{"version":3,"file":"legacy-list.mjs","sources":["../../../../../../src/material/legacy-list/list.ts","../../../../../../src/material/legacy-list/list.html","../../../../../../src/material/legacy-list/list-item.html","../../../../../../src/material/legacy-list/selection-list.ts","../../../../../../src/material/legacy-list/list-option.html","../../../../../../src/material/legacy-list/list-module.ts","../../../../../../src/material/legacy-list/legacy-list_public_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 Inject,\n} from '@angular/core';\nimport {\n CanDisable,\n CanDisableRipple,\n MatLine,\n setLines,\n mixinDisableRipple,\n mixinDisabled,\n} from '@angular/material/core';\nimport {MAT_LIST, MAT_NAV_LIST} from '@angular/material/list';\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 * @deprecated Use `MatNavList` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\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: MatLegacyNavList}],\n})\nexport class MatLegacyNavList\n extends _MatListBase\n implements CanDisable, CanDisableRipple, OnChanges, OnDestroy\n{\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\n/**\n * @deprecated Use `MatList` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\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: MatLegacyList}],\n})\nexport class MatLegacyList\n extends _MatListBase\n implements CanDisable, CanDisableRipple, OnChanges, OnDestroy\n{\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 _elementRef.nativeElement.setAttribute('role', 'group');\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\n/**\n * Directive whose purpose is to add the mat- CSS styling to this selector.\n * @docs-private\n * @deprecated Use `MatListAvatarCssMatStyler` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Directive({\n selector: '[mat-list-avatar], [matListAvatar]',\n host: {'class': 'mat-list-avatar'},\n})\nexport class MatLegacyListAvatarCssMatStyler {}\n\n/**\n * Directive whose purpose is to add the mat- CSS styling to this selector.\n * @docs-private\n * @deprecated Use `MatListIconCssMatStyler` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Directive({\n selector: '[mat-list-icon], [matListIcon]',\n host: {'class': 'mat-list-icon'},\n})\nexport class MatLegacyListIconCssMatStyler {}\n\n/**\n * Directive whose purpose is to add the mat- CSS styling to this selector.\n * @docs-private\n * @deprecated Use `MatListSubheaderCssMatStyler` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Directive({\n selector: '[mat-subheader], [matSubheader]',\n host: {'class': 'mat-subheader'},\n})\nexport class MatLegacyListSubheaderCssMatStyler {}\n\n/**\n * An item within a Material Design list.\n * @deprecated Use `MatListItem` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\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 '[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 MatLegacyListItem\n extends _MatListItemMixinBase\n implements AfterContentInit, CanDisableRipple, OnDestroy\n{\n private _isInteractiveList: boolean = false;\n private _list?: MatLegacyNavList | MatLegacyList;\n private readonly _destroyed = new Subject();\n\n @ContentChildren(MatLine, {descendants: true}) _lines: QueryList;\n @ContentChild(MatLegacyListAvatarCssMatStyler) _avatar: MatLegacyListAvatarCssMatStyler;\n @ContentChild(MatLegacyListIconCssMatStyler) _icon: MatLegacyListIconCssMatStyler;\n\n constructor(\n private _element: ElementRef,\n _changeDetectorRef: ChangeDetectorRef,\n @Optional() @Inject(MAT_NAV_LIST) navList?: MatLegacyNavList,\n @Optional() @Inject(MAT_LIST) list?: MatLegacyList,\n ) {\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