source: trip-planner-front/node_modules/@angular/material/sort/sort-header.d.ts@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 6.9 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { BooleanInput } from '@angular/cdk/coercion';
9import { ChangeDetectorRef, OnDestroy, OnInit, ElementRef, AfterViewInit } from '@angular/core';
10import { CanDisable } from '@angular/material/core';
11import { FocusMonitor } from '@angular/cdk/a11y';
12import { MatSort, MatSortable } from './sort';
13import { SortDirection } from './sort-direction';
14import { MatSortHeaderIntl } from './sort-header-intl';
15/** @docs-private */
16declare const _MatSortHeaderBase: import("@angular/material/core/common-behaviors/constructor").Constructor<CanDisable> & import("@angular/material/core/common-behaviors/constructor").AbstractConstructor<CanDisable> & {
17 new (): {};
18};
19/**
20 * Valid positions for the arrow to be in for its opacity and translation. If the state is a
21 * sort direction, the position of the arrow will be above/below and opacity 0. If the state is
22 * hint, the arrow will be in the center with a slight opacity. Active state means the arrow will
23 * be fully opaque in the center.
24 *
25 * @docs-private
26 */
27export declare type ArrowViewState = SortDirection | 'hint' | 'active';
28/**
29 * States describing the arrow's animated position (animating fromState to toState).
30 * If the fromState is not defined, there will be no animated transition to the toState.
31 * @docs-private
32 */
33export interface ArrowViewStateTransition {
34 fromState?: ArrowViewState;
35 toState?: ArrowViewState;
36}
37/** Column definition associated with a `MatSortHeader`. */
38interface MatSortHeaderColumnDef {
39 name: string;
40}
41/**
42 * Applies sorting behavior (click to change sort) and styles to an element, including an
43 * arrow to display the current sort direction.
44 *
45 * Must be provided with an id and contained within a parent MatSort directive.
46 *
47 * If used on header cells in a CdkTable, it will automatically default its id from its containing
48 * column definition.
49 */
50export declare class MatSortHeader extends _MatSortHeaderBase implements CanDisable, MatSortable, OnDestroy, OnInit, AfterViewInit {
51 /**
52 * @deprecated `_intl` parameter isn't being used anymore and it'll be removed.
53 * @breaking-change 13.0.0
54 */
55 _intl: MatSortHeaderIntl;
56 private _changeDetectorRef;
57 _sort: MatSort;
58 _columnDef: MatSortHeaderColumnDef;
59 private _focusMonitor;
60 private _elementRef;
61 private _rerenderSubscription;
62 /**
63 * Flag set to true when the indicator should be displayed while the sort is not active. Used to
64 * provide an affordance that the header is sortable by showing on focus and hover.
65 */
66 _showIndicatorHint: boolean;
67 /**
68 * The view transition state of the arrow (translation/ opacity) - indicates its `from` and `to`
69 * position through the animation. If animations are currently disabled, the fromState is removed
70 * so that there is no animation displayed.
71 */
72 _viewState: ArrowViewStateTransition;
73 /** The direction the arrow should be facing according to the current state. */
74 _arrowDirection: SortDirection;
75 /**
76 * Whether the view state animation should show the transition between the `from` and `to` states.
77 */
78 _disableViewStateAnimation: boolean;
79 /**
80 * ID of this sort header. If used within the context of a CdkColumnDef, this will default to
81 * the column's name.
82 */
83 id: string;
84 /** Sets the position of the arrow that displays when sorted. */
85 arrowPosition: 'before' | 'after';
86 /** Overrides the sort start value of the containing MatSort for this MatSortable. */
87 start: 'asc' | 'desc';
88 /** Overrides the disable clear value of the containing MatSort for this MatSortable. */
89 get disableClear(): boolean;
90 set disableClear(v: boolean);
91 private _disableClear;
92 constructor(
93 /**
94 * @deprecated `_intl` parameter isn't being used anymore and it'll be removed.
95 * @breaking-change 13.0.0
96 */
97 _intl: MatSortHeaderIntl, _changeDetectorRef: ChangeDetectorRef, _sort: MatSort, _columnDef: MatSortHeaderColumnDef, _focusMonitor: FocusMonitor, _elementRef: ElementRef<HTMLElement>);
98 ngOnInit(): void;
99 ngAfterViewInit(): void;
100 ngOnDestroy(): void;
101 /**
102 * Sets the "hint" state such that the arrow will be semi-transparently displayed as a hint to the
103 * user showing what the active sort will become. If set to false, the arrow will fade away.
104 */
105 _setIndicatorHintVisible(visible: boolean): void;
106 /**
107 * Sets the animation transition view state for the arrow's position and opacity. If the
108 * `disableViewStateAnimation` flag is set to true, the `fromState` will be ignored so that
109 * no animation appears.
110 */
111 _setAnimationTransitionState(viewState: ArrowViewStateTransition): void;
112 /** Triggers the sort on this sort header and removes the indicator hint. */
113 _toggleOnInteraction(): void;
114 _handleClick(): void;
115 _handleKeydown(event: KeyboardEvent): void;
116 /** Whether this MatSortHeader is currently sorted in either ascending or descending order. */
117 _isSorted(): boolean;
118 /** Returns the animation state for the arrow direction (indicator and pointers). */
119 _getArrowDirectionState(): string;
120 /** Returns the arrow position state (opacity, translation). */
121 _getArrowViewState(): string;
122 /**
123 * Updates the direction the arrow should be pointing. If it is not sorted, the arrow should be
124 * facing the start direction. Otherwise if it is sorted, the arrow should point in the currently
125 * active sorted direction. The reason this is updated through a function is because the direction
126 * should only be changed at specific times - when deactivated but the hint is displayed and when
127 * the sort is active and the direction changes. Otherwise the arrow's direction should linger
128 * in cases such as the sort becoming deactivated but we want to animate the arrow away while
129 * preserving its direction, even though the next sort direction is actually different and should
130 * only be changed once the arrow displays again (hint or activation).
131 */
132 _updateArrowDirection(): void;
133 _isDisabled(): boolean;
134 /**
135 * Gets the aria-sort attribute that should be applied to this sort header. If this header
136 * is not sorted, returns null so that the attribute is removed from the host element. Aria spec
137 * says that the aria-sort property should only be present on one header at a time, so removing
138 * ensures this is true.
139 */
140 _getAriaSortAttribute(): "none" | "ascending" | "descending";
141 /** Whether the arrow inside the sort header should be rendered. */
142 _renderArrow(): boolean;
143 /** Handles changes in the sorting state. */
144 private _handleStateChanges;
145 static ngAcceptInputType_disableClear: BooleanInput;
146 static ngAcceptInputType_disabled: BooleanInput;
147}
148export {};
Note: See TracBrowser for help on using the repository browser.