{"version":3,"file":"listbox.mjs","sources":["../../../../../../src/cdk/listbox/listbox.ts","../../../../../../src/cdk/listbox/listbox-module.ts","../../../../../../src/cdk/listbox/listbox_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 {\n AfterContentInit,\n ChangeDetectorRef,\n ContentChildren,\n Directive,\n ElementRef,\n forwardRef,\n inject,\n Input,\n NgZone,\n OnDestroy,\n Output,\n QueryList,\n} from '@angular/core';\nimport {ActiveDescendantKeyManager, Highlightable, ListKeyManagerOption} from '@angular/cdk/a11y';\nimport {\n A,\n DOWN_ARROW,\n END,\n ENTER,\n hasModifierKey,\n HOME,\n LEFT_ARROW,\n RIGHT_ARROW,\n SPACE,\n UP_ARROW,\n} from '@angular/cdk/keycodes';\nimport {BooleanInput, coerceArray, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {defer, fromEvent, merge, Observable, Subject} from 'rxjs';\nimport {filter, map, startWith, switchMap, takeUntil} from 'rxjs/operators';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {Directionality} from '@angular/cdk/bidi';\n\n/** The next id to use for creating unique DOM IDs. */\nlet nextId = 0;\n\n/**\n * An implementation of SelectionModel that internally always represents the selection as a\n * multi-selection. This is necessary so that we can recover the full selection if the user\n * switches the listbox from single-selection to multi-selection after initialization.\n *\n * This selection model may report multiple selected values, even if it is in single-selection\n * mode. It is up to the user (CdkListbox) to check for invalid selections.\n */\nclass ListboxSelectionModel extends SelectionModel {\n constructor(\n public multiple = false,\n initiallySelectedValues?: T[],\n emitChanges = true,\n compareWith?: (o1: T, o2: T) => boolean,\n ) {\n super(true, initiallySelectedValues, emitChanges, compareWith);\n }\n\n override isMultipleSelection(): boolean {\n return this.multiple;\n }\n\n override select(...values: T[]) {\n // The super class is always in multi-selection mode, so we need to override the behavior if\n // this selection model actually belongs to a single-selection listbox.\n if (this.multiple) {\n return super.select(...values);\n } else {\n return super.setSelection(...values);\n }\n }\n}\n\n/** A selectable option in a listbox. */\n@Directive({\n selector: '[cdkOption]',\n standalone: true,\n exportAs: 'cdkOption',\n host: {\n 'role': 'option',\n 'class': 'cdk-option',\n '[id]': 'id',\n '[attr.aria-selected]': 'isSelected()',\n '[attr.tabindex]': '_getTabIndex()',\n '[attr.aria-disabled]': 'disabled',\n '[class.cdk-option-active]': 'isActive()',\n '(click)': '_clicked.next($event)',\n '(focus)': '_handleFocus()',\n },\n})\nexport class CdkOption implements ListKeyManagerOption, Highlightable, OnDestroy {\n /** The id of the option's host element. */\n @Input()\n get id() {\n return this._id || this._generatedId;\n }\n set id(value) {\n this._id = value;\n }\n private _id: string;\n private _generatedId = `cdk-option-${nextId++}`;\n\n /** The value of this option. */\n @Input('cdkOption') value: T;\n\n /**\n * The text used to locate this item during listbox typeahead. If not specified,\n * the `textContent` of the item will be used.\n */\n @Input('cdkOptionTypeaheadLabel') typeaheadLabel: string;\n\n /** Whether this option is disabled. */\n @Input('cdkOptionDisabled')\n get disabled(): boolean {\n return this.listbox.disabled || this._disabled;\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled: boolean = false;\n\n /** The tabindex of the option when it is enabled. */\n @Input('tabindex')\n get enabledTabIndex() {\n return this._enabledTabIndex === undefined\n ? this.listbox.enabledTabIndex\n : this._enabledTabIndex;\n }\n set enabledTabIndex(value) {\n this._enabledTabIndex = value;\n }\n private _enabledTabIndex?: number | null;\n\n /** The option's host element */\n readonly element: HTMLElement = inject(ElementRef).nativeElement;\n\n /** The parent listbox this option belongs to. */\n protected readonly listbox: CdkListbox = inject(CdkListbox);\n\n /** Emits when the option is destroyed. */\n protected destroyed = new Subject();\n\n /** Emits when the option is clicked. */\n readonly _clicked = new Subject();\n\n ngOnDestroy() {\n this.destroyed.next();\n this.destroyed.complete();\n }\n\n /** Whether this option is selected. */\n isSelected() {\n return this.listbox.isSelected(this);\n }\n\n /** Whether this option is active. */\n isActive() {\n return this.listbox.isActive(this);\n }\n\n /** Toggle the selected state of this option. */\n toggle() {\n this.listbox.toggle(this);\n }\n\n /** Select this option if it is not selected. */\n select() {\n this.listbox.select(this);\n }\n\n /** Deselect this option if it is selected. */\n deselect() {\n this.listbox.deselect(this);\n }\n\n /** Focus this option. */\n focus() {\n this.element.focus();\n }\n\n /** Get the label for this element which is required by the FocusableOption interface. */\n getLabel() {\n return (this.typeaheadLabel ?? this.element.textContent?.trim()) || '';\n }\n\n /**\n * No-op implemented as a part of `Highlightable`.\n * @docs-private\n */\n setActiveStyles() {}\n\n /**\n * No-op implemented as a part of `Highlightable`.\n * @docs-private\n */\n setInactiveStyles() {}\n\n /** Handle focus events on the option. */\n protected _handleFocus() {\n // Options can wind up getting focused in active descendant mode if the user clicks on them.\n // In this case, we push focus back to the parent listbox to prevent an extra tab stop when\n // the user performs a shift+tab.\n if (this.listbox.useActiveDescendant) {\n this.listbox._setActiveOption(this);\n this.listbox.focus();\n }\n }\n\n /** Get the tabindex for this option. */\n protected _getTabIndex() {\n if (this.listbox.useActiveDescendant || this.disabled) {\n return -1;\n }\n return this.isActive() ? this.enabledTabIndex : -1;\n }\n}\n\n@Directive({\n selector: '[cdkListbox]',\n standalone: true,\n exportAs: 'cdkListbox',\n host: {\n 'role': 'listbox',\n 'class': 'cdk-listbox',\n '[id]': 'id',\n '[attr.tabindex]': '_getTabIndex()',\n '[attr.aria-disabled]': 'disabled',\n '[attr.aria-multiselectable]': 'multiple',\n '[attr.aria-activedescendant]': '_getAriaActiveDescendant()',\n '[attr.aria-orientation]': 'orientation',\n '(focus)': '_handleFocus()',\n '(keydown)': '_handleKeydown($event)',\n '(focusout)': '_handleFocusOut($event)',\n '(focusin)': '_handleFocusIn()',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CdkListbox),\n multi: true,\n },\n ],\n})\nexport class CdkListbox implements AfterContentInit, OnDestroy, ControlValueAccessor {\n /** The id of the option's host element. */\n @Input()\n get id() {\n return this._id || this._generatedId;\n }\n set id(value) {\n this._id = value;\n }\n private _id: string;\n private _generatedId = `cdk-listbox-${nextId++}`;\n\n /** The tabindex to use when the listbox is enabled. */\n @Input('tabindex')\n get enabledTabIndex() {\n return this._enabledTabIndex === undefined ? 0 : this._enabledTabIndex;\n }\n set enabledTabIndex(value) {\n this._enabledTabIndex = value;\n }\n private _enabledTabIndex?: number | null;\n\n /** The value selected in the listbox, represented as an array of option values. */\n @Input('cdkListboxValue')\n get value(): readonly T[] {\n return this._invalid ? [] : this.selectionModel.selected;\n }\n set value(value: readonly T[]) {\n this._setSelection(value);\n }\n\n /**\n * Whether the listbox allows multiple options to be selected. If the value switches from `true`\n * to `false`, and more than one option is selected, all options are deselected.\n */\n @Input('cdkListboxMultiple')\n get multiple(): boolean {\n return this.selectionModel.multiple;\n }\n set multiple(value: BooleanInput) {\n this.selectionModel.multiple = coerceBooleanProperty(value);\n\n if (this.options) {\n this._updateInternalValue();\n }\n }\n\n /** Whether the listbox is disabled. */\n @Input('cdkListboxDisabled')\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled: boolean = false;\n\n /** Whether the listbox will use active descendant or will move focus onto the options. */\n @Input('cdkListboxUseActiveDescendant')\n get useActiveDescendant(): boolean {\n return this._useActiveDescendant;\n }\n set useActiveDescendant(shouldUseActiveDescendant: BooleanInput) {\n this._useActiveDescendant = coerceBooleanProperty(shouldUseActiveDescendant);\n }\n private _useActiveDescendant: boolean = false;\n\n /** The orientation of the listbox. Only affects keyboard interaction, not visual layout. */\n @Input('cdkListboxOrientation')\n get orientation() {\n return this._orientation;\n }\n set orientation(value: 'horizontal' | 'vertical') {\n this._orientation = value === 'horizontal' ? 'horizontal' : 'vertical';\n if (value === 'horizontal') {\n this.listKeyManager?.withHorizontalOrientation(this._dir?.value || 'ltr');\n } else {\n this.listKeyManager?.withVerticalOrientation();\n }\n }\n private _orientation: 'horizontal' | 'vertical' = 'vertical';\n\n /** The function used to compare option values. */\n @Input('cdkListboxCompareWith')\n get compareWith(): undefined | ((o1: T, o2: T) => boolean) {\n return this.selectionModel.compareWith;\n }\n set compareWith(fn: undefined | ((o1: T, o2: T) => boolean)) {\n this.selectionModel.compareWith = fn;\n }\n\n /**\n * Whether the keyboard navigation should wrap when the user presses arrow down on the last item\n * or arrow up on the first item.\n */\n @Input('cdkListboxNavigationWrapDisabled')\n get navigationWrapDisabled() {\n return this._navigationWrapDisabled;\n }\n set navigationWrapDisabled(wrap: BooleanInput) {\n this._navigationWrapDisabled = coerceBooleanProperty(wrap);\n this.listKeyManager?.withWrap(!this._navigationWrapDisabled);\n }\n private _navigationWrapDisabled = false;\n\n /** Whether keyboard navigation should skip over disabled items. */\n @Input('cdkListboxNavigatesDisabledOptions')\n get navigateDisabledOptions() {\n return this._navigateDisabledOptions;\n }\n set navigateDisabledOptions(skip: BooleanInput) {\n this._navigateDisabledOptions = coerceBooleanProperty(skip);\n this.listKeyManager?.skipPredicate(\n this._navigateDisabledOptions ? this._skipNonePredicate : this._skipDisabledPredicate,\n );\n }\n private _navigateDisabledOptions = false;\n\n /** Emits when the selected value(s) in the listbox change. */\n @Output('cdkListboxValueChange') readonly valueChange = new Subject>();\n\n /** The child options in this listbox. */\n @ContentChildren(CdkOption, {descendants: true}) protected options: QueryList>;\n\n /** The selection model used by the listbox. */\n protected selectionModel = new ListboxSelectionModel();\n\n /** The key manager that manages keyboard navigation for this listbox. */\n protected listKeyManager: ActiveDescendantKeyManager>;\n\n /** Emits when the listbox is destroyed. */\n protected readonly destroyed = new Subject();\n\n /** The host element of the listbox. */\n protected readonly element: HTMLElement = inject(ElementRef).nativeElement;\n\n /** The Angular zone. */\n protected readonly ngZone = inject(NgZone);\n\n /** The change detector for this listbox. */\n protected readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n /** Whether the currently selected value in the selection model is invalid. */\n private _invalid = false;\n\n /** The last user-triggered option. */\n private _lastTriggered: CdkOption | null = null;\n\n /** Callback called when the listbox has been touched */\n private _onTouched = () => {};\n\n /** Callback called when the listbox value changes */\n private _onChange: (value: readonly T[]) => void = () => {};\n\n /** Emits when an option has been clicked. */\n private _optionClicked = defer(() =>\n (this.options.changes as Observable[]>).pipe(\n startWith(this.options),\n switchMap(options =>\n merge(...options.map(option => option._clicked.pipe(map(event => ({option, event}))))),\n ),\n ),\n );\n\n /** The directionality of the page. */\n private readonly _dir = inject(Directionality, {optional: true});\n\n /** A predicate that skips disabled options. */\n private readonly _skipDisabledPredicate = (option: CdkOption) => option.disabled;\n\n /** A predicate that does not skip any options. */\n private readonly _skipNonePredicate = () => false;\n\n /** Whether the listbox currently has focus. */\n private _hasFocus = false;\n\n /** A reference to the option that was active before the listbox lost focus. */\n private _previousActiveOption: CdkOption | null = null;\n\n constructor() {\n this._setPreviousActiveOptionAsActiveOptionOnWindowBlur();\n }\n\n ngAfterContentInit() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n this._verifyNoOptionValueCollisions();\n this._verifyOptionValues();\n }\n\n this._initKeyManager();\n\n // Update the internal value whenever the options or the model value changes.\n merge(this.selectionModel.changed, this.options.changes)\n .pipe(startWith(null), takeUntil(this.destroyed))\n .subscribe(() => this._updateInternalValue());\n\n this._optionClicked\n .pipe(\n filter(({option}) => !option.disabled),\n takeUntil(this.destroyed),\n )\n .subscribe(({option, event}) => this._handleOptionClicked(option, event));\n }\n\n ngOnDestroy() {\n this.listKeyManager?.destroy();\n this.destroyed.next();\n this.destroyed.complete();\n }\n\n /**\n * Toggle the selected state of the given option.\n * @param option The option to toggle\n */\n toggle(option: CdkOption) {\n this.toggleValue(option.value);\n }\n\n /**\n * Toggle the selected state of the given value.\n * @param value The value to toggle\n */\n toggleValue(value: T) {\n if (this._invalid) {\n this.selectionModel.clear(false);\n }\n this.selectionModel.toggle(value);\n }\n\n /**\n * Select the given option.\n * @param option The option to select\n */\n select(option: CdkOption) {\n this.selectValue(option.value);\n }\n\n /**\n * Select the given value.\n * @param value The value to select\n */\n selectValue(value: T) {\n if (this._invalid) {\n this.selectionModel.clear(false);\n }\n this.selectionModel.select(value);\n }\n\n /**\n * Deselect the given option.\n * @param option The option to deselect\n */\n deselect(option: CdkOption) {\n this.deselectValue(option.value);\n }\n\n /**\n * Deselect the given value.\n * @param value The value to deselect\n */\n deselectValue(value: T) {\n if (this._invalid) {\n this.selectionModel.clear(false);\n }\n this.selectionModel.deselect(value);\n }\n\n /**\n * Set the selected state of all options.\n * @param isSelected The new selected state to set\n */\n setAllSelected(isSelected: boolean) {\n if (!isSelected) {\n this.selectionModel.clear();\n } else {\n if (this._invalid) {\n this.selectionModel.clear(false);\n }\n this.selectionModel.select(...this.options.map(option => option.value));\n }\n }\n\n /**\n * Get whether the given option is selected.\n * @param option The option to get the selected state of\n */\n isSelected(option: CdkOption) {\n return this.isValueSelected(option.value);\n }\n\n /**\n * Get whether the given option is active.\n * @param option The option to get the active state of\n */\n isActive(option: CdkOption): boolean {\n return !!(this.listKeyManager?.activeItem === option);\n }\n\n /**\n * Get whether the given value is selected.\n * @param value The value to get the selected state of\n */\n isValueSelected(value: T) {\n if (this._invalid) {\n return false;\n }\n return this.selectionModel.isSelected(value);\n }\n\n /**\n * Registers a callback to be invoked when the listbox's value changes from user input.\n * @param fn The callback to register\n * @docs-private\n */\n registerOnChange(fn: (value: readonly T[]) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a callback to be invoked when the listbox is blurred by the user.\n * @param fn The callback to register\n * @docs-private\n */\n registerOnTouched(fn: () => {}): void {\n this._onTouched = fn;\n }\n\n /**\n * Sets the listbox's value.\n * @param value The new value of the listbox\n * @docs-private\n */\n writeValue(value: readonly T[]): void {\n this._setSelection(value);\n this._verifyOptionValues();\n }\n\n /**\n * Sets the disabled state of the listbox.\n * @param isDisabled The new disabled state\n * @docs-private\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /** Focus the listbox's host element. */\n focus() {\n this.element.focus();\n }\n\n /**\n * Triggers the given option in response to user interaction.\n * - In single selection mode: selects the option and deselects any other selected option.\n * - In multi selection mode: toggles the selected state of the option.\n * @param option The option to trigger\n */\n protected triggerOption(option: CdkOption | null) {\n if (option && !option.disabled) {\n this._lastTriggered = option;\n const changed = this.multiple\n ? this.selectionModel.toggle(option.value)\n : this.selectionModel.select(option.value);\n if (changed) {\n this._onChange(this.value);\n this.valueChange.next({\n value: this.value,\n listbox: this,\n option: option,\n });\n }\n }\n }\n\n /**\n * Trigger the given range of options in response to user interaction.\n * Should only be called in multi-selection mode.\n * @param trigger The option that was triggered\n * @param from The start index of the options to toggle\n * @param to The end index of the options to toggle\n * @param on Whether to toggle the option range on\n */\n protected triggerRange(trigger: CdkOption | null, from: number, to: number, on: boolean) {\n if (this.disabled || (trigger && trigger.disabled)) {\n return;\n }\n this._lastTriggered = trigger;\n const isEqual = this.compareWith ?? Object.is;\n const updateValues = [...this.options]\n .slice(Math.max(0, Math.min(from, to)), Math.min(this.options.length, Math.max(from, to) + 1))\n .filter(option => !option.disabled)\n .map(option => option.value);\n const selected = [...this.value];\n for (const updateValue of updateValues) {\n const selectedIndex = selected.findIndex(selectedValue =>\n isEqual(selectedValue, updateValue),\n );\n if (on && selectedIndex === -1) {\n selected.push(updateValue);\n } else if (!on && selectedIndex !== -1) {\n selected.splice(selectedIndex, 1);\n }\n }\n let changed = this.selectionModel.setSelection(...selected);\n if (changed) {\n this._onChange(this.value);\n this.valueChange.next({\n value: this.value,\n listbox: this,\n option: trigger,\n });\n }\n }\n\n /**\n * Sets the given option as active.\n * @param option The option to make active\n */\n _setActiveOption(option: CdkOption) {\n this.listKeyManager.setActiveItem(option);\n }\n\n /** Called when the listbox receives focus. */\n protected _handleFocus() {\n if (!this.useActiveDescendant) {\n if (this.selectionModel.selected.length > 0) {\n this._setNextFocusToSelectedOption();\n } else {\n this.listKeyManager.setNextItemActive();\n }\n\n this._focusActiveOption();\n }\n }\n\n /** Called when the user presses keydown on the listbox. */\n protected _handleKeydown(event: KeyboardEvent) {\n if (this._disabled) {\n return;\n }\n\n const {keyCode} = event;\n const previousActiveIndex = this.listKeyManager.activeItemIndex;\n const ctrlKeys = ['ctrlKey', 'metaKey'] as const;\n\n if (this.multiple && keyCode === A && hasModifierKey(event, ...ctrlKeys)) {\n // Toggle all options off if they're all selected, otherwise toggle them all on.\n this.triggerRange(\n null,\n 0,\n this.options.length - 1,\n this.options.length !== this.value.length,\n );\n event.preventDefault();\n return;\n }\n\n if (\n this.multiple &&\n (keyCode === SPACE || keyCode === ENTER) &&\n hasModifierKey(event, 'shiftKey')\n ) {\n if (this.listKeyManager.activeItem && this.listKeyManager.activeItemIndex != null) {\n this.triggerRange(\n this.listKeyManager.activeItem,\n this._getLastTriggeredIndex() ?? this.listKeyManager.activeItemIndex,\n this.listKeyManager.activeItemIndex,\n !this.listKeyManager.activeItem.isSelected(),\n );\n }\n event.preventDefault();\n return;\n }\n\n if (\n this.multiple &&\n keyCode === HOME &&\n hasModifierKey(event, ...ctrlKeys) &&\n hasModifierKey(event, 'shiftKey')\n ) {\n const trigger = this.listKeyManager.activeItem;\n if (trigger) {\n const from = this.listKeyManager.activeItemIndex!;\n this.listKeyManager.setFirstItemActive();\n this.triggerRange(\n trigger,\n from,\n this.listKeyManager.activeItemIndex!,\n !trigger.isSelected(),\n );\n }\n event.preventDefault();\n return;\n }\n\n if (\n this.multiple &&\n keyCode === END &&\n hasModifierKey(event, ...ctrlKeys) &&\n hasModifierKey(event, 'shiftKey')\n ) {\n const trigger = this.listKeyManager.activeItem;\n if (trigger) {\n const from = this.listKeyManager.activeItemIndex!;\n this.listKeyManager.setLastItemActive();\n this.triggerRange(\n trigger,\n from,\n this.listKeyManager.activeItemIndex!,\n !trigger.isSelected(),\n );\n }\n event.preventDefault();\n return;\n }\n\n if (keyCode === SPACE || keyCode === ENTER) {\n this.triggerOption(this.listKeyManager.activeItem);\n event.preventDefault();\n return;\n }\n\n const isNavKey =\n keyCode === UP_ARROW ||\n keyCode === DOWN_ARROW ||\n keyCode === LEFT_ARROW ||\n keyCode === RIGHT_ARROW ||\n keyCode === HOME ||\n keyCode === END;\n this.listKeyManager.onKeydown(event);\n // Will select an option if shift was pressed while navigating to the option\n if (isNavKey && event.shiftKey && previousActiveIndex !== this.listKeyManager.activeItemIndex) {\n this.triggerOption(this.listKeyManager.activeItem);\n }\n }\n\n /** Called when a focus moves into the listbox. */\n protected _handleFocusIn() {\n // Note that we use a `focusin` handler for this instead of the existing `focus` handler,\n // because focus won't land on the listbox if `useActiveDescendant` is enabled.\n this._hasFocus = true;\n }\n\n /**\n * Called when the focus leaves an element in the listbox.\n * @param event The focusout event\n */\n protected _handleFocusOut(event: FocusEvent) {\n // Some browsers (e.g. Chrome and Firefox) trigger the focusout event when the user returns back to the document.\n // To prevent losing the active option in this case, we store it in `_previousActiveOption` and restore it on the window `blur` event\n // This ensures that the `activeItem` matches the actual focused element when the user returns to the document.\n this._previousActiveOption = this.listKeyManager.activeItem;\n\n const otherElement = event.relatedTarget as Element;\n if (this.element !== otherElement && !this.element.contains(otherElement)) {\n this._onTouched();\n this._hasFocus = false;\n this._setNextFocusToSelectedOption();\n }\n }\n\n /** Get the id of the active option if active descendant is being used. */\n protected _getAriaActiveDescendant(): string | null | undefined {\n return this._useActiveDescendant ? this.listKeyManager?.activeItem?.id : null;\n }\n\n /** Get the tabindex for the listbox. */\n protected _getTabIndex() {\n if (this.disabled) {\n return -1;\n }\n return this.useActiveDescendant || !this.listKeyManager.activeItem ? this.enabledTabIndex : -1;\n }\n\n /** Initialize the key manager. */\n private _initKeyManager() {\n this.listKeyManager = new ActiveDescendantKeyManager(this.options)\n .withWrap(!this._navigationWrapDisabled)\n .withTypeAhead()\n .withHomeAndEnd()\n .withAllowedModifierKeys(['shiftKey'])\n .skipPredicate(\n this._navigateDisabledOptions ? this._skipNonePredicate : this._skipDisabledPredicate,\n );\n\n if (this.orientation === 'vertical') {\n this.listKeyManager.withVerticalOrientation();\n } else {\n this.listKeyManager.withHorizontalOrientation(this._dir?.value || 'ltr');\n }\n\n if (this.selectionModel.selected.length) {\n Promise.resolve().then(() => this._setNextFocusToSelectedOption());\n }\n\n this.listKeyManager.change.subscribe(() => this._focusActiveOption());\n }\n\n /** Focus the active option. */\n private _focusActiveOption() {\n if (!this.useActiveDescendant) {\n this.listKeyManager.activeItem?.focus();\n }\n this.changeDetectorRef.markForCheck();\n }\n\n /**\n * Set the selected values.\n * @param value The list of new selected values.\n */\n private _setSelection(value: readonly T[]) {\n if (this._invalid) {\n this.selectionModel.clear(false);\n }\n this.selectionModel.setSelection(...this._coerceValue(value));\n\n if (!this._hasFocus) {\n this._setNextFocusToSelectedOption();\n }\n }\n\n /** Sets the first selected option as first in the keyboard focus order. */\n private _setNextFocusToSelectedOption() {\n // Null check the options since they only get defined after `ngAfterContentInit`.\n const selected = this.options?.find(option => option.isSelected());\n\n if (selected) {\n this.listKeyManager.updateActiveItem(selected);\n }\n }\n\n /** Update the internal value of the listbox based on the selection model. */\n private _updateInternalValue() {\n const indexCache = new Map();\n this.selectionModel.sort((a: T, b: T) => {\n const aIndex = this._getIndexForValue(indexCache, a);\n const bIndex = this._getIndexForValue(indexCache, b);\n return aIndex - bIndex;\n });\n const selected = this.selectionModel.selected;\n this._invalid =\n (!this.multiple && selected.length > 1) || !!this._getInvalidOptionValues(selected).length;\n this.changeDetectorRef.markForCheck();\n }\n\n /**\n * Gets the index of the given value in the given list of options.\n * @param cache The cache of indices found so far\n * @param value The value to find\n * @return The index of the value in the options list\n */\n private _getIndexForValue(cache: Map, value: T) {\n const isEqual = this.compareWith || Object.is;\n if (!cache.has(value)) {\n let index = -1;\n for (let i = 0; i < this.options.length; i++) {\n if (isEqual(value, this.options.get(i)!.value)) {\n index = i;\n break;\n }\n }\n cache.set(value, index);\n }\n return cache.get(value)!;\n }\n\n /**\n * Handle the user clicking an option.\n * @param option The option that was clicked.\n */\n private _handleOptionClicked(option: CdkOption, event: MouseEvent) {\n event.preventDefault();\n this.listKeyManager.setActiveItem(option);\n if (event.shiftKey && this.multiple) {\n this.triggerRange(\n option,\n this._getLastTriggeredIndex() ?? this.listKeyManager.activeItemIndex!,\n this.listKeyManager.activeItemIndex!,\n !option.isSelected(),\n );\n } else {\n this.triggerOption(option);\n }\n }\n\n /** Verifies that no two options represent the same value under the compareWith function. */\n private _verifyNoOptionValueCollisions() {\n this.options.changes.pipe(startWith(this.options), takeUntil(this.destroyed)).subscribe(() => {\n const isEqual = this.compareWith ?? Object.is;\n for (let i = 0; i < this.options.length; i++) {\n const option = this.options.get(i)!;\n let duplicate: CdkOption | null = null;\n for (let j = i + 1; j < this.options.length; j++) {\n const other = this.options.get(j)!;\n if (isEqual(option.value, other.value)) {\n duplicate = other;\n break;\n }\n }\n if (duplicate) {\n // TODO(mmalerba): Link to docs about this.\n if (this.compareWith) {\n console.warn(\n `Found multiple CdkOption representing the same value under the given compareWith function`,\n {\n option1: option.element,\n option2: duplicate.element,\n compareWith: this.compareWith,\n },\n );\n } else {\n console.warn(`Found multiple CdkOption with the same value`, {\n option1: option.element,\n option2: duplicate.element,\n });\n }\n return;\n }\n }\n });\n }\n\n /** Verifies that the option values are valid. */\n private _verifyOptionValues() {\n if (this.options && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n const selected = this.selectionModel.selected;\n const invalidValues = this._getInvalidOptionValues(selected);\n\n if (!this.multiple && selected.length > 1) {\n throw Error('Listbox cannot have more than one selected value in multi-selection mode.');\n }\n\n if (invalidValues.length) {\n throw Error('Listbox has selected values that do not match any of its options.');\n }\n }\n }\n\n /**\n * Coerces a value into an array representing a listbox selection.\n * @param value The value to coerce\n * @return An array\n */\n private _coerceValue(value: readonly T[]) {\n return value == null ? [] : coerceArray(value);\n }\n\n /**\n * Get the sublist of values that do not represent valid option values in this listbox.\n * @param values The list of values\n * @return The sublist of values that are not valid option values\n */\n private _getInvalidOptionValues(values: readonly T[]) {\n const isEqual = this.compareWith || Object.is;\n const validValues = (this.options || []).map(option => option.value);\n return values.filter(value => !validValues.some(validValue => isEqual(value, validValue)));\n }\n\n /** Get the index of the last triggered option. */\n private _getLastTriggeredIndex() {\n const index = this.options.toArray().indexOf(this._lastTriggered!);\n return index === -1 ? null : index;\n }\n\n /**\n * Set previous active option as active option on window blur.\n * This ensures that the `activeOption` matches the actual focused element when the user returns to the document.\n */\n private _setPreviousActiveOptionAsActiveOptionOnWindowBlur() {\n this.ngZone.runOutsideAngular(() => {\n fromEvent(window, 'blur')\n .pipe(takeUntil(this.destroyed))\n .subscribe(() => {\n if (this.element.contains(document.activeElement) && this._previousActiveOption) {\n this._setActiveOption(this._previousActiveOption);\n this._previousActiveOption = null;\n }\n });\n });\n }\n}\n\n/** Change event that is fired whenever the value of the listbox changes. */\nexport interface ListboxValueChangeEvent {\n /** The new value of the listbox. */\n readonly value: readonly T[];\n\n /** Reference to the listbox that emitted the event. */\n readonly listbox: CdkListbox;\n\n /** Reference to the option that was triggered. */\n readonly option: CdkOption | null;\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\nimport {NgModule} from '@angular/core';\nimport {CdkListbox, CdkOption} from './listbox';\n\nconst EXPORTED_DECLARATIONS = [CdkListbox, CdkOption];\n\n@NgModule({\n imports: [...EXPORTED_DECLARATIONS],\n exports: [...EXPORTED_DECLARATIONS],\n})\nexport class CdkListboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AA0CA;AACA,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf;;;;;;;AAOG;AACH,MAAM,qBAAyB,SAAQ,cAAiB,CAAA;IACtD,WACS,CAAA,QAAA,GAAW,KAAK,EACvB,uBAA6B,EAC7B,WAAW,GAAG,IAAI,EAClB,WAAuC,EAAA;QAEvC,KAAK,CAAC,IAAI,EAAE,uB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