{"version":3,"file":"list.mjs","sources":["../../../../../../src/material/list/list-option-types.ts","../../../../../../src/material/list/list-item-sections.ts","../../../../../../src/material/list/tokens.ts","../../../../../../src/material/list/list-base.ts","../../../../../../src/material/list/action-list.ts","../../../../../../src/material/list/list.ts","../../../../../../src/material/list/list-item.html","../../../../../../src/material/list/list-option.ts","../../../../../../src/material/list/list-option.html","../../../../../../src/material/list/subheader.ts","../../../../../../src/material/list/nav-list.ts","../../../../../../src/material/list/selection-list.ts","../../../../../../src/material/list/list-module.ts","../../../../../../src/material/list/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 {InjectionToken} from '@angular/core';\n\n/**\n * Type describing possible positions of a checkbox or radio in a list option\n * with respect to the list item's text.\n */\nexport type MatListOptionTogglePosition = 'before' | 'after';\n\n/**\n * Interface describing a list option. This is used to avoid circular\n * dependencies between the list-option and the styler directives.\n * @docs-private\n */\nexport interface ListOption {\n _getTogglePosition(): MatListOptionTogglePosition;\n}\n\n/**\n * Injection token that can be used to reference instances of an `ListOption`. It serves\n * as alternative token to an actual implementation which could result in undesired\n * retention of the class or circular references breaking runtime execution.\n * @docs-private\n */\nexport const LIST_OPTION = new InjectionToken('ListOption');\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\nimport {Directive, ElementRef, Inject, Optional} from '@angular/core';\nimport {LIST_OPTION, ListOption} from './list-option-types';\n\n/**\n * Directive capturing the title of a list item. A list item usually consists of a\n * title and optional secondary or tertiary lines.\n *\n * Text content for the title never wraps. There can only be a single title per list item.\n */\n@Directive({\n selector: '[matListItemTitle]',\n host: {'class': 'mat-mdc-list-item-title mdc-list-item__primary-text'},\n})\nexport class MatListItemTitle {\n constructor(public _elementRef: ElementRef) {}\n}\n\n/**\n * Directive capturing a line in a list item. A list item usually consists of a\n * title and optional secondary or tertiary lines.\n *\n * Text content inside a line never wraps. There can be at maximum two lines per list item.\n */\n@Directive({\n selector: '[matListItemLine]',\n host: {'class': 'mat-mdc-list-item-line mdc-list-item__secondary-text'},\n})\nexport class MatListItemLine {\n constructor(public _elementRef: ElementRef) {}\n}\n\n/**\n * Directive matching an optional meta section for list items.\n *\n * List items can reserve space at the end of an item to display a control,\n * button or additional text content.\n */\n@Directive({\n selector: '[matListItemMeta]',\n host: {'class': 'mat-mdc-list-item-meta mdc-list-item__end'},\n})\nexport class MatListItemMeta {}\n\n/**\n * @docs-private\n *\n * MDC uses the very intuitively named classes `.mdc-list-item__start` and `.mat-list-item__end` to\n * position content such as icons or checkboxes/radios that comes either before or after the text\n * content respectively. This directive detects the placement of the checkbox/radio and applies the\n * correct MDC class to position the icon/avatar on the opposite side.\n */\n@Directive({\n host: {\n // MDC uses intuitively named classes `.mdc-list-item__start` and `.mat-list-item__end` to\n // position content such as icons or checkboxes/radios that comes either before or after the\n // text content respectively. This directive detects the placement of the checkbox/radio and\n // applies the correct MDC class to position the icon/avatar on the opposite side.\n '[class.mdc-list-item__start]': '_isAlignedAtStart()',\n '[class.mdc-list-item__end]': '!_isAlignedAtStart()',\n },\n})\nexport class _MatListItemGraphicBase {\n constructor(@Optional() @Inject(LIST_OPTION) public _listOption: ListOption) {}\n\n _isAlignedAtStart() {\n // By default, in all list items the graphic is aligned at start. In list options,\n // the graphic is only aligned at start if the checkbox/radio is at the end.\n return !this._listOption || this._listOption?._getTogglePosition() === 'after';\n }\n}\n\n/**\n * Directive matching an optional avatar within a list item.\n *\n * List items can reserve space at the beginning of an item to display an avatar.\n */\n@Directive({\n selector: '[matListItemAvatar]',\n host: {'class': 'mat-mdc-list-item-avatar'},\n})\nexport class MatListItemAvatar extends _MatListItemGraphicBase {}\n\n/**\n * Directive matching an optional icon within a list item.\n *\n * List items can reserve space at the beginning of an item to display an icon.\n */\n@Directive({\n selector: '[matListItemIcon]',\n host: {'class': 'mat-mdc-list-item-icon'},\n})\nexport class MatListItemIcon extends _MatListItemGraphicBase {}\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\nimport {InjectionToken} from '@angular/core';\n\n/** Object that can be used to configure the default options for the list module. */\nexport interface MatListConfig {\n /** Wheter icon indicators should be hidden for single-selection. */\n hideSingleSelectionIndicator?: boolean;\n}\n\n/** Injection token that can be used to provide the default options the list module. */\nexport const MAT_LIST_CONFIG = new InjectionToken('MAT_LIST_CONFIG');\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\nimport {BooleanInput, coerceBooleanProperty, coerceNumberProperty} from '@angular/cdk/coercion';\nimport {Platform} from '@angular/cdk/platform';\nimport {\n AfterViewInit,\n ContentChildren,\n Directive,\n ElementRef,\n inject,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n QueryList,\n} from '@angular/core';\nimport {\n MAT_RIPPLE_GLOBAL_OPTIONS,\n RippleConfig,\n RippleGlobalOptions,\n RippleRenderer,\n RippleTarget,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {Subscription, merge} from 'rxjs';\nimport {\n MatListItemLine,\n MatListItemTitle,\n MatListItemIcon,\n MatListItemAvatar,\n} from './list-item-sections';\nimport {MAT_LIST_CONFIG} from './tokens';\n\n@Directive({\n host: {\n '[attr.aria-disabled]': 'disabled',\n },\n})\n/** @docs-private */\nexport abstract class MatListBase {\n _isNonInteractive: boolean = true;\n\n /** Whether ripples for all list items is disabled. */\n @Input()\n get disableRipple(): boolean {\n return this._disableRipple;\n }\n set disableRipple(value: BooleanInput) {\n this._disableRipple = coerceBooleanProperty(value);\n }\n private _disableRipple: boolean = false;\n\n /**\n * Whether the entire list is disabled. When disabled, the list itself and each of its list items\n * are disabled.\n */\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n protected _defaultOptions = inject(MAT_LIST_CONFIG, {optional: true});\n}\n\n@Directive({\n host: {\n '[class.mdc-list-item--disabled]': 'disabled',\n '[attr.aria-disabled]': 'disabled',\n '[attr.disabled]': '(_isButtonElement && disabled) || null',\n },\n})\n/** @docs-private */\nexport abstract class MatListItemBase implements AfterViewInit, OnDestroy, RippleTarget {\n /** Query list matching list-item line elements. */\n abstract _lines: QueryList | undefined;\n\n /** Query list matching list-item title elements. */\n abstract _titles: QueryList | undefined;\n\n /**\n * Element reference to the unscoped content in a list item.\n *\n * Unscoped content is user-projected text content in a list item that is\n * not part of an explicit line or title.\n */\n abstract _unscopedContent: ElementRef | undefined;\n\n /** Host element for the list item. */\n _hostElement: HTMLElement;\n\n /** indicate whether the host element is a button or not */\n _isButtonElement: boolean;\n\n /** Whether animations are disabled. */\n _noopAnimations: boolean;\n\n @ContentChildren(MatListItemAvatar, {descendants: false}) _avatars: QueryList;\n @ContentChildren(MatListItemIcon, {descendants: false}) _icons: QueryList;\n\n /**\n * The number of lines this list item should reserve space for. If not specified,\n * lines are inferred based on the projected content.\n *\n * Explicitly specifying the number of lines is useful if you want to acquire additional\n * space and enable the wrapping of text. The unscoped text content of a list item will\n * always be able to take up the remaining space of the item, unless it represents the title.\n *\n * A maximum of three lines is supported as per the Material Design specification.\n */\n @Input()\n set lines(lines: number | string | null) {\n this._explicitLines = coerceNumberProperty(lines, null);\n this._updateItemLines(false);\n }\n _explicitLines: number | null = null;\n\n /** Whether ripples for list items are disabled. */\n @Input()\n get disableRipple(): boolean {\n return (\n this.disabled ||\n this._disableRipple ||\n this._noopAnimations ||\n !!this._listBase?.disableRipple\n );\n }\n set disableRipple(value: BooleanInput) {\n this._disableRipple = coerceBooleanProperty(value);\n }\n private _disableRipple: boolean = false;\n\n /** Whether the list-item is disabled. */\n @Input()\n get disabled(): boolean {\n return this._disabled || !!this._listBase?.disabled;\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n private _subscriptions = new Subscription();\n private _rippleRenderer: RippleRenderer | null = null;\n\n /** Whether the list item has unscoped text content. */\n _hasUnscopedTextContent: boolean = false;\n\n /**\n * Implemented as part of `RippleTarget`.\n * @docs-private\n */\n rippleConfig: RippleConfig & RippleGlobalOptions;\n\n /**\n * Implemented as part of `RippleTarget`.\n * @docs-private\n */\n get rippleDisabled(): boolean {\n return this.disableRipple || !!this.rippleConfig.disabled;\n }\n\n constructor(\n public _elementRef: ElementRef,\n protected _ngZone: NgZone,\n @Optional() private _listBase: MatListBase | null,\n private _platform: Platform,\n @Optional()\n @Inject(MAT_RIPPLE_GLOBAL_OPTIONS)\n globalRippleOptions?: RippleGlobalOptions,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n ) {\n this.rippleConfig = globalRippleOptions || {};\n this._hostElement = this._elementRef.nativeElement;\n this._isButtonElement = this._hostElement.nodeName.toLowerCase() === 'button';\n this._noopAnimations = animationMode === 'NoopAnimations';\n\n if (_listBase && !_listBase._isNonInteractive) {\n this._initInteractiveListItem();\n }\n\n // If no type attribute is specified for a host `