import { AfterContentInit, ChangeDetectorRef, DoCheck, ElementRef, NgZone, OnDestroy, QueryList, Renderer2 } from '@angular/core'; import { Subject } from 'rxjs'; import { TsDrawerContentComponent } from './drawer-content.component'; import { TsDrawerComponent } from './drawer.component'; /** * Throws an exception when two TsDrawer are matching the same position with same mode. * * @param position - drawer's position */ export declare function throwTsDuplicatedDrawerError(position: string): void; /** * Define content left right margin interface */ export interface ContentLeftRightMargin { left: number | null; right: number | null; } /** * The drawer container UI Component * * @example * * * https://getterminus.github.io/ui-demos-release/components/drawer */ export declare class TsDrawerContainerComponent implements AfterContentInit, DoCheck, OnDestroy { private element; private ngZone; renderer: Renderer2; private changeDetectorRef; private animationMode?; /** * The drawer at the start/end position. */ private start; private end; private openDrawerCount; /** * Emits on every ngDoCheck. Used for debouncing reflows. */ private readonly doCheckSubject; /** * Whether the container is being pushed to the side by one of the drawers. */ private get isPushed(); /** * Define whether backdrop is shown. */ get isShowingBackdrop(): boolean; /** * Access the child drawer {@link TsDrawerComponent} */ drawers: QueryList; /** * Access the child content {@link TsDrawerContentComponent} */ content: TsDrawerContentComponent; /** * Margins to be applied to the content. These are used to push / shrink the drawer content when a * drawer is open. We use margin rather than transform even for push mode because transform breaks * fixed position elements inside of the transformed element. */ contentMargins: ContentLeftRightMargin; /** * Used to notify anyone that's listening to content margin changes. */ readonly contentMarginChanges: Subject; /** * Whether the drawer container should have a backdrop while one of the drawers is open. * * If set to `true`, the backdrop will be enabled for all contained drawers. */ hasBackdrop: boolean; /** * Event emitted when the drawer backdrop is clicked. */ private readonly backdropClick; constructor(element: ElementRef, ngZone: NgZone, renderer: Renderer2, changeDetectorRef: ChangeDetectorRef, animationMode?: string | undefined); /** * After drawer initiated, subscribe to drawer and content changes. */ ngAfterContentInit(): void; /** * Run outside the NgZone, otherwise the debouncer will throw us into an infinite loop. */ ngDoCheck(): void; /** * Complete the observable on destroy */ ngOnDestroy(): void; /** * Calls `expand` of drawers */ expand(): void; /** * Calls `collapse` of drawers */ collapse(): void; /** * Recalculates and updates the inline styles for the content. */ updateContentMargins(): void; /** * For drawers in `overlay` mode, they don't affect the content. * For drawers in `push` mode they should shrink the content. We do this by adding to the * left margin (for left drawer) or right margin (for right the drawer). * If the content margin has already been set and there are more than 1 opening windows on the same size, do not update. * * @param drawer - drawer component, * @param side - left of right side where the drawer expands * @param margin - margin on that side of drawer * @returns - calculated margin on the specific side. */ private marginCalculation; /** * Subscribes to drawer events in order to set a class on the main container element when the * drawer is open and the backdrop is visible. This ensures any overflow on the container element * is properly hidden. * * @param drawer - TsDrawerComponent */ private adjustDrawerOnChange; /** * Subscribes to drawer positionChanged event in order to re-validate drawers when the position changes. * * @param drawer - TsDrawerComponent */ private drawerPositionOnChange; /** * Subscribes to changes in drawer mode so we can run change detection. * * @param drawer */ private drawerModeOnChange; /** * Toggles the 'ts-drawer--expanded' class on the main 'ts-drawer-container' element. * * @param isAdd - whether drawer is expanding */ private setContainerClass; /** * Validate the state of the drawer children components. */ private validateDrawers; /** * When backdrop is clicked, emit backdropClick event and collapse the drawer */ onBackdropClicked(): void; /** * Collapse all the drawers if hasBackdrop is true */ closeModalDrawer(): void; /** * Whether drawer is currently expanded * * @param drawer * @returns boolean */ private static isDrawerOpen; }