@angular/cdk 2.0.0-beta.11 → 2.0.0-beta.12

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 (306) hide show
  1. package/_a11y.scss +23 -0
  2. package/_overlay.scss +93 -0
  3. package/a11y/index.metadata.json +2 -1
  4. package/a11y/typings/a11y-module.d.ts +2 -0
  5. package/a11y/typings/focus-monitor.d.ts +1 -1
  6. package/a11y/typings/index.d.ts +1 -1
  7. package/a11y/typings/index.metadata.json +1 -1
  8. package/a11y/typings/{public_api.d.ts → public-api.d.ts} +8 -2
  9. package/a11y-prebuilt.css +1 -0
  10. package/a11y.metadata.json +2 -1
  11. package/bidi/index.metadata.json +2 -1
  12. package/bidi/typings/bidi-module.d.ts +2 -0
  13. package/bidi/typings/index.d.ts +1 -1
  14. package/bidi/typings/index.metadata.json +1 -1
  15. package/bidi/typings/public-api.d.ts +10 -0
  16. package/bidi.metadata.json +2 -1
  17. package/bundles/cdk-a11y.umd.js +1368 -1357
  18. package/bundles/cdk-a11y.umd.js.map +1 -1
  19. package/bundles/cdk-a11y.umd.min.js +2 -2
  20. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  21. package/bundles/cdk-bidi.umd.js +42 -40
  22. package/bundles/cdk-bidi.umd.js.map +1 -1
  23. package/bundles/cdk-bidi.umd.min.js +2 -2
  24. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  25. package/bundles/cdk-coercion.umd.js +12 -0
  26. package/bundles/cdk-coercion.umd.js.map +1 -1
  27. package/bundles/cdk-coercion.umd.min.js +2 -2
  28. package/bundles/cdk-coercion.umd.min.js.map +1 -1
  29. package/bundles/cdk-collections.umd.js +113 -11
  30. package/bundles/cdk-collections.umd.js.map +1 -1
  31. package/bundles/cdk-collections.umd.min.js +2 -2
  32. package/bundles/cdk-collections.umd.min.js.map +1 -1
  33. package/bundles/cdk-keycodes.umd.js.map +1 -1
  34. package/bundles/cdk-keycodes.umd.min.js +1 -1
  35. package/bundles/cdk-keycodes.umd.min.js.map +1 -1
  36. package/bundles/cdk-layout.umd.js +235 -0
  37. package/bundles/cdk-layout.umd.js.map +1 -0
  38. package/bundles/cdk-layout.umd.min.js +9 -0
  39. package/bundles/cdk-layout.umd.min.js.map +1 -0
  40. package/bundles/cdk-observers.umd.js +41 -40
  41. package/bundles/cdk-observers.umd.js.map +1 -1
  42. package/bundles/cdk-observers.umd.min.js +2 -2
  43. package/bundles/cdk-observers.umd.min.js.map +1 -1
  44. package/bundles/cdk-overlay.umd.js +306 -265
  45. package/bundles/cdk-overlay.umd.js.map +1 -1
  46. package/bundles/cdk-overlay.umd.min.js +2 -2
  47. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  48. package/bundles/cdk-platform.umd.js +19 -17
  49. package/bundles/cdk-platform.umd.js.map +1 -1
  50. package/bundles/cdk-platform.umd.min.js +2 -2
  51. package/bundles/cdk-platform.umd.min.js.map +1 -1
  52. package/bundles/cdk-portal.umd.js +71 -37
  53. package/bundles/cdk-portal.umd.js.map +1 -1
  54. package/bundles/cdk-portal.umd.min.js +2 -2
  55. package/bundles/cdk-portal.umd.min.js.map +1 -1
  56. package/bundles/cdk-rxjs.umd.js +13 -4
  57. package/bundles/cdk-rxjs.umd.js.map +1 -1
  58. package/bundles/cdk-rxjs.umd.min.js +2 -2
  59. package/bundles/cdk-rxjs.umd.min.js.map +1 -1
  60. package/bundles/cdk-scrolling.umd.js +89 -54
  61. package/bundles/cdk-scrolling.umd.js.map +1 -1
  62. package/bundles/cdk-scrolling.umd.min.js +2 -2
  63. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  64. package/bundles/cdk-stepper.umd.js +115 -90
  65. package/bundles/cdk-stepper.umd.js.map +1 -1
  66. package/bundles/cdk-stepper.umd.min.js +2 -2
  67. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  68. package/bundles/cdk-table.umd.js +261 -218
  69. package/bundles/cdk-table.umd.js.map +1 -1
  70. package/bundles/cdk-table.umd.min.js +2 -2
  71. package/bundles/cdk-table.umd.min.js.map +1 -1
  72. package/bundles/cdk.umd.js +1 -1
  73. package/bundles/cdk.umd.js.map +1 -1
  74. package/bundles/cdk.umd.min.js +2 -2
  75. package/bundles/cdk.umd.min.js.map +1 -1
  76. package/cdk.metadata.json +2 -1
  77. package/coercion/index.metadata.json +2 -1
  78. package/coercion/typings/array.d.ts +9 -0
  79. package/coercion/typings/index.d.ts +1 -1
  80. package/coercion/typings/index.metadata.json +1 -1
  81. package/{typings/coercion/public_api.d.ts → coercion/typings/public-api.d.ts} +1 -0
  82. package/coercion.metadata.json +2 -1
  83. package/collections/index.metadata.json +2 -1
  84. package/collections/typings/index.d.ts +2 -1
  85. package/collections/typings/index.metadata.json +1 -1
  86. package/{typings/collections/public_api.d.ts → collections/typings/public-api.d.ts} +1 -0
  87. package/collections/typings/selection.d.ts +13 -3
  88. package/collections/typings/unique-selection-dispatcher.d.ts +40 -0
  89. package/collections.metadata.json +2 -1
  90. package/esm2015/a11y.js +1252 -1250
  91. package/esm2015/a11y.js.map +1 -1
  92. package/esm2015/bidi.js +1 -1
  93. package/esm2015/bidi.js.map +1 -1
  94. package/esm2015/cdk.js +1 -1
  95. package/esm2015/cdk.js.map +1 -1
  96. package/esm2015/coercion.js +11 -1
  97. package/esm2015/coercion.js.map +1 -1
  98. package/esm2015/collections.js +93 -8
  99. package/esm2015/collections.js.map +1 -1
  100. package/esm2015/keycodes.js.map +1 -1
  101. package/esm2015/layout.js +226 -0
  102. package/esm2015/layout.js.map +1 -0
  103. package/esm2015/observers.js +8 -7
  104. package/esm2015/observers.js.map +1 -1
  105. package/esm2015/overlay.js +157 -136
  106. package/esm2015/overlay.js.map +1 -1
  107. package/esm2015/platform.js +1 -1
  108. package/esm2015/platform.js.map +1 -1
  109. package/esm2015/portal.js +30 -1
  110. package/esm2015/portal.js.map +1 -1
  111. package/esm2015/rxjs.js +5 -1
  112. package/esm2015/rxjs.js.map +1 -1
  113. package/esm2015/scrolling.js +39 -8
  114. package/esm2015/scrolling.js.map +1 -1
  115. package/esm2015/stepper.js +27 -5
  116. package/esm2015/stepper.js.map +1 -1
  117. package/esm2015/table.js +68 -29
  118. package/esm2015/table.js.map +1 -1
  119. package/esm5/a11y.es5.js +1372 -1357
  120. package/esm5/a11y.es5.js.map +1 -1
  121. package/esm5/bidi.es5.js +45 -40
  122. package/esm5/bidi.es5.js.map +1 -1
  123. package/esm5/cdk.es5.js +4 -1
  124. package/esm5/cdk.es5.js.map +1 -1
  125. package/esm5/coercion.es5.js +14 -1
  126. package/esm5/coercion.es5.js.map +1 -1
  127. package/esm5/collections.es5.js +110 -8
  128. package/esm5/collections.es5.js.map +1 -1
  129. package/esm5/keycodes.es5.js +2 -0
  130. package/esm5/keycodes.es5.js.map +1 -1
  131. package/esm5/layout.es5.js +234 -0
  132. package/esm5/layout.es5.js.map +1 -0
  133. package/esm5/observers.es5.js +44 -40
  134. package/esm5/observers.es5.js.map +1 -1
  135. package/esm5/overlay.es5.js +304 -259
  136. package/esm5/overlay.es5.js.map +1 -1
  137. package/esm5/platform.es5.js +22 -17
  138. package/esm5/platform.es5.js.map +1 -1
  139. package/esm5/portal.es5.js +81 -44
  140. package/esm5/portal.es5.js.map +1 -1
  141. package/esm5/rxjs.es5.js +12 -1
  142. package/esm5/rxjs.es5.js.map +1 -1
  143. package/esm5/scrolling.es5.js +89 -51
  144. package/esm5/scrolling.es5.js.map +1 -1
  145. package/esm5/stepper.es5.js +119 -91
  146. package/esm5/stepper.es5.js.map +1 -1
  147. package/esm5/table.es5.js +265 -218
  148. package/esm5/table.es5.js.map +1 -1
  149. package/keycodes/index.metadata.json +2 -1
  150. package/keycodes/typings/index.d.ts +1 -1
  151. package/keycodes/typings/{public_api.d.ts → public-api.d.ts} +0 -0
  152. package/keycodes.metadata.json +2 -1
  153. package/layout/index.d.ts +8 -0
  154. package/layout/index.metadata.json +12 -0
  155. package/layout/package.json +7 -0
  156. package/layout/typings/breakpoints-observer.d.ts +37 -0
  157. package/layout/typings/breakpoints.d.ts +18 -0
  158. package/layout/typings/index.d.ts +4 -0
  159. package/layout/typings/index.metadata.json +1 -0
  160. package/layout/typings/media-matcher.d.ts +15 -0
  161. package/layout/typings/public-api.d.ts +5 -0
  162. package/layout.d.ts +8 -0
  163. package/layout.metadata.json +12 -0
  164. package/observers/index.metadata.json +2 -1
  165. package/observers/typings/index.d.ts +1 -1
  166. package/observers/typings/index.metadata.json +1 -1
  167. package/observers/typings/observe-content.d.ts +3 -3
  168. package/observers/typings/{public_api.d.ts → public-api.d.ts} +0 -0
  169. package/observers.metadata.json +2 -1
  170. package/overlay/index.metadata.json +2 -1
  171. package/overlay/typings/index.d.ts +2 -2
  172. package/overlay/typings/index.metadata.json +1 -1
  173. package/overlay/typings/overlay-config.d.ts +1 -1
  174. package/overlay/typings/overlay-directives.d.ts +3 -3
  175. package/overlay/typings/overlay-module.d.ts +11 -0
  176. package/overlay/typings/overlay-ref.d.ts +6 -6
  177. package/overlay/typings/overlay.d.ts +2 -2
  178. package/overlay/typings/position/connected-position-strategy.d.ts +5 -0
  179. package/overlay/typings/position/position-strategy.d.ts +2 -0
  180. package/overlay/typings/{public_api.d.ts → public-api.d.ts} +1 -4
  181. package/overlay/typings/scroll/scroll-strategy.d.ts +1 -1
  182. package/overlay-prebuilt.css +1 -0
  183. package/overlay.metadata.json +2 -1
  184. package/package.json +3 -3
  185. package/platform/index.metadata.json +2 -1
  186. package/platform/typings/index.d.ts +1 -1
  187. package/platform/typings/index.metadata.json +1 -1
  188. package/platform/typings/platform-module.d.ts +2 -0
  189. package/platform/typings/public-api.d.ts +10 -0
  190. package/platform.metadata.json +2 -1
  191. package/portal/index.metadata.json +2 -1
  192. package/portal/typings/index.d.ts +1 -1
  193. package/portal/typings/index.metadata.json +1 -1
  194. package/portal/typings/{public_api.d.ts → public-api.d.ts} +1 -0
  195. package/portal.metadata.json +2 -1
  196. package/rxjs/index.metadata.json +2 -1
  197. package/rxjs/typings/index.d.ts +1 -1
  198. package/rxjs/typings/index.metadata.json +1 -1
  199. package/rxjs/typings/{public_api.d.ts → public-api.d.ts} +0 -0
  200. package/rxjs/typings/rx-operators.d.ts +7 -0
  201. package/rxjs.metadata.json +2 -1
  202. package/scrolling/index.metadata.json +2 -1
  203. package/scrolling/typings/index.d.ts +1 -1
  204. package/scrolling/typings/index.metadata.json +1 -1
  205. package/scrolling/typings/public-api.d.ts +11 -0
  206. package/scrolling/typings/scrolling-module.d.ts +2 -0
  207. package/scrolling/typings/viewport-ruler.d.ts +20 -6
  208. package/scrolling.metadata.json +2 -1
  209. package/stepper/index.metadata.json +2 -1
  210. package/stepper/typings/index.d.ts +1 -1
  211. package/stepper/typings/index.metadata.json +1 -1
  212. package/stepper/typings/public-api.d.ts +11 -0
  213. package/stepper/typings/stepper-module.d.ts +2 -0
  214. package/stepper/typings/stepper.d.ts +8 -4
  215. package/stepper.metadata.json +2 -1
  216. package/table/index.metadata.json +2 -1
  217. package/table/typings/index.d.ts +1 -1
  218. package/table/typings/index.metadata.json +1 -1
  219. package/table/typings/public-api.d.ts +13 -0
  220. package/table/typings/row.d.ts +11 -3
  221. package/table/typings/table-errors.d.ts +10 -0
  222. package/table/typings/table-module.d.ts +2 -0
  223. package/table/typings/table.d.ts +17 -8
  224. package/table.metadata.json +2 -1
  225. package/typings/a11y/a11y-module.d.ts +2 -0
  226. package/typings/a11y/focus-monitor.d.ts +1 -1
  227. package/typings/a11y/index.d.ts +1 -1
  228. package/typings/a11y/index.metadata.json +1 -1
  229. package/typings/a11y/{public_api.d.ts → public-api.d.ts} +8 -2
  230. package/typings/bidi/bidi-module.d.ts +2 -0
  231. package/typings/bidi/index.d.ts +1 -1
  232. package/typings/bidi/index.metadata.json +1 -1
  233. package/typings/bidi/public-api.d.ts +10 -0
  234. package/typings/coercion/array.d.ts +9 -0
  235. package/typings/coercion/index.d.ts +1 -1
  236. package/typings/coercion/index.metadata.json +1 -1
  237. package/{coercion/typings/public_api.d.ts → typings/coercion/public-api.d.ts} +1 -0
  238. package/typings/collections/index.d.ts +2 -1
  239. package/typings/collections/index.metadata.json +1 -1
  240. package/{collections/typings/public_api.d.ts → typings/collections/public-api.d.ts} +1 -0
  241. package/typings/collections/selection.d.ts +13 -3
  242. package/typings/collections/unique-selection-dispatcher.d.ts +40 -0
  243. package/typings/index.d.ts +1 -1
  244. package/typings/index.metadata.json +1 -1
  245. package/typings/keycodes/index.d.ts +1 -1
  246. package/typings/keycodes/{public_api.d.ts → public-api.d.ts} +0 -0
  247. package/typings/layout/breakpoints-observer.d.ts +37 -0
  248. package/typings/layout/breakpoints.d.ts +18 -0
  249. package/typings/layout/index.d.ts +4 -0
  250. package/typings/layout/index.metadata.json +1 -0
  251. package/typings/layout/media-matcher.d.ts +15 -0
  252. package/typings/layout/public-api.d.ts +5 -0
  253. package/typings/observers/index.d.ts +1 -1
  254. package/typings/observers/index.metadata.json +1 -1
  255. package/typings/observers/observe-content.d.ts +3 -3
  256. package/typings/observers/{public_api.d.ts → public-api.d.ts} +0 -0
  257. package/typings/overlay/index.d.ts +2 -2
  258. package/typings/overlay/index.metadata.json +1 -1
  259. package/typings/overlay/overlay-config.d.ts +1 -1
  260. package/typings/overlay/overlay-directives.d.ts +3 -3
  261. package/typings/overlay/overlay-module.d.ts +11 -0
  262. package/typings/overlay/overlay-ref.d.ts +6 -6
  263. package/typings/overlay/overlay.d.ts +2 -2
  264. package/typings/overlay/position/connected-position-strategy.d.ts +5 -0
  265. package/typings/overlay/position/position-strategy.d.ts +2 -0
  266. package/typings/overlay/{public_api.d.ts → public-api.d.ts} +1 -4
  267. package/typings/overlay/scroll/scroll-strategy.d.ts +1 -1
  268. package/typings/platform/index.d.ts +1 -1
  269. package/typings/platform/index.metadata.json +1 -1
  270. package/typings/platform/platform-module.d.ts +2 -0
  271. package/typings/platform/public-api.d.ts +10 -0
  272. package/typings/portal/index.d.ts +1 -1
  273. package/typings/portal/index.metadata.json +1 -1
  274. package/typings/portal/{public_api.d.ts → public-api.d.ts} +1 -0
  275. package/typings/{public_api.d.ts → public-api.d.ts} +0 -0
  276. package/typings/rxjs/index.d.ts +1 -1
  277. package/typings/rxjs/index.metadata.json +1 -1
  278. package/typings/rxjs/{public_api.d.ts → public-api.d.ts} +0 -0
  279. package/typings/rxjs/rx-operators.d.ts +7 -0
  280. package/typings/scrolling/index.d.ts +1 -1
  281. package/typings/scrolling/index.metadata.json +1 -1
  282. package/typings/scrolling/public-api.d.ts +11 -0
  283. package/typings/scrolling/scrolling-module.d.ts +2 -0
  284. package/typings/scrolling/viewport-ruler.d.ts +20 -6
  285. package/typings/stepper/index.d.ts +1 -1
  286. package/typings/stepper/index.metadata.json +1 -1
  287. package/typings/stepper/public-api.d.ts +11 -0
  288. package/typings/stepper/stepper-module.d.ts +2 -0
  289. package/typings/stepper/stepper.d.ts +8 -4
  290. package/typings/table/index.d.ts +1 -1
  291. package/typings/table/index.metadata.json +1 -1
  292. package/typings/table/public-api.d.ts +13 -0
  293. package/typings/table/row.d.ts +11 -3
  294. package/typings/table/table-errors.d.ts +10 -0
  295. package/typings/table/table-module.d.ts +2 -0
  296. package/typings/table/table.d.ts +17 -8
  297. package/bidi/typings/public_api.d.ts +0 -4
  298. package/platform/typings/public_api.d.ts +0 -4
  299. package/scrolling/typings/public_api.d.ts +0 -5
  300. package/stepper/typings/public_api.d.ts +0 -5
  301. package/table/typings/public_api.d.ts +0 -7
  302. package/typings/bidi/public_api.d.ts +0 -4
  303. package/typings/platform/public_api.d.ts +0 -4
  304. package/typings/scrolling/public_api.d.ts +0 -5
  305. package/typings/stepper/public_api.d.ts +0 -5
  306. package/typings/table/public_api.d.ts +0 -7
@@ -10,8 +10,10 @@ import { Platform, PlatformModule } from '@angular/cdk/platform';
10
10
  import { Subject } from 'rxjs/Subject';
11
11
  import { Subscription } from 'rxjs/Subscription';
12
12
  import { fromEvent } from 'rxjs/observable/fromEvent';
13
- import { merge } from 'rxjs/observable/merge';
14
13
  import { auditTime } from 'rxjs/operator/auditTime';
14
+ import { merge } from 'rxjs/observable/merge';
15
+ import { of } from 'rxjs/observable/of';
16
+
15
17
  /**
16
18
  * Time in ms to throttle the scrolling events by default.
17
19
  */
@@ -92,7 +94,7 @@ var ScrollDispatcher = (function () {
92
94
  this._scrolledCount++;
93
95
  if (!this._globalSubscription) {
94
96
  this._globalSubscription = this._ngZone.runOutsideAngular(function () {
95
- return merge(fromEvent(window.document, 'scroll'), fromEvent(window, 'resize')).subscribe(function () { return _this._notify(); });
97
+ return fromEvent(window.document, 'scroll').subscribe(function () { return _this._notify(); });
96
98
  });
97
99
  }
98
100
  // Note that we need to do the subscribing from here, in order to be able to remove
@@ -147,18 +149,18 @@ var ScrollDispatcher = (function () {
147
149
  ScrollDispatcher.prototype._notify = function () {
148
150
  this._scrolled.next();
149
151
  };
152
+ ScrollDispatcher.decorators = [
153
+ { type: Injectable },
154
+ ];
155
+ /**
156
+ * @nocollapse
157
+ */
158
+ ScrollDispatcher.ctorParameters = function () { return [
159
+ { type: NgZone, },
160
+ { type: Platform, },
161
+ ]; };
150
162
  return ScrollDispatcher;
151
163
  }());
152
- ScrollDispatcher.decorators = [
153
- { type: Injectable },
154
- ];
155
- /**
156
- * @nocollapse
157
- */
158
- ScrollDispatcher.ctorParameters = function () { return [
159
- { type: NgZone, },
160
- { type: Platform, },
161
- ]; };
162
164
  /**
163
165
  * \@docs-private
164
166
  * @param {?} parentDispatcher
@@ -178,6 +180,7 @@ var SCROLL_DISPATCHER_PROVIDER = {
178
180
  deps: [[new Optional(), new SkipSelf(), ScrollDispatcher], NgZone, Platform],
179
181
  useFactory: SCROLL_DISPATCHER_PROVIDER_FACTORY
180
182
  };
183
+
181
184
  /**
182
185
  * Sends an event when the directive's element is scrolled. Registers itself with the
183
186
  * ScrollDispatcher service to include itself as part of its collection of scrolling events that it
@@ -232,35 +235,54 @@ var Scrollable = (function () {
232
235
  Scrollable.prototype.getElementRef = function () {
233
236
  return this._elementRef;
234
237
  };
238
+ Scrollable.decorators = [
239
+ { type: Directive, args: [{
240
+ selector: '[cdk-scrollable], [cdkScrollable]'
241
+ },] },
242
+ ];
243
+ /**
244
+ * @nocollapse
245
+ */
246
+ Scrollable.ctorParameters = function () { return [
247
+ { type: ElementRef, },
248
+ { type: ScrollDispatcher, },
249
+ { type: NgZone, },
250
+ { type: Renderer2, },
251
+ ]; };
235
252
  return Scrollable;
236
253
  }());
237
- Scrollable.decorators = [
238
- { type: Directive, args: [{
239
- selector: '[cdk-scrollable], [cdkScrollable]'
240
- },] },
241
- ];
254
+
242
255
  /**
243
- * @nocollapse
256
+ * Time in ms to throttle the resize events by default.
244
257
  */
245
- Scrollable.ctorParameters = function () { return [
246
- { type: ElementRef, },
247
- { type: ScrollDispatcher, },
248
- { type: NgZone, },
249
- { type: Renderer2, },
250
- ]; };
258
+ var DEFAULT_RESIZE_TIME = 20;
251
259
  /**
252
260
  * Simple utility for getting the bounds of the browser viewport.
253
261
  * \@docs-private
254
262
  */
255
263
  var ViewportRuler = (function () {
256
264
  /**
265
+ * @param {?} platform
266
+ * @param {?} ngZone
257
267
  * @param {?} scrollDispatcher
258
268
  */
259
- function ViewportRuler(scrollDispatcher) {
269
+ function ViewportRuler(platform, ngZone, scrollDispatcher) {
260
270
  var _this = this;
271
+ this._change = platform.isBrowser ? ngZone.runOutsideAngular(function () {
272
+ return merge(fromEvent(window, 'resize'), fromEvent(window, 'orientationchange'));
273
+ }) : of();
261
274
  // Subscribe to scroll and resize events and update the document rectangle on changes.
262
- scrollDispatcher.scrolled(0, function () { return _this._cacheViewportGeometry(); });
275
+ this._invalidateCacheSubscriptions = [
276
+ scrollDispatcher.scrolled(0, function () { return _this._cacheViewportGeometry(); }),
277
+ this.change().subscribe(function () { return _this._cacheViewportGeometry(); })
278
+ ];
263
279
  }
280
+ /**
281
+ * @return {?}
282
+ */
283
+ ViewportRuler.prototype.ngOnDestroy = function () {
284
+ this._invalidateCacheSubscriptions.forEach(function (subscription) { return subscription.unsubscribe(); });
285
+ };
264
286
  /**
265
287
  * Gets a ClientRect for the viewport's bounds.
266
288
  * @param {?=} documentRect
@@ -318,6 +340,15 @@ var ViewportRuler = (function () {
318
340
  document.documentElement.scrollLeft || 0;
319
341
  return { top: top, left: left };
320
342
  };
343
+ /**
344
+ * Returns a stream that emits whenever the size of the viewport changes.
345
+ * @param {?=} throttleTime
346
+ * @return {?}
347
+ */
348
+ ViewportRuler.prototype.change = function (throttleTime) {
349
+ if (throttleTime === void 0) { throttleTime = DEFAULT_RESIZE_TIME; }
350
+ return throttleTime > 0 ? auditTime.call(this._change, throttleTime) : this._change;
351
+ };
321
352
  /**
322
353
  * Caches the latest client rectangle of the document element.
323
354
  * @return {?}
@@ -325,25 +356,29 @@ var ViewportRuler = (function () {
325
356
  ViewportRuler.prototype._cacheViewportGeometry = function () {
326
357
  this._documentRect = document.documentElement.getBoundingClientRect();
327
358
  };
359
+ ViewportRuler.decorators = [
360
+ { type: Injectable },
361
+ ];
362
+ /**
363
+ * @nocollapse
364
+ */
365
+ ViewportRuler.ctorParameters = function () { return [
366
+ { type: Platform, },
367
+ { type: NgZone, },
368
+ { type: ScrollDispatcher, },
369
+ ]; };
328
370
  return ViewportRuler;
329
371
  }());
330
- ViewportRuler.decorators = [
331
- { type: Injectable },
332
- ];
333
- /**
334
- * @nocollapse
335
- */
336
- ViewportRuler.ctorParameters = function () { return [
337
- { type: ScrollDispatcher, },
338
- ]; };
339
372
  /**
340
373
  * \@docs-private
341
374
  * @param {?} parentRuler
375
+ * @param {?} platform
376
+ * @param {?} ngZone
342
377
  * @param {?} scrollDispatcher
343
378
  * @return {?}
344
379
  */
345
- function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, scrollDispatcher) {
346
- return parentRuler || new ViewportRuler(scrollDispatcher);
380
+ function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, platform, ngZone, scrollDispatcher) {
381
+ return parentRuler || new ViewportRuler(platform, ngZone, scrollDispatcher);
347
382
  }
348
383
  /**
349
384
  * \@docs-private
@@ -351,28 +386,31 @@ function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, scrollDispatcher) {
351
386
  var VIEWPORT_RULER_PROVIDER = {
352
387
  // If there is already a ViewportRuler available, use that. Otherwise, provide a new one.
353
388
  provide: ViewportRuler,
354
- deps: [[new Optional(), new SkipSelf(), ViewportRuler], ScrollDispatcher],
389
+ deps: [[new Optional(), new SkipSelf(), ViewportRuler], Platform, NgZone, ScrollDispatcher],
355
390
  useFactory: VIEWPORT_RULER_PROVIDER_FACTORY
356
391
  };
392
+
357
393
  var ScrollDispatchModule = (function () {
358
394
  function ScrollDispatchModule() {
359
395
  }
396
+ ScrollDispatchModule.decorators = [
397
+ { type: NgModule, args: [{
398
+ imports: [PlatformModule],
399
+ exports: [Scrollable],
400
+ declarations: [Scrollable],
401
+ providers: [SCROLL_DISPATCHER_PROVIDER],
402
+ },] },
403
+ ];
404
+ /**
405
+ * @nocollapse
406
+ */
407
+ ScrollDispatchModule.ctorParameters = function () { return []; };
360
408
  return ScrollDispatchModule;
361
409
  }());
362
- ScrollDispatchModule.decorators = [
363
- { type: NgModule, args: [{
364
- imports: [PlatformModule],
365
- exports: [Scrollable],
366
- declarations: [Scrollable],
367
- providers: [SCROLL_DISPATCHER_PROVIDER],
368
- },] },
369
- ];
370
- /**
371
- * @nocollapse
372
- */
373
- ScrollDispatchModule.ctorParameters = function () { return []; };
410
+
374
411
  /**
375
412
  * Generated bundle index. Do not edit.
376
413
  */
377
- export { ScrollDispatchModule, DEFAULT_SCROLL_TIME, ScrollDispatcher, SCROLL_DISPATCHER_PROVIDER_FACTORY, SCROLL_DISPATCHER_PROVIDER, Scrollable, ViewportRuler, VIEWPORT_RULER_PROVIDER_FACTORY, VIEWPORT_RULER_PROVIDER };
414
+
415
+ export { DEFAULT_SCROLL_TIME, ScrollDispatcher, SCROLL_DISPATCHER_PROVIDER_FACTORY, SCROLL_DISPATCHER_PROVIDER, Scrollable, DEFAULT_RESIZE_TIME, ViewportRuler, VIEWPORT_RULER_PROVIDER_FACTORY, VIEWPORT_RULER_PROVIDER, ScrollDispatchModule };
378
416
  //# sourceMappingURL=scrolling.es5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrolling.es5.js","sources":["../../../src/cdk/scrolling/index.ts","../../../src/cdk/scrolling/public_api.ts","../../../src/cdk/scrolling/viewport-ruler.ts","../../../src/cdk/scrolling/scrollable.ts","../../../src/cdk/scrolling/scroll-dispatcher.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {ScrollDispatchModule,DEFAULT_SCROLL_TIME,ScrollDispatcher,SCROLL_DISPATCHER_PROVIDER_FACTORY,SCROLL_DISPATCHER_PROVIDER,Scrollable,ViewportRuler,VIEWPORT_RULER_PROVIDER_FACTORY,VIEWPORT_RULER_PROVIDER} from './public_api';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {NgModule} from '@angular/core';\nimport {SCROLL_DISPATCHER_PROVIDER} from './scroll-dispatcher';\nimport {Scrollable} from './scrollable';\nimport {PlatformModule} from '@angular/cdk/platform';\nexport class ScrollDispatchModule {static decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n imports: [PlatformModule],\n exports: [Scrollable],\n declarations: [Scrollable],\n providers: [SCROLL_DISPATCHER_PROVIDER],\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction ScrollDispatchModule_tsickle_Closure_declarations() {\n/** @type {?} */\nScrollDispatchModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nScrollDispatchModule.ctorParameters;\n}\n\n\nexport {DEFAULT_SCROLL_TIME,ScrollDispatcher,SCROLL_DISPATCHER_PROVIDER_FACTORY,SCROLL_DISPATCHER_PROVIDER} from './scroll-dispatcher';\nexport {Scrollable} from './scrollable';\nexport {ViewportRuler,VIEWPORT_RULER_PROVIDER_FACTORY,VIEWPORT_RULER_PROVIDER} from './viewport-ruler';\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Injectable, Optional, SkipSelf} from '@angular/core';\nimport {ScrollDispatcher} from './scroll-dispatcher';\n/**\n * Simple utility for getting the bounds of the browser viewport.\n * \\@docs-private\n */\nexport class ViewportRuler {\n/**\n * Cached document client rectangle.\n */\nprivate _documentRect?: ClientRect;\n/**\n * @param {?} scrollDispatcher\n */\nconstructor(scrollDispatcher: ScrollDispatcher) {\n // Subscribe to scroll and resize events and update the document rectangle on changes.\n scrollDispatcher.scrolled(0, () => this._cacheViewportGeometry());\n }\n/**\n * Gets a ClientRect for the viewport's bounds.\n * @param {?=} documentRect\n * @return {?}\n */\ngetViewportRect(documentRect = this._documentRect): ClientRect {\n // Cache the document bounding rect so that we don't recompute it for multiple calls.\n if (!documentRect) {\n this._cacheViewportGeometry();\n documentRect = this._documentRect;\n }\n\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const /** @type {?} */ scrollPosition = this.getViewportScrollPosition(documentRect);\n const /** @type {?} */ height = window.innerHeight;\n const /** @type {?} */ width = window.innerWidth;\n\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width,\n };\n }\n/**\n * Gets the (top, left) scroll position of the viewport.\n * @param {?=} documentRect\n * @return {?}\n */\ngetViewportScrollPosition(documentRect = this._documentRect) {\n // Cache the document bounding rect so that we don't recompute it for multiple calls.\n if (!documentRect) {\n this._cacheViewportGeometry();\n documentRect = this._documentRect;\n }\n\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const /** @type {?} */ top = - /** @type {?} */((documentRect)).top || document.body.scrollTop || window.scrollY ||\n document.documentElement.scrollTop || 0;\n\n const /** @type {?} */ left = - /** @type {?} */((documentRect)).left || document.body.scrollLeft || window.scrollX ||\n document.documentElement.scrollLeft || 0;\n\n return {top, left};\n }\n/**\n * Caches the latest client rectangle of the document element.\n * @return {?}\n */\n_cacheViewportGeometry() {\n this._documentRect = document.documentElement.getBoundingClientRect();\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ScrollDispatcher, },\n];\n}\n\nfunction ViewportRuler_tsickle_Closure_declarations() {\n/** @type {?} */\nViewportRuler.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nViewportRuler.ctorParameters;\n/**\n * Cached document client rectangle.\n * @type {?}\n */\nViewportRuler.prototype._documentRect;\n}\n\n/**\n * \\@docs-private\n * @param {?} parentRuler\n * @param {?} scrollDispatcher\n * @return {?}\n */\nexport function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler: ViewportRuler,\n scrollDispatcher: ScrollDispatcher) {\n return parentRuler || new ViewportRuler(scrollDispatcher);\n}\n/**\n * \\@docs-private\n */\nexport const VIEWPORT_RULER_PROVIDER = {\n // If there is already a ViewportRuler available, use that. Otherwise, provide a new one.\n provide: ViewportRuler,\n deps: [[new Optional(), new SkipSelf(), ViewportRuler], ScrollDispatcher],\n useFactory: VIEWPORT_RULER_PROVIDER_FACTORY\n};\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Directive, ElementRef, OnInit, OnDestroy, NgZone, Renderer2} from '@angular/core';\nimport {Observable} from 'rxjs/Observable';\nimport {Subject} from 'rxjs/Subject';\nimport {ScrollDispatcher} from './scroll-dispatcher';\n/**\n * Sends an event when the directive's element is scrolled. Registers itself with the\n * ScrollDispatcher service to include itself as part of its collection of scrolling events that it\n * can be listened to through the service.\n */\nexport class Scrollable implements OnInit, OnDestroy {\nprivate _elementScrolled: Subject<Event> = new Subject();\nprivate _scrollListener: Function | null;\n/**\n * @param {?} _elementRef\n * @param {?} _scroll\n * @param {?} _ngZone\n * @param {?} _renderer\n */\nconstructor(private _elementRef: ElementRef,\nprivate _scroll: ScrollDispatcher,\nprivate _ngZone: NgZone,\nprivate _renderer: Renderer2) {}\n/**\n * @return {?}\n */\nngOnInit() {\n this._scrollListener = this._ngZone.runOutsideAngular(() => {\n return this._renderer.listen(this.getElementRef().nativeElement, 'scroll', (event: Event) => {\n this._elementScrolled.next(event);\n });\n });\n\n this._scroll.register(this);\n }\n/**\n * @return {?}\n */\nngOnDestroy() {\n this._scroll.deregister(this);\n\n if (this._scrollListener) {\n this._scrollListener();\n this._scrollListener = null;\n }\n }\n/**\n * Returns observable that emits when a scroll event is fired on the host element.\n * @return {?}\n */\nelementScrolled(): Observable<any> {\n return this._elementScrolled.asObservable();\n }\n/**\n * @return {?}\n */\ngetElementRef(): ElementRef {\n return this._elementRef;\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{\n selector: '[cdk-scrollable], [cdkScrollable]'\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ElementRef, },\n{type: ScrollDispatcher, },\n{type: NgZone, },\n{type: Renderer2, },\n];\n}\n\nfunction Scrollable_tsickle_Closure_declarations() {\n/** @type {?} */\nScrollable.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nScrollable.ctorParameters;\n/** @type {?} */\nScrollable.prototype._elementScrolled;\n/** @type {?} */\nScrollable.prototype._scrollListener;\n/** @type {?} */\nScrollable.prototype._elementRef;\n/** @type {?} */\nScrollable.prototype._scroll;\n/** @type {?} */\nScrollable.prototype._ngZone;\n/** @type {?} */\nScrollable.prototype._renderer;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {ElementRef, Injectable, NgZone, Optional, SkipSelf} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\nimport {Subject} from 'rxjs/Subject';\nimport {Subscription} from 'rxjs/Subscription';\nimport {fromEvent} from 'rxjs/observable/fromEvent';\nimport {merge} from 'rxjs/observable/merge';\nimport {auditTime} from 'rxjs/operator/auditTime';\nimport {Scrollable} from './scrollable';\n/**\n * Time in ms to throttle the scrolling events by default.\n */\nexport const DEFAULT_SCROLL_TIME = 20;\n/**\n * Service contained all registered Scrollable references and emits an event when any one of the\n * Scrollable references emit a scrolled event.\n */\nexport class ScrollDispatcher {\n/**\n * @param {?} _ngZone\n * @param {?} _platform\n */\nconstructor(private _ngZone: NgZone,\nprivate _platform: Platform) { }\n/**\n * Subject for notifying that a registered scrollable reference element has been scrolled.\n */\n_scrolled: Subject<void> = new Subject<void>();\n/**\n * Keeps track of the global `scroll` and `resize` subscriptions.\n */\n_globalSubscription: Subscription | null = null;\n/**\n * Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards.\n */\nprivate _scrolledCount = 0;\n/**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n */\nscrollableReferences: Map<Scrollable, Subscription> = new Map();\n/**\n * Registers a Scrollable with the service and listens for its scrolled events. When the\n * scrollable is scrolled, the service emits the event in its scrolled observable.\n * @param {?} scrollable Scrollable instance to be registered.\n * @return {?}\n */\nregister(scrollable: Scrollable): void {\n const /** @type {?} */ scrollSubscription = scrollable.elementScrolled().subscribe(() => this._notify());\n\n this.scrollableReferences.set(scrollable, scrollSubscription);\n }\n/**\n * Deregisters a Scrollable reference and unsubscribes from its scroll event observable.\n * @param {?} scrollable Scrollable instance to be deregistered.\n * @return {?}\n */\nderegister(scrollable: Scrollable): void {\n const /** @type {?} */ scrollableReference = this.scrollableReferences.get(scrollable);\n\n if (scrollableReference) {\n scrollableReference.unsubscribe();\n this.scrollableReferences.delete(scrollable);\n }\n }\n/**\n * Subscribes to an observable that emits an event whenever any of the registered Scrollable\n * references (or window, document, or body) fire a scrolled event. Can provide a time in ms\n * to override the default \"throttle\" time.\n * @param {?=} auditTimeInMs\n * @param {?=} callback\n * @return {?}\n */\nscrolled(auditTimeInMs: number = DEFAULT_SCROLL_TIME, callback: () => any): Subscription {\n // Scroll events can only happen on the browser, so do nothing if we're not on the browser.\n if (!this._platform.isBrowser) {\n return Subscription.EMPTY;\n }\n\n // In the case of a 0ms delay, use an observable without auditTime\n // since it does add a perceptible delay in processing overhead.\n let /** @type {?} */ observable = auditTimeInMs > 0 ?\n auditTime.call(this._scrolled.asObservable(), auditTimeInMs) :\n this._scrolled.asObservable();\n\n this._scrolledCount++;\n\n if (!this._globalSubscription) {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n return merge(\n fromEvent(window.document, 'scroll'),\n fromEvent(window, 'resize')\n ).subscribe(() => this._notify());\n });\n }\n\n // Note that we need to do the subscribing from here, in order to be able to remove\n // the global event listeners once there are no more subscriptions.\n let /** @type {?} */ subscription = observable.subscribe(callback);\n\n subscription.add(() => {\n this._scrolledCount--;\n\n if (this._globalSubscription && !this.scrollableReferences.size && !this._scrolledCount) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n });\n\n return subscription;\n }\n/**\n * Returns all registered Scrollables that contain the provided element.\n * @param {?} elementRef\n * @return {?}\n */\ngetScrollContainers(elementRef: ElementRef): Scrollable[] {\n const /** @type {?} */ scrollingContainers: Scrollable[] = [];\n\n this.scrollableReferences.forEach((_subscription: Subscription, scrollable: Scrollable) => {\n if (this.scrollableContainsElement(scrollable, elementRef)) {\n scrollingContainers.push(scrollable);\n }\n });\n\n return scrollingContainers;\n }\n/**\n * Returns true if the element is contained within the provided Scrollable.\n * @param {?} scrollable\n * @param {?} elementRef\n * @return {?}\n */\nscrollableContainsElement(scrollable: Scrollable, elementRef: ElementRef): boolean {\n let /** @type {?} */ element = elementRef.nativeElement;\n let /** @type {?} */ scrollableElement = scrollable.getElementRef().nativeElement;\n\n // Traverse through the element parents until we reach null, checking if any of the elements\n // are the scrollable's element.\n do {\n if (element == scrollableElement) { return true; }\n } while (element = element.parentElement);\n\n return false;\n }\n/**\n * Sends a notification that a scroll event has been fired.\n * @return {?}\n */\n_notify() {\n this._scrolled.next();\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: NgZone, },\n{type: Platform, },\n];\n}\n\nfunction ScrollDispatcher_tsickle_Closure_declarations() {\n/** @type {?} */\nScrollDispatcher.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nScrollDispatcher.ctorParameters;\n/**\n * Subject for notifying that a registered scrollable reference element has been scrolled.\n * @type {?}\n */\nScrollDispatcher.prototype._scrolled;\n/**\n * Keeps track of the global `scroll` and `resize` subscriptions.\n * @type {?}\n */\nScrollDispatcher.prototype._globalSubscription;\n/**\n * Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards.\n * @type {?}\n */\nScrollDispatcher.prototype._scrolledCount;\n/**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n * @type {?}\n */\nScrollDispatcher.prototype.scrollableReferences;\n/** @type {?} */\nScrollDispatcher.prototype._ngZone;\n/** @type {?} */\nScrollDispatcher.prototype._platform;\n}\n\n/**\n * \\@docs-private\n * @param {?} parentDispatcher\n * @param {?} ngZone\n * @param {?} platform\n * @return {?}\n */\nexport function SCROLL_DISPATCHER_PROVIDER_FACTORY(\n parentDispatcher: ScrollDispatcher, ngZone: NgZone, platform: Platform) {\n return parentDispatcher || new ScrollDispatcher(ngZone, platform);\n}\n/**\n * \\@docs-private\n */\nexport const SCROLL_DISPATCHER_PROVIDER = {\n // If there is already a ScrollDispatcher available, use that. Otherwise, provide a new one.\n provide: ScrollDispatcher,\n deps: [[new Optional(), new SkipSelf(), ScrollDispatcher], NgZone, Platform],\n useFactory: SCROLL_DISPATCHER_PROVIDER_FACTORY\n};\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AIiBA;;;AAGA,AADC,MAAA,mBAAA,GAAA,EAAA,CAAA;;;;;AAMD,AAAA,MAAA,gBAAA,CAAA;;;;;IAKA,WAAA,CAHsB,OAAS,EAAgB,SAAW,EAG1D;QAHsB,IAAtB,CAAA,OAAsB,GAAA,OAAA,CAAS;QAAgB,IAA/C,CAAA,SAA+C,GAAA,SAAA,CAAW;;;;QAQ1D,IAAA,CAAA,SALG,GAAA,IAAA,OAAA,EAAA,CAAA;;;;QASH,IAAA,CAAA,mBANG,GAAA,IAAA,CAAA;;;;QAGA,IAAH,CAAA,cAAG,GAAA,CAAA,CAAA;;;;;QAYH,IAAA,CAAA,oBANG,GAAA,IAAA,GAAA,EAAA,CAAA;KAfgE;;;;;;;IA4BnE,QANG,CAAA,UAAA,EAMH;QACI,uBANM,kBAAA,GAAqB,UAAA,CAAW,eAAC,EAAe,CAAE,SAAC,CAAS,MAAM,IAAA,CAAK,OAAC,EAAO,CAAE,CAAC;QAQxF,IAAI,CANC,oBAAC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AAE,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACzE,UAAU,EAAE,+BAA+B;CAC5C,CAAC;;AD9HF,MAAA,oBAAA,CAAA;;AAC0C,oBAA1C,CAAA,UAA0C,GAAoC;IAA9E,EACE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,CAAA;gBAAtB,OAAO,EACE,CAAA,cAAE,CAAc;gBAAzB,OAAO,EACE,CAAA,UAAE,CAAU;gBAArB,YAAY,EACE,CAAA,UAAE,CAAU;gBAA1B,SAAS,EACE,CAAA,0BAAE,CAA0B;aAAxC,EACC,EAAG;CAAJ,CACC;;;;AAED,oBAAD,CAAA,cAAC,GAAA,MAAA,EAEA,CANoC,AASrC,AAWA,AACA,AACA,AAAuG;;ADzCvG;;GAEG,AAEH,AAAsO;;"}
1
+ {"version":3,"file":"scrolling.es5.js","sources":["../../packages/cdk/esm5/scrolling/scroll-dispatcher.js","../../packages/cdk/esm5/scrolling/scrollable.js","../../packages/cdk/esm5/scrolling/viewport-ruler.js","../../packages/cdk/esm5/scrolling/scrolling-module.js","../../packages/cdk/esm5/scrolling/index.js"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Injectable, NgZone, Optional, SkipSelf } from '@angular/core';\nimport { Platform } from '@angular/cdk/platform';\nimport { Subject } from 'rxjs/Subject';\nimport { Subscription } from 'rxjs/Subscription';\nimport { fromEvent } from 'rxjs/observable/fromEvent';\nimport { auditTime } from 'rxjs/operator/auditTime';\n/**\n * Time in ms to throttle the scrolling events by default.\n */\nexport var DEFAULT_SCROLL_TIME = 20;\n/**\n * Service contained all registered Scrollable references and emits an event when any one of the\n * Scrollable references emit a scrolled event.\n */\nvar ScrollDispatcher = (function () {\n /**\n * @param {?} _ngZone\n * @param {?} _platform\n */\n function ScrollDispatcher(_ngZone, _platform) {\n this._ngZone = _ngZone;\n this._platform = _platform;\n /**\n * Subject for notifying that a registered scrollable reference element has been scrolled.\n */\n this._scrolled = new Subject();\n /**\n * Keeps track of the global `scroll` and `resize` subscriptions.\n */\n this._globalSubscription = null;\n /**\n * Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards.\n */\n this._scrolledCount = 0;\n /**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n */\n this.scrollableReferences = new Map();\n }\n /**\n * Registers a Scrollable with the service and listens for its scrolled events. When the\n * scrollable is scrolled, the service emits the event in its scrolled observable.\n * @param {?} scrollable Scrollable instance to be registered.\n * @return {?}\n */\n ScrollDispatcher.prototype.register = function (scrollable) {\n var _this = this;\n var /** @type {?} */ scrollSubscription = scrollable.elementScrolled().subscribe(function () { return _this._notify(); });\n this.scrollableReferences.set(scrollable, scrollSubscription);\n };\n /**\n * Deregisters a Scrollable reference and unsubscribes from its scroll event observable.\n * @param {?} scrollable Scrollable instance to be deregistered.\n * @return {?}\n */\n ScrollDispatcher.prototype.deregister = function (scrollable) {\n var /** @type {?} */ scrollableReference = this.scrollableReferences.get(scrollable);\n if (scrollableReference) {\n scrollableReference.unsubscribe();\n this.scrollableReferences.delete(scrollable);\n }\n };\n /**\n * Subscribes to an observable that emits an event whenever any of the registered Scrollable\n * references (or window, document, or body) fire a scrolled event. Can provide a time in ms\n * to override the default \"throttle\" time.\n * @param {?=} auditTimeInMs\n * @param {?=} callback\n * @return {?}\n */\n ScrollDispatcher.prototype.scrolled = function (auditTimeInMs, callback) {\n var _this = this;\n if (auditTimeInMs === void 0) { auditTimeInMs = DEFAULT_SCROLL_TIME; }\n // Scroll events can only happen on the browser, so do nothing if we're not on the browser.\n if (!this._platform.isBrowser) {\n return Subscription.EMPTY;\n }\n // In the case of a 0ms delay, use an observable without auditTime\n // since it does add a perceptible delay in processing overhead.\n var /** @type {?} */ observable = auditTimeInMs > 0 ?\n auditTime.call(this._scrolled.asObservable(), auditTimeInMs) :\n this._scrolled.asObservable();\n this._scrolledCount++;\n if (!this._globalSubscription) {\n this._globalSubscription = this._ngZone.runOutsideAngular(function () {\n return fromEvent(window.document, 'scroll').subscribe(function () { return _this._notify(); });\n });\n }\n // Note that we need to do the subscribing from here, in order to be able to remove\n // the global event listeners once there are no more subscriptions.\n var /** @type {?} */ subscription = observable.subscribe(callback);\n subscription.add(function () {\n _this._scrolledCount--;\n if (_this._globalSubscription && !_this.scrollableReferences.size && !_this._scrolledCount) {\n _this._globalSubscription.unsubscribe();\n _this._globalSubscription = null;\n }\n });\n return subscription;\n };\n /**\n * Returns all registered Scrollables that contain the provided element.\n * @param {?} elementRef\n * @return {?}\n */\n ScrollDispatcher.prototype.getScrollContainers = function (elementRef) {\n var _this = this;\n var /** @type {?} */ scrollingContainers = [];\n this.scrollableReferences.forEach(function (_subscription, scrollable) {\n if (_this.scrollableContainsElement(scrollable, elementRef)) {\n scrollingContainers.push(scrollable);\n }\n });\n return scrollingContainers;\n };\n /**\n * Returns true if the element is contained within the provided Scrollable.\n * @param {?} scrollable\n * @param {?} elementRef\n * @return {?}\n */\n ScrollDispatcher.prototype.scrollableContainsElement = function (scrollable, elementRef) {\n var /** @type {?} */ element = elementRef.nativeElement;\n var /** @type {?} */ scrollableElement = scrollable.getElementRef().nativeElement;\n // Traverse through the element parents until we reach null, checking if any of the elements\n // are the scrollable's element.\n do {\n if (element == scrollableElement) {\n return true;\n }\n } while (element = element.parentElement);\n return false;\n };\n /**\n * Sends a notification that a scroll event has been fired.\n * @return {?}\n */\n ScrollDispatcher.prototype._notify = function () {\n this._scrolled.next();\n };\n ScrollDispatcher.decorators = [\n { type: Injectable },\n ];\n /**\n * @nocollapse\n */\n ScrollDispatcher.ctorParameters = function () { return [\n { type: NgZone, },\n { type: Platform, },\n ]; };\n return ScrollDispatcher;\n}());\nexport { ScrollDispatcher };\nfunction ScrollDispatcher_tsickle_Closure_declarations() {\n /** @type {?} */\n ScrollDispatcher.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n ScrollDispatcher.ctorParameters;\n /**\n * Subject for notifying that a registered scrollable reference element has been scrolled.\n * @type {?}\n */\n ScrollDispatcher.prototype._scrolled;\n /**\n * Keeps track of the global `scroll` and `resize` subscriptions.\n * @type {?}\n */\n ScrollDispatcher.prototype._globalSubscription;\n /**\n * Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards.\n * @type {?}\n */\n ScrollDispatcher.prototype._scrolledCount;\n /**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n * @type {?}\n */\n ScrollDispatcher.prototype.scrollableReferences;\n /** @type {?} */\n ScrollDispatcher.prototype._ngZone;\n /** @type {?} */\n ScrollDispatcher.prototype._platform;\n}\n/**\n * \\@docs-private\n * @param {?} parentDispatcher\n * @param {?} ngZone\n * @param {?} platform\n * @return {?}\n */\nexport function SCROLL_DISPATCHER_PROVIDER_FACTORY(parentDispatcher, ngZone, platform) {\n return parentDispatcher || new ScrollDispatcher(ngZone, platform);\n}\n/**\n * \\@docs-private\n */\nexport var SCROLL_DISPATCHER_PROVIDER = {\n // If there is already a ScrollDispatcher available, use that. Otherwise, provide a new one.\n provide: ScrollDispatcher,\n deps: [[new Optional(), new SkipSelf(), ScrollDispatcher], NgZone, Platform],\n useFactory: SCROLL_DISPATCHER_PROVIDER_FACTORY\n};\n//# sourceMappingURL=scroll-dispatcher.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Directive, ElementRef, NgZone, Renderer2 } from '@angular/core';\nimport { Subject } from 'rxjs/Subject';\nimport { ScrollDispatcher } from './scroll-dispatcher';\n/**\n * Sends an event when the directive's element is scrolled. Registers itself with the\n * ScrollDispatcher service to include itself as part of its collection of scrolling events that it\n * can be listened to through the service.\n */\nvar Scrollable = (function () {\n /**\n * @param {?} _elementRef\n * @param {?} _scroll\n * @param {?} _ngZone\n * @param {?} _renderer\n */\n function Scrollable(_elementRef, _scroll, _ngZone, _renderer) {\n this._elementRef = _elementRef;\n this._scroll = _scroll;\n this._ngZone = _ngZone;\n this._renderer = _renderer;\n this._elementScrolled = new Subject();\n }\n /**\n * @return {?}\n */\n Scrollable.prototype.ngOnInit = function () {\n var _this = this;\n this._scrollListener = this._ngZone.runOutsideAngular(function () {\n return _this._renderer.listen(_this.getElementRef().nativeElement, 'scroll', function (event) {\n _this._elementScrolled.next(event);\n });\n });\n this._scroll.register(this);\n };\n /**\n * @return {?}\n */\n Scrollable.prototype.ngOnDestroy = function () {\n this._scroll.deregister(this);\n if (this._scrollListener) {\n this._scrollListener();\n this._scrollListener = null;\n }\n };\n /**\n * Returns observable that emits when a scroll event is fired on the host element.\n * @return {?}\n */\n Scrollable.prototype.elementScrolled = function () {\n return this._elementScrolled.asObservable();\n };\n /**\n * @return {?}\n */\n Scrollable.prototype.getElementRef = function () {\n return this._elementRef;\n };\n Scrollable.decorators = [\n { type: Directive, args: [{\n selector: '[cdk-scrollable], [cdkScrollable]'\n },] },\n ];\n /**\n * @nocollapse\n */\n Scrollable.ctorParameters = function () { return [\n { type: ElementRef, },\n { type: ScrollDispatcher, },\n { type: NgZone, },\n { type: Renderer2, },\n ]; };\n return Scrollable;\n}());\nexport { Scrollable };\nfunction Scrollable_tsickle_Closure_declarations() {\n /** @type {?} */\n Scrollable.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n Scrollable.ctorParameters;\n /** @type {?} */\n Scrollable.prototype._elementScrolled;\n /** @type {?} */\n Scrollable.prototype._scrollListener;\n /** @type {?} */\n Scrollable.prototype._elementRef;\n /** @type {?} */\n Scrollable.prototype._scroll;\n /** @type {?} */\n Scrollable.prototype._ngZone;\n /** @type {?} */\n Scrollable.prototype._renderer;\n}\n//# sourceMappingURL=scrollable.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Injectable, Optional, SkipSelf, NgZone } from '@angular/core';\nimport { Platform } from '@angular/cdk/platform';\nimport { ScrollDispatcher } from './scroll-dispatcher';\nimport { fromEvent } from 'rxjs/observable/fromEvent';\nimport { merge } from 'rxjs/observable/merge';\nimport { auditTime } from 'rxjs/operator/auditTime';\nimport { of as observableOf } from 'rxjs/observable/of';\n/**\n * Time in ms to throttle the resize events by default.\n */\nexport var DEFAULT_RESIZE_TIME = 20;\n/**\n * Simple utility for getting the bounds of the browser viewport.\n * \\@docs-private\n */\nvar ViewportRuler = (function () {\n /**\n * @param {?} platform\n * @param {?} ngZone\n * @param {?} scrollDispatcher\n */\n function ViewportRuler(platform, ngZone, scrollDispatcher) {\n var _this = this;\n this._change = platform.isBrowser ? ngZone.runOutsideAngular(function () {\n return merge(fromEvent(window, 'resize'), fromEvent(window, 'orientationchange'));\n }) : observableOf();\n // Subscribe to scroll and resize events and update the document rectangle on changes.\n this._invalidateCacheSubscriptions = [\n scrollDispatcher.scrolled(0, function () { return _this._cacheViewportGeometry(); }),\n this.change().subscribe(function () { return _this._cacheViewportGeometry(); })\n ];\n }\n /**\n * @return {?}\n */\n ViewportRuler.prototype.ngOnDestroy = function () {\n this._invalidateCacheSubscriptions.forEach(function (subscription) { return subscription.unsubscribe(); });\n };\n /**\n * Gets a ClientRect for the viewport's bounds.\n * @param {?=} documentRect\n * @return {?}\n */\n ViewportRuler.prototype.getViewportRect = function (documentRect) {\n if (documentRect === void 0) { documentRect = this._documentRect; }\n // Cache the document bounding rect so that we don't recompute it for multiple calls.\n if (!documentRect) {\n this._cacheViewportGeometry();\n documentRect = this._documentRect;\n }\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n var /** @type {?} */ scrollPosition = this.getViewportScrollPosition(documentRect);\n var /** @type {?} */ height = window.innerHeight;\n var /** @type {?} */ width = window.innerWidth;\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height: height,\n width: width,\n };\n };\n /**\n * Gets the (top, left) scroll position of the viewport.\n * @param {?=} documentRect\n * @return {?}\n */\n ViewportRuler.prototype.getViewportScrollPosition = function (documentRect) {\n if (documentRect === void 0) { documentRect = this._documentRect; }\n // Cache the document bounding rect so that we don't recompute it for multiple calls.\n if (!documentRect) {\n this._cacheViewportGeometry();\n documentRect = this._documentRect;\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n var /** @type {?} */ top = -((documentRect)).top || document.body.scrollTop || window.scrollY ||\n document.documentElement.scrollTop || 0;\n var /** @type {?} */ left = -((documentRect)).left || document.body.scrollLeft || window.scrollX ||\n document.documentElement.scrollLeft || 0;\n return { top: top, left: left };\n };\n /**\n * Returns a stream that emits whenever the size of the viewport changes.\n * @param {?=} throttleTime\n * @return {?}\n */\n ViewportRuler.prototype.change = function (throttleTime) {\n if (throttleTime === void 0) { throttleTime = DEFAULT_RESIZE_TIME; }\n return throttleTime > 0 ? auditTime.call(this._change, throttleTime) : this._change;\n };\n /**\n * Caches the latest client rectangle of the document element.\n * @return {?}\n */\n ViewportRuler.prototype._cacheViewportGeometry = function () {\n this._documentRect = document.documentElement.getBoundingClientRect();\n };\n ViewportRuler.decorators = [\n { type: Injectable },\n ];\n /**\n * @nocollapse\n */\n ViewportRuler.ctorParameters = function () { return [\n { type: Platform, },\n { type: NgZone, },\n { type: ScrollDispatcher, },\n ]; };\n return ViewportRuler;\n}());\nexport { ViewportRuler };\nfunction ViewportRuler_tsickle_Closure_declarations() {\n /** @type {?} */\n ViewportRuler.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n ViewportRuler.ctorParameters;\n /**\n * Cached document client rectangle.\n * @type {?}\n */\n ViewportRuler.prototype._documentRect;\n /**\n * Stream of viewport change events.\n * @type {?}\n */\n ViewportRuler.prototype._change;\n /**\n * Subscriptions to streams that invalidate the cached viewport dimensions.\n * @type {?}\n */\n ViewportRuler.prototype._invalidateCacheSubscriptions;\n}\n/**\n * \\@docs-private\n * @param {?} parentRuler\n * @param {?} platform\n * @param {?} ngZone\n * @param {?} scrollDispatcher\n * @return {?}\n */\nexport function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, platform, ngZone, scrollDispatcher) {\n return parentRuler || new ViewportRuler(platform, ngZone, scrollDispatcher);\n}\n/**\n * \\@docs-private\n */\nexport var VIEWPORT_RULER_PROVIDER = {\n // If there is already a ViewportRuler available, use that. Otherwise, provide a new one.\n provide: ViewportRuler,\n deps: [[new Optional(), new SkipSelf(), ViewportRuler], Platform, NgZone, ScrollDispatcher],\n useFactory: VIEWPORT_RULER_PROVIDER_FACTORY\n};\n//# sourceMappingURL=viewport-ruler.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { NgModule } from '@angular/core';\nimport { SCROLL_DISPATCHER_PROVIDER } from './scroll-dispatcher';\nimport { Scrollable } from './scrollable';\nimport { PlatformModule } from '@angular/cdk/platform';\nvar ScrollDispatchModule = (function () {\n function ScrollDispatchModule() {\n }\n ScrollDispatchModule.decorators = [\n { type: NgModule, args: [{\n imports: [PlatformModule],\n exports: [Scrollable],\n declarations: [Scrollable],\n providers: [SCROLL_DISPATCHER_PROVIDER],\n },] },\n ];\n /**\n * @nocollapse\n */\n ScrollDispatchModule.ctorParameters = function () { return []; };\n return ScrollDispatchModule;\n}());\nexport { ScrollDispatchModule };\nfunction ScrollDispatchModule_tsickle_Closure_declarations() {\n /** @type {?} */\n ScrollDispatchModule.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n ScrollDispatchModule.ctorParameters;\n}\n//# sourceMappingURL=scrolling-module.js.map","/**\n * Generated bundle index. Do not edit.\n */\nexport { DEFAULT_SCROLL_TIME, ScrollDispatcher, SCROLL_DISPATCHER_PROVIDER_FACTORY, SCROLL_DISPATCHER_PROVIDER, Scrollable, DEFAULT_RESIZE_TIME, ViewportRuler, VIEWPORT_RULER_PROVIDER_FACTORY, VIEWPORT_RULER_PROVIDER, ScrollDispatchModule } from './public-api';\n//# sourceMappingURL=index.js.map"],"names":["observableOf"],"mappings":";;;;;;;;;;;;;;;;AAaA;;;AAGA,AAAO,IAAI,mBAAmB,GAAG,EAAE,CAAC;;;;;AAKpC,IAAI,gBAAgB,IAAI,YAAY;;;;;IAKhC,SAAS,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;;;;QAI3B,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;;;;QAI/B,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;;;;QAIhC,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;;;;;QAKxB,IAAI,CAAC,oBAAoB,GAAG,IAAI,GAAG,EAAE,CAAC;KACzC;;;;;;;IAOD,gBAAgB,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAU,UAAU,EAAE;QACxD,IAAI,KAAK,GAAG,IAAI,CAAC;QACjB,qBAAqB,kBAAkB,GAAG,UAAU,CAAC,eAAe,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QAC1H,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,UAAU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,CAAC,UAAU,CAAC;oBACrB,YAAY,EAAE,CAAC,UAAU,CAAC;oBAC1B,SAAS,EAAE,CAAC,0BAA0B,CAAC;iBAC1C,EAAE,EAAE;KAChB,CAAC;;;;IAIF,oBAAoB,CAAC,cAAc,GAAG,YAAY,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACjE,OAAO,oBAAoB,CAAC;CAC/B,EAAE,CAAC,CAAC,AACL,AACA,AAQC,AACD;;ACtCA;;GAEG,AACH,AAAqQ,AACrQ;;"}
@@ -5,11 +5,12 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { Component, ContentChild, ContentChildren, Directive, EventEmitter, Inject, Input, NgModule, Optional, Output, TemplateRef, ViewChild, ViewEncapsulation, forwardRef } from '@angular/core';
8
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, Directive, EventEmitter, Inject, Input, NgModule, Optional, Output, TemplateRef, ViewChild, ViewEncapsulation, forwardRef } from '@angular/core';
9
9
  import { ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE } from '@angular/cdk/keycodes';
10
10
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
11
11
  import { BidiModule, Directionality } from '@angular/cdk/bidi';
12
12
  import { CommonModule } from '@angular/common';
13
+
13
14
  var CdkStepLabel = (function () {
14
15
  /**
15
16
  * @param {?} template
@@ -17,19 +18,20 @@ var CdkStepLabel = (function () {
17
18
  function CdkStepLabel(template) {
18
19
  this.template = template;
19
20
  }
21
+ CdkStepLabel.decorators = [
22
+ { type: Directive, args: [{
23
+ selector: '[cdkStepLabel]',
24
+ },] },
25
+ ];
26
+ /**
27
+ * @nocollapse
28
+ */
29
+ CdkStepLabel.ctorParameters = function () { return [
30
+ { type: TemplateRef, },
31
+ ]; };
20
32
  return CdkStepLabel;
21
33
  }());
22
- CdkStepLabel.decorators = [
23
- { type: Directive, args: [{
24
- selector: '[cdkStepLabel]',
25
- },] },
26
- ];
27
- /**
28
- * @nocollapse
29
- */
30
- CdkStepLabel.ctorParameters = function () { return [
31
- { type: TemplateRef, },
32
- ]; };
34
+
33
35
  /**
34
36
  * Used to generate unique ID for each stepper component.
35
37
  */
@@ -49,7 +51,7 @@ var CdkStep = (function () {
49
51
  function CdkStep(_stepper) {
50
52
  this._stepper = _stepper;
51
53
  /**
52
- * Whether user has seen the expanded step content or not .
54
+ * Whether user has seen the expanded step content or not.
53
55
  */
54
56
  this.interacted = false;
55
57
  this._editable = true;
@@ -122,36 +124,48 @@ var CdkStep = (function () {
122
124
  CdkStep.prototype.select = function () {
123
125
  this._stepper.selected = this;
124
126
  };
127
+ /**
128
+ * @return {?}
129
+ */
130
+ CdkStep.prototype.ngOnChanges = function () {
131
+ // Since basically all inputs of the MdStep get proxied through the view down to the
132
+ // underlying MdStepHeader, we have to make sure that change detection runs correctly.
133
+ this._stepper._stateChanged();
134
+ };
135
+ CdkStep.decorators = [
136
+ { type: Component, args: [{selector: 'cdk-step',
137
+ exportAs: 'cdkStep',
138
+ template: "<ng-template><ng-content></ng-content></ng-template>",
139
+ encapsulation: ViewEncapsulation.None,
140
+ preserveWhitespaces: false,
141
+ changeDetection: ChangeDetectionStrategy.OnPush,
142
+ },] },
143
+ ];
144
+ /**
145
+ * @nocollapse
146
+ */
147
+ CdkStep.ctorParameters = function () { return [
148
+ { type: CdkStepper, decorators: [{ type: Inject, args: [forwardRef(function () { return CdkStepper; }),] },] },
149
+ ]; };
150
+ CdkStep.propDecorators = {
151
+ 'stepLabel': [{ type: ContentChild, args: [CdkStepLabel,] },],
152
+ 'content': [{ type: ViewChild, args: [TemplateRef,] },],
153
+ 'stepControl': [{ type: Input },],
154
+ 'label': [{ type: Input },],
155
+ 'editable': [{ type: Input },],
156
+ 'optional': [{ type: Input },],
157
+ 'completed': [{ type: Input },],
158
+ };
125
159
  return CdkStep;
126
160
  }());
127
- CdkStep.decorators = [
128
- { type: Component, args: [{ selector: 'cdk-step',
129
- template: "<ng-template><ng-content></ng-content></ng-template>",
130
- encapsulation: ViewEncapsulation.None,
131
- preserveWhitespaces: false,
132
- },] },
133
- ];
134
- /**
135
- * @nocollapse
136
- */
137
- CdkStep.ctorParameters = function () { return [
138
- { type: CdkStepper, decorators: [{ type: Inject, args: [forwardRef(function () { return CdkStepper; }),] },] },
139
- ]; };
140
- CdkStep.propDecorators = {
141
- 'stepLabel': [{ type: ContentChild, args: [CdkStepLabel,] },],
142
- 'content': [{ type: ViewChild, args: [TemplateRef,] },],
143
- 'stepControl': [{ type: Input },],
144
- 'label': [{ type: Input },],
145
- 'editable': [{ type: Input },],
146
- 'optional': [{ type: Input },],
147
- 'completed': [{ type: Input },],
148
- };
149
161
  var CdkStepper = (function () {
150
162
  /**
151
163
  * @param {?} _dir
164
+ * @param {?} _changeDetectorRef
152
165
  */
153
- function CdkStepper(_dir) {
166
+ function CdkStepper(_dir, _changeDetectorRef) {
154
167
  this._dir = _dir;
168
+ this._changeDetectorRef = _changeDetectorRef;
155
169
  this._linear = false;
156
170
  this._selectedIndex = 0;
157
171
  /**
@@ -207,7 +221,7 @@ var CdkStepper = (function () {
207
221
  * The step that is selected.
208
222
  * @return {?}
209
223
  */
210
- get: function () { return this._steps[this.selectedIndex]; },
224
+ get: function () { return this._steps.toArray()[this.selectedIndex]; },
211
225
  /**
212
226
  * @param {?} step
213
227
  * @return {?}
@@ -248,6 +262,13 @@ var CdkStepper = (function () {
248
262
  CdkStepper.prototype._getStepContentId = function (i) {
249
263
  return "mat-step-content-" + this._groupId + "-" + i;
250
264
  };
265
+ /**
266
+ * Marks the component to be change detected.
267
+ * @return {?}
268
+ */
269
+ CdkStepper.prototype._stateChanged = function () {
270
+ this._changeDetectorRef.markForCheck();
271
+ };
251
272
  /**
252
273
  * Returns position state of the step with the given index.
253
274
  * @param {?} index
@@ -290,6 +311,7 @@ var CdkStepper = (function () {
290
311
  previouslySelectedStep: stepsArray[this._selectedIndex],
291
312
  });
292
313
  this._selectedIndex = newIndex;
314
+ this._stateChanged();
293
315
  };
294
316
  /**
295
317
  * @param {?} event
@@ -360,26 +382,29 @@ var CdkStepper = (function () {
360
382
  CdkStepper.prototype._layoutDirection = function () {
361
383
  return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
362
384
  };
385
+ CdkStepper.decorators = [
386
+ { type: Directive, args: [{
387
+ selector: '[cdkStepper]',
388
+ exportAs: 'cdkStepper',
389
+ },] },
390
+ ];
391
+ /**
392
+ * @nocollapse
393
+ */
394
+ CdkStepper.ctorParameters = function () { return [
395
+ { type: Directionality, decorators: [{ type: Optional },] },
396
+ { type: ChangeDetectorRef, },
397
+ ]; };
398
+ CdkStepper.propDecorators = {
399
+ '_steps': [{ type: ContentChildren, args: [CdkStep,] },],
400
+ 'linear': [{ type: Input },],
401
+ 'selectedIndex': [{ type: Input },],
402
+ 'selected': [{ type: Input },],
403
+ 'selectionChange': [{ type: Output },],
404
+ };
363
405
  return CdkStepper;
364
406
  }());
365
- CdkStepper.decorators = [
366
- { type: Directive, args: [{
367
- selector: '[cdkStepper]',
368
- },] },
369
- ];
370
- /**
371
- * @nocollapse
372
- */
373
- CdkStepper.ctorParameters = function () { return [
374
- { type: Directionality, decorators: [{ type: Optional },] },
375
- ]; };
376
- CdkStepper.propDecorators = {
377
- '_steps': [{ type: ContentChildren, args: [CdkStep,] },],
378
- 'linear': [{ type: Input },],
379
- 'selectedIndex': [{ type: Input },],
380
- 'selected': [{ type: Input },],
381
- 'selectionChange': [{ type: Output },],
382
- };
407
+
383
408
  /**
384
409
  * Button that moves to the next step in a stepper workflow.
385
410
  */
@@ -390,20 +415,20 @@ var CdkStepperNext = (function () {
390
415
  function CdkStepperNext(_stepper) {
391
416
  this._stepper = _stepper;
392
417
  }
418
+ CdkStepperNext.decorators = [
419
+ { type: Directive, args: [{
420
+ selector: 'button[cdkStepperNext]',
421
+ host: { '(click)': '_stepper.next()' }
422
+ },] },
423
+ ];
424
+ /**
425
+ * @nocollapse
426
+ */
427
+ CdkStepperNext.ctorParameters = function () { return [
428
+ { type: CdkStepper, },
429
+ ]; };
393
430
  return CdkStepperNext;
394
431
  }());
395
- CdkStepperNext.decorators = [
396
- { type: Directive, args: [{
397
- selector: 'button[cdkStepperNext]',
398
- host: { '(click)': '_stepper.next()' }
399
- },] },
400
- ];
401
- /**
402
- * @nocollapse
403
- */
404
- CdkStepperNext.ctorParameters = function () { return [
405
- { type: CdkStepper, },
406
- ]; };
407
432
  /**
408
433
  * Button that moves to the previous step in a stepper workflow.
409
434
  */
@@ -414,38 +439,41 @@ var CdkStepperPrevious = (function () {
414
439
  function CdkStepperPrevious(_stepper) {
415
440
  this._stepper = _stepper;
416
441
  }
442
+ CdkStepperPrevious.decorators = [
443
+ { type: Directive, args: [{
444
+ selector: 'button[cdkStepperPrevious]',
445
+ host: { '(click)': '_stepper.previous()' }
446
+ },] },
447
+ ];
448
+ /**
449
+ * @nocollapse
450
+ */
451
+ CdkStepperPrevious.ctorParameters = function () { return [
452
+ { type: CdkStepper, },
453
+ ]; };
417
454
  return CdkStepperPrevious;
418
455
  }());
419
- CdkStepperPrevious.decorators = [
420
- { type: Directive, args: [{
421
- selector: 'button[cdkStepperPrevious]',
422
- host: { '(click)': '_stepper.previous()' }
423
- },] },
424
- ];
425
- /**
426
- * @nocollapse
427
- */
428
- CdkStepperPrevious.ctorParameters = function () { return [
429
- { type: CdkStepper, },
430
- ]; };
456
+
431
457
  var CdkStepperModule = (function () {
432
458
  function CdkStepperModule() {
433
459
  }
460
+ CdkStepperModule.decorators = [
461
+ { type: NgModule, args: [{
462
+ imports: [BidiModule, CommonModule],
463
+ exports: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious],
464
+ declarations: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious]
465
+ },] },
466
+ ];
467
+ /**
468
+ * @nocollapse
469
+ */
470
+ CdkStepperModule.ctorParameters = function () { return []; };
434
471
  return CdkStepperModule;
435
472
  }());
436
- CdkStepperModule.decorators = [
437
- { type: NgModule, args: [{
438
- imports: [BidiModule, CommonModule],
439
- exports: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious],
440
- declarations: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious]
441
- },] },
442
- ];
443
- /**
444
- * @nocollapse
445
- */
446
- CdkStepperModule.ctorParameters = function () { return []; };
473
+
447
474
  /**
448
475
  * Generated bundle index. Do not edit.
449
476
  */
450
- export { CdkStepperModule, StepperSelectionEvent, CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious };
477
+
478
+ export { StepperSelectionEvent, CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious, CdkStepperModule };
451
479
  //# sourceMappingURL=stepper.es5.js.map