{"version":3,"file":"list.js","sources":["../../../../../../src/material/list/list.ts","../../../../../../src/material/list/selection-list.ts","../../../../../../src/material/list/list-module.ts","../../../../../../src/material/list/public-api.ts","../../../../../../src/material/list/index.ts"],"sourcesContent":["/**\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\nimport {coerceBooleanProperty, BooleanInput} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n ElementRef,\n Optional,\n QueryList,\n ViewEncapsulation,\n OnChanges,\n OnDestroy,\n ChangeDetectorRef,\n Input,\n InjectionToken,\n Inject,\n} from '@angular/core';\nimport {\n CanDisable,\n CanDisableRipple,\n MatLine,\n setLines,\n mixinDisableRipple,\n mixinDisabled,\n} from '@angular/material/core';\nimport {Subject} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n// Boilerplate for applying mixins to MatList.\n/** @docs-private */\nconst _MatListBase = mixinDisabled(mixinDisableRipple(class {}));\n\n// Boilerplate for applying mixins to MatListItem.\n/** @docs-private */\nconst _MatListItemMixinBase = mixinDisableRipple(class {});\n\n/**\n * Injection token that can be used to inject instances of `MatList`. It serves as\n * alternative token to the actual `MatList` class which could cause unnecessary\n * retention of the class and its component metadata.\n */\nexport const MAT_LIST = new InjectionToken('MatList');\n\n/**\n * Injection token that can be used to inject instances of `MatNavList`. It serves as\n * alternative token to the actual `MatNavList` class which could cause unnecessary\n * retention of the class and its component metadata.\n */\nexport const MAT_NAV_LIST = new InjectionToken('MatNavList');\n\n@Component({\n selector: 'mat-nav-list',\n exportAs: 'matNavList',\n host: {\n 'role': 'navigation',\n 'class': 'mat-nav-list mat-list-base'\n },\n templateUrl: 'list.html',\n styleUrls: ['list.css'],\n inputs: ['disableRipple', 'disabled'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{provide: MAT_NAV_LIST, useExisting: MatNavList}],\n})\nexport class MatNavList extends _MatListBase implements CanDisable, CanDisableRipple,\n OnChanges, OnDestroy {\n /** Emits when the state of the list changes. */\n readonly _stateChanges = new Subject();\n\n ngOnChanges() {\n this._stateChanges.next();\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n }\n\n static ngAcceptInputType_disableRipple: BooleanInput;\n static ngAcceptInputType_disabled: BooleanInput;\n}\n\n@Component({\n selector: 'mat-list, mat-action-list',\n exportAs: 'matList',\n templateUrl: 'list.html',\n host: {\n 'class': 'mat-list mat-list-base'\n },\n styleUrls: ['list.css'],\n inputs: ['disableRipple', 'disabled'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{provide: MAT_LIST, useExisting: MatList}],\n})\nexport class MatList extends _MatListBase implements CanDisable, CanDisableRipple, OnChanges,\n OnDestroy {\n /** Emits when the state of the list changes. */\n readonly _stateChanges = new Subject();\n\n constructor(private _elementRef: ElementRef) {\n super();\n\n if (this._getListType() === 'action-list') {\n _elementRef.nativeElement.classList.add('mat-action-list');\n }\n }\n\n _getListType(): 'list' | 'action-list' | null {\n const nodeName = this._elementRef.nativeElement.nodeName.toLowerCase();\n\n if (nodeName === 'mat-list') {\n return 'list';\n }\n\n if (nodeName === 'mat-action-list') {\n return 'action-list';\n }\n\n return null;\n }\n\n ngOnChanges() {\n this._stateChanges.next();\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n }\n\n static ngAcceptInputType_disableRipple: BooleanInput;\n static ngAcceptInputType_disabled: BooleanInput;\n}\n\n/**\n * Directive whose purpose is to add the mat- CSS styling to this selector.\n * @docs-private\n */\n@Directive({\n selector: '[mat-list-avatar], [matListAvatar]',\n host: {'class': 'mat-list-avatar'}\n})\nexport class MatListAvatarCssMatStyler {}\n\n/**\n * Directive whose purpose is to add the mat- CSS styling to this selector.\n * @docs-private\n */\n@Directive({\n selector: '[mat-list-icon], [matListIcon]',\n host: {'class': 'mat-list-icon'}\n})\nexport class MatListIconCssMatStyler {}\n\n/**\n * Directive whose purpose is to add the mat- CSS styling to this selector.\n * @docs-private\n */\n@Directive({\n selector: '[mat-subheader], [matSubheader]',\n host: {'class': 'mat-subheader'}\n})\nexport class MatListSubheaderCssMatStyler {}\n\n/** An item within a Material Design list. */\n@Component({\n selector: 'mat-list-item, a[mat-list-item], button[mat-list-item]',\n exportAs: 'matListItem',\n host: {\n 'class': 'mat-list-item mat-focus-indicator',\n '[class.mat-list-item-disabled]': 'disabled',\n // @breaking-change 8.0.0 Remove `mat-list-item-avatar` in favor of `mat-list-item-with-avatar`.\n '[class.mat-list-item-avatar]': '_avatar || _icon',\n '[class.mat-list-item-with-avatar]': '_avatar || _icon',\n },\n inputs: ['disableRipple'],\n templateUrl: 'list-item.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatListItem extends _MatListItemMixinBase implements AfterContentInit,\n CanDisableRipple, OnDestroy {\n private _isInteractiveList: boolean = false;\n private _list?: MatNavList | MatList;\n private readonly _destroyed = new Subject();\n\n @ContentChildren(MatLine, {descendants: true}) _lines: QueryList;\n @ContentChild(MatListAvatarCssMatStyler) _avatar: MatListAvatarCssMatStyler;\n @ContentChild(MatListIconCssMatStyler) _icon: MatListIconCssMatStyler;\n\n constructor(private _element: ElementRef,\n _changeDetectorRef: ChangeDetectorRef,\n @Optional() @Inject(MAT_NAV_LIST) navList?: MatNavList,\n @Optional() @Inject(MAT_LIST) list?: MatList) {\n super();\n this._isInteractiveList = !!(navList || (list && list._getListType() === 'action-list'));\n this._list = navList || list;\n\n // If no type attribute is specified for