/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Directive, ElementRef, Optional, inject, InjectionToken, Inject, Injector, } from '@angular/core'; import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgForm, FormGroupDirective, NgControl, Validators, } from '@angular/forms'; import { mixinErrorState, MAT_DATE_FORMATS, DateAdapter, ErrorStateMatcher, } from '@angular/material/core'; import { Directionality } from '@angular/cdk/bidi'; import { BACKSPACE, LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes'; import { MatDatepickerInputBase } from './datepicker-input-base'; import { DateRange } from './date-selection-model'; import { _computeAriaAccessibleName } from './aria-accessible-name'; import * as i0 from "@angular/core"; import * as i1 from "@angular/material/core"; import * as i2 from "@angular/forms"; /** * Used to provide the date range input wrapper component * to the parts without circular dependencies. */ export const MAT_DATE_RANGE_INPUT_PARENT = new InjectionToken('MAT_DATE_RANGE_INPUT_PARENT'); /** * Base class for the individual inputs that can be projected inside a `mat-date-range-input`. */ class MatDateRangeInputPartBase extends MatDatepickerInputBase { constructor(_rangeInput, _elementRef, _defaultErrorStateMatcher, _injector, _parentForm, _parentFormGroup, dateAdapter, dateFormats) { super(_elementRef, dateAdapter, dateFormats); this._rangeInput = _rangeInput; this._elementRef = _elementRef; this._defaultErrorStateMatcher = _defaultErrorStateMatcher; this._injector = _injector; this._parentForm = _parentForm; this._parentFormGroup = _parentFormGroup; this._dir = inject(Directionality, { optional: true }); } ngOnInit() { // We need the date input to provide itself as a `ControlValueAccessor` and a `Validator`, while // injecting its `NgControl` so that the error state is handled correctly. This introduces a // circular dependency, because both `ControlValueAccessor` and `Validator` depend on the input // itself. Usually we can work around it for the CVA, but there's no API to do it for the // validator. We work around it here by injecting the `NgControl` in `ngOnInit`, after // everything has been resolved. // tslint:disable-next-line:no-bitwise const ngControl = this._injector.get(NgControl, null, { optional: true, self: true }); if (ngControl) { this.ngControl = ngControl; } } ngDoCheck() { if (this.ngControl) { // We need to re-evaluate this on every change detection cycle, because there are some // error triggers that we can't subscribe to (e.g. parent form submissions). This means // that whatever logic is in here has to be super lean or we risk destroying the performance. this.updateErrorState(); } } /** Gets whether the input is empty. */ isEmpty() { return this._elementRef.nativeElement.value.length === 0; } /** Gets the placeholder of the input. */ _getPlaceholder() { return this._elementRef.nativeElement.placeholder; } /** Focuses the input. */ focus() { this._elementRef.nativeElement.focus(); } /** Gets the value that should be used when mirroring the input's size. */ getMirrorValue() { const element = this._elementRef.nativeElement; const value = element.value; return value.length > 0 ? value : element.placeholder; } /** Handles `input` events on the input element. */ _onInput(value) { super._onInput(value); this._rangeInput._handleChildValueChange(); } /** Opens the datepicker associated with the input. */ _openPopup() { this._rangeInput._openDatepicker(); } /** Gets the minimum date from the range input. */ _getMinDate() { return this._rangeInput.min; } /** Gets the maximum date from the range input. */ _getMaxDate() { return this._rangeInput.max; } /** Gets the date filter function from the range input. */ _getDateFilter() { return this._rangeInput.dateFilter; } _parentDisabled() { return this._rangeInput._groupDisabled; } _shouldHandleChangeEvent({ source }) { return source !== this._rangeInput._startInput && source !== this._rangeInput._endInput; } _assignValueProgrammatically(value) { super._assignValueProgrammatically(value); const opposite = (this === this._rangeInput._startInput ? this._rangeInput._endInput : this._rangeInput._startInput); opposite?._validatorOnChange(); } /** return the ARIA accessible name of the input element */ _getAccessibleName() { return _computeAriaAccessibleName(this._elementRef.nativeElement); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatDateRangeInputPartBase, deps: [{ token: MAT_DATE_RANGE_INPUT_PARENT }, { token: i0.ElementRef }, { token: i1.ErrorStateMatcher }, { token: i0.Injector }, { token: i2.NgForm, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatDateRangeInputPartBase, usesInheritance: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatDateRangeInputPartBase, decorators: [{ type: Directive }], ctorParameters: function () { return [{ type: undefined, decorators: [{ type: Inject, args: [MAT_DATE_RANGE_INPUT_PARENT] }] }, { type: i0.ElementRef }, { type: i1.ErrorStateMatcher }, { type: i0.Injector }, { type: i2.NgForm, decorators: [{ type: Optional }] }, { type: i2.FormGroupDirective, decorators: [{ type: Optional }] }, { type: i1.DateAdapter, decorators: [{ type: Optional }] }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DATE_FORMATS] }] }]; } }); const _MatDateRangeInputBase = mixinErrorState(MatDateRangeInputPartBase); /** Input for entering the start date in a `mat-date-range-input`. */ export class MatStartDate extends _MatDateRangeInputBase { constructor(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats) { super(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats); /** Validator that checks that the start date isn't after the end date. */ this._startValidator = (control) => { const start = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value)); const end = this._model ? this._model.selection.end : null; return !start || !end || this._dateAdapter.compareDate(start, end) <= 0 ? null : { 'matStartDateInvalid': { 'end': end, 'actual': start } }; }; this._validator = Validators.compose([...super._getValidators(), this._startValidator]); } _getValueFromModel(modelValue) { return modelValue.start; } _shouldHandleChangeEvent(change) { if (!super._shouldHandleChangeEvent(change)) { return false; } else { return !change.oldValue?.start ? !!change.selection.start : !change.selection.start || !!this._dateAdapter.compareDate(change.oldValue.start, change.selection.start); } } _assignValueToModel(value) { if (this._model) { const range = new DateRange(value, this._model.selection.end); this._model.updateSelection(range, this); } } _formatValue(value) { super._formatValue(value); // Any time the input value is reformatted we need to tell the parent. this._rangeInput._handleChildValueChange(); } _onKeydown(event) { const endInput = this._rangeInput._endInput; const element = this._elementRef.nativeElement; const isLtr = this._dir?.value !== 'rtl'; // If the user hits RIGHT (LTR) when at the end of the input (and no // selection), move the cursor to the start of the end input. if (((event.keyCode === RIGHT_ARROW && isLtr) || (event.keyCode === LEFT_ARROW && !isLtr)) && element.selectionStart === element.value.length && element.selectionEnd === element.value.length) { event.preventDefault(); endInput._elementRef.nativeElement.setSelectionRange(0, 0); endInput.focus(); } else { super._onKeydown(event); } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatStartDate, deps: [{ token: MAT_DATE_RANGE_INPUT_PARENT }, { token: i0.ElementRef }, { token: i1.ErrorStateMatcher }, { token: i0.Injector }, { token: i2.NgForm, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatStartDate, selector: "input[matStartDate]", inputs: { errorStateMatcher: "errorStateMatcher" }, outputs: { dateChange: "dateChange", dateInput: "dateInput" }, host: { attributes: { "type": "text" }, listeners: { "input": "_onInput($event.target.value)", "change": "_onChange()", "keydown": "_onKeydown($event)", "blur": "_onBlur()" }, properties: { "disabled": "disabled", "attr.aria-haspopup": "_rangeInput.rangePicker ? \"dialog\" : null", "attr.aria-owns": "(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null", "attr.min": "_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null", "attr.max": "_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null" }, classAttribute: "mat-start-date mat-date-range-input-inner" }, providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: MatStartDate, multi: true }, { provide: NG_VALIDATORS, useExisting: MatStartDate, multi: true }, ], usesInheritance: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatStartDate, decorators: [{ type: Directive, args: [{ selector: 'input[matStartDate]', host: { 'class': 'mat-start-date mat-date-range-input-inner', '[disabled]': 'disabled', '(input)': '_onInput($event.target.value)', '(change)': '_onChange()', '(keydown)': '_onKeydown($event)', '[attr.aria-haspopup]': '_rangeInput.rangePicker ? "dialog" : null', '[attr.aria-owns]': '(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null', '[attr.min]': '_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null', '[attr.max]': '_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null', '(blur)': '_onBlur()', 'type': 'text', }, providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: MatStartDate, multi: true }, { provide: NG_VALIDATORS, useExisting: MatStartDate, multi: true }, ], // These need to be specified explicitly, because some tooling doesn't // seem to pick them up from the base class. See #20932. outputs: ['dateChange', 'dateInput'], inputs: ['errorStateMatcher'], }] }], ctorParameters: function () { return [{ type: undefined, decorators: [{ type: Inject, args: [MAT_DATE_RANGE_INPUT_PARENT] }] }, { type: i0.ElementRef }, { type: i1.ErrorStateMatcher }, { type: i0.Injector }, { type: i2.NgForm, decorators: [{ type: Optional }] }, { type: i2.FormGroupDirective, decorators: [{ type: Optional }] }, { type: i1.DateAdapter, decorators: [{ type: Optional }] }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DATE_FORMATS] }] }]; } }); /** Input for entering the end date in a `mat-date-range-input`. */ export class MatEndDate extends _MatDateRangeInputBase { constructor(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats) { super(rangeInput, elementRef, defaultErrorStateMatcher, injector, parentForm, parentFormGroup, dateAdapter, dateFormats); /** Validator that checks that the end date isn't before the start date. */ this._endValidator = (control) => { const end = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value)); const start = this._model ? this._model.selection.start : null; return !end || !start || this._dateAdapter.compareDate(end, start) >= 0 ? null : { 'matEndDateInvalid': { 'start': start, 'actual': end } }; }; this._validator = Validators.compose([...super._getValidators(), this._endValidator]); } _getValueFromModel(modelValue) { return modelValue.end; } _shouldHandleChangeEvent(change) { if (!super._shouldHandleChangeEvent(change)) { return false; } else { return !change.oldValue?.end ? !!change.selection.end : !change.selection.end || !!this._dateAdapter.compareDate(change.oldValue.end, change.selection.end); } } _assignValueToModel(value) { if (this._model) { const range = new DateRange(this._model.selection.start, value); this._model.updateSelection(range, this); } } _onKeydown(event) { const startInput = this._rangeInput._startInput; const element = this._elementRef.nativeElement; const isLtr = this._dir?.value !== 'rtl'; // If the user is pressing backspace on an empty end input, move focus back to the start. if (event.keyCode === BACKSPACE && !element.value) { startInput.focus(); } // If the user hits LEFT (LTR) when at the start of the input (and no // selection), move the cursor to the end of the start input. else if (((event.keyCode === LEFT_ARROW && isLtr) || (event.keyCode === RIGHT_ARROW && !isLtr)) && element.selectionStart === 0 && element.selectionEnd === 0) { event.preventDefault(); const endPosition = startInput._elementRef.nativeElement.value.length; startInput._elementRef.nativeElement.setSelectionRange(endPosition, endPosition); startInput.focus(); } else { super._onKeydown(event); } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatEndDate, deps: [{ token: MAT_DATE_RANGE_INPUT_PARENT }, { token: i0.ElementRef }, { token: i1.ErrorStateMatcher }, { token: i0.Injector }, { token: i2.NgForm, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: i1.DateAdapter, optional: true }, { token: MAT_DATE_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatEndDate, selector: "input[matEndDate]", inputs: { errorStateMatcher: "errorStateMatcher" }, outputs: { dateChange: "dateChange", dateInput: "dateInput" }, host: { attributes: { "type": "text" }, listeners: { "input": "_onInput($event.target.value)", "change": "_onChange()", "keydown": "_onKeydown($event)", "blur": "_onBlur()" }, properties: { "disabled": "disabled", "attr.aria-haspopup": "_rangeInput.rangePicker ? \"dialog\" : null", "attr.aria-owns": "(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null", "attr.min": "_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null", "attr.max": "_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null" }, classAttribute: "mat-end-date mat-date-range-input-inner" }, providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: MatEndDate, multi: true }, { provide: NG_VALIDATORS, useExisting: MatEndDate, multi: true }, ], usesInheritance: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatEndDate, decorators: [{ type: Directive, args: [{ selector: 'input[matEndDate]', host: { 'class': 'mat-end-date mat-date-range-input-inner', '[disabled]': 'disabled', '(input)': '_onInput($event.target.value)', '(change)': '_onChange()', '(keydown)': '_onKeydown($event)', '[attr.aria-haspopup]': '_rangeInput.rangePicker ? "dialog" : null', '[attr.aria-owns]': '(_rangeInput.rangePicker?.opened && _rangeInput.rangePicker.id) || null', '[attr.min]': '_getMinDate() ? _dateAdapter.toIso8601(_getMinDate()) : null', '[attr.max]': '_getMaxDate() ? _dateAdapter.toIso8601(_getMaxDate()) : null', '(blur)': '_onBlur()', 'type': 'text', }, providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: MatEndDate, multi: true }, { provide: NG_VALIDATORS, useExisting: MatEndDate, multi: true }, ], // These need to be specified explicitly, because some tooling doesn't // seem to pick them up from the base class. See #20932. outputs: ['dateChange', 'dateInput'], inputs: ['errorStateMatcher'], }] }], ctorParameters: function () { return [{ type: undefined, decorators: [{ type: Inject, args: [MAT_DATE_RANGE_INPUT_PARENT] }] }, { type: i0.ElementRef }, { type: i1.ErrorStateMatcher }, { type: i0.Injector }, { type: i2.NgForm, decorators: [{ type: Optional }] }, { type: i2.FormGroupDirective, decorators: [{ type: Optional }] }, { type: i1.DateAdapter, decorators: [{ type: Optional }] }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DATE_FORMATS] }] }]; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS1yYW5nZS1pbnB1dC1wYXJ0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYXRlcmlhbC9kYXRlcGlja2VyL2RhdGUtcmFuZ2UtaW5wdXQtcGFydHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUNMLFNBQVMsRUFDVCxVQUFVLEVBQ1YsUUFBUSxFQUNSLE1BQU0sRUFDTixjQUFjLEVBQ2QsTUFBTSxFQUVOLFFBQVEsR0FFVCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQ0wsaUJBQWlCLEVBQ2pCLGFBQWEsRUFDYixNQUFNLEVBQ04sa0JBQWtCLEVBQ2xCLFNBQVMsRUFFVCxVQUFVLEdBR1gsTUFBTSxnQkFBZ0IsQ0FBQztBQUN4QixPQUFPLEVBRUwsZUFBZSxFQUNmLGdCQUFnQixFQUNoQixXQUFXLEVBRVgsaUJBQWlCLEdBQ2xCLE1BQU0sd0JBQXdCLENBQUM7QUFDaEMsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLG1CQUFtQixDQUFDO0FBQ2pELE9BQU8sRUFBQyxTQUFTLEVBQUUsVUFBVSxFQUFFLFdBQVcsRUFBQyxNQUFNLHVCQUF1QixDQUFDO0FBQ3pFLE9BQU8sRUFBQyxzQkFBc0IsRUFBZSxNQUFNLHlCQUF5QixDQUFDO0FBQzdFLE9BQU8sRUFBQyxTQUFTLEVBQTJCLE1BQU0sd0JBQXdCLENBQUM7QUFDM0UsT0FBTyxFQUFDLDBCQUEwQixFQUFDLE1BQU0sd0JBQXdCLENBQUM7Ozs7Q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