Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * @license
  3.  * Copyright Google Inc. 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 { Overlay, RepositionScrollStrategy, ScrollStrategy } from '@angular/cdk/overlay';
  10. import { AfterContentInit, EventEmitter, InjectionToken, NgZone, OnDestroy, ViewContainerRef } from '@angular/core';
  11. import { DateAdapter } from '@angular/material/core';
  12. import { MatDialog } from '@angular/material/dialog';
  13. import { Subject } from 'rxjs/Subject';
  14. import { MatCalendar } from './calendar';
  15. import { MatDatepickerInput } from './datepicker-input';
  16. /** Injection token that determines the scroll handling while the calendar is open. */
  17. export declare const MAT_DATEPICKER_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
  18. /** @docs-private */
  19. export declare function MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay): () => RepositionScrollStrategy;
  20. /** @docs-private */
  21. export declare const MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER: {
  22.     provide: InjectionToken<() => ScrollStrategy>;
  23.     deps: typeof Overlay[];
  24.     useFactory: (overlay: Overlay) => () => RepositionScrollStrategy;
  25. };
  26. /**
  27.  * Component used as the content for the datepicker dialog and popup. We use this instead of using
  28.  * MatCalendar directly as the content so we can control the initial focus. This also gives us a
  29.  * place to put additional features of the popup that are not part of the calendar itself in the
  30.  * future. (e.g. confirmation buttons).
  31.  * @docs-private
  32.  */
  33. export declare class MatDatepickerContent<D> implements AfterContentInit {
  34.     datepicker: MatDatepicker<D>;
  35.     _calendar: MatCalendar<D>;
  36.     ngAfterContentInit(): void;
  37.     /**
  38.      * Handles keydown event on datepicker content.
  39.      * @param event The event.
  40.      */
  41.     _handleKeydown(event: KeyboardEvent): void;
  42. }
  43. /** Component responsible for managing the datepicker popup/dialog. */
  44. export declare class MatDatepicker<D> implements OnDestroy {
  45.     private _dialog;
  46.     private _overlay;
  47.     private _ngZone;
  48.     private _viewContainerRef;
  49.     private _scrollStrategy;
  50.     private _dateAdapter;
  51.     private _dir;
  52.     private _document;
  53.     /** The date to open the calendar to initially. */
  54.     startAt: D | null;
  55.     private _startAt;
  56.     /** The view that the calendar should start in. */
  57.     startView: 'month' | 'year';
  58.     /**
  59.      * Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather
  60.      * than a popup and elements have more padding to allow for bigger touch targets.
  61.      */
  62.     touchUi: boolean;
  63.     /** Whether the datepicker pop-up should be disabled. */
  64.     disabled: any;
  65.     private _disabled;
  66.     /**
  67.      * Emits new selected date when selected date changes.
  68.      * @deprecated Switch to the `dateChange` and `dateInput` binding on the input element.
  69.      */
  70.     selectedChanged: EventEmitter<D>;
  71.     /** Whether the calendar is open. */
  72.     opened: boolean;
  73.     /** The id for the datepicker calendar. */
  74.     id: string;
  75.     /** The currently selected date. */
  76.     _selected: D | null;
  77.     private _validSelected;
  78.     /** The minimum selectable date. */
  79.     readonly _minDate: D | null;
  80.     /** The maximum selectable date. */
  81.     readonly _maxDate: D | null;
  82.     readonly _dateFilter: (date: D | null) => boolean;
  83.     /** A reference to the overlay when the calendar is opened as a popup. */
  84.     private _popupRef;
  85.     /** A reference to the dialog when the calendar is opened as a dialog. */
  86.     private _dialogRef;
  87.     /** A portal containing the calendar for this datepicker. */
  88.     private _calendarPortal;
  89.     /** The element that was focused before the datepicker was opened. */
  90.     private _focusedElementBeforeOpen;
  91.     private _inputSubscription;
  92.     /** The input element this datepicker is associated with. */
  93.     _datepickerInput: MatDatepickerInput<D>;
  94.     /** Emits when the datepicker is disabled. */
  95.     _disabledChange: Subject<boolean>;
  96.     constructor(_dialog: MatDialog, _overlay: Overlay, _ngZone: NgZone, _viewContainerRef: ViewContainerRef, _scrollStrategy: any, _dateAdapter: DateAdapter<D>, _dir: Directionality, _document: any);
  97.     ngOnDestroy(): void;
  98.     /** Selects the given date */
  99.     _select(date: D): void;
  100.     /**
  101.      * Register an input with this datepicker.
  102.      * @param input The datepicker input to register with this datepicker.
  103.      */
  104.     _registerInput(input: MatDatepickerInput<D>): void;
  105.     /** Open the calendar. */
  106.     open(): void;
  107.     /** Close the calendar. */
  108.     close(): void;
  109.     /** Open the calendar as a dialog. */
  110.     private _openAsDialog();
  111.     /** Open the calendar as a popup. */
  112.     private _openAsPopup();
  113.     /** Create the popup. */
  114.     private _createPopup();
  115.     /** Create the popup PositionStrategy. */
  116.     private _createPopupPositionStrategy();
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement