@angular/cdk 7.0.3 → 7.2.0

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 (252) hide show
  1. package/a11y/typings/focus-monitor/focus-monitor.d.ts +20 -4
  2. package/a11y/typings/index.metadata.json +1 -1
  3. package/a11y/typings/key-manager/list-key-manager.d.ts +8 -0
  4. package/a11y/typings/live-announcer/live-announcer.d.ts +37 -4
  5. package/bidi/typings/dir.d.ts +4 -1
  6. package/bidi/typings/index.metadata.json +1 -1
  7. package/bundles/cdk-a11y.umd.js +503 -210
  8. package/bundles/cdk-a11y.umd.js.map +1 -1
  9. package/bundles/cdk-a11y.umd.min.js +1 -1
  10. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  11. package/bundles/cdk-accordion.umd.js +16 -9
  12. package/bundles/cdk-accordion.umd.js.map +1 -1
  13. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  14. package/bundles/cdk-bidi.umd.js +16 -7
  15. package/bundles/cdk-bidi.umd.js.map +1 -1
  16. package/bundles/cdk-bidi.umd.min.js +1 -1
  17. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  18. package/bundles/cdk-coercion.umd.js +5 -5
  19. package/bundles/cdk-coercion.umd.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 +2251 -853
  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 +33 -1
  28. package/bundles/cdk-keycodes.umd.js.map +1 -1
  29. package/bundles/cdk-keycodes.umd.min.js +1 -1
  30. package/bundles/cdk-keycodes.umd.min.js.map +1 -1
  31. package/bundles/cdk-layout.umd.js +29 -22
  32. package/bundles/cdk-layout.umd.js.map +1 -1
  33. package/bundles/cdk-layout.umd.min.js +1 -1
  34. package/bundles/cdk-layout.umd.min.js.map +1 -1
  35. package/bundles/cdk-observers.umd.js +25 -6
  36. package/bundles/cdk-observers.umd.js.map +1 -1
  37. package/bundles/cdk-observers.umd.min.js.map +1 -1
  38. package/bundles/cdk-overlay.umd.js +600 -243
  39. package/bundles/cdk-overlay.umd.js.map +1 -1
  40. package/bundles/cdk-overlay.umd.min.js +2 -2
  41. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  42. package/bundles/cdk-platform.umd.js +50 -28
  43. package/bundles/cdk-platform.umd.js.map +1 -1
  44. package/bundles/cdk-platform.umd.min.js.map +1 -1
  45. package/bundles/cdk-portal.umd.js +14 -7
  46. package/bundles/cdk-portal.umd.js.map +1 -1
  47. package/bundles/cdk-portal.umd.min.js.map +1 -1
  48. package/bundles/cdk-scrolling.umd.js +143 -48
  49. package/bundles/cdk-scrolling.umd.js.map +1 -1
  50. package/bundles/cdk-scrolling.umd.min.js +1 -1
  51. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  52. package/bundles/cdk-stepper.umd.js +103 -19
  53. package/bundles/cdk-stepper.umd.js.map +1 -1
  54. package/bundles/cdk-stepper.umd.min.js +1 -1
  55. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  56. package/bundles/cdk-table.umd.js +182 -48
  57. package/bundles/cdk-table.umd.js.map +1 -1
  58. package/bundles/cdk-table.umd.min.js.map +1 -1
  59. package/bundles/cdk-text-field.umd.js +70 -32
  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/drag-drop/typings/{drag-handle.d.ts → directives/drag-handle.d.ts} +3 -0
  72. package/drag-drop/typings/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  73. package/drag-drop/typings/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  74. package/drag-drop/typings/directives/drag.d.ts +108 -0
  75. package/drag-drop/typings/directives/drop-list-group.d.ts +22 -0
  76. package/drag-drop/typings/directives/drop-list.d.ts +135 -0
  77. package/drag-drop/typings/drag-drop-registry.d.ts +8 -5
  78. package/drag-drop/typings/drag-events.d.ts +24 -6
  79. package/{typings/esm5/drag-drop/drag.d.ts → drag-drop/typings/drag-ref.d.ts} +153 -77
  80. package/drag-drop/typings/drop-list-container.d.ts +21 -3
  81. package/drag-drop/typings/{drop-list.d.ts → drop-list-ref.d.ts} +133 -77
  82. package/drag-drop/typings/index.d.ts +1 -0
  83. package/drag-drop/typings/index.metadata.json +1 -1
  84. package/drag-drop/typings/public-api.d.ts +13 -5
  85. package/esm2015/a11y.js +353 -189
  86. package/esm2015/a11y.js.map +1 -1
  87. package/esm2015/accordion.js +16 -11
  88. package/esm2015/accordion.js.map +1 -1
  89. package/esm2015/bidi.js +18 -9
  90. package/esm2015/bidi.js.map +1 -1
  91. package/esm2015/cdk.js +7 -6
  92. package/esm2015/cdk.js.map +1 -1
  93. package/esm2015/coercion.js +7 -7
  94. package/esm2015/coercion.js.map +1 -1
  95. package/esm2015/collections.js +22 -7
  96. package/esm2015/collections.js.map +1 -1
  97. package/esm2015/drag-drop.js +1768 -751
  98. package/esm2015/drag-drop.js.map +1 -1
  99. package/esm2015/keycodes.js +31 -4
  100. package/esm2015/keycodes.js.map +1 -1
  101. package/esm2015/layout.js +29 -19
  102. package/esm2015/layout.js.map +1 -1
  103. package/esm2015/observers.js +13 -8
  104. package/esm2015/observers.js.map +1 -1
  105. package/esm2015/overlay.js +384 -219
  106. package/esm2015/overlay.js.map +1 -1
  107. package/esm2015/platform.js +53 -31
  108. package/esm2015/platform.js.map +1 -1
  109. package/esm2015/portal.js +13 -9
  110. package/esm2015/portal.js.map +1 -1
  111. package/esm2015/scrolling.js +106 -49
  112. package/esm2015/scrolling.js.map +1 -1
  113. package/esm2015/stepper.js +93 -24
  114. package/esm2015/stepper.js.map +1 -1
  115. package/esm2015/table.js +89 -45
  116. package/esm2015/table.js.map +1 -1
  117. package/esm2015/text-field.js +51 -34
  118. package/esm2015/text-field.js.map +1 -1
  119. package/esm2015/tree.js +55 -36
  120. package/esm2015/tree.js.map +1 -1
  121. package/esm5/a11y.es5.js +507 -214
  122. package/esm5/a11y.es5.js.map +1 -1
  123. package/esm5/accordion.es5.js +18 -11
  124. package/esm5/accordion.es5.js.map +1 -1
  125. package/esm5/bidi.es5.js +18 -9
  126. package/esm5/bidi.es5.js.map +1 -1
  127. package/esm5/cdk.es5.js +7 -6
  128. package/esm5/cdk.es5.js.map +1 -1
  129. package/esm5/coercion.es5.js +7 -7
  130. package/esm5/coercion.es5.js.map +1 -1
  131. package/esm5/collections.es5.js +35 -7
  132. package/esm5/collections.es5.js.map +1 -1
  133. package/esm5/drag-drop.es5.js +2125 -729
  134. package/esm5/drag-drop.es5.js.map +1 -1
  135. package/esm5/keycodes.es5.js +35 -4
  136. package/esm5/keycodes.es5.js.map +1 -1
  137. package/esm5/layout.es5.js +31 -24
  138. package/esm5/layout.es5.js.map +1 -1
  139. package/esm5/observers.es5.js +27 -8
  140. package/esm5/observers.es5.js.map +1 -1
  141. package/esm5/overlay.es5.js +602 -245
  142. package/esm5/overlay.es5.js.map +1 -1
  143. package/esm5/platform.es5.js +52 -30
  144. package/esm5/platform.es5.js.map +1 -1
  145. package/esm5/portal.es5.js +16 -9
  146. package/esm5/portal.es5.js.map +1 -1
  147. package/esm5/scrolling.es5.js +145 -50
  148. package/esm5/scrolling.es5.js.map +1 -1
  149. package/esm5/stepper.es5.js +106 -24
  150. package/esm5/stepper.es5.js.map +1 -1
  151. package/esm5/table.es5.js +184 -50
  152. package/esm5/table.es5.js.map +1 -1
  153. package/esm5/text-field.es5.js +72 -34
  154. package/esm5/text-field.es5.js.map +1 -1
  155. package/esm5/tree.es5.js +74 -37
  156. package/esm5/tree.es5.js.map +1 -1
  157. package/keycodes/typings/index.metadata.json +1 -1
  158. package/keycodes/typings/modifiers.d.ts +14 -0
  159. package/keycodes/typings/public-api.d.ts +1 -0
  160. package/overlay/typings/index.metadata.json +1 -1
  161. package/package.json +4 -4
  162. package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
  163. package/schematics/ng-update/upgrade-data.js +2 -1
  164. package/schematics/ng-update/upgrade-data.js.map +1 -1
  165. package/schematics/ng-update/upgrade-rules/index.js +3 -2
  166. package/schematics/ng-update/upgrade-rules/index.js.map +1 -1
  167. package/schematics/utils/ast/ng-module-imports.d.ts +1 -1
  168. package/schematics/utils/ast/ng-module-imports.js +25 -13
  169. package/schematics/utils/ast/ng-module-imports.js.map +1 -1
  170. package/schematics/utils/get-project.js +2 -1
  171. package/schematics/utils/get-project.js.map +1 -1
  172. package/schematics/utils/parse5-element.js +3 -2
  173. package/schematics/utils/parse5-element.js.map +1 -1
  174. package/schematics/utils/project-targets.js +2 -1
  175. package/schematics/utils/project-targets.js.map +1 -1
  176. package/schematics/utils/version-agnostic-typescript.js +3 -2
  177. package/schematics/utils/version-agnostic-typescript.js.map +1 -1
  178. package/scrolling/typings/index.metadata.json +1 -1
  179. package/stepper/typings/index.metadata.json +1 -1
  180. package/stepper/typings/public-api.d.ts +1 -0
  181. package/stepper/typings/step-header.d.ts +15 -0
  182. package/stepper/typings/stepper.d.ts +11 -1
  183. package/text-field/typings/autosize.d.ts +6 -0
  184. package/text-field/typings/index.metadata.json +1 -1
  185. package/tree/typings/nested-node.d.ts +5 -5
  186. package/typings/a11y/focus-monitor/focus-monitor.d.ts +20 -4
  187. package/typings/a11y/index.metadata.json +1 -1
  188. package/typings/a11y/key-manager/list-key-manager.d.ts +8 -0
  189. package/typings/a11y/live-announcer/live-announcer.d.ts +37 -4
  190. package/typings/bidi/dir.d.ts +4 -1
  191. package/typings/bidi/index.metadata.json +1 -1
  192. package/typings/{esm5/drag-drop → drag-drop/directives}/drag-handle.d.ts +3 -0
  193. package/typings/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  194. package/typings/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  195. package/typings/drag-drop/directives/drag.d.ts +108 -0
  196. package/typings/drag-drop/directives/drop-list-group.d.ts +22 -0
  197. package/typings/drag-drop/directives/drop-list.d.ts +135 -0
  198. package/typings/drag-drop/drag-drop-registry.d.ts +8 -5
  199. package/typings/drag-drop/drag-events.d.ts +24 -6
  200. package/typings/drag-drop/{drag.d.ts → drag-ref.d.ts} +153 -77
  201. package/typings/drag-drop/drop-list-container.d.ts +21 -3
  202. package/typings/{esm5/drag-drop/drop-list.d.ts → drag-drop/drop-list-ref.d.ts} +133 -77
  203. package/typings/drag-drop/index.d.ts +1 -0
  204. package/typings/drag-drop/index.metadata.json +1 -1
  205. package/typings/drag-drop/public-api.d.ts +13 -5
  206. package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +20 -4
  207. package/typings/esm5/a11y/index.metadata.json +1 -1
  208. package/typings/esm5/a11y/key-manager/list-key-manager.d.ts +8 -0
  209. package/typings/esm5/a11y/live-announcer/live-announcer.d.ts +37 -4
  210. package/typings/esm5/bidi/dir.d.ts +4 -1
  211. package/typings/esm5/bidi/index.metadata.json +1 -1
  212. package/typings/{drag-drop → esm5/drag-drop/directives}/drag-handle.d.ts +3 -0
  213. package/typings/esm5/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  214. package/typings/esm5/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  215. package/typings/esm5/drag-drop/directives/drag.d.ts +108 -0
  216. package/typings/esm5/drag-drop/directives/drop-list-group.d.ts +22 -0
  217. package/typings/esm5/drag-drop/directives/drop-list.d.ts +135 -0
  218. package/typings/esm5/drag-drop/drag-drop-registry.d.ts +8 -5
  219. package/typings/esm5/drag-drop/drag-events.d.ts +24 -6
  220. package/{drag-drop/typings/drag.d.ts → typings/esm5/drag-drop/drag-ref.d.ts} +153 -77
  221. package/typings/esm5/drag-drop/drop-list-container.d.ts +21 -3
  222. package/typings/{drag-drop/drop-list.d.ts → esm5/drag-drop/drop-list-ref.d.ts} +133 -77
  223. package/typings/esm5/drag-drop/index.d.ts +1 -0
  224. package/typings/esm5/drag-drop/index.metadata.json +1 -1
  225. package/typings/esm5/drag-drop/public-api.d.ts +13 -5
  226. package/typings/esm5/index.metadata.json +1 -1
  227. package/typings/esm5/keycodes/index.metadata.json +1 -1
  228. package/typings/esm5/keycodes/modifiers.d.ts +14 -0
  229. package/typings/esm5/keycodes/public-api.d.ts +1 -0
  230. package/typings/esm5/overlay/index.metadata.json +1 -1
  231. package/typings/esm5/scrolling/index.metadata.json +1 -1
  232. package/typings/esm5/stepper/index.metadata.json +1 -1
  233. package/typings/esm5/stepper/public-api.d.ts +1 -0
  234. package/typings/esm5/stepper/step-header.d.ts +15 -0
  235. package/typings/esm5/stepper/stepper.d.ts +11 -1
  236. package/typings/esm5/text-field/autosize.d.ts +6 -0
  237. package/typings/esm5/text-field/index.metadata.json +1 -1
  238. package/typings/esm5/tree/nested-node.d.ts +5 -5
  239. package/typings/index.metadata.json +1 -1
  240. package/typings/keycodes/index.metadata.json +1 -1
  241. package/typings/keycodes/modifiers.d.ts +14 -0
  242. package/typings/keycodes/public-api.d.ts +1 -0
  243. package/typings/overlay/index.metadata.json +1 -1
  244. package/typings/schematics/utils/ast/ng-module-imports.d.ts +1 -1
  245. package/typings/scrolling/index.metadata.json +1 -1
  246. package/typings/stepper/index.metadata.json +1 -1
  247. package/typings/stepper/public-api.d.ts +1 -0
  248. package/typings/stepper/step-header.d.ts +15 -0
  249. package/typings/stepper/stepper.d.ts +11 -1
  250. package/typings/text-field/autosize.d.ts +6 -0
  251. package/typings/text-field/index.metadata.json +1 -1
  252. package/typings/tree/nested-node.d.ts +5 -5
@@ -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.
@@ -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
  }
@@ -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. */
@@ -1385,41 +1417,44 @@ OverlayRef = /** @class */ (function () {
1385
1417
  var _this = this;
1386
1418
  /** @type {?} */
1387
1419
  var backdropToDetach = this._backdropElement;
1388
- if (backdropToDetach) {
1389
- /** @type {?} */
1390
- var timeoutId_1 = void 0;
1391
- /** @type {?} */
1392
- var finishDetach_1 = function () {
1393
- // It may not be attached to anything in certain cases (e.g. unit tests).
1394
- if (backdropToDetach && backdropToDetach.parentNode) {
1395
- backdropToDetach.parentNode.removeChild(backdropToDetach);
1396
- }
1397
- // It is possible that a new portal has been attached to this overlay since we started
1398
- // removing the backdrop. If that is the case, only clear the backdrop reference if it
1399
- // is still the same instance that we started to remove.
1400
- if (_this._backdropElement == backdropToDetach) {
1401
- _this._backdropElement = null;
1402
- }
1403
- clearTimeout(timeoutId_1);
1404
- };
1405
- backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');
1406
- if (this._config.backdropClass) {
1407
- this._toggleClasses(backdropToDetach, this._config.backdropClass, false);
1408
- }
1409
- this._ngZone.runOutsideAngular(function () {
1410
- /** @type {?} */ ((backdropToDetach)).addEventListener('transitionend', finishDetach_1);
1411
- });
1412
- // If the backdrop doesn't have a transition, the `transitionend` event won't fire.
1413
- // In this case we make it unclickable and we try to remove it after a delay.
1414
- backdropToDetach.style.pointerEvents = 'none';
1415
- // Run this outside the Angular zone because there's nothing that Angular cares about.
1416
- // If it were to run inside the Angular zone, every test that used Overlay would have to be
1417
- // either async or fakeAsync.
1418
- timeoutId_1 = this._ngZone.runOutsideAngular(function () { return setTimeout(finishDetach_1, 500); });
1420
+ if (!backdropToDetach) {
1421
+ return;
1419
1422
  }
1423
+ /** @type {?} */
1424
+ var timeoutId;
1425
+ /** @type {?} */
1426
+ var finishDetach = function () {
1427
+ // It may not be attached to anything in certain cases (e.g. unit tests).
1428
+ if (backdropToDetach && backdropToDetach.parentNode) {
1429
+ backdropToDetach.parentNode.removeChild(backdropToDetach);
1430
+ }
1431
+ // It is possible that a new portal has been attached to this overlay since we started
1432
+ // removing the backdrop. If that is the case, only clear the backdrop reference if it
1433
+ // is still the same instance that we started to remove.
1434
+ if (_this._backdropElement == backdropToDetach) {
1435
+ _this._backdropElement = null;
1436
+ }
1437
+ if (_this._config.backdropClass) {
1438
+ _this._toggleClasses((/** @type {?} */ (backdropToDetach)), _this._config.backdropClass, false);
1439
+ }
1440
+ clearTimeout(timeoutId);
1441
+ };
1442
+ backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');
1443
+ this._ngZone.runOutsideAngular(function () {
1444
+ (/** @type {?} */ (backdropToDetach)).addEventListener('transitionend', finishDetach);
1445
+ });
1446
+ // If the backdrop doesn't have a transition, the `transitionend` event won't fire.
1447
+ // In this case we make it unclickable and we try to remove it after a delay.
1448
+ backdropToDetach.style.pointerEvents = 'none';
1449
+ // Run this outside the Angular zone because there's nothing that Angular cares about.
1450
+ // If it were to run inside the Angular zone, every test that used Overlay would have to be
1451
+ // either async or fakeAsync.
1452
+ timeoutId = this._ngZone.runOutsideAngular(function () { return setTimeout(finishDetach, 500); });
1420
1453
  };
1454
+ /** Toggles a single CSS class or an array of classes on an element. */
1421
1455
  /**
1422
1456
  * Toggles a single CSS class or an array of classes on an element.
1457
+ * @private
1423
1458
  * @param {?} element
1424
1459
  * @param {?} cssClasses
1425
1460
  * @param {?} isAdd
@@ -1427,6 +1462,7 @@ OverlayRef = /** @class */ (function () {
1427
1462
  */
1428
1463
  OverlayRef.prototype._toggleClasses = /**
1429
1464
  * Toggles a single CSS class or an array of classes on an element.
1465
+ * @private
1430
1466
  * @param {?} element
1431
1467
  * @param {?} cssClasses
1432
1468
  * @param {?} isAdd
@@ -1440,12 +1476,15 @@ OverlayRef = /** @class */ (function () {
1440
1476
  isAdd ? classList.add(cssClass) : classList.remove(cssClass);
1441
1477
  });
1442
1478
  };
1479
+ /** Detaches the overlay content next time the zone stabilizes. */
1443
1480
  /**
1444
1481
  * Detaches the overlay content next time the zone stabilizes.
1482
+ * @private
1445
1483
  * @return {?}
1446
1484
  */
1447
1485
  OverlayRef.prototype._detachContentWhenStable = /**
1448
1486
  * Detaches the overlay content next time the zone stabilizes.
1487
+ * @private
1449
1488
  * @return {?}
1450
1489
  */
1451
1490
  function () {
@@ -1454,6 +1493,9 @@ OverlayRef = /** @class */ (function () {
1454
1493
  // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will
1455
1494
  // be patched to run inside the zone, which will throw us into an infinite loop.
1456
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.
1457
1499
  /** @type {?} */
1458
1500
  var subscription = _this._ngZone.onStable
1459
1501
  .asObservable()
@@ -1479,11 +1521,14 @@ OverlayRef = /** @class */ (function () {
1479
1521
 
1480
1522
  /**
1481
1523
  * @fileoverview added by tsickle
1482
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1524
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1483
1525
  */
1484
- /** *
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
+ /**
1485
1529
  * Class to be added to the overlay bounding box.
1486
- @type {?} */
1530
+ * @type {?}
1531
+ */
1487
1532
  var boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';
1488
1533
  /**
1489
1534
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -1697,18 +1742,25 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1697
1742
  var overlayRect = this._overlayRect;
1698
1743
  /** @type {?} */
1699
1744
  var viewportRect = this._viewportRect;
1745
+ // Positions where the overlay will fit with flexible dimensions.
1700
1746
  /** @type {?} */
1701
1747
  var flexibleFits = [];
1748
+ // Fallback if none of the preferred positions fit within the viewport.
1702
1749
  /** @type {?} */
1703
1750
  var fallback;
1704
1751
  // Go through each of the preferred positions looking for a good fit.
1705
1752
  // If a good fit is found, it will be applied immediately.
1706
1753
  for (var _i = 0, _a = this._preferredPositions; _i < _a.length; _i++) {
1707
1754
  var pos = _a[_i];
1755
+ // Get the exact (x, y) coordinate for the point-of-origin on the origin element.
1708
1756
  /** @type {?} */
1709
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.
1710
1761
  /** @type {?} */
1711
1762
  var overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);
1763
+ // Calculate how well the overlay would fit into the viewport with this point.
1712
1764
  /** @type {?} */
1713
1765
  var overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);
1714
1766
  // If the overlay, without any further work, fits into the viewport, use this position.
@@ -1754,7 +1806,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1754
1806
  }
1755
1807
  }
1756
1808
  this._isPushed = false;
1757
- this._applyPosition(/** @type {?} */ ((bestFit)).position, /** @type {?} */ ((bestFit)).origin);
1809
+ this._applyPosition((/** @type {?} */ (bestFit)).position, (/** @type {?} */ (bestFit)).origin);
1758
1810
  return;
1759
1811
  }
1760
1812
  // When none of the preferred positions fit within the viewport, take the position
@@ -1762,12 +1814,12 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1762
1814
  if (this._canPush) {
1763
1815
  // TODO(jelbourn): after pushing, the opening "direction" of the overlay might not make sense.
1764
1816
  this._isPushed = true;
1765
- this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
1817
+ this._applyPosition((/** @type {?} */ (fallback)).position, (/** @type {?} */ (fallback)).originPoint);
1766
1818
  return;
1767
1819
  }
1768
1820
  // All options for getting the overlay within the viewport have been exhausted, so go with the
1769
1821
  // position that went off-screen the least.
1770
- this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
1822
+ this._applyPosition((/** @type {?} */ (fallback)).position, (/** @type {?} */ (fallback)).originPoint);
1771
1823
  };
1772
1824
  /**
1773
1825
  * @return {?}
@@ -1797,7 +1849,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1797
1849
  // We can't use `_resetBoundingBoxStyles` here, because it resets
1798
1850
  // some properties to zero, rather than removing them.
1799
1851
  if (this._boundingBox) {
1800
- extendStyles(this._boundingBox.style, /** @type {?} */ ({
1852
+ extendStyles(this._boundingBox.style, (/** @type {?} */ ({
1801
1853
  top: '',
1802
1854
  left: '',
1803
1855
  right: '',
@@ -1806,7 +1858,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1806
1858
  width: '',
1807
1859
  alignItems: '',
1808
1860
  justifyContent: '',
1809
- }));
1861
+ })));
1810
1862
  }
1811
1863
  if (this._pane) {
1812
1864
  this._resetOverlayElementStyles();
@@ -1816,7 +1868,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1816
1868
  }
1817
1869
  this.detach();
1818
1870
  this._positionChanges.complete();
1819
- this._overlayRef = this._boundingBox = /** @type {?} */ ((null));
1871
+ this._overlayRef = this._boundingBox = (/** @type {?} */ (null));
1820
1872
  this._isDisposed = true;
1821
1873
  };
1822
1874
  /**
@@ -1876,23 +1928,27 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1876
1928
  */
1877
1929
  /**
1878
1930
  * Adds new preferred positions.
1931
+ * @template THIS
1932
+ * @this {THIS}
1879
1933
  * @param {?} positions List of positions options for this overlay.
1880
- * @return {?}
1934
+ * @return {THIS}
1881
1935
  */
1882
1936
  FlexibleConnectedPositionStrategy.prototype.withPositions = /**
1883
1937
  * Adds new preferred positions.
1938
+ * @template THIS
1939
+ * @this {THIS}
1884
1940
  * @param {?} positions List of positions options for this overlay.
1885
- * @return {?}
1941
+ * @return {THIS}
1886
1942
  */
1887
1943
  function (positions) {
1888
- this._preferredPositions = positions;
1944
+ (/** @type {?} */ (this))._preferredPositions = positions;
1889
1945
  // If the last calculated position object isn't part of the positions anymore, clear
1890
1946
  // it in order to avoid it being picked up if the consumer tries to re-apply.
1891
- if (positions.indexOf(/** @type {?} */ ((this._lastPosition))) === -1) {
1892
- this._lastPosition = null;
1947
+ if (positions.indexOf((/** @type {?} */ ((/** @type {?} */ (this))._lastPosition))) === -1) {
1948
+ (/** @type {?} */ (this))._lastPosition = null;
1893
1949
  }
1894
- this._validatePositions();
1895
- return this;
1950
+ (/** @type {?} */ (this))._validatePositions();
1951
+ return (/** @type {?} */ (this));
1896
1952
  };
1897
1953
  /**
1898
1954
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
@@ -1900,65 +1956,81 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1900
1956
  */
1901
1957
  /**
1902
1958
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
1959
+ * @template THIS
1960
+ * @this {THIS}
1903
1961
  * @param {?} margin Required margin between the overlay and the viewport edge in pixels.
1904
- * @return {?}
1962
+ * @return {THIS}
1905
1963
  */
1906
1964
  FlexibleConnectedPositionStrategy.prototype.withViewportMargin = /**
1907
1965
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
1966
+ * @template THIS
1967
+ * @this {THIS}
1908
1968
  * @param {?} margin Required margin between the overlay and the viewport edge in pixels.
1909
- * @return {?}
1969
+ * @return {THIS}
1910
1970
  */
1911
1971
  function (margin) {
1912
- this._viewportMargin = margin;
1913
- return this;
1972
+ (/** @type {?} */ (this))._viewportMargin = margin;
1973
+ return (/** @type {?} */ (this));
1914
1974
  };
1915
1975
  /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */
1916
1976
  /**
1917
1977
  * Sets whether the overlay's width and height can be constrained to fit within the viewport.
1978
+ * @template THIS
1979
+ * @this {THIS}
1918
1980
  * @param {?=} flexibleDimensions
1919
- * @return {?}
1981
+ * @return {THIS}
1920
1982
  */
1921
1983
  FlexibleConnectedPositionStrategy.prototype.withFlexibleDimensions = /**
1922
1984
  * Sets whether the overlay's width and height can be constrained to fit within the viewport.
1985
+ * @template THIS
1986
+ * @this {THIS}
1923
1987
  * @param {?=} flexibleDimensions
1924
- * @return {?}
1988
+ * @return {THIS}
1925
1989
  */
1926
1990
  function (flexibleDimensions) {
1927
1991
  if (flexibleDimensions === void 0) { flexibleDimensions = true; }
1928
- this._hasFlexibleDimensions = flexibleDimensions;
1929
- return this;
1992
+ (/** @type {?} */ (this))._hasFlexibleDimensions = flexibleDimensions;
1993
+ return (/** @type {?} */ (this));
1930
1994
  };
1931
1995
  /** Sets whether the overlay can grow after the initial open via flexible width/height. */
1932
1996
  /**
1933
1997
  * Sets whether the overlay can grow after the initial open via flexible width/height.
1998
+ * @template THIS
1999
+ * @this {THIS}
1934
2000
  * @param {?=} growAfterOpen
1935
- * @return {?}
2001
+ * @return {THIS}
1936
2002
  */
1937
2003
  FlexibleConnectedPositionStrategy.prototype.withGrowAfterOpen = /**
1938
2004
  * Sets whether the overlay can grow after the initial open via flexible width/height.
2005
+ * @template THIS
2006
+ * @this {THIS}
1939
2007
  * @param {?=} growAfterOpen
1940
- * @return {?}
2008
+ * @return {THIS}
1941
2009
  */
1942
2010
  function (growAfterOpen) {
1943
2011
  if (growAfterOpen === void 0) { growAfterOpen = true; }
1944
- this._growAfterOpen = growAfterOpen;
1945
- return this;
2012
+ (/** @type {?} */ (this))._growAfterOpen = growAfterOpen;
2013
+ return (/** @type {?} */ (this));
1946
2014
  };
1947
2015
  /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */
1948
2016
  /**
1949
2017
  * Sets whether the overlay can be pushed on-screen if none of the provided positions fit.
2018
+ * @template THIS
2019
+ * @this {THIS}
1950
2020
  * @param {?=} canPush
1951
- * @return {?}
2021
+ * @return {THIS}
1952
2022
  */
1953
2023
  FlexibleConnectedPositionStrategy.prototype.withPush = /**
1954
2024
  * Sets whether the overlay can be pushed on-screen if none of the provided positions fit.
2025
+ * @template THIS
2026
+ * @this {THIS}
1955
2027
  * @param {?=} canPush
1956
- * @return {?}
2028
+ * @return {THIS}
1957
2029
  */
1958
2030
  function (canPush) {
1959
2031
  if (canPush === void 0) { canPush = true; }
1960
- this._canPush = canPush;
1961
- return this;
2032
+ (/** @type {?} */ (this))._canPush = canPush;
2033
+ return (/** @type {?} */ (this));
1962
2034
  };
1963
2035
  /**
1964
2036
  * Sets whether the overlay's position should be locked in after it is positioned
@@ -1970,20 +2042,24 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1970
2042
  * Sets whether the overlay's position should be locked in after it is positioned
1971
2043
  * initially. When an overlay is locked in, it won't attempt to reposition itself
1972
2044
  * when the position is re-applied (e.g. when the user scrolls away).
2045
+ * @template THIS
2046
+ * @this {THIS}
1973
2047
  * @param {?=} isLocked Whether the overlay should locked in.
1974
- * @return {?}
2048
+ * @return {THIS}
1975
2049
  */
1976
2050
  FlexibleConnectedPositionStrategy.prototype.withLockedPosition = /**
1977
2051
  * Sets whether the overlay's position should be locked in after it is positioned
1978
2052
  * initially. When an overlay is locked in, it won't attempt to reposition itself
1979
2053
  * when the position is re-applied (e.g. when the user scrolls away).
2054
+ * @template THIS
2055
+ * @this {THIS}
1980
2056
  * @param {?=} isLocked Whether the overlay should locked in.
1981
- * @return {?}
2057
+ * @return {THIS}
1982
2058
  */
1983
2059
  function (isLocked) {
1984
2060
  if (isLocked === void 0) { isLocked = true; }
1985
- this._positionLocked = isLocked;
1986
- return this;
2061
+ (/** @type {?} */ (this))._positionLocked = isLocked;
2062
+ return (/** @type {?} */ (this));
1987
2063
  };
1988
2064
  /**
1989
2065
  * Sets the origin element, relative to which to position the overlay.
@@ -1991,17 +2067,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1991
2067
  */
1992
2068
  /**
1993
2069
  * Sets the origin element, relative to which to position the overlay.
2070
+ * @template THIS
2071
+ * @this {THIS}
1994
2072
  * @param {?} origin Reference to the new origin element.
1995
- * @return {?}
2073
+ * @return {THIS}
1996
2074
  */
1997
2075
  FlexibleConnectedPositionStrategy.prototype.setOrigin = /**
1998
2076
  * Sets the origin element, relative to which to position the overlay.
2077
+ * @template THIS
2078
+ * @this {THIS}
1999
2079
  * @param {?} origin Reference to the new origin element.
2000
- * @return {?}
2080
+ * @return {THIS}
2001
2081
  */
2002
2082
  function (origin) {
2003
- this._origin = origin instanceof ElementRef ? origin.nativeElement : origin;
2004
- return this;
2083
+ (/** @type {?} */ (this))._origin = origin instanceof ElementRef ? origin.nativeElement : origin;
2084
+ return (/** @type {?} */ (this));
2005
2085
  };
2006
2086
  /**
2007
2087
  * Sets the default offset for the overlay's connection point on the x-axis.
@@ -2009,17 +2089,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2009
2089
  */
2010
2090
  /**
2011
2091
  * Sets the default offset for the overlay's connection point on the x-axis.
2092
+ * @template THIS
2093
+ * @this {THIS}
2012
2094
  * @param {?} offset New offset in the X axis.
2013
- * @return {?}
2095
+ * @return {THIS}
2014
2096
  */
2015
2097
  FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetX = /**
2016
2098
  * Sets the default offset for the overlay's connection point on the x-axis.
2099
+ * @template THIS
2100
+ * @this {THIS}
2017
2101
  * @param {?} offset New offset in the X axis.
2018
- * @return {?}
2102
+ * @return {THIS}
2019
2103
  */
2020
2104
  function (offset) {
2021
- this._offsetX = offset;
2022
- return this;
2105
+ (/** @type {?} */ (this))._offsetX = offset;
2106
+ return (/** @type {?} */ (this));
2023
2107
  };
2024
2108
  /**
2025
2109
  * Sets the default offset for the overlay's connection point on the y-axis.
@@ -2027,17 +2111,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2027
2111
  */
2028
2112
  /**
2029
2113
  * Sets the default offset for the overlay's connection point on the y-axis.
2114
+ * @template THIS
2115
+ * @this {THIS}
2030
2116
  * @param {?} offset New offset in the Y axis.
2031
- * @return {?}
2117
+ * @return {THIS}
2032
2118
  */
2033
2119
  FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetY = /**
2034
2120
  * Sets the default offset for the overlay's connection point on the y-axis.
2121
+ * @template THIS
2122
+ * @this {THIS}
2035
2123
  * @param {?} offset New offset in the Y axis.
2036
- * @return {?}
2124
+ * @return {THIS}
2037
2125
  */
2038
2126
  function (offset) {
2039
- this._offsetY = offset;
2040
- return this;
2127
+ (/** @type {?} */ (this))._offsetY = offset;
2128
+ return (/** @type {?} */ (this));
2041
2129
  };
2042
2130
  /**
2043
2131
  * Configures that the position strategy should set a `transform-origin` on some elements
@@ -2052,31 +2140,40 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2052
2140
  * inside the overlay, depending on the current position that is being applied. This is
2053
2141
  * useful for the cases where the origin of an animation can change depending on the
2054
2142
  * alignment of the overlay.
2143
+ * @template THIS
2144
+ * @this {THIS}
2055
2145
  * @param {?} selector CSS selector that will be used to find the target
2056
2146
  * elements onto which to set the transform origin.
2057
- * @return {?}
2147
+ * @return {THIS}
2058
2148
  */
2059
2149
  FlexibleConnectedPositionStrategy.prototype.withTransformOriginOn = /**
2060
2150
  * Configures that the position strategy should set a `transform-origin` on some elements
2061
2151
  * inside the overlay, depending on the current position that is being applied. This is
2062
2152
  * useful for the cases where the origin of an animation can change depending on the
2063
2153
  * alignment of the overlay.
2154
+ * @template THIS
2155
+ * @this {THIS}
2064
2156
  * @param {?} selector CSS selector that will be used to find the target
2065
2157
  * elements onto which to set the transform origin.
2066
- * @return {?}
2158
+ * @return {THIS}
2067
2159
  */
2068
2160
  function (selector) {
2069
- this._transformOriginSelector = selector;
2070
- return this;
2161
+ (/** @type {?} */ (this))._transformOriginSelector = selector;
2162
+ return (/** @type {?} */ (this));
2071
2163
  };
2072
2164
  /**
2073
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
2074
2170
  * @param {?} originRect
2075
2171
  * @param {?} pos
2076
2172
  * @return {?}
2077
2173
  */
2078
2174
  FlexibleConnectedPositionStrategy.prototype._getOriginPoint = /**
2079
2175
  * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
2176
+ * @private
2080
2177
  * @param {?} originRect
2081
2178
  * @param {?} pos
2082
2179
  * @return {?}
@@ -2109,6 +2206,11 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2109
2206
  /**
2110
2207
  * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
2111
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
2112
2214
  * @param {?} originPoint
2113
2215
  * @param {?} overlayRect
2114
2216
  * @param {?} pos
@@ -2117,12 +2219,15 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2117
2219
  FlexibleConnectedPositionStrategy.prototype._getOverlayPoint = /**
2118
2220
  * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
2119
2221
  * origin point to which the overlay should be connected.
2222
+ * @private
2120
2223
  * @param {?} originPoint
2121
2224
  * @param {?} overlayRect
2122
2225
  * @param {?} pos
2123
2226
  * @return {?}
2124
2227
  */
2125
2228
  function (originPoint, overlayRect, pos) {
2229
+ // Calculate the (overlayStartX, overlayStartY), the start of the
2230
+ // potential overlay position relative to the origin point.
2126
2231
  /** @type {?} */
2127
2232
  var overlayStartX;
2128
2233
  if (pos.overlayX == 'center') {
@@ -2148,8 +2253,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2148
2253
  y: originPoint.y + overlayStartY,
2149
2254
  };
2150
2255
  };
2256
+ /** Gets how well an overlay at the given point will fit within the viewport. */
2151
2257
  /**
2152
2258
  * Gets how well an overlay at the given point will fit within the viewport.
2259
+ * @private
2153
2260
  * @param {?} point
2154
2261
  * @param {?} overlay
2155
2262
  * @param {?} viewport
@@ -2158,6 +2265,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2158
2265
  */
2159
2266
  FlexibleConnectedPositionStrategy.prototype._getOverlayFit = /**
2160
2267
  * Gets how well an overlay at the given point will fit within the viewport.
2268
+ * @private
2161
2269
  * @param {?} point
2162
2270
  * @param {?} overlay
2163
2271
  * @param {?} viewport
@@ -2177,6 +2285,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2177
2285
  if (offsetY) {
2178
2286
  y += offsetY;
2179
2287
  }
2288
+ // How much the overlay would overflow at this position, on each side.
2180
2289
  /** @type {?} */
2181
2290
  var leftOverflow = 0 - x;
2182
2291
  /** @type {?} */
@@ -2185,6 +2294,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2185
2294
  var topOverflow = 0 - y;
2186
2295
  /** @type {?} */
2187
2296
  var bottomOverflow = (y + overlay.height) - viewport.height;
2297
+ // Visible parts of the element on each axis.
2188
2298
  /** @type {?} */
2189
2299
  var visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);
2190
2300
  /** @type {?} */
@@ -2200,6 +2310,13 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2200
2310
  };
2201
2311
  /**
2202
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
2203
2320
  * @param {?} fit How well the overlay fits in the viewport at some position.
2204
2321
  * @param {?} point The (x, y) coordinates of the overlat at some position.
2205
2322
  * @param {?} viewport The geometry of the viewport.
@@ -2207,6 +2324,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2207
2324
  */
2208
2325
  FlexibleConnectedPositionStrategy.prototype._canFitWithFlexibleDimensions = /**
2209
2326
  * Whether the overlay can fit within the viewport when it may resize either its width or height.
2327
+ * @private
2210
2328
  * @param {?} fit How well the overlay fits in the viewport at some position.
2211
2329
  * @param {?} point The (x, y) coordinates of the overlat at some position.
2212
2330
  * @param {?} viewport The geometry of the viewport.
@@ -2236,6 +2354,18 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2236
2354
  * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
2237
2355
  * right and bottom).
2238
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
2239
2369
  * @param {?} start Starting point from which the overlay is pushed.
2240
2370
  * @param {?} overlay Dimensions of the overlay.
2241
2371
  * @param {?} scrollPosition Current viewport scroll position.
@@ -2247,6 +2377,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2247
2377
  * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
2248
2378
  * right and bottom).
2249
2379
  *
2380
+ * @private
2250
2381
  * @param {?} start Starting point from which the overlay is pushed.
2251
2382
  * @param {?} overlay Dimensions of the overlay.
2252
2383
  * @param {?} scrollPosition Current viewport scroll position.
@@ -2265,6 +2396,8 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2265
2396
  }
2266
2397
  /** @type {?} */
2267
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.
2268
2401
  /** @type {?} */
2269
2402
  var overflowRight = Math.max(start.x + overlay.width - viewport.right, 0);
2270
2403
  /** @type {?} */
@@ -2273,6 +2406,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2273
2406
  var overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);
2274
2407
  /** @type {?} */
2275
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.
2276
2410
  /** @type {?} */
2277
2411
  var pushX = 0;
2278
2412
  /** @type {?} */
@@ -2300,12 +2434,19 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2300
2434
  };
2301
2435
  /**
2302
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
2303
2443
  * @param {?} position The position preference
2304
2444
  * @param {?} originPoint The point on the origin element where the overlay is connected.
2305
2445
  * @return {?}
2306
2446
  */
2307
2447
  FlexibleConnectedPositionStrategy.prototype._applyPosition = /**
2308
2448
  * Applies a computed position to the overlay and emits a position change.
2449
+ * @private
2309
2450
  * @param {?} position The position preference
2310
2451
  * @param {?} originPoint The point on the origin element where the overlay is connected.
2311
2452
  * @return {?}
@@ -2331,13 +2472,16 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2331
2472
  }
2332
2473
  this._isInitialRender = false;
2333
2474
  };
2475
+ /** Sets the transform origin based on the configured selector and the passed-in position. */
2334
2476
  /**
2335
2477
  * Sets the transform origin based on the configured selector and the passed-in position.
2478
+ * @private
2336
2479
  * @param {?} position
2337
2480
  * @return {?}
2338
2481
  */
2339
2482
  FlexibleConnectedPositionStrategy.prototype._setTransformOrigin = /**
2340
2483
  * Sets the transform origin based on the configured selector and the passed-in position.
2484
+ * @private
2341
2485
  * @param {?} position
2342
2486
  * @return {?}
2343
2487
  */
@@ -2346,7 +2490,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2346
2490
  return;
2347
2491
  }
2348
2492
  /** @type {?} */
2349
- var elements = /** @type {?} */ ((this._boundingBox)).querySelectorAll(this._transformOriginSelector);
2493
+ var elements = (/** @type {?} */ (this._boundingBox)).querySelectorAll(this._transformOriginSelector);
2350
2494
  /** @type {?} */
2351
2495
  var xOrigin;
2352
2496
  /** @type {?} */
@@ -2369,6 +2513,13 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2369
2513
  *
2370
2514
  * This method does no measuring and applies no styles so that we can cheaply compute the
2371
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
2372
2523
  * @param {?} origin
2373
2524
  * @param {?} position
2374
2525
  * @return {?}
@@ -2378,6 +2529,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2378
2529
  *
2379
2530
  * This method does no measuring and applies no styles so that we can cheaply compute the
2380
2531
  * bounds for all positions and choose the best fit based on these results.
2532
+ * @private
2381
2533
  * @param {?} origin
2382
2534
  * @param {?} position
2383
2535
  * @return {?}
@@ -2406,6 +2558,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2406
2558
  height = viewport.height - bottom + this._viewportMargin;
2407
2559
  }
2408
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`.
2409
2565
  /** @type {?} */
2410
2566
  var smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y + viewport.top, origin.y);
2411
2567
  /** @type {?} */
@@ -2416,9 +2572,11 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2416
2572
  top = origin.y - (previousHeight / 2);
2417
2573
  }
2418
2574
  }
2575
+ // The overlay is opening 'right-ward' (the content flows to the right).
2419
2576
  /** @type {?} */
2420
2577
  var isBoundedByRightViewportEdge = (position.overlayX === 'start' && !isRtl) ||
2421
2578
  (position.overlayX === 'end' && isRtl);
2579
+ // The overlay is opening 'left-ward' (the content flows to the left).
2422
2580
  /** @type {?} */
2423
2581
  var isBoundedByLeftViewportEdge = (position.overlayX === 'end' && !isRtl) ||
2424
2582
  (position.overlayX === 'start' && isRtl);
@@ -2437,6 +2595,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2437
2595
  width = viewport.right - origin.x;
2438
2596
  }
2439
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`.
2440
2602
  /** @type {?} */
2441
2603
  var smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x + viewport.left, origin.x);
2442
2604
  /** @type {?} */
@@ -2447,12 +2609,20 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2447
2609
  left = origin.x - (previousWidth / 2);
2448
2610
  }
2449
2611
  }
2450
- 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 };
2451
2613
  };
2452
2614
  /**
2453
2615
  * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
2454
2616
  * origin's connection point and stetches to the bounds of the viewport.
2455
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
2456
2626
  * @param {?} origin The point on the origin element where the overlay is connected.
2457
2627
  * @param {?} position The position preference
2458
2628
  * @return {?}
@@ -2461,6 +2631,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2461
2631
  * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
2462
2632
  * origin's connection point and stetches to the bounds of the viewport.
2463
2633
  *
2634
+ * @private
2464
2635
  * @param {?} origin The point on the origin element where the overlay is connected.
2465
2636
  * @param {?} position The position preference
2466
2637
  * @return {?}
@@ -2475,7 +2646,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2475
2646
  boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);
2476
2647
  }
2477
2648
  /** @type {?} */
2478
- var styles = /** @type {?} */ ({});
2649
+ var styles = (/** @type {?} */ ({}));
2479
2650
  if (this._hasExactPosition()) {
2480
2651
  styles.top = styles.left = '0';
2481
2652
  styles.bottom = styles.right = '';
@@ -2513,18 +2684,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2513
2684
  }
2514
2685
  }
2515
2686
  this._lastBoundingBoxSize = boundingBoxRect;
2516
- extendStyles(/** @type {?} */ ((this._boundingBox)).style, styles);
2687
+ extendStyles((/** @type {?} */ (this._boundingBox)).style, styles);
2517
2688
  };
2689
+ /** Resets the styles for the bounding box so that a new positioning can be computed. */
2518
2690
  /**
2519
2691
  * Resets the styles for the bounding box so that a new positioning can be computed.
2692
+ * @private
2520
2693
  * @return {?}
2521
2694
  */
2522
2695
  FlexibleConnectedPositionStrategy.prototype._resetBoundingBoxStyles = /**
2523
2696
  * Resets the styles for the bounding box so that a new positioning can be computed.
2697
+ * @private
2524
2698
  * @return {?}
2525
2699
  */
2526
2700
  function () {
2527
- extendStyles(/** @type {?} */ ((this._boundingBox)).style, /** @type {?} */ ({
2701
+ extendStyles((/** @type {?} */ (this._boundingBox)).style, (/** @type {?} */ ({
2528
2702
  top: '0',
2529
2703
  left: '0',
2530
2704
  right: '0',
@@ -2533,40 +2707,46 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2533
2707
  width: '',
2534
2708
  alignItems: '',
2535
2709
  justifyContent: '',
2536
- }));
2710
+ })));
2537
2711
  };
2712
+ /** Resets the styles for the overlay pane so that a new positioning can be computed. */
2538
2713
  /**
2539
2714
  * Resets the styles for the overlay pane so that a new positioning can be computed.
2715
+ * @private
2540
2716
  * @return {?}
2541
2717
  */
2542
2718
  FlexibleConnectedPositionStrategy.prototype._resetOverlayElementStyles = /**
2543
2719
  * Resets the styles for the overlay pane so that a new positioning can be computed.
2720
+ * @private
2544
2721
  * @return {?}
2545
2722
  */
2546
2723
  function () {
2547
- extendStyles(this._pane.style, /** @type {?} */ ({
2724
+ extendStyles(this._pane.style, (/** @type {?} */ ({
2548
2725
  top: '',
2549
2726
  left: '',
2550
2727
  bottom: '',
2551
2728
  right: '',
2552
2729
  position: '',
2553
- }));
2730
+ })));
2554
2731
  };
2732
+ /** Sets positioning styles to the overlay element. */
2555
2733
  /**
2556
2734
  * Sets positioning styles to the overlay element.
2735
+ * @private
2557
2736
  * @param {?} originPoint
2558
2737
  * @param {?} position
2559
2738
  * @return {?}
2560
2739
  */
2561
2740
  FlexibleConnectedPositionStrategy.prototype._setOverlayElementStyles = /**
2562
2741
  * Sets positioning styles to the overlay element.
2742
+ * @private
2563
2743
  * @param {?} originPoint
2564
2744
  * @param {?} position
2565
2745
  * @return {?}
2566
2746
  */
2567
2747
  function (originPoint, position) {
2568
2748
  /** @type {?} */
2569
- var styles = /** @type {?} */ ({});
2749
+ var styles = (/** @type {?} */ ({}));
2570
2750
  if (this._hasExactPosition()) {
2571
2751
  /** @type {?} */
2572
2752
  var scrollPosition = this._viewportRuler.getViewportScrollPosition();
@@ -2576,6 +2756,11 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2576
2756
  else {
2577
2757
  styles.position = 'static';
2578
2758
  }
2759
+ // Use a transform to apply the offsets. We do this because the `center` positions rely on
2760
+ // being in the normal flex flow and setting a `top` / `left` at all will completely throw
2761
+ // off the position. We also can't use margins, because they won't have an effect in some
2762
+ // cases where the element doesn't have anything to "push off of". Finally, this works
2763
+ // better both with flexible and non-flexible positioning.
2579
2764
  /** @type {?} */
2580
2765
  var transformString = '';
2581
2766
  /** @type {?} */
@@ -2600,8 +2785,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2600
2785
  }
2601
2786
  extendStyles(this._pane.style, styles);
2602
2787
  };
2788
+ /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */
2603
2789
  /**
2604
2790
  * Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing.
2791
+ * @private
2605
2792
  * @param {?} position
2606
2793
  * @param {?} originPoint
2607
2794
  * @param {?} scrollPosition
@@ -2609,19 +2796,25 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2609
2796
  */
2610
2797
  FlexibleConnectedPositionStrategy.prototype._getExactOverlayY = /**
2611
2798
  * Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing.
2799
+ * @private
2612
2800
  * @param {?} position
2613
2801
  * @param {?} originPoint
2614
2802
  * @param {?} scrollPosition
2615
2803
  * @return {?}
2616
2804
  */
2617
2805
  function (position, originPoint, scrollPosition) {
2806
+ // Reset any existing styles. This is necessary in case the
2807
+ // preferred position has changed since the last `apply`.
2618
2808
  /** @type {?} */
2619
- var styles = /** @type {?} */ ({ top: null, bottom: null });
2809
+ var styles = (/** @type {?} */ ({ top: null, bottom: null }));
2620
2810
  /** @type {?} */
2621
2811
  var overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2622
2812
  if (this._isPushed) {
2623
2813
  overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2624
2814
  }
2815
+ // @breaking-change 8.0.0 Currently the `_overlayContainer` is optional in order to avoid a
2816
+ // breaking change. The null check here can be removed once the `_overlayContainer` becomes
2817
+ // a required parameter.
2625
2818
  /** @type {?} */
2626
2819
  var virtualKeyboardOffset = this._overlayContainer ?
2627
2820
  this._overlayContainer.getContainerElement().getBoundingClientRect().top : 0;
@@ -2633,8 +2826,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2633
2826
  // We want to set either `top` or `bottom` based on whether the overlay wants to appear
2634
2827
  // above or below the origin and the direction in which the element will expand.
2635
2828
  if (position.overlayY === 'bottom') {
2829
+ // When using `bottom`, we adjust the y position such that it is the distance
2830
+ // from the bottom of the viewport rather than the top.
2636
2831
  /** @type {?} */
2637
- var documentHeight = /** @type {?} */ ((this._document.documentElement)).clientHeight;
2832
+ var documentHeight = (/** @type {?} */ (this._document.documentElement)).clientHeight;
2638
2833
  styles.bottom = documentHeight - (overlayPoint.y + this._overlayRect.height) + "px";
2639
2834
  }
2640
2835
  else {
@@ -2642,8 +2837,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2642
2837
  }
2643
2838
  return styles;
2644
2839
  };
2840
+ /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */
2645
2841
  /**
2646
2842
  * Gets the exact left/right for the overlay when not using flexible sizing or when pushing.
2843
+ * @private
2647
2844
  * @param {?} position
2648
2845
  * @param {?} originPoint
2649
2846
  * @param {?} scrollPosition
@@ -2651,19 +2848,26 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2651
2848
  */
2652
2849
  FlexibleConnectedPositionStrategy.prototype._getExactOverlayX = /**
2653
2850
  * Gets the exact left/right for the overlay when not using flexible sizing or when pushing.
2851
+ * @private
2654
2852
  * @param {?} position
2655
2853
  * @param {?} originPoint
2656
2854
  * @param {?} scrollPosition
2657
2855
  * @return {?}
2658
2856
  */
2659
2857
  function (position, originPoint, scrollPosition) {
2858
+ // Reset any existing styles. This is necessary in case the preferred position has
2859
+ // changed since the last `apply`.
2660
2860
  /** @type {?} */
2661
- var styles = /** @type {?} */ ({ left: null, right: null });
2861
+ var styles = (/** @type {?} */ ({ left: null, right: null }));
2662
2862
  /** @type {?} */
2663
2863
  var overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2664
2864
  if (this._isPushed) {
2665
2865
  overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2666
2866
  }
2867
+ // We want to set either `left` or `right` based on whether the overlay wants to appear "before"
2868
+ // or "after" the origin, which determines the direction in which the element will expand.
2869
+ // For the horizontal axis, the meaning of "before" and "after" change based on whether the
2870
+ // page is in RTL or LTR.
2667
2871
  /** @type {?} */
2668
2872
  var horizontalStyleProperty;
2669
2873
  if (this._isRtl()) {
@@ -2676,7 +2880,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2676
2880
  // from the right edge of the viewport rather than the left edge.
2677
2881
  if (horizontalStyleProperty === 'right') {
2678
2882
  /** @type {?} */
2679
- var documentWidth = /** @type {?} */ ((this._document.documentElement)).clientWidth;
2883
+ var documentWidth = (/** @type {?} */ (this._document.documentElement)).clientWidth;
2680
2884
  styles.right = documentWidth - (overlayPoint.x + this._overlayRect.width) + "px";
2681
2885
  }
2682
2886
  else {
@@ -2687,18 +2891,28 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2687
2891
  /**
2688
2892
  * Gets the view properties of the trigger and overlay, including whether they are clipped
2689
2893
  * or completely outside the view of any of the strategy's scrollables.
2894
+ */
2895
+ /**
2896
+ * Gets the view properties of the trigger and overlay, including whether they are clipped
2897
+ * or completely outside the view of any of the strategy's scrollables.
2898
+ * @private
2690
2899
  * @return {?}
2691
2900
  */
2692
2901
  FlexibleConnectedPositionStrategy.prototype._getScrollVisibility = /**
2693
2902
  * Gets the view properties of the trigger and overlay, including whether they are clipped
2694
2903
  * or completely outside the view of any of the strategy's scrollables.
2904
+ * @private
2695
2905
  * @return {?}
2696
2906
  */
2697
2907
  function () {
2908
+ // Note: needs fresh rects since the position could've changed.
2698
2909
  /** @type {?} */
2699
2910
  var originBounds = this._origin.getBoundingClientRect();
2700
2911
  /** @type {?} */
2701
2912
  var overlayBounds = this._pane.getBoundingClientRect();
2913
+ // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers
2914
+ // every time, we should be able to use the scrollTop of the containers if the size of those
2915
+ // containers hasn't changed.
2702
2916
  /** @type {?} */
2703
2917
  var scrollContainerBounds = this.scrollables.map(function (scrollable) {
2704
2918
  return scrollable.getElementRef().nativeElement.getBoundingClientRect();
@@ -2710,14 +2924,17 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2710
2924
  isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds),
2711
2925
  };
2712
2926
  };
2927
+ /** Subtracts the amount that an element is overflowing on an axis from it's length. */
2713
2928
  /**
2714
2929
  * Subtracts the amount that an element is overflowing on an axis from it's length.
2930
+ * @private
2715
2931
  * @param {?} length
2716
2932
  * @param {...?} overflows
2717
2933
  * @return {?}
2718
2934
  */
2719
2935
  FlexibleConnectedPositionStrategy.prototype._subtractOverflows = /**
2720
2936
  * Subtracts the amount that an element is overflowing on an axis from it's length.
2937
+ * @private
2721
2938
  * @param {?} length
2722
2939
  * @param {...?} overflows
2723
2940
  * @return {?}
@@ -2731,19 +2948,27 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2731
2948
  return currentValue - Math.max(currentOverflow, 0);
2732
2949
  }, length);
2733
2950
  };
2951
+ /** Narrows the given viewport rect by the current _viewportMargin. */
2734
2952
  /**
2735
2953
  * Narrows the given viewport rect by the current _viewportMargin.
2954
+ * @private
2736
2955
  * @return {?}
2737
2956
  */
2738
2957
  FlexibleConnectedPositionStrategy.prototype._getNarrowedViewportRect = /**
2739
2958
  * Narrows the given viewport rect by the current _viewportMargin.
2959
+ * @private
2740
2960
  * @return {?}
2741
2961
  */
2742
2962
  function () {
2963
+ // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,
2964
+ // because we want to use the `clientWidth` and `clientHeight` as the base. The difference
2965
+ // being that the client properties don't include the scrollbar, as opposed to `innerWidth`
2966
+ // and `innerHeight` that do. This is necessary, because the overlay container uses
2967
+ // 100% `width` and `height` which don't include the scrollbar either.
2743
2968
  /** @type {?} */
2744
- var width = /** @type {?} */ ((this._document.documentElement)).clientWidth;
2969
+ var width = (/** @type {?} */ (this._document.documentElement)).clientWidth;
2745
2970
  /** @type {?} */
2746
- var height = /** @type {?} */ ((this._document.documentElement)).clientHeight;
2971
+ var height = (/** @type {?} */ (this._document.documentElement)).clientHeight;
2747
2972
  /** @type {?} */
2748
2973
  var scrollPosition = this._viewportRuler.getViewportScrollPosition();
2749
2974
  return {
@@ -2755,36 +2980,45 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2755
2980
  height: height - (2 * this._viewportMargin),
2756
2981
  };
2757
2982
  };
2983
+ /** Whether the we're dealing with an RTL context */
2758
2984
  /**
2759
2985
  * Whether the we're dealing with an RTL context
2986
+ * @private
2760
2987
  * @return {?}
2761
2988
  */
2762
2989
  FlexibleConnectedPositionStrategy.prototype._isRtl = /**
2763
2990
  * Whether the we're dealing with an RTL context
2991
+ * @private
2764
2992
  * @return {?}
2765
2993
  */
2766
2994
  function () {
2767
2995
  return this._overlayRef.getDirection() === 'rtl';
2768
2996
  };
2997
+ /** Determines whether the overlay uses exact or flexible positioning. */
2769
2998
  /**
2770
2999
  * Determines whether the overlay uses exact or flexible positioning.
3000
+ * @private
2771
3001
  * @return {?}
2772
3002
  */
2773
3003
  FlexibleConnectedPositionStrategy.prototype._hasExactPosition = /**
2774
3004
  * Determines whether the overlay uses exact or flexible positioning.
3005
+ * @private
2775
3006
  * @return {?}
2776
3007
  */
2777
3008
  function () {
2778
3009
  return !this._hasFlexibleDimensions || this._isPushed;
2779
3010
  };
3011
+ /** Retrieves the offset of a position along the x or y axis. */
2780
3012
  /**
2781
3013
  * Retrieves the offset of a position along the x or y axis.
3014
+ * @private
2782
3015
  * @param {?} position
2783
3016
  * @param {?} axis
2784
3017
  * @return {?}
2785
3018
  */
2786
3019
  FlexibleConnectedPositionStrategy.prototype._getOffset = /**
2787
3020
  * Retrieves the offset of a position along the x or y axis.
3021
+ * @private
2788
3022
  * @param {?} position
2789
3023
  * @param {?} axis
2790
3024
  * @return {?}
@@ -2797,12 +3031,15 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2797
3031
  }
2798
3032
  return position.offsetY == null ? this._offsetY : position.offsetY;
2799
3033
  };
3034
+ /** Validates that the current position match the expected values. */
2800
3035
  /**
2801
3036
  * Validates that the current position match the expected values.
3037
+ * @private
2802
3038
  * @return {?}
2803
3039
  */
2804
3040
  FlexibleConnectedPositionStrategy.prototype._validatePositions = /**
2805
3041
  * Validates that the current position match the expected values.
3042
+ * @private
2806
3043
  * @return {?}
2807
3044
  */
2808
3045
  function () {
@@ -2818,13 +3055,16 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2818
3055
  validateVerticalPosition('overlayY', pair.overlayY);
2819
3056
  });
2820
3057
  };
3058
+ /** Adds a single CSS class or an array of classes on the overlay panel. */
2821
3059
  /**
2822
3060
  * Adds a single CSS class or an array of classes on the overlay panel.
3061
+ * @private
2823
3062
  * @param {?} cssClasses
2824
3063
  * @return {?}
2825
3064
  */
2826
3065
  FlexibleConnectedPositionStrategy.prototype._addPanelClasses = /**
2827
3066
  * Adds a single CSS class or an array of classes on the overlay panel.
3067
+ * @private
2828
3068
  * @param {?} cssClasses
2829
3069
  * @return {?}
2830
3070
  */
@@ -2839,12 +3079,15 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2839
3079
  });
2840
3080
  }
2841
3081
  };
3082
+ /** Clears the classes that the position strategy has applied from the overlay panel. */
2842
3083
  /**
2843
3084
  * Clears the classes that the position strategy has applied from the overlay panel.
3085
+ * @private
2844
3086
  * @return {?}
2845
3087
  */
2846
3088
  FlexibleConnectedPositionStrategy.prototype._clearPanelClasses = /**
2847
3089
  * Clears the classes that the position strategy has applied from the overlay panel.
3090
+ * @private
2848
3091
  * @return {?}
2849
3092
  */
2850
3093
  function () {
@@ -2873,7 +3116,7 @@ function extendStyles(dest, source) {
2873
3116
 
2874
3117
  /**
2875
3118
  * @fileoverview added by tsickle
2876
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3119
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2877
3120
  */
2878
3121
  /**
2879
3122
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -3060,26 +3303,30 @@ ConnectedPositionStrategy = /** @class */ (function () {
3060
3303
  */
3061
3304
  /**
3062
3305
  * Adds a new preferred fallback position.
3306
+ * @template THIS
3307
+ * @this {THIS}
3063
3308
  * @param {?} originPos
3064
3309
  * @param {?} overlayPos
3065
3310
  * @param {?=} offsetX
3066
3311
  * @param {?=} offsetY
3067
- * @return {?}
3312
+ * @return {THIS}
3068
3313
  */
3069
3314
  ConnectedPositionStrategy.prototype.withFallbackPosition = /**
3070
3315
  * Adds a new preferred fallback position.
3316
+ * @template THIS
3317
+ * @this {THIS}
3071
3318
  * @param {?} originPos
3072
3319
  * @param {?} overlayPos
3073
3320
  * @param {?=} offsetX
3074
3321
  * @param {?=} offsetY
3075
- * @return {?}
3322
+ * @return {THIS}
3076
3323
  */
3077
3324
  function (originPos, overlayPos, offsetX, offsetY) {
3078
3325
  /** @type {?} */
3079
3326
  var position = new ConnectionPositionPair(originPos, overlayPos, offsetX, offsetY);
3080
- this._preferredPositions.push(position);
3081
- this._positionStrategy.withPositions(this._preferredPositions);
3082
- return this;
3327
+ (/** @type {?} */ (this))._preferredPositions.push(position);
3328
+ (/** @type {?} */ (this))._positionStrategy.withPositions((/** @type {?} */ (this))._preferredPositions);
3329
+ return (/** @type {?} */ (this));
3083
3330
  };
3084
3331
  /**
3085
3332
  * Sets the layout direction so the overlay's position can be adjusted to match.
@@ -3087,25 +3334,29 @@ ConnectedPositionStrategy = /** @class */ (function () {
3087
3334
  */
3088
3335
  /**
3089
3336
  * Sets the layout direction so the overlay's position can be adjusted to match.
3337
+ * @template THIS
3338
+ * @this {THIS}
3090
3339
  * @param {?} dir New layout direction.
3091
- * @return {?}
3340
+ * @return {THIS}
3092
3341
  */
3093
3342
  ConnectedPositionStrategy.prototype.withDirection = /**
3094
3343
  * Sets the layout direction so the overlay's position can be adjusted to match.
3344
+ * @template THIS
3345
+ * @this {THIS}
3095
3346
  * @param {?} dir New layout direction.
3096
- * @return {?}
3347
+ * @return {THIS}
3097
3348
  */
3098
3349
  function (dir) {
3099
3350
  // Since the direction might be declared before the strategy is attached,
3100
3351
  // we save the value in a temporary property and we'll transfer it to the
3101
3352
  // overlay ref on attachment.
3102
- if (this._overlayRef) {
3103
- this._overlayRef.setDirection(dir);
3353
+ if ((/** @type {?} */ (this))._overlayRef) {
3354
+ (/** @type {?} */ (this))._overlayRef.setDirection(dir);
3104
3355
  }
3105
3356
  else {
3106
- this._direction = dir;
3357
+ (/** @type {?} */ (this))._direction = dir;
3107
3358
  }
3108
- return this;
3359
+ return (/** @type {?} */ (this));
3109
3360
  };
3110
3361
  /**
3111
3362
  * Sets an offset for the overlay's connection point on the x-axis
@@ -3113,17 +3364,21 @@ ConnectedPositionStrategy = /** @class */ (function () {
3113
3364
  */
3114
3365
  /**
3115
3366
  * Sets an offset for the overlay's connection point on the x-axis
3367
+ * @template THIS
3368
+ * @this {THIS}
3116
3369
  * @param {?} offset New offset in the X axis.
3117
- * @return {?}
3370
+ * @return {THIS}
3118
3371
  */
3119
3372
  ConnectedPositionStrategy.prototype.withOffsetX = /**
3120
3373
  * Sets an offset for the overlay's connection point on the x-axis
3374
+ * @template THIS
3375
+ * @this {THIS}
3121
3376
  * @param {?} offset New offset in the X axis.
3122
- * @return {?}
3377
+ * @return {THIS}
3123
3378
  */
3124
3379
  function (offset) {
3125
- this._positionStrategy.withDefaultOffsetX(offset);
3126
- return this;
3380
+ (/** @type {?} */ (this))._positionStrategy.withDefaultOffsetX(offset);
3381
+ return (/** @type {?} */ (this));
3127
3382
  };
3128
3383
  /**
3129
3384
  * Sets an offset for the overlay's connection point on the y-axis
@@ -3131,17 +3386,21 @@ ConnectedPositionStrategy = /** @class */ (function () {
3131
3386
  */
3132
3387
  /**
3133
3388
  * Sets an offset for the overlay's connection point on the y-axis
3389
+ * @template THIS
3390
+ * @this {THIS}
3134
3391
  * @param {?} offset New offset in the Y axis.
3135
- * @return {?}
3392
+ * @return {THIS}
3136
3393
  */
3137
3394
  ConnectedPositionStrategy.prototype.withOffsetY = /**
3138
3395
  * Sets an offset for the overlay's connection point on the y-axis
3396
+ * @template THIS
3397
+ * @this {THIS}
3139
3398
  * @param {?} offset New offset in the Y axis.
3140
- * @return {?}
3399
+ * @return {THIS}
3141
3400
  */
3142
3401
  function (offset) {
3143
- this._positionStrategy.withDefaultOffsetY(offset);
3144
- return this;
3402
+ (/** @type {?} */ (this))._positionStrategy.withDefaultOffsetY(offset);
3403
+ return (/** @type {?} */ (this));
3145
3404
  };
3146
3405
  /**
3147
3406
  * Sets whether the overlay's position should be locked in after it is positioned
@@ -3153,19 +3412,23 @@ ConnectedPositionStrategy = /** @class */ (function () {
3153
3412
  * Sets whether the overlay's position should be locked in after it is positioned
3154
3413
  * initially. When an overlay is locked in, it won't attempt to reposition itself
3155
3414
  * when the position is re-applied (e.g. when the user scrolls away).
3415
+ * @template THIS
3416
+ * @this {THIS}
3156
3417
  * @param {?} isLocked Whether the overlay should locked in.
3157
- * @return {?}
3418
+ * @return {THIS}
3158
3419
  */
3159
3420
  ConnectedPositionStrategy.prototype.withLockedPosition = /**
3160
3421
  * Sets whether the overlay's position should be locked in after it is positioned
3161
3422
  * initially. When an overlay is locked in, it won't attempt to reposition itself
3162
3423
  * when the position is re-applied (e.g. when the user scrolls away).
3424
+ * @template THIS
3425
+ * @this {THIS}
3163
3426
  * @param {?} isLocked Whether the overlay should locked in.
3164
- * @return {?}
3427
+ * @return {THIS}
3165
3428
  */
3166
3429
  function (isLocked) {
3167
- this._positionStrategy.withLockedPosition(isLocked);
3168
- return this;
3430
+ (/** @type {?} */ (this))._positionStrategy.withLockedPosition(isLocked);
3431
+ return (/** @type {?} */ (this));
3169
3432
  };
3170
3433
  /**
3171
3434
  * Overwrites the current set of positions with an array of new ones.
@@ -3173,18 +3436,22 @@ ConnectedPositionStrategy = /** @class */ (function () {
3173
3436
  */
3174
3437
  /**
3175
3438
  * Overwrites the current set of positions with an array of new ones.
3439
+ * @template THIS
3440
+ * @this {THIS}
3176
3441
  * @param {?} positions Position pairs to be set on the strategy.
3177
- * @return {?}
3442
+ * @return {THIS}
3178
3443
  */
3179
3444
  ConnectedPositionStrategy.prototype.withPositions = /**
3180
3445
  * Overwrites the current set of positions with an array of new ones.
3446
+ * @template THIS
3447
+ * @this {THIS}
3181
3448
  * @param {?} positions Position pairs to be set on the strategy.
3182
- * @return {?}
3449
+ * @return {THIS}
3183
3450
  */
3184
3451
  function (positions) {
3185
- this._preferredPositions = positions.slice();
3186
- this._positionStrategy.withPositions(this._preferredPositions);
3187
- return this;
3452
+ (/** @type {?} */ (this))._preferredPositions = positions.slice();
3453
+ (/** @type {?} */ (this))._positionStrategy.withPositions((/** @type {?} */ (this))._preferredPositions);
3454
+ return (/** @type {?} */ (this));
3188
3455
  };
3189
3456
  /**
3190
3457
  * Sets the origin element, relative to which to position the overlay.
@@ -3192,29 +3459,34 @@ ConnectedPositionStrategy = /** @class */ (function () {
3192
3459
  */
3193
3460
  /**
3194
3461
  * Sets the origin element, relative to which to position the overlay.
3462
+ * @template THIS
3463
+ * @this {THIS}
3195
3464
  * @param {?} origin Reference to the new origin element.
3196
- * @return {?}
3465
+ * @return {THIS}
3197
3466
  */
3198
3467
  ConnectedPositionStrategy.prototype.setOrigin = /**
3199
3468
  * Sets the origin element, relative to which to position the overlay.
3469
+ * @template THIS
3470
+ * @this {THIS}
3200
3471
  * @param {?} origin Reference to the new origin element.
3201
- * @return {?}
3472
+ * @return {THIS}
3202
3473
  */
3203
3474
  function (origin) {
3204
- this._positionStrategy.setOrigin(origin);
3205
- return this;
3475
+ (/** @type {?} */ (this))._positionStrategy.setOrigin(origin);
3476
+ return (/** @type {?} */ (this));
3206
3477
  };
3207
3478
  return ConnectedPositionStrategy;
3208
3479
  }());
3209
3480
 
3210
3481
  /**
3211
3482
  * @fileoverview added by tsickle
3212
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3483
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3213
3484
  */
3214
3485
 
3215
- /** *
3486
+ /**
3216
3487
  * Class to be added to the overlay pane wrapper.
3217
- @type {?} */
3488
+ * @type {?}
3489
+ */
3218
3490
  var wrapperClass = 'cdk-global-overlay-wrapper';
3219
3491
  /**
3220
3492
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -3267,20 +3539,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3267
3539
  */
3268
3540
  /**
3269
3541
  * Sets the top position of the overlay. Clears any previously set vertical position.
3542
+ * @template THIS
3543
+ * @this {THIS}
3270
3544
  * @param {?=} value New top offset.
3271
- * @return {?}
3545
+ * @return {THIS}
3272
3546
  */
3273
3547
  GlobalPositionStrategy.prototype.top = /**
3274
3548
  * Sets the top position of the overlay. Clears any previously set vertical position.
3549
+ * @template THIS
3550
+ * @this {THIS}
3275
3551
  * @param {?=} value New top offset.
3276
- * @return {?}
3552
+ * @return {THIS}
3277
3553
  */
3278
3554
  function (value) {
3279
3555
  if (value === void 0) { value = ''; }
3280
- this._bottomOffset = '';
3281
- this._topOffset = value;
3282
- this._alignItems = 'flex-start';
3283
- return this;
3556
+ (/** @type {?} */ (this))._bottomOffset = '';
3557
+ (/** @type {?} */ (this))._topOffset = value;
3558
+ (/** @type {?} */ (this))._alignItems = 'flex-start';
3559
+ return (/** @type {?} */ (this));
3284
3560
  };
3285
3561
  /**
3286
3562
  * Sets the left position of the overlay. Clears any previously set horizontal position.
@@ -3288,20 +3564,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3288
3564
  */
3289
3565
  /**
3290
3566
  * Sets the left position of the overlay. Clears any previously set horizontal position.
3567
+ * @template THIS
3568
+ * @this {THIS}
3291
3569
  * @param {?=} value New left offset.
3292
- * @return {?}
3570
+ * @return {THIS}
3293
3571
  */
3294
3572
  GlobalPositionStrategy.prototype.left = /**
3295
3573
  * Sets the left position of the overlay. Clears any previously set horizontal position.
3574
+ * @template THIS
3575
+ * @this {THIS}
3296
3576
  * @param {?=} value New left offset.
3297
- * @return {?}
3577
+ * @return {THIS}
3298
3578
  */
3299
3579
  function (value) {
3300
3580
  if (value === void 0) { value = ''; }
3301
- this._rightOffset = '';
3302
- this._leftOffset = value;
3303
- this._justifyContent = 'flex-start';
3304
- return this;
3581
+ (/** @type {?} */ (this))._rightOffset = '';
3582
+ (/** @type {?} */ (this))._leftOffset = value;
3583
+ (/** @type {?} */ (this))._justifyContent = 'flex-start';
3584
+ return (/** @type {?} */ (this));
3305
3585
  };
3306
3586
  /**
3307
3587
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
@@ -3309,20 +3589,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3309
3589
  */
3310
3590
  /**
3311
3591
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
3592
+ * @template THIS
3593
+ * @this {THIS}
3312
3594
  * @param {?=} value New bottom offset.
3313
- * @return {?}
3595
+ * @return {THIS}
3314
3596
  */
3315
3597
  GlobalPositionStrategy.prototype.bottom = /**
3316
3598
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
3599
+ * @template THIS
3600
+ * @this {THIS}
3317
3601
  * @param {?=} value New bottom offset.
3318
- * @return {?}
3602
+ * @return {THIS}
3319
3603
  */
3320
3604
  function (value) {
3321
3605
  if (value === void 0) { value = ''; }
3322
- this._topOffset = '';
3323
- this._bottomOffset = value;
3324
- this._alignItems = 'flex-end';
3325
- return this;
3606
+ (/** @type {?} */ (this))._topOffset = '';
3607
+ (/** @type {?} */ (this))._bottomOffset = value;
3608
+ (/** @type {?} */ (this))._alignItems = 'flex-end';
3609
+ return (/** @type {?} */ (this));
3326
3610
  };
3327
3611
  /**
3328
3612
  * Sets the right position of the overlay. Clears any previously set horizontal position.
@@ -3330,20 +3614,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3330
3614
  */
3331
3615
  /**
3332
3616
  * Sets the right position of the overlay. Clears any previously set horizontal position.
3617
+ * @template THIS
3618
+ * @this {THIS}
3333
3619
  * @param {?=} value New right offset.
3334
- * @return {?}
3620
+ * @return {THIS}
3335
3621
  */
3336
3622
  GlobalPositionStrategy.prototype.right = /**
3337
3623
  * Sets the right position of the overlay. Clears any previously set horizontal position.
3624
+ * @template THIS
3625
+ * @this {THIS}
3338
3626
  * @param {?=} value New right offset.
3339
- * @return {?}
3627
+ * @return {THIS}
3340
3628
  */
3341
3629
  function (value) {
3342
3630
  if (value === void 0) { value = ''; }
3343
- this._leftOffset = '';
3344
- this._rightOffset = value;
3345
- this._justifyContent = 'flex-end';
3346
- return this;
3631
+ (/** @type {?} */ (this))._leftOffset = '';
3632
+ (/** @type {?} */ (this))._rightOffset = value;
3633
+ (/** @type {?} */ (this))._justifyContent = 'flex-end';
3634
+ return (/** @type {?} */ (this));
3347
3635
  };
3348
3636
  /**
3349
3637
  * Sets the overlay width and clears any previously set width.
@@ -3355,25 +3643,29 @@ GlobalPositionStrategy = /** @class */ (function () {
3355
3643
  * Sets the overlay width and clears any previously set width.
3356
3644
  * @deprecated Pass the `width` through the `OverlayConfig`.
3357
3645
  * \@breaking-change 8.0.0
3646
+ * @template THIS
3647
+ * @this {THIS}
3358
3648
  * @param {?=} value New width for the overlay
3359
- * @return {?}
3649
+ * @return {THIS}
3360
3650
  */
3361
3651
  GlobalPositionStrategy.prototype.width = /**
3362
3652
  * Sets the overlay width and clears any previously set width.
3363
3653
  * @deprecated Pass the `width` through the `OverlayConfig`.
3364
3654
  * \@breaking-change 8.0.0
3655
+ * @template THIS
3656
+ * @this {THIS}
3365
3657
  * @param {?=} value New width for the overlay
3366
- * @return {?}
3658
+ * @return {THIS}
3367
3659
  */
3368
3660
  function (value) {
3369
3661
  if (value === void 0) { value = ''; }
3370
- if (this._overlayRef) {
3371
- this._overlayRef.updateSize({ width: value });
3662
+ if ((/** @type {?} */ (this))._overlayRef) {
3663
+ (/** @type {?} */ (this))._overlayRef.updateSize({ width: value });
3372
3664
  }
3373
3665
  else {
3374
- this._width = value;
3666
+ (/** @type {?} */ (this))._width = value;
3375
3667
  }
3376
- return this;
3668
+ return (/** @type {?} */ (this));
3377
3669
  };
3378
3670
  /**
3379
3671
  * Sets the overlay height and clears any previously set height.
@@ -3385,25 +3677,29 @@ GlobalPositionStrategy = /** @class */ (function () {
3385
3677
  * Sets the overlay height and clears any previously set height.
3386
3678
  * @deprecated Pass the `height` through the `OverlayConfig`.
3387
3679
  * \@breaking-change 8.0.0
3680
+ * @template THIS
3681
+ * @this {THIS}
3388
3682
  * @param {?=} value New height for the overlay
3389
- * @return {?}
3683
+ * @return {THIS}
3390
3684
  */
3391
3685
  GlobalPositionStrategy.prototype.height = /**
3392
3686
  * Sets the overlay height and clears any previously set height.
3393
3687
  * @deprecated Pass the `height` through the `OverlayConfig`.
3394
3688
  * \@breaking-change 8.0.0
3689
+ * @template THIS
3690
+ * @this {THIS}
3395
3691
  * @param {?=} value New height for the overlay
3396
- * @return {?}
3692
+ * @return {THIS}
3397
3693
  */
3398
3694
  function (value) {
3399
3695
  if (value === void 0) { value = ''; }
3400
- if (this._overlayRef) {
3401
- this._overlayRef.updateSize({ height: value });
3696
+ if ((/** @type {?} */ (this))._overlayRef) {
3697
+ (/** @type {?} */ (this))._overlayRef.updateSize({ height: value });
3402
3698
  }
3403
3699
  else {
3404
- this._height = value;
3700
+ (/** @type {?} */ (this))._height = value;
3405
3701
  }
3406
- return this;
3702
+ return (/** @type {?} */ (this));
3407
3703
  };
3408
3704
  /**
3409
3705
  * Centers the overlay horizontally with an optional offset.
@@ -3415,21 +3711,25 @@ GlobalPositionStrategy = /** @class */ (function () {
3415
3711
  * Centers the overlay horizontally with an optional offset.
3416
3712
  * Clears any previously set horizontal position.
3417
3713
  *
3714
+ * @template THIS
3715
+ * @this {THIS}
3418
3716
  * @param {?=} offset Overlay offset from the horizontal center.
3419
- * @return {?}
3717
+ * @return {THIS}
3420
3718
  */
3421
3719
  GlobalPositionStrategy.prototype.centerHorizontally = /**
3422
3720
  * Centers the overlay horizontally with an optional offset.
3423
3721
  * Clears any previously set horizontal position.
3424
3722
  *
3723
+ * @template THIS
3724
+ * @this {THIS}
3425
3725
  * @param {?=} offset Overlay offset from the horizontal center.
3426
- * @return {?}
3726
+ * @return {THIS}
3427
3727
  */
3428
3728
  function (offset) {
3429
3729
  if (offset === void 0) { offset = ''; }
3430
- this.left(offset);
3431
- this._justifyContent = 'center';
3432
- return this;
3730
+ (/** @type {?} */ (this)).left(offset);
3731
+ (/** @type {?} */ (this))._justifyContent = 'center';
3732
+ return (/** @type {?} */ (this));
3433
3733
  };
3434
3734
  /**
3435
3735
  * Centers the overlay vertically with an optional offset.
@@ -3441,21 +3741,25 @@ GlobalPositionStrategy = /** @class */ (function () {
3441
3741
  * Centers the overlay vertically with an optional offset.
3442
3742
  * Clears any previously set vertical position.
3443
3743
  *
3744
+ * @template THIS
3745
+ * @this {THIS}
3444
3746
  * @param {?=} offset Overlay offset from the vertical center.
3445
- * @return {?}
3747
+ * @return {THIS}
3446
3748
  */
3447
3749
  GlobalPositionStrategy.prototype.centerVertically = /**
3448
3750
  * Centers the overlay vertically with an optional offset.
3449
3751
  * Clears any previously set vertical position.
3450
3752
  *
3753
+ * @template THIS
3754
+ * @this {THIS}
3451
3755
  * @param {?=} offset Overlay offset from the vertical center.
3452
- * @return {?}
3756
+ * @return {THIS}
3453
3757
  */
3454
3758
  function (offset) {
3455
3759
  if (offset === void 0) { offset = ''; }
3456
- this.top(offset);
3457
- this._alignItems = 'center';
3458
- return this;
3760
+ (/** @type {?} */ (this)).top(offset);
3761
+ (/** @type {?} */ (this))._alignItems = 'center';
3762
+ return (/** @type {?} */ (this));
3459
3763
  };
3460
3764
  /**
3461
3765
  * Apply the position to the element.
@@ -3539,7 +3843,7 @@ GlobalPositionStrategy = /** @class */ (function () {
3539
3843
  parent.classList.remove(wrapperClass);
3540
3844
  parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop =
3541
3845
  styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';
3542
- this._overlayRef = /** @type {?} */ ((null));
3846
+ this._overlayRef = (/** @type {?} */ (null));
3543
3847
  this._isDisposed = true;
3544
3848
  };
3545
3849
  return GlobalPositionStrategy;
@@ -3547,15 +3851,13 @@ GlobalPositionStrategy = /** @class */ (function () {
3547
3851
 
3548
3852
  /**
3549
3853
  * @fileoverview added by tsickle
3550
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3854
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3551
3855
  */
3552
3856
  /**
3553
3857
  * Builder for overlay position strategy.
3554
3858
  */
3555
3859
  var OverlayPositionBuilder = /** @class */ (function () {
3556
- function OverlayPositionBuilder(_viewportRuler, _document,
3557
- // @breaking-change 8.0.0 `_platform` and `_overlayContainer` parameters to be made required.
3558
- _platform, _overlayContainer) {
3860
+ function OverlayPositionBuilder(_viewportRuler, _document, _platform, _overlayContainer) {
3559
3861
  this._viewportRuler = _viewportRuler;
3560
3862
  this._document = _document;
3561
3863
  this._platform = _platform;
@@ -3637,12 +3939,15 @@ var OverlayPositionBuilder = /** @class */ (function () {
3637
3939
 
3638
3940
  /**
3639
3941
  * @fileoverview added by tsickle
3640
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3942
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3641
3943
  */
3642
- /** *
3944
+ /**
3643
3945
  * Next overlay unique ID.
3644
- @type {?} */
3946
+ * @type {?}
3947
+ */
3645
3948
  var nextUniqueId = 0;
3949
+ // Note that Overlay is *not* scoped to the app root because the ComponentFactoryResolver
3950
+ // it needs is different based on where OverlayModule is imported.
3646
3951
  /**
3647
3952
  * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
3648
3953
  * used as a low-level building block for other components. Dialogs, tooltips, menus,
@@ -3652,9 +3957,7 @@ var nextUniqueId = 0;
3652
3957
  * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.
3653
3958
  */
3654
3959
  var Overlay = /** @class */ (function () {
3655
- function Overlay(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality,
3656
- // @breaking-change 8.0.0 `_location` parameter to be made required.
3657
- _location) {
3960
+ function Overlay(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location) {
3658
3961
  this.scrollStrategies = scrollStrategies;
3659
3962
  this._overlayContainer = _overlayContainer;
3660
3963
  this._componentFactoryResolver = _componentFactoryResolver;
@@ -3713,11 +4016,17 @@ var Overlay = /** @class */ (function () {
3713
4016
  };
3714
4017
  /**
3715
4018
  * Creates the DOM element for an overlay and appends it to the overlay container.
4019
+ * @returns Newly-created pane element
4020
+ */
4021
+ /**
4022
+ * Creates the DOM element for an overlay and appends it to the overlay container.
4023
+ * @private
3716
4024
  * @param {?} host
3717
4025
  * @return {?} Newly-created pane element
3718
4026
  */
3719
4027
  Overlay.prototype._createPaneElement = /**
3720
4028
  * Creates the DOM element for an overlay and appends it to the overlay container.
4029
+ * @private
3721
4030
  * @param {?} host
3722
4031
  * @return {?} Newly-created pane element
3723
4032
  */
@@ -3732,11 +4041,18 @@ var Overlay = /** @class */ (function () {
3732
4041
  /**
3733
4042
  * Creates the host element that wraps around an overlay
3734
4043
  * and can be used for advanced positioning.
4044
+ * @returns Newly-create host element.
4045
+ */
4046
+ /**
4047
+ * Creates the host element that wraps around an overlay
4048
+ * and can be used for advanced positioning.
4049
+ * @private
3735
4050
  * @return {?} Newly-create host element.
3736
4051
  */
3737
4052
  Overlay.prototype._createHostElement = /**
3738
4053
  * Creates the host element that wraps around an overlay
3739
4054
  * and can be used for advanced positioning.
4055
+ * @private
3740
4056
  * @return {?} Newly-create host element.
3741
4057
  */
3742
4058
  function () {
@@ -3747,11 +4063,18 @@ var Overlay = /** @class */ (function () {
3747
4063
  };
3748
4064
  /**
3749
4065
  * Create a DomPortalOutlet into which the overlay content can be loaded.
4066
+ * @param pane The DOM element to turn into a portal outlet.
4067
+ * @returns A portal outlet for the given DOM element.
4068
+ */
4069
+ /**
4070
+ * Create a DomPortalOutlet into which the overlay content can be loaded.
4071
+ * @private
3750
4072
  * @param {?} pane The DOM element to turn into a portal outlet.
3751
4073
  * @return {?} A portal outlet for the given DOM element.
3752
4074
  */
3753
4075
  Overlay.prototype._createPortalOutlet = /**
3754
4076
  * Create a DomPortalOutlet into which the overlay content can be loaded.
4077
+ * @private
3755
4078
  * @param {?} pane The DOM element to turn into a portal outlet.
3756
4079
  * @return {?} A portal outlet for the given DOM element.
3757
4080
  */
@@ -3784,11 +4107,12 @@ var Overlay = /** @class */ (function () {
3784
4107
 
3785
4108
  /**
3786
4109
  * @fileoverview added by tsickle
3787
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4110
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3788
4111
  */
3789
- /** *
4112
+ /**
3790
4113
  * Default set of positions for the overlay. Follows the behavior of a dropdown.
3791
- @type {?} */
4114
+ * @type {?}
4115
+ */
3792
4116
  var defaultPositionList = [
3793
4117
  {
3794
4118
  originX: 'start',
@@ -3815,9 +4139,10 @@ var defaultPositionList = [
3815
4139
  overlayY: 'top'
3816
4140
  }
3817
4141
  ];
3818
- /** *
4142
+ /**
3819
4143
  * Injection token that determines the scroll handling while the connected overlay is open.
3820
- @type {?} */
4144
+ * @type {?}
4145
+ */
3821
4146
  var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken('cdk-connected-overlay-scroll-strategy');
3822
4147
  /**
3823
4148
  * Directive applied to an element to make it usable as an origin for an Overlay using a
@@ -4055,12 +4380,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4055
4380
  this.open ? this._attachOverlay() : this._detachOverlay();
4056
4381
  }
4057
4382
  };
4383
+ /** Creates an overlay */
4058
4384
  /**
4059
4385
  * Creates an overlay
4386
+ * @private
4060
4387
  * @return {?}
4061
4388
  */
4062
4389
  CdkConnectedOverlay.prototype._createOverlay = /**
4063
4390
  * Creates an overlay
4391
+ * @private
4064
4392
  * @return {?}
4065
4393
  */
4066
4394
  function () {
@@ -4076,12 +4404,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4076
4404
  }
4077
4405
  });
4078
4406
  };
4407
+ /** Builds the overlay config based on the directive's inputs */
4079
4408
  /**
4080
4409
  * Builds the overlay config based on the directive's inputs
4410
+ * @private
4081
4411
  * @return {?}
4082
4412
  */
4083
4413
  CdkConnectedOverlay.prototype._buildConfig = /**
4084
4414
  * Builds the overlay config based on the directive's inputs
4415
+ * @private
4085
4416
  * @return {?}
4086
4417
  */
4087
4418
  function () {
@@ -4114,13 +4445,16 @@ var CdkConnectedOverlay = /** @class */ (function () {
4114
4445
  }
4115
4446
  return overlayConfig;
4116
4447
  };
4448
+ /** Updates the state of a position strategy, based on the values of the directive inputs. */
4117
4449
  /**
4118
4450
  * Updates the state of a position strategy, based on the values of the directive inputs.
4451
+ * @private
4119
4452
  * @param {?} positionStrategy
4120
4453
  * @return {?}
4121
4454
  */
4122
4455
  CdkConnectedOverlay.prototype._updatePositionStrategy = /**
4123
4456
  * Updates the state of a position strategy, based on the values of the directive inputs.
4457
+ * @private
4124
4458
  * @param {?} positionStrategy
4125
4459
  * @return {?}
4126
4460
  */
@@ -4144,12 +4478,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4144
4478
  .withViewportMargin(this.viewportMargin)
4145
4479
  .withLockedPosition(this.lockPosition);
4146
4480
  };
4481
+ /** Returns the position strategy of the overlay to be set on the overlay config */
4147
4482
  /**
4148
4483
  * Returns the position strategy of the overlay to be set on the overlay config
4484
+ * @private
4149
4485
  * @return {?}
4150
4486
  */
4151
4487
  CdkConnectedOverlay.prototype._createPositionStrategy = /**
4152
4488
  * Returns the position strategy of the overlay to be set on the overlay config
4489
+ * @private
4153
4490
  * @return {?}
4154
4491
  */
4155
4492
  function () {
@@ -4160,12 +4497,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4160
4497
  strategy.positionChanges.subscribe(function (p) { return _this.positionChange.emit(p); });
4161
4498
  return strategy;
4162
4499
  };
4500
+ /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
4163
4501
  /**
4164
4502
  * Attaches the overlay and subscribes to backdrop clicks if backdrop exists
4503
+ * @private
4165
4504
  * @return {?}
4166
4505
  */
4167
4506
  CdkConnectedOverlay.prototype._attachOverlay = /**
4168
4507
  * Attaches the overlay and subscribes to backdrop clicks if backdrop exists
4508
+ * @private
4169
4509
  * @return {?}
4170
4510
  */
4171
4511
  function () {
@@ -4192,12 +4532,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4192
4532
  });
4193
4533
  }
4194
4534
  };
4535
+ /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
4195
4536
  /**
4196
4537
  * Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists
4538
+ * @private
4197
4539
  * @return {?}
4198
4540
  */
4199
4541
  CdkConnectedOverlay.prototype._detachOverlay = /**
4200
4542
  * Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists
4543
+ * @private
4201
4544
  * @return {?}
4202
4545
  */
4203
4546
  function () {
@@ -4207,12 +4550,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4207
4550
  }
4208
4551
  this._backdropSubscription.unsubscribe();
4209
4552
  };
4553
+ /** Destroys the overlay created by this directive. */
4210
4554
  /**
4211
4555
  * Destroys the overlay created by this directive.
4556
+ * @private
4212
4557
  * @return {?}
4213
4558
  */
4214
4559
  CdkConnectedOverlay.prototype._destroyOverlay = /**
4215
4560
  * Destroys the overlay created by this directive.
4561
+ * @private
4216
4562
  * @return {?}
4217
4563
  */
4218
4564
  function () {
@@ -4270,9 +4616,10 @@ var CdkConnectedOverlay = /** @class */ (function () {
4270
4616
  function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
4271
4617
  return function () { return overlay.scrollStrategies.reposition(); };
4272
4618
  }
4273
- /** *
4619
+ /**
4274
4620
  * \@docs-private
4275
- @type {?} */
4621
+ * @type {?}
4622
+ */
4276
4623
  var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
4277
4624
  provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
4278
4625
  deps: [Overlay],
@@ -4281,7 +4628,7 @@ var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
4281
4628
 
4282
4629
  /**
4283
4630
  * @fileoverview added by tsickle
4284
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4631
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4285
4632
  */
4286
4633
  var OverlayModule = /** @class */ (function () {
4287
4634
  function OverlayModule() {
@@ -4299,11 +4646,12 @@ var OverlayModule = /** @class */ (function () {
4299
4646
  ];
4300
4647
  return OverlayModule;
4301
4648
  }());
4302
- /** *
4649
+ /**
4303
4650
  * @deprecated Use `OverlayModule` instead.
4304
4651
  * \@breaking-change 8.0.0
4305
4652
  * \@docs-private
4306
- @type {?} */
4653
+ * @type {?}
4654
+ */
4307
4655
  var OVERLAY_PROVIDERS = [
4308
4656
  Overlay,
4309
4657
  OverlayPositionBuilder,
@@ -4315,7 +4663,7 @@ var OVERLAY_PROVIDERS = [
4315
4663
 
4316
4664
  /**
4317
4665
  * @fileoverview added by tsickle
4318
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4666
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4319
4667
  */
4320
4668
  /**
4321
4669
  * Alternative to OverlayContainer that supports correct displaying of overlay elements in
@@ -4342,9 +4690,11 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4342
4690
  }
4343
4691
  };
4344
4692
  /**
4693
+ * @protected
4345
4694
  * @return {?}
4346
4695
  */
4347
4696
  FullscreenOverlayContainer.prototype._createContainer = /**
4697
+ * @protected
4348
4698
  * @return {?}
4349
4699
  */
4350
4700
  function () {
@@ -4354,9 +4704,11 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4354
4704
  this._addFullscreenChangeListener(function () { return _this._adjustParentForFullscreenChange(); });
4355
4705
  };
4356
4706
  /**
4707
+ * @private
4357
4708
  * @return {?}
4358
4709
  */
4359
4710
  FullscreenOverlayContainer.prototype._adjustParentForFullscreenChange = /**
4711
+ * @private
4360
4712
  * @return {?}
4361
4713
  */
4362
4714
  function () {
@@ -4370,10 +4722,12 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4370
4722
  parent.appendChild(this._containerElement);
4371
4723
  };
4372
4724
  /**
4725
+ * @private
4373
4726
  * @param {?} fn
4374
4727
  * @return {?}
4375
4728
  */
4376
4729
  FullscreenOverlayContainer.prototype._addFullscreenChangeListener = /**
4730
+ * @private
4377
4731
  * @param {?} fn
4378
4732
  * @return {?}
4379
4733
  */
@@ -4389,9 +4743,11 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4389
4743
  }
4390
4744
  };
4391
4745
  /**
4746
+ * @private
4392
4747
  * @return {?}
4393
4748
  */
4394
4749
  FullscreenOverlayContainer.prototype._getEventName = /**
4750
+ * @private
4395
4751
  * @return {?}
4396
4752
  */
4397
4753
  function () {
@@ -4402,10 +4758,10 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4402
4758
  else if (this._document.webkitFullscreenEnabled) {
4403
4759
  this._fullScreenEventName = 'webkitfullscreenchange';
4404
4760
  }
4405
- else if ((/** @type {?} */ (this._document)).mozFullScreenEnabled) {
4761
+ else if (((/** @type {?} */ (this._document))).mozFullScreenEnabled) {
4406
4762
  this._fullScreenEventName = 'mozfullscreenchange';
4407
4763
  }
4408
- else if ((/** @type {?} */ (this._document)).msFullscreenEnabled) {
4764
+ else if (((/** @type {?} */ (this._document))).msFullscreenEnabled) {
4409
4765
  this._fullScreenEventName = 'MSFullscreenChange';
4410
4766
  }
4411
4767
  }
@@ -4428,28 +4784,29 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4428
4784
  function () {
4429
4785
  return this._document.fullscreenElement ||
4430
4786
  this._document.webkitFullscreenElement ||
4431
- (/** @type {?} */ (this._document)).mozFullScreenElement ||
4432
- (/** @type {?} */ (this._document)).msFullscreenElement ||
4787
+ ((/** @type {?} */ (this._document))).mozFullScreenElement ||
4788
+ ((/** @type {?} */ (this._document))).msFullscreenElement ||
4433
4789
  null;
4434
4790
  };
4435
4791
  FullscreenOverlayContainer.decorators = [
4436
- { type: Injectable },
4792
+ { type: Injectable, args: [{ providedIn: 'root' },] },
4437
4793
  ];
4438
4794
  /** @nocollapse */
4439
4795
  FullscreenOverlayContainer.ctorParameters = function () { return [
4440
4796
  { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
4441
4797
  ]; };
4798
+ /** @nocollapse */ FullscreenOverlayContainer.ngInjectableDef = defineInjectable({ factory: function FullscreenOverlayContainer_Factory() { return new FullscreenOverlayContainer(inject(DOCUMENT)); }, token: FullscreenOverlayContainer, providedIn: "root" });
4442
4799
  return FullscreenOverlayContainer;
4443
4800
  }(OverlayContainer));
4444
4801
 
4445
4802
  /**
4446
4803
  * @fileoverview added by tsickle
4447
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4804
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4448
4805
  */
4449
4806
 
4450
4807
  /**
4451
4808
  * @fileoverview added by tsickle
4452
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4809
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4453
4810
  */
4454
4811
 
4455
4812
  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 };