@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 { __assign, __extends } from 'tslib';
14
14
  import { Observable, Subject, merge, Subscription } from 'rxjs';
15
15
  import { take, takeUntil } from 'rxjs/operators';
@@ -20,7 +20,7 @@ import { ESCAPE } from '@angular/cdk/keycodes';
20
20
 
21
21
  /**
22
22
  * @fileoverview added by tsickle
23
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
23
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
24
24
  */
25
25
  /**
26
26
  * Strategy that will prevent the user from scrolling while the overlay is visible.
@@ -57,7 +57,7 @@ BlockScrollStrategy = /** @class */ (function () {
57
57
  function () {
58
58
  if (this._canBeEnabled()) {
59
59
  /** @type {?} */
60
- var root = /** @type {?} */ ((this._document.documentElement));
60
+ var root = (/** @type {?} */ (this._document.documentElement));
61
61
  this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();
62
62
  // Cache the previous inline styles in case the user had set them.
63
63
  this._previousHTMLStyles.left = root.style.left || '';
@@ -82,13 +82,13 @@ BlockScrollStrategy = /** @class */ (function () {
82
82
  function () {
83
83
  if (this._isEnabled) {
84
84
  /** @type {?} */
85
- var html = /** @type {?} */ ((this._document.documentElement));
85
+ var html = (/** @type {?} */ (this._document.documentElement));
86
86
  /** @type {?} */
87
- var body = /** @type {?} */ ((this._document.body));
87
+ var body = (/** @type {?} */ (this._document.body));
88
88
  /** @type {?} */
89
- var htmlStyle = /** @type {?} */ (html.style);
89
+ var htmlStyle = (/** @type {?} */ (html.style));
90
90
  /** @type {?} */
91
- var bodyStyle = /** @type {?} */ (body.style);
91
+ var bodyStyle = (/** @type {?} */ (body.style));
92
92
  /** @type {?} */
93
93
  var previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';
94
94
  /** @type {?} */
@@ -106,14 +106,19 @@ BlockScrollStrategy = /** @class */ (function () {
106
106
  }
107
107
  };
108
108
  /**
109
+ * @private
109
110
  * @return {?}
110
111
  */
111
112
  BlockScrollStrategy.prototype._canBeEnabled = /**
113
+ * @private
112
114
  * @return {?}
113
115
  */
114
116
  function () {
117
+ // Since the scroll strategies can't be singletons, we have to use a global CSS class
118
+ // (`cdk-global-scrollblock`) to make sure that we don't try to disable global
119
+ // scrolling multiple times.
115
120
  /** @type {?} */
116
- var html = /** @type {?} */ ((this._document.documentElement));
121
+ var html = (/** @type {?} */ (this._document.documentElement));
117
122
  if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {
118
123
  return false;
119
124
  }
@@ -128,7 +133,7 @@ BlockScrollStrategy = /** @class */ (function () {
128
133
 
129
134
  /**
130
135
  * @fileoverview added by tsickle
131
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
136
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
132
137
  */
133
138
  /**
134
139
  * Returns an error to be thrown when attempting to attach an already-attached scroll strategy.
@@ -140,7 +145,7 @@ function getMatScrollStrategyAlreadyAttachedError() {
140
145
 
141
146
  /**
142
147
  * @fileoverview added by tsickle
143
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
148
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
144
149
  */
145
150
  /**
146
151
  * Strategy that will close the overlay as soon as the user starts scrolling.
@@ -204,7 +209,7 @@ CloseScrollStrategy = /** @class */ (function () {
204
209
  this._scrollSubscription = stream.subscribe(function () {
205
210
  /** @type {?} */
206
211
  var scrollPosition = _this._viewportRuler.getViewportScrollPosition().top;
207
- if (Math.abs(scrollPosition - _this._initialScrollPosition) > /** @type {?} */ ((/** @type {?} */ ((_this._config)).threshold))) {
212
+ if (Math.abs(scrollPosition - _this._initialScrollPosition) > (/** @type {?} */ ((/** @type {?} */ (_this._config)).threshold))) {
208
213
  _this._detach();
209
214
  }
210
215
  else {
@@ -236,7 +241,7 @@ CloseScrollStrategy = /** @class */ (function () {
236
241
 
237
242
  /**
238
243
  * @fileoverview added by tsickle
239
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
244
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
240
245
  */
241
246
 
242
247
  /**
@@ -283,7 +288,7 @@ NoopScrollStrategy = /** @class */ (function () {
283
288
 
284
289
  /**
285
290
  * @fileoverview added by tsickle
286
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
291
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
287
292
  */
288
293
 
289
294
  // TODO(jelbourn): move this to live with the rest of the scrolling code
@@ -331,7 +336,7 @@ function isElementClippedByScrolling(element, scrollContainers) {
331
336
 
332
337
  /**
333
338
  * @fileoverview added by tsickle
334
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
339
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
335
340
  */
336
341
  /**
337
342
  * Strategy that will update the element position as the user is scrolling.
@@ -385,6 +390,8 @@ RepositionScrollStrategy = /** @class */ (function () {
385
390
  /** @type {?} */
386
391
  var overlayRect = _this._overlayRef.overlayElement.getBoundingClientRect();
387
392
  var _a = _this._viewportRuler.getViewportSize(), width = _a.width, height = _a.height;
393
+ // TODO(crisbeto): include all ancestor scroll containers here once
394
+ // we have a way of exposing the trigger element to the scroll strategy.
388
395
  /** @type {?} */
389
396
  var parentRects = [{ width: width, height: height, bottom: height, right: width, top: 0, left: 0 }];
390
397
  if (isElementScrolledOutsideView(overlayRect, parentRects)) {
@@ -415,7 +422,7 @@ RepositionScrollStrategy = /** @class */ (function () {
415
422
 
416
423
  /**
417
424
  * @fileoverview added by tsickle
418
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
425
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
419
426
  */
420
427
  /**
421
428
  * Options for how an overlay will handle scrolling.
@@ -466,12 +473,12 @@ var ScrollStrategyOptions = /** @class */ (function () {
466
473
 
467
474
  /**
468
475
  * @fileoverview added by tsickle
469
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
476
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
470
477
  */
471
478
 
472
479
  /**
473
480
  * @fileoverview added by tsickle
474
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
481
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
475
482
  */
476
483
  /**
477
484
  * Initial configuration used when creating an overlay.
@@ -507,7 +514,7 @@ OverlayConfig = /** @class */ (function () {
507
514
  if (config) {
508
515
  Object.keys(config).forEach(function (k) {
509
516
  /** @type {?} */
510
- var key = /** @type {?} */ (k);
517
+ var key = (/** @type {?} */ (k));
511
518
  if (typeof config[key] !== 'undefined') {
512
519
  _this[key] = config[key];
513
520
  }
@@ -519,7 +526,7 @@ OverlayConfig = /** @class */ (function () {
519
526
 
520
527
  /**
521
528
  * @fileoverview added by tsickle
522
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
529
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
523
530
  */
524
531
  /**
525
532
  * The points of the origin element and the overlay element to connect.
@@ -598,8 +605,7 @@ ScrollingVisibility = /** @class */ (function () {
598
605
  * The change event emitted by the strategy when a fallback position is used.
599
606
  */
600
607
  var ConnectedOverlayPositionChange = /** @class */ (function () {
601
- function ConnectedOverlayPositionChange(connectionPair, /** @docs-private */
602
- scrollableViewProperties) {
608
+ function ConnectedOverlayPositionChange(connectionPair, scrollableViewProperties) {
603
609
  this.connectionPair = connectionPair;
604
610
  this.scrollableViewProperties = scrollableViewProperties;
605
611
  }
@@ -639,7 +645,7 @@ function validateHorizontalPosition(property, value) {
639
645
 
640
646
  /**
641
647
  * @fileoverview added by tsickle
642
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
648
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
643
649
  */
644
650
  /**
645
651
  * Service for dispatching keyboard events that land on the body to appropriate overlay ref,
@@ -726,12 +732,15 @@ var OverlayKeyboardDispatcher = /** @class */ (function () {
726
732
  this._detach();
727
733
  }
728
734
  };
735
+ /** Detaches the global keyboard event listener. */
729
736
  /**
730
737
  * Detaches the global keyboard event listener.
738
+ * @private
731
739
  * @return {?}
732
740
  */
733
741
  OverlayKeyboardDispatcher.prototype._detach = /**
734
742
  * Detaches the global keyboard event listener.
743
+ * @private
735
744
  * @return {?}
736
745
  */
737
746
  function () {
@@ -759,16 +768,17 @@ var OverlayKeyboardDispatcher = /** @class */ (function () {
759
768
  function OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY(dispatcher, _document) {
760
769
  return dispatcher || new OverlayKeyboardDispatcher(_document);
761
770
  }
762
- /** *
771
+ /**
763
772
  * \@docs-private \@deprecated \@breaking-change 8.0.0
764
- @type {?} */
773
+ * @type {?}
774
+ */
765
775
  var OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {
766
776
  // If there is already an OverlayKeyboardDispatcher available, use that.
767
777
  // Otherwise, provide a new one.
768
778
  provide: OverlayKeyboardDispatcher,
769
779
  deps: [
770
780
  [new Optional(), new SkipSelf(), OverlayKeyboardDispatcher],
771
- /** @type {?} */ ((
781
+ (/** @type {?} */ (
772
782
  // Coerce to `InjectionToken` so that the `deps` match the "shape"
773
783
  // of the type expected by Angular
774
784
  DOCUMENT))
@@ -778,7 +788,7 @@ var OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {
778
788
 
779
789
  /**
780
790
  * @fileoverview added by tsickle
781
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
791
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
782
792
  */
783
793
  /**
784
794
  * Container inside which all overlays will render.
@@ -829,11 +839,13 @@ var OverlayContainer = /** @class */ (function () {
829
839
  /**
830
840
  * Create the overlay container element, which is simply a div
831
841
  * with the 'cdk-overlay-container' class on the document body.
842
+ * @protected
832
843
  * @return {?}
833
844
  */
834
845
  OverlayContainer.prototype._createContainer = /**
835
846
  * Create the overlay container element, which is simply a div
836
847
  * with the 'cdk-overlay-container' class on the document body.
848
+ * @protected
837
849
  * @return {?}
838
850
  */
839
851
  function () {
@@ -862,23 +874,23 @@ var OverlayContainer = /** @class */ (function () {
862
874
  function OVERLAY_CONTAINER_PROVIDER_FACTORY(parentContainer, _document) {
863
875
  return parentContainer || new OverlayContainer(_document);
864
876
  }
865
- /** *
877
+ /**
866
878
  * \@docs-private \@deprecated \@breaking-change 8.0.0
867
- @type {?} */
879
+ * @type {?}
880
+ */
868
881
  var OVERLAY_CONTAINER_PROVIDER = {
869
882
  // If there is already an OverlayContainer available, use that. Otherwise, provide a new one.
870
883
  provide: OverlayContainer,
871
884
  deps: [
872
885
  [new Optional(), new SkipSelf(), OverlayContainer],
873
- /** @type {?} */ (DOCUMENT // We need to use the InjectionToken somewhere to keep TS happy
874
- ) // We need to use the InjectionToken somewhere to keep TS happy
886
+ (/** @type {?} */ (DOCUMENT))
875
887
  ],
876
888
  useFactory: OVERLAY_CONTAINER_PROVIDER_FACTORY
877
889
  };
878
890
 
879
891
  /**
880
892
  * @fileoverview added by tsickle
881
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
893
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
882
894
  */
883
895
  /**
884
896
  * Reference to an overlay that has been created with the Overlay service.
@@ -904,7 +916,7 @@ OverlayRef = /** @class */ (function () {
904
916
  this._attachments = new Subject();
905
917
  this._detachments = new Subject();
906
918
  this._locationChanges = Subscription.EMPTY;
907
- this._keydownEventsObservable = Observable.create(function (observer) {
919
+ this._keydownEventsObservable = new Observable(function (observer) {
908
920
  /** @type {?} */
909
921
  var subscription = _this._keydownEvents.subscribe(observer);
910
922
  _this._keydownEventSubscriptions++;
@@ -1104,9 +1116,9 @@ OverlayRef = /** @class */ (function () {
1104
1116
  this._keydownEvents.complete();
1105
1117
  if (this._host && this._host.parentNode) {
1106
1118
  this._host.parentNode.removeChild(this._host);
1107
- this._host = /** @type {?} */ ((null));
1119
+ this._host = (/** @type {?} */ (null));
1108
1120
  }
1109
- this._previousHostParent = this._pane = /** @type {?} */ ((null));
1121
+ this._previousHostParent = this._pane = (/** @type {?} */ (null));
1110
1122
  if (isAttached) {
1111
1123
  this._detachments.next();
1112
1124
  }
@@ -1172,13 +1184,13 @@ OverlayRef = /** @class */ (function () {
1172
1184
  function () {
1173
1185
  return this._keydownEventsObservable;
1174
1186
  };
1175
- /** Gets the the current overlay configuration, which is immutable. */
1187
+ /** Gets the current overlay configuration, which is immutable. */
1176
1188
  /**
1177
- * Gets the the current overlay configuration, which is immutable.
1189
+ * Gets the current overlay configuration, which is immutable.
1178
1190
  * @return {?}
1179
1191
  */
1180
1192
  OverlayRef.prototype.getConfig = /**
1181
- * Gets the the current overlay configuration, which is immutable.
1193
+ * Gets the current overlay configuration, which is immutable.
1182
1194
  * @return {?}
1183
1195
  */
1184
1196
  function () {
@@ -1271,23 +1283,29 @@ OverlayRef = /** @class */ (function () {
1271
1283
  }
1272
1284
  return typeof direction === 'string' ? direction : direction.value;
1273
1285
  };
1286
+ /** Updates the text direction of the overlay panel. */
1274
1287
  /**
1275
1288
  * Updates the text direction of the overlay panel.
1289
+ * @private
1276
1290
  * @return {?}
1277
1291
  */
1278
1292
  OverlayRef.prototype._updateElementDirection = /**
1279
1293
  * Updates the text direction of the overlay panel.
1294
+ * @private
1280
1295
  * @return {?}
1281
1296
  */
1282
1297
  function () {
1283
1298
  this._host.setAttribute('dir', this.getDirection());
1284
1299
  };
1300
+ /** Updates the size of the overlay element based on the overlay config. */
1285
1301
  /**
1286
1302
  * Updates the size of the overlay element based on the overlay config.
1303
+ * @private
1287
1304
  * @return {?}
1288
1305
  */
1289
1306
  OverlayRef.prototype._updateElementSize = /**
1290
1307
  * Updates the size of the overlay element based on the overlay config.
1308
+ * @private
1291
1309
  * @return {?}
1292
1310
  */
1293
1311
  function () {
@@ -1300,25 +1318,31 @@ OverlayRef = /** @class */ (function () {
1300
1318
  style.maxWidth = coerceCssPixelValue(this._config.maxWidth);
1301
1319
  style.maxHeight = coerceCssPixelValue(this._config.maxHeight);
1302
1320
  };
1321
+ /** Toggles the pointer events for the overlay pane element. */
1303
1322
  /**
1304
1323
  * Toggles the pointer events for the overlay pane element.
1324
+ * @private
1305
1325
  * @param {?} enablePointer
1306
1326
  * @return {?}
1307
1327
  */
1308
1328
  OverlayRef.prototype._togglePointerEvents = /**
1309
1329
  * Toggles the pointer events for the overlay pane element.
1330
+ * @private
1310
1331
  * @param {?} enablePointer
1311
1332
  * @return {?}
1312
1333
  */
1313
1334
  function (enablePointer) {
1314
1335
  this._pane.style.pointerEvents = enablePointer ? 'auto' : 'none';
1315
1336
  };
1337
+ /** Attaches a backdrop for this overlay. */
1316
1338
  /**
1317
1339
  * Attaches a backdrop for this overlay.
1340
+ * @private
1318
1341
  * @return {?}
1319
1342
  */
1320
1343
  OverlayRef.prototype._attachBackdrop = /**
1321
1344
  * Attaches a backdrop for this overlay.
1345
+ * @private
1322
1346
  * @return {?}
1323
1347
  */
1324
1348
  function () {
@@ -1329,11 +1353,10 @@ OverlayRef = /** @class */ (function () {
1329
1353
  this._backdropElement.classList.add('cdk-overlay-backdrop');
1330
1354
  if (this._config.backdropClass) {
1331
1355
  this._toggleClasses(this._backdropElement, this._config.backdropClass, true);
1332
- } /** @type {?} */
1333
- ((
1356
+ }
1334
1357
  // Insert the backdrop before the pane in the DOM order,
1335
1358
  // in order to handle stacked overlays properly.
1336
- this._host.parentElement)).insertBefore(this._backdropElement, this._host);
1359
+ (/** @type {?} */ (this._host.parentElement)).insertBefore(this._backdropElement, this._host);
1337
1360
  // Forward backdrop clicks such that the consumer of the overlay can perform whatever
1338
1361
  // action desired when such a click occurs (usually closing the overlay).
1339
1362
  this._backdropElement.addEventListener('click', function (event) { return _this._backdropClick.next(event); });
@@ -1357,6 +1380,14 @@ OverlayRef = /** @class */ (function () {
1357
1380
  * that should be behind it, was destroyed. The next time both of them are opened,
1358
1381
  * the stacking will be wrong, because the detached element's pane will still be
1359
1382
  * in its original DOM position.
1383
+ */
1384
+ /**
1385
+ * Updates the stacking order of the element, moving it to the top if necessary.
1386
+ * This is required in cases where one overlay was detached, while another one,
1387
+ * that should be behind it, was destroyed. The next time both of them are opened,
1388
+ * the stacking will be wrong, because the detached element's pane will still be
1389
+ * in its original DOM position.
1390
+ * @private
1360
1391
  * @return {?}
1361
1392
  */
1362
1393
  OverlayRef.prototype._updateStackingOrder = /**
@@ -1365,11 +1396,12 @@ OverlayRef = /** @class */ (function () {
1365
1396
  * that should be behind it, was destroyed. The next time both of them are opened,
1366
1397
  * the stacking will be wrong, because the detached element's pane will still be
1367
1398
  * in its original DOM position.
1399
+ * @private
1368
1400
  * @return {?}
1369
1401
  */
1370
1402
  function () {
1371
1403
  if (this._host.nextSibling) {
1372
- /** @type {?} */ ((this._host.parentNode)).appendChild(this._host);
1404
+ (/** @type {?} */ (this._host.parentNode)).appendChild(this._host);
1373
1405
  }
1374
1406
  };
1375
1407
  /** Detaches the backdrop (if any) associated with the overlay. */
@@ -1403,13 +1435,13 @@ OverlayRef = /** @class */ (function () {
1403
1435
  _this._backdropElement = null;
1404
1436
  }
1405
1437
  if (_this._config.backdropClass) {
1406
- _this._toggleClasses(/** @type {?} */ ((backdropToDetach)), _this._config.backdropClass, false);
1438
+ _this._toggleClasses((/** @type {?} */ (backdropToDetach)), _this._config.backdropClass, false);
1407
1439
  }
1408
1440
  clearTimeout(timeoutId);
1409
1441
  };
1410
1442
  backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');
1411
1443
  this._ngZone.runOutsideAngular(function () {
1412
- /** @type {?} */ ((backdropToDetach)).addEventListener('transitionend', finishDetach);
1444
+ (/** @type {?} */ (backdropToDetach)).addEventListener('transitionend', finishDetach);
1413
1445
  });
1414
1446
  // If the backdrop doesn't have a transition, the `transitionend` event won't fire.
1415
1447
  // In this case we make it unclickable and we try to remove it after a delay.
@@ -1419,8 +1451,10 @@ OverlayRef = /** @class */ (function () {
1419
1451
  // either async or fakeAsync.
1420
1452
  timeoutId = this._ngZone.runOutsideAngular(function () { return setTimeout(finishDetach, 500); });
1421
1453
  };
1454
+ /** Toggles a single CSS class or an array of classes on an element. */
1422
1455
  /**
1423
1456
  * Toggles a single CSS class or an array of classes on an element.
1457
+ * @private
1424
1458
  * @param {?} element
1425
1459
  * @param {?} cssClasses
1426
1460
  * @param {?} isAdd
@@ -1428,6 +1462,7 @@ OverlayRef = /** @class */ (function () {
1428
1462
  */
1429
1463
  OverlayRef.prototype._toggleClasses = /**
1430
1464
  * Toggles a single CSS class or an array of classes on an element.
1465
+ * @private
1431
1466
  * @param {?} element
1432
1467
  * @param {?} cssClasses
1433
1468
  * @param {?} isAdd
@@ -1441,12 +1476,15 @@ OverlayRef = /** @class */ (function () {
1441
1476
  isAdd ? classList.add(cssClass) : classList.remove(cssClass);
1442
1477
  });
1443
1478
  };
1479
+ /** Detaches the overlay content next time the zone stabilizes. */
1444
1480
  /**
1445
1481
  * Detaches the overlay content next time the zone stabilizes.
1482
+ * @private
1446
1483
  * @return {?}
1447
1484
  */
1448
1485
  OverlayRef.prototype._detachContentWhenStable = /**
1449
1486
  * Detaches the overlay content next time the zone stabilizes.
1487
+ * @private
1450
1488
  * @return {?}
1451
1489
  */
1452
1490
  function () {
@@ -1455,6 +1493,9 @@ OverlayRef = /** @class */ (function () {
1455
1493
  // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will
1456
1494
  // be patched to run inside the zone, which will throw us into an infinite loop.
1457
1495
  this._ngZone.runOutsideAngular(function () {
1496
+ // We can't remove the host here immediately, because the overlay pane's content
1497
+ // might still be animating. This stream helps us avoid interrupting the animation
1498
+ // by waiting for the pane to become empty.
1458
1499
  /** @type {?} */
1459
1500
  var subscription = _this._ngZone.onStable
1460
1501
  .asObservable()
@@ -1480,11 +1521,14 @@ OverlayRef = /** @class */ (function () {
1480
1521
 
1481
1522
  /**
1482
1523
  * @fileoverview added by tsickle
1483
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1524
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1484
1525
  */
1485
- /** *
1526
+ // TODO: refactor clipping detection into a separate thing (part of scrolling module)
1527
+ // TODO: doesn't handle both flexible width and height when it has to scroll along both axis.
1528
+ /**
1486
1529
  * Class to be added to the overlay bounding box.
1487
- @type {?} */
1530
+ * @type {?}
1531
+ */
1488
1532
  var boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';
1489
1533
  /**
1490
1534
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -1570,7 +1614,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1570
1614
  /**
1571
1615
  * Observable sequence of position changes.
1572
1616
  */
1573
- this.positionChanges = Observable.create(function (observer) {
1617
+ this.positionChanges = new Observable(function (observer) {
1574
1618
  /** @type {?} */
1575
1619
  var subscription = _this._positionChanges.subscribe(observer);
1576
1620
  _this._positionChangeSubscriptions++;
@@ -1698,18 +1742,25 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1698
1742
  var overlayRect = this._overlayRect;
1699
1743
  /** @type {?} */
1700
1744
  var viewportRect = this._viewportRect;
1745
+ // Positions where the overlay will fit with flexible dimensions.
1701
1746
  /** @type {?} */
1702
1747
  var flexibleFits = [];
1748
+ // Fallback if none of the preferred positions fit within the viewport.
1703
1749
  /** @type {?} */
1704
1750
  var fallback;
1705
1751
  // Go through each of the preferred positions looking for a good fit.
1706
1752
  // If a good fit is found, it will be applied immediately.
1707
1753
  for (var _i = 0, _a = this._preferredPositions; _i < _a.length; _i++) {
1708
1754
  var pos = _a[_i];
1755
+ // Get the exact (x, y) coordinate for the point-of-origin on the origin element.
1709
1756
  /** @type {?} */
1710
1757
  var originPoint = this._getOriginPoint(originRect, pos);
1758
+ // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the
1759
+ // overlay in this position. We use the top-left corner for calculations and later translate
1760
+ // this into an appropriate (top, left, bottom, right) style.
1711
1761
  /** @type {?} */
1712
1762
  var overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);
1763
+ // Calculate how well the overlay would fit into the viewport with this point.
1713
1764
  /** @type {?} */
1714
1765
  var overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);
1715
1766
  // If the overlay, without any further work, fits into the viewport, use this position.
@@ -1755,7 +1806,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1755
1806
  }
1756
1807
  }
1757
1808
  this._isPushed = false;
1758
- this._applyPosition(/** @type {?} */ ((bestFit)).position, /** @type {?} */ ((bestFit)).origin);
1809
+ this._applyPosition((/** @type {?} */ (bestFit)).position, (/** @type {?} */ (bestFit)).origin);
1759
1810
  return;
1760
1811
  }
1761
1812
  // When none of the preferred positions fit within the viewport, take the position
@@ -1763,12 +1814,12 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1763
1814
  if (this._canPush) {
1764
1815
  // TODO(jelbourn): after pushing, the opening "direction" of the overlay might not make sense.
1765
1816
  this._isPushed = true;
1766
- this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
1817
+ this._applyPosition((/** @type {?} */ (fallback)).position, (/** @type {?} */ (fallback)).originPoint);
1767
1818
  return;
1768
1819
  }
1769
1820
  // All options for getting the overlay within the viewport have been exhausted, so go with the
1770
1821
  // position that went off-screen the least.
1771
- this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
1822
+ this._applyPosition((/** @type {?} */ (fallback)).position, (/** @type {?} */ (fallback)).originPoint);
1772
1823
  };
1773
1824
  /**
1774
1825
  * @return {?}
@@ -1798,7 +1849,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1798
1849
  // We can't use `_resetBoundingBoxStyles` here, because it resets
1799
1850
  // some properties to zero, rather than removing them.
1800
1851
  if (this._boundingBox) {
1801
- extendStyles(this._boundingBox.style, /** @type {?} */ ({
1852
+ extendStyles(this._boundingBox.style, (/** @type {?} */ ({
1802
1853
  top: '',
1803
1854
  left: '',
1804
1855
  right: '',
@@ -1807,7 +1858,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1807
1858
  width: '',
1808
1859
  alignItems: '',
1809
1860
  justifyContent: '',
1810
- }));
1861
+ })));
1811
1862
  }
1812
1863
  if (this._pane) {
1813
1864
  this._resetOverlayElementStyles();
@@ -1817,7 +1868,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1817
1868
  }
1818
1869
  this.detach();
1819
1870
  this._positionChanges.complete();
1820
- this._overlayRef = this._boundingBox = /** @type {?} */ ((null));
1871
+ this._overlayRef = this._boundingBox = (/** @type {?} */ (null));
1821
1872
  this._isDisposed = true;
1822
1873
  };
1823
1874
  /**
@@ -1877,23 +1928,27 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1877
1928
  */
1878
1929
  /**
1879
1930
  * Adds new preferred positions.
1931
+ * @template THIS
1932
+ * @this {THIS}
1880
1933
  * @param {?} positions List of positions options for this overlay.
1881
- * @return {?}
1934
+ * @return {THIS}
1882
1935
  */
1883
1936
  FlexibleConnectedPositionStrategy.prototype.withPositions = /**
1884
1937
  * Adds new preferred positions.
1938
+ * @template THIS
1939
+ * @this {THIS}
1885
1940
  * @param {?} positions List of positions options for this overlay.
1886
- * @return {?}
1941
+ * @return {THIS}
1887
1942
  */
1888
1943
  function (positions) {
1889
- this._preferredPositions = positions;
1944
+ (/** @type {?} */ (this))._preferredPositions = positions;
1890
1945
  // If the last calculated position object isn't part of the positions anymore, clear
1891
1946
  // it in order to avoid it being picked up if the consumer tries to re-apply.
1892
- if (positions.indexOf(/** @type {?} */ ((this._lastPosition))) === -1) {
1893
- this._lastPosition = null;
1947
+ if (positions.indexOf((/** @type {?} */ ((/** @type {?} */ (this))._lastPosition))) === -1) {
1948
+ (/** @type {?} */ (this))._lastPosition = null;
1894
1949
  }
1895
- this._validatePositions();
1896
- return this;
1950
+ (/** @type {?} */ (this))._validatePositions();
1951
+ return (/** @type {?} */ (this));
1897
1952
  };
1898
1953
  /**
1899
1954
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
@@ -1901,65 +1956,81 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1901
1956
  */
1902
1957
  /**
1903
1958
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
1959
+ * @template THIS
1960
+ * @this {THIS}
1904
1961
  * @param {?} margin Required margin between the overlay and the viewport edge in pixels.
1905
- * @return {?}
1962
+ * @return {THIS}
1906
1963
  */
1907
1964
  FlexibleConnectedPositionStrategy.prototype.withViewportMargin = /**
1908
1965
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
1966
+ * @template THIS
1967
+ * @this {THIS}
1909
1968
  * @param {?} margin Required margin between the overlay and the viewport edge in pixels.
1910
- * @return {?}
1969
+ * @return {THIS}
1911
1970
  */
1912
1971
  function (margin) {
1913
- this._viewportMargin = margin;
1914
- return this;
1972
+ (/** @type {?} */ (this))._viewportMargin = margin;
1973
+ return (/** @type {?} */ (this));
1915
1974
  };
1916
1975
  /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */
1917
1976
  /**
1918
1977
  * Sets whether the overlay's width and height can be constrained to fit within the viewport.
1978
+ * @template THIS
1979
+ * @this {THIS}
1919
1980
  * @param {?=} flexibleDimensions
1920
- * @return {?}
1981
+ * @return {THIS}
1921
1982
  */
1922
1983
  FlexibleConnectedPositionStrategy.prototype.withFlexibleDimensions = /**
1923
1984
  * Sets whether the overlay's width and height can be constrained to fit within the viewport.
1985
+ * @template THIS
1986
+ * @this {THIS}
1924
1987
  * @param {?=} flexibleDimensions
1925
- * @return {?}
1988
+ * @return {THIS}
1926
1989
  */
1927
1990
  function (flexibleDimensions) {
1928
1991
  if (flexibleDimensions === void 0) { flexibleDimensions = true; }
1929
- this._hasFlexibleDimensions = flexibleDimensions;
1930
- return this;
1992
+ (/** @type {?} */ (this))._hasFlexibleDimensions = flexibleDimensions;
1993
+ return (/** @type {?} */ (this));
1931
1994
  };
1932
1995
  /** Sets whether the overlay can grow after the initial open via flexible width/height. */
1933
1996
  /**
1934
1997
  * Sets whether the overlay can grow after the initial open via flexible width/height.
1998
+ * @template THIS
1999
+ * @this {THIS}
1935
2000
  * @param {?=} growAfterOpen
1936
- * @return {?}
2001
+ * @return {THIS}
1937
2002
  */
1938
2003
  FlexibleConnectedPositionStrategy.prototype.withGrowAfterOpen = /**
1939
2004
  * Sets whether the overlay can grow after the initial open via flexible width/height.
2005
+ * @template THIS
2006
+ * @this {THIS}
1940
2007
  * @param {?=} growAfterOpen
1941
- * @return {?}
2008
+ * @return {THIS}
1942
2009
  */
1943
2010
  function (growAfterOpen) {
1944
2011
  if (growAfterOpen === void 0) { growAfterOpen = true; }
1945
- this._growAfterOpen = growAfterOpen;
1946
- return this;
2012
+ (/** @type {?} */ (this))._growAfterOpen = growAfterOpen;
2013
+ return (/** @type {?} */ (this));
1947
2014
  };
1948
2015
  /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */
1949
2016
  /**
1950
2017
  * Sets whether the overlay can be pushed on-screen if none of the provided positions fit.
2018
+ * @template THIS
2019
+ * @this {THIS}
1951
2020
  * @param {?=} canPush
1952
- * @return {?}
2021
+ * @return {THIS}
1953
2022
  */
1954
2023
  FlexibleConnectedPositionStrategy.prototype.withPush = /**
1955
2024
  * Sets whether the overlay can be pushed on-screen if none of the provided positions fit.
2025
+ * @template THIS
2026
+ * @this {THIS}
1956
2027
  * @param {?=} canPush
1957
- * @return {?}
2028
+ * @return {THIS}
1958
2029
  */
1959
2030
  function (canPush) {
1960
2031
  if (canPush === void 0) { canPush = true; }
1961
- this._canPush = canPush;
1962
- return this;
2032
+ (/** @type {?} */ (this))._canPush = canPush;
2033
+ return (/** @type {?} */ (this));
1963
2034
  };
1964
2035
  /**
1965
2036
  * Sets whether the overlay's position should be locked in after it is positioned
@@ -1971,20 +2042,24 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1971
2042
  * Sets whether the overlay's position should be locked in after it is positioned
1972
2043
  * initially. When an overlay is locked in, it won't attempt to reposition itself
1973
2044
  * when the position is re-applied (e.g. when the user scrolls away).
2045
+ * @template THIS
2046
+ * @this {THIS}
1974
2047
  * @param {?=} isLocked Whether the overlay should locked in.
1975
- * @return {?}
2048
+ * @return {THIS}
1976
2049
  */
1977
2050
  FlexibleConnectedPositionStrategy.prototype.withLockedPosition = /**
1978
2051
  * Sets whether the overlay's position should be locked in after it is positioned
1979
2052
  * initially. When an overlay is locked in, it won't attempt to reposition itself
1980
2053
  * when the position is re-applied (e.g. when the user scrolls away).
2054
+ * @template THIS
2055
+ * @this {THIS}
1981
2056
  * @param {?=} isLocked Whether the overlay should locked in.
1982
- * @return {?}
2057
+ * @return {THIS}
1983
2058
  */
1984
2059
  function (isLocked) {
1985
2060
  if (isLocked === void 0) { isLocked = true; }
1986
- this._positionLocked = isLocked;
1987
- return this;
2061
+ (/** @type {?} */ (this))._positionLocked = isLocked;
2062
+ return (/** @type {?} */ (this));
1988
2063
  };
1989
2064
  /**
1990
2065
  * Sets the origin element, relative to which to position the overlay.
@@ -1992,17 +2067,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1992
2067
  */
1993
2068
  /**
1994
2069
  * Sets the origin element, relative to which to position the overlay.
2070
+ * @template THIS
2071
+ * @this {THIS}
1995
2072
  * @param {?} origin Reference to the new origin element.
1996
- * @return {?}
2073
+ * @return {THIS}
1997
2074
  */
1998
2075
  FlexibleConnectedPositionStrategy.prototype.setOrigin = /**
1999
2076
  * Sets the origin element, relative to which to position the overlay.
2077
+ * @template THIS
2078
+ * @this {THIS}
2000
2079
  * @param {?} origin Reference to the new origin element.
2001
- * @return {?}
2080
+ * @return {THIS}
2002
2081
  */
2003
2082
  function (origin) {
2004
- this._origin = origin instanceof ElementRef ? origin.nativeElement : origin;
2005
- return this;
2083
+ (/** @type {?} */ (this))._origin = coerceElement(origin);
2084
+ return (/** @type {?} */ (this));
2006
2085
  };
2007
2086
  /**
2008
2087
  * Sets the default offset for the overlay's connection point on the x-axis.
@@ -2010,17 +2089,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2010
2089
  */
2011
2090
  /**
2012
2091
  * Sets the default offset for the overlay's connection point on the x-axis.
2092
+ * @template THIS
2093
+ * @this {THIS}
2013
2094
  * @param {?} offset New offset in the X axis.
2014
- * @return {?}
2095
+ * @return {THIS}
2015
2096
  */
2016
2097
  FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetX = /**
2017
2098
  * Sets the default offset for the overlay's connection point on the x-axis.
2099
+ * @template THIS
2100
+ * @this {THIS}
2018
2101
  * @param {?} offset New offset in the X axis.
2019
- * @return {?}
2102
+ * @return {THIS}
2020
2103
  */
2021
2104
  function (offset) {
2022
- this._offsetX = offset;
2023
- return this;
2105
+ (/** @type {?} */ (this))._offsetX = offset;
2106
+ return (/** @type {?} */ (this));
2024
2107
  };
2025
2108
  /**
2026
2109
  * Sets the default offset for the overlay's connection point on the y-axis.
@@ -2028,17 +2111,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2028
2111
  */
2029
2112
  /**
2030
2113
  * Sets the default offset for the overlay's connection point on the y-axis.
2114
+ * @template THIS
2115
+ * @this {THIS}
2031
2116
  * @param {?} offset New offset in the Y axis.
2032
- * @return {?}
2117
+ * @return {THIS}
2033
2118
  */
2034
2119
  FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetY = /**
2035
2120
  * Sets the default offset for the overlay's connection point on the y-axis.
2121
+ * @template THIS
2122
+ * @this {THIS}
2036
2123
  * @param {?} offset New offset in the Y axis.
2037
- * @return {?}
2124
+ * @return {THIS}
2038
2125
  */
2039
2126
  function (offset) {
2040
- this._offsetY = offset;
2041
- return this;
2127
+ (/** @type {?} */ (this))._offsetY = offset;
2128
+ return (/** @type {?} */ (this));
2042
2129
  };
2043
2130
  /**
2044
2131
  * Configures that the position strategy should set a `transform-origin` on some elements
@@ -2053,31 +2140,40 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2053
2140
  * inside the overlay, depending on the current position that is being applied. This is
2054
2141
  * useful for the cases where the origin of an animation can change depending on the
2055
2142
  * alignment of the overlay.
2143
+ * @template THIS
2144
+ * @this {THIS}
2056
2145
  * @param {?} selector CSS selector that will be used to find the target
2057
2146
  * elements onto which to set the transform origin.
2058
- * @return {?}
2147
+ * @return {THIS}
2059
2148
  */
2060
2149
  FlexibleConnectedPositionStrategy.prototype.withTransformOriginOn = /**
2061
2150
  * Configures that the position strategy should set a `transform-origin` on some elements
2062
2151
  * inside the overlay, depending on the current position that is being applied. This is
2063
2152
  * useful for the cases where the origin of an animation can change depending on the
2064
2153
  * alignment of the overlay.
2154
+ * @template THIS
2155
+ * @this {THIS}
2065
2156
  * @param {?} selector CSS selector that will be used to find the target
2066
2157
  * elements onto which to set the transform origin.
2067
- * @return {?}
2158
+ * @return {THIS}
2068
2159
  */
2069
2160
  function (selector) {
2070
- this._transformOriginSelector = selector;
2071
- return this;
2161
+ (/** @type {?} */ (this))._transformOriginSelector = selector;
2162
+ return (/** @type {?} */ (this));
2072
2163
  };
2073
2164
  /**
2074
2165
  * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
2166
+ */
2167
+ /**
2168
+ * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
2169
+ * @private
2075
2170
  * @param {?} originRect
2076
2171
  * @param {?} pos
2077
2172
  * @return {?}
2078
2173
  */
2079
2174
  FlexibleConnectedPositionStrategy.prototype._getOriginPoint = /**
2080
2175
  * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
2176
+ * @private
2081
2177
  * @param {?} originRect
2082
2178
  * @param {?} pos
2083
2179
  * @return {?}
@@ -2110,6 +2206,11 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2110
2206
  /**
2111
2207
  * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
2112
2208
  * origin point to which the overlay should be connected.
2209
+ */
2210
+ /**
2211
+ * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
2212
+ * origin point to which the overlay should be connected.
2213
+ * @private
2113
2214
  * @param {?} originPoint
2114
2215
  * @param {?} overlayRect
2115
2216
  * @param {?} pos
@@ -2118,12 +2219,15 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2118
2219
  FlexibleConnectedPositionStrategy.prototype._getOverlayPoint = /**
2119
2220
  * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
2120
2221
  * origin point to which the overlay should be connected.
2222
+ * @private
2121
2223
  * @param {?} originPoint
2122
2224
  * @param {?} overlayRect
2123
2225
  * @param {?} pos
2124
2226
  * @return {?}
2125
2227
  */
2126
2228
  function (originPoint, overlayRect, pos) {
2229
+ // Calculate the (overlayStartX, overlayStartY), the start of the
2230
+ // potential overlay position relative to the origin point.
2127
2231
  /** @type {?} */
2128
2232
  var overlayStartX;
2129
2233
  if (pos.overlayX == 'center') {
@@ -2149,8 +2253,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2149
2253
  y: originPoint.y + overlayStartY,
2150
2254
  };
2151
2255
  };
2256
+ /** Gets how well an overlay at the given point will fit within the viewport. */
2152
2257
  /**
2153
2258
  * Gets how well an overlay at the given point will fit within the viewport.
2259
+ * @private
2154
2260
  * @param {?} point
2155
2261
  * @param {?} overlay
2156
2262
  * @param {?} viewport
@@ -2159,6 +2265,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2159
2265
  */
2160
2266
  FlexibleConnectedPositionStrategy.prototype._getOverlayFit = /**
2161
2267
  * Gets how well an overlay at the given point will fit within the viewport.
2268
+ * @private
2162
2269
  * @param {?} point
2163
2270
  * @param {?} overlay
2164
2271
  * @param {?} viewport
@@ -2178,6 +2285,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2178
2285
  if (offsetY) {
2179
2286
  y += offsetY;
2180
2287
  }
2288
+ // How much the overlay would overflow at this position, on each side.
2181
2289
  /** @type {?} */
2182
2290
  var leftOverflow = 0 - x;
2183
2291
  /** @type {?} */
@@ -2186,6 +2294,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2186
2294
  var topOverflow = 0 - y;
2187
2295
  /** @type {?} */
2188
2296
  var bottomOverflow = (y + overlay.height) - viewport.height;
2297
+ // Visible parts of the element on each axis.
2189
2298
  /** @type {?} */
2190
2299
  var visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);
2191
2300
  /** @type {?} */
@@ -2201,6 +2310,13 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2201
2310
  };
2202
2311
  /**
2203
2312
  * Whether the overlay can fit within the viewport when it may resize either its width or height.
2313
+ * @param fit How well the overlay fits in the viewport at some position.
2314
+ * @param point The (x, y) coordinates of the overlat at some position.
2315
+ * @param viewport The geometry of the viewport.
2316
+ */
2317
+ /**
2318
+ * Whether the overlay can fit within the viewport when it may resize either its width or height.
2319
+ * @private
2204
2320
  * @param {?} fit How well the overlay fits in the viewport at some position.
2205
2321
  * @param {?} point The (x, y) coordinates of the overlat at some position.
2206
2322
  * @param {?} viewport The geometry of the viewport.
@@ -2208,6 +2324,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2208
2324
  */
2209
2325
  FlexibleConnectedPositionStrategy.prototype._canFitWithFlexibleDimensions = /**
2210
2326
  * Whether the overlay can fit within the viewport when it may resize either its width or height.
2327
+ * @private
2211
2328
  * @param {?} fit How well the overlay fits in the viewport at some position.
2212
2329
  * @param {?} point The (x, y) coordinates of the overlat at some position.
2213
2330
  * @param {?} viewport The geometry of the viewport.
@@ -2237,6 +2354,18 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2237
2354
  * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
2238
2355
  * right and bottom).
2239
2356
  *
2357
+ * @param start Starting point from which the overlay is pushed.
2358
+ * @param overlay Dimensions of the overlay.
2359
+ * @param scrollPosition Current viewport scroll position.
2360
+ * @returns The point at which to position the overlay after pushing. This is effectively a new
2361
+ * originPoint.
2362
+ */
2363
+ /**
2364
+ * Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
2365
+ * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
2366
+ * right and bottom).
2367
+ *
2368
+ * @private
2240
2369
  * @param {?} start Starting point from which the overlay is pushed.
2241
2370
  * @param {?} overlay Dimensions of the overlay.
2242
2371
  * @param {?} scrollPosition Current viewport scroll position.
@@ -2248,6 +2377,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2248
2377
  * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
2249
2378
  * right and bottom).
2250
2379
  *
2380
+ * @private
2251
2381
  * @param {?} start Starting point from which the overlay is pushed.
2252
2382
  * @param {?} overlay Dimensions of the overlay.
2253
2383
  * @param {?} scrollPosition Current viewport scroll position.
@@ -2266,6 +2396,8 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2266
2396
  }
2267
2397
  /** @type {?} */
2268
2398
  var viewport = this._viewportRect;
2399
+ // Determine how much the overlay goes outside the viewport on each
2400
+ // side, which we'll use to decide which direction to push it.
2269
2401
  /** @type {?} */
2270
2402
  var overflowRight = Math.max(start.x + overlay.width - viewport.right, 0);
2271
2403
  /** @type {?} */
@@ -2274,6 +2406,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2274
2406
  var overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);
2275
2407
  /** @type {?} */
2276
2408
  var overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);
2409
+ // Amount by which to push the overlay in each axis such that it remains on-screen.
2277
2410
  /** @type {?} */
2278
2411
  var pushX = 0;
2279
2412
  /** @type {?} */
@@ -2301,12 +2434,19 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2301
2434
  };
2302
2435
  /**
2303
2436
  * Applies a computed position to the overlay and emits a position change.
2437
+ * @param position The position preference
2438
+ * @param originPoint The point on the origin element where the overlay is connected.
2439
+ */
2440
+ /**
2441
+ * Applies a computed position to the overlay and emits a position change.
2442
+ * @private
2304
2443
  * @param {?} position The position preference
2305
2444
  * @param {?} originPoint The point on the origin element where the overlay is connected.
2306
2445
  * @return {?}
2307
2446
  */
2308
2447
  FlexibleConnectedPositionStrategy.prototype._applyPosition = /**
2309
2448
  * Applies a computed position to the overlay and emits a position change.
2449
+ * @private
2310
2450
  * @param {?} position The position preference
2311
2451
  * @param {?} originPoint The point on the origin element where the overlay is connected.
2312
2452
  * @return {?}
@@ -2332,13 +2472,16 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2332
2472
  }
2333
2473
  this._isInitialRender = false;
2334
2474
  };
2475
+ /** Sets the transform origin based on the configured selector and the passed-in position. */
2335
2476
  /**
2336
2477
  * Sets the transform origin based on the configured selector and the passed-in position.
2478
+ * @private
2337
2479
  * @param {?} position
2338
2480
  * @return {?}
2339
2481
  */
2340
2482
  FlexibleConnectedPositionStrategy.prototype._setTransformOrigin = /**
2341
2483
  * Sets the transform origin based on the configured selector and the passed-in position.
2484
+ * @private
2342
2485
  * @param {?} position
2343
2486
  * @return {?}
2344
2487
  */
@@ -2347,7 +2490,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2347
2490
  return;
2348
2491
  }
2349
2492
  /** @type {?} */
2350
- var elements = /** @type {?} */ ((this._boundingBox)).querySelectorAll(this._transformOriginSelector);
2493
+ var elements = (/** @type {?} */ (this._boundingBox)).querySelectorAll(this._transformOriginSelector);
2351
2494
  /** @type {?} */
2352
2495
  var xOrigin;
2353
2496
  /** @type {?} */
@@ -2370,6 +2513,13 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2370
2513
  *
2371
2514
  * This method does no measuring and applies no styles so that we can cheaply compute the
2372
2515
  * bounds for all positions and choose the best fit based on these results.
2516
+ */
2517
+ /**
2518
+ * Gets the position and size of the overlay's sizing container.
2519
+ *
2520
+ * This method does no measuring and applies no styles so that we can cheaply compute the
2521
+ * bounds for all positions and choose the best fit based on these results.
2522
+ * @private
2373
2523
  * @param {?} origin
2374
2524
  * @param {?} position
2375
2525
  * @return {?}
@@ -2379,6 +2529,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2379
2529
  *
2380
2530
  * This method does no measuring and applies no styles so that we can cheaply compute the
2381
2531
  * bounds for all positions and choose the best fit based on these results.
2532
+ * @private
2382
2533
  * @param {?} origin
2383
2534
  * @param {?} position
2384
2535
  * @return {?}
@@ -2397,7 +2548,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2397
2548
  if (position.overlayY === 'top') {
2398
2549
  // Overlay is opening "downward" and thus is bound by the bottom viewport edge.
2399
2550
  top = origin.y;
2400
- height = viewport.bottom - origin.y;
2551
+ height = viewport.height - top + this._viewportMargin;
2401
2552
  }
2402
2553
  else if (position.overlayY === 'bottom') {
2403
2554
  // Overlay is opening "upward" and thus is bound by the top viewport edge. We need to add
@@ -2407,6 +2558,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2407
2558
  height = viewport.height - bottom + this._viewportMargin;
2408
2559
  }
2409
2560
  else {
2561
+ // If neither top nor bottom, it means that the overlay is vertically centered on the
2562
+ // origin point. Note that we want the position relative to the viewport, rather than
2563
+ // the page, which is why we don't use something like `viewport.bottom - origin.y` and
2564
+ // `origin.y - viewport.top`.
2410
2565
  /** @type {?} */
2411
2566
  var smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y + viewport.top, origin.y);
2412
2567
  /** @type {?} */
@@ -2417,9 +2572,11 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2417
2572
  top = origin.y - (previousHeight / 2);
2418
2573
  }
2419
2574
  }
2575
+ // The overlay is opening 'right-ward' (the content flows to the right).
2420
2576
  /** @type {?} */
2421
2577
  var isBoundedByRightViewportEdge = (position.overlayX === 'start' && !isRtl) ||
2422
2578
  (position.overlayX === 'end' && isRtl);
2579
+ // The overlay is opening 'left-ward' (the content flows to the left).
2423
2580
  /** @type {?} */
2424
2581
  var isBoundedByLeftViewportEdge = (position.overlayX === 'end' && !isRtl) ||
2425
2582
  (position.overlayX === 'start' && isRtl);
@@ -2438,6 +2595,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2438
2595
  width = viewport.right - origin.x;
2439
2596
  }
2440
2597
  else {
2598
+ // If neither start nor end, it means that the overlay is horizontally centered on the
2599
+ // origin point. Note that we want the position relative to the viewport, rather than
2600
+ // the page, which is why we don't use something like `viewport.right - origin.x` and
2601
+ // `origin.x - viewport.left`.
2441
2602
  /** @type {?} */
2442
2603
  var smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x + viewport.left, origin.x);
2443
2604
  /** @type {?} */
@@ -2448,12 +2609,20 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2448
2609
  left = origin.x - (previousWidth / 2);
2449
2610
  }
2450
2611
  }
2451
- return { top: /** @type {?} */ ((top)), left: /** @type {?} */ ((left)), bottom: /** @type {?} */ ((bottom)), right: /** @type {?} */ ((right)), width: width, height: height };
2612
+ return { top: (/** @type {?} */ (top)), left: (/** @type {?} */ (left)), bottom: (/** @type {?} */ (bottom)), right: (/** @type {?} */ (right)), width: width, height: height };
2452
2613
  };
2453
2614
  /**
2454
2615
  * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
2455
2616
  * origin's connection point and stetches to the bounds of the viewport.
2456
2617
  *
2618
+ * @param origin The point on the origin element where the overlay is connected.
2619
+ * @param position The position preference
2620
+ */
2621
+ /**
2622
+ * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
2623
+ * origin's connection point and stetches to the bounds of the viewport.
2624
+ *
2625
+ * @private
2457
2626
  * @param {?} origin The point on the origin element where the overlay is connected.
2458
2627
  * @param {?} position The position preference
2459
2628
  * @return {?}
@@ -2462,6 +2631,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2462
2631
  * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
2463
2632
  * origin's connection point and stetches to the bounds of the viewport.
2464
2633
  *
2634
+ * @private
2465
2635
  * @param {?} origin The point on the origin element where the overlay is connected.
2466
2636
  * @param {?} position The position preference
2467
2637
  * @return {?}
@@ -2476,7 +2646,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2476
2646
  boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);
2477
2647
  }
2478
2648
  /** @type {?} */
2479
- var styles = /** @type {?} */ ({});
2649
+ var styles = (/** @type {?} */ ({}));
2480
2650
  if (this._hasExactPosition()) {
2481
2651
  styles.top = styles.left = '0';
2482
2652
  styles.bottom = styles.right = '';
@@ -2514,18 +2684,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2514
2684
  }
2515
2685
  }
2516
2686
  this._lastBoundingBoxSize = boundingBoxRect;
2517
- extendStyles(/** @type {?} */ ((this._boundingBox)).style, styles);
2687
+ extendStyles((/** @type {?} */ (this._boundingBox)).style, styles);
2518
2688
  };
2689
+ /** Resets the styles for the bounding box so that a new positioning can be computed. */
2519
2690
  /**
2520
2691
  * Resets the styles for the bounding box so that a new positioning can be computed.
2692
+ * @private
2521
2693
  * @return {?}
2522
2694
  */
2523
2695
  FlexibleConnectedPositionStrategy.prototype._resetBoundingBoxStyles = /**
2524
2696
  * Resets the styles for the bounding box so that a new positioning can be computed.
2697
+ * @private
2525
2698
  * @return {?}
2526
2699
  */
2527
2700
  function () {
2528
- extendStyles(/** @type {?} */ ((this._boundingBox)).style, /** @type {?} */ ({
2701
+ extendStyles((/** @type {?} */ (this._boundingBox)).style, (/** @type {?} */ ({
2529
2702
  top: '0',
2530
2703
  left: '0',
2531
2704
  right: '0',
@@ -2534,40 +2707,47 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2534
2707
  width: '',
2535
2708
  alignItems: '',
2536
2709
  justifyContent: '',
2537
- }));
2710
+ })));
2538
2711
  };
2712
+ /** Resets the styles for the overlay pane so that a new positioning can be computed. */
2539
2713
  /**
2540
2714
  * Resets the styles for the overlay pane so that a new positioning can be computed.
2715
+ * @private
2541
2716
  * @return {?}
2542
2717
  */
2543
2718
  FlexibleConnectedPositionStrategy.prototype._resetOverlayElementStyles = /**
2544
2719
  * Resets the styles for the overlay pane so that a new positioning can be computed.
2720
+ * @private
2545
2721
  * @return {?}
2546
2722
  */
2547
2723
  function () {
2548
- extendStyles(this._pane.style, /** @type {?} */ ({
2724
+ extendStyles(this._pane.style, (/** @type {?} */ ({
2549
2725
  top: '',
2550
2726
  left: '',
2551
2727
  bottom: '',
2552
2728
  right: '',
2553
2729
  position: '',
2554
- }));
2730
+ transform: '',
2731
+ })));
2555
2732
  };
2733
+ /** Sets positioning styles to the overlay element. */
2556
2734
  /**
2557
2735
  * Sets positioning styles to the overlay element.
2736
+ * @private
2558
2737
  * @param {?} originPoint
2559
2738
  * @param {?} position
2560
2739
  * @return {?}
2561
2740
  */
2562
2741
  FlexibleConnectedPositionStrategy.prototype._setOverlayElementStyles = /**
2563
2742
  * Sets positioning styles to the overlay element.
2743
+ * @private
2564
2744
  * @param {?} originPoint
2565
2745
  * @param {?} position
2566
2746
  * @return {?}
2567
2747
  */
2568
2748
  function (originPoint, position) {
2569
2749
  /** @type {?} */
2570
- var styles = /** @type {?} */ ({});
2750
+ var styles = (/** @type {?} */ ({}));
2571
2751
  if (this._hasExactPosition()) {
2572
2752
  /** @type {?} */
2573
2753
  var scrollPosition = this._viewportRuler.getViewportScrollPosition();
@@ -2577,6 +2757,11 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2577
2757
  else {
2578
2758
  styles.position = 'static';
2579
2759
  }
2760
+ // Use a transform to apply the offsets. We do this because the `center` positions rely on
2761
+ // being in the normal flex flow and setting a `top` / `left` at all will completely throw
2762
+ // off the position. We also can't use margins, because they won't have an effect in some
2763
+ // cases where the element doesn't have anything to "push off of". Finally, this works
2764
+ // better both with flexible and non-flexible positioning.
2580
2765
  /** @type {?} */
2581
2766
  var transformString = '';
2582
2767
  /** @type {?} */
@@ -2601,8 +2786,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2601
2786
  }
2602
2787
  extendStyles(this._pane.style, styles);
2603
2788
  };
2789
+ /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */
2604
2790
  /**
2605
2791
  * Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing.
2792
+ * @private
2606
2793
  * @param {?} position
2607
2794
  * @param {?} originPoint
2608
2795
  * @param {?} scrollPosition
@@ -2610,19 +2797,25 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2610
2797
  */
2611
2798
  FlexibleConnectedPositionStrategy.prototype._getExactOverlayY = /**
2612
2799
  * Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing.
2800
+ * @private
2613
2801
  * @param {?} position
2614
2802
  * @param {?} originPoint
2615
2803
  * @param {?} scrollPosition
2616
2804
  * @return {?}
2617
2805
  */
2618
2806
  function (position, originPoint, scrollPosition) {
2807
+ // Reset any existing styles. This is necessary in case the
2808
+ // preferred position has changed since the last `apply`.
2619
2809
  /** @type {?} */
2620
- var styles = /** @type {?} */ ({ top: null, bottom: null });
2810
+ var styles = (/** @type {?} */ ({ top: null, bottom: null }));
2621
2811
  /** @type {?} */
2622
2812
  var overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2623
2813
  if (this._isPushed) {
2624
2814
  overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2625
2815
  }
2816
+ // @breaking-change 8.0.0 Currently the `_overlayContainer` is optional in order to avoid a
2817
+ // breaking change. The null check here can be removed once the `_overlayContainer` becomes
2818
+ // a required parameter.
2626
2819
  /** @type {?} */
2627
2820
  var virtualKeyboardOffset = this._overlayContainer ?
2628
2821
  this._overlayContainer.getContainerElement().getBoundingClientRect().top : 0;
@@ -2634,8 +2827,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2634
2827
  // We want to set either `top` or `bottom` based on whether the overlay wants to appear
2635
2828
  // above or below the origin and the direction in which the element will expand.
2636
2829
  if (position.overlayY === 'bottom') {
2830
+ // When using `bottom`, we adjust the y position such that it is the distance
2831
+ // from the bottom of the viewport rather than the top.
2637
2832
  /** @type {?} */
2638
- var documentHeight = /** @type {?} */ ((this._document.documentElement)).clientHeight;
2833
+ var documentHeight = (/** @type {?} */ (this._document.documentElement)).clientHeight;
2639
2834
  styles.bottom = documentHeight - (overlayPoint.y + this._overlayRect.height) + "px";
2640
2835
  }
2641
2836
  else {
@@ -2643,8 +2838,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2643
2838
  }
2644
2839
  return styles;
2645
2840
  };
2841
+ /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */
2646
2842
  /**
2647
2843
  * Gets the exact left/right for the overlay when not using flexible sizing or when pushing.
2844
+ * @private
2648
2845
  * @param {?} position
2649
2846
  * @param {?} originPoint
2650
2847
  * @param {?} scrollPosition
@@ -2652,19 +2849,26 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2652
2849
  */
2653
2850
  FlexibleConnectedPositionStrategy.prototype._getExactOverlayX = /**
2654
2851
  * Gets the exact left/right for the overlay when not using flexible sizing or when pushing.
2852
+ * @private
2655
2853
  * @param {?} position
2656
2854
  * @param {?} originPoint
2657
2855
  * @param {?} scrollPosition
2658
2856
  * @return {?}
2659
2857
  */
2660
2858
  function (position, originPoint, scrollPosition) {
2859
+ // Reset any existing styles. This is necessary in case the preferred position has
2860
+ // changed since the last `apply`.
2661
2861
  /** @type {?} */
2662
- var styles = /** @type {?} */ ({ left: null, right: null });
2862
+ var styles = (/** @type {?} */ ({ left: null, right: null }));
2663
2863
  /** @type {?} */
2664
2864
  var overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2665
2865
  if (this._isPushed) {
2666
2866
  overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2667
2867
  }
2868
+ // We want to set either `left` or `right` based on whether the overlay wants to appear "before"
2869
+ // or "after" the origin, which determines the direction in which the element will expand.
2870
+ // For the horizontal axis, the meaning of "before" and "after" change based on whether the
2871
+ // page is in RTL or LTR.
2668
2872
  /** @type {?} */
2669
2873
  var horizontalStyleProperty;
2670
2874
  if (this._isRtl()) {
@@ -2677,7 +2881,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2677
2881
  // from the right edge of the viewport rather than the left edge.
2678
2882
  if (horizontalStyleProperty === 'right') {
2679
2883
  /** @type {?} */
2680
- var documentWidth = /** @type {?} */ ((this._document.documentElement)).clientWidth;
2884
+ var documentWidth = (/** @type {?} */ (this._document.documentElement)).clientWidth;
2681
2885
  styles.right = documentWidth - (overlayPoint.x + this._overlayRect.width) + "px";
2682
2886
  }
2683
2887
  else {
@@ -2688,18 +2892,28 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2688
2892
  /**
2689
2893
  * Gets the view properties of the trigger and overlay, including whether they are clipped
2690
2894
  * or completely outside the view of any of the strategy's scrollables.
2895
+ */
2896
+ /**
2897
+ * Gets the view properties of the trigger and overlay, including whether they are clipped
2898
+ * or completely outside the view of any of the strategy's scrollables.
2899
+ * @private
2691
2900
  * @return {?}
2692
2901
  */
2693
2902
  FlexibleConnectedPositionStrategy.prototype._getScrollVisibility = /**
2694
2903
  * Gets the view properties of the trigger and overlay, including whether they are clipped
2695
2904
  * or completely outside the view of any of the strategy's scrollables.
2905
+ * @private
2696
2906
  * @return {?}
2697
2907
  */
2698
2908
  function () {
2909
+ // Note: needs fresh rects since the position could've changed.
2699
2910
  /** @type {?} */
2700
2911
  var originBounds = this._origin.getBoundingClientRect();
2701
2912
  /** @type {?} */
2702
2913
  var overlayBounds = this._pane.getBoundingClientRect();
2914
+ // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers
2915
+ // every time, we should be able to use the scrollTop of the containers if the size of those
2916
+ // containers hasn't changed.
2703
2917
  /** @type {?} */
2704
2918
  var scrollContainerBounds = this.scrollables.map(function (scrollable) {
2705
2919
  return scrollable.getElementRef().nativeElement.getBoundingClientRect();
@@ -2711,14 +2925,17 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2711
2925
  isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds),
2712
2926
  };
2713
2927
  };
2928
+ /** Subtracts the amount that an element is overflowing on an axis from it's length. */
2714
2929
  /**
2715
2930
  * Subtracts the amount that an element is overflowing on an axis from it's length.
2931
+ * @private
2716
2932
  * @param {?} length
2717
2933
  * @param {...?} overflows
2718
2934
  * @return {?}
2719
2935
  */
2720
2936
  FlexibleConnectedPositionStrategy.prototype._subtractOverflows = /**
2721
2937
  * Subtracts the amount that an element is overflowing on an axis from it's length.
2938
+ * @private
2722
2939
  * @param {?} length
2723
2940
  * @param {...?} overflows
2724
2941
  * @return {?}
@@ -2732,19 +2949,27 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2732
2949
  return currentValue - Math.max(currentOverflow, 0);
2733
2950
  }, length);
2734
2951
  };
2952
+ /** Narrows the given viewport rect by the current _viewportMargin. */
2735
2953
  /**
2736
2954
  * Narrows the given viewport rect by the current _viewportMargin.
2955
+ * @private
2737
2956
  * @return {?}
2738
2957
  */
2739
2958
  FlexibleConnectedPositionStrategy.prototype._getNarrowedViewportRect = /**
2740
2959
  * Narrows the given viewport rect by the current _viewportMargin.
2960
+ * @private
2741
2961
  * @return {?}
2742
2962
  */
2743
2963
  function () {
2964
+ // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,
2965
+ // because we want to use the `clientWidth` and `clientHeight` as the base. The difference
2966
+ // being that the client properties don't include the scrollbar, as opposed to `innerWidth`
2967
+ // and `innerHeight` that do. This is necessary, because the overlay container uses
2968
+ // 100% `width` and `height` which don't include the scrollbar either.
2744
2969
  /** @type {?} */
2745
- var width = /** @type {?} */ ((this._document.documentElement)).clientWidth;
2970
+ var width = (/** @type {?} */ (this._document.documentElement)).clientWidth;
2746
2971
  /** @type {?} */
2747
- var height = /** @type {?} */ ((this._document.documentElement)).clientHeight;
2972
+ var height = (/** @type {?} */ (this._document.documentElement)).clientHeight;
2748
2973
  /** @type {?} */
2749
2974
  var scrollPosition = this._viewportRuler.getViewportScrollPosition();
2750
2975
  return {
@@ -2756,36 +2981,45 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2756
2981
  height: height - (2 * this._viewportMargin),
2757
2982
  };
2758
2983
  };
2984
+ /** Whether the we're dealing with an RTL context */
2759
2985
  /**
2760
2986
  * Whether the we're dealing with an RTL context
2987
+ * @private
2761
2988
  * @return {?}
2762
2989
  */
2763
2990
  FlexibleConnectedPositionStrategy.prototype._isRtl = /**
2764
2991
  * Whether the we're dealing with an RTL context
2992
+ * @private
2765
2993
  * @return {?}
2766
2994
  */
2767
2995
  function () {
2768
2996
  return this._overlayRef.getDirection() === 'rtl';
2769
2997
  };
2998
+ /** Determines whether the overlay uses exact or flexible positioning. */
2770
2999
  /**
2771
3000
  * Determines whether the overlay uses exact or flexible positioning.
3001
+ * @private
2772
3002
  * @return {?}
2773
3003
  */
2774
3004
  FlexibleConnectedPositionStrategy.prototype._hasExactPosition = /**
2775
3005
  * Determines whether the overlay uses exact or flexible positioning.
3006
+ * @private
2776
3007
  * @return {?}
2777
3008
  */
2778
3009
  function () {
2779
3010
  return !this._hasFlexibleDimensions || this._isPushed;
2780
3011
  };
3012
+ /** Retrieves the offset of a position along the x or y axis. */
2781
3013
  /**
2782
3014
  * Retrieves the offset of a position along the x or y axis.
3015
+ * @private
2783
3016
  * @param {?} position
2784
3017
  * @param {?} axis
2785
3018
  * @return {?}
2786
3019
  */
2787
3020
  FlexibleConnectedPositionStrategy.prototype._getOffset = /**
2788
3021
  * Retrieves the offset of a position along the x or y axis.
3022
+ * @private
2789
3023
  * @param {?} position
2790
3024
  * @param {?} axis
2791
3025
  * @return {?}
@@ -2798,12 +3032,15 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2798
3032
  }
2799
3033
  return position.offsetY == null ? this._offsetY : position.offsetY;
2800
3034
  };
3035
+ /** Validates that the current position match the expected values. */
2801
3036
  /**
2802
3037
  * Validates that the current position match the expected values.
3038
+ * @private
2803
3039
  * @return {?}
2804
3040
  */
2805
3041
  FlexibleConnectedPositionStrategy.prototype._validatePositions = /**
2806
3042
  * Validates that the current position match the expected values.
3043
+ * @private
2807
3044
  * @return {?}
2808
3045
  */
2809
3046
  function () {
@@ -2819,13 +3056,16 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2819
3056
  validateVerticalPosition('overlayY', pair.overlayY);
2820
3057
  });
2821
3058
  };
3059
+ /** Adds a single CSS class or an array of classes on the overlay panel. */
2822
3060
  /**
2823
3061
  * Adds a single CSS class or an array of classes on the overlay panel.
3062
+ * @private
2824
3063
  * @param {?} cssClasses
2825
3064
  * @return {?}
2826
3065
  */
2827
3066
  FlexibleConnectedPositionStrategy.prototype._addPanelClasses = /**
2828
3067
  * Adds a single CSS class or an array of classes on the overlay panel.
3068
+ * @private
2829
3069
  * @param {?} cssClasses
2830
3070
  * @return {?}
2831
3071
  */
@@ -2840,12 +3080,15 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2840
3080
  });
2841
3081
  }
2842
3082
  };
3083
+ /** Clears the classes that the position strategy has applied from the overlay panel. */
2843
3084
  /**
2844
3085
  * Clears the classes that the position strategy has applied from the overlay panel.
3086
+ * @private
2845
3087
  * @return {?}
2846
3088
  */
2847
3089
  FlexibleConnectedPositionStrategy.prototype._clearPanelClasses = /**
2848
3090
  * Clears the classes that the position strategy has applied from the overlay panel.
3091
+ * @private
2849
3092
  * @return {?}
2850
3093
  */
2851
3094
  function () {
@@ -2874,7 +3117,7 @@ function extendStyles(dest, source) {
2874
3117
 
2875
3118
  /**
2876
3119
  * @fileoverview added by tsickle
2877
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3120
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2878
3121
  */
2879
3122
  /**
2880
3123
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -3061,26 +3304,30 @@ ConnectedPositionStrategy = /** @class */ (function () {
3061
3304
  */
3062
3305
  /**
3063
3306
  * Adds a new preferred fallback position.
3307
+ * @template THIS
3308
+ * @this {THIS}
3064
3309
  * @param {?} originPos
3065
3310
  * @param {?} overlayPos
3066
3311
  * @param {?=} offsetX
3067
3312
  * @param {?=} offsetY
3068
- * @return {?}
3313
+ * @return {THIS}
3069
3314
  */
3070
3315
  ConnectedPositionStrategy.prototype.withFallbackPosition = /**
3071
3316
  * Adds a new preferred fallback position.
3317
+ * @template THIS
3318
+ * @this {THIS}
3072
3319
  * @param {?} originPos
3073
3320
  * @param {?} overlayPos
3074
3321
  * @param {?=} offsetX
3075
3322
  * @param {?=} offsetY
3076
- * @return {?}
3323
+ * @return {THIS}
3077
3324
  */
3078
3325
  function (originPos, overlayPos, offsetX, offsetY) {
3079
3326
  /** @type {?} */
3080
3327
  var position = new ConnectionPositionPair(originPos, overlayPos, offsetX, offsetY);
3081
- this._preferredPositions.push(position);
3082
- this._positionStrategy.withPositions(this._preferredPositions);
3083
- return this;
3328
+ (/** @type {?} */ (this))._preferredPositions.push(position);
3329
+ (/** @type {?} */ (this))._positionStrategy.withPositions((/** @type {?} */ (this))._preferredPositions);
3330
+ return (/** @type {?} */ (this));
3084
3331
  };
3085
3332
  /**
3086
3333
  * Sets the layout direction so the overlay's position can be adjusted to match.
@@ -3088,25 +3335,29 @@ ConnectedPositionStrategy = /** @class */ (function () {
3088
3335
  */
3089
3336
  /**
3090
3337
  * Sets the layout direction so the overlay's position can be adjusted to match.
3338
+ * @template THIS
3339
+ * @this {THIS}
3091
3340
  * @param {?} dir New layout direction.
3092
- * @return {?}
3341
+ * @return {THIS}
3093
3342
  */
3094
3343
  ConnectedPositionStrategy.prototype.withDirection = /**
3095
3344
  * Sets the layout direction so the overlay's position can be adjusted to match.
3345
+ * @template THIS
3346
+ * @this {THIS}
3096
3347
  * @param {?} dir New layout direction.
3097
- * @return {?}
3348
+ * @return {THIS}
3098
3349
  */
3099
3350
  function (dir) {
3100
3351
  // Since the direction might be declared before the strategy is attached,
3101
3352
  // we save the value in a temporary property and we'll transfer it to the
3102
3353
  // overlay ref on attachment.
3103
- if (this._overlayRef) {
3104
- this._overlayRef.setDirection(dir);
3354
+ if ((/** @type {?} */ (this))._overlayRef) {
3355
+ (/** @type {?} */ (this))._overlayRef.setDirection(dir);
3105
3356
  }
3106
3357
  else {
3107
- this._direction = dir;
3358
+ (/** @type {?} */ (this))._direction = dir;
3108
3359
  }
3109
- return this;
3360
+ return (/** @type {?} */ (this));
3110
3361
  };
3111
3362
  /**
3112
3363
  * Sets an offset for the overlay's connection point on the x-axis
@@ -3114,17 +3365,21 @@ ConnectedPositionStrategy = /** @class */ (function () {
3114
3365
  */
3115
3366
  /**
3116
3367
  * Sets an offset for the overlay's connection point on the x-axis
3368
+ * @template THIS
3369
+ * @this {THIS}
3117
3370
  * @param {?} offset New offset in the X axis.
3118
- * @return {?}
3371
+ * @return {THIS}
3119
3372
  */
3120
3373
  ConnectedPositionStrategy.prototype.withOffsetX = /**
3121
3374
  * Sets an offset for the overlay's connection point on the x-axis
3375
+ * @template THIS
3376
+ * @this {THIS}
3122
3377
  * @param {?} offset New offset in the X axis.
3123
- * @return {?}
3378
+ * @return {THIS}
3124
3379
  */
3125
3380
  function (offset) {
3126
- this._positionStrategy.withDefaultOffsetX(offset);
3127
- return this;
3381
+ (/** @type {?} */ (this))._positionStrategy.withDefaultOffsetX(offset);
3382
+ return (/** @type {?} */ (this));
3128
3383
  };
3129
3384
  /**
3130
3385
  * Sets an offset for the overlay's connection point on the y-axis
@@ -3132,17 +3387,21 @@ ConnectedPositionStrategy = /** @class */ (function () {
3132
3387
  */
3133
3388
  /**
3134
3389
  * Sets an offset for the overlay's connection point on the y-axis
3390
+ * @template THIS
3391
+ * @this {THIS}
3135
3392
  * @param {?} offset New offset in the Y axis.
3136
- * @return {?}
3393
+ * @return {THIS}
3137
3394
  */
3138
3395
  ConnectedPositionStrategy.prototype.withOffsetY = /**
3139
3396
  * Sets an offset for the overlay's connection point on the y-axis
3397
+ * @template THIS
3398
+ * @this {THIS}
3140
3399
  * @param {?} offset New offset in the Y axis.
3141
- * @return {?}
3400
+ * @return {THIS}
3142
3401
  */
3143
3402
  function (offset) {
3144
- this._positionStrategy.withDefaultOffsetY(offset);
3145
- return this;
3403
+ (/** @type {?} */ (this))._positionStrategy.withDefaultOffsetY(offset);
3404
+ return (/** @type {?} */ (this));
3146
3405
  };
3147
3406
  /**
3148
3407
  * Sets whether the overlay's position should be locked in after it is positioned
@@ -3154,19 +3413,23 @@ ConnectedPositionStrategy = /** @class */ (function () {
3154
3413
  * Sets whether the overlay's position should be locked in after it is positioned
3155
3414
  * initially. When an overlay is locked in, it won't attempt to reposition itself
3156
3415
  * when the position is re-applied (e.g. when the user scrolls away).
3416
+ * @template THIS
3417
+ * @this {THIS}
3157
3418
  * @param {?} isLocked Whether the overlay should locked in.
3158
- * @return {?}
3419
+ * @return {THIS}
3159
3420
  */
3160
3421
  ConnectedPositionStrategy.prototype.withLockedPosition = /**
3161
3422
  * Sets whether the overlay's position should be locked in after it is positioned
3162
3423
  * initially. When an overlay is locked in, it won't attempt to reposition itself
3163
3424
  * when the position is re-applied (e.g. when the user scrolls away).
3425
+ * @template THIS
3426
+ * @this {THIS}
3164
3427
  * @param {?} isLocked Whether the overlay should locked in.
3165
- * @return {?}
3428
+ * @return {THIS}
3166
3429
  */
3167
3430
  function (isLocked) {
3168
- this._positionStrategy.withLockedPosition(isLocked);
3169
- return this;
3431
+ (/** @type {?} */ (this))._positionStrategy.withLockedPosition(isLocked);
3432
+ return (/** @type {?} */ (this));
3170
3433
  };
3171
3434
  /**
3172
3435
  * Overwrites the current set of positions with an array of new ones.
@@ -3174,18 +3437,22 @@ ConnectedPositionStrategy = /** @class */ (function () {
3174
3437
  */
3175
3438
  /**
3176
3439
  * Overwrites the current set of positions with an array of new ones.
3440
+ * @template THIS
3441
+ * @this {THIS}
3177
3442
  * @param {?} positions Position pairs to be set on the strategy.
3178
- * @return {?}
3443
+ * @return {THIS}
3179
3444
  */
3180
3445
  ConnectedPositionStrategy.prototype.withPositions = /**
3181
3446
  * Overwrites the current set of positions with an array of new ones.
3447
+ * @template THIS
3448
+ * @this {THIS}
3182
3449
  * @param {?} positions Position pairs to be set on the strategy.
3183
- * @return {?}
3450
+ * @return {THIS}
3184
3451
  */
3185
3452
  function (positions) {
3186
- this._preferredPositions = positions.slice();
3187
- this._positionStrategy.withPositions(this._preferredPositions);
3188
- return this;
3453
+ (/** @type {?} */ (this))._preferredPositions = positions.slice();
3454
+ (/** @type {?} */ (this))._positionStrategy.withPositions((/** @type {?} */ (this))._preferredPositions);
3455
+ return (/** @type {?} */ (this));
3189
3456
  };
3190
3457
  /**
3191
3458
  * Sets the origin element, relative to which to position the overlay.
@@ -3193,29 +3460,34 @@ ConnectedPositionStrategy = /** @class */ (function () {
3193
3460
  */
3194
3461
  /**
3195
3462
  * Sets the origin element, relative to which to position the overlay.
3463
+ * @template THIS
3464
+ * @this {THIS}
3196
3465
  * @param {?} origin Reference to the new origin element.
3197
- * @return {?}
3466
+ * @return {THIS}
3198
3467
  */
3199
3468
  ConnectedPositionStrategy.prototype.setOrigin = /**
3200
3469
  * Sets the origin element, relative to which to position the overlay.
3470
+ * @template THIS
3471
+ * @this {THIS}
3201
3472
  * @param {?} origin Reference to the new origin element.
3202
- * @return {?}
3473
+ * @return {THIS}
3203
3474
  */
3204
3475
  function (origin) {
3205
- this._positionStrategy.setOrigin(origin);
3206
- return this;
3476
+ (/** @type {?} */ (this))._positionStrategy.setOrigin(origin);
3477
+ return (/** @type {?} */ (this));
3207
3478
  };
3208
3479
  return ConnectedPositionStrategy;
3209
3480
  }());
3210
3481
 
3211
3482
  /**
3212
3483
  * @fileoverview added by tsickle
3213
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3484
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3214
3485
  */
3215
3486
 
3216
- /** *
3487
+ /**
3217
3488
  * Class to be added to the overlay pane wrapper.
3218
- @type {?} */
3489
+ * @type {?}
3490
+ */
3219
3491
  var wrapperClass = 'cdk-global-overlay-wrapper';
3220
3492
  /**
3221
3493
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -3268,20 +3540,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3268
3540
  */
3269
3541
  /**
3270
3542
  * Sets the top position of the overlay. Clears any previously set vertical position.
3543
+ * @template THIS
3544
+ * @this {THIS}
3271
3545
  * @param {?=} value New top offset.
3272
- * @return {?}
3546
+ * @return {THIS}
3273
3547
  */
3274
3548
  GlobalPositionStrategy.prototype.top = /**
3275
3549
  * Sets the top position of the overlay. Clears any previously set vertical position.
3550
+ * @template THIS
3551
+ * @this {THIS}
3276
3552
  * @param {?=} value New top offset.
3277
- * @return {?}
3553
+ * @return {THIS}
3278
3554
  */
3279
3555
  function (value) {
3280
3556
  if (value === void 0) { value = ''; }
3281
- this._bottomOffset = '';
3282
- this._topOffset = value;
3283
- this._alignItems = 'flex-start';
3284
- return this;
3557
+ (/** @type {?} */ (this))._bottomOffset = '';
3558
+ (/** @type {?} */ (this))._topOffset = value;
3559
+ (/** @type {?} */ (this))._alignItems = 'flex-start';
3560
+ return (/** @type {?} */ (this));
3285
3561
  };
3286
3562
  /**
3287
3563
  * Sets the left position of the overlay. Clears any previously set horizontal position.
@@ -3289,20 +3565,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3289
3565
  */
3290
3566
  /**
3291
3567
  * Sets the left position of the overlay. Clears any previously set horizontal position.
3568
+ * @template THIS
3569
+ * @this {THIS}
3292
3570
  * @param {?=} value New left offset.
3293
- * @return {?}
3571
+ * @return {THIS}
3294
3572
  */
3295
3573
  GlobalPositionStrategy.prototype.left = /**
3296
3574
  * Sets the left position of the overlay. Clears any previously set horizontal position.
3575
+ * @template THIS
3576
+ * @this {THIS}
3297
3577
  * @param {?=} value New left offset.
3298
- * @return {?}
3578
+ * @return {THIS}
3299
3579
  */
3300
3580
  function (value) {
3301
3581
  if (value === void 0) { value = ''; }
3302
- this._rightOffset = '';
3303
- this._leftOffset = value;
3304
- this._justifyContent = 'flex-start';
3305
- return this;
3582
+ (/** @type {?} */ (this))._rightOffset = '';
3583
+ (/** @type {?} */ (this))._leftOffset = value;
3584
+ (/** @type {?} */ (this))._justifyContent = 'flex-start';
3585
+ return (/** @type {?} */ (this));
3306
3586
  };
3307
3587
  /**
3308
3588
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
@@ -3310,20 +3590,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3310
3590
  */
3311
3591
  /**
3312
3592
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
3593
+ * @template THIS
3594
+ * @this {THIS}
3313
3595
  * @param {?=} value New bottom offset.
3314
- * @return {?}
3596
+ * @return {THIS}
3315
3597
  */
3316
3598
  GlobalPositionStrategy.prototype.bottom = /**
3317
3599
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
3600
+ * @template THIS
3601
+ * @this {THIS}
3318
3602
  * @param {?=} value New bottom offset.
3319
- * @return {?}
3603
+ * @return {THIS}
3320
3604
  */
3321
3605
  function (value) {
3322
3606
  if (value === void 0) { value = ''; }
3323
- this._topOffset = '';
3324
- this._bottomOffset = value;
3325
- this._alignItems = 'flex-end';
3326
- return this;
3607
+ (/** @type {?} */ (this))._topOffset = '';
3608
+ (/** @type {?} */ (this))._bottomOffset = value;
3609
+ (/** @type {?} */ (this))._alignItems = 'flex-end';
3610
+ return (/** @type {?} */ (this));
3327
3611
  };
3328
3612
  /**
3329
3613
  * Sets the right position of the overlay. Clears any previously set horizontal position.
@@ -3331,20 +3615,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3331
3615
  */
3332
3616
  /**
3333
3617
  * Sets the right position of the overlay. Clears any previously set horizontal position.
3618
+ * @template THIS
3619
+ * @this {THIS}
3334
3620
  * @param {?=} value New right offset.
3335
- * @return {?}
3621
+ * @return {THIS}
3336
3622
  */
3337
3623
  GlobalPositionStrategy.prototype.right = /**
3338
3624
  * Sets the right position of the overlay. Clears any previously set horizontal position.
3625
+ * @template THIS
3626
+ * @this {THIS}
3339
3627
  * @param {?=} value New right offset.
3340
- * @return {?}
3628
+ * @return {THIS}
3341
3629
  */
3342
3630
  function (value) {
3343
3631
  if (value === void 0) { value = ''; }
3344
- this._leftOffset = '';
3345
- this._rightOffset = value;
3346
- this._justifyContent = 'flex-end';
3347
- return this;
3632
+ (/** @type {?} */ (this))._leftOffset = '';
3633
+ (/** @type {?} */ (this))._rightOffset = value;
3634
+ (/** @type {?} */ (this))._justifyContent = 'flex-end';
3635
+ return (/** @type {?} */ (this));
3348
3636
  };
3349
3637
  /**
3350
3638
  * Sets the overlay width and clears any previously set width.
@@ -3356,25 +3644,29 @@ GlobalPositionStrategy = /** @class */ (function () {
3356
3644
  * Sets the overlay width and clears any previously set width.
3357
3645
  * @deprecated Pass the `width` through the `OverlayConfig`.
3358
3646
  * \@breaking-change 8.0.0
3647
+ * @template THIS
3648
+ * @this {THIS}
3359
3649
  * @param {?=} value New width for the overlay
3360
- * @return {?}
3650
+ * @return {THIS}
3361
3651
  */
3362
3652
  GlobalPositionStrategy.prototype.width = /**
3363
3653
  * Sets the overlay width and clears any previously set width.
3364
3654
  * @deprecated Pass the `width` through the `OverlayConfig`.
3365
3655
  * \@breaking-change 8.0.0
3656
+ * @template THIS
3657
+ * @this {THIS}
3366
3658
  * @param {?=} value New width for the overlay
3367
- * @return {?}
3659
+ * @return {THIS}
3368
3660
  */
3369
3661
  function (value) {
3370
3662
  if (value === void 0) { value = ''; }
3371
- if (this._overlayRef) {
3372
- this._overlayRef.updateSize({ width: value });
3663
+ if ((/** @type {?} */ (this))._overlayRef) {
3664
+ (/** @type {?} */ (this))._overlayRef.updateSize({ width: value });
3373
3665
  }
3374
3666
  else {
3375
- this._width = value;
3667
+ (/** @type {?} */ (this))._width = value;
3376
3668
  }
3377
- return this;
3669
+ return (/** @type {?} */ (this));
3378
3670
  };
3379
3671
  /**
3380
3672
  * Sets the overlay height and clears any previously set height.
@@ -3386,25 +3678,29 @@ GlobalPositionStrategy = /** @class */ (function () {
3386
3678
  * Sets the overlay height and clears any previously set height.
3387
3679
  * @deprecated Pass the `height` through the `OverlayConfig`.
3388
3680
  * \@breaking-change 8.0.0
3681
+ * @template THIS
3682
+ * @this {THIS}
3389
3683
  * @param {?=} value New height for the overlay
3390
- * @return {?}
3684
+ * @return {THIS}
3391
3685
  */
3392
3686
  GlobalPositionStrategy.prototype.height = /**
3393
3687
  * Sets the overlay height and clears any previously set height.
3394
3688
  * @deprecated Pass the `height` through the `OverlayConfig`.
3395
3689
  * \@breaking-change 8.0.0
3690
+ * @template THIS
3691
+ * @this {THIS}
3396
3692
  * @param {?=} value New height for the overlay
3397
- * @return {?}
3693
+ * @return {THIS}
3398
3694
  */
3399
3695
  function (value) {
3400
3696
  if (value === void 0) { value = ''; }
3401
- if (this._overlayRef) {
3402
- this._overlayRef.updateSize({ height: value });
3697
+ if ((/** @type {?} */ (this))._overlayRef) {
3698
+ (/** @type {?} */ (this))._overlayRef.updateSize({ height: value });
3403
3699
  }
3404
3700
  else {
3405
- this._height = value;
3701
+ (/** @type {?} */ (this))._height = value;
3406
3702
  }
3407
- return this;
3703
+ return (/** @type {?} */ (this));
3408
3704
  };
3409
3705
  /**
3410
3706
  * Centers the overlay horizontally with an optional offset.
@@ -3416,21 +3712,25 @@ GlobalPositionStrategy = /** @class */ (function () {
3416
3712
  * Centers the overlay horizontally with an optional offset.
3417
3713
  * Clears any previously set horizontal position.
3418
3714
  *
3715
+ * @template THIS
3716
+ * @this {THIS}
3419
3717
  * @param {?=} offset Overlay offset from the horizontal center.
3420
- * @return {?}
3718
+ * @return {THIS}
3421
3719
  */
3422
3720
  GlobalPositionStrategy.prototype.centerHorizontally = /**
3423
3721
  * Centers the overlay horizontally with an optional offset.
3424
3722
  * Clears any previously set horizontal position.
3425
3723
  *
3724
+ * @template THIS
3725
+ * @this {THIS}
3426
3726
  * @param {?=} offset Overlay offset from the horizontal center.
3427
- * @return {?}
3727
+ * @return {THIS}
3428
3728
  */
3429
3729
  function (offset) {
3430
3730
  if (offset === void 0) { offset = ''; }
3431
- this.left(offset);
3432
- this._justifyContent = 'center';
3433
- return this;
3731
+ (/** @type {?} */ (this)).left(offset);
3732
+ (/** @type {?} */ (this))._justifyContent = 'center';
3733
+ return (/** @type {?} */ (this));
3434
3734
  };
3435
3735
  /**
3436
3736
  * Centers the overlay vertically with an optional offset.
@@ -3442,21 +3742,25 @@ GlobalPositionStrategy = /** @class */ (function () {
3442
3742
  * Centers the overlay vertically with an optional offset.
3443
3743
  * Clears any previously set vertical position.
3444
3744
  *
3745
+ * @template THIS
3746
+ * @this {THIS}
3445
3747
  * @param {?=} offset Overlay offset from the vertical center.
3446
- * @return {?}
3748
+ * @return {THIS}
3447
3749
  */
3448
3750
  GlobalPositionStrategy.prototype.centerVertically = /**
3449
3751
  * Centers the overlay vertically with an optional offset.
3450
3752
  * Clears any previously set vertical position.
3451
3753
  *
3754
+ * @template THIS
3755
+ * @this {THIS}
3452
3756
  * @param {?=} offset Overlay offset from the vertical center.
3453
- * @return {?}
3757
+ * @return {THIS}
3454
3758
  */
3455
3759
  function (offset) {
3456
3760
  if (offset === void 0) { offset = ''; }
3457
- this.top(offset);
3458
- this._alignItems = 'center';
3459
- return this;
3761
+ (/** @type {?} */ (this)).top(offset);
3762
+ (/** @type {?} */ (this))._alignItems = 'center';
3763
+ return (/** @type {?} */ (this));
3460
3764
  };
3461
3765
  /**
3462
3766
  * Apply the position to the element.
@@ -3540,7 +3844,7 @@ GlobalPositionStrategy = /** @class */ (function () {
3540
3844
  parent.classList.remove(wrapperClass);
3541
3845
  parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop =
3542
3846
  styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';
3543
- this._overlayRef = /** @type {?} */ ((null));
3847
+ this._overlayRef = (/** @type {?} */ (null));
3544
3848
  this._isDisposed = true;
3545
3849
  };
3546
3850
  return GlobalPositionStrategy;
@@ -3548,15 +3852,13 @@ GlobalPositionStrategy = /** @class */ (function () {
3548
3852
 
3549
3853
  /**
3550
3854
  * @fileoverview added by tsickle
3551
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3855
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3552
3856
  */
3553
3857
  /**
3554
3858
  * Builder for overlay position strategy.
3555
3859
  */
3556
3860
  var OverlayPositionBuilder = /** @class */ (function () {
3557
- function OverlayPositionBuilder(_viewportRuler, _document,
3558
- // @breaking-change 8.0.0 `_platform` and `_overlayContainer` parameters to be made required.
3559
- _platform, _overlayContainer) {
3861
+ function OverlayPositionBuilder(_viewportRuler, _document, _platform, _overlayContainer) {
3560
3862
  this._viewportRuler = _viewportRuler;
3561
3863
  this._document = _document;
3562
3864
  this._platform = _platform;
@@ -3638,12 +3940,15 @@ var OverlayPositionBuilder = /** @class */ (function () {
3638
3940
 
3639
3941
  /**
3640
3942
  * @fileoverview added by tsickle
3641
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3943
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3642
3944
  */
3643
- /** *
3945
+ /**
3644
3946
  * Next overlay unique ID.
3645
- @type {?} */
3947
+ * @type {?}
3948
+ */
3646
3949
  var nextUniqueId = 0;
3950
+ // Note that Overlay is *not* scoped to the app root because the ComponentFactoryResolver
3951
+ // it needs is different based on where OverlayModule is imported.
3647
3952
  /**
3648
3953
  * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
3649
3954
  * used as a low-level building block for other components. Dialogs, tooltips, menus,
@@ -3653,9 +3958,7 @@ var nextUniqueId = 0;
3653
3958
  * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.
3654
3959
  */
3655
3960
  var Overlay = /** @class */ (function () {
3656
- function Overlay(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality,
3657
- // @breaking-change 8.0.0 `_location` parameter to be made required.
3658
- _location) {
3961
+ function Overlay(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location) {
3659
3962
  this.scrollStrategies = scrollStrategies;
3660
3963
  this._overlayContainer = _overlayContainer;
3661
3964
  this._componentFactoryResolver = _componentFactoryResolver;
@@ -3714,11 +4017,17 @@ var Overlay = /** @class */ (function () {
3714
4017
  };
3715
4018
  /**
3716
4019
  * Creates the DOM element for an overlay and appends it to the overlay container.
4020
+ * @returns Newly-created pane element
4021
+ */
4022
+ /**
4023
+ * Creates the DOM element for an overlay and appends it to the overlay container.
4024
+ * @private
3717
4025
  * @param {?} host
3718
4026
  * @return {?} Newly-created pane element
3719
4027
  */
3720
4028
  Overlay.prototype._createPaneElement = /**
3721
4029
  * Creates the DOM element for an overlay and appends it to the overlay container.
4030
+ * @private
3722
4031
  * @param {?} host
3723
4032
  * @return {?} Newly-created pane element
3724
4033
  */
@@ -3733,11 +4042,18 @@ var Overlay = /** @class */ (function () {
3733
4042
  /**
3734
4043
  * Creates the host element that wraps around an overlay
3735
4044
  * and can be used for advanced positioning.
4045
+ * @returns Newly-create host element.
4046
+ */
4047
+ /**
4048
+ * Creates the host element that wraps around an overlay
4049
+ * and can be used for advanced positioning.
4050
+ * @private
3736
4051
  * @return {?} Newly-create host element.
3737
4052
  */
3738
4053
  Overlay.prototype._createHostElement = /**
3739
4054
  * Creates the host element that wraps around an overlay
3740
4055
  * and can be used for advanced positioning.
4056
+ * @private
3741
4057
  * @return {?} Newly-create host element.
3742
4058
  */
3743
4059
  function () {
@@ -3748,11 +4064,18 @@ var Overlay = /** @class */ (function () {
3748
4064
  };
3749
4065
  /**
3750
4066
  * Create a DomPortalOutlet into which the overlay content can be loaded.
4067
+ * @param pane The DOM element to turn into a portal outlet.
4068
+ * @returns A portal outlet for the given DOM element.
4069
+ */
4070
+ /**
4071
+ * Create a DomPortalOutlet into which the overlay content can be loaded.
4072
+ * @private
3751
4073
  * @param {?} pane The DOM element to turn into a portal outlet.
3752
4074
  * @return {?} A portal outlet for the given DOM element.
3753
4075
  */
3754
4076
  Overlay.prototype._createPortalOutlet = /**
3755
4077
  * Create a DomPortalOutlet into which the overlay content can be loaded.
4078
+ * @private
3756
4079
  * @param {?} pane The DOM element to turn into a portal outlet.
3757
4080
  * @return {?} A portal outlet for the given DOM element.
3758
4081
  */
@@ -3785,11 +4108,12 @@ var Overlay = /** @class */ (function () {
3785
4108
 
3786
4109
  /**
3787
4110
  * @fileoverview added by tsickle
3788
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4111
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3789
4112
  */
3790
- /** *
4113
+ /**
3791
4114
  * Default set of positions for the overlay. Follows the behavior of a dropdown.
3792
- @type {?} */
4115
+ * @type {?}
4116
+ */
3793
4117
  var defaultPositionList = [
3794
4118
  {
3795
4119
  originX: 'start',
@@ -3816,9 +4140,10 @@ var defaultPositionList = [
3816
4140
  overlayY: 'top'
3817
4141
  }
3818
4142
  ];
3819
- /** *
4143
+ /**
3820
4144
  * Injection token that determines the scroll handling while the connected overlay is open.
3821
- @type {?} */
4145
+ * @type {?}
4146
+ */
3822
4147
  var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken('cdk-connected-overlay-scroll-strategy');
3823
4148
  /**
3824
4149
  * Directive applied to an element to make it usable as an origin for an Overlay using a
@@ -4035,7 +4360,10 @@ var CdkConnectedOverlay = /** @class */ (function () {
4035
4360
  * @return {?}
4036
4361
  */
4037
4362
  function () {
4038
- this._destroyOverlay();
4363
+ if (this._overlayRef) {
4364
+ this._overlayRef.dispose();
4365
+ }
4366
+ this._backdropSubscription.unsubscribe();
4039
4367
  };
4040
4368
  /**
4041
4369
  * @param {?} changes
@@ -4048,6 +4376,12 @@ var CdkConnectedOverlay = /** @class */ (function () {
4048
4376
  function (changes) {
4049
4377
  if (this._position) {
4050
4378
  this._updatePositionStrategy(this._position);
4379
+ this._overlayRef.updateSize({
4380
+ width: this.width,
4381
+ minWidth: this.minWidth,
4382
+ height: this.height,
4383
+ minHeight: this.minHeight,
4384
+ });
4051
4385
  if (changes['origin'] && this.open) {
4052
4386
  this._position.apply();
4053
4387
  }
@@ -4056,12 +4390,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4056
4390
  this.open ? this._attachOverlay() : this._detachOverlay();
4057
4391
  }
4058
4392
  };
4393
+ /** Creates an overlay */
4059
4394
  /**
4060
4395
  * Creates an overlay
4396
+ * @private
4061
4397
  * @return {?}
4062
4398
  */
4063
4399
  CdkConnectedOverlay.prototype._createOverlay = /**
4064
4400
  * Creates an overlay
4401
+ * @private
4065
4402
  * @return {?}
4066
4403
  */
4067
4404
  function () {
@@ -4077,12 +4414,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4077
4414
  }
4078
4415
  });
4079
4416
  };
4417
+ /** Builds the overlay config based on the directive's inputs */
4080
4418
  /**
4081
4419
  * Builds the overlay config based on the directive's inputs
4420
+ * @private
4082
4421
  * @return {?}
4083
4422
  */
4084
4423
  CdkConnectedOverlay.prototype._buildConfig = /**
4085
4424
  * Builds the overlay config based on the directive's inputs
4425
+ * @private
4086
4426
  * @return {?}
4087
4427
  */
4088
4428
  function () {
@@ -4115,13 +4455,16 @@ var CdkConnectedOverlay = /** @class */ (function () {
4115
4455
  }
4116
4456
  return overlayConfig;
4117
4457
  };
4458
+ /** Updates the state of a position strategy, based on the values of the directive inputs. */
4118
4459
  /**
4119
4460
  * Updates the state of a position strategy, based on the values of the directive inputs.
4461
+ * @private
4120
4462
  * @param {?} positionStrategy
4121
4463
  * @return {?}
4122
4464
  */
4123
4465
  CdkConnectedOverlay.prototype._updatePositionStrategy = /**
4124
4466
  * Updates the state of a position strategy, based on the values of the directive inputs.
4467
+ * @private
4125
4468
  * @param {?} positionStrategy
4126
4469
  * @return {?}
4127
4470
  */
@@ -4145,12 +4488,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4145
4488
  .withViewportMargin(this.viewportMargin)
4146
4489
  .withLockedPosition(this.lockPosition);
4147
4490
  };
4491
+ /** Returns the position strategy of the overlay to be set on the overlay config */
4148
4492
  /**
4149
4493
  * Returns the position strategy of the overlay to be set on the overlay config
4494
+ * @private
4150
4495
  * @return {?}
4151
4496
  */
4152
4497
  CdkConnectedOverlay.prototype._createPositionStrategy = /**
4153
4498
  * Returns the position strategy of the overlay to be set on the overlay config
4499
+ * @private
4154
4500
  * @return {?}
4155
4501
  */
4156
4502
  function () {
@@ -4161,12 +4507,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4161
4507
  strategy.positionChanges.subscribe(function (p) { return _this.positionChange.emit(p); });
4162
4508
  return strategy;
4163
4509
  };
4510
+ /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
4164
4511
  /**
4165
4512
  * Attaches the overlay and subscribes to backdrop clicks if backdrop exists
4513
+ * @private
4166
4514
  * @return {?}
4167
4515
  */
4168
4516
  CdkConnectedOverlay.prototype._attachOverlay = /**
4169
4517
  * Attaches the overlay and subscribes to backdrop clicks if backdrop exists
4518
+ * @private
4170
4519
  * @return {?}
4171
4520
  */
4172
4521
  function () {
@@ -4176,12 +4525,7 @@ var CdkConnectedOverlay = /** @class */ (function () {
4176
4525
  }
4177
4526
  else {
4178
4527
  // Update the overlay size, in case the directive's inputs have changed
4179
- this._overlayRef.updateSize({
4180
- width: this.width,
4181
- minWidth: this.minWidth,
4182
- height: this.height,
4183
- minHeight: this.minHeight,
4184
- });
4528
+ this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;
4185
4529
  }
4186
4530
  if (!this._overlayRef.hasAttached()) {
4187
4531
  this._overlayRef.attach(this._templatePortal);
@@ -4192,13 +4536,19 @@ var CdkConnectedOverlay = /** @class */ (function () {
4192
4536
  _this.backdropClick.emit(event);
4193
4537
  });
4194
4538
  }
4539
+ else {
4540
+ this._backdropSubscription.unsubscribe();
4541
+ }
4195
4542
  };
4543
+ /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
4196
4544
  /**
4197
4545
  * Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists
4546
+ * @private
4198
4547
  * @return {?}
4199
4548
  */
4200
4549
  CdkConnectedOverlay.prototype._detachOverlay = /**
4201
4550
  * Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists
4551
+ * @private
4202
4552
  * @return {?}
4203
4553
  */
4204
4554
  function () {
@@ -4208,20 +4558,6 @@ var CdkConnectedOverlay = /** @class */ (function () {
4208
4558
  }
4209
4559
  this._backdropSubscription.unsubscribe();
4210
4560
  };
4211
- /**
4212
- * Destroys the overlay created by this directive.
4213
- * @return {?}
4214
- */
4215
- CdkConnectedOverlay.prototype._destroyOverlay = /**
4216
- * Destroys the overlay created by this directive.
4217
- * @return {?}
4218
- */
4219
- function () {
4220
- if (this._overlayRef) {
4221
- this._overlayRef.dispose();
4222
- }
4223
- this._backdropSubscription.unsubscribe();
4224
- };
4225
4561
  CdkConnectedOverlay.decorators = [
4226
4562
  { type: Directive, args: [{
4227
4563
  selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',
@@ -4271,9 +4607,10 @@ var CdkConnectedOverlay = /** @class */ (function () {
4271
4607
  function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
4272
4608
  return function () { return overlay.scrollStrategies.reposition(); };
4273
4609
  }
4274
- /** *
4610
+ /**
4275
4611
  * \@docs-private
4276
- @type {?} */
4612
+ * @type {?}
4613
+ */
4277
4614
  var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
4278
4615
  provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
4279
4616
  deps: [Overlay],
@@ -4282,7 +4619,7 @@ var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
4282
4619
 
4283
4620
  /**
4284
4621
  * @fileoverview added by tsickle
4285
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4622
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4286
4623
  */
4287
4624
  var OverlayModule = /** @class */ (function () {
4288
4625
  function OverlayModule() {
@@ -4300,11 +4637,12 @@ var OverlayModule = /** @class */ (function () {
4300
4637
  ];
4301
4638
  return OverlayModule;
4302
4639
  }());
4303
- /** *
4640
+ /**
4304
4641
  * @deprecated Use `OverlayModule` instead.
4305
4642
  * \@breaking-change 8.0.0
4306
4643
  * \@docs-private
4307
- @type {?} */
4644
+ * @type {?}
4645
+ */
4308
4646
  var OVERLAY_PROVIDERS = [
4309
4647
  Overlay,
4310
4648
  OverlayPositionBuilder,
@@ -4316,7 +4654,7 @@ var OVERLAY_PROVIDERS = [
4316
4654
 
4317
4655
  /**
4318
4656
  * @fileoverview added by tsickle
4319
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4657
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4320
4658
  */
4321
4659
  /**
4322
4660
  * Alternative to OverlayContainer that supports correct displaying of overlay elements in
@@ -4343,9 +4681,11 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4343
4681
  }
4344
4682
  };
4345
4683
  /**
4684
+ * @protected
4346
4685
  * @return {?}
4347
4686
  */
4348
4687
  FullscreenOverlayContainer.prototype._createContainer = /**
4688
+ * @protected
4349
4689
  * @return {?}
4350
4690
  */
4351
4691
  function () {
@@ -4355,9 +4695,11 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4355
4695
  this._addFullscreenChangeListener(function () { return _this._adjustParentForFullscreenChange(); });
4356
4696
  };
4357
4697
  /**
4698
+ * @private
4358
4699
  * @return {?}
4359
4700
  */
4360
4701
  FullscreenOverlayContainer.prototype._adjustParentForFullscreenChange = /**
4702
+ * @private
4361
4703
  * @return {?}
4362
4704
  */
4363
4705
  function () {
@@ -4371,10 +4713,12 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4371
4713
  parent.appendChild(this._containerElement);
4372
4714
  };
4373
4715
  /**
4716
+ * @private
4374
4717
  * @param {?} fn
4375
4718
  * @return {?}
4376
4719
  */
4377
4720
  FullscreenOverlayContainer.prototype._addFullscreenChangeListener = /**
4721
+ * @private
4378
4722
  * @param {?} fn
4379
4723
  * @return {?}
4380
4724
  */
@@ -4390,9 +4734,11 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4390
4734
  }
4391
4735
  };
4392
4736
  /**
4737
+ * @private
4393
4738
  * @return {?}
4394
4739
  */
4395
4740
  FullscreenOverlayContainer.prototype._getEventName = /**
4741
+ * @private
4396
4742
  * @return {?}
4397
4743
  */
4398
4744
  function () {
@@ -4403,10 +4749,10 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4403
4749
  else if (this._document.webkitFullscreenEnabled) {
4404
4750
  this._fullScreenEventName = 'webkitfullscreenchange';
4405
4751
  }
4406
- else if ((/** @type {?} */ (this._document)).mozFullScreenEnabled) {
4752
+ else if (((/** @type {?} */ (this._document))).mozFullScreenEnabled) {
4407
4753
  this._fullScreenEventName = 'mozfullscreenchange';
4408
4754
  }
4409
- else if ((/** @type {?} */ (this._document)).msFullscreenEnabled) {
4755
+ else if (((/** @type {?} */ (this._document))).msFullscreenEnabled) {
4410
4756
  this._fullScreenEventName = 'MSFullscreenChange';
4411
4757
  }
4412
4758
  }
@@ -4429,8 +4775,8 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4429
4775
  function () {
4430
4776
  return this._document.fullscreenElement ||
4431
4777
  this._document.webkitFullscreenElement ||
4432
- (/** @type {?} */ (this._document)).mozFullScreenElement ||
4433
- (/** @type {?} */ (this._document)).msFullscreenElement ||
4778
+ ((/** @type {?} */ (this._document))).mozFullScreenElement ||
4779
+ ((/** @type {?} */ (this._document))).msFullscreenElement ||
4434
4780
  null;
4435
4781
  };
4436
4782
  FullscreenOverlayContainer.decorators = [
@@ -4446,12 +4792,12 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4446
4792
 
4447
4793
  /**
4448
4794
  * @fileoverview added by tsickle
4449
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4795
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4450
4796
  */
4451
4797
 
4452
4798
  /**
4453
4799
  * @fileoverview added by tsickle
4454
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4800
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4455
4801
  */
4456
4802
 
4457
4803
  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 };