@kato-lee/cdk 14.2.7

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 (374) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +8 -0
  3. package/_index.scss +8 -0
  4. package/a11y/_index.import.scss +2 -0
  5. package/a11y/_index.scss +102 -0
  6. package/a11y/index.d.ts +1212 -0
  7. package/a11y-prebuilt.css +1 -0
  8. package/accordion/index.d.ts +140 -0
  9. package/bidi/index.d.ts +80 -0
  10. package/clipboard/index.d.ts +115 -0
  11. package/coercion/index.d.ts +67 -0
  12. package/collections/index.d.ts +374 -0
  13. package/dialog/index.d.ts +469 -0
  14. package/drag-drop/index.d.ts +1614 -0
  15. package/esm2020/a11y/a11y-module.mjs +32 -0
  16. package/esm2020/a11y/a11y_public_index.mjs +5 -0
  17. package/esm2020/a11y/aria-describer/aria-describer.mjs +232 -0
  18. package/esm2020/a11y/aria-describer/aria-reference.mjs +44 -0
  19. package/esm2020/a11y/fake-event-detection.mjs +31 -0
  20. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +451 -0
  21. package/esm2020/a11y/focus-trap/configurable-focus-trap-config.mjs +9 -0
  22. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +53 -0
  23. package/esm2020/a11y/focus-trap/configurable-focus-trap.mjs +51 -0
  24. package/esm2020/a11y/focus-trap/event-listener-inert-strategy.mjs +61 -0
  25. package/esm2020/a11y/focus-trap/focus-trap-inert-strategy.mjs +11 -0
  26. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +53 -0
  27. package/esm2020/a11y/focus-trap/focus-trap.mjs +402 -0
  28. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +109 -0
  29. package/esm2020/a11y/index.mjs +9 -0
  30. package/esm2020/a11y/input-modality/input-modality-detector.mjs +176 -0
  31. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +238 -0
  32. package/esm2020/a11y/key-manager/activedescendant-key-manager.mjs +20 -0
  33. package/esm2020/a11y/key-manager/focus-key-manager.mjs +29 -0
  34. package/esm2020/a11y/key-manager/list-key-manager.mjs +321 -0
  35. package/esm2020/a11y/live-announcer/live-announcer-tokens.mjs +19 -0
  36. package/esm2020/a11y/live-announcer/live-announcer.mjs +178 -0
  37. package/esm2020/a11y/public-api.mjs +26 -0
  38. package/esm2020/accordion/accordion-item.mjs +167 -0
  39. package/esm2020/accordion/accordion-module.mjs +24 -0
  40. package/esm2020/accordion/accordion.mjs +70 -0
  41. package/esm2020/accordion/accordion_public_index.mjs +5 -0
  42. package/esm2020/accordion/index.mjs +9 -0
  43. package/esm2020/accordion/public-api.mjs +11 -0
  44. package/esm2020/bidi/bidi-module.mjs +23 -0
  45. package/esm2020/bidi/bidi_public_index.mjs +5 -0
  46. package/esm2020/bidi/dir-document-token.mjs +33 -0
  47. package/esm2020/bidi/dir.mjs +69 -0
  48. package/esm2020/bidi/directionality.mjs +52 -0
  49. package/esm2020/bidi/index.mjs +9 -0
  50. package/esm2020/bidi/public-api.mjs +12 -0
  51. package/esm2020/clipboard/clipboard-module.mjs +23 -0
  52. package/esm2020/clipboard/clipboard.mjs +53 -0
  53. package/esm2020/clipboard/clipboard_public_index.mjs +5 -0
  54. package/esm2020/clipboard/copy-to-clipboard.mjs +99 -0
  55. package/esm2020/clipboard/index.mjs +9 -0
  56. package/esm2020/clipboard/pending-copy.mjs +69 -0
  57. package/esm2020/clipboard/public-api.mjs +12 -0
  58. package/esm2020/coercion/array.mjs +11 -0
  59. package/esm2020/coercion/boolean-property.mjs +12 -0
  60. package/esm2020/coercion/css-pixel-value.mjs +15 -0
  61. package/esm2020/coercion/element.mjs +16 -0
  62. package/esm2020/coercion/index.mjs +9 -0
  63. package/esm2020/coercion/number-property.mjs +21 -0
  64. package/esm2020/coercion/public-api.mjs +14 -0
  65. package/esm2020/coercion/string-array.mjs +38 -0
  66. package/esm2020/collections/array-data-source.mjs +21 -0
  67. package/esm2020/collections/collection-viewer.mjs +9 -0
  68. package/esm2020/collections/collections_public_index.mjs +5 -0
  69. package/esm2020/collections/data-source.mjs +19 -0
  70. package/esm2020/collections/dispose-view-repeater-strategy.mjs +47 -0
  71. package/esm2020/collections/index.mjs +9 -0
  72. package/esm2020/collections/public-api.mjs +17 -0
  73. package/esm2020/collections/recycle-view-repeater-strategy.mjs +128 -0
  74. package/esm2020/collections/selection-model.mjs +216 -0
  75. package/esm2020/collections/tree-adapter.mjs +9 -0
  76. package/esm2020/collections/unique-selection-dispatcher.mjs +55 -0
  77. package/esm2020/collections/view-repeater.mjs +14 -0
  78. package/esm2020/dialog/dialog-config.mjs +63 -0
  79. package/esm2020/dialog/dialog-container.mjs +278 -0
  80. package/esm2020/dialog/dialog-injectors.mjs +26 -0
  81. package/esm2020/dialog/dialog-module.mjs +42 -0
  82. package/esm2020/dialog/dialog-ref.mjs +76 -0
  83. package/esm2020/dialog/dialog.mjs +301 -0
  84. package/esm2020/dialog/dialog_public_index.mjs +5 -0
  85. package/esm2020/dialog/index.mjs +9 -0
  86. package/esm2020/dialog/public-api.mjs +14 -0
  87. package/esm2020/drag-drop/directives/assertions.mjs +18 -0
  88. package/esm2020/drag-drop/directives/config.mjs +14 -0
  89. package/esm2020/drag-drop/directives/drag-handle.mjs +66 -0
  90. package/esm2020/drag-drop/directives/drag-placeholder.mjs +36 -0
  91. package/esm2020/drag-drop/directives/drag-preview.mjs +47 -0
  92. package/esm2020/drag-drop/directives/drag.mjs +487 -0
  93. package/esm2020/drag-drop/directives/drop-list-group.mjs +53 -0
  94. package/esm2020/drag-drop/directives/drop-list.mjs +345 -0
  95. package/esm2020/drag-drop/dom/client-rect.mjs +64 -0
  96. package/esm2020/drag-drop/dom/clone-node.mjs +65 -0
  97. package/esm2020/drag-drop/dom/parent-position-tracker.mjs +76 -0
  98. package/esm2020/drag-drop/dom/styling.mjs +69 -0
  99. package/esm2020/drag-drop/dom/transition-duration.mjs +36 -0
  100. package/esm2020/drag-drop/drag-drop-module.mjs +57 -0
  101. package/esm2020/drag-drop/drag-drop-registry.mjs +231 -0
  102. package/esm2020/drag-drop/drag-drop.mjs +57 -0
  103. package/esm2020/drag-drop/drag-drop_public_index.mjs +5 -0
  104. package/esm2020/drag-drop/drag-events.mjs +9 -0
  105. package/esm2020/drag-drop/drag-parent.mjs +16 -0
  106. package/esm2020/drag-drop/drag-ref.mjs +1146 -0
  107. package/esm2020/drag-drop/drag-utils.mjs +60 -0
  108. package/esm2020/drag-drop/drop-list-ref.mjs +577 -0
  109. package/esm2020/drag-drop/index.mjs +9 -0
  110. package/esm2020/drag-drop/public-api.mjs +23 -0
  111. package/esm2020/drag-drop/sorting/drop-list-sort-strategy.mjs +9 -0
  112. package/esm2020/drag-drop/sorting/single-axis-sort-strategy.mjs +341 -0
  113. package/esm2020/index.mjs +9 -0
  114. package/esm2020/keycodes/index.mjs +9 -0
  115. package/esm2020/keycodes/keycodes.mjs +127 -0
  116. package/esm2020/keycodes/keycodes_public_index.mjs +5 -0
  117. package/esm2020/keycodes/modifiers.mjs +18 -0
  118. package/esm2020/keycodes/public-api.mjs +10 -0
  119. package/esm2020/layout/breakpoints-observer.mjs +105 -0
  120. package/esm2020/layout/breakpoints.mjs +29 -0
  121. package/esm2020/layout/index.mjs +9 -0
  122. package/esm2020/layout/layout-module.mjs +19 -0
  123. package/esm2020/layout/layout_public_index.mjs +5 -0
  124. package/esm2020/layout/media-matcher.mjs +85 -0
  125. package/esm2020/layout/public-api.mjs +12 -0
  126. package/esm2020/listbox/index.mjs +9 -0
  127. package/esm2020/listbox/listbox-module.mjs +24 -0
  128. package/esm2020/listbox/listbox.mjs +872 -0
  129. package/esm2020/listbox/listbox_public_index.mjs +5 -0
  130. package/esm2020/listbox/public-api.mjs +10 -0
  131. package/esm2020/menu/context-menu-trigger.mjs +212 -0
  132. package/esm2020/menu/index.mjs +9 -0
  133. package/esm2020/menu/menu-aim.mjs +203 -0
  134. package/esm2020/menu/menu-bar.mjs +133 -0
  135. package/esm2020/menu/menu-base.mjs +187 -0
  136. package/esm2020/menu/menu-errors.mjs +22 -0
  137. package/esm2020/menu/menu-group.mjs +30 -0
  138. package/esm2020/menu/menu-interface.mjs +11 -0
  139. package/esm2020/menu/menu-item-checkbox.mjs +49 -0
  140. package/esm2020/menu/menu-item-radio.mjs +71 -0
  141. package/esm2020/menu/menu-item-selectable.mjs +42 -0
  142. package/esm2020/menu/menu-item.mjs +267 -0
  143. package/esm2020/menu/menu-module.mjs +62 -0
  144. package/esm2020/menu/menu-stack.mjs +156 -0
  145. package/esm2020/menu/menu-trigger-base.mjs +107 -0
  146. package/esm2020/menu/menu-trigger.mjs +291 -0
  147. package/esm2020/menu/menu.mjs +134 -0
  148. package/esm2020/menu/menu_public_index.mjs +5 -0
  149. package/esm2020/menu/pointer-focus-tracker.mjs +51 -0
  150. package/esm2020/menu/public-api.mjs +24 -0
  151. package/esm2020/observers/index.mjs +9 -0
  152. package/esm2020/observers/observe-content.mjs +187 -0
  153. package/esm2020/observers/observers_public_index.mjs +5 -0
  154. package/esm2020/observers/public-api.mjs +9 -0
  155. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +52 -0
  156. package/esm2020/overlay/dispatchers/index.mjs +10 -0
  157. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +81 -0
  158. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +138 -0
  159. package/esm2020/overlay/fullscreen-overlay-container.mjs +94 -0
  160. package/esm2020/overlay/index.mjs +9 -0
  161. package/esm2020/overlay/overlay-config.mjs +45 -0
  162. package/esm2020/overlay/overlay-container.mjs +81 -0
  163. package/esm2020/overlay/overlay-directives.mjs +427 -0
  164. package/esm2020/overlay/overlay-module.mjs +29 -0
  165. package/esm2020/overlay/overlay-ref.mjs +427 -0
  166. package/esm2020/overlay/overlay-reference.mjs +9 -0
  167. package/esm2020/overlay/overlay.mjs +125 -0
  168. package/esm2020/overlay/overlay_public_index.mjs +5 -0
  169. package/esm2020/overlay/position/connected-position.mjs +88 -0
  170. package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +985 -0
  171. package/esm2020/overlay/position/global-position-strategy.mjs +237 -0
  172. package/esm2020/overlay/position/overlay-position-builder.mjs +50 -0
  173. package/esm2020/overlay/position/position-strategy.mjs +9 -0
  174. package/esm2020/overlay/position/scroll-clip.mjs +40 -0
  175. package/esm2020/overlay/public-api.mjs +22 -0
  176. package/esm2020/overlay/scroll/block-scroll-strategy.mjs +80 -0
  177. package/esm2020/overlay/scroll/close-scroll-strategy.mjs +61 -0
  178. package/esm2020/overlay/scroll/index.mjs +14 -0
  179. package/esm2020/overlay/scroll/noop-scroll-strategy.mjs +17 -0
  180. package/esm2020/overlay/scroll/reposition-scroll-strategy.mjs +61 -0
  181. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +55 -0
  182. package/esm2020/overlay/scroll/scroll-strategy.mjs +14 -0
  183. package/esm2020/platform/features/input-types.mjs +59 -0
  184. package/esm2020/platform/features/passive-listeners.mjs +36 -0
  185. package/esm2020/platform/features/scrolling.mjs +85 -0
  186. package/esm2020/platform/features/shadow-dom.mjs +54 -0
  187. package/esm2020/platform/features/test-environment.mjs +24 -0
  188. package/esm2020/platform/index.mjs +9 -0
  189. package/esm2020/platform/platform-module.mjs +19 -0
  190. package/esm2020/platform/platform.mjs +85 -0
  191. package/esm2020/platform/platform_public_index.mjs +5 -0
  192. package/esm2020/platform/public-api.mjs +15 -0
  193. package/esm2020/portal/dom-portal-outlet.mjs +158 -0
  194. package/esm2020/portal/index.mjs +9 -0
  195. package/esm2020/portal/portal-directives.mjs +246 -0
  196. package/esm2020/portal/portal-errors.mjs +51 -0
  197. package/esm2020/portal/portal-injector.mjs +28 -0
  198. package/esm2020/portal/portal.mjs +188 -0
  199. package/esm2020/portal/portal_public_index.mjs +5 -0
  200. package/esm2020/portal/public-api.mjs +12 -0
  201. package/esm2020/public-api.mjs +9 -0
  202. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +217 -0
  203. package/esm2020/scrolling/index.mjs +9 -0
  204. package/esm2020/scrolling/public-api.mjs +20 -0
  205. package/esm2020/scrolling/scroll-dispatcher.mjs +163 -0
  206. package/esm2020/scrolling/scrollable.mjs +176 -0
  207. package/esm2020/scrolling/scrolling-module.mjs +67 -0
  208. package/esm2020/scrolling/scrolling_public_index.mjs +5 -0
  209. package/esm2020/scrolling/viewport-ruler.mjs +146 -0
  210. package/esm2020/scrolling/virtual-for-of.mjs +298 -0
  211. package/esm2020/scrolling/virtual-scroll-repeater.mjs +9 -0
  212. package/esm2020/scrolling/virtual-scroll-strategy.mjs +11 -0
  213. package/esm2020/scrolling/virtual-scroll-viewport.mjs +437 -0
  214. package/esm2020/scrolling/virtual-scrollable-element.mjs +41 -0
  215. package/esm2020/scrolling/virtual-scrollable-window.mjs +40 -0
  216. package/esm2020/scrolling/virtual-scrollable.mjs +40 -0
  217. package/esm2020/stepper/index.mjs +9 -0
  218. package/esm2020/stepper/public-api.mjs +13 -0
  219. package/esm2020/stepper/step-header.mjs +30 -0
  220. package/esm2020/stepper/step-label.mjs +23 -0
  221. package/esm2020/stepper/stepper-button.mjs +56 -0
  222. package/esm2020/stepper/stepper-module.mjs +40 -0
  223. package/esm2020/stepper/stepper.mjs +458 -0
  224. package/esm2020/stepper/stepper_public_index.mjs +5 -0
  225. package/esm2020/table/can-stick.mjs +44 -0
  226. package/esm2020/table/cell.mjs +217 -0
  227. package/esm2020/table/coalesced-style-scheduler.mjs +91 -0
  228. package/esm2020/table/index.mjs +9 -0
  229. package/esm2020/table/public-api.mjs +20 -0
  230. package/esm2020/table/row.mjs +262 -0
  231. package/esm2020/table/sticky-position-listener.mjs +11 -0
  232. package/esm2020/table/sticky-styler.mjs +345 -0
  233. package/esm2020/table/table-errors.mjs +67 -0
  234. package/esm2020/table/table-module.mjs +94 -0
  235. package/esm2020/table/table.mjs +1065 -0
  236. package/esm2020/table/table_public_index.mjs +5 -0
  237. package/esm2020/table/text-column.mjs +153 -0
  238. package/esm2020/table/tokens.mjs +16 -0
  239. package/esm2020/text-field/autofill.mjs +113 -0
  240. package/esm2020/text-field/autosize.mjs +309 -0
  241. package/esm2020/text-field/index.mjs +9 -0
  242. package/esm2020/text-field/public-api.mjs +11 -0
  243. package/esm2020/text-field/text-field-module.mjs +24 -0
  244. package/esm2020/text-field/text-field_public_index.mjs +5 -0
  245. package/esm2020/tree/control/base-tree-control.mjs +57 -0
  246. package/esm2020/tree/control/flat-tree-control.mjs +51 -0
  247. package/esm2020/tree/control/nested-tree-control.mjs +58 -0
  248. package/esm2020/tree/control/tree-control.mjs +2 -0
  249. package/esm2020/tree/index.mjs +9 -0
  250. package/esm2020/tree/nested-node.mjs +112 -0
  251. package/esm2020/tree/node.mjs +35 -0
  252. package/esm2020/tree/outlet.mjs +39 -0
  253. package/esm2020/tree/padding.mjs +131 -0
  254. package/esm2020/tree/public-api.mjs +20 -0
  255. package/esm2020/tree/toggle.mjs +50 -0
  256. package/esm2020/tree/tree-errors.mjs +43 -0
  257. package/esm2020/tree/tree-module.mjs +49 -0
  258. package/esm2020/tree/tree.mjs +347 -0
  259. package/esm2020/tree/tree_public_index.mjs +5 -0
  260. package/esm2020/version.mjs +11 -0
  261. package/fesm2015/a11y.mjs +2473 -0
  262. package/fesm2015/a11y.mjs.map +1 -0
  263. package/fesm2015/accordion.mjs +414 -0
  264. package/fesm2015/accordion.mjs.map +1 -0
  265. package/fesm2015/bidi.mjs +194 -0
  266. package/fesm2015/bidi.mjs.map +1 -0
  267. package/fesm2015/cdk.mjs +30 -0
  268. package/fesm2015/cdk.mjs.map +1 -0
  269. package/fesm2015/clipboard.mjs +263 -0
  270. package/fesm2015/clipboard.mjs.map +1 -0
  271. package/fesm2015/coercion.mjs +132 -0
  272. package/fesm2015/coercion.mjs.map +1 -0
  273. package/fesm2015/collections.mjs +519 -0
  274. package/fesm2015/collections.mjs.map +1 -0
  275. package/fesm2015/dialog.mjs +1050 -0
  276. package/fesm2015/dialog.mjs.map +1 -0
  277. package/fesm2015/drag-drop.mjs +3812 -0
  278. package/fesm2015/drag-drop.mjs.map +1 -0
  279. package/fesm2015/keycodes.mjs +167 -0
  280. package/fesm2015/keycodes.mjs.map +1 -0
  281. package/fesm2015/layout.mjs +337 -0
  282. package/fesm2015/layout.mjs.map +1 -0
  283. package/fesm2015/listbox.mjs +1200 -0
  284. package/fesm2015/listbox.mjs.map +1 -0
  285. package/fesm2015/menu.mjs +2719 -0
  286. package/fesm2015/menu.mjs.map +1 -0
  287. package/fesm2015/observers.mjs +326 -0
  288. package/fesm2015/observers.mjs.map +1 -0
  289. package/fesm2015/overlay.mjs +3137 -0
  290. package/fesm2015/overlay.mjs.map +1 -0
  291. package/fesm2015/platform.mjs +385 -0
  292. package/fesm2015/platform.mjs.map +1 -0
  293. package/fesm2015/portal.mjs +691 -0
  294. package/fesm2015/portal.mjs.map +1 -0
  295. package/fesm2015/scrolling.mjs +1558 -0
  296. package/fesm2015/scrolling.mjs.map +1 -0
  297. package/fesm2015/stepper.mjs +989 -0
  298. package/fesm2015/stepper.mjs.map +1 -0
  299. package/fesm2015/table.mjs +2356 -0
  300. package/fesm2015/table.mjs.map +1 -0
  301. package/fesm2015/testing.mjs +833 -0
  302. package/fesm2015/testing.mjs.map +1 -0
  303. package/fesm2015/text-field.mjs +461 -0
  304. package/fesm2015/text-field.mjs.map +1 -0
  305. package/fesm2015/tree.mjs +1303 -0
  306. package/fesm2015/tree.mjs.map +1 -0
  307. package/fesm2020/a11y.mjs +2476 -0
  308. package/fesm2020/a11y.mjs.map +1 -0
  309. package/fesm2020/accordion.mjs +414 -0
  310. package/fesm2020/accordion.mjs.map +1 -0
  311. package/fesm2020/bidi.mjs +192 -0
  312. package/fesm2020/bidi.mjs.map +1 -0
  313. package/fesm2020/cdk.mjs +30 -0
  314. package/fesm2020/cdk.mjs.map +1 -0
  315. package/fesm2020/clipboard.mjs +259 -0
  316. package/fesm2020/clipboard.mjs.map +1 -0
  317. package/fesm2020/coercion.mjs +132 -0
  318. package/fesm2020/coercion.mjs.map +1 -0
  319. package/fesm2020/collections.mjs +535 -0
  320. package/fesm2020/collections.mjs.map +1 -0
  321. package/fesm2020/dialog.mjs +787 -0
  322. package/fesm2020/dialog.mjs.map +1 -0
  323. package/fesm2020/drag-drop.mjs +3808 -0
  324. package/fesm2020/drag-drop.mjs.map +1 -0
  325. package/fesm2020/keycodes.mjs +167 -0
  326. package/fesm2020/keycodes.mjs.map +1 -0
  327. package/fesm2020/layout.mjs +337 -0
  328. package/fesm2020/layout.mjs.map +1 -0
  329. package/fesm2020/listbox.mjs +1164 -0
  330. package/fesm2020/listbox.mjs.map +1 -0
  331. package/fesm2020/menu.mjs +2615 -0
  332. package/fesm2020/menu.mjs.map +1 -0
  333. package/fesm2020/observers.mjs +325 -0
  334. package/fesm2020/observers.mjs.map +1 -0
  335. package/fesm2020/overlay.mjs +3145 -0
  336. package/fesm2020/overlay.mjs.map +1 -0
  337. package/fesm2020/platform.mjs +383 -0
  338. package/fesm2020/platform.mjs.map +1 -0
  339. package/fesm2020/portal.mjs +689 -0
  340. package/fesm2020/portal.mjs.map +1 -0
  341. package/fesm2020/scrolling.mjs +1591 -0
  342. package/fesm2020/scrolling.mjs.map +1 -0
  343. package/fesm2020/stepper.mjs +985 -0
  344. package/fesm2020/stepper.mjs.map +1 -0
  345. package/fesm2020/table.mjs +2348 -0
  346. package/fesm2020/table.mjs.map +1 -0
  347. package/fesm2020/testing.mjs +797 -0
  348. package/fesm2020/testing.mjs.map +1 -0
  349. package/fesm2020/text-field.mjs +459 -0
  350. package/fesm2020/text-field.mjs.map +1 -0
  351. package/fesm2020/tree.mjs +1305 -0
  352. package/fesm2020/tree.mjs.map +1 -0
  353. package/index.d.ts +6 -0
  354. package/keycodes/index.d.ts +249 -0
  355. package/layout/index.d.ts +90 -0
  356. package/listbox/index.d.ts +419 -0
  357. package/menu/index.d.ts +1013 -0
  358. package/observers/index.d.ts +109 -0
  359. package/overlay/_index-deprecated.scss +13 -0
  360. package/overlay/_index.import.scss +13 -0
  361. package/overlay/_index.scss +152 -0
  362. package/overlay/index.d.ts +1343 -0
  363. package/overlay-prebuilt.css +1 -0
  364. package/package.json +232 -0
  365. package/platform/index.d.ts +106 -0
  366. package/portal/index.d.ts +328 -0
  367. package/scrolling/index.d.ts +849 -0
  368. package/stepper/index.d.ts +419 -0
  369. package/table/index.d.ts +1483 -0
  370. package/text-field/_index.import.scss +2 -0
  371. package/text-field/_index.scss +89 -0
  372. package/text-field/index.d.ts +203 -0
  373. package/text-field-prebuilt.css +1 -0
  374. package/tree/index.d.ts +593 -0
@@ -0,0 +1,2473 @@
1
+ import { DOCUMENT } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, APP_ID, Injectable, Inject, QueryList, Directive, Input, InjectionToken, Optional, EventEmitter, Output, NgModule } from '@angular/core';
4
+ import * as i1 from '@kato-lee/cdk/platform';
5
+ import { _getFocusedElementPierceShadowDom, normalizePassiveListenerOptions, _getEventTarget, _getShadowRoot } from '@kato-lee/cdk/platform';
6
+ import { Subject, Subscription, BehaviorSubject, of } from 'rxjs';
7
+ import { hasModifierKey, A, Z, ZERO, NINE, END, HOME, LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, TAB, ALT, CONTROL, MAC_META, META, SHIFT } from '@kato-lee/cdk/keycodes';
8
+ import { tap, debounceTime, filter, map, take, skip, distinctUntilChanged, takeUntil } from 'rxjs/operators';
9
+ import { coerceBooleanProperty, coerceElement } from '@kato-lee/cdk/coercion';
10
+ import * as i1$1 from '@kato-lee/cdk/observers';
11
+ import { ObserversModule } from '@kato-lee/cdk/observers';
12
+ import { BreakpointObserver } from '@kato-lee/cdk/layout';
13
+
14
+ /**
15
+ * @license
16
+ * Copyright Google LLC All Rights Reserved.
17
+ *
18
+ * Use of this source code is governed by an MIT-style license that can be
19
+ * found in the LICENSE file at https://angular.io/license
20
+ */
21
+ /** IDs are delimited by an empty space, as per the spec. */
22
+ const ID_DELIMITER = ' ';
23
+ /**
24
+ * Adds the given ID to the specified ARIA attribute on an element.
25
+ * Used for attributes such as aria-labelledby, aria-owns, etc.
26
+ */
27
+ function addAriaReferencedId(el, attr, id) {
28
+ const ids = getAriaReferenceIds(el, attr);
29
+ if (ids.some(existingId => existingId.trim() == id.trim())) {
30
+ return;
31
+ }
32
+ ids.push(id.trim());
33
+ el.setAttribute(attr, ids.join(ID_DELIMITER));
34
+ }
35
+ /**
36
+ * Removes the given ID from the specified ARIA attribute on an element.
37
+ * Used for attributes such as aria-labelledby, aria-owns, etc.
38
+ */
39
+ function removeAriaReferencedId(el, attr, id) {
40
+ const ids = getAriaReferenceIds(el, attr);
41
+ const filteredIds = ids.filter(val => val != id.trim());
42
+ if (filteredIds.length) {
43
+ el.setAttribute(attr, filteredIds.join(ID_DELIMITER));
44
+ }
45
+ else {
46
+ el.removeAttribute(attr);
47
+ }
48
+ }
49
+ /**
50
+ * Gets the list of IDs referenced by the given ARIA attribute on an element.
51
+ * Used for attributes such as aria-labelledby, aria-owns, etc.
52
+ */
53
+ function getAriaReferenceIds(el, attr) {
54
+ // Get string array of all individual ids (whitespace delimited) in the attribute value
55
+ return (el.getAttribute(attr) || '').match(/\S+/g) || [];
56
+ }
57
+
58
+ /**
59
+ * @license
60
+ * Copyright Google LLC All Rights Reserved.
61
+ *
62
+ * Use of this source code is governed by an MIT-style license that can be
63
+ * found in the LICENSE file at https://angular.io/license
64
+ */
65
+ /**
66
+ * ID used for the body container where all messages are appended.
67
+ * @deprecated No longer being used. To be removed.
68
+ * @breaking-change 14.0.0
69
+ */
70
+ const MESSAGES_CONTAINER_ID = 'cdk-describedby-message-container';
71
+ /**
72
+ * ID prefix used for each created message element.
73
+ * @deprecated To be turned into a private variable.
74
+ * @breaking-change 14.0.0
75
+ */
76
+ const CDK_DESCRIBEDBY_ID_PREFIX = 'cdk-describedby-message';
77
+ /**
78
+ * Attribute given to each host element that is described by a message element.
79
+ * @deprecated To be turned into a private variable.
80
+ * @breaking-change 14.0.0
81
+ */
82
+ const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = 'cdk-describedby-host';
83
+ /** Global incremental identifier for each registered message element. */
84
+ let nextId = 0;
85
+ /**
86
+ * Utility that creates visually hidden elements with a message content. Useful for elements that
87
+ * want to use aria-describedby to further describe themselves without adding additional visual
88
+ * content.
89
+ */
90
+ class AriaDescriber {
91
+ constructor(_document,
92
+ /**
93
+ * @deprecated To be turned into a required parameter.
94
+ * @breaking-change 14.0.0
95
+ */
96
+ _platform) {
97
+ this._platform = _platform;
98
+ /** Map of all registered message elements that have been placed into the document. */
99
+ this._messageRegistry = new Map();
100
+ /** Container for all registered messages. */
101
+ this._messagesContainer = null;
102
+ /** Unique ID for the service. */
103
+ this._id = `${nextId++}`;
104
+ this._document = _document;
105
+ this._id = inject(APP_ID) + '-' + nextId++;
106
+ }
107
+ describe(hostElement, message, role) {
108
+ if (!this._canBeDescribed(hostElement, message)) {
109
+ return;
110
+ }
111
+ const key = getKey(message, role);
112
+ if (typeof message !== 'string') {
113
+ // We need to ensure that the element has an ID.
114
+ setMessageId(message, this._id);
115
+ this._messageRegistry.set(key, { messageElement: message, referenceCount: 0 });
116
+ }
117
+ else if (!this._messageRegistry.has(key)) {
118
+ this._createMessageElement(message, role);
119
+ }
120
+ if (!this._isElementDescribedByMessage(hostElement, key)) {
121
+ this._addMessageReference(hostElement, key);
122
+ }
123
+ }
124
+ removeDescription(hostElement, message, role) {
125
+ var _a;
126
+ if (!message || !this._isElementNode(hostElement)) {
127
+ return;
128
+ }
129
+ const key = getKey(message, role);
130
+ if (this._isElementDescribedByMessage(hostElement, key)) {
131
+ this._removeMessageReference(hostElement, key);
132
+ }
133
+ // If the message is a string, it means that it's one that we created for the
134
+ // consumer so we can remove it safely, otherwise we should leave it in place.
135
+ if (typeof message === 'string') {
136
+ const registeredMessage = this._messageRegistry.get(key);
137
+ if (registeredMessage && registeredMessage.referenceCount === 0) {
138
+ this._deleteMessageElement(key);
139
+ }
140
+ }
141
+ if (((_a = this._messagesContainer) === null || _a === void 0 ? void 0 : _a.childNodes.length) === 0) {
142
+ this._messagesContainer.remove();
143
+ this._messagesContainer = null;
144
+ }
145
+ }
146
+ /** Unregisters all created message elements and removes the message container. */
147
+ ngOnDestroy() {
148
+ var _a;
149
+ const describedElements = this._document.querySelectorAll(`[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}="${this._id}"]`);
150
+ for (let i = 0; i < describedElements.length; i++) {
151
+ this._removeCdkDescribedByReferenceIds(describedElements[i]);
152
+ describedElements[i].removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
153
+ }
154
+ (_a = this._messagesContainer) === null || _a === void 0 ? void 0 : _a.remove();
155
+ this._messagesContainer = null;
156
+ this._messageRegistry.clear();
157
+ }
158
+ /**
159
+ * Creates a new element in the visually hidden message container element with the message
160
+ * as its content and adds it to the message registry.
161
+ */
162
+ _createMessageElement(message, role) {
163
+ const messageElement = this._document.createElement('div');
164
+ setMessageId(messageElement, this._id);
165
+ messageElement.textContent = message;
166
+ if (role) {
167
+ messageElement.setAttribute('role', role);
168
+ }
169
+ this._createMessagesContainer();
170
+ this._messagesContainer.appendChild(messageElement);
171
+ this._messageRegistry.set(getKey(message, role), { messageElement, referenceCount: 0 });
172
+ }
173
+ /** Deletes the message element from the global messages container. */
174
+ _deleteMessageElement(key) {
175
+ var _a, _b;
176
+ (_b = (_a = this._messageRegistry.get(key)) === null || _a === void 0 ? void 0 : _a.messageElement) === null || _b === void 0 ? void 0 : _b.remove();
177
+ this._messageRegistry.delete(key);
178
+ }
179
+ /** Creates the global container for all aria-describedby messages. */
180
+ _createMessagesContainer() {
181
+ if (this._messagesContainer) {
182
+ return;
183
+ }
184
+ const containerClassName = 'cdk-describedby-message-container';
185
+ const serverContainers = this._document.querySelectorAll(`.${containerClassName}[platform="server"]`);
186
+ for (let i = 0; i < serverContainers.length; i++) {
187
+ // When going from the server to the client, we may end up in a situation where there's
188
+ // already a container on the page, but we don't have a reference to it. Clear the
189
+ // old container so we don't get duplicates. Doing this, instead of emptying the previous
190
+ // container, should be slightly faster.
191
+ serverContainers[i].remove();
192
+ }
193
+ const messagesContainer = this._document.createElement('div');
194
+ // We add `visibility: hidden` in order to prevent text in this container from
195
+ // being searchable by the browser's Ctrl + F functionality.
196
+ // Screen-readers will still read the description for elements with aria-describedby even
197
+ // when the description element is not visible.
198
+ messagesContainer.style.visibility = 'hidden';
199
+ // Even though we use `visibility: hidden`, we still apply `cdk-visually-hidden` so that
200
+ // the description element doesn't impact page layout.
201
+ messagesContainer.classList.add(containerClassName);
202
+ messagesContainer.classList.add('cdk-visually-hidden');
203
+ // @breaking-change 14.0.0 Remove null check for `_platform`.
204
+ if (this._platform && !this._platform.isBrowser) {
205
+ messagesContainer.setAttribute('platform', 'server');
206
+ }
207
+ this._document.body.appendChild(messagesContainer);
208
+ this._messagesContainer = messagesContainer;
209
+ }
210
+ /** Removes all cdk-describedby messages that are hosted through the element. */
211
+ _removeCdkDescribedByReferenceIds(element) {
212
+ // Remove all aria-describedby reference IDs that are prefixed by CDK_DESCRIBEDBY_ID_PREFIX
213
+ const originalReferenceIds = getAriaReferenceIds(element, 'aria-describedby').filter(id => id.indexOf(CDK_DESCRIBEDBY_ID_PREFIX) != 0);
214
+ element.setAttribute('aria-describedby', originalReferenceIds.join(' '));
215
+ }
216
+ /**
217
+ * Adds a message reference to the element using aria-describedby and increments the registered
218
+ * message's reference count.
219
+ */
220
+ _addMessageReference(element, key) {
221
+ const registeredMessage = this._messageRegistry.get(key);
222
+ // Add the aria-describedby reference and set the
223
+ // describedby_host attribute to mark the element.
224
+ addAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);
225
+ element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, this._id);
226
+ registeredMessage.referenceCount++;
227
+ }
228
+ /**
229
+ * Removes a message reference from the element using aria-describedby
230
+ * and decrements the registered message's reference count.
231
+ */
232
+ _removeMessageReference(element, key) {
233
+ const registeredMessage = this._messageRegistry.get(key);
234
+ registeredMessage.referenceCount--;
235
+ removeAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);
236
+ element.removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
237
+ }
238
+ /** Returns true if the element has been described by the provided message ID. */
239
+ _isElementDescribedByMessage(element, key) {
240
+ const referenceIds = getAriaReferenceIds(element, 'aria-describedby');
241
+ const registeredMessage = this._messageRegistry.get(key);
242
+ const messageId = registeredMessage && registeredMessage.messageElement.id;
243
+ return !!messageId && referenceIds.indexOf(messageId) != -1;
244
+ }
245
+ /** Determines whether a message can be described on a particular element. */
246
+ _canBeDescribed(element, message) {
247
+ if (!this._isElementNode(element)) {
248
+ return false;
249
+ }
250
+ if (message && typeof message === 'object') {
251
+ // We'd have to make some assumptions about the description element's text, if the consumer
252
+ // passed in an element. Assume that if an element is passed in, the consumer has verified
253
+ // that it can be used as a description.
254
+ return true;
255
+ }
256
+ const trimmedMessage = message == null ? '' : `${message}`.trim();
257
+ const ariaLabel = element.getAttribute('aria-label');
258
+ // We shouldn't set descriptions if they're exactly the same as the `aria-label` of the
259
+ // element, because screen readers will end up reading out the same text twice in a row.
260
+ return trimmedMessage ? !ariaLabel || ariaLabel.trim() !== trimmedMessage : false;
261
+ }
262
+ /** Checks whether a node is an Element node. */
263
+ _isElementNode(element) {
264
+ return element.nodeType === this._document.ELEMENT_NODE;
265
+ }
266
+ }
267
+ AriaDescriber.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: AriaDescriber, deps: [{ token: DOCUMENT }, { token: i1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
268
+ AriaDescriber.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: AriaDescriber, providedIn: 'root' });
269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: AriaDescriber, decorators: [{
270
+ type: Injectable,
271
+ args: [{ providedIn: 'root' }]
272
+ }], ctorParameters: function () {
273
+ return [{ type: undefined, decorators: [{
274
+ type: Inject,
275
+ args: [DOCUMENT]
276
+ }] }, { type: i1.Platform }];
277
+ } });
278
+ /** Gets a key that can be used to look messages up in the registry. */
279
+ function getKey(message, role) {
280
+ return typeof message === 'string' ? `${role || ''}/${message}` : message;
281
+ }
282
+ /** Assigns a unique ID to an element, if it doesn't have one already. */
283
+ function setMessageId(element, serviceId) {
284
+ if (!element.id) {
285
+ element.id = `${CDK_DESCRIBEDBY_ID_PREFIX}-${serviceId}-${nextId++}`;
286
+ }
287
+ }
288
+
289
+ /**
290
+ * @license
291
+ * Copyright Google LLC All Rights Reserved.
292
+ *
293
+ * Use of this source code is governed by an MIT-style license that can be
294
+ * found in the LICENSE file at https://angular.io/license
295
+ */
296
+ /**
297
+ * This class manages keyboard events for selectable lists. If you pass it a query list
298
+ * of items, it will set the active item correctly when arrow events occur.
299
+ */
300
+ class ListKeyManager {
301
+ constructor(_items) {
302
+ this._items = _items;
303
+ this._activeItemIndex = -1;
304
+ this._activeItem = null;
305
+ this._wrap = false;
306
+ this._letterKeyStream = new Subject();
307
+ this._typeaheadSubscription = Subscription.EMPTY;
308
+ this._vertical = true;
309
+ this._allowedModifierKeys = [];
310
+ this._homeAndEnd = false;
311
+ /**
312
+ * Predicate function that can be used to check whether an item should be skipped
313
+ * by the key manager. By default, disabled items are skipped.
314
+ */
315
+ this._skipPredicateFn = (item) => item.disabled;
316
+ // Buffer for the letters that the user has pressed when the typeahead option is turned on.
317
+ this._pressedLetters = [];
318
+ /**
319
+ * Stream that emits any time the TAB key is pressed, so components can react
320
+ * when focus is shifted off of the list.
321
+ */
322
+ this.tabOut = new Subject();
323
+ /** Stream that emits whenever the active item of the list manager changes. */
324
+ this.change = new Subject();
325
+ // We allow for the items to be an array because, in some cases, the consumer may
326
+ // not have access to a QueryList of the items they want to manage (e.g. when the
327
+ // items aren't being collected via `ViewChildren` or `ContentChildren`).
328
+ if (_items instanceof QueryList) {
329
+ _items.changes.subscribe((newItems) => {
330
+ if (this._activeItem) {
331
+ const itemArray = newItems.toArray();
332
+ const newIndex = itemArray.indexOf(this._activeItem);
333
+ if (newIndex > -1 && newIndex !== this._activeItemIndex) {
334
+ this._activeItemIndex = newIndex;
335
+ }
336
+ }
337
+ });
338
+ }
339
+ }
340
+ /**
341
+ * Sets the predicate function that determines which items should be skipped by the
342
+ * list key manager.
343
+ * @param predicate Function that determines whether the given item should be skipped.
344
+ */
345
+ skipPredicate(predicate) {
346
+ this._skipPredicateFn = predicate;
347
+ return this;
348
+ }
349
+ /**
350
+ * Configures wrapping mode, which determines whether the active item will wrap to
351
+ * the other end of list when there are no more items in the given direction.
352
+ * @param shouldWrap Whether the list should wrap when reaching the end.
353
+ */
354
+ withWrap(shouldWrap = true) {
355
+ this._wrap = shouldWrap;
356
+ return this;
357
+ }
358
+ /**
359
+ * Configures whether the key manager should be able to move the selection vertically.
360
+ * @param enabled Whether vertical selection should be enabled.
361
+ */
362
+ withVerticalOrientation(enabled = true) {
363
+ this._vertical = enabled;
364
+ return this;
365
+ }
366
+ /**
367
+ * Configures the key manager to move the selection horizontally.
368
+ * Passing in `null` will disable horizontal movement.
369
+ * @param direction Direction in which the selection can be moved.
370
+ */
371
+ withHorizontalOrientation(direction) {
372
+ this._horizontal = direction;
373
+ return this;
374
+ }
375
+ /**
376
+ * Modifier keys which are allowed to be held down and whose default actions will be prevented
377
+ * as the user is pressing the arrow keys. Defaults to not allowing any modifier keys.
378
+ */
379
+ withAllowedModifierKeys(keys) {
380
+ this._allowedModifierKeys = keys;
381
+ return this;
382
+ }
383
+ /**
384
+ * Turns on typeahead mode which allows users to set the active item by typing.
385
+ * @param debounceInterval Time to wait after the last keystroke before setting the active item.
386
+ */
387
+ withTypeAhead(debounceInterval = 200) {
388
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
389
+ this._items.length &&
390
+ this._items.some(item => typeof item.getLabel !== 'function')) {
391
+ throw Error('ListKeyManager items in typeahead mode must implement the `getLabel` method.');
392
+ }
393
+ this._typeaheadSubscription.unsubscribe();
394
+ // Debounce the presses of non-navigational keys, collect the ones that correspond to letters
395
+ // and convert those letters back into a string. Afterwards find the first item that starts
396
+ // with that string and select it.
397
+ this._typeaheadSubscription = this._letterKeyStream
398
+ .pipe(tap(letter => this._pressedLetters.push(letter)), debounceTime(debounceInterval), filter(() => this._pressedLetters.length > 0), map(() => this._pressedLetters.join('')))
399
+ .subscribe(inputString => {
400
+ const items = this._getItemsArray();
401
+ // Start at 1 because we want to start searching at the item immediately
402
+ // following the current active item.
403
+ for (let i = 1; i < items.length + 1; i++) {
404
+ const index = (this._activeItemIndex + i) % items.length;
405
+ const item = items[index];
406
+ if (!this._skipPredicateFn(item) &&
407
+ item.getLabel().toUpperCase().trim().indexOf(inputString) === 0) {
408
+ this.setActiveItem(index);
409
+ break;
410
+ }
411
+ }
412
+ this._pressedLetters = [];
413
+ });
414
+ return this;
415
+ }
416
+ /**
417
+ * Configures the key manager to activate the first and last items
418
+ * respectively when the Home or End key is pressed.
419
+ * @param enabled Whether pressing the Home or End key activates the first/last item.
420
+ */
421
+ withHomeAndEnd(enabled = true) {
422
+ this._homeAndEnd = enabled;
423
+ return this;
424
+ }
425
+ setActiveItem(item) {
426
+ const previousActiveItem = this._activeItem;
427
+ this.updateActiveItem(item);
428
+ if (this._activeItem !== previousActiveItem) {
429
+ this.change.next(this._activeItemIndex);
430
+ }
431
+ }
432
+ /**
433
+ * Sets the active item depending on the key event passed in.
434
+ * @param event Keyboard event to be used for determining which element should be active.
435
+ */
436
+ onKeydown(event) {
437
+ const keyCode = event.keyCode;
438
+ const modifiers = ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'];
439
+ const isModifierAllowed = modifiers.every(modifier => {
440
+ return !event[modifier] || this._allowedModifierKeys.indexOf(modifier) > -1;
441
+ });
442
+ switch (keyCode) {
443
+ case TAB:
444
+ this.tabOut.next();
445
+ return;
446
+ case DOWN_ARROW:
447
+ if (this._vertical && isModifierAllowed) {
448
+ this.setNextItemActive();
449
+ break;
450
+ }
451
+ else {
452
+ return;
453
+ }
454
+ case UP_ARROW:
455
+ if (this._vertical && isModifierAllowed) {
456
+ this.setPreviousItemActive();
457
+ break;
458
+ }
459
+ else {
460
+ return;
461
+ }
462
+ case RIGHT_ARROW:
463
+ if (this._horizontal && isModifierAllowed) {
464
+ this._horizontal === 'rtl' ? this.setPreviousItemActive() : this.setNextItemActive();
465
+ break;
466
+ }
467
+ else {
468
+ return;
469
+ }
470
+ case LEFT_ARROW:
471
+ if (this._horizontal && isModifierAllowed) {
472
+ this._horizontal === 'rtl' ? this.setNextItemActive() : this.setPreviousItemActive();
473
+ break;
474
+ }
475
+ else {
476
+ return;
477
+ }
478
+ case HOME:
479
+ if (this._homeAndEnd && isModifierAllowed) {
480
+ this.setFirstItemActive();
481
+ break;
482
+ }
483
+ else {
484
+ return;
485
+ }
486
+ case END:
487
+ if (this._homeAndEnd && isModifierAllowed) {
488
+ this.setLastItemActive();
489
+ break;
490
+ }
491
+ else {
492
+ return;
493
+ }
494
+ default:
495
+ if (isModifierAllowed || hasModifierKey(event, 'shiftKey')) {
496
+ // Attempt to use the `event.key` which also maps it to the user's keyboard language,
497
+ // otherwise fall back to resolving alphanumeric characters via the keyCode.
498
+ if (event.key && event.key.length === 1) {
499
+ this._letterKeyStream.next(event.key.toLocaleUpperCase());
500
+ }
501
+ else if ((keyCode >= A && keyCode <= Z) || (keyCode >= ZERO && keyCode <= NINE)) {
502
+ this._letterKeyStream.next(String.fromCharCode(keyCode));
503
+ }
504
+ }
505
+ // Note that we return here, in order to avoid preventing
506
+ // the default action of non-navigational keys.
507
+ return;
508
+ }
509
+ this._pressedLetters = [];
510
+ event.preventDefault();
511
+ }
512
+ /** Index of the currently active item. */
513
+ get activeItemIndex() {
514
+ return this._activeItemIndex;
515
+ }
516
+ /** The active item. */
517
+ get activeItem() {
518
+ return this._activeItem;
519
+ }
520
+ /** Gets whether the user is currently typing into the manager using the typeahead feature. */
521
+ isTyping() {
522
+ return this._pressedLetters.length > 0;
523
+ }
524
+ /** Sets the active item to the first enabled item in the list. */
525
+ setFirstItemActive() {
526
+ this._setActiveItemByIndex(0, 1);
527
+ }
528
+ /** Sets the active item to the last enabled item in the list. */
529
+ setLastItemActive() {
530
+ this._setActiveItemByIndex(this._items.length - 1, -1);
531
+ }
532
+ /** Sets the active item to the next enabled item in the list. */
533
+ setNextItemActive() {
534
+ this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);
535
+ }
536
+ /** Sets the active item to a previous enabled item in the list. */
537
+ setPreviousItemActive() {
538
+ this._activeItemIndex < 0 && this._wrap
539
+ ? this.setLastItemActive()
540
+ : this._setActiveItemByDelta(-1);
541
+ }
542
+ updateActiveItem(item) {
543
+ const itemArray = this._getItemsArray();
544
+ const index = typeof item === 'number' ? item : itemArray.indexOf(item);
545
+ const activeItem = itemArray[index];
546
+ // Explicitly check for `null` and `undefined` because other falsy values are valid.
547
+ this._activeItem = activeItem == null ? null : activeItem;
548
+ this._activeItemIndex = index;
549
+ }
550
+ /**
551
+ * This method sets the active item, given a list of items and the delta between the
552
+ * currently active item and the new active item. It will calculate differently
553
+ * depending on whether wrap mode is turned on.
554
+ */
555
+ _setActiveItemByDelta(delta) {
556
+ this._wrap ? this._setActiveInWrapMode(delta) : this._setActiveInDefaultMode(delta);
557
+ }
558
+ /**
559
+ * Sets the active item properly given "wrap" mode. In other words, it will continue to move
560
+ * down the list until it finds an item that is not disabled, and it will wrap if it
561
+ * encounters either end of the list.
562
+ */
563
+ _setActiveInWrapMode(delta) {
564
+ const items = this._getItemsArray();
565
+ for (let i = 1; i <= items.length; i++) {
566
+ const index = (this._activeItemIndex + delta * i + items.length) % items.length;
567
+ const item = items[index];
568
+ if (!this._skipPredicateFn(item)) {
569
+ this.setActiveItem(index);
570
+ return;
571
+ }
572
+ }
573
+ }
574
+ /**
575
+ * Sets the active item properly given the default mode. In other words, it will
576
+ * continue to move down the list until it finds an item that is not disabled. If
577
+ * it encounters either end of the list, it will stop and not wrap.
578
+ */
579
+ _setActiveInDefaultMode(delta) {
580
+ this._setActiveItemByIndex(this._activeItemIndex + delta, delta);
581
+ }
582
+ /**
583
+ * Sets the active item to the first enabled item starting at the index specified. If the
584
+ * item is disabled, it will move in the fallbackDelta direction until it either
585
+ * finds an enabled item or encounters the end of the list.
586
+ */
587
+ _setActiveItemByIndex(index, fallbackDelta) {
588
+ const items = this._getItemsArray();
589
+ if (!items[index]) {
590
+ return;
591
+ }
592
+ while (this._skipPredicateFn(items[index])) {
593
+ index += fallbackDelta;
594
+ if (!items[index]) {
595
+ return;
596
+ }
597
+ }
598
+ this.setActiveItem(index);
599
+ }
600
+ /** Returns the items as an array. */
601
+ _getItemsArray() {
602
+ return this._items instanceof QueryList ? this._items.toArray() : this._items;
603
+ }
604
+ }
605
+
606
+ /**
607
+ * @license
608
+ * Copyright Google LLC All Rights Reserved.
609
+ *
610
+ * Use of this source code is governed by an MIT-style license that can be
611
+ * found in the LICENSE file at https://angular.io/license
612
+ */
613
+ class ActiveDescendantKeyManager extends ListKeyManager {
614
+ setActiveItem(index) {
615
+ if (this.activeItem) {
616
+ this.activeItem.setInactiveStyles();
617
+ }
618
+ super.setActiveItem(index);
619
+ if (this.activeItem) {
620
+ this.activeItem.setActiveStyles();
621
+ }
622
+ }
623
+ }
624
+
625
+ /**
626
+ * @license
627
+ * Copyright Google LLC All Rights Reserved.
628
+ *
629
+ * Use of this source code is governed by an MIT-style license that can be
630
+ * found in the LICENSE file at https://angular.io/license
631
+ */
632
+ class FocusKeyManager extends ListKeyManager {
633
+ constructor() {
634
+ super(...arguments);
635
+ this._origin = 'program';
636
+ }
637
+ /**
638
+ * Sets the focus origin that will be passed in to the items for any subsequent `focus` calls.
639
+ * @param origin Focus origin to be used when focusing items.
640
+ */
641
+ setFocusOrigin(origin) {
642
+ this._origin = origin;
643
+ return this;
644
+ }
645
+ setActiveItem(item) {
646
+ super.setActiveItem(item);
647
+ if (this.activeItem) {
648
+ this.activeItem.focus(this._origin);
649
+ }
650
+ }
651
+ }
652
+
653
+ /**
654
+ * Configuration for the isFocusable method.
655
+ */
656
+ class IsFocusableConfig {
657
+ constructor() {
658
+ /**
659
+ * Whether to count an element as focusable even if it is not currently visible.
660
+ */
661
+ this.ignoreVisibility = false;
662
+ }
663
+ }
664
+ // The InteractivityChecker leans heavily on the ally.js accessibility utilities.
665
+ // Methods like `isTabbable` are only covering specific edge-cases for the browsers which are
666
+ // supported.
667
+ /**
668
+ * Utility for checking the interactivity of an element, such as whether is is focusable or
669
+ * tabbable.
670
+ */
671
+ class InteractivityChecker {
672
+ constructor(_platform) {
673
+ this._platform = _platform;
674
+ }
675
+ /**
676
+ * Gets whether an element is disabled.
677
+ *
678
+ * @param element Element to be checked.
679
+ * @returns Whether the element is disabled.
680
+ */
681
+ isDisabled(element) {
682
+ // This does not capture some cases, such as a non-form control with a disabled attribute or
683
+ // a form control inside of a disabled form, but should capture the most common cases.
684
+ return element.hasAttribute('disabled');
685
+ }
686
+ /**
687
+ * Gets whether an element is visible for the purposes of interactivity.
688
+ *
689
+ * This will capture states like `display: none` and `visibility: hidden`, but not things like
690
+ * being clipped by an `overflow: hidden` parent or being outside the viewport.
691
+ *
692
+ * @returns Whether the element is visible.
693
+ */
694
+ isVisible(element) {
695
+ return hasGeometry(element) && getComputedStyle(element).visibility === 'visible';
696
+ }
697
+ /**
698
+ * Gets whether an element can be reached via Tab key.
699
+ * Assumes that the element has already been checked with isFocusable.
700
+ *
701
+ * @param element Element to be checked.
702
+ * @returns Whether the element is tabbable.
703
+ */
704
+ isTabbable(element) {
705
+ // Nothing is tabbable on the server 😎
706
+ if (!this._platform.isBrowser) {
707
+ return false;
708
+ }
709
+ const frameElement = getFrameElement(getWindow(element));
710
+ if (frameElement) {
711
+ // Frame elements inherit their tabindex onto all child elements.
712
+ if (getTabIndexValue(frameElement) === -1) {
713
+ return false;
714
+ }
715
+ // Browsers disable tabbing to an element inside of an invisible frame.
716
+ if (!this.isVisible(frameElement)) {
717
+ return false;
718
+ }
719
+ }
720
+ let nodeName = element.nodeName.toLowerCase();
721
+ let tabIndexValue = getTabIndexValue(element);
722
+ if (element.hasAttribute('contenteditable')) {
723
+ return tabIndexValue !== -1;
724
+ }
725
+ if (nodeName === 'iframe' || nodeName === 'object') {
726
+ // The frame or object's content may be tabbable depending on the content, but it's
727
+ // not possibly to reliably detect the content of the frames. We always consider such
728
+ // elements as non-tabbable.
729
+ return false;
730
+ }
731
+ // In iOS, the browser only considers some specific elements as tabbable.
732
+ if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {
733
+ return false;
734
+ }
735
+ if (nodeName === 'audio') {
736
+ // Audio elements without controls enabled are never tabbable, regardless
737
+ // of the tabindex attribute explicitly being set.
738
+ if (!element.hasAttribute('controls')) {
739
+ return false;
740
+ }
741
+ // Audio elements with controls are by default tabbable unless the
742
+ // tabindex attribute is set to `-1` explicitly.
743
+ return tabIndexValue !== -1;
744
+ }
745
+ if (nodeName === 'video') {
746
+ // For all video elements, if the tabindex attribute is set to `-1`, the video
747
+ // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex`
748
+ // property as that one is set to `-1` in Chrome, Edge and Safari v13.1. The
749
+ // tabindex attribute is the source of truth here.
750
+ if (tabIndexValue === -1) {
751
+ return false;
752
+ }
753
+ // If the tabindex is explicitly set, and not `-1` (as per check before), the
754
+ // video element is always tabbable (regardless of whether it has controls or not).
755
+ if (tabIndexValue !== null) {
756
+ return true;
757
+ }
758
+ // Otherwise (when no explicit tabindex is set), a video is only tabbable if it
759
+ // has controls enabled. Firefox is special as videos are always tabbable regardless
760
+ // of whether there are controls or not.
761
+ return this._platform.FIREFOX || element.hasAttribute('controls');
762
+ }
763
+ return element.tabIndex >= 0;
764
+ }
765
+ /**
766
+ * Gets whether an element can be focused by the user.
767
+ *
768
+ * @param element Element to be checked.
769
+ * @param config The config object with options to customize this method's behavior
770
+ * @returns Whether the element is focusable.
771
+ */
772
+ isFocusable(element, config) {
773
+ // Perform checks in order of left to most expensive.
774
+ // Again, naive approach that does not capture many edge cases and browser quirks.
775
+ return (isPotentiallyFocusable(element) &&
776
+ !this.isDisabled(element) &&
777
+ ((config === null || config === void 0 ? void 0 : config.ignoreVisibility) || this.isVisible(element)));
778
+ }
779
+ }
780
+ InteractivityChecker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: InteractivityChecker, deps: [{ token: i1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
781
+ InteractivityChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: InteractivityChecker, providedIn: 'root' });
782
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: InteractivityChecker, decorators: [{
783
+ type: Injectable,
784
+ args: [{ providedIn: 'root' }]
785
+ }], ctorParameters: function () { return [{ type: i1.Platform }]; } });
786
+ /**
787
+ * Returns the frame element from a window object. Since browsers like MS Edge throw errors if
788
+ * the frameElement property is being accessed from a different host address, this property
789
+ * should be accessed carefully.
790
+ */
791
+ function getFrameElement(window) {
792
+ try {
793
+ return window.frameElement;
794
+ }
795
+ catch (_a) {
796
+ return null;
797
+ }
798
+ }
799
+ /** Checks whether the specified element has any geometry / rectangles. */
800
+ function hasGeometry(element) {
801
+ // Use logic from jQuery to check for an invisible element.
802
+ // See https://github.com/jquery/jquery/blob/master/src/css/hiddenVisibleSelectors.js#L12
803
+ return !!(element.offsetWidth ||
804
+ element.offsetHeight ||
805
+ (typeof element.getClientRects === 'function' && element.getClientRects().length));
806
+ }
807
+ /** Gets whether an element's */
808
+ function isNativeFormElement(element) {
809
+ let nodeName = element.nodeName.toLowerCase();
810
+ return (nodeName === 'input' ||
811
+ nodeName === 'select' ||
812
+ nodeName === 'button' ||
813
+ nodeName === 'textarea');
814
+ }
815
+ /** Gets whether an element is an `<input type="hidden">`. */
816
+ function isHiddenInput(element) {
817
+ return isInputElement(element) && element.type == 'hidden';
818
+ }
819
+ /** Gets whether an element is an anchor that has an href attribute. */
820
+ function isAnchorWithHref(element) {
821
+ return isAnchorElement(element) && element.hasAttribute('href');
822
+ }
823
+ /** Gets whether an element is an input element. */
824
+ function isInputElement(element) {
825
+ return element.nodeName.toLowerCase() == 'input';
826
+ }
827
+ /** Gets whether an element is an anchor element. */
828
+ function isAnchorElement(element) {
829
+ return element.nodeName.toLowerCase() == 'a';
830
+ }
831
+ /** Gets whether an element has a valid tabindex. */
832
+ function hasValidTabIndex(element) {
833
+ if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) {
834
+ return false;
835
+ }
836
+ let tabIndex = element.getAttribute('tabindex');
837
+ return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));
838
+ }
839
+ /**
840
+ * Returns the parsed tabindex from the element attributes instead of returning the
841
+ * evaluated tabindex from the browsers defaults.
842
+ */
843
+ function getTabIndexValue(element) {
844
+ if (!hasValidTabIndex(element)) {
845
+ return null;
846
+ }
847
+ // See browser issue in Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054
848
+ const tabIndex = parseInt(element.getAttribute('tabindex') || '', 10);
849
+ return isNaN(tabIndex) ? -1 : tabIndex;
850
+ }
851
+ /** Checks whether the specified element is potentially tabbable on iOS */
852
+ function isPotentiallyTabbableIOS(element) {
853
+ let nodeName = element.nodeName.toLowerCase();
854
+ let inputType = nodeName === 'input' && element.type;
855
+ return (inputType === 'text' ||
856
+ inputType === 'password' ||
857
+ nodeName === 'select' ||
858
+ nodeName === 'textarea');
859
+ }
860
+ /**
861
+ * Gets whether an element is potentially focusable without taking current visible/disabled state
862
+ * into account.
863
+ */
864
+ function isPotentiallyFocusable(element) {
865
+ // Inputs are potentially focusable *unless* they're type="hidden".
866
+ if (isHiddenInput(element)) {
867
+ return false;
868
+ }
869
+ return (isNativeFormElement(element) ||
870
+ isAnchorWithHref(element) ||
871
+ element.hasAttribute('contenteditable') ||
872
+ hasValidTabIndex(element));
873
+ }
874
+ /** Gets the parent window of a DOM node with regards of being inside of an iframe. */
875
+ function getWindow(node) {
876
+ // ownerDocument is null if `node` itself *is* a document.
877
+ return (node.ownerDocument && node.ownerDocument.defaultView) || window;
878
+ }
879
+
880
+ /**
881
+ * @license
882
+ * Copyright Google LLC All Rights Reserved.
883
+ *
884
+ * Use of this source code is governed by an MIT-style license that can be
885
+ * found in the LICENSE file at https://angular.io/license
886
+ */
887
+ /**
888
+ * Class that allows for trapping focus within a DOM element.
889
+ *
890
+ * This class currently uses a relatively simple approach to focus trapping.
891
+ * It assumes that the tab order is the same as DOM order, which is not necessarily true.
892
+ * Things like `tabIndex > 0`, flex `order`, and shadow roots can cause the two to be misaligned.
893
+ *
894
+ * @deprecated Use `ConfigurableFocusTrap` instead.
895
+ * @breaking-change 11.0.0
896
+ */
897
+ class FocusTrap {
898
+ constructor(_element, _checker, _ngZone, _document, deferAnchors = false) {
899
+ this._element = _element;
900
+ this._checker = _checker;
901
+ this._ngZone = _ngZone;
902
+ this._document = _document;
903
+ this._hasAttached = false;
904
+ // Event listeners for the anchors. Need to be regular functions so that we can unbind them later.
905
+ this.startAnchorListener = () => this.focusLastTabbableElement();
906
+ this.endAnchorListener = () => this.focusFirstTabbableElement();
907
+ this._enabled = true;
908
+ if (!deferAnchors) {
909
+ this.attachAnchors();
910
+ }
911
+ }
912
+ /** Whether the focus trap is active. */
913
+ get enabled() {
914
+ return this._enabled;
915
+ }
916
+ set enabled(value) {
917
+ this._enabled = value;
918
+ if (this._startAnchor && this._endAnchor) {
919
+ this._toggleAnchorTabIndex(value, this._startAnchor);
920
+ this._toggleAnchorTabIndex(value, this._endAnchor);
921
+ }
922
+ }
923
+ /** Destroys the focus trap by cleaning up the anchors. */
924
+ destroy() {
925
+ const startAnchor = this._startAnchor;
926
+ const endAnchor = this._endAnchor;
927
+ if (startAnchor) {
928
+ startAnchor.removeEventListener('focus', this.startAnchorListener);
929
+ startAnchor.remove();
930
+ }
931
+ if (endAnchor) {
932
+ endAnchor.removeEventListener('focus', this.endAnchorListener);
933
+ endAnchor.remove();
934
+ }
935
+ this._startAnchor = this._endAnchor = null;
936
+ this._hasAttached = false;
937
+ }
938
+ /**
939
+ * Inserts the anchors into the DOM. This is usually done automatically
940
+ * in the constructor, but can be deferred for cases like directives with `*ngIf`.
941
+ * @returns Whether the focus trap managed to attach successfully. This may not be the case
942
+ * if the target element isn't currently in the DOM.
943
+ */
944
+ attachAnchors() {
945
+ // If we're not on the browser, there can be no focus to trap.
946
+ if (this._hasAttached) {
947
+ return true;
948
+ }
949
+ this._ngZone.runOutsideAngular(() => {
950
+ if (!this._startAnchor) {
951
+ this._startAnchor = this._createAnchor();
952
+ this._startAnchor.addEventListener('focus', this.startAnchorListener);
953
+ }
954
+ if (!this._endAnchor) {
955
+ this._endAnchor = this._createAnchor();
956
+ this._endAnchor.addEventListener('focus', this.endAnchorListener);
957
+ }
958
+ });
959
+ if (this._element.parentNode) {
960
+ this._element.parentNode.insertBefore(this._startAnchor, this._element);
961
+ this._element.parentNode.insertBefore(this._endAnchor, this._element.nextSibling);
962
+ this._hasAttached = true;
963
+ }
964
+ return this._hasAttached;
965
+ }
966
+ /**
967
+ * Waits for the zone to stabilize, then focuses the first tabbable element.
968
+ * @returns Returns a promise that resolves with a boolean, depending
969
+ * on whether focus was moved successfully.
970
+ */
971
+ focusInitialElementWhenReady(options) {
972
+ return new Promise(resolve => {
973
+ this._executeOnStable(() => resolve(this.focusInitialElement(options)));
974
+ });
975
+ }
976
+ /**
977
+ * Waits for the zone to stabilize, then focuses
978
+ * the first tabbable element within the focus trap region.
979
+ * @returns Returns a promise that resolves with a boolean, depending
980
+ * on whether focus was moved successfully.
981
+ */
982
+ focusFirstTabbableElementWhenReady(options) {
983
+ return new Promise(resolve => {
984
+ this._executeOnStable(() => resolve(this.focusFirstTabbableElement(options)));
985
+ });
986
+ }
987
+ /**
988
+ * Waits for the zone to stabilize, then focuses
989
+ * the last tabbable element within the focus trap region.
990
+ * @returns Returns a promise that resolves with a boolean, depending
991
+ * on whether focus was moved successfully.
992
+ */
993
+ focusLastTabbableElementWhenReady(options) {
994
+ return new Promise(resolve => {
995
+ this._executeOnStable(() => resolve(this.focusLastTabbableElement(options)));
996
+ });
997
+ }
998
+ /**
999
+ * Get the specified boundary element of the trapped region.
1000
+ * @param bound The boundary to get (start or end of trapped region).
1001
+ * @returns The boundary element.
1002
+ */
1003
+ _getRegionBoundary(bound) {
1004
+ // Contains the deprecated version of selector, for temporary backwards comparability.
1005
+ const markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` + `[cdkFocusRegion${bound}], ` + `[cdk-focus-${bound}]`);
1006
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
1007
+ for (let i = 0; i < markers.length; i++) {
1008
+ // @breaking-change 8.0.0
1009
+ if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {
1010
+ console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', ` +
1011
+ `use 'cdkFocusRegion${bound}' instead. The deprecated ` +
1012
+ `attribute will be removed in 8.0.0.`, markers[i]);
1013
+ }
1014
+ else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {
1015
+ console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', ` +
1016
+ `use 'cdkFocusRegion${bound}' instead. The deprecated attribute ` +
1017
+ `will be removed in 8.0.0.`, markers[i]);
1018
+ }
1019
+ }
1020
+ }
1021
+ if (bound == 'start') {
1022
+ return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);
1023
+ }
1024
+ return markers.length
1025
+ ? markers[markers.length - 1]
1026
+ : this._getLastTabbableElement(this._element);
1027
+ }
1028
+ /**
1029
+ * Focuses the element that should be focused when the focus trap is initialized.
1030
+ * @returns Whether focus was moved successfully.
1031
+ */
1032
+ focusInitialElement(options) {
1033
+ // Contains the deprecated version of selector, for temporary backwards comparability.
1034
+ const redirectToElement = this._element.querySelector(`[cdk-focus-initial], ` + `[cdkFocusInitial]`);
1035
+ if (redirectToElement) {
1036
+ // @breaking-change 8.0.0
1037
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
1038
+ redirectToElement.hasAttribute(`cdk-focus-initial`)) {
1039
+ console.warn(`Found use of deprecated attribute 'cdk-focus-initial', ` +
1040
+ `use 'cdkFocusInitial' instead. The deprecated attribute ` +
1041
+ `will be removed in 8.0.0`, redirectToElement);
1042
+ }
1043
+ // Warn the consumer if the element they've pointed to
1044
+ // isn't focusable, when not in production mode.
1045
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
1046
+ !this._checker.isFocusable(redirectToElement)) {
1047
+ console.warn(`Element matching '[cdkFocusInitial]' is not focusable.`, redirectToElement);
1048
+ }
1049
+ if (!this._checker.isFocusable(redirectToElement)) {
1050
+ const focusableChild = this._getFirstTabbableElement(redirectToElement);
1051
+ focusableChild === null || focusableChild === void 0 ? void 0 : focusableChild.focus(options);
1052
+ return !!focusableChild;
1053
+ }
1054
+ redirectToElement.focus(options);
1055
+ return true;
1056
+ }
1057
+ return this.focusFirstTabbableElement(options);
1058
+ }
1059
+ /**
1060
+ * Focuses the first tabbable element within the focus trap region.
1061
+ * @returns Whether focus was moved successfully.
1062
+ */
1063
+ focusFirstTabbableElement(options) {
1064
+ const redirectToElement = this._getRegionBoundary('start');
1065
+ if (redirectToElement) {
1066
+ redirectToElement.focus(options);
1067
+ }
1068
+ return !!redirectToElement;
1069
+ }
1070
+ /**
1071
+ * Focuses the last tabbable element within the focus trap region.
1072
+ * @returns Whether focus was moved successfully.
1073
+ */
1074
+ focusLastTabbableElement(options) {
1075
+ const redirectToElement = this._getRegionBoundary('end');
1076
+ if (redirectToElement) {
1077
+ redirectToElement.focus(options);
1078
+ }
1079
+ return !!redirectToElement;
1080
+ }
1081
+ /**
1082
+ * Checks whether the focus trap has successfully been attached.
1083
+ */
1084
+ hasAttached() {
1085
+ return this._hasAttached;
1086
+ }
1087
+ /** Get the first tabbable element from a DOM subtree (inclusive). */
1088
+ _getFirstTabbableElement(root) {
1089
+ if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {
1090
+ return root;
1091
+ }
1092
+ const children = root.children;
1093
+ for (let i = 0; i < children.length; i++) {
1094
+ const tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE
1095
+ ? this._getFirstTabbableElement(children[i])
1096
+ : null;
1097
+ if (tabbableChild) {
1098
+ return tabbableChild;
1099
+ }
1100
+ }
1101
+ return null;
1102
+ }
1103
+ /** Get the last tabbable element from a DOM subtree (inclusive). */
1104
+ _getLastTabbableElement(root) {
1105
+ if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {
1106
+ return root;
1107
+ }
1108
+ // Iterate in reverse DOM order.
1109
+ const children = root.children;
1110
+ for (let i = children.length - 1; i >= 0; i--) {
1111
+ const tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE
1112
+ ? this._getLastTabbableElement(children[i])
1113
+ : null;
1114
+ if (tabbableChild) {
1115
+ return tabbableChild;
1116
+ }
1117
+ }
1118
+ return null;
1119
+ }
1120
+ /** Creates an anchor element. */
1121
+ _createAnchor() {
1122
+ const anchor = this._document.createElement('div');
1123
+ this._toggleAnchorTabIndex(this._enabled, anchor);
1124
+ anchor.classList.add('cdk-visually-hidden');
1125
+ anchor.classList.add('cdk-focus-trap-anchor');
1126
+ anchor.setAttribute('aria-hidden', 'true');
1127
+ return anchor;
1128
+ }
1129
+ /**
1130
+ * Toggles the `tabindex` of an anchor, based on the enabled state of the focus trap.
1131
+ * @param isEnabled Whether the focus trap is enabled.
1132
+ * @param anchor Anchor on which to toggle the tabindex.
1133
+ */
1134
+ _toggleAnchorTabIndex(isEnabled, anchor) {
1135
+ // Remove the tabindex completely, rather than setting it to -1, because if the
1136
+ // element has a tabindex, the user might still hit it when navigating with the arrow keys.
1137
+ isEnabled ? anchor.setAttribute('tabindex', '0') : anchor.removeAttribute('tabindex');
1138
+ }
1139
+ /**
1140
+ * Toggles the`tabindex` of both anchors to either trap Tab focus or allow it to escape.
1141
+ * @param enabled: Whether the anchors should trap Tab.
1142
+ */
1143
+ toggleAnchors(enabled) {
1144
+ if (this._startAnchor && this._endAnchor) {
1145
+ this._toggleAnchorTabIndex(enabled, this._startAnchor);
1146
+ this._toggleAnchorTabIndex(enabled, this._endAnchor);
1147
+ }
1148
+ }
1149
+ /** Executes a function when the zone is stable. */
1150
+ _executeOnStable(fn) {
1151
+ if (this._ngZone.isStable) {
1152
+ fn();
1153
+ }
1154
+ else {
1155
+ this._ngZone.onStable.pipe(take(1)).subscribe(fn);
1156
+ }
1157
+ }
1158
+ }
1159
+ /**
1160
+ * Factory that allows easy instantiation of focus traps.
1161
+ * @deprecated Use `ConfigurableFocusTrapFactory` instead.
1162
+ * @breaking-change 11.0.0
1163
+ */
1164
+ class FocusTrapFactory {
1165
+ constructor(_checker, _ngZone, _document) {
1166
+ this._checker = _checker;
1167
+ this._ngZone = _ngZone;
1168
+ this._document = _document;
1169
+ }
1170
+ /**
1171
+ * Creates a focus-trapped region around the given element.
1172
+ * @param element The element around which focus will be trapped.
1173
+ * @param deferCaptureElements Defers the creation of focus-capturing elements to be done
1174
+ * manually by the user.
1175
+ * @returns The created focus trap instance.
1176
+ */
1177
+ create(element, deferCaptureElements = false) {
1178
+ return new FocusTrap(element, this._checker, this._ngZone, this._document, deferCaptureElements);
1179
+ }
1180
+ }
1181
+ FocusTrapFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FocusTrapFactory, deps: [{ token: InteractivityChecker }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1182
+ FocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FocusTrapFactory, providedIn: 'root' });
1183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FocusTrapFactory, decorators: [{
1184
+ type: Injectable,
1185
+ args: [{ providedIn: 'root' }]
1186
+ }], ctorParameters: function () {
1187
+ return [{ type: InteractivityChecker }, { type: i0.NgZone }, { type: undefined, decorators: [{
1188
+ type: Inject,
1189
+ args: [DOCUMENT]
1190
+ }] }];
1191
+ } });
1192
+ /** Directive for trapping focus within a region. */
1193
+ class CdkTrapFocus {
1194
+ constructor(_elementRef, _focusTrapFactory,
1195
+ /**
1196
+ * @deprecated No longer being used. To be removed.
1197
+ * @breaking-change 13.0.0
1198
+ */
1199
+ _document) {
1200
+ this._elementRef = _elementRef;
1201
+ this._focusTrapFactory = _focusTrapFactory;
1202
+ /** Previously focused element to restore focus to upon destroy when using autoCapture. */
1203
+ this._previouslyFocusedElement = null;
1204
+ this.focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement, true);
1205
+ }
1206
+ /** Whether the focus trap is active. */
1207
+ get enabled() {
1208
+ return this.focusTrap.enabled;
1209
+ }
1210
+ set enabled(value) {
1211
+ this.focusTrap.enabled = coerceBooleanProperty(value);
1212
+ }
1213
+ /**
1214
+ * Whether the directive should automatically move focus into the trapped region upon
1215
+ * initialization and return focus to the previous activeElement upon destruction.
1216
+ */
1217
+ get autoCapture() {
1218
+ return this._autoCapture;
1219
+ }
1220
+ set autoCapture(value) {
1221
+ this._autoCapture = coerceBooleanProperty(value);
1222
+ }
1223
+ ngOnDestroy() {
1224
+ this.focusTrap.destroy();
1225
+ // If we stored a previously focused element when using autoCapture, return focus to that
1226
+ // element now that the trapped region is being destroyed.
1227
+ if (this._previouslyFocusedElement) {
1228
+ this._previouslyFocusedElement.focus();
1229
+ this._previouslyFocusedElement = null;
1230
+ }
1231
+ }
1232
+ ngAfterContentInit() {
1233
+ this.focusTrap.attachAnchors();
1234
+ if (this.autoCapture) {
1235
+ this._captureFocus();
1236
+ }
1237
+ }
1238
+ ngDoCheck() {
1239
+ if (!this.focusTrap.hasAttached()) {
1240
+ this.focusTrap.attachAnchors();
1241
+ }
1242
+ }
1243
+ ngOnChanges(changes) {
1244
+ const autoCaptureChange = changes['autoCapture'];
1245
+ if (autoCaptureChange &&
1246
+ !autoCaptureChange.firstChange &&
1247
+ this.autoCapture &&
1248
+ this.focusTrap.hasAttached()) {
1249
+ this._captureFocus();
1250
+ }
1251
+ }
1252
+ _captureFocus() {
1253
+ this._previouslyFocusedElement = _getFocusedElementPierceShadowDom();
1254
+ this.focusTrap.focusInitialElementWhenReady();
1255
+ }
1256
+ }
1257
+ CdkTrapFocus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkTrapFocus, deps: [{ token: i0.ElementRef }, { token: FocusTrapFactory }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
1258
+ CdkTrapFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: { enabled: ["cdkTrapFocus", "enabled"], autoCapture: ["cdkTrapFocusAutoCapture", "autoCapture"] }, exportAs: ["cdkTrapFocus"], usesOnChanges: true, ngImport: i0 });
1259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkTrapFocus, decorators: [{
1260
+ type: Directive,
1261
+ args: [{
1262
+ selector: '[cdkTrapFocus]',
1263
+ exportAs: 'cdkTrapFocus',
1264
+ }]
1265
+ }], ctorParameters: function () {
1266
+ return [{ type: i0.ElementRef }, { type: FocusTrapFactory }, { type: undefined, decorators: [{
1267
+ type: Inject,
1268
+ args: [DOCUMENT]
1269
+ }] }];
1270
+ }, propDecorators: { enabled: [{
1271
+ type: Input,
1272
+ args: ['cdkTrapFocus']
1273
+ }], autoCapture: [{
1274
+ type: Input,
1275
+ args: ['cdkTrapFocusAutoCapture']
1276
+ }] } });
1277
+
1278
+ /**
1279
+ * @license
1280
+ * Copyright Google LLC All Rights Reserved.
1281
+ *
1282
+ * Use of this source code is governed by an MIT-style license that can be
1283
+ * found in the LICENSE file at https://angular.io/license
1284
+ */
1285
+ /**
1286
+ * Class that allows for trapping focus within a DOM element.
1287
+ *
1288
+ * This class uses a strategy pattern that determines how it traps focus.
1289
+ * See FocusTrapInertStrategy.
1290
+ */
1291
+ class ConfigurableFocusTrap extends FocusTrap {
1292
+ constructor(_element, _checker, _ngZone, _document, _focusTrapManager, _inertStrategy, config) {
1293
+ super(_element, _checker, _ngZone, _document, config.defer);
1294
+ this._focusTrapManager = _focusTrapManager;
1295
+ this._inertStrategy = _inertStrategy;
1296
+ this._focusTrapManager.register(this);
1297
+ }
1298
+ /** Whether the FocusTrap is enabled. */
1299
+ get enabled() {
1300
+ return this._enabled;
1301
+ }
1302
+ set enabled(value) {
1303
+ this._enabled = value;
1304
+ if (this._enabled) {
1305
+ this._focusTrapManager.register(this);
1306
+ }
1307
+ else {
1308
+ this._focusTrapManager.deregister(this);
1309
+ }
1310
+ }
1311
+ /** Notifies the FocusTrapManager that this FocusTrap will be destroyed. */
1312
+ destroy() {
1313
+ this._focusTrapManager.deregister(this);
1314
+ super.destroy();
1315
+ }
1316
+ /** @docs-private Implemented as part of ManagedFocusTrap. */
1317
+ _enable() {
1318
+ this._inertStrategy.preventFocus(this);
1319
+ this.toggleAnchors(true);
1320
+ }
1321
+ /** @docs-private Implemented as part of ManagedFocusTrap. */
1322
+ _disable() {
1323
+ this._inertStrategy.allowFocus(this);
1324
+ this.toggleAnchors(false);
1325
+ }
1326
+ }
1327
+
1328
+ /**
1329
+ * @license
1330
+ * Copyright Google LLC All Rights Reserved.
1331
+ *
1332
+ * Use of this source code is governed by an MIT-style license that can be
1333
+ * found in the LICENSE file at https://angular.io/license
1334
+ */
1335
+ /** The injection token used to specify the inert strategy. */
1336
+ const FOCUS_TRAP_INERT_STRATEGY = new InjectionToken('FOCUS_TRAP_INERT_STRATEGY');
1337
+
1338
+ /**
1339
+ * @license
1340
+ * Copyright Google LLC All Rights Reserved.
1341
+ *
1342
+ * Use of this source code is governed by an MIT-style license that can be
1343
+ * found in the LICENSE file at https://angular.io/license
1344
+ */
1345
+ /**
1346
+ * Lightweight FocusTrapInertStrategy that adds a document focus event
1347
+ * listener to redirect focus back inside the FocusTrap.
1348
+ */
1349
+ class EventListenerFocusTrapInertStrategy {
1350
+ constructor() {
1351
+ /** Focus event handler. */
1352
+ this._listener = null;
1353
+ }
1354
+ /** Adds a document event listener that keeps focus inside the FocusTrap. */
1355
+ preventFocus(focusTrap) {
1356
+ // Ensure there's only one listener per document
1357
+ if (this._listener) {
1358
+ focusTrap._document.removeEventListener('focus', this._listener, true);
1359
+ }
1360
+ this._listener = (e) => this._trapFocus(focusTrap, e);
1361
+ focusTrap._ngZone.runOutsideAngular(() => {
1362
+ focusTrap._document.addEventListener('focus', this._listener, true);
1363
+ });
1364
+ }
1365
+ /** Removes the event listener added in preventFocus. */
1366
+ allowFocus(focusTrap) {
1367
+ if (!this._listener) {
1368
+ return;
1369
+ }
1370
+ focusTrap._document.removeEventListener('focus', this._listener, true);
1371
+ this._listener = null;
1372
+ }
1373
+ /**
1374
+ * Refocuses the first element in the FocusTrap if the focus event target was outside
1375
+ * the FocusTrap.
1376
+ *
1377
+ * This is an event listener callback. The event listener is added in runOutsideAngular,
1378
+ * so all this code runs outside Angular as well.
1379
+ */
1380
+ _trapFocus(focusTrap, event) {
1381
+ var _a;
1382
+ const target = event.target;
1383
+ const focusTrapRoot = focusTrap._element;
1384
+ // Don't refocus if target was in an overlay, because the overlay might be associated
1385
+ // with an element inside the FocusTrap, ex. mat-select.
1386
+ if (target && !focusTrapRoot.contains(target) && !((_a = target.closest) === null || _a === void 0 ? void 0 : _a.call(target, 'div.cdk-overlay-pane'))) {
1387
+ // Some legacy FocusTrap usages have logic that focuses some element on the page
1388
+ // just before FocusTrap is destroyed. For backwards compatibility, wait
1389
+ // to be sure FocusTrap is still enabled before refocusing.
1390
+ setTimeout(() => {
1391
+ // Check whether focus wasn't put back into the focus trap while the timeout was pending.
1392
+ if (focusTrap.enabled && !focusTrapRoot.contains(focusTrap._document.activeElement)) {
1393
+ focusTrap.focusFirstTabbableElement();
1394
+ }
1395
+ });
1396
+ }
1397
+ }
1398
+ }
1399
+
1400
+ /**
1401
+ * @license
1402
+ * Copyright Google LLC All Rights Reserved.
1403
+ *
1404
+ * Use of this source code is governed by an MIT-style license that can be
1405
+ * found in the LICENSE file at https://angular.io/license
1406
+ */
1407
+ /** Injectable that ensures only the most recently enabled FocusTrap is active. */
1408
+ class FocusTrapManager {
1409
+ constructor() {
1410
+ // A stack of the FocusTraps on the page. Only the FocusTrap at the
1411
+ // top of the stack is active.
1412
+ this._focusTrapStack = [];
1413
+ }
1414
+ /**
1415
+ * Disables the FocusTrap at the top of the stack, and then pushes
1416
+ * the new FocusTrap onto the stack.
1417
+ */
1418
+ register(focusTrap) {
1419
+ // Dedupe focusTraps that register multiple times.
1420
+ this._focusTrapStack = this._focusTrapStack.filter(ft => ft !== focusTrap);
1421
+ let stack = this._focusTrapStack;
1422
+ if (stack.length) {
1423
+ stack[stack.length - 1]._disable();
1424
+ }
1425
+ stack.push(focusTrap);
1426
+ focusTrap._enable();
1427
+ }
1428
+ /**
1429
+ * Removes the FocusTrap from the stack, and activates the
1430
+ * FocusTrap that is the new top of the stack.
1431
+ */
1432
+ deregister(focusTrap) {
1433
+ focusTrap._disable();
1434
+ const stack = this._focusTrapStack;
1435
+ const i = stack.indexOf(focusTrap);
1436
+ if (i !== -1) {
1437
+ stack.splice(i, 1);
1438
+ if (stack.length) {
1439
+ stack[stack.length - 1]._enable();
1440
+ }
1441
+ }
1442
+ }
1443
+ }
1444
+ FocusTrapManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FocusTrapManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1445
+ FocusTrapManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FocusTrapManager, providedIn: 'root' });
1446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FocusTrapManager, decorators: [{
1447
+ type: Injectable,
1448
+ args: [{ providedIn: 'root' }]
1449
+ }] });
1450
+
1451
+ /**
1452
+ * @license
1453
+ * Copyright Google LLC All Rights Reserved.
1454
+ *
1455
+ * Use of this source code is governed by an MIT-style license that can be
1456
+ * found in the LICENSE file at https://angular.io/license
1457
+ */
1458
+ /** Factory that allows easy instantiation of configurable focus traps. */
1459
+ class ConfigurableFocusTrapFactory {
1460
+ constructor(_checker, _ngZone, _focusTrapManager, _document, _inertStrategy) {
1461
+ this._checker = _checker;
1462
+ this._ngZone = _ngZone;
1463
+ this._focusTrapManager = _focusTrapManager;
1464
+ this._document = _document;
1465
+ // TODO split up the strategies into different modules, similar to DateAdapter.
1466
+ this._inertStrategy = _inertStrategy || new EventListenerFocusTrapInertStrategy();
1467
+ }
1468
+ create(element, config = { defer: false }) {
1469
+ let configObject;
1470
+ if (typeof config === 'boolean') {
1471
+ configObject = { defer: config };
1472
+ }
1473
+ else {
1474
+ configObject = config;
1475
+ }
1476
+ return new ConfigurableFocusTrap(element, this._checker, this._ngZone, this._document, this._focusTrapManager, this._inertStrategy, configObject);
1477
+ }
1478
+ }
1479
+ ConfigurableFocusTrapFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ConfigurableFocusTrapFactory, deps: [{ token: InteractivityChecker }, { token: i0.NgZone }, { token: FocusTrapManager }, { token: DOCUMENT }, { token: FOCUS_TRAP_INERT_STRATEGY, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1480
+ ConfigurableFocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ConfigurableFocusTrapFactory, providedIn: 'root' });
1481
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ConfigurableFocusTrapFactory, decorators: [{
1482
+ type: Injectable,
1483
+ args: [{ providedIn: 'root' }]
1484
+ }], ctorParameters: function () {
1485
+ return [{ type: InteractivityChecker }, { type: i0.NgZone }, { type: FocusTrapManager }, { type: undefined, decorators: [{
1486
+ type: Inject,
1487
+ args: [DOCUMENT]
1488
+ }] }, { type: undefined, decorators: [{
1489
+ type: Optional
1490
+ }, {
1491
+ type: Inject,
1492
+ args: [FOCUS_TRAP_INERT_STRATEGY]
1493
+ }] }];
1494
+ } });
1495
+
1496
+ /**
1497
+ * @license
1498
+ * Copyright Google LLC All Rights Reserved.
1499
+ *
1500
+ * Use of this source code is governed by an MIT-style license that can be
1501
+ * found in the LICENSE file at https://angular.io/license
1502
+ */
1503
+ /** Gets whether an event could be a faked `mousedown` event dispatched by a screen reader. */
1504
+ function isFakeMousedownFromScreenReader(event) {
1505
+ // Some screen readers will dispatch a fake `mousedown` event when pressing enter or space on
1506
+ // a clickable element. We can distinguish these events when both `offsetX` and `offsetY` are
1507
+ // zero or `event.buttons` is zero, depending on the browser:
1508
+ // - `event.buttons` works on Firefox, but fails on Chrome.
1509
+ // - `offsetX` and `offsetY` work on Chrome, but fail on Firefox.
1510
+ // Note that there's an edge case where the user could click the 0x0 spot of the
1511
+ // screen themselves, but that is unlikely to contain interactive elements.
1512
+ return event.buttons === 0 || (event.offsetX === 0 && event.offsetY === 0);
1513
+ }
1514
+ /** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */
1515
+ function isFakeTouchstartFromScreenReader(event) {
1516
+ const touch = (event.touches && event.touches[0]) || (event.changedTouches && event.changedTouches[0]);
1517
+ // A fake `touchstart` can be distinguished from a real one by looking at the `identifier`
1518
+ // which is typically >= 0 on a real device versus -1 from a screen reader. Just to be safe,
1519
+ // we can also look at `radiusX` and `radiusY`. This behavior was observed against a Windows 10
1520
+ // device with a touch screen running NVDA v2020.4 and Firefox 85 or Chrome 88.
1521
+ return (!!touch &&
1522
+ touch.identifier === -1 &&
1523
+ (touch.radiusX == null || touch.radiusX === 1) &&
1524
+ (touch.radiusY == null || touch.radiusY === 1));
1525
+ }
1526
+
1527
+ /**
1528
+ * @license
1529
+ * Copyright Google LLC All Rights Reserved.
1530
+ *
1531
+ * Use of this source code is governed by an MIT-style license that can be
1532
+ * found in the LICENSE file at https://angular.io/license
1533
+ */
1534
+ /**
1535
+ * Injectable options for the InputModalityDetector. These are shallowly merged with the default
1536
+ * options.
1537
+ */
1538
+ const INPUT_MODALITY_DETECTOR_OPTIONS = new InjectionToken('cdk-input-modality-detector-options');
1539
+ /**
1540
+ * Default options for the InputModalityDetector.
1541
+ *
1542
+ * Modifier keys are ignored by default (i.e. when pressed won't cause the service to detect
1543
+ * keyboard input modality) for two reasons:
1544
+ *
1545
+ * 1. Modifier keys are commonly used with mouse to perform actions such as 'right click' or 'open
1546
+ * in new tab', and are thus less representative of actual keyboard interaction.
1547
+ * 2. VoiceOver triggers some keyboard events when linearly navigating with Control + Option (but
1548
+ * confusingly not with Caps Lock). Thus, to have parity with other screen readers, we ignore
1549
+ * these keys so as to not update the input modality.
1550
+ *
1551
+ * Note that we do not by default ignore the right Meta key on Safari because it has the same key
1552
+ * code as the ContextMenu key on other browsers. When we switch to using event.key, we can
1553
+ * distinguish between the two.
1554
+ */
1555
+ const INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS = {
1556
+ ignoreKeys: [ALT, CONTROL, MAC_META, META, SHIFT],
1557
+ };
1558
+ /**
1559
+ * The amount of time needed to pass after a touchstart event in order for a subsequent mousedown
1560
+ * event to be attributed as mouse and not touch.
1561
+ *
1562
+ * This is the value used by AngularJS Material. Through trial and error (on iPhone 6S) they found
1563
+ * that a value of around 650ms seems appropriate.
1564
+ */
1565
+ const TOUCH_BUFFER_MS = 650;
1566
+ /**
1567
+ * Event listener options that enable capturing and also mark the listener as passive if the browser
1568
+ * supports it.
1569
+ */
1570
+ const modalityEventListenerOptions = normalizePassiveListenerOptions({
1571
+ passive: true,
1572
+ capture: true,
1573
+ });
1574
+ /**
1575
+ * Service that detects the user's input modality.
1576
+ *
1577
+ * This service does not update the input modality when a user navigates with a screen reader
1578
+ * (e.g. linear navigation with VoiceOver, object navigation / browse mode with NVDA, virtual PC
1579
+ * cursor mode with JAWS). This is in part due to technical limitations (i.e. keyboard events do not
1580
+ * fire as expected in these modes) but is also arguably the correct behavior. Navigating with a
1581
+ * screen reader is akin to visually scanning a page, and should not be interpreted as actual user
1582
+ * input interaction.
1583
+ *
1584
+ * When a user is not navigating but *interacting* with a screen reader, this service attempts to
1585
+ * update the input modality to keyboard, but in general this service's behavior is largely
1586
+ * undefined.
1587
+ */
1588
+ class InputModalityDetector {
1589
+ constructor(_platform, ngZone, document, options) {
1590
+ this._platform = _platform;
1591
+ /**
1592
+ * The most recently detected input modality event target. Is null if no input modality has been
1593
+ * detected or if the associated event target is null for some unknown reason.
1594
+ */
1595
+ this._mostRecentTarget = null;
1596
+ /** The underlying BehaviorSubject that emits whenever an input modality is detected. */
1597
+ this._modality = new BehaviorSubject(null);
1598
+ /**
1599
+ * The timestamp of the last touch input modality. Used to determine whether mousedown events
1600
+ * should be attributed to mouse or touch.
1601
+ */
1602
+ this._lastTouchMs = 0;
1603
+ /**
1604
+ * Handles keydown events. Must be an arrow function in order to preserve the context when it gets
1605
+ * bound.
1606
+ */
1607
+ this._onKeydown = (event) => {
1608
+ var _a, _b;
1609
+ // If this is one of the keys we should ignore, then ignore it and don't update the input
1610
+ // modality to keyboard.
1611
+ if ((_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.ignoreKeys) === null || _b === void 0 ? void 0 : _b.some(keyCode => keyCode === event.keyCode)) {
1612
+ return;
1613
+ }
1614
+ this._modality.next('keyboard');
1615
+ this._mostRecentTarget = _getEventTarget(event);
1616
+ };
1617
+ /**
1618
+ * Handles mousedown events. Must be an arrow function in order to preserve the context when it
1619
+ * gets bound.
1620
+ */
1621
+ this._onMousedown = (event) => {
1622
+ // Touches trigger both touch and mouse events, so we need to distinguish between mouse events
1623
+ // that were triggered via mouse vs touch. To do so, check if the mouse event occurs closely
1624
+ // after the previous touch event.
1625
+ if (Date.now() - this._lastTouchMs < TOUCH_BUFFER_MS) {
1626
+ return;
1627
+ }
1628
+ // Fake mousedown events are fired by some screen readers when controls are activated by the
1629
+ // screen reader. Attribute them to keyboard input modality.
1630
+ this._modality.next(isFakeMousedownFromScreenReader(event) ? 'keyboard' : 'mouse');
1631
+ this._mostRecentTarget = _getEventTarget(event);
1632
+ };
1633
+ /**
1634
+ * Handles touchstart events. Must be an arrow function in order to preserve the context when it
1635
+ * gets bound.
1636
+ */
1637
+ this._onTouchstart = (event) => {
1638
+ // Same scenario as mentioned in _onMousedown, but on touch screen devices, fake touchstart
1639
+ // events are fired. Again, attribute to keyboard input modality.
1640
+ if (isFakeTouchstartFromScreenReader(event)) {
1641
+ this._modality.next('keyboard');
1642
+ return;
1643
+ }
1644
+ // Store the timestamp of this touch event, as it's used to distinguish between mouse events
1645
+ // triggered via mouse vs touch.
1646
+ this._lastTouchMs = Date.now();
1647
+ this._modality.next('touch');
1648
+ this._mostRecentTarget = _getEventTarget(event);
1649
+ };
1650
+ this._options = Object.assign(Object.assign({}, INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS), options);
1651
+ // Skip the first emission as it's null.
1652
+ this.modalityDetected = this._modality.pipe(skip(1));
1653
+ this.modalityChanged = this.modalityDetected.pipe(distinctUntilChanged());
1654
+ // If we're not in a browser, this service should do nothing, as there's no relevant input
1655
+ // modality to detect.
1656
+ if (_platform.isBrowser) {
1657
+ ngZone.runOutsideAngular(() => {
1658
+ document.addEventListener('keydown', this._onKeydown, modalityEventListenerOptions);
1659
+ document.addEventListener('mousedown', this._onMousedown, modalityEventListenerOptions);
1660
+ document.addEventListener('touchstart', this._onTouchstart, modalityEventListenerOptions);
1661
+ });
1662
+ }
1663
+ }
1664
+ /** The most recently detected input modality. */
1665
+ get mostRecentModality() {
1666
+ return this._modality.value;
1667
+ }
1668
+ ngOnDestroy() {
1669
+ this._modality.complete();
1670
+ if (this._platform.isBrowser) {
1671
+ document.removeEventListener('keydown', this._onKeydown, modalityEventListenerOptions);
1672
+ document.removeEventListener('mousedown', this._onMousedown, modalityEventListenerOptions);
1673
+ document.removeEventListener('touchstart', this._onTouchstart, modalityEventListenerOptions);
1674
+ }
1675
+ }
1676
+ }
1677
+ InputModalityDetector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: InputModalityDetector, deps: [{ token: i1.Platform }, { token: i0.NgZone }, { token: DOCUMENT }, { token: INPUT_MODALITY_DETECTOR_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1678
+ InputModalityDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: InputModalityDetector, providedIn: 'root' });
1679
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: InputModalityDetector, decorators: [{
1680
+ type: Injectable,
1681
+ args: [{ providedIn: 'root' }]
1682
+ }], ctorParameters: function () {
1683
+ return [{ type: i1.Platform }, { type: i0.NgZone }, { type: Document, decorators: [{
1684
+ type: Inject,
1685
+ args: [DOCUMENT]
1686
+ }] }, { type: undefined, decorators: [{
1687
+ type: Optional
1688
+ }, {
1689
+ type: Inject,
1690
+ args: [INPUT_MODALITY_DETECTOR_OPTIONS]
1691
+ }] }];
1692
+ } });
1693
+
1694
+ /**
1695
+ * @license
1696
+ * Copyright Google LLC All Rights Reserved.
1697
+ *
1698
+ * Use of this source code is governed by an MIT-style license that can be
1699
+ * found in the LICENSE file at https://angular.io/license
1700
+ */
1701
+ const LIVE_ANNOUNCER_ELEMENT_TOKEN = new InjectionToken('liveAnnouncerElement', {
1702
+ providedIn: 'root',
1703
+ factory: LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY,
1704
+ });
1705
+ /** @docs-private */
1706
+ function LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY() {
1707
+ return null;
1708
+ }
1709
+ /** Injection token that can be used to configure the default options for the LiveAnnouncer. */
1710
+ const LIVE_ANNOUNCER_DEFAULT_OPTIONS = new InjectionToken('LIVE_ANNOUNCER_DEFAULT_OPTIONS');
1711
+
1712
+ class LiveAnnouncer {
1713
+ constructor(elementToken, _ngZone, _document, _defaultOptions) {
1714
+ this._ngZone = _ngZone;
1715
+ this._defaultOptions = _defaultOptions;
1716
+ // We inject the live element and document as `any` because the constructor signature cannot
1717
+ // reference browser globals (HTMLElement, Document) on non-browser environments, since having
1718
+ // a class decorator causes TypeScript to preserve the constructor signature types.
1719
+ this._document = _document;
1720
+ this._liveElement = elementToken || this._createLiveElement();
1721
+ }
1722
+ announce(message, ...args) {
1723
+ const defaultOptions = this._defaultOptions;
1724
+ let politeness;
1725
+ let duration;
1726
+ if (args.length === 1 && typeof args[0] === 'number') {
1727
+ duration = args[0];
1728
+ }
1729
+ else {
1730
+ [politeness, duration] = args;
1731
+ }
1732
+ this.clear();
1733
+ clearTimeout(this._previousTimeout);
1734
+ if (!politeness) {
1735
+ politeness =
1736
+ defaultOptions && defaultOptions.politeness ? defaultOptions.politeness : 'polite';
1737
+ }
1738
+ if (duration == null && defaultOptions) {
1739
+ duration = defaultOptions.duration;
1740
+ }
1741
+ // TODO: ensure changing the politeness works on all environments we support.
1742
+ this._liveElement.setAttribute('aria-live', politeness);
1743
+ // This 100ms timeout is necessary for some browser + screen-reader combinations:
1744
+ // - Both JAWS and NVDA over IE11 will not announce anything without a non-zero timeout.
1745
+ // - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a
1746
+ // second time without clearing and then using a non-zero delay.
1747
+ // (using JAWS 17 at time of this writing).
1748
+ return this._ngZone.runOutsideAngular(() => {
1749
+ if (!this._currentPromise) {
1750
+ this._currentPromise = new Promise(resolve => (this._currentResolve = resolve));
1751
+ }
1752
+ clearTimeout(this._previousTimeout);
1753
+ this._previousTimeout = setTimeout(() => {
1754
+ this._liveElement.textContent = message;
1755
+ if (typeof duration === 'number') {
1756
+ this._previousTimeout = setTimeout(() => this.clear(), duration);
1757
+ }
1758
+ this._currentResolve();
1759
+ this._currentPromise = this._currentResolve = undefined;
1760
+ }, 100);
1761
+ return this._currentPromise;
1762
+ });
1763
+ }
1764
+ /**
1765
+ * Clears the current text from the announcer element. Can be used to prevent
1766
+ * screen readers from reading the text out again while the user is going
1767
+ * through the page landmarks.
1768
+ */
1769
+ clear() {
1770
+ if (this._liveElement) {
1771
+ this._liveElement.textContent = '';
1772
+ }
1773
+ }
1774
+ ngOnDestroy() {
1775
+ var _a, _b;
1776
+ clearTimeout(this._previousTimeout);
1777
+ (_a = this._liveElement) === null || _a === void 0 ? void 0 : _a.remove();
1778
+ this._liveElement = null;
1779
+ (_b = this._currentResolve) === null || _b === void 0 ? void 0 : _b.call(this);
1780
+ this._currentPromise = this._currentResolve = undefined;
1781
+ }
1782
+ _createLiveElement() {
1783
+ const elementClass = 'cdk-live-announcer-element';
1784
+ const previousElements = this._document.getElementsByClassName(elementClass);
1785
+ const liveEl = this._document.createElement('div');
1786
+ // Remove any old containers. This can happen when coming in from a server-side-rendered page.
1787
+ for (let i = 0; i < previousElements.length; i++) {
1788
+ previousElements[i].remove();
1789
+ }
1790
+ liveEl.classList.add(elementClass);
1791
+ liveEl.classList.add('cdk-visually-hidden');
1792
+ liveEl.setAttribute('aria-atomic', 'true');
1793
+ liveEl.setAttribute('aria-live', 'polite');
1794
+ this._document.body.appendChild(liveEl);
1795
+ return liveEl;
1796
+ }
1797
+ }
1798
+ LiveAnnouncer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LiveAnnouncer, deps: [{ token: LIVE_ANNOUNCER_ELEMENT_TOKEN, optional: true }, { token: i0.NgZone }, { token: DOCUMENT }, { token: LIVE_ANNOUNCER_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1799
+ LiveAnnouncer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LiveAnnouncer, providedIn: 'root' });
1800
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LiveAnnouncer, decorators: [{
1801
+ type: Injectable,
1802
+ args: [{ providedIn: 'root' }]
1803
+ }], ctorParameters: function () {
1804
+ return [{ type: undefined, decorators: [{
1805
+ type: Optional
1806
+ }, {
1807
+ type: Inject,
1808
+ args: [LIVE_ANNOUNCER_ELEMENT_TOKEN]
1809
+ }] }, { type: i0.NgZone }, { type: undefined, decorators: [{
1810
+ type: Inject,
1811
+ args: [DOCUMENT]
1812
+ }] }, { type: undefined, decorators: [{
1813
+ type: Optional
1814
+ }, {
1815
+ type: Inject,
1816
+ args: [LIVE_ANNOUNCER_DEFAULT_OPTIONS]
1817
+ }] }];
1818
+ } });
1819
+ /**
1820
+ * A directive that works similarly to aria-live, but uses the LiveAnnouncer to ensure compatibility
1821
+ * with a wider range of browsers and screen readers.
1822
+ */
1823
+ class CdkAriaLive {
1824
+ constructor(_elementRef, _liveAnnouncer, _contentObserver, _ngZone) {
1825
+ this._elementRef = _elementRef;
1826
+ this._liveAnnouncer = _liveAnnouncer;
1827
+ this._contentObserver = _contentObserver;
1828
+ this._ngZone = _ngZone;
1829
+ this._politeness = 'polite';
1830
+ }
1831
+ /** The aria-live politeness level to use when announcing messages. */
1832
+ get politeness() {
1833
+ return this._politeness;
1834
+ }
1835
+ set politeness(value) {
1836
+ this._politeness = value === 'off' || value === 'assertive' ? value : 'polite';
1837
+ if (this._politeness === 'off') {
1838
+ if (this._subscription) {
1839
+ this._subscription.unsubscribe();
1840
+ this._subscription = null;
1841
+ }
1842
+ }
1843
+ else if (!this._subscription) {
1844
+ this._subscription = this._ngZone.runOutsideAngular(() => {
1845
+ return this._contentObserver.observe(this._elementRef).subscribe(() => {
1846
+ // Note that we use textContent here, rather than innerText, in order to avoid a reflow.
1847
+ const elementText = this._elementRef.nativeElement.textContent;
1848
+ // The `MutationObserver` fires also for attribute
1849
+ // changes which we don't want to announce.
1850
+ if (elementText !== this._previousAnnouncedText) {
1851
+ this._liveAnnouncer.announce(elementText, this._politeness, this.duration);
1852
+ this._previousAnnouncedText = elementText;
1853
+ }
1854
+ });
1855
+ });
1856
+ }
1857
+ }
1858
+ ngOnDestroy() {
1859
+ if (this._subscription) {
1860
+ this._subscription.unsubscribe();
1861
+ }
1862
+ }
1863
+ }
1864
+ CdkAriaLive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkAriaLive, deps: [{ token: i0.ElementRef }, { token: LiveAnnouncer }, { token: i1$1.ContentObserver }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1865
+ CdkAriaLive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: CdkAriaLive, selector: "[cdkAriaLive]", inputs: { politeness: ["cdkAriaLive", "politeness"], duration: ["cdkAriaLiveDuration", "duration"] }, exportAs: ["cdkAriaLive"], ngImport: i0 });
1866
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkAriaLive, decorators: [{
1867
+ type: Directive,
1868
+ args: [{
1869
+ selector: '[cdkAriaLive]',
1870
+ exportAs: 'cdkAriaLive',
1871
+ }]
1872
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: LiveAnnouncer }, { type: i1$1.ContentObserver }, { type: i0.NgZone }]; }, propDecorators: { politeness: [{
1873
+ type: Input,
1874
+ args: ['cdkAriaLive']
1875
+ }], duration: [{
1876
+ type: Input,
1877
+ args: ['cdkAriaLiveDuration']
1878
+ }] } });
1879
+
1880
+ /**
1881
+ * @license
1882
+ * Copyright Google LLC All Rights Reserved.
1883
+ *
1884
+ * Use of this source code is governed by an MIT-style license that can be
1885
+ * found in the LICENSE file at https://angular.io/license
1886
+ */
1887
+ /** InjectionToken for FocusMonitorOptions. */
1888
+ const FOCUS_MONITOR_DEFAULT_OPTIONS = new InjectionToken('cdk-focus-monitor-default-options');
1889
+ /**
1890
+ * Event listener options that enable capturing and also
1891
+ * mark the listener as passive if the browser supports it.
1892
+ */
1893
+ const captureEventListenerOptions = normalizePassiveListenerOptions({
1894
+ passive: true,
1895
+ capture: true,
1896
+ });
1897
+ /** Monitors mouse and keyboard events to determine the cause of focus events. */
1898
+ class FocusMonitor {
1899
+ constructor(_ngZone, _platform, _inputModalityDetector,
1900
+ /** @breaking-change 11.0.0 make document required */
1901
+ document, options) {
1902
+ this._ngZone = _ngZone;
1903
+ this._platform = _platform;
1904
+ this._inputModalityDetector = _inputModalityDetector;
1905
+ /** The focus origin that the next focus event is a result of. */
1906
+ this._origin = null;
1907
+ /** Whether the window has just been focused. */
1908
+ this._windowFocused = false;
1909
+ /**
1910
+ * Whether the origin was determined via a touch interaction. Necessary as properly attributing
1911
+ * focus events to touch interactions requires special logic.
1912
+ */
1913
+ this._originFromTouchInteraction = false;
1914
+ /** Map of elements being monitored to their info. */
1915
+ this._elementInfo = new Map();
1916
+ /** The number of elements currently being monitored. */
1917
+ this._monitoredElementCount = 0;
1918
+ /**
1919
+ * Keeps track of the root nodes to which we've currently bound a focus/blur handler,
1920
+ * as well as the number of monitored elements that they contain. We have to treat focus/blur
1921
+ * handlers differently from the rest of the events, because the browser won't emit events
1922
+ * to the document when focus moves inside of a shadow root.
1923
+ */
1924
+ this._rootNodeFocusListenerCount = new Map();
1925
+ /**
1926
+ * Event listener for `focus` events on the window.
1927
+ * Needs to be an arrow function in order to preserve the context when it gets bound.
1928
+ */
1929
+ this._windowFocusListener = () => {
1930
+ // Make a note of when the window regains focus, so we can
1931
+ // restore the origin info for the focused element.
1932
+ this._windowFocused = true;
1933
+ this._windowFocusTimeoutId = window.setTimeout(() => (this._windowFocused = false));
1934
+ };
1935
+ /** Subject for stopping our InputModalityDetector subscription. */
1936
+ this._stopInputModalityDetector = new Subject();
1937
+ /**
1938
+ * Event listener for `focus` and 'blur' events on the document.
1939
+ * Needs to be an arrow function in order to preserve the context when it gets bound.
1940
+ */
1941
+ this._rootNodeFocusAndBlurListener = (event) => {
1942
+ const target = _getEventTarget(event);
1943
+ // We need to walk up the ancestor chain in order to support `checkChildren`.
1944
+ for (let element = target; element; element = element.parentElement) {
1945
+ if (event.type === 'focus') {
1946
+ this._onFocus(event, element);
1947
+ }
1948
+ else {
1949
+ this._onBlur(event, element);
1950
+ }
1951
+ }
1952
+ };
1953
+ this._document = document;
1954
+ this._detectionMode = (options === null || options === void 0 ? void 0 : options.detectionMode) || 0 /* FocusMonitorDetectionMode.IMMEDIATE */;
1955
+ }
1956
+ monitor(element, checkChildren = false) {
1957
+ const nativeElement = coerceElement(element);
1958
+ // Do nothing if we're not on the browser platform or the passed in node isn't an element.
1959
+ if (!this._platform.isBrowser || nativeElement.nodeType !== 1) {
1960
+ return of(null);
1961
+ }
1962
+ // If the element is inside the shadow DOM, we need to bind our focus/blur listeners to
1963
+ // the shadow root, rather than the `document`, because the browser won't emit focus events
1964
+ // to the `document`, if focus is moving within the same shadow root.
1965
+ const rootNode = _getShadowRoot(nativeElement) || this._getDocument();
1966
+ const cachedInfo = this._elementInfo.get(nativeElement);
1967
+ // Check if we're already monitoring this element.
1968
+ if (cachedInfo) {
1969
+ if (checkChildren) {
1970
+ // TODO(COMP-318): this can be problematic, because it'll turn all non-checkChildren
1971
+ // observers into ones that behave as if `checkChildren` was turned on. We need a more
1972
+ // robust solution.
1973
+ cachedInfo.checkChildren = true;
1974
+ }
1975
+ return cachedInfo.subject;
1976
+ }
1977
+ // Create monitored element info.
1978
+ const info = {
1979
+ checkChildren: checkChildren,
1980
+ subject: new Subject(),
1981
+ rootNode,
1982
+ };
1983
+ this._elementInfo.set(nativeElement, info);
1984
+ this._registerGlobalListeners(info);
1985
+ return info.subject;
1986
+ }
1987
+ stopMonitoring(element) {
1988
+ const nativeElement = coerceElement(element);
1989
+ const elementInfo = this._elementInfo.get(nativeElement);
1990
+ if (elementInfo) {
1991
+ elementInfo.subject.complete();
1992
+ this._setClasses(nativeElement);
1993
+ this._elementInfo.delete(nativeElement);
1994
+ this._removeGlobalListeners(elementInfo);
1995
+ }
1996
+ }
1997
+ focusVia(element, origin, options) {
1998
+ const nativeElement = coerceElement(element);
1999
+ const focusedElement = this._getDocument().activeElement;
2000
+ // If the element is focused already, calling `focus` again won't trigger the event listener
2001
+ // which means that the focus classes won't be updated. If that's the case, update the classes
2002
+ // directly without waiting for an event.
2003
+ if (nativeElement === focusedElement) {
2004
+ this._getClosestElementsInfo(nativeElement).forEach(([currentElement, info]) => this._originChanged(currentElement, origin, info));
2005
+ }
2006
+ else {
2007
+ this._setOrigin(origin);
2008
+ // `focus` isn't available on the server
2009
+ if (typeof nativeElement.focus === 'function') {
2010
+ nativeElement.focus(options);
2011
+ }
2012
+ }
2013
+ }
2014
+ ngOnDestroy() {
2015
+ this._elementInfo.forEach((_info, element) => this.stopMonitoring(element));
2016
+ }
2017
+ /** Access injected document if available or fallback to global document reference */
2018
+ _getDocument() {
2019
+ return this._document || document;
2020
+ }
2021
+ /** Use defaultView of injected document if available or fallback to global window reference */
2022
+ _getWindow() {
2023
+ const doc = this._getDocument();
2024
+ return doc.defaultView || window;
2025
+ }
2026
+ _getFocusOrigin(focusEventTarget) {
2027
+ if (this._origin) {
2028
+ // If the origin was realized via a touch interaction, we need to perform additional checks
2029
+ // to determine whether the focus origin should be attributed to touch or program.
2030
+ if (this._originFromTouchInteraction) {
2031
+ return this._shouldBeAttributedToTouch(focusEventTarget) ? 'touch' : 'program';
2032
+ }
2033
+ else {
2034
+ return this._origin;
2035
+ }
2036
+ }
2037
+ // If the window has just regained focus, we can restore the most recent origin from before the
2038
+ // window blurred. Otherwise, we've reached the point where we can't identify the source of the
2039
+ // focus. This typically means one of two things happened:
2040
+ //
2041
+ // 1) The element was programmatically focused, or
2042
+ // 2) The element was focused via screen reader navigation (which generally doesn't fire
2043
+ // events).
2044
+ //
2045
+ // Because we can't distinguish between these two cases, we default to setting `program`.
2046
+ if (this._windowFocused && this._lastFocusOrigin) {
2047
+ return this._lastFocusOrigin;
2048
+ }
2049
+ // If the interaction is coming from an input label, we consider it a mouse interactions.
2050
+ // This is a special case where focus moves on `click`, rather than `mousedown` which breaks
2051
+ // our detection, because all our assumptions are for `mousedown`. We need to handle this
2052
+ // special case, because it's very common for checkboxes and radio buttons.
2053
+ if (focusEventTarget && this._isLastInteractionFromInputLabel(focusEventTarget)) {
2054
+ return 'mouse';
2055
+ }
2056
+ return 'program';
2057
+ }
2058
+ /**
2059
+ * Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a
2060
+ * touch origin isn't immediately reset at the next tick (see _setOrigin). This means that when we
2061
+ * handle a focus event following a touch interaction, we need to determine whether (1) the focus
2062
+ * event was directly caused by the touch interaction or (2) the focus event was caused by a
2063
+ * subsequent programmatic focus call triggered by the touch interaction.
2064
+ * @param focusEventTarget The target of the focus event under examination.
2065
+ */
2066
+ _shouldBeAttributedToTouch(focusEventTarget) {
2067
+ // Please note that this check is not perfect. Consider the following edge case:
2068
+ //
2069
+ // <div #parent tabindex="0">
2070
+ // <div #child tabindex="0" (click)="#parent.focus()"></div>
2071
+ // </div>
2072
+ //
2073
+ // Suppose there is a FocusMonitor in IMMEDIATE mode attached to #parent. When the user touches
2074
+ // #child, #parent is programmatically focused. This code will attribute the focus to touch
2075
+ // instead of program. This is a relatively minor edge-case that can be worked around by using
2076
+ // focusVia(parent, 'program') to focus #parent.
2077
+ return (this._detectionMode === 1 /* FocusMonitorDetectionMode.EVENTUAL */ ||
2078
+ !!(focusEventTarget === null || focusEventTarget === void 0 ? void 0 : focusEventTarget.contains(this._inputModalityDetector._mostRecentTarget)));
2079
+ }
2080
+ /**
2081
+ * Sets the focus classes on the element based on the given focus origin.
2082
+ * @param element The element to update the classes on.
2083
+ * @param origin The focus origin.
2084
+ */
2085
+ _setClasses(element, origin) {
2086
+ element.classList.toggle('cdk-focused', !!origin);
2087
+ element.classList.toggle('cdk-touch-focused', origin === 'touch');
2088
+ element.classList.toggle('cdk-keyboard-focused', origin === 'keyboard');
2089
+ element.classList.toggle('cdk-mouse-focused', origin === 'mouse');
2090
+ element.classList.toggle('cdk-program-focused', origin === 'program');
2091
+ }
2092
+ /**
2093
+ * Updates the focus origin. If we're using immediate detection mode, we schedule an async
2094
+ * function to clear the origin at the end of a timeout. The duration of the timeout depends on
2095
+ * the origin being set.
2096
+ * @param origin The origin to set.
2097
+ * @param isFromInteraction Whether we are setting the origin from an interaction event.
2098
+ */
2099
+ _setOrigin(origin, isFromInteraction = false) {
2100
+ this._ngZone.runOutsideAngular(() => {
2101
+ this._origin = origin;
2102
+ this._originFromTouchInteraction = origin === 'touch' && isFromInteraction;
2103
+ // If we're in IMMEDIATE mode, reset the origin at the next tick (or in `TOUCH_BUFFER_MS` ms
2104
+ // for a touch event). We reset the origin at the next tick because Firefox focuses one tick
2105
+ // after the interaction event. We wait `TOUCH_BUFFER_MS` ms before resetting the origin for
2106
+ // a touch event because when a touch event is fired, the associated focus event isn't yet in
2107
+ // the event queue. Before doing so, clear any pending timeouts.
2108
+ if (this._detectionMode === 0 /* FocusMonitorDetectionMode.IMMEDIATE */) {
2109
+ clearTimeout(this._originTimeoutId);
2110
+ const ms = this._originFromTouchInteraction ? TOUCH_BUFFER_MS : 1;
2111
+ this._originTimeoutId = setTimeout(() => (this._origin = null), ms);
2112
+ }
2113
+ });
2114
+ }
2115
+ /**
2116
+ * Handles focus events on a registered element.
2117
+ * @param event The focus event.
2118
+ * @param element The monitored element.
2119
+ */
2120
+ _onFocus(event, element) {
2121
+ // NOTE(mmalerba): We currently set the classes based on the focus origin of the most recent
2122
+ // focus event affecting the monitored element. If we want to use the origin of the first event
2123
+ // instead we should check for the cdk-focused class here and return if the element already has
2124
+ // it. (This only matters for elements that have includesChildren = true).
2125
+ // If we are not counting child-element-focus as focused, make sure that the event target is the
2126
+ // monitored element itself.
2127
+ const elementInfo = this._elementInfo.get(element);
2128
+ const focusEventTarget = _getEventTarget(event);
2129
+ if (!elementInfo || (!elementInfo.checkChildren && element !== focusEventTarget)) {
2130
+ return;
2131
+ }
2132
+ this._originChanged(element, this._getFocusOrigin(focusEventTarget), elementInfo);
2133
+ }
2134
+ /**
2135
+ * Handles blur events on a registered element.
2136
+ * @param event The blur event.
2137
+ * @param element The monitored element.
2138
+ */
2139
+ _onBlur(event, element) {
2140
+ // If we are counting child-element-focus as focused, make sure that we aren't just blurring in
2141
+ // order to focus another child of the monitored element.
2142
+ const elementInfo = this._elementInfo.get(element);
2143
+ if (!elementInfo ||
2144
+ (elementInfo.checkChildren &&
2145
+ event.relatedTarget instanceof Node &&
2146
+ element.contains(event.relatedTarget))) {
2147
+ return;
2148
+ }
2149
+ this._setClasses(element);
2150
+ this._emitOrigin(elementInfo, null);
2151
+ }
2152
+ _emitOrigin(info, origin) {
2153
+ if (info.subject.observers.length) {
2154
+ this._ngZone.run(() => info.subject.next(origin));
2155
+ }
2156
+ }
2157
+ _registerGlobalListeners(elementInfo) {
2158
+ if (!this._platform.isBrowser) {
2159
+ return;
2160
+ }
2161
+ const rootNode = elementInfo.rootNode;
2162
+ const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode) || 0;
2163
+ if (!rootNodeFocusListeners) {
2164
+ this._ngZone.runOutsideAngular(() => {
2165
+ rootNode.addEventListener('focus', this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
2166
+ rootNode.addEventListener('blur', this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
2167
+ });
2168
+ }
2169
+ this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners + 1);
2170
+ // Register global listeners when first element is monitored.
2171
+ if (++this._monitoredElementCount === 1) {
2172
+ // Note: we listen to events in the capture phase so we
2173
+ // can detect them even if the user stops propagation.
2174
+ this._ngZone.runOutsideAngular(() => {
2175
+ const window = this._getWindow();
2176
+ window.addEventListener('focus', this._windowFocusListener);
2177
+ });
2178
+ // The InputModalityDetector is also just a collection of global listeners.
2179
+ this._inputModalityDetector.modalityDetected
2180
+ .pipe(takeUntil(this._stopInputModalityDetector))
2181
+ .subscribe(modality => {
2182
+ this._setOrigin(modality, true /* isFromInteraction */);
2183
+ });
2184
+ }
2185
+ }
2186
+ _removeGlobalListeners(elementInfo) {
2187
+ const rootNode = elementInfo.rootNode;
2188
+ if (this._rootNodeFocusListenerCount.has(rootNode)) {
2189
+ const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode);
2190
+ if (rootNodeFocusListeners > 1) {
2191
+ this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners - 1);
2192
+ }
2193
+ else {
2194
+ rootNode.removeEventListener('focus', this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
2195
+ rootNode.removeEventListener('blur', this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
2196
+ this._rootNodeFocusListenerCount.delete(rootNode);
2197
+ }
2198
+ }
2199
+ // Unregister global listeners when last element is unmonitored.
2200
+ if (!--this._monitoredElementCount) {
2201
+ const window = this._getWindow();
2202
+ window.removeEventListener('focus', this._windowFocusListener);
2203
+ // Equivalently, stop our InputModalityDetector subscription.
2204
+ this._stopInputModalityDetector.next();
2205
+ // Clear timeouts for all potentially pending timeouts to prevent the leaks.
2206
+ clearTimeout(this._windowFocusTimeoutId);
2207
+ clearTimeout(this._originTimeoutId);
2208
+ }
2209
+ }
2210
+ /** Updates all the state on an element once its focus origin has changed. */
2211
+ _originChanged(element, origin, elementInfo) {
2212
+ this._setClasses(element, origin);
2213
+ this._emitOrigin(elementInfo, origin);
2214
+ this._lastFocusOrigin = origin;
2215
+ }
2216
+ /**
2217
+ * Collects the `MonitoredElementInfo` of a particular element and
2218
+ * all of its ancestors that have enabled `checkChildren`.
2219
+ * @param element Element from which to start the search.
2220
+ */
2221
+ _getClosestElementsInfo(element) {
2222
+ const results = [];
2223
+ this._elementInfo.forEach((info, currentElement) => {
2224
+ if (currentElement === element || (info.checkChildren && currentElement.contains(element))) {
2225
+ results.push([currentElement, info]);
2226
+ }
2227
+ });
2228
+ return results;
2229
+ }
2230
+ /**
2231
+ * Returns whether an interaction is likely to have come from the user clicking the `label` of
2232
+ * an `input` or `textarea` in order to focus it.
2233
+ * @param focusEventTarget Target currently receiving focus.
2234
+ */
2235
+ _isLastInteractionFromInputLabel(focusEventTarget) {
2236
+ const { _mostRecentTarget: mostRecentTarget, mostRecentModality } = this._inputModalityDetector;
2237
+ // If the last interaction used the mouse on an element contained by one of the labels
2238
+ // of an `input`/`textarea` that is currently focused, it is very likely that the
2239
+ // user redirected focus using the label.
2240
+ if (mostRecentModality !== 'mouse' ||
2241
+ !mostRecentTarget ||
2242
+ mostRecentTarget === focusEventTarget ||
2243
+ (focusEventTarget.nodeName !== 'INPUT' && focusEventTarget.nodeName !== 'TEXTAREA') ||
2244
+ focusEventTarget.disabled) {
2245
+ return false;
2246
+ }
2247
+ const labels = focusEventTarget.labels;
2248
+ if (labels) {
2249
+ for (let i = 0; i < labels.length; i++) {
2250
+ if (labels[i].contains(mostRecentTarget)) {
2251
+ return true;
2252
+ }
2253
+ }
2254
+ }
2255
+ return false;
2256
+ }
2257
+ }
2258
+ FocusMonitor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FocusMonitor, deps: [{ token: i0.NgZone }, { token: i1.Platform }, { token: InputModalityDetector }, { token: DOCUMENT, optional: true }, { token: FOCUS_MONITOR_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
2259
+ FocusMonitor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FocusMonitor, providedIn: 'root' });
2260
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FocusMonitor, decorators: [{
2261
+ type: Injectable,
2262
+ args: [{ providedIn: 'root' }]
2263
+ }], ctorParameters: function () {
2264
+ return [{ type: i0.NgZone }, { type: i1.Platform }, { type: InputModalityDetector }, { type: undefined, decorators: [{
2265
+ type: Optional
2266
+ }, {
2267
+ type: Inject,
2268
+ args: [DOCUMENT]
2269
+ }] }, { type: undefined, decorators: [{
2270
+ type: Optional
2271
+ }, {
2272
+ type: Inject,
2273
+ args: [FOCUS_MONITOR_DEFAULT_OPTIONS]
2274
+ }] }];
2275
+ } });
2276
+ /**
2277
+ * Directive that determines how a particular element was focused (via keyboard, mouse, touch, or
2278
+ * programmatically) and adds corresponding classes to the element.
2279
+ *
2280
+ * There are two variants of this directive:
2281
+ * 1) cdkMonitorElementFocus: does not consider an element to be focused if one of its children is
2282
+ * focused.
2283
+ * 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused.
2284
+ */
2285
+ class CdkMonitorFocus {
2286
+ constructor(_elementRef, _focusMonitor) {
2287
+ this._elementRef = _elementRef;
2288
+ this._focusMonitor = _focusMonitor;
2289
+ this._focusOrigin = null;
2290
+ this.cdkFocusChange = new EventEmitter();
2291
+ }
2292
+ get focusOrigin() {
2293
+ return this._focusOrigin;
2294
+ }
2295
+ ngAfterViewInit() {
2296
+ const element = this._elementRef.nativeElement;
2297
+ this._monitorSubscription = this._focusMonitor
2298
+ .monitor(element, element.nodeType === 1 && element.hasAttribute('cdkMonitorSubtreeFocus'))
2299
+ .subscribe(origin => {
2300
+ this._focusOrigin = origin;
2301
+ this.cdkFocusChange.emit(origin);
2302
+ });
2303
+ }
2304
+ ngOnDestroy() {
2305
+ this._focusMonitor.stopMonitoring(this._elementRef);
2306
+ if (this._monitorSubscription) {
2307
+ this._monitorSubscription.unsubscribe();
2308
+ }
2309
+ }
2310
+ }
2311
+ CdkMonitorFocus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkMonitorFocus, deps: [{ token: i0.ElementRef }, { token: FocusMonitor }], target: i0.ɵɵFactoryTarget.Directive });
2312
+ CdkMonitorFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: { cdkFocusChange: "cdkFocusChange" }, exportAs: ["cdkMonitorFocus"], ngImport: i0 });
2313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkMonitorFocus, decorators: [{
2314
+ type: Directive,
2315
+ args: [{
2316
+ selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]',
2317
+ exportAs: 'cdkMonitorFocus',
2318
+ }]
2319
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: FocusMonitor }]; }, propDecorators: { cdkFocusChange: [{
2320
+ type: Output
2321
+ }] } });
2322
+
2323
+ /**
2324
+ * @license
2325
+ * Copyright Google LLC All Rights Reserved.
2326
+ *
2327
+ * Use of this source code is governed by an MIT-style license that can be
2328
+ * found in the LICENSE file at https://angular.io/license
2329
+ */
2330
+ /** CSS class applied to the document body when in black-on-white high-contrast mode. */
2331
+ const BLACK_ON_WHITE_CSS_CLASS = 'cdk-high-contrast-black-on-white';
2332
+ /** CSS class applied to the document body when in white-on-black high-contrast mode. */
2333
+ const WHITE_ON_BLACK_CSS_CLASS = 'cdk-high-contrast-white-on-black';
2334
+ /** CSS class applied to the document body when in high-contrast mode. */
2335
+ const HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS = 'cdk-high-contrast-active';
2336
+ /**
2337
+ * Service to determine whether the browser is currently in a high-contrast-mode environment.
2338
+ *
2339
+ * Microsoft Windows supports an accessibility feature called "High Contrast Mode". This mode
2340
+ * changes the appearance of all applications, including web applications, to dramatically increase
2341
+ * contrast.
2342
+ *
2343
+ * IE, Edge, and Firefox currently support this mode. Chrome does not support Windows High Contrast
2344
+ * Mode. This service does not detect high-contrast mode as added by the Chrome "High Contrast"
2345
+ * browser extension.
2346
+ */
2347
+ class HighContrastModeDetector {
2348
+ constructor(_platform, document) {
2349
+ this._platform = _platform;
2350
+ this._document = document;
2351
+ this._breakpointSubscription = inject(BreakpointObserver)
2352
+ .observe('(forced-colors: active)')
2353
+ .subscribe(() => {
2354
+ if (this._hasCheckedHighContrastMode) {
2355
+ this._hasCheckedHighContrastMode = false;
2356
+ this._applyBodyHighContrastModeCssClasses();
2357
+ }
2358
+ });
2359
+ }
2360
+ /** Gets the current high-contrast-mode for the page. */
2361
+ getHighContrastMode() {
2362
+ if (!this._platform.isBrowser) {
2363
+ return 0 /* HighContrastMode.NONE */;
2364
+ }
2365
+ // Create a test element with an arbitrary background-color that is neither black nor
2366
+ // white; high-contrast mode will coerce the color to either black or white. Also ensure that
2367
+ // appending the test element to the DOM does not affect layout by absolutely positioning it
2368
+ const testElement = this._document.createElement('div');
2369
+ testElement.style.backgroundColor = 'rgb(1,2,3)';
2370
+ testElement.style.position = 'absolute';
2371
+ this._document.body.appendChild(testElement);
2372
+ // Get the computed style for the background color, collapsing spaces to normalize between
2373
+ // browsers. Once we get this color, we no longer need the test element. Access the `window`
2374
+ // via the document so we can fake it in tests. Note that we have extra null checks, because
2375
+ // this logic will likely run during app bootstrap and throwing can break the entire app.
2376
+ const documentWindow = this._document.defaultView || window;
2377
+ const computedStyle = documentWindow && documentWindow.getComputedStyle
2378
+ ? documentWindow.getComputedStyle(testElement)
2379
+ : null;
2380
+ const computedColor = ((computedStyle && computedStyle.backgroundColor) || '').replace(/ /g, '');
2381
+ testElement.remove();
2382
+ switch (computedColor) {
2383
+ // Pre Windows 11 dark theme.
2384
+ case 'rgb(0,0,0)':
2385
+ // Windows 11 dark themes.
2386
+ case 'rgb(45,50,54)':
2387
+ case 'rgb(32,32,32)':
2388
+ return 2 /* HighContrastMode.WHITE_ON_BLACK */;
2389
+ // Pre Windows 11 light theme.
2390
+ case 'rgb(255,255,255)':
2391
+ // Windows 11 light theme.
2392
+ case 'rgb(255,250,239)':
2393
+ return 1 /* HighContrastMode.BLACK_ON_WHITE */;
2394
+ }
2395
+ return 0 /* HighContrastMode.NONE */;
2396
+ }
2397
+ ngOnDestroy() {
2398
+ this._breakpointSubscription.unsubscribe();
2399
+ }
2400
+ /** Applies CSS classes indicating high-contrast mode to document body (browser-only). */
2401
+ _applyBodyHighContrastModeCssClasses() {
2402
+ if (!this._hasCheckedHighContrastMode && this._platform.isBrowser && this._document.body) {
2403
+ const bodyClasses = this._document.body.classList;
2404
+ bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
2405
+ this._hasCheckedHighContrastMode = true;
2406
+ const mode = this.getHighContrastMode();
2407
+ if (mode === 1 /* HighContrastMode.BLACK_ON_WHITE */) {
2408
+ bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS);
2409
+ }
2410
+ else if (mode === 2 /* HighContrastMode.WHITE_ON_BLACK */) {
2411
+ bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
2412
+ }
2413
+ }
2414
+ }
2415
+ }
2416
+ HighContrastModeDetector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: HighContrastModeDetector, deps: [{ token: i1.Platform }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
2417
+ HighContrastModeDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: HighContrastModeDetector, providedIn: 'root' });
2418
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: HighContrastModeDetector, decorators: [{
2419
+ type: Injectable,
2420
+ args: [{ providedIn: 'root' }]
2421
+ }], ctorParameters: function () {
2422
+ return [{ type: i1.Platform }, { type: undefined, decorators: [{
2423
+ type: Inject,
2424
+ args: [DOCUMENT]
2425
+ }] }];
2426
+ } });
2427
+
2428
+ /**
2429
+ * @license
2430
+ * Copyright Google LLC All Rights Reserved.
2431
+ *
2432
+ * Use of this source code is governed by an MIT-style license that can be
2433
+ * found in the LICENSE file at https://angular.io/license
2434
+ */
2435
+ class A11yModule {
2436
+ constructor(highContrastModeDetector) {
2437
+ highContrastModeDetector._applyBodyHighContrastModeCssClasses();
2438
+ }
2439
+ }
2440
+ A11yModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: A11yModule, deps: [{ token: HighContrastModeDetector }], target: i0.ɵɵFactoryTarget.NgModule });
2441
+ A11yModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: A11yModule, declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus], imports: [ObserversModule], exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus] });
2442
+ A11yModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: A11yModule, imports: [ObserversModule] });
2443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: A11yModule, decorators: [{
2444
+ type: NgModule,
2445
+ args: [{
2446
+ imports: [ObserversModule],
2447
+ declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
2448
+ exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
2449
+ }]
2450
+ }], ctorParameters: function () { return [{ type: HighContrastModeDetector }]; } });
2451
+
2452
+ /**
2453
+ * @license
2454
+ * Copyright Google LLC All Rights Reserved.
2455
+ *
2456
+ * Use of this source code is governed by an MIT-style license that can be
2457
+ * found in the LICENSE file at https://angular.io/license
2458
+ */
2459
+
2460
+ /**
2461
+ * @license
2462
+ * Copyright Google LLC All Rights Reserved.
2463
+ *
2464
+ * Use of this source code is governed by an MIT-style license that can be
2465
+ * found in the LICENSE file at https://angular.io/license
2466
+ */
2467
+
2468
+ /**
2469
+ * Generated bundle index. Do not edit.
2470
+ */
2471
+
2472
+ export { A11yModule, ActiveDescendantKeyManager, AriaDescriber, CDK_DESCRIBEDBY_HOST_ATTRIBUTE, CDK_DESCRIBEDBY_ID_PREFIX, CdkAriaLive, CdkMonitorFocus, CdkTrapFocus, ConfigurableFocusTrap, ConfigurableFocusTrapFactory, EventListenerFocusTrapInertStrategy, FOCUS_MONITOR_DEFAULT_OPTIONS, FOCUS_TRAP_INERT_STRATEGY, FocusKeyManager, FocusMonitor, FocusTrap, FocusTrapFactory, HighContrastModeDetector, INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS, INPUT_MODALITY_DETECTOR_OPTIONS, InputModalityDetector, InteractivityChecker, IsFocusableConfig, LIVE_ANNOUNCER_DEFAULT_OPTIONS, LIVE_ANNOUNCER_ELEMENT_TOKEN, LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY, ListKeyManager, LiveAnnouncer, MESSAGES_CONTAINER_ID, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader };
2473
+ //# sourceMappingURL=a11y.mjs.map