source: trip-planner-front/node_modules/@angular/material/esm2015/tabs/paginated-tab-header.js@ 6a80231

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

initial commit

  • Property mode set to 100644
File size: 66.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, Optional, EventEmitter, Directive, Inject, Input, } from '@angular/core';
9import { Directionality } from '@angular/cdk/bidi';
10import { coerceNumberProperty } from '@angular/cdk/coercion';
11import { ViewportRuler } from '@angular/cdk/scrolling';
12import { FocusKeyManager } from '@angular/cdk/a11y';
13import { ENTER, SPACE, hasModifierKey } from '@angular/cdk/keycodes';
14import { merge, of as observableOf, Subject, timer, fromEvent } from 'rxjs';
15import { takeUntil } from 'rxjs/operators';
16import { Platform, normalizePassiveListenerOptions } from '@angular/cdk/platform';
17import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
18/** Config used to bind passive event listeners */
19const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });
20/**
21 * The distance in pixels that will be overshot when scrolling a tab label into view. This helps
22 * provide a small affordance to the label next to it.
23 */
24const EXAGGERATED_OVERSCROLL = 60;
25/**
26 * Amount of milliseconds to wait before starting to scroll the header automatically.
27 * Set a little conservatively in order to handle fake events dispatched on touch devices.
28 */
29const HEADER_SCROLL_DELAY = 650;
30/**
31 * Interval in milliseconds at which to scroll the header
32 * while the user is holding their pointer.
33 */
34const HEADER_SCROLL_INTERVAL = 100;
35/**
36 * Base class for a tab header that supported pagination.
37 * @docs-private
38 */
39export class MatPaginatedTabHeader {
40 constructor(_elementRef, _changeDetectorRef, _viewportRuler, _dir, _ngZone, _platform, _animationMode) {
41 this._elementRef = _elementRef;
42 this._changeDetectorRef = _changeDetectorRef;
43 this._viewportRuler = _viewportRuler;
44 this._dir = _dir;
45 this._ngZone = _ngZone;
46 this._platform = _platform;
47 this._animationMode = _animationMode;
48 /** The distance in pixels that the tab labels should be translated to the left. */
49 this._scrollDistance = 0;
50 /** Whether the header should scroll to the selected index after the view has been checked. */
51 this._selectedIndexChanged = false;
52 /** Emits when the component is destroyed. */
53 this._destroyed = new Subject();
54 /** Whether the controls for pagination should be displayed */
55 this._showPaginationControls = false;
56 /** Whether the tab list can be scrolled more towards the end of the tab label list. */
57 this._disableScrollAfter = true;
58 /** Whether the tab list can be scrolled more towards the beginning of the tab label list. */
59 this._disableScrollBefore = true;
60 /** Stream that will stop the automated scrolling. */
61 this._stopScrolling = new Subject();
62 /**
63 * Whether pagination should be disabled. This can be used to avoid unnecessary
64 * layout recalculations if it's known that pagination won't be required.
65 */
66 this.disablePagination = false;
67 this._selectedIndex = 0;
68 /** Event emitted when the option is selected. */
69 this.selectFocusedIndex = new EventEmitter();
70 /** Event emitted when a label is focused. */
71 this.indexFocused = new EventEmitter();
72 // Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
73 _ngZone.runOutsideAngular(() => {
74 fromEvent(_elementRef.nativeElement, 'mouseleave')
75 .pipe(takeUntil(this._destroyed))
76 .subscribe(() => {
77 this._stopInterval();
78 });
79 });
80 }
81 /** The index of the active tab. */
82 get selectedIndex() { return this._selectedIndex; }
83 set selectedIndex(value) {
84 value = coerceNumberProperty(value);
85 if (this._selectedIndex != value) {
86 this._selectedIndexChanged = true;
87 this._selectedIndex = value;
88 if (this._keyManager) {
89 this._keyManager.updateActiveItem(value);
90 }
91 }
92 }
93 ngAfterViewInit() {
94 // We need to handle these events manually, because we want to bind passive event listeners.
95 fromEvent(this._previousPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
96 .pipe(takeUntil(this._destroyed))
97 .subscribe(() => {
98 this._handlePaginatorPress('before');
99 });
100 fromEvent(this._nextPaginator.nativeElement, 'touchstart', passiveEventListenerOptions)
101 .pipe(takeUntil(this._destroyed))
102 .subscribe(() => {
103 this._handlePaginatorPress('after');
104 });
105 }
106 ngAfterContentInit() {
107 const dirChange = this._dir ? this._dir.change : observableOf('ltr');
108 const resize = this._viewportRuler.change(150);
109 const realign = () => {
110 this.updatePagination();
111 this._alignInkBarToSelectedTab();
112 };
113 this._keyManager = new FocusKeyManager(this._items)
114 .withHorizontalOrientation(this._getLayoutDirection())
115 .withHomeAndEnd()
116 .withWrap();
117 this._keyManager.updateActiveItem(this._selectedIndex);
118 // Defer the first call in order to allow for slower browsers to lay out the elements.
119 // This helps in cases where the user lands directly on a page with paginated tabs.
120 typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame(realign) : realign();
121 // On dir change or window resize, realign the ink bar and update the orientation of
122 // the key manager if the direction has changed.
123 merge(dirChange, resize, this._items.changes).pipe(takeUntil(this._destroyed)).subscribe(() => {
124 // We need to defer this to give the browser some time to recalculate
125 // the element dimensions. The call has to be wrapped in `NgZone.run`,
126 // because the viewport change handler runs outside of Angular.
127 this._ngZone.run(() => Promise.resolve().then(realign));
128 this._keyManager.withHorizontalOrientation(this._getLayoutDirection());
129 });
130 // If there is a change in the focus key manager we need to emit the `indexFocused`
131 // event in order to provide a public event that notifies about focus changes. Also we realign
132 // the tabs container by scrolling the new focused tab into the visible section.
133 this._keyManager.change.pipe(takeUntil(this._destroyed)).subscribe(newFocusIndex => {
134 this.indexFocused.emit(newFocusIndex);
135 this._setTabFocus(newFocusIndex);
136 });
137 }
138 ngAfterContentChecked() {
139 // If the number of tab labels have changed, check if scrolling should be enabled
140 if (this._tabLabelCount != this._items.length) {
141 this.updatePagination();
142 this._tabLabelCount = this._items.length;
143 this._changeDetectorRef.markForCheck();
144 }
145 // If the selected index has changed, scroll to the label and check if the scrolling controls
146 // should be disabled.
147 if (this._selectedIndexChanged) {
148 this._scrollToLabel(this._selectedIndex);
149 this._checkScrollingControls();
150 this._alignInkBarToSelectedTab();
151 this._selectedIndexChanged = false;
152 this._changeDetectorRef.markForCheck();
153 }
154 // If the scroll distance has been changed (tab selected, focused, scroll controls activated),
155 // then translate the header to reflect this.
156 if (this._scrollDistanceChanged) {
157 this._updateTabScrollPosition();
158 this._scrollDistanceChanged = false;
159 this._changeDetectorRef.markForCheck();
160 }
161 }
162 ngOnDestroy() {
163 this._destroyed.next();
164 this._destroyed.complete();
165 this._stopScrolling.complete();
166 }
167 /** Handles keyboard events on the header. */
168 _handleKeydown(event) {
169 // We don't handle any key bindings with a modifier key.
170 if (hasModifierKey(event)) {
171 return;
172 }
173 switch (event.keyCode) {
174 case ENTER:
175 case SPACE:
176 if (this.focusIndex !== this.selectedIndex) {
177 this.selectFocusedIndex.emit(this.focusIndex);
178 this._itemSelected(event);
179 }
180 break;
181 default:
182 this._keyManager.onKeydown(event);
183 }
184 }
185 /**
186 * Callback for when the MutationObserver detects that the content has changed.
187 */
188 _onContentChanges() {
189 const textContent = this._elementRef.nativeElement.textContent;
190 // We need to diff the text content of the header, because the MutationObserver callback
191 // will fire even if the text content didn't change which is inefficient and is prone
192 // to infinite loops if a poorly constructed expression is passed in (see #14249).
193 if (textContent !== this._currentTextContent) {
194 this._currentTextContent = textContent || '';
195 // The content observer runs outside the `NgZone` by default, which
196 // means that we need to bring the callback back in ourselves.
197 this._ngZone.run(() => {
198 this.updatePagination();
199 this._alignInkBarToSelectedTab();
200 this._changeDetectorRef.markForCheck();
201 });
202 }
203 }
204 /**
205 * Updates the view whether pagination should be enabled or not.
206 *
207 * WARNING: Calling this method can be very costly in terms of performance. It should be called
208 * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
209 * page.
210 */
211 updatePagination() {
212 this._checkPaginationEnabled();
213 this._checkScrollingControls();
214 this._updateTabScrollPosition();
215 }
216 /** Tracks which element has focus; used for keyboard navigation */
217 get focusIndex() {
218 return this._keyManager ? this._keyManager.activeItemIndex : 0;
219 }
220 /** When the focus index is set, we must manually send focus to the correct label */
221 set focusIndex(value) {
222 if (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {
223 return;
224 }
225 this._keyManager.setActiveItem(value);
226 }
227 /**
228 * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
229 * providing a valid index and return true.
230 */
231 _isValidIndex(index) {
232 if (!this._items) {
233 return true;
234 }
235 const tab = this._items ? this._items.toArray()[index] : null;
236 return !!tab && !tab.disabled;
237 }
238 /**
239 * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
240 * scrolling is enabled.
241 */
242 _setTabFocus(tabIndex) {
243 if (this._showPaginationControls) {
244 this._scrollToLabel(tabIndex);
245 }
246 if (this._items && this._items.length) {
247 this._items.toArray()[tabIndex].focus();
248 // Do not let the browser manage scrolling to focus the element, this will be handled
249 // by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
250 // should be the full width minus the offset width.
251 const containerEl = this._tabListContainer.nativeElement;
252 const dir = this._getLayoutDirection();
253 if (dir == 'ltr') {
254 containerEl.scrollLeft = 0;
255 }
256 else {
257 containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
258 }
259 }
260 }
261 /** The layout direction of the containing app. */
262 _getLayoutDirection() {
263 return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
264 }
265 /** Performs the CSS transformation on the tab list that will cause the list to scroll. */
266 _updateTabScrollPosition() {
267 if (this.disablePagination) {
268 return;
269 }
270 const scrollDistance = this.scrollDistance;
271 const translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
272 // Don't use `translate3d` here because we don't want to create a new layer. A new layer
273 // seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
274 // and ripples will exceed the boundaries of the visible tab bar.
275 // See: https://github.com/angular/components/issues/10276
276 // We round the `transform` here, because transforms with sub-pixel precision cause some
277 // browsers to blur the content of the element.
278 this._tabList.nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;
279 // Setting the `transform` on IE will change the scroll offset of the parent, causing the
280 // position to be thrown off in some cases. We have to reset it ourselves to ensure that
281 // it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
282 // with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
283 if (this._platform.TRIDENT || this._platform.EDGE) {
284 this._tabListContainer.nativeElement.scrollLeft = 0;
285 }
286 }
287 /** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
288 get scrollDistance() { return this._scrollDistance; }
289 set scrollDistance(value) {
290 this._scrollTo(value);
291 }
292 /**
293 * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
294 * the end of the list, respectively). The distance to scroll is computed to be a third of the
295 * length of the tab list view window.
296 *
297 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
298 * should be called sparingly.
299 */
300 _scrollHeader(direction) {
301 const viewLength = this._tabListContainer.nativeElement.offsetWidth;
302 // Move the scroll distance one-third the length of the tab list's viewport.
303 const scrollAmount = (direction == 'before' ? -1 : 1) * viewLength / 3;
304 return this._scrollTo(this._scrollDistance + scrollAmount);
305 }
306 /** Handles click events on the pagination arrows. */
307 _handlePaginatorClick(direction) {
308 this._stopInterval();
309 this._scrollHeader(direction);
310 }
311 /**
312 * Moves the tab list such that the desired tab label (marked by index) is moved into view.
313 *
314 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
315 * should be called sparingly.
316 */
317 _scrollToLabel(labelIndex) {
318 if (this.disablePagination) {
319 return;
320 }
321 const selectedLabel = this._items ? this._items.toArray()[labelIndex] : null;
322 if (!selectedLabel) {
323 return;
324 }
325 // The view length is the visible width of the tab labels.
326 const viewLength = this._tabListContainer.nativeElement.offsetWidth;
327 const { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;
328 let labelBeforePos, labelAfterPos;
329 if (this._getLayoutDirection() == 'ltr') {
330 labelBeforePos = offsetLeft;
331 labelAfterPos = labelBeforePos + offsetWidth;
332 }
333 else {
334 labelAfterPos = this._tabList.nativeElement.offsetWidth - offsetLeft;
335 labelBeforePos = labelAfterPos - offsetWidth;
336 }
337 const beforeVisiblePos = this.scrollDistance;
338 const afterVisiblePos = this.scrollDistance + viewLength;
339 if (labelBeforePos < beforeVisiblePos) {
340 // Scroll header to move label to the before direction
341 this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
342 }
343 else if (labelAfterPos > afterVisiblePos) {
344 // Scroll header to move label to the after direction
345 this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
346 }
347 }
348 /**
349 * Evaluate whether the pagination controls should be displayed. If the scroll width of the
350 * tab list is wider than the size of the header container, then the pagination controls should
351 * be shown.
352 *
353 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
354 * should be called sparingly.
355 */
356 _checkPaginationEnabled() {
357 if (this.disablePagination) {
358 this._showPaginationControls = false;
359 }
360 else {
361 const isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
362 if (!isEnabled) {
363 this.scrollDistance = 0;
364 }
365 if (isEnabled !== this._showPaginationControls) {
366 this._changeDetectorRef.markForCheck();
367 }
368 this._showPaginationControls = isEnabled;
369 }
370 }
371 /**
372 * Evaluate whether the before and after controls should be enabled or disabled.
373 * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
374 * before button. If the header is at the end of the list (scroll distance is equal to the
375 * maximum distance we can scroll), then disable the after button.
376 *
377 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
378 * should be called sparingly.
379 */
380 _checkScrollingControls() {
381 if (this.disablePagination) {
382 this._disableScrollAfter = this._disableScrollBefore = true;
383 }
384 else {
385 // Check if the pagination arrows should be activated.
386 this._disableScrollBefore = this.scrollDistance == 0;
387 this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();
388 this._changeDetectorRef.markForCheck();
389 }
390 }
391 /**
392 * Determines what is the maximum length in pixels that can be set for the scroll distance. This
393 * is equal to the difference in width between the tab list container and tab header container.
394 *
395 * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
396 * should be called sparingly.
397 */
398 _getMaxScrollDistance() {
399 const lengthOfTabList = this._tabList.nativeElement.scrollWidth;
400 const viewLength = this._tabListContainer.nativeElement.offsetWidth;
401 return (lengthOfTabList - viewLength) || 0;
402 }
403 /** Tells the ink-bar to align itself to the current label wrapper */
404 _alignInkBarToSelectedTab() {
405 const selectedItem = this._items && this._items.length ?
406 this._items.toArray()[this.selectedIndex] : null;
407 const selectedLabelWrapper = selectedItem ? selectedItem.elementRef.nativeElement : null;
408 if (selectedLabelWrapper) {
409 this._inkBar.alignToElement(selectedLabelWrapper);
410 }
411 else {
412 this._inkBar.hide();
413 }
414 }
415 /** Stops the currently-running paginator interval. */
416 _stopInterval() {
417 this._stopScrolling.next();
418 }
419 /**
420 * Handles the user pressing down on one of the paginators.
421 * Starts scrolling the header after a certain amount of time.
422 * @param direction In which direction the paginator should be scrolled.
423 */
424 _handlePaginatorPress(direction, mouseEvent) {
425 // Don't start auto scrolling for right mouse button clicks. Note that we shouldn't have to
426 // null check the `button`, but we do it so we don't break tests that use fake events.
427 if (mouseEvent && mouseEvent.button != null && mouseEvent.button !== 0) {
428 return;
429 }
430 // Avoid overlapping timers.
431 this._stopInterval();
432 // Start a timer after the delay and keep firing based on the interval.
433 timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
434 // Keep the timer going until something tells it to stop or the component is destroyed.
435 .pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))
436 .subscribe(() => {
437 const { maxScrollDistance, distance } = this._scrollHeader(direction);
438 // Stop the timer if we've reached the start or the end.
439 if (distance === 0 || distance >= maxScrollDistance) {
440 this._stopInterval();
441 }
442 });
443 }
444 /**
445 * Scrolls the header to a given position.
446 * @param position Position to which to scroll.
447 * @returns Information on the current scroll distance and the maximum.
448 */
449 _scrollTo(position) {
450 if (this.disablePagination) {
451 return { maxScrollDistance: 0, distance: 0 };
452 }
453 const maxScrollDistance = this._getMaxScrollDistance();
454 this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
455 // Mark that the scroll distance has changed so that after the view is checked, the CSS
456 // transformation can move the header.
457 this._scrollDistanceChanged = true;
458 this._checkScrollingControls();
459 return { maxScrollDistance, distance: this._scrollDistance };
460 }
461}
462MatPaginatedTabHeader.decorators = [
463 { type: Directive }
464];
465MatPaginatedTabHeader.ctorParameters = () => [
466 { type: ElementRef },
467 { type: ChangeDetectorRef },
468 { type: ViewportRuler },
469 { type: Directionality, decorators: [{ type: Optional }] },
470 { type: NgZone },
471 { type: Platform },
472 { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
473];
474MatPaginatedTabHeader.propDecorators = {
475 disablePagination: [{ type: Input }]
476};
477//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFnaW5hdGVkLXRhYi1oZWFkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvdGFicy9wYWdpbmF0ZWQtdGFiLWhlYWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQ0wsaUJBQWlCLEVBQ2pCLFVBQVUsRUFDVixNQUFNLEVBQ04sUUFBUSxFQUVSLFlBQVksRUFLWixTQUFTLEVBQ1QsTUFBTSxFQUNOLEtBQUssR0FDTixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQVksY0FBYyxFQUFDLE1BQU0sbUJBQW1CLENBQUM7QUFDNUQsT0FBTyxFQUFDLG9CQUFvQixFQUFjLE1BQU0sdUJBQXVCLENBQUM7QUFDeEUsT0FBTyxFQUFDLGFBQWEsRUFBQyxNQUFNLHdCQUF3QixDQUFDO0FBQ3JELE9BQU8sRUFBQyxlQUFlLEVBQWtCLE1BQU0sbUJBQW1CLENBQUM7QUFDbkUsT0FBTyxFQUFDLEtBQUssRUFBRSxLQUFLLEVBQUUsY0FBYyxFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFDbkUsT0FBTyxFQUFDLEtBQUssRUFBRSxFQUFFLElBQUksWUFBWSxFQUFFLE9BQU8sRUFBRSxLQU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