UNPKG

@angular/material

Version:
11 lines (10 loc) 37 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/core"),require("@angular/platform-browser/animations"),require("@angular/cdk/portal"),require("@angular/material/core"),require("rxjs"),require("@angular/animations"),require("@angular/cdk/bidi"),require("rxjs/operators"),require("@angular/cdk/coercion"),require("@angular/cdk/keycodes"),require("@angular/cdk/scrolling"),require("@angular/cdk/a11y"),require("@angular/cdk/platform"),require("@angular/cdk/observers"),require("@angular/common")):"function"==typeof define&&define.amd?define("@angular/material/tabs",["exports","@angular/core","@angular/platform-browser/animations","@angular/cdk/portal","@angular/material/core","rxjs","@angular/animations","@angular/cdk/bidi","rxjs/operators","@angular/cdk/coercion","@angular/cdk/keycodes","@angular/cdk/scrolling","@angular/cdk/a11y","@angular/cdk/platform","@angular/cdk/observers","@angular/common"],e):e((t.ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.tabs={}),t.ng.core,t.ng.platformBrowser.animations,t.ng.cdk.portal,t.ng.material.core,t.rxjs,t.ng.animations,t.ng.cdk.bidi,t.rxjs.operators,t.ng.cdk.coercion,t.ng.cdk.keycodes,t.ng.cdk.scrolling,t.ng.cdk.a11y,t.ng.cdk.platform,t.ng.cdk.observers,t.ng.common)}(this,function(t,e,n,a,i,o,r,s,l,c,p,d,b,u,h,m){"use strict";function g(t,e){function n(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function f(){return function(t){return{left:t?(t.offsetLeft||0)+"px":"0",width:t?(t.offsetWidth||0)+"px":"0"}}}var _=function(t,e){return(_=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])})(t,e)},y=new e.InjectionToken("MatInkBarPositioner",{providedIn:"root",factory:f}),v=function(){function t(t,e,n,a){this._elementRef=t,this._ngZone=e,this._inkBarPositioner=n,this._animationMode=a}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._inkBarPositioner(t),n=this._elementRef.nativeElement;n.style.left=e.left,n.style.width=e.width},t.decorators=[{type:e.Directive,args:[{selector:"mat-ink-bar",host:{class:"mat-ink-bar","[class._mat-animation-noopable]":"_animationMode === 'NoopAnimations'"}}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone},{type:void 0,decorators:[{type:e.Inject,args:[y]}]},{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[n.ANIMATION_MODULE_TYPE]}]}]},t}(),x=function(){function t(t){this.template=t}return t.decorators=[{type:e.Directive,args:[{selector:"[matTabContent]"}]}],t.ctorParameters=function(){return[{type:e.TemplateRef}]},t}(),k=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return g(n,t),n.decorators=[{type:e.Directive,args:[{selector:"[mat-tab-label], [matTabLabel]"}]}],n}(a.CdkPortal),C=function(){function t(){}return t}(),I=i.mixinDisabled(C),D=function(t){function n(e){var n=t.call(this)||this;return n._viewContainerRef=e,n.textLabel="",n._contentPortal=null,n._stateChanges=new o.Subject,n.position=null,n.origin=null,n.isActive=!1,n}return g(n,t),Object.defineProperty(n.prototype,"content",{get:function(){return this._contentPortal},enumerable:!0,configurable:!0}),n.prototype.ngOnChanges=function(t){(t.hasOwnProperty("textLabel")||t.hasOwnProperty("disabled"))&&this._stateChanges.next()},n.prototype.ngOnDestroy=function(){this._stateChanges.complete()},n.prototype.ngOnInit=function(){this._contentPortal=new a.TemplatePortal(this._explicitContent||this._implicitContent,this._viewContainerRef)},n.decorators=[{type:e.Component,args:[{selector:"mat-tab",template:"<ng-template><ng-content></ng-content></ng-template>",inputs:["disabled"],changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,exportAs:"matTab"}]}],n.ctorParameters=function(){return[{type:e.ViewContainerRef}]},n.propDecorators={templateLabel:[{type:e.ContentChild,args:[k,{static:!1}]}],_explicitContent:[{type:e.ContentChild,args:[x,{read:e.TemplateRef,static:!0}]}],_implicitContent:[{type:e.ViewChild,args:[e.TemplateRef,{static:!0}]}],textLabel:[{type:e.Input,args:["label"]}],ariaLabel:[{type:e.Input,args:["aria-label"]}],ariaLabelledby:[{type:e.Input,args:["aria-labelledby"]}]},n}(I),T={translateTab:r.trigger("translateTab",[r.state("center, void, left-origin-center, right-origin-center",r.style({transform:"none"})),r.state("left",r.style({transform:"translate3d(-100%, 0, 0)",minHeight:"1px"})),r.state("right",r.style({transform:"translate3d(100%, 0, 0)",minHeight:"1px"})),r.transition("* => left, * => right, left => center, right => center",r.animate("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)")),r.transition("void => left-origin-center",[r.style({transform:"translate3d(-100%, 0, 0)"}),r.animate("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)")]),r.transition("void => right-origin-center",[r.style({transform:"translate3d(100%, 0, 0)"}),r.animate("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)")])])},w=function(t){function n(e,n,a){var i=t.call(this,e,n)||this;return i._host=a,i._centeringSub=o.Subscription.EMPTY,i._leavingSub=o.Subscription.EMPTY,i}return g(n,t),n.prototype.ngOnInit=function(){var e=this;t.prototype.ngOnInit.call(this),this._centeringSub=this._host._beforeCentering.pipe(l.startWith(this._host._isCenterPosition(this._host._position))).subscribe(function(t){t&&!e.hasAttached()&&e.attach(e._host._content)}),this._leavingSub=this._host._afterLeavingCenter.subscribe(function(){e.detach()})},n.prototype.ngOnDestroy=function(){t.prototype.ngOnDestroy.call(this),this._centeringSub.unsubscribe(),this._leavingSub.unsubscribe()},n.decorators=[{type:e.Directive,args:[{selector:"[matTabBodyHost]"}]}],n.ctorParameters=function(){return[{type:e.ComponentFactoryResolver},{type:e.ViewContainerRef},{type:P,decorators:[{type:e.Inject,args:[e.forwardRef(function(){return P})]}]}]},n}(a.CdkPortalOutlet),P=function(){function t(t,n,a){var i=this;this._elementRef=t,this._dir=n,this._dirChangeSubscription=o.Subscription.EMPTY,this._translateTabComplete=new o.Subject,this._onCentering=new e.EventEmitter,this._beforeCentering=new e.EventEmitter,this._afterLeavingCenter=new e.EventEmitter,this._onCentered=new e.EventEmitter(!0),this.animationDuration="500ms",n&&(this._dirChangeSubscription=n.change.subscribe(function(t){i._computePositionAnimationState(t),a.markForCheck()})),this._translateTabComplete.pipe(l.distinctUntilChanged(function(t,e){return t.fromState===e.fromState&&t.toState===e.toState})).subscribe(function(t){i._isCenterPosition(t.toState)&&i._isCenterPosition(i._position)&&i._onCentered.emit(),i._isCenterPosition(t.fromState)&&!i._isCenterPosition(i._position)&&i._afterLeavingCenter.emit()})}return Object.defineProperty(t.prototype,"position",{set:function(t){this._positionIndex=t,this._computePositionAnimationState()},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){"center"==this._position&&null!=this.origin&&(this._position=this._computePositionFromOrigin())},t.prototype.ngOnDestroy=function(){this._dirChangeSubscription.unsubscribe(),this._translateTabComplete.complete()},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._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.prototype._computePositionAnimationState=function(t){void 0===t&&(t=this._getLayoutDirection()),this._positionIndex<0?this._position="ltr"==t?"left":"right":this._positionIndex>0?this._position="ltr"==t?"right":"left":this._position="center"},t.prototype._computePositionFromOrigin=function(){var t=this._getLayoutDirection();return"ltr"==t&&this.origin<=0||"rtl"==t&&this.origin>0?"left-origin-center":"right-origin-center"},t.decorators=[{type:e.Component,args:[{selector:"mat-tab-body",template:'<div class="mat-tab-body-content" #content [@translateTab]="{ value: _position, params: {animationDuration: animationDuration} }" (@translateTab.start)="_onTranslateTabStarted($event)" (@translateTab.done)="_translateTabComplete.next($event)"><ng-template matTabBodyHost></ng-template></div>',styles:[".mat-tab-body-content{height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}"],encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,animations:[T.translateTab],host:{class:"mat-tab-body"}}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:s.Directionality,decorators:[{type:e.Optional}]},{type:e.ChangeDetectorRef}]},t.propDecorators={_onCentering:[{type:e.Output}],_beforeCentering:[{type:e.Output}],_afterLeavingCenter:[{type:e.Output}],_onCentered:[{type:e.Output}],_portalHost:[{type:e.ViewChild,args:[a.PortalHostDirective,{static:!1}]}],_content:[{type:e.Input,args:["content"]}],origin:[{type:e.Input}],animationDuration:[{type:e.Input}],position:[{type:e.Input}]},t}(),E=function(){function t(){}return t}(),L=i.mixinDisabled(E),S=function(t){function n(e){var n=t.call(this)||this;return n.elementRef=e,n}return g(n,t),n.prototype.focus=function(){this.elementRef.nativeElement.focus()},n.prototype.getOffsetLeft=function(){return this.elementRef.nativeElement.offsetLeft},n.prototype.getOffsetWidth=function(){return this.elementRef.nativeElement.offsetWidth},n.decorators=[{type:e.Directive,args:[{selector:"[matTabLabelWrapper]",inputs:["disabled"],host:{"[class.mat-tab-disabled]":"disabled","[attr.aria-disabled]":"!!disabled"}}]}],n.ctorParameters=function(){return[{type:e.ElementRef}]},n}(L),O=u.normalizePassiveListenerOptions({passive:!0}),R=function(){function t(){}return t}(),M=i.mixinDisableRipple(R),A=function(t){function a(n,a,i,r,s,c,p){var d=t.call(this)||this;return d._elementRef=n,d._changeDetectorRef=a,d._viewportRuler=i,d._dir=r,d._ngZone=s,d._platform=c,d._animationMode=p,d._scrollDistance=0,d._selectedIndexChanged=!1,d._destroyed=new o.Subject,d._showPaginationControls=!1,d._disableScrollAfter=!0,d._disableScrollBefore=!0,d._stopScrolling=new o.Subject,d._selectedIndex=0,d.selectFocusedIndex=new e.EventEmitter,d.indexFocused=new e.EventEmitter,s.runOutsideAngular(function(){o.fromEvent(n.nativeElement,"mouseleave").pipe(l.takeUntil(d._destroyed)).subscribe(function(){d._stopInterval()})}),d}return g(a,t),Object.defineProperty(a.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(t){t=c.coerceNumberProperty(t),this._selectedIndexChanged=this._selectedIndex!=t,this._selectedIndex=t,this._keyManager&&this._keyManager.updateActiveItemIndex(t)},enumerable:!0,configurable:!0}),a.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())},a.prototype._handleKeydown=function(t){if(!p.hasModifierKey(t))switch(t.keyCode){case p.HOME:this._keyManager.setFirstItemActive(),t.preventDefault();break;case p.END:this._keyManager.setLastItemActive(),t.preventDefault();break;case p.ENTER:case p.SPACE:this.selectFocusedIndex.emit(this.focusIndex),t.preventDefault();break;default:this._keyManager.onKeydown(t)}},a.prototype.ngAfterContentInit=function(){var t=this,e=this._dir?this._dir.change:o.of(null),n=this._viewportRuler.change(150),a=function(){t.updatePagination(),t._alignInkBarToSelectedTab()};this._keyManager=new b.FocusKeyManager(this._labelWrappers).withHorizontalOrientation(this._getLayoutDirection()).withWrap(),this._keyManager.updateActiveItem(0),"undefined"!=typeof requestAnimationFrame?requestAnimationFrame(a):a(),o.merge(e,n).pipe(l.takeUntil(this._destroyed)).subscribe(function(){a(),t._keyManager.withHorizontalOrientation(t._getLayoutDirection())}),this._keyManager.change.pipe(l.takeUntil(this._destroyed)).subscribe(function(e){t.indexFocused.emit(e),t._setTabFocus(e)})},a.prototype.ngAfterViewInit=function(){var t=this;o.fromEvent(this._previousPaginator.nativeElement,"touchstart",O).pipe(l.takeUntil(this._destroyed)).subscribe(function(){t._handlePaginatorPress("before")}),o.fromEvent(this._nextPaginator.nativeElement,"touchstart",O).pipe(l.takeUntil(this._destroyed)).subscribe(function(){t._handlePaginatorPress("after")})},a.prototype.ngOnDestroy=function(){this._destroyed.next(),this._destroyed.complete(),this._stopScrolling.complete()},a.prototype._onContentChanges=function(){var t=this,e=this._elementRef.nativeElement.textContent;e!==this._currentTextContent&&(this._currentTextContent=e,this._ngZone.run(function(){t.updatePagination(),t._alignInkBarToSelectedTab(),t._changeDetectorRef.markForCheck()}))},a.prototype.updatePagination=function(){this._checkPaginationEnabled(),this._checkScrollingControls(),this._updateTabScrollPosition()},Object.defineProperty(a.prototype,"focusIndex",{get:function(){return this._keyManager?this._keyManager.activeItemIndex:0},set:function(t){this._isValidIndex(t)&&this.focusIndex!==t&&this._keyManager&&this._keyManager.setActiveItem(t)},enumerable:!0,configurable:!0}),a.prototype._isValidIndex=function(t){if(!this._labelWrappers)return!0;var e=this._labelWrappers?this._labelWrappers.toArray()[t]:null;return!!e&&!e.disabled},a.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}},a.prototype._getLayoutDirection=function(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"},a.prototype._updateTabScrollPosition=function(){var t=this.scrollDistance,e=this._platform,n="ltr"===this._getLayoutDirection()?-t:t;this._tabList.nativeElement.style.transform="translateX("+Math.round(n)+"px)",(e.TRIDENT||e.EDGE)&&(this._tabListContainer.nativeElement.scrollLeft=0)},Object.defineProperty(a.prototype,"scrollDistance",{get:function(){return this._scrollDistance},set:function(t){this._scrollTo(t)},enumerable:!0,configurable:!0}),a.prototype._scrollHeader=function(t){var e=this._tabListContainer.nativeElement.offsetWidth,n=("before"==t?-1:1)*e/3;return this._scrollTo(this._scrollDistance+n)},a.prototype._handlePaginatorClick=function(t){this._stopInterval(),this._scrollHeader(t)},a.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 o=this.scrollDistance,r=this.scrollDistance+i;n<o?this.scrollDistance-=o-n+60:a>r&&(this.scrollDistance+=a-r+60)}},a.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},a.prototype._checkScrollingControls=function(){this._disableScrollBefore=0==this.scrollDistance,this._disableScrollAfter=this.scrollDistance==this._getMaxScrollDistance(),this._changeDetectorRef.markForCheck()},a.prototype._getMaxScrollDistance=function(){return this._tabList.nativeElement.scrollWidth-this._tabListContainer.nativeElement.offsetWidth||0},a.prototype._alignInkBarToSelectedTab=function(){var t=this._labelWrappers&&this._labelWrappers.length?this._labelWrappers.toArray()[this.selectedIndex].elementRef.nativeElement:null;this._inkBar.alignToElement(t)},a.prototype._stopInterval=function(){this._stopScrolling.next()},a.prototype._handlePaginatorPress=function(t){var e=this;this._stopInterval(),o.timer(650,100).pipe(l.takeUntil(o.merge(this._stopScrolling,this._destroyed))).subscribe(function(){var n=e._scrollHeader(t),a=n.maxScrollDistance,i=n.distance;(0===i||i>=a)&&e._stopInterval()})},a.prototype._scrollTo=function(t){var e=this._getMaxScrollDistance();return this._scrollDistance=Math.max(0,Math.min(e,t)),this._scrollDistanceChanged=!0,this._checkScrollingControls(),{maxScrollDistance:e,distance:this._scrollDistance}},a.decorators=[{type:e.Component,args:[{selector:"mat-tab-header",template:'<div class="mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4" #previousPaginator aria-hidden="true" mat-ripple [matRippleDisabled]="_disableScrollBefore || disableRipple" [class.mat-tab-header-pagination-disabled]="_disableScrollBefore" (click)="_handlePaginatorClick(\'before\')" (mousedown)="_handlePaginatorPress(\'before\')" (touchend)="_stopInterval()"><div class="mat-tab-header-pagination-chevron"></div></div><div class="mat-tab-label-container" #tabListContainer (keydown)="_handleKeydown($event)"><div class="mat-tab-list" [class._mat-animation-noopable]="_animationMode === \'NoopAnimations\'" #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" #nextPaginator aria-hidden="true" mat-ripple [matRippleDisabled]="_disableScrollAfter || disableRipple" [class.mat-tab-header-pagination-disabled]="_disableScrollAfter" (mousedown)="_handlePaginatorPress(\'after\')" (click)="_handlePaginatorClick(\'after\')" (touchend)="_stopInterval()"><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}@media (-ms-high-contrast:active){.mat-tab-label:focus{outline:dotted 2px}}.mat-tab-label.mat-tab-disabled{cursor:default}@media (-ms-high-contrast:active){.mat-tab-label.mat-tab-disabled{opacity:.5}}.mat-tab-label .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}@media (-ms-high-contrast:active){.mat-tab-label{opacity:1}}@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-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}@media (-ms-high-contrast:active){.mat-ink-bar{outline:solid 2px;height: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-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-animation-noopable.mat-tab-list{transition:none;animation:none}.mat-tab-labels{display:flex}[mat-align-tabs=center] .mat-tab-labels{justify-content:center}[mat-align-tabs=end] .mat-tab-labels{justify-content:flex-end}"],inputs:["disableRipple"],encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,host:{class:"mat-tab-header","[class.mat-tab-header-pagination-controls-enabled]":"_showPaginationControls","[class.mat-tab-header-rtl]":"_getLayoutDirection() == 'rtl'"}}]}],a.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:d.ViewportRuler},{type:s.Directionality,decorators:[{type:e.Optional}]},{type:e.NgZone},{type:u.Platform},{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[n.ANIMATION_MODULE_TYPE]}]}]},a.propDecorators={_labelWrappers:[{type:e.ContentChildren,args:[S]}],_inkBar:[{type:e.ViewChild,args:[v,{static:!0}]}],_tabListContainer:[{type:e.ViewChild,args:["tabListContainer",{static:!0}]}],_tabList:[{type:e.ViewChild,args:["tabList",{static:!0}]}],_nextPaginator:[{type:e.ViewChild,args:["nextPaginator",{static:!1}]}],_previousPaginator:[{type:e.ViewChild,args:["previousPaginator",{static:!1}]}],selectedIndex:[{type:e.Input}],selectFocusedIndex:[{type:e.Output}],indexFocused:[{type:e.Output}]},a}(M),B=0,j=function(){function t(){}return t}(),W=new e.InjectionToken("MAT_TABS_CONFIG"),N=function(){function t(t){this._elementRef=t}return t}(),H=i.mixinColor(i.mixinDisableRipple(N),"primary"),F=function(t){function a(n,a,i,r){var s=t.call(this,n)||this;return s._changeDetectorRef=a,s._animationMode=r,s._indexToSelect=0,s._tabBodyWrapperHeight=0,s._tabsSubscription=o.Subscription.EMPTY,s._tabLabelSubscription=o.Subscription.EMPTY,s._dynamicHeight=!1,s._selectedIndex=null,s.headerPosition="above",s.selectedIndexChange=new e.EventEmitter,s.focusChange=new e.EventEmitter,s.animationDone=new e.EventEmitter,s.selectedTabChange=new e.EventEmitter(!0),s._groupId=B++,s.animationDuration=i&&i.animationDuration?i.animationDuration:"500ms",s}return g(a,t),Object.defineProperty(a.prototype,"dynamicHeight",{get:function(){return this._dynamicHeight},set:function(t){this._dynamicHeight=c.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(t){this._indexToSelect=c.coerceNumberProperty(t,null)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"animationDuration",{get:function(){return this._animationDuration},set:function(t){this._animationDuration=/^\d+$/.test(t)?t+"ms":t},enumerable:!0,configurable:!0}),Object.defineProperty(a.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}),a.prototype.ngAfterContentChecked=function(){var t=this,e=this._indexToSelect=this._clampTabIndex(this._indexToSelect);if(this._selectedIndex!=e){var n=null==this._selectedIndex;n||this.selectedTabChange.emit(this._createChangeEvent(e)),Promise.resolve().then(function(){t._tabs.forEach(function(t,n){return t.isActive=n===e}),n||t.selectedIndexChange.emit(e)})}this._tabs.forEach(function(n,a){n.position=a-e,null==t._selectedIndex||0!=n.position||n.origin||(n.origin=e-t._selectedIndex)}),this._selectedIndex!==e&&(this._selectedIndex=e,this._changeDetectorRef.markForCheck())},a.prototype.ngAfterContentInit=function(){var t=this;this._subscribeToTabLabels(),this._tabsSubscription=this._tabs.changes.subscribe(function(){if(t._clampTabIndex(t._indexToSelect)===t._selectedIndex)for(var e=t._tabs.toArray(),n=0;n<e.length;n++)if(e[n].isActive){t._indexToSelect=t._selectedIndex=n;break}t._subscribeToTabLabels(),t._changeDetectorRef.markForCheck()})},a.prototype.ngOnDestroy=function(){this._tabsSubscription.unsubscribe(),this._tabLabelSubscription.unsubscribe()},a.prototype.realignInkBar=function(){this._tabHeader&&this._tabHeader._alignInkBarToSelectedTab()},a.prototype._focusChanged=function(t){this.focusChange.emit(this._createChangeEvent(t))},a.prototype._createChangeEvent=function(t){var e=new j;return e.index=t,this._tabs&&this._tabs.length&&(e.tab=this._tabs.toArray()[t]),e},a.prototype._subscribeToTabLabels=function(){var t=this;this._tabLabelSubscription&&this._tabLabelSubscription.unsubscribe(),this._tabLabelSubscription=o.merge.apply(void 0,this._tabs.map(function(t){return t._stateChanges})).subscribe(function(){return t._changeDetectorRef.markForCheck()})},a.prototype._clampTabIndex=function(t){return Math.min(this._tabs.length-1,Math.max(t||0,0))},a.prototype._getTabLabelId=function(t){return"mat-tab-label-"+this._groupId+"-"+t},a.prototype._getTabContentId=function(t){return"mat-tab-content-"+this._groupId+"-"+t},a.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")}},a.prototype._removeTabBodyWrapperHeight=function(){var t=this._tabBodyWrapper.nativeElement;this._tabBodyWrapperHeight=t.clientHeight,t.style.height="",this.animationDone.emit()},a.prototype._handleClick=function(t,e,n){t.disabled||(this.selectedIndex=e.focusIndex=n)},a.prototype._getTabIndex=function(t,e){return t.disabled?null:this.selectedIndex===e?0:-1},a.decorators=[{type:e.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 cdkMonitorElementFocus *ngFor="let tab of _tabs; let i = index" [id]="_getTabLabelId(i)" [attr.tabIndex]="_getTabIndex(tab, i)" [attr.aria-posinset]="i + 1" [attr.aria-setsize]="_tabs.length" [attr.aria-controls]="_getTabContentId(i)" [attr.aria-selected]="selectedIndex == i" [attr.aria-label]="tab.ariaLabel || null" [attr.aria-labelledby]="(!tab.ariaLabel && tab.ariaLabelledby) ? tab.ariaLabelledby : null" [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" [class._mat-animation-noopable]="_animationMode === \'NoopAnimations\'" #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" [animationDuration]="animationDuration" (_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}@media (-ms-high-contrast:active){.mat-tab-label:focus{outline:dotted 2px}}.mat-tab-label.mat-tab-disabled{cursor:default}@media (-ms-high-contrast:active){.mat-tab-label.mat-tab-disabled{opacity:.5}}.mat-tab-label .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}@media (-ms-high-contrast:active){.mat-tab-label{opacity:1}}@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-header .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-animation-noopable.mat-tab-body-wrapper{transition:none;animation:none}.mat-tab-body{top:0;left:0;right:0;bottom:0;position:absolute;display:block;overflow:hidden;flex-basis:100%}.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:e.ViewEncapsulation.None,changeDetection:e.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"'}}]}],a.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:void 0,decorators:[{type:e.Inject,args:[W]},{type:e.Optional}]},{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[n.ANIMATION_MODULE_TYPE]}]}]},a.propDecorators={_tabs:[{type:e.ContentChildren,args:[D]}],_tabBodyWrapper:[{type:e.ViewChild,args:["tabBodyWrapper",{static:!1}]}],_tabHeader:[{type:e.ViewChild,args:["tabHeader",{static:!1}]}],dynamicHeight:[{type:e.Input}],selectedIndex:[{type:e.Input}],headerPosition:[{type:e.Input}],animationDuration:[{type:e.Input}],backgroundColor:[{type:e.Input}],selectedIndexChange:[{type:e.Output}],focusChange:[{type:e.Output}],animationDone:[{type:e.Output}],selectedTabChange:[{type:e.Output}]},a}(H),V=function(){function t(t){this._elementRef=t}return t}(),z=i.mixinDisableRipple(i.mixinColor(V,"primary")),q=function(t){function n(e,n,a,i,r){var s=t.call(this,e)||this;return s._dir=n,s._ngZone=a,s._changeDetectorRef=i,s._viewportRuler=r,s._onDestroy=new o.Subject,s}return g(n,t),Object.defineProperty(n.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}),n.prototype.updateActiveLink=function(t){this._activeLinkChanged=!!t,this._changeDetectorRef.markForCheck()},n.prototype.ngAfterContentInit=function(){var t=this;this._ngZone.runOutsideAngular(function(){var e=t._dir?t._dir.change:o.of(null);return o.merge(e,t._viewportRuler.change(10)).pipe(l.takeUntil(t._onDestroy)).subscribe(function(){return t._alignInkBar()})})},n.prototype.ngAfterContentChecked=function(){if(this._activeLinkChanged){var t=this._tabLinks.find(function(t){return t.active});this._activeLinkElement=t?t._elementRef:null,this._alignInkBar(),this._activeLinkChanged=!1}},n.prototype.ngOnDestroy=function(){this._onDestroy.next(),this._onDestroy.complete()},n.prototype._alignInkBar=function(){this._activeLinkElement?(this._inkBar.show(), this._inkBar.alignToElement(this._activeLinkElement.nativeElement)):this._inkBar.hide()},n.decorators=[{type:e.Component,args:[{selector:"[mat-tab-nav-bar]",exportAs:"matTabNavBar, matTabNav",inputs:["color","disableRipple"],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;display:flex}[mat-align-tabs=center] .mat-tab-links{justify-content:center}[mat-align-tabs=end] .mat-tab-links{justify-content:flex-end}.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:0}.mat-tab-link:focus:not(.mat-tab-disabled){opacity:1}@media (-ms-high-contrast:active){.mat-tab-link:focus{outline:dotted 2px}}.mat-tab-link.mat-tab-disabled{cursor:default}@media (-ms-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}@media (-ms-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}}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:.5s cubic-bezier(.35,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}@media (-ms-high-contrast:active){.mat-ink-bar{outline:solid 2px;height:0}}"],host:{class:"mat-tab-nav-bar"},encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],n.ctorParameters=function(){return[{type:e.ElementRef},{type:s.Directionality,decorators:[{type:e.Optional}]},{type:e.NgZone},{type:e.ChangeDetectorRef},{type:d.ViewportRuler}]},n.propDecorators={_inkBar:[{type:e.ViewChild,args:[v,{static:!0}]}],_tabLinks:[{type:e.ContentChildren,args:[e.forwardRef(function(){return Y}),{descendants:!0}]}],backgroundColor:[{type:e.Input}]},n}(z),U=function(){function t(){}return t}(),Z=i.mixinTabIndex(i.mixinDisableRipple(i.mixinDisabled(U))),Y=function(t){function a(e,n,a,o,r,s,l,c){var p=t.call(this)||this;return p._tabNavBar=e,p._elementRef=n,p._focusMonitor=l,p._isActive=!1,p._tabLinkRipple=new i.RippleRenderer(p,a,n,o),p._tabLinkRipple.setupTriggerEvents(n.nativeElement),p.rippleConfig=r||{},p.tabIndex=parseInt(s)||0,l.monitor(n),"NoopAnimations"===c&&(p.rippleConfig.animation={enterDuration:0,exitDuration:0}),p}return g(a,t),Object.defineProperty(a.prototype,"active",{get:function(){return this._isActive},set:function(t){t!==this._isActive&&(this._isActive=t,this._tabNavBar.updateActiveLink(this._elementRef))},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"rippleDisabled",{get:function(){return this.disabled||this.disableRipple||this._tabNavBar.disableRipple||!!this.rippleConfig.disabled},enumerable:!0,configurable:!0}),a.prototype.ngOnDestroy=function(){this._tabLinkRipple._removeTriggerEvents(),this._focusMonitor.stopMonitoring(this._elementRef)},a.decorators=[{type:e.Directive,args:[{selector:"[mat-tab-link], [matTabLink]",exportAs:"matTabLink",inputs:["disabled","disableRipple","tabIndex"],host:{class:"mat-tab-link","[attr.aria-current]":"active","[attr.aria-disabled]":"disabled.toString()","[attr.tabIndex]":"tabIndex","[class.mat-tab-disabled]":"disabled","[class.mat-tab-label-active]":"active"}}]}],a.ctorParameters=function(){return[{type:q},{type:e.ElementRef},{type:e.NgZone},{type:u.Platform},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[i.MAT_RIPPLE_GLOBAL_OPTIONS]}]},{type:String,decorators:[{type:e.Attribute,args:["tabindex"]}]},{type:b.FocusMonitor},{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[n.ANIMATION_MODULE_TYPE]}]}]},a.propDecorators={active:[{type:e.Input}]},a}(Z),$=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[m.CommonModule,i.MatCommonModule,a.PortalModule,i.MatRippleModule,h.ObserversModule,b.A11yModule],exports:[i.MatCommonModule,F,k,D,q,Y,x],declarations:[F,k,D,v,S,q,Y,P,w,A,x]}]}],t}();t.MatInkBar=v,t._MAT_INK_BAR_POSITIONER=y,t.MatTabBody=P,t.MatTabBodyPortal=w,t.MatTabHeader=A,t.MatTabLabelWrapper=S,t.MatTab=D,t.MatTabLabel=k,t.MatTabNav=q,t.MatTabLink=Y,t.MatTabContent=x,t.MatTabsModule=$,t.MatTabChangeEvent=j,t.MAT_TABS_CONFIG=W,t.MatTabGroup=F,t.matTabsAnimations=T,t.ɵa20=f,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=material-tabs.umd.min.js.map