UNPKG

@blox/material

Version:

Material Components for Angular

116 lines (115 loc) 4.72 kB
import { AfterContentInit, ElementRef, EventEmitter, OnDestroy, Renderer2 } from '@angular/core'; import { AbstractMdcFocusTrap } from '../focus-trap/abstract.mdc.focus-trap'; /** * Directive for the title of a drawer. The use of this directive is optional. * If used, it should be placed as first element inside an `mdcDrawerHeader` */ export declare class MdcDrawerTitleDirective { } /** * Directive for the subtitle of a drawer. The use of this directive is optional. * If used, it should be placed as a sibling element of `mdcDrawerTitle` * inside an `mdcDrawerHeader` */ export declare class MdcDrawerSubtitleDirective { } /** * A toolbar header is an optional first child of an `mdcDrawer`. * The header will not scroll with the rest of the drawer content, so is a * good place to place titles and account switchers. * * Directives that are typically used inside an `mdcDrawerHeader`: * `mdcDrawerTitle`, and `mdcDrawerSubTitle` */ export declare class MdcDrawerHeaderDirective { } /** * Directive for the drawer content. You would typically also apply the `mdcList` * or `mdcListGroup` directive to the drawer content (see the examples). */ export declare class MdcDrawerContentDirective { } export declare class MdcDrawerScrimDirective { } /** * Directive for a (navigation) drawer. The following drawer types are * supported: * * `permanent`: the default type if none was specified. * * `dismissible`: the drawer is hidden by default, and can slide into view. * Typically used when navigation is not common, and the main app content is * prioritized. * * `modal`: the drawer is hidden by default. When activated, the drawer is elevated * above the UI of the app. It uses a scrim to block interaction with the rest of * the app with a scrim. * * Drawers may contain an `mdcDrawerHeader`, and should contain an `mdcDrawerContent` * directive. */ export declare class MdcDrawerDirective implements AfterContentInit, OnDestroy { _elm: ElementRef; protected _rndr: Renderer2; private _focusTrap; private _onDocumentClick; private focusTrapHandle; private type; private previousFocus; private _open; private document; private mdcAdapter; private foundation; /** * Event emitted when the drawer is opened or closed. The event value will be * `true` when the drawer is opened, and `false` when the * drawer is closed. (When this event is triggered, the drawer is starting to open/close, * but the animation may not have fully completed yet) */ readonly openChange: EventEmitter<boolean>; /** * Event emitted after the drawer has fully opened. When this event is emitted the full * opening animation has completed, and the drawer is visible. */ readonly afterOpened: EventEmitter<void>; /** * Event emitted after the drawer has fully closed. When this event is emitted the full * closing animation has completed, and the drawer is not visible anymore. */ readonly afterClosed: EventEmitter<void>; constructor(_elm: ElementRef, _rndr: Renderer2, doc: any, _focusTrap: AbstractMdcFocusTrap); ngAfterContentInit(): void; ngOnDestroy(): void; private destroyDrawer; private initDrawer; /** * Set the type of drawer. Either `permanent`, `dismissible`, or `modal`. * The default type is `permanent`. */ get mdcDrawer(): 'permanent' | 'dismissible' | 'modal'; set mdcDrawer(value: 'permanent' | 'dismissible' | 'modal'); static ngAcceptInputType_mdcDrawer: 'permanent' | 'dismissible' | 'modal' | ''; /** * Input to open (assign value `true`) or close (assign value `false`) * the drawer. */ get open(): boolean; set open(value: boolean); static ngAcceptInputType_open: boolean | ''; private fixOpenClose; private trapFocus; private untrapFocus; } /** * Use this directive for marking the sibling element after a dismissible `mdcDrawer`. * This will apply styling so that the open/close animations work correctly. */ export declare class MdcDrawerAppContent { /** * Set this to false to disable the styling for sibbling app content of a dismissible drawer. * This is typically only used when your `mdcDrawer` type is dynamic. In those cases you can * disable the `mdcDrawerAppContent` when you set your drawer type to anything other than * `dismissible`. */ get mdcDrawerAppContent(): boolean; set mdcDrawerAppContent(value: boolean); static ngAcceptInputType_mdcDrawerAppContent: boolean | ''; } export declare const DRAWER_DIRECTIVES: (typeof MdcDrawerTitleDirective | typeof MdcDrawerDirective | typeof MdcDrawerAppContent)[];