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