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 { Directionality } from '@angular/cdk/bidi';
|
---|
9 | import { coerceBooleanProperty, coerceStringArray } from '@angular/cdk/coercion';
|
---|
10 | import { ESCAPE, hasModifierKey, UP_ARROW } from '@angular/cdk/keycodes';
|
---|
11 | import { Overlay, OverlayConfig, FlexibleConnectedPositionStrategy, } from '@angular/cdk/overlay';
|
---|
12 | import { ComponentPortal } from '@angular/cdk/portal';
|
---|
13 | import { DOCUMENT } from '@angular/common';
|
---|
14 | import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Inject, InjectionToken, Input, NgZone, Optional, Output, ViewChild, ViewContainerRef, ViewEncapsulation, ChangeDetectorRef, Directive, } from '@angular/core';
|
---|
15 | import { DateAdapter, mixinColor, } from '@angular/material/core';
|
---|
16 | import { merge, Subject, Subscription } from 'rxjs';
|
---|
17 | import { filter, take } from 'rxjs/operators';
|
---|
18 | import { _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
|
---|
19 | import { MatCalendar } from './calendar';
|
---|
20 | import { matDatepickerAnimations } from './datepicker-animations';
|
---|
21 | import { createMissingDateImplError } from './datepicker-errors';
|
---|
22 | import { MatDateSelectionModel, DateRange, } from './date-selection-model';
|
---|
23 | import { MAT_DATE_RANGE_SELECTION_STRATEGY, } from './date-range-selection-strategy';
|
---|
24 | import { MatDatepickerIntl } from './datepicker-intl';
|
---|
25 | /** Used to generate a unique ID for each datepicker instance. */
|
---|
26 | let datepickerUid = 0;
|
---|
27 | /** Injection token that determines the scroll handling while the calendar is open. */
|
---|
28 | export const MAT_DATEPICKER_SCROLL_STRATEGY = new InjectionToken('mat-datepicker-scroll-strategy');
|
---|
29 | /** @docs-private */
|
---|
30 | export function MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
|
---|
31 | return () => overlay.scrollStrategies.reposition();
|
---|
32 | }
|
---|
33 | /** @docs-private */
|
---|
34 | export const MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
|
---|
35 | provide: MAT_DATEPICKER_SCROLL_STRATEGY,
|
---|
36 | deps: [Overlay],
|
---|
37 | useFactory: MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY,
|
---|
38 | };
|
---|
39 | // Boilerplate for applying mixins to MatDatepickerContent.
|
---|
40 | /** @docs-private */
|
---|
41 | const _MatDatepickerContentBase = mixinColor(class {
|
---|
42 | constructor(_elementRef) {
|
---|
43 | this._elementRef = _elementRef;
|
---|
44 | }
|
---|
45 | });
|
---|
46 | /**
|
---|
47 | * Component used as the content for the datepicker overlay. We use this instead of using
|
---|
48 | * MatCalendar directly as the content so we can control the initial focus. This also gives us a
|
---|
49 | * place to put additional features of the overlay that are not part of the calendar itself in the
|
---|
50 | * future. (e.g. confirmation buttons).
|
---|
51 | * @docs-private
|
---|
52 | */
|
---|
53 | export class MatDatepickerContent extends _MatDatepickerContentBase {
|
---|
54 | constructor(elementRef, _changeDetectorRef, _globalModel, _dateAdapter, _rangeSelectionStrategy, intl) {
|
---|
55 | super(elementRef);
|
---|
56 | this._changeDetectorRef = _changeDetectorRef;
|
---|
57 | this._globalModel = _globalModel;
|
---|
58 | this._dateAdapter = _dateAdapter;
|
---|
59 | this._rangeSelectionStrategy = _rangeSelectionStrategy;
|
---|
60 | this._subscriptions = new Subscription();
|
---|
61 | /** Emits when an animation has finished. */
|
---|
62 | this._animationDone = new Subject();
|
---|
63 | /** Portal with projected action buttons. */
|
---|
64 | this._actionsPortal = null;
|
---|
65 | this._closeButtonText = intl.closeCalendarLabel;
|
---|
66 | }
|
---|
67 | ngOnInit() {
|
---|
68 | // If we have actions, clone the model so that we have the ability to cancel the selection,
|
---|
69 | // otherwise update the global model directly. Note that we want to assign this as soon as
|
---|
70 | // possible, but `_actionsPortal` isn't available in the constructor so we do it in `ngOnInit`.
|
---|
71 | this._model = this._actionsPortal ? this._globalModel.clone() : this._globalModel;
|
---|
72 | this._animationState = this.datepicker.touchUi ? 'enter-dialog' : 'enter-dropdown';
|
---|
73 | }
|
---|
74 | ngAfterViewInit() {
|
---|
75 | this._subscriptions.add(this.datepicker.stateChanges.subscribe(() => {
|
---|
76 | this._changeDetectorRef.markForCheck();
|
---|
77 | }));
|
---|
78 | this._calendar.focusActiveCell();
|
---|
79 | }
|
---|
80 | ngOnDestroy() {
|
---|
81 | this._subscriptions.unsubscribe();
|
---|
82 | this._animationDone.complete();
|
---|
83 | }
|
---|
84 | _handleUserSelection(event) {
|
---|
85 | const selection = this._model.selection;
|
---|
86 | const value = event.value;
|
---|
87 | const isRange = selection instanceof DateRange;
|
---|
88 | // If we're selecting a range and we have a selection strategy, always pass the value through
|
---|
89 | // there. Otherwise don't assign null values to the model, unless we're selecting a range.
|
---|
90 | // A null value when picking a range means that the user cancelled the selection (e.g. by
|
---|
91 | // pressing escape), whereas when selecting a single value it means that the value didn't
|
---|
92 | // change. This isn't very intuitive, but it's here for backwards-compatibility.
|
---|
93 | if (isRange && this._rangeSelectionStrategy) {
|
---|
94 | const newSelection = this._rangeSelectionStrategy.selectionFinished(value, selection, event.event);
|
---|
95 | this._model.updateSelection(newSelection, this);
|
---|
96 | }
|
---|
97 | else if (value && (isRange ||
|
---|
98 | !this._dateAdapter.sameDate(value, selection))) {
|
---|
99 | this._model.add(value);
|
---|
100 | }
|
---|
101 | // Delegate closing the overlay to the actions.
|
---|
102 | if ((!this._model || this._model.isComplete()) && !this._actionsPortal) {
|
---|
103 | this.datepicker.close();
|
---|
104 | }
|
---|
105 | }
|
---|
106 | _startExitAnimation() {
|
---|
107 | this._animationState = 'void';
|
---|
108 | this._changeDetectorRef.markForCheck();
|
---|
109 | }
|
---|
110 | _getSelected() {
|
---|
111 | return this._model.selection;
|
---|
112 | }
|
---|
113 | /** Applies the current pending selection to the global model. */
|
---|
114 | _applyPendingSelection() {
|
---|
115 | if (this._model !== this._globalModel) {
|
---|
116 | this._globalModel.updateSelection(this._model.selection, this);
|
---|
117 | }
|
---|
118 | }
|
---|
119 | }
|
---|
120 | MatDatepickerContent.decorators = [
|
---|
121 | { type: Component, args: [{
|
---|
122 | selector: 'mat-datepicker-content',
|
---|
123 | template: "<div\n cdkTrapFocus\n class=\"mat-datepicker-content-container\"\n [class.mat-datepicker-content-container-with-actions]=\"_actionsPortal\">\n <mat-calendar\n [id]=\"datepicker.id\"\n [ngClass]=\"datepicker.panelClass\"\n [startAt]=\"datepicker.startAt\"\n [startView]=\"datepicker.startView\"\n [minDate]=\"datepicker._getMinDate()\"\n [maxDate]=\"datepicker._getMaxDate()\"\n [dateFilter]=\"datepicker._getDateFilter()\"\n [headerComponent]=\"datepicker.calendarHeaderComponent\"\n [selected]=\"_getSelected()\"\n [dateClass]=\"datepicker.dateClass\"\n [comparisonStart]=\"comparisonStart\"\n [comparisonEnd]=\"comparisonEnd\"\n [@fadeInCalendar]=\"'enter'\"\n (yearSelected)=\"datepicker._selectYear($event)\"\n (monthSelected)=\"datepicker._selectMonth($event)\"\n (viewChanged)=\"datepicker._viewChanged($event)\"\n (_userSelection)=\"_handleUserSelection($event)\"></mat-calendar>\n\n <ng-template [cdkPortalOutlet]=\"_actionsPortal\"></ng-template>\n\n <!-- Invisible close button for screen reader users. -->\n <button\n type=\"button\"\n mat-raised-button\n [color]=\"color || 'primary'\"\n class=\"mat-datepicker-close-button\"\n [class.cdk-visually-hidden]=\"!_closeButtonFocused\"\n (focus)=\"_closeButtonFocused = true\"\n (blur)=\"_closeButtonFocused = false\"\n (click)=\"datepicker.close()\">{{ _closeButtonText }}</button>\n</div>\n",
|
---|
124 | host: {
|
---|
125 | 'class': 'mat-datepicker-content',
|
---|
126 | '[@transformPanel]': '_animationState',
|
---|
127 | '(@transformPanel.done)': '_animationDone.next()',
|
---|
128 | '[class.mat-datepicker-content-touch]': 'datepicker.touchUi',
|
---|
129 | },
|
---|
130 | animations: [
|
---|
131 | matDatepickerAnimations.transformPanel,
|
---|
132 | matDatepickerAnimations.fadeInCalendar,
|
---|
133 | ],
|
---|
134 | exportAs: 'matDatepickerContent',
|
---|
135 | encapsulation: ViewEncapsulation.None,
|
---|
136 | changeDetection: ChangeDetectionStrategy.OnPush,
|
---|
137 | inputs: ['color'],
|
---|
138 | styles: [".mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mat-datepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:788px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\n"]
|
---|
139 | },] }
|
---|
140 | ];
|
---|
141 | MatDatepickerContent.ctorParameters = () => [
|
---|
142 | { type: ElementRef },
|
---|
143 | { type: ChangeDetectorRef },
|
---|
144 | { type: MatDateSelectionModel },
|
---|
145 | { type: DateAdapter },
|
---|
146 | { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DATE_RANGE_SELECTION_STRATEGY,] }] },
|
---|
147 | { type: MatDatepickerIntl }
|
---|
148 | ];
|
---|
149 | MatDatepickerContent.propDecorators = {
|
---|
150 | _calendar: [{ type: ViewChild, args: [MatCalendar,] }]
|
---|
151 | };
|
---|
152 | /** Base class for a datepicker. */
|
---|
153 | export class MatDatepickerBase {
|
---|
154 | constructor(
|
---|
155 | /**
|
---|
156 | * @deprecated `_dialog` parameter is no longer being used and it will be removed.
|
---|
157 | * @breaking-change 13.0.0
|
---|
158 | */
|
---|
159 | _dialog, _overlay, _ngZone, _viewContainerRef, scrollStrategy, _dateAdapter, _dir,
|
---|
160 | /**
|
---|
161 | * @deprecated No longer being used. To be removed.
|
---|
162 | * @breaking-change 13.0.0
|
---|
163 | */
|
---|
164 | _document, _model) {
|
---|
165 | this._overlay = _overlay;
|
---|
166 | this._ngZone = _ngZone;
|
---|
167 | this._viewContainerRef = _viewContainerRef;
|
---|
168 | this._dateAdapter = _dateAdapter;
|
---|
169 | this._dir = _dir;
|
---|
170 | this._model = _model;
|
---|
171 | this._inputStateChanges = Subscription.EMPTY;
|
---|
172 | /** The view that the calendar should start in. */
|
---|
173 | this.startView = 'month';
|
---|
174 | this._touchUi = false;
|
---|
175 | /** Preferred position of the datepicker in the X axis. */
|
---|
176 | this.xPosition = 'start';
|
---|
177 | /** Preferred position of the datepicker in the Y axis. */
|
---|
178 | this.yPosition = 'below';
|
---|
179 | this._restoreFocus = true;
|
---|
180 | /**
|
---|
181 | * Emits selected year in multiyear view.
|
---|
182 | * This doesn't imply a change on the selected date.
|
---|
183 | */
|
---|
184 | this.yearSelected = new EventEmitter();
|
---|
185 | /**
|
---|
186 | * Emits selected month in year view.
|
---|
187 | * This doesn't imply a change on the selected date.
|
---|
188 | */
|
---|
189 | this.monthSelected = new EventEmitter();
|
---|
190 | /**
|
---|
191 | * Emits when the current view changes.
|
---|
192 | */
|
---|
193 | this.viewChanged = new EventEmitter(true);
|
---|
194 | /** Emits when the datepicker has been opened. */
|
---|
195 | this.openedStream = new EventEmitter();
|
---|
196 | /** Emits when the datepicker has been closed. */
|
---|
197 | this.closedStream = new EventEmitter();
|
---|
198 | this._opened = false;
|
---|
199 | /** The id for the datepicker calendar. */
|
---|
200 | this.id = `mat-datepicker-${datepickerUid++}`;
|
---|
201 | /** The element that was focused before the datepicker was opened. */
|
---|
202 | this._focusedElementBeforeOpen = null;
|
---|
203 | /** Unique class that will be added to the backdrop so that the test harnesses can look it up. */
|
---|
204 | this._backdropHarnessClass = `${this.id}-backdrop`;
|
---|
205 | /** Emits when the datepicker's state changes. */
|
---|
206 | this.stateChanges = new Subject();
|
---|
207 | if (!this._dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
---|
208 | throw createMissingDateImplError('DateAdapter');
|
---|
209 | }
|
---|
210 | this._scrollStrategy = scrollStrategy;
|
---|
211 | }
|
---|
212 | /** The date to open the calendar to initially. */
|
---|
213 | get startAt() {
|
---|
214 | // If an explicit startAt is set we start there, otherwise we start at whatever the currently
|
---|
215 | // selected value is.
|
---|
216 | return this._startAt || (this.datepickerInput ? this.datepickerInput.getStartValue() : null);
|
---|
217 | }
|
---|
218 | set startAt(value) {
|
---|
219 | this._startAt = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(value));
|
---|
220 | }
|
---|
221 | /** Color palette to use on the datepicker's calendar. */
|
---|
222 | get color() {
|
---|
223 | return this._color ||
|
---|
224 | (this.datepickerInput ? this.datepickerInput.getThemePalette() : undefined);
|
---|
225 | }
|
---|
226 | set color(value) {
|
---|
227 | this._color = value;
|
---|
228 | }
|
---|
229 | /**
|
---|
230 | * Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather
|
---|
231 | * than a dropdown and elements have more padding to allow for bigger touch targets.
|
---|
232 | */
|
---|
233 | get touchUi() { return this._touchUi; }
|
---|
234 | set touchUi(value) {
|
---|
235 | this._touchUi = coerceBooleanProperty(value);
|
---|
236 | }
|
---|
237 | /** Whether the datepicker pop-up should be disabled. */
|
---|
238 | get disabled() {
|
---|
239 | return this._disabled === undefined && this.datepickerInput ?
|
---|
240 | this.datepickerInput.disabled : !!this._disabled;
|
---|
241 | }
|
---|
242 | set disabled(value) {
|
---|
243 | const newValue = coerceBooleanProperty(value);
|
---|
244 | if (newValue !== this._disabled) {
|
---|
245 | this._disabled = newValue;
|
---|
246 | this.stateChanges.next(undefined);
|
---|
247 | }
|
---|
248 | }
|
---|
249 | /**
|
---|
250 | * Whether to restore focus to the previously-focused element when the calendar is closed.
|
---|
251 | * Note that automatic focus restoration is an accessibility feature and it is recommended that
|
---|
252 | * you provide your own equivalent, if you decide to turn it off.
|
---|
253 | */
|
---|
254 | get restoreFocus() { return this._restoreFocus; }
|
---|
255 | set restoreFocus(value) {
|
---|
256 | this._restoreFocus = coerceBooleanProperty(value);
|
---|
257 | }
|
---|
258 | /**
|
---|
259 | * Classes to be passed to the date picker panel.
|
---|
260 | * Supports string and string array values, similar to `ngClass`.
|
---|
261 | */
|
---|
262 | get panelClass() { return this._panelClass; }
|
---|
263 | set panelClass(value) {
|
---|
264 | this._panelClass = coerceStringArray(value);
|
---|
265 | }
|
---|
266 | /** Whether the calendar is open. */
|
---|
267 | get opened() { return this._opened; }
|
---|
268 | set opened(value) {
|
---|
269 | coerceBooleanProperty(value) ? this.open() : this.close();
|
---|
270 | }
|
---|
271 | /** The minimum selectable date. */
|
---|
272 | _getMinDate() {
|
---|
273 | return this.datepickerInput && this.datepickerInput.min;
|
---|
274 | }
|
---|
275 | /** The maximum selectable date. */
|
---|
276 | _getMaxDate() {
|
---|
277 | return this.datepickerInput && this.datepickerInput.max;
|
---|
278 | }
|
---|
279 | _getDateFilter() {
|
---|
280 | return this.datepickerInput && this.datepickerInput.dateFilter;
|
---|
281 | }
|
---|
282 | ngOnChanges(changes) {
|
---|
283 | const positionChange = changes['xPosition'] || changes['yPosition'];
|
---|
284 | if (positionChange && !positionChange.firstChange && this._overlayRef) {
|
---|
285 | const positionStrategy = this._overlayRef.getConfig().positionStrategy;
|
---|
286 | if (positionStrategy instanceof FlexibleConnectedPositionStrategy) {
|
---|
287 | this._setConnectedPositions(positionStrategy);
|
---|
288 | if (this.opened) {
|
---|
289 | this._overlayRef.updatePosition();
|
---|
290 | }
|
---|
291 | }
|
---|
292 | }
|
---|
293 | this.stateChanges.next(undefined);
|
---|
294 | }
|
---|
295 | ngOnDestroy() {
|
---|
296 | this._destroyOverlay();
|
---|
297 | this.close();
|
---|
298 | this._inputStateChanges.unsubscribe();
|
---|
299 | this.stateChanges.complete();
|
---|
300 | }
|
---|
301 | /** Selects the given date */
|
---|
302 | select(date) {
|
---|
303 | this._model.add(date);
|
---|
304 | }
|
---|
305 | /** Emits the selected year in multiyear view */
|
---|
306 | _selectYear(normalizedYear) {
|
---|
307 | this.yearSelected.emit(normalizedYear);
|
---|
308 | }
|
---|
309 | /** Emits selected month in year view */
|
---|
310 | _selectMonth(normalizedMonth) {
|
---|
311 | this.monthSelected.emit(normalizedMonth);
|
---|
312 | }
|
---|
313 | /** Emits changed view */
|
---|
314 | _viewChanged(view) {
|
---|
315 | this.viewChanged.emit(view);
|
---|
316 | }
|
---|
317 | /**
|
---|
318 | * Register an input with this datepicker.
|
---|
319 | * @param input The datepicker input to register with this datepicker.
|
---|
320 | * @returns Selection model that the input should hook itself up to.
|
---|
321 | */
|
---|
322 | registerInput(input) {
|
---|
323 | if (this.datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
---|
324 | throw Error('A MatDatepicker can only be associated with a single input.');
|
---|
325 | }
|
---|
326 | this._inputStateChanges.unsubscribe();
|
---|
327 | this.datepickerInput = input;
|
---|
328 | this._inputStateChanges =
|
---|
329 | input.stateChanges.subscribe(() => this.stateChanges.next(undefined));
|
---|
330 | return this._model;
|
---|
331 | }
|
---|
332 | /**
|
---|
333 | * Registers a portal containing action buttons with the datepicker.
|
---|
334 | * @param portal Portal to be registered.
|
---|
335 | */
|
---|
336 | registerActions(portal) {
|
---|
337 | if (this._actionsPortal && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
---|
338 | throw Error('A MatDatepicker can only be associated with a single actions row.');
|
---|
339 | }
|
---|
340 | this._actionsPortal = portal;
|
---|
341 | }
|
---|
342 | /**
|
---|
343 | * Removes a portal containing action buttons from the datepicker.
|
---|
344 | * @param portal Portal to be removed.
|
---|
345 | */
|
---|
346 | removeActions(portal) {
|
---|
347 | if (portal === this._actionsPortal) {
|
---|
348 | this._actionsPortal = null;
|
---|
349 | }
|
---|
350 | }
|
---|
351 | /** Open the calendar. */
|
---|
352 | open() {
|
---|
353 | if (this._opened || this.disabled) {
|
---|
354 | return;
|
---|
355 | }
|
---|
356 | if (!this.datepickerInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
---|
357 | throw Error('Attempted to open an MatDatepicker with no associated input.');
|
---|
358 | }
|
---|
359 | this._focusedElementBeforeOpen = _getFocusedElementPierceShadowDom();
|
---|
360 | this._openOverlay();
|
---|
361 | this._opened = true;
|
---|
362 | this.openedStream.emit();
|
---|
363 | }
|
---|
364 | /** Close the calendar. */
|
---|
365 | close() {
|
---|
366 | if (!this._opened) {
|
---|
367 | return;
|
---|
368 | }
|
---|
369 | if (this._componentRef) {
|
---|
370 | const instance = this._componentRef.instance;
|
---|
371 | instance._startExitAnimation();
|
---|
372 | instance._animationDone.pipe(take(1)).subscribe(() => this._destroyOverlay());
|
---|
373 | }
|
---|
374 | const completeClose = () => {
|
---|
375 | // The `_opened` could've been reset already if
|
---|
376 | // we got two events in quick succession.
|
---|
377 | if (this._opened) {
|
---|
378 | this._opened = false;
|
---|
379 | this.closedStream.emit();
|
---|
380 | this._focusedElementBeforeOpen = null;
|
---|
381 | }
|
---|
382 | };
|
---|
383 | if (this._restoreFocus && this._focusedElementBeforeOpen &&
|
---|
384 | typeof this._focusedElementBeforeOpen.focus === 'function') {
|
---|
385 | // Because IE moves focus asynchronously, we can't count on it being restored before we've
|
---|
386 | // marked the datepicker as closed. If the event fires out of sequence and the element that
|
---|
387 | // we're refocusing opens the datepicker on focus, the user could be stuck with not being
|
---|
388 | // able to close the calendar at all. We work around it by making the logic, that marks
|
---|
389 | // the datepicker as closed, async as well.
|
---|
390 | this._focusedElementBeforeOpen.focus();
|
---|
391 | setTimeout(completeClose);
|
---|
392 | }
|
---|
393 | else {
|
---|
394 | completeClose();
|
---|
395 | }
|
---|
396 | }
|
---|
397 | /** Applies the current pending selection on the overlay to the model. */
|
---|
398 | _applyPendingSelection() {
|
---|
399 | var _a, _b;
|
---|
400 | (_b = (_a = this._componentRef) === null || _a === void 0 ? void 0 : _a.instance) === null || _b === void 0 ? void 0 : _b._applyPendingSelection();
|
---|
401 | }
|
---|
402 | /** Forwards relevant values from the datepicker to the datepicker content inside the overlay. */
|
---|
403 | _forwardContentValues(instance) {
|
---|
404 | instance.datepicker = this;
|
---|
405 | instance.color = this.color;
|
---|
406 | instance._actionsPortal = this._actionsPortal;
|
---|
407 | }
|
---|
408 | /** Opens the overlay with the calendar. */
|
---|
409 | _openOverlay() {
|
---|
410 | this._destroyOverlay();
|
---|
411 | const isDialog = this.touchUi;
|
---|
412 | const labelId = this.datepickerInput.getOverlayLabelId();
|
---|
413 | const portal = new ComponentPortal(MatDatepickerContent, this._viewContainerRef);
|
---|
414 | const overlayRef = this._overlayRef = this._overlay.create(new OverlayConfig({
|
---|
415 | positionStrategy: isDialog ? this._getDialogStrategy() : this._getDropdownStrategy(),
|
---|
416 | hasBackdrop: true,
|
---|
417 | backdropClass: [
|
---|
418 | isDialog ? 'cdk-overlay-dark-backdrop' : 'mat-overlay-transparent-backdrop',
|
---|
419 | this._backdropHarnessClass
|
---|
420 | ],
|
---|
421 | direction: this._dir,
|
---|
422 | scrollStrategy: isDialog ? this._overlay.scrollStrategies.block() : this._scrollStrategy(),
|
---|
423 | panelClass: `mat-datepicker-${isDialog ? 'dialog' : 'popup'}`,
|
---|
424 | }));
|
---|
425 | const overlayElement = overlayRef.overlayElement;
|
---|
426 | overlayElement.setAttribute('role', 'dialog');
|
---|
427 | if (labelId) {
|
---|
428 | overlayElement.setAttribute('aria-labelledby', labelId);
|
---|
429 | }
|
---|
430 | if (isDialog) {
|
---|
431 | overlayElement.setAttribute('aria-modal', 'true');
|
---|
432 | }
|
---|
433 | this._getCloseStream(overlayRef).subscribe(event => {
|
---|
434 | if (event) {
|
---|
435 | event.preventDefault();
|
---|
436 | }
|
---|
437 | this.close();
|
---|
438 | });
|
---|
439 | this._componentRef = overlayRef.attach(portal);
|
---|
440 | this._forwardContentValues(this._componentRef.instance);
|
---|
441 | // Update the position once the calendar has rendered. Only relevant in dropdown mode.
|
---|
442 | if (!isDialog) {
|
---|
443 | this._ngZone.onStable.pipe(take(1)).subscribe(() => overlayRef.updatePosition());
|
---|
444 | }
|
---|
445 | }
|
---|
446 | /** Destroys the current overlay. */
|
---|
447 | _destroyOverlay() {
|
---|
448 | if (this._overlayRef) {
|
---|
449 | this._overlayRef.dispose();
|
---|
450 | this._overlayRef = this._componentRef = null;
|
---|
451 | }
|
---|
452 | }
|
---|
453 | /** Gets a position strategy that will open the calendar as a dropdown. */
|
---|
454 | _getDialogStrategy() {
|
---|
455 | return this._overlay.position().global().centerHorizontally().centerVertically();
|
---|
456 | }
|
---|
457 | /** Gets a position strategy that will open the calendar as a dropdown. */
|
---|
458 | _getDropdownStrategy() {
|
---|
459 | const strategy = this._overlay.position()
|
---|
460 | .flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin())
|
---|
461 | .withTransformOriginOn('.mat-datepicker-content')
|
---|
462 | .withFlexibleDimensions(false)
|
---|
463 | .withViewportMargin(8)
|
---|
464 | .withLockedPosition();
|
---|
465 | return this._setConnectedPositions(strategy);
|
---|
466 | }
|
---|
467 | /** Sets the positions of the datepicker in dropdown mode based on the current configuration. */
|
---|
468 | _setConnectedPositions(strategy) {
|
---|
469 | const primaryX = this.xPosition === 'end' ? 'end' : 'start';
|
---|
470 | const secondaryX = primaryX === 'start' ? 'end' : 'start';
|
---|
471 | const primaryY = this.yPosition === 'above' ? 'bottom' : 'top';
|
---|
472 | const secondaryY = primaryY === 'top' ? 'bottom' : 'top';
|
---|
473 | return strategy.withPositions([
|
---|
474 | {
|
---|
475 | originX: primaryX,
|
---|
476 | originY: secondaryY,
|
---|
477 | overlayX: primaryX,
|
---|
478 | overlayY: primaryY
|
---|
479 | },
|
---|
480 | {
|
---|
481 | originX: primaryX,
|
---|
482 | originY: primaryY,
|
---|
483 | overlayX: primaryX,
|
---|
484 | overlayY: secondaryY
|
---|
485 | },
|
---|
486 | {
|
---|
487 | originX: secondaryX,
|
---|
488 | originY: secondaryY,
|
---|
489 | overlayX: secondaryX,
|
---|
490 | overlayY: primaryY
|
---|
491 | },
|
---|
492 | {
|
---|
493 | originX: secondaryX,
|
---|
494 | originY: primaryY,
|
---|
495 | overlayX: secondaryX,
|
---|
496 | overlayY: secondaryY
|
---|
497 | }
|
---|
498 | ]);
|
---|
499 | }
|
---|
500 | /** Gets an observable that will emit when the overlay is supposed to be closed. */
|
---|
501 | _getCloseStream(overlayRef) {
|
---|
502 | return merge(overlayRef.backdropClick(), overlayRef.detachments(), overlayRef.keydownEvents().pipe(filter(event => {
|
---|
503 | // Closing on alt + up is only valid when there's an input associated with the datepicker.
|
---|
504 | return (event.keyCode === ESCAPE && !hasModifierKey(event)) || (this.datepickerInput &&
|
---|
505 | hasModifierKey(event, 'altKey') && event.keyCode === UP_ARROW);
|
---|
506 | })));
|
---|
507 | }
|
---|
508 | }
|
---|
509 | MatDatepickerBase.decorators = [
|
---|
510 | { type: Directive }
|
---|
511 | ];
|
---|
512 | MatDatepickerBase.ctorParameters = () => [
|
---|
513 | { type: undefined, decorators: [{ type: Inject, args: [ElementRef,] }] },
|
---|
514 | { type: Overlay },
|
---|
515 | { type: NgZone },
|
---|
516 | { type: ViewContainerRef },
|
---|
517 | { type: undefined, decorators: [{ type: Inject, args: [MAT_DATEPICKER_SCROLL_STRATEGY,] }] },
|
---|
518 | { type: DateAdapter, decorators: [{ type: Optional }] },
|
---|
519 | { type: Directionality, decorators: [{ type: Optional }] },
|
---|
520 | { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
|
---|
521 | { type: MatDateSelectionModel }
|
---|
522 | ];
|
---|
523 | MatDatepickerBase.propDecorators = {
|
---|
524 | calendarHeaderComponent: [{ type: Input }],
|
---|
525 | startAt: [{ type: Input }],
|
---|
526 | startView: [{ type: Input }],
|
---|
527 | color: [{ type: Input }],
|
---|
528 | touchUi: [{ type: Input }],
|
---|
529 | disabled: [{ type: Input }],
|
---|
530 | xPosition: [{ type: Input }],
|
---|
531 | yPosition: [{ type: Input }],
|
---|
532 | restoreFocus: [{ type: Input }],
|
---|
533 | yearSelected: [{ type: Output }],
|
---|
534 | monthSelected: [{ type: Output }],
|
---|
535 | viewChanged: [{ type: Output }],
|
---|
536 | dateClass: [{ type: Input }],
|
---|
537 | openedStream: [{ type: Output, args: ['opened',] }],
|
---|
538 | closedStream: [{ type: Output, args: ['closed',] }],
|
---|
539 | panelClass: [{ type: Input }],
|
---|
540 | opened: [{ type: Input }]
|
---|
541 | };
|
---|
542 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXBpY2tlci1iYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci1iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSxtQkFBbUIsQ0FBQztBQUNqRCxPQUFPLEVBQWUscUJBQXFCLEVBQUUsaUJBQWlCLEVBQUMsTUFBTSx1QkFBdUIsQ0FBQztBQUM3RixPQUFPLEVBQUMsTUFBTSxFQUFFLGNBQWMsRUFBRSxRQUFRLEVBQUMsTUFBTSx1QkFBdUIsQ0FBQztBQUN2RSxPQUFPLEVBQ0wsT0FBTyxFQUNQLGFBQWEsRUFHYixpQ0FBaUMsR0FDbEMsTUFBTSxzQkFBc0IsQ0FBQztBQUM5QixPQUFPLEVBQUMsZUFBZSxFQUFnQyxNQUFNLHFCQUFxQixDQUFDO0FBQ25GLE9BQU8sRUFBQyxRQUFRLEVBQUMsTUFBTSxpQkFBaUIsQ0FBQztBQUN6QyxPQUFPLEVBRUwsdUJBQXVCLEVB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