@angular/cdk 20.0.0-next.0 → 20.0.0-next.2

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 (181) hide show
  1. package/a11y/index.d.ts +330 -1234
  2. package/a11y-module.d-7d03e079.d.ts +313 -0
  3. package/accordion/index.d.ts +8 -27
  4. package/activedescendant-key-manager.d-11921e3a.d.ts +31 -0
  5. package/bidi/index.d.ts +3 -62
  6. package/bidi-module.d-f8648621.d.ts +53 -0
  7. package/clipboard/index.d.ts +61 -75
  8. package/coercion/index.d.ts +10 -33
  9. package/coercion/private/index.d.ts +2 -2
  10. package/collections/index.d.ts +13 -291
  11. package/data-source.d-7cab2c9d.d.ts +42 -0
  12. package/dialog/index.d.ts +204 -249
  13. package/drag-drop/index.d.ts +1077 -1157
  14. package/fesm2022/a11y-module-e6996d20.mjs +952 -0
  15. package/fesm2022/a11y-module-e6996d20.mjs.map +1 -0
  16. package/fesm2022/a11y.mjs +47 -2445
  17. package/fesm2022/a11y.mjs.map +1 -1
  18. package/fesm2022/accordion.mjs +12 -16
  19. package/fesm2022/accordion.mjs.map +1 -1
  20. package/fesm2022/activedescendant-key-manager-1351a9d3.mjs +16 -0
  21. package/fesm2022/activedescendant-key-manager-1351a9d3.mjs.map +1 -0
  22. package/fesm2022/array-ee3b4bab.mjs +6 -0
  23. package/fesm2022/array-ee3b4bab.mjs.map +1 -0
  24. package/fesm2022/backwards-compatibility-bcbe473e.mjs +25 -0
  25. package/fesm2022/backwards-compatibility-bcbe473e.mjs.map +1 -0
  26. package/fesm2022/bidi-module-0726b65c.mjs +78 -0
  27. package/fesm2022/bidi-module-0726b65c.mjs.map +1 -0
  28. package/fesm2022/bidi.mjs +4 -143
  29. package/fesm2022/bidi.mjs.map +1 -1
  30. package/fesm2022/breakpoints-observer-d4584b66.mjs +179 -0
  31. package/fesm2022/breakpoints-observer-d4584b66.mjs.map +1 -0
  32. package/fesm2022/cdk.mjs +1 -1
  33. package/fesm2022/cdk.mjs.map +1 -1
  34. package/fesm2022/clipboard.mjs +10 -14
  35. package/fesm2022/clipboard.mjs.map +1 -1
  36. package/fesm2022/coercion/private.mjs +2 -18
  37. package/fesm2022/coercion/private.mjs.map +1 -1
  38. package/fesm2022/coercion.mjs +5 -39
  39. package/fesm2022/coercion.mjs.map +1 -1
  40. package/fesm2022/collections.mjs +7 -476
  41. package/fesm2022/collections.mjs.map +1 -1
  42. package/fesm2022/css-pixel-value-286c9a60.mjs +10 -0
  43. package/fesm2022/css-pixel-value-286c9a60.mjs.map +1 -0
  44. package/fesm2022/data-source-5320b6fd.mjs +15 -0
  45. package/fesm2022/data-source-5320b6fd.mjs.map +1 -0
  46. package/fesm2022/dialog.mjs +37 -39
  47. package/fesm2022/dialog.mjs.map +1 -1
  48. package/fesm2022/directionality-7ea26429.mjs +72 -0
  49. package/fesm2022/directionality-7ea26429.mjs.map +1 -0
  50. package/fesm2022/dispose-view-repeater-strategy-b11b87ea.mjs +44 -0
  51. package/fesm2022/dispose-view-repeater-strategy-b11b87ea.mjs.map +1 -0
  52. package/fesm2022/drag-drop.mjs +48 -50
  53. package/fesm2022/drag-drop.mjs.map +1 -1
  54. package/fesm2022/element-705567fe.mjs +29 -0
  55. package/fesm2022/element-705567fe.mjs.map +1 -0
  56. package/fesm2022/fake-event-detection-7055b1bd.mjs +24 -0
  57. package/fesm2022/fake-event-detection-7055b1bd.mjs.map +1 -0
  58. package/fesm2022/focus-key-manager-58d29acd.mjs +22 -0
  59. package/fesm2022/focus-key-manager-58d29acd.mjs.map +1 -0
  60. package/fesm2022/focus-monitor-cebaa0d1.mjs +629 -0
  61. package/fesm2022/focus-monitor-cebaa0d1.mjs.map +1 -0
  62. package/fesm2022/id-generator-fba495fb.mjs +37 -0
  63. package/fesm2022/id-generator-fba495fb.mjs.map +1 -0
  64. package/fesm2022/keycodes-107cd3e4.mjs +122 -0
  65. package/fesm2022/keycodes-107cd3e4.mjs.map +1 -0
  66. package/fesm2022/keycodes.mjs +2 -136
  67. package/fesm2022/keycodes.mjs.map +1 -1
  68. package/fesm2022/layout.mjs +12 -184
  69. package/fesm2022/layout.mjs.map +1 -1
  70. package/fesm2022/list-key-manager-c7b5cefb.mjs +360 -0
  71. package/fesm2022/list-key-manager-c7b5cefb.mjs.map +1 -0
  72. package/fesm2022/listbox.mjs +21 -20
  73. package/fesm2022/listbox.mjs.map +1 -1
  74. package/fesm2022/menu.mjs +76 -60
  75. package/fesm2022/menu.mjs.map +1 -1
  76. package/fesm2022/modifiers-33a5859e.mjs +13 -0
  77. package/fesm2022/modifiers-33a5859e.mjs.map +1 -0
  78. package/fesm2022/observable-97c0792c.mjs +15 -0
  79. package/fesm2022/observable-97c0792c.mjs.map +1 -0
  80. package/fesm2022/observe-content-d2a6b5a0.mjs +210 -0
  81. package/fesm2022/observe-content-d2a6b5a0.mjs.map +1 -0
  82. package/fesm2022/observers/private.mjs +3 -7
  83. package/fesm2022/observers/private.mjs.map +1 -1
  84. package/fesm2022/observers.mjs +5 -213
  85. package/fesm2022/observers.mjs.map +1 -1
  86. package/fesm2022/overlay-module-863b82c9.mjs +3029 -0
  87. package/fesm2022/overlay-module-863b82c9.mjs.map +1 -0
  88. package/fesm2022/overlay.mjs +28 -3019
  89. package/fesm2022/overlay.mjs.map +1 -1
  90. package/fesm2022/passive-listeners-c0bdc49f.mjs +31 -0
  91. package/fesm2022/passive-listeners-c0bdc49f.mjs.map +1 -0
  92. package/fesm2022/platform-1be098b0.mjs +77 -0
  93. package/fesm2022/platform-1be098b0.mjs.map +1 -0
  94. package/fesm2022/platform.mjs +13 -293
  95. package/fesm2022/platform.mjs.map +1 -1
  96. package/fesm2022/portal-directives-c88fea11.mjs +615 -0
  97. package/fesm2022/portal-directives-c88fea11.mjs.map +1 -0
  98. package/fesm2022/portal.mjs +3 -650
  99. package/fesm2022/portal.mjs.map +1 -1
  100. package/fesm2022/private.mjs +3 -63
  101. package/fesm2022/private.mjs.map +1 -1
  102. package/fesm2022/recycle-view-repeater-strategy-c1712813.mjs +156 -0
  103. package/fesm2022/recycle-view-repeater-strategy-c1712813.mjs.map +1 -0
  104. package/fesm2022/scrolling-61955dd1.mjs +99 -0
  105. package/fesm2022/scrolling-61955dd1.mjs.map +1 -0
  106. package/fesm2022/scrolling-module-aa9eeac5.mjs +1463 -0
  107. package/fesm2022/scrolling-module-aa9eeac5.mjs.map +1 -0
  108. package/fesm2022/scrolling.mjs +12 -1463
  109. package/fesm2022/scrolling.mjs.map +1 -1
  110. package/fesm2022/selection-model-30243dba.mjs +221 -0
  111. package/fesm2022/selection-model-30243dba.mjs.map +1 -0
  112. package/fesm2022/shadow-dom-9f403d00.mjs +49 -0
  113. package/fesm2022/shadow-dom-9f403d00.mjs.map +1 -0
  114. package/fesm2022/stepper.mjs +32 -30
  115. package/fesm2022/stepper.mjs.map +1 -1
  116. package/fesm2022/style-loader-e14dc585.mjs +47 -0
  117. package/fesm2022/style-loader-e14dc585.mjs.map +1 -0
  118. package/fesm2022/table.mjs +88 -132
  119. package/fesm2022/table.mjs.map +1 -1
  120. package/fesm2022/test-environment-34eef1ee.mjs +19 -0
  121. package/fesm2022/test-environment-34eef1ee.mjs.map +1 -0
  122. package/fesm2022/testing/selenium-webdriver.mjs +2 -1
  123. package/fesm2022/testing/selenium-webdriver.mjs.map +1 -1
  124. package/fesm2022/testing/testbed.mjs +33 -74
  125. package/fesm2022/testing/testbed.mjs.map +1 -1
  126. package/fesm2022/testing.mjs +2 -697
  127. package/fesm2022/testing.mjs.map +1 -1
  128. package/fesm2022/text-field.mjs +24 -23
  129. package/fesm2022/text-field.mjs.map +1 -1
  130. package/fesm2022/text-filtering-b60ba8a2.mjs +698 -0
  131. package/fesm2022/text-filtering-b60ba8a2.mjs.map +1 -0
  132. package/fesm2022/tree-key-manager-2f20c79c.mjs +360 -0
  133. package/fesm2022/tree-key-manager-2f20c79c.mjs.map +1 -0
  134. package/fesm2022/tree.mjs +33 -33
  135. package/fesm2022/tree.mjs.map +1 -1
  136. package/fesm2022/typeahead-11ae39bd.mjs +88 -0
  137. package/fesm2022/typeahead-11ae39bd.mjs.map +1 -0
  138. package/fesm2022/unique-selection-dispatcher-1d6f91d8.mjs +49 -0
  139. package/fesm2022/unique-selection-dispatcher-1d6f91d8.mjs.map +1 -0
  140. package/fesm2022/visually-hidden-83aea4a0.mjs +18 -0
  141. package/fesm2022/visually-hidden-83aea4a0.mjs.map +1 -0
  142. package/focus-key-manager.d-415a6958.d.ts +33 -0
  143. package/focus-monitor.d-810a02e6.d.ts +209 -0
  144. package/harness-environment.d-4d615248.d.ts +619 -0
  145. package/index.d.ts +2 -2
  146. package/keycodes/index.d.ts +123 -244
  147. package/layout/index.d.ts +23 -25
  148. package/list-key-manager.d-72e9a2e7.d.ts +164 -0
  149. package/listbox/index.d.ts +91 -107
  150. package/menu/index.d.ts +596 -682
  151. package/number-property.d-ce316715.d.ts +15 -0
  152. package/observe-content.d-c08bc882.d.ts +84 -0
  153. package/observers/index.d.ts +4 -90
  154. package/observers/private/index.d.ts +3 -3
  155. package/overlay/index.d.ts +110 -951
  156. package/overlay-module.d-5d06db8a.d.ts +790 -0
  157. package/package.json +1 -1
  158. package/platform/index.d.ts +45 -86
  159. package/platform.d-0a5b4792.d.ts +33 -0
  160. package/portal/index.d.ts +5 -264
  161. package/portal-directives.d-d345bd53.d.ts +210 -0
  162. package/private/index.d.ts +3 -20
  163. package/schematics/ng-add/index.js +1 -1
  164. package/schematics/ng-add/index.mjs +1 -1
  165. package/schematics/ng-update/html-parsing/angular.js +2 -2
  166. package/schematics/ng-update/html-parsing/angular.mjs +2 -2
  167. package/scrolling/index.d.ts +7 -687
  168. package/scrolling-module.d-a08a462d.d.ts +551 -0
  169. package/selection-model.d-1a70542c.d.ts +111 -0
  170. package/stepper/index.d.ts +74 -124
  171. package/style-loader.d-19baab84.d.ts +21 -0
  172. package/table/index.d.ts +329 -453
  173. package/testing/index.d.ts +32 -675
  174. package/testing/selenium-webdriver/index.d.ts +30 -20
  175. package/testing/testbed/index.d.ts +9 -19
  176. package/text-field/index.d.ts +11 -30
  177. package/tree/index.d.ts +205 -271
  178. package/tree-key-manager-strategy.d-603161dd.d.ts +116 -0
  179. package/unique-selection-dispatcher.d-7993b9f5.d.ts +32 -0
  180. package/view-repeater.d-79039e1f.d.ts +88 -0
  181. package/viewport-ruler.d-f3d3e82f.d.ts +57 -0
package/a11y/index.d.ts CHANGED
@@ -1,59 +1,51 @@
1
- import { AfterContentInit } from '@angular/core';
2
- import { AfterViewInit } from '@angular/core';
3
- import { DoCheck } from '@angular/core';
4
- import { ElementRef } from '@angular/core';
5
- import { EventEmitter } from '@angular/core';
6
1
  import * as i0 from '@angular/core';
7
- import * as i1 from '@angular/cdk/observers';
8
- import { InjectionToken } from '@angular/core';
9
- import { Injector } from '@angular/core';
10
- import { NgZone } from '@angular/core';
11
- import { Observable } from 'rxjs';
12
- import { OnChanges } from '@angular/core';
13
- import { OnDestroy } from '@angular/core';
14
- import { Provider } from '@angular/core';
15
- import { QueryList } from '@angular/core';
16
- import { Signal } from '@angular/core';
17
- import { SimpleChanges } from '@angular/core';
18
- import { Subject } from 'rxjs';
2
+ import { OnDestroy, Provider, QueryList, InjectionToken, NgZone, Injector } from '@angular/core';
3
+ export { A as ActiveDescendantKeyManager, H as Highlightable } from '../activedescendant-key-manager.d-11921e3a.js';
4
+ export { a as FocusKeyManager, F as FocusableOption } from '../focus-key-manager.d-415a6958.js';
5
+ export { b as ListKeyManager, a as ListKeyManagerModifierKey, L as ListKeyManagerOption } from '../list-key-manager.d-72e9a2e7.js';
6
+ import { Subject, Observable } from 'rxjs';
7
+ import { T as TreeKeyManagerItem, a as TreeKeyManagerStrategy, b as TreeKeyManagerFactory, c as TreeKeyManagerOptions } from '../tree-key-manager-strategy.d-603161dd.js';
8
+ export { b as TreeKeyManagerFactory, T as TreeKeyManagerItem, c as TreeKeyManagerOptions, a as TreeKeyManagerStrategy } from '../tree-key-manager-strategy.d-603161dd.js';
9
+ import { F as FocusTrap, I as InteractivityChecker } from '../a11y-module.d-7d03e079.js';
10
+ export { h as A11yModule, A as AriaLivePoliteness, c as CdkAriaLive, C as CdkTrapFocus, F as FocusTrap, a as FocusTrapFactory, I as InteractivityChecker, b as IsFocusableConfig, g as LIVE_ANNOUNCER_DEFAULT_OPTIONS, d as LIVE_ANNOUNCER_ELEMENT_TOKEN, e as LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY, L as LiveAnnouncer, f as LiveAnnouncerDefaultOptions } from '../a11y-module.d-7d03e079.js';
11
+ export { C as CdkMonitorFocus, d as FOCUS_MONITOR_DEFAULT_OPTIONS, e as FocusMonitor, b as FocusMonitorDetectionMode, c as FocusMonitorOptions, a as FocusOptions, F as FocusOrigin } from '../focus-monitor.d-810a02e6.js';
12
+ import '../observe-content.d-c08bc882.js';
13
+ import '../number-property.d-ce316715.js';
19
14
 
20
- export declare class A11yModule {
21
- constructor();
22
- static ɵfac: i0.ɵɵFactoryDeclaration<A11yModule, never>;
23
- static ɵmod: i0.ɵɵNgModuleDeclaration<A11yModule, never, [typeof i1.ObserversModule, typeof i2.CdkAriaLive, typeof i3.CdkTrapFocus, typeof i4.CdkMonitorFocus], [typeof i2.CdkAriaLive, typeof i3.CdkTrapFocus, typeof i4.CdkMonitorFocus]>;
24
- static ɵinj: i0.ɵɵInjectorDeclaration<A11yModule>;
25
- }
26
-
27
- export declare class ActiveDescendantKeyManager<T> extends ListKeyManager<Highlightable & T> {
28
- /**
29
- * Sets the active item to the item at the specified index and adds the
30
- * active styles to the newly active item. Also removes active styles
31
- * from the previously active item.
32
- * @param index Index of the item to be set as active.
33
- */
34
- setActiveItem(index: number): void;
35
- /**
36
- * Sets the active item to the item to the specified one and adds the
37
- * active styles to the it. Also removes active styles from the
38
- * previously active item.
39
- * @param item Item to be set as active.
40
- */
41
- setActiveItem(item: T): void;
15
+ /**
16
+ * Interface used to register message elements and keep a count of how many registrations have
17
+ * the same message and the reference to the message element used for the `aria-describedby`.
18
+ */
19
+ interface RegisteredMessage {
20
+ /** The element containing the message. */
21
+ messageElement: Element;
22
+ /** The number of elements that reference this message element via `aria-describedby`. */
23
+ referenceCount: number;
42
24
  }
43
-
44
-
45
25
  /**
46
- * Adds the given ID to the specified ARIA attribute on an element.
47
- * Used for attributes such as aria-labelledby, aria-owns, etc.
26
+ * ID used for the body container where all messages are appended.
27
+ * @deprecated No longer being used. To be removed.
28
+ * @breaking-change 14.0.0
48
29
  */
49
- export declare function addAriaReferencedId(el: Element, attr: `aria-${string}`, id: string): void;
50
-
30
+ declare const MESSAGES_CONTAINER_ID = "cdk-describedby-message-container";
31
+ /**
32
+ * ID prefix used for each created message element.
33
+ * @deprecated To be turned into a private variable.
34
+ * @breaking-change 14.0.0
35
+ */
36
+ declare const CDK_DESCRIBEDBY_ID_PREFIX = "cdk-describedby-message";
37
+ /**
38
+ * Attribute given to each host element that is described by a message element.
39
+ * @deprecated To be turned into a private variable.
40
+ * @breaking-change 14.0.0
41
+ */
42
+ declare const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = "cdk-describedby-host";
51
43
  /**
52
44
  * Utility that creates visually hidden elements with a message content. Useful for elements that
53
45
  * want to use aria-describedby to further describe themselves without adding additional visual
54
46
  * content.
55
47
  */
56
- export declare class AriaDescriber implements OnDestroy {
48
+ declare class AriaDescriber implements OnDestroy {
57
49
  private _platform;
58
50
  private _document;
59
51
  /** Map of all registered message elements that have been placed into the document. */
@@ -110,1066 +102,64 @@ export declare class AriaDescriber implements OnDestroy {
110
102
  static ɵprov: i0.ɵɵInjectableDeclaration<AriaDescriber>;
111
103
  }
112
104
 
113
- /** Possible politeness levels. */
114
- export declare type AriaLivePoliteness = 'off' | 'polite' | 'assertive';
115
-
116
105
  /**
117
- * Attribute given to each host element that is described by a message element.
118
- * @deprecated To be turned into a private variable.
119
- * @breaking-change 14.0.0
106
+ * Adds the given ID to the specified ARIA attribute on an element.
107
+ * Used for attributes such as aria-labelledby, aria-owns, etc.
120
108
  */
121
- export declare const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = "cdk-describedby-host";
122
-
109
+ declare function addAriaReferencedId(el: Element, attr: `aria-${string}`, id: string): void;
123
110
  /**
124
- * ID prefix used for each created message element.
125
- * @deprecated To be turned into a private variable.
126
- * @breaking-change 14.0.0
111
+ * Removes the given ID from the specified ARIA attribute on an element.
112
+ * Used for attributes such as aria-labelledby, aria-owns, etc.
127
113
  */
128
- export declare const CDK_DESCRIBEDBY_ID_PREFIX = "cdk-describedby-message";
129
-
114
+ declare function removeAriaReferencedId(el: Element, attr: `aria-${string}`, id: string): void;
130
115
  /**
131
- * A directive that works similarly to aria-live, but uses the LiveAnnouncer to ensure compatibility
132
- * with a wider range of browsers and screen readers.
116
+ * Gets the list of IDs referenced by the given ARIA attribute on an element.
117
+ * Used for attributes such as aria-labelledby, aria-owns, etc.
133
118
  */
134
- export declare class CdkAriaLive implements OnDestroy {
135
- private _elementRef;
136
- private _liveAnnouncer;
137
- private _contentObserver;
138
- private _ngZone;
139
- /** The aria-live politeness level to use when announcing messages. */
140
- get politeness(): AriaLivePoliteness;
141
- set politeness(value: AriaLivePoliteness);
142
- private _politeness;
143
- /** Time in milliseconds after which to clear out the announcer element. */
144
- duration: number;
145
- private _previousAnnouncedText?;
146
- private _subscription;
147
- constructor(...args: unknown[]);
148
- ngOnDestroy(): void;
149
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkAriaLive, never>;
150
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkAriaLive, "[cdkAriaLive]", ["cdkAriaLive"], { "politeness": { "alias": "cdkAriaLive"; "required": false; }; "duration": { "alias": "cdkAriaLiveDuration"; "required": false; }; }, {}, never, never, true, never>;
151
- }
119
+ declare function getAriaReferenceIds(el: Element, attr: string): string[];
152
120
 
153
121
  /**
154
- * Directive that determines how a particular element was focused (via keyboard, mouse, touch, or
155
- * programmatically) and adds corresponding classes to the element.
122
+ * @docs-private
156
123
  *
157
- * There are two variants of this directive:
158
- * 1) cdkMonitorElementFocus: does not consider an element to be focused if one of its children is
159
- * focused.
160
- * 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused.
161
- */
162
- export declare class CdkMonitorFocus implements AfterViewInit, OnDestroy {
163
- private _elementRef;
164
- private _focusMonitor;
165
- private _monitorSubscription;
166
- private _focusOrigin;
167
- readonly cdkFocusChange: EventEmitter<FocusOrigin>;
168
- constructor(...args: unknown[]);
169
- get focusOrigin(): FocusOrigin;
170
- ngAfterViewInit(): void;
171
- ngOnDestroy(): void;
172
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkMonitorFocus, never>;
173
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMonitorFocus, "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", ["cdkMonitorFocus"], {}, { "cdkFocusChange": "cdkFocusChange"; }, never, never, true, never>;
174
- }
175
-
176
- /** Directive for trapping focus within a region. */
177
- export declare class CdkTrapFocus implements OnDestroy, AfterContentInit, OnChanges, DoCheck {
178
- private _elementRef;
179
- private _focusTrapFactory;
180
- /** Underlying FocusTrap instance. */
181
- focusTrap: FocusTrap;
182
- /** Previously focused element to restore focus to upon destroy when using autoCapture. */
183
- private _previouslyFocusedElement;
184
- /** Whether the focus trap is active. */
185
- get enabled(): boolean;
186
- set enabled(value: boolean);
187
- /**
188
- * Whether the directive should automatically move focus into the trapped region upon
189
- * initialization and return focus to the previous activeElement upon destruction.
190
- */
191
- autoCapture: boolean;
192
- constructor(...args: unknown[]);
193
- ngOnDestroy(): void;
194
- ngAfterContentInit(): void;
195
- ngDoCheck(): void;
196
- ngOnChanges(changes: SimpleChanges): void;
197
- private _captureFocus;
198
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkTrapFocus, never>;
199
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTrapFocus, "[cdkTrapFocus]", ["cdkTrapFocus"], { "enabled": { "alias": "cdkTrapFocus"; "required": false; }; "autoCapture": { "alias": "cdkTrapFocusAutoCapture"; "required": false; }; }, {}, never, never, true, never>;
200
- static ngAcceptInputType_enabled: unknown;
201
- static ngAcceptInputType_autoCapture: unknown;
202
- }
203
-
204
- /**
205
- * Class that allows for trapping focus within a DOM element.
124
+ * Opt-out of Tree of key manager behavior.
206
125
  *
207
- * This class uses a strategy pattern that determines how it traps focus.
208
- * See FocusTrapInertStrategy.
126
+ * When provided, Tree has same focus management behavior as before TreeKeyManager was introduced.
127
+ * - Tree does not respond to keyboard interaction
128
+ * - Tree node allows tabindex to be set by Input binding
129
+ * - Tree node allows tabindex to be set by attribute binding
130
+ *
131
+ * @deprecated NoopTreeKeyManager deprecated. Use TreeKeyManager or inject a
132
+ * TreeKeyManagerStrategy instead. To be removed in a future version.
133
+ *
134
+ * @breaking-change 21.0.0
209
135
  */
210
- export declare class ConfigurableFocusTrap extends FocusTrap implements ManagedFocusTrap {
211
- private _focusTrapManager;
212
- private _inertStrategy;
213
- /** Whether the FocusTrap is enabled. */
214
- get enabled(): boolean;
215
- set enabled(value: boolean);
216
- constructor(_element: HTMLElement, _checker: InteractivityChecker, _ngZone: NgZone, _document: Document, _focusTrapManager: FocusTrapManager, _inertStrategy: FocusTrapInertStrategy, config: ConfigurableFocusTrapConfig, injector?: Injector);
217
- /** Notifies the FocusTrapManager that this FocusTrap will be destroyed. */
136
+ declare class NoopTreeKeyManager<T extends TreeKeyManagerItem> implements TreeKeyManagerStrategy<T> {
137
+ readonly _isNoopTreeKeyManager = true;
138
+ readonly change: Subject<T | null>;
218
139
  destroy(): void;
219
- /** @docs-private Implemented as part of ManagedFocusTrap. */
220
- _enable(): void;
221
- /** @docs-private Implemented as part of ManagedFocusTrap. */
222
- _disable(): void;
223
- }
224
-
225
-
226
- /**
227
- * Options for creating a ConfigurableFocusTrap.
228
- */
229
- export declare interface ConfigurableFocusTrapConfig {
230
- /**
231
- * Whether to defer the creation of FocusTrap elements to be done manually by the user.
232
- */
233
- defer: boolean;
234
- }
235
-
236
- /** Factory that allows easy instantiation of configurable focus traps. */
237
- export declare class ConfigurableFocusTrapFactory {
238
- private _checker;
239
- private _ngZone;
240
- private _focusTrapManager;
241
- private _document;
242
- private _inertStrategy;
243
- private readonly _injector;
244
- constructor(...args: unknown[]);
245
- /**
246
- * Creates a focus-trapped region around the given element.
247
- * @param element The element around which focus will be trapped.
248
- * @param config The focus trap configuration.
249
- * @returns The created focus trap instance.
250
- */
251
- create(element: HTMLElement, config?: ConfigurableFocusTrapConfig): ConfigurableFocusTrap;
252
- /**
253
- * @deprecated Pass a config object instead of the `deferCaptureElements` flag.
254
- * @breaking-change 11.0.0
255
- */
256
- create(element: HTMLElement, deferCaptureElements: boolean): ConfigurableFocusTrap;
257
- static ɵfac: i0.ɵɵFactoryDeclaration<ConfigurableFocusTrapFactory, never>;
258
- static ɵprov: i0.ɵɵInjectableDeclaration<ConfigurableFocusTrapFactory>;
259
- }
260
-
261
- /**
262
- * Lightweight FocusTrapInertStrategy that adds a document focus event
263
- * listener to redirect focus back inside the FocusTrap.
264
- */
265
- export declare class EventListenerFocusTrapInertStrategy implements FocusTrapInertStrategy {
266
- /** Focus event handler. */
267
- private _listener;
268
- /** Adds a document event listener that keeps focus inside the FocusTrap. */
269
- preventFocus(focusTrap: ConfigurableFocusTrap): void;
270
- /** Removes the event listener added in preventFocus. */
271
- allowFocus(focusTrap: ConfigurableFocusTrap): void;
272
- /**
273
- * Refocuses the first element in the FocusTrap if the focus event target was outside
274
- * the FocusTrap.
275
- *
276
- * This is an event listener callback. The event listener is added in runOutsideAngular,
277
- * so all this code runs outside Angular as well.
278
- */
279
- private _trapFocus;
280
- }
281
-
282
- /** InjectionToken for FocusMonitorOptions. */
283
- export declare const FOCUS_MONITOR_DEFAULT_OPTIONS: InjectionToken<FocusMonitorOptions>;
284
-
285
- /** The injection token used to specify the inert strategy. */
286
- export declare const FOCUS_TRAP_INERT_STRATEGY: InjectionToken<FocusTrapInertStrategy>;
287
-
288
- /**
289
- * This is the interface for focusable items (used by the FocusKeyManager).
290
- * Each item must know how to focus itself, whether or not it is currently disabled
291
- * and be able to supply its label.
292
- */
293
- export declare interface FocusableOption extends ListKeyManagerOption {
294
- /** Focuses the `FocusableOption`. */
295
- focus(origin?: FocusOrigin): void;
296
- }
297
-
298
- export declare class FocusKeyManager<T> extends ListKeyManager<FocusableOption & T> {
299
- private _origin;
300
- /**
301
- * Sets the focus origin that will be passed in to the items for any subsequent `focus` calls.
302
- * @param origin Focus origin to be used when focusing items.
303
- */
304
- setFocusOrigin(origin: FocusOrigin): this;
305
- /**
306
- * Sets the active item to the item at the specified
307
- * index and focuses the newly active item.
308
- * @param index Index of the item to be set as active.
309
- */
310
- setActiveItem(index: number): void;
311
- /**
312
- * Sets the active item to the item that is specified and focuses it.
313
- * @param item Item to be set as active.
314
- */
315
- setActiveItem(item: T): void;
316
- }
317
-
318
- /** Monitors mouse and keyboard events to determine the cause of focus events. */
319
- export declare class FocusMonitor implements OnDestroy {
320
- private _ngZone;
321
- private _platform;
322
- private readonly _inputModalityDetector;
323
- /** The focus origin that the next focus event is a result of. */
324
- private _origin;
325
- /** The FocusOrigin of the last focus event tracked by the FocusMonitor. */
326
- private _lastFocusOrigin;
327
- /** Whether the window has just been focused. */
328
- private _windowFocused;
329
- /** The timeout id of the window focus timeout. */
330
- private _windowFocusTimeoutId;
331
- /** The timeout id of the origin clearing timeout. */
332
- private _originTimeoutId;
333
- /**
334
- * Whether the origin was determined via a touch interaction. Necessary as properly attributing
335
- * focus events to touch interactions requires special logic.
336
- */
337
- private _originFromTouchInteraction;
338
- /** Map of elements being monitored to their info. */
339
- private _elementInfo;
340
- /** The number of elements currently being monitored. */
341
- private _monitoredElementCount;
342
- /**
343
- * Keeps track of the root nodes to which we've currently bound a focus/blur handler,
344
- * as well as the number of monitored elements that they contain. We have to treat focus/blur
345
- * handlers differently from the rest of the events, because the browser won't emit events
346
- * to the document when focus moves inside of a shadow root.
347
- */
348
- private _rootNodeFocusListenerCount;
349
- /**
350
- * The specified detection mode, used for attributing the origin of a focus
351
- * event.
352
- */
353
- private readonly _detectionMode;
354
- /**
355
- * Event listener for `focus` events on the window.
356
- * Needs to be an arrow function in order to preserve the context when it gets bound.
357
- */
358
- private _windowFocusListener;
359
- /** Used to reference correct document/window */
360
- protected _document?: Document | null | undefined;
361
- /** Subject for stopping our InputModalityDetector subscription. */
362
- private readonly _stopInputModalityDetector;
363
- constructor(...args: unknown[]);
364
- /**
365
- * Event listener for `focus` and 'blur' events on the document.
366
- * Needs to be an arrow function in order to preserve the context when it gets bound.
367
- */
368
- private _rootNodeFocusAndBlurListener;
369
- /**
370
- * Monitors focus on an element and applies appropriate CSS classes.
371
- * @param element The element to monitor
372
- * @param checkChildren Whether to count the element as focused when its children are focused.
373
- * @returns An observable that emits when the focus state of the element changes.
374
- * When the element is blurred, null will be emitted.
375
- */
376
- monitor(element: HTMLElement, checkChildren?: boolean): Observable<FocusOrigin>;
377
- /**
378
- * Monitors focus on an element and applies appropriate CSS classes.
379
- * @param element The element to monitor
380
- * @param checkChildren Whether to count the element as focused when its children are focused.
381
- * @returns An observable that emits when the focus state of the element changes.
382
- * When the element is blurred, null will be emitted.
383
- */
384
- monitor(element: ElementRef<HTMLElement>, checkChildren?: boolean): Observable<FocusOrigin>;
385
- /**
386
- * Stops monitoring an element and removes all focus classes.
387
- * @param element The element to stop monitoring.
388
- */
389
- stopMonitoring(element: HTMLElement): void;
390
- /**
391
- * Stops monitoring an element and removes all focus classes.
392
- * @param element The element to stop monitoring.
393
- */
394
- stopMonitoring(element: ElementRef<HTMLElement>): void;
395
- /**
396
- * Focuses the element via the specified focus origin.
397
- * @param element Element to focus.
398
- * @param origin Focus origin.
399
- * @param options Options that can be used to configure the focus behavior.
400
- */
401
- focusVia(element: HTMLElement, origin: FocusOrigin, options?: FocusOptions_2): void;
402
- /**
403
- * Focuses the element via the specified focus origin.
404
- * @param element Element to focus.
405
- * @param origin Focus origin.
406
- * @param options Options that can be used to configure the focus behavior.
407
- */
408
- focusVia(element: ElementRef<HTMLElement>, origin: FocusOrigin, options?: FocusOptions_2): void;
409
- ngOnDestroy(): void;
410
- /** Access injected document if available or fallback to global document reference */
411
- private _getDocument;
412
- /** Use defaultView of injected document if available or fallback to global window reference */
413
- private _getWindow;
414
- private _getFocusOrigin;
415
- /**
416
- * Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a
417
- * touch origin isn't immediately reset at the next tick (see _setOrigin). This means that when we
418
- * handle a focus event following a touch interaction, we need to determine whether (1) the focus
419
- * event was directly caused by the touch interaction or (2) the focus event was caused by a
420
- * subsequent programmatic focus call triggered by the touch interaction.
421
- * @param focusEventTarget The target of the focus event under examination.
422
- */
423
- private _shouldBeAttributedToTouch;
424
- /**
425
- * Sets the focus classes on the element based on the given focus origin.
426
- * @param element The element to update the classes on.
427
- * @param origin The focus origin.
428
- */
429
- private _setClasses;
430
- /**
431
- * Updates the focus origin. If we're using immediate detection mode, we schedule an async
432
- * function to clear the origin at the end of a timeout. The duration of the timeout depends on
433
- * the origin being set.
434
- * @param origin The origin to set.
435
- * @param isFromInteraction Whether we are setting the origin from an interaction event.
436
- */
437
- private _setOrigin;
438
- /**
439
- * Handles focus events on a registered element.
440
- * @param event The focus event.
441
- * @param element The monitored element.
442
- */
443
- private _onFocus;
444
- /**
445
- * Handles blur events on a registered element.
446
- * @param event The blur event.
447
- * @param element The monitored element.
448
- */
449
- _onBlur(event: FocusEvent, element: HTMLElement): void;
450
- private _emitOrigin;
451
- private _registerGlobalListeners;
452
- private _removeGlobalListeners;
453
- /** Updates all the state on an element once its focus origin has changed. */
454
- private _originChanged;
455
- /**
456
- * Collects the `MonitoredElementInfo` of a particular element and
457
- * all of its ancestors that have enabled `checkChildren`.
458
- * @param element Element from which to start the search.
459
- */
460
- private _getClosestElementsInfo;
461
- /**
462
- * Returns whether an interaction is likely to have come from the user clicking the `label` of
463
- * an `input` or `textarea` in order to focus it.
464
- * @param focusEventTarget Target currently receiving focus.
465
- */
466
- private _isLastInteractionFromInputLabel;
467
- static ɵfac: i0.ɵɵFactoryDeclaration<FocusMonitor, never>;
468
- static ɵprov: i0.ɵɵInjectableDeclaration<FocusMonitor>;
469
- }
470
-
471
- /** Detection mode used for attributing the origin of a focus event. */
472
- export declare enum FocusMonitorDetectionMode {
473
- /**
474
- * Any mousedown, keydown, or touchstart event that happened in the previous
475
- * tick or the current tick will be used to assign a focus event's origin (to
476
- * either mouse, keyboard, or touch). This is the default option.
477
- */
478
- IMMEDIATE = 0,
479
- /**
480
- * A focus event's origin is always attributed to the last corresponding
481
- * mousedown, keydown, or touchstart event, no matter how long ago it occurred.
482
- */
483
- EVENTUAL = 1
484
- }
485
-
486
- /** Injectable service-level options for FocusMonitor. */
487
- export declare interface FocusMonitorOptions {
488
- detectionMode?: FocusMonitorDetectionMode;
140
+ onKeydown(): void;
141
+ getActiveItemIndex(): null;
142
+ getActiveItem(): null;
143
+ focusItem(): void;
489
144
  }
490
-
491
145
  /**
492
- * Corresponds to the options that can be passed to the native `focus` event.
493
- * via https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
146
+ * @docs-private
147
+ *
148
+ * Opt-out of Tree of key manager behavior.
149
+ *
150
+ * When provided, Tree has same focus management behavior as before TreeKeyManager was introduced.
151
+ * - Tree does not respond to keyboard interaction
152
+ * - Tree node allows tabindex to be set by Input binding
153
+ * - Tree node allows tabindex to be set by attribute binding
154
+ *
155
+ * @deprecated NoopTreeKeyManager deprecated. Use TreeKeyManager or inject a
156
+ * TreeKeyManagerStrategy instead. To be removed in a future version.
157
+ *
158
+ * @breaking-change 21.0.0
494
159
  */
495
- declare interface FocusOptions_2 {
496
- /** Whether the browser should scroll to the element when it is focused. */
497
- preventScroll?: boolean;
498
- }
499
- export { FocusOptions_2 as FocusOptions }
500
-
501
- export declare type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null;
502
-
160
+ declare function NOOP_TREE_KEY_MANAGER_FACTORY<T extends TreeKeyManagerItem>(): TreeKeyManagerFactory<T>;
503
161
  /**
504
- * Class that allows for trapping focus within a DOM element.
505
- *
506
- * This class currently uses a relatively simple approach to focus trapping.
507
- * It assumes that the tab order is the same as DOM order, which is not necessarily true.
508
- * Things like `tabIndex > 0`, flex `order`, and shadow roots can cause the two to be misaligned.
509
- */
510
- export declare class FocusTrap {
511
- readonly _element: HTMLElement;
512
- private _checker;
513
- readonly _ngZone: NgZone;
514
- readonly _document: Document;
515
- /** @breaking-change 20.0.0 param to become required */
516
- readonly _injector?: Injector | undefined;
517
- private _startAnchor;
518
- private _endAnchor;
519
- private _hasAttached;
520
- protected startAnchorListener: () => boolean;
521
- protected endAnchorListener: () => boolean;
522
- /** Whether the focus trap is active. */
523
- get enabled(): boolean;
524
- set enabled(value: boolean);
525
- protected _enabled: boolean;
526
- constructor(_element: HTMLElement, _checker: InteractivityChecker, _ngZone: NgZone, _document: Document, deferAnchors?: boolean,
527
- /** @breaking-change 20.0.0 param to become required */
528
- _injector?: Injector | undefined);
529
- /** Destroys the focus trap by cleaning up the anchors. */
530
- destroy(): void;
531
- /**
532
- * Inserts the anchors into the DOM. This is usually done automatically
533
- * in the constructor, but can be deferred for cases like directives with `*ngIf`.
534
- * @returns Whether the focus trap managed to attach successfully. This may not be the case
535
- * if the target element isn't currently in the DOM.
536
- */
537
- attachAnchors(): boolean;
538
- /**
539
- * Waits for the zone to stabilize, then focuses the first tabbable element.
540
- * @returns Returns a promise that resolves with a boolean, depending
541
- * on whether focus was moved successfully.
542
- */
543
- focusInitialElementWhenReady(options?: FocusOptions): Promise<boolean>;
544
- /**
545
- * Waits for the zone to stabilize, then focuses
546
- * the first tabbable element within the focus trap region.
547
- * @returns Returns a promise that resolves with a boolean, depending
548
- * on whether focus was moved successfully.
549
- */
550
- focusFirstTabbableElementWhenReady(options?: FocusOptions): Promise<boolean>;
551
- /**
552
- * Waits for the zone to stabilize, then focuses
553
- * the last tabbable element within the focus trap region.
554
- * @returns Returns a promise that resolves with a boolean, depending
555
- * on whether focus was moved successfully.
556
- */
557
- focusLastTabbableElementWhenReady(options?: FocusOptions): Promise<boolean>;
558
- /**
559
- * Get the specified boundary element of the trapped region.
560
- * @param bound The boundary to get (start or end of trapped region).
561
- * @returns The boundary element.
562
- */
563
- private _getRegionBoundary;
564
- /**
565
- * Focuses the element that should be focused when the focus trap is initialized.
566
- * @returns Whether focus was moved successfully.
567
- */
568
- focusInitialElement(options?: FocusOptions): boolean;
569
- /**
570
- * Focuses the first tabbable element within the focus trap region.
571
- * @returns Whether focus was moved successfully.
572
- */
573
- focusFirstTabbableElement(options?: FocusOptions): boolean;
574
- /**
575
- * Focuses the last tabbable element within the focus trap region.
576
- * @returns Whether focus was moved successfully.
577
- */
578
- focusLastTabbableElement(options?: FocusOptions): boolean;
579
- /**
580
- * Checks whether the focus trap has successfully been attached.
581
- */
582
- hasAttached(): boolean;
583
- /** Get the first tabbable element from a DOM subtree (inclusive). */
584
- private _getFirstTabbableElement;
585
- /** Get the last tabbable element from a DOM subtree (inclusive). */
586
- private _getLastTabbableElement;
587
- /** Creates an anchor element. */
588
- private _createAnchor;
589
- /**
590
- * Toggles the `tabindex` of an anchor, based on the enabled state of the focus trap.
591
- * @param isEnabled Whether the focus trap is enabled.
592
- * @param anchor Anchor on which to toggle the tabindex.
593
- */
594
- private _toggleAnchorTabIndex;
595
- /**
596
- * Toggles the`tabindex` of both anchors to either trap Tab focus or allow it to escape.
597
- * @param enabled: Whether the anchors should trap Tab.
598
- */
599
- protected toggleAnchors(enabled: boolean): void;
600
- /** Executes a function when the zone is stable. */
601
- private _executeOnStable;
602
- }
603
-
604
- /**
605
- * Factory that allows easy instantiation of focus traps.
606
- */
607
- export declare class FocusTrapFactory {
608
- private _checker;
609
- private _ngZone;
610
- private _document;
611
- private _injector;
612
- constructor(...args: unknown[]);
613
- /**
614
- * Creates a focus-trapped region around the given element.
615
- * @param element The element around which focus will be trapped.
616
- * @param deferCaptureElements Defers the creation of focus-capturing elements to be done
617
- * manually by the user.
618
- * @returns The created focus trap instance.
619
- */
620
- create(element: HTMLElement, deferCaptureElements?: boolean): FocusTrap;
621
- static ɵfac: i0.ɵɵFactoryDeclaration<FocusTrapFactory, never>;
622
- static ɵprov: i0.ɵɵInjectableDeclaration<FocusTrapFactory>;
623
- }
624
-
625
- /**
626
- * A strategy that dictates how FocusTrap should prevent elements
627
- * outside of the FocusTrap from being focused.
628
- */
629
- export declare interface FocusTrapInertStrategy {
630
- /** Makes all elements outside focusTrap unfocusable. */
631
- preventFocus(focusTrap: FocusTrap): void;
632
- /** Reverts elements made unfocusable by preventFocus to their previous state. */
633
- allowFocus(focusTrap: FocusTrap): void;
634
- }
635
-
636
- /** Injectable that ensures only the most recently enabled FocusTrap is active. */
637
- declare class FocusTrapManager {
638
- private _focusTrapStack;
639
- /**
640
- * Disables the FocusTrap at the top of the stack, and then pushes
641
- * the new FocusTrap onto the stack.
642
- */
643
- register(focusTrap: ManagedFocusTrap): void;
644
- /**
645
- * Removes the FocusTrap from the stack, and activates the
646
- * FocusTrap that is the new top of the stack.
647
- */
648
- deregister(focusTrap: ManagedFocusTrap): void;
649
- static ɵfac: i0.ɵɵFactoryDeclaration<FocusTrapManager, never>;
650
- static ɵprov: i0.ɵɵInjectableDeclaration<FocusTrapManager>;
651
- }
652
-
653
- /**
654
- * Gets the list of IDs referenced by the given ARIA attribute on an element.
655
- * Used for attributes such as aria-labelledby, aria-owns, etc.
656
- */
657
- export declare function getAriaReferenceIds(el: Element, attr: string): string[];
658
-
659
- /** Set of possible high-contrast mode backgrounds. */
660
- export declare enum HighContrastMode {
661
- NONE = 0,
662
- BLACK_ON_WHITE = 1,
663
- WHITE_ON_BLACK = 2
664
- }
665
-
666
- /**
667
- * Service to determine whether the browser is currently in a high-contrast-mode environment.
668
- *
669
- * Microsoft Windows supports an accessibility feature called "High Contrast Mode". This mode
670
- * changes the appearance of all applications, including web applications, to dramatically increase
671
- * contrast.
672
- *
673
- * IE, Edge, and Firefox currently support this mode. Chrome does not support Windows High Contrast
674
- * Mode. This service does not detect high-contrast mode as added by the Chrome "High Contrast"
675
- * browser extension.
676
- */
677
- export declare class HighContrastModeDetector implements OnDestroy {
678
- private _platform;
679
- /**
680
- * Figuring out the high contrast mode and adding the body classes can cause
681
- * some expensive layouts. This flag is used to ensure that we only do it once.
682
- */
683
- private _hasCheckedHighContrastMode;
684
- private _document;
685
- private _breakpointSubscription;
686
- constructor(...args: unknown[]);
687
- /** Gets the current high-contrast-mode for the page. */
688
- getHighContrastMode(): HighContrastMode;
689
- ngOnDestroy(): void;
690
- /** Applies CSS classes indicating high-contrast mode to document body (browser-only). */
691
- _applyBodyHighContrastModeCssClasses(): void;
692
- static ɵfac: i0.ɵɵFactoryDeclaration<HighContrastModeDetector, never>;
693
- static ɵprov: i0.ɵɵInjectableDeclaration<HighContrastModeDetector>;
694
- }
695
-
696
- /**
697
- * This is the interface for highlightable items (used by the ActiveDescendantKeyManager).
698
- * Each item must know how to style itself as active or inactive and whether or not it is
699
- * currently disabled.
700
- */
701
- export declare interface Highlightable extends ListKeyManagerOption {
702
- /** Applies the styles for an active item to this item. */
703
- setActiveStyles(): void;
704
- /** Applies the styles for an inactive item to this item. */
705
- setInactiveStyles(): void;
706
- }
707
-
708
- declare namespace i2 {
709
- export {
710
- LiveAnnouncer,
711
- CdkAriaLive
712
- }
713
- }
714
-
715
- declare namespace i3 {
716
- export {
717
- FocusTrap,
718
- FocusTrapFactory,
719
- CdkTrapFocus
720
- }
721
- }
722
-
723
- declare namespace i4 {
724
- export {
725
- FocusOrigin,
726
- FocusOptions_2 as FocusOptions,
727
- FocusMonitorDetectionMode,
728
- FocusMonitorOptions,
729
- FOCUS_MONITOR_DEFAULT_OPTIONS,
730
- FocusMonitor,
731
- CdkMonitorFocus
732
- }
733
- }
734
-
735
- /** Service that generates unique IDs for DOM nodes. */
736
- export declare class _IdGenerator {
737
- private _appId;
738
- /**
739
- * Generates a unique ID with a specific prefix.
740
- * @param prefix Prefix to add to the ID.
741
- */
742
- getId(prefix: string): string;
743
- static ɵfac: i0.ɵɵFactoryDeclaration<_IdGenerator, never>;
744
- static ɵprov: i0.ɵɵInjectableDeclaration<_IdGenerator>;
745
- }
746
-
747
- /**
748
- * Default options for the InputModalityDetector.
749
- *
750
- * Modifier keys are ignored by default (i.e. when pressed won't cause the service to detect
751
- * keyboard input modality) for two reasons:
752
- *
753
- * 1. Modifier keys are commonly used with mouse to perform actions such as 'right click' or 'open
754
- * in new tab', and are thus less representative of actual keyboard interaction.
755
- * 2. VoiceOver triggers some keyboard events when linearly navigating with Control + Option (but
756
- * confusingly not with Caps Lock). Thus, to have parity with other screen readers, we ignore
757
- * these keys so as to not update the input modality.
758
- *
759
- * Note that we do not by default ignore the right Meta key on Safari because it has the same key
760
- * code as the ContextMenu key on other browsers. When we switch to using event.key, we can
761
- * distinguish between the two.
762
- */
763
- export declare const INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS: InputModalityDetectorOptions;
764
-
765
- /**
766
- * Injectable options for the InputModalityDetector. These are shallowly merged with the default
767
- * options.
768
- */
769
- export declare const INPUT_MODALITY_DETECTOR_OPTIONS: InjectionToken<InputModalityDetectorOptions>;
770
-
771
- /**
772
- * The input modalities detected by this service. Null is used if the input modality is unknown.
773
- */
774
- export declare type InputModality = 'keyboard' | 'mouse' | 'touch' | null;
775
-
776
- /**
777
- * Service that detects the user's input modality.
778
- *
779
- * This service does not update the input modality when a user navigates with a screen reader
780
- * (e.g. linear navigation with VoiceOver, object navigation / browse mode with NVDA, virtual PC
781
- * cursor mode with JAWS). This is in part due to technical limitations (i.e. keyboard events do not
782
- * fire as expected in these modes) but is also arguably the correct behavior. Navigating with a
783
- * screen reader is akin to visually scanning a page, and should not be interpreted as actual user
784
- * input interaction.
785
- *
786
- * When a user is not navigating but *interacting* with a screen reader, this service attempts to
787
- * update the input modality to keyboard, but in general this service's behavior is largely
788
- * undefined.
789
- */
790
- export declare class InputModalityDetector implements OnDestroy {
791
- private readonly _platform;
792
- private readonly _listenerCleanups;
793
- /** Emits whenever an input modality is detected. */
794
- readonly modalityDetected: Observable<InputModality>;
795
- /** Emits when the input modality changes. */
796
- readonly modalityChanged: Observable<InputModality>;
797
- /** The most recently detected input modality. */
798
- get mostRecentModality(): InputModality;
799
- /**
800
- * The most recently detected input modality event target. Is null if no input modality has been
801
- * detected or if the associated event target is null for some unknown reason.
802
- */
803
- _mostRecentTarget: HTMLElement | null;
804
- /** The underlying BehaviorSubject that emits whenever an input modality is detected. */
805
- private readonly _modality;
806
- /** Options for this InputModalityDetector. */
807
- private readonly _options;
808
- /**
809
- * The timestamp of the last touch input modality. Used to determine whether mousedown events
810
- * should be attributed to mouse or touch.
811
- */
812
- private _lastTouchMs;
813
- /**
814
- * Handles keydown events. Must be an arrow function in order to preserve the context when it gets
815
- * bound.
816
- */
817
- private _onKeydown;
818
- /**
819
- * Handles mousedown events. Must be an arrow function in order to preserve the context when it
820
- * gets bound.
821
- */
822
- private _onMousedown;
823
- /**
824
- * Handles touchstart events. Must be an arrow function in order to preserve the context when it
825
- * gets bound.
826
- */
827
- private _onTouchstart;
828
- constructor(...args: unknown[]);
829
- ngOnDestroy(): void;
830
- static ɵfac: i0.ɵɵFactoryDeclaration<InputModalityDetector, never>;
831
- static ɵprov: i0.ɵɵInjectableDeclaration<InputModalityDetector>;
832
- }
833
-
834
- /** Options to configure the behavior of the InputModalityDetector. */
835
- export declare interface InputModalityDetectorOptions {
836
- /** Keys to ignore when detecting keyboard input modality. */
837
- ignoreKeys?: number[];
838
- }
839
-
840
- /**
841
- * Utility for checking the interactivity of an element, such as whether it is focusable or
842
- * tabbable.
843
- */
844
- export declare class InteractivityChecker {
845
- private _platform;
846
- constructor(...args: unknown[]);
847
- /**
848
- * Gets whether an element is disabled.
849
- *
850
- * @param element Element to be checked.
851
- * @returns Whether the element is disabled.
852
- */
853
- isDisabled(element: HTMLElement): boolean;
854
- /**
855
- * Gets whether an element is visible for the purposes of interactivity.
856
- *
857
- * This will capture states like `display: none` and `visibility: hidden`, but not things like
858
- * being clipped by an `overflow: hidden` parent or being outside the viewport.
859
- *
860
- * @returns Whether the element is visible.
861
- */
862
- isVisible(element: HTMLElement): boolean;
863
- /**
864
- * Gets whether an element can be reached via Tab key.
865
- * Assumes that the element has already been checked with isFocusable.
866
- *
867
- * @param element Element to be checked.
868
- * @returns Whether the element is tabbable.
869
- */
870
- isTabbable(element: HTMLElement): boolean;
871
- /**
872
- * Gets whether an element can be focused by the user.
873
- *
874
- * @param element Element to be checked.
875
- * @param config The config object with options to customize this method's behavior
876
- * @returns Whether the element is focusable.
877
- */
878
- isFocusable(element: HTMLElement, config?: IsFocusableConfig): boolean;
879
- static ɵfac: i0.ɵɵFactoryDeclaration<InteractivityChecker, never>;
880
- static ɵprov: i0.ɵɵInjectableDeclaration<InteractivityChecker>;
881
- }
882
-
883
-
884
- /** Gets whether an event could be a faked `mousedown` event dispatched by a screen reader. */
885
- export declare function isFakeMousedownFromScreenReader(event: MouseEvent): boolean;
886
-
887
- /** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */
888
- export declare function isFakeTouchstartFromScreenReader(event: TouchEvent): boolean;
889
-
890
- /**
891
- * Configuration for the isFocusable method.
892
- */
893
- export declare class IsFocusableConfig {
894
- /**
895
- * Whether to count an element as focusable even if it is not currently visible.
896
- */
897
- ignoreVisibility: boolean;
898
- }
899
-
900
- /**
901
- * This class manages keyboard events for selectable lists. If you pass it a query list
902
- * of items, it will set the active item correctly when arrow events occur.
903
- */
904
- export declare class ListKeyManager<T extends ListKeyManagerOption> {
905
- private _items;
906
- private _activeItemIndex;
907
- private _activeItem;
908
- private _wrap;
909
- private _typeaheadSubscription;
910
- private _itemChangesSubscription?;
911
- private _vertical;
912
- private _horizontal;
913
- private _allowedModifierKeys;
914
- private _homeAndEnd;
915
- private _pageUpAndDown;
916
- private _effectRef;
917
- private _typeahead?;
918
- /**
919
- * Predicate function that can be used to check whether an item should be skipped
920
- * by the key manager. By default, disabled items are skipped.
921
- */
922
- private _skipPredicateFn;
923
- constructor(items: QueryList<T> | T[] | readonly T[]);
924
- constructor(items: Signal<T[]> | Signal<readonly T[]>, injector: Injector);
925
- /**
926
- * Stream that emits any time the TAB key is pressed, so components can react
927
- * when focus is shifted off of the list.
928
- */
929
- readonly tabOut: Subject<void>;
930
- /** Stream that emits whenever the active item of the list manager changes. */
931
- readonly change: Subject<number>;
932
- /**
933
- * Sets the predicate function that determines which items should be skipped by the
934
- * list key manager.
935
- * @param predicate Function that determines whether the given item should be skipped.
936
- */
937
- skipPredicate(predicate: (item: T) => boolean): this;
938
- /**
939
- * Configures wrapping mode, which determines whether the active item will wrap to
940
- * the other end of list when there are no more items in the given direction.
941
- * @param shouldWrap Whether the list should wrap when reaching the end.
942
- */
943
- withWrap(shouldWrap?: boolean): this;
944
- /**
945
- * Configures whether the key manager should be able to move the selection vertically.
946
- * @param enabled Whether vertical selection should be enabled.
947
- */
948
- withVerticalOrientation(enabled?: boolean): this;
949
- /**
950
- * Configures the key manager to move the selection horizontally.
951
- * Passing in `null` will disable horizontal movement.
952
- * @param direction Direction in which the selection can be moved.
953
- */
954
- withHorizontalOrientation(direction: 'ltr' | 'rtl' | null): this;
955
- /**
956
- * Modifier keys which are allowed to be held down and whose default actions will be prevented
957
- * as the user is pressing the arrow keys. Defaults to not allowing any modifier keys.
958
- */
959
- withAllowedModifierKeys(keys: ListKeyManagerModifierKey[]): this;
960
- /**
961
- * Turns on typeahead mode which allows users to set the active item by typing.
962
- * @param debounceInterval Time to wait after the last keystroke before setting the active item.
963
- */
964
- withTypeAhead(debounceInterval?: number): this;
965
- /** Cancels the current typeahead sequence. */
966
- cancelTypeahead(): this;
967
- /**
968
- * Configures the key manager to activate the first and last items
969
- * respectively when the Home or End key is pressed.
970
- * @param enabled Whether pressing the Home or End key activates the first/last item.
971
- */
972
- withHomeAndEnd(enabled?: boolean): this;
973
- /**
974
- * Configures the key manager to activate every 10th, configured or first/last element in up/down direction
975
- * respectively when the Page-Up or Page-Down key is pressed.
976
- * @param enabled Whether pressing the Page-Up or Page-Down key activates the first/last item.
977
- * @param delta Whether pressing the Home or End key activates the first/last item.
978
- */
979
- withPageUpDown(enabled?: boolean, delta?: number): this;
980
- /**
981
- * Sets the active item to the item at the index specified.
982
- * @param index The index of the item to be set as active.
983
- */
984
- setActiveItem(index: number): void;
985
- /**
986
- * Sets the active item to the specified item.
987
- * @param item The item to be set as active.
988
- */
989
- setActiveItem(item: T): void;
990
- /**
991
- * Sets the active item depending on the key event passed in.
992
- * @param event Keyboard event to be used for determining which element should be active.
993
- */
994
- onKeydown(event: KeyboardEvent): void;
995
- /** Index of the currently active item. */
996
- get activeItemIndex(): number | null;
997
- /** The active item. */
998
- get activeItem(): T | null;
999
- /** Gets whether the user is currently typing into the manager using the typeahead feature. */
1000
- isTyping(): boolean;
1001
- /** Sets the active item to the first enabled item in the list. */
1002
- setFirstItemActive(): void;
1003
- /** Sets the active item to the last enabled item in the list. */
1004
- setLastItemActive(): void;
1005
- /** Sets the active item to the next enabled item in the list. */
1006
- setNextItemActive(): void;
1007
- /** Sets the active item to a previous enabled item in the list. */
1008
- setPreviousItemActive(): void;
1009
- /**
1010
- * Allows setting the active without any other effects.
1011
- * @param index Index of the item to be set as active.
1012
- */
1013
- updateActiveItem(index: number): void;
1014
- /**
1015
- * Allows setting the active item without any other effects.
1016
- * @param item Item to be set as active.
1017
- */
1018
- updateActiveItem(item: T): void;
1019
- /** Cleans up the key manager. */
1020
- destroy(): void;
1021
- /**
1022
- * This method sets the active item, given a list of items and the delta between the
1023
- * currently active item and the new active item. It will calculate differently
1024
- * depending on whether wrap mode is turned on.
1025
- */
1026
- private _setActiveItemByDelta;
1027
- /**
1028
- * Sets the active item properly given "wrap" mode. In other words, it will continue to move
1029
- * down the list until it finds an item that is not disabled, and it will wrap if it
1030
- * encounters either end of the list.
1031
- */
1032
- private _setActiveInWrapMode;
1033
- /**
1034
- * Sets the active item properly given the default mode. In other words, it will
1035
- * continue to move down the list until it finds an item that is not disabled. If
1036
- * it encounters either end of the list, it will stop and not wrap.
1037
- */
1038
- private _setActiveInDefaultMode;
1039
- /**
1040
- * Sets the active item to the first enabled item starting at the index specified. If the
1041
- * item is disabled, it will move in the fallbackDelta direction until it either
1042
- * finds an enabled item or encounters the end of the list.
1043
- */
1044
- private _setActiveItemByIndex;
1045
- /** Returns the items as an array. */
1046
- private _getItemsArray;
1047
- /** Callback for when the items have changed. */
1048
- private _itemsChanged;
1049
- }
1050
-
1051
- /** Modifier keys handled by the ListKeyManager. */
1052
- export declare type ListKeyManagerModifierKey = 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey';
1053
-
1054
- /** This interface is for items that can be passed to a ListKeyManager. */
1055
- export declare interface ListKeyManagerOption {
1056
- /** Whether the option is disabled. */
1057
- disabled?: boolean;
1058
- /** Gets the label for this option. */
1059
- getLabel?(): string;
1060
- }
1061
-
1062
- /** Injection token that can be used to configure the default options for the LiveAnnouncer. */
1063
- export declare const LIVE_ANNOUNCER_DEFAULT_OPTIONS: InjectionToken<LiveAnnouncerDefaultOptions>;
1064
-
1065
- export declare const LIVE_ANNOUNCER_ELEMENT_TOKEN: InjectionToken<HTMLElement | null>;
1066
-
1067
- /** @docs-private */
1068
- export declare function LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY(): null;
1069
-
1070
- export declare class LiveAnnouncer implements OnDestroy {
1071
- private _ngZone;
1072
- private _defaultOptions;
1073
- private _liveElement;
1074
- private _document;
1075
- private _previousTimeout;
1076
- private _currentPromise;
1077
- private _currentResolve;
1078
- constructor(...args: unknown[]);
1079
- /**
1080
- * Announces a message to screen readers.
1081
- * @param message Message to be announced to the screen reader.
1082
- * @returns Promise that will be resolved when the message is added to the DOM.
1083
- */
1084
- announce(message: string): Promise<void>;
1085
- /**
1086
- * Announces a message to screen readers.
1087
- * @param message Message to be announced to the screen reader.
1088
- * @param politeness The politeness of the announcer element.
1089
- * @returns Promise that will be resolved when the message is added to the DOM.
1090
- */
1091
- announce(message: string, politeness?: AriaLivePoliteness): Promise<void>;
1092
- /**
1093
- * Announces a message to screen readers.
1094
- * @param message Message to be announced to the screen reader.
1095
- * @param duration Time in milliseconds after which to clear out the announcer element. Note
1096
- * that this takes effect after the message has been added to the DOM, which can be up to
1097
- * 100ms after `announce` has been called.
1098
- * @returns Promise that will be resolved when the message is added to the DOM.
1099
- */
1100
- announce(message: string, duration?: number): Promise<void>;
1101
- /**
1102
- * Announces a message to screen readers.
1103
- * @param message Message to be announced to the screen reader.
1104
- * @param politeness The politeness of the announcer element.
1105
- * @param duration Time in milliseconds after which to clear out the announcer element. Note
1106
- * that this takes effect after the message has been added to the DOM, which can be up to
1107
- * 100ms after `announce` has been called.
1108
- * @returns Promise that will be resolved when the message is added to the DOM.
1109
- */
1110
- announce(message: string, politeness?: AriaLivePoliteness, duration?: number): Promise<void>;
1111
- /**
1112
- * Clears the current text from the announcer element. Can be used to prevent
1113
- * screen readers from reading the text out again while the user is going
1114
- * through the page landmarks.
1115
- */
1116
- clear(): void;
1117
- ngOnDestroy(): void;
1118
- private _createLiveElement;
1119
- /**
1120
- * Some browsers won't expose the accessibility node of the live announcer element if there is an
1121
- * `aria-modal` and the live announcer is outside of it. This method works around the issue by
1122
- * pointing the `aria-owns` of all modals to the live announcer element.
1123
- */
1124
- private _exposeAnnouncerToModals;
1125
- static ɵfac: i0.ɵɵFactoryDeclaration<LiveAnnouncer, never>;
1126
- static ɵprov: i0.ɵɵInjectableDeclaration<LiveAnnouncer>;
1127
- }
1128
-
1129
- /** Object that can be used to configure the default options for the LiveAnnouncer. */
1130
- export declare interface LiveAnnouncerDefaultOptions {
1131
- /** Default politeness for the announcements. */
1132
- politeness?: AriaLivePoliteness;
1133
- /** Default duration for the announcement messages. */
1134
- duration?: number;
1135
- }
1136
-
1137
- /**
1138
- * A FocusTrap managed by FocusTrapManager.
1139
- * Implemented by ConfigurableFocusTrap to avoid circular dependency.
1140
- */
1141
- declare interface ManagedFocusTrap {
1142
- _enable(): void;
1143
- _disable(): void;
1144
- focusInitialElementWhenReady(): Promise<boolean>;
1145
- }
1146
-
1147
- /**
1148
- * ID used for the body container where all messages are appended.
1149
- * @deprecated No longer being used. To be removed.
1150
- * @breaking-change 14.0.0
1151
- */
1152
- export declare const MESSAGES_CONTAINER_ID = "cdk-describedby-message-container";
1153
-
1154
- /**
1155
- * @docs-private
1156
- *
1157
- * Opt-out of Tree of key manager behavior.
1158
- *
1159
- * When provided, Tree has same focus management behavior as before TreeKeyManager was introduced.
1160
- * - Tree does not respond to keyboard interaction
1161
- * - Tree node allows tabindex to be set by Input binding
1162
- * - Tree node allows tabindex to be set by attribute binding
1163
- *
1164
- * @deprecated NoopTreeKeyManager deprecated. Use TreeKeyManager or inject a
1165
- * TreeKeyManagerStrategy instead. To be removed in a future version.
1166
- *
1167
- * @breaking-change 21.0.0
1168
- */
1169
- export declare function NOOP_TREE_KEY_MANAGER_FACTORY<T extends TreeKeyManagerItem>(): TreeKeyManagerFactory<T>;
1170
-
1171
- /**
1172
- * @docs-private
162
+ * @docs-private
1173
163
  *
1174
164
  * Opt-out of Tree of key manager behavior.
1175
165
  *
@@ -1180,71 +170,17 @@ export declare function NOOP_TREE_KEY_MANAGER_FACTORY<T extends TreeKeyManagerIt
1180
170
  *
1181
171
  * @deprecated NoopTreeKeyManager deprecated. Use TreeKeyManager or inject a
1182
172
  * TreeKeyManagerStrategy instead. To be removed in a future version.
1183
- *
1184
- * @breaking-change 21.0.0
1185
- */
1186
- export declare const NOOP_TREE_KEY_MANAGER_FACTORY_PROVIDER: Provider;
1187
-
1188
- /**
1189
- * @docs-private
1190
- *
1191
- * Opt-out of Tree of key manager behavior.
1192
- *
1193
- * When provided, Tree has same focus management behavior as before TreeKeyManager was introduced.
1194
- * - Tree does not respond to keyboard interaction
1195
- * - Tree node allows tabindex to be set by Input binding
1196
- * - Tree node allows tabindex to be set by attribute binding
1197
- *
1198
- * @deprecated NoopTreeKeyManager deprecated. Use TreeKeyManager or inject a
1199
- * TreeKeyManagerStrategy instead. To be removed in a future version.
1200
- *
1201
- * @breaking-change 21.0.0
1202
- */
1203
- export declare class NoopTreeKeyManager<T extends TreeKeyManagerItem> implements TreeKeyManagerStrategy<T> {
1204
- readonly _isNoopTreeKeyManager = true;
1205
- readonly change: Subject<T | null>;
1206
- destroy(): void;
1207
- onKeydown(): void;
1208
- getActiveItemIndex(): null;
1209
- getActiveItem(): null;
1210
- focusItem(): void;
1211
- }
1212
-
1213
- /**
1214
- * Interface used to register message elements and keep a count of how many registrations have
1215
- * the same message and the reference to the message element used for the `aria-describedby`.
1216
- */
1217
- export declare interface RegisteredMessage {
1218
- /** The element containing the message. */
1219
- messageElement: Element;
1220
- /** The number of elements that reference this message element via `aria-describedby`. */
1221
- referenceCount: number;
1222
- }
1223
-
1224
- /**
1225
- * Removes the given ID from the specified ARIA attribute on an element.
1226
- * Used for attributes such as aria-labelledby, aria-owns, etc.
1227
- */
1228
- export declare function removeAriaReferencedId(el: Element, attr: `aria-${string}`, id: string): void;
1229
-
1230
- /** Injection token that determines the key manager to use. */
1231
- export declare const TREE_KEY_MANAGER: InjectionToken<TreeKeyManagerFactory<any>>;
1232
-
1233
- /** @docs-private */
1234
- export declare function TREE_KEY_MANAGER_FACTORY<T extends TreeKeyManagerItem>(): TreeKeyManagerFactory<T>;
1235
-
1236
- /** @docs-private */
1237
- export declare const TREE_KEY_MANAGER_FACTORY_PROVIDER: {
1238
- provide: InjectionToken<TreeKeyManagerFactory<any>>;
1239
- useFactory: typeof TREE_KEY_MANAGER_FACTORY;
1240
- };
173
+ *
174
+ * @breaking-change 21.0.0
175
+ */
176
+ declare const NOOP_TREE_KEY_MANAGER_FACTORY_PROVIDER: Provider;
1241
177
 
1242
178
  /**
1243
179
  * This class manages keyboard events for trees. If you pass it a QueryList or other list of tree
1244
180
  * items, it will set the active item, focus, handle expansion and typeahead correctly when
1245
181
  * keyboard events occur.
1246
182
  */
1247
- export declare class TreeKeyManager<T extends TreeKeyManagerItem> implements TreeKeyManagerStrategy<T> {
183
+ declare class TreeKeyManager<T extends TreeKeyManagerItem> implements TreeKeyManagerStrategy<T> {
1248
184
  /** The index of the currently active (focused) item. */
1249
185
  private _activeItemIndex;
1250
186
  /** The currently active (focused) item. */
@@ -1335,120 +271,280 @@ export declare class TreeKeyManager<T extends TreeKeyManagerItem> implements Tre
1335
271
  private _expandAllItemsAtCurrentItemLevel;
1336
272
  private _activateCurrentItem;
1337
273
  }
274
+ /**
275
+ * @docs-private
276
+ * @deprecated No longer used, will be removed.
277
+ * @breaking-change 21.0.0
278
+ */
279
+ declare function TREE_KEY_MANAGER_FACTORY<T extends TreeKeyManagerItem>(): TreeKeyManagerFactory<T>;
280
+ /** Injection token that determines the key manager to use. */
281
+ declare const TREE_KEY_MANAGER: InjectionToken<TreeKeyManagerFactory<any>>;
282
+ /**
283
+ * @docs-private
284
+ * @deprecated No longer used, will be removed.
285
+ * @breaking-change 21.0.0
286
+ */
287
+ declare const TREE_KEY_MANAGER_FACTORY_PROVIDER: {
288
+ provide: InjectionToken<TreeKeyManagerFactory<any>>;
289
+ useFactory: typeof TREE_KEY_MANAGER_FACTORY;
290
+ };
1338
291
 
1339
- export declare type TreeKeyManagerFactory<T extends TreeKeyManagerItem> = (items: Observable<T[]> | QueryList<T> | T[], options: TreeKeyManagerOptions<T>) => TreeKeyManagerStrategy<T>;
1340
-
1341
- /** Represents an item within a tree that can be passed to a TreeKeyManager. */
1342
- export declare interface TreeKeyManagerItem {
1343
- /** Whether the item is disabled. */
1344
- isDisabled?: (() => boolean) | boolean;
1345
- /** The user-facing label for this item. */
1346
- getLabel?(): string;
1347
- /** Perform the main action (i.e. selection) for this item. */
1348
- activate(): void;
1349
- /** Retrieves the parent for this item. This is `null` if there is no parent. */
1350
- getParent(): TreeKeyManagerItem | null;
1351
- /** Retrieves the children for this item. */
1352
- getChildren(): TreeKeyManagerItem[] | Observable<TreeKeyManagerItem[]>;
1353
- /** Determines if the item is currently expanded. */
1354
- isExpanded: (() => boolean) | boolean;
1355
- /** Collapses the item, hiding its children. */
1356
- collapse(): void;
1357
- /** Expands the item, showing its children. */
1358
- expand(): void;
292
+ /**
293
+ * Options for creating a ConfigurableFocusTrap.
294
+ */
295
+ interface ConfigurableFocusTrapConfig {
1359
296
  /**
1360
- * Focuses the item. This should provide some indication to the user that this item is focused.
297
+ * Whether to defer the creation of FocusTrap elements to be done manually by the user.
1361
298
  */
1362
- focus(): void;
299
+ defer: boolean;
300
+ }
301
+
302
+ /** The injection token used to specify the inert strategy. */
303
+ declare const FOCUS_TRAP_INERT_STRATEGY: InjectionToken<FocusTrapInertStrategy>;
304
+ /**
305
+ * A strategy that dictates how FocusTrap should prevent elements
306
+ * outside of the FocusTrap from being focused.
307
+ */
308
+ interface FocusTrapInertStrategy {
309
+ /** Makes all elements outside focusTrap unfocusable. */
310
+ preventFocus(focusTrap: FocusTrap): void;
311
+ /** Reverts elements made unfocusable by preventFocus to their previous state. */
312
+ allowFocus(focusTrap: FocusTrap): void;
313
+ }
314
+
315
+ /**
316
+ * A FocusTrap managed by FocusTrapManager.
317
+ * Implemented by ConfigurableFocusTrap to avoid circular dependency.
318
+ */
319
+ interface ManagedFocusTrap {
320
+ _enable(): void;
321
+ _disable(): void;
322
+ focusInitialElementWhenReady(): Promise<boolean>;
323
+ }
324
+ /** Injectable that ensures only the most recently enabled FocusTrap is active. */
325
+ declare class FocusTrapManager {
326
+ private _focusTrapStack;
1363
327
  /**
1364
- * Unfocus the item. This should remove the focus state.
328
+ * Disables the FocusTrap at the top of the stack, and then pushes
329
+ * the new FocusTrap onto the stack.
1365
330
  */
1366
- unfocus(): void;
331
+ register(focusTrap: ManagedFocusTrap): void;
1367
332
  /**
1368
- * Sets the item to be focusable without actually focusing it.
333
+ * Removes the FocusTrap from the stack, and activates the
334
+ * FocusTrap that is the new top of the stack.
1369
335
  */
1370
- makeFocusable?(): void;
336
+ deregister(focusTrap: ManagedFocusTrap): void;
337
+ static ɵfac: i0.ɵɵFactoryDeclaration<FocusTrapManager, never>;
338
+ static ɵprov: i0.ɵɵInjectableDeclaration<FocusTrapManager>;
1371
339
  }
1372
340
 
1373
341
  /**
1374
- * Configuration for the TreeKeyManager.
342
+ * Class that allows for trapping focus within a DOM element.
343
+ *
344
+ * This class uses a strategy pattern that determines how it traps focus.
345
+ * See FocusTrapInertStrategy.
1375
346
  */
1376
- export declare interface TreeKeyManagerOptions<T extends TreeKeyManagerItem> {
347
+ declare class ConfigurableFocusTrap extends FocusTrap implements ManagedFocusTrap {
348
+ private _focusTrapManager;
349
+ private _inertStrategy;
350
+ /** Whether the FocusTrap is enabled. */
351
+ get enabled(): boolean;
352
+ set enabled(value: boolean);
353
+ constructor(_element: HTMLElement, _checker: InteractivityChecker, _ngZone: NgZone, _document: Document, _focusTrapManager: FocusTrapManager, _inertStrategy: FocusTrapInertStrategy, config: ConfigurableFocusTrapConfig, injector?: Injector);
354
+ /** Notifies the FocusTrapManager that this FocusTrap will be destroyed. */
355
+ destroy(): void;
356
+ /** @docs-private Implemented as part of ManagedFocusTrap. */
357
+ _enable(): void;
358
+ /** @docs-private Implemented as part of ManagedFocusTrap. */
359
+ _disable(): void;
360
+ }
361
+
362
+ /** Factory that allows easy instantiation of configurable focus traps. */
363
+ declare class ConfigurableFocusTrapFactory {
364
+ private _checker;
365
+ private _ngZone;
366
+ private _focusTrapManager;
367
+ private _document;
368
+ private _inertStrategy;
369
+ private readonly _injector;
370
+ constructor(...args: unknown[]);
1377
371
  /**
1378
- * If true, then the key manager will call `activate` in addition to calling `focus` when a
1379
- * particular item is focused.
372
+ * Creates a focus-trapped region around the given element.
373
+ * @param element The element around which focus will be trapped.
374
+ * @param config The focus trap configuration.
375
+ * @returns The created focus trap instance.
1380
376
  */
1381
- shouldActivationFollowFocus?: boolean;
377
+ create(element: HTMLElement, config?: ConfigurableFocusTrapConfig): ConfigurableFocusTrap;
1382
378
  /**
1383
- * The direction in which the tree items are laid out horizontally. This influences which key
1384
- * will be interpreted as expand or collapse.
379
+ * @deprecated Pass a config object instead of the `deferCaptureElements` flag.
380
+ * @breaking-change 11.0.0
1385
381
  */
1386
- horizontalOrientation?: 'rtl' | 'ltr';
382
+ create(element: HTMLElement, deferCaptureElements: boolean): ConfigurableFocusTrap;
383
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfigurableFocusTrapFactory, never>;
384
+ static ɵprov: i0.ɵɵInjectableDeclaration<ConfigurableFocusTrapFactory>;
385
+ }
386
+
387
+ /**
388
+ * Lightweight FocusTrapInertStrategy that adds a document focus event
389
+ * listener to redirect focus back inside the FocusTrap.
390
+ */
391
+ declare class EventListenerFocusTrapInertStrategy implements FocusTrapInertStrategy {
392
+ /** Focus event handler. */
393
+ private _listener;
394
+ /** Adds a document event listener that keeps focus inside the FocusTrap. */
395
+ preventFocus(focusTrap: ConfigurableFocusTrap): void;
396
+ /** Removes the event listener added in preventFocus. */
397
+ allowFocus(focusTrap: ConfigurableFocusTrap): void;
1387
398
  /**
1388
- * If provided, navigation "skips" over items that pass the given predicate.
399
+ * Refocuses the first element in the FocusTrap if the focus event target was outside
400
+ * the FocusTrap.
1389
401
  *
1390
- * If the item is to be skipped, predicate function should return false.
402
+ * This is an event listener callback. The event listener is added in runOutsideAngular,
403
+ * so all this code runs outside Angular as well.
404
+ */
405
+ private _trapFocus;
406
+ }
407
+
408
+ /**
409
+ * The input modalities detected by this service. Null is used if the input modality is unknown.
410
+ */
411
+ type InputModality = 'keyboard' | 'mouse' | 'touch' | null;
412
+ /** Options to configure the behavior of the InputModalityDetector. */
413
+ interface InputModalityDetectorOptions {
414
+ /** Keys to ignore when detecting keyboard input modality. */
415
+ ignoreKeys?: number[];
416
+ }
417
+ /**
418
+ * Injectable options for the InputModalityDetector. These are shallowly merged with the default
419
+ * options.
420
+ */
421
+ declare const INPUT_MODALITY_DETECTOR_OPTIONS: InjectionToken<InputModalityDetectorOptions>;
422
+ /**
423
+ * Default options for the InputModalityDetector.
424
+ *
425
+ * Modifier keys are ignored by default (i.e. when pressed won't cause the service to detect
426
+ * keyboard input modality) for two reasons:
427
+ *
428
+ * 1. Modifier keys are commonly used with mouse to perform actions such as 'right click' or 'open
429
+ * in new tab', and are thus less representative of actual keyboard interaction.
430
+ * 2. VoiceOver triggers some keyboard events when linearly navigating with Control + Option (but
431
+ * confusingly not with Caps Lock). Thus, to have parity with other screen readers, we ignore
432
+ * these keys so as to not update the input modality.
433
+ *
434
+ * Note that we do not by default ignore the right Meta key on Safari because it has the same key
435
+ * code as the ContextMenu key on other browsers. When we switch to using event.key, we can
436
+ * distinguish between the two.
437
+ */
438
+ declare const INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS: InputModalityDetectorOptions;
439
+ /**
440
+ * Service that detects the user's input modality.
441
+ *
442
+ * This service does not update the input modality when a user navigates with a screen reader
443
+ * (e.g. linear navigation with VoiceOver, object navigation / browse mode with NVDA, virtual PC
444
+ * cursor mode with JAWS). This is in part due to technical limitations (i.e. keyboard events do not
445
+ * fire as expected in these modes) but is also arguably the correct behavior. Navigating with a
446
+ * screen reader is akin to visually scanning a page, and should not be interpreted as actual user
447
+ * input interaction.
448
+ *
449
+ * When a user is not navigating but *interacting* with a screen reader, this service attempts to
450
+ * update the input modality to keyboard, but in general this service's behavior is largely
451
+ * undefined.
452
+ */
453
+ declare class InputModalityDetector implements OnDestroy {
454
+ private readonly _platform;
455
+ private readonly _listenerCleanups;
456
+ /** Emits whenever an input modality is detected. */
457
+ readonly modalityDetected: Observable<InputModality>;
458
+ /** Emits when the input modality changes. */
459
+ readonly modalityChanged: Observable<InputModality>;
460
+ /** The most recently detected input modality. */
461
+ get mostRecentModality(): InputModality;
462
+ /**
463
+ * The most recently detected input modality event target. Is null if no input modality has been
464
+ * detected or if the associated event target is null for some unknown reason.
1391
465
  */
1392
- skipPredicate?: (item: T) => boolean;
466
+ _mostRecentTarget: HTMLElement | null;
467
+ /** The underlying BehaviorSubject that emits whenever an input modality is detected. */
468
+ private readonly _modality;
469
+ /** Options for this InputModalityDetector. */
470
+ private readonly _options;
1393
471
  /**
1394
- * If provided, determines how the key manager determines if two items are equivalent.
1395
- *
1396
- * It should provide a unique key for each unique tree item. If two tree items are equivalent,
1397
- * then this function should return the same value.
472
+ * The timestamp of the last touch input modality. Used to determine whether mousedown events
473
+ * should be attributed to mouse or touch.
1398
474
  */
1399
- trackBy?: (treeItem: T) => unknown;
475
+ private _lastTouchMs;
1400
476
  /**
1401
- * If a value is provided, enables typeahead mode, which allows users to set the active item
1402
- * by typing the visible label of the item.
1403
- *
1404
- * If a number is provided, this will be the time to wait after the last keystroke before
1405
- * setting the active item. If `true` is provided, the default interval of 200ms will be used.
477
+ * Handles keydown events. Must be an arrow function in order to preserve the context when it gets
478
+ * bound.
1406
479
  */
1407
- typeAheadDebounceInterval?: true | number;
1408
- }
1409
-
1410
- export declare interface TreeKeyManagerStrategy<T extends TreeKeyManagerItem> {
1411
- /** Stream that emits any time the focused item changes. */
1412
- readonly change: Subject<T | null>;
480
+ private _onKeydown;
1413
481
  /**
1414
- * Cleans up the key manager.
482
+ * Handles mousedown events. Must be an arrow function in order to preserve the context when it
483
+ * gets bound.
1415
484
  */
1416
- destroy(): void;
485
+ private _onMousedown;
1417
486
  /**
1418
- * Handles a keyboard event on the tree.
1419
- *
1420
- * @param event Keyboard event that represents the user interaction with the tree.
487
+ * Handles touchstart events. Must be an arrow function in order to preserve the context when it
488
+ * gets bound.
1421
489
  */
1422
- onKeydown(event: KeyboardEvent): void;
1423
- /** Index of the currently active item. */
1424
- getActiveItemIndex(): number | null;
1425
- /** The currently active item. */
1426
- getActiveItem(): T | null;
490
+ private _onTouchstart;
491
+ constructor(...args: unknown[]);
492
+ ngOnDestroy(): void;
493
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputModalityDetector, never>;
494
+ static ɵprov: i0.ɵɵInjectableDeclaration<InputModalityDetector>;
495
+ }
496
+
497
+ /** Gets whether an event could be a faked `mousedown` event dispatched by a screen reader. */
498
+ declare function isFakeMousedownFromScreenReader(event: MouseEvent): boolean;
499
+ /** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */
500
+ declare function isFakeTouchstartFromScreenReader(event: TouchEvent): boolean;
501
+
502
+ /** Set of possible high-contrast mode backgrounds. */
503
+ declare enum HighContrastMode {
504
+ NONE = 0,
505
+ BLACK_ON_WHITE = 1,
506
+ WHITE_ON_BLACK = 2
507
+ }
508
+ /**
509
+ * Service to determine whether the browser is currently in a high-contrast-mode environment.
510
+ *
511
+ * Microsoft Windows supports an accessibility feature called "High Contrast Mode". This mode
512
+ * changes the appearance of all applications, including web applications, to dramatically increase
513
+ * contrast.
514
+ *
515
+ * IE, Edge, and Firefox currently support this mode. Chrome does not support Windows High Contrast
516
+ * Mode. This service does not detect high-contrast mode as added by the Chrome "High Contrast"
517
+ * browser extension.
518
+ */
519
+ declare class HighContrastModeDetector implements OnDestroy {
520
+ private _platform;
1427
521
  /**
1428
- * Focus the provided item by index.
1429
- *
1430
- * Updates the state of the currently active item. Emits to `change` stream if active item
1431
- * Changes.
1432
- * @param index The index of the item to focus.
1433
- * @param options Additional focusing options.
522
+ * Figuring out the high contrast mode and adding the body classes can cause
523
+ * some expensive layouts. This flag is used to ensure that we only do it once.
1434
524
  */
1435
- focusItem(index: number, options?: {
1436
- emitChangeEvent?: boolean;
1437
- }): void;
525
+ private _hasCheckedHighContrastMode;
526
+ private _document;
527
+ private _breakpointSubscription;
528
+ constructor(...args: unknown[]);
529
+ /** Gets the current high-contrast-mode for the page. */
530
+ getHighContrastMode(): HighContrastMode;
531
+ ngOnDestroy(): void;
532
+ /** Applies CSS classes indicating high-contrast mode to document body (browser-only). */
533
+ _applyBodyHighContrastModeCssClasses(): void;
534
+ static ɵfac: i0.ɵɵFactoryDeclaration<HighContrastModeDetector, never>;
535
+ static ɵprov: i0.ɵɵInjectableDeclaration<HighContrastModeDetector>;
536
+ }
537
+
538
+ /** Service that generates unique IDs for DOM nodes. */
539
+ declare class _IdGenerator {
540
+ private _appId;
1438
541
  /**
1439
- * Focus the provided item.
1440
- *
1441
- * Updates the state of the currently active item. Emits to `change` stream if active item
1442
- * Changes.
1443
- * @param item The item to focus. Equality is determined via the trackBy function.
1444
- * @param options Additional focusing options.
542
+ * Generates a unique ID with a specific prefix.
543
+ * @param prefix Prefix to add to the ID.
1445
544
  */
1446
- focusItem(item: T, options?: {
1447
- emitChangeEvent?: boolean;
1448
- }): void;
1449
- focusItem(itemOrIndex: number | T, options?: {
1450
- emitChangeEvent?: boolean;
1451
- }): void;
545
+ getId(prefix: string): string;
546
+ static ɵfac: i0.ɵɵFactoryDeclaration<_IdGenerator, never>;
547
+ static ɵprov: i0.ɵɵInjectableDeclaration<_IdGenerator>;
1452
548
  }
1453
549
 
1454
- export { }
550
+ export { AriaDescriber, CDK_DESCRIBEDBY_HOST_ATTRIBUTE, CDK_DESCRIBEDBY_ID_PREFIX, ConfigurableFocusTrap, type ConfigurableFocusTrapConfig, ConfigurableFocusTrapFactory, EventListenerFocusTrapInertStrategy, FOCUS_TRAP_INERT_STRATEGY, type FocusTrapInertStrategy, HighContrastMode, HighContrastModeDetector, INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS, INPUT_MODALITY_DETECTOR_OPTIONS, type InputModality, InputModalityDetector, type InputModalityDetectorOptions, MESSAGES_CONTAINER_ID, NOOP_TREE_KEY_MANAGER_FACTORY, NOOP_TREE_KEY_MANAGER_FACTORY_PROVIDER, NoopTreeKeyManager, type RegisteredMessage, TREE_KEY_MANAGER, TREE_KEY_MANAGER_FACTORY, TREE_KEY_MANAGER_FACTORY_PROVIDER, TreeKeyManager, _IdGenerator, addAriaReferencedId, getAriaReferenceIds, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader, removeAriaReferencedId };