import * as i1$2 from '@sbb-esta/angular/core'; import { TypeRef } from '@sbb-esta/angular/core'; import * as i0 from '@angular/core'; import { OnDestroy, EventEmitter, AfterContentInit, QueryList, InjectionToken, ElementRef, OnChanges, AfterViewInit, SimpleChanges } from '@angular/core'; import { AnimationEvent } from '@angular/animations'; import { FocusableOption, FocusOrigin, FocusKeyManager } from '@angular/cdk/a11y'; import { BooleanInput } from '@angular/cdk/coercion'; import { Subject, Observable } from 'rxjs'; import * as i2 from '@angular/cdk/overlay'; import { ScrollStrategy, Overlay } from '@angular/cdk/overlay'; import * as i1$1 from '@angular/cdk/portal'; import { CdkPortal, CdkPortalOutlet } from '@angular/cdk/portal'; import * as i1 from '@angular/cdk/observers'; import * as i3 from '@sbb-esta/angular/icon'; declare class SbbAppChooserSection { private _header; label: string; constructor(...args: unknown[]); /** Close the header menu when any a or button child element is clicked. */ _handleChildClick(event: TypeRef): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SbbHeaderMenuItem implements FocusableOption, OnDestroy { private _elementRef; private _focusMonitor; /** ARIA role for the menu item. */ role: 'menuitem' | 'menuitemradio' | 'menuitemcheckbox'; /** Whether the menu item is disabled. */ disabled: boolean; private _document; /** Whether the menu item is highlighted. */ _highlighted: boolean; /** Whether the menu item acts as a trigger for a sub-menu. */ _triggersSubmenu: boolean; /** Emits whenever a this item is clicked when enabled. */ click: EventEmitter; constructor(...args: unknown[]); /** Focuses the menu item. */ focus(origin?: FocusOrigin, options?: FocusOptions): void; ngOnDestroy(): void; /** Used to set the `tabindex`. */ _getTabIndex(): string; /** Returns the host DOM element. */ _getHostElement(): HTMLElement; /** Prevents the default element actions if it is disabled. */ _checkDisabled(event: TypeRef): void; /** Gets the label to be used when determining whether the option should be focused. */ getLabel(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; static ngAcceptInputType_disabled: unknown; } declare class SbbHeaderMenu implements AfterContentInit, OnDestroy { private _elementRef; private _changeDetectorRef; _header: SbbHeaderLean; _backButton: string; /** Unique ID to be used by menu trigger's "aria-owns" property. */ id: string; /** Event emitted when the menu is closed. */ readonly closed: EventEmitter; /** Reference to the menu items. */ _items: QueryList; /** @docs-private */ _panelPortal: CdkPortal; /** @docs-private */ _panelPortalOutlet: CdkPortalOutlet; /** Whether the menu panel is open. */ get open(): boolean; set open(value: boolean); private _open; /** * This method takes classes set on the host sbb-header-menu element and applies them on the * menu template that displays in the overlay container. Otherwise, it's difficult * to style the containing menu from outside the component. * @param classes list of class names */ set panelClass(classes: string); private _previousPanelClass; /** Whether the autocomplete panel should be visible, depending on option length. */ showPanel: boolean; /** Manages active item in item list based on key events. */ _keyManager: FocusKeyManager; /** Class list for the panel. */ _classList: { [key: string]: boolean; }; /** @docs-private */ _panel: CdkPortal | null; /** @docs-private */ _animationState: 'closed' | 'open-panel' | 'open-menu'; /** Subscription to tab events on the menu panel */ private _destroyed; constructor(...args: unknown[]); ngAfterContentInit(): void; ngOnDestroy(): void; /** * Focus the first item in the menu. * @param origin Action from which the focus originated. Used to set the correct styling. */ focusFirstItem(origin?: FocusOrigin): void; /** * Resets the active item in the menu. This is used when the menu is opened, allowing * the user to start from the first option when pressing the down arrow. */ resetActiveItem(): void; _onAnimationDone(event: AnimationEvent): void; _handleMenuKeydown(event: TypeRef): void; /** Handle a keyboard event from the menu, delegating to the appropriate action. */ _handlePanelKeydown(event: KeyboardEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** Injection token that determines the scroll handling while the menu is open. */ declare const SBB_HEADER_MENU_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>; /** @docs-private */ declare function SBB_HEADER_MENU_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy; /** @docs-private */ declare const SBB_HEADER_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER: { provide: InjectionToken<() => ScrollStrategy>; deps: (typeof Overlay)[]; useFactory: typeof SBB_HEADER_MENU_SCROLL_STRATEGY_FACTORY; }; declare class SbbHeaderMenuTrigger implements AfterContentInit, OnDestroy { private _overlay; private _element; private _focusMonitor; private _router; private _header; _openedBy: 'mouse' | 'touch' | null; /** References the menu instance that the trigger is associated with. */ get menu(): SbbHeaderMenu; set menu(menu: SbbHeaderMenu); private _menu; /** * Whether focus should be restored when the menu is closed. * Note that disabling this option can have accessibility implications * and it's up to you to manage focus, if you decide to turn it off. */ restoreFocus: boolean; /** Event emitted when the associated menu is opened. */ readonly menuOpened: EventEmitter; /** Event emitted when the associated menu is closed. */ readonly menuClosed: EventEmitter; _panelTarget: ElementRef; /** Whether the menu is open. */ get menuOpen(): boolean; private _overlayRef; private _menuOpen; private _closingActionsSubscription; private _menuCloseSubscription; private _destroyed; private _scrollStrategy; /** * Handles touch start events on the trigger. * Needs to be an arrow function so we can easily use addEventListener and removeEventListener. */ private _handleTouchStart; constructor(...args: unknown[]); ngAfterContentInit(): void; ngOnDestroy(): void; /** Toggles the menu between the open and closed states. */ toggleMenu(): void; /** Opens the menu. */ openMenu(): void; /** Closes the menu. */ closeMenu(): void; /** * Focuses the menu trigger. * @param origin Source of the menu trigger's focus. */ focus(origin?: FocusOrigin, options?: FocusOptions): void; /** Handles mouse presses on the trigger. */ _handleMousedown(event: TypeRef): void; /** Handles click events on the trigger. */ _handleClick(): void; /** Closes the menu and does the necessary cleanup. */ private _destroyMenu; /** * This method sets the menu state to open and focuses the first item if * the menu was opened via the keyboard. */ private _initMenu; /** Restores focus to the element that was focused before the menu was open. */ private _restoreFocus; private _setIsMenuOpen; /** * This method checks that a valid instance of HeaderMenu has been passed into * sbbHeaderMenu. If not, an exception is thrown. */ private _checkMenu; /** * This method creates the overlay from the provided menu's template and saves its * OverlayRef so that it can be attached to the DOM when openMenu is called. */ private _createOverlay; /** * This method builds the configuration object needed to create the overlay, the OverlayState. * @returns OverlayConfig */ private _getOverlayConfig; /** * Sets the appropriate positions on a position strategy * so the overlay connects with the trigger correctly. * @param positionStrategy Strategy whose position to update. */ private _setPosition; /** Returns the width of the input element, so the panel width can match it. */ protected _getHostWidth(): number; /** Returns a stream that emits whenever an action that should close the menu occurs. */ private _menuClosingActions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** Result of the toggle promise that indicates the state of the header menu. */ type SbbHeaderMenuToggleResult = 'open' | 'close'; type SbbHeaderCollapseBreakpoint = 'mobile' | 'tablet' | 'desktop' | 'desktopLarge' | 'desktop2k' | 'desktop4k' | 'desktop5k'; declare class SbbHeaderLean implements OnChanges, AfterViewInit, OnDestroy { private _elementRef; private _focusTrapFactory; private _focusMonitor; private _ngZone; private _breakpointObserver; private _changeDetectorRef; private _router; private _doc; _labelOpenMenu: string; _labelCloseMenu: string; /** Main title shown in the header. */ label?: string; /** Subtitle shown below the main title, if present. */ subtitle?: string; /** * The breakpoint on which to collapse the header menus into the burger menu. * Matching the given breakpoint or anything below, will collapse the menus. * (e.g. 'tablet' will collapse the menu, if 'tablet' or 'mobile' is matched) * See breakpoint documentation for specific values. */ collapseBreakpoint: SbbHeaderCollapseBreakpoint; /** Whether the header menu is open. */ get opened(): boolean; set opened(value: BooleanInput); private _opened; /** Emits whenever the header menu has started animating. */ _animationStarted: Subject; /** Emits whenever the header menu is done animating. */ _animationEnd: Subject; /** Current state of the menu animation. */ _animationState: 'open' | 'void'; /** Observable of whether the menus are collapsed into the burger menu. */ _headerMenusCollapsed: Observable; /** Whether the menus are collapsed into the burger menu. */ _menusCollapsed: boolean; /** Event emitted when the header menu open state is changed. */ readonly openedChange: EventEmitter; /** Event emitted when the header menu has been opened. */ get _openedStream(): Observable; /** Event emitted when the header menu has started opening. */ get openedStart(): Observable; /** Event emitted when the header menu has been closed. */ get _closedStream(): Observable; /** Event emitted when the header menu has started closing. */ get closedStart(): Observable; /** @docs-private */ _menuElement: ElementRef; /** * The provided app chooser sections. * @docs-private */ _appChooserSections: QueryList; /** * Menu triggers used within the header. * @docs-private */ _menuTriggers: QueryList; /** How the sidenav was opened (keypress, mouse click etc.) */ private _openedVia; /** Emits when the component is destroyed. */ private readonly _destroyed; private readonly _collapseBreakpoint; private _focusTrap; private _elementFocusedBeforeMenuWasOpened; constructor(...args: unknown[]); ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; ngOnDestroy(): void; /** @docs-private */ _openOnKeydownTrigger(event: KeyboardEvent): void; /** * Open the header menu. * @param openedVia Whether the header menu was opened by a key press, mouse click or programmatically. * Used for focus management after the sidenav is closed. */ openMenu(openedVia?: FocusOrigin): Promise; /** @docs-private */ _closeOnKeydownTrigger(event: KeyboardEvent): void; /** @docs-private */ _onBackdropClicked(): void; /** Close the header menu. */ closeMenu(): Promise; /** * Toggle the header menu. * @param isOpen Whether the header menu should be open. * @param openedVia Whether the header menu was opened by a key press, mouse click or programmatically. * Used for focus management after the sidenav is closed. */ toggleMenu(isOpen?: boolean, openedVia?: FocusOrigin): Promise; /** @docs-private */ _animationStartListener(event: AnimationEvent): void; /** @docs-private */ _animationDoneListener(event: AnimationEvent): void; /** Traps focus inside the header menu. */ private _trapFocus; /** * If focus is currently inside the header menu, restores it to where it was before * the header menu opened. */ private _restoreFocus; /** Updates the enabled state of the focus trap. */ private _updateFocusTrapState; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Optional component to indicate the environment of the app (e.g. dev, test, int, ...). * The component observes and extracts the text content of itself and appends * it (normalized) as a css class. * * e.g.: * dev * has the css class `sbb-header-environment-dev` */ declare class SbbHeaderEnvironment implements OnDestroy { private _destroyed; private _previousClass; constructor(...args: unknown[]); ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Optional component to display icon buttons next to the `` or the `[brand]`. * * e.g.: * ``` * * * * * ``` */ declare class SbbHeaderIconActions { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare const SBB_HEADER: InjectionToken; declare class SbbHeaderLeanModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { SBB_HEADER, SBB_HEADER_MENU_SCROLL_STRATEGY, SBB_HEADER_MENU_SCROLL_STRATEGY_FACTORY, SBB_HEADER_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER, SbbAppChooserSection, SbbHeaderEnvironment, SbbHeaderIconActions, SbbHeaderLean, SbbHeaderLeanModule, SbbHeaderMenu, SbbHeaderMenuItem, SbbHeaderMenuTrigger }; export type { SbbHeaderCollapseBreakpoint, SbbHeaderMenuToggleResult };