blob: 0de33cb57a7c02448f62c1c4e0acdc5fcae836e7 [file] [log] [blame]
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/common"),require("@angular/material/core"),require("@angular/material/icon"),require("@angular/cdk/portal"),require("@covalent/core/common"),require("@angular/core"),require("@angular/cdk/coercion"),require("rxjs/operators"),require("rxjs")):"function"==typeof define&&define.amd?define("@covalent/core/expansion-panel",["exports","@angular/common","@angular/material/core","@angular/material/icon","@angular/cdk/portal","@covalent/core/common","@angular/core","@angular/cdk/coercion","rxjs/operators","rxjs"],n):n((e.covalent=e.covalent||{},e.covalent.core=e.covalent.core||{},e.covalent.core["expansion-panel"]={}),e.ng.common,e.ng.material.core,e.ng.material.icon,e.ng.cdk.portal,e.covalent.core.common,e.ng.core,e.ng.cdk.coercion,e.rxjs.operators,e.rxjs)}(this,function(e,n,t,a,o,i,s,l,r,p){"use strict";var d=function(e,n){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])})(e,n)};function c(e,n){function t(){this.constructor=e}d(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var u,x=(c(h,u=o.TemplatePortalDirective),h.decorators=[{type:s.Directive,args:[{selector:"[td-expansion-panel-header]ng-template"}]}],h.ctorParameters=function(){return[{type:s.TemplateRef},{type:s.ViewContainerRef}]},h);function h(e,n){return u.call(this,e,n)||this}var m,f=(c(b,m=o.TemplatePortalDirective),b.decorators=[{type:s.Directive,args:[{selector:"[td-expansion-panel-label]ng-template"}]}],b.ctorParameters=function(){return[{type:s.TemplateRef},{type:s.ViewContainerRef}]},b);function b(e,n){return m.call(this,e,n)||this}var g,_=(c(y,g=o.TemplatePortalDirective),y.decorators=[{type:s.Directive,args:[{selector:"[td-expansion-panel-sublabel]ng-template"}]}],y.ctorParameters=function(){return[{type:s.TemplateRef},{type:s.ViewContainerRef}]},y);function y(e,n){return g.call(this,e,n)||this}var P=(v.decorators=[{type:s.Component,args:[{selector:"td-expansion-summary",template:"<ng-content></ng-content>"}]}],v);function v(){}function E(){}var C,k=i.mixinDisableRipple(i.mixinDisabled(E)),w=(c(O,C=k),Object.defineProperty(O.prototype,"expand",{get:function(){return this._expand},set:function(e){this._setExpand(l.coerceBooleanProperty(e))},enumerable:!0,configurable:!0}),O.prototype.clickEvent=function(){this._setExpand(!this._expand)},O.prototype.toggle=function(){return this._setExpand(!this._expand)},O.prototype.open=function(){return this._setExpand(!0)},O.prototype.close=function(){return this._setExpand(!1)},O.prototype.onDisabledChange=function(e){e&&this._expand&&(this._expand=!1,this._onCollapsed())},O.prototype._setExpand=function(e){return!this.disabled&&this._expand!==e&&((this._expand=e)?(this._renderer.addClass(this._elementRef.nativeElement,"td-expanded"),this._onExpanded()):(this._renderer.removeClass(this._elementRef.nativeElement,"td-expanded"),this._onCollapsed()),!0)},O.prototype._onExpanded=function(){this.expanded.emit(undefined)},O.prototype._onCollapsed=function(){this.collapsed.emit(undefined)},O.decorators=[{type:s.Component,args:[{selector:"td-expansion-panel",template:'<div class="td-expansion-panel-header"\n [class.mat-disabled]="disabled"\n matRipple\n [matRippleDisabled]="disabled || disableRipple"\n [tabIndex]="disabled? -1 : 0"\n (keydown.enter)="clickEvent()"\n (click)="clickEvent()">\n <ng-template [cdkPortalOutlet]="expansionPanelHeader"></ng-template>\n <div class="td-expansion-panel-header-content"\n [class.mat-disabled]="disabled"\n *ngIf="!expansionPanelHeader">\n <div *ngIf="label || expansionPanelLabel" class="td-expansion-label">\n <ng-template [cdkPortalOutlet]="expansionPanelLabel"></ng-template>\n <ng-template [ngIf]="!expansionPanelLabel">{{label}}</ng-template>\n </div>\n <div *ngIf="sublabel || expansionPanelSublabel" class="td-expansion-sublabel">\n <ng-template [cdkPortalOutlet]="expansionPanelSublabel"></ng-template>\n <ng-template [ngIf]="!expansionPanelSublabel">{{sublabel}}</ng-template>\n </div>\n <mat-icon class="td-expand-icon" *ngIf="!disabled" [@tdRotate]="expand">keyboard_arrow_down</mat-icon>\n </div>\n</div>\n<div class="td-expansion-content"\n [@tdCollapse]="!expand">\n <ng-content></ng-content>\n</div>\n<div class="td-expansion-summary"\n [@tdCollapse]="expand">\n <ng-content select="td-expansion-summary"></ng-content>\n</div>\n',inputs:["disabled","disableRipple"],animations:[i.tdCollapseAnimation,i.tdRotateAnimation],styles:[":host{display:block}:host .td-expansion-panel-header{position:relative;outline:0}:host .td-expansion-panel-header:focus:not(.mat-disabled),:host .td-expansion-panel-header:hover:not(.mat-disabled){cursor:pointer}:host .td-expansion-panel-header .td-expansion-panel-header-content{height:48px;padding:0 24px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;max-width:100%}:host .td-expansion-panel-header .td-expansion-panel-header-content .td-expansion-label,:host .td-expansion-panel-header .td-expansion-panel-header-content .td-expansion-sublabel{-webkit-box-flex:1;-ms-flex:1;flex:1}:host .td-expansion-content.ng-animating,:host .td-expansion-summary.ng-animating{overflow:hidden}.td-expansion-label,.td-expansion-sublabel{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:16px}::ng-deep [dir=rtl] .td-expansion-label,::ng-deep [dir=rtl] .td-expansion-sublabel{margin-left:16px;margin-right:inherit}"]}]}],O.ctorParameters=function(){return[{type:s.Renderer2},{type:s.ElementRef}]},O.propDecorators={expansionPanelHeader:[{type:s.ContentChild,args:[x]}],expansionPanelLabel:[{type:s.ContentChild,args:[f]}],expansionPanelSublabel:[{type:s.ContentChild,args:[_]}],label:[{type:s.Input}],sublabel:[{type:s.Input}],expand:[{type:s.Input,args:["expand"]}],expanded:[{type:s.Output}],collapsed:[{type:s.Output}]},O);function O(e,n){var t=C.call(this)||this;return t._renderer=e,t._elementRef=n,t._expand=!1,t.expanded=new s.EventEmitter,t.collapsed=new s.EventEmitter,t._renderer.addClass(t._elementRef.nativeElement,"td-expansion-panel"),t}var R=(Object.defineProperty(j.prototype,"multi",{set:function(e){this._multi=l.coerceBooleanProperty(e),!1===this._multi&&0<this._lastOpenedPanels.length&&this._closeAllExcept(this._lastOpenedPanels[this._lastOpenedPanels.length-1])},enumerable:!0,configurable:!0}),j.prototype.ngOnDestroy=function(){this._destroyed.next(!0),this._destroyed.unsubscribe(),this._stopWatchingPanels.next(!0),this._stopWatchingPanels.unsubscribe()},j.prototype.ngAfterContentInit=function(){var n=this;if(!this._multi){var e=this.expansionPanels.filter(function(e){return e.expand}),t=e.length;1<t&&this._closeAllExcept(e[t-1])}this._attachListeners(this.expansionPanels),this.expansionPanels.changes.pipe(r.takeUntil(this._destroyed)).subscribe(function(e){n._stopWatchingPanels.next(!0),n._stopWatchingPanels.unsubscribe(),n._stopWatchingPanels=new p.Subject,n._attachListeners(e)})},j.prototype.openAll=function(){this._multi&&this.expansionPanels.forEach(function(e){e.open()})},j.prototype.closeAll=function(){this.expansionPanels.forEach(function(e){e.close()})},j.prototype._attachListeners=function(e){var t=this;this._lastOpenedPanels=[],e.forEach(function(n){n.expanded.pipe(r.takeUntil(t._stopWatchingPanels)).subscribe(function(){var e=t._lastOpenedPanels.indexOf(n);-1!==e&&t._lastOpenedPanels.splice(e,1),t._lastOpenedPanels.push(n),t._multi||t._closeAllExcept(n)}),n.collapsed.pipe(r.takeUntil(t._stopWatchingPanels)).subscribe(function(){var e=t._lastOpenedPanels.indexOf(n);-1!==e&&t._lastOpenedPanels.splice(e,1)})})},j.prototype._closeAllExcept=function(n){this.expansionPanels.forEach(function(e){e!==n&&e.close()})},j.decorators=[{type:s.Component,args:[{selector:"td-expansion-panel-group",template:"<ng-content></ng-content>",styles:[""]}]}],j.ctorParameters=function(){return[{type:s.Renderer2},{type:s.ElementRef}]},j.propDecorators={multi:[{type:s.Input,args:["multi"]}],expansionPanels:[{type:s.ContentChildren,args:[w]}]},j);function j(e,n){this._renderer=e,this._elementRef=n,this._multi=!1,this._lastOpenedPanels=[],this._destroyed=new p.Subject,this._stopWatchingPanels=new p.Subject,this._renderer.addClass(this._elementRef.nativeElement,"td-expansion-panel-group")}var D=[R,w,x,f,_,P],T=(I.decorators=[{type:s.NgModule,args:[{imports:[n.CommonModule,t.MatRippleModule,a.MatIconModule,o.PortalModule],declarations:[D],exports:[D]}]}],I);function I(){}e.CovalentExpansionPanelModule=T,e.TdExpansionPanelHeaderDirective=x,e.TdExpansionPanelLabelDirective=f,e.TdExpansionPanelSublabelDirective=_,e.TdExpansionPanelSummaryComponent=P,e.TdExpansionPanelBase=E,e._TdExpansionPanelMixinBase=k,e.TdExpansionPanelComponent=w,e.TdExpansionPanelGroupComponent=R,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=covalent-core-expansion-panel.umd.min.js.map