@angular/cdk 21.0.2 → 21.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_a11y-module-chunk.mjs.map +1 -1
- package/fesm2022/_activedescendant-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_array-chunk.mjs.map +1 -1
- package/fesm2022/_breakpoints-observer-chunk.mjs.map +1 -1
- package/fesm2022/_css-pixel-value-chunk.mjs.map +1 -1
- package/fesm2022/_data-source-chunk.mjs.map +1 -1
- package/fesm2022/_directionality-chunk.mjs.map +1 -1
- package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_element-chunk.mjs.map +1 -1
- package/fesm2022/_fake-event-detection-chunk.mjs.map +1 -1
- package/fesm2022/_focus-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_focus-monitor-chunk.mjs.map +1 -1
- package/fesm2022/_id-generator-chunk.mjs.map +1 -1
- package/fesm2022/_keycodes-chunk.mjs.map +1 -1
- package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_overlay-module-chunk.mjs +8 -0
- package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
- package/fesm2022/_passive-listeners-chunk.mjs.map +1 -1
- package/fesm2022/_platform-chunk.mjs.map +1 -1
- package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_scrolling-chunk.mjs.map +1 -1
- package/fesm2022/_selection-model-chunk.mjs.map +1 -1
- package/fesm2022/_shadow-dom-chunk.mjs.map +1 -1
- package/fesm2022/_style-loader-chunk.mjs.map +1 -1
- package/fesm2022/_test-environment-chunk.mjs.map +1 -1
- package/fesm2022/_tree-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_unique-selection-dispatcher-chunk.mjs.map +1 -1
- package/fesm2022/_visually-hidden-chunk.mjs.map +1 -1
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/coercion-private.mjs.map +1 -1
- package/fesm2022/coercion.mjs.map +1 -1
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/keycodes.mjs.map +1 -1
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +20 -3
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers-private.mjs.map +1 -1
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/testing-selenium-webdriver.mjs.map +1 -1
- package/fesm2022/testing-testbed.mjs.map +1 -1
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/types/_overlay-module-chunk.d.ts +1 -0
- package/types/menu.d.ts +7 -2
- package/_adev_assets/cdk_drag_drop.json +0 -7221
- package/_adev_assets/cdk_testing.json +0 -7601
- package/_adev_assets/cdk_testing_protractor.json +0 -1747
- package/_adev_assets/cdk_testing_selenium_webdriver.json +0 -1801
- package/_adev_assets/cdk_testing_testbed.json +0 -1903
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_focus-key-manager-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_focus-key-manager-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/a11y/key-manager/focus-key-manager.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.dev/license\n */\n\nimport {ListKeyManager, ListKeyManagerOption} from './list-key-manager';\nimport {FocusOrigin} from '../focus-monitor/focus-monitor';\n\n/**\n * This is the interface for focusable items (used by the FocusKeyManager).\n * Each item must know how to focus itself, whether or not it is currently disabled\n * and be able to supply its label.\n */\nexport interface FocusableOption extends ListKeyManagerOption {\n /** Focuses the `FocusableOption`. */\n focus(origin?: FocusOrigin): void;\n}\n\nexport class FocusKeyManager<T> extends ListKeyManager<FocusableOption & T> {\n private _origin: FocusOrigin = 'program';\n\n /**\n * Sets the focus origin that will be passed in to the items for any subsequent `focus` calls.\n * @param origin Focus origin to be used when focusing items.\n */\n setFocusOrigin(origin: FocusOrigin): this {\n this._origin = origin;\n return this;\n }\n\n /**\n * Sets the active item to the item at the specified\n * index and focuses the newly active item.\n * @param index Index of the item to be set as active.\n */\n override setActiveItem(index: number): void;\n\n /**\n * Sets the active item to the item that is specified and focuses it.\n * @param item Item to be set as active.\n */\n override setActiveItem(item: T): void;\n\n /**\n * Sets the active item to the item that is specified and focuses it.\n * @param item Item to be set as active.\n */\n override setActiveItem(item: T | number): void;\n\n override setActiveItem(item: any): void {\n super.setActiveItem(item);\n\n if (this.activeItem) {\n this.activeItem.focus(this._origin);\n }\n }\n}\n"],"names":["FocusKeyManager","ListKeyManager","_origin","setFocusOrigin","origin","setActiveItem","item","activeItem","focus"],"mappings":";;AAqBM,MAAOA,eAAmB,SAAQC,cAAmC,CAAA;AACjEC,EAAAA,OAAO,GAAgB,SAAS;EAMxCC,cAAcA,CAACC,MAAmB,EAAA;IAChC,IAAI,CAACF,OAAO,GAAGE,MAAM;AACrB,IAAA,OAAO,IAAI;AACb;EAqBSC,aAAaA,CAACC,IAAS,EAAA;AAC9B,IAAA,KAAK,CAACD,aAAa,CAACC,IAAI,CAAC;IAEzB,IAAI,IAAI,CAACC,UAAU,EAAE;MACnB,IAAI,CAACA,UAAU,CAACC,KAAK,CAAC,IAAI,CAACN,OAAO,CAAC;AACrC;AACF;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_focus-monitor-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/a11y/input-modality/input-modality-detector.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/a11y/focus-monitor/focus-monitor.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.dev/license\n */\n\nimport {ALT, CONTROL, MAC_META, META, SHIFT} from '../../keycodes';\nimport {\n Injectable,\n InjectionToken,\n OnDestroy,\n NgZone,\n inject,\n RendererFactory2,\n DOCUMENT,\n} from '@angular/core';\nimport {Platform, _getEventTarget} from '../../platform';\n\nimport {BehaviorSubject, Observable} from 'rxjs';\nimport {distinctUntilChanged, skip} from 'rxjs/operators';\nimport {\n isFakeMousedownFromScreenReader,\n isFakeTouchstartFromScreenReader,\n} from '../fake-event-detection';\n\n/**\n * The input modalities detected by this service. Null is used if the input modality is unknown.\n */\nexport type InputModality = 'keyboard' | 'mouse' | 'touch' | null;\n\n/** Options to configure the behavior of the InputModalityDetector. */\nexport interface InputModalityDetectorOptions {\n /** Keys to ignore when detecting keyboard input modality. */\n ignoreKeys?: number[];\n}\n\n/**\n * Injectable options for the InputModalityDetector. These are shallowly merged with the default\n * options.\n */\nexport const INPUT_MODALITY_DETECTOR_OPTIONS = new InjectionToken<InputModalityDetectorOptions>(\n 'cdk-input-modality-detector-options',\n);\n\n/**\n * Default options for the InputModalityDetector.\n *\n * Modifier keys are ignored by default (i.e. when pressed won't cause the service to detect\n * keyboard input modality) for two reasons:\n *\n * 1. Modifier keys are commonly used with mouse to perform actions such as 'right click' or 'open\n * in new tab', and are thus less representative of actual keyboard interaction.\n * 2. VoiceOver triggers some keyboard events when linearly navigating with Control + Option (but\n * confusingly not with Caps Lock). Thus, to have parity with other screen readers, we ignore\n * these keys so as to not update the input modality.\n *\n * Note that we do not by default ignore the right Meta key on Safari because it has the same key\n * code as the ContextMenu key on other browsers. When we switch to using event.key, we can\n * distinguish between the two.\n */\nexport const INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS: InputModalityDetectorOptions = {\n ignoreKeys: [ALT, CONTROL, MAC_META, META, SHIFT],\n};\n\n/**\n * The amount of time needed to pass after a touchstart event in order for a subsequent mousedown\n * event to be attributed as mouse and not touch.\n *\n * This is the value used by AngularJS Material. Through trial and error (on iPhone 6S) they found\n * that a value of around 650ms seems appropriate.\n */\nexport const TOUCH_BUFFER_MS = 650;\n\n/**\n * Event listener options that enable capturing and also mark the listener as passive if the browser\n * supports it.\n */\nconst modalityEventListenerOptions = {\n passive: true,\n capture: true,\n};\n\n/**\n * Service that detects the user's input modality.\n *\n * This service does not update the input modality when a user navigates with a screen reader\n * (e.g. linear navigation with VoiceOver, object navigation / browse mode with NVDA, virtual PC\n * cursor mode with JAWS). This is in part due to technical limitations (i.e. keyboard events do not\n * fire as expected in these modes) but is also arguably the correct behavior. Navigating with a\n * screen reader is akin to visually scanning a page, and should not be interpreted as actual user\n * input interaction.\n *\n * When a user is not navigating but *interacting* with a screen reader, this service attempts to\n * update the input modality to keyboard, but in general this service's behavior is largely\n * undefined.\n */\n@Injectable({providedIn: 'root'})\nexport class InputModalityDetector implements OnDestroy {\n private readonly _platform = inject(Platform);\n private readonly _listenerCleanups: (() => void)[] | undefined;\n\n /** Emits whenever an input modality is detected. */\n readonly modalityDetected: Observable<InputModality>;\n\n /** Emits when the input modality changes. */\n readonly modalityChanged: Observable<InputModality>;\n\n /** The most recently detected input modality. */\n get mostRecentModality(): InputModality {\n return this._modality.value;\n }\n\n /**\n * The most recently detected input modality event target. Is null if no input modality has been\n * detected or if the associated event target is null for some unknown reason.\n */\n _mostRecentTarget: HTMLElement | null = null;\n\n /** The underlying BehaviorSubject that emits whenever an input modality is detected. */\n private readonly _modality = new BehaviorSubject<InputModality>(null);\n\n /** Options for this InputModalityDetector. */\n private readonly _options: InputModalityDetectorOptions;\n\n /**\n * The timestamp of the last touch input modality. Used to determine whether mousedown events\n * should be attributed to mouse or touch.\n */\n private _lastTouchMs = 0;\n\n /**\n * Handles keydown events. Must be an arrow function in order to preserve the context when it gets\n * bound.\n */\n private _onKeydown = (event: KeyboardEvent) => {\n // If this is one of the keys we should ignore, then ignore it and don't update the input\n // modality to keyboard.\n if (this._options?.ignoreKeys?.some(keyCode => keyCode === event.keyCode)) {\n return;\n }\n\n this._modality.next('keyboard');\n this._mostRecentTarget = _getEventTarget(event);\n };\n\n /**\n * Handles mousedown events. Must be an arrow function in order to preserve the context when it\n * gets bound.\n */\n private _onMousedown = (event: MouseEvent) => {\n // Touches trigger both touch and mouse events, so we need to distinguish between mouse events\n // that were triggered via mouse vs touch. To do so, check if the mouse event occurs closely\n // after the previous touch event.\n if (Date.now() - this._lastTouchMs < TOUCH_BUFFER_MS) {\n return;\n }\n\n // Fake mousedown events are fired by some screen readers when controls are activated by the\n // screen reader. Attribute them to keyboard input modality.\n this._modality.next(isFakeMousedownFromScreenReader(event) ? 'keyboard' : 'mouse');\n this._mostRecentTarget = _getEventTarget(event);\n };\n\n /**\n * Handles touchstart events. Must be an arrow function in order to preserve the context when it\n * gets bound.\n */\n private _onTouchstart = (event: TouchEvent) => {\n // Same scenario as mentioned in _onMousedown, but on touch screen devices, fake touchstart\n // events are fired. Again, attribute to keyboard input modality.\n if (isFakeTouchstartFromScreenReader(event)) {\n this._modality.next('keyboard');\n return;\n }\n\n // Store the timestamp of this touch event, as it's used to distinguish between mouse events\n // triggered via mouse vs touch.\n this._lastTouchMs = Date.now();\n\n this._modality.next('touch');\n this._mostRecentTarget = _getEventTarget(event);\n };\n\n constructor(...args: unknown[]);\n\n constructor() {\n const ngZone = inject(NgZone);\n const document = inject<Document>(DOCUMENT);\n const options = inject(INPUT_MODALITY_DETECTOR_OPTIONS, {optional: true});\n\n this._options = {\n ...INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS,\n ...options,\n };\n\n // Skip the first emission as it's null.\n this.modalityDetected = this._modality.pipe(skip(1));\n this.modalityChanged = this.modalityDetected.pipe(distinctUntilChanged());\n\n // If we're not in a browser, this service should do nothing, as there's no relevant input\n // modality to detect.\n if (this._platform.isBrowser) {\n const renderer = inject(RendererFactory2).createRenderer(null, null);\n\n this._listenerCleanups = ngZone.runOutsideAngular(() => {\n return [\n renderer.listen(document, 'keydown', this._onKeydown, modalityEventListenerOptions),\n renderer.listen(document, 'mousedown', this._onMousedown, modalityEventListenerOptions),\n renderer.listen(document, 'touchstart', this._onTouchstart, modalityEventListenerOptions),\n ];\n });\n }\n }\n\n ngOnDestroy() {\n this._modality.complete();\n this._listenerCleanups?.forEach(cleanup => cleanup());\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.dev/license\n */\n\nimport {\n Platform,\n normalizePassiveListenerOptions,\n _getShadowRoot,\n _getEventTarget,\n} from '../../platform';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n InjectionToken,\n NgZone,\n OnDestroy,\n Output,\n AfterViewInit,\n inject,\n DOCUMENT,\n} from '@angular/core';\nimport {Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {coerceElement} from '../../coercion';\n\nimport {InputModalityDetector, TOUCH_BUFFER_MS} from '../input-modality/input-modality-detector';\n\nexport type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null;\n\n/**\n * Corresponds to the options that can be passed to the native `focus` event.\n * via https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus\n */\nexport interface FocusOptions {\n /** Whether the browser should scroll to the element when it is focused. */\n preventScroll?: boolean;\n}\n\n/** Detection mode used for attributing the origin of a focus event. */\nexport enum FocusMonitorDetectionMode {\n /**\n * Any mousedown, keydown, or touchstart event that happened in the previous\n * tick or the current tick will be used to assign a focus event's origin (to\n * either mouse, keyboard, or touch). This is the default option.\n */\n IMMEDIATE,\n /**\n * A focus event's origin is always attributed to the last corresponding\n * mousedown, keydown, or touchstart event, no matter how long ago it occurred.\n */\n EVENTUAL,\n}\n\n/** Injectable service-level options for FocusMonitor. */\nexport interface FocusMonitorOptions {\n detectionMode?: FocusMonitorDetectionMode;\n}\n\n/** InjectionToken for FocusMonitorOptions. */\nexport const FOCUS_MONITOR_DEFAULT_OPTIONS = new InjectionToken<FocusMonitorOptions>(\n 'cdk-focus-monitor-default-options',\n);\n\ntype MonitoredElementInfo = {\n checkChildren: boolean;\n readonly subject: Subject<FocusOrigin>;\n rootNode: HTMLElement | ShadowRoot | Document;\n};\n\n/**\n * Event listener options that enable capturing and also\n * mark the listener as passive if the browser supports it.\n */\nconst captureEventListenerOptions = normalizePassiveListenerOptions({\n passive: true,\n capture: true,\n});\n\n/** Monitors mouse and keyboard events to determine the cause of focus events. */\n@Injectable({providedIn: 'root'})\nexport class FocusMonitor implements OnDestroy {\n private _ngZone = inject(NgZone);\n private _platform = inject(Platform);\n private readonly _inputModalityDetector = inject(InputModalityDetector);\n\n /** The focus origin that the next focus event is a result of. */\n private _origin: FocusOrigin = null;\n\n /** The FocusOrigin of the last focus event tracked by the FocusMonitor. */\n private _lastFocusOrigin: FocusOrigin;\n\n /** Whether the window has just been focused. */\n private _windowFocused = false;\n\n /** The timeout id of the window focus timeout. */\n private _windowFocusTimeoutId: ReturnType<typeof setTimeout>;\n\n /** The timeout id of the origin clearing timeout. */\n private _originTimeoutId: ReturnType<typeof setTimeout>;\n\n /**\n * Whether the origin was determined via a touch interaction. Necessary as properly attributing\n * focus events to touch interactions requires special logic.\n */\n private _originFromTouchInteraction = false;\n\n /** Map of elements being monitored to their info. */\n private _elementInfo = new Map<HTMLElement, MonitoredElementInfo>();\n\n /** The number of elements currently being monitored. */\n private _monitoredElementCount = 0;\n\n /**\n * Keeps track of the root nodes to which we've currently bound a focus/blur handler,\n * as well as the number of monitored elements that they contain. We have to treat focus/blur\n * handlers differently from the rest of the events, because the browser won't emit events\n * to the document when focus moves inside of a shadow root.\n */\n private _rootNodeFocusListenerCount = new Map<HTMLElement | Document | ShadowRoot, number>();\n\n /**\n * The specified detection mode, used for attributing the origin of a focus\n * event.\n */\n private readonly _detectionMode: FocusMonitorDetectionMode;\n\n /**\n * Event listener for `focus` events on the window.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _windowFocusListener = () => {\n // Make a note of when the window regains focus, so we can\n // restore the origin info for the focused element.\n this._windowFocused = true;\n this._windowFocusTimeoutId = setTimeout(() => (this._windowFocused = false));\n };\n\n /** Used to reference correct document/window */\n protected _document = inject(DOCUMENT);\n\n /** Subject for stopping our InputModalityDetector subscription. */\n private readonly _stopInputModalityDetector = new Subject<void>();\n\n constructor(...args: unknown[]);\n\n constructor() {\n const options = inject<FocusMonitorOptions | null>(FOCUS_MONITOR_DEFAULT_OPTIONS, {\n optional: true,\n });\n\n this._detectionMode = options?.detectionMode || FocusMonitorDetectionMode.IMMEDIATE;\n }\n /**\n * Event listener for `focus` and 'blur' events on the document.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _rootNodeFocusAndBlurListener = (event: Event) => {\n const target = _getEventTarget<HTMLElement>(event);\n\n // We need to walk up the ancestor chain in order to support `checkChildren`.\n for (let element = target; element; element = element.parentElement) {\n if (event.type === 'focus') {\n this._onFocus(event as FocusEvent, element);\n } else {\n this._onBlur(event as FocusEvent, element);\n }\n }\n };\n\n /**\n * Monitors focus on an element and applies appropriate CSS classes.\n * @param element The element to monitor\n * @param checkChildren Whether to count the element as focused when its children are focused.\n * @returns An observable that emits when the focus state of the element changes.\n * When the element is blurred, null will be emitted.\n */\n monitor(element: HTMLElement, checkChildren?: boolean): Observable<FocusOrigin>;\n\n /**\n * Monitors focus on an element and applies appropriate CSS classes.\n * @param element The element to monitor\n * @param checkChildren Whether to count the element as focused when its children are focused.\n * @returns An observable that emits when the focus state of the element changes.\n * When the element is blurred, null will be emitted.\n */\n monitor(element: ElementRef<HTMLElement>, checkChildren?: boolean): Observable<FocusOrigin>;\n\n monitor(\n element: HTMLElement | ElementRef<HTMLElement>,\n checkChildren: boolean = false,\n ): Observable<FocusOrigin> {\n const nativeElement = coerceElement(element);\n\n // Do nothing if we're not on the browser platform or the passed in node isn't an element.\n if (!this._platform.isBrowser || nativeElement.nodeType !== 1) {\n // Note: we don't want the observable to emit at all so we don't pass any parameters.\n return observableOf();\n }\n\n // If the element is inside the shadow DOM, we need to bind our focus/blur listeners to\n // the shadow root, rather than the `document`, because the browser won't emit focus events\n // to the `document`, if focus is moving within the same shadow root.\n const rootNode = _getShadowRoot(nativeElement) || this._document;\n const cachedInfo = this._elementInfo.get(nativeElement);\n\n // Check if we're already monitoring this element.\n if (cachedInfo) {\n if (checkChildren) {\n // TODO(COMP-318): this can be problematic, because it'll turn all non-checkChildren\n // observers into ones that behave as if `checkChildren` was turned on. We need a more\n // robust solution.\n cachedInfo.checkChildren = true;\n }\n\n return cachedInfo.subject;\n }\n\n // Create monitored element info.\n const info: MonitoredElementInfo = {\n checkChildren: checkChildren,\n subject: new Subject<FocusOrigin>(),\n rootNode,\n };\n this._elementInfo.set(nativeElement, info);\n this._registerGlobalListeners(info);\n\n return info.subject;\n }\n\n /**\n * Stops monitoring an element and removes all focus classes.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: HTMLElement): void;\n\n /**\n * Stops monitoring an element and removes all focus classes.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: ElementRef<HTMLElement>): void;\n\n stopMonitoring(element: HTMLElement | ElementRef<HTMLElement>): void {\n const nativeElement = coerceElement(element);\n const elementInfo = this._elementInfo.get(nativeElement);\n\n if (elementInfo) {\n elementInfo.subject.complete();\n\n this._setClasses(nativeElement);\n this._elementInfo.delete(nativeElement);\n this._removeGlobalListeners(elementInfo);\n }\n }\n\n /**\n * Focuses the element via the specified focus origin.\n * @param element Element to focus.\n * @param origin Focus origin.\n * @param options Options that can be used to configure the focus behavior.\n */\n focusVia(element: HTMLElement, origin: FocusOrigin, options?: FocusOptions): void;\n\n /**\n * Focuses the element via the specified focus origin.\n * @param element Element to focus.\n * @param origin Focus origin.\n * @param options Options that can be used to configure the focus behavior.\n */\n focusVia(element: ElementRef<HTMLElement>, origin: FocusOrigin, options?: FocusOptions): void;\n\n focusVia(\n element: HTMLElement | ElementRef<HTMLElement>,\n origin: FocusOrigin,\n options?: FocusOptions,\n ): void {\n const nativeElement = coerceElement(element);\n const focusedElement = this._document.activeElement;\n\n // If the element is focused already, calling `focus` again won't trigger the event listener\n // which means that the focus classes won't be updated. If that's the case, update the classes\n // directly without waiting for an event.\n if (nativeElement === focusedElement) {\n this._getClosestElementsInfo(nativeElement).forEach(([currentElement, info]) =>\n this._originChanged(currentElement, origin, info),\n );\n } else {\n this._setOrigin(origin);\n\n // `focus` isn't available on the server\n if (typeof nativeElement.focus === 'function') {\n nativeElement.focus(options);\n }\n }\n }\n\n ngOnDestroy() {\n this._elementInfo.forEach((_info, element) => this.stopMonitoring(element));\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n return this._document.defaultView || window;\n }\n\n private _getFocusOrigin(focusEventTarget: HTMLElement | null): FocusOrigin {\n if (this._origin) {\n // If the origin was realized via a touch interaction, we need to perform additional checks\n // to determine whether the focus origin should be attributed to touch or program.\n if (this._originFromTouchInteraction) {\n return this._shouldBeAttributedToTouch(focusEventTarget) ? 'touch' : 'program';\n } else {\n return this._origin;\n }\n }\n\n // If the window has just regained focus, we can restore the most recent origin from before the\n // window blurred. Otherwise, we've reached the point where we can't identify the source of the\n // focus. This typically means one of two things happened:\n //\n // 1) The element was programmatically focused, or\n // 2) The element was focused via screen reader navigation (which generally doesn't fire\n // events).\n //\n // Because we can't distinguish between these two cases, we default to setting `program`.\n if (this._windowFocused && this._lastFocusOrigin) {\n return this._lastFocusOrigin;\n }\n\n // If the interaction is coming from an input label, we consider it a mouse interactions.\n // This is a special case where focus moves on `click`, rather than `mousedown` which breaks\n // our detection, because all our assumptions are for `mousedown`. We need to handle this\n // special case, because it's very common for checkboxes and radio buttons.\n if (focusEventTarget && this._isLastInteractionFromInputLabel(focusEventTarget)) {\n return 'mouse';\n }\n\n return 'program';\n }\n\n /**\n * Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a\n * touch origin isn't immediately reset at the next tick (see _setOrigin). This means that when we\n * handle a focus event following a touch interaction, we need to determine whether (1) the focus\n * event was directly caused by the touch interaction or (2) the focus event was caused by a\n * subsequent programmatic focus call triggered by the touch interaction.\n * @param focusEventTarget The target of the focus event under examination.\n */\n private _shouldBeAttributedToTouch(focusEventTarget: HTMLElement | null): boolean {\n // Please note that this check is not perfect. Consider the following edge case:\n //\n // <div #parent tabindex=\"0\">\n // <div #child tabindex=\"0\" (click)=\"#parent.focus()\"></div>\n // </div>\n //\n // Suppose there is a FocusMonitor in IMMEDIATE mode attached to #parent. When the user touches\n // #child, #parent is programmatically focused. This code will attribute the focus to touch\n // instead of program. This is a relatively minor edge-case that can be worked around by using\n // focusVia(parent, 'program') to focus #parent.\n return (\n this._detectionMode === FocusMonitorDetectionMode.EVENTUAL ||\n !!focusEventTarget?.contains(this._inputModalityDetector._mostRecentTarget)\n );\n }\n\n /**\n * Sets the focus classes on the element based on the given focus origin.\n * @param element The element to update the classes on.\n * @param origin The focus origin.\n */\n private _setClasses(element: HTMLElement, origin?: FocusOrigin): void {\n element.classList.toggle('cdk-focused', !!origin);\n element.classList.toggle('cdk-touch-focused', origin === 'touch');\n element.classList.toggle('cdk-keyboard-focused', origin === 'keyboard');\n element.classList.toggle('cdk-mouse-focused', origin === 'mouse');\n element.classList.toggle('cdk-program-focused', origin === 'program');\n }\n\n /**\n * Updates the focus origin. If we're using immediate detection mode, we schedule an async\n * function to clear the origin at the end of a timeout. The duration of the timeout depends on\n * the origin being set.\n * @param origin The origin to set.\n * @param isFromInteraction Whether we are setting the origin from an interaction event.\n */\n private _setOrigin(origin: FocusOrigin, isFromInteraction = false): void {\n this._ngZone.runOutsideAngular(() => {\n this._origin = origin;\n this._originFromTouchInteraction = origin === 'touch' && isFromInteraction;\n\n // If we're in IMMEDIATE mode, reset the origin at the next tick (or in `TOUCH_BUFFER_MS` ms\n // for a touch event). We reset the origin at the next tick because Firefox focuses one tick\n // after the interaction event. We wait `TOUCH_BUFFER_MS` ms before resetting the origin for\n // a touch event because when a touch event is fired, the associated focus event isn't yet in\n // the event queue. Before doing so, clear any pending timeouts.\n if (this._detectionMode === FocusMonitorDetectionMode.IMMEDIATE) {\n clearTimeout(this._originTimeoutId);\n const ms = this._originFromTouchInteraction ? TOUCH_BUFFER_MS : 1;\n this._originTimeoutId = setTimeout(() => (this._origin = null), ms);\n }\n });\n }\n\n /**\n * Handles focus events on a registered element.\n * @param event The focus event.\n * @param element The monitored element.\n */\n private _onFocus(event: FocusEvent, element: HTMLElement) {\n // NOTE(mmalerba): We currently set the classes based on the focus origin of the most recent\n // focus event affecting the monitored element. If we want to use the origin of the first event\n // instead we should check for the cdk-focused class here and return if the element already has\n // it. (This only matters for elements that have includesChildren = true).\n\n // If we are not counting child-element-focus as focused, make sure that the event target is the\n // monitored element itself.\n const elementInfo = this._elementInfo.get(element);\n const focusEventTarget = _getEventTarget<HTMLElement>(event);\n if (!elementInfo || (!elementInfo.checkChildren && element !== focusEventTarget)) {\n return;\n }\n\n this._originChanged(element, this._getFocusOrigin(focusEventTarget), elementInfo);\n }\n\n /**\n * Handles blur events on a registered element.\n * @param event The blur event.\n * @param element The monitored element.\n */\n _onBlur(event: FocusEvent, element: HTMLElement) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n\n if (\n !elementInfo ||\n (elementInfo.checkChildren &&\n event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))\n ) {\n return;\n }\n\n this._setClasses(element);\n this._emitOrigin(elementInfo, null);\n }\n\n private _emitOrigin(info: MonitoredElementInfo, origin: FocusOrigin) {\n if (info.subject.observers.length) {\n this._ngZone.run(() => info.subject.next(origin));\n }\n }\n\n private _registerGlobalListeners(elementInfo: MonitoredElementInfo) {\n if (!this._platform.isBrowser) {\n return;\n }\n\n const rootNode = elementInfo.rootNode;\n const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode) || 0;\n\n if (!rootNodeFocusListeners) {\n this._ngZone.runOutsideAngular(() => {\n rootNode.addEventListener(\n 'focus',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n rootNode.addEventListener(\n 'blur',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n });\n }\n\n this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners + 1);\n\n // Register global listeners when first element is monitored.\n if (++this._monitoredElementCount === 1) {\n // Note: we listen to events in the capture phase so we\n // can detect them even if the user stops propagation.\n this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n window.addEventListener('focus', this._windowFocusListener);\n });\n\n // The InputModalityDetector is also just a collection of global listeners.\n this._inputModalityDetector.modalityDetected\n .pipe(takeUntil(this._stopInputModalityDetector))\n .subscribe(modality => {\n this._setOrigin(modality, true /* isFromInteraction */);\n });\n }\n }\n\n private _removeGlobalListeners(elementInfo: MonitoredElementInfo) {\n const rootNode = elementInfo.rootNode;\n\n if (this._rootNodeFocusListenerCount.has(rootNode)) {\n const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode)!;\n\n if (rootNodeFocusListeners > 1) {\n this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners - 1);\n } else {\n rootNode.removeEventListener(\n 'focus',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n rootNode.removeEventListener(\n 'blur',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n this._rootNodeFocusListenerCount.delete(rootNode);\n }\n }\n\n // Unregister global listeners when last element is unmonitored.\n if (!--this._monitoredElementCount) {\n const window = this._getWindow();\n window.removeEventListener('focus', this._windowFocusListener);\n\n // Equivalently, stop our InputModalityDetector subscription.\n this._stopInputModalityDetector.next();\n\n // Clear timeouts for all potentially pending timeouts to prevent the leaks.\n clearTimeout(this._windowFocusTimeoutId);\n clearTimeout(this._originTimeoutId);\n }\n }\n\n /** Updates all the state on an element once its focus origin has changed. */\n private _originChanged(\n element: HTMLElement,\n origin: FocusOrigin,\n elementInfo: MonitoredElementInfo,\n ) {\n this._setClasses(element, origin);\n this._emitOrigin(elementInfo, origin);\n this._lastFocusOrigin = origin;\n }\n\n /**\n * Collects the `MonitoredElementInfo` of a particular element and\n * all of its ancestors that have enabled `checkChildren`.\n * @param element Element from which to start the search.\n */\n private _getClosestElementsInfo(element: HTMLElement): [HTMLElement, MonitoredElementInfo][] {\n const results: [HTMLElement, MonitoredElementInfo][] = [];\n\n this._elementInfo.forEach((info, currentElement) => {\n if (currentElement === element || (info.checkChildren && currentElement.contains(element))) {\n results.push([currentElement, info]);\n }\n });\n\n return results;\n }\n\n /**\n * Returns whether an interaction is likely to have come from the user clicking the `label` of\n * an `input` or `textarea` in order to focus it.\n * @param focusEventTarget Target currently receiving focus.\n */\n private _isLastInteractionFromInputLabel(focusEventTarget: HTMLElement): boolean {\n const {_mostRecentTarget: mostRecentTarget, mostRecentModality} = this._inputModalityDetector;\n\n // If the last interaction used the mouse on an element contained by one of the labels\n // of an `input`/`textarea` that is currently focused, it is very likely that the\n // user redirected focus using the label.\n if (\n mostRecentModality !== 'mouse' ||\n !mostRecentTarget ||\n mostRecentTarget === focusEventTarget ||\n (focusEventTarget.nodeName !== 'INPUT' && focusEventTarget.nodeName !== 'TEXTAREA') ||\n (focusEventTarget as HTMLInputElement | HTMLTextAreaElement).disabled\n ) {\n return false;\n }\n\n const labels = (focusEventTarget as HTMLInputElement | HTMLTextAreaElement).labels;\n\n if (labels) {\n for (let i = 0; i < labels.length; i++) {\n if (labels[i].contains(mostRecentTarget)) {\n return true;\n }\n }\n }\n\n return false;\n }\n}\n\n/**\n * Directive that determines how a particular element was focused (via keyboard, mouse, touch, or\n * programmatically) and adds corresponding classes to the element.\n *\n * There are two variants of this directive:\n * 1) cdkMonitorElementFocus: does not consider an element to be focused if one of its children is\n * focused.\n * 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused.\n */\n@Directive({\n selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]',\n exportAs: 'cdkMonitorFocus',\n})\nexport class CdkMonitorFocus implements AfterViewInit, OnDestroy {\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private _focusMonitor = inject(FocusMonitor);\n\n private _monitorSubscription: Subscription;\n private _focusOrigin: FocusOrigin = null;\n\n @Output() readonly cdkFocusChange = new EventEmitter<FocusOrigin>();\n\n constructor(...args: unknown[]);\n constructor() {}\n\n get focusOrigin(): FocusOrigin {\n return this._focusOrigin;\n }\n\n ngAfterViewInit() {\n const element = this._elementRef.nativeElement;\n this._monitorSubscription = this._focusMonitor\n .monitor(element, element.nodeType === 1 && element.hasAttribute('cdkMonitorSubtreeFocus'))\n .subscribe(origin => {\n this._focusOrigin = origin;\n this.cdkFocusChange.emit(origin);\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n\n if (this._monitorSubscription) {\n this._monitorSubscription.unsubscribe();\n }\n }\n}\n"],"names":["INPUT_MODALITY_DETECTOR_OPTIONS","InjectionToken","INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS","ignoreKeys","ALT","CONTROL","MAC_META","META","SHIFT","TOUCH_BUFFER_MS","modalityEventListenerOptions","passive","capture","InputModalityDetector","_platform","inject","Platform","_listenerCleanups","modalityDetected","modalityChanged","mostRecentModality","_modality","value","_mostRecentTarget","BehaviorSubject","_options","_lastTouchMs","_onKeydown","event","some","keyCode","next","_getEventTarget","_onMousedown","Date","now","isFakeMousedownFromScreenReader","_onTouchstart","isFakeTouchstartFromScreenReader","constructor","ngZone","NgZone","document","DOCUMENT","options","optional","pipe","skip","distinctUntilChanged","isBrowser","renderer","RendererFactory2","createRenderer","runOutsideAngular","listen","ngOnDestroy","complete","forEach","cleanup","deps","target","i0","ɵɵFactoryTarget","Injectable","ɵprov","ɵɵngDeclareInjectable","minVersion","version","ngImport","type","decorators","providedIn","FocusMonitorDetectionMode","FOCUS_MONITOR_DEFAULT_OPTIONS","captureEventListenerOptions","normalizePassiveListenerOptions","FocusMonitor","_ngZone","_inputModalityDetector","_origin","_lastFocusOrigin","_windowFocused","_windowFocusTimeoutId","_originTimeoutId","_originFromTouchInteraction","_elementInfo","Map","_monitoredElementCount","_rootNodeFocusListenerCount","_detectionMode","_windowFocusListener","setTimeout","_document","_stopInputModalityDetector","Subject","detectionMode","IMMEDIATE","_rootNodeFocusAndBlurListener","element","parentElement","_onFocus","_onBlur","monitor","checkChildren","nativeElement","coerceElement","nodeType","observableOf","rootNode","_getShadowRoot","cachedInfo","get","subject","info","set","_registerGlobalListeners","stopMonitoring","elementInfo","_setClasses","delete","_removeGlobalListeners","focusVia","origin","focusedElement","activeElement","_getClosestElementsInfo","currentElement","_originChanged","_setOrigin","focus","_info","_getWindow","defaultView","window","_getFocusOrigin","focusEventTarget","_shouldBeAttributedToTouch","_isLastInteractionFromInputLabel","EVENTUAL","contains","classList","toggle","isFromInteraction","clearTimeout","ms","relatedTarget","Node","_emitOrigin","observers","length","run","rootNodeFocusListeners","addEventListener","takeUntil","subscribe","modality","has","removeEventListener","results","push","mostRecentTarget","nodeName","disabled","labels","i","CdkMonitorFocus","_elementRef","ElementRef","_focusMonitor","_monitorSubscription","_focusOrigin","cdkFocusChange","EventEmitter","focusOrigin","ngAfterViewInit","hasAttribute","emit","unsubscribe","Directive","isStandalone","selector","outputs","exportAs","args","Output"],"mappings":";;;;;;;;;;;MA0CaA,+BAA+B,GAA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-detector.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/a11y/focus-monitor/focus-monitor.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.dev/license\n */\n\nimport {ALT, CONTROL, MAC_META, META, SHIFT} from '../../keycodes';\nimport {\n Injectable,\n InjectionToken,\n OnDestroy,\n NgZone,\n inject,\n RendererFactory2,\n DOCUMENT,\n} from '@angular/core';\nimport {Platform, _getEventTarget} from '../../platform';\n\nimport {BehaviorSubject, Observable} from 'rxjs';\nimport {distinctUntilChanged, skip} from 'rxjs/operators';\nimport {\n isFakeMousedownFromScreenReader,\n isFakeTouchstartFromScreenReader,\n} from '../fake-event-detection';\n\n/**\n * The input modalities detected by this service. Null is used if the input modality is unknown.\n */\nexport type InputModality = 'keyboard' | 'mouse' | 'touch' | null;\n\n/** Options to configure the behavior of the InputModalityDetector. */\nexport interface InputModalityDetectorOptions {\n /** Keys to ignore when detecting keyboard input modality. */\n ignoreKeys?: number[];\n}\n\n/**\n * Injectable options for the InputModalityDetector. These are shallowly merged with the default\n * options.\n */\nexport const INPUT_MODALITY_DETECTOR_OPTIONS = new InjectionToken<InputModalityDetectorOptions>(\n 'cdk-input-modality-detector-options',\n);\n\n/**\n * Default options for the InputModalityDetector.\n *\n * Modifier keys are ignored by default (i.e. when pressed won't cause the service to detect\n * keyboard input modality) for two reasons:\n *\n * 1. Modifier keys are commonly used with mouse to perform actions such as 'right click' or 'open\n * in new tab', and are thus less representative of actual keyboard interaction.\n * 2. VoiceOver triggers some keyboard events when linearly navigating with Control + Option (but\n * confusingly not with Caps Lock). Thus, to have parity with other screen readers, we ignore\n * these keys so as to not update the input modality.\n *\n * Note that we do not by default ignore the right Meta key on Safari because it has the same key\n * code as the ContextMenu key on other browsers. When we switch to using event.key, we can\n * distinguish between the two.\n */\nexport const INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS: InputModalityDetectorOptions = {\n ignoreKeys: [ALT, CONTROL, MAC_META, META, SHIFT],\n};\n\n/**\n * The amount of time needed to pass after a touchstart event in order for a subsequent mousedown\n * event to be attributed as mouse and not touch.\n *\n * This is the value used by AngularJS Material. Through trial and error (on iPhone 6S) they found\n * that a value of around 650ms seems appropriate.\n */\nexport const TOUCH_BUFFER_MS = 650;\n\n/**\n * Event listener options that enable capturing and also mark the listener as passive if the browser\n * supports it.\n */\nconst modalityEventListenerOptions = {\n passive: true,\n capture: true,\n};\n\n/**\n * Service that detects the user's input modality.\n *\n * This service does not update the input modality when a user navigates with a screen reader\n * (e.g. linear navigation with VoiceOver, object navigation / browse mode with NVDA, virtual PC\n * cursor mode with JAWS). This is in part due to technical limitations (i.e. keyboard events do not\n * fire as expected in these modes) but is also arguably the correct behavior. Navigating with a\n * screen reader is akin to visually scanning a page, and should not be interpreted as actual user\n * input interaction.\n *\n * When a user is not navigating but *interacting* with a screen reader, this service attempts to\n * update the input modality to keyboard, but in general this service's behavior is largely\n * undefined.\n */\n@Injectable({providedIn: 'root'})\nexport class InputModalityDetector implements OnDestroy {\n private readonly _platform = inject(Platform);\n private readonly _listenerCleanups: (() => void)[] | undefined;\n\n /** Emits whenever an input modality is detected. */\n readonly modalityDetected: Observable<InputModality>;\n\n /** Emits when the input modality changes. */\n readonly modalityChanged: Observable<InputModality>;\n\n /** The most recently detected input modality. */\n get mostRecentModality(): InputModality {\n return this._modality.value;\n }\n\n /**\n * The most recently detected input modality event target. Is null if no input modality has been\n * detected or if the associated event target is null for some unknown reason.\n */\n _mostRecentTarget: HTMLElement | null = null;\n\n /** The underlying BehaviorSubject that emits whenever an input modality is detected. */\n private readonly _modality = new BehaviorSubject<InputModality>(null);\n\n /** Options for this InputModalityDetector. */\n private readonly _options: InputModalityDetectorOptions;\n\n /**\n * The timestamp of the last touch input modality. Used to determine whether mousedown events\n * should be attributed to mouse or touch.\n */\n private _lastTouchMs = 0;\n\n /**\n * Handles keydown events. Must be an arrow function in order to preserve the context when it gets\n * bound.\n */\n private _onKeydown = (event: KeyboardEvent) => {\n // If this is one of the keys we should ignore, then ignore it and don't update the input\n // modality to keyboard.\n if (this._options?.ignoreKeys?.some(keyCode => keyCode === event.keyCode)) {\n return;\n }\n\n this._modality.next('keyboard');\n this._mostRecentTarget = _getEventTarget(event);\n };\n\n /**\n * Handles mousedown events. Must be an arrow function in order to preserve the context when it\n * gets bound.\n */\n private _onMousedown = (event: MouseEvent) => {\n // Touches trigger both touch and mouse events, so we need to distinguish between mouse events\n // that were triggered via mouse vs touch. To do so, check if the mouse event occurs closely\n // after the previous touch event.\n if (Date.now() - this._lastTouchMs < TOUCH_BUFFER_MS) {\n return;\n }\n\n // Fake mousedown events are fired by some screen readers when controls are activated by the\n // screen reader. Attribute them to keyboard input modality.\n this._modality.next(isFakeMousedownFromScreenReader(event) ? 'keyboard' : 'mouse');\n this._mostRecentTarget = _getEventTarget(event);\n };\n\n /**\n * Handles touchstart events. Must be an arrow function in order to preserve the context when it\n * gets bound.\n */\n private _onTouchstart = (event: TouchEvent) => {\n // Same scenario as mentioned in _onMousedown, but on touch screen devices, fake touchstart\n // events are fired. Again, attribute to keyboard input modality.\n if (isFakeTouchstartFromScreenReader(event)) {\n this._modality.next('keyboard');\n return;\n }\n\n // Store the timestamp of this touch event, as it's used to distinguish between mouse events\n // triggered via mouse vs touch.\n this._lastTouchMs = Date.now();\n\n this._modality.next('touch');\n this._mostRecentTarget = _getEventTarget(event);\n };\n\n constructor(...args: unknown[]);\n\n constructor() {\n const ngZone = inject(NgZone);\n const document = inject<Document>(DOCUMENT);\n const options = inject(INPUT_MODALITY_DETECTOR_OPTIONS, {optional: true});\n\n this._options = {\n ...INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS,\n ...options,\n };\n\n // Skip the first emission as it's null.\n this.modalityDetected = this._modality.pipe(skip(1));\n this.modalityChanged = this.modalityDetected.pipe(distinctUntilChanged());\n\n // If we're not in a browser, this service should do nothing, as there's no relevant input\n // modality to detect.\n if (this._platform.isBrowser) {\n const renderer = inject(RendererFactory2).createRenderer(null, null);\n\n this._listenerCleanups = ngZone.runOutsideAngular(() => {\n return [\n renderer.listen(document, 'keydown', this._onKeydown, modalityEventListenerOptions),\n renderer.listen(document, 'mousedown', this._onMousedown, modalityEventListenerOptions),\n renderer.listen(document, 'touchstart', this._onTouchstart, modalityEventListenerOptions),\n ];\n });\n }\n }\n\n ngOnDestroy() {\n this._modality.complete();\n this._listenerCleanups?.forEach(cleanup => cleanup());\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.dev/license\n */\n\nimport {\n Platform,\n normalizePassiveListenerOptions,\n _getShadowRoot,\n _getEventTarget,\n} from '../../platform';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n InjectionToken,\n NgZone,\n OnDestroy,\n Output,\n AfterViewInit,\n inject,\n DOCUMENT,\n} from '@angular/core';\nimport {Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {coerceElement} from '../../coercion';\n\nimport {InputModalityDetector, TOUCH_BUFFER_MS} from '../input-modality/input-modality-detector';\n\nexport type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null;\n\n/**\n * Corresponds to the options that can be passed to the native `focus` event.\n * via https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus\n */\nexport interface FocusOptions {\n /** Whether the browser should scroll to the element when it is focused. */\n preventScroll?: boolean;\n}\n\n/** Detection mode used for attributing the origin of a focus event. */\nexport enum FocusMonitorDetectionMode {\n /**\n * Any mousedown, keydown, or touchstart event that happened in the previous\n * tick or the current tick will be used to assign a focus event's origin (to\n * either mouse, keyboard, or touch). This is the default option.\n */\n IMMEDIATE,\n /**\n * A focus event's origin is always attributed to the last corresponding\n * mousedown, keydown, or touchstart event, no matter how long ago it occurred.\n */\n EVENTUAL,\n}\n\n/** Injectable service-level options for FocusMonitor. */\nexport interface FocusMonitorOptions {\n detectionMode?: FocusMonitorDetectionMode;\n}\n\n/** InjectionToken for FocusMonitorOptions. */\nexport const FOCUS_MONITOR_DEFAULT_OPTIONS = new InjectionToken<FocusMonitorOptions>(\n 'cdk-focus-monitor-default-options',\n);\n\ntype MonitoredElementInfo = {\n checkChildren: boolean;\n readonly subject: Subject<FocusOrigin>;\n rootNode: HTMLElement | ShadowRoot | Document;\n};\n\n/**\n * Event listener options that enable capturing and also\n * mark the listener as passive if the browser supports it.\n */\nconst captureEventListenerOptions = normalizePassiveListenerOptions({\n passive: true,\n capture: true,\n});\n\n/** Monitors mouse and keyboard events to determine the cause of focus events. */\n@Injectable({providedIn: 'root'})\nexport class FocusMonitor implements OnDestroy {\n private _ngZone = inject(NgZone);\n private _platform = inject(Platform);\n private readonly _inputModalityDetector = inject(InputModalityDetector);\n\n /** The focus origin that the next focus event is a result of. */\n private _origin: FocusOrigin = null;\n\n /** The FocusOrigin of the last focus event tracked by the FocusMonitor. */\n private _lastFocusOrigin: FocusOrigin;\n\n /** Whether the window has just been focused. */\n private _windowFocused = false;\n\n /** The timeout id of the window focus timeout. */\n private _windowFocusTimeoutId: ReturnType<typeof setTimeout>;\n\n /** The timeout id of the origin clearing timeout. */\n private _originTimeoutId: ReturnType<typeof setTimeout>;\n\n /**\n * Whether the origin was determined via a touch interaction. Necessary as properly attributing\n * focus events to touch interactions requires special logic.\n */\n private _originFromTouchInteraction = false;\n\n /** Map of elements being monitored to their info. */\n private _elementInfo = new Map<HTMLElement, MonitoredElementInfo>();\n\n /** The number of elements currently being monitored. */\n private _monitoredElementCount = 0;\n\n /**\n * Keeps track of the root nodes to which we've currently bound a focus/blur handler,\n * as well as the number of monitored elements that they contain. We have to treat focus/blur\n * handlers differently from the rest of the events, because the browser won't emit events\n * to the document when focus moves inside of a shadow root.\n */\n private _rootNodeFocusListenerCount = new Map<HTMLElement | Document | ShadowRoot, number>();\n\n /**\n * The specified detection mode, used for attributing the origin of a focus\n * event.\n */\n private readonly _detectionMode: FocusMonitorDetectionMode;\n\n /**\n * Event listener for `focus` events on the window.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _windowFocusListener = () => {\n // Make a note of when the window regains focus, so we can\n // restore the origin info for the focused element.\n this._windowFocused = true;\n this._windowFocusTimeoutId = setTimeout(() => (this._windowFocused = false));\n };\n\n /** Used to reference correct document/window */\n protected _document = inject(DOCUMENT);\n\n /** Subject for stopping our InputModalityDetector subscription. */\n private readonly _stopInputModalityDetector = new Subject<void>();\n\n constructor(...args: unknown[]);\n\n constructor() {\n const options = inject<FocusMonitorOptions | null>(FOCUS_MONITOR_DEFAULT_OPTIONS, {\n optional: true,\n });\n\n this._detectionMode = options?.detectionMode || FocusMonitorDetectionMode.IMMEDIATE;\n }\n /**\n * Event listener for `focus` and 'blur' events on the document.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _rootNodeFocusAndBlurListener = (event: Event) => {\n const target = _getEventTarget<HTMLElement>(event);\n\n // We need to walk up the ancestor chain in order to support `checkChildren`.\n for (let element = target; element; element = element.parentElement) {\n if (event.type === 'focus') {\n this._onFocus(event as FocusEvent, element);\n } else {\n this._onBlur(event as FocusEvent, element);\n }\n }\n };\n\n /**\n * Monitors focus on an element and applies appropriate CSS classes.\n * @param element The element to monitor\n * @param checkChildren Whether to count the element as focused when its children are focused.\n * @returns An observable that emits when the focus state of the element changes.\n * When the element is blurred, null will be emitted.\n */\n monitor(element: HTMLElement, checkChildren?: boolean): Observable<FocusOrigin>;\n\n /**\n * Monitors focus on an element and applies appropriate CSS classes.\n * @param element The element to monitor\n * @param checkChildren Whether to count the element as focused when its children are focused.\n * @returns An observable that emits when the focus state of the element changes.\n * When the element is blurred, null will be emitted.\n */\n monitor(element: ElementRef<HTMLElement>, checkChildren?: boolean): Observable<FocusOrigin>;\n\n monitor(\n element: HTMLElement | ElementRef<HTMLElement>,\n checkChildren: boolean = false,\n ): Observable<FocusOrigin> {\n const nativeElement = coerceElement(element);\n\n // Do nothing if we're not on the browser platform or the passed in node isn't an element.\n if (!this._platform.isBrowser || nativeElement.nodeType !== 1) {\n // Note: we don't want the observable to emit at all so we don't pass any parameters.\n return observableOf();\n }\n\n // If the element is inside the shadow DOM, we need to bind our focus/blur listeners to\n // the shadow root, rather than the `document`, because the browser won't emit focus events\n // to the `document`, if focus is moving within the same shadow root.\n const rootNode = _getShadowRoot(nativeElement) || this._document;\n const cachedInfo = this._elementInfo.get(nativeElement);\n\n // Check if we're already monitoring this element.\n if (cachedInfo) {\n if (checkChildren) {\n // TODO(COMP-318): this can be problematic, because it'll turn all non-checkChildren\n // observers into ones that behave as if `checkChildren` was turned on. We need a more\n // robust solution.\n cachedInfo.checkChildren = true;\n }\n\n return cachedInfo.subject;\n }\n\n // Create monitored element info.\n const info: MonitoredElementInfo = {\n checkChildren: checkChildren,\n subject: new Subject<FocusOrigin>(),\n rootNode,\n };\n this._elementInfo.set(nativeElement, info);\n this._registerGlobalListeners(info);\n\n return info.subject;\n }\n\n /**\n * Stops monitoring an element and removes all focus classes.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: HTMLElement): void;\n\n /**\n * Stops monitoring an element and removes all focus classes.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: ElementRef<HTMLElement>): void;\n\n stopMonitoring(element: HTMLElement | ElementRef<HTMLElement>): void {\n const nativeElement = coerceElement(element);\n const elementInfo = this._elementInfo.get(nativeElement);\n\n if (elementInfo) {\n elementInfo.subject.complete();\n\n this._setClasses(nativeElement);\n this._elementInfo.delete(nativeElement);\n this._removeGlobalListeners(elementInfo);\n }\n }\n\n /**\n * Focuses the element via the specified focus origin.\n * @param element Element to focus.\n * @param origin Focus origin.\n * @param options Options that can be used to configure the focus behavior.\n */\n focusVia(element: HTMLElement, origin: FocusOrigin, options?: FocusOptions): void;\n\n /**\n * Focuses the element via the specified focus origin.\n * @param element Element to focus.\n * @param origin Focus origin.\n * @param options Options that can be used to configure the focus behavior.\n */\n focusVia(element: ElementRef<HTMLElement>, origin: FocusOrigin, options?: FocusOptions): void;\n\n focusVia(\n element: HTMLElement | ElementRef<HTMLElement>,\n origin: FocusOrigin,\n options?: FocusOptions,\n ): void {\n const nativeElement = coerceElement(element);\n const focusedElement = this._document.activeElement;\n\n // If the element is focused already, calling `focus` again won't trigger the event listener\n // which means that the focus classes won't be updated. If that's the case, update the classes\n // directly without waiting for an event.\n if (nativeElement === focusedElement) {\n this._getClosestElementsInfo(nativeElement).forEach(([currentElement, info]) =>\n this._originChanged(currentElement, origin, info),\n );\n } else {\n this._setOrigin(origin);\n\n // `focus` isn't available on the server\n if (typeof nativeElement.focus === 'function') {\n nativeElement.focus(options);\n }\n }\n }\n\n ngOnDestroy() {\n this._elementInfo.forEach((_info, element) => this.stopMonitoring(element));\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n return this._document.defaultView || window;\n }\n\n private _getFocusOrigin(focusEventTarget: HTMLElement | null): FocusOrigin {\n if (this._origin) {\n // If the origin was realized via a touch interaction, we need to perform additional checks\n // to determine whether the focus origin should be attributed to touch or program.\n if (this._originFromTouchInteraction) {\n return this._shouldBeAttributedToTouch(focusEventTarget) ? 'touch' : 'program';\n } else {\n return this._origin;\n }\n }\n\n // If the window has just regained focus, we can restore the most recent origin from before the\n // window blurred. Otherwise, we've reached the point where we can't identify the source of the\n // focus. This typically means one of two things happened:\n //\n // 1) The element was programmatically focused, or\n // 2) The element was focused via screen reader navigation (which generally doesn't fire\n // events).\n //\n // Because we can't distinguish between these two cases, we default to setting `program`.\n if (this._windowFocused && this._lastFocusOrigin) {\n return this._lastFocusOrigin;\n }\n\n // If the interaction is coming from an input label, we consider it a mouse interactions.\n // This is a special case where focus moves on `click`, rather than `mousedown` which breaks\n // our detection, because all our assumptions are for `mousedown`. We need to handle this\n // special case, because it's very common for checkboxes and radio buttons.\n if (focusEventTarget && this._isLastInteractionFromInputLabel(focusEventTarget)) {\n return 'mouse';\n }\n\n return 'program';\n }\n\n /**\n * Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a\n * touch origin isn't immediately reset at the next tick (see _setOrigin). This means that when we\n * handle a focus event following a touch interaction, we need to determine whether (1) the focus\n * event was directly caused by the touch interaction or (2) the focus event was caused by a\n * subsequent programmatic focus call triggered by the touch interaction.\n * @param focusEventTarget The target of the focus event under examination.\n */\n private _shouldBeAttributedToTouch(focusEventTarget: HTMLElement | null): boolean {\n // Please note that this check is not perfect. Consider the following edge case:\n //\n // <div #parent tabindex=\"0\">\n // <div #child tabindex=\"0\" (click)=\"#parent.focus()\"></div>\n // </div>\n //\n // Suppose there is a FocusMonitor in IMMEDIATE mode attached to #parent. When the user touches\n // #child, #parent is programmatically focused. This code will attribute the focus to touch\n // instead of program. This is a relatively minor edge-case that can be worked around by using\n // focusVia(parent, 'program') to focus #parent.\n return (\n this._detectionMode === FocusMonitorDetectionMode.EVENTUAL ||\n !!focusEventTarget?.contains(this._inputModalityDetector._mostRecentTarget)\n );\n }\n\n /**\n * Sets the focus classes on the element based on the given focus origin.\n * @param element The element to update the classes on.\n * @param origin The focus origin.\n */\n private _setClasses(element: HTMLElement, origin?: FocusOrigin): void {\n element.classList.toggle('cdk-focused', !!origin);\n element.classList.toggle('cdk-touch-focused', origin === 'touch');\n element.classList.toggle('cdk-keyboard-focused', origin === 'keyboard');\n element.classList.toggle('cdk-mouse-focused', origin === 'mouse');\n element.classList.toggle('cdk-program-focused', origin === 'program');\n }\n\n /**\n * Updates the focus origin. If we're using immediate detection mode, we schedule an async\n * function to clear the origin at the end of a timeout. The duration of the timeout depends on\n * the origin being set.\n * @param origin The origin to set.\n * @param isFromInteraction Whether we are setting the origin from an interaction event.\n */\n private _setOrigin(origin: FocusOrigin, isFromInteraction = false): void {\n this._ngZone.runOutsideAngular(() => {\n this._origin = origin;\n this._originFromTouchInteraction = origin === 'touch' && isFromInteraction;\n\n // If we're in IMMEDIATE mode, reset the origin at the next tick (or in `TOUCH_BUFFER_MS` ms\n // for a touch event). We reset the origin at the next tick because Firefox focuses one tick\n // after the interaction event. We wait `TOUCH_BUFFER_MS` ms before resetting the origin for\n // a touch event because when a touch event is fired, the associated focus event isn't yet in\n // the event queue. Before doing so, clear any pending timeouts.\n if (this._detectionMode === FocusMonitorDetectionMode.IMMEDIATE) {\n clearTimeout(this._originTimeoutId);\n const ms = this._originFromTouchInteraction ? TOUCH_BUFFER_MS : 1;\n this._originTimeoutId = setTimeout(() => (this._origin = null), ms);\n }\n });\n }\n\n /**\n * Handles focus events on a registered element.\n * @param event The focus event.\n * @param element The monitored element.\n */\n private _onFocus(event: FocusEvent, element: HTMLElement) {\n // NOTE(mmalerba): We currently set the classes based on the focus origin of the most recent\n // focus event affecting the monitored element. If we want to use the origin of the first event\n // instead we should check for the cdk-focused class here and return if the element already has\n // it. (This only matters for elements that have includesChildren = true).\n\n // If we are not counting child-element-focus as focused, make sure that the event target is the\n // monitored element itself.\n const elementInfo = this._elementInfo.get(element);\n const focusEventTarget = _getEventTarget<HTMLElement>(event);\n if (!elementInfo || (!elementInfo.checkChildren && element !== focusEventTarget)) {\n return;\n }\n\n this._originChanged(element, this._getFocusOrigin(focusEventTarget), elementInfo);\n }\n\n /**\n * Handles blur events on a registered element.\n * @param event The blur event.\n * @param element The monitored element.\n */\n _onBlur(event: FocusEvent, element: HTMLElement) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n\n if (\n !elementInfo ||\n (elementInfo.checkChildren &&\n event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))\n ) {\n return;\n }\n\n this._setClasses(element);\n this._emitOrigin(elementInfo, null);\n }\n\n private _emitOrigin(info: MonitoredElementInfo, origin: FocusOrigin) {\n if (info.subject.observers.length) {\n this._ngZone.run(() => info.subject.next(origin));\n }\n }\n\n private _registerGlobalListeners(elementInfo: MonitoredElementInfo) {\n if (!this._platform.isBrowser) {\n return;\n }\n\n const rootNode = elementInfo.rootNode;\n const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode) || 0;\n\n if (!rootNodeFocusListeners) {\n this._ngZone.runOutsideAngular(() => {\n rootNode.addEventListener(\n 'focus',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n rootNode.addEventListener(\n 'blur',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n });\n }\n\n this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners + 1);\n\n // Register global listeners when first element is monitored.\n if (++this._monitoredElementCount === 1) {\n // Note: we listen to events in the capture phase so we\n // can detect them even if the user stops propagation.\n this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n window.addEventListener('focus', this._windowFocusListener);\n });\n\n // The InputModalityDetector is also just a collection of global listeners.\n this._inputModalityDetector.modalityDetected\n .pipe(takeUntil(this._stopInputModalityDetector))\n .subscribe(modality => {\n this._setOrigin(modality, true /* isFromInteraction */);\n });\n }\n }\n\n private _removeGlobalListeners(elementInfo: MonitoredElementInfo) {\n const rootNode = elementInfo.rootNode;\n\n if (this._rootNodeFocusListenerCount.has(rootNode)) {\n const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode)!;\n\n if (rootNodeFocusListeners > 1) {\n this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners - 1);\n } else {\n rootNode.removeEventListener(\n 'focus',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n rootNode.removeEventListener(\n 'blur',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n this._rootNodeFocusListenerCount.delete(rootNode);\n }\n }\n\n // Unregister global listeners when last element is unmonitored.\n if (!--this._monitoredElementCount) {\n const window = this._getWindow();\n window.removeEventListener('focus', this._windowFocusListener);\n\n // Equivalently, stop our InputModalityDetector subscription.\n this._stopInputModalityDetector.next();\n\n // Clear timeouts for all potentially pending timeouts to prevent the leaks.\n clearTimeout(this._windowFocusTimeoutId);\n clearTimeout(this._originTimeoutId);\n }\n }\n\n /** Updates all the state on an element once its focus origin has changed. */\n private _originChanged(\n element: HTMLElement,\n origin: FocusOrigin,\n elementInfo: MonitoredElementInfo,\n ) {\n this._setClasses(element, origin);\n this._emitOrigin(elementInfo, origin);\n this._lastFocusOrigin = origin;\n }\n\n /**\n * Collects the `MonitoredElementInfo` of a particular element and\n * all of its ancestors that have enabled `checkChildren`.\n * @param element Element from which to start the search.\n */\n private _getClosestElementsInfo(element: HTMLElement): [HTMLElement, MonitoredElementInfo][] {\n const results: [HTMLElement, MonitoredElementInfo][] = [];\n\n this._elementInfo.forEach((info, currentElement) => {\n if (currentElement === element || (info.checkChildren && currentElement.contains(element))) {\n results.push([currentElement, info]);\n }\n });\n\n return results;\n }\n\n /**\n * Returns whether an interaction is likely to have come from the user clicking the `label` of\n * an `input` or `textarea` in order to focus it.\n * @param focusEventTarget Target currently receiving focus.\n */\n private _isLastInteractionFromInputLabel(focusEventTarget: HTMLElement): boolean {\n const {_mostRecentTarget: mostRecentTarget, mostRecentModality} = this._inputModalityDetector;\n\n // If the last interaction used the mouse on an element contained by one of the labels\n // of an `input`/`textarea` that is currently focused, it is very likely that the\n // user redirected focus using the label.\n if (\n mostRecentModality !== 'mouse' ||\n !mostRecentTarget ||\n mostRecentTarget === focusEventTarget ||\n (focusEventTarget.nodeName !== 'INPUT' && focusEventTarget.nodeName !== 'TEXTAREA') ||\n (focusEventTarget as HTMLInputElement | HTMLTextAreaElement).disabled\n ) {\n return false;\n }\n\n const labels = (focusEventTarget as HTMLInputElement | HTMLTextAreaElement).labels;\n\n if (labels) {\n for (let i = 0; i < labels.length; i++) {\n if (labels[i].contains(mostRecentTarget)) {\n return true;\n }\n }\n }\n\n return false;\n }\n}\n\n/**\n * Directive that determines how a particular element was focused (via keyboard, mouse, touch, or\n * programmatically) and adds corresponding classes to the element.\n *\n * There are two variants of this directive:\n * 1) cdkMonitorElementFocus: does not consider an element to be focused if one of its children is\n * focused.\n * 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused.\n */\n@Directive({\n selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]',\n exportAs: 'cdkMonitorFocus',\n})\nexport class CdkMonitorFocus implements AfterViewInit, OnDestroy {\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private _focusMonitor = inject(FocusMonitor);\n\n private _monitorSubscription: Subscription;\n private _focusOrigin: FocusOrigin = null;\n\n @Output() readonly cdkFocusChange = new EventEmitter<FocusOrigin>();\n\n constructor(...args: unknown[]);\n constructor() {}\n\n get focusOrigin(): FocusOrigin {\n return this._focusOrigin;\n }\n\n ngAfterViewInit() {\n const element = this._elementRef.nativeElement;\n this._monitorSubscription = this._focusMonitor\n .monitor(element, element.nodeType === 1 && element.hasAttribute('cdkMonitorSubtreeFocus'))\n .subscribe(origin => {\n this._focusOrigin = origin;\n this.cdkFocusChange.emit(origin);\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n\n if (this._monitorSubscription) {\n this._monitorSubscription.unsubscribe();\n }\n }\n}\n"],"names":["INPUT_MODALITY_DETECTOR_OPTIONS","InjectionToken","INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS","ignoreKeys","ALT","CONTROL","MAC_META","META","SHIFT","TOUCH_BUFFER_MS","modalityEventListenerOptions","passive","capture","InputModalityDetector","_platform","inject","Platform","_listenerCleanups","modalityDetected","modalityChanged","mostRecentModality","_modality","value","_mostRecentTarget","BehaviorSubject","_options","_lastTouchMs","_onKeydown","event","some","keyCode","next","_getEventTarget","_onMousedown","Date","now","isFakeMousedownFromScreenReader","_onTouchstart","isFakeTouchstartFromScreenReader","constructor","ngZone","NgZone","document","DOCUMENT","options","optional","pipe","skip","distinctUntilChanged","isBrowser","renderer","RendererFactory2","createRenderer","runOutsideAngular","listen","ngOnDestroy","complete","forEach","cleanup","deps","target","i0","ɵɵFactoryTarget","Injectable","ɵprov","ɵɵngDeclareInjectable","minVersion","version","ngImport","type","decorators","providedIn","FocusMonitorDetectionMode","FOCUS_MONITOR_DEFAULT_OPTIONS","captureEventListenerOptions","normalizePassiveListenerOptions","FocusMonitor","_ngZone","_inputModalityDetector","_origin","_lastFocusOrigin","_windowFocused","_windowFocusTimeoutId","_originTimeoutId","_originFromTouchInteraction","_elementInfo","Map","_monitoredElementCount","_rootNodeFocusListenerCount","_detectionMode","_windowFocusListener","setTimeout","_document","_stopInputModalityDetector","Subject","detectionMode","IMMEDIATE","_rootNodeFocusAndBlurListener","element","parentElement","_onFocus","_onBlur","monitor","checkChildren","nativeElement","coerceElement","nodeType","observableOf","rootNode","_getShadowRoot","cachedInfo","get","subject","info","set","_registerGlobalListeners","stopMonitoring","elementInfo","_setClasses","delete","_removeGlobalListeners","focusVia","origin","focusedElement","activeElement","_getClosestElementsInfo","currentElement","_originChanged","_setOrigin","focus","_info","_getWindow","defaultView","window","_getFocusOrigin","focusEventTarget","_shouldBeAttributedToTouch","_isLastInteractionFromInputLabel","EVENTUAL","contains","classList","toggle","isFromInteraction","clearTimeout","ms","relatedTarget","Node","_emitOrigin","observers","length","run","rootNodeFocusListeners","addEventListener","takeUntil","subscribe","modality","has","removeEventListener","results","push","mostRecentTarget","nodeName","disabled","labels","i","CdkMonitorFocus","_elementRef","ElementRef","_focusMonitor","_monitorSubscription","_focusOrigin","cdkFocusChange","EventEmitter","focusOrigin","ngAfterViewInit","hasAttribute","emit","unsubscribe","Directive","isStandalone","selector","outputs","exportAs","args","Output"],"mappings":";;;;;;;;;;;MA0CaA,+BAA+B,GAAG,IAAIC,cAAc,CAC/D,qCAAqC;AAmBhC,MAAMC,uCAAuC,GAAiC;EACnFC,UAAU,EAAE,CAACC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,KAAK;;AAU3C,MAAMC,eAAe,GAAG,GAAG;AAMlC,MAAMC,4BAA4B,GAAG;AACnCC,EAAAA,OAAO,EAAE,IAAI;AACbC,EAAAA,OAAO,EAAE;CACV;MAiBYC,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;AAC1B,MAAA,IAAI,CAACiD,cAAc,CAACK,IAAI,CAACtD,MAAM,CAAC;AAClC,KAAC,CAAC;AACN;AAEAnE,EAAAA,WAAWA,GAAA;IACT,IAAI,CAACiH,aAAa,CAACpD,cAAc,CAAC,IAAI,CAACkD,WAAW,CAAC;IAEnD,IAAI,IAAI,CAACG,oBAAoB,EAAE;AAC7B,MAAA,IAAI,CAACA,oBAAoB,CAACQ,WAAW,EAAE;AACzC;AACF;;;;;UAhCWZ,eAAe;AAAA1G,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAoH;AAAA,GAAA,CAAA;;;;UAAfb,eAAe;AAAAc,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,QAAA,EAAA,oDAAA;AAAAC,IAAAA,OAAA,EAAA;AAAAV,MAAAA,cAAA,EAAA;KAAA;IAAAW,QAAA,EAAA,CAAA,iBAAA,CAAA;AAAAlH,IAAAA,QAAA,EAAAP;AAAA,GAAA,CAAA;;;;;;QAAfwG,eAAe;AAAA/F,EAAAA,UAAA,EAAA,CAAA;UAJ3B4G,SAAS;AAACK,IAAAA,IAAA,EAAA,CAAA;AACTH,MAAAA,QAAQ,EAAE,oDAAoD;AAC9DE,MAAAA,QAAQ,EAAE;KACX;;;;;YAQEE;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_id-generator-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_id-generator-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/a11y/id-generator.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.dev/license\n */\n\nimport {APP_ID, inject, Injectable} from '@angular/core';\n\n/**\n * Keeps track of the ID count per prefix. This helps us make the IDs a bit more deterministic\n * like they were before the service was introduced. Note that ideally we wouldn't have to do\n * this, but there are some internal tests that rely on the IDs.\n */\nconst counters: Record<string, number> = {};\n\n/** Service that generates unique IDs for DOM nodes. */\n@Injectable({providedIn: 'root'})\nexport class _IdGenerator {\n private _appId = inject(APP_ID);\n private static _infix = `a${Math.floor(Math.random() * 100000).toString()}`;\n\n /**\n * Generates a unique ID with a specific prefix.\n * @param prefix Prefix to add to the ID.\n * @param randomize Add a randomized infix string.\n */\n getId(prefix: string, randomize: boolean = false): string {\n // Omit the app ID if it's the default `ng`. Since the vast majority of pages have one\n // Angular app on them, we can reduce the amount of breakages by not adding it.\n if (this._appId !== 'ng') {\n prefix += this._appId;\n }\n\n if (!counters.hasOwnProperty(prefix)) {\n counters[prefix] = 0;\n }\n\n return `${prefix}${randomize ? _IdGenerator._infix + '-' : ''}${counters[prefix]++}`;\n }\n}\n"],"names":["counters","_IdGenerator","_appId","inject","APP_ID","_infix","Math","floor","random","toString","getId","prefix","randomize","hasOwnProperty","deps","target","i0","ɵɵFactoryTarget","Injectable","ɵprov","ɵɵngDeclareInjectable","minVersion","version","ngImport","type","decorators","providedIn"],"mappings":";;;AAeA,MAAMA,QAAQ,GAA2B,EAAE;MAI9BC,YAAY,CAAA;AACfC,EAAAA,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAC;AACvB,EAAA,OAAOC,MAAM,GAAG,CAAA,CAAA,EAAIC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,EAAE,GAAG,MAAM,CAAC,CAACC,QAAQ,EAAE,CAAE,CAAA;AAO3EC,EAAAA,KAAKA,CAACC,MAAc,EAAEC,SAAA,GAAqB,KAAK,EAAA;AAG9C,IAAA,IAAI,IAAI,CAACV,MAAM,KAAK,IAAI,EAAE;MACxBS,MAAM,IAAI,IAAI,CAACT,MAAM;AACvB;AAEA,IAAA,IAAI,CAACF,QAAQ,CAACa,cAAc,CAACF,MAAM,CAAC,EAAE;AACpCX,MAAAA,QAAQ,CAACW,MAAM,CAAC,GAAG,CAAC;AACtB;AAEA,IAAA,OAAO,GAAGA,MAAM,CAAA,EAAGC,SAAS,GAAGX,YAAY,CAACI,MAAM,GAAG,GAAG,GAAG,EAAE,CAAGL,EAAAA,QAAQ,CAACW,MAAM,CAAC,EAAE,CAAE,CAAA;AACtF;;;;;UArBWV,YAAY;AAAAa,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;AAAZ,EAAA,OAAAC,KAAA,GAAAH,EAAA,CAAAI,qBAAA,CAAA;AAAAC,IAAAA,UAAA,EAAA,QAAA;AAAAC,IAAAA,OAAA,EAAA,QAAA;AAAAC,IAAAA,QAAA,EAAAP,EAAA;AAAAQ,IAAAA,IAAA,EAAAvB,YAAY;gBADA;AAAM,GAAA,CAAA;;;;;;QAClBA,YAAY;AAAAwB,EAAAA,UAAA,EAAA,CAAA;UADxBP,UAAU;WAAC;AAACQ,MAAAA,UAAU,EAAE;KAAO;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_keycodes-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_keycodes-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/keycodes/keycodes.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.dev/license\n */\n\nexport const MAC_ENTER = 3;\nexport const BACKSPACE = 8;\nexport const TAB = 9;\nexport const NUM_CENTER = 12;\nexport const ENTER = 13;\nexport const SHIFT = 16;\nexport const CONTROL = 17;\nexport const ALT = 18;\nexport const PAUSE = 19;\nexport const CAPS_LOCK = 20;\nexport const ESCAPE = 27;\nexport const SPACE = 32;\nexport const PAGE_UP = 33;\nexport const PAGE_DOWN = 34;\nexport const END = 35;\nexport const HOME = 36;\nexport const LEFT_ARROW = 37;\nexport const UP_ARROW = 38;\nexport const RIGHT_ARROW = 39;\nexport const DOWN_ARROW = 40;\nexport const PLUS_SIGN = 43;\nexport const PRINT_SCREEN = 44;\nexport const INSERT = 45;\nexport const DELETE = 46;\nexport const ZERO = 48;\nexport const ONE = 49;\nexport const TWO = 50;\nexport const THREE = 51;\nexport const FOUR = 52;\nexport const FIVE = 53;\nexport const SIX = 54;\nexport const SEVEN = 55;\nexport const EIGHT = 56;\nexport const NINE = 57;\nexport const FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186\nexport const FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187\nexport const QUESTION_MARK = 63;\nexport const AT_SIGN = 64;\nexport const A = 65;\nexport const B = 66;\nexport const C = 67;\nexport const D = 68;\nexport const E = 69;\nexport const F = 70;\nexport const G = 71;\nexport const H = 72;\nexport const I = 73;\nexport const J = 74;\nexport const K = 75;\nexport const L = 76;\nexport const M = 77;\nexport const N = 78;\nexport const O = 79;\nexport const P = 80;\nexport const Q = 81;\nexport const R = 82;\nexport const S = 83;\nexport const T = 84;\nexport const U = 85;\nexport const V = 86;\nexport const W = 87;\nexport const X = 88;\nexport const Y = 89;\nexport const Z = 90;\nexport const META = 91; // WIN_KEY_LEFT\nexport const MAC_WK_CMD_LEFT = 91;\nexport const MAC_WK_CMD_RIGHT = 93;\nexport const CONTEXT_MENU = 93;\nexport const NUMPAD_ZERO = 96;\nexport const NUMPAD_ONE = 97;\nexport const NUMPAD_TWO = 98;\nexport const NUMPAD_THREE = 99;\nexport const NUMPAD_FOUR = 100;\nexport const NUMPAD_FIVE = 101;\nexport const NUMPAD_SIX = 102;\nexport const NUMPAD_SEVEN = 103;\nexport const NUMPAD_EIGHT = 104;\nexport const NUMPAD_NINE = 105;\nexport const NUMPAD_MULTIPLY = 106;\nexport const NUMPAD_PLUS = 107;\nexport const NUMPAD_MINUS = 109;\nexport const NUMPAD_PERIOD = 110;\nexport const NUMPAD_DIVIDE = 111;\nexport const F1 = 112;\nexport const F2 = 113;\nexport const F3 = 114;\nexport const F4 = 115;\nexport const F5 = 116;\nexport const F6 = 117;\nexport const F7 = 118;\nexport const F8 = 119;\nexport const F9 = 120;\nexport const F10 = 121;\nexport const F11 = 122;\nexport const F12 = 123;\nexport const NUM_LOCK = 144;\nexport const SCROLL_LOCK = 145;\nexport const FIRST_MEDIA = 166;\nexport const FF_MINUS = 173;\nexport const MUTE = 173; // Firefox (Gecko) fires 181 for MUTE\nexport const VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN\nexport const VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP\nexport const FF_MUTE = 181;\nexport const FF_VOLUME_DOWN = 182;\nexport const LAST_MEDIA = 183;\nexport const FF_VOLUME_UP = 183;\nexport const SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON\nexport const EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS\nexport const COMMA = 188;\nexport const DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS\nexport const PERIOD = 190;\nexport const SLASH = 191;\nexport const APOSTROPHE = 192;\nexport const TILDE = 192;\nexport const OPEN_SQUARE_BRACKET = 219;\nexport const BACKSLASH = 220;\nexport const CLOSE_SQUARE_BRACKET = 221;\nexport const SINGLE_QUOTE = 222;\nexport const MAC_META = 224;\n"],"names":["MAC_ENTER","BACKSPACE","TAB","NUM_CENTER","ENTER","SHIFT","CONTROL","ALT","PAUSE","CAPS_LOCK","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT_ARROW","UP_ARROW","RIGHT_ARROW","DOWN_ARROW","PLUS_SIGN","PRINT_SCREEN","INSERT","DELETE","ZERO","ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE","FF_SEMICOLON","FF_EQUALS","QUESTION_MARK","AT_SIGN","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","META","MAC_WK_CMD_LEFT","MAC_WK_CMD_RIGHT","CONTEXT_MENU","NUMPAD_ZERO","NUMPAD_ONE","NUMPAD_TWO","NUMPAD_THREE","NUMPAD_FOUR","NUMPAD_FIVE","NUMPAD_SIX","NUMPAD_SEVEN","NUMPAD_EIGHT","NUMPAD_NINE","NUMPAD_MULTIPLY","NUMPAD_PLUS","NUMPAD_MINUS","NUMPAD_PERIOD","NUMPAD_DIVIDE","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","NUM_LOCK","SCROLL_LOCK","FIRST_MEDIA","FF_MINUS","MUTE","VOLUME_DOWN","VOLUME_UP","FF_MUTE","FF_VOLUME_DOWN","LAST_MEDIA","FF_VOLUME_UP","SEMICOLON","EQUALS","COMMA","DASH","PERIOD","SLASH","APOSTROPHE","TILDE","OPEN_SQUARE_BRACKET","BACKSLASH","CLOSE_SQUARE_BRACKET","SINGLE_QUOTE","MAC_META"],"mappings":"AAQO,MAAMA,SAAS,GAAG;AAClB,MAAMC,SAAS,GAAG;AAClB,MAAMC,GAAG,GAAG;AACZ,MAAMC,UAAU,GAAG;AACnB,MAAMC,KAAK,GAAG;AACd,MAAMC,KAAK,GAAG;AACd,MAAMC,OAAO,GAAG;AAChB,MAAMC,GAAG,GAAG;AACZ,MAAMC,KAAK,GAAG;AACd,MAAMC,SAAS,GAAG;AAClB,MAAMC,MAAM,GAAG;AACf,MAAMC,KAAK,GAAG;AACd,MAAMC,OAAO,GAAG;AAChB,MAAMC,SAAS,GAAG;AAClB,MAAMC,GAAG,GAAG;AACZ,MAAMC,IAAI,GAAG;AACb,MAAMC,UAAU,GAAG;AACnB,MAAMC,QAAQ,GAAG;AACjB,MAAMC,WAAW,GAAG;AACpB,MAAMC,UAAU,GAAG;AACnB,MAAMC,SAAS,GAAG;AAClB,MAAMC,YAAY,GAAG;AACrB,MAAMC,MAAM,GAAG;AACf,MAAMC,MAAM,GAAG;AACf,MAAMC,IAAI,GAAG;AACb,MAAMC,GAAG,GAAG;AACZ,MAAMC,GAAG,GAAG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,MAAMC,WAAW,GAAG;AACpB,MAAMC,eAAe,GAAG;AACxB,MAAMC,WAAW,GAAG;AACpB,MAAMC,YAAY,GAAG;AACrB,MAAMC,aAAa,GAAG;AACtB,MAAMC,aAAa,GAAG;AACtB,MAAMC,EAAE,GAAG;AACX,MAAMC,EAAE,GAAG;AACX,MAAMC,EAAE,GAAG;AACX,MAAMC,EAAE,GAAG;AACX,MAAMC,EAAE,GAAG;AACX,MAAMC,EAAE,GAAG;AACX,MAAMC,EAAE,GAAG;AACX,MAAMC,EAAE,GAAG;AACX,MAAMC,EAAE,GAAG;AACX,MAAMC,GAAG,GAAG;AACZ,MAAMC,GAAG,GAAG;AACZ,MAAMC,GAAG,GAAG;AACZ,MAAMC,QAAQ,GAAG;AACjB,MAAMC,WAAW,GAAG;AACpB,MAAMC,WAAW,GAAG;AACpB,MAAMC,QAAQ,GAAG;AACjB,MAAMC,IAAI,GAAG;AACb,MAAMC,WAAW,GAAG;AACpB,MAAMC,SAAS,GAAG;AAClB,MAAMC,OAAO,GAAG;AAChB,MAAMC,cAAc,GAAG;AACvB,MAAMC,UAAU,GAAG;AACnB,MAAMC,YAAY,GAAG;AACrB,MAAMC,SAAS,GAAG;AAClB,MAAMC,MAAM,GAAG;AACf,MAAMC,KAAK,GAAG;AACd,MAAMC,IAAI,GAAG;AACb,MAAMC,MAAM,GAAG;AACf,MAAMC,KAAK,GAAG;AACd,MAAMC,UAAU,GAAG;AACnB,MAAMC,KAAK,GAAG;AACd,MAAMC,mBAAmB,GAAG;AAC5B,MAAMC,SAAS,GAAG;AAClB,MAAMC,oBAAoB,GAAG;AAC7B,MAAMC,YAAY,GAAG;AACrB,MAAMC,QAAQ,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_list-key-manager-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/a11y/key-manager/list-key-manager.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.dev/license\n */\n\nimport {\n DOWN_ARROW,\n END,\n HOME,\n LEFT_ARROW,\n PAGE_DOWN,\n PAGE_UP,\n RIGHT_ARROW,\n TAB,\n UP_ARROW,\n hasModifierKey,\n} from '../../keycodes';\nimport {EffectRef, Injector, QueryList, Signal, effect, isSignal, signal} from '@angular/core';\nimport {Subject, Subscription} from 'rxjs';\nimport {Typeahead} from './typeahead';\n\n/** This interface is for items that can be passed to a ListKeyManager. */\nexport interface ListKeyManagerOption {\n /** Whether the option is disabled. */\n disabled?: boolean;\n\n /** Gets the label for this option. */\n getLabel?(): string;\n}\n\n/** Modifier keys handled by the ListKeyManager. */\nexport type ListKeyManagerModifierKey = 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey';\n\n/**\n * This class manages keyboard events for selectable lists. If you pass it a query list\n * of items, it will set the active item correctly when arrow events occur.\n */\nexport class ListKeyManager<T extends ListKeyManagerOption> {\n private _activeItemIndex = signal(-1);\n private _activeItem = signal<T | null>(null);\n private _wrap = false;\n private _typeaheadSubscription = Subscription.EMPTY;\n private _itemChangesSubscription?: Subscription;\n private _vertical = true;\n private _horizontal: 'ltr' | 'rtl' | null;\n private _allowedModifierKeys: ListKeyManagerModifierKey[] = [];\n private _homeAndEnd = false;\n private _pageUpAndDown = {enabled: false, delta: 10};\n private _effectRef: EffectRef | undefined;\n private _typeahead?: Typeahead<T>;\n\n /**\n * Predicate function that can be used to check whether an item should be skipped\n * by the key manager. By default, disabled items are skipped.\n */\n private _skipPredicateFn = (item: T) => item.disabled;\n\n constructor(items: QueryList<T> | T[] | readonly T[]);\n constructor(items: Signal<T[]> | Signal<readonly T[]>, injector: Injector);\n constructor(\n private _items: QueryList<T> | T[] | readonly T[] | Signal<T[]> | Signal<readonly T[]>,\n injector?: Injector,\n ) {\n // We allow for the items to be an array because, in some cases, the consumer may\n // not have access to a QueryList of the items they want to manage (e.g. when the\n // items aren't being collected via `ViewChildren` or `ContentChildren`).\n if (_items instanceof QueryList) {\n this._itemChangesSubscription = _items.changes.subscribe((newItems: QueryList<T>) =>\n this._itemsChanged(newItems.toArray()),\n );\n } else if (isSignal(_items)) {\n if (!injector && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw new Error('ListKeyManager constructed with a signal must receive an injector');\n }\n\n this._effectRef = effect(() => this._itemsChanged(_items()), {injector});\n }\n }\n\n /**\n * Stream that emits any time the TAB key is pressed, so components can react\n * when focus is shifted off of the list.\n */\n readonly tabOut = new Subject<void>();\n\n /** Stream that emits whenever the active item of the list manager changes. */\n readonly change = new Subject<number>();\n\n /**\n * Sets the predicate function that determines which items should be skipped by the\n * list key manager.\n * @param predicate Function that determines whether the given item should be skipped.\n */\n skipPredicate(predicate: (item: T) => boolean): this {\n this._skipPredicateFn = predicate;\n return this;\n }\n\n /**\n * Configures wrapping mode, which determines whether the active item will wrap to\n * the other end of list when there are no more items in the given direction.\n * @param shouldWrap Whether the list should wrap when reaching the end.\n */\n withWrap(shouldWrap = true): this {\n this._wrap = shouldWrap;\n return this;\n }\n\n /**\n * Configures whether the key manager should be able to move the selection vertically.\n * @param enabled Whether vertical selection should be enabled.\n */\n withVerticalOrientation(enabled: boolean = true): this {\n this._vertical = enabled;\n return this;\n }\n\n /**\n * Configures the key manager to move the selection horizontally.\n * Passing in `null` will disable horizontal movement.\n * @param direction Direction in which the selection can be moved.\n */\n withHorizontalOrientation(direction: 'ltr' | 'rtl' | null): this {\n this._horizontal = direction;\n return this;\n }\n\n /**\n * Modifier keys which are allowed to be held down and whose default actions will be prevented\n * as the user is pressing the arrow keys. Defaults to not allowing any modifier keys.\n */\n withAllowedModifierKeys(keys: ListKeyManagerModifierKey[]): this {\n this._allowedModifierKeys = keys;\n return this;\n }\n\n /**\n * Turns on typeahead mode which allows users to set the active item by typing.\n * @param debounceInterval Time to wait after the last keystroke before setting the active item.\n */\n withTypeAhead(debounceInterval: number = 200): this {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const items = this._getItemsArray();\n if (items.length > 0 && items.some(item => typeof item.getLabel !== 'function')) {\n throw Error('ListKeyManager items in typeahead mode must implement the `getLabel` method.');\n }\n }\n\n this._typeaheadSubscription.unsubscribe();\n\n const items = this._getItemsArray();\n this._typeahead = new Typeahead(items, {\n debounceInterval: typeof debounceInterval === 'number' ? debounceInterval : undefined,\n skipPredicate: item => this._skipPredicateFn(item),\n });\n\n this._typeaheadSubscription = this._typeahead.selectedItem.subscribe(item => {\n this.setActiveItem(item);\n });\n\n return this;\n }\n\n /** Cancels the current typeahead sequence. */\n cancelTypeahead(): this {\n this._typeahead?.reset();\n return this;\n }\n\n /**\n * Configures the key manager to activate the first and last items\n * respectively when the Home or End key is pressed.\n * @param enabled Whether pressing the Home or End key activates the first/last item.\n */\n withHomeAndEnd(enabled: boolean = true): this {\n this._homeAndEnd = enabled;\n return this;\n }\n\n /**\n * Configures the key manager to activate every 10th, configured or first/last element in up/down direction\n * respectively when the Page-Up or Page-Down key is pressed.\n * @param enabled Whether pressing the Page-Up or Page-Down key activates the first/last item.\n * @param delta Whether pressing the Home or End key activates the first/last item.\n */\n withPageUpDown(enabled: boolean = true, delta: number = 10): this {\n this._pageUpAndDown = {enabled, delta};\n return this;\n }\n\n /**\n * Sets the active item to the item at the index specified.\n * @param index The index of the item to be set as active.\n */\n setActiveItem(index: number): void;\n\n /**\n * Sets the active item to the specified item.\n * @param item The item to be set as active.\n */\n setActiveItem(item: T): void;\n\n /**\n * Sets the active item to the specified item.\n * @param item The item to be set as active.\n */\n setActiveItem(item: T | number): void;\n\n setActiveItem(item: any): void {\n const previousActiveItem = this._activeItem();\n\n this.updateActiveItem(item);\n\n if (this._activeItem() !== previousActiveItem) {\n this.change.next(this._activeItemIndex());\n }\n }\n\n /**\n * Sets the active item depending on the key event passed in.\n * @param event Keyboard event to be used for determining which element should be active.\n */\n onKeydown(event: KeyboardEvent): void {\n const keyCode = event.keyCode;\n const modifiers: ListKeyManagerModifierKey[] = ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'];\n const isModifierAllowed = modifiers.every(modifier => {\n return !event[modifier] || this._allowedModifierKeys.indexOf(modifier) > -1;\n });\n\n switch (keyCode) {\n case TAB:\n this.tabOut.next();\n return;\n\n case DOWN_ARROW:\n if (this._vertical && isModifierAllowed) {\n this.setNextItemActive();\n break;\n } else {\n return;\n }\n\n case UP_ARROW:\n if (this._vertical && isModifierAllowed) {\n this.setPreviousItemActive();\n break;\n } else {\n return;\n }\n\n case RIGHT_ARROW:\n if (this._horizontal && isModifierAllowed) {\n this._horizontal === 'rtl' ? this.setPreviousItemActive() : this.setNextItemActive();\n break;\n } else {\n return;\n }\n\n case LEFT_ARROW:\n if (this._horizontal && isModifierAllowed) {\n this._horizontal === 'rtl' ? this.setNextItemActive() : this.setPreviousItemActive();\n break;\n } else {\n return;\n }\n\n case HOME:\n if (this._homeAndEnd && isModifierAllowed) {\n this.setFirstItemActive();\n break;\n } else {\n return;\n }\n\n case END:\n if (this._homeAndEnd && isModifierAllowed) {\n this.setLastItemActive();\n break;\n } else {\n return;\n }\n\n case PAGE_UP:\n if (this._pageUpAndDown.enabled && isModifierAllowed) {\n const targetIndex = this._activeItemIndex() - this._pageUpAndDown.delta;\n this._setActiveItemByIndex(targetIndex > 0 ? targetIndex : 0, 1);\n break;\n } else {\n return;\n }\n\n case PAGE_DOWN:\n if (this._pageUpAndDown.enabled && isModifierAllowed) {\n const targetIndex = this._activeItemIndex() + this._pageUpAndDown.delta;\n const itemsLength = this._getItemsArray().length;\n this._setActiveItemByIndex(targetIndex < itemsLength ? targetIndex : itemsLength - 1, -1);\n break;\n } else {\n return;\n }\n\n default:\n if (isModifierAllowed || hasModifierKey(event, 'shiftKey')) {\n this._typeahead?.handleKey(event);\n }\n\n // Note that we return here, in order to avoid preventing\n // the default action of non-navigational keys.\n return;\n }\n\n this._typeahead?.reset();\n event.preventDefault();\n }\n\n /** Index of the currently active item. */\n get activeItemIndex(): number | null {\n return this._activeItemIndex();\n }\n\n /** The active item. */\n get activeItem(): T | null {\n return this._activeItem();\n }\n\n /** Gets whether the user is currently typing into the manager using the typeahead feature. */\n isTyping(): boolean {\n return !!this._typeahead && this._typeahead.isTyping();\n }\n\n /** Sets the active item to the first enabled item in the list. */\n setFirstItemActive(): void {\n this._setActiveItemByIndex(0, 1);\n }\n\n /** Sets the active item to the last enabled item in the list. */\n setLastItemActive(): void {\n this._setActiveItemByIndex(this._getItemsArray().length - 1, -1);\n }\n\n /** Sets the active item to the next enabled item in the list. */\n setNextItemActive(): void {\n this._activeItemIndex() < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);\n }\n\n /** Sets the active item to a previous enabled item in the list. */\n setPreviousItemActive(): void {\n this._activeItemIndex() < 0 && this._wrap\n ? this.setLastItemActive()\n : this._setActiveItemByDelta(-1);\n }\n\n /**\n * Allows setting the active without any other effects.\n * @param index Index of the item to be set as active.\n */\n updateActiveItem(index: number): void;\n\n /**\n * Allows setting the active item without any other effects.\n * @param item Item to be set as active.\n */\n updateActiveItem(item: T): void;\n\n updateActiveItem(item: any): void {\n const itemArray = this._getItemsArray();\n const index = typeof item === 'number' ? item : itemArray.indexOf(item);\n const activeItem = itemArray[index];\n\n // Explicitly check for `null` and `undefined` because other falsy values are valid.\n this._activeItem.set(activeItem == null ? null : activeItem);\n this._activeItemIndex.set(index);\n this._typeahead?.setCurrentSelectedItemIndex(index);\n }\n\n /** Cleans up the key manager. */\n destroy() {\n this._typeaheadSubscription.unsubscribe();\n this._itemChangesSubscription?.unsubscribe();\n this._effectRef?.destroy();\n this._typeahead?.destroy();\n this.tabOut.complete();\n this.change.complete();\n }\n\n /**\n * This method sets the active item, given a list of items and the delta between the\n * currently active item and the new active item. It will calculate differently\n * depending on whether wrap mode is turned on.\n */\n private _setActiveItemByDelta(delta: -1 | 1): void {\n this._wrap ? this._setActiveInWrapMode(delta) : this._setActiveInDefaultMode(delta);\n }\n\n /**\n * Sets the active item properly given \"wrap\" mode. In other words, it will continue to move\n * down the list until it finds an item that is not disabled, and it will wrap if it\n * encounters either end of the list.\n */\n private _setActiveInWrapMode(delta: -1 | 1): void {\n const items = this._getItemsArray();\n\n for (let i = 1; i <= items.length; i++) {\n const index = (this._activeItemIndex() + delta * i + items.length) % items.length;\n const item = items[index];\n\n if (!this._skipPredicateFn(item)) {\n this.setActiveItem(index);\n return;\n }\n }\n }\n\n /**\n * Sets the active item properly given the default mode. In other words, it will\n * continue to move down the list until it finds an item that is not disabled. If\n * it encounters either end of the list, it will stop and not wrap.\n */\n private _setActiveInDefaultMode(delta: -1 | 1): void {\n this._setActiveItemByIndex(this._activeItemIndex() + delta, delta);\n }\n\n /**\n * Sets the active item to the first enabled item starting at the index specified. If the\n * item is disabled, it will move in the fallbackDelta direction until it either\n * finds an enabled item or encounters the end of the list.\n */\n private _setActiveItemByIndex(index: number, fallbackDelta: -1 | 1): void {\n const items = this._getItemsArray();\n\n if (!items[index]) {\n return;\n }\n\n while (this._skipPredicateFn(items[index])) {\n index += fallbackDelta;\n\n if (!items[index]) {\n return;\n }\n }\n\n this.setActiveItem(index);\n }\n\n /** Returns the items as an array. */\n private _getItemsArray(): T[] | readonly T[] {\n if (isSignal(this._items)) {\n return this._items();\n }\n\n return this._items instanceof QueryList ? this._items.toArray() : this._items;\n }\n\n /** Callback for when the items have changed. */\n private _itemsChanged(newItems: T[] | readonly T[]) {\n this._typeahead?.setItems(newItems);\n const activeItem = this._activeItem();\n if (activeItem) {\n const newIndex = newItems.indexOf(activeItem);\n\n if (newIndex > -1 && newIndex !== this._activeItemIndex()) {\n this._activeItemIndex.set(newIndex);\n this._typeahead?.setCurrentSelectedItemIndex(newIndex);\n }\n }\n }\n}\n"],"names":["ListKeyManager","_items","_activeItemIndex","signal","_activeItem","_wrap","_typeaheadSubscription","Subscription","EMPTY","_itemChangesSubscription","_vertical","_horizontal","_allowedModifierKeys","_homeAndEnd","_pageUpAndDown","enabled","delta","_effectRef","_typeahead","_skipPredicateFn","item","disabled","constructor","injector","QueryList","changes","subscribe","newItems","_itemsChanged","toArray","isSignal","ngDevMode","Error","effect","debugName","tabOut","Subject","change","skipPredicate","predicate","withWrap","shouldWrap","withVerticalOrientation","withHorizontalOrientation","direction","withAllowedModifierKeys","keys","withTypeAhead","debounceInterval","items","_getItemsArray","length","some","getLabel","unsubscribe","Typeahead","undefined","selectedItem","setActiveItem","cancelTypeahead","reset","withHomeAndEnd","withPageUpDown","previousActiveItem","updateActiveItem","next","onKeydown","event","keyCode","modifiers","isModifierAllowed","every","modifier","indexOf","TAB","DOWN_ARROW","setNextItemActive","UP_ARROW","setPreviousItemActive","RIGHT_ARROW","LEFT_ARROW","HOME","setFirstItemActive","END","setLastItemActive","PAGE_UP","targetIndex","_setActiveItemByIndex","PAGE_DOWN","itemsLength","hasModifierKey","handleKey","preventDefault","activeItemIndex","activeItem","isTyping","_setActiveItemByDelta","itemArray","index","set","setCurrentSelectedItemIndex","destroy","complete","_setActiveInWrapMode","_setActiveInDefaultMode","i","fallbackDelta","setItems","newIndex"],"mappings":";;;;;;MAwCaA,cAAc,CAAA;EAuBfC,MAAA;EAtBFC,gBAAgB,GAAGC,MAAM,CAAC,CAAC,CAAC;;WAAC;EAC7BC,WAAW,GAAGD,MAAM,CAAW,IAAI;;WAAC;AACpCE,EAAAA,KAAK,GAAG,KAAK;EACbC,sBAAsB,GAAGC,YAAY,CAACC,KAAK;EAC3CC,wBAAwB;AACxBC,EAAAA,SAAS,GAAG,IAAI;EAChBC,WAAW;AACXC,EAAAA,oBAAoB,GAAgC,EAAE;AACtDC,EAAAA,WAAW,GAAG,KAAK;AACnBC,EAAAA,cAAc,GAAG;AAACC,IAAAA,OAAO,EAAE,KAAK;AAAEC,IAAAA,KAAK,EAAE;GAAG;EAC5CC,UAAU;EACVC,UAAU;AAMVC,EAAAA,gBAAgB,GAAIC,IAAO,IAAKA,IAAI,CAACC,QAAQ;AAIrDC,EAAAA,WACUA,CAAArB,MAA8E,EACtFsB,QAAmB,EAAA;IADX,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A,IAAI,CAACxC,aAAa,CAACwC,KAAK,CAAC;AAC3B;AAGQhD,EAAAA,cAAcA,GAAA;AACpB,IAAA,IAAIpB,QAAQ,CAAC,IAAI,CAAC7B,MAAM,CAAC,EAAE;AACzB,MAAA,OAAO,IAAI,CAACA,MAAM,EAAE;AACtB;AAEA,IAAA,OAAO,IAAI,CAACA,MAAM,YAAYuB,SAAS,GAAG,IAAI,CAACvB,MAAM,CAAC4B,OAAO,EAAE,GAAG,IAAI,CAAC5B,MAAM;AAC/E;EAGQ2B,aAAaA,CAACD,QAA4B,EAAA;AAChD,IAAA,IAAI,CAACT,UAAU,EAAEyF,QAAQ,CAAChF,QAAQ,CAAC;AACnC,IAAA,MAAMmE,UAAU,GAAG,IAAI,CAAC1F,WAAW,EAAE;AACrC,IAAA,IAAI0F,UAAU,EAAE;AACd,MAAA,MAAMc,QAAQ,GAAGjF,QAAQ,CAAC8C,OAAO,CAACqB,UAAU,CAAC;AAE7C,MAAA,IAAIc,QAAQ,GAAG,CAAC,CAAC,IAAIA,QAAQ,KAAK,IAAI,CAAC1G,gBAAgB,EAAE,EAAE;AACzD,QAAA,IAAI,CAACA,gBAAgB,CAACiG,GAAG,CAACS,QAAQ,CAAC;AACnC,QAAA,IAAI,CAAC1F,UAAU,EAAEkF,2BAA2B,CAACQ,QAAQ,CAAC;AACxD;AACF;AACF;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"_list-key-manager-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/a11y/key-manager/list-key-manager.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.dev/license\n */\n\nimport {\n DOWN_ARROW,\n END,\n HOME,\n LEFT_ARROW,\n PAGE_DOWN,\n PAGE_UP,\n RIGHT_ARROW,\n TAB,\n UP_ARROW,\n hasModifierKey,\n} from '../../keycodes';\nimport {EffectRef, Injector, QueryList, Signal, effect, isSignal, signal} from '@angular/core';\nimport {Subject, Subscription} from 'rxjs';\nimport {Typeahead} from './typeahead';\n\n/** This interface is for items that can be passed to a ListKeyManager. */\nexport interface ListKeyManagerOption {\n /** Whether the option is disabled. */\n disabled?: boolean;\n\n /** Gets the label for this option. */\n getLabel?(): string;\n}\n\n/** Modifier keys handled by the ListKeyManager. */\nexport type ListKeyManagerModifierKey = 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey';\n\n/**\n * This class manages keyboard events for selectable lists. If you pass it a query list\n * of items, it will set the active item correctly when arrow events occur.\n */\nexport class ListKeyManager<T extends ListKeyManagerOption> {\n private _activeItemIndex = signal(-1);\n private _activeItem = signal<T | null>(null);\n private _wrap = false;\n private _typeaheadSubscription = Subscription.EMPTY;\n private _itemChangesSubscription?: Subscription;\n private _vertical = true;\n private _horizontal: 'ltr' | 'rtl' | null;\n private _allowedModifierKeys: ListKeyManagerModifierKey[] = [];\n private _homeAndEnd = false;\n private _pageUpAndDown = {enabled: false, delta: 10};\n private _effectRef: EffectRef | undefined;\n private _typeahead?: Typeahead<T>;\n\n /**\n * Predicate function that can be used to check whether an item should be skipped\n * by the key manager. By default, disabled items are skipped.\n */\n private _skipPredicateFn = (item: T) => item.disabled;\n\n constructor(items: QueryList<T> | T[] | readonly T[]);\n constructor(items: Signal<T[]> | Signal<readonly T[]>, injector: Injector);\n constructor(\n private _items: QueryList<T> | T[] | readonly T[] | Signal<T[]> | Signal<readonly T[]>,\n injector?: Injector,\n ) {\n // We allow for the items to be an array because, in some cases, the consumer may\n // not have access to a QueryList of the items they want to manage (e.g. when the\n // items aren't being collected via `ViewChildren` or `ContentChildren`).\n if (_items instanceof QueryList) {\n this._itemChangesSubscription = _items.changes.subscribe((newItems: QueryList<T>) =>\n this._itemsChanged(newItems.toArray()),\n );\n } else if (isSignal(_items)) {\n if (!injector && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw new Error('ListKeyManager constructed with a signal must receive an injector');\n }\n\n this._effectRef = effect(() => this._itemsChanged(_items()), {injector});\n }\n }\n\n /**\n * Stream that emits any time the TAB key is pressed, so components can react\n * when focus is shifted off of the list.\n */\n readonly tabOut = new Subject<void>();\n\n /** Stream that emits whenever the active item of the list manager changes. */\n readonly change = new Subject<number>();\n\n /**\n * Sets the predicate function that determines which items should be skipped by the\n * list key manager.\n * @param predicate Function that determines whether the given item should be skipped.\n */\n skipPredicate(predicate: (item: T) => boolean): this {\n this._skipPredicateFn = predicate;\n return this;\n }\n\n /**\n * Configures wrapping mode, which determines whether the active item will wrap to\n * the other end of list when there are no more items in the given direction.\n * @param shouldWrap Whether the list should wrap when reaching the end.\n */\n withWrap(shouldWrap = true): this {\n this._wrap = shouldWrap;\n return this;\n }\n\n /**\n * Configures whether the key manager should be able to move the selection vertically.\n * @param enabled Whether vertical selection should be enabled.\n */\n withVerticalOrientation(enabled: boolean = true): this {\n this._vertical = enabled;\n return this;\n }\n\n /**\n * Configures the key manager to move the selection horizontally.\n * Passing in `null` will disable horizontal movement.\n * @param direction Direction in which the selection can be moved.\n */\n withHorizontalOrientation(direction: 'ltr' | 'rtl' | null): this {\n this._horizontal = direction;\n return this;\n }\n\n /**\n * Modifier keys which are allowed to be held down and whose default actions will be prevented\n * as the user is pressing the arrow keys. Defaults to not allowing any modifier keys.\n */\n withAllowedModifierKeys(keys: ListKeyManagerModifierKey[]): this {\n this._allowedModifierKeys = keys;\n return this;\n }\n\n /**\n * Turns on typeahead mode which allows users to set the active item by typing.\n * @param debounceInterval Time to wait after the last keystroke before setting the active item.\n */\n withTypeAhead(debounceInterval: number = 200): this {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const items = this._getItemsArray();\n if (items.length > 0 && items.some(item => typeof item.getLabel !== 'function')) {\n throw Error('ListKeyManager items in typeahead mode must implement the `getLabel` method.');\n }\n }\n\n this._typeaheadSubscription.unsubscribe();\n\n const items = this._getItemsArray();\n this._typeahead = new Typeahead(items, {\n debounceInterval: typeof debounceInterval === 'number' ? debounceInterval : undefined,\n skipPredicate: item => this._skipPredicateFn(item),\n });\n\n this._typeaheadSubscription = this._typeahead.selectedItem.subscribe(item => {\n this.setActiveItem(item);\n });\n\n return this;\n }\n\n /** Cancels the current typeahead sequence. */\n cancelTypeahead(): this {\n this._typeahead?.reset();\n return this;\n }\n\n /**\n * Configures the key manager to activate the first and last items\n * respectively when the Home or End key is pressed.\n * @param enabled Whether pressing the Home or End key activates the first/last item.\n */\n withHomeAndEnd(enabled: boolean = true): this {\n this._homeAndEnd = enabled;\n return this;\n }\n\n /**\n * Configures the key manager to activate every 10th, configured or first/last element in up/down direction\n * respectively when the Page-Up or Page-Down key is pressed.\n * @param enabled Whether pressing the Page-Up or Page-Down key activates the first/last item.\n * @param delta Whether pressing the Home or End key activates the first/last item.\n */\n withPageUpDown(enabled: boolean = true, delta: number = 10): this {\n this._pageUpAndDown = {enabled, delta};\n return this;\n }\n\n /**\n * Sets the active item to the item at the index specified.\n * @param index The index of the item to be set as active.\n */\n setActiveItem(index: number): void;\n\n /**\n * Sets the active item to the specified item.\n * @param item The item to be set as active.\n */\n setActiveItem(item: T): void;\n\n /**\n * Sets the active item to the specified item.\n * @param item The item to be set as active.\n */\n setActiveItem(item: T | number): void;\n\n setActiveItem(item: any): void {\n const previousActiveItem = this._activeItem();\n\n this.updateActiveItem(item);\n\n if (this._activeItem() !== previousActiveItem) {\n this.change.next(this._activeItemIndex());\n }\n }\n\n /**\n * Sets the active item depending on the key event passed in.\n * @param event Keyboard event to be used for determining which element should be active.\n */\n onKeydown(event: KeyboardEvent): void {\n const keyCode = event.keyCode;\n const modifiers: ListKeyManagerModifierKey[] = ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'];\n const isModifierAllowed = modifiers.every(modifier => {\n return !event[modifier] || this._allowedModifierKeys.indexOf(modifier) > -1;\n });\n\n switch (keyCode) {\n case TAB:\n this.tabOut.next();\n return;\n\n case DOWN_ARROW:\n if (this._vertical && isModifierAllowed) {\n this.setNextItemActive();\n break;\n } else {\n return;\n }\n\n case UP_ARROW:\n if (this._vertical && isModifierAllowed) {\n this.setPreviousItemActive();\n break;\n } else {\n return;\n }\n\n case RIGHT_ARROW:\n if (this._horizontal && isModifierAllowed) {\n this._horizontal === 'rtl' ? this.setPreviousItemActive() : this.setNextItemActive();\n break;\n } else {\n return;\n }\n\n case LEFT_ARROW:\n if (this._horizontal && isModifierAllowed) {\n this._horizontal === 'rtl' ? this.setNextItemActive() : this.setPreviousItemActive();\n break;\n } else {\n return;\n }\n\n case HOME:\n if (this._homeAndEnd && isModifierAllowed) {\n this.setFirstItemActive();\n break;\n } else {\n return;\n }\n\n case END:\n if (this._homeAndEnd && isModifierAllowed) {\n this.setLastItemActive();\n break;\n } else {\n return;\n }\n\n case PAGE_UP:\n if (this._pageUpAndDown.enabled && isModifierAllowed) {\n const targetIndex = this._activeItemIndex() - this._pageUpAndDown.delta;\n this._setActiveItemByIndex(targetIndex > 0 ? targetIndex : 0, 1);\n break;\n } else {\n return;\n }\n\n case PAGE_DOWN:\n if (this._pageUpAndDown.enabled && isModifierAllowed) {\n const targetIndex = this._activeItemIndex() + this._pageUpAndDown.delta;\n const itemsLength = this._getItemsArray().length;\n this._setActiveItemByIndex(targetIndex < itemsLength ? targetIndex : itemsLength - 1, -1);\n break;\n } else {\n return;\n }\n\n default:\n if (isModifierAllowed || hasModifierKey(event, 'shiftKey')) {\n this._typeahead?.handleKey(event);\n }\n\n // Note that we return here, in order to avoid preventing\n // the default action of non-navigational keys.\n return;\n }\n\n this._typeahead?.reset();\n event.preventDefault();\n }\n\n /** Index of the currently active item. */\n get activeItemIndex(): number | null {\n return this._activeItemIndex();\n }\n\n /** The active item. */\n get activeItem(): T | null {\n return this._activeItem();\n }\n\n /** Gets whether the user is currently typing into the manager using the typeahead feature. */\n isTyping(): boolean {\n return !!this._typeahead && this._typeahead.isTyping();\n }\n\n /** Sets the active item to the first enabled item in the list. */\n setFirstItemActive(): void {\n this._setActiveItemByIndex(0, 1);\n }\n\n /** Sets the active item to the last enabled item in the list. */\n setLastItemActive(): void {\n this._setActiveItemByIndex(this._getItemsArray().length - 1, -1);\n }\n\n /** Sets the active item to the next enabled item in the list. */\n setNextItemActive(): void {\n this._activeItemIndex() < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);\n }\n\n /** Sets the active item to a previous enabled item in the list. */\n setPreviousItemActive(): void {\n this._activeItemIndex() < 0 && this._wrap\n ? this.setLastItemActive()\n : this._setActiveItemByDelta(-1);\n }\n\n /**\n * Allows setting the active without any other effects.\n * @param index Index of the item to be set as active.\n */\n updateActiveItem(index: number): void;\n\n /**\n * Allows setting the active item without any other effects.\n * @param item Item to be set as active.\n */\n updateActiveItem(item: T): void;\n\n updateActiveItem(item: any): void {\n const itemArray = this._getItemsArray();\n const index = typeof item === 'number' ? item : itemArray.indexOf(item);\n const activeItem = itemArray[index];\n\n // Explicitly check for `null` and `undefined` because other falsy values are valid.\n this._activeItem.set(activeItem == null ? null : activeItem);\n this._activeItemIndex.set(index);\n this._typeahead?.setCurrentSelectedItemIndex(index);\n }\n\n /** Cleans up the key manager. */\n destroy() {\n this._typeaheadSubscription.unsubscribe();\n this._itemChangesSubscription?.unsubscribe();\n this._effectRef?.destroy();\n this._typeahead?.destroy();\n this.tabOut.complete();\n this.change.complete();\n }\n\n /**\n * This method sets the active item, given a list of items and the delta between the\n * currently active item and the new active item. It will calculate differently\n * depending on whether wrap mode is turned on.\n */\n private _setActiveItemByDelta(delta: -1 | 1): void {\n this._wrap ? this._setActiveInWrapMode(delta) : this._setActiveInDefaultMode(delta);\n }\n\n /**\n * Sets the active item properly given \"wrap\" mode. In other words, it will continue to move\n * down the list until it finds an item that is not disabled, and it will wrap if it\n * encounters either end of the list.\n */\n private _setActiveInWrapMode(delta: -1 | 1): void {\n const items = this._getItemsArray();\n\n for (let i = 1; i <= items.length; i++) {\n const index = (this._activeItemIndex() + delta * i + items.length) % items.length;\n const item = items[index];\n\n if (!this._skipPredicateFn(item)) {\n this.setActiveItem(index);\n return;\n }\n }\n }\n\n /**\n * Sets the active item properly given the default mode. In other words, it will\n * continue to move down the list until it finds an item that is not disabled. If\n * it encounters either end of the list, it will stop and not wrap.\n */\n private _setActiveInDefaultMode(delta: -1 | 1): void {\n this._setActiveItemByIndex(this._activeItemIndex() + delta, delta);\n }\n\n /**\n * Sets the active item to the first enabled item starting at the index specified. If the\n * item is disabled, it will move in the fallbackDelta direction until it either\n * finds an enabled item or encounters the end of the list.\n */\n private _setActiveItemByIndex(index: number, fallbackDelta: -1 | 1): void {\n const items = this._getItemsArray();\n\n if (!items[index]) {\n return;\n }\n\n while (this._skipPredicateFn(items[index])) {\n index += fallbackDelta;\n\n if (!items[index]) {\n return;\n }\n }\n\n this.setActiveItem(index);\n }\n\n /** Returns the items as an array. */\n private _getItemsArray(): T[] | readonly T[] {\n if (isSignal(this._items)) {\n return this._items();\n }\n\n return this._items instanceof QueryList ? this._items.toArray() : this._items;\n }\n\n /** Callback for when the items have changed. */\n private _itemsChanged(newItems: T[] | readonly T[]) {\n this._typeahead?.setItems(newItems);\n const activeItem = this._activeItem();\n if (activeItem) {\n const newIndex = newItems.indexOf(activeItem);\n\n if (newIndex > -1 && newIndex !== this._activeItemIndex()) {\n this._activeItemIndex.set(newIndex);\n this._typeahead?.setCurrentSelectedItemIndex(newIndex);\n }\n }\n }\n}\n"],"names":["ListKeyManager","_items","_activeItemIndex","signal","_activeItem","_wrap","_typeaheadSubscription","Subscription","EMPTY","_itemChangesSubscription","_vertical","_horizontal","_allowedModifierKeys","_homeAndEnd","_pageUpAndDown","enabled","delta","_effectRef","_typeahead","_skipPredicateFn","item","disabled","constructor","injector","QueryList","changes","subscribe","newItems","_itemsChanged","toArray","isSignal","ngDevMode","Error","effect","debugName","tabOut","Subject","change","skipPredicate","predicate","withWrap","shouldWrap","withVerticalOrientation","withHorizontalOrientation","direction","withAllowedModifierKeys","keys","withTypeAhead","debounceInterval","items","_getItemsArray","length","some","getLabel","unsubscribe","Typeahead","undefined","selectedItem","setActiveItem","cancelTypeahead","reset","withHomeAndEnd","withPageUpDown","previousActiveItem","updateActiveItem","next","onKeydown","event","keyCode","modifiers","isModifierAllowed","every","modifier","indexOf","TAB","DOWN_ARROW","setNextItemActive","UP_ARROW","setPreviousItemActive","RIGHT_ARROW","LEFT_ARROW","HOME","setFirstItemActive","END","setLastItemActive","PAGE_UP","targetIndex","_setActiveItemByIndex","PAGE_DOWN","itemsLength","hasModifierKey","handleKey","preventDefault","activeItemIndex","activeItem","isTyping","_setActiveItemByDelta","itemArray","index","set","setCurrentSelectedItemIndex","destroy","complete","_setActiveInWrapMode","_setActiveInDefaultMode","i","fallbackDelta","setItems","newIndex"],"mappings":";;;;;;MAwCaA,cAAc,CAAA;EAuBfC,MAAA;EAtBFC,gBAAgB,GAAGC,MAAM,CAAC,CAAC,CAAC;;WAAC;EAC7BC,WAAW,GAAGD,MAAM,CAAW,IAAI;;WAAC;AACpCE,EAAAA,KAAK,GAAG,KAAK;EACbC,sBAAsB,GAAGC,YAAY,CAACC,KAAK;EAC3CC,wBAAwB;AACxBC,EAAAA,SAAS,GAAG,IAAI;EAChBC,WAAW;AACXC,EAAAA,oBAAoB,GAAgC,EAAE;AACtDC,EAAAA,WAAW,GAAG,KAAK;AACnBC,EAAAA,cAAc,GAAG;AAACC,IAAAA,OAAO,EAAE,KAAK;AAAEC,IAAAA,KAAK,EAAE;GAAG;EAC5CC,UAAU;EACVC,UAAU;AAMVC,EAAAA,gBAAgB,GAAIC,IAAO,IAAKA,IAAI,CAACC,QAAQ;AAIrDC,EAAAA,WACUA,CAAArB,MAA8E,EACtFsB,QAAmB,EAAA;IADX,IAAM,CAAAtB,MAAA,GAANA,MAAM;IAMd,IAAIA,MAAM,YAAYuB,SAAS,EAAE;MAC/B,IAAI,CAACf,wBAAwB,GAAGR,MAAM,CAACwB,OAAO,CAACC,SAAS,CAAEC,QAAsB,IAC9E,IAAI,CAACC,aAAa,CAACD,QAAQ,CAACE,OAAO,EAAE,CAAC,CAC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ACA,MAAM,YAAYuB,SAAS,GAAG,IAAI,CAACvB,MAAM,CAAC4B,OAAO,EAAE,GAAG,IAAI,CAAC5B,MAAM;AAC/E;EAGQ2B,aAAaA,CAACD,QAA4B,EAAA;AAChD,IAAA,IAAI,CAACT,UAAU,EAAEyF,QAAQ,CAAChF,QAAQ,CAAC;AACnC,IAAA,MAAMmE,UAAU,GAAG,IAAI,CAAC1F,WAAW,EAAE;AACrC,IAAA,IAAI0F,UAAU,EAAE;AACd,MAAA,MAAMc,QAAQ,GAAGjF,QAAQ,CAAC8C,OAAO,CAACqB,UAAU,CAAC;AAE7C,MAAA,IAAIc,QAAQ,GAAG,CAAC,CAAC,IAAIA,QAAQ,KAAK,IAAI,CAAC1G,gBAAgB,EAAE,EAAE;AACzD,QAAA,IAAI,CAACA,gBAAgB,CAACiG,GAAG,CAACS,QAAQ,CAAC;AACnC,QAAA,IAAI,CAAC1F,UAAU,EAAEkF,2BAA2B,CAACQ,QAAQ,CAAC;AACxD;AACF;AACF;AACD;;;;"}
|
|
@@ -724,6 +724,7 @@ class OverlayRef {
|
|
|
724
724
|
_backdropRef = null;
|
|
725
725
|
_detachContentMutationObserver;
|
|
726
726
|
_detachContentAfterRenderRef;
|
|
727
|
+
_disposed;
|
|
727
728
|
_previousHostParent;
|
|
728
729
|
_keydownEvents = new Subject();
|
|
729
730
|
_outsidePointerEvents = new Subject();
|
|
@@ -757,6 +758,9 @@ class OverlayRef {
|
|
|
757
758
|
return this._host;
|
|
758
759
|
}
|
|
759
760
|
attach(portal) {
|
|
761
|
+
if (this._disposed) {
|
|
762
|
+
return null;
|
|
763
|
+
}
|
|
760
764
|
this._attachHost();
|
|
761
765
|
const attachResult = this._portalOutlet.attach(portal);
|
|
762
766
|
this._positionStrategy?.attach(this);
|
|
@@ -819,6 +823,9 @@ class OverlayRef {
|
|
|
819
823
|
return detachmentResult;
|
|
820
824
|
}
|
|
821
825
|
dispose() {
|
|
826
|
+
if (this._disposed) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
822
829
|
const isAttached = this.hasAttached();
|
|
823
830
|
if (this._positionStrategy) {
|
|
824
831
|
this._positionStrategy.dispose();
|
|
@@ -841,6 +848,7 @@ class OverlayRef {
|
|
|
841
848
|
}
|
|
842
849
|
this._detachments.complete();
|
|
843
850
|
this._completeDetachContent();
|
|
851
|
+
this._disposed = true;
|
|
844
852
|
}
|
|
845
853
|
hasAttached() {
|
|
846
854
|
return this._portalOutlet.hasAttached();
|