UNPKG

4.11 kBJavaScriptView Raw
1!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("ngx-bootstrap/utils"),require("@angular/common"),require("ngx-bootstrap/collapse")):"function"==typeof define&&define.amd?define("ngx-bootstrap/accordion",["exports","@angular/core","ngx-bootstrap/utils","@angular/common","ngx-bootstrap/collapse"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self)["ngx-bootstrap"]=e["ngx-bootstrap"]||{},e["ngx-bootstrap"].accordion={}),e.ng.core,e.utils,e.ng.common,e.collapse)}(this,(function(e,n,t,o,s){"use strict";var i=function(){this.closeOthers=!1,this.isAnimated=!1};i.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new i},token:i,providedIn:"root"}),i.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}];var r=function(){function e(e){this.isAnimated=!1,this.closeOthers=!1,this.groups=[],Object.assign(this,e)}return e.prototype.closeOtherPanels=function(e){this.closeOthers&&this.groups.forEach((function(n){n!==e&&(n.isOpen=!1)}))},e.prototype.addGroup=function(e){e.isAnimated=this.isAnimated,this.groups.push(e)},e.prototype.removeGroup=function(e){var n=this.groups.indexOf(e);-1!==n&&this.groups.splice(n,1)},e}();r.decorators=[{type:n.Component,args:[{selector:"accordion",template:"<ng-content></ng-content>",host:{"[attr.aria-multiselectable]":"closeOthers",role:"tablist",class:"panel-group",style:"display: block"}}]}],r.ctorParameters=function(){return[{type:i}]},r.propDecorators={isAnimated:[{type:n.Input}],closeOthers:[{type:n.Input}]};var a=function(){function e(e){this.isAnimated=!1,this.panelClass="panel-default",this.isDisabled=!1,this.isOpenChange=new n.EventEmitter,this._isOpen=!1,this.accordion=e}return Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},set:function(e){var n=this;e!==this.isOpen&&(e&&this.accordion.closeOtherPanels(this),this._isOpen=e,Promise.resolve(null).then((function(){n.isOpenChange.emit(e)})))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBs3",{get:function(){return t.isBs3()},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.accordion.addGroup(this)},e.prototype.ngOnDestroy=function(){this.accordion.removeGroup(this)},e.prototype.toggleOpen=function(){this.isDisabled||(this.isOpen=!this.isOpen)},e}();a.decorators=[{type:n.Component,args:[{selector:"accordion-group, accordion-panel",template:'<div class="panel card" [ngClass]="panelClass">\n <div\n class="panel-heading card-header"\n role="tab"\n (click)="toggleOpen()"\n [ngClass]="isDisabled ? \'panel-disabled\' : \'panel-enabled\'"\n >\n <div class="panel-title">\n <div role="button" class="accordion-toggle" [attr.aria-expanded]="isOpen">\n <button class="btn btn-link" *ngIf="heading" [ngClass]="{ \'text-muted\': isDisabled }" type="button">\n {{ heading }}\n </button>\n <ng-content select="[accordion-heading]"></ng-content>\n </div>\n </div>\n </div>\n <div class="panel-collapse collapse" role="tabpanel" [collapse]="!isOpen" [isAnimated]="isAnimated">\n <div class="panel-body card-block card-body">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n',host:{class:"panel",style:"display: block"},styles:[":host .card-header.panel-enabled{cursor:pointer}:host .card-header.panel-disabled .btn.btn-link{cursor:default;text-decoration:none}"]}]}],a.ctorParameters=function(){return[{type:r,decorators:[{type:n.Inject,args:[r]}]}]},a.propDecorators={heading:[{type:n.Input}],panelClass:[{type:n.Input}],isDisabled:[{type:n.Input}],isOpenChange:[{type:n.Output}],isOpen:[{type:n.HostBinding,args:["class.panel-open"]},{type:n.Input}]};var c=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e}();c.decorators=[{type:n.NgModule,args:[{imports:[o.CommonModule,s.CollapseModule],declarations:[r,a],exports:[r,a]}]}],e.AccordionComponent=r,e.AccordionConfig=i,e.AccordionModule=c,e.AccordionPanelComponent=a,Object.defineProperty(e,"__esModule",{value:!0})}));
2//# sourceMappingURL=ngx-bootstrap-accordion.umd.min.js.map
\No newline at end of file