import * as i0 from '@angular/core'; import { InjectionToken, ElementRef, AfterViewInit, OnDestroy, EventEmitter, AfterContentInit, NgZone, ChangeDetectorRef, QueryList } from '@angular/core'; import * as i1 from '@angular/cdk/scrolling'; import { CdkScrollable } from '@angular/cdk/scrolling'; import * as i1$1 from '@sbb-esta/angular/core'; import * as i3 from '@sbb-esta/angular/icon'; import { FocusOrigin } from '@angular/cdk/a11y'; import { BooleanInput } from '@angular/cdk/coercion'; import { Subject, Observable } from 'rxjs'; import { BreakpointObserver } from '@angular/cdk/layout'; /** * Throws an exception if more than one SbbSidebarBase is provided. * @docs-private */ declare function throwSbbDuplicatedSidebarError(position: string): void; /** * Used to provide a sidebar container to a sidebar while avoiding circular references. * @docs-private */ declare const SBB_SIDEBAR_CONTAINER: InjectionToken; /** @docs-private */ interface SbbSidebarMobileCapableContainer { _mobile: boolean; } declare abstract class SbbSidebarContentBase extends CdkScrollable { _elementRef: ElementRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** This component corresponds to a sidebar. */ declare abstract class SbbSidebarBase implements AfterViewInit, OnDestroy { abstract _container: SbbSidebarMobileCapableContainer; protected _elementRef: ElementRef; protected _doc: Document; abstract _mobileChanged(mobile: boolean): void; /** Whether the view of the component has been attached. */ private _isAttached; /** Anchor node used to restore the sidebar to its initial position. */ private _anchor; /** The side that the sidebar is attached to. */ set position(value: 'start' | 'end'); get position(): "start" | "end"; _position: 'start' | 'end'; /** Event emitted when the sidebar's position changes. */ readonly onPositionChanged: EventEmitter; protected constructor(...args: unknown[]); protected _updatePositionInParent(newPosition: 'start' | 'end'): void; ngAfterViewInit(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * This is the parent component to one or two ``s that validates the state internally * and coordinates the backdrop and content styling. */ declare abstract class SbbSidebarContainerBase implements AfterContentInit, OnDestroy, SbbSidebarMobileCapableContainer { protected _ngZone: NgZone; protected _changeDetectorRef: ChangeDetectorRef; protected _breakpointObserver: BreakpointObserver; _mobile: boolean; /** * The sidebar child at the start or end position. * @deprecated Use `start` or `end` instead. * @breaking-change 19.0.0 */ get sidebar(): T | null; /** The sidebar child with the `start` position. */ get start(): T | null; /** The sidebar child with the `end` position. */ get end(): T | null; /** Reference to the CdkScrollable instance that wraps the scrollable content. */ get scrollable(): CdkScrollable; /** All sidebars, also nested sidebars included **/ _allSidebars: QueryList; /** Sidebars that belong to this container. */ _sidebars: QueryList; _content: SbbSidebarContentBase; _userContent: SbbSidebarContentBase; /** The sidebar at the start/end position. */ protected _start: T | null; protected _end: T | null; /** Emits when the component is destroyed. */ protected readonly _destroyed: Subject; protected constructor(...args: unknown[]); ngAfterContentInit(): void; protected _watchBreakpointObserver(): void; private _updateMobileState; ngOnDestroy(): void; /** Validate the state of the sidebar children components. */ protected _validateSidebars(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, {}, {}, never, never, true, never>; } /** Result of the toggle promise that indicates the state of the sidebar. */ type SbbSidebarToggleResult = 'open' | 'close'; /** Sidebar display modes. */ type SbbSidebarMode = 'over' | 'side'; declare class SbbSidebarContent extends SbbSidebarContentBase implements AfterContentInit { _container: SbbSidebarContainer; _changeDetectorRef: ChangeDetectorRef; ngAfterContentInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SbbSidebar extends SbbSidebarBase implements AfterContentInit, OnDestroy { private _focusTrapFactory; private _focusMonitor; private _ngZone; private _renderer; _container: SbbSidebarContainer; private _router; _labelCloseSidebar: string; /** Whether the sidebar is in mobile mode. */ _mobile: boolean; /** Whether the sidebar is collapsible. */ set collapsible(value: boolean); get collapsible(): boolean; _collapsible: boolean; /** Optional title to display in the sidebar header next to the close icon if sidebar is collapsible. */ collapsibleTitle?: string | null; /** Mode of the sidebar; one of 'over', or 'side'. */ get mode(): SbbSidebarMode; set mode(value: SbbSidebarMode); /** * Whether the collapsible sidebar is opened. */ get opened(): boolean; set opened(value: BooleanInput); private _opened; /** * Whether the `opened` state was set via the @Input. * If true, the sidebar will not be toggled automatically if the mobile state changes. */ private _openedViaInput; /** Emits whenever the sidebar has started animating. */ readonly _animationStarted: Subject; /** Emits whenever the sidebar is done animating. */ readonly _animationEnd: Subject; /** * Name of the svg icon for the trigger on mobile devices. */ set triggerSvgIcon(value: string); get triggerSvgIcon(): string | null; private _triggerSvgIconSubject; /** Event emitted when the sidebar has started opening. */ readonly openedStart: Observable; /** Event emitted when the sidebar has started closing. */ readonly closedStart: Observable; private _focusTrap; private _elementFocusedBeforeSidebarWasOpened; private _eventCleanups; private _mode; /** How the sidebar was opened (keypress, mouse click etc.) */ private _openedVia; /** Event emitted when the sidebar open state is changed. */ readonly openedChange: EventEmitter; /** Event emitted when the sidebar has been opened. */ readonly _openedStream: Observable; /** Event emitted when the sidebar has been closed. */ readonly _closedStream: Observable; /** Emits when the component is destroyed. */ private readonly _destroyed; /** * An observable that emits when the sidebar mode changes. This is used by the sidebar container to * to know when to when the mode changes so it can adapt the margins on the content. */ readonly _modeChanged: Subject; readonly _svgIcon: Observable; private _changeDetectorRef; private _injector; constructor(...args: unknown[]); /** * Moves focus into the sidebar. Note that this works even if * the focus trap is disabled in `side` mode. */ private _takeFocus; /** * Restores focus to the element that was originally focused when the sidebar opened. * If no element was focused at that time, the focus will be restored to the sidebar. */ private _restoreFocus; /** Whether focus is currently within the sidebar. */ private _isFocusWithinSidebar; ngAfterContentInit(): void; ngOnDestroy(): void; /** * Open the sidebar. * @param openedVia Whether the sidebar was opened by a key press, mouse click or programmatically. * Used for focus management after the sidebar is closed. */ open(openedVia?: FocusOrigin): Promise; /** Close the sidebar. */ close(): Promise; /** Closes the sidebar with context that the backdrop was clicked. */ _closeViaBackdropClick(): Promise; /** * Toggle this sidebar. * @param isOpen Whether the sidebar should be open. * @param openedVia Whether the sidebar was opened by a key press, mouse click or programmatically. * Used for focus management after the sidebar is closed. */ toggle(isOpen?: boolean, openedVia?: FocusOrigin): Promise; /** * Toggles the opened state of the sidebar. * @param isOpen Whether the sidebar should open or close. * @param restoreFocus Whether focus should be restored on close. * @param focusOrigin Origin to use when restoring focus. */ private _setOpen; /** Toggles whether the drawer is currently animating. */ private _setIsAnimating; _getWidth(): number; /** Updates the enabled state of the focus trap. */ private _updateFocusTrapState; _mobileChanged(mobile: boolean): void; /** Event handler for animation events. */ private _handleTransitionEvent; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_collapsible: unknown; } declare class SbbSidebarContainer extends SbbSidebarContainerBase implements AfterContentInit, SbbSidebarMobileCapableContainer, OnDestroy { private _element; private _animationMode; _transitionsEnabled: boolean; _labelOpenSidebar: string; /** The sidebar child at the start/end position. */ get start(): SbbSidebar | null; get end(): SbbSidebar | null; /** Whether the sidebar container should have a backdrop while one of the sidebars is open. */ get hasBackdrop(): boolean; constructor(...args: unknown[]); /** All sidebars in the container. Includes sidebars from inside nested containers. */ _allSidebars: QueryList; _content: SbbSidebarContent; _userContent: SbbSidebarContent; /** Event emitted when the sidebar backdrop is clicked. */ readonly backdropClick: EventEmitter; /** * Margins to be applied to the content. These are used to shrink the sidebar content when a * sidebar is open. We use margin rather than transform because transform breaks * fixed position elements inside of the transformed element. */ _contentMargins: { left: number | null; right: number | null; }; readonly _contentMarginChanges: Subject<{ left: number | null; }>; ngAfterContentInit(): void; /** Calls `open` of both start and end sidebars */ open(): void; /** Calls `close` of both start and end sidebars */ close(): void; /** * Recalculates and updates the inline styles for the content. Note that this should be used * sparingly, because it causes a reflow. */ updateContentMargins(): void; /** * Subscribes to sidebar events in order to set a class on the main container element when the * sidebar is open and the backdrop is visible. This ensures any overflow on the container element * is properly hidden. */ private _watchSidebarToggle; /** Subscribes to changes in sidebar mode so we can run change detection. */ private _watchSidebarMode; /** * Subscribes to sidebar onPositionChanged event in order to * re-validate sidebars when the position changes. */ private _watchSidebarPosition; /** Toggles the 'sbb-sidebar-opened' class on the main 'sbb-sidebar-container' element. */ private _setContainerClass; _onBackdropClicked(): void; _closeModalSidebarsViaBackdrop(): void; _isShowingBackdrop(): boolean; private _canHaveBackdrop; private _isSidebarOpen; toggleSidebar(position: 'start' | 'end'): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SbbSidebarLink { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare function throwSbbDuplicatedIconSidebarError(): void; declare class SbbIconSidebarContent extends SbbSidebarContentBase { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SbbIconSidebar extends SbbSidebarBase { private _changeDetectorRef; _container: SbbIconSidebarContainer; _labelCollapse: string; _labelExpand: string; /** Whether the sidebar is expanded. */ get expanded(): boolean; set expanded(value: boolean); private _expanded; /** Event emitted when the icon sidebar expanded state is changed. */ readonly expandedChange: EventEmitter; constructor(...args: unknown[]); toggleExpanded(expanded?: boolean): void; _mobileChanged(mobile: boolean): void; /** * On mobile devices, the position of the sidebar is always 'start'. * @docs-private */ _updatePositionInParent(position: 'start' | 'end'): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_expanded: unknown; } declare class SbbIconSidebarContainer extends SbbSidebarContainerBase implements AfterContentInit, SbbSidebarMobileCapableContainer { /** All sidebars in the container. Includes sidebars from inside nested containers. */ _allSidebars: QueryList; _content: SbbIconSidebarContent; _userContent: SbbIconSidebarContent; constructor(...args: unknown[]); ngAfterContentInit(): void; /** Validate the state of the icon sidebar children components. */ _validateSidebars(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SbbIconSidebarItem { /** Label of the icon */ label: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SbbSidebarModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { SBB_SIDEBAR_CONTAINER, SbbIconSidebar, SbbIconSidebarContainer, SbbIconSidebarContent, SbbIconSidebarItem, SbbSidebar, SbbSidebarBase, SbbSidebarContainer, SbbSidebarContainerBase, SbbSidebarContent, SbbSidebarContentBase, SbbSidebarLink, SbbSidebarModule, throwSbbDuplicatedIconSidebarError, throwSbbDuplicatedSidebarError }; export type { SbbSidebarMobileCapableContainer, SbbSidebarMode, SbbSidebarToggleResult };