@angular/cdk 7.1.0 → 7.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/LICENSE +1 -1
  2. package/_a11y.scss +1 -1
  3. package/a11y/typings/focus-monitor/focus-monitor.d.ts +20 -5
  4. package/a11y/typings/focus-trap/focus-trap.d.ts +2 -0
  5. package/a11y/typings/index.metadata.json +1 -1
  6. package/bundles/cdk-a11y.umd.js +428 -197
  7. package/bundles/cdk-a11y.umd.js.map +1 -1
  8. package/bundles/cdk-a11y.umd.min.js +1 -1
  9. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  10. package/bundles/cdk-accordion.umd.js +16 -9
  11. package/bundles/cdk-accordion.umd.js.map +1 -1
  12. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  13. package/bundles/cdk-bidi.umd.js +11 -6
  14. package/bundles/cdk-bidi.umd.js.map +1 -1
  15. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  16. package/bundles/cdk-coercion.umd.js +25 -9
  17. package/bundles/cdk-coercion.umd.js.map +1 -1
  18. package/bundles/cdk-coercion.umd.min.js +1 -1
  19. package/bundles/cdk-coercion.umd.min.js.map +1 -1
  20. package/bundles/cdk-collections.umd.js +28 -5
  21. package/bundles/cdk-collections.umd.js.map +1 -1
  22. package/bundles/cdk-collections.umd.min.js.map +1 -1
  23. package/bundles/cdk-drag-drop.umd.js +2297 -973
  24. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  25. package/bundles/cdk-drag-drop.umd.min.js +2 -1
  26. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  27. package/bundles/cdk-keycodes.umd.js +12 -2
  28. package/bundles/cdk-keycodes.umd.js.map +1 -1
  29. package/bundles/cdk-layout.umd.js +29 -22
  30. package/bundles/cdk-layout.umd.js.map +1 -1
  31. package/bundles/cdk-layout.umd.min.js +1 -1
  32. package/bundles/cdk-layout.umd.min.js.map +1 -1
  33. package/bundles/cdk-observers.umd.js +27 -8
  34. package/bundles/cdk-observers.umd.js.map +1 -1
  35. package/bundles/cdk-observers.umd.min.js +1 -1
  36. package/bundles/cdk-observers.umd.min.js.map +1 -1
  37. package/bundles/cdk-overlay.umd.js +586 -240
  38. package/bundles/cdk-overlay.umd.js.map +1 -1
  39. package/bundles/cdk-overlay.umd.min.js +2 -2
  40. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  41. package/bundles/cdk-platform.umd.js +50 -28
  42. package/bundles/cdk-platform.umd.js.map +1 -1
  43. package/bundles/cdk-platform.umd.min.js.map +1 -1
  44. package/bundles/cdk-portal.umd.js +17 -10
  45. package/bundles/cdk-portal.umd.js.map +1 -1
  46. package/bundles/cdk-portal.umd.min.js.map +1 -1
  47. package/bundles/cdk-scrolling.umd.js +148 -50
  48. package/bundles/cdk-scrolling.umd.js.map +1 -1
  49. package/bundles/cdk-scrolling.umd.min.js +1 -1
  50. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  51. package/bundles/cdk-stepper.umd.js +69 -27
  52. package/bundles/cdk-stepper.umd.js.map +1 -1
  53. package/bundles/cdk-stepper.umd.min.js +1 -1
  54. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  55. package/bundles/cdk-table.umd.js +189 -51
  56. package/bundles/cdk-table.umd.js.map +1 -1
  57. package/bundles/cdk-table.umd.min.js +1 -1
  58. package/bundles/cdk-table.umd.min.js.map +1 -1
  59. package/bundles/cdk-text-field.umd.js +76 -38
  60. package/bundles/cdk-text-field.umd.js.map +1 -1
  61. package/bundles/cdk-text-field.umd.min.js +1 -1
  62. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  63. package/bundles/cdk-tree.umd.js +71 -34
  64. package/bundles/cdk-tree.umd.js.map +1 -1
  65. package/bundles/cdk-tree.umd.min.js +1 -1
  66. package/bundles/cdk-tree.umd.min.js.map +1 -1
  67. package/bundles/cdk.umd.js +5 -4
  68. package/bundles/cdk.umd.js.map +1 -1
  69. package/bundles/cdk.umd.min.js +1 -1
  70. package/bundles/cdk.umd.min.js.map +1 -1
  71. package/coercion/typings/element.d.ts +13 -0
  72. package/coercion/typings/index.metadata.json +1 -1
  73. package/coercion/typings/public-api.d.ts +1 -0
  74. package/drag-drop/typings/{drag-handle.d.ts → directives/drag-handle.d.ts} +6 -2
  75. package/drag-drop/typings/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  76. package/drag-drop/typings/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  77. package/drag-drop/typings/directives/drag.d.ts +110 -0
  78. package/{typings/esm5/drag-drop → drag-drop/typings/directives}/drop-list-group.d.ts +3 -0
  79. package/drag-drop/typings/{drop-list.d.ts → directives/drop-list.d.ts} +32 -72
  80. package/drag-drop/typings/drag-drop-registry.d.ts +8 -3
  81. package/drag-drop/typings/drag-events.d.ts +14 -7
  82. package/{typings/esm5/drag-drop/drag.d.ts → drag-drop/typings/drag-ref.d.ts} +152 -83
  83. package/drag-drop/typings/drop-list-container.d.ts +19 -3
  84. package/drag-drop/typings/drop-list-ref.d.ts +234 -0
  85. package/drag-drop/typings/index.d.ts +1 -0
  86. package/drag-drop/typings/index.metadata.json +1 -1
  87. package/drag-drop/typings/public-api.d.ts +13 -6
  88. package/esm2015/a11y.js +306 -182
  89. package/esm2015/a11y.js.map +1 -1
  90. package/esm2015/accordion.js +16 -11
  91. package/esm2015/accordion.js.map +1 -1
  92. package/esm2015/bidi.js +13 -8
  93. package/esm2015/bidi.js.map +1 -1
  94. package/esm2015/cdk.js +7 -6
  95. package/esm2015/cdk.js.map +1 -1
  96. package/esm2015/coercion.js +25 -8
  97. package/esm2015/coercion.js.map +1 -1
  98. package/esm2015/collections.js +22 -7
  99. package/esm2015/collections.js.map +1 -1
  100. package/esm2015/drag-drop.js +1774 -864
  101. package/esm2015/drag-drop.js.map +1 -1
  102. package/esm2015/keycodes.js +14 -4
  103. package/esm2015/keycodes.js.map +1 -1
  104. package/esm2015/layout.js +29 -19
  105. package/esm2015/layout.js.map +1 -1
  106. package/esm2015/observers.js +16 -11
  107. package/esm2015/observers.js.map +1 -1
  108. package/esm2015/overlay.js +373 -213
  109. package/esm2015/overlay.js.map +1 -1
  110. package/esm2015/platform.js +53 -31
  111. package/esm2015/platform.js.map +1 -1
  112. package/esm2015/portal.js +14 -10
  113. package/esm2015/portal.js.map +1 -1
  114. package/esm2015/scrolling.js +111 -51
  115. package/esm2015/scrolling.js.map +1 -1
  116. package/esm2015/stepper.js +56 -30
  117. package/esm2015/stepper.js.map +1 -1
  118. package/esm2015/table.js +96 -48
  119. package/esm2015/table.js.map +1 -1
  120. package/esm2015/text-field.js +54 -37
  121. package/esm2015/text-field.js.map +1 -1
  122. package/esm2015/tree.js +55 -36
  123. package/esm2015/tree.js.map +1 -1
  124. package/esm5/a11y.es5.js +432 -201
  125. package/esm5/a11y.es5.js.map +1 -1
  126. package/esm5/accordion.es5.js +18 -11
  127. package/esm5/accordion.es5.js.map +1 -1
  128. package/esm5/bidi.es5.js +13 -8
  129. package/esm5/bidi.es5.js.map +1 -1
  130. package/esm5/cdk.es5.js +7 -6
  131. package/esm5/cdk.es5.js.map +1 -1
  132. package/esm5/coercion.es5.js +25 -8
  133. package/esm5/coercion.es5.js.map +1 -1
  134. package/esm5/collections.es5.js +35 -7
  135. package/esm5/collections.es5.js.map +1 -1
  136. package/esm5/drag-drop.es5.js +2358 -1035
  137. package/esm5/drag-drop.es5.js.map +1 -1
  138. package/esm5/keycodes.es5.js +14 -4
  139. package/esm5/keycodes.es5.js.map +1 -1
  140. package/esm5/layout.es5.js +31 -24
  141. package/esm5/layout.es5.js.map +1 -1
  142. package/esm5/observers.es5.js +30 -11
  143. package/esm5/observers.es5.js.map +1 -1
  144. package/esm5/overlay.es5.js +590 -244
  145. package/esm5/overlay.es5.js.map +1 -1
  146. package/esm5/platform.es5.js +52 -30
  147. package/esm5/platform.es5.js.map +1 -1
  148. package/esm5/portal.es5.js +19 -12
  149. package/esm5/portal.es5.js.map +1 -1
  150. package/esm5/scrolling.es5.js +150 -52
  151. package/esm5/scrolling.es5.js.map +1 -1
  152. package/esm5/stepper.es5.js +71 -30
  153. package/esm5/stepper.es5.js.map +1 -1
  154. package/esm5/table.es5.js +191 -53
  155. package/esm5/table.es5.js.map +1 -1
  156. package/esm5/text-field.es5.js +75 -37
  157. package/esm5/text-field.es5.js.map +1 -1
  158. package/esm5/tree.es5.js +74 -37
  159. package/esm5/tree.es5.js.map +1 -1
  160. package/overlay/typings/index.metadata.json +1 -1
  161. package/overlay/typings/overlay-directives.d.ts +0 -2
  162. package/overlay/typings/overlay-ref.d.ts +1 -1
  163. package/package.json +4 -4
  164. package/portal/typings/portal.d.ts +1 -1
  165. package/schematics/migration.json +5 -0
  166. package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
  167. package/schematics/ng-update/index.d.ts +2 -0
  168. package/schematics/ng-update/index.js +5 -0
  169. package/schematics/ng-update/index.js.map +1 -1
  170. package/schematics/ng-update/target-version.d.ts +7 -1
  171. package/schematics/ng-update/target-version.js +10 -0
  172. package/schematics/ng-update/target-version.js.map +1 -1
  173. package/schematics/ng-update/upgrade-data.js +2 -1
  174. package/schematics/ng-update/upgrade-data.js.map +1 -1
  175. package/schematics/ng-update/upgrade-rules/index.js +3 -2
  176. package/schematics/ng-update/upgrade-rules/index.js.map +1 -1
  177. package/schematics/utils/ast/ng-module-imports.d.ts +1 -1
  178. package/schematics/utils/ast/ng-module-imports.js +25 -13
  179. package/schematics/utils/ast/ng-module-imports.js.map +1 -1
  180. package/schematics/utils/get-project.js +2 -1
  181. package/schematics/utils/get-project.js.map +1 -1
  182. package/schematics/utils/parse5-element.js +3 -2
  183. package/schematics/utils/parse5-element.js.map +1 -1
  184. package/schematics/utils/project-targets.js +2 -1
  185. package/schematics/utils/project-targets.js.map +1 -1
  186. package/schematics/utils/version-agnostic-typescript.js +3 -2
  187. package/schematics/utils/version-agnostic-typescript.js.map +1 -1
  188. package/scrolling/typings/index.metadata.json +1 -1
  189. package/stepper/typings/index.metadata.json +1 -1
  190. package/stepper/typings/stepper.d.ts +13 -1
  191. package/text-field/typings/autosize.d.ts +6 -0
  192. package/text-field/typings/index.metadata.json +1 -1
  193. package/tree/typings/control/base-tree-control.d.ts +1 -1
  194. package/tree/typings/control/nested-tree-control.d.ts +2 -2
  195. package/tree/typings/control/tree-control.d.ts +1 -1
  196. package/tree/typings/nested-node.d.ts +5 -5
  197. package/typings/a11y/focus-monitor/focus-monitor.d.ts +20 -5
  198. package/typings/a11y/focus-trap/focus-trap.d.ts +2 -0
  199. package/typings/a11y/index.metadata.json +1 -1
  200. package/typings/coercion/element.d.ts +13 -0
  201. package/typings/coercion/index.metadata.json +1 -1
  202. package/typings/coercion/public-api.d.ts +1 -0
  203. package/typings/drag-drop/{drag-handle.d.ts → directives/drag-handle.d.ts} +6 -2
  204. package/typings/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  205. package/typings/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  206. package/typings/drag-drop/directives/drag.d.ts +110 -0
  207. package/typings/drag-drop/{drop-list-group.d.ts → directives/drop-list-group.d.ts} +3 -0
  208. package/typings/{esm5/drag-drop → drag-drop/directives}/drop-list.d.ts +32 -72
  209. package/typings/drag-drop/drag-drop-registry.d.ts +8 -3
  210. package/typings/drag-drop/drag-events.d.ts +14 -7
  211. package/typings/drag-drop/{drag.d.ts → drag-ref.d.ts} +152 -83
  212. package/typings/drag-drop/drop-list-container.d.ts +19 -3
  213. package/typings/drag-drop/drop-list-ref.d.ts +234 -0
  214. package/typings/drag-drop/index.d.ts +1 -0
  215. package/typings/drag-drop/index.metadata.json +1 -1
  216. package/typings/drag-drop/public-api.d.ts +13 -6
  217. package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +20 -5
  218. package/typings/esm5/a11y/focus-trap/focus-trap.d.ts +2 -0
  219. package/typings/esm5/a11y/index.metadata.json +1 -1
  220. package/typings/esm5/coercion/element.d.ts +13 -0
  221. package/typings/esm5/coercion/index.metadata.json +1 -1
  222. package/typings/esm5/coercion/public-api.d.ts +1 -0
  223. package/typings/esm5/drag-drop/{drag-handle.d.ts → directives/drag-handle.d.ts} +6 -2
  224. package/typings/esm5/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  225. package/typings/esm5/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  226. package/typings/esm5/drag-drop/directives/drag.d.ts +110 -0
  227. package/{drag-drop/typings → typings/esm5/drag-drop/directives}/drop-list-group.d.ts +3 -0
  228. package/typings/{drag-drop → esm5/drag-drop/directives}/drop-list.d.ts +32 -72
  229. package/typings/esm5/drag-drop/drag-drop-registry.d.ts +8 -3
  230. package/typings/esm5/drag-drop/drag-events.d.ts +14 -7
  231. package/{drag-drop/typings/drag.d.ts → typings/esm5/drag-drop/drag-ref.d.ts} +152 -83
  232. package/typings/esm5/drag-drop/drop-list-container.d.ts +19 -3
  233. package/typings/esm5/drag-drop/drop-list-ref.d.ts +234 -0
  234. package/typings/esm5/drag-drop/index.d.ts +1 -0
  235. package/typings/esm5/drag-drop/index.metadata.json +1 -1
  236. package/typings/esm5/drag-drop/public-api.d.ts +13 -6
  237. package/typings/esm5/index.metadata.json +1 -1
  238. package/typings/esm5/overlay/index.metadata.json +1 -1
  239. package/typings/esm5/overlay/overlay-directives.d.ts +0 -2
  240. package/typings/esm5/overlay/overlay-ref.d.ts +1 -1
  241. package/typings/esm5/portal/portal.d.ts +1 -1
  242. package/typings/esm5/scrolling/index.metadata.json +1 -1
  243. package/typings/esm5/stepper/index.metadata.json +1 -1
  244. package/typings/esm5/stepper/stepper.d.ts +13 -1
  245. package/typings/esm5/text-field/autosize.d.ts +6 -0
  246. package/typings/esm5/text-field/index.metadata.json +1 -1
  247. package/typings/esm5/tree/control/base-tree-control.d.ts +1 -1
  248. package/typings/esm5/tree/control/nested-tree-control.d.ts +2 -2
  249. package/typings/esm5/tree/control/tree-control.d.ts +1 -1
  250. package/typings/esm5/tree/nested-node.d.ts +5 -5
  251. package/typings/index.metadata.json +1 -1
  252. package/typings/overlay/index.metadata.json +1 -1
  253. package/typings/overlay/overlay-directives.d.ts +0 -2
  254. package/typings/overlay/overlay-ref.d.ts +1 -1
  255. package/typings/portal/portal.d.ts +1 -1
  256. package/typings/schematics/ng-update/index.d.ts +2 -0
  257. package/typings/schematics/ng-update/target-version.d.ts +7 -1
  258. package/typings/schematics/utils/ast/ng-module-imports.d.ts +1 -1
  259. package/typings/scrolling/index.metadata.json +1 -1
  260. package/typings/stepper/index.metadata.json +1 -1
  261. package/typings/stepper/stepper.d.ts +13 -1
  262. package/typings/text-field/autosize.d.ts +6 -0
  263. package/typings/text-field/index.metadata.json +1 -1
  264. package/typings/tree/control/base-tree-control.d.ts +1 -1
  265. package/typings/tree/control/nested-tree-control.d.ts +2 -2
  266. package/typings/tree/control/tree-control.d.ts +1 -1
  267. package/typings/tree/nested-node.d.ts +5 -5
@@ -5,11 +5,11 @@
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 { coerceCssPixelValue, coerceArray, coerceBooleanProperty } from '@angular/cdk/coercion';
8
+ import { coerceCssPixelValue, coerceArray, coerceElement, coerceBooleanProperty } from '@angular/cdk/coercion';
9
9
  import { ScrollDispatcher, ViewportRuler, ScrollingModule, VIEWPORT_RULER_PROVIDER } from '@angular/cdk/scrolling';
10
10
  export { ViewportRuler, VIEWPORT_RULER_PROVIDER, CdkScrollable, ScrollDispatcher } from '@angular/cdk/scrolling';
11
11
  import { DOCUMENT, Location } from '@angular/common';
12
- import { Inject, Injectable, NgZone, Optional, NgModule, SkipSelf, ApplicationRef, ComponentFactoryResolver, Injector, ElementRef, Directive, EventEmitter, InjectionToken, Input, Output, TemplateRef, ViewContainerRef, defineInjectable, inject } from '@angular/core';
12
+ import { Inject, Injectable, NgZone, Optional, NgModule, SkipSelf, ApplicationRef, ComponentFactoryResolver, Injector, Directive, ElementRef, EventEmitter, InjectionToken, Input, Output, TemplateRef, ViewContainerRef, defineInjectable, inject } from '@angular/core';
13
13
  import { Observable, Subject, merge, Subscription } from 'rxjs';
14
14
  import { take, takeUntil } from 'rxjs/operators';
15
15
  import { Platform } from '@angular/cdk/platform';
@@ -19,7 +19,7 @@ import { ESCAPE } from '@angular/cdk/keycodes';
19
19
 
20
20
  /**
21
21
  * @fileoverview added by tsickle
22
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
22
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
23
23
  */
24
24
  /**
25
25
  * Strategy that will prevent the user from scrolling while the overlay is visible.
@@ -47,7 +47,7 @@ class BlockScrollStrategy {
47
47
  enable() {
48
48
  if (this._canBeEnabled()) {
49
49
  /** @type {?} */
50
- const root = /** @type {?} */ ((this._document.documentElement));
50
+ const root = (/** @type {?} */ (this._document.documentElement));
51
51
  this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();
52
52
  // Cache the previous inline styles in case the user had set them.
53
53
  this._previousHTMLStyles.left = root.style.left || '';
@@ -67,13 +67,13 @@ class BlockScrollStrategy {
67
67
  disable() {
68
68
  if (this._isEnabled) {
69
69
  /** @type {?} */
70
- const html = /** @type {?} */ ((this._document.documentElement));
70
+ const html = (/** @type {?} */ (this._document.documentElement));
71
71
  /** @type {?} */
72
- const body = /** @type {?} */ ((this._document.body));
72
+ const body = (/** @type {?} */ (this._document.body));
73
73
  /** @type {?} */
74
- const htmlStyle = /** @type {?} */ (html.style);
74
+ const htmlStyle = (/** @type {?} */ (html.style));
75
75
  /** @type {?} */
76
- const bodyStyle = /** @type {?} */ (body.style);
76
+ const bodyStyle = (/** @type {?} */ (body.style));
77
77
  /** @type {?} */
78
78
  const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';
79
79
  /** @type {?} */
@@ -91,11 +91,15 @@ class BlockScrollStrategy {
91
91
  }
92
92
  }
93
93
  /**
94
+ * @private
94
95
  * @return {?}
95
96
  */
96
97
  _canBeEnabled() {
98
+ // Since the scroll strategies can't be singletons, we have to use a global CSS class
99
+ // (`cdk-global-scrollblock`) to make sure that we don't try to disable global
100
+ // scrolling multiple times.
97
101
  /** @type {?} */
98
- const html = /** @type {?} */ ((this._document.documentElement));
102
+ const html = (/** @type {?} */ (this._document.documentElement));
99
103
  if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {
100
104
  return false;
101
105
  }
@@ -109,7 +113,7 @@ class BlockScrollStrategy {
109
113
 
110
114
  /**
111
115
  * @fileoverview added by tsickle
112
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
116
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
113
117
  */
114
118
  /**
115
119
  * Returns an error to be thrown when attempting to attach an already-attached scroll strategy.
@@ -121,7 +125,7 @@ function getMatScrollStrategyAlreadyAttachedError() {
121
125
 
122
126
  /**
123
127
  * @fileoverview added by tsickle
124
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
128
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
125
129
  */
126
130
  /**
127
131
  * Strategy that will close the overlay as soon as the user starts scrolling.
@@ -175,7 +179,7 @@ class CloseScrollStrategy {
175
179
  this._scrollSubscription = stream.subscribe(() => {
176
180
  /** @type {?} */
177
181
  const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;
178
- if (Math.abs(scrollPosition - this._initialScrollPosition) > /** @type {?} */ ((/** @type {?} */ ((this._config)).threshold))) {
182
+ if (Math.abs(scrollPosition - this._initialScrollPosition) > (/** @type {?} */ ((/** @type {?} */ (this._config)).threshold))) {
179
183
  this._detach();
180
184
  }
181
185
  else {
@@ -201,7 +205,7 @@ class CloseScrollStrategy {
201
205
 
202
206
  /**
203
207
  * @fileoverview added by tsickle
204
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
208
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
205
209
  */
206
210
 
207
211
  /**
@@ -227,7 +231,7 @@ class NoopScrollStrategy {
227
231
 
228
232
  /**
229
233
  * @fileoverview added by tsickle
230
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
234
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
231
235
  */
232
236
 
233
237
  // TODO(jelbourn): move this to live with the rest of the scrolling code
@@ -275,7 +279,7 @@ function isElementClippedByScrolling(element, scrollContainers) {
275
279
 
276
280
  /**
277
281
  * @fileoverview added by tsickle
278
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
282
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
279
283
  */
280
284
  /**
281
285
  * Strategy that will update the element position as the user is scrolling.
@@ -320,6 +324,8 @@ class RepositionScrollStrategy {
320
324
  /** @type {?} */
321
325
  const overlayRect = this._overlayRef.overlayElement.getBoundingClientRect();
322
326
  const { width, height } = this._viewportRuler.getViewportSize();
327
+ // TODO(crisbeto): include all ancestor scroll containers here once
328
+ // we have a way of exposing the trigger element to the scroll strategy.
323
329
  /** @type {?} */
324
330
  const parentRects = [{ width, height, bottom: height, right: width, top: 0, left: 0 }];
325
331
  if (isElementScrolledOutsideView(overlayRect, parentRects)) {
@@ -344,7 +350,7 @@ class RepositionScrollStrategy {
344
350
 
345
351
  /**
346
352
  * @fileoverview added by tsickle
347
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
353
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
348
354
  */
349
355
  /**
350
356
  * Options for how an overlay will handle scrolling.
@@ -399,12 +405,12 @@ ScrollStrategyOptions.ctorParameters = () => [
399
405
 
400
406
  /**
401
407
  * @fileoverview added by tsickle
402
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
408
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
403
409
  */
404
410
 
405
411
  /**
406
412
  * @fileoverview added by tsickle
407
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
413
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
408
414
  */
409
415
  /**
410
416
  * Initial configuration used when creating an overlay.
@@ -439,7 +445,7 @@ class OverlayConfig {
439
445
  if (config) {
440
446
  Object.keys(config).forEach(k => {
441
447
  /** @type {?} */
442
- const key = /** @type {?} */ (k);
448
+ const key = (/** @type {?} */ (k));
443
449
  if (typeof config[key] !== 'undefined') {
444
450
  this[key] = config[key];
445
451
  }
@@ -450,7 +456,7 @@ class OverlayConfig {
450
456
 
451
457
  /**
452
458
  * @fileoverview added by tsickle
453
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
459
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
454
460
  */
455
461
  /**
456
462
  * The points of the origin element and the overlay element to connect.
@@ -508,8 +514,7 @@ class ConnectedOverlayPositionChange {
508
514
  * @param {?} connectionPair
509
515
  * @param {?} scrollableViewProperties
510
516
  */
511
- constructor(connectionPair, /** @docs-private */
512
- scrollableViewProperties) {
517
+ constructor(connectionPair, scrollableViewProperties) {
513
518
  this.connectionPair = connectionPair;
514
519
  this.scrollableViewProperties = scrollableViewProperties;
515
520
  }
@@ -548,7 +553,7 @@ function validateHorizontalPosition(property, value) {
548
553
 
549
554
  /**
550
555
  * @fileoverview added by tsickle
551
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
556
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
552
557
  */
553
558
  /**
554
559
  * Service for dispatching keyboard events that land on the body to appropriate overlay ref,
@@ -624,6 +629,7 @@ class OverlayKeyboardDispatcher {
624
629
  }
625
630
  /**
626
631
  * Detaches the global keyboard event listener.
632
+ * @private
627
633
  * @return {?}
628
634
  */
629
635
  _detach() {
@@ -650,16 +656,17 @@ OverlayKeyboardDispatcher.ctorParameters = () => [
650
656
  function OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY(dispatcher, _document) {
651
657
  return dispatcher || new OverlayKeyboardDispatcher(_document);
652
658
  }
653
- /** *
659
+ /**
654
660
  * \@docs-private \@deprecated \@breaking-change 8.0.0
655
- @type {?} */
661
+ * @type {?}
662
+ */
656
663
  const OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {
657
664
  // If there is already an OverlayKeyboardDispatcher available, use that.
658
665
  // Otherwise, provide a new one.
659
666
  provide: OverlayKeyboardDispatcher,
660
667
  deps: [
661
668
  [new Optional(), new SkipSelf(), OverlayKeyboardDispatcher],
662
- /** @type {?} */ ((
669
+ (/** @type {?} */ (
663
670
  // Coerce to `InjectionToken` so that the `deps` match the "shape"
664
671
  // of the type expected by Angular
665
672
  DOCUMENT))
@@ -669,7 +676,7 @@ const OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {
669
676
 
670
677
  /**
671
678
  * @fileoverview added by tsickle
672
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
679
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
673
680
  */
674
681
  /**
675
682
  * Container inside which all overlays will render.
@@ -704,6 +711,7 @@ class OverlayContainer {
704
711
  /**
705
712
  * Create the overlay container element, which is simply a div
706
713
  * with the 'cdk-overlay-container' class on the document body.
714
+ * @protected
707
715
  * @return {?}
708
716
  */
709
717
  _createContainer() {
@@ -731,23 +739,23 @@ OverlayContainer.ctorParameters = () => [
731
739
  function OVERLAY_CONTAINER_PROVIDER_FACTORY(parentContainer, _document) {
732
740
  return parentContainer || new OverlayContainer(_document);
733
741
  }
734
- /** *
742
+ /**
735
743
  * \@docs-private \@deprecated \@breaking-change 8.0.0
736
- @type {?} */
744
+ * @type {?}
745
+ */
737
746
  const OVERLAY_CONTAINER_PROVIDER = {
738
747
  // If there is already an OverlayContainer available, use that. Otherwise, provide a new one.
739
748
  provide: OverlayContainer,
740
749
  deps: [
741
750
  [new Optional(), new SkipSelf(), OverlayContainer],
742
- /** @type {?} */ (DOCUMENT // We need to use the InjectionToken somewhere to keep TS happy
743
- ) // We need to use the InjectionToken somewhere to keep TS happy
751
+ (/** @type {?} */ (DOCUMENT))
744
752
  ],
745
753
  useFactory: OVERLAY_CONTAINER_PROVIDER_FACTORY
746
754
  };
747
755
 
748
756
  /**
749
757
  * @fileoverview added by tsickle
750
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
758
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
751
759
  */
752
760
  /**
753
761
  * Reference to an overlay that has been created with the Overlay service.
@@ -778,7 +786,7 @@ class OverlayRef {
778
786
  this._attachments = new Subject();
779
787
  this._detachments = new Subject();
780
788
  this._locationChanges = Subscription.EMPTY;
781
- this._keydownEventsObservable = Observable.create((observer) => {
789
+ this._keydownEventsObservable = new Observable((observer) => {
782
790
  /** @type {?} */
783
791
  const subscription = this._keydownEvents.subscribe(observer);
784
792
  this._keydownEventSubscriptions++;
@@ -931,9 +939,9 @@ class OverlayRef {
931
939
  this._keydownEvents.complete();
932
940
  if (this._host && this._host.parentNode) {
933
941
  this._host.parentNode.removeChild(this._host);
934
- this._host = /** @type {?} */ ((null));
942
+ this._host = (/** @type {?} */ (null));
935
943
  }
936
- this._previousHostParent = this._pane = /** @type {?} */ ((null));
944
+ this._previousHostParent = this._pane = (/** @type {?} */ (null));
937
945
  if (isAttached) {
938
946
  this._detachments.next();
939
947
  }
@@ -975,7 +983,7 @@ class OverlayRef {
975
983
  return this._keydownEventsObservable;
976
984
  }
977
985
  /**
978
- * Gets the the current overlay configuration, which is immutable.
986
+ * Gets the current overlay configuration, which is immutable.
979
987
  * @return {?}
980
988
  */
981
989
  getConfig() {
@@ -1040,6 +1048,7 @@ class OverlayRef {
1040
1048
  }
1041
1049
  /**
1042
1050
  * Updates the text direction of the overlay panel.
1051
+ * @private
1043
1052
  * @return {?}
1044
1053
  */
1045
1054
  _updateElementDirection() {
@@ -1047,6 +1056,7 @@ class OverlayRef {
1047
1056
  }
1048
1057
  /**
1049
1058
  * Updates the size of the overlay element based on the overlay config.
1059
+ * @private
1050
1060
  * @return {?}
1051
1061
  */
1052
1062
  _updateElementSize() {
@@ -1061,6 +1071,7 @@ class OverlayRef {
1061
1071
  }
1062
1072
  /**
1063
1073
  * Toggles the pointer events for the overlay pane element.
1074
+ * @private
1064
1075
  * @param {?} enablePointer
1065
1076
  * @return {?}
1066
1077
  */
@@ -1069,6 +1080,7 @@ class OverlayRef {
1069
1080
  }
1070
1081
  /**
1071
1082
  * Attaches a backdrop for this overlay.
1083
+ * @private
1072
1084
  * @return {?}
1073
1085
  */
1074
1086
  _attachBackdrop() {
@@ -1078,11 +1090,10 @@ class OverlayRef {
1078
1090
  this._backdropElement.classList.add('cdk-overlay-backdrop');
1079
1091
  if (this._config.backdropClass) {
1080
1092
  this._toggleClasses(this._backdropElement, this._config.backdropClass, true);
1081
- } /** @type {?} */
1082
- ((
1093
+ }
1083
1094
  // Insert the backdrop before the pane in the DOM order,
1084
1095
  // in order to handle stacked overlays properly.
1085
- this._host.parentElement)).insertBefore(this._backdropElement, this._host);
1096
+ (/** @type {?} */ (this._host.parentElement)).insertBefore(this._backdropElement, this._host);
1086
1097
  // Forward backdrop clicks such that the consumer of the overlay can perform whatever
1087
1098
  // action desired when such a click occurs (usually closing the overlay).
1088
1099
  this._backdropElement.addEventListener('click', (event) => this._backdropClick.next(event));
@@ -1106,11 +1117,12 @@ class OverlayRef {
1106
1117
  * that should be behind it, was destroyed. The next time both of them are opened,
1107
1118
  * the stacking will be wrong, because the detached element's pane will still be
1108
1119
  * in its original DOM position.
1120
+ * @private
1109
1121
  * @return {?}
1110
1122
  */
1111
1123
  _updateStackingOrder() {
1112
1124
  if (this._host.nextSibling) {
1113
- /** @type {?} */ ((this._host.parentNode)).appendChild(this._host);
1125
+ (/** @type {?} */ (this._host.parentNode)).appendChild(this._host);
1114
1126
  }
1115
1127
  }
1116
1128
  /**
@@ -1138,13 +1150,13 @@ class OverlayRef {
1138
1150
  this._backdropElement = null;
1139
1151
  }
1140
1152
  if (this._config.backdropClass) {
1141
- this._toggleClasses(/** @type {?} */ ((backdropToDetach)), this._config.backdropClass, false);
1153
+ this._toggleClasses((/** @type {?} */ (backdropToDetach)), this._config.backdropClass, false);
1142
1154
  }
1143
1155
  clearTimeout(timeoutId);
1144
1156
  };
1145
1157
  backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');
1146
1158
  this._ngZone.runOutsideAngular(() => {
1147
- /** @type {?} */ ((backdropToDetach)).addEventListener('transitionend', finishDetach);
1159
+ (/** @type {?} */ (backdropToDetach)).addEventListener('transitionend', finishDetach);
1148
1160
  });
1149
1161
  // If the backdrop doesn't have a transition, the `transitionend` event won't fire.
1150
1162
  // In this case we make it unclickable and we try to remove it after a delay.
@@ -1156,6 +1168,7 @@ class OverlayRef {
1156
1168
  }
1157
1169
  /**
1158
1170
  * Toggles a single CSS class or an array of classes on an element.
1171
+ * @private
1159
1172
  * @param {?} element
1160
1173
  * @param {?} cssClasses
1161
1174
  * @param {?} isAdd
@@ -1171,6 +1184,7 @@ class OverlayRef {
1171
1184
  }
1172
1185
  /**
1173
1186
  * Detaches the overlay content next time the zone stabilizes.
1187
+ * @private
1174
1188
  * @return {?}
1175
1189
  */
1176
1190
  _detachContentWhenStable() {
@@ -1178,6 +1192,9 @@ class OverlayRef {
1178
1192
  // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will
1179
1193
  // be patched to run inside the zone, which will throw us into an infinite loop.
1180
1194
  this._ngZone.runOutsideAngular(() => {
1195
+ // We can't remove the host here immediately, because the overlay pane's content
1196
+ // might still be animating. This stream helps us avoid interrupting the animation
1197
+ // by waiting for the pane to become empty.
1181
1198
  /** @type {?} */
1182
1199
  const subscription = this._ngZone.onStable
1183
1200
  .asObservable()
@@ -1202,11 +1219,14 @@ class OverlayRef {
1202
1219
 
1203
1220
  /**
1204
1221
  * @fileoverview added by tsickle
1205
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1222
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1206
1223
  */
1207
- /** *
1224
+ // TODO: refactor clipping detection into a separate thing (part of scrolling module)
1225
+ // TODO: doesn't handle both flexible width and height when it has to scroll along both axis.
1226
+ /**
1208
1227
  * Class to be added to the overlay bounding box.
1209
- @type {?} */
1228
+ * @type {?}
1229
+ */
1210
1230
  const boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';
1211
1231
  /**
1212
1232
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -1291,7 +1311,7 @@ class FlexibleConnectedPositionStrategy {
1291
1311
  /**
1292
1312
  * Observable sequence of position changes.
1293
1313
  */
1294
- this.positionChanges = Observable.create((observer) => {
1314
+ this.positionChanges = new Observable((observer) => {
1295
1315
  /** @type {?} */
1296
1316
  const subscription = this._positionChanges.subscribe(observer);
1297
1317
  this._positionChangeSubscriptions++;
@@ -1378,17 +1398,24 @@ class FlexibleConnectedPositionStrategy {
1378
1398
  const overlayRect = this._overlayRect;
1379
1399
  /** @type {?} */
1380
1400
  const viewportRect = this._viewportRect;
1401
+ // Positions where the overlay will fit with flexible dimensions.
1381
1402
  /** @type {?} */
1382
1403
  const flexibleFits = [];
1404
+ // Fallback if none of the preferred positions fit within the viewport.
1383
1405
  /** @type {?} */
1384
1406
  let fallback;
1385
1407
  // Go through each of the preferred positions looking for a good fit.
1386
1408
  // If a good fit is found, it will be applied immediately.
1387
1409
  for (let pos of this._preferredPositions) {
1410
+ // Get the exact (x, y) coordinate for the point-of-origin on the origin element.
1388
1411
  /** @type {?} */
1389
1412
  let originPoint = this._getOriginPoint(originRect, pos);
1413
+ // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the
1414
+ // overlay in this position. We use the top-left corner for calculations and later translate
1415
+ // this into an appropriate (top, left, bottom, right) style.
1390
1416
  /** @type {?} */
1391
1417
  let overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);
1418
+ // Calculate how well the overlay would fit into the viewport with this point.
1392
1419
  /** @type {?} */
1393
1420
  let overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);
1394
1421
  // If the overlay, without any further work, fits into the viewport, use this position.
@@ -1433,7 +1460,7 @@ class FlexibleConnectedPositionStrategy {
1433
1460
  }
1434
1461
  }
1435
1462
  this._isPushed = false;
1436
- this._applyPosition(/** @type {?} */ ((bestFit)).position, /** @type {?} */ ((bestFit)).origin);
1463
+ this._applyPosition((/** @type {?} */ (bestFit)).position, (/** @type {?} */ (bestFit)).origin);
1437
1464
  return;
1438
1465
  }
1439
1466
  // When none of the preferred positions fit within the viewport, take the position
@@ -1441,12 +1468,12 @@ class FlexibleConnectedPositionStrategy {
1441
1468
  if (this._canPush) {
1442
1469
  // TODO(jelbourn): after pushing, the opening "direction" of the overlay might not make sense.
1443
1470
  this._isPushed = true;
1444
- this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
1471
+ this._applyPosition((/** @type {?} */ (fallback)).position, (/** @type {?} */ (fallback)).originPoint);
1445
1472
  return;
1446
1473
  }
1447
1474
  // All options for getting the overlay within the viewport have been exhausted, so go with the
1448
1475
  // position that went off-screen the least.
1449
- this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
1476
+ this._applyPosition((/** @type {?} */ (fallback)).position, (/** @type {?} */ (fallback)).originPoint);
1450
1477
  }
1451
1478
  /**
1452
1479
  * @return {?}
@@ -1468,7 +1495,7 @@ class FlexibleConnectedPositionStrategy {
1468
1495
  // We can't use `_resetBoundingBoxStyles` here, because it resets
1469
1496
  // some properties to zero, rather than removing them.
1470
1497
  if (this._boundingBox) {
1471
- extendStyles(this._boundingBox.style, /** @type {?} */ ({
1498
+ extendStyles(this._boundingBox.style, (/** @type {?} */ ({
1472
1499
  top: '',
1473
1500
  left: '',
1474
1501
  right: '',
@@ -1477,7 +1504,7 @@ class FlexibleConnectedPositionStrategy {
1477
1504
  width: '',
1478
1505
  alignItems: '',
1479
1506
  justifyContent: '',
1480
- }));
1507
+ })));
1481
1508
  }
1482
1509
  if (this._pane) {
1483
1510
  this._resetOverlayElementStyles();
@@ -1487,7 +1514,7 @@ class FlexibleConnectedPositionStrategy {
1487
1514
  }
1488
1515
  this.detach();
1489
1516
  this._positionChanges.complete();
1490
- this._overlayRef = this._boundingBox = /** @type {?} */ ((null));
1517
+ this._overlayRef = this._boundingBox = (/** @type {?} */ (null));
1491
1518
  this._isDisposed = true;
1492
1519
  }
1493
1520
  /**
@@ -1520,108 +1547,129 @@ class FlexibleConnectedPositionStrategy {
1520
1547
  }
1521
1548
  /**
1522
1549
  * Adds new preferred positions.
1550
+ * @template THIS
1551
+ * @this {THIS}
1523
1552
  * @param {?} positions List of positions options for this overlay.
1524
- * @return {?}
1553
+ * @return {THIS}
1525
1554
  */
1526
1555
  withPositions(positions) {
1527
- this._preferredPositions = positions;
1556
+ (/** @type {?} */ (this))._preferredPositions = positions;
1528
1557
  // If the last calculated position object isn't part of the positions anymore, clear
1529
1558
  // it in order to avoid it being picked up if the consumer tries to re-apply.
1530
- if (positions.indexOf(/** @type {?} */ ((this._lastPosition))) === -1) {
1531
- this._lastPosition = null;
1559
+ if (positions.indexOf((/** @type {?} */ ((/** @type {?} */ (this))._lastPosition))) === -1) {
1560
+ (/** @type {?} */ (this))._lastPosition = null;
1532
1561
  }
1533
- this._validatePositions();
1534
- return this;
1562
+ (/** @type {?} */ (this))._validatePositions();
1563
+ return (/** @type {?} */ (this));
1535
1564
  }
1536
1565
  /**
1537
1566
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
1567
+ * @template THIS
1568
+ * @this {THIS}
1538
1569
  * @param {?} margin Required margin between the overlay and the viewport edge in pixels.
1539
- * @return {?}
1570
+ * @return {THIS}
1540
1571
  */
1541
1572
  withViewportMargin(margin) {
1542
- this._viewportMargin = margin;
1543
- return this;
1573
+ (/** @type {?} */ (this))._viewportMargin = margin;
1574
+ return (/** @type {?} */ (this));
1544
1575
  }
1545
1576
  /**
1546
1577
  * Sets whether the overlay's width and height can be constrained to fit within the viewport.
1578
+ * @template THIS
1579
+ * @this {THIS}
1547
1580
  * @param {?=} flexibleDimensions
1548
- * @return {?}
1581
+ * @return {THIS}
1549
1582
  */
1550
1583
  withFlexibleDimensions(flexibleDimensions = true) {
1551
- this._hasFlexibleDimensions = flexibleDimensions;
1552
- return this;
1584
+ (/** @type {?} */ (this))._hasFlexibleDimensions = flexibleDimensions;
1585
+ return (/** @type {?} */ (this));
1553
1586
  }
1554
1587
  /**
1555
1588
  * Sets whether the overlay can grow after the initial open via flexible width/height.
1589
+ * @template THIS
1590
+ * @this {THIS}
1556
1591
  * @param {?=} growAfterOpen
1557
- * @return {?}
1592
+ * @return {THIS}
1558
1593
  */
1559
1594
  withGrowAfterOpen(growAfterOpen = true) {
1560
- this._growAfterOpen = growAfterOpen;
1561
- return this;
1595
+ (/** @type {?} */ (this))._growAfterOpen = growAfterOpen;
1596
+ return (/** @type {?} */ (this));
1562
1597
  }
1563
1598
  /**
1564
1599
  * Sets whether the overlay can be pushed on-screen if none of the provided positions fit.
1600
+ * @template THIS
1601
+ * @this {THIS}
1565
1602
  * @param {?=} canPush
1566
- * @return {?}
1603
+ * @return {THIS}
1567
1604
  */
1568
1605
  withPush(canPush = true) {
1569
- this._canPush = canPush;
1570
- return this;
1606
+ (/** @type {?} */ (this))._canPush = canPush;
1607
+ return (/** @type {?} */ (this));
1571
1608
  }
1572
1609
  /**
1573
1610
  * Sets whether the overlay's position should be locked in after it is positioned
1574
1611
  * initially. When an overlay is locked in, it won't attempt to reposition itself
1575
1612
  * when the position is re-applied (e.g. when the user scrolls away).
1613
+ * @template THIS
1614
+ * @this {THIS}
1576
1615
  * @param {?=} isLocked Whether the overlay should locked in.
1577
- * @return {?}
1616
+ * @return {THIS}
1578
1617
  */
1579
1618
  withLockedPosition(isLocked = true) {
1580
- this._positionLocked = isLocked;
1581
- return this;
1619
+ (/** @type {?} */ (this))._positionLocked = isLocked;
1620
+ return (/** @type {?} */ (this));
1582
1621
  }
1583
1622
  /**
1584
1623
  * Sets the origin element, relative to which to position the overlay.
1624
+ * @template THIS
1625
+ * @this {THIS}
1585
1626
  * @param {?} origin Reference to the new origin element.
1586
- * @return {?}
1627
+ * @return {THIS}
1587
1628
  */
1588
1629
  setOrigin(origin) {
1589
- this._origin = origin instanceof ElementRef ? origin.nativeElement : origin;
1590
- return this;
1630
+ (/** @type {?} */ (this))._origin = coerceElement(origin);
1631
+ return (/** @type {?} */ (this));
1591
1632
  }
1592
1633
  /**
1593
1634
  * Sets the default offset for the overlay's connection point on the x-axis.
1635
+ * @template THIS
1636
+ * @this {THIS}
1594
1637
  * @param {?} offset New offset in the X axis.
1595
- * @return {?}
1638
+ * @return {THIS}
1596
1639
  */
1597
1640
  withDefaultOffsetX(offset) {
1598
- this._offsetX = offset;
1599
- return this;
1641
+ (/** @type {?} */ (this))._offsetX = offset;
1642
+ return (/** @type {?} */ (this));
1600
1643
  }
1601
1644
  /**
1602
1645
  * Sets the default offset for the overlay's connection point on the y-axis.
1646
+ * @template THIS
1647
+ * @this {THIS}
1603
1648
  * @param {?} offset New offset in the Y axis.
1604
- * @return {?}
1649
+ * @return {THIS}
1605
1650
  */
1606
1651
  withDefaultOffsetY(offset) {
1607
- this._offsetY = offset;
1608
- return this;
1652
+ (/** @type {?} */ (this))._offsetY = offset;
1653
+ return (/** @type {?} */ (this));
1609
1654
  }
1610
1655
  /**
1611
1656
  * Configures that the position strategy should set a `transform-origin` on some elements
1612
1657
  * inside the overlay, depending on the current position that is being applied. This is
1613
1658
  * useful for the cases where the origin of an animation can change depending on the
1614
1659
  * alignment of the overlay.
1660
+ * @template THIS
1661
+ * @this {THIS}
1615
1662
  * @param {?} selector CSS selector that will be used to find the target
1616
1663
  * elements onto which to set the transform origin.
1617
- * @return {?}
1664
+ * @return {THIS}
1618
1665
  */
1619
1666
  withTransformOriginOn(selector) {
1620
- this._transformOriginSelector = selector;
1621
- return this;
1667
+ (/** @type {?} */ (this))._transformOriginSelector = selector;
1668
+ return (/** @type {?} */ (this));
1622
1669
  }
1623
1670
  /**
1624
1671
  * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
1672
+ * @private
1625
1673
  * @param {?} originRect
1626
1674
  * @param {?} pos
1627
1675
  * @return {?}
@@ -1654,12 +1702,15 @@ class FlexibleConnectedPositionStrategy {
1654
1702
  /**
1655
1703
  * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
1656
1704
  * origin point to which the overlay should be connected.
1705
+ * @private
1657
1706
  * @param {?} originPoint
1658
1707
  * @param {?} overlayRect
1659
1708
  * @param {?} pos
1660
1709
  * @return {?}
1661
1710
  */
1662
1711
  _getOverlayPoint(originPoint, overlayRect, pos) {
1712
+ // Calculate the (overlayStartX, overlayStartY), the start of the
1713
+ // potential overlay position relative to the origin point.
1663
1714
  /** @type {?} */
1664
1715
  let overlayStartX;
1665
1716
  if (pos.overlayX == 'center') {
@@ -1687,6 +1738,7 @@ class FlexibleConnectedPositionStrategy {
1687
1738
  }
1688
1739
  /**
1689
1740
  * Gets how well an overlay at the given point will fit within the viewport.
1741
+ * @private
1690
1742
  * @param {?} point
1691
1743
  * @param {?} overlay
1692
1744
  * @param {?} viewport
@@ -1706,6 +1758,7 @@ class FlexibleConnectedPositionStrategy {
1706
1758
  if (offsetY) {
1707
1759
  y += offsetY;
1708
1760
  }
1761
+ // How much the overlay would overflow at this position, on each side.
1709
1762
  /** @type {?} */
1710
1763
  let leftOverflow = 0 - x;
1711
1764
  /** @type {?} */
@@ -1714,6 +1767,7 @@ class FlexibleConnectedPositionStrategy {
1714
1767
  let topOverflow = 0 - y;
1715
1768
  /** @type {?} */
1716
1769
  let bottomOverflow = (y + overlay.height) - viewport.height;
1770
+ // Visible parts of the element on each axis.
1717
1771
  /** @type {?} */
1718
1772
  let visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);
1719
1773
  /** @type {?} */
@@ -1729,6 +1783,7 @@ class FlexibleConnectedPositionStrategy {
1729
1783
  }
1730
1784
  /**
1731
1785
  * Whether the overlay can fit within the viewport when it may resize either its width or height.
1786
+ * @private
1732
1787
  * @param {?} fit How well the overlay fits in the viewport at some position.
1733
1788
  * @param {?} point The (x, y) coordinates of the overlat at some position.
1734
1789
  * @param {?} viewport The geometry of the viewport.
@@ -1758,6 +1813,7 @@ class FlexibleConnectedPositionStrategy {
1758
1813
  * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
1759
1814
  * right and bottom).
1760
1815
  *
1816
+ * @private
1761
1817
  * @param {?} start Starting point from which the overlay is pushed.
1762
1818
  * @param {?} overlay Dimensions of the overlay.
1763
1819
  * @param {?} scrollPosition Current viewport scroll position.
@@ -1776,6 +1832,8 @@ class FlexibleConnectedPositionStrategy {
1776
1832
  }
1777
1833
  /** @type {?} */
1778
1834
  const viewport = this._viewportRect;
1835
+ // Determine how much the overlay goes outside the viewport on each
1836
+ // side, which we'll use to decide which direction to push it.
1779
1837
  /** @type {?} */
1780
1838
  const overflowRight = Math.max(start.x + overlay.width - viewport.right, 0);
1781
1839
  /** @type {?} */
@@ -1784,6 +1842,7 @@ class FlexibleConnectedPositionStrategy {
1784
1842
  const overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);
1785
1843
  /** @type {?} */
1786
1844
  const overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);
1845
+ // Amount by which to push the overlay in each axis such that it remains on-screen.
1787
1846
  /** @type {?} */
1788
1847
  let pushX = 0;
1789
1848
  /** @type {?} */
@@ -1811,6 +1870,7 @@ class FlexibleConnectedPositionStrategy {
1811
1870
  }
1812
1871
  /**
1813
1872
  * Applies a computed position to the overlay and emits a position change.
1873
+ * @private
1814
1874
  * @param {?} position The position preference
1815
1875
  * @param {?} originPoint The point on the origin element where the overlay is connected.
1816
1876
  * @return {?}
@@ -1838,6 +1898,7 @@ class FlexibleConnectedPositionStrategy {
1838
1898
  }
1839
1899
  /**
1840
1900
  * Sets the transform origin based on the configured selector and the passed-in position.
1901
+ * @private
1841
1902
  * @param {?} position
1842
1903
  * @return {?}
1843
1904
  */
@@ -1846,7 +1907,7 @@ class FlexibleConnectedPositionStrategy {
1846
1907
  return;
1847
1908
  }
1848
1909
  /** @type {?} */
1849
- const elements = /** @type {?} */ ((this._boundingBox)).querySelectorAll(this._transformOriginSelector);
1910
+ const elements = (/** @type {?} */ (this._boundingBox)).querySelectorAll(this._transformOriginSelector);
1850
1911
  /** @type {?} */
1851
1912
  let xOrigin;
1852
1913
  /** @type {?} */
@@ -1869,6 +1930,7 @@ class FlexibleConnectedPositionStrategy {
1869
1930
  *
1870
1931
  * This method does no measuring and applies no styles so that we can cheaply compute the
1871
1932
  * bounds for all positions and choose the best fit based on these results.
1933
+ * @private
1872
1934
  * @param {?} origin
1873
1935
  * @param {?} position
1874
1936
  * @return {?}
@@ -1887,7 +1949,7 @@ class FlexibleConnectedPositionStrategy {
1887
1949
  if (position.overlayY === 'top') {
1888
1950
  // Overlay is opening "downward" and thus is bound by the bottom viewport edge.
1889
1951
  top = origin.y;
1890
- height = viewport.bottom - origin.y;
1952
+ height = viewport.height - top + this._viewportMargin;
1891
1953
  }
1892
1954
  else if (position.overlayY === 'bottom') {
1893
1955
  // Overlay is opening "upward" and thus is bound by the top viewport edge. We need to add
@@ -1897,6 +1959,10 @@ class FlexibleConnectedPositionStrategy {
1897
1959
  height = viewport.height - bottom + this._viewportMargin;
1898
1960
  }
1899
1961
  else {
1962
+ // If neither top nor bottom, it means that the overlay is vertically centered on the
1963
+ // origin point. Note that we want the position relative to the viewport, rather than
1964
+ // the page, which is why we don't use something like `viewport.bottom - origin.y` and
1965
+ // `origin.y - viewport.top`.
1900
1966
  /** @type {?} */
1901
1967
  const smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y + viewport.top, origin.y);
1902
1968
  /** @type {?} */
@@ -1907,9 +1973,11 @@ class FlexibleConnectedPositionStrategy {
1907
1973
  top = origin.y - (previousHeight / 2);
1908
1974
  }
1909
1975
  }
1976
+ // The overlay is opening 'right-ward' (the content flows to the right).
1910
1977
  /** @type {?} */
1911
1978
  const isBoundedByRightViewportEdge = (position.overlayX === 'start' && !isRtl) ||
1912
1979
  (position.overlayX === 'end' && isRtl);
1980
+ // The overlay is opening 'left-ward' (the content flows to the left).
1913
1981
  /** @type {?} */
1914
1982
  const isBoundedByLeftViewportEdge = (position.overlayX === 'end' && !isRtl) ||
1915
1983
  (position.overlayX === 'start' && isRtl);
@@ -1928,6 +1996,10 @@ class FlexibleConnectedPositionStrategy {
1928
1996
  width = viewport.right - origin.x;
1929
1997
  }
1930
1998
  else {
1999
+ // If neither start nor end, it means that the overlay is horizontally centered on the
2000
+ // origin point. Note that we want the position relative to the viewport, rather than
2001
+ // the page, which is why we don't use something like `viewport.right - origin.x` and
2002
+ // `origin.x - viewport.left`.
1931
2003
  /** @type {?} */
1932
2004
  const smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x + viewport.left, origin.x);
1933
2005
  /** @type {?} */
@@ -1938,12 +2010,13 @@ class FlexibleConnectedPositionStrategy {
1938
2010
  left = origin.x - (previousWidth / 2);
1939
2011
  }
1940
2012
  }
1941
- return { top: /** @type {?} */ ((top)), left: /** @type {?} */ ((left)), bottom: /** @type {?} */ ((bottom)), right: /** @type {?} */ ((right)), width, height };
2013
+ return { top: (/** @type {?} */ (top)), left: (/** @type {?} */ (left)), bottom: (/** @type {?} */ (bottom)), right: (/** @type {?} */ (right)), width, height };
1942
2014
  }
1943
2015
  /**
1944
2016
  * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
1945
2017
  * origin's connection point and stetches to the bounds of the viewport.
1946
2018
  *
2019
+ * @private
1947
2020
  * @param {?} origin The point on the origin element where the overlay is connected.
1948
2021
  * @param {?} position The position preference
1949
2022
  * @return {?}
@@ -1958,7 +2031,7 @@ class FlexibleConnectedPositionStrategy {
1958
2031
  boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);
1959
2032
  }
1960
2033
  /** @type {?} */
1961
- const styles = /** @type {?} */ ({});
2034
+ const styles = (/** @type {?} */ ({}));
1962
2035
  if (this._hasExactPosition()) {
1963
2036
  styles.top = styles.left = '0';
1964
2037
  styles.bottom = styles.right = '';
@@ -1996,14 +2069,15 @@ class FlexibleConnectedPositionStrategy {
1996
2069
  }
1997
2070
  }
1998
2071
  this._lastBoundingBoxSize = boundingBoxRect;
1999
- extendStyles(/** @type {?} */ ((this._boundingBox)).style, styles);
2072
+ extendStyles((/** @type {?} */ (this._boundingBox)).style, styles);
2000
2073
  }
2001
2074
  /**
2002
2075
  * Resets the styles for the bounding box so that a new positioning can be computed.
2076
+ * @private
2003
2077
  * @return {?}
2004
2078
  */
2005
2079
  _resetBoundingBoxStyles() {
2006
- extendStyles(/** @type {?} */ ((this._boundingBox)).style, /** @type {?} */ ({
2080
+ extendStyles((/** @type {?} */ (this._boundingBox)).style, (/** @type {?} */ ({
2007
2081
  top: '0',
2008
2082
  left: '0',
2009
2083
  right: '0',
@@ -2012,30 +2086,33 @@ class FlexibleConnectedPositionStrategy {
2012
2086
  width: '',
2013
2087
  alignItems: '',
2014
2088
  justifyContent: '',
2015
- }));
2089
+ })));
2016
2090
  }
2017
2091
  /**
2018
2092
  * Resets the styles for the overlay pane so that a new positioning can be computed.
2093
+ * @private
2019
2094
  * @return {?}
2020
2095
  */
2021
2096
  _resetOverlayElementStyles() {
2022
- extendStyles(this._pane.style, /** @type {?} */ ({
2097
+ extendStyles(this._pane.style, (/** @type {?} */ ({
2023
2098
  top: '',
2024
2099
  left: '',
2025
2100
  bottom: '',
2026
2101
  right: '',
2027
2102
  position: '',
2028
- }));
2103
+ transform: '',
2104
+ })));
2029
2105
  }
2030
2106
  /**
2031
2107
  * Sets positioning styles to the overlay element.
2108
+ * @private
2032
2109
  * @param {?} originPoint
2033
2110
  * @param {?} position
2034
2111
  * @return {?}
2035
2112
  */
2036
2113
  _setOverlayElementStyles(originPoint, position) {
2037
2114
  /** @type {?} */
2038
- const styles = /** @type {?} */ ({});
2115
+ const styles = (/** @type {?} */ ({}));
2039
2116
  if (this._hasExactPosition()) {
2040
2117
  /** @type {?} */
2041
2118
  const scrollPosition = this._viewportRuler.getViewportScrollPosition();
@@ -2045,6 +2122,11 @@ class FlexibleConnectedPositionStrategy {
2045
2122
  else {
2046
2123
  styles.position = 'static';
2047
2124
  }
2125
+ // Use a transform to apply the offsets. We do this because the `center` positions rely on
2126
+ // being in the normal flex flow and setting a `top` / `left` at all will completely throw
2127
+ // off the position. We also can't use margins, because they won't have an effect in some
2128
+ // cases where the element doesn't have anything to "push off of". Finally, this works
2129
+ // better both with flexible and non-flexible positioning.
2048
2130
  /** @type {?} */
2049
2131
  let transformString = '';
2050
2132
  /** @type {?} */
@@ -2071,19 +2153,25 @@ class FlexibleConnectedPositionStrategy {
2071
2153
  }
2072
2154
  /**
2073
2155
  * Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing.
2156
+ * @private
2074
2157
  * @param {?} position
2075
2158
  * @param {?} originPoint
2076
2159
  * @param {?} scrollPosition
2077
2160
  * @return {?}
2078
2161
  */
2079
2162
  _getExactOverlayY(position, originPoint, scrollPosition) {
2163
+ // Reset any existing styles. This is necessary in case the
2164
+ // preferred position has changed since the last `apply`.
2080
2165
  /** @type {?} */
2081
- let styles = /** @type {?} */ ({ top: null, bottom: null });
2166
+ let styles = (/** @type {?} */ ({ top: null, bottom: null }));
2082
2167
  /** @type {?} */
2083
2168
  let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2084
2169
  if (this._isPushed) {
2085
2170
  overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2086
2171
  }
2172
+ // @breaking-change 8.0.0 Currently the `_overlayContainer` is optional in order to avoid a
2173
+ // breaking change. The null check here can be removed once the `_overlayContainer` becomes
2174
+ // a required parameter.
2087
2175
  /** @type {?} */
2088
2176
  let virtualKeyboardOffset = this._overlayContainer ?
2089
2177
  this._overlayContainer.getContainerElement().getBoundingClientRect().top : 0;
@@ -2095,8 +2183,10 @@ class FlexibleConnectedPositionStrategy {
2095
2183
  // We want to set either `top` or `bottom` based on whether the overlay wants to appear
2096
2184
  // above or below the origin and the direction in which the element will expand.
2097
2185
  if (position.overlayY === 'bottom') {
2186
+ // When using `bottom`, we adjust the y position such that it is the distance
2187
+ // from the bottom of the viewport rather than the top.
2098
2188
  /** @type {?} */
2099
- const documentHeight = /** @type {?} */ ((this._document.documentElement)).clientHeight;
2189
+ const documentHeight = (/** @type {?} */ (this._document.documentElement)).clientHeight;
2100
2190
  styles.bottom = `${documentHeight - (overlayPoint.y + this._overlayRect.height)}px`;
2101
2191
  }
2102
2192
  else {
@@ -2106,19 +2196,26 @@ class FlexibleConnectedPositionStrategy {
2106
2196
  }
2107
2197
  /**
2108
2198
  * Gets the exact left/right for the overlay when not using flexible sizing or when pushing.
2199
+ * @private
2109
2200
  * @param {?} position
2110
2201
  * @param {?} originPoint
2111
2202
  * @param {?} scrollPosition
2112
2203
  * @return {?}
2113
2204
  */
2114
2205
  _getExactOverlayX(position, originPoint, scrollPosition) {
2206
+ // Reset any existing styles. This is necessary in case the preferred position has
2207
+ // changed since the last `apply`.
2115
2208
  /** @type {?} */
2116
- let styles = /** @type {?} */ ({ left: null, right: null });
2209
+ let styles = (/** @type {?} */ ({ left: null, right: null }));
2117
2210
  /** @type {?} */
2118
2211
  let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2119
2212
  if (this._isPushed) {
2120
2213
  overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2121
2214
  }
2215
+ // We want to set either `left` or `right` based on whether the overlay wants to appear "before"
2216
+ // or "after" the origin, which determines the direction in which the element will expand.
2217
+ // For the horizontal axis, the meaning of "before" and "after" change based on whether the
2218
+ // page is in RTL or LTR.
2122
2219
  /** @type {?} */
2123
2220
  let horizontalStyleProperty;
2124
2221
  if (this._isRtl()) {
@@ -2131,7 +2228,7 @@ class FlexibleConnectedPositionStrategy {
2131
2228
  // from the right edge of the viewport rather than the left edge.
2132
2229
  if (horizontalStyleProperty === 'right') {
2133
2230
  /** @type {?} */
2134
- const documentWidth = /** @type {?} */ ((this._document.documentElement)).clientWidth;
2231
+ const documentWidth = (/** @type {?} */ (this._document.documentElement)).clientWidth;
2135
2232
  styles.right = `${documentWidth - (overlayPoint.x + this._overlayRect.width)}px`;
2136
2233
  }
2137
2234
  else {
@@ -2142,13 +2239,18 @@ class FlexibleConnectedPositionStrategy {
2142
2239
  /**
2143
2240
  * Gets the view properties of the trigger and overlay, including whether they are clipped
2144
2241
  * or completely outside the view of any of the strategy's scrollables.
2242
+ * @private
2145
2243
  * @return {?}
2146
2244
  */
2147
2245
  _getScrollVisibility() {
2246
+ // Note: needs fresh rects since the position could've changed.
2148
2247
  /** @type {?} */
2149
2248
  const originBounds = this._origin.getBoundingClientRect();
2150
2249
  /** @type {?} */
2151
2250
  const overlayBounds = this._pane.getBoundingClientRect();
2251
+ // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers
2252
+ // every time, we should be able to use the scrollTop of the containers if the size of those
2253
+ // containers hasn't changed.
2152
2254
  /** @type {?} */
2153
2255
  const scrollContainerBounds = this.scrollables.map(scrollable => {
2154
2256
  return scrollable.getElementRef().nativeElement.getBoundingClientRect();
@@ -2162,6 +2264,7 @@ class FlexibleConnectedPositionStrategy {
2162
2264
  }
2163
2265
  /**
2164
2266
  * Subtracts the amount that an element is overflowing on an axis from it's length.
2267
+ * @private
2165
2268
  * @param {?} length
2166
2269
  * @param {...?} overflows
2167
2270
  * @return {?}
@@ -2173,13 +2276,19 @@ class FlexibleConnectedPositionStrategy {
2173
2276
  }
2174
2277
  /**
2175
2278
  * Narrows the given viewport rect by the current _viewportMargin.
2279
+ * @private
2176
2280
  * @return {?}
2177
2281
  */
2178
2282
  _getNarrowedViewportRect() {
2283
+ // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,
2284
+ // because we want to use the `clientWidth` and `clientHeight` as the base. The difference
2285
+ // being that the client properties don't include the scrollbar, as opposed to `innerWidth`
2286
+ // and `innerHeight` that do. This is necessary, because the overlay container uses
2287
+ // 100% `width` and `height` which don't include the scrollbar either.
2179
2288
  /** @type {?} */
2180
- const width = /** @type {?} */ ((this._document.documentElement)).clientWidth;
2289
+ const width = (/** @type {?} */ (this._document.documentElement)).clientWidth;
2181
2290
  /** @type {?} */
2182
- const height = /** @type {?} */ ((this._document.documentElement)).clientHeight;
2291
+ const height = (/** @type {?} */ (this._document.documentElement)).clientHeight;
2183
2292
  /** @type {?} */
2184
2293
  const scrollPosition = this._viewportRuler.getViewportScrollPosition();
2185
2294
  return {
@@ -2193,6 +2302,7 @@ class FlexibleConnectedPositionStrategy {
2193
2302
  }
2194
2303
  /**
2195
2304
  * Whether the we're dealing with an RTL context
2305
+ * @private
2196
2306
  * @return {?}
2197
2307
  */
2198
2308
  _isRtl() {
@@ -2200,6 +2310,7 @@ class FlexibleConnectedPositionStrategy {
2200
2310
  }
2201
2311
  /**
2202
2312
  * Determines whether the overlay uses exact or flexible positioning.
2313
+ * @private
2203
2314
  * @return {?}
2204
2315
  */
2205
2316
  _hasExactPosition() {
@@ -2207,6 +2318,7 @@ class FlexibleConnectedPositionStrategy {
2207
2318
  }
2208
2319
  /**
2209
2320
  * Retrieves the offset of a position along the x or y axis.
2321
+ * @private
2210
2322
  * @param {?} position
2211
2323
  * @param {?} axis
2212
2324
  * @return {?}
@@ -2221,6 +2333,7 @@ class FlexibleConnectedPositionStrategy {
2221
2333
  }
2222
2334
  /**
2223
2335
  * Validates that the current position match the expected values.
2336
+ * @private
2224
2337
  * @return {?}
2225
2338
  */
2226
2339
  _validatePositions() {
@@ -2238,6 +2351,7 @@ class FlexibleConnectedPositionStrategy {
2238
2351
  }
2239
2352
  /**
2240
2353
  * Adds a single CSS class or an array of classes on the overlay panel.
2354
+ * @private
2241
2355
  * @param {?} cssClasses
2242
2356
  * @return {?}
2243
2357
  */
@@ -2253,6 +2367,7 @@ class FlexibleConnectedPositionStrategy {
2253
2367
  }
2254
2368
  /**
2255
2369
  * Clears the classes that the position strategy has applied from the overlay panel.
2370
+ * @private
2256
2371
  * @return {?}
2257
2372
  */
2258
2373
  _clearPanelClasses() {
@@ -2279,7 +2394,7 @@ function extendStyles(dest, source) {
2279
2394
 
2280
2395
  /**
2281
2396
  * @fileoverview added by tsickle
2282
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
2397
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2283
2398
  */
2284
2399
  /**
2285
2400
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -2395,94 +2510,109 @@ class ConnectedPositionStrategy {
2395
2510
  }
2396
2511
  /**
2397
2512
  * Adds a new preferred fallback position.
2513
+ * @template THIS
2514
+ * @this {THIS}
2398
2515
  * @param {?} originPos
2399
2516
  * @param {?} overlayPos
2400
2517
  * @param {?=} offsetX
2401
2518
  * @param {?=} offsetY
2402
- * @return {?}
2519
+ * @return {THIS}
2403
2520
  */
2404
2521
  withFallbackPosition(originPos, overlayPos, offsetX, offsetY) {
2405
2522
  /** @type {?} */
2406
2523
  const position = new ConnectionPositionPair(originPos, overlayPos, offsetX, offsetY);
2407
- this._preferredPositions.push(position);
2408
- this._positionStrategy.withPositions(this._preferredPositions);
2409
- return this;
2524
+ (/** @type {?} */ (this))._preferredPositions.push(position);
2525
+ (/** @type {?} */ (this))._positionStrategy.withPositions((/** @type {?} */ (this))._preferredPositions);
2526
+ return (/** @type {?} */ (this));
2410
2527
  }
2411
2528
  /**
2412
2529
  * Sets the layout direction so the overlay's position can be adjusted to match.
2530
+ * @template THIS
2531
+ * @this {THIS}
2413
2532
  * @param {?} dir New layout direction.
2414
- * @return {?}
2533
+ * @return {THIS}
2415
2534
  */
2416
2535
  withDirection(dir) {
2417
2536
  // Since the direction might be declared before the strategy is attached,
2418
2537
  // we save the value in a temporary property and we'll transfer it to the
2419
2538
  // overlay ref on attachment.
2420
- if (this._overlayRef) {
2421
- this._overlayRef.setDirection(dir);
2539
+ if ((/** @type {?} */ (this))._overlayRef) {
2540
+ (/** @type {?} */ (this))._overlayRef.setDirection(dir);
2422
2541
  }
2423
2542
  else {
2424
- this._direction = dir;
2543
+ (/** @type {?} */ (this))._direction = dir;
2425
2544
  }
2426
- return this;
2545
+ return (/** @type {?} */ (this));
2427
2546
  }
2428
2547
  /**
2429
2548
  * Sets an offset for the overlay's connection point on the x-axis
2549
+ * @template THIS
2550
+ * @this {THIS}
2430
2551
  * @param {?} offset New offset in the X axis.
2431
- * @return {?}
2552
+ * @return {THIS}
2432
2553
  */
2433
2554
  withOffsetX(offset) {
2434
- this._positionStrategy.withDefaultOffsetX(offset);
2435
- return this;
2555
+ (/** @type {?} */ (this))._positionStrategy.withDefaultOffsetX(offset);
2556
+ return (/** @type {?} */ (this));
2436
2557
  }
2437
2558
  /**
2438
2559
  * Sets an offset for the overlay's connection point on the y-axis
2560
+ * @template THIS
2561
+ * @this {THIS}
2439
2562
  * @param {?} offset New offset in the Y axis.
2440
- * @return {?}
2563
+ * @return {THIS}
2441
2564
  */
2442
2565
  withOffsetY(offset) {
2443
- this._positionStrategy.withDefaultOffsetY(offset);
2444
- return this;
2566
+ (/** @type {?} */ (this))._positionStrategy.withDefaultOffsetY(offset);
2567
+ return (/** @type {?} */ (this));
2445
2568
  }
2446
2569
  /**
2447
2570
  * Sets whether the overlay's position should be locked in after it is positioned
2448
2571
  * initially. When an overlay is locked in, it won't attempt to reposition itself
2449
2572
  * when the position is re-applied (e.g. when the user scrolls away).
2573
+ * @template THIS
2574
+ * @this {THIS}
2450
2575
  * @param {?} isLocked Whether the overlay should locked in.
2451
- * @return {?}
2576
+ * @return {THIS}
2452
2577
  */
2453
2578
  withLockedPosition(isLocked) {
2454
- this._positionStrategy.withLockedPosition(isLocked);
2455
- return this;
2579
+ (/** @type {?} */ (this))._positionStrategy.withLockedPosition(isLocked);
2580
+ return (/** @type {?} */ (this));
2456
2581
  }
2457
2582
  /**
2458
2583
  * Overwrites the current set of positions with an array of new ones.
2584
+ * @template THIS
2585
+ * @this {THIS}
2459
2586
  * @param {?} positions Position pairs to be set on the strategy.
2460
- * @return {?}
2587
+ * @return {THIS}
2461
2588
  */
2462
2589
  withPositions(positions) {
2463
- this._preferredPositions = positions.slice();
2464
- this._positionStrategy.withPositions(this._preferredPositions);
2465
- return this;
2590
+ (/** @type {?} */ (this))._preferredPositions = positions.slice();
2591
+ (/** @type {?} */ (this))._positionStrategy.withPositions((/** @type {?} */ (this))._preferredPositions);
2592
+ return (/** @type {?} */ (this));
2466
2593
  }
2467
2594
  /**
2468
2595
  * Sets the origin element, relative to which to position the overlay.
2596
+ * @template THIS
2597
+ * @this {THIS}
2469
2598
  * @param {?} origin Reference to the new origin element.
2470
- * @return {?}
2599
+ * @return {THIS}
2471
2600
  */
2472
2601
  setOrigin(origin) {
2473
- this._positionStrategy.setOrigin(origin);
2474
- return this;
2602
+ (/** @type {?} */ (this))._positionStrategy.setOrigin(origin);
2603
+ return (/** @type {?} */ (this));
2475
2604
  }
2476
2605
  }
2477
2606
 
2478
2607
  /**
2479
2608
  * @fileoverview added by tsickle
2480
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
2609
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2481
2610
  */
2482
2611
 
2483
- /** *
2612
+ /**
2484
2613
  * Class to be added to the overlay pane wrapper.
2485
- @type {?} */
2614
+ * @type {?}
2615
+ */
2486
2616
  const wrapperClass = 'cdk-global-overlay-wrapper';
2487
2617
  /**
2488
2618
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -2521,103 +2651,119 @@ class GlobalPositionStrategy {
2521
2651
  }
2522
2652
  /**
2523
2653
  * Sets the top position of the overlay. Clears any previously set vertical position.
2654
+ * @template THIS
2655
+ * @this {THIS}
2524
2656
  * @param {?=} value New top offset.
2525
- * @return {?}
2657
+ * @return {THIS}
2526
2658
  */
2527
2659
  top(value = '') {
2528
- this._bottomOffset = '';
2529
- this._topOffset = value;
2530
- this._alignItems = 'flex-start';
2531
- return this;
2660
+ (/** @type {?} */ (this))._bottomOffset = '';
2661
+ (/** @type {?} */ (this))._topOffset = value;
2662
+ (/** @type {?} */ (this))._alignItems = 'flex-start';
2663
+ return (/** @type {?} */ (this));
2532
2664
  }
2533
2665
  /**
2534
2666
  * Sets the left position of the overlay. Clears any previously set horizontal position.
2667
+ * @template THIS
2668
+ * @this {THIS}
2535
2669
  * @param {?=} value New left offset.
2536
- * @return {?}
2670
+ * @return {THIS}
2537
2671
  */
2538
2672
  left(value = '') {
2539
- this._rightOffset = '';
2540
- this._leftOffset = value;
2541
- this._justifyContent = 'flex-start';
2542
- return this;
2673
+ (/** @type {?} */ (this))._rightOffset = '';
2674
+ (/** @type {?} */ (this))._leftOffset = value;
2675
+ (/** @type {?} */ (this))._justifyContent = 'flex-start';
2676
+ return (/** @type {?} */ (this));
2543
2677
  }
2544
2678
  /**
2545
2679
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
2680
+ * @template THIS
2681
+ * @this {THIS}
2546
2682
  * @param {?=} value New bottom offset.
2547
- * @return {?}
2683
+ * @return {THIS}
2548
2684
  */
2549
2685
  bottom(value = '') {
2550
- this._topOffset = '';
2551
- this._bottomOffset = value;
2552
- this._alignItems = 'flex-end';
2553
- return this;
2686
+ (/** @type {?} */ (this))._topOffset = '';
2687
+ (/** @type {?} */ (this))._bottomOffset = value;
2688
+ (/** @type {?} */ (this))._alignItems = 'flex-end';
2689
+ return (/** @type {?} */ (this));
2554
2690
  }
2555
2691
  /**
2556
2692
  * Sets the right position of the overlay. Clears any previously set horizontal position.
2693
+ * @template THIS
2694
+ * @this {THIS}
2557
2695
  * @param {?=} value New right offset.
2558
- * @return {?}
2696
+ * @return {THIS}
2559
2697
  */
2560
2698
  right(value = '') {
2561
- this._leftOffset = '';
2562
- this._rightOffset = value;
2563
- this._justifyContent = 'flex-end';
2564
- return this;
2699
+ (/** @type {?} */ (this))._leftOffset = '';
2700
+ (/** @type {?} */ (this))._rightOffset = value;
2701
+ (/** @type {?} */ (this))._justifyContent = 'flex-end';
2702
+ return (/** @type {?} */ (this));
2565
2703
  }
2566
2704
  /**
2567
2705
  * Sets the overlay width and clears any previously set width.
2568
2706
  * @deprecated Pass the `width` through the `OverlayConfig`.
2569
2707
  * \@breaking-change 8.0.0
2708
+ * @template THIS
2709
+ * @this {THIS}
2570
2710
  * @param {?=} value New width for the overlay
2571
- * @return {?}
2711
+ * @return {THIS}
2572
2712
  */
2573
2713
  width(value = '') {
2574
- if (this._overlayRef) {
2575
- this._overlayRef.updateSize({ width: value });
2714
+ if ((/** @type {?} */ (this))._overlayRef) {
2715
+ (/** @type {?} */ (this))._overlayRef.updateSize({ width: value });
2576
2716
  }
2577
2717
  else {
2578
- this._width = value;
2718
+ (/** @type {?} */ (this))._width = value;
2579
2719
  }
2580
- return this;
2720
+ return (/** @type {?} */ (this));
2581
2721
  }
2582
2722
  /**
2583
2723
  * Sets the overlay height and clears any previously set height.
2584
2724
  * @deprecated Pass the `height` through the `OverlayConfig`.
2585
2725
  * \@breaking-change 8.0.0
2726
+ * @template THIS
2727
+ * @this {THIS}
2586
2728
  * @param {?=} value New height for the overlay
2587
- * @return {?}
2729
+ * @return {THIS}
2588
2730
  */
2589
2731
  height(value = '') {
2590
- if (this._overlayRef) {
2591
- this._overlayRef.updateSize({ height: value });
2732
+ if ((/** @type {?} */ (this))._overlayRef) {
2733
+ (/** @type {?} */ (this))._overlayRef.updateSize({ height: value });
2592
2734
  }
2593
2735
  else {
2594
- this._height = value;
2736
+ (/** @type {?} */ (this))._height = value;
2595
2737
  }
2596
- return this;
2738
+ return (/** @type {?} */ (this));
2597
2739
  }
2598
2740
  /**
2599
2741
  * Centers the overlay horizontally with an optional offset.
2600
2742
  * Clears any previously set horizontal position.
2601
2743
  *
2744
+ * @template THIS
2745
+ * @this {THIS}
2602
2746
  * @param {?=} offset Overlay offset from the horizontal center.
2603
- * @return {?}
2747
+ * @return {THIS}
2604
2748
  */
2605
2749
  centerHorizontally(offset = '') {
2606
- this.left(offset);
2607
- this._justifyContent = 'center';
2608
- return this;
2750
+ (/** @type {?} */ (this)).left(offset);
2751
+ (/** @type {?} */ (this))._justifyContent = 'center';
2752
+ return (/** @type {?} */ (this));
2609
2753
  }
2610
2754
  /**
2611
2755
  * Centers the overlay vertically with an optional offset.
2612
2756
  * Clears any previously set vertical position.
2613
2757
  *
2758
+ * @template THIS
2759
+ * @this {THIS}
2614
2760
  * @param {?=} offset Overlay offset from the vertical center.
2615
- * @return {?}
2761
+ * @return {THIS}
2616
2762
  */
2617
2763
  centerVertically(offset = '') {
2618
- this.top(offset);
2619
- this._alignItems = 'center';
2620
- return this;
2764
+ (/** @type {?} */ (this)).top(offset);
2765
+ (/** @type {?} */ (this))._alignItems = 'center';
2766
+ return (/** @type {?} */ (this));
2621
2767
  }
2622
2768
  /**
2623
2769
  * Apply the position to the element.
@@ -2683,14 +2829,14 @@ class GlobalPositionStrategy {
2683
2829
  parent.classList.remove(wrapperClass);
2684
2830
  parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop =
2685
2831
  styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';
2686
- this._overlayRef = /** @type {?} */ ((null));
2832
+ this._overlayRef = (/** @type {?} */ (null));
2687
2833
  this._isDisposed = true;
2688
2834
  }
2689
2835
  }
2690
2836
 
2691
2837
  /**
2692
2838
  * @fileoverview added by tsickle
2693
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
2839
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2694
2840
  */
2695
2841
  /**
2696
2842
  * Builder for overlay position strategy.
@@ -2702,9 +2848,7 @@ class OverlayPositionBuilder {
2702
2848
  * @param {?=} _platform
2703
2849
  * @param {?=} _overlayContainer
2704
2850
  */
2705
- constructor(_viewportRuler, _document,
2706
- // @breaking-change 8.0.0 `_platform` and `_overlayContainer` parameters to be made required.
2707
- _platform, _overlayContainer) {
2851
+ constructor(_viewportRuler, _document, _platform, _overlayContainer) {
2708
2852
  this._viewportRuler = _viewportRuler;
2709
2853
  this._document = _document;
2710
2854
  this._platform = _platform;
@@ -2752,12 +2896,15 @@ OverlayPositionBuilder.ctorParameters = () => [
2752
2896
 
2753
2897
  /**
2754
2898
  * @fileoverview added by tsickle
2755
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
2899
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2756
2900
  */
2757
- /** *
2901
+ /**
2758
2902
  * Next overlay unique ID.
2759
- @type {?} */
2903
+ * @type {?}
2904
+ */
2760
2905
  let nextUniqueId = 0;
2906
+ // Note that Overlay is *not* scoped to the app root because the ComponentFactoryResolver
2907
+ // it needs is different based on where OverlayModule is imported.
2761
2908
  /**
2762
2909
  * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
2763
2910
  * used as a low-level building block for other components. Dialogs, tooltips, menus,
@@ -2779,9 +2926,7 @@ class Overlay {
2779
2926
  * @param {?} _directionality
2780
2927
  * @param {?=} _location
2781
2928
  */
2782
- constructor(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality,
2783
- // @breaking-change 8.0.0 `_location` parameter to be made required.
2784
- _location) {
2929
+ constructor(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location) {
2785
2930
  this.scrollStrategies = scrollStrategies;
2786
2931
  this._overlayContainer = _overlayContainer;
2787
2932
  this._componentFactoryResolver = _componentFactoryResolver;
@@ -2820,6 +2965,7 @@ class Overlay {
2820
2965
  }
2821
2966
  /**
2822
2967
  * Creates the DOM element for an overlay and appends it to the overlay container.
2968
+ * @private
2823
2969
  * @param {?} host
2824
2970
  * @return {?} Newly-created pane element
2825
2971
  */
@@ -2834,6 +2980,7 @@ class Overlay {
2834
2980
  /**
2835
2981
  * Creates the host element that wraps around an overlay
2836
2982
  * and can be used for advanced positioning.
2983
+ * @private
2837
2984
  * @return {?} Newly-create host element.
2838
2985
  */
2839
2986
  _createHostElement() {
@@ -2844,6 +2991,7 @@ class Overlay {
2844
2991
  }
2845
2992
  /**
2846
2993
  * Create a DomPortalOutlet into which the overlay content can be loaded.
2994
+ * @private
2847
2995
  * @param {?} pane The DOM element to turn into a portal outlet.
2848
2996
  * @return {?} A portal outlet for the given DOM element.
2849
2997
  */
@@ -2875,11 +3023,12 @@ Overlay.ctorParameters = () => [
2875
3023
 
2876
3024
  /**
2877
3025
  * @fileoverview added by tsickle
2878
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3026
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2879
3027
  */
2880
- /** *
3028
+ /**
2881
3029
  * Default set of positions for the overlay. Follows the behavior of a dropdown.
2882
- @type {?} */
3030
+ * @type {?}
3031
+ */
2883
3032
  const defaultPositionList = [
2884
3033
  {
2885
3034
  originX: 'start',
@@ -2906,9 +3055,10 @@ const defaultPositionList = [
2906
3055
  overlayY: 'top'
2907
3056
  }
2908
3057
  ];
2909
- /** *
3058
+ /**
2910
3059
  * Injection token that determines the scroll handling while the connected overlay is open.
2911
- @type {?} */
3060
+ * @type {?}
3061
+ */
2912
3062
  const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken('cdk-connected-overlay-scroll-strategy');
2913
3063
  /**
2914
3064
  * Directive applied to an element to make it usable as an origin for an Overlay using a
@@ -2937,6 +3087,7 @@ CdkOverlayOrigin.ctorParameters = () => [
2937
3087
  * Overlay using a FlexibleConnectedPositionStrategy.
2938
3088
  */
2939
3089
  class CdkConnectedOverlay {
3090
+ // TODO(jelbourn): inputs for size, scroll behavior, animation, etc.
2940
3091
  /**
2941
3092
  * @param {?} _overlay
2942
3093
  * @param {?} templateRef
@@ -3085,7 +3236,10 @@ class CdkConnectedOverlay {
3085
3236
  * @return {?}
3086
3237
  */
3087
3238
  ngOnDestroy() {
3088
- this._destroyOverlay();
3239
+ if (this._overlayRef) {
3240
+ this._overlayRef.dispose();
3241
+ }
3242
+ this._backdropSubscription.unsubscribe();
3089
3243
  }
3090
3244
  /**
3091
3245
  * @param {?} changes
@@ -3094,6 +3248,12 @@ class CdkConnectedOverlay {
3094
3248
  ngOnChanges(changes) {
3095
3249
  if (this._position) {
3096
3250
  this._updatePositionStrategy(this._position);
3251
+ this._overlayRef.updateSize({
3252
+ width: this.width,
3253
+ minWidth: this.minWidth,
3254
+ height: this.height,
3255
+ minHeight: this.minHeight,
3256
+ });
3097
3257
  if (changes['origin'] && this.open) {
3098
3258
  this._position.apply();
3099
3259
  }
@@ -3104,6 +3264,7 @@ class CdkConnectedOverlay {
3104
3264
  }
3105
3265
  /**
3106
3266
  * Creates an overlay
3267
+ * @private
3107
3268
  * @return {?}
3108
3269
  */
3109
3270
  _createOverlay() {
@@ -3120,6 +3281,7 @@ class CdkConnectedOverlay {
3120
3281
  }
3121
3282
  /**
3122
3283
  * Builds the overlay config based on the directive's inputs
3284
+ * @private
3123
3285
  * @return {?}
3124
3286
  */
3125
3287
  _buildConfig() {
@@ -3154,6 +3316,7 @@ class CdkConnectedOverlay {
3154
3316
  }
3155
3317
  /**
3156
3318
  * Updates the state of a position strategy, based on the values of the directive inputs.
3319
+ * @private
3157
3320
  * @param {?} positionStrategy
3158
3321
  * @return {?}
3159
3322
  */
@@ -3178,6 +3341,7 @@ class CdkConnectedOverlay {
3178
3341
  }
3179
3342
  /**
3180
3343
  * Returns the position strategy of the overlay to be set on the overlay config
3344
+ * @private
3181
3345
  * @return {?}
3182
3346
  */
3183
3347
  _createPositionStrategy() {
@@ -3189,6 +3353,7 @@ class CdkConnectedOverlay {
3189
3353
  }
3190
3354
  /**
3191
3355
  * Attaches the overlay and subscribes to backdrop clicks if backdrop exists
3356
+ * @private
3192
3357
  * @return {?}
3193
3358
  */
3194
3359
  _attachOverlay() {
@@ -3197,12 +3362,7 @@ class CdkConnectedOverlay {
3197
3362
  }
3198
3363
  else {
3199
3364
  // Update the overlay size, in case the directive's inputs have changed
3200
- this._overlayRef.updateSize({
3201
- width: this.width,
3202
- minWidth: this.minWidth,
3203
- height: this.height,
3204
- minHeight: this.minHeight,
3205
- });
3365
+ this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;
3206
3366
  }
3207
3367
  if (!this._overlayRef.hasAttached()) {
3208
3368
  this._overlayRef.attach(this._templatePortal);
@@ -3213,9 +3373,13 @@ class CdkConnectedOverlay {
3213
3373
  this.backdropClick.emit(event);
3214
3374
  });
3215
3375
  }
3376
+ else {
3377
+ this._backdropSubscription.unsubscribe();
3378
+ }
3216
3379
  }
3217
3380
  /**
3218
3381
  * Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists
3382
+ * @private
3219
3383
  * @return {?}
3220
3384
  */
3221
3385
  _detachOverlay() {
@@ -3225,16 +3389,6 @@ class CdkConnectedOverlay {
3225
3389
  }
3226
3390
  this._backdropSubscription.unsubscribe();
3227
3391
  }
3228
- /**
3229
- * Destroys the overlay created by this directive.
3230
- * @return {?}
3231
- */
3232
- _destroyOverlay() {
3233
- if (this._overlayRef) {
3234
- this._overlayRef.dispose();
3235
- }
3236
- this._backdropSubscription.unsubscribe();
3237
- }
3238
3392
  }
3239
3393
  CdkConnectedOverlay.decorators = [
3240
3394
  { type: Directive, args: [{
@@ -3283,9 +3437,10 @@ CdkConnectedOverlay.propDecorators = {
3283
3437
  function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
3284
3438
  return () => overlay.scrollStrategies.reposition();
3285
3439
  }
3286
- /** *
3440
+ /**
3287
3441
  * \@docs-private
3288
- @type {?} */
3442
+ * @type {?}
3443
+ */
3289
3444
  const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
3290
3445
  provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
3291
3446
  deps: [Overlay],
@@ -3294,7 +3449,7 @@ const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
3294
3449
 
3295
3450
  /**
3296
3451
  * @fileoverview added by tsickle
3297
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3452
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3298
3453
  */
3299
3454
  class OverlayModule {
3300
3455
  }
@@ -3309,11 +3464,12 @@ OverlayModule.decorators = [
3309
3464
  ],
3310
3465
  },] },
3311
3466
  ];
3312
- /** *
3467
+ /**
3313
3468
  * @deprecated Use `OverlayModule` instead.
3314
3469
  * \@breaking-change 8.0.0
3315
3470
  * \@docs-private
3316
- @type {?} */
3471
+ * @type {?}
3472
+ */
3317
3473
  const OVERLAY_PROVIDERS = [
3318
3474
  Overlay,
3319
3475
  OverlayPositionBuilder,
@@ -3325,7 +3481,7 @@ const OVERLAY_PROVIDERS = [
3325
3481
 
3326
3482
  /**
3327
3483
  * @fileoverview added by tsickle
3328
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3484
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3329
3485
  */
3330
3486
  /**
3331
3487
  * Alternative to OverlayContainer that supports correct displaying of overlay elements in
@@ -3351,6 +3507,7 @@ class FullscreenOverlayContainer extends OverlayContainer {
3351
3507
  }
3352
3508
  }
3353
3509
  /**
3510
+ * @protected
3354
3511
  * @return {?}
3355
3512
  */
3356
3513
  _createContainer() {
@@ -3359,6 +3516,7 @@ class FullscreenOverlayContainer extends OverlayContainer {
3359
3516
  this._addFullscreenChangeListener(() => this._adjustParentForFullscreenChange());
3360
3517
  }
3361
3518
  /**
3519
+ * @private
3362
3520
  * @return {?}
3363
3521
  */
3364
3522
  _adjustParentForFullscreenChange() {
@@ -3372,6 +3530,7 @@ class FullscreenOverlayContainer extends OverlayContainer {
3372
3530
  parent.appendChild(this._containerElement);
3373
3531
  }
3374
3532
  /**
3533
+ * @private
3375
3534
  * @param {?} fn
3376
3535
  * @return {?}
3377
3536
  */
@@ -3387,6 +3546,7 @@ class FullscreenOverlayContainer extends OverlayContainer {
3387
3546
  }
3388
3547
  }
3389
3548
  /**
3549
+ * @private
3390
3550
  * @return {?}
3391
3551
  */
3392
3552
  _getEventName() {
@@ -3397,10 +3557,10 @@ class FullscreenOverlayContainer extends OverlayContainer {
3397
3557
  else if (this._document.webkitFullscreenEnabled) {
3398
3558
  this._fullScreenEventName = 'webkitfullscreenchange';
3399
3559
  }
3400
- else if ((/** @type {?} */ (this._document)).mozFullScreenEnabled) {
3560
+ else if (((/** @type {?} */ (this._document))).mozFullScreenEnabled) {
3401
3561
  this._fullScreenEventName = 'mozfullscreenchange';
3402
3562
  }
3403
- else if ((/** @type {?} */ (this._document)).msFullscreenEnabled) {
3563
+ else if (((/** @type {?} */ (this._document))).msFullscreenEnabled) {
3404
3564
  this._fullScreenEventName = 'MSFullscreenChange';
3405
3565
  }
3406
3566
  }
@@ -3414,8 +3574,8 @@ class FullscreenOverlayContainer extends OverlayContainer {
3414
3574
  getFullscreenElement() {
3415
3575
  return this._document.fullscreenElement ||
3416
3576
  this._document.webkitFullscreenElement ||
3417
- (/** @type {?} */ (this._document)).mozFullScreenElement ||
3418
- (/** @type {?} */ (this._document)).msFullscreenElement ||
3577
+ ((/** @type {?} */ (this._document))).mozFullScreenElement ||
3578
+ ((/** @type {?} */ (this._document))).msFullscreenElement ||
3419
3579
  null;
3420
3580
  }
3421
3581
  }
@@ -3430,12 +3590,12 @@ FullscreenOverlayContainer.ctorParameters = () => [
3430
3590
 
3431
3591
  /**
3432
3592
  * @fileoverview added by tsickle
3433
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3593
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3434
3594
  */
3435
3595
 
3436
3596
  /**
3437
3597
  * @fileoverview added by tsickle
3438
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3598
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3439
3599
  */
3440
3600
 
3441
3601
  export { Overlay, OverlayContainer, CdkOverlayOrigin, CdkConnectedOverlay, FullscreenOverlayContainer, OverlayRef, OverlayKeyboardDispatcher, OverlayPositionBuilder, GlobalPositionStrategy, ConnectedPositionStrategy, FlexibleConnectedPositionStrategy, OverlayConfig, validateVerticalPosition, validateHorizontalPosition, ConnectionPositionPair, ScrollingVisibility, ConnectedOverlayPositionChange, ScrollStrategyOptions, RepositionScrollStrategy, CloseScrollStrategy, NoopScrollStrategy, BlockScrollStrategy, OverlayModule, OVERLAY_PROVIDERS, OVERLAY_KEYBOARD_DISPATCHER_PROVIDER as ɵg, OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY as ɵf, OVERLAY_CONTAINER_PROVIDER as ɵb, OVERLAY_CONTAINER_PROVIDER_FACTORY as ɵa, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY as ɵc, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER as ɵe, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY as ɵd };