ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
16 lines (14 loc) • 8.22 kB
JavaScript
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("ng-zorro-antd/core/animation"),require("ng-zorro-antd/core/config"),require("ng-zorro-antd/core/no-animation"),require("ng-zorro-antd/core/util"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/bidi"),require("@angular/common"),require("ng-zorro-antd/core/outlet"),require("ng-zorro-antd/icon")):"function"==typeof define&&define.amd?define("ng-zorro-antd/collapse",["exports","@angular/core","ng-zorro-antd/core/animation","ng-zorro-antd/core/config","ng-zorro-antd/core/no-animation","ng-zorro-antd/core/util","rxjs","rxjs/operators","@angular/cdk/bidi","@angular/common","ng-zorro-antd/core/outlet","ng-zorro-antd/icon"],e):e(((n="undefined"!=typeof globalThis?globalThis:n||self)["ng-zorro-antd"]=n["ng-zorro-antd"]||{},n["ng-zorro-antd"].collapse={}),n.ng.core,n["ng-zorro-antd"].core.animation,n["ng-zorro-antd"].core.config,n["ng-zorro-antd"].core["no-animation"],n["ng-zorro-antd"].core.util,n.rxjs,n.rxjs.operators,n.ng.cdk.bidi,n.ng.common,n["ng-zorro-antd"].core.outlet,n["ng-zorro-antd"].icon)}(this,(function(n,e,t,o,i,r,a,c,s,l,p,d){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function z(n,e,t,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(n,e,t,o);else for(var c=n.length-1;c>=0;c--)(i=n[c])&&(a=(r<3?i(a):r>3?i(e,t,a):i(e,t))||a);return r>3&&a&&Object.defineProperty(e,t,a),a}function u(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}Object.create;Object.create;var g="collapse",h=function(){function n(n,e,t,o){var i=this;this.nzConfigService=n,this.cdr=e,this.elementRef=t,this.directionality=o,this._nzModuleName=g,this.nzAccordion=!1,this.nzBordered=!0,this.nzGhost=!1,this.nzExpandIconPosition="left",this.dir="ltr",this.listOfNzCollapsePanelComponent=[],this.destroy$=new a.Subject,this.elementRef.nativeElement.classList.add("ant-collapse"),this.nzConfigService.getConfigChangeEventForComponent(g).pipe(c.takeUntil(this.destroy$)).subscribe((function(){i.cdr.markForCheck()}))}return n.prototype.ngOnInit=function(){var n,e=this;null===(n=this.directionality.change)||void 0===n||n.pipe(c.takeUntil(this.destroy$)).subscribe((function(n){e.dir=n,e.cdr.detectChanges()})),this.dir=this.directionality.value},n.prototype.addPanel=function(n){this.listOfNzCollapsePanelComponent.push(n)},n.prototype.removePanel=function(n){this.listOfNzCollapsePanelComponent.splice(this.listOfNzCollapsePanelComponent.indexOf(n),1)},n.prototype.click=function(n){this.nzAccordion&&!n.nzActive&&this.listOfNzCollapsePanelComponent.filter((function(e){return e!==n})).forEach((function(n){n.nzActive&&(n.nzActive=!1,n.nzActiveChange.emit(n.nzActive),n.markForCheck())})),n.nzActive=!n.nzActive,n.nzActiveChange.emit(n.nzActive)},n.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},n}();h.decorators=[{type:e.Component,args:[{selector:"nz-collapse",exportAs:"nzCollapse",changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,template:"\n <ng-content></ng-content>\n ",host:{"[class.ant-collapse-icon-position-left]":"nzExpandIconPosition === 'left'","[class.ant-collapse-icon-position-right]":"nzExpandIconPosition === 'right'","[class.ant-collapse-ghost]":"nzGhost","[class.ant-collapse-borderless]":"!nzBordered","[class.ant-collapse-rtl]":"dir === 'rtl'"}}]}],h.ctorParameters=function(){return[{type:o.NzConfigService},{type:e.ChangeDetectorRef},{type:e.ElementRef},{type:s.Directionality,decorators:[{type:e.Optional}]}]},h.propDecorators={nzAccordion:[{type:e.Input}],nzBordered:[{type:e.Input}],nzGhost:[{type:e.Input}],nzExpandIconPosition:[{type:e.Input}]},z([o.WithConfig(),r.InputBoolean(),u("design:type",Boolean)],h.prototype,"nzAccordion",void 0),z([o.WithConfig(),r.InputBoolean(),u("design:type",Boolean)],h.prototype,"nzBordered",void 0),z([o.WithConfig(),r.InputBoolean(),u("design:type",Boolean)],h.prototype,"nzGhost",void 0);var f="collapsePanel",y=function(){function n(n,t,o,i,r){var s=this;this.nzConfigService=n,this.cdr=t,this.nzCollapseComponent=o,this.elementRef=i,this.noAnimation=r,this._nzModuleName=f,this.nzActive=!1,this.nzDisabled=!1,this.nzShowArrow=!0,this.nzActiveChange=new e.EventEmitter,this.destroy$=new a.Subject,this.elementRef.nativeElement.classList.add("ant-collapse-item"),this.nzConfigService.getConfigChangeEventForComponent(f).pipe(c.takeUntil(this.destroy$)).subscribe((function(){s.cdr.markForCheck()}))}return n.prototype.clickHeader=function(){this.nzDisabled||this.nzCollapseComponent.click(this)},n.prototype.markForCheck=function(){this.cdr.markForCheck()},n.prototype.ngOnInit=function(){this.nzCollapseComponent.addPanel(this)},n.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete(),this.nzCollapseComponent.removePanel(this)},n}();y.decorators=[{type:e.Component,args:[{selector:"nz-collapse-panel",exportAs:"nzCollapsePanel",changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,animations:[t.collapseMotion],template:'\n <div role="tab" [attr.aria-expanded]="nzActive" class="ant-collapse-header" (click)="clickHeader()">\n <ng-container *ngIf="nzShowArrow">\n <ng-container *nzStringTemplateOutlet="nzExpandedIcon; let expandedIcon">\n <i nz-icon [nzType]="expandedIcon || \'right\'" class="ant-collapse-arrow" [nzRotate]="nzActive ? 90 : 0"></i>\n </ng-container>\n </ng-container>\n <ng-container *nzStringTemplateOutlet="nzHeader">{{ nzHeader }}</ng-container>\n <div class="ant-collapse-extra" *ngIf="nzExtra">\n <ng-container *nzStringTemplateOutlet="nzExtra">{{ nzExtra }}</ng-container>\n </div>\n </div>\n <div\n class="ant-collapse-content"\n [class.ant-collapse-content-active]="nzActive"\n [@.disabled]="noAnimation?.nzNoAnimation"\n [@collapseMotion]="nzActive ? \'expanded\' : \'hidden\'"\n >\n <div class="ant-collapse-content-box">\n <ng-content></ng-content>\n </div>\n </div>\n ',host:{"[class.ant-collapse-no-arrow]":"!nzShowArrow","[class.ant-collapse-item-active]":"nzActive","[class.ant-collapse-item-disabled]":"nzDisabled"}}]}],y.ctorParameters=function(){return[{type:o.NzConfigService},{type:e.ChangeDetectorRef},{type:h,decorators:[{type:e.Host}]},{type:e.ElementRef},{type:i.NzNoAnimationDirective,decorators:[{type:e.Optional}]}]},y.propDecorators={nzActive:[{type:e.Input}],nzDisabled:[{type:e.Input}],nzShowArrow:[{type:e.Input}],nzExtra:[{type:e.Input}],nzHeader:[{type:e.Input}],nzExpandedIcon:[{type:e.Input}],nzActiveChange:[{type:e.Output}]},z([r.InputBoolean(),u("design:type",Object)],y.prototype,"nzActive",void 0),z([r.InputBoolean(),u("design:type",Object)],y.prototype,"nzDisabled",void 0),z([o.WithConfig(),r.InputBoolean(),u("design:type",Boolean)],y.prototype,"nzShowArrow",void 0);var m=function(){};m.decorators=[{type:e.NgModule,args:[{declarations:[y,h],exports:[y,h],imports:[s.BidiModule,l.CommonModule,d.NzIconModule,p.NzOutletModule,i.NzNoAnimationModule]}]}],n.NzCollapseComponent=h,n.NzCollapseModule=m,n.NzCollapsePanelComponent=y,Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-zorro-antd-collapse.umd.min.js.map