@angular/cdk 21.0.3 → 21.0.6

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.
Files changed (44) hide show
  1. package/LICENSE +1 -1
  2. package/fesm2022/_a11y-module-chunk.mjs +22 -22
  3. package/fesm2022/_breakpoints-observer-chunk.mjs +6 -6
  4. package/fesm2022/_directionality-chunk.mjs +3 -3
  5. package/fesm2022/_focus-monitor-chunk.mjs +9 -9
  6. package/fesm2022/_id-generator-chunk.mjs +3 -3
  7. package/fesm2022/_list-key-manager-chunk.mjs +5 -5
  8. package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
  9. package/fesm2022/_overlay-module-chunk.mjs +49 -38
  10. package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
  11. package/fesm2022/_platform-chunk.mjs +3 -3
  12. package/fesm2022/_style-loader-chunk.mjs +3 -3
  13. package/fesm2022/_unique-selection-dispatcher-chunk.mjs +3 -3
  14. package/fesm2022/_visually-hidden-chunk.mjs +3 -3
  15. package/fesm2022/a11y.mjs +9 -9
  16. package/fesm2022/accordion.mjs +10 -10
  17. package/fesm2022/bidi.mjs +7 -7
  18. package/fesm2022/cdk.mjs +1 -1
  19. package/fesm2022/cdk.mjs.map +1 -1
  20. package/fesm2022/clipboard.mjs +10 -10
  21. package/fesm2022/dialog.mjs +10 -10
  22. package/fesm2022/drag-drop.mjs +269 -266
  23. package/fesm2022/drag-drop.mjs.map +1 -1
  24. package/fesm2022/layout.mjs +4 -4
  25. package/fesm2022/listbox.mjs +10 -10
  26. package/fesm2022/menu.mjs +49 -49
  27. package/fesm2022/observers-private.mjs +3 -3
  28. package/fesm2022/observers.mjs +13 -13
  29. package/fesm2022/overlay.mjs +3 -3
  30. package/fesm2022/platform.mjs +4 -4
  31. package/fesm2022/portal.mjs +10 -10
  32. package/fesm2022/scrolling.mjs +40 -40
  33. package/fesm2022/scrolling.mjs.map +1 -1
  34. package/fesm2022/stepper.mjs +22 -22
  35. package/fesm2022/table.mjs +73 -73
  36. package/fesm2022/testing-testbed.mjs +7 -1
  37. package/fesm2022/testing-testbed.mjs.map +1 -1
  38. package/fesm2022/text-field.mjs +16 -16
  39. package/fesm2022/tree.mjs +25 -25
  40. package/package.json +1 -1
  41. package/schematics/ng-add/index.js +1 -1
  42. package/types/_overlay-module-chunk.d.ts +2 -0
  43. package/types/drag-drop.d.ts +23 -7
  44. package/types/testing-testbed.d.ts +3 -0
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2025 Google LLC.
3
+ Copyright (c) 2026 Google LLC.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -66,7 +66,7 @@ class InteractivityChecker {
66
66
  }
67
67
  static ɵfac = i0.ɵɵngDeclareFactory({
68
68
  minVersion: "12.0.0",
69
- version: "21.0.0",
69
+ version: "21.0.3",
70
70
  ngImport: i0,
71
71
  type: InteractivityChecker,
72
72
  deps: [],
@@ -74,7 +74,7 @@ class InteractivityChecker {
74
74
  });
75
75
  static ɵprov = i0.ɵɵngDeclareInjectable({
76
76
  minVersion: "12.0.0",
77
- version: "21.0.0",
77
+ version: "21.0.3",
78
78
  ngImport: i0,
79
79
  type: InteractivityChecker,
80
80
  providedIn: 'root'
@@ -82,7 +82,7 @@ class InteractivityChecker {
82
82
  }
83
83
  i0.ɵɵngDeclareClassMetadata({
84
84
  minVersion: "12.0.0",
85
- version: "21.0.0",
85
+ version: "21.0.3",
86
86
  ngImport: i0,
87
87
  type: InteractivityChecker,
88
88
  decorators: [{
@@ -348,7 +348,7 @@ class FocusTrapFactory {
348
348
  }
349
349
  static ɵfac = i0.ɵɵngDeclareFactory({
350
350
  minVersion: "12.0.0",
351
- version: "21.0.0",
351
+ version: "21.0.3",
352
352
  ngImport: i0,
353
353
  type: FocusTrapFactory,
354
354
  deps: [],
@@ -356,7 +356,7 @@ class FocusTrapFactory {
356
356
  });
357
357
  static ɵprov = i0.ɵɵngDeclareInjectable({
358
358
  minVersion: "12.0.0",
359
- version: "21.0.0",
359
+ version: "21.0.3",
360
360
  ngImport: i0,
361
361
  type: FocusTrapFactory,
362
362
  providedIn: 'root'
@@ -364,7 +364,7 @@ class FocusTrapFactory {
364
364
  }
365
365
  i0.ɵɵngDeclareClassMetadata({
366
366
  minVersion: "12.0.0",
367
- version: "21.0.0",
367
+ version: "21.0.3",
368
368
  ngImport: i0,
369
369
  type: FocusTrapFactory,
370
370
  decorators: [{
@@ -425,7 +425,7 @@ class CdkTrapFocus {
425
425
  }
426
426
  static ɵfac = i0.ɵɵngDeclareFactory({
427
427
  minVersion: "12.0.0",
428
- version: "21.0.0",
428
+ version: "21.0.3",
429
429
  ngImport: i0,
430
430
  type: CdkTrapFocus,
431
431
  deps: [],
@@ -433,7 +433,7 @@ class CdkTrapFocus {
433
433
  });
434
434
  static ɵdir = i0.ɵɵngDeclareDirective({
435
435
  minVersion: "16.1.0",
436
- version: "21.0.0",
436
+ version: "21.0.3",
437
437
  type: CdkTrapFocus,
438
438
  isStandalone: true,
439
439
  selector: "[cdkTrapFocus]",
@@ -448,7 +448,7 @@ class CdkTrapFocus {
448
448
  }
449
449
  i0.ɵɵngDeclareClassMetadata({
450
450
  minVersion: "12.0.0",
451
- version: "21.0.0",
451
+ version: "21.0.3",
452
452
  ngImport: i0,
453
453
  type: CdkTrapFocus,
454
454
  decorators: [{
@@ -578,7 +578,7 @@ class LiveAnnouncer {
578
578
  }
579
579
  static ɵfac = i0.ɵɵngDeclareFactory({
580
580
  minVersion: "12.0.0",
581
- version: "21.0.0",
581
+ version: "21.0.3",
582
582
  ngImport: i0,
583
583
  type: LiveAnnouncer,
584
584
  deps: [],
@@ -586,7 +586,7 @@ class LiveAnnouncer {
586
586
  });
587
587
  static ɵprov = i0.ɵɵngDeclareInjectable({
588
588
  minVersion: "12.0.0",
589
- version: "21.0.0",
589
+ version: "21.0.3",
590
590
  ngImport: i0,
591
591
  type: LiveAnnouncer,
592
592
  providedIn: 'root'
@@ -594,7 +594,7 @@ class LiveAnnouncer {
594
594
  }
595
595
  i0.ɵɵngDeclareClassMetadata({
596
596
  minVersion: "12.0.0",
597
- version: "21.0.0",
597
+ version: "21.0.3",
598
598
  ngImport: i0,
599
599
  type: LiveAnnouncer,
600
600
  decorators: [{
@@ -646,7 +646,7 @@ class CdkAriaLive {
646
646
  }
647
647
  static ɵfac = i0.ɵɵngDeclareFactory({
648
648
  minVersion: "12.0.0",
649
- version: "21.0.0",
649
+ version: "21.0.3",
650
650
  ngImport: i0,
651
651
  type: CdkAriaLive,
652
652
  deps: [],
@@ -654,7 +654,7 @@ class CdkAriaLive {
654
654
  });
655
655
  static ɵdir = i0.ɵɵngDeclareDirective({
656
656
  minVersion: "14.0.0",
657
- version: "21.0.0",
657
+ version: "21.0.3",
658
658
  type: CdkAriaLive,
659
659
  isStandalone: true,
660
660
  selector: "[cdkAriaLive]",
@@ -668,7 +668,7 @@ class CdkAriaLive {
668
668
  }
669
669
  i0.ɵɵngDeclareClassMetadata({
670
670
  minVersion: "12.0.0",
671
- version: "21.0.0",
671
+ version: "21.0.3",
672
672
  ngImport: i0,
673
673
  type: CdkAriaLive,
674
674
  decorators: [{
@@ -754,7 +754,7 @@ class HighContrastModeDetector {
754
754
  }
755
755
  static ɵfac = i0.ɵɵngDeclareFactory({
756
756
  minVersion: "12.0.0",
757
- version: "21.0.0",
757
+ version: "21.0.3",
758
758
  ngImport: i0,
759
759
  type: HighContrastModeDetector,
760
760
  deps: [],
@@ -762,7 +762,7 @@ class HighContrastModeDetector {
762
762
  });
763
763
  static ɵprov = i0.ɵɵngDeclareInjectable({
764
764
  minVersion: "12.0.0",
765
- version: "21.0.0",
765
+ version: "21.0.3",
766
766
  ngImport: i0,
767
767
  type: HighContrastModeDetector,
768
768
  providedIn: 'root'
@@ -770,7 +770,7 @@ class HighContrastModeDetector {
770
770
  }
771
771
  i0.ɵɵngDeclareClassMetadata({
772
772
  minVersion: "12.0.0",
773
- version: "21.0.0",
773
+ version: "21.0.3",
774
774
  ngImport: i0,
775
775
  type: HighContrastModeDetector,
776
776
  decorators: [{
@@ -788,7 +788,7 @@ class A11yModule {
788
788
  }
789
789
  static ɵfac = i0.ɵɵngDeclareFactory({
790
790
  minVersion: "12.0.0",
791
- version: "21.0.0",
791
+ version: "21.0.3",
792
792
  ngImport: i0,
793
793
  type: A11yModule,
794
794
  deps: [],
@@ -796,7 +796,7 @@ class A11yModule {
796
796
  });
797
797
  static ɵmod = i0.ɵɵngDeclareNgModule({
798
798
  minVersion: "14.0.0",
799
- version: "21.0.0",
799
+ version: "21.0.3",
800
800
  ngImport: i0,
801
801
  type: A11yModule,
802
802
  imports: [ObserversModule, CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
@@ -804,7 +804,7 @@ class A11yModule {
804
804
  });
805
805
  static ɵinj = i0.ɵɵngDeclareInjector({
806
806
  minVersion: "12.0.0",
807
- version: "21.0.0",
807
+ version: "21.0.3",
808
808
  ngImport: i0,
809
809
  type: A11yModule,
810
810
  imports: [ObserversModule]
@@ -812,7 +812,7 @@ class A11yModule {
812
812
  }
813
813
  i0.ɵɵngDeclareClassMetadata({
814
814
  minVersion: "12.0.0",
815
- version: "21.0.0",
815
+ version: "21.0.3",
816
816
  ngImport: i0,
817
817
  type: A11yModule,
818
818
  decorators: [{
@@ -24,7 +24,7 @@ class MediaMatcher {
24
24
  }
25
25
  static ɵfac = i0.ɵɵngDeclareFactory({
26
26
  minVersion: "12.0.0",
27
- version: "21.0.0",
27
+ version: "21.0.3",
28
28
  ngImport: i0,
29
29
  type: MediaMatcher,
30
30
  deps: [],
@@ -32,7 +32,7 @@ class MediaMatcher {
32
32
  });
33
33
  static ɵprov = i0.ɵɵngDeclareInjectable({
34
34
  minVersion: "12.0.0",
35
- version: "21.0.0",
35
+ version: "21.0.3",
36
36
  ngImport: i0,
37
37
  type: MediaMatcher,
38
38
  providedIn: 'root'
@@ -40,7 +40,7 @@ class MediaMatcher {
40
40
  }
41
41
  i0.ɵɵngDeclareClassMetadata({
42
42
  minVersion: "12.0.0",
43
- version: "21.0.0",
43
+ version: "21.0.3",
44
44
  ngImport: i0,
45
45
  type: MediaMatcher,
46
46
  decorators: [{
@@ -141,7 +141,7 @@ class BreakpointObserver {
141
141
  }
142
142
  static ɵfac = i0.ɵɵngDeclareFactory({
143
143
  minVersion: "12.0.0",
144
- version: "21.0.0",
144
+ version: "21.0.3",
145
145
  ngImport: i0,
146
146
  type: BreakpointObserver,
147
147
  deps: [],
@@ -149,7 +149,7 @@ class BreakpointObserver {
149
149
  });
150
150
  static ɵprov = i0.ɵɵngDeclareInjectable({
151
151
  minVersion: "12.0.0",
152
- version: "21.0.0",
152
+ version: "21.0.3",
153
153
  ngImport: i0,
154
154
  type: BreakpointObserver,
155
155
  providedIn: 'root'
@@ -157,7 +157,7 @@ class BreakpointObserver {
157
157
  }
158
158
  i0.ɵɵngDeclareClassMetadata({
159
159
  minVersion: "12.0.0",
160
- version: "21.0.0",
160
+ version: "21.0.3",
161
161
  ngImport: i0,
162
162
  type: BreakpointObserver,
163
163
  decorators: [{
@@ -37,7 +37,7 @@ class Directionality {
37
37
  }
38
38
  static ɵfac = i0.ɵɵngDeclareFactory({
39
39
  minVersion: "12.0.0",
40
- version: "21.0.0",
40
+ version: "21.0.3",
41
41
  ngImport: i0,
42
42
  type: Directionality,
43
43
  deps: [],
@@ -45,7 +45,7 @@ class Directionality {
45
45
  });
46
46
  static ɵprov = i0.ɵɵngDeclareInjectable({
47
47
  minVersion: "12.0.0",
48
- version: "21.0.0",
48
+ version: "21.0.3",
49
49
  ngImport: i0,
50
50
  type: Directionality,
51
51
  providedIn: 'root'
@@ -53,7 +53,7 @@ class Directionality {
53
53
  }
54
54
  i0.ɵɵngDeclareClassMetadata({
55
55
  minVersion: "12.0.0",
56
- version: "21.0.0",
56
+ version: "21.0.3",
57
57
  ngImport: i0,
58
58
  type: Directionality,
59
59
  decorators: [{
@@ -78,7 +78,7 @@ class InputModalityDetector {
78
78
  }
79
79
  static ɵfac = i0.ɵɵngDeclareFactory({
80
80
  minVersion: "12.0.0",
81
- version: "21.0.0",
81
+ version: "21.0.3",
82
82
  ngImport: i0,
83
83
  type: InputModalityDetector,
84
84
  deps: [],
@@ -86,7 +86,7 @@ class InputModalityDetector {
86
86
  });
87
87
  static ɵprov = i0.ɵɵngDeclareInjectable({
88
88
  minVersion: "12.0.0",
89
- version: "21.0.0",
89
+ version: "21.0.3",
90
90
  ngImport: i0,
91
91
  type: InputModalityDetector,
92
92
  providedIn: 'root'
@@ -94,7 +94,7 @@ class InputModalityDetector {
94
94
  }
95
95
  i0.ɵɵngDeclareClassMetadata({
96
96
  minVersion: "12.0.0",
97
- version: "21.0.0",
97
+ version: "21.0.3",
98
98
  ngImport: i0,
99
99
  type: InputModalityDetector,
100
100
  decorators: [{
@@ -337,7 +337,7 @@ class FocusMonitor {
337
337
  }
338
338
  static ɵfac = i0.ɵɵngDeclareFactory({
339
339
  minVersion: "12.0.0",
340
- version: "21.0.0",
340
+ version: "21.0.3",
341
341
  ngImport: i0,
342
342
  type: FocusMonitor,
343
343
  deps: [],
@@ -345,7 +345,7 @@ class FocusMonitor {
345
345
  });
346
346
  static ɵprov = i0.ɵɵngDeclareInjectable({
347
347
  minVersion: "12.0.0",
348
- version: "21.0.0",
348
+ version: "21.0.3",
349
349
  ngImport: i0,
350
350
  type: FocusMonitor,
351
351
  providedIn: 'root'
@@ -353,7 +353,7 @@ class FocusMonitor {
353
353
  }
354
354
  i0.ɵɵngDeclareClassMetadata({
355
355
  minVersion: "12.0.0",
356
- version: "21.0.0",
356
+ version: "21.0.3",
357
357
  ngImport: i0,
358
358
  type: FocusMonitor,
359
359
  decorators: [{
@@ -389,7 +389,7 @@ class CdkMonitorFocus {
389
389
  }
390
390
  static ɵfac = i0.ɵɵngDeclareFactory({
391
391
  minVersion: "12.0.0",
392
- version: "21.0.0",
392
+ version: "21.0.3",
393
393
  ngImport: i0,
394
394
  type: CdkMonitorFocus,
395
395
  deps: [],
@@ -397,7 +397,7 @@ class CdkMonitorFocus {
397
397
  });
398
398
  static ɵdir = i0.ɵɵngDeclareDirective({
399
399
  minVersion: "14.0.0",
400
- version: "21.0.0",
400
+ version: "21.0.3",
401
401
  type: CdkMonitorFocus,
402
402
  isStandalone: true,
403
403
  selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]",
@@ -410,7 +410,7 @@ class CdkMonitorFocus {
410
410
  }
411
411
  i0.ɵɵngDeclareClassMetadata({
412
412
  minVersion: "12.0.0",
413
- version: "21.0.0",
413
+ version: "21.0.3",
414
414
  ngImport: i0,
415
415
  type: CdkMonitorFocus,
416
416
  decorators: [{
@@ -16,7 +16,7 @@ class _IdGenerator {
16
16
  }
17
17
  static ɵfac = i0.ɵɵngDeclareFactory({
18
18
  minVersion: "12.0.0",
19
- version: "21.0.0",
19
+ version: "21.0.3",
20
20
  ngImport: i0,
21
21
  type: _IdGenerator,
22
22
  deps: [],
@@ -24,7 +24,7 @@ class _IdGenerator {
24
24
  });
25
25
  static ɵprov = i0.ɵɵngDeclareInjectable({
26
26
  minVersion: "12.0.0",
27
- version: "21.0.0",
27
+ version: "21.0.3",
28
28
  ngImport: i0,
29
29
  type: _IdGenerator,
30
30
  providedIn: 'root'
@@ -32,7 +32,7 @@ class _IdGenerator {
32
32
  }
33
33
  i0.ɵɵngDeclareClassMetadata({
34
34
  minVersion: "12.0.0",
35
- version: "21.0.0",
35
+ version: "21.0.3",
36
36
  ngImport: i0,
37
37
  type: _IdGenerator,
38
38
  decorators: [{
@@ -34,12 +34,12 @@ class ListKeyManager {
34
34
  if (!injector && (typeof ngDevMode === 'undefined' || ngDevMode)) {
35
35
  throw new Error('ListKeyManager constructed with a signal must receive an injector');
36
36
  }
37
- this._effectRef = effect(() => this._itemsChanged(_items()), ...(ngDevMode ? [{
38
- debugName: "_effectRef",
37
+ this._effectRef = effect(() => this._itemsChanged(_items()), {
38
+ ...(ngDevMode ? {
39
+ debugName: "_effectRef"
40
+ } : {}),
39
41
  injector
40
- }] : [{
41
- injector
42
- }]));
42
+ });
43
43
  }
44
44
  }
45
45
  tabOut = new Subject();
@@ -1 +1 @@
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,EAA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-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,EA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