import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core'; import { NwbSort, NwbSortable } from './sort'; import { CdkColumnDef } from '@angular/cdk/table'; import { SortDirection } from './sort-direction'; /** * Valid positions for the arrow to be in for its opacity and translation. If the state is a * sort direction, the position of the arrow will be above/below and opacity 0. If the state is * hint, the arrow will be in the center with a slight opacity. Active state means the arrow will * be fully opaque in the center. * * @docs-private */ export declare type ArrowViewState = SortDirection | 'hint' | 'active'; /** * States describing the arrow's animated position (animating fromState to toState). * If the fromState is not defined, there will be no animated transition to the toState. * @docs-private */ export interface ArrowViewStateTransition { fromState?: ArrowViewState; toState: ArrowViewState; } export declare class NwbSortHeaderComponent implements NwbSortable, OnInit, OnDestroy { _sort: NwbSort; private _cdkColumnDef; private _rerenderSubscription; /** * Flag set to true when the indicator should be displayed while the sort is not active. Used to * provide an affordance that the header is sortable by showing on focus and hover. */ _showIndicatorHint: boolean; /** * Whether the view state animation should show the transition between the `from` and `to` states. */ _disableViewStateAnimation: boolean; /** * The view transition state of the arrow (translation/ opacity) - indicates its `from` and `to` * position through the animation. If animations are currently disabled, the fromState is removed * so that there is no animation displayed. */ _viewState: ArrowViewStateTransition; /** The direction the arrow should be facing according to the current state. */ _arrowDirection: SortDirection; id: string; /** Overrides the sort start value of the containing NwbSort for this NwbSortable. */ start: 'asc' | 'desc'; constructor(changeDetectorRef: ChangeDetectorRef, _sort: NwbSort, _cdkColumnDef: CdkColumnDef); private _updateArrow; ngOnInit(): void; /** Whether this NwbSortHeader is currently sorted in either ascending or descending order. */ isSorted(): boolean; /** Triggers the sort on this sort header and removes the indicator hint. */ handleClick(event: MouseEvent): void; /** * Sets the "hint" state such that the arrow will be semi-transparently displayed as a hint to the * user showing what the active sort will become. If set to false, the arrow will fade away. */ _setIndicatorHintVisible(visible: boolean): void; /** * Sets the animation transition view state for the arrow's position and opacity. If the * `disableViewStateAnimation` flag is set to true, the `fromState` will be ignored so that * no animation appears. */ _setAnimationTransitionState(viewState: ArrowViewStateTransition): void; /** * Updates the direction the arrow should be pointing. If it is not sorted, the arrow should be * facing the start direction. Otherwise if it is sorted, the arrow should point in the currently * active sorted direction. The reason this is updated through a function is because the direction * should only be changed at specific times - when deactivated but the hint is displayed and when * the sort is active and the direction changes. Otherwise the arrow's direction should linger * in cases such as the sort becoming deactivated but we want to animate the arrow away while * preserving its direction, even though the next sort direction is actually different and should * only be changed once the arrow displays again (hint or activation). */ _updateArrowDirection(): void; /** Returns the arrow position state (opacity, translation). */ _getArrowViewState(): string; /** Returns the animation state for the arrow direction (indicator and pointers). */ _getArrowDirectionState(): string; ngOnDestroy(): void; }