import { ConfigurableFocusTrapFactory, FocusMonitor } from '@angular/cdk/a11y'; import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit } from '@angular/core'; import { CanDestroyNotify, CanDestroyNotifyCtor } from '@mtna/lib-ui'; import { MtnaResizableDragHandlePosition } from './resizable-drag-handle-position.model'; import * as i0 from "@angular/core"; declare const _MtnaResizablePanelComponentBaseMixinBase: CanDestroyNotifyCtor; /** * A generic, resizable layout container. * - Buttons to expand and collapse * - Can be resized by dragging the left or right size. * - Will automatically collapse if resized smaller than a provided threshold * - Leverages LocalStorage to save the user's last set size. * - NOTE: Toggle-button explicit event handlers used in order to prevent `restoreFocus()` from leaking "keyup" events to external elements * * @author Will Davis */ export declare class MtnaResizablePanelComponent extends _MtnaResizablePanelComponentBaseMixinBase implements AfterViewInit, CanDestroyNotify, OnDestroy, OnInit { private _cdr; private _element; private _focusMonitor; private _focusTrapFactory; private _ngZone; static ngAcceptInputType_autoFocus: BooleanInput; static ngAcceptInputType_closeThreshold: NumberInput; static ngAcceptInputType_collapsed: BooleanInput; static ngAcceptInputType_defaultPanelWidth: NumberInput; static ngAcceptInputType_disableOpen: BooleanInput; static ngAcceptInputType_disableResize: BooleanInput; static ngAcceptInputType_dragHandlePosition: MtnaResizableDragHandlePosition | null | undefined; static ngAcceptInputType_expandButtonTop: string | null | undefined; static ngAcceptInputType_panelWidth: NumberInput; static ngAcceptInputType_preserveCollapsedState: BooleanInput; /** Whether the drag handle is set to be positioned before the content */ get dragHandleBefore(): boolean; /** Whether the drag handle is set to be positioned after the content */ get dragHandleAfter(): boolean; /** Current width of the panel. */ get panelWidth(): number; set panelWidth(width: number); private _panelWidth; dragHandle: ElementRef; /** Whether to trap focus in the resizable panel on initialization. * NOTE: only use when resizable panel is removed from DOM on close. * Automatically restores focus to a previously active element on close, if exists. */ get autoFocus(): boolean; set autoFocus(a: boolean); private _autoFocus; /** Automatically collapsed when resized to less than the threshold, defaults to 49 */ get closeThreshold(): number; set closeThreshold(width: number); private _closeThreshold; /** Whether the panel is collapsed. Defaults to false. */ get collapsed(): boolean; set collapsed(collapsed: boolean); private _collapsed; /** Initial, expanded width of the panel. Local storage value will take precedence. Defaults to 300. */ get defaultPanelWidth(): number; set defaultPanelWidth(width: number); private _defaultPanelWidth; /** Whether to disable opening the panel. Defaults to false. */ get disableOpen(): boolean; set disableOpen(disableOpen: boolean); private _disableOpen; /** Whether resizing is disabled, defaults to false. Hides the expand button if disabled and collapsed. */ get disableResize(): boolean; set disableResize(disableResize: boolean); private _disableResize; /** Allows the user to define the position of the drag handle relative to the container. Defualts to 'after'. */ get dragHandlePosition(): MtnaResizableDragHandlePosition; set dragHandlePosition(value: MtnaResizableDragHandlePosition); private _dragHandlePosition; /** Input for the icon that shows during the collapsed state */ expandButtonIcon: string | undefined; /** Top position for the expansion button. Defaults to 30px. */ get expandButtonTop(): string; set expandButtonTop(width: string); private _expandButtonTop; /** Whether to preserve the collapsed state in local stroage. Defaults to false. */ get preserveCollapsedState(): boolean; set preserveCollapsedState(value: boolean); private _preserveCollapsedState; /** Local storage key to store the last set size. If an empty string is provided, the default storage key will be used. */ get storageKey(): string; set storageKey(value: string); private _storageKey; /** Emitted when the collpased value changes. */ collapsedChange: EventEmitter; /** Emitted when the open panel is resized */ resized: EventEmitter; /** Key for extracting a collapsed state from local storage */ private get _collapsedStorageKey(); /** the DOM Document */ private _document; /** Whether a current drag event is in progress */ private _dragActive; private _elementFocusedBeforePanelWasOpened; private _focusTrap?; /** Keeps track of the event listeners that we've bound to the `document`. */ private _globalListeners; /** * Time at which the last touch event occurred. Used to avoid firing the same * events multiple times on touch devices where the browser will fire a fake * mouse event for each touch event, after a certain time. */ private _lastTouchEventTime?; /** * Emits the `touchmove` or `mousemove` events that are dispatched * while the user is dragging a drag item instance. */ private _pointerMove; /** * Emits the `touchend` or `mouseup` events that are dispatched * while the user is dragging a drag item instance. */ private _pointerUp; /** Key for extracting a width from local storage */ private get _widthStorageKey(); constructor(_cdr: ChangeDetectorRef, _document: any, _element: ElementRef, _focusMonitor: FocusMonitor, _focusTrapFactory: ConfigurableFocusTrapFactory, _ngZone: NgZone); cancelEvent(event: Event): void; /** @returns the collapsed state from local storage if it was ever persisted with the given key. */ getStoredCollapsedState(): boolean | undefined; /** @returns panel width stored in local storage if it exists, otherwise `undefined`. */ getStoredWidth(): number | undefined; ngAfterViewInit(): void; ngOnInit(): void; ngOnDestroy(): void; /** * Persists the collapsed state in local storage. * @param state Whether the panel is collapsed */ storeCollapsedState(state: boolean): void; /** * Persist width in local storage * @param width width in pixels for the resizable panel's expanded state. */ storeWidth(width: number): void; /** Toggle the panel expansion */ toggleExpansion(event: Event): void; /** Clears out the global event listeners from the `document`. */ private _clearGlobalListeners; /** Determines whether an event is a touch event. */ private _isTouchEvent; /** Handler for the `mousedown`/`touchstart` events. */ private _pointerDown; /** Restores keyboard focus to a previos element, if it exists */ private _restoreFocus; /** Update the panel width as it is dragged. */ private _startDragging; /** Traps the keyboard focus within the resizable panel content */ private _takeFocus; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};