@angular/cdk 14.0.0-next.0 → 14.0.0-next.11

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 (272) hide show
  1. package/a11y/_index.scss +11 -0
  2. package/a11y/a11y-module.d.ts +2 -3
  3. package/a11y/aria-describer/aria-describer.d.ts +33 -6
  4. package/a11y/live-announcer/live-announcer.d.ts +5 -1
  5. package/a11y-prebuilt.css +1 -1
  6. package/drag-drop/drag-events.d.ts +8 -0
  7. package/drag-drop/drag-ref.d.ts +11 -1
  8. package/drag-drop/drop-list-ref.d.ts +5 -1
  9. package/drag-drop/parent-position-tracker.d.ts +11 -3
  10. package/esm2020/a11y/a11y-module.mjs +6 -7
  11. package/esm2020/a11y/aria-describer/aria-describer.mjs +75 -52
  12. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +13 -11
  13. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
  14. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +4 -4
  15. package/esm2020/a11y/focus-trap/focus-trap.mjs +7 -7
  16. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +7 -12
  17. package/esm2020/a11y/input-modality/input-modality-detector.mjs +4 -4
  18. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
  19. package/esm2020/a11y/live-announcer/live-announcer.mjs +26 -18
  20. package/esm2020/accordion/accordion-item.mjs +4 -4
  21. package/esm2020/accordion/accordion-module.mjs +5 -5
  22. package/esm2020/accordion/accordion.mjs +4 -4
  23. package/esm2020/bidi/bidi-module.mjs +5 -5
  24. package/esm2020/bidi/dir.mjs +4 -4
  25. package/esm2020/bidi/directionality.mjs +4 -4
  26. package/esm2020/clipboard/clipboard-module.mjs +5 -5
  27. package/esm2020/clipboard/clipboard.mjs +4 -4
  28. package/esm2020/clipboard/copy-to-clipboard.mjs +4 -4
  29. package/esm2020/collections/unique-selection-dispatcher.mjs +4 -4
  30. package/esm2020/drag-drop/directives/drag-handle.mjs +4 -4
  31. package/esm2020/drag-drop/directives/drag-placeholder.mjs +4 -4
  32. package/esm2020/drag-drop/directives/drag-preview.mjs +4 -4
  33. package/esm2020/drag-drop/directives/drag.mjs +26 -24
  34. package/esm2020/drag-drop/directives/drop-list-group.mjs +4 -4
  35. package/esm2020/drag-drop/directives/drop-list.mjs +14 -13
  36. package/esm2020/drag-drop/drag-drop-module.mjs +5 -5
  37. package/esm2020/drag-drop/drag-drop-registry.mjs +4 -4
  38. package/esm2020/drag-drop/drag-drop.mjs +4 -4
  39. package/esm2020/drag-drop/drag-events.mjs +1 -1
  40. package/esm2020/drag-drop/drag-ref.mjs +48 -24
  41. package/esm2020/drag-drop/drop-list-ref.mjs +7 -3
  42. package/esm2020/drag-drop/parent-position-tracker.mjs +13 -5
  43. package/esm2020/layout/breakpoints-observer.mjs +4 -4
  44. package/esm2020/layout/layout-module.mjs +5 -5
  45. package/esm2020/layout/media-matcher.mjs +4 -4
  46. package/esm2020/observers/observe-content.mjs +14 -14
  47. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
  48. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +26 -8
  49. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +33 -12
  50. package/esm2020/overlay/fullscreen-overlay-container.mjs +4 -4
  51. package/esm2020/overlay/overlay-container.mjs +4 -4
  52. package/esm2020/overlay/overlay-directives.mjs +7 -7
  53. package/esm2020/overlay/overlay-module.mjs +5 -5
  54. package/esm2020/overlay/overlay-ref.mjs +24 -18
  55. package/esm2020/overlay/overlay.mjs +14 -8
  56. package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +21 -3
  57. package/esm2020/overlay/position/global-position-strategy.mjs +64 -30
  58. package/esm2020/overlay/position/overlay-position-builder.mjs +4 -4
  59. package/esm2020/overlay/public-api.mjs +2 -2
  60. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +4 -4
  61. package/esm2020/platform/platform-module.mjs +5 -5
  62. package/esm2020/platform/platform.mjs +4 -4
  63. package/esm2020/portal/dom-portal-outlet.mjs +29 -5
  64. package/esm2020/portal/portal-directives.mjs +20 -18
  65. package/esm2020/portal/portal.mjs +12 -3
  66. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +4 -4
  67. package/esm2020/scrolling/scroll-dispatcher.mjs +4 -4
  68. package/esm2020/scrolling/scrollable.mjs +4 -4
  69. package/esm2020/scrolling/scrolling-module.mjs +10 -11
  70. package/esm2020/scrolling/viewport-ruler.mjs +4 -4
  71. package/esm2020/scrolling/virtual-for-of.mjs +7 -5
  72. package/esm2020/scrolling/virtual-scroll-viewport.mjs +8 -6
  73. package/esm2020/stepper/step-header.mjs +4 -4
  74. package/esm2020/stepper/step-label.mjs +4 -4
  75. package/esm2020/stepper/stepper-button.mjs +7 -7
  76. package/esm2020/stepper/stepper-module.mjs +5 -5
  77. package/esm2020/stepper/stepper.mjs +9 -22
  78. package/esm2020/table/cell.mjs +22 -22
  79. package/esm2020/table/coalesced-style-scheduler.mjs +4 -4
  80. package/esm2020/table/row.mjs +28 -28
  81. package/esm2020/table/table-module.mjs +5 -5
  82. package/esm2020/table/table.mjs +21 -21
  83. package/esm2020/table/text-column.mjs +4 -4
  84. package/esm2020/testing/component-harness.mjs +7 -1
  85. package/esm2020/testing/harness-environment.mjs +12 -1
  86. package/esm2020/testing/public-api.mjs +2 -1
  87. package/esm2020/testing/selenium-webdriver/selenium-web-driver-element.mjs +8 -3
  88. package/esm2020/testing/test-element-errors.mjs +15 -0
  89. package/esm2020/testing/test-element.mjs +1 -1
  90. package/esm2020/testing/testbed/fake-events/type-in-element.mjs +13 -4
  91. package/esm2020/testing/testbed/unit-test-element.mjs +21 -5
  92. package/esm2020/text-field/autofill.mjs +7 -7
  93. package/esm2020/text-field/autosize.mjs +4 -4
  94. package/esm2020/text-field/text-field-module.mjs +5 -7
  95. package/esm2020/tree/nested-node.mjs +4 -4
  96. package/esm2020/tree/node.mjs +4 -4
  97. package/esm2020/tree/outlet.mjs +4 -4
  98. package/esm2020/tree/padding.mjs +4 -4
  99. package/esm2020/tree/toggle.mjs +4 -4
  100. package/esm2020/tree/tree-module.mjs +5 -5
  101. package/esm2020/tree/tree.mjs +7 -7
  102. package/esm2020/version.mjs +1 -1
  103. package/fesm2015/a11y.mjs +146 -118
  104. package/fesm2015/a11y.mjs.map +1 -1
  105. package/fesm2015/accordion.mjs +10 -10
  106. package/fesm2015/accordion.mjs.map +1 -1
  107. package/fesm2015/bidi.mjs +10 -10
  108. package/fesm2015/bidi.mjs.map +1 -1
  109. package/fesm2015/cdk.mjs +1 -1
  110. package/fesm2015/cdk.mjs.map +1 -1
  111. package/fesm2015/clipboard.mjs +10 -10
  112. package/fesm2015/clipboard.mjs.map +1 -1
  113. package/fesm2015/coercion.mjs.map +1 -1
  114. package/fesm2015/collections.mjs +3 -3
  115. package/fesm2015/collections.mjs.map +1 -1
  116. package/fesm2015/drag-drop.mjs +126 -86
  117. package/fesm2015/drag-drop.mjs.map +1 -1
  118. package/fesm2015/keycodes.mjs.map +1 -1
  119. package/fesm2015/layout.mjs +10 -10
  120. package/fesm2015/layout.mjs.map +1 -1
  121. package/fesm2015/observers.mjs +13 -13
  122. package/fesm2015/observers.mjs.map +1 -1
  123. package/fesm2015/overlay.mjs +202 -99
  124. package/fesm2015/overlay.mjs.map +1 -1
  125. package/fesm2015/platform.mjs +7 -7
  126. package/fesm2015/platform.mjs.map +1 -1
  127. package/fesm2015/portal.mjs +58 -24
  128. package/fesm2015/portal.mjs.map +1 -1
  129. package/fesm2015/scrolling.mjs +35 -31
  130. package/fesm2015/scrolling.mjs.map +1 -1
  131. package/fesm2015/stepper.mjs +24 -37
  132. package/fesm2015/stepper.mjs.map +1 -1
  133. package/fesm2015/table.mjs +78 -78
  134. package/fesm2015/table.mjs.map +1 -1
  135. package/fesm2015/testing/selenium-webdriver.mjs +7 -2
  136. package/fesm2015/testing/selenium-webdriver.mjs.map +1 -1
  137. package/fesm2015/testing/testbed.mjs +32 -8
  138. package/fesm2015/testing/testbed.mjs.map +1 -1
  139. package/fesm2015/testing.mjs +39 -1
  140. package/fesm2015/testing.mjs.map +1 -1
  141. package/fesm2015/text-field.mjs +14 -15
  142. package/fesm2015/text-field.mjs.map +1 -1
  143. package/fesm2015/tree.mjs +25 -25
  144. package/fesm2015/tree.mjs.map +1 -1
  145. package/fesm2020/a11y.mjs +142 -116
  146. package/fesm2020/a11y.mjs.map +1 -1
  147. package/fesm2020/accordion.mjs +10 -10
  148. package/fesm2020/accordion.mjs.map +1 -1
  149. package/fesm2020/bidi.mjs +10 -10
  150. package/fesm2020/bidi.mjs.map +1 -1
  151. package/fesm2020/cdk.mjs +1 -1
  152. package/fesm2020/cdk.mjs.map +1 -1
  153. package/fesm2020/clipboard.mjs +10 -10
  154. package/fesm2020/clipboard.mjs.map +1 -1
  155. package/fesm2020/coercion.mjs.map +1 -1
  156. package/fesm2020/collections.mjs +3 -3
  157. package/fesm2020/collections.mjs.map +1 -1
  158. package/fesm2020/drag-drop.mjs +125 -86
  159. package/fesm2020/drag-drop.mjs.map +1 -1
  160. package/fesm2020/keycodes.mjs.map +1 -1
  161. package/fesm2020/layout.mjs +10 -10
  162. package/fesm2020/layout.mjs.map +1 -1
  163. package/fesm2020/observers.mjs +13 -13
  164. package/fesm2020/observers.mjs.map +1 -1
  165. package/fesm2020/overlay.mjs +202 -99
  166. package/fesm2020/overlay.mjs.map +1 -1
  167. package/fesm2020/platform.mjs +7 -7
  168. package/fesm2020/platform.mjs.map +1 -1
  169. package/fesm2020/portal.mjs +58 -24
  170. package/fesm2020/portal.mjs.map +1 -1
  171. package/fesm2020/scrolling.mjs +35 -31
  172. package/fesm2020/scrolling.mjs.map +1 -1
  173. package/fesm2020/stepper.mjs +24 -37
  174. package/fesm2020/stepper.mjs.map +1 -1
  175. package/fesm2020/table.mjs +78 -78
  176. package/fesm2020/table.mjs.map +1 -1
  177. package/fesm2020/testing/selenium-webdriver.mjs +7 -2
  178. package/fesm2020/testing/selenium-webdriver.mjs.map +1 -1
  179. package/fesm2020/testing/testbed.mjs +32 -8
  180. package/fesm2020/testing/testbed.mjs.map +1 -1
  181. package/fesm2020/testing.mjs +33 -1
  182. package/fesm2020/testing.mjs.map +1 -1
  183. package/fesm2020/text-field.mjs +14 -15
  184. package/fesm2020/text-field.mjs.map +1 -1
  185. package/fesm2020/tree.mjs +25 -25
  186. package/fesm2020/tree.mjs.map +1 -1
  187. package/overlay/_index.scss +11 -1
  188. package/overlay/dispatchers/overlay-keyboard-dispatcher.d.ts +7 -2
  189. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +8 -2
  190. package/overlay/overlay-ref.d.ts +4 -1
  191. package/overlay/overlay.d.ts +3 -2
  192. package/overlay/position/flexible-connected-position-strategy.d.ts +2 -0
  193. package/overlay/position/global-position-strategy.d.ts +14 -3
  194. package/overlay/public-api.d.ts +1 -1
  195. package/overlay-prebuilt.css +1 -1
  196. package/package.json +3 -11
  197. package/portal/dom-portal-outlet.d.ts +17 -6
  198. package/portal/portal.d.ts +12 -2
  199. package/schematics/collection.json +2 -1
  200. package/schematics/index.js +6 -2
  201. package/schematics/index.mjs +6 -2
  202. package/schematics/migration.json +5 -0
  203. package/schematics/ng-add/index.js +1 -1
  204. package/schematics/ng-add/index.mjs +1 -1
  205. package/schematics/ng-generate/drag-drop/index.js +5 -14
  206. package/schematics/ng-generate/drag-drop/index.mjs +5 -14
  207. package/schematics/ng-generate/drag-drop/schema.json +1 -1
  208. package/schematics/ng-update/data/constructor-checks.js +7 -1
  209. package/schematics/ng-update/data/constructor-checks.mjs +7 -1
  210. package/schematics/ng-update/data/index.js +6 -2
  211. package/schematics/ng-update/data/index.mjs +6 -2
  212. package/schematics/ng-update/devkit-migration-rule.js +5 -14
  213. package/schematics/ng-update/devkit-migration-rule.mjs +5 -14
  214. package/schematics/ng-update/devkit-migration.js +1 -1
  215. package/schematics/ng-update/devkit-migration.mjs +1 -1
  216. package/schematics/ng-update/html-parsing/elements.js +2 -3
  217. package/schematics/ng-update/html-parsing/elements.mjs +2 -3
  218. package/schematics/ng-update/index.d.ts +2 -0
  219. package/schematics/ng-update/index.js +7 -2
  220. package/schematics/ng-update/index.mjs +7 -2
  221. package/schematics/ng-update/migrations/symbol-removal.js +2 -3
  222. package/schematics/ng-update/migrations/symbol-removal.mjs +2 -3
  223. package/schematics/ng-update/public-api.js +6 -2
  224. package/schematics/ng-update/public-api.mjs +6 -2
  225. package/schematics/tsconfig.json +2 -10
  226. package/schematics/update-tool/public-api.js +6 -2
  227. package/schematics/update-tool/public-api.mjs +6 -2
  228. package/schematics/update-tool/target-version.d.ts +2 -1
  229. package/schematics/update-tool/target-version.js +2 -1
  230. package/schematics/update-tool/target-version.mjs +2 -1
  231. package/schematics/utils/ast.js +11 -22
  232. package/schematics/utils/ast.mjs +11 -22
  233. package/schematics/utils/build-component.js +10 -15
  234. package/schematics/utils/build-component.mjs +10 -15
  235. package/schematics/utils/get-project.d.ts +1 -1
  236. package/schematics/utils/get-project.js +7 -2
  237. package/schematics/utils/get-project.mjs +7 -2
  238. package/schematics/utils/html-manipulation.js +3 -1
  239. package/schematics/utils/html-manipulation.mjs +3 -1
  240. package/schematics/utils/index.js +6 -2
  241. package/schematics/utils/index.mjs +6 -2
  242. package/schematics/utils/project-index-file.js +2 -2
  243. package/schematics/utils/project-index-file.mjs +2 -2
  244. package/schematics/utils/project-targets.js +3 -4
  245. package/schematics/utils/project-targets.mjs +3 -4
  246. package/schematics/utils/project-tsconfig-paths.js +16 -28
  247. package/schematics/utils/project-tsconfig-paths.mjs +16 -28
  248. package/scrolling/scrolling-module.d.ts +1 -2
  249. package/stepper/stepper.d.ts +3 -12
  250. package/table/table.d.ts +2 -6
  251. package/table/text-column.d.ts +1 -1
  252. package/testing/component-harness.d.ts +18 -0
  253. package/testing/harness-environment.d.ts +2 -0
  254. package/testing/public-api.d.ts +1 -0
  255. package/testing/{protractor/index.d.ts → test-element-errors.d.ts} +5 -1
  256. package/testing/test-element.d.ts +4 -2
  257. package/testing/testbed/fake-events/type-in-element.d.ts +2 -2
  258. package/testing/testbed/unit-test-element.d.ts +4 -1
  259. package/text-field/text-field-module.d.ts +1 -2
  260. package/text-field-prebuilt.css +1 -1
  261. package/esm2020/testing/protractor/index.mjs +0 -9
  262. package/esm2020/testing/protractor/protractor-element.mjs +0 -234
  263. package/esm2020/testing/protractor/protractor-harness-environment.mjs +0 -72
  264. package/esm2020/testing/protractor/public-api.mjs +0 -10
  265. package/fesm2015/testing/protractor.mjs +0 -355
  266. package/fesm2015/testing/protractor.mjs.map +0 -1
  267. package/fesm2020/testing/protractor.mjs +0 -322
  268. package/fesm2020/testing/protractor.mjs.map +0 -1
  269. package/testing/protractor/package.json +0 -9
  270. package/testing/protractor/protractor-element.d.ts +0 -90
  271. package/testing/protractor/protractor-harness-environment.d.ts +0 -50
  272. package/testing/protractor/public-api.d.ts +0 -9
package/a11y/_index.scss CHANGED
@@ -21,6 +21,17 @@
21
21
  // Avoid some cases where the browser will still render the native controls (see #9049).
22
22
  -webkit-appearance: none;
23
23
  -moz-appearance: none;
24
+
25
+ // We need at least one of top/bottom/left/right in order to prevent cases where the
26
+ // absolute-positioned element is pushed down and can affect scrolling (see #24597).
27
+ // `left` was chosen here, because it's the least likely to break overrides where the
28
+ // element might have been positioned (e.g. `mat-checkbox`).
29
+ left: 0;
30
+
31
+ [dir='rtl'] & {
32
+ left: auto;
33
+ right: 0;
34
+ }
24
35
  }
25
36
  }
26
37
 
@@ -3,11 +3,10 @@ import * as i0 from "@angular/core";
3
3
  import * as i1 from "./live-announcer/live-announcer";
4
4
  import * as i2 from "./focus-trap/focus-trap";
5
5
  import * as i3 from "./focus-monitor/focus-monitor";
6
- import * as i4 from "@angular/cdk/platform";
7
- import * as i5 from "@angular/cdk/observers";
6
+ import * as i4 from "@angular/cdk/observers";
8
7
  export declare class A11yModule {
9
8
  constructor(highContrastModeDetector: HighContrastModeDetector);
10
9
  static ɵfac: i0.ɵɵFactoryDeclaration<A11yModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<A11yModule, [typeof i1.CdkAriaLive, typeof i2.CdkTrapFocus, typeof i3.CdkMonitorFocus], [typeof i4.PlatformModule, typeof i5.ObserversModule], [typeof i1.CdkAriaLive, typeof i2.CdkTrapFocus, typeof i3.CdkMonitorFocus]>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<A11yModule, [typeof i1.CdkAriaLive, typeof i2.CdkTrapFocus, typeof i3.CdkMonitorFocus], [typeof i4.ObserversModule], [typeof i1.CdkAriaLive, typeof i2.CdkTrapFocus, typeof i3.CdkMonitorFocus]>;
12
11
  static ɵinj: i0.ɵɵInjectorDeclaration<A11yModule>;
13
12
  }
@@ -1,4 +1,5 @@
1
1
  import { OnDestroy } from '@angular/core';
2
+ import { Platform } from '@angular/cdk/platform';
2
3
  import * as i0 from "@angular/core";
3
4
  /**
4
5
  * Interface used to register message elements and keep a count of how many registrations have
@@ -10,11 +11,23 @@ export interface RegisteredMessage {
10
11
  /** The number of elements that reference this message element via `aria-describedby`. */
11
12
  referenceCount: number;
12
13
  }
13
- /** ID used for the body container where all messages are appended. */
14
+ /**
15
+ * ID used for the body container where all messages are appended.
16
+ * @deprecated No longer being used. To be removed.
17
+ * @breaking-change 14.0.0
18
+ */
14
19
  export declare const MESSAGES_CONTAINER_ID = "cdk-describedby-message-container";
15
- /** ID prefix used for each created message element. */
20
+ /**
21
+ * ID prefix used for each created message element.
22
+ * @deprecated To be turned into a private variable.
23
+ * @breaking-change 14.0.0
24
+ */
16
25
  export declare const CDK_DESCRIBEDBY_ID_PREFIX = "cdk-describedby-message";
17
- /** Attribute given to each host element that is described by a message element. */
26
+ /**
27
+ * Attribute given to each host element that is described by a message element.
28
+ * @deprecated To be turned into a private variable.
29
+ * @breaking-change 14.0.0
30
+ */
18
31
  export declare const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = "cdk-describedby-host";
19
32
  /**
20
33
  * Utility that creates visually hidden elements with a message content. Useful for elements that
@@ -22,8 +35,24 @@ export declare const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = "cdk-describedby-host";
22
35
  * content.
23
36
  */
24
37
  export declare class AriaDescriber implements OnDestroy {
38
+ /**
39
+ * @deprecated To be turned into a required parameter.
40
+ * @breaking-change 14.0.0
41
+ */
42
+ private _platform?;
25
43
  private _document;
26
- constructor(_document: any);
44
+ /** Map of all registered message elements that have been placed into the document. */
45
+ private _messageRegistry;
46
+ /** Container for all registered messages. */
47
+ private _messagesContainer;
48
+ /** Unique ID for the service. */
49
+ private readonly _id;
50
+ constructor(_document: any,
51
+ /**
52
+ * @deprecated To be turned into a required parameter.
53
+ * @breaking-change 14.0.0
54
+ */
55
+ _platform?: Platform | undefined);
27
56
  /**
28
57
  * Adds to the host element an aria-describedby reference to a hidden element that contains
29
58
  * the message. If the same message has already been registered, then it will reuse the created
@@ -49,8 +78,6 @@ export declare class AriaDescriber implements OnDestroy {
49
78
  private _deleteMessageElement;
50
79
  /** Creates the global container for all aria-describedby messages. */
51
80
  private _createMessagesContainer;
52
- /** Deletes the global messages container. */
53
- private _deleteMessagesContainer;
54
81
  /** Removes all cdk-describedby messages that are hosted through the element. */
55
82
  private _removeCdkDescribedByReferenceIds;
56
83
  /**
@@ -15,6 +15,8 @@ export declare class LiveAnnouncer implements OnDestroy {
15
15
  private _liveElement;
16
16
  private _document;
17
17
  private _previousTimeout;
18
+ private _currentPromise;
19
+ private _currentResolve;
18
20
  constructor(elementToken: any, _ngZone: NgZone, _document: any, _defaultOptions?: LiveAnnouncerDefaultOptions | undefined);
19
21
  /**
20
22
  * Announces a message to screenreaders.
@@ -72,10 +74,12 @@ export declare class CdkAriaLive implements OnDestroy {
72
74
  get politeness(): AriaLivePoliteness;
73
75
  set politeness(value: AriaLivePoliteness);
74
76
  private _politeness;
77
+ /** Time in milliseconds after which to clear out the announcer element. */
78
+ duration: number;
75
79
  private _previousAnnouncedText?;
76
80
  private _subscription;
77
81
  constructor(_elementRef: ElementRef, _liveAnnouncer: LiveAnnouncer, _contentObserver: ContentObserver, _ngZone: NgZone);
78
82
  ngOnDestroy(): void;
79
83
  static ɵfac: i0.ɵɵFactoryDeclaration<CdkAriaLive, never>;
80
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkAriaLive, "[cdkAriaLive]", ["cdkAriaLive"], { "politeness": "cdkAriaLive"; }, {}, never>;
84
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkAriaLive, "[cdkAriaLive]", ["cdkAriaLive"], { "politeness": "cdkAriaLive"; "duration": "cdkAriaLiveDuration"; }, {}, never>;
81
85
  }
package/a11y-prebuilt.css CHANGED
@@ -1 +1 @@
1
- .cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none}
1
+ .cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}
@@ -11,11 +11,15 @@ import { CdkDropList } from './directives/drop-list';
11
11
  export interface CdkDragStart<T = any> {
12
12
  /** Draggable that emitted the event. */
13
13
  source: CdkDrag<T>;
14
+ /** Native event that started the drag sequence. */
15
+ event: MouseEvent | TouchEvent;
14
16
  }
15
17
  /** Event emitted when the user releases an item, before any animations have started. */
16
18
  export interface CdkDragRelease<T = any> {
17
19
  /** Draggable that emitted the event. */
18
20
  source: CdkDrag<T>;
21
+ /** Native event that caused the release event. */
22
+ event: MouseEvent | TouchEvent;
19
23
  }
20
24
  /** Event emitted when the user stops dragging a draggable. */
21
25
  export interface CdkDragEnd<T = any> {
@@ -31,6 +35,8 @@ export interface CdkDragEnd<T = any> {
31
35
  x: number;
32
36
  y: number;
33
37
  };
38
+ /** Native event that caused the dragging to stop. */
39
+ event: MouseEvent | TouchEvent;
34
40
  }
35
41
  /** Event emitted when the user moves an item into a new drop container. */
36
42
  export interface CdkDragEnter<T = any, I = T> {
@@ -75,6 +81,8 @@ export interface CdkDragDrop<T, O = T, I = any> {
75
81
  x: number;
76
82
  y: number;
77
83
  };
84
+ /** Native event that caused the drop event. */
85
+ event: MouseEvent | TouchEvent;
78
86
  }
79
87
  /** Event emitted as the user is dragging a draggable item. */
80
88
  export interface CdkDragMove<T = any> {
@@ -157,7 +157,7 @@ export declare class DragRef<T = any> {
157
157
  private _boundaryElement;
158
158
  /** Whether the native dragging interactions have been enabled on the root element. */
159
159
  private _nativeInteractionsEnabled;
160
- /** Cached dimensions of the preview element. */
160
+ /** Cached dimensions of the preview element. Should be read via `_getPreviewRect`. */
161
161
  private _previewRect?;
162
162
  /** Cached dimensions of the boundary element. */
163
163
  private _boundaryRect?;
@@ -202,16 +202,19 @@ export declare class DragRef<T = any> {
202
202
  /** Emits when the user starts dragging the item. */
203
203
  readonly started: Subject<{
204
204
  source: DragRef;
205
+ event: MouseEvent | TouchEvent;
205
206
  }>;
206
207
  /** Emits when the user has released a drag item, before any animations have started. */
207
208
  readonly released: Subject<{
208
209
  source: DragRef;
210
+ event: MouseEvent | TouchEvent;
209
211
  }>;
210
212
  /** Emits when the user stops dragging an item in the container. */
211
213
  readonly ended: Subject<{
212
214
  source: DragRef;
213
215
  distance: Point;
214
216
  dropPoint: Point;
217
+ event: MouseEvent | TouchEvent;
215
218
  }>;
216
219
  /** Emits when the user has moved the item into a new container. */
217
220
  readonly entered: Subject<{
@@ -234,6 +237,7 @@ export declare class DragRef<T = any> {
234
237
  distance: Point;
235
238
  dropPoint: Point;
236
239
  isPointerOverContainer: boolean;
240
+ event: MouseEvent | TouchEvent;
237
241
  }>;
238
242
  /**
239
243
  * Emits as the user is dragging the item. Use with caution,
@@ -434,5 +438,11 @@ export declare class DragRef<T = any> {
434
438
  private _getShadowRoot;
435
439
  /** Gets the element into which the drag preview should be inserted. */
436
440
  private _getPreviewInsertionPoint;
441
+ /** Lazily resolves and returns the dimensions of the preview. */
442
+ private _getPreviewRect;
443
+ /** Handles a native `dragstart` event. */
444
+ private _nativeDragStart;
445
+ /** Gets a handle that is the target of an event. */
446
+ private _getTargetHandle;
437
447
  }
438
448
  export {};
@@ -75,6 +75,7 @@ export declare class DropListRef<T = any> {
75
75
  isPointerOverContainer: boolean;
76
76
  distance: Point;
77
77
  dropPoint: Point;
78
+ event: MouseEvent | TouchEvent;
78
79
  }>;
79
80
  /** Emits as the user is swapping items while actively dragging. */
80
81
  readonly sorted: Subject<{
@@ -163,8 +164,11 @@ export declare class DropListRef<T = any> {
163
164
  * @param isPointerOverContainer Whether the user's pointer was over the
164
165
  * container when the item was dropped.
165
166
  * @param distance Distance the user has dragged since the start of the dragging sequence.
167
+ * @param event Event that triggered the dropping sequence.
168
+ *
169
+ * @breaking-change 15.0.0 `previousIndex` and `event` parameters to become required.
166
170
  */
167
- drop(item: DragRef, currentIndex: number, previousIndex: number, previousContainer: DropListRef, isPointerOverContainer: boolean, distance: Point, dropPoint: Point): void;
171
+ drop(item: DragRef, currentIndex: number, previousIndex: number, previousContainer: DropListRef, isPointerOverContainer: boolean, distance: Point, dropPoint: Point, event?: MouseEvent | TouchEvent): void;
168
172
  /**
169
173
  * Sets the draggable items that are a part of this list.
170
174
  * @param items Items that are a part of this list.
@@ -5,7 +5,6 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { ViewportRuler } from '@angular/cdk/scrolling';
9
8
  /** Object holding the scroll position of something. */
10
9
  interface ScrollPosition {
11
10
  top: number;
@@ -14,18 +13,27 @@ interface ScrollPosition {
14
13
  /** Keeps track of the scroll position and dimensions of the parents of an element. */
15
14
  export declare class ParentPositionTracker {
16
15
  private _document;
17
- private _viewportRuler;
18
16
  /** Cached positions of the scrollable parent elements. */
19
17
  readonly positions: Map<HTMLElement | Document, {
20
18
  scrollPosition: ScrollPosition;
21
19
  clientRect?: ClientRect | undefined;
22
20
  }>;
23
- constructor(_document: Document, _viewportRuler: ViewportRuler);
21
+ constructor(_document: Document);
24
22
  /** Clears the cached positions. */
25
23
  clear(): void;
26
24
  /** Caches the positions. Should be called at the beginning of a drag sequence. */
27
25
  cache(elements: readonly HTMLElement[]): void;
28
26
  /** Handles scrolling while a drag is taking place. */
29
27
  handleScroll(event: Event): ScrollPosition | null;
28
+ /**
29
+ * Gets the scroll position of the viewport. Note that we use the scrollX and scrollY directly,
30
+ * instead of going through the `ViewportRuler`, because the first value the ruler looks at is
31
+ * the top/left offset of the `document.documentElement` which works for most cases, but breaks
32
+ * if the element is offset by something like the `BlockScrollStrategy`.
33
+ */
34
+ getViewportScrollPosition(): {
35
+ top: number;
36
+ left: number;
37
+ };
30
38
  }
31
39
  export {};
@@ -6,7 +6,6 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { ObserversModule } from '@angular/cdk/observers';
9
- import { PlatformModule } from '@angular/cdk/platform';
10
9
  import { NgModule } from '@angular/core';
11
10
  import { CdkMonitorFocus } from './focus-monitor/focus-monitor';
12
11
  import { CdkTrapFocus } from './focus-trap/focus-trap';
@@ -19,15 +18,15 @@ export class A11yModule {
19
18
  highContrastModeDetector._applyBodyHighContrastModeCssClasses();
20
19
  }
21
20
  }
22
- A11yModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: A11yModule, deps: [{ token: i1.HighContrastModeDetector }], target: i0.ɵɵFactoryTarget.NgModule });
23
- A11yModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: A11yModule, declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus], imports: [PlatformModule, ObserversModule], exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus] });
24
- A11yModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: A11yModule, imports: [[PlatformModule, ObserversModule]] });
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: A11yModule, decorators: [{
21
+ A11yModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, deps: [{ token: i1.HighContrastModeDetector }], target: i0.ɵɵFactoryTarget.NgModule });
22
+ A11yModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus], imports: [ObserversModule], exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus] });
23
+ A11yModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, imports: [[ObserversModule]] });
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, decorators: [{
26
25
  type: NgModule,
27
26
  args: [{
28
- imports: [PlatformModule, ObserversModule],
27
+ imports: [ObserversModule],
29
28
  declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
30
29
  exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
31
30
  }]
32
31
  }], ctorParameters: function () { return [{ type: i1.HighContrastModeDetector }]; } });
33
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYTExeS1tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvY2RrL2ExMXkvYTExeS1tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLGVBQWUsRUFBQyxNQUFNLHdCQUF3QixDQUFDO0FBQ3ZELE9BQ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