/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { FocusMonitor } from '@angular/cdk/a11y'; import { Directionality } from '@angular/cdk/bidi'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { Platform } from '@angular/cdk/platform'; import { ViewportRuler } from '@angular/cdk/scrolling'; import { Attribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, Directive, ElementRef, forwardRef, Inject, Input, NgZone, Optional, QueryList, ViewChild, ViewEncapsulation, } from '@angular/core'; import { MAT_RIPPLE_GLOBAL_OPTIONS, mixinDisabled, mixinDisableRipple, mixinTabIndex, RippleRenderer, } from '@angular/material/core'; import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations'; import { startWith, takeUntil } from 'rxjs/operators'; import { MatInkBar } from '../ink-bar'; import { MatPaginatedTabHeader } from '../paginated-tab-header'; /** * Base class with all of the `MatTabNav` functionality. * @docs-private */ export class _MatTabNavBase extends MatPaginatedTabHeader { constructor(elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform, animationMode) { super(elementRef, changeDetectorRef, viewportRuler, dir, ngZone, platform, animationMode); this._disableRipple = false; /** Theme color of the nav bar. */ this.color = 'primary'; } /** Background color of the tab nav. */ get backgroundColor() { return this._backgroundColor; } set backgroundColor(value) { const classList = this._elementRef.nativeElement.classList; classList.remove(`mat-background-${this.backgroundColor}`); if (value) { classList.add(`mat-background-${value}`); } this._backgroundColor = value; } /** Whether the ripple effect is disabled or not. */ get disableRipple() { return this._disableRipple; } set disableRipple(value) { this._disableRipple = coerceBooleanProperty(value); } _itemSelected() { // noop } ngAfterContentInit() { // We need this to run before the `changes` subscription in parent to ensure that the // selectedIndex is up-to-date by the time the super class starts looking for it. this._items.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => { this.updateActiveLink(); }); super.ngAfterContentInit(); } /** Notifies the component that the active link has been changed. */ updateActiveLink() { if (!this._items) { return; } const items = this._items.toArray(); for (let i = 0; i < items.length; i++) { if (items[i].active) { this.selectedIndex = i; this._changeDetectorRef.markForCheck(); return; } } // The ink bar should hide itself if no items are active. this.selectedIndex = -1; this._inkBar.hide(); } } _MatTabNavBase.decorators = [ { type: Directive } ]; _MatTabNavBase.ctorParameters = () => [ { type: ElementRef }, { type: Directionality, decorators: [{ type: Optional }] }, { type: NgZone }, { type: ChangeDetectorRef }, { type: ViewportRuler }, { type: Platform }, { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] } ]; _MatTabNavBase.propDecorators = { backgroundColor: [{ type: Input }], disableRipple: [{ type: Input }], color: [{ type: Input }] }; /** * Navigation component matching the styles of the tab group header. * Provides anchored navigation with animated ink bar. */ export class MatTabNav extends _MatTabNavBase { constructor(elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform, animationMode) { super(elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform, animationMode); } } MatTabNav.decorators = [ { type: Component, args: [{ selector: '[mat-tab-nav-bar]', exportAs: 'matTabNavBar, matTabNav', inputs: ['color'], template: "
\n
\n
\n\n\n\n\n
\n
\n
\n", host: { 'class': 'mat-tab-nav-bar mat-tab-header', '[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls', '[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'", '[class.mat-primary]': 'color !== "warn" && color !== "accent"', '[class.mat-accent]': 'color === "accent"', '[class.mat-warn]': 'color === "warn"', }, encapsulation: ViewEncapsulation.None, // tslint:disable-next-line:validate-decorators changeDetection: ChangeDetectionStrategy.Default, styles: [".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-header-pagination{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:transparent;touch-action:none}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;content:\"\";height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-list{flex-grow:1;position:relative;transition:transform 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-tab-links{display:flex}[mat-align-tabs=center]>.mat-tab-link-container .mat-tab-links{justify-content:center}[mat-align-tabs=end]>.mat-tab-link-container .mat-tab-links{justify-content:flex-end}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-link-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}.mat-tab-link{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;vertical-align:top;text-decoration:none;position:relative;overflow:hidden;-webkit-tap-highlight-color:transparent}.mat-tab-link:focus{outline:none}.mat-tab-link:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-link:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-link.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-link.mat-tab-disabled{opacity:.5}.mat-tab-link .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-link{opacity:1}[mat-stretch-tabs] .mat-tab-link{flex-basis:0;flex-grow:1}.mat-tab-link.mat-tab-disabled{pointer-events:none}@media(max-width: 599px){.mat-tab-link{min-width:72px}}\n"] },] } ]; MatTabNav.ctorParameters = () => [ { type: ElementRef }, { type: Directionality, decorators: [{ type: Optional }] }, { type: NgZone }, { type: ChangeDetectorRef }, { type: ViewportRuler }, { type: Platform }, { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] } ]; MatTabNav.propDecorators = { _items: [{ type: ContentChildren, args: [forwardRef(() => MatTabLink), { descendants: true },] }], _inkBar: [{ type: ViewChild, args: [MatInkBar, { static: true },] }], _tabListContainer: [{ type: ViewChild, args: ['tabListContainer', { static: true },] }], _tabList: [{ type: ViewChild, args: ['tabList', { static: true },] }], _nextPaginator: [{ type: ViewChild, args: ['nextPaginator',] }], _previousPaginator: [{ type: ViewChild, args: ['previousPaginator',] }] }; // Boilerplate for applying mixins to MatTabLink. const _MatTabLinkMixinBase = mixinTabIndex(mixinDisableRipple(mixinDisabled(class { }))); /** Base class with all of the `MatTabLink` functionality. */ export class _MatTabLinkBase extends _MatTabLinkMixinBase { constructor(_tabNavBar, /** @docs-private */ elementRef, globalRippleOptions, tabIndex, _focusMonitor, animationMode) { super(); this._tabNavBar = _tabNavBar; this.elementRef = elementRef; this._focusMonitor = _focusMonitor; /** Whether the tab link is active or not. */ this._isActive = false; this.rippleConfig = globalRippleOptions || {}; this.tabIndex = parseInt(tabIndex) || 0; if (animationMode === 'NoopAnimations') { this.rippleConfig.animation = { enterDuration: 0, exitDuration: 0 }; } } /** Whether the link is active. */ get active() { return this._isActive; } set active(value) { const newValue = coerceBooleanProperty(value); if (newValue !== this._isActive) { this._isActive = value; this._tabNavBar.updateActiveLink(); } } /** * Whether ripples are disabled on interaction. * @docs-private */ get rippleDisabled() { return this.disabled || this.disableRipple || this._tabNavBar.disableRipple || !!this.rippleConfig.disabled; } /** Focuses the tab link. */ focus() { this.elementRef.nativeElement.focus(); } ngAfterViewInit() { this._focusMonitor.monitor(this.elementRef); } ngOnDestroy() { this._focusMonitor.stopMonitoring(this.elementRef); } _handleFocus() { // Since we allow navigation through tabbing in the nav bar, we // have to update the focused index whenever the link receives focus. this._tabNavBar.focusIndex = this._tabNavBar._items.toArray().indexOf(this); } } _MatTabLinkBase.decorators = [ { type: Directive } ]; _MatTabLinkBase.ctorParameters = () => [ { type: _MatTabNavBase }, { type: ElementRef }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] }, { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] }, { type: FocusMonitor }, { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] } ]; _MatTabLinkBase.propDecorators = { active: [{ type: Input }] }; /** * Link inside of a `mat-tab-nav-bar`. */ export class MatTabLink extends _MatTabLinkBase { constructor(tabNavBar, elementRef, ngZone, platform, globalRippleOptions, tabIndex, focusMonitor, animationMode) { super(tabNavBar, elementRef, globalRippleOptions, tabIndex, focusMonitor, animationMode); this._tabLinkRipple = new RippleRenderer(this, ngZone, elementRef, platform); this._tabLinkRipple.setupTriggerEvents(elementRef.nativeElement); } ngOnDestroy() { super.ngOnDestroy(); this._tabLinkRipple._removeTriggerEvents(); } } MatTabLink.decorators = [ { type: Directive, args: [{ selector: '[mat-tab-link], [matTabLink]', exportAs: 'matTabLink', inputs: ['disabled', 'disableRipple', 'tabIndex'], host: { 'class': 'mat-tab-link mat-focus-indicator', '[attr.aria-current]': 'active ? "page" : null', '[attr.aria-disabled]': 'disabled', '[attr.tabIndex]': 'tabIndex', '[class.mat-tab-disabled]': 'disabled', '[class.mat-tab-label-active]': 'active', '(focus)': '_handleFocus()' } },] } ]; MatTabLink.ctorParameters = () => [ { type: MatTabNav }, { type: ElementRef }, { type: NgZone }, { type: Platform }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_RIPPLE_GLOBAL_OPTIONS,] }] }, { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] }, { type: FocusMonitor }, { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] } ]; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFiLW5hdi1iYXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvdGFicy90YWItbmF2LWJhci90YWItbmF2LWJhci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFDSCxPQUFPLEVBQWtCLFlBQVksRUFBQyxNQUFNLG1CQUFtQixDQUFDO0FBQ2hFLE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSxtQkFBbUIsQ0FBQztBQUNqRCxPQUFPLEVBQWUscUJBQXFCLEVBQWMsTUFBTSx1QkFBdUIsQ0FBQztBQUN2RixPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFDL0MsT0FBTyxFQUFDLGFBQWEsRUFBQyxNQUFNLHdCQUF3QixDQUFDO0FBQ3JELE9BQU8sRUFJTCxTQUFTLEVBQ1QsdUJBQXVCLEVBQ3ZCLGlCQUFpQixFQUNqQixTQUFTLEVBQ1QsZUFBZSxFQUNmLFNBQVMsRUFDVCxVQUFVLEVBQ1YsVUFBVSxFQUNWLE1BQU0sRUFDTixLQUFLLEVBQ0wsTUFBTSxFQUVOLFFBQVEsRUFDUixTQUFTLEVBQ1QsU0FBUyxFQUNULGlCQUFpQixHQUNsQixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBSUwseUJBQXlCLEVBQ3pCLGFBQWEsRUFDYixrQkFBa0IsRUFDbEIsYUFBYSxFQUViLGNBQWMsR0FHZixNQUFNLHdCQUF3QixDQUFD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