/** Autogenerated by public2business schematic. DO NOT CHANGE! */ import { BooleanInput } from '@angular/cdk/coercion'; import { FlexibleConnectedPositionStrategy, Overlay, PositionStrategy, ScrollStrategy } from '@angular/cdk/overlay'; import { ViewportRuler } from '@angular/cdk/scrolling'; import { ChangeDetectorRef, ElementRef, InjectionToken, NgZone, OnDestroy, ViewContainerRef } from '@angular/core'; import { TypeRef } from '@sbb-esta/angular-core/common-behaviors'; import { Observable } from 'rxjs'; import { SbbDropdownItem, SbbDropdownSelectionChange } from './dropdown-item.directive'; import { SbbDropdownOrigin } from './dropdown-origin.directive'; import { SbbDropdown } from './dropdown/dropdown.component'; /** * Creates an error to be thrown when attempting to use an dropdown trigger without a panel. * @docs-private */ export declare function getSbbDropdownMissingPanelError(): Error; /** Injection token that determines the scroll handling while the dropdown panel is open. */ export declare const SBB_DROPDOWN_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>; /** @docs-private */ export declare function SBB_DROPDOWN_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy; /** The height of each dropdown option. */ export declare const SBB_DROPDOWN_OPTION_HEIGHT = 40; /** The total height of the dropdown panel. */ export declare const SBB_DROPDOWN_PANEL_HEIGHT = 404; export declare const SBB_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER: { provide: InjectionToken<() => ScrollStrategy>; deps: (typeof Overlay)[]; useFactory: typeof SBB_DROPDOWN_SCROLL_STRATEGY_FACTORY; }; export declare class SbbDropdownTrigger implements OnDestroy { protected _elementRef: ElementRef; protected _overlay: Overlay; protected _viewContainerRef: ViewContainerRef; protected _zone: NgZone; protected _changeDetectorRef: ChangeDetectorRef; protected _scrollStrategy: any; protected _document: any; protected _viewportRuler?: ViewportRuler | undefined; /** * Whether the dropdown is disabled. When disabled, the element will * act as a regular input and the user won't be able to open the panel. */ get dropdownDisabled(): boolean; set dropdownDisabled(value: boolean); private _dropdownDisabled; /** Whether or not the dropdown panel is open. */ get panelOpen(): boolean; /** * A stream of actions that should close the dropdown panel, including * when an option is selected, on blur, and when TAB is pressed. */ get panelClosingActions(): Observable; /** The currently active option, coerced to SbbOption type. */ get activeOption(): SbbDropdownItem | null; /** The dropdown panel to be attached to this trigger. */ dropdown: SbbDropdown; /** * Reference relative to which to position the dropdown panel. * Defaults to the dropdown trigger element. */ connectedTo: SbbDropdownOrigin; panelClass: string; /** Whether the dropdown should be opened on the left or the right side of the origin. */ horizontalOrientation: 'left' | 'right' | 'prefer-right' | 'prefer-left'; /** Stream of dropdown option selections. */ readonly optionSelections: Observable; private _overlayRef; private _portal; private _componentDestroyed; /** Strategy that is used to position the panel. */ protected _positionStrategy: FlexibleConnectedPositionStrategy; /** The subscription for closing actions (some are bound to document). */ private _closingActionsSubscription; /** Subscription to viewport size changes. */ private _viewportSubscription; private _positionSubscription; /** Stream of keyboard events that can close the panel. */ private readonly _closeKeyEventStream; private _overlayAttached; /** Whether the element is inside of a ShadowRoot component. */ private _isInsideShadowRoot; constructor(_elementRef: ElementRef, _overlay: Overlay, _viewContainerRef: ViewContainerRef, _zone: NgZone, _changeDetectorRef: ChangeDetectorRef, _scrollStrategy: any, _document: any, _viewportRuler?: ViewportRuler | undefined); ngOnDestroy(): void; _onBlur(): void; /** Handles all keydown events on the select. */ _handleKeydown(event: TypeRef): void; /** Handles keyboard events while the select is closed. */ private _handleClosedKeydown; /** Handles keyboard events when the selected is open. */ private _handleOpenKeydown; /** Opens the dropdown suggestion panel. */ openPanel(): void; /** Closes the dropdown suggestion panel. */ closePanel(): void; /** Stream of clicks outside of the dropdown panel. */ private _getOutsideClickStream; scrollToOption(): void; _handleClick(event: any): void; /** * This method listens to a stream of panel closing actions and resets the * stream every time the option list changes. */ private _subscribeToClosingActions; /** Destroys the dropdown suggestion panel. */ private _destroyPanel; /** * This method closes the panel, and if a value is specified, also sets the associated * control to that value. It will also mark the control as dirty if this interaction * stemmed from the user. */ private _setValueAndClose; /** Clear any previous selected option and emit a selection change event for this option */ private _clearPreviousSelectedOption; protected _attachOverlay(): void; private _getOverlayConfig; protected _getOverlayPosition(): PositionStrategy; protected _getConnectedElement(): ElementRef; protected _getPanelWidth(): number | string; /** Returns the width of the input element, so the panel width can match it. */ protected _getHostWidth(): number; /** * Resets the active item to -1 so arrow events will activate the * correct options, or to 0 if the consumer opted into it. */ private _resetActiveItem; /** Determines whether the panel can be opened. */ private _canOpen; static ngAcceptInputType_dropdownDisabled: BooleanInput; }