blob: 1923599dabb6b7df39cb6529d31cf82267e43545 [file] [log] [blame]
/**
* @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/cdk/coercion"),require("@angular/core"),require("rxjs"),require("@angular/cdk/collections")):"function"==typeof define&&define.amd?define("@angular/cdk/accordion",["exports","@angular/cdk/coercion","@angular/core","rxjs","@angular/cdk/collections"],t):t((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.accordion={}),e.ng.cdk.coercion,e.ng.core,e.rxjs,e.ng.cdk.collections)}(this,function(e,t,o,n,i){"use strict";var c=0,r=function(){function e(){this._stateChanges=new n.Subject,this._openCloseAllActions=new n.Subject,this.id="cdk-accordion-"+c++,this._multi=!1}return Object.defineProperty(e.prototype,"multi",{get:function(){return this._multi},set:function(e){this._multi=t.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype.openAll=function(){this._openCloseAll(!0)},e.prototype.closeAll=function(){this._openCloseAll(!1)},e.prototype.ngOnChanges=function(e){this._stateChanges.next(e)},e.prototype.ngOnDestroy=function(){this._stateChanges.complete()},e.prototype._openCloseAll=function(e){this.multi&&this._openCloseAllActions.next(e)},e.decorators=[{type:o.Directive,args:[{selector:"cdk-accordion, [cdkAccordion]",exportAs:"cdkAccordion"}]}],e.propDecorators={multi:[{type:o.Input}]},e}(),s=0,d=function(){function e(e,t,i){var c=this;this.accordion=e,this._changeDetectorRef=t,this._expansionDispatcher=i,this._openCloseAllSubscription=n.Subscription.EMPTY,this.closed=new o.EventEmitter,this.opened=new o.EventEmitter,this.destroyed=new o.EventEmitter,this.expandedChange=new o.EventEmitter,this.id="cdk-accordion-child-"+s++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=function(){},this._removeUniqueSelectionListener=i.listen(function(e,t){c.accordion&&!c.accordion.multi&&c.accordion.id===t&&c.id!==e&&(c.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}return Object.defineProperty(e.prototype,"expanded",{get:function(){return this._expanded},set:function(e){if(e=t.coerceBooleanProperty(e),this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();var o=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,o)}else this.closed.emit();this._changeDetectorRef.markForCheck()}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this._disabled=t.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()},e.prototype.toggle=function(){this.disabled||(this.expanded=!this.expanded)},e.prototype.close=function(){this.disabled||(this.expanded=!1)},e.prototype.open=function(){this.disabled||(this.expanded=!0)},e.prototype._subscribeToOpenCloseAllActions=function(){var e=this;return this.accordion._openCloseAllActions.subscribe(function(t){e.disabled||(e.expanded=t)})},e.decorators=[{type:o.Directive,args:[{selector:"cdk-accordion-item, [cdkAccordionItem]",exportAs:"cdkAccordionItem",providers:[{provide:r,useValue:void 0}]}]}],e.ctorParameters=function(){return[{type:r,decorators:[{type:o.Optional},{type:o.SkipSelf}]},{type:o.ChangeDetectorRef},{type:i.UniqueSelectionDispatcher}]},e.propDecorators={closed:[{type:o.Output}],opened:[{type:o.Output}],destroyed:[{type:o.Output}],expandedChange:[{type:o.Output}],expanded:[{type:o.Input}],disabled:[{type:o.Input}]},e}(),p=function(){function e(){}return e.decorators=[{type:o.NgModule,args:[{exports:[r,d],declarations:[r,d]}]}],e}();e.CdkAccordionItem=d,e.CdkAccordion=r,e.CdkAccordionModule=p,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=cdk-accordion.umd.min.js.map