blob: 9c4797f92b6ae26f26f0e23e4dd6de58bfadc256 [file] [log] [blame]
{"version":3,"sources":["src/cdk/cdk-accordion.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","accordion","core","collections","coercion","rxjs","this","nextId","CDK_ACCORDION","InjectionToken","CdkAccordion","_stateChanges","Subject","_openCloseAllActions","id","_multi","Object","defineProperty","prototype","get","set","multi","coerceBooleanProperty","enumerable","configurable","openAll","next","closeAll","ngOnChanges","changes","ngOnDestroy","complete","decorators","type","Directive","args","selector","exportAs","providers","provide","useExisting","propDecorators","Input","CdkAccordionModule","nextId$1","CdkAccordionItem","_changeDetectorRef","_expansionDispatcher","_this","_openCloseAllSubscription","Subscription","EMPTY","closed","EventEmitter","opened","destroyed","expandedChange","_expanded","_disabled","_removeUniqueSelectionListener","listen","accordionId","expanded","_subscribeToOpenCloseAllActions","emit","notify","markForCheck","disabled","unsubscribe","toggle","close","open","subscribe","useValue","undefined","ctorParameters","Optional","Inject","SkipSelf","ChangeDetectorRef","UniqueSelectionDispatcher","Output","NgModule","declarations","ɵangular_material_src_cdk_accordion_accordion_a","value"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,iBAAkBA,QAAQ,4BAA6BA,QAAQ,yBAA0BA,QAAQ,SACvK,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,yBAA0B,CAAC,UAAW,gBAAiB,2BAA4B,wBAAyB,QAASJ,GAC/IA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC,UAAY,IAAKV,EAAOQ,GAAGG,KAAMX,EAAOQ,GAAGC,IAAIG,YAAaZ,EAAOQ,GAAGC,IAAII,SAAUb,EAAOc,MAHlN,CAIEC,MAAM,SAAWb,EAASS,EAAMC,EAAaC,EAAUC,GAAQ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7CpD,EAAQiB,aAAeA,EACvBjB,EAAQoD,iBAAmBA,EAC3BpD,EAAQkD,mBAAqBA,EAC7BlD,EAAQ2F,gDAAkD5E,EAE1DQ,OAAOC,eAAexB,EAAS,aAAc,CAAE4F,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/cdk/collections'), require('@angular/cdk/coercion'), require('rxjs')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/accordion', ['exports', '@angular/core', '@angular/cdk/collections', '@angular/cdk/coercion', 'rxjs'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.accordion = {}), global.ng.core, global.ng.cdk.collections, global.ng.cdk.coercion, global.rxjs));\n}(this, (function (exports, core, collections, coercion, rxjs) { 'use strict';\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /** Used to generate unique ID for each accordion. */\n var nextId = 0;\n /**\n * Injection token that can be used to reference instances of `CdkAccordion`. It serves\n * as alternative token to the actual `CdkAccordion` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\n var CDK_ACCORDION = new core.InjectionToken('CdkAccordion');\n /**\n * Directive whose purpose is to manage the expanded state of CdkAccordionItem children.\n */\n var CdkAccordion = /** @class */ (function () {\n function CdkAccordion() {\n /** Emits when the state of the accordion changes */\n this._stateChanges = new rxjs.Subject();\n /** Stream that emits true/false when openAll/closeAll is triggered. */\n this._openCloseAllActions = new rxjs.Subject();\n /** A readonly id value to use for unique selection coordination. */\n this.id = \"cdk-accordion-\" + nextId++;\n this._multi = false;\n }\n Object.defineProperty(CdkAccordion.prototype, \"multi\", {\n /** Whether the accordion should allow multiple expanded accordion items simultaneously. */\n get: function () { return this._multi; },\n set: function (multi) { this._multi = coercion.coerceBooleanProperty(multi); },\n enumerable: false,\n configurable: true\n });\n /** Opens all enabled accordion items in an accordion where multi is enabled. */\n CdkAccordion.prototype.openAll = function () {\n if (this._multi) {\n this._openCloseAllActions.next(true);\n }\n };\n /** Closes all enabled accordion items in an accordion where multi is enabled. */\n CdkAccordion.prototype.closeAll = function () {\n this._openCloseAllActions.next(false);\n };\n CdkAccordion.prototype.ngOnChanges = function (changes) {\n this._stateChanges.next(changes);\n };\n CdkAccordion.prototype.ngOnDestroy = function () {\n this._stateChanges.complete();\n this._openCloseAllActions.complete();\n };\n return CdkAccordion;\n }());\n CdkAccordion.decorators = [\n { type: core.Directive, args: [{\n selector: 'cdk-accordion, [cdkAccordion]',\n exportAs: 'cdkAccordion',\n providers: [{ provide: CDK_ACCORDION, useExisting: CdkAccordion }],\n },] }\n ];\n CdkAccordion.propDecorators = {\n multi: [{ type: core.Input }]\n };\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /** Used to generate unique ID for each accordion item. */\n var nextId$1 = 0;\n var ɵ0 = undefined;\n /**\n * An basic directive expected to be extended and decorated as a component. Sets up all\n * events and attributes needed to be managed by a CdkAccordion parent.\n */\n var CdkAccordionItem = /** @class */ (function () {\n function CdkAccordionItem(accordion, _changeDetectorRef, _expansionDispatcher) {\n var _this = this;\n this.accordion = accordion;\n this._changeDetectorRef = _changeDetectorRef;\n this._expansionDispatcher = _expansionDispatcher;\n /** Subscription to openAll/closeAll events. */\n this._openCloseAllSubscription = rxjs.Subscription.EMPTY;\n /** Event emitted every time the AccordionItem is closed. */\n this.closed = new core.EventEmitter();\n /** Event emitted every time the AccordionItem is opened. */\n this.opened = new core.EventEmitter();\n /** Event emitted when the AccordionItem is destroyed. */\n this.destroyed = new core.EventEmitter();\n /**\n * Emits whenever the expanded state of the accordion changes.\n * Primarily used to facilitate two-way binding.\n * @docs-private\n */\n this.expandedChange = new core.EventEmitter();\n /** The unique AccordionItem id. */\n this.id = \"cdk-accordion-child-\" + nextId$1++;\n this._expanded = false;\n this._disabled = false;\n /** Unregister function for _expansionDispatcher. */\n this._removeUniqueSelectionListener = function () { };\n this._removeUniqueSelectionListener =\n _expansionDispatcher.listen(function (id, accordionId) {\n if (_this.accordion && !_this.accordion.multi &&\n _this.accordion.id === accordionId && _this.id !== id) {\n _this.expanded = false;\n }\n });\n // When an accordion item is hosted in an accordion, subscribe to open/close events.\n if (this.accordion) {\n this._openCloseAllSubscription = this._subscribeToOpenCloseAllActions();\n }\n }\n Object.defineProperty(CdkAccordionItem.prototype, \"expanded\", {\n /** Whether the AccordionItem is expanded. */\n get: function () { return this._expanded; },\n set: function (expanded) {\n expanded = coercion.coerceBooleanProperty(expanded);\n // Only emit events and update the internal value if the value changes.\n if (this._expanded !== expanded) {\n this._expanded = expanded;\n this.expandedChange.emit(expanded);\n if (expanded) {\n this.opened.emit();\n /**\n * In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,\n * the name value is the id of the accordion.\n */\n var accordionId = this.accordion ? this.accordion.id : this.id;\n this._expansionDispatcher.notify(this.id, accordionId);\n }\n else {\n this.closed.emit();\n }\n // Ensures that the animation will run when the value is set outside of an `@Input`.\n // This includes cases like the open, close and toggle methods.\n this._changeDetectorRef.markForCheck();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkAccordionItem.prototype, \"disabled\", {\n /** Whether the AccordionItem is disabled. */\n get: function () { return this._disabled; },\n set: function (disabled) { this._disabled = coercion.coerceBooleanProperty(disabled); },\n enumerable: false,\n configurable: true\n });\n /** Emits an event for the accordion item being destroyed. */\n CdkAccordionItem.prototype.ngOnDestroy = function () {\n this.opened.complete();\n this.closed.complete();\n this.destroyed.emit();\n this.destroyed.complete();\n this._removeUniqueSelectionListener();\n this._openCloseAllSubscription.unsubscribe();\n };\n /** Toggles the expanded state of the accordion item. */\n CdkAccordionItem.prototype.toggle = function () {\n if (!this.disabled) {\n this.expanded = !this.expanded;\n }\n };\n /** Sets the expanded state of the accordion item to false. */\n CdkAccordionItem.prototype.close = function () {\n if (!this.disabled) {\n this.expanded = false;\n }\n };\n /** Sets the expanded state of the accordion item to true. */\n CdkAccordionItem.prototype.open = function () {\n if (!this.disabled) {\n this.expanded = true;\n }\n };\n CdkAccordionItem.prototype._subscribeToOpenCloseAllActions = function () {\n var _this = this;\n return this.accordion._openCloseAllActions.subscribe(function (expanded) {\n // Only change expanded state if item is enabled\n if (!_this.disabled) {\n _this.expanded = expanded;\n }\n });\n };\n return CdkAccordionItem;\n }());\n CdkAccordionItem.decorators = [\n { type: core.Directive, args: [{\n selector: 'cdk-accordion-item, [cdkAccordionItem]',\n exportAs: 'cdkAccordionItem',\n providers: [\n // Provide `CDK_ACCORDION` as undefined to prevent nested accordion items from\n // registering to the same accordion.\n { provide: CDK_ACCORDION, useValue: ɵ0 },\n ],\n },] }\n ];\n CdkAccordionItem.ctorParameters = function () { return [\n { type: CdkAccordion, decorators: [{ type: core.Optional }, { type: core.Inject, args: [CDK_ACCORDION,] }, { type: core.SkipSelf }] },\n { type: core.ChangeDetectorRef },\n { type: collections.UniqueSelectionDispatcher }\n ]; };\n CdkAccordionItem.propDecorators = {\n closed: [{ type: core.Output }],\n opened: [{ type: core.Output }],\n destroyed: [{ type: core.Output }],\n expandedChange: [{ type: core.Output }],\n expanded: [{ type: core.Input }],\n disabled: [{ type: core.Input }]\n };\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n var CdkAccordionModule = /** @class */ (function () {\n function CdkAccordionModule() {\n }\n return CdkAccordionModule;\n }());\n CdkAccordionModule.decorators = [\n { type: core.NgModule, args: [{\n exports: [CdkAccordion, CdkAccordionItem],\n declarations: [CdkAccordion, CdkAccordionItem],\n },] }\n ];\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.CdkAccordion = CdkAccordion;\n exports.CdkAccordionItem = CdkAccordionItem;\n exports.CdkAccordionModule = CdkAccordionModule;\n exports.ɵangular_material_src_cdk_accordion_accordion_a = CDK_ACCORDION;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-accordion.umd.js.map\n"]}