@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
@@ -53,7 +53,7 @@ var __assign = function() {
53
53
 
54
54
  /**
55
55
  * @fileoverview added by tsickle
56
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
56
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
57
57
  */
58
58
  /**
59
59
  * Strategy that will prevent the user from scrolling while the overlay is visible.
@@ -90,7 +90,7 @@ BlockScrollStrategy = /** @class */ (function () {
90
90
  function () {
91
91
  if (this._canBeEnabled()) {
92
92
  /** @type {?} */
93
- var root = /** @type {?} */ ((this._document.documentElement));
93
+ var root = (/** @type {?} */ (this._document.documentElement));
94
94
  this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();
95
95
  // Cache the previous inline styles in case the user had set them.
96
96
  this._previousHTMLStyles.left = root.style.left || '';
@@ -115,13 +115,13 @@ BlockScrollStrategy = /** @class */ (function () {
115
115
  function () {
116
116
  if (this._isEnabled) {
117
117
  /** @type {?} */
118
- var html = /** @type {?} */ ((this._document.documentElement));
118
+ var html = (/** @type {?} */ (this._document.documentElement));
119
119
  /** @type {?} */
120
- var body = /** @type {?} */ ((this._document.body));
120
+ var body = (/** @type {?} */ (this._document.body));
121
121
  /** @type {?} */
122
- var htmlStyle = /** @type {?} */ (html.style);
122
+ var htmlStyle = (/** @type {?} */ (html.style));
123
123
  /** @type {?} */
124
- var bodyStyle = /** @type {?} */ (body.style);
124
+ var bodyStyle = (/** @type {?} */ (body.style));
125
125
  /** @type {?} */
126
126
  var previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';
127
127
  /** @type {?} */
@@ -139,14 +139,19 @@ BlockScrollStrategy = /** @class */ (function () {
139
139
  }
140
140
  };
141
141
  /**
142
+ * @private
142
143
  * @return {?}
143
144
  */
144
145
  BlockScrollStrategy.prototype._canBeEnabled = /**
146
+ * @private
145
147
  * @return {?}
146
148
  */
147
149
  function () {
150
+ // Since the scroll strategies can't be singletons, we have to use a global CSS class
151
+ // (`cdk-global-scrollblock`) to make sure that we don't try to disable global
152
+ // scrolling multiple times.
148
153
  /** @type {?} */
149
- var html = /** @type {?} */ ((this._document.documentElement));
154
+ var html = (/** @type {?} */ (this._document.documentElement));
150
155
  if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {
151
156
  return false;
152
157
  }
@@ -161,7 +166,7 @@ BlockScrollStrategy = /** @class */ (function () {
161
166
 
162
167
  /**
163
168
  * @fileoverview added by tsickle
164
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
169
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
165
170
  */
166
171
  /**
167
172
  * Returns an error to be thrown when attempting to attach an already-attached scroll strategy.
@@ -173,7 +178,7 @@ function getMatScrollStrategyAlreadyAttachedError() {
173
178
 
174
179
  /**
175
180
  * @fileoverview added by tsickle
176
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
181
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
177
182
  */
178
183
  /**
179
184
  * Strategy that will close the overlay as soon as the user starts scrolling.
@@ -237,7 +242,7 @@ CloseScrollStrategy = /** @class */ (function () {
237
242
  this._scrollSubscription = stream.subscribe(function () {
238
243
  /** @type {?} */
239
244
  var scrollPosition = _this._viewportRuler.getViewportScrollPosition().top;
240
- if (Math.abs(scrollPosition - _this._initialScrollPosition) > /** @type {?} */ ((/** @type {?} */ ((_this._config)).threshold))) {
245
+ if (Math.abs(scrollPosition - _this._initialScrollPosition) > (/** @type {?} */ ((/** @type {?} */ (_this._config)).threshold))) {
241
246
  _this._detach();
242
247
  }
243
248
  else {
@@ -269,7 +274,7 @@ CloseScrollStrategy = /** @class */ (function () {
269
274
 
270
275
  /**
271
276
  * @fileoverview added by tsickle
272
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
277
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
273
278
  */
274
279
 
275
280
  /**
@@ -316,7 +321,7 @@ NoopScrollStrategy = /** @class */ (function () {
316
321
 
317
322
  /**
318
323
  * @fileoverview added by tsickle
319
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
324
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
320
325
  */
321
326
 
322
327
  // TODO(jelbourn): move this to live with the rest of the scrolling code
@@ -364,7 +369,7 @@ function isElementClippedByScrolling(element, scrollContainers) {
364
369
 
365
370
  /**
366
371
  * @fileoverview added by tsickle
367
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
372
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
368
373
  */
369
374
  /**
370
375
  * Strategy that will update the element position as the user is scrolling.
@@ -418,6 +423,8 @@ RepositionScrollStrategy = /** @class */ (function () {
418
423
  /** @type {?} */
419
424
  var overlayRect = _this._overlayRef.overlayElement.getBoundingClientRect();
420
425
  var _a = _this._viewportRuler.getViewportSize(), width = _a.width, height = _a.height;
426
+ // TODO(crisbeto): include all ancestor scroll containers here once
427
+ // we have a way of exposing the trigger element to the scroll strategy.
421
428
  /** @type {?} */
422
429
  var parentRects = [{ width: width, height: height, bottom: height, right: width, top: 0, left: 0 }];
423
430
  if (isElementScrolledOutsideView(overlayRect, parentRects)) {
@@ -448,7 +455,7 @@ RepositionScrollStrategy = /** @class */ (function () {
448
455
 
449
456
  /**
450
457
  * @fileoverview added by tsickle
451
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
458
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
452
459
  */
453
460
  /**
454
461
  * Options for how an overlay will handle scrolling.
@@ -499,12 +506,12 @@ var ScrollStrategyOptions = /** @class */ (function () {
499
506
 
500
507
  /**
501
508
  * @fileoverview added by tsickle
502
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
509
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
503
510
  */
504
511
 
505
512
  /**
506
513
  * @fileoverview added by tsickle
507
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
514
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
508
515
  */
509
516
  /**
510
517
  * Initial configuration used when creating an overlay.
@@ -540,7 +547,7 @@ OverlayConfig = /** @class */ (function () {
540
547
  if (config) {
541
548
  Object.keys(config).forEach(function (k) {
542
549
  /** @type {?} */
543
- var key = /** @type {?} */ (k);
550
+ var key = (/** @type {?} */ (k));
544
551
  if (typeof config[key] !== 'undefined') {
545
552
  _this[key] = config[key];
546
553
  }
@@ -552,7 +559,7 @@ OverlayConfig = /** @class */ (function () {
552
559
 
553
560
  /**
554
561
  * @fileoverview added by tsickle
555
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
562
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
556
563
  */
557
564
  /**
558
565
  * The points of the origin element and the overlay element to connect.
@@ -631,8 +638,7 @@ ScrollingVisibility = /** @class */ (function () {
631
638
  * The change event emitted by the strategy when a fallback position is used.
632
639
  */
633
640
  var ConnectedOverlayPositionChange = /** @class */ (function () {
634
- function ConnectedOverlayPositionChange(connectionPair, /** @docs-private */
635
- scrollableViewProperties) {
641
+ function ConnectedOverlayPositionChange(connectionPair, scrollableViewProperties) {
636
642
  this.connectionPair = connectionPair;
637
643
  this.scrollableViewProperties = scrollableViewProperties;
638
644
  }
@@ -672,7 +678,7 @@ function validateHorizontalPosition(property, value) {
672
678
 
673
679
  /**
674
680
  * @fileoverview added by tsickle
675
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
681
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
676
682
  */
677
683
  /**
678
684
  * Service for dispatching keyboard events that land on the body to appropriate overlay ref,
@@ -759,12 +765,15 @@ var OverlayKeyboardDispatcher = /** @class */ (function () {
759
765
  this._detach();
760
766
  }
761
767
  };
768
+ /** Detaches the global keyboard event listener. */
762
769
  /**
763
770
  * Detaches the global keyboard event listener.
771
+ * @private
764
772
  * @return {?}
765
773
  */
766
774
  OverlayKeyboardDispatcher.prototype._detach = /**
767
775
  * Detaches the global keyboard event listener.
776
+ * @private
768
777
  * @return {?}
769
778
  */
770
779
  function () {
@@ -792,16 +801,17 @@ var OverlayKeyboardDispatcher = /** @class */ (function () {
792
801
  function OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY(dispatcher, _document) {
793
802
  return dispatcher || new OverlayKeyboardDispatcher(_document);
794
803
  }
795
- /** *
804
+ /**
796
805
  * \@docs-private \@deprecated \@breaking-change 8.0.0
797
- @type {?} */
806
+ * @type {?}
807
+ */
798
808
  var OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {
799
809
  // If there is already an OverlayKeyboardDispatcher available, use that.
800
810
  // Otherwise, provide a new one.
801
811
  provide: OverlayKeyboardDispatcher,
802
812
  deps: [
803
813
  [new core.Optional(), new core.SkipSelf(), OverlayKeyboardDispatcher],
804
- /** @type {?} */ ((
814
+ (/** @type {?} */ (
805
815
  // Coerce to `InjectionToken` so that the `deps` match the "shape"
806
816
  // of the type expected by Angular
807
817
  common.DOCUMENT))
@@ -811,7 +821,7 @@ var OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {
811
821
 
812
822
  /**
813
823
  * @fileoverview added by tsickle
814
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
824
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
815
825
  */
816
826
  /**
817
827
  * Container inside which all overlays will render.
@@ -862,11 +872,13 @@ var OverlayContainer = /** @class */ (function () {
862
872
  /**
863
873
  * Create the overlay container element, which is simply a div
864
874
  * with the 'cdk-overlay-container' class on the document body.
875
+ * @protected
865
876
  * @return {?}
866
877
  */
867
878
  OverlayContainer.prototype._createContainer = /**
868
879
  * Create the overlay container element, which is simply a div
869
880
  * with the 'cdk-overlay-container' class on the document body.
881
+ * @protected
870
882
  * @return {?}
871
883
  */
872
884
  function () {
@@ -895,23 +907,23 @@ var OverlayContainer = /** @class */ (function () {
895
907
  function OVERLAY_CONTAINER_PROVIDER_FACTORY(parentContainer, _document) {
896
908
  return parentContainer || new OverlayContainer(_document);
897
909
  }
898
- /** *
910
+ /**
899
911
  * \@docs-private \@deprecated \@breaking-change 8.0.0
900
- @type {?} */
912
+ * @type {?}
913
+ */
901
914
  var OVERLAY_CONTAINER_PROVIDER = {
902
915
  // If there is already an OverlayContainer available, use that. Otherwise, provide a new one.
903
916
  provide: OverlayContainer,
904
917
  deps: [
905
918
  [new core.Optional(), new core.SkipSelf(), OverlayContainer],
906
- /** @type {?} */ (common.DOCUMENT // We need to use the InjectionToken somewhere to keep TS happy
907
- ) // We need to use the InjectionToken somewhere to keep TS happy
919
+ (/** @type {?} */ (common.DOCUMENT))
908
920
  ],
909
921
  useFactory: OVERLAY_CONTAINER_PROVIDER_FACTORY
910
922
  };
911
923
 
912
924
  /**
913
925
  * @fileoverview added by tsickle
914
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
926
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
915
927
  */
916
928
  /**
917
929
  * Reference to an overlay that has been created with the Overlay service.
@@ -1137,9 +1149,9 @@ OverlayRef = /** @class */ (function () {
1137
1149
  this._keydownEvents.complete();
1138
1150
  if (this._host && this._host.parentNode) {
1139
1151
  this._host.parentNode.removeChild(this._host);
1140
- this._host = /** @type {?} */ ((null));
1152
+ this._host = (/** @type {?} */ (null));
1141
1153
  }
1142
- this._previousHostParent = this._pane = /** @type {?} */ ((null));
1154
+ this._previousHostParent = this._pane = (/** @type {?} */ (null));
1143
1155
  if (isAttached) {
1144
1156
  this._detachments.next();
1145
1157
  }
@@ -1304,23 +1316,29 @@ OverlayRef = /** @class */ (function () {
1304
1316
  }
1305
1317
  return typeof direction === 'string' ? direction : direction.value;
1306
1318
  };
1319
+ /** Updates the text direction of the overlay panel. */
1307
1320
  /**
1308
1321
  * Updates the text direction of the overlay panel.
1322
+ * @private
1309
1323
  * @return {?}
1310
1324
  */
1311
1325
  OverlayRef.prototype._updateElementDirection = /**
1312
1326
  * Updates the text direction of the overlay panel.
1327
+ * @private
1313
1328
  * @return {?}
1314
1329
  */
1315
1330
  function () {
1316
1331
  this._host.setAttribute('dir', this.getDirection());
1317
1332
  };
1333
+ /** Updates the size of the overlay element based on the overlay config. */
1318
1334
  /**
1319
1335
  * Updates the size of the overlay element based on the overlay config.
1336
+ * @private
1320
1337
  * @return {?}
1321
1338
  */
1322
1339
  OverlayRef.prototype._updateElementSize = /**
1323
1340
  * Updates the size of the overlay element based on the overlay config.
1341
+ * @private
1324
1342
  * @return {?}
1325
1343
  */
1326
1344
  function () {
@@ -1333,25 +1351,31 @@ OverlayRef = /** @class */ (function () {
1333
1351
  style.maxWidth = coercion.coerceCssPixelValue(this._config.maxWidth);
1334
1352
  style.maxHeight = coercion.coerceCssPixelValue(this._config.maxHeight);
1335
1353
  };
1354
+ /** Toggles the pointer events for the overlay pane element. */
1336
1355
  /**
1337
1356
  * Toggles the pointer events for the overlay pane element.
1357
+ * @private
1338
1358
  * @param {?} enablePointer
1339
1359
  * @return {?}
1340
1360
  */
1341
1361
  OverlayRef.prototype._togglePointerEvents = /**
1342
1362
  * Toggles the pointer events for the overlay pane element.
1363
+ * @private
1343
1364
  * @param {?} enablePointer
1344
1365
  * @return {?}
1345
1366
  */
1346
1367
  function (enablePointer) {
1347
1368
  this._pane.style.pointerEvents = enablePointer ? 'auto' : 'none';
1348
1369
  };
1370
+ /** Attaches a backdrop for this overlay. */
1349
1371
  /**
1350
1372
  * Attaches a backdrop for this overlay.
1373
+ * @private
1351
1374
  * @return {?}
1352
1375
  */
1353
1376
  OverlayRef.prototype._attachBackdrop = /**
1354
1377
  * Attaches a backdrop for this overlay.
1378
+ * @private
1355
1379
  * @return {?}
1356
1380
  */
1357
1381
  function () {
@@ -1362,11 +1386,10 @@ OverlayRef = /** @class */ (function () {
1362
1386
  this._backdropElement.classList.add('cdk-overlay-backdrop');
1363
1387
  if (this._config.backdropClass) {
1364
1388
  this._toggleClasses(this._backdropElement, this._config.backdropClass, true);
1365
- } /** @type {?} */
1366
- ((
1389
+ }
1367
1390
  // Insert the backdrop before the pane in the DOM order,
1368
1391
  // in order to handle stacked overlays properly.
1369
- this._host.parentElement)).insertBefore(this._backdropElement, this._host);
1392
+ (/** @type {?} */ (this._host.parentElement)).insertBefore(this._backdropElement, this._host);
1370
1393
  // Forward backdrop clicks such that the consumer of the overlay can perform whatever
1371
1394
  // action desired when such a click occurs (usually closing the overlay).
1372
1395
  this._backdropElement.addEventListener('click', function (event) { return _this._backdropClick.next(event); });
@@ -1390,6 +1413,14 @@ OverlayRef = /** @class */ (function () {
1390
1413
  * that should be behind it, was destroyed. The next time both of them are opened,
1391
1414
  * the stacking will be wrong, because the detached element's pane will still be
1392
1415
  * in its original DOM position.
1416
+ */
1417
+ /**
1418
+ * Updates the stacking order of the element, moving it to the top if necessary.
1419
+ * This is required in cases where one overlay was detached, while another one,
1420
+ * that should be behind it, was destroyed. The next time both of them are opened,
1421
+ * the stacking will be wrong, because the detached element's pane will still be
1422
+ * in its original DOM position.
1423
+ * @private
1393
1424
  * @return {?}
1394
1425
  */
1395
1426
  OverlayRef.prototype._updateStackingOrder = /**
@@ -1398,11 +1429,12 @@ OverlayRef = /** @class */ (function () {
1398
1429
  * that should be behind it, was destroyed. The next time both of them are opened,
1399
1430
  * the stacking will be wrong, because the detached element's pane will still be
1400
1431
  * in its original DOM position.
1432
+ * @private
1401
1433
  * @return {?}
1402
1434
  */
1403
1435
  function () {
1404
1436
  if (this._host.nextSibling) {
1405
- /** @type {?} */ ((this._host.parentNode)).appendChild(this._host);
1437
+ (/** @type {?} */ (this._host.parentNode)).appendChild(this._host);
1406
1438
  }
1407
1439
  };
1408
1440
  /** Detaches the backdrop (if any) associated with the overlay. */
@@ -1418,41 +1450,44 @@ OverlayRef = /** @class */ (function () {
1418
1450
  var _this = this;
1419
1451
  /** @type {?} */
1420
1452
  var backdropToDetach = this._backdropElement;
1421
- if (backdropToDetach) {
1422
- /** @type {?} */
1423
- var timeoutId_1 = void 0;
1424
- /** @type {?} */
1425
- var finishDetach_1 = function () {
1426
- // It may not be attached to anything in certain cases (e.g. unit tests).
1427
- if (backdropToDetach && backdropToDetach.parentNode) {
1428
- backdropToDetach.parentNode.removeChild(backdropToDetach);
1429
- }
1430
- // It is possible that a new portal has been attached to this overlay since we started
1431
- // removing the backdrop. If that is the case, only clear the backdrop reference if it
1432
- // is still the same instance that we started to remove.
1433
- if (_this._backdropElement == backdropToDetach) {
1434
- _this._backdropElement = null;
1435
- }
1436
- clearTimeout(timeoutId_1);
1437
- };
1438
- backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');
1439
- if (this._config.backdropClass) {
1440
- this._toggleClasses(backdropToDetach, this._config.backdropClass, false);
1441
- }
1442
- this._ngZone.runOutsideAngular(function () {
1443
- /** @type {?} */ ((backdropToDetach)).addEventListener('transitionend', finishDetach_1);
1444
- });
1445
- // If the backdrop doesn't have a transition, the `transitionend` event won't fire.
1446
- // In this case we make it unclickable and we try to remove it after a delay.
1447
- backdropToDetach.style.pointerEvents = 'none';
1448
- // Run this outside the Angular zone because there's nothing that Angular cares about.
1449
- // If it were to run inside the Angular zone, every test that used Overlay would have to be
1450
- // either async or fakeAsync.
1451
- timeoutId_1 = this._ngZone.runOutsideAngular(function () { return setTimeout(finishDetach_1, 500); });
1453
+ if (!backdropToDetach) {
1454
+ return;
1452
1455
  }
1456
+ /** @type {?} */
1457
+ var timeoutId;
1458
+ /** @type {?} */
1459
+ var finishDetach = function () {
1460
+ // It may not be attached to anything in certain cases (e.g. unit tests).
1461
+ if (backdropToDetach && backdropToDetach.parentNode) {
1462
+ backdropToDetach.parentNode.removeChild(backdropToDetach);
1463
+ }
1464
+ // It is possible that a new portal has been attached to this overlay since we started
1465
+ // removing the backdrop. If that is the case, only clear the backdrop reference if it
1466
+ // is still the same instance that we started to remove.
1467
+ if (_this._backdropElement == backdropToDetach) {
1468
+ _this._backdropElement = null;
1469
+ }
1470
+ if (_this._config.backdropClass) {
1471
+ _this._toggleClasses((/** @type {?} */ (backdropToDetach)), _this._config.backdropClass, false);
1472
+ }
1473
+ clearTimeout(timeoutId);
1474
+ };
1475
+ backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');
1476
+ this._ngZone.runOutsideAngular(function () {
1477
+ (/** @type {?} */ (backdropToDetach)).addEventListener('transitionend', finishDetach);
1478
+ });
1479
+ // If the backdrop doesn't have a transition, the `transitionend` event won't fire.
1480
+ // In this case we make it unclickable and we try to remove it after a delay.
1481
+ backdropToDetach.style.pointerEvents = 'none';
1482
+ // Run this outside the Angular zone because there's nothing that Angular cares about.
1483
+ // If it were to run inside the Angular zone, every test that used Overlay would have to be
1484
+ // either async or fakeAsync.
1485
+ timeoutId = this._ngZone.runOutsideAngular(function () { return setTimeout(finishDetach, 500); });
1453
1486
  };
1487
+ /** Toggles a single CSS class or an array of classes on an element. */
1454
1488
  /**
1455
1489
  * Toggles a single CSS class or an array of classes on an element.
1490
+ * @private
1456
1491
  * @param {?} element
1457
1492
  * @param {?} cssClasses
1458
1493
  * @param {?} isAdd
@@ -1460,6 +1495,7 @@ OverlayRef = /** @class */ (function () {
1460
1495
  */
1461
1496
  OverlayRef.prototype._toggleClasses = /**
1462
1497
  * Toggles a single CSS class or an array of classes on an element.
1498
+ * @private
1463
1499
  * @param {?} element
1464
1500
  * @param {?} cssClasses
1465
1501
  * @param {?} isAdd
@@ -1473,12 +1509,15 @@ OverlayRef = /** @class */ (function () {
1473
1509
  isAdd ? classList.add(cssClass) : classList.remove(cssClass);
1474
1510
  });
1475
1511
  };
1512
+ /** Detaches the overlay content next time the zone stabilizes. */
1476
1513
  /**
1477
1514
  * Detaches the overlay content next time the zone stabilizes.
1515
+ * @private
1478
1516
  * @return {?}
1479
1517
  */
1480
1518
  OverlayRef.prototype._detachContentWhenStable = /**
1481
1519
  * Detaches the overlay content next time the zone stabilizes.
1520
+ * @private
1482
1521
  * @return {?}
1483
1522
  */
1484
1523
  function () {
@@ -1487,6 +1526,9 @@ OverlayRef = /** @class */ (function () {
1487
1526
  // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will
1488
1527
  // be patched to run inside the zone, which will throw us into an infinite loop.
1489
1528
  this._ngZone.runOutsideAngular(function () {
1529
+ // We can't remove the host here immediately, because the overlay pane's content
1530
+ // might still be animating. This stream helps us avoid interrupting the animation
1531
+ // by waiting for the pane to become empty.
1490
1532
  /** @type {?} */
1491
1533
  var subscription = _this._ngZone.onStable
1492
1534
  .asObservable()
@@ -1512,11 +1554,14 @@ OverlayRef = /** @class */ (function () {
1512
1554
 
1513
1555
  /**
1514
1556
  * @fileoverview added by tsickle
1515
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1557
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1516
1558
  */
1517
- /** *
1559
+ // TODO: refactor clipping detection into a separate thing (part of scrolling module)
1560
+ // TODO: doesn't handle both flexible width and height when it has to scroll along both axis.
1561
+ /**
1518
1562
  * Class to be added to the overlay bounding box.
1519
- @type {?} */
1563
+ * @type {?}
1564
+ */
1520
1565
  var boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';
1521
1566
  /**
1522
1567
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -1730,18 +1775,25 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1730
1775
  var overlayRect = this._overlayRect;
1731
1776
  /** @type {?} */
1732
1777
  var viewportRect = this._viewportRect;
1778
+ // Positions where the overlay will fit with flexible dimensions.
1733
1779
  /** @type {?} */
1734
1780
  var flexibleFits = [];
1781
+ // Fallback if none of the preferred positions fit within the viewport.
1735
1782
  /** @type {?} */
1736
1783
  var fallback;
1737
1784
  // Go through each of the preferred positions looking for a good fit.
1738
1785
  // If a good fit is found, it will be applied immediately.
1739
1786
  for (var _i = 0, _a = this._preferredPositions; _i < _a.length; _i++) {
1740
1787
  var pos = _a[_i];
1788
+ // Get the exact (x, y) coordinate for the point-of-origin on the origin element.
1741
1789
  /** @type {?} */
1742
1790
  var originPoint = this._getOriginPoint(originRect, pos);
1791
+ // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the
1792
+ // overlay in this position. We use the top-left corner for calculations and later translate
1793
+ // this into an appropriate (top, left, bottom, right) style.
1743
1794
  /** @type {?} */
1744
1795
  var overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);
1796
+ // Calculate how well the overlay would fit into the viewport with this point.
1745
1797
  /** @type {?} */
1746
1798
  var overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);
1747
1799
  // If the overlay, without any further work, fits into the viewport, use this position.
@@ -1787,7 +1839,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1787
1839
  }
1788
1840
  }
1789
1841
  this._isPushed = false;
1790
- this._applyPosition(/** @type {?} */ ((bestFit)).position, /** @type {?} */ ((bestFit)).origin);
1842
+ this._applyPosition((/** @type {?} */ (bestFit)).position, (/** @type {?} */ (bestFit)).origin);
1791
1843
  return;
1792
1844
  }
1793
1845
  // When none of the preferred positions fit within the viewport, take the position
@@ -1795,12 +1847,12 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1795
1847
  if (this._canPush) {
1796
1848
  // TODO(jelbourn): after pushing, the opening "direction" of the overlay might not make sense.
1797
1849
  this._isPushed = true;
1798
- this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
1850
+ this._applyPosition((/** @type {?} */ (fallback)).position, (/** @type {?} */ (fallback)).originPoint);
1799
1851
  return;
1800
1852
  }
1801
1853
  // All options for getting the overlay within the viewport have been exhausted, so go with the
1802
1854
  // position that went off-screen the least.
1803
- this._applyPosition(/** @type {?} */ ((fallback)).position, /** @type {?} */ ((fallback)).originPoint);
1855
+ this._applyPosition((/** @type {?} */ (fallback)).position, (/** @type {?} */ (fallback)).originPoint);
1804
1856
  };
1805
1857
  /**
1806
1858
  * @return {?}
@@ -1830,7 +1882,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1830
1882
  // We can't use `_resetBoundingBoxStyles` here, because it resets
1831
1883
  // some properties to zero, rather than removing them.
1832
1884
  if (this._boundingBox) {
1833
- extendStyles(this._boundingBox.style, /** @type {?} */ ({
1885
+ extendStyles(this._boundingBox.style, (/** @type {?} */ ({
1834
1886
  top: '',
1835
1887
  left: '',
1836
1888
  right: '',
@@ -1839,7 +1891,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1839
1891
  width: '',
1840
1892
  alignItems: '',
1841
1893
  justifyContent: '',
1842
- }));
1894
+ })));
1843
1895
  }
1844
1896
  if (this._pane) {
1845
1897
  this._resetOverlayElementStyles();
@@ -1849,7 +1901,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1849
1901
  }
1850
1902
  this.detach();
1851
1903
  this._positionChanges.complete();
1852
- this._overlayRef = this._boundingBox = /** @type {?} */ ((null));
1904
+ this._overlayRef = this._boundingBox = (/** @type {?} */ (null));
1853
1905
  this._isDisposed = true;
1854
1906
  };
1855
1907
  /**
@@ -1909,23 +1961,27 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1909
1961
  */
1910
1962
  /**
1911
1963
  * Adds new preferred positions.
1964
+ * @template THIS
1965
+ * @this {THIS}
1912
1966
  * @param {?} positions List of positions options for this overlay.
1913
- * @return {?}
1967
+ * @return {THIS}
1914
1968
  */
1915
1969
  FlexibleConnectedPositionStrategy.prototype.withPositions = /**
1916
1970
  * Adds new preferred positions.
1971
+ * @template THIS
1972
+ * @this {THIS}
1917
1973
  * @param {?} positions List of positions options for this overlay.
1918
- * @return {?}
1974
+ * @return {THIS}
1919
1975
  */
1920
1976
  function (positions) {
1921
- this._preferredPositions = positions;
1977
+ (/** @type {?} */ (this))._preferredPositions = positions;
1922
1978
  // If the last calculated position object isn't part of the positions anymore, clear
1923
1979
  // it in order to avoid it being picked up if the consumer tries to re-apply.
1924
- if (positions.indexOf(/** @type {?} */ ((this._lastPosition))) === -1) {
1925
- this._lastPosition = null;
1980
+ if (positions.indexOf((/** @type {?} */ ((/** @type {?} */ (this))._lastPosition))) === -1) {
1981
+ (/** @type {?} */ (this))._lastPosition = null;
1926
1982
  }
1927
- this._validatePositions();
1928
- return this;
1983
+ (/** @type {?} */ (this))._validatePositions();
1984
+ return (/** @type {?} */ (this));
1929
1985
  };
1930
1986
  /**
1931
1987
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
@@ -1933,65 +1989,81 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
1933
1989
  */
1934
1990
  /**
1935
1991
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
1992
+ * @template THIS
1993
+ * @this {THIS}
1936
1994
  * @param {?} margin Required margin between the overlay and the viewport edge in pixels.
1937
- * @return {?}
1995
+ * @return {THIS}
1938
1996
  */
1939
1997
  FlexibleConnectedPositionStrategy.prototype.withViewportMargin = /**
1940
1998
  * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
1999
+ * @template THIS
2000
+ * @this {THIS}
1941
2001
  * @param {?} margin Required margin between the overlay and the viewport edge in pixels.
1942
- * @return {?}
2002
+ * @return {THIS}
1943
2003
  */
1944
2004
  function (margin) {
1945
- this._viewportMargin = margin;
1946
- return this;
2005
+ (/** @type {?} */ (this))._viewportMargin = margin;
2006
+ return (/** @type {?} */ (this));
1947
2007
  };
1948
2008
  /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */
1949
2009
  /**
1950
2010
  * Sets whether the overlay's width and height can be constrained to fit within the viewport.
2011
+ * @template THIS
2012
+ * @this {THIS}
1951
2013
  * @param {?=} flexibleDimensions
1952
- * @return {?}
2014
+ * @return {THIS}
1953
2015
  */
1954
2016
  FlexibleConnectedPositionStrategy.prototype.withFlexibleDimensions = /**
1955
2017
  * Sets whether the overlay's width and height can be constrained to fit within the viewport.
2018
+ * @template THIS
2019
+ * @this {THIS}
1956
2020
  * @param {?=} flexibleDimensions
1957
- * @return {?}
2021
+ * @return {THIS}
1958
2022
  */
1959
2023
  function (flexibleDimensions) {
1960
2024
  if (flexibleDimensions === void 0) { flexibleDimensions = true; }
1961
- this._hasFlexibleDimensions = flexibleDimensions;
1962
- return this;
2025
+ (/** @type {?} */ (this))._hasFlexibleDimensions = flexibleDimensions;
2026
+ return (/** @type {?} */ (this));
1963
2027
  };
1964
2028
  /** Sets whether the overlay can grow after the initial open via flexible width/height. */
1965
2029
  /**
1966
2030
  * Sets whether the overlay can grow after the initial open via flexible width/height.
2031
+ * @template THIS
2032
+ * @this {THIS}
1967
2033
  * @param {?=} growAfterOpen
1968
- * @return {?}
2034
+ * @return {THIS}
1969
2035
  */
1970
2036
  FlexibleConnectedPositionStrategy.prototype.withGrowAfterOpen = /**
1971
2037
  * Sets whether the overlay can grow after the initial open via flexible width/height.
2038
+ * @template THIS
2039
+ * @this {THIS}
1972
2040
  * @param {?=} growAfterOpen
1973
- * @return {?}
2041
+ * @return {THIS}
1974
2042
  */
1975
2043
  function (growAfterOpen) {
1976
2044
  if (growAfterOpen === void 0) { growAfterOpen = true; }
1977
- this._growAfterOpen = growAfterOpen;
1978
- return this;
2045
+ (/** @type {?} */ (this))._growAfterOpen = growAfterOpen;
2046
+ return (/** @type {?} */ (this));
1979
2047
  };
1980
2048
  /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */
1981
2049
  /**
1982
2050
  * Sets whether the overlay can be pushed on-screen if none of the provided positions fit.
2051
+ * @template THIS
2052
+ * @this {THIS}
1983
2053
  * @param {?=} canPush
1984
- * @return {?}
2054
+ * @return {THIS}
1985
2055
  */
1986
2056
  FlexibleConnectedPositionStrategy.prototype.withPush = /**
1987
2057
  * Sets whether the overlay can be pushed on-screen if none of the provided positions fit.
2058
+ * @template THIS
2059
+ * @this {THIS}
1988
2060
  * @param {?=} canPush
1989
- * @return {?}
2061
+ * @return {THIS}
1990
2062
  */
1991
2063
  function (canPush) {
1992
2064
  if (canPush === void 0) { canPush = true; }
1993
- this._canPush = canPush;
1994
- return this;
2065
+ (/** @type {?} */ (this))._canPush = canPush;
2066
+ return (/** @type {?} */ (this));
1995
2067
  };
1996
2068
  /**
1997
2069
  * Sets whether the overlay's position should be locked in after it is positioned
@@ -2003,20 +2075,24 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2003
2075
  * Sets whether the overlay's position should be locked in after it is positioned
2004
2076
  * initially. When an overlay is locked in, it won't attempt to reposition itself
2005
2077
  * when the position is re-applied (e.g. when the user scrolls away).
2078
+ * @template THIS
2079
+ * @this {THIS}
2006
2080
  * @param {?=} isLocked Whether the overlay should locked in.
2007
- * @return {?}
2081
+ * @return {THIS}
2008
2082
  */
2009
2083
  FlexibleConnectedPositionStrategy.prototype.withLockedPosition = /**
2010
2084
  * Sets whether the overlay's position should be locked in after it is positioned
2011
2085
  * initially. When an overlay is locked in, it won't attempt to reposition itself
2012
2086
  * when the position is re-applied (e.g. when the user scrolls away).
2087
+ * @template THIS
2088
+ * @this {THIS}
2013
2089
  * @param {?=} isLocked Whether the overlay should locked in.
2014
- * @return {?}
2090
+ * @return {THIS}
2015
2091
  */
2016
2092
  function (isLocked) {
2017
2093
  if (isLocked === void 0) { isLocked = true; }
2018
- this._positionLocked = isLocked;
2019
- return this;
2094
+ (/** @type {?} */ (this))._positionLocked = isLocked;
2095
+ return (/** @type {?} */ (this));
2020
2096
  };
2021
2097
  /**
2022
2098
  * Sets the origin element, relative to which to position the overlay.
@@ -2024,17 +2100,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2024
2100
  */
2025
2101
  /**
2026
2102
  * Sets the origin element, relative to which to position the overlay.
2103
+ * @template THIS
2104
+ * @this {THIS}
2027
2105
  * @param {?} origin Reference to the new origin element.
2028
- * @return {?}
2106
+ * @return {THIS}
2029
2107
  */
2030
2108
  FlexibleConnectedPositionStrategy.prototype.setOrigin = /**
2031
2109
  * Sets the origin element, relative to which to position the overlay.
2110
+ * @template THIS
2111
+ * @this {THIS}
2032
2112
  * @param {?} origin Reference to the new origin element.
2033
- * @return {?}
2113
+ * @return {THIS}
2034
2114
  */
2035
2115
  function (origin) {
2036
- this._origin = origin instanceof core.ElementRef ? origin.nativeElement : origin;
2037
- return this;
2116
+ (/** @type {?} */ (this))._origin = origin instanceof core.ElementRef ? origin.nativeElement : origin;
2117
+ return (/** @type {?} */ (this));
2038
2118
  };
2039
2119
  /**
2040
2120
  * Sets the default offset for the overlay's connection point on the x-axis.
@@ -2042,17 +2122,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2042
2122
  */
2043
2123
  /**
2044
2124
  * Sets the default offset for the overlay's connection point on the x-axis.
2125
+ * @template THIS
2126
+ * @this {THIS}
2045
2127
  * @param {?} offset New offset in the X axis.
2046
- * @return {?}
2128
+ * @return {THIS}
2047
2129
  */
2048
2130
  FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetX = /**
2049
2131
  * Sets the default offset for the overlay's connection point on the x-axis.
2132
+ * @template THIS
2133
+ * @this {THIS}
2050
2134
  * @param {?} offset New offset in the X axis.
2051
- * @return {?}
2135
+ * @return {THIS}
2052
2136
  */
2053
2137
  function (offset) {
2054
- this._offsetX = offset;
2055
- return this;
2138
+ (/** @type {?} */ (this))._offsetX = offset;
2139
+ return (/** @type {?} */ (this));
2056
2140
  };
2057
2141
  /**
2058
2142
  * Sets the default offset for the overlay's connection point on the y-axis.
@@ -2060,17 +2144,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2060
2144
  */
2061
2145
  /**
2062
2146
  * Sets the default offset for the overlay's connection point on the y-axis.
2147
+ * @template THIS
2148
+ * @this {THIS}
2063
2149
  * @param {?} offset New offset in the Y axis.
2064
- * @return {?}
2150
+ * @return {THIS}
2065
2151
  */
2066
2152
  FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetY = /**
2067
2153
  * Sets the default offset for the overlay's connection point on the y-axis.
2154
+ * @template THIS
2155
+ * @this {THIS}
2068
2156
  * @param {?} offset New offset in the Y axis.
2069
- * @return {?}
2157
+ * @return {THIS}
2070
2158
  */
2071
2159
  function (offset) {
2072
- this._offsetY = offset;
2073
- return this;
2160
+ (/** @type {?} */ (this))._offsetY = offset;
2161
+ return (/** @type {?} */ (this));
2074
2162
  };
2075
2163
  /**
2076
2164
  * Configures that the position strategy should set a `transform-origin` on some elements
@@ -2085,31 +2173,40 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2085
2173
  * inside the overlay, depending on the current position that is being applied. This is
2086
2174
  * useful for the cases where the origin of an animation can change depending on the
2087
2175
  * alignment of the overlay.
2176
+ * @template THIS
2177
+ * @this {THIS}
2088
2178
  * @param {?} selector CSS selector that will be used to find the target
2089
2179
  * elements onto which to set the transform origin.
2090
- * @return {?}
2180
+ * @return {THIS}
2091
2181
  */
2092
2182
  FlexibleConnectedPositionStrategy.prototype.withTransformOriginOn = /**
2093
2183
  * Configures that the position strategy should set a `transform-origin` on some elements
2094
2184
  * inside the overlay, depending on the current position that is being applied. This is
2095
2185
  * useful for the cases where the origin of an animation can change depending on the
2096
2186
  * alignment of the overlay.
2187
+ * @template THIS
2188
+ * @this {THIS}
2097
2189
  * @param {?} selector CSS selector that will be used to find the target
2098
2190
  * elements onto which to set the transform origin.
2099
- * @return {?}
2191
+ * @return {THIS}
2100
2192
  */
2101
2193
  function (selector) {
2102
- this._transformOriginSelector = selector;
2103
- return this;
2194
+ (/** @type {?} */ (this))._transformOriginSelector = selector;
2195
+ return (/** @type {?} */ (this));
2104
2196
  };
2105
2197
  /**
2106
2198
  * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
2199
+ */
2200
+ /**
2201
+ * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
2202
+ * @private
2107
2203
  * @param {?} originRect
2108
2204
  * @param {?} pos
2109
2205
  * @return {?}
2110
2206
  */
2111
2207
  FlexibleConnectedPositionStrategy.prototype._getOriginPoint = /**
2112
2208
  * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
2209
+ * @private
2113
2210
  * @param {?} originRect
2114
2211
  * @param {?} pos
2115
2212
  * @return {?}
@@ -2142,6 +2239,11 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2142
2239
  /**
2143
2240
  * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
2144
2241
  * origin point to which the overlay should be connected.
2242
+ */
2243
+ /**
2244
+ * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
2245
+ * origin point to which the overlay should be connected.
2246
+ * @private
2145
2247
  * @param {?} originPoint
2146
2248
  * @param {?} overlayRect
2147
2249
  * @param {?} pos
@@ -2150,12 +2252,15 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2150
2252
  FlexibleConnectedPositionStrategy.prototype._getOverlayPoint = /**
2151
2253
  * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
2152
2254
  * origin point to which the overlay should be connected.
2255
+ * @private
2153
2256
  * @param {?} originPoint
2154
2257
  * @param {?} overlayRect
2155
2258
  * @param {?} pos
2156
2259
  * @return {?}
2157
2260
  */
2158
2261
  function (originPoint, overlayRect, pos) {
2262
+ // Calculate the (overlayStartX, overlayStartY), the start of the
2263
+ // potential overlay position relative to the origin point.
2159
2264
  /** @type {?} */
2160
2265
  var overlayStartX;
2161
2266
  if (pos.overlayX == 'center') {
@@ -2181,8 +2286,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2181
2286
  y: originPoint.y + overlayStartY,
2182
2287
  };
2183
2288
  };
2289
+ /** Gets how well an overlay at the given point will fit within the viewport. */
2184
2290
  /**
2185
2291
  * Gets how well an overlay at the given point will fit within the viewport.
2292
+ * @private
2186
2293
  * @param {?} point
2187
2294
  * @param {?} overlay
2188
2295
  * @param {?} viewport
@@ -2191,6 +2298,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2191
2298
  */
2192
2299
  FlexibleConnectedPositionStrategy.prototype._getOverlayFit = /**
2193
2300
  * Gets how well an overlay at the given point will fit within the viewport.
2301
+ * @private
2194
2302
  * @param {?} point
2195
2303
  * @param {?} overlay
2196
2304
  * @param {?} viewport
@@ -2210,6 +2318,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2210
2318
  if (offsetY) {
2211
2319
  y += offsetY;
2212
2320
  }
2321
+ // How much the overlay would overflow at this position, on each side.
2213
2322
  /** @type {?} */
2214
2323
  var leftOverflow = 0 - x;
2215
2324
  /** @type {?} */
@@ -2218,6 +2327,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2218
2327
  var topOverflow = 0 - y;
2219
2328
  /** @type {?} */
2220
2329
  var bottomOverflow = (y + overlay.height) - viewport.height;
2330
+ // Visible parts of the element on each axis.
2221
2331
  /** @type {?} */
2222
2332
  var visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);
2223
2333
  /** @type {?} */
@@ -2233,6 +2343,13 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2233
2343
  };
2234
2344
  /**
2235
2345
  * Whether the overlay can fit within the viewport when it may resize either its width or height.
2346
+ * @param fit How well the overlay fits in the viewport at some position.
2347
+ * @param point The (x, y) coordinates of the overlat at some position.
2348
+ * @param viewport The geometry of the viewport.
2349
+ */
2350
+ /**
2351
+ * Whether the overlay can fit within the viewport when it may resize either its width or height.
2352
+ * @private
2236
2353
  * @param {?} fit How well the overlay fits in the viewport at some position.
2237
2354
  * @param {?} point The (x, y) coordinates of the overlat at some position.
2238
2355
  * @param {?} viewport The geometry of the viewport.
@@ -2240,6 +2357,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2240
2357
  */
2241
2358
  FlexibleConnectedPositionStrategy.prototype._canFitWithFlexibleDimensions = /**
2242
2359
  * Whether the overlay can fit within the viewport when it may resize either its width or height.
2360
+ * @private
2243
2361
  * @param {?} fit How well the overlay fits in the viewport at some position.
2244
2362
  * @param {?} point The (x, y) coordinates of the overlat at some position.
2245
2363
  * @param {?} viewport The geometry of the viewport.
@@ -2269,6 +2387,18 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2269
2387
  * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
2270
2388
  * right and bottom).
2271
2389
  *
2390
+ * @param start Starting point from which the overlay is pushed.
2391
+ * @param overlay Dimensions of the overlay.
2392
+ * @param scrollPosition Current viewport scroll position.
2393
+ * @returns The point at which to position the overlay after pushing. This is effectively a new
2394
+ * originPoint.
2395
+ */
2396
+ /**
2397
+ * Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
2398
+ * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
2399
+ * right and bottom).
2400
+ *
2401
+ * @private
2272
2402
  * @param {?} start Starting point from which the overlay is pushed.
2273
2403
  * @param {?} overlay Dimensions of the overlay.
2274
2404
  * @param {?} scrollPosition Current viewport scroll position.
@@ -2280,6 +2410,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2280
2410
  * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
2281
2411
  * right and bottom).
2282
2412
  *
2413
+ * @private
2283
2414
  * @param {?} start Starting point from which the overlay is pushed.
2284
2415
  * @param {?} overlay Dimensions of the overlay.
2285
2416
  * @param {?} scrollPosition Current viewport scroll position.
@@ -2298,6 +2429,8 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2298
2429
  }
2299
2430
  /** @type {?} */
2300
2431
  var viewport = this._viewportRect;
2432
+ // Determine how much the overlay goes outside the viewport on each
2433
+ // side, which we'll use to decide which direction to push it.
2301
2434
  /** @type {?} */
2302
2435
  var overflowRight = Math.max(start.x + overlay.width - viewport.right, 0);
2303
2436
  /** @type {?} */
@@ -2306,6 +2439,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2306
2439
  var overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);
2307
2440
  /** @type {?} */
2308
2441
  var overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);
2442
+ // Amount by which to push the overlay in each axis such that it remains on-screen.
2309
2443
  /** @type {?} */
2310
2444
  var pushX = 0;
2311
2445
  /** @type {?} */
@@ -2333,12 +2467,19 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2333
2467
  };
2334
2468
  /**
2335
2469
  * Applies a computed position to the overlay and emits a position change.
2470
+ * @param position The position preference
2471
+ * @param originPoint The point on the origin element where the overlay is connected.
2472
+ */
2473
+ /**
2474
+ * Applies a computed position to the overlay and emits a position change.
2475
+ * @private
2336
2476
  * @param {?} position The position preference
2337
2477
  * @param {?} originPoint The point on the origin element where the overlay is connected.
2338
2478
  * @return {?}
2339
2479
  */
2340
2480
  FlexibleConnectedPositionStrategy.prototype._applyPosition = /**
2341
2481
  * Applies a computed position to the overlay and emits a position change.
2482
+ * @private
2342
2483
  * @param {?} position The position preference
2343
2484
  * @param {?} originPoint The point on the origin element where the overlay is connected.
2344
2485
  * @return {?}
@@ -2364,13 +2505,16 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2364
2505
  }
2365
2506
  this._isInitialRender = false;
2366
2507
  };
2508
+ /** Sets the transform origin based on the configured selector and the passed-in position. */
2367
2509
  /**
2368
2510
  * Sets the transform origin based on the configured selector and the passed-in position.
2511
+ * @private
2369
2512
  * @param {?} position
2370
2513
  * @return {?}
2371
2514
  */
2372
2515
  FlexibleConnectedPositionStrategy.prototype._setTransformOrigin = /**
2373
2516
  * Sets the transform origin based on the configured selector and the passed-in position.
2517
+ * @private
2374
2518
  * @param {?} position
2375
2519
  * @return {?}
2376
2520
  */
@@ -2379,7 +2523,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2379
2523
  return;
2380
2524
  }
2381
2525
  /** @type {?} */
2382
- var elements = /** @type {?} */ ((this._boundingBox)).querySelectorAll(this._transformOriginSelector);
2526
+ var elements = (/** @type {?} */ (this._boundingBox)).querySelectorAll(this._transformOriginSelector);
2383
2527
  /** @type {?} */
2384
2528
  var xOrigin;
2385
2529
  /** @type {?} */
@@ -2402,6 +2546,13 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2402
2546
  *
2403
2547
  * This method does no measuring and applies no styles so that we can cheaply compute the
2404
2548
  * bounds for all positions and choose the best fit based on these results.
2549
+ */
2550
+ /**
2551
+ * Gets the position and size of the overlay's sizing container.
2552
+ *
2553
+ * This method does no measuring and applies no styles so that we can cheaply compute the
2554
+ * bounds for all positions and choose the best fit based on these results.
2555
+ * @private
2405
2556
  * @param {?} origin
2406
2557
  * @param {?} position
2407
2558
  * @return {?}
@@ -2411,6 +2562,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2411
2562
  *
2412
2563
  * This method does no measuring and applies no styles so that we can cheaply compute the
2413
2564
  * bounds for all positions and choose the best fit based on these results.
2565
+ * @private
2414
2566
  * @param {?} origin
2415
2567
  * @param {?} position
2416
2568
  * @return {?}
@@ -2439,6 +2591,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2439
2591
  height = viewport.height - bottom + this._viewportMargin;
2440
2592
  }
2441
2593
  else {
2594
+ // If neither top nor bottom, it means that the overlay is vertically centered on the
2595
+ // origin point. Note that we want the position relative to the viewport, rather than
2596
+ // the page, which is why we don't use something like `viewport.bottom - origin.y` and
2597
+ // `origin.y - viewport.top`.
2442
2598
  /** @type {?} */
2443
2599
  var smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y + viewport.top, origin.y);
2444
2600
  /** @type {?} */
@@ -2449,9 +2605,11 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2449
2605
  top = origin.y - (previousHeight / 2);
2450
2606
  }
2451
2607
  }
2608
+ // The overlay is opening 'right-ward' (the content flows to the right).
2452
2609
  /** @type {?} */
2453
2610
  var isBoundedByRightViewportEdge = (position.overlayX === 'start' && !isRtl) ||
2454
2611
  (position.overlayX === 'end' && isRtl);
2612
+ // The overlay is opening 'left-ward' (the content flows to the left).
2455
2613
  /** @type {?} */
2456
2614
  var isBoundedByLeftViewportEdge = (position.overlayX === 'end' && !isRtl) ||
2457
2615
  (position.overlayX === 'start' && isRtl);
@@ -2470,6 +2628,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2470
2628
  width = viewport.right - origin.x;
2471
2629
  }
2472
2630
  else {
2631
+ // If neither start nor end, it means that the overlay is horizontally centered on the
2632
+ // origin point. Note that we want the position relative to the viewport, rather than
2633
+ // the page, which is why we don't use something like `viewport.right - origin.x` and
2634
+ // `origin.x - viewport.left`.
2473
2635
  /** @type {?} */
2474
2636
  var smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x + viewport.left, origin.x);
2475
2637
  /** @type {?} */
@@ -2480,12 +2642,20 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2480
2642
  left = origin.x - (previousWidth / 2);
2481
2643
  }
2482
2644
  }
2483
- return { top: /** @type {?} */ ((top)), left: /** @type {?} */ ((left)), bottom: /** @type {?} */ ((bottom)), right: /** @type {?} */ ((right)), width: width, height: height };
2645
+ return { top: (/** @type {?} */ (top)), left: (/** @type {?} */ (left)), bottom: (/** @type {?} */ (bottom)), right: (/** @type {?} */ (right)), width: width, height: height };
2484
2646
  };
2485
2647
  /**
2486
2648
  * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
2487
2649
  * origin's connection point and stetches to the bounds of the viewport.
2488
2650
  *
2651
+ * @param origin The point on the origin element where the overlay is connected.
2652
+ * @param position The position preference
2653
+ */
2654
+ /**
2655
+ * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
2656
+ * origin's connection point and stetches to the bounds of the viewport.
2657
+ *
2658
+ * @private
2489
2659
  * @param {?} origin The point on the origin element where the overlay is connected.
2490
2660
  * @param {?} position The position preference
2491
2661
  * @return {?}
@@ -2494,6 +2664,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2494
2664
  * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
2495
2665
  * origin's connection point and stetches to the bounds of the viewport.
2496
2666
  *
2667
+ * @private
2497
2668
  * @param {?} origin The point on the origin element where the overlay is connected.
2498
2669
  * @param {?} position The position preference
2499
2670
  * @return {?}
@@ -2508,7 +2679,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2508
2679
  boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);
2509
2680
  }
2510
2681
  /** @type {?} */
2511
- var styles = /** @type {?} */ ({});
2682
+ var styles = (/** @type {?} */ ({}));
2512
2683
  if (this._hasExactPosition()) {
2513
2684
  styles.top = styles.left = '0';
2514
2685
  styles.bottom = styles.right = '';
@@ -2546,18 +2717,21 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2546
2717
  }
2547
2718
  }
2548
2719
  this._lastBoundingBoxSize = boundingBoxRect;
2549
- extendStyles(/** @type {?} */ ((this._boundingBox)).style, styles);
2720
+ extendStyles((/** @type {?} */ (this._boundingBox)).style, styles);
2550
2721
  };
2722
+ /** Resets the styles for the bounding box so that a new positioning can be computed. */
2551
2723
  /**
2552
2724
  * Resets the styles for the bounding box so that a new positioning can be computed.
2725
+ * @private
2553
2726
  * @return {?}
2554
2727
  */
2555
2728
  FlexibleConnectedPositionStrategy.prototype._resetBoundingBoxStyles = /**
2556
2729
  * Resets the styles for the bounding box so that a new positioning can be computed.
2730
+ * @private
2557
2731
  * @return {?}
2558
2732
  */
2559
2733
  function () {
2560
- extendStyles(/** @type {?} */ ((this._boundingBox)).style, /** @type {?} */ ({
2734
+ extendStyles((/** @type {?} */ (this._boundingBox)).style, (/** @type {?} */ ({
2561
2735
  top: '0',
2562
2736
  left: '0',
2563
2737
  right: '0',
@@ -2566,40 +2740,46 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2566
2740
  width: '',
2567
2741
  alignItems: '',
2568
2742
  justifyContent: '',
2569
- }));
2743
+ })));
2570
2744
  };
2745
+ /** Resets the styles for the overlay pane so that a new positioning can be computed. */
2571
2746
  /**
2572
2747
  * Resets the styles for the overlay pane so that a new positioning can be computed.
2748
+ * @private
2573
2749
  * @return {?}
2574
2750
  */
2575
2751
  FlexibleConnectedPositionStrategy.prototype._resetOverlayElementStyles = /**
2576
2752
  * Resets the styles for the overlay pane so that a new positioning can be computed.
2753
+ * @private
2577
2754
  * @return {?}
2578
2755
  */
2579
2756
  function () {
2580
- extendStyles(this._pane.style, /** @type {?} */ ({
2757
+ extendStyles(this._pane.style, (/** @type {?} */ ({
2581
2758
  top: '',
2582
2759
  left: '',
2583
2760
  bottom: '',
2584
2761
  right: '',
2585
2762
  position: '',
2586
- }));
2763
+ })));
2587
2764
  };
2765
+ /** Sets positioning styles to the overlay element. */
2588
2766
  /**
2589
2767
  * Sets positioning styles to the overlay element.
2768
+ * @private
2590
2769
  * @param {?} originPoint
2591
2770
  * @param {?} position
2592
2771
  * @return {?}
2593
2772
  */
2594
2773
  FlexibleConnectedPositionStrategy.prototype._setOverlayElementStyles = /**
2595
2774
  * Sets positioning styles to the overlay element.
2775
+ * @private
2596
2776
  * @param {?} originPoint
2597
2777
  * @param {?} position
2598
2778
  * @return {?}
2599
2779
  */
2600
2780
  function (originPoint, position) {
2601
2781
  /** @type {?} */
2602
- var styles = /** @type {?} */ ({});
2782
+ var styles = (/** @type {?} */ ({}));
2603
2783
  if (this._hasExactPosition()) {
2604
2784
  /** @type {?} */
2605
2785
  var scrollPosition = this._viewportRuler.getViewportScrollPosition();
@@ -2609,6 +2789,11 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2609
2789
  else {
2610
2790
  styles.position = 'static';
2611
2791
  }
2792
+ // Use a transform to apply the offsets. We do this because the `center` positions rely on
2793
+ // being in the normal flex flow and setting a `top` / `left` at all will completely throw
2794
+ // off the position. We also can't use margins, because they won't have an effect in some
2795
+ // cases where the element doesn't have anything to "push off of". Finally, this works
2796
+ // better both with flexible and non-flexible positioning.
2612
2797
  /** @type {?} */
2613
2798
  var transformString = '';
2614
2799
  /** @type {?} */
@@ -2633,8 +2818,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2633
2818
  }
2634
2819
  extendStyles(this._pane.style, styles);
2635
2820
  };
2821
+ /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */
2636
2822
  /**
2637
2823
  * Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing.
2824
+ * @private
2638
2825
  * @param {?} position
2639
2826
  * @param {?} originPoint
2640
2827
  * @param {?} scrollPosition
@@ -2642,19 +2829,25 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2642
2829
  */
2643
2830
  FlexibleConnectedPositionStrategy.prototype._getExactOverlayY = /**
2644
2831
  * Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing.
2832
+ * @private
2645
2833
  * @param {?} position
2646
2834
  * @param {?} originPoint
2647
2835
  * @param {?} scrollPosition
2648
2836
  * @return {?}
2649
2837
  */
2650
2838
  function (position, originPoint, scrollPosition) {
2839
+ // Reset any existing styles. This is necessary in case the
2840
+ // preferred position has changed since the last `apply`.
2651
2841
  /** @type {?} */
2652
- var styles = /** @type {?} */ ({ top: null, bottom: null });
2842
+ var styles = (/** @type {?} */ ({ top: null, bottom: null }));
2653
2843
  /** @type {?} */
2654
2844
  var overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2655
2845
  if (this._isPushed) {
2656
2846
  overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2657
2847
  }
2848
+ // @breaking-change 8.0.0 Currently the `_overlayContainer` is optional in order to avoid a
2849
+ // breaking change. The null check here can be removed once the `_overlayContainer` becomes
2850
+ // a required parameter.
2658
2851
  /** @type {?} */
2659
2852
  var virtualKeyboardOffset = this._overlayContainer ?
2660
2853
  this._overlayContainer.getContainerElement().getBoundingClientRect().top : 0;
@@ -2666,8 +2859,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2666
2859
  // We want to set either `top` or `bottom` based on whether the overlay wants to appear
2667
2860
  // above or below the origin and the direction in which the element will expand.
2668
2861
  if (position.overlayY === 'bottom') {
2862
+ // When using `bottom`, we adjust the y position such that it is the distance
2863
+ // from the bottom of the viewport rather than the top.
2669
2864
  /** @type {?} */
2670
- var documentHeight = /** @type {?} */ ((this._document.documentElement)).clientHeight;
2865
+ var documentHeight = (/** @type {?} */ (this._document.documentElement)).clientHeight;
2671
2866
  styles.bottom = documentHeight - (overlayPoint.y + this._overlayRect.height) + "px";
2672
2867
  }
2673
2868
  else {
@@ -2675,8 +2870,10 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2675
2870
  }
2676
2871
  return styles;
2677
2872
  };
2873
+ /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */
2678
2874
  /**
2679
2875
  * Gets the exact left/right for the overlay when not using flexible sizing or when pushing.
2876
+ * @private
2680
2877
  * @param {?} position
2681
2878
  * @param {?} originPoint
2682
2879
  * @param {?} scrollPosition
@@ -2684,19 +2881,26 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2684
2881
  */
2685
2882
  FlexibleConnectedPositionStrategy.prototype._getExactOverlayX = /**
2686
2883
  * Gets the exact left/right for the overlay when not using flexible sizing or when pushing.
2884
+ * @private
2687
2885
  * @param {?} position
2688
2886
  * @param {?} originPoint
2689
2887
  * @param {?} scrollPosition
2690
2888
  * @return {?}
2691
2889
  */
2692
2890
  function (position, originPoint, scrollPosition) {
2891
+ // Reset any existing styles. This is necessary in case the preferred position has
2892
+ // changed since the last `apply`.
2693
2893
  /** @type {?} */
2694
- var styles = /** @type {?} */ ({ left: null, right: null });
2894
+ var styles = (/** @type {?} */ ({ left: null, right: null }));
2695
2895
  /** @type {?} */
2696
2896
  var overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2697
2897
  if (this._isPushed) {
2698
2898
  overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2699
2899
  }
2900
+ // We want to set either `left` or `right` based on whether the overlay wants to appear "before"
2901
+ // or "after" the origin, which determines the direction in which the element will expand.
2902
+ // For the horizontal axis, the meaning of "before" and "after" change based on whether the
2903
+ // page is in RTL or LTR.
2700
2904
  /** @type {?} */
2701
2905
  var horizontalStyleProperty;
2702
2906
  if (this._isRtl()) {
@@ -2709,7 +2913,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2709
2913
  // from the right edge of the viewport rather than the left edge.
2710
2914
  if (horizontalStyleProperty === 'right') {
2711
2915
  /** @type {?} */
2712
- var documentWidth = /** @type {?} */ ((this._document.documentElement)).clientWidth;
2916
+ var documentWidth = (/** @type {?} */ (this._document.documentElement)).clientWidth;
2713
2917
  styles.right = documentWidth - (overlayPoint.x + this._overlayRect.width) + "px";
2714
2918
  }
2715
2919
  else {
@@ -2720,18 +2924,28 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2720
2924
  /**
2721
2925
  * Gets the view properties of the trigger and overlay, including whether they are clipped
2722
2926
  * or completely outside the view of any of the strategy's scrollables.
2927
+ */
2928
+ /**
2929
+ * Gets the view properties of the trigger and overlay, including whether they are clipped
2930
+ * or completely outside the view of any of the strategy's scrollables.
2931
+ * @private
2723
2932
  * @return {?}
2724
2933
  */
2725
2934
  FlexibleConnectedPositionStrategy.prototype._getScrollVisibility = /**
2726
2935
  * Gets the view properties of the trigger and overlay, including whether they are clipped
2727
2936
  * or completely outside the view of any of the strategy's scrollables.
2937
+ * @private
2728
2938
  * @return {?}
2729
2939
  */
2730
2940
  function () {
2941
+ // Note: needs fresh rects since the position could've changed.
2731
2942
  /** @type {?} */
2732
2943
  var originBounds = this._origin.getBoundingClientRect();
2733
2944
  /** @type {?} */
2734
2945
  var overlayBounds = this._pane.getBoundingClientRect();
2946
+ // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers
2947
+ // every time, we should be able to use the scrollTop of the containers if the size of those
2948
+ // containers hasn't changed.
2735
2949
  /** @type {?} */
2736
2950
  var scrollContainerBounds = this.scrollables.map(function (scrollable) {
2737
2951
  return scrollable.getElementRef().nativeElement.getBoundingClientRect();
@@ -2743,14 +2957,17 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2743
2957
  isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds),
2744
2958
  };
2745
2959
  };
2960
+ /** Subtracts the amount that an element is overflowing on an axis from it's length. */
2746
2961
  /**
2747
2962
  * Subtracts the amount that an element is overflowing on an axis from it's length.
2963
+ * @private
2748
2964
  * @param {?} length
2749
2965
  * @param {...?} overflows
2750
2966
  * @return {?}
2751
2967
  */
2752
2968
  FlexibleConnectedPositionStrategy.prototype._subtractOverflows = /**
2753
2969
  * Subtracts the amount that an element is overflowing on an axis from it's length.
2970
+ * @private
2754
2971
  * @param {?} length
2755
2972
  * @param {...?} overflows
2756
2973
  * @return {?}
@@ -2764,19 +2981,27 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2764
2981
  return currentValue - Math.max(currentOverflow, 0);
2765
2982
  }, length);
2766
2983
  };
2984
+ /** Narrows the given viewport rect by the current _viewportMargin. */
2767
2985
  /**
2768
2986
  * Narrows the given viewport rect by the current _viewportMargin.
2987
+ * @private
2769
2988
  * @return {?}
2770
2989
  */
2771
2990
  FlexibleConnectedPositionStrategy.prototype._getNarrowedViewportRect = /**
2772
2991
  * Narrows the given viewport rect by the current _viewportMargin.
2992
+ * @private
2773
2993
  * @return {?}
2774
2994
  */
2775
2995
  function () {
2996
+ // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,
2997
+ // because we want to use the `clientWidth` and `clientHeight` as the base. The difference
2998
+ // being that the client properties don't include the scrollbar, as opposed to `innerWidth`
2999
+ // and `innerHeight` that do. This is necessary, because the overlay container uses
3000
+ // 100% `width` and `height` which don't include the scrollbar either.
2776
3001
  /** @type {?} */
2777
- var width = /** @type {?} */ ((this._document.documentElement)).clientWidth;
3002
+ var width = (/** @type {?} */ (this._document.documentElement)).clientWidth;
2778
3003
  /** @type {?} */
2779
- var height = /** @type {?} */ ((this._document.documentElement)).clientHeight;
3004
+ var height = (/** @type {?} */ (this._document.documentElement)).clientHeight;
2780
3005
  /** @type {?} */
2781
3006
  var scrollPosition = this._viewportRuler.getViewportScrollPosition();
2782
3007
  return {
@@ -2788,36 +3013,45 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2788
3013
  height: height - (2 * this._viewportMargin),
2789
3014
  };
2790
3015
  };
3016
+ /** Whether the we're dealing with an RTL context */
2791
3017
  /**
2792
3018
  * Whether the we're dealing with an RTL context
3019
+ * @private
2793
3020
  * @return {?}
2794
3021
  */
2795
3022
  FlexibleConnectedPositionStrategy.prototype._isRtl = /**
2796
3023
  * Whether the we're dealing with an RTL context
3024
+ * @private
2797
3025
  * @return {?}
2798
3026
  */
2799
3027
  function () {
2800
3028
  return this._overlayRef.getDirection() === 'rtl';
2801
3029
  };
3030
+ /** Determines whether the overlay uses exact or flexible positioning. */
2802
3031
  /**
2803
3032
  * Determines whether the overlay uses exact or flexible positioning.
3033
+ * @private
2804
3034
  * @return {?}
2805
3035
  */
2806
3036
  FlexibleConnectedPositionStrategy.prototype._hasExactPosition = /**
2807
3037
  * Determines whether the overlay uses exact or flexible positioning.
3038
+ * @private
2808
3039
  * @return {?}
2809
3040
  */
2810
3041
  function () {
2811
3042
  return !this._hasFlexibleDimensions || this._isPushed;
2812
3043
  };
3044
+ /** Retrieves the offset of a position along the x or y axis. */
2813
3045
  /**
2814
3046
  * Retrieves the offset of a position along the x or y axis.
3047
+ * @private
2815
3048
  * @param {?} position
2816
3049
  * @param {?} axis
2817
3050
  * @return {?}
2818
3051
  */
2819
3052
  FlexibleConnectedPositionStrategy.prototype._getOffset = /**
2820
3053
  * Retrieves the offset of a position along the x or y axis.
3054
+ * @private
2821
3055
  * @param {?} position
2822
3056
  * @param {?} axis
2823
3057
  * @return {?}
@@ -2830,12 +3064,15 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2830
3064
  }
2831
3065
  return position.offsetY == null ? this._offsetY : position.offsetY;
2832
3066
  };
3067
+ /** Validates that the current position match the expected values. */
2833
3068
  /**
2834
3069
  * Validates that the current position match the expected values.
3070
+ * @private
2835
3071
  * @return {?}
2836
3072
  */
2837
3073
  FlexibleConnectedPositionStrategy.prototype._validatePositions = /**
2838
3074
  * Validates that the current position match the expected values.
3075
+ * @private
2839
3076
  * @return {?}
2840
3077
  */
2841
3078
  function () {
@@ -2851,13 +3088,16 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2851
3088
  validateVerticalPosition('overlayY', pair.overlayY);
2852
3089
  });
2853
3090
  };
3091
+ /** Adds a single CSS class or an array of classes on the overlay panel. */
2854
3092
  /**
2855
3093
  * Adds a single CSS class or an array of classes on the overlay panel.
3094
+ * @private
2856
3095
  * @param {?} cssClasses
2857
3096
  * @return {?}
2858
3097
  */
2859
3098
  FlexibleConnectedPositionStrategy.prototype._addPanelClasses = /**
2860
3099
  * Adds a single CSS class or an array of classes on the overlay panel.
3100
+ * @private
2861
3101
  * @param {?} cssClasses
2862
3102
  * @return {?}
2863
3103
  */
@@ -2872,12 +3112,15 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2872
3112
  });
2873
3113
  }
2874
3114
  };
3115
+ /** Clears the classes that the position strategy has applied from the overlay panel. */
2875
3116
  /**
2876
3117
  * Clears the classes that the position strategy has applied from the overlay panel.
3118
+ * @private
2877
3119
  * @return {?}
2878
3120
  */
2879
3121
  FlexibleConnectedPositionStrategy.prototype._clearPanelClasses = /**
2880
3122
  * Clears the classes that the position strategy has applied from the overlay panel.
3123
+ * @private
2881
3124
  * @return {?}
2882
3125
  */
2883
3126
  function () {
@@ -2906,7 +3149,7 @@ function extendStyles(dest, source) {
2906
3149
 
2907
3150
  /**
2908
3151
  * @fileoverview added by tsickle
2909
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3152
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2910
3153
  */
2911
3154
  /**
2912
3155
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -3093,26 +3336,30 @@ ConnectedPositionStrategy = /** @class */ (function () {
3093
3336
  */
3094
3337
  /**
3095
3338
  * Adds a new preferred fallback position.
3339
+ * @template THIS
3340
+ * @this {THIS}
3096
3341
  * @param {?} originPos
3097
3342
  * @param {?} overlayPos
3098
3343
  * @param {?=} offsetX
3099
3344
  * @param {?=} offsetY
3100
- * @return {?}
3345
+ * @return {THIS}
3101
3346
  */
3102
3347
  ConnectedPositionStrategy.prototype.withFallbackPosition = /**
3103
3348
  * Adds a new preferred fallback position.
3349
+ * @template THIS
3350
+ * @this {THIS}
3104
3351
  * @param {?} originPos
3105
3352
  * @param {?} overlayPos
3106
3353
  * @param {?=} offsetX
3107
3354
  * @param {?=} offsetY
3108
- * @return {?}
3355
+ * @return {THIS}
3109
3356
  */
3110
3357
  function (originPos, overlayPos, offsetX, offsetY) {
3111
3358
  /** @type {?} */
3112
3359
  var position = new ConnectionPositionPair(originPos, overlayPos, offsetX, offsetY);
3113
- this._preferredPositions.push(position);
3114
- this._positionStrategy.withPositions(this._preferredPositions);
3115
- return this;
3360
+ (/** @type {?} */ (this))._preferredPositions.push(position);
3361
+ (/** @type {?} */ (this))._positionStrategy.withPositions((/** @type {?} */ (this))._preferredPositions);
3362
+ return (/** @type {?} */ (this));
3116
3363
  };
3117
3364
  /**
3118
3365
  * Sets the layout direction so the overlay's position can be adjusted to match.
@@ -3120,25 +3367,29 @@ ConnectedPositionStrategy = /** @class */ (function () {
3120
3367
  */
3121
3368
  /**
3122
3369
  * Sets the layout direction so the overlay's position can be adjusted to match.
3370
+ * @template THIS
3371
+ * @this {THIS}
3123
3372
  * @param {?} dir New layout direction.
3124
- * @return {?}
3373
+ * @return {THIS}
3125
3374
  */
3126
3375
  ConnectedPositionStrategy.prototype.withDirection = /**
3127
3376
  * Sets the layout direction so the overlay's position can be adjusted to match.
3377
+ * @template THIS
3378
+ * @this {THIS}
3128
3379
  * @param {?} dir New layout direction.
3129
- * @return {?}
3380
+ * @return {THIS}
3130
3381
  */
3131
3382
  function (dir) {
3132
3383
  // Since the direction might be declared before the strategy is attached,
3133
3384
  // we save the value in a temporary property and we'll transfer it to the
3134
3385
  // overlay ref on attachment.
3135
- if (this._overlayRef) {
3136
- this._overlayRef.setDirection(dir);
3386
+ if ((/** @type {?} */ (this))._overlayRef) {
3387
+ (/** @type {?} */ (this))._overlayRef.setDirection(dir);
3137
3388
  }
3138
3389
  else {
3139
- this._direction = dir;
3390
+ (/** @type {?} */ (this))._direction = dir;
3140
3391
  }
3141
- return this;
3392
+ return (/** @type {?} */ (this));
3142
3393
  };
3143
3394
  /**
3144
3395
  * Sets an offset for the overlay's connection point on the x-axis
@@ -3146,17 +3397,21 @@ ConnectedPositionStrategy = /** @class */ (function () {
3146
3397
  */
3147
3398
  /**
3148
3399
  * Sets an offset for the overlay's connection point on the x-axis
3400
+ * @template THIS
3401
+ * @this {THIS}
3149
3402
  * @param {?} offset New offset in the X axis.
3150
- * @return {?}
3403
+ * @return {THIS}
3151
3404
  */
3152
3405
  ConnectedPositionStrategy.prototype.withOffsetX = /**
3153
3406
  * Sets an offset for the overlay's connection point on the x-axis
3407
+ * @template THIS
3408
+ * @this {THIS}
3154
3409
  * @param {?} offset New offset in the X axis.
3155
- * @return {?}
3410
+ * @return {THIS}
3156
3411
  */
3157
3412
  function (offset) {
3158
- this._positionStrategy.withDefaultOffsetX(offset);
3159
- return this;
3413
+ (/** @type {?} */ (this))._positionStrategy.withDefaultOffsetX(offset);
3414
+ return (/** @type {?} */ (this));
3160
3415
  };
3161
3416
  /**
3162
3417
  * Sets an offset for the overlay's connection point on the y-axis
@@ -3164,17 +3419,21 @@ ConnectedPositionStrategy = /** @class */ (function () {
3164
3419
  */
3165
3420
  /**
3166
3421
  * Sets an offset for the overlay's connection point on the y-axis
3422
+ * @template THIS
3423
+ * @this {THIS}
3167
3424
  * @param {?} offset New offset in the Y axis.
3168
- * @return {?}
3425
+ * @return {THIS}
3169
3426
  */
3170
3427
  ConnectedPositionStrategy.prototype.withOffsetY = /**
3171
3428
  * Sets an offset for the overlay's connection point on the y-axis
3429
+ * @template THIS
3430
+ * @this {THIS}
3172
3431
  * @param {?} offset New offset in the Y axis.
3173
- * @return {?}
3432
+ * @return {THIS}
3174
3433
  */
3175
3434
  function (offset) {
3176
- this._positionStrategy.withDefaultOffsetY(offset);
3177
- return this;
3435
+ (/** @type {?} */ (this))._positionStrategy.withDefaultOffsetY(offset);
3436
+ return (/** @type {?} */ (this));
3178
3437
  };
3179
3438
  /**
3180
3439
  * Sets whether the overlay's position should be locked in after it is positioned
@@ -3186,19 +3445,23 @@ ConnectedPositionStrategy = /** @class */ (function () {
3186
3445
  * Sets whether the overlay's position should be locked in after it is positioned
3187
3446
  * initially. When an overlay is locked in, it won't attempt to reposition itself
3188
3447
  * when the position is re-applied (e.g. when the user scrolls away).
3448
+ * @template THIS
3449
+ * @this {THIS}
3189
3450
  * @param {?} isLocked Whether the overlay should locked in.
3190
- * @return {?}
3451
+ * @return {THIS}
3191
3452
  */
3192
3453
  ConnectedPositionStrategy.prototype.withLockedPosition = /**
3193
3454
  * Sets whether the overlay's position should be locked in after it is positioned
3194
3455
  * initially. When an overlay is locked in, it won't attempt to reposition itself
3195
3456
  * when the position is re-applied (e.g. when the user scrolls away).
3457
+ * @template THIS
3458
+ * @this {THIS}
3196
3459
  * @param {?} isLocked Whether the overlay should locked in.
3197
- * @return {?}
3460
+ * @return {THIS}
3198
3461
  */
3199
3462
  function (isLocked) {
3200
- this._positionStrategy.withLockedPosition(isLocked);
3201
- return this;
3463
+ (/** @type {?} */ (this))._positionStrategy.withLockedPosition(isLocked);
3464
+ return (/** @type {?} */ (this));
3202
3465
  };
3203
3466
  /**
3204
3467
  * Overwrites the current set of positions with an array of new ones.
@@ -3206,18 +3469,22 @@ ConnectedPositionStrategy = /** @class */ (function () {
3206
3469
  */
3207
3470
  /**
3208
3471
  * Overwrites the current set of positions with an array of new ones.
3472
+ * @template THIS
3473
+ * @this {THIS}
3209
3474
  * @param {?} positions Position pairs to be set on the strategy.
3210
- * @return {?}
3475
+ * @return {THIS}
3211
3476
  */
3212
3477
  ConnectedPositionStrategy.prototype.withPositions = /**
3213
3478
  * Overwrites the current set of positions with an array of new ones.
3479
+ * @template THIS
3480
+ * @this {THIS}
3214
3481
  * @param {?} positions Position pairs to be set on the strategy.
3215
- * @return {?}
3482
+ * @return {THIS}
3216
3483
  */
3217
3484
  function (positions) {
3218
- this._preferredPositions = positions.slice();
3219
- this._positionStrategy.withPositions(this._preferredPositions);
3220
- return this;
3485
+ (/** @type {?} */ (this))._preferredPositions = positions.slice();
3486
+ (/** @type {?} */ (this))._positionStrategy.withPositions((/** @type {?} */ (this))._preferredPositions);
3487
+ return (/** @type {?} */ (this));
3221
3488
  };
3222
3489
  /**
3223
3490
  * Sets the origin element, relative to which to position the overlay.
@@ -3225,29 +3492,34 @@ ConnectedPositionStrategy = /** @class */ (function () {
3225
3492
  */
3226
3493
  /**
3227
3494
  * Sets the origin element, relative to which to position the overlay.
3495
+ * @template THIS
3496
+ * @this {THIS}
3228
3497
  * @param {?} origin Reference to the new origin element.
3229
- * @return {?}
3498
+ * @return {THIS}
3230
3499
  */
3231
3500
  ConnectedPositionStrategy.prototype.setOrigin = /**
3232
3501
  * Sets the origin element, relative to which to position the overlay.
3502
+ * @template THIS
3503
+ * @this {THIS}
3233
3504
  * @param {?} origin Reference to the new origin element.
3234
- * @return {?}
3505
+ * @return {THIS}
3235
3506
  */
3236
3507
  function (origin) {
3237
- this._positionStrategy.setOrigin(origin);
3238
- return this;
3508
+ (/** @type {?} */ (this))._positionStrategy.setOrigin(origin);
3509
+ return (/** @type {?} */ (this));
3239
3510
  };
3240
3511
  return ConnectedPositionStrategy;
3241
3512
  }());
3242
3513
 
3243
3514
  /**
3244
3515
  * @fileoverview added by tsickle
3245
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3516
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3246
3517
  */
3247
3518
 
3248
- /** *
3519
+ /**
3249
3520
  * Class to be added to the overlay pane wrapper.
3250
- @type {?} */
3521
+ * @type {?}
3522
+ */
3251
3523
  var wrapperClass = 'cdk-global-overlay-wrapper';
3252
3524
  /**
3253
3525
  * A strategy for positioning overlays. Using this strategy, an overlay is given an
@@ -3300,20 +3572,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3300
3572
  */
3301
3573
  /**
3302
3574
  * Sets the top position of the overlay. Clears any previously set vertical position.
3575
+ * @template THIS
3576
+ * @this {THIS}
3303
3577
  * @param {?=} value New top offset.
3304
- * @return {?}
3578
+ * @return {THIS}
3305
3579
  */
3306
3580
  GlobalPositionStrategy.prototype.top = /**
3307
3581
  * Sets the top position of the overlay. Clears any previously set vertical position.
3582
+ * @template THIS
3583
+ * @this {THIS}
3308
3584
  * @param {?=} value New top offset.
3309
- * @return {?}
3585
+ * @return {THIS}
3310
3586
  */
3311
3587
  function (value) {
3312
3588
  if (value === void 0) { value = ''; }
3313
- this._bottomOffset = '';
3314
- this._topOffset = value;
3315
- this._alignItems = 'flex-start';
3316
- return this;
3589
+ (/** @type {?} */ (this))._bottomOffset = '';
3590
+ (/** @type {?} */ (this))._topOffset = value;
3591
+ (/** @type {?} */ (this))._alignItems = 'flex-start';
3592
+ return (/** @type {?} */ (this));
3317
3593
  };
3318
3594
  /**
3319
3595
  * Sets the left position of the overlay. Clears any previously set horizontal position.
@@ -3321,20 +3597,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3321
3597
  */
3322
3598
  /**
3323
3599
  * Sets the left position of the overlay. Clears any previously set horizontal position.
3600
+ * @template THIS
3601
+ * @this {THIS}
3324
3602
  * @param {?=} value New left offset.
3325
- * @return {?}
3603
+ * @return {THIS}
3326
3604
  */
3327
3605
  GlobalPositionStrategy.prototype.left = /**
3328
3606
  * Sets the left position of the overlay. Clears any previously set horizontal position.
3607
+ * @template THIS
3608
+ * @this {THIS}
3329
3609
  * @param {?=} value New left offset.
3330
- * @return {?}
3610
+ * @return {THIS}
3331
3611
  */
3332
3612
  function (value) {
3333
3613
  if (value === void 0) { value = ''; }
3334
- this._rightOffset = '';
3335
- this._leftOffset = value;
3336
- this._justifyContent = 'flex-start';
3337
- return this;
3614
+ (/** @type {?} */ (this))._rightOffset = '';
3615
+ (/** @type {?} */ (this))._leftOffset = value;
3616
+ (/** @type {?} */ (this))._justifyContent = 'flex-start';
3617
+ return (/** @type {?} */ (this));
3338
3618
  };
3339
3619
  /**
3340
3620
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
@@ -3342,20 +3622,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3342
3622
  */
3343
3623
  /**
3344
3624
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
3625
+ * @template THIS
3626
+ * @this {THIS}
3345
3627
  * @param {?=} value New bottom offset.
3346
- * @return {?}
3628
+ * @return {THIS}
3347
3629
  */
3348
3630
  GlobalPositionStrategy.prototype.bottom = /**
3349
3631
  * Sets the bottom position of the overlay. Clears any previously set vertical position.
3632
+ * @template THIS
3633
+ * @this {THIS}
3350
3634
  * @param {?=} value New bottom offset.
3351
- * @return {?}
3635
+ * @return {THIS}
3352
3636
  */
3353
3637
  function (value) {
3354
3638
  if (value === void 0) { value = ''; }
3355
- this._topOffset = '';
3356
- this._bottomOffset = value;
3357
- this._alignItems = 'flex-end';
3358
- return this;
3639
+ (/** @type {?} */ (this))._topOffset = '';
3640
+ (/** @type {?} */ (this))._bottomOffset = value;
3641
+ (/** @type {?} */ (this))._alignItems = 'flex-end';
3642
+ return (/** @type {?} */ (this));
3359
3643
  };
3360
3644
  /**
3361
3645
  * Sets the right position of the overlay. Clears any previously set horizontal position.
@@ -3363,20 +3647,24 @@ GlobalPositionStrategy = /** @class */ (function () {
3363
3647
  */
3364
3648
  /**
3365
3649
  * Sets the right position of the overlay. Clears any previously set horizontal position.
3650
+ * @template THIS
3651
+ * @this {THIS}
3366
3652
  * @param {?=} value New right offset.
3367
- * @return {?}
3653
+ * @return {THIS}
3368
3654
  */
3369
3655
  GlobalPositionStrategy.prototype.right = /**
3370
3656
  * Sets the right position of the overlay. Clears any previously set horizontal position.
3657
+ * @template THIS
3658
+ * @this {THIS}
3371
3659
  * @param {?=} value New right offset.
3372
- * @return {?}
3660
+ * @return {THIS}
3373
3661
  */
3374
3662
  function (value) {
3375
3663
  if (value === void 0) { value = ''; }
3376
- this._leftOffset = '';
3377
- this._rightOffset = value;
3378
- this._justifyContent = 'flex-end';
3379
- return this;
3664
+ (/** @type {?} */ (this))._leftOffset = '';
3665
+ (/** @type {?} */ (this))._rightOffset = value;
3666
+ (/** @type {?} */ (this))._justifyContent = 'flex-end';
3667
+ return (/** @type {?} */ (this));
3380
3668
  };
3381
3669
  /**
3382
3670
  * Sets the overlay width and clears any previously set width.
@@ -3388,25 +3676,29 @@ GlobalPositionStrategy = /** @class */ (function () {
3388
3676
  * Sets the overlay width and clears any previously set width.
3389
3677
  * @deprecated Pass the `width` through the `OverlayConfig`.
3390
3678
  * \@breaking-change 8.0.0
3679
+ * @template THIS
3680
+ * @this {THIS}
3391
3681
  * @param {?=} value New width for the overlay
3392
- * @return {?}
3682
+ * @return {THIS}
3393
3683
  */
3394
3684
  GlobalPositionStrategy.prototype.width = /**
3395
3685
  * Sets the overlay width and clears any previously set width.
3396
3686
  * @deprecated Pass the `width` through the `OverlayConfig`.
3397
3687
  * \@breaking-change 8.0.0
3688
+ * @template THIS
3689
+ * @this {THIS}
3398
3690
  * @param {?=} value New width for the overlay
3399
- * @return {?}
3691
+ * @return {THIS}
3400
3692
  */
3401
3693
  function (value) {
3402
3694
  if (value === void 0) { value = ''; }
3403
- if (this._overlayRef) {
3404
- this._overlayRef.updateSize({ width: value });
3695
+ if ((/** @type {?} */ (this))._overlayRef) {
3696
+ (/** @type {?} */ (this))._overlayRef.updateSize({ width: value });
3405
3697
  }
3406
3698
  else {
3407
- this._width = value;
3699
+ (/** @type {?} */ (this))._width = value;
3408
3700
  }
3409
- return this;
3701
+ return (/** @type {?} */ (this));
3410
3702
  };
3411
3703
  /**
3412
3704
  * Sets the overlay height and clears any previously set height.
@@ -3418,25 +3710,29 @@ GlobalPositionStrategy = /** @class */ (function () {
3418
3710
  * Sets the overlay height and clears any previously set height.
3419
3711
  * @deprecated Pass the `height` through the `OverlayConfig`.
3420
3712
  * \@breaking-change 8.0.0
3713
+ * @template THIS
3714
+ * @this {THIS}
3421
3715
  * @param {?=} value New height for the overlay
3422
- * @return {?}
3716
+ * @return {THIS}
3423
3717
  */
3424
3718
  GlobalPositionStrategy.prototype.height = /**
3425
3719
  * Sets the overlay height and clears any previously set height.
3426
3720
  * @deprecated Pass the `height` through the `OverlayConfig`.
3427
3721
  * \@breaking-change 8.0.0
3722
+ * @template THIS
3723
+ * @this {THIS}
3428
3724
  * @param {?=} value New height for the overlay
3429
- * @return {?}
3725
+ * @return {THIS}
3430
3726
  */
3431
3727
  function (value) {
3432
3728
  if (value === void 0) { value = ''; }
3433
- if (this._overlayRef) {
3434
- this._overlayRef.updateSize({ height: value });
3729
+ if ((/** @type {?} */ (this))._overlayRef) {
3730
+ (/** @type {?} */ (this))._overlayRef.updateSize({ height: value });
3435
3731
  }
3436
3732
  else {
3437
- this._height = value;
3733
+ (/** @type {?} */ (this))._height = value;
3438
3734
  }
3439
- return this;
3735
+ return (/** @type {?} */ (this));
3440
3736
  };
3441
3737
  /**
3442
3738
  * Centers the overlay horizontally with an optional offset.
@@ -3448,21 +3744,25 @@ GlobalPositionStrategy = /** @class */ (function () {
3448
3744
  * Centers the overlay horizontally with an optional offset.
3449
3745
  * Clears any previously set horizontal position.
3450
3746
  *
3747
+ * @template THIS
3748
+ * @this {THIS}
3451
3749
  * @param {?=} offset Overlay offset from the horizontal center.
3452
- * @return {?}
3750
+ * @return {THIS}
3453
3751
  */
3454
3752
  GlobalPositionStrategy.prototype.centerHorizontally = /**
3455
3753
  * Centers the overlay horizontally with an optional offset.
3456
3754
  * Clears any previously set horizontal position.
3457
3755
  *
3756
+ * @template THIS
3757
+ * @this {THIS}
3458
3758
  * @param {?=} offset Overlay offset from the horizontal center.
3459
- * @return {?}
3759
+ * @return {THIS}
3460
3760
  */
3461
3761
  function (offset) {
3462
3762
  if (offset === void 0) { offset = ''; }
3463
- this.left(offset);
3464
- this._justifyContent = 'center';
3465
- return this;
3763
+ (/** @type {?} */ (this)).left(offset);
3764
+ (/** @type {?} */ (this))._justifyContent = 'center';
3765
+ return (/** @type {?} */ (this));
3466
3766
  };
3467
3767
  /**
3468
3768
  * Centers the overlay vertically with an optional offset.
@@ -3474,21 +3774,25 @@ GlobalPositionStrategy = /** @class */ (function () {
3474
3774
  * Centers the overlay vertically with an optional offset.
3475
3775
  * Clears any previously set vertical position.
3476
3776
  *
3777
+ * @template THIS
3778
+ * @this {THIS}
3477
3779
  * @param {?=} offset Overlay offset from the vertical center.
3478
- * @return {?}
3780
+ * @return {THIS}
3479
3781
  */
3480
3782
  GlobalPositionStrategy.prototype.centerVertically = /**
3481
3783
  * Centers the overlay vertically with an optional offset.
3482
3784
  * Clears any previously set vertical position.
3483
3785
  *
3786
+ * @template THIS
3787
+ * @this {THIS}
3484
3788
  * @param {?=} offset Overlay offset from the vertical center.
3485
- * @return {?}
3789
+ * @return {THIS}
3486
3790
  */
3487
3791
  function (offset) {
3488
3792
  if (offset === void 0) { offset = ''; }
3489
- this.top(offset);
3490
- this._alignItems = 'center';
3491
- return this;
3793
+ (/** @type {?} */ (this)).top(offset);
3794
+ (/** @type {?} */ (this))._alignItems = 'center';
3795
+ return (/** @type {?} */ (this));
3492
3796
  };
3493
3797
  /**
3494
3798
  * Apply the position to the element.
@@ -3572,7 +3876,7 @@ GlobalPositionStrategy = /** @class */ (function () {
3572
3876
  parent.classList.remove(wrapperClass);
3573
3877
  parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop =
3574
3878
  styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';
3575
- this._overlayRef = /** @type {?} */ ((null));
3879
+ this._overlayRef = (/** @type {?} */ (null));
3576
3880
  this._isDisposed = true;
3577
3881
  };
3578
3882
  return GlobalPositionStrategy;
@@ -3580,15 +3884,13 @@ GlobalPositionStrategy = /** @class */ (function () {
3580
3884
 
3581
3885
  /**
3582
3886
  * @fileoverview added by tsickle
3583
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3887
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3584
3888
  */
3585
3889
  /**
3586
3890
  * Builder for overlay position strategy.
3587
3891
  */
3588
3892
  var OverlayPositionBuilder = /** @class */ (function () {
3589
- function OverlayPositionBuilder(_viewportRuler, _document,
3590
- // @breaking-change 8.0.0 `_platform` and `_overlayContainer` parameters to be made required.
3591
- _platform, _overlayContainer) {
3893
+ function OverlayPositionBuilder(_viewportRuler, _document, _platform, _overlayContainer) {
3592
3894
  this._viewportRuler = _viewportRuler;
3593
3895
  this._document = _document;
3594
3896
  this._platform = _platform;
@@ -3670,12 +3972,15 @@ var OverlayPositionBuilder = /** @class */ (function () {
3670
3972
 
3671
3973
  /**
3672
3974
  * @fileoverview added by tsickle
3673
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3975
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3674
3976
  */
3675
- /** *
3977
+ /**
3676
3978
  * Next overlay unique ID.
3677
- @type {?} */
3979
+ * @type {?}
3980
+ */
3678
3981
  var nextUniqueId = 0;
3982
+ // Note that Overlay is *not* scoped to the app root because the ComponentFactoryResolver
3983
+ // it needs is different based on where OverlayModule is imported.
3679
3984
  /**
3680
3985
  * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
3681
3986
  * used as a low-level building block for other components. Dialogs, tooltips, menus,
@@ -3685,9 +3990,7 @@ var nextUniqueId = 0;
3685
3990
  * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.
3686
3991
  */
3687
3992
  var Overlay = /** @class */ (function () {
3688
- function Overlay(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality,
3689
- // @breaking-change 8.0.0 `_location` parameter to be made required.
3690
- _location) {
3993
+ function Overlay(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location) {
3691
3994
  this.scrollStrategies = scrollStrategies;
3692
3995
  this._overlayContainer = _overlayContainer;
3693
3996
  this._componentFactoryResolver = _componentFactoryResolver;
@@ -3746,11 +4049,17 @@ var Overlay = /** @class */ (function () {
3746
4049
  };
3747
4050
  /**
3748
4051
  * Creates the DOM element for an overlay and appends it to the overlay container.
4052
+ * @returns Newly-created pane element
4053
+ */
4054
+ /**
4055
+ * Creates the DOM element for an overlay and appends it to the overlay container.
4056
+ * @private
3749
4057
  * @param {?} host
3750
4058
  * @return {?} Newly-created pane element
3751
4059
  */
3752
4060
  Overlay.prototype._createPaneElement = /**
3753
4061
  * Creates the DOM element for an overlay and appends it to the overlay container.
4062
+ * @private
3754
4063
  * @param {?} host
3755
4064
  * @return {?} Newly-created pane element
3756
4065
  */
@@ -3765,11 +4074,18 @@ var Overlay = /** @class */ (function () {
3765
4074
  /**
3766
4075
  * Creates the host element that wraps around an overlay
3767
4076
  * and can be used for advanced positioning.
4077
+ * @returns Newly-create host element.
4078
+ */
4079
+ /**
4080
+ * Creates the host element that wraps around an overlay
4081
+ * and can be used for advanced positioning.
4082
+ * @private
3768
4083
  * @return {?} Newly-create host element.
3769
4084
  */
3770
4085
  Overlay.prototype._createHostElement = /**
3771
4086
  * Creates the host element that wraps around an overlay
3772
4087
  * and can be used for advanced positioning.
4088
+ * @private
3773
4089
  * @return {?} Newly-create host element.
3774
4090
  */
3775
4091
  function () {
@@ -3780,11 +4096,18 @@ var Overlay = /** @class */ (function () {
3780
4096
  };
3781
4097
  /**
3782
4098
  * Create a DomPortalOutlet into which the overlay content can be loaded.
4099
+ * @param pane The DOM element to turn into a portal outlet.
4100
+ * @returns A portal outlet for the given DOM element.
4101
+ */
4102
+ /**
4103
+ * Create a DomPortalOutlet into which the overlay content can be loaded.
4104
+ * @private
3783
4105
  * @param {?} pane The DOM element to turn into a portal outlet.
3784
4106
  * @return {?} A portal outlet for the given DOM element.
3785
4107
  */
3786
4108
  Overlay.prototype._createPortalOutlet = /**
3787
4109
  * Create a DomPortalOutlet into which the overlay content can be loaded.
4110
+ * @private
3788
4111
  * @param {?} pane The DOM element to turn into a portal outlet.
3789
4112
  * @return {?} A portal outlet for the given DOM element.
3790
4113
  */
@@ -3817,11 +4140,12 @@ var Overlay = /** @class */ (function () {
3817
4140
 
3818
4141
  /**
3819
4142
  * @fileoverview added by tsickle
3820
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4143
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3821
4144
  */
3822
- /** *
4145
+ /**
3823
4146
  * Default set of positions for the overlay. Follows the behavior of a dropdown.
3824
- @type {?} */
4147
+ * @type {?}
4148
+ */
3825
4149
  var defaultPositionList = [
3826
4150
  {
3827
4151
  originX: 'start',
@@ -3848,9 +4172,10 @@ var defaultPositionList = [
3848
4172
  overlayY: 'top'
3849
4173
  }
3850
4174
  ];
3851
- /** *
4175
+ /**
3852
4176
  * Injection token that determines the scroll handling while the connected overlay is open.
3853
- @type {?} */
4177
+ * @type {?}
4178
+ */
3854
4179
  var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new core.InjectionToken('cdk-connected-overlay-scroll-strategy');
3855
4180
  /**
3856
4181
  * Directive applied to an element to make it usable as an origin for an Overlay using a
@@ -4088,12 +4413,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4088
4413
  this.open ? this._attachOverlay() : this._detachOverlay();
4089
4414
  }
4090
4415
  };
4416
+ /** Creates an overlay */
4091
4417
  /**
4092
4418
  * Creates an overlay
4419
+ * @private
4093
4420
  * @return {?}
4094
4421
  */
4095
4422
  CdkConnectedOverlay.prototype._createOverlay = /**
4096
4423
  * Creates an overlay
4424
+ * @private
4097
4425
  * @return {?}
4098
4426
  */
4099
4427
  function () {
@@ -4109,12 +4437,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4109
4437
  }
4110
4438
  });
4111
4439
  };
4440
+ /** Builds the overlay config based on the directive's inputs */
4112
4441
  /**
4113
4442
  * Builds the overlay config based on the directive's inputs
4443
+ * @private
4114
4444
  * @return {?}
4115
4445
  */
4116
4446
  CdkConnectedOverlay.prototype._buildConfig = /**
4117
4447
  * Builds the overlay config based on the directive's inputs
4448
+ * @private
4118
4449
  * @return {?}
4119
4450
  */
4120
4451
  function () {
@@ -4147,13 +4478,16 @@ var CdkConnectedOverlay = /** @class */ (function () {
4147
4478
  }
4148
4479
  return overlayConfig;
4149
4480
  };
4481
+ /** Updates the state of a position strategy, based on the values of the directive inputs. */
4150
4482
  /**
4151
4483
  * Updates the state of a position strategy, based on the values of the directive inputs.
4484
+ * @private
4152
4485
  * @param {?} positionStrategy
4153
4486
  * @return {?}
4154
4487
  */
4155
4488
  CdkConnectedOverlay.prototype._updatePositionStrategy = /**
4156
4489
  * Updates the state of a position strategy, based on the values of the directive inputs.
4490
+ * @private
4157
4491
  * @param {?} positionStrategy
4158
4492
  * @return {?}
4159
4493
  */
@@ -4177,12 +4511,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4177
4511
  .withViewportMargin(this.viewportMargin)
4178
4512
  .withLockedPosition(this.lockPosition);
4179
4513
  };
4514
+ /** Returns the position strategy of the overlay to be set on the overlay config */
4180
4515
  /**
4181
4516
  * Returns the position strategy of the overlay to be set on the overlay config
4517
+ * @private
4182
4518
  * @return {?}
4183
4519
  */
4184
4520
  CdkConnectedOverlay.prototype._createPositionStrategy = /**
4185
4521
  * Returns the position strategy of the overlay to be set on the overlay config
4522
+ * @private
4186
4523
  * @return {?}
4187
4524
  */
4188
4525
  function () {
@@ -4193,12 +4530,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4193
4530
  strategy.positionChanges.subscribe(function (p) { return _this.positionChange.emit(p); });
4194
4531
  return strategy;
4195
4532
  };
4533
+ /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
4196
4534
  /**
4197
4535
  * Attaches the overlay and subscribes to backdrop clicks if backdrop exists
4536
+ * @private
4198
4537
  * @return {?}
4199
4538
  */
4200
4539
  CdkConnectedOverlay.prototype._attachOverlay = /**
4201
4540
  * Attaches the overlay and subscribes to backdrop clicks if backdrop exists
4541
+ * @private
4202
4542
  * @return {?}
4203
4543
  */
4204
4544
  function () {
@@ -4225,12 +4565,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4225
4565
  });
4226
4566
  }
4227
4567
  };
4568
+ /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
4228
4569
  /**
4229
4570
  * Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists
4571
+ * @private
4230
4572
  * @return {?}
4231
4573
  */
4232
4574
  CdkConnectedOverlay.prototype._detachOverlay = /**
4233
4575
  * Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists
4576
+ * @private
4234
4577
  * @return {?}
4235
4578
  */
4236
4579
  function () {
@@ -4240,12 +4583,15 @@ var CdkConnectedOverlay = /** @class */ (function () {
4240
4583
  }
4241
4584
  this._backdropSubscription.unsubscribe();
4242
4585
  };
4586
+ /** Destroys the overlay created by this directive. */
4243
4587
  /**
4244
4588
  * Destroys the overlay created by this directive.
4589
+ * @private
4245
4590
  * @return {?}
4246
4591
  */
4247
4592
  CdkConnectedOverlay.prototype._destroyOverlay = /**
4248
4593
  * Destroys the overlay created by this directive.
4594
+ * @private
4249
4595
  * @return {?}
4250
4596
  */
4251
4597
  function () {
@@ -4303,9 +4649,10 @@ var CdkConnectedOverlay = /** @class */ (function () {
4303
4649
  function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
4304
4650
  return function () { return overlay.scrollStrategies.reposition(); };
4305
4651
  }
4306
- /** *
4652
+ /**
4307
4653
  * \@docs-private
4308
- @type {?} */
4654
+ * @type {?}
4655
+ */
4309
4656
  var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
4310
4657
  provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
4311
4658
  deps: [Overlay],
@@ -4314,7 +4661,7 @@ var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
4314
4661
 
4315
4662
  /**
4316
4663
  * @fileoverview added by tsickle
4317
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4664
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4318
4665
  */
4319
4666
  var OverlayModule = /** @class */ (function () {
4320
4667
  function OverlayModule() {
@@ -4332,11 +4679,12 @@ var OverlayModule = /** @class */ (function () {
4332
4679
  ];
4333
4680
  return OverlayModule;
4334
4681
  }());
4335
- /** *
4682
+ /**
4336
4683
  * @deprecated Use `OverlayModule` instead.
4337
4684
  * \@breaking-change 8.0.0
4338
4685
  * \@docs-private
4339
- @type {?} */
4686
+ * @type {?}
4687
+ */
4340
4688
  var OVERLAY_PROVIDERS = [
4341
4689
  Overlay,
4342
4690
  OverlayPositionBuilder,
@@ -4348,7 +4696,7 @@ var OVERLAY_PROVIDERS = [
4348
4696
 
4349
4697
  /**
4350
4698
  * @fileoverview added by tsickle
4351
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4699
+ * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4352
4700
  */
4353
4701
  /**
4354
4702
  * Alternative to OverlayContainer that supports correct displaying of overlay elements in
@@ -4375,9 +4723,11 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4375
4723
  }
4376
4724
  };
4377
4725
  /**
4726
+ * @protected
4378
4727
  * @return {?}
4379
4728
  */
4380
4729
  FullscreenOverlayContainer.prototype._createContainer = /**
4730
+ * @protected
4381
4731
  * @return {?}
4382
4732
  */
4383
4733
  function () {
@@ -4387,9 +4737,11 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4387
4737
  this._addFullscreenChangeListener(function () { return _this._adjustParentForFullscreenChange(); });
4388
4738
  };
4389
4739
  /**
4740
+ * @private
4390
4741
  * @return {?}
4391
4742
  */
4392
4743
  FullscreenOverlayContainer.prototype._adjustParentForFullscreenChange = /**
4744
+ * @private
4393
4745
  * @return {?}
4394
4746
  */
4395
4747
  function () {
@@ -4403,10 +4755,12 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4403
4755
  parent.appendChild(this._containerElement);
4404
4756
  };
4405
4757
  /**
4758
+ * @private
4406
4759
  * @param {?} fn
4407
4760
  * @return {?}
4408
4761
  */
4409
4762
  FullscreenOverlayContainer.prototype._addFullscreenChangeListener = /**
4763
+ * @private
4410
4764
  * @param {?} fn
4411
4765
  * @return {?}
4412
4766
  */
@@ -4422,9 +4776,11 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4422
4776
  }
4423
4777
  };
4424
4778
  /**
4779
+ * @private
4425
4780
  * @return {?}
4426
4781
  */
4427
4782
  FullscreenOverlayContainer.prototype._getEventName = /**
4783
+ * @private
4428
4784
  * @return {?}
4429
4785
  */
4430
4786
  function () {
@@ -4435,10 +4791,10 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4435
4791
  else if (this._document.webkitFullscreenEnabled) {
4436
4792
  this._fullScreenEventName = 'webkitfullscreenchange';
4437
4793
  }
4438
- else if ((/** @type {?} */ (this._document)).mozFullScreenEnabled) {
4794
+ else if (((/** @type {?} */ (this._document))).mozFullScreenEnabled) {
4439
4795
  this._fullScreenEventName = 'mozfullscreenchange';
4440
4796
  }
4441
- else if ((/** @type {?} */ (this._document)).msFullscreenEnabled) {
4797
+ else if (((/** @type {?} */ (this._document))).msFullscreenEnabled) {
4442
4798
  this._fullScreenEventName = 'MSFullscreenChange';
4443
4799
  }
4444
4800
  }
@@ -4461,17 +4817,18 @@ var FullscreenOverlayContainer = /** @class */ (function (_super) {
4461
4817
  function () {
4462
4818
  return this._document.fullscreenElement ||
4463
4819
  this._document.webkitFullscreenElement ||
4464
- (/** @type {?} */ (this._document)).mozFullScreenElement ||
4465
- (/** @type {?} */ (this._document)).msFullscreenElement ||
4820
+ ((/** @type {?} */ (this._document))).mozFullScreenElement ||
4821
+ ((/** @type {?} */ (this._document))).msFullscreenElement ||
4466
4822
  null;
4467
4823
  };
4468
4824
  FullscreenOverlayContainer.decorators = [
4469
- { type: core.Injectable },
4825
+ { type: core.Injectable, args: [{ providedIn: 'root' },] },
4470
4826
  ];
4471
4827
  /** @nocollapse */
4472
4828
  FullscreenOverlayContainer.ctorParameters = function () { return [
4473
4829
  { type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] }
4474
4830
  ]; };
4831
+ /** @nocollapse */ FullscreenOverlayContainer.ngInjectableDef = core.defineInjectable({ factory: function FullscreenOverlayContainer_Factory() { return new FullscreenOverlayContainer(core.inject(common.DOCUMENT)); }, token: FullscreenOverlayContainer, providedIn: "root" });
4475
4832
  return FullscreenOverlayContainer;
4476
4833
  }(OverlayContainer));
4477
4834