UNPKG

@angular/material

Version:
10 lines (9 loc) 31.6 kB
/** * @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 */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/observers"),require("@angular/cdk/portal"),require("@angular/cdk/scrolling"),require("@angular/common"),require("@angular/core"),require("@angular/material/core"),require("rxjs/Subject"),require("@angular/cdk/bidi"),require("@angular/animations"),require("@angular/cdk/coercion"),require("rxjs/Subscription"),require("rxjs/observable/merge"),require("@angular/cdk/keycodes"),require("rxjs/observable/of"),require("@angular/cdk/platform"),require("rxjs/operators/takeUntil")):"function"==typeof define&&define.amd?define(["exports","@angular/cdk/observers","@angular/cdk/portal","@angular/cdk/scrolling","@angular/common","@angular/core","@angular/material/core","rxjs/Subject","@angular/cdk/bidi","@angular/animations","@angular/cdk/coercion","rxjs/Subscription","rxjs/observable/merge","@angular/cdk/keycodes","rxjs/observable/of","@angular/cdk/platform","rxjs/operators/takeUntil"],e):e((t.ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.tabs=t.ng.material.tabs||{}),t.ng.cdk.observers,t.ng.cdk.portal,t.ng.cdk.scrolling,t.ng.common,t.ng.core,t.ng.material.core,t.Rx,t.ng.cdk.bidi,t.ng.animations,t.ng.cdk.coercion,t.Rx,t.Rx.Observable,t.ng.cdk.keycodes,t.Rx.Observable,t.ng.cdk.platform,t.Rx.operators)}(this,function(t,e,n,a,i,r,o,s,l,c,p,d,b,h,u,g,f){"use strict";function m(t,e){function n(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},y=function(){function t(t,e){this._elementRef=t,this._ngZone=e}return t.prototype.alignToElement=function(t){var e=this;this.show(),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(function(){requestAnimationFrame(function(){return e._setStyles(t)})}):this._setStyles(t)},t.prototype.show=function(){this._elementRef.nativeElement.style.visibility="visible"},t.prototype.hide=function(){this._elementRef.nativeElement.style.visibility="hidden"},t.prototype._setStyles=function(t){var e=this._elementRef.nativeElement;e.style.left=t?(t.offsetLeft||0)+"px":"0",e.style.width=t?(t.offsetWidth||0)+"px":"0"},t.decorators=[{type:r.Directive,args:[{selector:"mat-ink-bar",host:{class:"mat-ink-bar"}}]}],t.ctorParameters=function(){return[{type:r.ElementRef},{type:r.NgZone}]},t}(),v=function(t){function e(e,n){return t.call(this,e,n)||this}return m(e,t),e.decorators=[{type:r.Directive,args:[{selector:"[mat-tab-label], [matTabLabel]"}]}],e.ctorParameters=function(){return[{type:r.TemplateRef},{type:r.ViewContainerRef}]},e}(n.CdkPortal),x=function(){function t(){}return t}(),C=o.mixinDisabled(x),k=function(t){function e(e){var n=t.call(this)||this;return n._viewContainerRef=e,n.textLabel="",n._contentPortal=null,n._labelChange=new s.Subject,n._disableChange=new s.Subject,n.position=null,n.origin=null,n.isActive=!1,n}return m(e,t),Object.defineProperty(e.prototype,"content",{get:function(){return this._contentPortal},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){t.hasOwnProperty("textLabel")&&this._labelChange.next(),t.hasOwnProperty("disabled")&&this._disableChange.next()},e.prototype.ngOnDestroy=function(){this._disableChange.complete(),this._labelChange.complete()},e.prototype.ngOnInit=function(){this._contentPortal=new n.TemplatePortal(this._content,this._viewContainerRef)},e.decorators=[{type:r.Component,args:[{selector:"mat-tab",template:"<ng-template><ng-content></ng-content></ng-template>",inputs:["disabled"],changeDetection:r.ChangeDetectionStrategy.OnPush,encapsulation:r.ViewEncapsulation.None,preserveWhitespaces:!1,exportAs:"matTab"}]}],e.ctorParameters=function(){return[{type:r.ViewContainerRef}]},e.propDecorators={templateLabel:[{type:r.ContentChild,args:[v]}],_content:[{type:r.ViewChild,args:[r.TemplateRef]}],textLabel:[{type:r.Input,args:["label"]}]},e}(C),I={translateTab:c.trigger("translateTab",[c.state("center, void, left-origin-center, right-origin-center",c.style({transform:"none"})),c.state("left",c.style({transform:"translate3d(-100%, 0, 0)"})),c.state("right",c.style({transform:"translate3d(100%, 0, 0)"})),c.transition("* => left, * => right, left => center, right => center",c.animate("500ms cubic-bezier(0.35, 0, 0.25, 1)")),c.transition("void => left-origin-center",[c.style({transform:"translate3d(-100%, 0, 0)"}),c.animate("500ms cubic-bezier(0.35, 0, 0.25, 1)")]),c.transition("void => right-origin-center",[c.style({transform:"translate3d(100%, 0, 0)"}),c.animate("500ms cubic-bezier(0.35, 0, 0.25, 1)")])])},T=function(t){function e(e,n,a){var i=t.call(this,e,n)||this;return i._host=a,i}return m(e,t),e.prototype.ngOnInit=function(){var t=this;this._host._isCenterPosition(this._host._position)&&this.attach(this._host._content),this._centeringSub=this._host._beforeCentering.subscribe(function(e){e&&(t.hasAttached()||t.attach(t._host._content))}),this._leavingSub=this._host._afterLeavingCenter.subscribe(function(){t.detach()})},e.prototype.ngOnDestroy=function(){this._centeringSub&&!this._centeringSub.closed&&this._centeringSub.unsubscribe(),this._leavingSub&&!this._leavingSub.closed&&this._leavingSub.unsubscribe()},e.decorators=[{type:r.Directive,args:[{selector:"[matTabBodyHost]"}]}],e.ctorParameters=function(){return[{type:r.ComponentFactoryResolver},{type:r.ViewContainerRef},{type:R,decorators:[{type:r.Inject,args:[r.forwardRef(function(){return R})]}]}]},e}(n.CdkPortalOutlet),R=function(){function t(t,e){this._elementRef=t,this._dir=e,this._onCentering=new r.EventEmitter,this._beforeCentering=new r.EventEmitter,this._afterLeavingCenter=new r.EventEmitter,this._onCentered=new r.EventEmitter(!0)}return Object.defineProperty(t.prototype,"position",{set:function(t){this._position=t<0?"ltr"==this._getLayoutDirection()?"left":"right":t>0?"ltr"==this._getLayoutDirection()?"right":"left":"center"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"origin",{set:function(t){if(null!=t){var e=this._getLayoutDirection();this._origin="ltr"==e&&t<=0||"rtl"==e&&t>0?"left":"right"}},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){"center"==this._position&&this._origin&&(this._position="left"==this._origin?"left-origin-center":"right-origin-center")},t.prototype._onTranslateTabStarted=function(t){var e=this._isCenterPosition(t.toState);this._beforeCentering.emit(e),e&&this._onCentering.emit(this._elementRef.nativeElement.clientHeight)},t.prototype._onTranslateTabComplete=function(t){this._isCenterPosition(t.toState)&&this._isCenterPosition(this._position)&&this._onCentered.emit(),this._isCenterPosition(t.fromState)&&!this._isCenterPosition(this._position)&&this._afterLeavingCenter.emit()},t.prototype._getLayoutDirection=function(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"},t.prototype._isCenterPosition=function(t){return"center"==t||"left-origin-center"==t||"right-origin-center"==t},t.decorators=[{type:r.Component,args:[{selector:"mat-tab-body",template:'<div class="mat-tab-body-content" #content [@translateTab]="_position" (@translateTab.start)="_onTranslateTabStarted($event)" (@translateTab.done)="_onTranslateTabComplete($event)"><ng-template matTabBodyHost></ng-template></div>',styles:[".mat-tab-body-content{-webkit-backface-visibility:hidden;backface-visibility:hidden;height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}"],encapsulation:r.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:r.ChangeDetectionStrategy.OnPush,animations:[I.translateTab],host:{class:"mat-tab-body"}}]}],t.ctorParameters=function(){return[{type:r.ElementRef},{type:l.Directionality,decorators:[{type:r.Optional}]}]},t.propDecorators={_onCentering:[{type:r.Output}],_beforeCentering:[{type:r.Output}],_afterLeavingCenter:[{type:r.Output}],_onCentered:[{type:r.Output}],_content:[{type:r.Input,args:["content"]}],position:[{type:r.Input}],origin:[{type:r.Input}]},t}(),D=0,w=function(){function t(){}return t}(),L=function(){function t(t){this._elementRef=t}return t}(),E=o.mixinColor(o.mixinDisableRipple(L),"primary"),P=function(t){function e(e,n){var a=t.call(this,e)||this;return a._changeDetectorRef=n,a._indexToSelect=0,a._tabBodyWrapperHeight=0,a._tabsSubscription=d.Subscription.EMPTY,a._tabLabelSubscription=d.Subscription.EMPTY,a._dynamicHeight=!1,a._selectedIndex=null,a.headerPosition="above",a.selectedIndexChange=new r.EventEmitter,a.focusChange=new r.EventEmitter,a.animationDone=new r.EventEmitter,a.selectedTabChange=new r.EventEmitter(!0),a.selectChange=a.selectedTabChange,a._groupId=D++,a}return m(e,t),Object.defineProperty(e.prototype,"dynamicHeight",{get:function(){return this._dynamicHeight},set:function(t){this._dynamicHeight=p.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_dynamicHeightDeprecated",{get:function(){return this._dynamicHeight},set:function(t){this._dynamicHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(t){this._indexToSelect=p.coerceNumberProperty(t,null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){var e=this._elementRef.nativeElement;e.classList.remove("mat-background-"+this.backgroundColor),t&&e.classList.add("mat-background-"+t),this._backgroundColor=t},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentChecked=function(){var t=this,e=this._indexToSelect=Math.min(this._tabs.length-1,Math.max(this._indexToSelect||0,0));if(this._selectedIndex!=e&&null!=this._selectedIndex){var n=this._createChangeEvent(e);this.selectedTabChange.emit(n),Promise.resolve().then(function(){return t.selectedIndexChange.emit(e)})}this._tabs.forEach(function(n,a){n.position=a-e,n.isActive=a===e,null==t._selectedIndex||0!=n.position||n.origin||(n.origin=e-t._selectedIndex)}),this._selectedIndex!==e&&(this._selectedIndex=e,this._changeDetectorRef.markForCheck())},e.prototype.ngAfterContentInit=function(){var t=this;this._subscribeToTabLabels(),this._tabsSubscription=this._tabs.changes.subscribe(function(){t._subscribeToTabLabels(),t._changeDetectorRef.markForCheck()})},e.prototype.ngOnDestroy=function(){this._tabsSubscription.unsubscribe(),this._tabLabelSubscription.unsubscribe()},e.prototype._focusChanged=function(t){this.focusChange.emit(this._createChangeEvent(t))},e.prototype._createChangeEvent=function(t){var e=new w;return e.index=t,this._tabs&&this._tabs.length&&(e.tab=this._tabs.toArray()[t]),e},e.prototype._subscribeToTabLabels=function(){var t=this;this._tabLabelSubscription&&this._tabLabelSubscription.unsubscribe(),this._tabLabelSubscription=b.merge.apply(void 0,this._tabs.map(function(t){return t._disableChange}).concat(this._tabs.map(function(t){return t._labelChange}))).subscribe(function(){t._changeDetectorRef.markForCheck()})},e.prototype._getTabLabelId=function(t){return"mat-tab-label-"+this._groupId+"-"+t},e.prototype._getTabContentId=function(t){return"mat-tab-content-"+this._groupId+"-"+t},e.prototype._setTabBodyWrapperHeight=function(t){if(this._dynamicHeight&&this._tabBodyWrapperHeight){var e=this._tabBodyWrapper.nativeElement;e.style.height=this._tabBodyWrapperHeight+"px",this._tabBodyWrapper.nativeElement.offsetHeight&&(e.style.height=t+"px")}},e.prototype._removeTabBodyWrapperHeight=function(){this._tabBodyWrapperHeight=this._tabBodyWrapper.nativeElement.clientHeight,this._tabBodyWrapper.nativeElement.style.height="",this.animationDone.emit()},e.prototype._handleClick=function(t,e,n){t.disabled||(this.selectedIndex=e.focusIndex=n)},e.prototype._getTabIndex=function(t,e){return t.disabled?null:this.selectedIndex===e?0:-1},e.decorators=[{type:r.Component,args:[{selector:"mat-tab-group",exportAs:"matTabGroup",template:'<mat-tab-header #tabHeader [selectedIndex]="selectedIndex" [disableRipple]="disableRipple" (indexFocused)="_focusChanged($event)" (selectFocusedIndex)="selectedIndex = $event"><div class="mat-tab-label" role="tab" matTabLabelWrapper mat-ripple *ngFor="let tab of _tabs; let i = index" [id]="_getTabLabelId(i)" [attr.tabIndex]="_getTabIndex(tab, i)" [attr.aria-controls]="_getTabContentId(i)" [attr.aria-selected]="selectedIndex == i" [class.mat-tab-label-active]="selectedIndex == i" [disabled]="tab.disabled" [matRippleDisabled]="tab.disabled || disableRipple" (click)="_handleClick(tab, tabHeader, i)"><div class="mat-tab-label-content"><ng-template [ngIf]="tab.templateLabel"><ng-template [cdkPortalOutlet]="tab.templateLabel"></ng-template></ng-template><ng-template [ngIf]="!tab.templateLabel">{{tab.textLabel}}</ng-template></div></div></mat-tab-header><div class="mat-tab-body-wrapper" #tabBodyWrapper><mat-tab-body role="tabpanel" *ngFor="let tab of _tabs; let i = index" [id]="_getTabContentId(i)" [attr.aria-labelledby]="_getTabLabelId(i)" [class.mat-tab-body-active]="selectedIndex == i" [content]="tab.content" [position]="tab.position" [origin]="tab.origin" (_onCentered)="_removeTabBodyWrapperHeight()" (_onCentering)="_setTabBodyWrapperHeight($event)"></mat-tab-body></div>',styles:[".mat-tab-group{display:flex;flex-direction:column}.mat-tab-group.mat-tab-group-inverted-header{flex-direction:column-reverse}.mat-tab-label{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;position:relative}.mat-tab-label:focus{outline:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.mat-tab-label.mat-tab-disabled{cursor:default}.mat-tab-label.mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}@media (max-width:599px){.mat-tab-label{padding:0 12px}}@media (max-width:959px){.mat-tab-label{padding:0 12px}}.mat-tab-group[mat-stretch-tabs] .mat-tab-label{flex-basis:0;flex-grow:1}.mat-tab-body-wrapper{position:relative;overflow:hidden;display:flex;transition:height .5s cubic-bezier(.35,0,.25,1)}.mat-tab-body{top:0;left:0;right:0;bottom:0;position:absolute;display:block;overflow:hidden}.mat-tab-body.mat-tab-body-active{position:relative;overflow-x:hidden;overflow-y:auto;z-index:1;flex-grow:1}.mat-tab-group.mat-tab-group-dynamic-height .mat-tab-body.mat-tab-body-active{overflow-y:hidden}"],encapsulation:r.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:r.ChangeDetectionStrategy.OnPush,inputs:["color","disableRipple"],host:{class:"mat-tab-group","[class.mat-tab-group-dynamic-height]":"dynamicHeight","[class.mat-tab-group-inverted-header]":'headerPosition === "below"'}}]}],e.ctorParameters=function(){return[{type:r.ElementRef},{type:r.ChangeDetectorRef}]},e.propDecorators={_tabs:[{type:r.ContentChildren,args:[k]}],_tabBodyWrapper:[{type:r.ViewChild,args:["tabBodyWrapper"]}],dynamicHeight:[{type:r.Input}],_dynamicHeightDeprecated:[{type:r.Input,args:["mat-dynamic-height"]}],selectedIndex:[{type:r.Input}],headerPosition:[{type:r.Input}],backgroundColor:[{type:r.Input}],selectedIndexChange:[{type:r.Output}],focusChange:[{type:r.Output}],animationDone:[{type:r.Output}],selectedTabChange:[{type:r.Output}],selectChange:[{type:r.Output}]},e}(E),O=function(){function t(){}return t}(),S=o.mixinDisabled(O),W=function(t){function e(e){var n=t.call(this)||this;return n.elementRef=e,n}return m(e,t),e.prototype.focus=function(){this.elementRef.nativeElement.focus()},e.prototype.getOffsetLeft=function(){return this.elementRef.nativeElement.offsetLeft},e.prototype.getOffsetWidth=function(){return this.elementRef.nativeElement.offsetWidth},e.decorators=[{type:r.Directive,args:[{selector:"[matTabLabelWrapper]",inputs:["disabled"],host:{"[class.mat-tab-disabled]":"disabled"}}]}],e.ctorParameters=function(){return[{type:r.ElementRef}]},e}(S),B=function(){function t(){}return t}(),j=o.mixinDisableRipple(B),A=function(t){function e(e,n,a,i){var o=t.call(this)||this;return o._elementRef=e,o._changeDetectorRef=n,o._viewportRuler=a,o._dir=i,o._focusIndex=0,o._scrollDistance=0,o._selectedIndexChanged=!1,o._realignInkBar=d.Subscription.EMPTY,o._showPaginationControls=!1,o._disableScrollAfter=!0,o._disableScrollBefore=!0,o._selectedIndex=0,o.selectFocusedIndex=new r.EventEmitter,o.indexFocused=new r.EventEmitter,o}return m(e,t),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(t){t=p.coerceNumberProperty(t),this._selectedIndexChanged=this._selectedIndex!=t,this._selectedIndex=t,this._focusIndex=t},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentChecked=function(){this._tabLabelCount!=this._labelWrappers.length&&(this._updatePagination(),this._tabLabelCount=this._labelWrappers.length,this._changeDetectorRef.markForCheck()),this._selectedIndexChanged&&(this._scrollToLabel(this._selectedIndex),this._checkScrollingControls(),this._alignInkBarToSelectedTab(),this._selectedIndexChanged=!1,this._changeDetectorRef.markForCheck()),this._scrollDistanceChanged&&(this._updateTabScrollPosition(),this._scrollDistanceChanged=!1,this._changeDetectorRef.markForCheck())},e.prototype._handleKeydown=function(t){switch(t.keyCode){case h.RIGHT_ARROW:this._focusNextTab();break;case h.LEFT_ARROW:this._focusPreviousTab();break;case h.HOME:this._focusFirstTab(),t.preventDefault();break;case h.END:this._focusLastTab(),t.preventDefault();break;case h.ENTER:case h.SPACE:this.selectFocusedIndex.emit(this.focusIndex),t.preventDefault()}},e.prototype.ngAfterContentInit=function(){var t=this,e=this._dir?this._dir.change:u.of(null),n=this._viewportRuler.change(150),a=function(){t._updatePagination(),t._alignInkBarToSelectedTab()};"undefined"!=typeof requestAnimationFrame?requestAnimationFrame(a):a(),this._realignInkBar=b.merge(e,n).subscribe(a)},e.prototype.ngOnDestroy=function(){this._realignInkBar.unsubscribe()},e.prototype._onContentChanges=function(){this._updatePagination(),this._alignInkBarToSelectedTab(),this._changeDetectorRef.markForCheck()},e.prototype._updatePagination=function(){this._checkPaginationEnabled(),this._checkScrollingControls(),this._updateTabScrollPosition()},Object.defineProperty(e.prototype,"focusIndex",{get:function(){return this._focusIndex},set:function(t){this._isValidIndex(t)&&this._focusIndex!=t&&(this._focusIndex=t,this.indexFocused.emit(t),this._setTabFocus(t))},enumerable:!0,configurable:!0}),e.prototype._isValidIndex=function(t){if(!this._labelWrappers)return!0;var e=this._labelWrappers?this._labelWrappers.toArray()[t]:null;return!!e&&!e.disabled},e.prototype._setTabFocus=function(t){if(this._showPaginationControls&&this._scrollToLabel(t),this._labelWrappers&&this._labelWrappers.length){this._labelWrappers.toArray()[t].focus();var e=this._tabListContainer.nativeElement,n=this._getLayoutDirection();e.scrollLeft="ltr"==n?0:e.scrollWidth-e.offsetWidth}},e.prototype._moveFocus=function(t){if(this._labelWrappers)for(var e=this._labelWrappers.toArray(),n=this.focusIndex+t;n<e.length&&n>=0;n+=t)if(this._isValidIndex(n))return void(this.focusIndex=n)},e.prototype._focusNextTab=function(){this._moveFocus("ltr"==this._getLayoutDirection()?1:-1)},e.prototype._focusPreviousTab=function(){this._moveFocus("ltr"==this._getLayoutDirection()?-1:1)},e.prototype._focusFirstTab=function(){for(var t=0;t<this._labelWrappers.length;t++)if(this._isValidIndex(t)){this.focusIndex=t;break}},e.prototype._focusLastTab=function(){for(var t=this._labelWrappers.length-1;t>-1;t--)if(this._isValidIndex(t)){this.focusIndex=t;break}},e.prototype._getLayoutDirection=function(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"},e.prototype._updateTabScrollPosition=function(){var t=this.scrollDistance,e="ltr"===this._getLayoutDirection()?-t:t;this._tabList.nativeElement.style.transform="translate3d("+e+"px, 0, 0)"},Object.defineProperty(e.prototype,"scrollDistance",{get:function(){return this._scrollDistance},set:function(t){this._scrollDistance=Math.max(0,Math.min(this._getMaxScrollDistance(),t)),this._scrollDistanceChanged=!0,this._checkScrollingControls()},enumerable:!0,configurable:!0}),e.prototype._scrollHeader=function(t){var e=this._tabListContainer.nativeElement.offsetWidth;this.scrollDistance+=("before"==t?-1:1)*e/3},e.prototype._scrollToLabel=function(t){var e=this._labelWrappers?this._labelWrappers.toArray()[t]:null;if(e){var n,a,i=this._tabListContainer.nativeElement.offsetWidth;"ltr"==this._getLayoutDirection()?(n=e.getOffsetLeft(),a=n+e.getOffsetWidth()):(a=this._tabList.nativeElement.offsetWidth-e.getOffsetLeft(),n=a-e.getOffsetWidth());var r=this.scrollDistance,o=this.scrollDistance+i;n<r?this.scrollDistance-=r-n+60:a>o&&(this.scrollDistance+=a-o+60)}},e.prototype._checkPaginationEnabled=function(){var t=this._tabList.nativeElement.scrollWidth>this._elementRef.nativeElement.offsetWidth;t||(this.scrollDistance=0),t!==this._showPaginationControls&&this._changeDetectorRef.markForCheck(),this._showPaginationControls=t},e.prototype._checkScrollingControls=function(){this._disableScrollBefore=0==this.scrollDistance,this._disableScrollAfter=this.scrollDistance==this._getMaxScrollDistance(),this._changeDetectorRef.markForCheck()},e.prototype._getMaxScrollDistance=function(){return this._tabList.nativeElement.scrollWidth-this._tabListContainer.nativeElement.offsetWidth||0},e.prototype._alignInkBarToSelectedTab=function(){var t=this._labelWrappers&&this._labelWrappers.length?this._labelWrappers.toArray()[this.selectedIndex].elementRef.nativeElement:null;this._inkBar.alignToElement(t)},e.decorators=[{type:r.Component,args:[{selector:"mat-tab-header",template:'<div class="mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4" aria-hidden="true" mat-ripple [matRippleDisabled]="_disableScrollBefore || disableRipple" [class.mat-tab-header-pagination-disabled]="_disableScrollBefore" (click)="_scrollHeader(\'before\')"><div class="mat-tab-header-pagination-chevron"></div></div><div class="mat-tab-label-container" #tabListContainer (keydown)="_handleKeydown($event)"><div class="mat-tab-list" #tabList role="tablist" (cdkObserveContent)="_onContentChanges()"><div class="mat-tab-labels"><ng-content></ng-content></div><mat-ink-bar></mat-ink-bar></div></div><div class="mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4" aria-hidden="true" mat-ripple [matRippleDisabled]="_disableScrollAfter || disableRipple" [class.mat-tab-header-pagination-disabled]="_disableScrollAfter" (click)="_scrollHeader(\'after\')"><div class="mat-tab-header-pagination-chevron"></div></div>',styles:[".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-label{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;position:relative}.mat-tab-label:focus{outline:0}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.mat-tab-label.mat-tab-disabled{cursor:default}.mat-tab-label.mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}@media (max-width:599px){.mat-tab-label{min-width:72px}}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:.5s cubic-bezier(.35,0,.25,1)}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}@media screen and (-ms-high-contrast:active){.mat-ink-bar{outline:solid 2px;height:0}}.mat-tab-header-pagination{position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2}.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-pagination-after,.mat-tab-header-rtl .mat-tab-header-pagination-before{padding-right:4px}.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-before .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-label-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}.mat-tab-list{flex-grow:1;position:relative;transition:transform .5s cubic-bezier(.35,0,.25,1)}.mat-tab-labels{display:flex}"],inputs:["disableRipple"],encapsulation:r.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:r.ChangeDetectionStrategy.OnPush,host:{class:"mat-tab-header","[class.mat-tab-header-pagination-controls-enabled]":"_showPaginationControls","[class.mat-tab-header-rtl]":"_getLayoutDirection() == 'rtl'"}}]}],e.ctorParameters=function(){return[{type:r.ElementRef},{type:r.ChangeDetectorRef},{type:a.ViewportRuler},{type:l.Directionality,decorators:[{type:r.Optional}]}]},e.propDecorators={_labelWrappers:[{type:r.ContentChildren,args:[W]}],_inkBar:[{type:r.ViewChild,args:[y]}],_tabListContainer:[{type:r.ViewChild,args:["tabListContainer"]}],_tabList:[{type:r.ViewChild,args:["tabList"]}],selectedIndex:[{type:r.Input}],selectFocusedIndex:[{type:r.Output}],indexFocused:[{type:r.Output}]},e}(j),M=function(){function t(t){this._elementRef=t}return t}(),F=o.mixinColor(M,"primary"),H=function(t){function e(e,n,a,i,r){var o=t.call(this,e)||this;return o._dir=n,o._ngZone=a,o._changeDetectorRef=i,o._viewportRuler=r,o._onDestroy=new s.Subject,o._disableRipple=!1,o}return m(e,t),Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){var e=this._elementRef.nativeElement;e.classList.remove("mat-background-"+this.backgroundColor),t&&e.classList.add("mat-background-"+t),this._backgroundColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disableRipple",{get:function(){return this._disableRipple},set:function(t){this._disableRipple=p.coerceBooleanProperty(t),this._setLinkDisableRipple()},enumerable:!0,configurable:!0}),e.prototype.updateActiveLink=function(t){this._activeLinkChanged=this._activeLinkElement!=t,this._activeLinkElement=t,this._activeLinkChanged&&this._changeDetectorRef.markForCheck()},e.prototype.ngAfterContentInit=function(){var t=this;this._ngZone.runOutsideAngular(function(){var e=t._dir?t._dir.change:u.of(null);return b.merge(e,t._viewportRuler.change(10)).pipe(f.takeUntil(t._onDestroy)).subscribe(function(){return t._alignInkBar()})}),this._setLinkDisableRipple()},e.prototype.ngAfterContentChecked=function(){this._activeLinkChanged&&(this._alignInkBar(),this._activeLinkChanged=!1)},e.prototype.ngOnDestroy=function(){this._onDestroy.next(),this._onDestroy.complete()},e.prototype._alignInkBar=function(){this._activeLinkElement&&this._inkBar.alignToElement(this._activeLinkElement.nativeElement)},e.prototype._setLinkDisableRipple=function(){var t=this;this._tabLinks&&this._tabLinks.forEach(function(e){return e.disableRipple=t.disableRipple})},e.decorators=[{type:r.Component,args:[{selector:"[mat-tab-nav-bar]",exportAs:"matTabNavBar, matTabNav",inputs:["color"],template:'<div class="mat-tab-links" (cdkObserveContent)="_alignInkBar()"><ng-content></ng-content><mat-ink-bar></mat-ink-bar></div>',styles:[".mat-tab-nav-bar{overflow:hidden;position:relative;flex-shrink:0}.mat-tab-links{position:relative}.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}.mat-tab-link:focus{outline:0}.mat-tab-link:focus:not(.mat-tab-disabled){opacity:1}.mat-tab-link.mat-tab-disabled{cursor:default}.mat-tab-link.mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}@media (max-width:599px){.mat-tab-link{min-width:72px}}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:.5s cubic-bezier(.35,0,.25,1)}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}@media screen and (-ms-high-contrast:active){.mat-ink-bar{outline:solid 2px;height:0}}"],host:{class:"mat-tab-nav-bar"},encapsulation:r.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:r.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:r.ElementRef},{type:l.Directionality,decorators:[{type:r.Optional}]},{type:r.NgZone},{type:r.ChangeDetectorRef},{type:a.ViewportRuler}]},e.propDecorators={_inkBar:[{type:r.ViewChild,args:[y]}],_tabLinks:[{type:r.ContentChildren,args:[r.forwardRef(function(){return q}),{descendants:!0}]}],backgroundColor:[{type:r.Input}],disableRipple:[{type:r.Input}]},e}(F),V=function(){function t(){}return t}(),N=o.mixinTabIndex(o.mixinDisableRipple(o.mixinDisabled(V))),q=function(t){function e(e,n,a,i,r,s){var l=t.call(this)||this;return l._tabNavBar=e,l._elementRef=n,l._isActive=!1,l.rippleConfig={},l._tabLinkRipple=new o.RippleRenderer(l,a,n,i),l._tabLinkRipple.setupTriggerEvents(n.nativeElement),l.tabIndex=parseInt(s)||0,r&&(l.rippleConfig={terminateOnPointerUp:r.terminateOnPointerUp,speedFactor:r.baseSpeedFactor,animation:r.animation}),l}return m(e,t),Object.defineProperty(e.prototype,"active",{get:function(){return this._isActive},set:function(t){this._isActive=t,t&&this._tabNavBar.updateActiveLink(this._elementRef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rippleDisabled",{get:function(){return this.disabled||this.disableRipple},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this._tabLinkRipple._removeTriggerEvents()},e.prototype._handleClick=function(t){this.disabled&&t.preventDefault()},e.decorators=[{type:r.Directive,args:[{selector:"[mat-tab-link], [matTabLink]",exportAs:"matTabLink",inputs:["disabled","disableRipple","tabIndex"],host:{class:"mat-tab-link","[attr.aria-disabled]":"disabled.toString()","[attr.tabIndex]":"tabIndex","[class.mat-tab-disabled]":"disabled","[class.mat-tab-label-active]":"active","(click)":"_handleClick($event)"}}]}],e.ctorParameters=function(){return[{type:H},{type:r.ElementRef},{type:r.NgZone},{type:g.Platform},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[o.MAT_RIPPLE_GLOBAL_OPTIONS]}]},{type:void 0,decorators:[{type:r.Attribute,args:["tabindex"]}]}]},e.propDecorators={active:[{type:r.Input}]},e}(N),z=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[i.CommonModule,o.MatCommonModule,n.PortalModule,o.MatRippleModule,e.ObserversModule,a.ScrollDispatchModule],exports:[o.MatCommonModule,P,v,k,H,q],declarations:[P,v,k,y,W,H,q,R,T,A],providers:[a.VIEWPORT_RULER_PROVIDER]}]}],t.ctorParameters=function(){return[]},t}();t.MatInkBar=y,t.MatTabBody=R,t.MatTabBodyPortal=T,t.MatTabHeader=A,t.MatTabLabelWrapper=W,t.MatTab=k,t.MatTabLabel=v,t.MatTabNav=H,t.MatTabLink=q,t.MatTabsModule=z,t.MatTabChangeEvent=w,t.MatTabGroupBase=L,t._MatTabGroupMixinBase=E,t.MatTabGroup=P,t.matTabsAnimations=I,t.ɵe22=x,t.ɵf22=C,t.ɵa22=B,t.ɵb22=j,t.ɵc22=O,t.ɵd22=S,t.ɵi22=V,t.ɵg22=M,t.ɵj22=N,t.ɵh22=F,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=material-tabs.umd.min.js.map