UNPKG

@angular-mdc/web

Version:
74 lines (73 loc) 3.22 kB
import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy } from '@angular/core'; import { FocusMonitor, FocusTrapFactory } from '@angular/cdk/a11y'; import { Platform } from '@angular/cdk/platform'; import { MDCComponent } from '@angular-mdc/web/base'; import { MdcList } from '@angular-mdc/web/list'; import { MDCDismissibleDrawerFoundation, MDCModalDrawerFoundation } from '@material/drawer'; export declare type MdcDrawerType = 'dismissible' | 'modal'; export declare class MdcDrawerHeader { elementRef: ElementRef<HTMLElement>; title?: string; subtitle?: string; constructor(elementRef: ElementRef<HTMLElement>); } export declare class MdcDrawer extends MDCComponent<MDCDismissibleDrawerFoundation | MDCModalDrawerFoundation> implements AfterContentInit, OnDestroy { private _platform; private _ngZone; private _changeDetectorRef; private _focusTrapFactory; private _focusMonitor; private _document; elementRef: ElementRef<HTMLElement>; /** Emits when the component is destroyed. */ private readonly _destroyed; private _scrimElement; /** How the drawer was opened (keypress, mouse click etc.) */ private _openedVia; /** Element that was focused before the drawer was opened. Save this to restore upon close. */ private _elementFocusedBeforeDrawerWasOpened; /** The class that traps and manages focus within the drawer. */ private _focusTrap; get open(): boolean; set open(value: boolean); private _open; get drawer(): string; set drawer(drawer: string); private _drawer; get autoFocus(): boolean; set autoFocus(value: boolean); private _autoFocus; get restoreFocus(): boolean; set restoreFocus(value: boolean); private _restoreFocus; get fixedAdjustElement(): any; set fixedAdjustElement(element: any); private _fixedAdjustElement; readonly opened: EventEmitter<void>; readonly closed: EventEmitter<void>; /** Event emitted when the drawer open state is changed. */ readonly openedChange: EventEmitter<boolean>; /** Event emitted when the drawer variant is changed. */ readonly drawerChange: EventEmitter<void>; _list?: MdcList; private _scrimSubscription; get modal(): boolean; get dismissible(): boolean; get _isFocusTrapEnabled(): boolean; getDefaultFoundation(): MDCDismissibleDrawerFoundation; constructor(_platform: Platform, _ngZone: NgZone, _changeDetectorRef: ChangeDetectorRef, _focusTrapFactory: FocusTrapFactory, _focusMonitor: FocusMonitor, _document: any, elementRef: ElementRef<HTMLElement>); ngAfterContentInit(): void; ngOnDestroy(): void; _handleTransitionEnd(event: TransitionEvent): void; private _createScrim; private _initFoundation; private _initListType; /** Updates the enabled state of the focus trap. */ private _updateFocusTrapState; private _trapFocus; /** Restores focus to the element that was focused before the drawer opened. */ private _releaseFocus; /** Saves a reference to the element that was focused before the drawer was opened. */ private _savePreviouslyFocusedElement; private _getHostElement; }