[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 { Directive, ElementRef, Optional, InjectionToken, Inject, Injector, InjectFlags, } from '@angular/core';
|
---|
| 9 | import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgForm, FormGroupDirective, NgControl, Validators, } from '@angular/forms';
|
---|
| 10 | import { mixinErrorState, MAT_DATE_FORMATS, DateAdapter, ErrorStateMatcher, } from '@angular/material/core';
|
---|
| 11 | import { BACKSPACE } from '@angular/cdk/keycodes';
|
---|
| 12 | import { MatDatepickerInputBase } from './datepicker-input-base';
|
---|
| 13 | import { DateRange } from './date-selection-model';
|
---|
| 14 | /**
|
---|
| 15 | * Used to provide the date range input wrapper component
|
---|
| 16 | * to the parts without circular dependencies.
|
---|
| 17 | */
|
---|
| 18 | export const MAT_DATE_RANGE_INPUT_PARENT = new InjectionToken('MAT_DATE_RANGE_INPUT_PARENT');
|
---|
| 19 | /**
|
---|
| 20 | * Base class for the individual inputs that can be projected inside a `mat-date-range-input`.
|
---|
| 21 | */
|
---|
| 22 | class MatDateRangeInputPartBase extends MatDatepickerInputBase {
|
---|
| 23 | constructor(_rangeInput, elementRef, _defaultErrorStateMatcher, _injector, _parentForm, _parentFormGroup, dateAdapter, dateFormats) {
|
---|
| 24 | super(elementRef, dateAdapter, dateFormats);
|
---|
| 25 | this._rangeInput = _rangeInput;
|
---|
| 26 | this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
|
---|
| 27 | this._injector = _injector;
|
---|
| 28 | this._parentForm = _parentForm;
|
---|
| 29 | this._parentFormGroup = _parentFormGroup;
|
---|
| 30 | }
|
---|
| 31 | ngOnInit() {
|
---|
| 32 | // We need the date input to provide itself as a `ControlValueAccessor` and a `Validator`, while
|
---|
| 33 | // injecting its `NgControl` so that the error state is handled correctly. This introduces a
|
---|
| 34 | // circular dependency, because both `ControlValueAccessor` and `Validator` depend on the input
|
---|
| 35 | // itself. Usually we can work around it for the CVA, but there's no API to do it for the
|
---|
| 36 | // validator. We work around it here by injecting the `NgControl` in `ngOnInit`, after
|
---|
| 37 | // everything has been resolved.
|
---|
| 38 | // tslint:disable-next-line:no-bitwise
|
---|
| 39 | const ngControl = this._injector.get(NgControl, null, InjectFlags.Self | InjectFlags.Optional);
|
---|
| 40 | if (ngControl) {
|
---|
| 41 | this.ngControl = ngControl;
|
---|
| 42 | }
|
---|
| 43 | }
|
---|
| 44 | ngDoCheck() {
|
---|
| 45 | if (this.ngControl) {
|
---|
| 46 | // We need to re-evaluate this on every change detection cycle, because there are some
|
---|
| 47 | // error triggers that we can't subscribe to (e.g. parent form submissions). This means
|
---|
| 48 | // that whatever logic is in here has to be super lean or we risk destroying the performance.
|
---|
| 49 | this.updateErrorState();
|
---|
| 50 | }
|
---|
| 51 | }
|
---|
| 52 | /** Gets whether the input is empty. */
|
---|
| 53 | isEmpty() {
|
---|
| 54 | return this._elementRef.nativeElement.value.length === 0;
|
---|
| 55 | }
|
---|
| 56 | /** Gets the placeholder of the input. */
|
---|
| 57 | _getPlaceholder() {
|
---|
| 58 | return this._elementRef.nativeElement.placeholder;
|
---|
| 59 | }
|
---|
| 60 | /** Focuses the input. */
|
---|
| 61 | focus() {
|
---|
| 62 | this._elementRef.nativeElement.focus();
|
---|
| 63 | }
|
---|
| 64 | /** Handles `input` events on the input element. */
|
---|
| 65 | _onInput(value) {
|
---|
| 66 | super._onInput(value);
|
---|
| 67 | this._rangeInput._handleChildValueChange();
|
---|
| 68 | }
|
---|
| 69 | /** Opens the datepicker associated with the input. */
|
---|
| 70 | _openPopup() {
|
---|
| 71 | this._rangeInput._openDatepicker();
|
---|
| 72 | }
|
---|
| 73 | /** Gets the minimum date from the range input. */
|
---|
| 74 | _getMinDate() {
|
---|
| 75 | return this._rangeInput.min;
|
---|
| 76 | }
|
---|
| 77 | /** Gets the maximum date from the range input. */
|
---|
| 78 | _getMaxDate() {
|
---|
| 79 | return this._rangeInput.max;
|
---|
| 80 | }
|
---|
| 81 | /** Gets the date filter function from the range input. */
|
---|
| 82 | _getDateFilter() {
|
---|
| 83 | return this._rangeInput.dateFilter;
|
---|
| 84 | }
|
---|
| 85 | _parentDisabled() {
|
---|
| 86 | return this._rangeInput._groupDisabled;
|
---|
| 87 | }
|
---|
| 88 | _shouldHandleChangeEvent({ source }) {
|
---|
| 89 | return source !== this._rangeInput._startInput && source !== this._rangeInput._endInput;
|
---|
| 90 | }
|
---|
| 91 | _assignValueProgrammatically(value) {
|
---|
| 92 | super._assignValueProgrammatically(value);
|
---|
| 93 | const opposite = (this === this._rangeInput._startInput ? this._rangeInput._endInput :
|
---|
| 94 | this._rangeInput._startInput);
|
---|
| 95 | opposite === null || opposite === void 0 ? void 0 : opposite._validatorOnChange();
|
---|
| 96 | }
|
---|
| 97 | }
|
---|
| 98 | MatDateRangeInputPartBase.decorators = [
|
---|
| 99 | { type: Directive }
|
---|
| 100 | ];
|
---|
| 101 | MatDateRangeInputPartBase.ctorParameters = () => [
|
---|
| 102 | { type: undefined, decorators: [{ type: Inject, args: [MAT_DATE_RANGE_INPUT_PARENT,] }] },
|
---|
| 103 | { type: ElementRef },
|
---|
| 104 | { type: ErrorStateMatcher },
|
---|
| 105 | { type: Injector },
|
---|
| 106 | { type: NgForm, decorators: [{ type: Optional }] },
|
---|
| 107 | { type: FormGroupDirective, decorators: [{ type: Optional }] },
|
---|
| 108 | { type: DateAdapter, decorators: [{ type: Optional }] },
|
---|
| 109 | { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DATE_FORMATS,] }] }
|
---|
| 110 | ];
|
---|
| 111 | const _MatDateRangeInputBase = mixinErrorState(MatDateRangeInputPartBase);
|
---|
| 112 | /** Input for entering the start date in a `mat-date-range-input`. */
|
---|
| 113 | export class MatStartDate extends _MatDateRangeInputBase {
|
---|
| 114 | constructor(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats) {
|
---|
| 115 | // TODO(crisbeto): this constructor shouldn't be necessary, but ViewEngine doesn't seem to
|
---|
| 116 | // handle DI correctly when it is inherited from `MatDateRangeInputPartBase`. We can drop this
|
---|
| 117 | // constructor once ViewEngine is removed.
|
---|
| 118 | super(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats);
|
---|
| 119 | /** Validator that checks that the start date isn't after the end date. */
|
---|
| 120 | this._startValidator = (control) => {
|
---|
| 121 | const start = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
|
---|
| 122 | const end = this._model ? this._model.selection.end : null;
|
---|
| 123 | return (!start || !end ||
|
---|
| 124 | this._dateAdapter.compareDate(start, end) <= 0) ?
|
---|
| 125 | null : { 'matStartDateInvalid': { 'end': end, 'actual': start } };
|
---|
| 126 | };
|
---|
| 127 | this._validator = Validators.compose([...super._getValidators(), this._startValidator]);
|
---|
| 128 | }
|
---|
| 129 | ngOnInit() {
|
---|
| 130 | // Normally this happens automatically, but it seems to break if not added explicitly when all
|
---|
| 131 | // of the criteria below are met:
|
---|
| 132 | // 1) The class extends a TS mixin.
|
---|
| 133 | // 2) The application is running in ViewEngine.
|
---|
| 134 | // 3) The application is being transpiled through tsickle.
|
---|
| 135 | // This can be removed once google3 is completely migrated to Ivy.
|
---|
| 136 | super.ngOnInit();
|
---|
| 137 | }
|
---|
| 138 | ngDoCheck() {
|
---|
| 139 | // Normally this happens automatically, but it seems to break if not added explicitly when all
|
---|
| 140 | // of the criteria below are met:
|
---|
| 141 | // 1) The class extends a TS mixin.
|
---|
| 142 | // 2) The application is running in ViewEngine.
|
---|
| 143 | // 3) The application is being transpiled through tsickle.
|
---|
| 144 | // This can be removed once google3 is completely migrated to Ivy.
|
---|
| 145 | super.ngDoCheck();
|
---|
| 146 | }
|
---|
| 147 | _getValueFromModel(modelValue) {
|
---|
| 148 | return modelValue.start;
|
---|
| 149 | }
|
---|
| 150 | _shouldHandleChangeEvent(change) {
|
---|
| 151 | var _a;
|
---|
| 152 | if (!super._shouldHandleChangeEvent(change)) {
|
---|
| 153 | return false;
|
---|
| 154 | }
|
---|
| 155 | else {
|
---|
| 156 | return !((_a = change.oldValue) === null || _a === void 0 ? void 0 : _a.start) ? !!change.selection.start :
|
---|
| 157 | !change.selection.start ||
|
---|
| 158 | !!this._dateAdapter.compareDate(change.oldValue.start, change.selection.start);
|
---|
| 159 | }
|
---|
| 160 | }
|
---|
| 161 | _assignValueToModel(value) {
|
---|
| 162 | if (this._model) {
|
---|
| 163 | const range = new DateRange(value, this._model.selection.end);
|
---|
| 164 | this._model.updateSelection(range, this);
|
---|
| 165 | }
|
---|
| 166 | }
|
---|
| 167 | _formatValue(value) {
|
---|
| 168 | super._formatValue(value);
|
---|
| 169 | // Any time the input value is reformatted we need to tell the parent.
|
---|
| 170 | this._rangeInput._handleChildValueChange();
|
---|
| 171 | }
|
---|
| 172 | /** Gets the value that should be used when mirroring the input's size. */
|
---|
| 173 | getMirrorValue() {
|
---|
| 174 | const element = this._elementRef.nativeElement;
|
---|
| 175 | const value = element.value;
|
---|
| 176 | return value.length > 0 ? value : element.placeholder;
|
---|
| 177 | }
|
---|
| 178 | }
|
---|
| 179 | MatStartDate.decorators = [
|
---|
| 180 | { type: Directive, args: [{
|
---|
| 181 | selector: 'input[matStartDate]',
|
---|
| 182 | host: {
|
---|
| 183 | 'class': 'mat-start-date mat-date-range-input-inner',
|
---|
| 184 | '[disabled]': 'disabled',
|
---|
| 185 | '(input)': '_onInput($event.target.value)',
|
---|
| 186 | '(change)': '_onChange()',
|
---|
| 187 | '(keydown)': '_onKeydown($event)',
|
---|
| 188 | '[attr.id]': '_rangeInput.id',
|
---|
| 189 | '[attr.aria-haspopup]': '_rangeInput.rangePicker ? "dialog" : null',
|
---|
| 190 | '[attr.aria-owns]': '(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null',
|
---|
| 191 | '[attr.min]': '_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null',
|
---|
| 192 | '[attr.max]': '_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null',
|
---|
| 193 | '(blur)': '_onBlur()',
|
---|
| 194 | 'type': 'text',
|
---|
| 195 | },
|
---|
| 196 | providers: [
|
---|
| 197 | { provide: NG_VALUE_ACCESSOR, useExisting: MatStartDate, multi: true },
|
---|
| 198 | { provide: NG_VALIDATORS, useExisting: MatStartDate, multi: true }
|
---|
| 199 | ],
|
---|
| 200 | // These need to be specified explicitly, because some tooling doesn't
|
---|
| 201 | // seem to pick them up from the base class. See #20932.
|
---|
| 202 | outputs: ['dateChange', 'dateInput'],
|
---|
| 203 | inputs: ['errorStateMatcher']
|
---|
| 204 | },] }
|
---|
| 205 | ];
|
---|
| 206 | MatStartDate.ctorParameters = () => [
|
---|
| 207 | { type: undefined, decorators: [{ type: Inject, args: [MAT_DATE_RANGE_INPUT_PARENT,] }] },
|
---|
| 208 | { type: ElementRef },
|
---|
| 209 | { type: ErrorStateMatcher },
|
---|
| 210 | { type: Injector },
|
---|
| 211 | { type: NgForm, decorators: [{ type: Optional }] },
|
---|
| 212 | { type: FormGroupDirective, decorators: [{ type: Optional }] },
|
---|
| 213 | { type: DateAdapter, decorators: [{ type: Optional }] },
|
---|
| 214 | { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DATE_FORMATS,] }] }
|
---|
| 215 | ];
|
---|
| 216 | /** Input for entering the end date in a `mat-date-range-input`. */
|
---|
| 217 | export class MatEndDate extends _MatDateRangeInputBase {
|
---|
| 218 | constructor(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats) {
|
---|
| 219 | // TODO(crisbeto): this constructor shouldn't be necessary, but ViewEngine doesn't seem to
|
---|
| 220 | // handle DI correctly when it is inherited from `MatDateRangeInputPartBase`. We can drop this
|
---|
| 221 | // constructor once ViewEngine is removed.
|
---|
| 222 | super(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats);
|
---|
| 223 | /** Validator that checks that the end date isn't before the start date. */
|
---|
| 224 | this._endValidator = (control) => {
|
---|
| 225 | const end = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
|
---|
| 226 | const start = this._model ? this._model.selection.start : null;
|
---|
| 227 | return (!end || !start ||
|
---|
| 228 | this._dateAdapter.compareDate(end, start) >= 0) ?
|
---|
| 229 | null : { 'matEndDateInvalid': { 'start': start, 'actual': end } };
|
---|
| 230 | };
|
---|
| 231 | this._validator = Validators.compose([...super._getValidators(), this._endValidator]);
|
---|
| 232 | }
|
---|
| 233 | ngOnInit() {
|
---|
| 234 | // Normally this happens automatically, but it seems to break if not added explicitly when all
|
---|
| 235 | // of the criteria below are met:
|
---|
| 236 | // 1) The class extends a TS mixin.
|
---|
| 237 | // 2) The application is running in ViewEngine.
|
---|
| 238 | // 3) The application is being transpiled through tsickle.
|
---|
| 239 | // This can be removed once google3 is completely migrated to Ivy.
|
---|
| 240 | super.ngOnInit();
|
---|
| 241 | }
|
---|
| 242 | ngDoCheck() {
|
---|
| 243 | // Normally this happens automatically, but it seems to break if not added explicitly when all
|
---|
| 244 | // of the criteria below are met:
|
---|
| 245 | // 1) The class extends a TS mixin.
|
---|
| 246 | // 2) The application is running in ViewEngine.
|
---|
| 247 | // 3) The application is being transpiled through tsickle.
|
---|
| 248 | // This can be removed once google3 is completely migrated to Ivy.
|
---|
| 249 | super.ngDoCheck();
|
---|
| 250 | }
|
---|
| 251 | _getValueFromModel(modelValue) {
|
---|
| 252 | return modelValue.end;
|
---|
| 253 | }
|
---|
| 254 | _shouldHandleChangeEvent(change) {
|
---|
| 255 | var _a;
|
---|
| 256 | if (!super._shouldHandleChangeEvent(change)) {
|
---|
| 257 | return false;
|
---|
| 258 | }
|
---|
| 259 | else {
|
---|
| 260 | return !((_a = change.oldValue) === null || _a === void 0 ? void 0 : _a.end) ? !!change.selection.end :
|
---|
| 261 | !change.selection.end ||
|
---|
| 262 | !!this._dateAdapter.compareDate(change.oldValue.end, change.selection.end);
|
---|
| 263 | }
|
---|
| 264 | }
|
---|
| 265 | _assignValueToModel(value) {
|
---|
| 266 | if (this._model) {
|
---|
| 267 | const range = new DateRange(this._model.selection.start, value);
|
---|
| 268 | this._model.updateSelection(range, this);
|
---|
| 269 | }
|
---|
| 270 | }
|
---|
| 271 | _onKeydown(event) {
|
---|
| 272 | // If the user is pressing backspace on an empty end input, move focus back to the start.
|
---|
| 273 | if (event.keyCode === BACKSPACE && !this._elementRef.nativeElement.value) {
|
---|
| 274 | this._rangeInput._startInput.focus();
|
---|
| 275 | }
|
---|
| 276 | super._onKeydown(event);
|
---|
| 277 | }
|
---|
| 278 | }
|
---|
| 279 | MatEndDate.decorators = [
|
---|
| 280 | { type: Directive, args: [{
|
---|
| 281 | selector: 'input[matEndDate]',
|
---|
| 282 | host: {
|
---|
| 283 | 'class': 'mat-end-date mat-date-range-input-inner',
|
---|
| 284 | '[disabled]': 'disabled',
|
---|
| 285 | '(input)': '_onInput($event.target.value)',
|
---|
| 286 | '(change)': '_onChange()',
|
---|
| 287 | '(keydown)': '_onKeydown($event)',
|
---|
| 288 | '[attr.aria-haspopup]': '_rangeInput.rangePicker ? "dialog" : null',
|
---|
| 289 | '[attr.aria-owns]': '(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null',
|
---|
| 290 | '[attr.min]': '_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null',
|
---|
| 291 | '[attr.max]': '_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null',
|
---|
| 292 | '(blur)': '_onBlur()',
|
---|
| 293 | 'type': 'text',
|
---|
| 294 | },
|
---|
| 295 | providers: [
|
---|
| 296 | { provide: NG_VALUE_ACCESSOR, useExisting: MatEndDate, multi: true },
|
---|
| 297 | { provide: NG_VALIDATORS, useExisting: MatEndDate, multi: true }
|
---|
| 298 | ],
|
---|
| 299 | // These need to be specified explicitly, because some tooling doesn't
|
---|
| 300 | // seem to pick them up from the base class. See #20932.
|
---|
| 301 | outputs: ['dateChange', 'dateInput'],
|
---|
| 302 | inputs: ['errorStateMatcher']
|
---|
| 303 | },] }
|
---|
| 304 | ];
|
---|
| 305 | MatEndDate.ctorParameters = () => [
|
---|
| 306 | { type: undefined, decorators: [{ type: Inject, args: [MAT_DATE_RANGE_INPUT_PARENT,] }] },
|
---|
| 307 | { type: ElementRef },
|
---|
| 308 | { type: ErrorStateMatcher },
|
---|
| 309 | { type: Injector },
|
---|
| 310 | { type: NgForm, decorators: [{ type: Optional }] },
|
---|
| 311 | { type: FormGroupDirective, decorators: [{ type: Optional }] },
|
---|
| 312 | { type: DateAdapter, decorators: [{ type: Optional }] },
|
---|
| 313 | { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DATE_FORMATS,] }] }
|
---|
| 314 | ];
|
---|
| 315 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS1yYW5nZS1pbnB1dC1wYXJ0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYXRlcmlhbC9kYXRlcGlja2VyL2RhdGUtcmFuZ2UtaW5wdXQtcGFydHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUNMLFNBQVMsRUFDVCxVQUFVLEVBQ1YsUUFBUSxFQUNSLGNBQWMsRUFDZCxNQUFNLEVBRU4sUUFBUSxFQUNSLFdBQVcsR0FFWixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQ0wsaUJBQWlCLEVBQ2pCLGFBQWEsRUFDYixNQUFNLEVBQ04sa0JBQWtCLEVBQ2xCLFNBQVMsRUFFVCxVQUFVLEdBR1gsTUFBTSxnQkFBZ0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