@angular/cdk 8.0.0-beta.2 → 8.0.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 (219) hide show
  1. package/README.md +2 -2
  2. package/_overlay.scss +4 -4
  3. package/bundles/cdk-a11y.umd.js +227 -79
  4. package/bundles/cdk-a11y.umd.js.map +1 -1
  5. package/bundles/cdk-a11y.umd.min.js +1 -1
  6. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  7. package/bundles/cdk-accordion.umd.js +20 -8
  8. package/bundles/cdk-accordion.umd.js.map +1 -1
  9. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  10. package/bundles/cdk-bidi.umd.js +5 -5
  11. package/bundles/cdk-bidi.umd.min.js +1 -1
  12. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  13. package/bundles/cdk-coercion.umd.js +5 -5
  14. package/bundles/cdk-collections.umd.js +38 -15
  15. package/bundles/cdk-collections.umd.js.map +1 -1
  16. package/bundles/cdk-collections.umd.min.js +1 -1
  17. package/bundles/cdk-collections.umd.min.js.map +1 -1
  18. package/bundles/cdk-drag-drop.umd.js +571 -180
  19. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  20. package/bundles/cdk-drag-drop.umd.min.js +2 -2
  21. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  22. package/bundles/cdk-keycodes.umd.js +7 -3
  23. package/bundles/cdk-keycodes.umd.js.map +1 -1
  24. package/bundles/cdk-keycodes.umd.min.js.map +1 -1
  25. package/bundles/cdk-layout.umd.js +83 -30
  26. package/bundles/cdk-layout.umd.js.map +1 -1
  27. package/bundles/cdk-layout.umd.min.js +1 -1
  28. package/bundles/cdk-layout.umd.min.js.map +1 -1
  29. package/bundles/cdk-observers.umd.js +30 -11
  30. package/bundles/cdk-observers.umd.js.map +1 -1
  31. package/bundles/cdk-observers.umd.min.js +1 -1
  32. package/bundles/cdk-observers.umd.min.js.map +1 -1
  33. package/bundles/cdk-overlay.umd.js +229 -108
  34. package/bundles/cdk-overlay.umd.js.map +1 -1
  35. package/bundles/cdk-overlay.umd.min.js +2 -2
  36. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  37. package/bundles/cdk-platform.umd.js +17 -10
  38. package/bundles/cdk-platform.umd.js.map +1 -1
  39. package/bundles/cdk-platform.umd.min.js +1 -1
  40. package/bundles/cdk-platform.umd.min.js.map +1 -1
  41. package/bundles/cdk-portal.umd.js +32 -13
  42. package/bundles/cdk-portal.umd.js.map +1 -1
  43. package/bundles/cdk-portal.umd.min.js.map +1 -1
  44. package/bundles/cdk-scrolling.umd.js +184 -62
  45. package/bundles/cdk-scrolling.umd.js.map +1 -1
  46. package/bundles/cdk-scrolling.umd.min.js +1 -1
  47. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  48. package/bundles/cdk-stepper.umd.js +30 -12
  49. package/bundles/cdk-stepper.umd.js.map +1 -1
  50. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  51. package/bundles/cdk-table.umd.js +384 -74
  52. package/bundles/cdk-table.umd.js.map +1 -1
  53. package/bundles/cdk-table.umd.min.js +1 -1
  54. package/bundles/cdk-table.umd.min.js.map +1 -1
  55. package/bundles/cdk-text-field.umd.js +61 -21
  56. package/bundles/cdk-text-field.umd.js.map +1 -1
  57. package/bundles/cdk-text-field.umd.min.js +1 -1
  58. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  59. package/bundles/cdk-tree.umd.js +85 -29
  60. package/bundles/cdk-tree.umd.js.map +1 -1
  61. package/bundles/cdk-tree.umd.min.js.map +1 -1
  62. package/bundles/cdk.umd.js +2 -2
  63. package/bundles/cdk.umd.js.map +1 -1
  64. package/bundles/cdk.umd.min.js +1 -1
  65. package/bundles/cdk.umd.min.js.map +1 -1
  66. package/drag-drop/typings/directives/drag.d.ts +11 -2
  67. package/drag-drop/typings/drag-events.d.ts +17 -0
  68. package/drag-drop/typings/drag-ref.d.ts +9 -5
  69. package/drag-drop/typings/drop-list-ref.d.ts +9 -3
  70. package/drag-drop/typings/index.metadata.json +1 -1
  71. package/esm2015/a11y.js +229 -81
  72. package/esm2015/a11y.js.map +1 -1
  73. package/esm2015/accordion.js +22 -10
  74. package/esm2015/accordion.js.map +1 -1
  75. package/esm2015/bidi.js +8 -8
  76. package/esm2015/cdk.js +4 -4
  77. package/esm2015/cdk.js.map +1 -1
  78. package/esm2015/coercion.js +7 -7
  79. package/esm2015/collections.js +41 -18
  80. package/esm2015/collections.js.map +1 -1
  81. package/esm2015/drag-drop.js +540 -181
  82. package/esm2015/drag-drop.js.map +1 -1
  83. package/esm2015/keycodes.js +9 -5
  84. package/esm2015/keycodes.js.map +1 -1
  85. package/esm2015/layout.js +89 -36
  86. package/esm2015/layout.js.map +1 -1
  87. package/esm2015/observers.js +33 -14
  88. package/esm2015/observers.js.map +1 -1
  89. package/esm2015/overlay.js +232 -110
  90. package/esm2015/overlay.js.map +1 -1
  91. package/esm2015/platform.js +20 -13
  92. package/esm2015/platform.js.map +1 -1
  93. package/esm2015/portal.js +34 -15
  94. package/esm2015/portal.js.map +1 -1
  95. package/esm2015/scrolling.js +180 -58
  96. package/esm2015/scrolling.js.map +1 -1
  97. package/esm2015/stepper.js +32 -14
  98. package/esm2015/stepper.js.map +1 -1
  99. package/esm2015/table.js +369 -69
  100. package/esm2015/table.js.map +1 -1
  101. package/esm2015/text-field.js +64 -24
  102. package/esm2015/text-field.js.map +1 -1
  103. package/esm2015/tree.js +86 -30
  104. package/esm2015/tree.js.map +1 -1
  105. package/esm5/a11y.es5.js +230 -82
  106. package/esm5/a11y.es5.js.map +1 -1
  107. package/esm5/accordion.es5.js +22 -10
  108. package/esm5/accordion.es5.js.map +1 -1
  109. package/esm5/bidi.es5.js +8 -8
  110. package/esm5/cdk.es5.js +4 -4
  111. package/esm5/cdk.es5.js.map +1 -1
  112. package/esm5/coercion.es5.js +7 -7
  113. package/esm5/collections.es5.js +42 -19
  114. package/esm5/collections.es5.js.map +1 -1
  115. package/esm5/drag-drop.es5.js +574 -183
  116. package/esm5/drag-drop.es5.js.map +1 -1
  117. package/esm5/keycodes.es5.js +9 -5
  118. package/esm5/keycodes.es5.js.map +1 -1
  119. package/esm5/layout.es5.js +86 -33
  120. package/esm5/layout.es5.js.map +1 -1
  121. package/esm5/observers.es5.js +33 -14
  122. package/esm5/observers.es5.js.map +1 -1
  123. package/esm5/overlay.es5.js +232 -111
  124. package/esm5/overlay.es5.js.map +1 -1
  125. package/esm5/platform.es5.js +20 -13
  126. package/esm5/platform.es5.js.map +1 -1
  127. package/esm5/portal.es5.js +34 -15
  128. package/esm5/portal.es5.js.map +1 -1
  129. package/esm5/scrolling.es5.js +187 -65
  130. package/esm5/scrolling.es5.js.map +1 -1
  131. package/esm5/stepper.es5.js +32 -14
  132. package/esm5/stepper.es5.js.map +1 -1
  133. package/esm5/table.es5.js +386 -72
  134. package/esm5/table.es5.js.map +1 -1
  135. package/esm5/text-field.es5.js +64 -24
  136. package/esm5/text-field.es5.js.map +1 -1
  137. package/esm5/tree.es5.js +87 -31
  138. package/esm5/tree.es5.js.map +1 -1
  139. package/layout/typings/breakpoints-observer.d.ts +3 -3
  140. package/layout/typings/index.metadata.json +1 -1
  141. package/layout/typings/media-matcher.d.ts +2 -2
  142. package/overlay/typings/index.metadata.json +1 -1
  143. package/overlay/typings/position/flexible-connected-position-strategy.d.ts +1 -3
  144. package/package.json +8 -8
  145. package/portal/typings/portal.d.ts +2 -2
  146. package/schematics/ng-update/data/attribute-selectors.js +1 -1
  147. package/schematics/ng-update/data/attribute-selectors.js.map +1 -1
  148. package/schematics/ng-update/data/class-names.js +3 -3
  149. package/schematics/ng-update/data/class-names.js.map +1 -1
  150. package/schematics/ng-update/data/constructor-checks.js +1 -1
  151. package/schematics/ng-update/data/constructor-checks.js.map +1 -1
  152. package/schematics/ng-update/data/input-names.js +1 -1
  153. package/schematics/ng-update/data/input-names.js.map +1 -1
  154. package/schematics/ng-update/data/method-call-checks.js +1 -1
  155. package/schematics/ng-update/data/method-call-checks.js.map +1 -1
  156. package/schematics/ng-update/data/property-names.js +4 -4
  157. package/schematics/ng-update/data/property-names.js.map +1 -1
  158. package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js +1 -1
  159. package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js.map +1 -1
  160. package/schematics/tsconfig.tsbuildinfo +5811 -0
  161. package/schematics/utils/ast.d.ts +1 -1
  162. package/schematics/utils/build-component.js +1 -1
  163. package/schematics/utils/build-component.js.map +1 -1
  164. package/schematics/utils/get-project.d.ts +1 -1
  165. package/schematics/utils/project-main-file.d.ts +1 -1
  166. package/schematics/utils/project-style-file.d.ts +1 -1
  167. package/schematics/utils/project-targets.d.ts +1 -1
  168. package/schematics/utils/schematic-options.d.ts +1 -1
  169. package/table/typings/cell.d.ts +3 -2
  170. package/table/typings/index.metadata.json +1 -1
  171. package/table/typings/public-api.d.ts +1 -0
  172. package/table/typings/row.d.ts +5 -4
  173. package/table/typings/sticky-styler.d.ts +5 -5
  174. package/table/typings/table-errors.d.ts +10 -0
  175. package/table/typings/text-column.d.ts +80 -0
  176. package/typings/drag-drop/directives/drag.d.ts +11 -2
  177. package/typings/drag-drop/drag-events.d.ts +17 -0
  178. package/typings/drag-drop/drag-ref.d.ts +9 -5
  179. package/typings/drag-drop/drop-list-ref.d.ts +9 -3
  180. package/typings/drag-drop/index.metadata.json +1 -1
  181. package/typings/esm5/drag-drop/directives/drag.d.ts +11 -2
  182. package/typings/esm5/drag-drop/drag-events.d.ts +17 -0
  183. package/typings/esm5/drag-drop/drag-ref.d.ts +9 -5
  184. package/typings/esm5/drag-drop/drop-list-ref.d.ts +9 -3
  185. package/typings/esm5/drag-drop/index.metadata.json +1 -1
  186. package/typings/esm5/index.metadata.json +1 -1
  187. package/typings/esm5/layout/breakpoints-observer.d.ts +3 -3
  188. package/typings/esm5/layout/index.metadata.json +1 -1
  189. package/typings/esm5/layout/media-matcher.d.ts +2 -2
  190. package/typings/esm5/overlay/index.metadata.json +1 -1
  191. package/typings/esm5/overlay/position/flexible-connected-position-strategy.d.ts +1 -3
  192. package/typings/esm5/portal/portal.d.ts +2 -2
  193. package/typings/esm5/table/cell.d.ts +3 -2
  194. package/typings/esm5/table/index.metadata.json +1 -1
  195. package/typings/esm5/table/public-api.d.ts +1 -0
  196. package/typings/esm5/table/row.d.ts +5 -4
  197. package/typings/esm5/table/sticky-styler.d.ts +5 -5
  198. package/typings/esm5/table/table-errors.d.ts +10 -0
  199. package/typings/esm5/table/text-column.d.ts +80 -0
  200. package/typings/index.metadata.json +1 -1
  201. package/typings/layout/breakpoints-observer.d.ts +3 -3
  202. package/typings/layout/index.metadata.json +1 -1
  203. package/typings/layout/media-matcher.d.ts +2 -2
  204. package/typings/overlay/index.metadata.json +1 -1
  205. package/typings/overlay/position/flexible-connected-position-strategy.d.ts +1 -3
  206. package/typings/portal/portal.d.ts +2 -2
  207. package/typings/schematics/utils/ast.d.ts +1 -1
  208. package/typings/schematics/utils/get-project.d.ts +1 -1
  209. package/typings/schematics/utils/project-main-file.d.ts +1 -1
  210. package/typings/schematics/utils/project-style-file.d.ts +1 -1
  211. package/typings/schematics/utils/project-targets.d.ts +1 -1
  212. package/typings/schematics/utils/schematic-options.d.ts +1 -1
  213. package/typings/table/cell.d.ts +3 -2
  214. package/typings/table/index.metadata.json +1 -1
  215. package/typings/table/public-api.d.ts +1 -0
  216. package/typings/table/row.d.ts +5 -4
  217. package/typings/table/sticky-styler.d.ts +5 -5
  218. package/typings/table/table-errors.d.ts +10 -0
  219. package/typings/table/text-column.d.ts +80 -0
@@ -13,7 +13,7 @@
13
13
 
14
14
  /**
15
15
  * @fileoverview added by tsickle
16
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
16
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
17
17
  */
18
18
  /**
19
19
  * Shallow-extends a stylesheet object with another stylesheet object.
@@ -53,7 +53,7 @@ function toggleNativeDragInteractions(element, enable) {
53
53
 
54
54
  /**
55
55
  * @fileoverview added by tsickle
56
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
56
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
57
57
  */
58
58
 
59
59
  /**
@@ -78,7 +78,11 @@ function getTransformTransitionDurationInMs(element) {
78
78
  /** @type {?} */
79
79
  var transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');
80
80
  /** @type {?} */
81
- var property = transitionedProperties.find(function (prop) { return prop === 'transform' || prop === 'all'; });
81
+ var property = transitionedProperties.find((/**
82
+ * @param {?} prop
83
+ * @return {?}
84
+ */
85
+ function (prop) { return prop === 'transform' || prop === 'all'; }));
82
86
  // If there's no transition for `all` or `transform`, we shouldn't do anything.
83
87
  if (!property) {
84
88
  return 0;
@@ -103,12 +107,16 @@ function getTransformTransitionDurationInMs(element) {
103
107
  function parseCssPropertyValue(computedStyle, name) {
104
108
  /** @type {?} */
105
109
  var value = computedStyle.getPropertyValue(name);
106
- return value.split(',').map(function (part) { return part.trim(); });
110
+ return value.split(',').map((/**
111
+ * @param {?} part
112
+ * @return {?}
113
+ */
114
+ function (part) { return part.trim(); }));
107
115
  }
108
116
 
109
117
  /**
110
118
  * @fileoverview added by tsickle
111
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
119
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
112
120
  */
113
121
  /**
114
122
  * Options that can be used to bind a passive event listener.
@@ -161,11 +169,6 @@ DragRef = /** @class */ (function () {
161
169
  * Emits when the item is being moved.
162
170
  */
163
171
  this._moveEvents = new rxjs.Subject();
164
- /**
165
- * Amount of subscriptions to the move event. Used to avoid
166
- * hitting the zone if the consumer didn't subscribe to it.
167
- */
168
- this._moveEventSubscriptions = 0;
169
172
  /**
170
173
  * Subscription to pointer movement events.
171
174
  */
@@ -232,28 +235,28 @@ DragRef = /** @class */ (function () {
232
235
  * Emits as the user is dragging the item. Use with caution,
233
236
  * because this event will fire for every pixel that the user has dragged.
234
237
  */
235
- this.moved = new rxjs.Observable(function (observer) {
236
- /** @type {?} */
237
- var subscription = _this._moveEvents.subscribe(observer);
238
- _this._moveEventSubscriptions++;
239
- return function () {
240
- subscription.unsubscribe();
241
- _this._moveEventSubscriptions--;
242
- };
243
- });
238
+ this.moved = this._moveEvents.asObservable();
244
239
  /**
245
240
  * Handler for the `mousedown`/`touchstart` events.
246
241
  */
247
- this._pointerDown = function (event) {
242
+ this._pointerDown = (/**
243
+ * @param {?} event
244
+ * @return {?}
245
+ */
246
+ function (event) {
248
247
  _this.beforeStarted.next();
249
248
  // Delegate the event based on whether it started from a handle or the element itself.
250
249
  if (_this._handles.length) {
251
250
  /** @type {?} */
252
- var targetHandle = _this._handles.find(function (handle) {
251
+ var targetHandle = _this._handles.find((/**
252
+ * @param {?} handle
253
+ * @return {?}
254
+ */
255
+ function (handle) {
253
256
  /** @type {?} */
254
257
  var target = event.target;
255
258
  return !!target && (target === handle || handle.contains((/** @type {?} */ (target))));
256
- });
259
+ }));
257
260
  if (targetHandle && !_this._disabledHandles.has(targetHandle) && !_this.disabled) {
258
261
  _this._initializeDragSequence(targetHandle, event);
259
262
  }
@@ -261,11 +264,15 @@ DragRef = /** @class */ (function () {
261
264
  else if (!_this.disabled) {
262
265
  _this._initializeDragSequence(_this._rootElement, event);
263
266
  }
264
- };
267
+ });
265
268
  /**
266
269
  * Handler that is invoked when the user moves their pointer after they've initiated a drag.
267
270
  */
268
- this._pointerMove = function (event) {
271
+ this._pointerMove = (/**
272
+ * @param {?} event
273
+ * @return {?}
274
+ */
275
+ function (event) {
269
276
  if (!_this._hasStartedDragging) {
270
277
  /** @type {?} */
271
278
  var pointerPosition = _this._getPointerPositionOnPage(event);
@@ -281,7 +288,10 @@ DragRef = /** @class */ (function () {
281
288
  // per pixel of movement (e.g. if the user moves their pointer quickly).
282
289
  if (isOverThreshold && (Date.now() >= _this._dragStartTime + (_this.dragStartDelay || 0))) {
283
290
  _this._hasStartedDragging = true;
284
- _this._ngZone.run(function () { return _this._startDragSequence(event); });
291
+ _this._ngZone.run((/**
292
+ * @return {?}
293
+ */
294
+ function () { return _this._startDragSequence(event); }));
285
295
  }
286
296
  return;
287
297
  }
@@ -319,21 +329,29 @@ DragRef = /** @class */ (function () {
319
329
  // Since this event gets fired for every pixel while dragging, we only
320
330
  // want to fire it if the consumer opted into it. Also we have to
321
331
  // re-enter the zone because we run all of the events on the outside.
322
- if (_this._moveEventSubscriptions > 0) {
323
- _this._ngZone.run(function () {
332
+ if (_this._moveEvents.observers.length) {
333
+ _this._ngZone.run((/**
334
+ * @return {?}
335
+ */
336
+ function () {
324
337
  _this._moveEvents.next({
325
338
  source: _this,
326
339
  pointerPosition: constrainedPointerPosition,
327
340
  event: event,
341
+ distance: _this._getDragDistance(constrainedPointerPosition),
328
342
  delta: _this._pointerDirectionDelta
329
343
  });
330
- });
344
+ }));
331
345
  }
332
- };
346
+ });
333
347
  /**
334
348
  * Handler that is invoked when the user lifts their pointer up, after initiating a drag.
335
349
  */
336
- this._pointerUp = function (event) {
350
+ this._pointerUp = (/**
351
+ * @param {?} event
352
+ * @return {?}
353
+ */
354
+ function (event) {
337
355
  // Note that here we use `isDragging` from the service, rather than from `this`.
338
356
  // The difference is that the one from the service reflects whether a dragging sequence
339
357
  // has been initiated, whereas the one on `this` includes whether the user has passed
@@ -356,15 +374,26 @@ DragRef = /** @class */ (function () {
356
374
  // to the new passive transform.
357
375
  _this._passiveTransform.x = _this._activeTransform.x;
358
376
  _this._passiveTransform.y = _this._activeTransform.y;
359
- _this._ngZone.run(function () { return _this.ended.next({ source: _this }); });
377
+ _this._ngZone.run((/**
378
+ * @return {?}
379
+ */
380
+ function () {
381
+ _this.ended.next({
382
+ source: _this,
383
+ distance: _this._getDragDistance(_this._getPointerPositionOnPage(event))
384
+ });
385
+ }));
360
386
  _this._dragDropRegistry.stopDragging(_this);
361
387
  return;
362
388
  }
363
- _this._animatePreviewToPlaceholder().then(function () {
389
+ _this._animatePreviewToPlaceholder().then((/**
390
+ * @return {?}
391
+ */
392
+ function () {
364
393
  _this._cleanupDragArtifacts(event);
365
394
  _this._dragDropRegistry.stopDragging(_this);
366
- });
367
- };
395
+ }));
396
+ });
368
397
  this.withRootElement(element);
369
398
  _dragDropRegistry.registerDragItem(this);
370
399
  }
@@ -437,8 +466,16 @@ DragRef = /** @class */ (function () {
437
466
  * @return {THIS}
438
467
  */
439
468
  function (handles) {
440
- (/** @type {?} */ (this))._handles = handles.map(function (handle) { return coercion.coerceElement(handle); });
441
- (/** @type {?} */ (this))._handles.forEach(function (handle) { return toggleNativeDragInteractions(handle, false); });
469
+ (/** @type {?} */ (this))._handles = handles.map((/**
470
+ * @param {?} handle
471
+ * @return {?}
472
+ */
473
+ function (handle) { return coercion.coerceElement(handle); }));
474
+ (/** @type {?} */ (this))._handles.forEach((/**
475
+ * @param {?} handle
476
+ * @return {?}
477
+ */
478
+ function (handle) { return toggleNativeDragInteractions(handle, false); }));
442
479
  (/** @type {?} */ (this))._toggleNativeDragInteractions();
443
480
  return (/** @type {?} */ (this));
444
481
  };
@@ -912,32 +949,39 @@ DragRef = /** @class */ (function () {
912
949
  (/** @type {?} */ (this._nextSibling.parentNode)).insertBefore(this._rootElement, this._nextSibling);
913
950
  }
914
951
  else {
915
- this._initialContainer.element.appendChild(this._rootElement);
952
+ coercion.coerceElement(this._initialContainer.element).appendChild(this._rootElement);
916
953
  }
917
954
  this._destroyPreview();
918
955
  this._destroyPlaceholder();
919
956
  this._boundaryRect = this._previewRect = undefined;
920
957
  // Re-enter the NgZone since we bound `document` events on the outside.
921
- this._ngZone.run(function () {
958
+ this._ngZone.run((/**
959
+ * @return {?}
960
+ */
961
+ function () {
922
962
  /** @type {?} */
923
963
  var container = (/** @type {?} */ (_this._dropContainer));
924
964
  /** @type {?} */
925
965
  var currentIndex = container.getItemIndex(_this);
926
- var _a = _this._getPointerPositionOnPage(event), x = _a.x, y = _a.y;
927
966
  /** @type {?} */
928
- var isPointerOverContainer = container._isOverContainer(x, y);
929
- _this.ended.next({ source: _this });
967
+ var pointerPosition = _this._getPointerPositionOnPage(event);
968
+ /** @type {?} */
969
+ var distance = _this._getDragDistance(_this._getPointerPositionOnPage(event));
970
+ /** @type {?} */
971
+ var isPointerOverContainer = container._isOverContainer(pointerPosition.x, pointerPosition.y);
972
+ _this.ended.next({ source: _this, distance: distance });
930
973
  _this.dropped.next({
931
974
  item: _this,
932
975
  currentIndex: currentIndex,
933
976
  previousIndex: _this._initialContainer.getItemIndex(_this),
934
977
  container: container,
935
978
  previousContainer: _this._initialContainer,
936
- isPointerOverContainer: isPointerOverContainer
979
+ isPointerOverContainer: isPointerOverContainer,
980
+ distance: distance
937
981
  });
938
- container.drop(_this, currentIndex, _this._initialContainer, isPointerOverContainer);
982
+ container.drop(_this, currentIndex, _this._initialContainer, isPointerOverContainer, distance);
939
983
  _this._dropContainer = _this._initialContainer;
940
- });
984
+ }));
941
985
  };
942
986
  /**
943
987
  * Updates the item's position in its drop container, or moves it
@@ -962,8 +1006,7 @@ DragRef = /** @class */ (function () {
962
1006
  var x = _a.x, y = _a.y;
963
1007
  // Drop container that draggable has been moved into.
964
1008
  /** @type {?} */
965
- var newContainer = (/** @type {?} */ (this._dropContainer))._getSiblingContainerFromPosition(this, x, y) ||
966
- this._initialContainer._getSiblingContainerFromPosition(this, x, y);
1009
+ var newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y);
967
1010
  // If we couldn't find a new container to move the item into, and the item has left it's
968
1011
  // initial container, check whether the it's over the initial container. This handles the
969
1012
  // case where two containers are connected one way and the user tries to undo dragging an
@@ -973,15 +1016,22 @@ DragRef = /** @class */ (function () {
973
1016
  newContainer = this._initialContainer;
974
1017
  }
975
1018
  if (newContainer && newContainer !== this._dropContainer) {
976
- this._ngZone.run(function () {
1019
+ this._ngZone.run((/**
1020
+ * @return {?}
1021
+ */
1022
+ function () {
977
1023
  // Notify the old container that the item has left.
978
1024
  _this.exited.next({ item: _this, container: (/** @type {?} */ (_this._dropContainer)) });
979
1025
  (/** @type {?} */ (_this._dropContainer)).exit(_this);
980
1026
  // Notify the new container that the item has entered.
981
- _this.entered.next({ item: _this, container: (/** @type {?} */ (newContainer)) });
982
1027
  _this._dropContainer = (/** @type {?} */ (newContainer));
983
1028
  _this._dropContainer.enter(_this, x, y);
984
- });
1029
+ _this.entered.next({
1030
+ item: _this,
1031
+ container: (/** @type {?} */ (newContainer)),
1032
+ currentIndex: (/** @type {?} */ (newContainer)).getItemIndex(_this)
1033
+ });
1034
+ }));
985
1035
  }
986
1036
  (/** @type {?} */ (this._dropContainer))._sortItem(this, x, y, this._pointerDirectionDelta);
987
1037
  this._preview.style.transform =
@@ -1077,24 +1127,35 @@ DragRef = /** @class */ (function () {
1077
1127
  if (duration === 0) {
1078
1128
  return Promise.resolve();
1079
1129
  }
1080
- return this._ngZone.runOutsideAngular(function () {
1081
- return new Promise(function (resolve) {
1130
+ return this._ngZone.runOutsideAngular((/**
1131
+ * @return {?}
1132
+ */
1133
+ function () {
1134
+ return new Promise((/**
1135
+ * @param {?} resolve
1136
+ * @return {?}
1137
+ */
1138
+ function (resolve) {
1082
1139
  /** @type {?} */
1083
- var handler = (/** @type {?} */ ((function (event) {
1140
+ var handler = (/** @type {?} */ (((/**
1141
+ * @param {?} event
1142
+ * @return {?}
1143
+ */
1144
+ function (event) {
1084
1145
  if (!event || (event.target === _this._preview && event.propertyName === 'transform')) {
1085
1146
  _this._preview.removeEventListener('transitionend', handler);
1086
1147
  resolve();
1087
1148
  clearTimeout(timeout);
1088
1149
  }
1089
- })));
1150
+ }))));
1090
1151
  // If a transition is short enough, the browser might not fire the `transitionend` event.
1091
1152
  // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll
1092
1153
  // fire if the transition hasn't completed when it was supposed to.
1093
1154
  /** @type {?} */
1094
1155
  var timeout = setTimeout((/** @type {?} */ (handler)), duration * 1.5);
1095
1156
  _this._preview.addEventListener('transitionend', handler);
1096
- });
1097
- });
1157
+ }));
1158
+ }));
1098
1159
  };
1099
1160
  /** Creates an element that will be shown instead of the current element while dragging. */
1100
1161
  /**
@@ -1338,6 +1399,30 @@ DragRef = /** @class */ (function () {
1338
1399
  this._rootElement.style.transform = this._initialTransform ?
1339
1400
  transform + ' ' + this._initialTransform : transform;
1340
1401
  };
1402
+ /**
1403
+ * Gets the distance that the user has dragged during the current drag sequence.
1404
+ * @param currentPosition Current position of the user's pointer.
1405
+ */
1406
+ /**
1407
+ * Gets the distance that the user has dragged during the current drag sequence.
1408
+ * @private
1409
+ * @param {?} currentPosition Current position of the user's pointer.
1410
+ * @return {?}
1411
+ */
1412
+ DragRef.prototype._getDragDistance = /**
1413
+ * Gets the distance that the user has dragged during the current drag sequence.
1414
+ * @private
1415
+ * @param {?} currentPosition Current position of the user's pointer.
1416
+ * @return {?}
1417
+ */
1418
+ function (currentPosition) {
1419
+ /** @type {?} */
1420
+ var pickupPosition = this._pickupPositionOnPage;
1421
+ if (pickupPosition) {
1422
+ return { x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y };
1423
+ }
1424
+ return { x: 0, y: 0 };
1425
+ };
1341
1426
  return DragRef;
1342
1427
  }());
1343
1428
  /**
@@ -1361,11 +1446,26 @@ function deepCloneNode(node) {
1361
1446
  var clone = (/** @type {?} */ (node.cloneNode(true)));
1362
1447
  /** @type {?} */
1363
1448
  var descendantsWithId = clone.querySelectorAll('[id]');
1449
+ /** @type {?} */
1450
+ var descendantCanvases = node.querySelectorAll('canvas');
1364
1451
  // Remove the `id` to avoid having multiple elements with the same id on the page.
1365
1452
  clone.removeAttribute('id');
1366
1453
  for (var i = 0; i < descendantsWithId.length; i++) {
1367
1454
  descendantsWithId[i].removeAttribute('id');
1368
1455
  }
1456
+ // `cloneNode` won't transfer the content of `canvas` elements so we have to do it ourselves.
1457
+ // We match up the cloned canvas to their sources using their index in the DOM.
1458
+ if (descendantCanvases.length) {
1459
+ /** @type {?} */
1460
+ var cloneCanvases = clone.querySelectorAll('canvas');
1461
+ for (var i = 0; i < descendantCanvases.length; i++) {
1462
+ /** @type {?} */
1463
+ var correspondingCloneContext = cloneCanvases[i].getContext('2d');
1464
+ if (correspondingCloneContext) {
1465
+ correspondingCloneContext.drawImage(descendantCanvases[i], 0, 0);
1466
+ }
1467
+ }
1468
+ }
1369
1469
  return clone;
1370
1470
  }
1371
1471
  /**
@@ -1414,7 +1514,7 @@ function getPreviewInsertionPoint(documentRef) {
1414
1514
 
1415
1515
  /**
1416
1516
  * @fileoverview added by tsickle
1417
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1517
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1418
1518
  */
1419
1519
 
1420
1520
  /**
@@ -1490,7 +1590,7 @@ function clamp$1(value, max) {
1490
1590
 
1491
1591
  /**
1492
1592
  * @fileoverview added by tsickle
1493
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1593
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1494
1594
  */
1495
1595
  /**
1496
1596
  * Counter used to generate unique ids for drop refs.
@@ -1534,7 +1634,10 @@ DropListRef = /** @class */ (function () {
1534
1634
  * Function that is used to determine whether an item
1535
1635
  * is allowed to be moved into a drop container.
1536
1636
  */
1537
- this.enterPredicate = function () { return true; };
1637
+ this.enterPredicate = (/**
1638
+ * @return {?}
1639
+ */
1640
+ function () { return true; });
1538
1641
  /**
1539
1642
  * Emits right before dragging has started.
1540
1643
  */
@@ -1632,10 +1735,12 @@ DropListRef = /** @class */ (function () {
1632
1735
  var _this = this;
1633
1736
  this.beforeStarted.next();
1634
1737
  this._isDragging = true;
1635
- this._activeDraggables = this._draggables.slice();
1636
- this._cacheOwnPosition();
1637
- this._cacheItemPositions();
1638
- this._siblings.forEach(function (sibling) { return sibling._startReceiving(_this); });
1738
+ this._cacheItems();
1739
+ this._siblings.forEach((/**
1740
+ * @param {?} sibling
1741
+ * @return {?}
1742
+ */
1743
+ function (sibling) { return sibling._startReceiving(_this); }));
1639
1744
  };
1640
1745
  /**
1641
1746
  * Emits an event to indicate that the user moved an item into the container.
@@ -1658,7 +1763,6 @@ DropListRef = /** @class */ (function () {
1658
1763
  * @return {?}
1659
1764
  */
1660
1765
  function (item, pointerX, pointerY) {
1661
- this.entered.next({ item: item, container: this });
1662
1766
  this.start();
1663
1767
  // If sorting is disabled, we want the item to return to its starting
1664
1768
  // position if the user is returning it to its initial container.
@@ -1697,7 +1801,7 @@ DropListRef = /** @class */ (function () {
1697
1801
  activeDraggables.splice(newIndex, 0, item);
1698
1802
  }
1699
1803
  else {
1700
- this.element.appendChild(placeholder);
1804
+ coercion.coerceElement(this.element).appendChild(placeholder);
1701
1805
  activeDraggables.push(item);
1702
1806
  }
1703
1807
  // The transform needs to be cleared so it doesn't throw off the measurements.
@@ -1705,6 +1809,7 @@ DropListRef = /** @class */ (function () {
1705
1809
  // Note that the positions were already cached when we called `start` above,
1706
1810
  // but we need to refresh them since the amount of items has changed.
1707
1811
  this._cacheItemPositions();
1812
+ this.entered.next({ item: item, container: this, currentIndex: this.getItemIndex(item) });
1708
1813
  };
1709
1814
  /**
1710
1815
  * Removes an item from the container after it was dragged into another container by the user.
@@ -1731,26 +1836,33 @@ DropListRef = /** @class */ (function () {
1731
1836
  * @param previousContainer Container from which the item got dragged in.
1732
1837
  * @param isPointerOverContainer Whether the user's pointer was over the
1733
1838
  * container when the item was dropped.
1839
+ * @param distance Distance the user has dragged since the start of the dragging sequence.
1840
+ * @breaking-change 9.0.0 `distance` parameter to become required.
1734
1841
  */
1735
1842
  /**
1736
1843
  * Drops an item into this container.
1844
+ * \@breaking-change 9.0.0 `distance` parameter to become required.
1737
1845
  * @param {?} item Item being dropped into the container.
1738
1846
  * @param {?} currentIndex Index at which the item should be inserted.
1739
1847
  * @param {?} previousContainer Container from which the item got dragged in.
1740
1848
  * @param {?} isPointerOverContainer Whether the user's pointer was over the
1741
1849
  * container when the item was dropped.
1850
+ * @param {?=} distance Distance the user has dragged since the start of the dragging sequence.
1742
1851
  * @return {?}
1743
1852
  */
1744
1853
  DropListRef.prototype.drop = /**
1745
1854
  * Drops an item into this container.
1855
+ * \@breaking-change 9.0.0 `distance` parameter to become required.
1746
1856
  * @param {?} item Item being dropped into the container.
1747
1857
  * @param {?} currentIndex Index at which the item should be inserted.
1748
1858
  * @param {?} previousContainer Container from which the item got dragged in.
1749
1859
  * @param {?} isPointerOverContainer Whether the user's pointer was over the
1750
1860
  * container when the item was dropped.
1861
+ * @param {?=} distance Distance the user has dragged since the start of the dragging sequence.
1751
1862
  * @return {?}
1752
1863
  */
1753
- function (item, currentIndex, previousContainer, isPointerOverContainer) {
1864
+ function (item, currentIndex, previousContainer, isPointerOverContainer, distance) {
1865
+ if (distance === void 0) { distance = { x: 0, y: 0 }; }
1754
1866
  this._reset();
1755
1867
  this.dropped.next({
1756
1868
  item: item,
@@ -1758,7 +1870,8 @@ DropListRef = /** @class */ (function () {
1758
1870
  previousIndex: previousContainer.getItemIndex(item),
1759
1871
  container: this,
1760
1872
  previousContainer: previousContainer,
1761
- isPointerOverContainer: isPointerOverContainer
1873
+ isPointerOverContainer: isPointerOverContainer,
1874
+ distance: distance
1762
1875
  });
1763
1876
  };
1764
1877
  /**
@@ -1782,7 +1895,14 @@ DropListRef = /** @class */ (function () {
1782
1895
  function (items) {
1783
1896
  var _this = this;
1784
1897
  (/** @type {?} */ (this))._draggables = items;
1785
- items.forEach(function (item) { return item._withDropContainer((/** @type {?} */ (_this))); });
1898
+ items.forEach((/**
1899
+ * @param {?} item
1900
+ * @return {?}
1901
+ */
1902
+ function (item) { return item._withDropContainer((/** @type {?} */ (_this))); }));
1903
+ if ((/** @type {?} */ (this)).isDragging()) {
1904
+ (/** @type {?} */ (this))._cacheItems();
1905
+ }
1786
1906
  return (/** @type {?} */ (this));
1787
1907
  };
1788
1908
  /** Sets the layout direction of the drop list. */
@@ -1875,7 +1995,11 @@ DropListRef = /** @class */ (function () {
1875
1995
  /** @type {?} */
1876
1996
  var items = this._orientation === 'horizontal' && this._direction === 'rtl' ?
1877
1997
  this._itemPositions.slice().reverse() : this._itemPositions;
1878
- return findIndex(items, function (currentItem) { return currentItem.drag === item; });
1998
+ return findIndex(items, (/**
1999
+ * @param {?} currentItem
2000
+ * @return {?}
2001
+ */
2002
+ function (currentItem) { return currentItem.drag === item; }));
1879
2003
  };
1880
2004
  /**
1881
2005
  * Whether the list is able to receive the item that
@@ -1932,7 +2056,11 @@ DropListRef = /** @class */ (function () {
1932
2056
  /** @type {?} */
1933
2057
  var isHorizontal = this._orientation === 'horizontal';
1934
2058
  /** @type {?} */
1935
- var currentIndex = findIndex(siblings, function (currentItem) { return currentItem.drag === item; });
2059
+ var currentIndex = findIndex(siblings, (/**
2060
+ * @param {?} currentItem
2061
+ * @return {?}
2062
+ */
2063
+ function (currentItem) { return currentItem.drag === item; }));
1936
2064
  /** @type {?} */
1937
2065
  var siblingAtNewPosition = siblings[newIndex];
1938
2066
  /** @type {?} */
@@ -1961,7 +2089,12 @@ DropListRef = /** @class */ (function () {
1961
2089
  container: this,
1962
2090
  item: item
1963
2091
  });
1964
- siblings.forEach(function (sibling, index) {
2092
+ siblings.forEach((/**
2093
+ * @param {?} sibling
2094
+ * @param {?} index
2095
+ * @return {?}
2096
+ */
2097
+ function (sibling, index) {
1965
2098
  // Don't do anything if the position hasn't changed.
1966
2099
  if (oldOrder[index] === sibling) {
1967
2100
  return;
@@ -1989,7 +2122,7 @@ DropListRef = /** @class */ (function () {
1989
2122
  elementToOffset.style.transform = "translate3d(0, " + Math.round(sibling.offset) + "px, 0)";
1990
2123
  adjustClientRect(sibling.clientRect, offset, 0);
1991
2124
  }
1992
- });
2125
+ }));
1993
2126
  };
1994
2127
  /** Caches the position of the drop list. */
1995
2128
  /**
@@ -2003,7 +2136,7 @@ DropListRef = /** @class */ (function () {
2003
2136
  * @return {?}
2004
2137
  */
2005
2138
  function () {
2006
- this._clientRect = this.element.getBoundingClientRect();
2139
+ this._clientRect = coercion.coerceElement(this.element).getBoundingClientRect();
2007
2140
  };
2008
2141
  /** Refreshes the position cache of the items and sibling containers. */
2009
2142
  /**
@@ -2020,7 +2153,11 @@ DropListRef = /** @class */ (function () {
2020
2153
  var _this = this;
2021
2154
  /** @type {?} */
2022
2155
  var isHorizontal = this._orientation === 'horizontal';
2023
- this._itemPositions = this._activeDraggables.map(function (drag) {
2156
+ this._itemPositions = this._activeDraggables.map((/**
2157
+ * @param {?} drag
2158
+ * @return {?}
2159
+ */
2160
+ function (drag) {
2024
2161
  /** @type {?} */
2025
2162
  var elementToMeasure = _this._dragDropRegistry.isDragging(drag) ?
2026
2163
  // If the element is being dragged, we have to measure the
@@ -2045,10 +2182,15 @@ DropListRef = /** @class */ (function () {
2045
2182
  height: clientRect.height
2046
2183
  }
2047
2184
  };
2048
- }).sort(function (a, b) {
2185
+ })).sort((/**
2186
+ * @param {?} a
2187
+ * @param {?} b
2188
+ * @return {?}
2189
+ */
2190
+ function (a, b) {
2049
2191
  return isHorizontal ? a.clientRect.left - b.clientRect.left :
2050
2192
  a.clientRect.top - b.clientRect.top;
2051
- });
2193
+ }));
2052
2194
  };
2053
2195
  /** Resets the container to its initial state. */
2054
2196
  /**
@@ -2065,8 +2207,16 @@ DropListRef = /** @class */ (function () {
2065
2207
  var _this = this;
2066
2208
  this._isDragging = false;
2067
2209
  // TODO(crisbeto): may have to wait for the animations to finish.
2068
- this._activeDraggables.forEach(function (item) { return item.getRootElement().style.transform = ''; });
2069
- this._siblings.forEach(function (sibling) { return sibling._stopReceiving(_this); });
2210
+ this._activeDraggables.forEach((/**
2211
+ * @param {?} item
2212
+ * @return {?}
2213
+ */
2214
+ function (item) { return item.getRootElement().style.transform = ''; }));
2215
+ this._siblings.forEach((/**
2216
+ * @param {?} sibling
2217
+ * @return {?}
2218
+ */
2219
+ function (sibling) { return sibling._stopReceiving(_this); }));
2070
2220
  this._activeDraggables = [];
2071
2221
  this._itemPositions = [];
2072
2222
  this._previousSwap.drag = null;
@@ -2213,7 +2363,13 @@ DropListRef = /** @class */ (function () {
2213
2363
  var _this = this;
2214
2364
  /** @type {?} */
2215
2365
  var isHorizontal = this._orientation === 'horizontal';
2216
- return findIndex(this._itemPositions, function (_a, _, array) {
2366
+ return findIndex(this._itemPositions, (/**
2367
+ * @param {?} __0
2368
+ * @param {?} _
2369
+ * @param {?} array
2370
+ * @return {?}
2371
+ */
2372
+ function (_a, _, array) {
2217
2373
  var drag = _a.drag, clientRect = _a.clientRect;
2218
2374
  if (drag === item) {
2219
2375
  // If there's only one item left in the container, it must be
@@ -2234,7 +2390,23 @@ DropListRef = /** @class */ (function () {
2234
2390
  // sub-pixel precision, whereas the pointer coordinates are rounded to pixels.
2235
2391
  pointerX >= Math.floor(clientRect.left) && pointerX <= Math.floor(clientRect.right) :
2236
2392
  pointerY >= Math.floor(clientRect.top) && pointerY <= Math.floor(clientRect.bottom);
2237
- });
2393
+ }));
2394
+ };
2395
+ /** Caches the current items in the list and their positions. */
2396
+ /**
2397
+ * Caches the current items in the list and their positions.
2398
+ * @private
2399
+ * @return {?}
2400
+ */
2401
+ DropListRef.prototype._cacheItems = /**
2402
+ * Caches the current items in the list and their positions.
2403
+ * @private
2404
+ * @return {?}
2405
+ */
2406
+ function () {
2407
+ this._activeDraggables = this._draggables.slice();
2408
+ this._cacheItemPositions();
2409
+ this._cacheOwnPosition();
2238
2410
  };
2239
2411
  /**
2240
2412
  * Checks whether the user's pointer is positioned over the container.
@@ -2280,7 +2452,11 @@ DropListRef = /** @class */ (function () {
2280
2452
  * @return {?}
2281
2453
  */
2282
2454
  function (item, x, y) {
2283
- return this._siblings.find(function (sibling) { return sibling._canReceive(item, x, y); });
2455
+ return this._siblings.find((/**
2456
+ * @param {?} sibling
2457
+ * @return {?}
2458
+ */
2459
+ function (sibling) { return sibling._canReceive(item, x, y); }));
2284
2460
  };
2285
2461
  /**
2286
2462
  * Checks whether the drop list can receive the passed-in item.
@@ -2307,19 +2483,21 @@ DropListRef = /** @class */ (function () {
2307
2483
  return false;
2308
2484
  }
2309
2485
  /** @type {?} */
2310
- var elementFromPoint = this._document.elementFromPoint(x, y);
2486
+ var elementFromPoint = (/** @type {?} */ (this._document.elementFromPoint(x, y)));
2311
2487
  // If there's no element at the pointer position, then
2312
2488
  // the client rect is probably scrolled out of the view.
2313
2489
  if (!elementFromPoint) {
2314
2490
  return false;
2315
2491
  }
2492
+ /** @type {?} */
2493
+ var nativeElement = coercion.coerceElement(this.element);
2316
2494
  // The `ClientRect`, that we're using to find the container over which the user is
2317
2495
  // hovering, doesn't give us any information on whether the element has been scrolled
2318
2496
  // out of the view or whether it's overlapping with other containers. This means that
2319
2497
  // we could end up transferring the item into a container that's invisible or is positioned
2320
2498
  // below another one. We use the result from `elementFromPoint` to get the top-most element
2321
2499
  // at the pointer position and to find whether it's one of the intersecting drop containers.
2322
- return elementFromPoint === this.element || this.element.contains(elementFromPoint);
2500
+ return elementFromPoint === nativeElement || nativeElement.contains(elementFromPoint);
2323
2501
  };
2324
2502
  /**
2325
2503
  * Called by one of the connected drop lists when a dragging sequence has started.
@@ -2405,7 +2583,7 @@ function isInsideClientRect(clientRect, x, y) {
2405
2583
 
2406
2584
  /**
2407
2585
  * @fileoverview added by tsickle
2408
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2586
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2409
2587
  */
2410
2588
  /**
2411
2589
  * Event options that can be used to bind an active, capturing event.
@@ -2458,11 +2636,15 @@ var DragDropRegistry = /** @class */ (function () {
2458
2636
  * Event listener that will prevent the default browser action while the user is dragging.
2459
2637
  * @param event Event whose default action should be prevented.
2460
2638
  */
2461
- this._preventDefaultWhileDragging = function (event) {
2639
+ this._preventDefaultWhileDragging = (/**
2640
+ * @param {?} event
2641
+ * @return {?}
2642
+ */
2643
+ function (event) {
2462
2644
  if (_this._activeDragInstances.size) {
2463
2645
  event.preventDefault();
2464
2646
  }
2465
- };
2647
+ });
2466
2648
  this._document = _document;
2467
2649
  }
2468
2650
  /** Adds a drop container to the registry. */
@@ -2502,11 +2684,14 @@ var DragDropRegistry = /** @class */ (function () {
2502
2684
  // won't preventDefault on a dynamically-added `touchmove` listener.
2503
2685
  // See https://bugs.webkit.org/show_bug.cgi?id=184250.
2504
2686
  if (this._dragInstances.size === 1) {
2505
- this._ngZone.runOutsideAngular(function () {
2687
+ this._ngZone.runOutsideAngular((/**
2688
+ * @return {?}
2689
+ */
2690
+ function () {
2506
2691
  // The event handler has to be explicitly active,
2507
2692
  // because newer browsers make it passive by default.
2508
2693
  _this._document.addEventListener('touchmove', _this._preventDefaultWhileDragging, activeCapturingEventOptions);
2509
- });
2694
+ }));
2510
2695
  }
2511
2696
  };
2512
2697
  /** Removes a drop container from the registry. */
@@ -2573,11 +2758,19 @@ var DragDropRegistry = /** @class */ (function () {
2573
2758
  // use `preventDefault` to prevent the page from scrolling while the user is dragging.
2574
2759
  this._globalListeners
2575
2760
  .set(moveEvent, {
2576
- handler: function (e) { return _this.pointerMove.next((/** @type {?} */ (e))); },
2761
+ handler: (/**
2762
+ * @param {?} e
2763
+ * @return {?}
2764
+ */
2765
+ function (e) { return _this.pointerMove.next((/** @type {?} */ (e))); }),
2577
2766
  options: activeCapturingEventOptions
2578
2767
  })
2579
2768
  .set(upEvent, {
2580
- handler: function (e) { return _this.pointerUp.next((/** @type {?} */ (e))); },
2769
+ handler: (/**
2770
+ * @param {?} e
2771
+ * @return {?}
2772
+ */
2773
+ function (e) { return _this.pointerUp.next((/** @type {?} */ (e))); }),
2581
2774
  options: true
2582
2775
  })
2583
2776
  // Preventing the default action on `mousemove` isn't enough to disable text selection
@@ -2596,11 +2789,19 @@ var DragDropRegistry = /** @class */ (function () {
2596
2789
  options: activeCapturingEventOptions
2597
2790
  });
2598
2791
  }
2599
- this._ngZone.runOutsideAngular(function () {
2600
- _this._globalListeners.forEach(function (config, name) {
2792
+ this._ngZone.runOutsideAngular((/**
2793
+ * @return {?}
2794
+ */
2795
+ function () {
2796
+ _this._globalListeners.forEach((/**
2797
+ * @param {?} config
2798
+ * @param {?} name
2799
+ * @return {?}
2800
+ */
2801
+ function (config, name) {
2601
2802
  _this._document.addEventListener(name, config.handler, config.options);
2602
- });
2603
- });
2803
+ }));
2804
+ }));
2604
2805
  }
2605
2806
  };
2606
2807
  /** Stops dragging a drag item instance. */
@@ -2654,7 +2855,11 @@ var DragDropRegistry = /** @class */ (function () {
2654
2855
  * @return {?}
2655
2856
  */
2656
2857
  function (id) {
2657
- return Array.from(this._dropInstances).find(function (instance) { return instance.id === id; });
2858
+ return Array.from(this._dropInstances).find((/**
2859
+ * @param {?} instance
2860
+ * @return {?}
2861
+ */
2862
+ function (instance) { return instance.id === id; }));
2658
2863
  };
2659
2864
  /**
2660
2865
  * @return {?}
@@ -2664,8 +2869,16 @@ var DragDropRegistry = /** @class */ (function () {
2664
2869
  */
2665
2870
  function () {
2666
2871
  var _this = this;
2667
- this._dragInstances.forEach(function (instance) { return _this.removeDragItem(instance); });
2668
- this._dropInstances.forEach(function (instance) { return _this.removeDropContainer(instance); });
2872
+ this._dragInstances.forEach((/**
2873
+ * @param {?} instance
2874
+ * @return {?}
2875
+ */
2876
+ function (instance) { return _this.removeDragItem(instance); }));
2877
+ this._dropInstances.forEach((/**
2878
+ * @param {?} instance
2879
+ * @return {?}
2880
+ */
2881
+ function (instance) { return _this.removeDropContainer(instance); }));
2669
2882
  this._clearGlobalListeners();
2670
2883
  this.pointerMove.complete();
2671
2884
  this.pointerUp.complete();
@@ -2683,9 +2896,14 @@ var DragDropRegistry = /** @class */ (function () {
2683
2896
  */
2684
2897
  function () {
2685
2898
  var _this = this;
2686
- this._globalListeners.forEach(function (config, name) {
2899
+ this._globalListeners.forEach((/**
2900
+ * @param {?} config
2901
+ * @param {?} name
2902
+ * @return {?}
2903
+ */
2904
+ function (config, name) {
2687
2905
  _this._document.removeEventListener(name, config.handler, config.options);
2688
- });
2906
+ }));
2689
2907
  this._globalListeners.clear();
2690
2908
  };
2691
2909
  DragDropRegistry.decorators = [
@@ -2696,13 +2914,13 @@ var DragDropRegistry = /** @class */ (function () {
2696
2914
  { type: core.NgZone },
2697
2915
  { type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] }
2698
2916
  ]; };
2699
- /** @nocollapse */ DragDropRegistry.ngInjectableDef = core.defineInjectable({ factory: function DragDropRegistry_Factory() { return new DragDropRegistry(core.inject(core.NgZone), core.inject(common.DOCUMENT)); }, token: DragDropRegistry, providedIn: "root" });
2917
+ /** @nocollapse */ DragDropRegistry.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function DragDropRegistry_Factory() { return new DragDropRegistry(core.ɵɵinject(core.NgZone), core.ɵɵinject(common.DOCUMENT)); }, token: DragDropRegistry, providedIn: "root" });
2700
2918
  return DragDropRegistry;
2701
2919
  }());
2702
2920
 
2703
2921
  /**
2704
2922
  * @fileoverview added by tsickle
2705
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2923
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2706
2924
  */
2707
2925
  /**
2708
2926
  * Default configuration to be used when creating a `DragRef`.
@@ -2774,13 +2992,13 @@ var DragDrop = /** @class */ (function () {
2774
2992
  { type: scrolling.ViewportRuler },
2775
2993
  { type: DragDropRegistry }
2776
2994
  ]; };
2777
- /** @nocollapse */ DragDrop.ngInjectableDef = core.defineInjectable({ factory: function DragDrop_Factory() { return new DragDrop(core.inject(common.DOCUMENT), core.inject(core.NgZone), core.inject(scrolling.ViewportRuler), core.inject(DragDropRegistry)); }, token: DragDrop, providedIn: "root" });
2995
+ /** @nocollapse */ DragDrop.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function DragDrop_Factory() { return new DragDrop(core.ɵɵinject(common.DOCUMENT), core.ɵɵinject(core.NgZone), core.ɵɵinject(scrolling.ViewportRuler), core.ɵɵinject(DragDropRegistry)); }, token: DragDrop, providedIn: "root" });
2778
2996
  return DragDrop;
2779
2997
  }());
2780
2998
 
2781
2999
  /**
2782
3000
  * @fileoverview added by tsickle
2783
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3001
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2784
3002
  */
2785
3003
  /**
2786
3004
  * Injection token that is used to provide a CdkDropList instance to CdkDrag.
@@ -2799,12 +3017,12 @@ var CDK_DROP_LIST_CONTAINER = CDK_DROP_LIST;
2799
3017
 
2800
3018
  /**
2801
3019
  * @fileoverview added by tsickle
2802
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3020
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2803
3021
  */
2804
3022
 
2805
3023
  /**
2806
3024
  * @fileoverview added by tsickle
2807
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3025
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2808
3026
  */
2809
3027
  /**
2810
3028
  * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the
@@ -2817,7 +3035,7 @@ var CDK_DRAG_PARENT = new core.InjectionToken('CDK_DRAG_PARENT');
2817
3035
 
2818
3036
  /**
2819
3037
  * @fileoverview added by tsickle
2820
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3038
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2821
3039
  */
2822
3040
  /**
2823
3041
  * Handle that can be used to drag and CdkDrag instance.
@@ -2881,7 +3099,7 @@ var CdkDragHandle = /** @class */ (function () {
2881
3099
 
2882
3100
  /**
2883
3101
  * @fileoverview added by tsickle
2884
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3102
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2885
3103
  */
2886
3104
  /**
2887
3105
  * Element that will be used as a template for the placeholder of a CdkDrag when
@@ -2909,7 +3127,7 @@ var CdkDragPlaceholder = /** @class */ (function () {
2909
3127
 
2910
3128
  /**
2911
3129
  * @fileoverview added by tsickle
2912
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3130
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2913
3131
  */
2914
3132
  /**
2915
3133
  * Element that will be used as a template for the preview
@@ -2937,7 +3155,7 @@ var CdkDragPreview = /** @class */ (function () {
2937
3155
 
2938
3156
  /**
2939
3157
  * @fileoverview added by tsickle
2940
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3158
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2941
3159
  */
2942
3160
  /**
2943
3161
  * Injection token that can be used to configure the behavior of `CdkDrag`.
@@ -3003,23 +3221,64 @@ var CdkDrag = /** @class */ (function () {
3003
3221
  * Emits as the user is dragging the item. Use with caution,
3004
3222
  * because this event will fire for every pixel that the user has dragged.
3005
3223
  */
3006
- this.moved = new rxjs.Observable(function (observer) {
3224
+ this.moved = new rxjs.Observable((/**
3225
+ * @param {?} observer
3226
+ * @return {?}
3227
+ */
3228
+ function (observer) {
3007
3229
  /** @type {?} */
3008
- var subscription = _this._dragRef.moved.pipe(operators.map(function (movedEvent) { return ({
3230
+ var subscription = _this._dragRef.moved.pipe(operators.map((/**
3231
+ * @param {?} movedEvent
3232
+ * @return {?}
3233
+ */
3234
+ function (movedEvent) { return ({
3009
3235
  source: _this,
3010
3236
  pointerPosition: movedEvent.pointerPosition,
3011
3237
  event: movedEvent.event,
3012
- delta: movedEvent.delta
3013
- }); })).subscribe(observer);
3014
- return function () {
3238
+ delta: movedEvent.delta,
3239
+ distance: movedEvent.distance
3240
+ }); }))).subscribe(observer);
3241
+ return (/**
3242
+ * @return {?}
3243
+ */
3244
+ function () {
3015
3245
  subscription.unsubscribe();
3016
- };
3017
- });
3246
+ });
3247
+ }));
3018
3248
  this._dragRef = dragDrop.createDrag(element, config);
3019
3249
  this._dragRef.data = this;
3020
3250
  this._syncInputs(this._dragRef);
3021
3251
  this._handleEvents(this._dragRef);
3022
3252
  }
3253
+ Object.defineProperty(CdkDrag.prototype, "boundaryElementSelector", {
3254
+ /**
3255
+ * Selector that will be used to determine the element to which the draggable's position will
3256
+ * be constrained. Matching starts from the element's parent and goes up the DOM until a matching
3257
+ * element has been found
3258
+ * @deprecated Use `boundaryElement` instead.
3259
+ * @breaking-change 9.0.0
3260
+ */
3261
+ get: /**
3262
+ * Selector that will be used to determine the element to which the draggable's position will
3263
+ * be constrained. Matching starts from the element's parent and goes up the DOM until a matching
3264
+ * element has been found
3265
+ * @deprecated Use `boundaryElement` instead.
3266
+ * \@breaking-change 9.0.0
3267
+ * @return {?}
3268
+ */
3269
+ function () {
3270
+ return typeof this.boundaryElement === 'string' ? this.boundaryElement : (/** @type {?} */ (undefined));
3271
+ },
3272
+ set: /**
3273
+ * @param {?} selector
3274
+ * @return {?}
3275
+ */
3276
+ function (selector) {
3277
+ this.boundaryElement = selector;
3278
+ },
3279
+ enumerable: true,
3280
+ configurable: true
3281
+ });
3023
3282
  Object.defineProperty(CdkDrag.prototype, "disabled", {
3024
3283
  /** Whether starting to drag this element is disabled. */
3025
3284
  get: /**
@@ -3109,33 +3368,60 @@ var CdkDrag = /** @class */ (function () {
3109
3368
  // their original DOM position and then they get transferred to the portal.
3110
3369
  this._ngZone.onStable.asObservable()
3111
3370
  .pipe(operators.take(1), operators.takeUntil(this._destroyed))
3112
- .subscribe(function () {
3371
+ .subscribe((/**
3372
+ * @return {?}
3373
+ */
3374
+ function () {
3113
3375
  _this._updateRootElement();
3114
3376
  // Listen for any newly-added handles.
3115
3377
  _this._handles.changes.pipe(operators.startWith(_this._handles),
3116
3378
  // Sync the new handles with the DragRef.
3117
- operators.tap(function (handles) {
3379
+ operators.tap((/**
3380
+ * @param {?} handles
3381
+ * @return {?}
3382
+ */
3383
+ function (handles) {
3118
3384
  /** @type {?} */
3119
3385
  var childHandleElements = handles
3120
- .filter(function (handle) { return handle._parentDrag === _this; })
3121
- .map(function (handle) { return handle.element; });
3386
+ .filter((/**
3387
+ * @param {?} handle
3388
+ * @return {?}
3389
+ */
3390
+ function (handle) { return handle._parentDrag === _this; }))
3391
+ .map((/**
3392
+ * @param {?} handle
3393
+ * @return {?}
3394
+ */
3395
+ function (handle) { return handle.element; }));
3122
3396
  _this._dragRef.withHandles(childHandleElements);
3123
- }),
3397
+ })),
3124
3398
  // Listen if the state of any of the handles changes.
3125
- operators.switchMap(function (handles) {
3126
- return rxjs.merge.apply(void 0, handles.map(function (item) { return item._stateChanges; }));
3127
- }), operators.takeUntil(_this._destroyed)).subscribe(function (handleInstance) {
3399
+ operators.switchMap((/**
3400
+ * @param {?} handles
3401
+ * @return {?}
3402
+ */
3403
+ function (handles) {
3404
+ return rxjs.merge.apply(void 0, handles.map((/**
3405
+ * @param {?} item
3406
+ * @return {?}
3407
+ */
3408
+ function (item) { return item._stateChanges; })));
3409
+ })), operators.takeUntil(_this._destroyed)).subscribe((/**
3410
+ * @param {?} handleInstance
3411
+ * @return {?}
3412
+ */
3413
+ function (handleInstance) {
3128
3414
  // Enabled/disable the handle that changed in the DragRef.
3129
3415
  /** @type {?} */
3130
3416
  var dragRef = _this._dragRef;
3131
3417
  /** @type {?} */
3132
3418
  var handle = handleInstance.element.nativeElement;
3133
3419
  handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);
3134
- });
3420
+ }));
3135
3421
  if (_this.freeDragPosition) {
3136
3422
  _this._dragRef.setFreeDragPosition(_this.freeDragPosition);
3137
3423
  }
3138
- });
3424
+ }));
3139
3425
  };
3140
3426
  /**
3141
3427
  * @param {?} changes
@@ -3149,7 +3435,7 @@ var CdkDrag = /** @class */ (function () {
3149
3435
  /** @type {?} */
3150
3436
  var rootSelectorChange = changes['rootElementSelector'];
3151
3437
  /** @type {?} */
3152
- var positionChange = changes['positionChange'];
3438
+ var positionChange = changes['freeDragPosition'];
3153
3439
  // We don't have to react to the first change since it's being
3154
3440
  // handled in `ngAfterViewInit` where it needs to be deferred.
3155
3441
  if (rootSelectorChange && !rootSelectorChange.firstChange) {
@@ -3194,21 +3480,32 @@ var CdkDrag = /** @class */ (function () {
3194
3480
  }
3195
3481
  this._dragRef.withRootElement(rootElement || element);
3196
3482
  };
3197
- /** Gets the boundary element, based on the `boundaryElementSelector`. */
3483
+ /** Gets the boundary element, based on the `boundaryElement` value. */
3198
3484
  /**
3199
- * Gets the boundary element, based on the `boundaryElementSelector`.
3485
+ * Gets the boundary element, based on the `boundaryElement` value.
3200
3486
  * @private
3201
3487
  * @return {?}
3202
3488
  */
3203
3489
  CdkDrag.prototype._getBoundaryElement = /**
3204
- * Gets the boundary element, based on the `boundaryElementSelector`.
3490
+ * Gets the boundary element, based on the `boundaryElement` value.
3205
3491
  * @private
3206
3492
  * @return {?}
3207
3493
  */
3208
3494
  function () {
3209
3495
  /** @type {?} */
3210
- var selector = this.boundaryElementSelector;
3211
- return selector ? getClosestMatchingAncestor(this.element.nativeElement, selector) : null;
3496
+ var boundary = this.boundaryElement;
3497
+ if (!boundary) {
3498
+ return null;
3499
+ }
3500
+ if (typeof boundary === 'string') {
3501
+ return getClosestMatchingAncestor(this.element.nativeElement, boundary);
3502
+ }
3503
+ /** @type {?} */
3504
+ var element = coercion.coerceElement(boundary);
3505
+ if (core.isDevMode() && !element.contains(this.element.nativeElement)) {
3506
+ throw Error('Draggable element is not inside of the node passed into cdkDragBoundary.');
3507
+ }
3508
+ return element;
3212
3509
  };
3213
3510
  /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */
3214
3511
  /**
@@ -3225,7 +3522,10 @@ var CdkDrag = /** @class */ (function () {
3225
3522
  */
3226
3523
  function (ref) {
3227
3524
  var _this = this;
3228
- ref.beforeStarted.subscribe(function () {
3525
+ ref.beforeStarted.subscribe((/**
3526
+ * @return {?}
3527
+ */
3528
+ function () {
3229
3529
  if (!ref.isDragging()) {
3230
3530
  /** @type {?} */
3231
3531
  var dir = _this._dir;
@@ -3253,7 +3553,7 @@ var CdkDrag = /** @class */ (function () {
3253
3553
  ref.withDirection(dir.value);
3254
3554
  }
3255
3555
  }
3256
- });
3556
+ }));
3257
3557
  };
3258
3558
  /** Handles the events from the underlying `DragRef`. */
3259
3559
  /**
@@ -3270,43 +3570,67 @@ var CdkDrag = /** @class */ (function () {
3270
3570
  */
3271
3571
  function (ref) {
3272
3572
  var _this = this;
3273
- ref.started.subscribe(function () {
3573
+ ref.started.subscribe((/**
3574
+ * @return {?}
3575
+ */
3576
+ function () {
3274
3577
  _this.started.emit({ source: _this });
3275
3578
  // Since all of these events run outside of change detection,
3276
3579
  // we need to ensure that everything is marked correctly.
3277
3580
  _this._changeDetectorRef.markForCheck();
3278
- });
3279
- ref.released.subscribe(function () {
3581
+ }));
3582
+ ref.released.subscribe((/**
3583
+ * @return {?}
3584
+ */
3585
+ function () {
3280
3586
  _this.released.emit({ source: _this });
3281
- });
3282
- ref.ended.subscribe(function () {
3283
- _this.ended.emit({ source: _this });
3587
+ }));
3588
+ ref.ended.subscribe((/**
3589
+ * @param {?} event
3590
+ * @return {?}
3591
+ */
3592
+ function (event) {
3593
+ _this.ended.emit({ source: _this, distance: event.distance });
3284
3594
  // Since all of these events run outside of change detection,
3285
3595
  // we need to ensure that everything is marked correctly.
3286
3596
  _this._changeDetectorRef.markForCheck();
3287
- });
3288
- ref.entered.subscribe(function (event) {
3597
+ }));
3598
+ ref.entered.subscribe((/**
3599
+ * @param {?} event
3600
+ * @return {?}
3601
+ */
3602
+ function (event) {
3289
3603
  _this.entered.emit({
3290
3604
  container: event.container.data,
3291
- item: _this
3605
+ item: _this,
3606
+ currentIndex: event.currentIndex
3292
3607
  });
3293
- });
3294
- ref.exited.subscribe(function (event) {
3608
+ }));
3609
+ ref.exited.subscribe((/**
3610
+ * @param {?} event
3611
+ * @return {?}
3612
+ */
3613
+ function (event) {
3295
3614
  _this.exited.emit({
3296
3615
  container: event.container.data,
3297
3616
  item: _this
3298
3617
  });
3299
- });
3300
- ref.dropped.subscribe(function (event) {
3618
+ }));
3619
+ ref.dropped.subscribe((/**
3620
+ * @param {?} event
3621
+ * @return {?}
3622
+ */
3623
+ function (event) {
3301
3624
  _this.dropped.emit({
3302
3625
  previousIndex: event.previousIndex,
3303
3626
  currentIndex: event.currentIndex,
3304
3627
  previousContainer: event.previousContainer.data,
3305
3628
  container: event.container.data,
3306
3629
  isPointerOverContainer: event.isPointerOverContainer,
3307
- item: _this
3630
+ item: _this,
3631
+ distance: event.distance
3308
3632
  });
3309
- });
3633
+ }));
3310
3634
  };
3311
3635
  CdkDrag.decorators = [
3312
3636
  { type: core.Directive, args: [{
@@ -3339,7 +3663,7 @@ var CdkDrag = /** @class */ (function () {
3339
3663
  data: [{ type: core.Input, args: ['cdkDragData',] }],
3340
3664
  lockAxis: [{ type: core.Input, args: ['cdkDragLockAxis',] }],
3341
3665
  rootElementSelector: [{ type: core.Input, args: ['cdkDragRootElement',] }],
3342
- boundaryElementSelector: [{ type: core.Input, args: ['cdkDragBoundary',] }],
3666
+ boundaryElement: [{ type: core.Input, args: ['cdkDragBoundary',] }],
3343
3667
  dragStartDelay: [{ type: core.Input, args: ['cdkDragStartDelay',] }],
3344
3668
  freeDragPosition: [{ type: core.Input, args: ['cdkDragFreeDragPosition',] }],
3345
3669
  disabled: [{ type: core.Input, args: ['cdkDragDisabled',] }],
@@ -3376,7 +3700,7 @@ function getClosestMatchingAncestor(element, selector) {
3376
3700
 
3377
3701
  /**
3378
3702
  * @fileoverview added by tsickle
3379
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3703
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3380
3704
  */
3381
3705
  /**
3382
3706
  * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`
@@ -3433,7 +3757,7 @@ var CdkDropListGroup = /** @class */ (function () {
3433
3757
 
3434
3758
  /**
3435
3759
  * @fileoverview added by tsickle
3436
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3760
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3437
3761
  */
3438
3762
  /**
3439
3763
  * Counter used to generate unique ids for drop zones.
@@ -3480,7 +3804,10 @@ var CdkDropList = /** @class */ (function () {
3480
3804
  * Function that is used to determine whether an item
3481
3805
  * is allowed to be moved into a drop container.
3482
3806
  */
3483
- this.enterPredicate = function () { return true; };
3807
+ this.enterPredicate = (/**
3808
+ * @return {?}
3809
+ */
3810
+ function () { return true; });
3484
3811
  /**
3485
3812
  * Emits when the user drops an item inside the container.
3486
3813
  */
@@ -3500,9 +3827,14 @@ var CdkDropList = /** @class */ (function () {
3500
3827
  this.sorted = new core.EventEmitter();
3501
3828
  this._dropListRef = dragDrop.createDropList(element);
3502
3829
  this._dropListRef.data = this;
3503
- this._dropListRef.enterPredicate = function (drag, drop) {
3830
+ this._dropListRef.enterPredicate = (/**
3831
+ * @param {?} drag
3832
+ * @param {?} drop
3833
+ * @return {?}
3834
+ */
3835
+ function (drag, drop) {
3504
3836
  return _this.enterPredicate(drag.data, drop.data);
3505
- };
3837
+ });
3506
3838
  this._syncInputs(this._dropListRef);
3507
3839
  this._handleEvents(this._dropListRef);
3508
3840
  CdkDropList._dropLists.push(this);
@@ -3556,9 +3888,17 @@ var CdkDropList = /** @class */ (function () {
3556
3888
  var _this = this;
3557
3889
  this._draggables.changes
3558
3890
  .pipe(operators.startWith(this._draggables), operators.takeUntil(this._destroyed))
3559
- .subscribe(function (items) {
3560
- _this._dropListRef.withItems(items.map(function (drag) { return drag._dragRef; }));
3561
- });
3891
+ .subscribe((/**
3892
+ * @param {?} items
3893
+ * @return {?}
3894
+ */
3895
+ function (items) {
3896
+ _this._dropListRef.withItems(items.map((/**
3897
+ * @param {?} drag
3898
+ * @return {?}
3899
+ */
3900
+ function (drag) { return drag._dragRef; })));
3901
+ }));
3562
3902
  };
3563
3903
  /**
3564
3904
  * @return {?}
@@ -3769,28 +4109,55 @@ var CdkDropList = /** @class */ (function () {
3769
4109
  if (this._dir) {
3770
4110
  this._dir.change
3771
4111
  .pipe(operators.startWith(this._dir.value), operators.takeUntil(this._destroyed))
3772
- .subscribe(function (value) { return ref.withDirection(value); });
4112
+ .subscribe((/**
4113
+ * @param {?} value
4114
+ * @return {?}
4115
+ */
4116
+ function (value) { return ref.withDirection(value); }));
3773
4117
  }
3774
- ref.beforeStarted.subscribe(function () {
4118
+ ref.beforeStarted.subscribe((/**
4119
+ * @return {?}
4120
+ */
4121
+ function () {
3775
4122
  /** @type {?} */
3776
- var siblings = coercion.coerceArray(_this.connectedTo).map(function (drop) {
4123
+ var siblings = coercion.coerceArray(_this.connectedTo).map((/**
4124
+ * @param {?} drop
4125
+ * @return {?}
4126
+ */
4127
+ function (drop) {
3777
4128
  return typeof drop === 'string' ?
3778
- (/** @type {?} */ (CdkDropList._dropLists.find(function (list) { return list.id === drop; }))) : drop;
3779
- });
4129
+ (/** @type {?} */ (CdkDropList._dropLists.find((/**
4130
+ * @param {?} list
4131
+ * @return {?}
4132
+ */
4133
+ function (list) { return list.id === drop; })))) : drop;
4134
+ }));
3780
4135
  if (_this._group) {
3781
- _this._group._items.forEach(function (drop) {
4136
+ _this._group._items.forEach((/**
4137
+ * @param {?} drop
4138
+ * @return {?}
4139
+ */
4140
+ function (drop) {
3782
4141
  if (siblings.indexOf(drop) === -1) {
3783
4142
  siblings.push(drop);
3784
4143
  }
3785
- });
4144
+ }));
3786
4145
  }
3787
4146
  ref.disabled = _this.disabled;
3788
4147
  ref.lockAxis = _this.lockAxis;
3789
4148
  ref.sortingDisabled = _this.sortingDisabled;
3790
4149
  ref
3791
- .connectedTo(siblings.filter(function (drop) { return drop && drop !== _this; }).map(function (list) { return list._dropListRef; }))
4150
+ .connectedTo(siblings.filter((/**
4151
+ * @param {?} drop
4152
+ * @return {?}
4153
+ */
4154
+ function (drop) { return drop && drop !== _this; })).map((/**
4155
+ * @param {?} list
4156
+ * @return {?}
4157
+ */
4158
+ function (list) { return list._dropListRef; })))
3792
4159
  .withOrientation(_this.orientation);
3793
- });
4160
+ }));
3794
4161
  };
3795
4162
  /** Handles events from the underlying DropListRef. */
3796
4163
  /**
@@ -3807,43 +4174,64 @@ var CdkDropList = /** @class */ (function () {
3807
4174
  */
3808
4175
  function (ref) {
3809
4176
  var _this = this;
3810
- ref.beforeStarted.subscribe(function () {
4177
+ ref.beforeStarted.subscribe((/**
4178
+ * @return {?}
4179
+ */
4180
+ function () {
3811
4181
  _this._changeDetectorRef.markForCheck();
3812
- });
3813
- ref.entered.subscribe(function (event) {
4182
+ }));
4183
+ ref.entered.subscribe((/**
4184
+ * @param {?} event
4185
+ * @return {?}
4186
+ */
4187
+ function (event) {
3814
4188
  _this.entered.emit({
3815
4189
  container: _this,
3816
- item: event.item.data
4190
+ item: event.item.data,
4191
+ currentIndex: event.currentIndex
3817
4192
  });
3818
- });
3819
- ref.exited.subscribe(function (event) {
4193
+ }));
4194
+ ref.exited.subscribe((/**
4195
+ * @param {?} event
4196
+ * @return {?}
4197
+ */
4198
+ function (event) {
3820
4199
  _this.exited.emit({
3821
4200
  container: _this,
3822
4201
  item: event.item.data
3823
4202
  });
3824
4203
  _this._changeDetectorRef.markForCheck();
3825
- });
3826
- ref.sorted.subscribe(function (event) {
4204
+ }));
4205
+ ref.sorted.subscribe((/**
4206
+ * @param {?} event
4207
+ * @return {?}
4208
+ */
4209
+ function (event) {
3827
4210
  _this.sorted.emit({
3828
4211
  previousIndex: event.previousIndex,
3829
4212
  currentIndex: event.currentIndex,
3830
4213
  container: _this,
3831
4214
  item: event.item.data
3832
4215
  });
3833
- });
3834
- ref.dropped.subscribe(function (event) {
4216
+ }));
4217
+ ref.dropped.subscribe((/**
4218
+ * @param {?} event
4219
+ * @return {?}
4220
+ */
4221
+ function (event) {
3835
4222
  _this.dropped.emit({
3836
4223
  previousIndex: event.previousIndex,
3837
4224
  currentIndex: event.currentIndex,
3838
4225
  previousContainer: event.previousContainer.data,
3839
4226
  container: event.container.data,
3840
4227
  item: event.item.data,
3841
- isPointerOverContainer: event.isPointerOverContainer
4228
+ isPointerOverContainer: event.isPointerOverContainer,
4229
+ distance: event.distance
3842
4230
  });
3843
4231
  // Mark for check since all of these events run outside of change
3844
4232
  // detection and we're not guaranteed for something else to have triggered it.
3845
4233
  _this._changeDetectorRef.markForCheck();
3846
- });
4234
+ }));
3847
4235
  };
3848
4236
  /**
3849
4237
  * Keeps track of the drop lists that are currently on the page.
@@ -3876,7 +4264,10 @@ var CdkDropList = /** @class */ (function () {
3876
4264
  { type: CdkDropListGroup, decorators: [{ type: core.Optional }, { type: core.SkipSelf }] }
3877
4265
  ]; };
3878
4266
  CdkDropList.propDecorators = {
3879
- _draggables: [{ type: core.ContentChildren, args: [core.forwardRef(function () { return CdkDrag; }), {
4267
+ _draggables: [{ type: core.ContentChildren, args: [core.forwardRef((/**
4268
+ * @return {?}
4269
+ */
4270
+ function () { return CdkDrag; })), {
3880
4271
  // Explicitly set to false since some of the logic below makes assumptions about it.
3881
4272
  // The `.withItems` call below should be updated if we ever need to switch this to `true`.
3882
4273
  descendants: false
@@ -3899,7 +4290,7 @@ var CdkDropList = /** @class */ (function () {
3899
4290
 
3900
4291
  /**
3901
4292
  * @fileoverview added by tsickle
3902
- * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4293
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3903
4294
  */
3904
4295
  var DragDropModule = /** @class */ (function () {
3905
4296
  function DragDropModule() {