@angular/material
Version:
Angular Material
10 lines (9 loc) • 11.5 kB
JavaScript
/**
* @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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/cdk/collections"),require("@angular/cdk/accordion"),require("@angular/cdk/a11y"),require("@angular/cdk/portal"),require("@angular/cdk/coercion"),require("rxjs/Subject"),require("rxjs/operators/take"),require("rxjs/operators/filter"),require("rxjs/operators/startWith"),require("@angular/animations"),require("@angular/cdk/keycodes"),require("rxjs/observable/merge"),require("rxjs/Subscription")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","@angular/cdk/collections","@angular/cdk/accordion","@angular/cdk/a11y","@angular/cdk/portal","@angular/cdk/coercion","rxjs/Subject","rxjs/operators/take","rxjs/operators/filter","rxjs/operators/startWith","@angular/animations","@angular/cdk/keycodes","rxjs/observable/merge","rxjs/Subscription"],t):t((e.ng=e.ng||{},e.ng.material=e.ng.material||{},e.ng.material.expansion=e.ng.material.expansion||{}),e.ng.common,e.ng.core,e.ng.cdk.collections,e.ng.cdk.accordion,e.ng.cdk.a11y,e.ng.cdk.portal,e.ng.cdk.coercion,e.Rx,e.Rx.operators,e.Rx.operators,e.Rx.operators,e.ng.animations,e.ng.cdk.keycodes,e.Rx.Observable,e.Rx)}(this,function(e,t,n,a,o,r,i,s,p,c,d,l,g,u,x,h){"use strict";function m(e,t){function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._hideToggle=!1,t.displayMode="default",t}return m(t,e),Object.defineProperty(t.prototype,"hideToggle",{get:function(){return this._hideToggle},set:function(e){this._hideToggle=s.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),t.decorators=[{type:n.Directive,args:[{selector:"mat-accordion",exportAs:"matAccordion",host:{class:"mat-accordion"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={hideToggle:[{type:n.Input}],displayMode:[{type:n.Input}]},t}(o.CdkAccordion),b=function(){function e(e){this._template=e}return e.decorators=[{type:n.Directive,args:[{selector:"ng-template[matExpansionPanelContent]"}]}],e.ctorParameters=function(){return[{type:n.TemplateRef}]},e}(),_={indicatorRotate:g.trigger("indicatorRotate",[g.state("collapsed",g.style({transform:"rotate(0deg)"})),g.state("expanded",g.style({transform:"rotate(180deg)"})),g.transition("expanded <=> collapsed",g.animate("225ms cubic-bezier(0.4,0.0,0.2,1)"))]),expansionHeaderHeight:g.trigger("expansionHeight",[g.state("collapsed",g.style({height:"{{collapsedHeight}}"}),{params:{collapsedHeight:"48px"}}),g.state("expanded",g.style({height:"{{expandedHeight}}"}),{params:{expandedHeight:"64px"}}),g.transition("expanded <=> collapsed",g.animate("225ms cubic-bezier(0.4,0.0,0.2,1)"))]),bodyExpansion:g.trigger("bodyExpansion",[g.state("collapsed",g.style({height:"0px",visibility:"hidden"})),g.state("expanded",g.style({height:"*",visibility:"visible"})),g.transition("expanded <=> collapsed",g.animate("225ms cubic-bezier(0.4,0.0,0.2,1)"))])},v=0,E=function(e){function t(t,n,a,o){var r=e.call(this,t,n,a)||this;return r._viewContainerRef=o,r._hideToggle=!1,r._inputChanges=new p.Subject,r._headerId="mat-expansion-panel-header-"+v++,r.accordion=t,r}return m(t,e),Object.defineProperty(t.prototype,"hideToggle",{get:function(){return this._hideToggle},set:function(e){this._hideToggle=s.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),t.prototype._getHideToggle=function(){return this.accordion?this.accordion.hideToggle:this.hideToggle},t.prototype._hasSpacing=function(){return!!this.accordion&&"default"===(this.expanded?this.accordion.displayMode:this._getExpandedState())},t.prototype._getExpandedState=function(){return this.expanded?"expanded":"collapsed"},t.prototype.ngAfterContentInit=function(){var e=this;this._lazyContent&&this.opened.pipe(l.startWith(null),d.filter(function(){return e.expanded&&!e._portal}),c.take(1)).subscribe(function(){e._portal=new i.TemplatePortal(e._lazyContent._template,e._viewContainerRef)})},t.prototype.ngOnChanges=function(e){this._inputChanges.next(e)},t.prototype.ngOnDestroy=function(){e.prototype.ngOnDestroy.call(this),this._inputChanges.complete()},t.prototype._bodyAnimation=function(e){var t=e.element.classList,n=e.phaseName,a=e.toState;"done"===n&&"expanded"===a?t.add("mat-expanded"):"start"===n&&"collapsed"===a&&t.remove("mat-expanded")},t.decorators=[{type:n.Component,args:[{styles:[".mat-expansion-panel{transition:box-shadow 280ms cubic-bezier(.4,0,.2,1);box-sizing:content-box;display:block;margin:0;transition:margin 225ms cubic-bezier(.4,0,.2,1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-expansion-panel-content{overflow:hidden}.mat-expansion-panel-content.mat-expanded{overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion .mat-expansion-panel-spacing:first-child{margin-top:0}.mat-accordion .mat-expansion-panel-spacing:last-child{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button{margin-left:0;margin-right:8px}"],selector:"mat-expansion-panel",exportAs:"matExpansionPanel",template:'<ng-content select="mat-expansion-panel-header"></ng-content><div class="mat-expansion-panel-content" role="region" [@bodyExpansion]="_getExpandedState()" (@bodyExpansion.done)="_bodyAnimation($event)" (@bodyExpansion.start)="_bodyAnimation($event)" [class.mat-expanded]="expanded" [attr.aria-labelledby]="_headerId" [id]="id" #body><div class="mat-expansion-panel-body"><ng-content></ng-content><ng-template [cdkPortalOutlet]="_portal"></ng-template></div><ng-content select="mat-action-row"></ng-content></div>',encapsulation:n.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:n.ChangeDetectionStrategy.OnPush,inputs:["disabled","expanded"],outputs:["opened","closed","expandedChange"],animations:[_.bodyExpansion],host:{class:"mat-expansion-panel","[class.mat-expanded]":"expanded","[class.mat-expansion-panel-spacing]":"_hasSpacing()"}}]}],t.ctorParameters=function(){return[{type:y,decorators:[{type:n.Optional},{type:n.Host}]},{type:n.ChangeDetectorRef},{type:a.UniqueSelectionDispatcher},{type:n.ViewContainerRef}]},t.propDecorators={hideToggle:[{type:n.Input}],_lazyContent:[{type:n.ContentChild,args:[b]}]},t}(o.CdkAccordionItem),k=function(){function e(){}return e.decorators=[{type:n.Directive,args:[{selector:"mat-action-row",host:{class:"mat-action-row"}}]}],e.ctorParameters=function(){return[]},e}(),P=function(){function e(e,t,n,a){var o=this;this.panel=e,this._element=t,this._focusMonitor=n,this._changeDetectorRef=a,this._parentChangeSubscription=h.Subscription.EMPTY,this._parentChangeSubscription=x.merge(e.opened,e.closed,e._inputChanges.pipe(d.filter(function(e){return!(!e.hideToggle&&!e.disabled)}))).subscribe(function(){return o._changeDetectorRef.markForCheck()}),n.monitor(t.nativeElement)}return e.prototype._toggle=function(){this.panel.toggle()},e.prototype._isExpanded=function(){return this.panel.expanded},e.prototype._getExpandedState=function(){return this.panel._getExpandedState()},e.prototype._getPanelId=function(){return this.panel.id},e.prototype._showToggle=function(){return!this.panel.hideToggle&&!this.panel.disabled},e.prototype._keydown=function(e){switch(e.keyCode){case u.SPACE:case u.ENTER:e.preventDefault(),this._toggle();break;default:return}},e.prototype.ngOnDestroy=function(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element.nativeElement)},e.decorators=[{type:n.Component,args:[{selector:"mat-expansion-panel-header",styles:[".mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:0}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-description,.mat-expansion-panel-header-title{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-description,[dir=rtl] .mat-expansion-panel-header-title{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:'';display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}"],template:'<span class="mat-content"><ng-content select="mat-panel-title"></ng-content><ng-content select="mat-panel-description"></ng-content><ng-content></ng-content></span><span [@indicatorRotate]="_getExpandedState()" *ngIf="_showToggle()" class="mat-expansion-indicator"></span>',encapsulation:n.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:n.ChangeDetectionStrategy.OnPush,animations:[_.indicatorRotate,_.expansionHeaderHeight],host:{class:"mat-expansion-panel-header",role:"button","[attr.id]":"panel._headerId","[attr.tabindex]":"panel.disabled ? -1 : 0","[attr.aria-controls]":"_getPanelId()","[attr.aria-expanded]":"_isExpanded()","[attr.aria-disabled]":"panel.disabled","[class.mat-expanded]":"_isExpanded()","(click)":"_toggle()","(keydown)":"_keydown($event)","[@expansionHeight]":"{\n value: _getExpandedState(),\n params: {\n collapsedHeight: collapsedHeight,\n expandedHeight: expandedHeight\n }\n }"}}]}],e.ctorParameters=function(){return[{type:E,decorators:[{type:n.Host}]},{type:n.ElementRef},{type:r.FocusMonitor},{type:n.ChangeDetectorRef}]},e.propDecorators={expandedHeight:[{type:n.Input}],collapsedHeight:[{type:n.Input}]},e}(),C=function(){function e(){}return e.decorators=[{type:n.Directive,args:[{selector:"mat-panel-description",host:{class:"mat-expansion-panel-header-description"}}]}],e.ctorParameters=function(){return[]},e}(),w=function(){function e(){}return e.decorators=[{type:n.Directive,args:[{selector:"mat-panel-title",host:{class:"mat-expansion-panel-header-title"}}]}],e.ctorParameters=function(){return[]},e}(),S=function(){function e(){}return e.decorators=[{type:n.NgModule,args:[{imports:[t.CommonModule,r.A11yModule,o.CdkAccordionModule,i.PortalModule],exports:[y,E,k,P,w,C,b],declarations:[y,E,k,P,w,C,b],providers:[a.UNIQUE_SELECTION_DISPATCHER_PROVIDER]}]}],e.ctorParameters=function(){return[]},e}();e.MatExpansionModule=S,e.MatAccordion=y,e.MatExpansionPanel=E,e.MatExpansionPanelActionRow=k,e.MatExpansionPanelHeader=P,e.MatExpansionPanelDescription=C,e.MatExpansionPanelTitle=w,e.MatExpansionPanelContent=b,e.EXPANSION_PANEL_ANIMATION_TIMING="225ms cubic-bezier(0.4,0.0,0.2,1)",e.matExpansionAnimations=_,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=material-expansion.umd.min.js.map