source: trip-planner-front/node_modules/@angular/material/tabs/paginated-tab-header.d.ts.__ivy_ngcc_bak@ 8d391a1

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

initial commit

  • Property mode set to 100644
File size: 8.7 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 { ChangeDetectorRef, ElementRef, NgZone, QueryList, EventEmitter, AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy } from '@angular/core';
9import { Direction, Directionality } from '@angular/cdk/bidi';
10import { NumberInput } from '@angular/cdk/coercion';
11import { ViewportRuler } from '@angular/cdk/scrolling';
12import { FocusableOption } from '@angular/cdk/a11y';
13import { Subject } from 'rxjs';
14import { Platform } from '@angular/cdk/platform';
15/**
16 * The directions that scrolling can go in when the header's tabs exceed the header width. 'After'
17 * will scroll the header towards the end of the tabs list and 'before' will scroll towards the
18 * beginning of the list.
19 */
20export declare type ScrollDirection = 'after' | 'before';
21/** Item inside a paginated tab header. */
22export declare type MatPaginatedTabHeaderItem = FocusableOption & {
23 elementRef: ElementRef;
24};
25/**
26 * Base class for a tab header that supported pagination.
27 * @docs-private
28 */
29export declare abstract class MatPaginatedTabHeader implements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy {
30 protected _elementRef: ElementRef<HTMLElement>;
31 protected _changeDetectorRef: ChangeDetectorRef;
32 private _viewportRuler;
33 private _dir;
34 private _ngZone;
35 private _platform;
36 _animationMode?: string | undefined;
37 abstract _items: QueryList<MatPaginatedTabHeaderItem>;
38 abstract _inkBar: {
39 hide: () => void;
40 alignToElement: (element: HTMLElement) => void;
41 };
42 abstract _tabListContainer: ElementRef<HTMLElement>;
43 abstract _tabList: ElementRef<HTMLElement>;
44 abstract _nextPaginator: ElementRef<HTMLElement>;
45 abstract _previousPaginator: ElementRef<HTMLElement>;
46 /** The distance in pixels that the tab labels should be translated to the left. */
47 private _scrollDistance;
48 /** Whether the header should scroll to the selected index after the view has been checked. */
49 private _selectedIndexChanged;
50 /** Emits when the component is destroyed. */
51 protected readonly _destroyed: Subject<void>;
52 /** Whether the controls for pagination should be displayed */
53 _showPaginationControls: boolean;
54 /** Whether the tab list can be scrolled more towards the end of the tab label list. */
55 _disableScrollAfter: boolean;
56 /** Whether the tab list can be scrolled more towards the beginning of the tab label list. */
57 _disableScrollBefore: boolean;
58 /**
59 * The number of tab labels that are displayed on the header. When this changes, the header
60 * should re-evaluate the scroll position.
61 */
62 private _tabLabelCount;
63 /** Whether the scroll distance has changed and should be applied after the view is checked. */
64 private _scrollDistanceChanged;
65 /** Used to manage focus between the tabs. */
66 private _keyManager;
67 /** Cached text content of the header. */
68 private _currentTextContent;
69 /** Stream that will stop the automated scrolling. */
70 private _stopScrolling;
71 /**
72 * Whether pagination should be disabled. This can be used to avoid unnecessary
73 * layout recalculations if it's known that pagination won't be required.
74 */
75 disablePagination: boolean;
76 /** The index of the active tab. */
77 get selectedIndex(): number;
78 set selectedIndex(value: number);
79 private _selectedIndex;
80 /** Event emitted when the option is selected. */
81 readonly selectFocusedIndex: EventEmitter<number>;
82 /** Event emitted when a label is focused. */
83 readonly indexFocused: EventEmitter<number>;
84 constructor(_elementRef: ElementRef<HTMLElement>, _changeDetectorRef: ChangeDetectorRef, _viewportRuler: ViewportRuler, _dir: Directionality, _ngZone: NgZone, _platform: Platform, _animationMode?: string | undefined);
85 /** Called when the user has selected an item via the keyboard. */
86 protected abstract _itemSelected(event: KeyboardEvent): void;
87 ngAfterViewInit(): void;
88 ngAfterContentInit(): void;
89 ngAfterContentChecked(): void;
90 ngOnDestroy(): void;
91 /** Handles keyboard events on the header. */
92 _handleKeydown(event: KeyboardEvent): void;
93 /**
94 * Callback for when the MutationObserver detects that the content has changed.
95 */
96 _onContentChanges(): void;
97 /**
98 * Updates the view whether pagination should be enabled or not.
99 *
100 * WARNING: Calling this method can be very costly in terms of performance. It should be called
101 * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
102 * page.
103 */
104 updatePagination(): void;
105 /** Tracks which element has focus; used for keyboard navigation */
106 get focusIndex(): number;
107 /** When the focus index is set, we must manually send focus to the correct label */
108 set focusIndex(value: number);
109 /**
110 * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
111 * providing a valid index and return true.
112 */
113 _isValidIndex(index: number): boolean;
114 /**
115 * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
116 * scrolling is enabled.
117 */
118 _setTabFocus(tabIndex: number): void;
119 /** The layout direction of the containing app. */
120 _getLayoutDirection(): Direction;
121 /** Performs the CSS transformation on the tab list that will cause the list to scroll. */
122 _updateTabScrollPosition(): void;
123 /** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
124 get scrollDistance(): number;
125 set scrollDistance(value: number);
126 /**
127 * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
128 * the end of the list, respectively). The distance to scroll is computed to be a third of the
129 * length of the tab list view window.
130 *
131 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
132 * should be called sparingly.
133 */
134 _scrollHeader(direction: ScrollDirection): {
135 maxScrollDistance: number;
136 distance: number;
137 };
138 /** Handles click events on the pagination arrows. */
139 _handlePaginatorClick(direction: ScrollDirection): void;
140 /**
141 * Moves the tab list such that the desired tab label (marked by index) is moved into view.
142 *
143 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
144 * should be called sparingly.
145 */
146 _scrollToLabel(labelIndex: number): void;
147 /**
148 * Evaluate whether the pagination controls should be displayed. If the scroll width of the
149 * tab list is wider than the size of the header container, then the pagination controls should
150 * be shown.
151 *
152 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
153 * should be called sparingly.
154 */
155 _checkPaginationEnabled(): void;
156 /**
157 * Evaluate whether the before and after controls should be enabled or disabled.
158 * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
159 * before button. If the header is at the end of the list (scroll distance is equal to the
160 * maximum distance we can scroll), then disable the after button.
161 *
162 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
163 * should be called sparingly.
164 */
165 _checkScrollingControls(): void;
166 /**
167 * Determines what is the maximum length in pixels that can be set for the scroll distance. This
168 * is equal to the difference in width between the tab list container and tab header container.
169 *
170 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
171 * should be called sparingly.
172 */
173 _getMaxScrollDistance(): number;
174 /** Tells the ink-bar to align itself to the current label wrapper */
175 _alignInkBarToSelectedTab(): void;
176 /** Stops the currently-running paginator interval. */
177 _stopInterval(): void;
178 /**
179 * Handles the user pressing down on one of the paginators.
180 * Starts scrolling the header after a certain amount of time.
181 * @param direction In which direction the paginator should be scrolled.
182 */
183 _handlePaginatorPress(direction: ScrollDirection, mouseEvent?: MouseEvent): void;
184 /**
185 * Scrolls the header to a given position.
186 * @param position Position to which to scroll.
187 * @returns Information on the current scroll distance and the maximum.
188 */
189 private _scrollTo;
190 static ngAcceptInputType_selectedIndex: NumberInput;
191}
Note: See TracBrowser for help on using the repository browser.