@angular/cdk 10.0.2 → 10.1.3

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 (216) hide show
  1. package/a11y/aria-describer/aria-describer.d.ts +10 -1
  2. package/a11y/index.metadata.json +1 -1
  3. package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
  4. package/a11y/key-manager/list-key-manager.d.ts +6 -0
  5. package/accordion/accordion.d.ts +7 -1
  6. package/accordion/index.d.ts +1 -0
  7. package/accordion/index.metadata.json +1 -1
  8. package/bundles/cdk-a11y.umd.js +514 -410
  9. package/bundles/cdk-a11y.umd.js.map +1 -1
  10. package/bundles/cdk-a11y.umd.min.js +35 -11
  11. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  12. package/bundles/cdk-accordion.umd.js +47 -39
  13. package/bundles/cdk-accordion.umd.js.map +1 -1
  14. package/bundles/cdk-accordion.umd.min.js +10 -2
  15. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  16. package/bundles/cdk-bidi.umd.js +25 -25
  17. package/bundles/cdk-bidi.umd.js.map +1 -1
  18. package/bundles/cdk-bidi.umd.min.js +5 -4
  19. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  20. package/bundles/cdk-clipboard.umd.js +37 -36
  21. package/bundles/cdk-clipboard.umd.js.map +1 -1
  22. package/bundles/cdk-clipboard.umd.min.js +10 -2
  23. package/bundles/cdk-clipboard.umd.min.js.map +1 -1
  24. package/bundles/cdk-coercion.umd.js.map +1 -1
  25. package/bundles/cdk-collections.umd.js +303 -237
  26. package/bundles/cdk-collections.umd.js.map +1 -1
  27. package/bundles/cdk-collections.umd.min.js +3 -9
  28. package/bundles/cdk-collections.umd.min.js.map +1 -1
  29. package/bundles/cdk-drag-drop.umd.js +1059 -927
  30. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  31. package/bundles/cdk-drag-drop.umd.min.js +72 -10
  32. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  33. package/bundles/cdk-keycodes.umd.js.map +1 -1
  34. package/bundles/cdk-layout.umd.js +18 -18
  35. package/bundles/cdk-layout.umd.js.map +1 -1
  36. package/bundles/cdk-layout.umd.min.js +6 -5
  37. package/bundles/cdk-layout.umd.min.js.map +1 -1
  38. package/bundles/cdk-observers.umd.js +34 -34
  39. package/bundles/cdk-observers.umd.js.map +1 -1
  40. package/bundles/cdk-observers.umd.min.js +2 -2
  41. package/bundles/cdk-observers.umd.min.js.map +1 -1
  42. package/bundles/cdk-overlay.umd.js +638 -416
  43. package/bundles/cdk-overlay.umd.js.map +1 -1
  44. package/bundles/cdk-overlay.umd.min.js +51 -12
  45. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  46. package/bundles/cdk-platform.umd.js +10 -10
  47. package/bundles/cdk-platform.umd.js.map +1 -1
  48. package/bundles/cdk-platform.umd.min.js +4 -11
  49. package/bundles/cdk-platform.umd.min.js.map +1 -1
  50. package/bundles/cdk-portal.umd.js +355 -300
  51. package/bundles/cdk-portal.umd.js.map +1 -1
  52. package/bundles/cdk-portal.umd.min.js +4 -5
  53. package/bundles/cdk-portal.umd.min.js.map +1 -1
  54. package/bundles/cdk-scrolling.umd.js +482 -392
  55. package/bundles/cdk-scrolling.umd.js.map +1 -1
  56. package/bundles/cdk-scrolling.umd.min.js +20 -12
  57. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  58. package/bundles/cdk-stepper.umd.js +117 -117
  59. package/bundles/cdk-stepper.umd.js.map +1 -1
  60. package/bundles/cdk-stepper.umd.min.js +11 -2
  61. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  62. package/bundles/cdk-table.umd.js +862 -607
  63. package/bundles/cdk-table.umd.js.map +1 -1
  64. package/bundles/cdk-table.umd.min.js +8 -15
  65. package/bundles/cdk-table.umd.min.js.map +1 -1
  66. package/bundles/cdk-testing-protractor.umd.js +300 -241
  67. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  68. package/bundles/cdk-testing-protractor.umd.min.js +2 -9
  69. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  70. package/bundles/cdk-testing-testbed.umd.js +337 -276
  71. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  72. package/bundles/cdk-testing-testbed.umd.min.js +7 -30
  73. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  74. package/bundles/cdk-testing.umd.js +358 -270
  75. package/bundles/cdk-testing.umd.js.map +1 -1
  76. package/bundles/cdk-testing.umd.min.js +3 -18
  77. package/bundles/cdk-testing.umd.min.js.map +1 -1
  78. package/bundles/cdk-text-field.umd.js +51 -51
  79. package/bundles/cdk-text-field.umd.js.map +1 -1
  80. package/bundles/cdk-text-field.umd.min.js +10 -2
  81. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  82. package/bundles/cdk-tree.umd.js +449 -396
  83. package/bundles/cdk-tree.umd.js.map +1 -1
  84. package/bundles/cdk-tree.umd.min.js +28 -3
  85. package/bundles/cdk-tree.umd.min.js.map +1 -1
  86. package/bundles/cdk.umd.js +1 -1
  87. package/bundles/cdk.umd.js.map +1 -1
  88. package/bundles/cdk.umd.min.js +1 -1
  89. package/bundles/cdk.umd.min.js.map +1 -1
  90. package/drag-drop/clone-node.d.ts +9 -0
  91. package/drag-drop/directives/drag-handle.d.ts +8 -2
  92. package/drag-drop/directives/drag-placeholder.d.ts +7 -1
  93. package/drag-drop/directives/drag-preview.d.ts +7 -1
  94. package/drag-drop/directives/drag.d.ts +3 -7
  95. package/drag-drop/directives/drop-list-group.d.ts +7 -1
  96. package/drag-drop/directives/drop-list.d.ts +7 -1
  97. package/drag-drop/index.d.ts +2 -2
  98. package/drag-drop/index.metadata.json +1 -1
  99. package/drag-drop/parent-position-tracker.d.ts +1 -1
  100. package/esm2015/a11y/aria-describer/aria-describer.js +21 -7
  101. package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
  102. package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
  103. package/esm2015/a11y/interactivity-checker/interactivity-checker.js +43 -30
  104. package/esm2015/a11y/key-manager/list-key-manager.js +27 -2
  105. package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
  106. package/esm2015/accordion/accordion-item.js +7 -7
  107. package/esm2015/accordion/accordion.js +9 -2
  108. package/esm2015/accordion/index.js +2 -1
  109. package/esm2015/clipboard/pending-copy.js +7 -6
  110. package/esm2015/drag-drop/clone-node.js +54 -0
  111. package/esm2015/drag-drop/directives/drag-handle.js +12 -5
  112. package/esm2015/drag-drop/directives/drag-placeholder.js +10 -3
  113. package/esm2015/drag-drop/directives/drag-preview.js +10 -3
  114. package/esm2015/drag-drop/directives/drag.js +19 -15
  115. package/esm2015/drag-drop/directives/drop-list-group.js +9 -2
  116. package/esm2015/drag-drop/directives/drop-list.js +19 -8
  117. package/esm2015/drag-drop/drag-ref.js +2 -29
  118. package/esm2015/drag-drop/index.js +3 -2
  119. package/esm2015/layout/breakpoints-observer.js +1 -1
  120. package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
  121. package/esm2015/overlay/dispatchers/index.js +10 -0
  122. package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
  123. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
  124. package/esm2015/overlay/index.js +5 -4
  125. package/esm2015/overlay/overlay-config.js +5 -1
  126. package/esm2015/overlay/overlay-directives.js +34 -8
  127. package/esm2015/overlay/overlay-module.js +2 -2
  128. package/esm2015/overlay/overlay-ref.js +24 -2
  129. package/esm2015/overlay/overlay-reference.js +1 -1
  130. package/esm2015/overlay/overlay.js +10 -5
  131. package/esm2015/overlay/position/connected-position-strategy.js +1 -5
  132. package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -3
  133. package/esm2015/overlay/position/overlay-position-builder.js +1 -1
  134. package/esm2015/overlay/public-api.js +2 -2
  135. package/esm2015/portal/dom-portal-outlet.js +5 -2
  136. package/esm2015/scrolling/public-api.js +2 -1
  137. package/esm2015/scrolling/scrolling-module.js +4 -1
  138. package/esm2015/scrolling/viewport-ruler.js +24 -10
  139. package/esm2015/scrolling/virtual-for-of.js +26 -12
  140. package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
  141. package/esm2015/scrolling/virtual-scroll-viewport.js +2 -2
  142. package/esm2015/table/cell.js +18 -3
  143. package/esm2015/table/coalesced-style-scheduler.js +87 -0
  144. package/esm2015/table/public-api.js +2 -1
  145. package/esm2015/table/sticky-styler.js +79 -45
  146. package/esm2015/table/table.js +33 -12
  147. package/esm2015/testing/component-harness.js +19 -1
  148. package/esm2015/testing/harness-environment.js +7 -1
  149. package/esm2015/testing/testbed/fake-events/dispatch-events.js +5 -4
  150. package/esm2015/testing/testbed/fake-events/event-objects.js +10 -7
  151. package/esm2015/testing/testbed/fake-events/type-in-element.js +4 -4
  152. package/esm2015/testing/testbed/unit-test-element.js +20 -12
  153. package/esm2015/tree/control/nested-tree-control.js +7 -3
  154. package/esm2015/tree/tree.js +9 -23
  155. package/esm2015/version.js +1 -1
  156. package/fesm2015/a11y.js +88 -38
  157. package/fesm2015/a11y.js.map +1 -1
  158. package/fesm2015/accordion.js +13 -6
  159. package/fesm2015/accordion.js.map +1 -1
  160. package/fesm2015/cdk.js +1 -1
  161. package/fesm2015/cdk.js.map +1 -1
  162. package/fesm2015/clipboard.js +6 -5
  163. package/fesm2015/clipboard.js.map +1 -1
  164. package/fesm2015/drag-drop.js +669 -600
  165. package/fesm2015/drag-drop.js.map +1 -1
  166. package/fesm2015/overlay.js +215 -40
  167. package/fesm2015/overlay.js.map +1 -1
  168. package/fesm2015/portal.js +4 -1
  169. package/fesm2015/portal.js.map +1 -1
  170. package/fesm2015/scrolling.js +60 -21
  171. package/fesm2015/scrolling.js.map +1 -1
  172. package/fesm2015/table.js +214 -61
  173. package/fesm2015/table.js.map +1 -1
  174. package/fesm2015/testing/testbed.js +35 -23
  175. package/fesm2015/testing/testbed.js.map +1 -1
  176. package/fesm2015/testing.js +25 -1
  177. package/fesm2015/testing.js.map +1 -1
  178. package/fesm2015/tree.js +13 -23
  179. package/fesm2015/tree.js.map +1 -1
  180. package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
  181. package/overlay/dispatchers/index.d.ts +9 -0
  182. package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
  183. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
  184. package/overlay/index.d.ts +4 -3
  185. package/overlay/index.metadata.json +1 -1
  186. package/overlay/overlay-config.d.ts +4 -0
  187. package/overlay/overlay-directives.d.ts +5 -0
  188. package/overlay/overlay-ref.d.ts +8 -2
  189. package/overlay/overlay-reference.d.ts +1 -0
  190. package/overlay/overlay.d.ts +4 -2
  191. package/overlay/position/connected-position-strategy.d.ts +0 -2
  192. package/overlay/public-api.d.ts +1 -1
  193. package/package.json +1 -1
  194. package/schematics/ng-add/index.js +1 -1
  195. package/scrolling/index.metadata.json +1 -1
  196. package/scrolling/public-api.d.ts +1 -0
  197. package/scrolling/scrolling-module.d.ts +3 -0
  198. package/scrolling/viewport-ruler.d.ts +2 -2
  199. package/scrolling/virtual-for-of.d.ts +2 -1
  200. package/scrolling/virtual-scroll-repeater.d.ts +16 -0
  201. package/scrolling/virtual-scroll-viewport.d.ts +4 -4
  202. package/table/cell.d.ts +13 -0
  203. package/table/coalesced-style-scheduler.d.ts +41 -0
  204. package/table/index.metadata.json +1 -1
  205. package/table/public-api.d.ts +1 -0
  206. package/table/sticky-styler.d.ts +7 -1
  207. package/table/table.d.ts +9 -1
  208. package/testing/component-harness.d.ts +12 -0
  209. package/testing/harness-environment.d.ts +1 -0
  210. package/testing/testbed/fake-events/dispatch-events.d.ts +3 -2
  211. package/testing/testbed/fake-events/event-objects.d.ts +2 -2
  212. package/testing/testbed/unit-test-element.d.ts +7 -0
  213. package/tree/control/nested-tree-control.d.ts +7 -2
  214. package/tree/index.metadata.json +1 -1
  215. package/tree/tree.d.ts +2 -4
  216. package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +0 -96
@@ -210,6 +210,60 @@
210
210
  return ParentPositionTracker;
211
211
  }());
212
212
 
213
+ /**
214
+ * @license
215
+ * Copyright Google LLC All Rights Reserved.
216
+ *
217
+ * Use of this source code is governed by an MIT-style license that can be
218
+ * found in the LICENSE file at https://angular.io/license
219
+ */
220
+ /** Creates a deep clone of an element. */
221
+ function deepCloneNode(node) {
222
+ var clone = node.cloneNode(true);
223
+ var descendantsWithId = clone.querySelectorAll('[id]');
224
+ var nodeName = node.nodeName.toLowerCase();
225
+ // Remove the `id` to avoid having multiple elements with the same id on the page.
226
+ clone.removeAttribute('id');
227
+ for (var i = 0; i < descendantsWithId.length; i++) {
228
+ descendantsWithId[i].removeAttribute('id');
229
+ }
230
+ if (nodeName === 'canvas') {
231
+ transferCanvasData(node, clone);
232
+ }
233
+ else if (nodeName === 'input' || nodeName === 'select' || nodeName === 'textarea') {
234
+ transferInputData(node, clone);
235
+ }
236
+ transferData('canvas', node, clone, transferCanvasData);
237
+ transferData('input, textarea, select', node, clone, transferInputData);
238
+ return clone;
239
+ }
240
+ /** Matches elements between an element and its clone and allows for their data to be cloned. */
241
+ function transferData(selector, node, clone, callback) {
242
+ var descendantElements = node.querySelectorAll(selector);
243
+ if (descendantElements.length) {
244
+ var cloneElements = clone.querySelectorAll(selector);
245
+ for (var i = 0; i < descendantElements.length; i++) {
246
+ callback(descendantElements[i], cloneElements[i]);
247
+ }
248
+ }
249
+ }
250
+ /** Transfers the data of one input element to another. */
251
+ function transferInputData(source, clone) {
252
+ clone.value = source.value;
253
+ }
254
+ /** Transfers the data of one canvas element to another. */
255
+ function transferCanvasData(source, clone) {
256
+ var context = clone.getContext('2d');
257
+ if (context) {
258
+ // In some cases `drawImage` can throw (e.g. if the canvas size is 0x0).
259
+ // We can't do much about it so just ignore the error.
260
+ try {
261
+ context.drawImage(source, 0, 0);
262
+ }
263
+ catch (_a) { }
264
+ }
265
+ }
266
+
213
267
  /**
214
268
  * @license
215
269
  * Copyright Google LLC All Rights Reserved.
@@ -661,17 +715,17 @@
661
715
  var dropContainer = this._dropContainer;
662
716
  if (dropContainer) {
663
717
  var element = this._rootElement;
664
- var parent_1 = element.parentNode;
718
+ var parent = element.parentNode;
665
719
  var preview = this._preview = this._createPreviewElement();
666
720
  var placeholder = this._placeholder = this._createPlaceholderElement();
667
721
  var anchor = this._anchor = this._anchor || this._document.createComment('');
668
722
  // Insert an anchor node so that we can restore the element's position in the DOM.
669
- parent_1.insertBefore(anchor, element);
723
+ parent.insertBefore(anchor, element);
670
724
  // We move the element out at the end of the body and we make it hidden, because keeping it in
671
725
  // place will throw off the consumer's `:last-child` selectors. We can't remove the element
672
726
  // from the DOM completely, because iOS will stop firing all subsequent events in the chain.
673
727
  element.style.display = 'none';
674
- this._document.body.appendChild(parent_1.replaceChild(placeholder, element));
728
+ this._document.body.appendChild(parent.replaceChild(placeholder, element));
675
729
  getPreviewInsertionPoint(this._document).appendChild(preview);
676
730
  this.started.next({ source: this }); // Emit before notifying the container.
677
731
  dropContainer.start();
@@ -1177,34 +1231,6 @@
1177
1231
  // blur the elements for sub-pixel transforms.
1178
1232
  return "translate3d(" + Math.round(x) + "px, " + Math.round(y) + "px, 0)";
1179
1233
  }
1180
- /** Creates a deep clone of an element. */
1181
- function deepCloneNode(node) {
1182
- var clone = node.cloneNode(true);
1183
- var descendantsWithId = clone.querySelectorAll('[id]');
1184
- var descendantCanvases = node.querySelectorAll('canvas');
1185
- // Remove the `id` to avoid having multiple elements with the same id on the page.
1186
- clone.removeAttribute('id');
1187
- for (var i = 0; i < descendantsWithId.length; i++) {
1188
- descendantsWithId[i].removeAttribute('id');
1189
- }
1190
- // `cloneNode` won't transfer the content of `canvas` elements so we have to do it ourselves.
1191
- // We match up the cloned canvas to their sources using their index in the DOM.
1192
- if (descendantCanvases.length) {
1193
- var cloneCanvases = clone.querySelectorAll('canvas');
1194
- for (var i = 0; i < descendantCanvases.length; i++) {
1195
- var correspondingCloneContext = cloneCanvases[i].getContext('2d');
1196
- if (correspondingCloneContext) {
1197
- // In some cases `drawImage` can throw (e.g. if the canvas size is 0x0).
1198
- // We can't do much about it so just ignore the error.
1199
- try {
1200
- correspondingCloneContext.drawImage(descendantCanvases[i], 0, 0);
1201
- }
1202
- catch (_a) { }
1203
- }
1204
- }
1205
- }
1206
- return clone;
1207
- }
1208
1234
  /** Clamps a value between a minimum and a maximum. */
1209
1235
  function clamp(value, min, max) {
1210
1236
  return Math.max(min, Math.min(max, value));
@@ -1260,232 +1286,305 @@
1260
1286
  target.style.transform = getTransform(sourceRect.left, sourceRect.top);
1261
1287
  }
1262
1288
 
1263
- /*! *****************************************************************************
1264
- Copyright (c) Microsoft Corporation.
1265
-
1266
- Permission to use, copy, modify, and/or distribute this software for any
1267
- purpose with or without fee is hereby granted.
1268
-
1269
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1270
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1271
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1272
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1273
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1274
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1275
- PERFORMANCE OF THIS SOFTWARE.
1276
- ***************************************************************************** */
1277
- /* global Reflect, Promise */
1278
-
1279
- var extendStatics = function(d, b) {
1280
- extendStatics = Object.setPrototypeOf ||
1281
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1282
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
1283
- return extendStatics(d, b);
1284
- };
1285
-
1286
- function __extends(d, b) {
1287
- extendStatics(d, b);
1288
- function __() { this.constructor = d; }
1289
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1290
- }
1291
-
1292
- var __assign = function() {
1293
- __assign = Object.assign || function __assign(t) {
1294
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1295
- s = arguments[i];
1296
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
1297
- }
1298
- return t;
1299
- };
1300
- return __assign.apply(this, arguments);
1301
- };
1302
-
1303
- function __rest(s, e) {
1304
- var t = {};
1305
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1306
- t[p] = s[p];
1307
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1308
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1309
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1310
- t[p[i]] = s[p[i]];
1311
- }
1312
- return t;
1313
- }
1314
-
1315
- function __decorate(decorators, target, key, desc) {
1316
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1317
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1318
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1319
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1320
- }
1321
-
1322
- function __param(paramIndex, decorator) {
1323
- return function (target, key) { decorator(target, key, paramIndex); }
1324
- }
1325
-
1326
- function __metadata(metadataKey, metadataValue) {
1327
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
1328
- }
1329
-
1330
- function __awaiter(thisArg, _arguments, P, generator) {
1331
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1332
- return new (P || (P = Promise))(function (resolve, reject) {
1333
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1334
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1335
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1336
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1337
- });
1338
- }
1339
-
1340
- function __generator(thisArg, body) {
1341
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1342
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1343
- function verb(n) { return function (v) { return step([n, v]); }; }
1344
- function step(op) {
1345
- if (f) throw new TypeError("Generator is already executing.");
1346
- while (_) try {
1347
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1348
- if (y = 0, t) op = [op[0] & 2, t.value];
1349
- switch (op[0]) {
1350
- case 0: case 1: t = op; break;
1351
- case 4: _.label++; return { value: op[1], done: false };
1352
- case 5: _.label++; y = op[1]; op = [0]; continue;
1353
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
1354
- default:
1355
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1356
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1357
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1358
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1359
- if (t[2]) _.ops.pop();
1360
- _.trys.pop(); continue;
1361
- }
1362
- op = body.call(thisArg, _);
1363
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1364
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1365
- }
1366
- }
1367
-
1368
- var __createBinding = Object.create ? (function(o, m, k, k2) {
1369
- if (k2 === undefined) k2 = k;
1370
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1371
- }) : (function(o, m, k, k2) {
1372
- if (k2 === undefined) k2 = k;
1373
- o[k2] = m[k];
1374
- });
1375
-
1376
- function __exportStar(m, exports) {
1377
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
1378
- }
1379
-
1380
- function __values(o) {
1381
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1382
- if (m) return m.call(o);
1383
- if (o && typeof o.length === "number") return {
1384
- next: function () {
1385
- if (o && i >= o.length) o = void 0;
1386
- return { value: o && o[i++], done: !o };
1387
- }
1388
- };
1389
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1390
- }
1391
-
1392
- function __read(o, n) {
1393
- var m = typeof Symbol === "function" && o[Symbol.iterator];
1394
- if (!m) return o;
1395
- var i = m.call(o), r, ar = [], e;
1396
- try {
1397
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
1398
- }
1399
- catch (error) { e = { error: error }; }
1400
- finally {
1401
- try {
1402
- if (r && !r.done && (m = i["return"])) m.call(i);
1403
- }
1404
- finally { if (e) throw e.error; }
1405
- }
1406
- return ar;
1407
- }
1408
-
1409
- function __spread() {
1410
- for (var ar = [], i = 0; i < arguments.length; i++)
1411
- ar = ar.concat(__read(arguments[i]));
1412
- return ar;
1413
- }
1414
-
1415
- function __spreadArrays() {
1416
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
1417
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
1418
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1419
- r[k] = a[j];
1420
- return r;
1421
- };
1422
-
1423
- function __await(v) {
1424
- return this instanceof __await ? (this.v = v, this) : new __await(v);
1425
- }
1426
-
1427
- function __asyncGenerator(thisArg, _arguments, generator) {
1428
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1429
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
1430
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
1431
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
1432
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
1433
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1434
- function fulfill(value) { resume("next", value); }
1435
- function reject(value) { resume("throw", value); }
1436
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
1437
- }
1438
-
1439
- function __asyncDelegator(o) {
1440
- var i, p;
1441
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
1442
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
1443
- }
1444
-
1445
- function __asyncValues(o) {
1446
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1447
- var m = o[Symbol.asyncIterator], i;
1448
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
1449
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
1450
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
1451
- }
1452
-
1453
- function __makeTemplateObject(cooked, raw) {
1454
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
1455
- return cooked;
1456
- };
1457
-
1458
- var __setModuleDefault = Object.create ? (function(o, v) {
1459
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1460
- }) : function(o, v) {
1461
- o["default"] = v;
1462
- };
1463
-
1464
- function __importStar(mod) {
1465
- if (mod && mod.__esModule) return mod;
1466
- var result = {};
1467
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1468
- __setModuleDefault(result, mod);
1469
- return result;
1470
- }
1471
-
1472
- function __importDefault(mod) {
1473
- return (mod && mod.__esModule) ? mod : { default: mod };
1474
- }
1475
-
1476
- function __classPrivateFieldGet(receiver, privateMap) {
1477
- if (!privateMap.has(receiver)) {
1478
- throw new TypeError("attempted to get private field on non-instance");
1479
- }
1480
- return privateMap.get(receiver);
1481
- }
1482
-
1483
- function __classPrivateFieldSet(receiver, privateMap, value) {
1484
- if (!privateMap.has(receiver)) {
1485
- throw new TypeError("attempted to set private field on non-instance");
1486
- }
1487
- privateMap.set(receiver, value);
1488
- return value;
1289
+ /*! *****************************************************************************
1290
+ Copyright (c) Microsoft Corporation.
1291
+
1292
+ Permission to use, copy, modify, and/or distribute this software for any
1293
+ purpose with or without fee is hereby granted.
1294
+
1295
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1296
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1297
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1298
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1299
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1300
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1301
+ PERFORMANCE OF THIS SOFTWARE.
1302
+ ***************************************************************************** */
1303
+ /* global Reflect, Promise */
1304
+ var extendStatics = function (d, b) {
1305
+ extendStatics = Object.setPrototypeOf ||
1306
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1307
+ function (d, b) { for (var p in b)
1308
+ if (b.hasOwnProperty(p))
1309
+ d[p] = b[p]; };
1310
+ return extendStatics(d, b);
1311
+ };
1312
+ function __extends(d, b) {
1313
+ extendStatics(d, b);
1314
+ function __() { this.constructor = d; }
1315
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1316
+ }
1317
+ var __assign = function () {
1318
+ __assign = Object.assign || function __assign(t) {
1319
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
1320
+ s = arguments[i];
1321
+ for (var p in s)
1322
+ if (Object.prototype.hasOwnProperty.call(s, p))
1323
+ t[p] = s[p];
1324
+ }
1325
+ return t;
1326
+ };
1327
+ return __assign.apply(this, arguments);
1328
+ };
1329
+ function __rest(s, e) {
1330
+ var t = {};
1331
+ for (var p in s)
1332
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1333
+ t[p] = s[p];
1334
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1335
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1336
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1337
+ t[p[i]] = s[p[i]];
1338
+ }
1339
+ return t;
1340
+ }
1341
+ function __decorate(decorators, target, key, desc) {
1342
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1343
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1344
+ r = Reflect.decorate(decorators, target, key, desc);
1345
+ else
1346
+ for (var i = decorators.length - 1; i >= 0; i--)
1347
+ if (d = decorators[i])
1348
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1349
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1350
+ }
1351
+ function __param(paramIndex, decorator) {
1352
+ return function (target, key) { decorator(target, key, paramIndex); };
1353
+ }
1354
+ function __metadata(metadataKey, metadataValue) {
1355
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1356
+ return Reflect.metadata(metadataKey, metadataValue);
1357
+ }
1358
+ function __awaiter(thisArg, _arguments, P, generator) {
1359
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1360
+ return new (P || (P = Promise))(function (resolve, reject) {
1361
+ function fulfilled(value) { try {
1362
+ step(generator.next(value));
1363
+ }
1364
+ catch (e) {
1365
+ reject(e);
1366
+ } }
1367
+ function rejected(value) { try {
1368
+ step(generator["throw"](value));
1369
+ }
1370
+ catch (e) {
1371
+ reject(e);
1372
+ } }
1373
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1374
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1375
+ });
1376
+ }
1377
+ function __generator(thisArg, body) {
1378
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
1379
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1380
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
1381
+ function verb(n) { return function (v) { return step([n, v]); }; }
1382
+ function step(op) {
1383
+ if (f)
1384
+ throw new TypeError("Generator is already executing.");
1385
+ while (_)
1386
+ try {
1387
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
1388
+ return t;
1389
+ if (y = 0, t)
1390
+ op = [op[0] & 2, t.value];
1391
+ switch (op[0]) {
1392
+ case 0:
1393
+ case 1:
1394
+ t = op;
1395
+ break;
1396
+ case 4:
1397
+ _.label++;
1398
+ return { value: op[1], done: false };
1399
+ case 5:
1400
+ _.label++;
1401
+ y = op[1];
1402
+ op = [0];
1403
+ continue;
1404
+ case 7:
1405
+ op = _.ops.pop();
1406
+ _.trys.pop();
1407
+ continue;
1408
+ default:
1409
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
1410
+ _ = 0;
1411
+ continue;
1412
+ }
1413
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
1414
+ _.label = op[1];
1415
+ break;
1416
+ }
1417
+ if (op[0] === 6 && _.label < t[1]) {
1418
+ _.label = t[1];
1419
+ t = op;
1420
+ break;
1421
+ }
1422
+ if (t && _.label < t[2]) {
1423
+ _.label = t[2];
1424
+ _.ops.push(op);
1425
+ break;
1426
+ }
1427
+ if (t[2])
1428
+ _.ops.pop();
1429
+ _.trys.pop();
1430
+ continue;
1431
+ }
1432
+ op = body.call(thisArg, _);
1433
+ }
1434
+ catch (e) {
1435
+ op = [6, e];
1436
+ y = 0;
1437
+ }
1438
+ finally {
1439
+ f = t = 0;
1440
+ }
1441
+ if (op[0] & 5)
1442
+ throw op[1];
1443
+ return { value: op[0] ? op[1] : void 0, done: true };
1444
+ }
1445
+ }
1446
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
1447
+ if (k2 === undefined)
1448
+ k2 = k;
1449
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
1450
+ }) : (function (o, m, k, k2) {
1451
+ if (k2 === undefined)
1452
+ k2 = k;
1453
+ o[k2] = m[k];
1454
+ });
1455
+ function __exportStar(m, exports) {
1456
+ for (var p in m)
1457
+ if (p !== "default" && !exports.hasOwnProperty(p))
1458
+ __createBinding(exports, m, p);
1459
+ }
1460
+ function __values(o) {
1461
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1462
+ if (m)
1463
+ return m.call(o);
1464
+ if (o && typeof o.length === "number")
1465
+ return {
1466
+ next: function () {
1467
+ if (o && i >= o.length)
1468
+ o = void 0;
1469
+ return { value: o && o[i++], done: !o };
1470
+ }
1471
+ };
1472
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1473
+ }
1474
+ function __read(o, n) {
1475
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
1476
+ if (!m)
1477
+ return o;
1478
+ var i = m.call(o), r, ar = [], e;
1479
+ try {
1480
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
1481
+ ar.push(r.value);
1482
+ }
1483
+ catch (error) {
1484
+ e = { error: error };
1485
+ }
1486
+ finally {
1487
+ try {
1488
+ if (r && !r.done && (m = i["return"]))
1489
+ m.call(i);
1490
+ }
1491
+ finally {
1492
+ if (e)
1493
+ throw e.error;
1494
+ }
1495
+ }
1496
+ return ar;
1497
+ }
1498
+ function __spread() {
1499
+ for (var ar = [], i = 0; i < arguments.length; i++)
1500
+ ar = ar.concat(__read(arguments[i]));
1501
+ return ar;
1502
+ }
1503
+ function __spreadArrays() {
1504
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
1505
+ s += arguments[i].length;
1506
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
1507
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1508
+ r[k] = a[j];
1509
+ return r;
1510
+ }
1511
+ ;
1512
+ function __await(v) {
1513
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
1514
+ }
1515
+ function __asyncGenerator(thisArg, _arguments, generator) {
1516
+ if (!Symbol.asyncIterator)
1517
+ throw new TypeError("Symbol.asyncIterator is not defined.");
1518
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
1519
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
1520
+ function verb(n) { if (g[n])
1521
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
1522
+ function resume(n, v) { try {
1523
+ step(g[n](v));
1524
+ }
1525
+ catch (e) {
1526
+ settle(q[0][3], e);
1527
+ } }
1528
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1529
+ function fulfill(value) { resume("next", value); }
1530
+ function reject(value) { resume("throw", value); }
1531
+ function settle(f, v) { if (f(v), q.shift(), q.length)
1532
+ resume(q[0][0], q[0][1]); }
1533
+ }
1534
+ function __asyncDelegator(o) {
1535
+ var i, p;
1536
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
1537
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
1538
+ }
1539
+ function __asyncValues(o) {
1540
+ if (!Symbol.asyncIterator)
1541
+ throw new TypeError("Symbol.asyncIterator is not defined.");
1542
+ var m = o[Symbol.asyncIterator], i;
1543
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
1544
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
1545
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
1546
+ }
1547
+ function __makeTemplateObject(cooked, raw) {
1548
+ if (Object.defineProperty) {
1549
+ Object.defineProperty(cooked, "raw", { value: raw });
1550
+ }
1551
+ else {
1552
+ cooked.raw = raw;
1553
+ }
1554
+ return cooked;
1555
+ }
1556
+ ;
1557
+ var __setModuleDefault = Object.create ? (function (o, v) {
1558
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1559
+ }) : function (o, v) {
1560
+ o["default"] = v;
1561
+ };
1562
+ function __importStar(mod) {
1563
+ if (mod && mod.__esModule)
1564
+ return mod;
1565
+ var result = {};
1566
+ if (mod != null)
1567
+ for (var k in mod)
1568
+ if (Object.hasOwnProperty.call(mod, k))
1569
+ __createBinding(result, mod, k);
1570
+ __setModuleDefault(result, mod);
1571
+ return result;
1572
+ }
1573
+ function __importDefault(mod) {
1574
+ return (mod && mod.__esModule) ? mod : { default: mod };
1575
+ }
1576
+ function __classPrivateFieldGet(receiver, privateMap) {
1577
+ if (!privateMap.has(receiver)) {
1578
+ throw new TypeError("attempted to get private field on non-instance");
1579
+ }
1580
+ return privateMap.get(receiver);
1581
+ }
1582
+ function __classPrivateFieldSet(receiver, privateMap, value) {
1583
+ if (!privateMap.has(receiver)) {
1584
+ throw new TypeError("attempted to set private field on non-instance");
1585
+ }
1586
+ privateMap.set(receiver, value);
1587
+ return value;
1489
1588
  }
1490
1589
 
1491
1590
  /**
@@ -1548,13 +1647,6 @@
1548
1647
  return Math.max(0, Math.min(max, value));
1549
1648
  }
1550
1649
 
1551
- /**
1552
- * @license
1553
- * Copyright Google LLC All Rights Reserved.
1554
- *
1555
- * Use of this source code is governed by an MIT-style license that can be
1556
- * found in the LICENSE file at https://angular.io/license
1557
- */
1558
1650
  /**
1559
1651
  * Proximity, as a ratio to width/height, at which a
1560
1652
  * dragged item will affect the drop container.
@@ -2543,16 +2635,16 @@
2543
2635
  });
2544
2636
  this._globalListeners.clear();
2545
2637
  };
2546
- DragDropRegistry.ɵprov = i0.ɵɵdefineInjectable({ factory: function DragDropRegistry_Factory() { return new DragDropRegistry(i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i1.DOCUMENT)); }, token: DragDropRegistry, providedIn: "root" });
2547
- DragDropRegistry.decorators = [
2548
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2549
- ];
2550
- DragDropRegistry.ctorParameters = function () { return [
2551
- { type: i0.NgZone },
2552
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }
2553
- ]; };
2554
2638
  return DragDropRegistry;
2555
2639
  }());
2640
+ DragDropRegistry.ɵprov = i0.ɵɵdefineInjectable({ factory: function DragDropRegistry_Factory() { return new DragDropRegistry(i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i1.DOCUMENT)); }, token: DragDropRegistry, providedIn: "root" });
2641
+ DragDropRegistry.decorators = [
2642
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2643
+ ];
2644
+ DragDropRegistry.ctorParameters = function () { return [
2645
+ { type: i0.NgZone },
2646
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }
2647
+ ]; };
2556
2648
 
2557
2649
  /**
2558
2650
  * @license
@@ -2592,18 +2684,18 @@
2592
2684
  DragDrop.prototype.createDropList = function (element) {
2593
2685
  return new DropListRef(element, this._dragDropRegistry, this._document, this._ngZone, this._viewportRuler);
2594
2686
  };
2595
- DragDrop.ɵprov = i0.ɵɵdefineInjectable({ factory: function DragDrop_Factory() { return new DragDrop(i0.ɵɵinject(i1.DOCUMENT), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i2.ViewportRuler), i0.ɵɵinject(DragDropRegistry)); }, token: DragDrop, providedIn: "root" });
2596
- DragDrop.decorators = [
2597
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2598
- ];
2599
- DragDrop.ctorParameters = function () { return [
2600
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] },
2601
- { type: i0.NgZone },
2602
- { type: i2.ViewportRuler },
2603
- { type: DragDropRegistry }
2604
- ]; };
2605
2687
  return DragDrop;
2606
2688
  }());
2689
+ DragDrop.ɵprov = i0.ɵɵdefineInjectable({ factory: function DragDrop_Factory() { return new DragDrop(i0.ɵɵinject(i1.DOCUMENT), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i2.ViewportRuler), i0.ɵɵinject(DragDropRegistry)); }, token: DragDrop, providedIn: "root" });
2690
+ DragDrop.decorators = [
2691
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2692
+ ];
2693
+ DragDrop.ctorParameters = function () { return [
2694
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] },
2695
+ { type: i0.NgZone },
2696
+ { type: i2.ViewportRuler },
2697
+ { type: DragDropRegistry }
2698
+ ]; };
2607
2699
 
2608
2700
  /**
2609
2701
  * @license
@@ -2621,127 +2713,47 @@
2621
2713
  * found in the LICENSE file at https://angular.io/license
2622
2714
  */
2623
2715
  /**
2624
- * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the
2625
- * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily
2626
- * to avoid circular imports.
2627
- * @docs-private
2716
+ * Injection token that can be used to reference instances of `CdkDropListGroup`. It serves as
2717
+ * alternative token to the actual `CdkDropListGroup` class which could cause unnecessary
2718
+ * retention of the class and its directive metadata.
2628
2719
  */
2629
- var CDK_DRAG_PARENT = new i0.InjectionToken('CDK_DRAG_PARENT');
2630
-
2720
+ var CDK_DROP_LIST_GROUP = new i0.InjectionToken('CdkDropListGroup');
2631
2721
  /**
2632
- * @license
2633
- * Copyright Google LLC All Rights Reserved.
2634
- *
2635
- * Use of this source code is governed by an MIT-style license that can be
2636
- * found in the LICENSE file at https://angular.io/license
2722
+ * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`
2723
+ * elements that are placed inside a `cdkDropListGroup` will be connected to each other
2724
+ * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input
2725
+ * from `cdkDropList`.
2637
2726
  */
2638
- /** Handle that can be used to drag and CdkDrag instance. */
2639
- var CdkDragHandle = /** @class */ (function () {
2640
- function CdkDragHandle(element, parentDrag) {
2641
- this.element = element;
2642
- /** Emits when the state of the handle has changed. */
2643
- this._stateChanges = new rxjs.Subject();
2727
+ var CdkDropListGroup = /** @class */ (function () {
2728
+ function CdkDropListGroup() {
2729
+ /** Drop lists registered inside the group. */
2730
+ this._items = new Set();
2644
2731
  this._disabled = false;
2645
- this._parentDrag = parentDrag;
2646
- toggleNativeDragInteractions(element.nativeElement, false);
2647
2732
  }
2648
- Object.defineProperty(CdkDragHandle.prototype, "disabled", {
2649
- /** Whether starting to drag through this handle is disabled. */
2733
+ Object.defineProperty(CdkDropListGroup.prototype, "disabled", {
2734
+ /** Whether starting a dragging sequence from inside this group is disabled. */
2650
2735
  get: function () { return this._disabled; },
2651
2736
  set: function (value) {
2652
2737
  this._disabled = coercion.coerceBooleanProperty(value);
2653
- this._stateChanges.next(this);
2654
2738
  },
2655
2739
  enumerable: false,
2656
2740
  configurable: true
2657
2741
  });
2658
- CdkDragHandle.prototype.ngOnDestroy = function () {
2659
- this._stateChanges.complete();
2660
- };
2661
- CdkDragHandle.decorators = [
2662
- { type: i0.Directive, args: [{
2663
- selector: '[cdkDragHandle]',
2664
- host: {
2665
- 'class': 'cdk-drag-handle'
2666
- }
2667
- },] }
2668
- ];
2669
- CdkDragHandle.ctorParameters = function () { return [
2670
- { type: i0.ElementRef },
2671
- { type: undefined, decorators: [{ type: i0.Inject, args: [CDK_DRAG_PARENT,] }, { type: i0.Optional }] }
2672
- ]; };
2673
- CdkDragHandle.propDecorators = {
2674
- disabled: [{ type: i0.Input, args: ['cdkDragHandleDisabled',] }]
2675
- };
2676
- return CdkDragHandle;
2677
- }());
2678
-
2679
- /**
2680
- * @license
2681
- * Copyright Google LLC All Rights Reserved.
2682
- *
2683
- * Use of this source code is governed by an MIT-style license that can be
2684
- * found in the LICENSE file at https://angular.io/license
2685
- */
2686
- /**
2687
- * Element that will be used as a template for the placeholder of a CdkDrag when
2688
- * it is being dragged. The placeholder is displayed in place of the element being dragged.
2689
- */
2690
- var CdkDragPlaceholder = /** @class */ (function () {
2691
- function CdkDragPlaceholder(templateRef) {
2692
- this.templateRef = templateRef;
2693
- }
2694
- CdkDragPlaceholder.decorators = [
2695
- { type: i0.Directive, args: [{
2696
- selector: 'ng-template[cdkDragPlaceholder]'
2697
- },] }
2698
- ];
2699
- CdkDragPlaceholder.ctorParameters = function () { return [
2700
- { type: i0.TemplateRef }
2701
- ]; };
2702
- CdkDragPlaceholder.propDecorators = {
2703
- data: [{ type: i0.Input }]
2704
- };
2705
- return CdkDragPlaceholder;
2706
- }());
2707
-
2708
- /**
2709
- * @license
2710
- * Copyright Google LLC All Rights Reserved.
2711
- *
2712
- * Use of this source code is governed by an MIT-style license that can be
2713
- * found in the LICENSE file at https://angular.io/license
2714
- */
2715
- /**
2716
- * Element that will be used as a template for the preview
2717
- * of a CdkDrag when it is being dragged.
2718
- */
2719
- var CdkDragPreview = /** @class */ (function () {
2720
- function CdkDragPreview(templateRef) {
2721
- this.templateRef = templateRef;
2722
- this._matchSize = false;
2723
- }
2724
- Object.defineProperty(CdkDragPreview.prototype, "matchSize", {
2725
- /** Whether the preview should preserve the same size as the item that is being dragged. */
2726
- get: function () { return this._matchSize; },
2727
- set: function (value) { this._matchSize = coercion.coerceBooleanProperty(value); },
2728
- enumerable: false,
2729
- configurable: true
2730
- });
2731
- CdkDragPreview.decorators = [
2732
- { type: i0.Directive, args: [{
2733
- selector: 'ng-template[cdkDragPreview]'
2734
- },] }
2735
- ];
2736
- CdkDragPreview.ctorParameters = function () { return [
2737
- { type: i0.TemplateRef }
2738
- ]; };
2739
- CdkDragPreview.propDecorators = {
2740
- data: [{ type: i0.Input }],
2741
- matchSize: [{ type: i0.Input }]
2742
+ CdkDropListGroup.prototype.ngOnDestroy = function () {
2743
+ this._items.clear();
2742
2744
  };
2743
- return CdkDragPreview;
2745
+ return CdkDropListGroup;
2744
2746
  }());
2747
+ CdkDropListGroup.decorators = [
2748
+ { type: i0.Directive, args: [{
2749
+ selector: '[cdkDropListGroup]',
2750
+ exportAs: 'cdkDropListGroup',
2751
+ providers: [{ provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup }],
2752
+ },] }
2753
+ ];
2754
+ CdkDropListGroup.propDecorators = {
2755
+ disabled: [{ type: i0.Input, args: ['cdkDropListGroupDisabled',] }]
2756
+ };
2745
2757
 
2746
2758
  /**
2747
2759
  * @license
@@ -2763,258 +2775,211 @@
2763
2775
  * Use of this source code is governed by an MIT-style license that can be
2764
2776
  * found in the LICENSE file at https://angular.io/license
2765
2777
  */
2778
+ /** Counter used to generate unique ids for drop zones. */
2779
+ var _uniqueIdCounter = 0;
2766
2780
  /**
2767
- * Injection token that is used to provide a CdkDropList instance to CdkDrag.
2768
- * Used for avoiding circular imports.
2781
+ * Injection token that can be used to reference instances of `CdkDropList`. It serves as
2782
+ * alternative token to the actual `CdkDropList` class which could cause unnecessary
2783
+ * retention of the class and its directive metadata.
2769
2784
  */
2770
- var CDK_DROP_LIST = new i0.InjectionToken('CDK_DROP_LIST');
2771
- /** Element that can be moved inside a CdkDropList container. */
2772
- var CdkDrag = /** @class */ (function () {
2773
- function CdkDrag(
2774
- /** Element that the draggable is attached to. */
2775
- element,
2776
- /** Droppable container that the draggable is a part of. */
2777
- dropContainer, _document, _ngZone, _viewContainerRef, config, _dir, dragDrop, _changeDetectorRef) {
2785
+ var CDK_DROP_LIST = new i0.InjectionToken('CdkDropList');
2786
+ var ɵ0 = undefined;
2787
+ /** Container that wraps a set of draggable items. */
2788
+ var CdkDropList = /** @class */ (function () {
2789
+ function CdkDropList(
2790
+ /** Element that the drop list is attached to. */
2791
+ element, dragDrop, _changeDetectorRef, _dir, _group,
2792
+ /**
2793
+ * @deprecated _scrollDispatcher parameter to become required.
2794
+ * @breaking-change 11.0.0
2795
+ */
2796
+ _scrollDispatcher, config) {
2778
2797
  var _this = this;
2779
2798
  this.element = element;
2780
- this.dropContainer = dropContainer;
2781
- this._document = _document;
2782
- this._ngZone = _ngZone;
2783
- this._viewContainerRef = _viewContainerRef;
2784
- this._dir = _dir;
2785
2799
  this._changeDetectorRef = _changeDetectorRef;
2800
+ this._dir = _dir;
2801
+ this._group = _group;
2802
+ this._scrollDispatcher = _scrollDispatcher;
2803
+ /** Emits when the list has been destroyed. */
2786
2804
  this._destroyed = new rxjs.Subject();
2787
- /** Emits when the user starts dragging the item. */
2788
- this.started = new i0.EventEmitter();
2789
- /** Emits when the user has released a drag item, before any animations have started. */
2790
- this.released = new i0.EventEmitter();
2791
- /** Emits when the user stops dragging an item in the container. */
2792
- this.ended = new i0.EventEmitter();
2793
- /** Emits when the user has moved the item into a new container. */
2794
- this.entered = new i0.EventEmitter();
2795
- /** Emits when the user removes the item its container by dragging it into another container. */
2796
- this.exited = new i0.EventEmitter();
2797
- /** Emits when the user drops the item inside a container. */
2805
+ /**
2806
+ * Other draggable containers that this container is connected to and into which the
2807
+ * container's items can be transferred. Can either be references to other drop containers,
2808
+ * or their unique IDs.
2809
+ */
2810
+ this.connectedTo = [];
2811
+ /**
2812
+ * Unique ID for the drop zone. Can be used as a reference
2813
+ * in the `connectedTo` of another `CdkDropList`.
2814
+ */
2815
+ this.id = "cdk-drop-list-" + _uniqueIdCounter++;
2816
+ /**
2817
+ * Function that is used to determine whether an item
2818
+ * is allowed to be moved into a drop container.
2819
+ */
2820
+ this.enterPredicate = function () { return true; };
2821
+ /** Emits when the user drops an item inside the container. */
2798
2822
  this.dropped = new i0.EventEmitter();
2799
2823
  /**
2800
- * Emits as the user is dragging the item. Use with caution,
2801
- * because this event will fire for every pixel that the user has dragged.
2824
+ * Emits when the user has moved a new drag item into this container.
2802
2825
  */
2803
- this.moved = new rxjs.Observable(function (observer) {
2804
- var subscription = _this._dragRef.moved.pipe(operators.map(function (movedEvent) { return ({
2805
- source: _this,
2806
- pointerPosition: movedEvent.pointerPosition,
2807
- event: movedEvent.event,
2808
- delta: movedEvent.delta,
2809
- distance: movedEvent.distance
2810
- }); })).subscribe(observer);
2811
- return function () {
2812
- subscription.unsubscribe();
2813
- };
2814
- });
2815
- this._dragRef = dragDrop.createDrag(element, {
2816
- dragStartThreshold: config && config.dragStartThreshold != null ?
2817
- config.dragStartThreshold : 5,
2818
- pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null ?
2819
- config.pointerDirectionChangeThreshold : 5,
2820
- zIndex: config === null || config === void 0 ? void 0 : config.zIndex
2821
- });
2822
- this._dragRef.data = this;
2826
+ this.entered = new i0.EventEmitter();
2827
+ /**
2828
+ * Emits when the user removes an item from the container
2829
+ * by dragging it into another container.
2830
+ */
2831
+ this.exited = new i0.EventEmitter();
2832
+ /** Emits as the user is swapping items while actively dragging. */
2833
+ this.sorted = new i0.EventEmitter();
2834
+ /**
2835
+ * Keeps track of the items that are registered with this container. Historically we used to
2836
+ * do this with a `ContentChildren` query, however queries don't handle transplanted views very
2837
+ * well which means that we can't handle cases like dragging the headers of a `mat-table`
2838
+ * correctly. What we do instead is to have the items register themselves with the container
2839
+ * and then we sort them based on their position in the DOM.
2840
+ */
2841
+ this._unsortedItems = new Set();
2842
+ this._dropListRef = dragDrop.createDropList(element);
2843
+ this._dropListRef.data = this;
2823
2844
  if (config) {
2824
2845
  this._assignDefaults(config);
2825
2846
  }
2826
- // Note that usually the container is assigned when the drop list is picks up the item, but in
2827
- // some cases (mainly transplanted views with OnPush, see #18341) we may end up in a situation
2828
- // where there are no items on the first change detection pass, but the items get picked up as
2829
- // soon as the user triggers another pass by dragging. This is a problem, because the item would
2830
- // have to switch from standalone mode to drag mode in the middle of the dragging sequence which
2831
- // is too late since the two modes save different kinds of information. We work around it by
2832
- // assigning the drop container both from here and the list.
2833
- if (dropContainer) {
2834
- this._dragRef._withDropContainer(dropContainer._dropListRef);
2835
- dropContainer.addItem(this);
2847
+ this._dropListRef.enterPredicate = function (drag, drop) {
2848
+ return _this.enterPredicate(drag.data, drop.data);
2849
+ };
2850
+ this._setupInputSyncSubscription(this._dropListRef);
2851
+ this._handleEvents(this._dropListRef);
2852
+ CdkDropList._dropLists.push(this);
2853
+ if (_group) {
2854
+ _group._items.add(this);
2836
2855
  }
2837
- this._syncInputs(this._dragRef);
2838
- this._handleEvents(this._dragRef);
2839
2856
  }
2840
- Object.defineProperty(CdkDrag.prototype, "disabled", {
2841
- /** Whether starting to drag this element is disabled. */
2857
+ Object.defineProperty(CdkDropList.prototype, "disabled", {
2858
+ /** Whether starting a dragging sequence from this container is disabled. */
2842
2859
  get: function () {
2843
- return this._disabled || (this.dropContainer && this.dropContainer.disabled);
2860
+ return this._disabled || (!!this._group && this._group.disabled);
2844
2861
  },
2845
2862
  set: function (value) {
2846
- this._disabled = coercion.coerceBooleanProperty(value);
2847
- this._dragRef.disabled = this._disabled;
2863
+ // Usually we sync the directive and ref state right before dragging starts, in order to have
2864
+ // a single point of failure and to avoid having to use setters for everything. `disabled` is
2865
+ // a special case, because it can prevent the `beforeStarted` event from firing, which can lock
2866
+ // the user in a disabled state, so we also need to sync it as it's being set.
2867
+ this._dropListRef.disabled = this._disabled = coercion.coerceBooleanProperty(value);
2848
2868
  },
2849
2869
  enumerable: false,
2850
2870
  configurable: true
2851
2871
  });
2852
- /**
2853
- * Returns the element that is being used as a placeholder
2854
- * while the current element is being dragged.
2855
- */
2856
- CdkDrag.prototype.getPlaceholderElement = function () {
2857
- return this._dragRef.getPlaceholderElement();
2858
- };
2859
- /** Returns the root draggable element. */
2860
- CdkDrag.prototype.getRootElement = function () {
2861
- return this._dragRef.getRootElement();
2862
- };
2863
- /** Resets a standalone drag item to its initial position. */
2864
- CdkDrag.prototype.reset = function () {
2865
- this._dragRef.reset();
2872
+ /** Registers an items with the drop list. */
2873
+ CdkDropList.prototype.addItem = function (item) {
2874
+ this._unsortedItems.add(item);
2875
+ if (this._dropListRef.isDragging()) {
2876
+ this._syncItemsWithRef();
2877
+ }
2866
2878
  };
2867
- /**
2868
- * Gets the pixel coordinates of the draggable outside of a drop container.
2869
- */
2870
- CdkDrag.prototype.getFreeDragPosition = function () {
2871
- return this._dragRef.getFreeDragPosition();
2879
+ /** Removes an item from the drop list. */
2880
+ CdkDropList.prototype.removeItem = function (item) {
2881
+ this._unsortedItems.delete(item);
2882
+ if (this._dropListRef.isDragging()) {
2883
+ this._syncItemsWithRef();
2884
+ }
2872
2885
  };
2873
- CdkDrag.prototype.ngAfterViewInit = function () {
2874
- var _this = this;
2875
- // We need to wait for the zone to stabilize, in order for the reference
2876
- // element to be in the proper place in the DOM. This is mostly relevant
2877
- // for draggable elements inside portals since they get stamped out in
2878
- // their original DOM position and then they get transferred to the portal.
2879
- this._ngZone.onStable.asObservable()
2880
- .pipe(operators.take(1), operators.takeUntil(this._destroyed))
2881
- .subscribe(function () {
2882
- _this._updateRootElement();
2883
- // Listen for any newly-added handles.
2884
- _this._handles.changes.pipe(operators.startWith(_this._handles),
2885
- // Sync the new handles with the DragRef.
2886
- operators.tap(function (handles) {
2887
- var childHandleElements = handles
2888
- .filter(function (handle) { return handle._parentDrag === _this; })
2889
- .map(function (handle) { return handle.element; });
2890
- _this._dragRef.withHandles(childHandleElements);
2891
- }),
2892
- // Listen if the state of any of the handles changes.
2893
- operators.switchMap(function (handles) {
2894
- return rxjs.merge.apply(void 0, __spread(handles.map(function (item) {
2895
- return item._stateChanges.pipe(operators.startWith(item));
2896
- })));
2897
- }), operators.takeUntil(_this._destroyed)).subscribe(function (handleInstance) {
2898
- // Enabled/disable the handle that changed in the DragRef.
2899
- var dragRef = _this._dragRef;
2900
- var handle = handleInstance.element.nativeElement;
2901
- handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);
2902
- });
2903
- if (_this.freeDragPosition) {
2904
- _this._dragRef.setFreeDragPosition(_this.freeDragPosition);
2905
- }
2886
+ /** Gets the registered items in the list, sorted by their position in the DOM. */
2887
+ CdkDropList.prototype.getSortedItems = function () {
2888
+ return Array.from(this._unsortedItems).sort(function (a, b) {
2889
+ var documentPosition = a._dragRef.getVisibleElement().compareDocumentPosition(b._dragRef.getVisibleElement());
2890
+ // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.
2891
+ // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
2892
+ // tslint:disable-next-line:no-bitwise
2893
+ return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
2906
2894
  });
2907
2895
  };
2908
- CdkDrag.prototype.ngOnChanges = function (changes) {
2909
- var rootSelectorChange = changes['rootElementSelector'];
2910
- var positionChange = changes['freeDragPosition'];
2911
- // We don't have to react to the first change since it's being
2912
- // handled in `ngAfterViewInit` where it needs to be deferred.
2913
- if (rootSelectorChange && !rootSelectorChange.firstChange) {
2914
- this._updateRootElement();
2915
- }
2916
- // Skip the first change since it's being handled in `ngAfterViewInit`.
2917
- if (positionChange && !positionChange.firstChange && this.freeDragPosition) {
2918
- this._dragRef.setFreeDragPosition(this.freeDragPosition);
2896
+ CdkDropList.prototype.ngOnDestroy = function () {
2897
+ var index = CdkDropList._dropLists.indexOf(this);
2898
+ if (index > -1) {
2899
+ CdkDropList._dropLists.splice(index, 1);
2919
2900
  }
2920
- };
2921
- CdkDrag.prototype.ngOnDestroy = function () {
2922
- if (this.dropContainer) {
2923
- this.dropContainer.removeItem(this);
2901
+ if (this._group) {
2902
+ this._group._items.delete(this);
2924
2903
  }
2904
+ this._unsortedItems.clear();
2905
+ this._dropListRef.dispose();
2925
2906
  this._destroyed.next();
2926
2907
  this._destroyed.complete();
2927
- this._dragRef.dispose();
2928
- };
2929
- /** Syncs the root element with the `DragRef`. */
2930
- CdkDrag.prototype._updateRootElement = function () {
2931
- var element = this.element.nativeElement;
2932
- var rootElement = this.rootElementSelector ?
2933
- getClosestMatchingAncestor(element, this.rootElementSelector) : element;
2934
- if (rootElement && rootElement.nodeType !== this._document.ELEMENT_NODE) {
2935
- throw Error("cdkDrag must be attached to an element node. " +
2936
- ("Currently attached to \"" + rootElement.nodeName + "\"."));
2937
- }
2938
- this._dragRef.withRootElement(rootElement || element);
2939
2908
  };
2940
- /** Gets the boundary element, based on the `boundaryElement` value. */
2941
- CdkDrag.prototype._getBoundaryElement = function () {
2942
- var boundary = this.boundaryElement;
2943
- if (!boundary) {
2944
- return null;
2945
- }
2946
- if (typeof boundary === 'string') {
2947
- return getClosestMatchingAncestor(this.element.nativeElement, boundary);
2948
- }
2949
- var element = coercion.coerceElement(boundary);
2950
- if (i0.isDevMode() && !element.contains(this.element.nativeElement)) {
2951
- throw Error('Draggable element is not inside of the node passed into cdkDragBoundary.');
2952
- }
2953
- return element;
2954
- };
2955
- /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */
2956
- CdkDrag.prototype._syncInputs = function (ref) {
2909
+ /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */
2910
+ CdkDropList.prototype._setupInputSyncSubscription = function (ref) {
2957
2911
  var _this = this;
2912
+ if (this._dir) {
2913
+ this._dir.change
2914
+ .pipe(operators.startWith(this._dir.value), operators.takeUntil(this._destroyed))
2915
+ .subscribe(function (value) { return ref.withDirection(value); });
2916
+ }
2958
2917
  ref.beforeStarted.subscribe(function () {
2959
- if (!ref.isDragging()) {
2960
- var dir = _this._dir;
2961
- var dragStartDelay = _this.dragStartDelay;
2962
- var placeholder = _this._placeholderTemplate ? {
2963
- template: _this._placeholderTemplate.templateRef,
2964
- context: _this._placeholderTemplate.data,
2965
- viewContainer: _this._viewContainerRef
2966
- } : null;
2967
- var preview = _this._previewTemplate ? {
2968
- template: _this._previewTemplate.templateRef,
2969
- context: _this._previewTemplate.data,
2970
- matchSize: _this._previewTemplate.matchSize,
2971
- viewContainer: _this._viewContainerRef
2972
- } : null;
2973
- ref.disabled = _this.disabled;
2974
- ref.lockAxis = _this.lockAxis;
2975
- ref.dragStartDelay = (typeof dragStartDelay === 'object' && dragStartDelay) ?
2976
- dragStartDelay : coercion.coerceNumberProperty(dragStartDelay);
2977
- ref.constrainPosition = _this.constrainPosition;
2978
- ref.previewClass = _this.previewClass;
2979
- ref
2980
- .withBoundaryElement(_this._getBoundaryElement())
2981
- .withPlaceholderTemplate(placeholder)
2982
- .withPreviewTemplate(preview);
2983
- if (dir) {
2984
- ref.withDirection(dir.value);
2918
+ var siblings = coercion.coerceArray(_this.connectedTo).map(function (drop) {
2919
+ if (typeof drop === 'string') {
2920
+ var correspondingDropList = CdkDropList._dropLists.find(function (list) { return list.id === drop; });
2921
+ if (!correspondingDropList && i0.isDevMode()) {
2922
+ console.warn("CdkDropList could not find connected drop list with id \"" + drop + "\"");
2923
+ }
2924
+ return correspondingDropList;
2985
2925
  }
2926
+ return drop;
2927
+ });
2928
+ if (_this._group) {
2929
+ _this._group._items.forEach(function (drop) {
2930
+ if (siblings.indexOf(drop) === -1) {
2931
+ siblings.push(drop);
2932
+ }
2933
+ });
2986
2934
  }
2935
+ // Note that we resolve the scrollable parents here so that we delay the resolution
2936
+ // as long as possible, ensuring that the element is in its final place in the DOM.
2937
+ // @breaking-change 11.0.0 Remove null check for _scrollDispatcher once it's required.
2938
+ if (!_this._scrollableParentsResolved && _this._scrollDispatcher) {
2939
+ var scrollableParents = _this._scrollDispatcher
2940
+ .getAncestorScrollContainers(_this.element)
2941
+ .map(function (scrollable) { return scrollable.getElementRef().nativeElement; });
2942
+ _this._dropListRef.withScrollableParents(scrollableParents);
2943
+ // Only do this once since it involves traversing the DOM and the parents
2944
+ // shouldn't be able to change without the drop list being destroyed.
2945
+ _this._scrollableParentsResolved = true;
2946
+ }
2947
+ ref.disabled = _this.disabled;
2948
+ ref.lockAxis = _this.lockAxis;
2949
+ ref.sortingDisabled = coercion.coerceBooleanProperty(_this.sortingDisabled);
2950
+ ref.autoScrollDisabled = coercion.coerceBooleanProperty(_this.autoScrollDisabled);
2951
+ ref
2952
+ .connectedTo(siblings.filter(function (drop) { return drop && drop !== _this; }).map(function (list) { return list._dropListRef; }))
2953
+ .withOrientation(_this.orientation);
2987
2954
  });
2988
2955
  };
2989
- /** Handles the events from the underlying `DragRef`. */
2990
- CdkDrag.prototype._handleEvents = function (ref) {
2956
+ /** Handles events from the underlying DropListRef. */
2957
+ CdkDropList.prototype._handleEvents = function (ref) {
2991
2958
  var _this = this;
2992
- ref.started.subscribe(function () {
2993
- _this.started.emit({ source: _this });
2994
- // Since all of these events run outside of change detection,
2995
- // we need to ensure that everything is marked correctly.
2996
- _this._changeDetectorRef.markForCheck();
2997
- });
2998
- ref.released.subscribe(function () {
2999
- _this.released.emit({ source: _this });
3000
- });
3001
- ref.ended.subscribe(function (event) {
3002
- _this.ended.emit({ source: _this, distance: event.distance });
3003
- // Since all of these events run outside of change detection,
3004
- // we need to ensure that everything is marked correctly.
2959
+ ref.beforeStarted.subscribe(function () {
2960
+ _this._syncItemsWithRef();
3005
2961
  _this._changeDetectorRef.markForCheck();
3006
2962
  });
3007
2963
  ref.entered.subscribe(function (event) {
3008
2964
  _this.entered.emit({
3009
- container: event.container.data,
3010
- item: _this,
2965
+ container: _this,
2966
+ item: event.item.data,
3011
2967
  currentIndex: event.currentIndex
3012
2968
  });
3013
2969
  });
3014
2970
  ref.exited.subscribe(function (event) {
3015
2971
  _this.exited.emit({
3016
- container: event.container.data,
3017
- item: _this
2972
+ container: _this,
2973
+ item: event.item.data
2974
+ });
2975
+ _this._changeDetectorRef.markForCheck();
2976
+ });
2977
+ ref.sorted.subscribe(function (event) {
2978
+ _this.sorted.emit({
2979
+ previousIndex: event.previousIndex,
2980
+ currentIndex: event.currentIndex,
2981
+ container: _this,
2982
+ item: event.item.data
3018
2983
  });
3019
2984
  });
3020
2985
  ref.dropped.subscribe(function (event) {
@@ -3023,92 +2988,76 @@
3023
2988
  currentIndex: event.currentIndex,
3024
2989
  previousContainer: event.previousContainer.data,
3025
2990
  container: event.container.data,
2991
+ item: event.item.data,
3026
2992
  isPointerOverContainer: event.isPointerOverContainer,
3027
- item: _this,
3028
2993
  distance: event.distance
3029
2994
  });
2995
+ // Mark for check since all of these events run outside of change
2996
+ // detection and we're not guaranteed for something else to have triggered it.
2997
+ _this._changeDetectorRef.markForCheck();
3030
2998
  });
3031
2999
  };
3032
- /** Assigns the default input values based on a provided config object. */
3033
- CdkDrag.prototype._assignDefaults = function (config) {
3034
- var lockAxis = config.lockAxis, dragStartDelay = config.dragStartDelay, constrainPosition = config.constrainPosition, previewClass = config.previewClass, boundaryElement = config.boundaryElement, draggingDisabled = config.draggingDisabled, rootElementSelector = config.rootElementSelector;
3035
- this.disabled = draggingDisabled == null ? false : draggingDisabled;
3036
- this.dragStartDelay = dragStartDelay || 0;
3037
- if (lockAxis) {
3038
- this.lockAxis = lockAxis;
3039
- }
3040
- if (constrainPosition) {
3041
- this.constrainPosition = constrainPosition;
3042
- }
3043
- if (previewClass) {
3044
- this.previewClass = previewClass;
3045
- }
3046
- if (boundaryElement) {
3047
- this.boundaryElement = boundaryElement;
3048
- }
3049
- if (rootElementSelector) {
3050
- this.rootElementSelector = rootElementSelector;
3000
+ /** Assigns the default input values based on a provided config object. */
3001
+ CdkDropList.prototype._assignDefaults = function (config) {
3002
+ var lockAxis = config.lockAxis, draggingDisabled = config.draggingDisabled, sortingDisabled = config.sortingDisabled, listAutoScrollDisabled = config.listAutoScrollDisabled, listOrientation = config.listOrientation;
3003
+ this.disabled = draggingDisabled == null ? false : draggingDisabled;
3004
+ this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled;
3005
+ this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled;
3006
+ this.orientation = listOrientation || 'vertical';
3007
+ if (lockAxis) {
3008
+ this.lockAxis = lockAxis;
3051
3009
  }
3052
3010
  };
3053
- CdkDrag.decorators = [
3054
- { type: i0.Directive, args: [{
3055
- selector: '[cdkDrag]',
3056
- exportAs: 'cdkDrag',
3057
- host: {
3058
- 'class': 'cdk-drag',
3059
- '[class.cdk-drag-disabled]': 'disabled',
3060
- '[class.cdk-drag-dragging]': '_dragRef.isDragging()',
3061
- },
3062
- providers: [{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }]
3063
- },] }
3064
- ];
3065
- CdkDrag.ctorParameters = function () { return [
3066
- { type: i0.ElementRef },
3067
- { type: undefined, decorators: [{ type: i0.Inject, args: [CDK_DROP_LIST,] }, { type: i0.Optional }, { type: i0.SkipSelf }] },
3068
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] },
3069
- { type: i0.NgZone },
3070
- { type: i0.ViewContainerRef },
3071
- { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [CDK_DRAG_CONFIG,] }] },
3072
- { type: bidi.Directionality, decorators: [{ type: i0.Optional }] },
3073
- { type: DragDrop },
3074
- { type: i0.ChangeDetectorRef }
3075
- ]; };
3076
- CdkDrag.propDecorators = {
3077
- _handles: [{ type: i0.ContentChildren, args: [CdkDragHandle, { descendants: true },] }],
3078
- _previewTemplate: [{ type: i0.ContentChild, args: [CdkDragPreview,] }],
3079
- _placeholderTemplate: [{ type: i0.ContentChild, args: [CdkDragPlaceholder,] }],
3080
- data: [{ type: i0.Input, args: ['cdkDragData',] }],
3081
- lockAxis: [{ type: i0.Input, args: ['cdkDragLockAxis',] }],
3082
- rootElementSelector: [{ type: i0.Input, args: ['cdkDragRootElement',] }],
3083
- boundaryElement: [{ type: i0.Input, args: ['cdkDragBoundary',] }],
3084
- dragStartDelay: [{ type: i0.Input, args: ['cdkDragStartDelay',] }],
3085
- freeDragPosition: [{ type: i0.Input, args: ['cdkDragFreeDragPosition',] }],
3086
- disabled: [{ type: i0.Input, args: ['cdkDragDisabled',] }],
3087
- constrainPosition: [{ type: i0.Input, args: ['cdkDragConstrainPosition',] }],
3088
- previewClass: [{ type: i0.Input, args: ['cdkDragPreviewClass',] }],
3089
- started: [{ type: i0.Output, args: ['cdkDragStarted',] }],
3090
- released: [{ type: i0.Output, args: ['cdkDragReleased',] }],
3091
- ended: [{ type: i0.Output, args: ['cdkDragEnded',] }],
3092
- entered: [{ type: i0.Output, args: ['cdkDragEntered',] }],
3093
- exited: [{ type: i0.Output, args: ['cdkDragExited',] }],
3094
- dropped: [{ type: i0.Output, args: ['cdkDragDropped',] }],
3095
- moved: [{ type: i0.Output, args: ['cdkDragMoved',] }]
3011
+ /** Syncs up the registered drag items with underlying drop list ref. */
3012
+ CdkDropList.prototype._syncItemsWithRef = function () {
3013
+ this._dropListRef.withItems(this.getSortedItems().map(function (item) { return item._dragRef; }));
3096
3014
  };
3097
- return CdkDrag;
3015
+ return CdkDropList;
3098
3016
  }());
3099
- /** Gets the closest ancestor of an element that matches a selector. */
3100
- function getClosestMatchingAncestor(element, selector) {
3101
- var currentElement = element.parentElement;
3102
- while (currentElement) {
3103
- // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.
3104
- if (currentElement.matches ? currentElement.matches(selector) :
3105
- currentElement.msMatchesSelector(selector)) {
3106
- return currentElement;
3107
- }
3108
- currentElement = currentElement.parentElement;
3109
- }
3110
- return null;
3111
- }
3017
+ /** Keeps track of the drop lists that are currently on the page. */
3018
+ CdkDropList._dropLists = [];
3019
+ CdkDropList.decorators = [
3020
+ { type: i0.Directive, args: [{
3021
+ selector: '[cdkDropList], cdk-drop-list',
3022
+ exportAs: 'cdkDropList',
3023
+ providers: [
3024
+ // Prevent child drop lists from picking up the same group as their parent.
3025
+ { provide: CDK_DROP_LIST_GROUP, useValue: ɵ0 },
3026
+ { provide: CDK_DROP_LIST, useExisting: CdkDropList },
3027
+ ],
3028
+ host: {
3029
+ 'class': 'cdk-drop-list',
3030
+ '[id]': 'id',
3031
+ '[class.cdk-drop-list-disabled]': 'disabled',
3032
+ '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()',
3033
+ '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()',
3034
+ }
3035
+ },] }
3036
+ ];
3037
+ CdkDropList.ctorParameters = function () { return [
3038
+ { type: i0.ElementRef },
3039
+ { type: DragDrop },
3040
+ { type: i0.ChangeDetectorRef },
3041
+ { type: bidi.Directionality, decorators: [{ type: i0.Optional }] },
3042
+ { type: CdkDropListGroup, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [CDK_DROP_LIST_GROUP,] }, { type: i0.SkipSelf }] },
3043
+ { type: i2.ScrollDispatcher },
3044
+ { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [CDK_DRAG_CONFIG,] }] }
3045
+ ]; };
3046
+ CdkDropList.propDecorators = {
3047
+ connectedTo: [{ type: i0.Input, args: ['cdkDropListConnectedTo',] }],
3048
+ data: [{ type: i0.Input, args: ['cdkDropListData',] }],
3049
+ orientation: [{ type: i0.Input, args: ['cdkDropListOrientation',] }],
3050
+ id: [{ type: i0.Input }],
3051
+ lockAxis: [{ type: i0.Input, args: ['cdkDropListLockAxis',] }],
3052
+ disabled: [{ type: i0.Input, args: ['cdkDropListDisabled',] }],
3053
+ sortingDisabled: [{ type: i0.Input, args: ['cdkDropListSortingDisabled',] }],
3054
+ enterPredicate: [{ type: i0.Input, args: ['cdkDropListEnterPredicate',] }],
3055
+ autoScrollDisabled: [{ type: i0.Input, args: ['cdkDropListAutoScrollDisabled',] }],
3056
+ dropped: [{ type: i0.Output, args: ['cdkDropListDropped',] }],
3057
+ entered: [{ type: i0.Output, args: ['cdkDropListEntered',] }],
3058
+ exited: [{ type: i0.Output, args: ['cdkDropListExited',] }],
3059
+ sorted: [{ type: i0.Output, args: ['cdkDropListSorted',] }]
3060
+ };
3112
3061
 
3113
3062
  /**
3114
3063
  * @license
@@ -3118,40 +3067,67 @@
3118
3067
  * found in the LICENSE file at https://angular.io/license
3119
3068
  */
3120
3069
  /**
3121
- * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`
3122
- * elements that are placed inside a `cdkDropListGroup` will be connected to each other
3123
- * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input
3124
- * from `cdkDropList`.
3070
+ * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the
3071
+ * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily
3072
+ * to avoid circular imports.
3073
+ * @docs-private
3125
3074
  */
3126
- var CdkDropListGroup = /** @class */ (function () {
3127
- function CdkDropListGroup() {
3128
- /** Drop lists registered inside the group. */
3129
- this._items = new Set();
3075
+ var CDK_DRAG_PARENT = new i0.InjectionToken('CDK_DRAG_PARENT');
3076
+
3077
+ /**
3078
+ * @license
3079
+ * Copyright Google LLC All Rights Reserved.
3080
+ *
3081
+ * Use of this source code is governed by an MIT-style license that can be
3082
+ * found in the LICENSE file at https://angular.io/license
3083
+ */
3084
+ /**
3085
+ * Injection token that can be used to reference instances of `CdkDragHandle`. It serves as
3086
+ * alternative token to the actual `CdkDragHandle` class which could cause unnecessary
3087
+ * retention of the class and its directive metadata.
3088
+ */
3089
+ var CDK_DRAG_HANDLE = new i0.InjectionToken('CdkDragHandle');
3090
+ /** Handle that can be used to drag a CdkDrag instance. */
3091
+ var CdkDragHandle = /** @class */ (function () {
3092
+ function CdkDragHandle(element, parentDrag) {
3093
+ this.element = element;
3094
+ /** Emits when the state of the handle has changed. */
3095
+ this._stateChanges = new rxjs.Subject();
3130
3096
  this._disabled = false;
3097
+ this._parentDrag = parentDrag;
3098
+ toggleNativeDragInteractions(element.nativeElement, false);
3131
3099
  }
3132
- Object.defineProperty(CdkDropListGroup.prototype, "disabled", {
3133
- /** Whether starting a dragging sequence from inside this group is disabled. */
3100
+ Object.defineProperty(CdkDragHandle.prototype, "disabled", {
3101
+ /** Whether starting to drag through this handle is disabled. */
3134
3102
  get: function () { return this._disabled; },
3135
3103
  set: function (value) {
3136
3104
  this._disabled = coercion.coerceBooleanProperty(value);
3105
+ this._stateChanges.next(this);
3137
3106
  },
3138
3107
  enumerable: false,
3139
3108
  configurable: true
3140
3109
  });
3141
- CdkDropListGroup.prototype.ngOnDestroy = function () {
3142
- this._items.clear();
3143
- };
3144
- CdkDropListGroup.decorators = [
3145
- { type: i0.Directive, args: [{
3146
- selector: '[cdkDropListGroup]',
3147
- exportAs: 'cdkDropListGroup',
3148
- },] }
3149
- ];
3150
- CdkDropListGroup.propDecorators = {
3151
- disabled: [{ type: i0.Input, args: ['cdkDropListGroupDisabled',] }]
3110
+ CdkDragHandle.prototype.ngOnDestroy = function () {
3111
+ this._stateChanges.complete();
3152
3112
  };
3153
- return CdkDropListGroup;
3113
+ return CdkDragHandle;
3154
3114
  }());
3115
+ CdkDragHandle.decorators = [
3116
+ { type: i0.Directive, args: [{
3117
+ selector: '[cdkDragHandle]',
3118
+ host: {
3119
+ 'class': 'cdk-drag-handle'
3120
+ },
3121
+ providers: [{ provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle }],
3122
+ },] }
3123
+ ];
3124
+ CdkDragHandle.ctorParameters = function () { return [
3125
+ { type: i0.ElementRef },
3126
+ { type: undefined, decorators: [{ type: i0.Inject, args: [CDK_DRAG_PARENT,] }, { type: i0.Optional }, { type: i0.SkipSelf }] }
3127
+ ]; };
3128
+ CdkDragHandle.propDecorators = {
3129
+ disabled: [{ type: i0.Input, args: ['cdkDragHandleDisabled',] }]
3130
+ };
3155
3131
 
3156
3132
  /**
3157
3133
  * @license
@@ -3160,199 +3136,334 @@
3160
3136
  * Use of this source code is governed by an MIT-style license that can be
3161
3137
  * found in the LICENSE file at https://angular.io/license
3162
3138
  */
3163
- /** Counter used to generate unique ids for drop zones. */
3164
- var _uniqueIdCounter = 0;
3165
- var ɵ0 = undefined;
3166
- /** Container that wraps a set of draggable items. */
3167
- var CdkDropList = /** @class */ (function () {
3168
- function CdkDropList(
3169
- /** Element that the drop list is attached to. */
3170
- element, dragDrop, _changeDetectorRef, _dir, _group,
3171
- /**
3172
- * @deprecated _scrollDispatcher parameter to become required.
3173
- * @breaking-change 11.0.0
3174
- */
3175
- _scrollDispatcher, config) {
3139
+ /**
3140
+ * Injection token that can be used to reference instances of `CdkDragPlaceholder`. It serves as
3141
+ * alternative token to the actual `CdkDragPlaceholder` class which could cause unnecessary
3142
+ * retention of the class and its directive metadata.
3143
+ */
3144
+ var CDK_DRAG_PLACEHOLDER = new i0.InjectionToken('CdkDragPlaceholder');
3145
+ /**
3146
+ * Element that will be used as a template for the placeholder of a CdkDrag when
3147
+ * it is being dragged. The placeholder is displayed in place of the element being dragged.
3148
+ */
3149
+ var CdkDragPlaceholder = /** @class */ (function () {
3150
+ function CdkDragPlaceholder(templateRef) {
3151
+ this.templateRef = templateRef;
3152
+ }
3153
+ return CdkDragPlaceholder;
3154
+ }());
3155
+ CdkDragPlaceholder.decorators = [
3156
+ { type: i0.Directive, args: [{
3157
+ selector: 'ng-template[cdkDragPlaceholder]',
3158
+ providers: [{ provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder }],
3159
+ },] }
3160
+ ];
3161
+ CdkDragPlaceholder.ctorParameters = function () { return [
3162
+ { type: i0.TemplateRef }
3163
+ ]; };
3164
+ CdkDragPlaceholder.propDecorators = {
3165
+ data: [{ type: i0.Input }]
3166
+ };
3167
+
3168
+ /**
3169
+ * @license
3170
+ * Copyright Google LLC All Rights Reserved.
3171
+ *
3172
+ * Use of this source code is governed by an MIT-style license that can be
3173
+ * found in the LICENSE file at https://angular.io/license
3174
+ */
3175
+ /**
3176
+ * Injection token that can be used to reference instances of `CdkDragPreview`. It serves as
3177
+ * alternative token to the actual `CdkDragPreview` class which could cause unnecessary
3178
+ * retention of the class and its directive metadata.
3179
+ */
3180
+ var CDK_DRAG_PREVIEW = new i0.InjectionToken('CdkDragPreview');
3181
+ /**
3182
+ * Element that will be used as a template for the preview
3183
+ * of a CdkDrag when it is being dragged.
3184
+ */
3185
+ var CdkDragPreview = /** @class */ (function () {
3186
+ function CdkDragPreview(templateRef) {
3187
+ this.templateRef = templateRef;
3188
+ this._matchSize = false;
3189
+ }
3190
+ Object.defineProperty(CdkDragPreview.prototype, "matchSize", {
3191
+ /** Whether the preview should preserve the same size as the item that is being dragged. */
3192
+ get: function () { return this._matchSize; },
3193
+ set: function (value) { this._matchSize = coercion.coerceBooleanProperty(value); },
3194
+ enumerable: false,
3195
+ configurable: true
3196
+ });
3197
+ return CdkDragPreview;
3198
+ }());
3199
+ CdkDragPreview.decorators = [
3200
+ { type: i0.Directive, args: [{
3201
+ selector: 'ng-template[cdkDragPreview]',
3202
+ providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }],
3203
+ },] }
3204
+ ];
3205
+ CdkDragPreview.ctorParameters = function () { return [
3206
+ { type: i0.TemplateRef }
3207
+ ]; };
3208
+ CdkDragPreview.propDecorators = {
3209
+ data: [{ type: i0.Input }],
3210
+ matchSize: [{ type: i0.Input }]
3211
+ };
3212
+
3213
+ /** Element that can be moved inside a CdkDropList container. */
3214
+ var CdkDrag = /** @class */ (function () {
3215
+ function CdkDrag(
3216
+ /** Element that the draggable is attached to. */
3217
+ element,
3218
+ /** Droppable container that the draggable is a part of. */
3219
+ dropContainer, _document, _ngZone, _viewContainerRef, config, _dir, dragDrop, _changeDetectorRef, _selfHandle) {
3176
3220
  var _this = this;
3177
3221
  this.element = element;
3178
- this._changeDetectorRef = _changeDetectorRef;
3222
+ this.dropContainer = dropContainer;
3223
+ this._document = _document;
3224
+ this._ngZone = _ngZone;
3225
+ this._viewContainerRef = _viewContainerRef;
3179
3226
  this._dir = _dir;
3180
- this._group = _group;
3181
- this._scrollDispatcher = _scrollDispatcher;
3182
- /** Emits when the list has been destroyed. */
3227
+ this._changeDetectorRef = _changeDetectorRef;
3228
+ this._selfHandle = _selfHandle;
3183
3229
  this._destroyed = new rxjs.Subject();
3184
- /**
3185
- * Other draggable containers that this container is connected to and into which the
3186
- * container's items can be transferred. Can either be references to other drop containers,
3187
- * or their unique IDs.
3188
- */
3189
- this.connectedTo = [];
3190
- /**
3191
- * Unique ID for the drop zone. Can be used as a reference
3192
- * in the `connectedTo` of another `CdkDropList`.
3193
- */
3194
- this.id = "cdk-drop-list-" + _uniqueIdCounter++;
3195
- /**
3196
- * Function that is used to determine whether an item
3197
- * is allowed to be moved into a drop container.
3198
- */
3199
- this.enterPredicate = function () { return true; };
3200
- /** Emits when the user drops an item inside the container. */
3201
- this.dropped = new i0.EventEmitter();
3202
- /**
3203
- * Emits when the user has moved a new drag item into this container.
3204
- */
3230
+ /** Emits when the user starts dragging the item. */
3231
+ this.started = new i0.EventEmitter();
3232
+ /** Emits when the user has released a drag item, before any animations have started. */
3233
+ this.released = new i0.EventEmitter();
3234
+ /** Emits when the user stops dragging an item in the container. */
3235
+ this.ended = new i0.EventEmitter();
3236
+ /** Emits when the user has moved the item into a new container. */
3205
3237
  this.entered = new i0.EventEmitter();
3206
- /**
3207
- * Emits when the user removes an item from the container
3208
- * by dragging it into another container.
3209
- */
3238
+ /** Emits when the user removes the item its container by dragging it into another container. */
3210
3239
  this.exited = new i0.EventEmitter();
3211
- /** Emits as the user is swapping items while actively dragging. */
3212
- this.sorted = new i0.EventEmitter();
3240
+ /** Emits when the user drops the item inside a container. */
3241
+ this.dropped = new i0.EventEmitter();
3213
3242
  /**
3214
- * Keeps track of the items that are registered with this container. Historically we used to
3215
- * do this with a `ContentChildren` query, however queries don't handle transplanted views very
3216
- * well which means that we can't handle cases like dragging the headers of a `mat-table`
3217
- * correctly. What we do instead is to have the items register themselves with the container
3218
- * and then we sort them based on their position in the DOM.
3243
+ * Emits as the user is dragging the item. Use with caution,
3244
+ * because this event will fire for every pixel that the user has dragged.
3219
3245
  */
3220
- this._unsortedItems = new Set();
3221
- this._dropListRef = dragDrop.createDropList(element);
3222
- this._dropListRef.data = this;
3246
+ this.moved = new rxjs.Observable(function (observer) {
3247
+ var subscription = _this._dragRef.moved.pipe(operators.map(function (movedEvent) { return ({
3248
+ source: _this,
3249
+ pointerPosition: movedEvent.pointerPosition,
3250
+ event: movedEvent.event,
3251
+ delta: movedEvent.delta,
3252
+ distance: movedEvent.distance
3253
+ }); })).subscribe(observer);
3254
+ return function () {
3255
+ subscription.unsubscribe();
3256
+ };
3257
+ });
3258
+ this._dragRef = dragDrop.createDrag(element, {
3259
+ dragStartThreshold: config && config.dragStartThreshold != null ?
3260
+ config.dragStartThreshold : 5,
3261
+ pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null ?
3262
+ config.pointerDirectionChangeThreshold : 5,
3263
+ zIndex: config === null || config === void 0 ? void 0 : config.zIndex
3264
+ });
3265
+ this._dragRef.data = this;
3223
3266
  if (config) {
3224
3267
  this._assignDefaults(config);
3225
3268
  }
3226
- this._dropListRef.enterPredicate = function (drag, drop) {
3227
- return _this.enterPredicate(drag.data, drop.data);
3228
- };
3229
- this._setupInputSyncSubscription(this._dropListRef);
3230
- this._handleEvents(this._dropListRef);
3231
- CdkDropList._dropLists.push(this);
3232
- if (_group) {
3233
- _group._items.add(this);
3269
+ // Note that usually the container is assigned when the drop list is picks up the item, but in
3270
+ // some cases (mainly transplanted views with OnPush, see #18341) we may end up in a situation
3271
+ // where there are no items on the first change detection pass, but the items get picked up as
3272
+ // soon as the user triggers another pass by dragging. This is a problem, because the item would
3273
+ // have to switch from standalone mode to drag mode in the middle of the dragging sequence which
3274
+ // is too late since the two modes save different kinds of information. We work around it by
3275
+ // assigning the drop container both from here and the list.
3276
+ if (dropContainer) {
3277
+ this._dragRef._withDropContainer(dropContainer._dropListRef);
3278
+ dropContainer.addItem(this);
3234
3279
  }
3280
+ this._syncInputs(this._dragRef);
3281
+ this._handleEvents(this._dragRef);
3235
3282
  }
3236
- Object.defineProperty(CdkDropList.prototype, "disabled", {
3237
- /** Whether starting a dragging sequence from this container is disabled. */
3283
+ Object.defineProperty(CdkDrag.prototype, "disabled", {
3284
+ /** Whether starting to drag this element is disabled. */
3238
3285
  get: function () {
3239
- return this._disabled || (!!this._group && this._group.disabled);
3286
+ return this._disabled || (this.dropContainer && this.dropContainer.disabled);
3240
3287
  },
3241
3288
  set: function (value) {
3242
- // Usually we sync the directive and ref state right before dragging starts, in order to have
3243
- // a single point of failure and to avoid having to use setters for everything. `disabled` is
3244
- // a special case, because it can prevent the `beforeStarted` event from firing, which can lock
3245
- // the user in a disabled state, so we also need to sync it as it's being set.
3246
- this._dropListRef.disabled = this._disabled = coercion.coerceBooleanProperty(value);
3289
+ this._disabled = coercion.coerceBooleanProperty(value);
3290
+ this._dragRef.disabled = this._disabled;
3247
3291
  },
3248
3292
  enumerable: false,
3249
3293
  configurable: true
3250
3294
  });
3251
- /** Registers an items with the drop list. */
3252
- CdkDropList.prototype.addItem = function (item) {
3253
- this._unsortedItems.add(item);
3254
- if (this._dropListRef.isDragging()) {
3255
- this._syncItemsWithRef();
3256
- }
3295
+ /**
3296
+ * Returns the element that is being used as a placeholder
3297
+ * while the current element is being dragged.
3298
+ */
3299
+ CdkDrag.prototype.getPlaceholderElement = function () {
3300
+ return this._dragRef.getPlaceholderElement();
3301
+ };
3302
+ /** Returns the root draggable element. */
3303
+ CdkDrag.prototype.getRootElement = function () {
3304
+ return this._dragRef.getRootElement();
3257
3305
  };
3258
- /** Removes an item from the drop list. */
3259
- CdkDropList.prototype.removeItem = function (item) {
3260
- this._unsortedItems.delete(item);
3261
- if (this._dropListRef.isDragging()) {
3262
- this._syncItemsWithRef();
3263
- }
3306
+ /** Resets a standalone drag item to its initial position. */
3307
+ CdkDrag.prototype.reset = function () {
3308
+ this._dragRef.reset();
3264
3309
  };
3265
- /** Gets the registered items in the list, sorted by their position in the DOM. */
3266
- CdkDropList.prototype.getSortedItems = function () {
3267
- return Array.from(this._unsortedItems).sort(function (a, b) {
3268
- var documentPosition = a._dragRef.getVisibleElement().compareDocumentPosition(b._dragRef.getVisibleElement());
3269
- // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.
3270
- // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
3271
- // tslint:disable-next-line:no-bitwise
3272
- return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
3310
+ /**
3311
+ * Gets the pixel coordinates of the draggable outside of a drop container.
3312
+ */
3313
+ CdkDrag.prototype.getFreeDragPosition = function () {
3314
+ return this._dragRef.getFreeDragPosition();
3315
+ };
3316
+ CdkDrag.prototype.ngAfterViewInit = function () {
3317
+ var _this = this;
3318
+ // We need to wait for the zone to stabilize, in order for the reference
3319
+ // element to be in the proper place in the DOM. This is mostly relevant
3320
+ // for draggable elements inside portals since they get stamped out in
3321
+ // their original DOM position and then they get transferred to the portal.
3322
+ this._ngZone.onStable.asObservable()
3323
+ .pipe(operators.take(1), operators.takeUntil(this._destroyed))
3324
+ .subscribe(function () {
3325
+ _this._updateRootElement();
3326
+ // Listen for any newly-added handles.
3327
+ _this._handles.changes.pipe(operators.startWith(_this._handles),
3328
+ // Sync the new handles with the DragRef.
3329
+ operators.tap(function (handles) {
3330
+ var childHandleElements = handles
3331
+ .filter(function (handle) { return handle._parentDrag === _this; })
3332
+ .map(function (handle) { return handle.element; });
3333
+ // Usually handles are only allowed to be a descendant of the drag element, but if
3334
+ // the consumer defined a different drag root, we should allow the drag element
3335
+ // itself to be a handle too.
3336
+ if (_this._selfHandle && _this.rootElementSelector) {
3337
+ childHandleElements.push(_this.element);
3338
+ }
3339
+ _this._dragRef.withHandles(childHandleElements);
3340
+ }),
3341
+ // Listen if the state of any of the handles changes.
3342
+ operators.switchMap(function (handles) {
3343
+ return rxjs.merge.apply(void 0, __spread(handles.map(function (item) {
3344
+ return item._stateChanges.pipe(operators.startWith(item));
3345
+ })));
3346
+ }), operators.takeUntil(_this._destroyed)).subscribe(function (handleInstance) {
3347
+ // Enabled/disable the handle that changed in the DragRef.
3348
+ var dragRef = _this._dragRef;
3349
+ var handle = handleInstance.element.nativeElement;
3350
+ handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);
3351
+ });
3352
+ if (_this.freeDragPosition) {
3353
+ _this._dragRef.setFreeDragPosition(_this.freeDragPosition);
3354
+ }
3273
3355
  });
3274
3356
  };
3275
- CdkDropList.prototype.ngOnDestroy = function () {
3276
- var index = CdkDropList._dropLists.indexOf(this);
3277
- if (index > -1) {
3278
- CdkDropList._dropLists.splice(index, 1);
3357
+ CdkDrag.prototype.ngOnChanges = function (changes) {
3358
+ var rootSelectorChange = changes['rootElementSelector'];
3359
+ var positionChange = changes['freeDragPosition'];
3360
+ // We don't have to react to the first change since it's being
3361
+ // handled in `ngAfterViewInit` where it needs to be deferred.
3362
+ if (rootSelectorChange && !rootSelectorChange.firstChange) {
3363
+ this._updateRootElement();
3279
3364
  }
3280
- if (this._group) {
3281
- this._group._items.delete(this);
3365
+ // Skip the first change since it's being handled in `ngAfterViewInit`.
3366
+ if (positionChange && !positionChange.firstChange && this.freeDragPosition) {
3367
+ this._dragRef.setFreeDragPosition(this.freeDragPosition);
3368
+ }
3369
+ };
3370
+ CdkDrag.prototype.ngOnDestroy = function () {
3371
+ if (this.dropContainer) {
3372
+ this.dropContainer.removeItem(this);
3282
3373
  }
3283
- this._unsortedItems.clear();
3284
- this._dropListRef.dispose();
3285
3374
  this._destroyed.next();
3286
3375
  this._destroyed.complete();
3376
+ this._dragRef.dispose();
3287
3377
  };
3288
- /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */
3289
- CdkDropList.prototype._setupInputSyncSubscription = function (ref) {
3290
- var _this = this;
3291
- if (this._dir) {
3292
- this._dir.change
3293
- .pipe(operators.startWith(this._dir.value), operators.takeUntil(this._destroyed))
3294
- .subscribe(function (value) { return ref.withDirection(value); });
3378
+ /** Syncs the root element with the `DragRef`. */
3379
+ CdkDrag.prototype._updateRootElement = function () {
3380
+ var element = this.element.nativeElement;
3381
+ var rootElement = this.rootElementSelector ?
3382
+ getClosestMatchingAncestor(element, this.rootElementSelector) : element;
3383
+ if (rootElement && rootElement.nodeType !== this._document.ELEMENT_NODE) {
3384
+ throw Error("cdkDrag must be attached to an element node. " +
3385
+ ("Currently attached to \"" + rootElement.nodeName + "\"."));
3386
+ }
3387
+ this._dragRef.withRootElement(rootElement || element);
3388
+ };
3389
+ /** Gets the boundary element, based on the `boundaryElement` value. */
3390
+ CdkDrag.prototype._getBoundaryElement = function () {
3391
+ var boundary = this.boundaryElement;
3392
+ if (!boundary) {
3393
+ return null;
3394
+ }
3395
+ if (typeof boundary === 'string') {
3396
+ return getClosestMatchingAncestor(this.element.nativeElement, boundary);
3397
+ }
3398
+ var element = coercion.coerceElement(boundary);
3399
+ if (i0.isDevMode() && !element.contains(this.element.nativeElement)) {
3400
+ throw Error('Draggable element is not inside of the node passed into cdkDragBoundary.');
3295
3401
  }
3402
+ return element;
3403
+ };
3404
+ /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */
3405
+ CdkDrag.prototype._syncInputs = function (ref) {
3406
+ var _this = this;
3296
3407
  ref.beforeStarted.subscribe(function () {
3297
- var siblings = coercion.coerceArray(_this.connectedTo).map(function (drop) {
3298
- return typeof drop === 'string' ?
3299
- CdkDropList._dropLists.find(function (list) { return list.id === drop; }) : drop;
3300
- });
3301
- if (_this._group) {
3302
- _this._group._items.forEach(function (drop) {
3303
- if (siblings.indexOf(drop) === -1) {
3304
- siblings.push(drop);
3305
- }
3306
- });
3307
- }
3308
- // Note that we resolve the scrollable parents here so that we delay the resolution
3309
- // as long as possible, ensuring that the element is in its final place in the DOM.
3310
- // @breaking-change 11.0.0 Remove null check for _scrollDispatcher once it's required.
3311
- if (!_this._scrollableParentsResolved && _this._scrollDispatcher) {
3312
- var scrollableParents = _this._scrollDispatcher
3313
- .getAncestorScrollContainers(_this.element)
3314
- .map(function (scrollable) { return scrollable.getElementRef().nativeElement; });
3315
- _this._dropListRef.withScrollableParents(scrollableParents);
3316
- // Only do this once since it involves traversing the DOM and the parents
3317
- // shouldn't be able to change without the drop list being destroyed.
3318
- _this._scrollableParentsResolved = true;
3408
+ if (!ref.isDragging()) {
3409
+ var dir = _this._dir;
3410
+ var dragStartDelay = _this.dragStartDelay;
3411
+ var placeholder = _this._placeholderTemplate ? {
3412
+ template: _this._placeholderTemplate.templateRef,
3413
+ context: _this._placeholderTemplate.data,
3414
+ viewContainer: _this._viewContainerRef
3415
+ } : null;
3416
+ var preview = _this._previewTemplate ? {
3417
+ template: _this._previewTemplate.templateRef,
3418
+ context: _this._previewTemplate.data,
3419
+ matchSize: _this._previewTemplate.matchSize,
3420
+ viewContainer: _this._viewContainerRef
3421
+ } : null;
3422
+ ref.disabled = _this.disabled;
3423
+ ref.lockAxis = _this.lockAxis;
3424
+ ref.dragStartDelay = (typeof dragStartDelay === 'object' && dragStartDelay) ?
3425
+ dragStartDelay : coercion.coerceNumberProperty(dragStartDelay);
3426
+ ref.constrainPosition = _this.constrainPosition;
3427
+ ref.previewClass = _this.previewClass;
3428
+ ref
3429
+ .withBoundaryElement(_this._getBoundaryElement())
3430
+ .withPlaceholderTemplate(placeholder)
3431
+ .withPreviewTemplate(preview);
3432
+ if (dir) {
3433
+ ref.withDirection(dir.value);
3434
+ }
3319
3435
  }
3320
- ref.disabled = _this.disabled;
3321
- ref.lockAxis = _this.lockAxis;
3322
- ref.sortingDisabled = coercion.coerceBooleanProperty(_this.sortingDisabled);
3323
- ref.autoScrollDisabled = coercion.coerceBooleanProperty(_this.autoScrollDisabled);
3324
- ref
3325
- .connectedTo(siblings.filter(function (drop) { return drop && drop !== _this; }).map(function (list) { return list._dropListRef; }))
3326
- .withOrientation(_this.orientation);
3327
3436
  });
3328
3437
  };
3329
- /** Handles events from the underlying DropListRef. */
3330
- CdkDropList.prototype._handleEvents = function (ref) {
3438
+ /** Handles the events from the underlying `DragRef`. */
3439
+ CdkDrag.prototype._handleEvents = function (ref) {
3331
3440
  var _this = this;
3332
- ref.beforeStarted.subscribe(function () {
3333
- _this._syncItemsWithRef();
3441
+ ref.started.subscribe(function () {
3442
+ _this.started.emit({ source: _this });
3443
+ // Since all of these events run outside of change detection,
3444
+ // we need to ensure that everything is marked correctly.
3445
+ _this._changeDetectorRef.markForCheck();
3446
+ });
3447
+ ref.released.subscribe(function () {
3448
+ _this.released.emit({ source: _this });
3449
+ });
3450
+ ref.ended.subscribe(function (event) {
3451
+ _this.ended.emit({ source: _this, distance: event.distance });
3452
+ // Since all of these events run outside of change detection,
3453
+ // we need to ensure that everything is marked correctly.
3334
3454
  _this._changeDetectorRef.markForCheck();
3335
3455
  });
3336
3456
  ref.entered.subscribe(function (event) {
3337
3457
  _this.entered.emit({
3338
- container: _this,
3339
- item: event.item.data,
3458
+ container: event.container.data,
3459
+ item: _this,
3340
3460
  currentIndex: event.currentIndex
3341
3461
  });
3342
3462
  });
3343
3463
  ref.exited.subscribe(function (event) {
3344
3464
  _this.exited.emit({
3345
- container: _this,
3346
- item: event.item.data
3347
- });
3348
- _this._changeDetectorRef.markForCheck();
3349
- });
3350
- ref.sorted.subscribe(function (event) {
3351
- _this.sorted.emit({
3352
- previousIndex: event.previousIndex,
3353
- currentIndex: event.currentIndex,
3354
- container: _this,
3355
- item: event.item.data
3465
+ container: event.container.data,
3466
+ item: _this
3356
3467
  });
3357
3468
  });
3358
3469
  ref.dropped.subscribe(function (event) {
@@ -3361,76 +3472,93 @@
3361
3472
  currentIndex: event.currentIndex,
3362
3473
  previousContainer: event.previousContainer.data,
3363
3474
  container: event.container.data,
3364
- item: event.item.data,
3365
3475
  isPointerOverContainer: event.isPointerOverContainer,
3476
+ item: _this,
3366
3477
  distance: event.distance
3367
3478
  });
3368
- // Mark for check since all of these events run outside of change
3369
- // detection and we're not guaranteed for something else to have triggered it.
3370
- _this._changeDetectorRef.markForCheck();
3371
3479
  });
3372
3480
  };
3373
3481
  /** Assigns the default input values based on a provided config object. */
3374
- CdkDropList.prototype._assignDefaults = function (config) {
3375
- var lockAxis = config.lockAxis, draggingDisabled = config.draggingDisabled, sortingDisabled = config.sortingDisabled, listAutoScrollDisabled = config.listAutoScrollDisabled, listOrientation = config.listOrientation;
3482
+ CdkDrag.prototype._assignDefaults = function (config) {
3483
+ var lockAxis = config.lockAxis, dragStartDelay = config.dragStartDelay, constrainPosition = config.constrainPosition, previewClass = config.previewClass, boundaryElement = config.boundaryElement, draggingDisabled = config.draggingDisabled, rootElementSelector = config.rootElementSelector;
3376
3484
  this.disabled = draggingDisabled == null ? false : draggingDisabled;
3377
- this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled;
3378
- this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled;
3379
- this.orientation = listOrientation || 'vertical';
3485
+ this.dragStartDelay = dragStartDelay || 0;
3380
3486
  if (lockAxis) {
3381
3487
  this.lockAxis = lockAxis;
3382
3488
  }
3489
+ if (constrainPosition) {
3490
+ this.constrainPosition = constrainPosition;
3491
+ }
3492
+ if (previewClass) {
3493
+ this.previewClass = previewClass;
3494
+ }
3495
+ if (boundaryElement) {
3496
+ this.boundaryElement = boundaryElement;
3497
+ }
3498
+ if (rootElementSelector) {
3499
+ this.rootElementSelector = rootElementSelector;
3500
+ }
3383
3501
  };
3384
- /** Syncs up the registered drag items with underlying drop list ref. */
3385
- CdkDropList.prototype._syncItemsWithRef = function () {
3386
- this._dropListRef.withItems(this.getSortedItems().map(function (item) { return item._dragRef; }));
3387
- };
3388
- /** Keeps track of the drop lists that are currently on the page. */
3389
- CdkDropList._dropLists = [];
3390
- CdkDropList.decorators = [
3391
- { type: i0.Directive, args: [{
3392
- selector: '[cdkDropList], cdk-drop-list',
3393
- exportAs: 'cdkDropList',
3394
- providers: [
3395
- // Prevent child drop lists from picking up the same group as their parent.
3396
- { provide: CdkDropListGroup, useValue: ɵ0 },
3397
- { provide: CDK_DROP_LIST, useExisting: CdkDropList },
3398
- ],
3399
- host: {
3400
- 'class': 'cdk-drop-list',
3401
- '[id]': 'id',
3402
- '[class.cdk-drop-list-disabled]': 'disabled',
3403
- '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()',
3404
- '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()',
3405
- }
3406
- },] }
3407
- ];
3408
- CdkDropList.ctorParameters = function () { return [
3409
- { type: i0.ElementRef },
3410
- { type: DragDrop },
3411
- { type: i0.ChangeDetectorRef },
3412
- { type: bidi.Directionality, decorators: [{ type: i0.Optional }] },
3413
- { type: CdkDropListGroup, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] },
3414
- { type: i2.ScrollDispatcher },
3415
- { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [CDK_DRAG_CONFIG,] }] }
3416
- ]; };
3417
- CdkDropList.propDecorators = {
3418
- connectedTo: [{ type: i0.Input, args: ['cdkDropListConnectedTo',] }],
3419
- data: [{ type: i0.Input, args: ['cdkDropListData',] }],
3420
- orientation: [{ type: i0.Input, args: ['cdkDropListOrientation',] }],
3421
- id: [{ type: i0.Input }],
3422
- lockAxis: [{ type: i0.Input, args: ['cdkDropListLockAxis',] }],
3423
- disabled: [{ type: i0.Input, args: ['cdkDropListDisabled',] }],
3424
- sortingDisabled: [{ type: i0.Input, args: ['cdkDropListSortingDisabled',] }],
3425
- enterPredicate: [{ type: i0.Input, args: ['cdkDropListEnterPredicate',] }],
3426
- autoScrollDisabled: [{ type: i0.Input, args: ['cdkDropListAutoScrollDisabled',] }],
3427
- dropped: [{ type: i0.Output, args: ['cdkDropListDropped',] }],
3428
- entered: [{ type: i0.Output, args: ['cdkDropListEntered',] }],
3429
- exited: [{ type: i0.Output, args: ['cdkDropListExited',] }],
3430
- sorted: [{ type: i0.Output, args: ['cdkDropListSorted',] }]
3431
- };
3432
- return CdkDropList;
3502
+ return CdkDrag;
3433
3503
  }());
3504
+ CdkDrag.decorators = [
3505
+ { type: i0.Directive, args: [{
3506
+ selector: '[cdkDrag]',
3507
+ exportAs: 'cdkDrag',
3508
+ host: {
3509
+ 'class': 'cdk-drag',
3510
+ '[class.cdk-drag-disabled]': 'disabled',
3511
+ '[class.cdk-drag-dragging]': '_dragRef.isDragging()',
3512
+ },
3513
+ providers: [{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }]
3514
+ },] }
3515
+ ];
3516
+ CdkDrag.ctorParameters = function () { return [
3517
+ { type: i0.ElementRef },
3518
+ { type: undefined, decorators: [{ type: i0.Inject, args: [CDK_DROP_LIST,] }, { type: i0.Optional }, { type: i0.SkipSelf }] },
3519
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] },
3520
+ { type: i0.NgZone },
3521
+ { type: i0.ViewContainerRef },
3522
+ { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [CDK_DRAG_CONFIG,] }] },
3523
+ { type: bidi.Directionality, decorators: [{ type: i0.Optional }] },
3524
+ { type: DragDrop },
3525
+ { type: i0.ChangeDetectorRef },
3526
+ { type: CdkDragHandle, decorators: [{ type: i0.Optional }, { type: i0.Self }, { type: i0.Inject, args: [CDK_DRAG_HANDLE,] }] }
3527
+ ]; };
3528
+ CdkDrag.propDecorators = {
3529
+ _handles: [{ type: i0.ContentChildren, args: [CDK_DRAG_HANDLE, { descendants: true },] }],
3530
+ _previewTemplate: [{ type: i0.ContentChild, args: [CDK_DRAG_PREVIEW,] }],
3531
+ _placeholderTemplate: [{ type: i0.ContentChild, args: [CDK_DRAG_PLACEHOLDER,] }],
3532
+ data: [{ type: i0.Input, args: ['cdkDragData',] }],
3533
+ lockAxis: [{ type: i0.Input, args: ['cdkDragLockAxis',] }],
3534
+ rootElementSelector: [{ type: i0.Input, args: ['cdkDragRootElement',] }],
3535
+ boundaryElement: [{ type: i0.Input, args: ['cdkDragBoundary',] }],
3536
+ dragStartDelay: [{ type: i0.Input, args: ['cdkDragStartDelay',] }],
3537
+ freeDragPosition: [{ type: i0.Input, args: ['cdkDragFreeDragPosition',] }],
3538
+ disabled: [{ type: i0.Input, args: ['cdkDragDisabled',] }],
3539
+ constrainPosition: [{ type: i0.Input, args: ['cdkDragConstrainPosition',] }],
3540
+ previewClass: [{ type: i0.Input, args: ['cdkDragPreviewClass',] }],
3541
+ started: [{ type: i0.Output, args: ['cdkDragStarted',] }],
3542
+ released: [{ type: i0.Output, args: ['cdkDragReleased',] }],
3543
+ ended: [{ type: i0.Output, args: ['cdkDragEnded',] }],
3544
+ entered: [{ type: i0.Output, args: ['cdkDragEntered',] }],
3545
+ exited: [{ type: i0.Output, args: ['cdkDragExited',] }],
3546
+ dropped: [{ type: i0.Output, args: ['cdkDragDropped',] }],
3547
+ moved: [{ type: i0.Output, args: ['cdkDragMoved',] }]
3548
+ };
3549
+ /** Gets the closest ancestor of an element that matches a selector. */
3550
+ function getClosestMatchingAncestor(element, selector) {
3551
+ var currentElement = element.parentElement;
3552
+ while (currentElement) {
3553
+ // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.
3554
+ if (currentElement.matches ? currentElement.matches(selector) :
3555
+ currentElement.msMatchesSelector(selector)) {
3556
+ return currentElement;
3557
+ }
3558
+ currentElement = currentElement.parentElement;
3559
+ }
3560
+ return null;
3561
+ }
3434
3562
 
3435
3563
  /**
3436
3564
  * @license
@@ -3442,32 +3570,32 @@
3442
3570
  var DragDropModule = /** @class */ (function () {
3443
3571
  function DragDropModule() {
3444
3572
  }
3445
- DragDropModule.decorators = [
3446
- { type: i0.NgModule, args: [{
3447
- declarations: [
3448
- CdkDropList,
3449
- CdkDropListGroup,
3450
- CdkDrag,
3451
- CdkDragHandle,
3452
- CdkDragPreview,
3453
- CdkDragPlaceholder,
3454
- ],
3455
- exports: [
3456
- i2.CdkScrollableModule,
3457
- CdkDropList,
3458
- CdkDropListGroup,
3459
- CdkDrag,
3460
- CdkDragHandle,
3461
- CdkDragPreview,
3462
- CdkDragPlaceholder,
3463
- ],
3464
- providers: [
3465
- DragDrop,
3466
- ]
3467
- },] }
3468
- ];
3469
3573
  return DragDropModule;
3470
3574
  }());
3575
+ DragDropModule.decorators = [
3576
+ { type: i0.NgModule, args: [{
3577
+ declarations: [
3578
+ CdkDropList,
3579
+ CdkDropListGroup,
3580
+ CdkDrag,
3581
+ CdkDragHandle,
3582
+ CdkDragPreview,
3583
+ CdkDragPlaceholder,
3584
+ ],
3585
+ exports: [
3586
+ i2.CdkScrollableModule,
3587
+ CdkDropList,
3588
+ CdkDropListGroup,
3589
+ CdkDrag,
3590
+ CdkDragHandle,
3591
+ CdkDragPreview,
3592
+ CdkDragPlaceholder,
3593
+ ],
3594
+ providers: [
3595
+ DragDrop,
3596
+ ]
3597
+ },] }
3598
+ ];
3471
3599
 
3472
3600
  /**
3473
3601
  * @license
@@ -3482,7 +3610,10 @@
3482
3610
  */
3483
3611
 
3484
3612
  exports.CDK_DRAG_CONFIG = CDK_DRAG_CONFIG;
3485
- exports.CDK_DROP_LIST = CDK_DROP_LIST;
3613
+ exports.CDK_DRAG_HANDLE = CDK_DRAG_HANDLE;
3614
+ exports.CDK_DRAG_PLACEHOLDER = CDK_DRAG_PLACEHOLDER;
3615
+ exports.CDK_DRAG_PREVIEW = CDK_DRAG_PREVIEW;
3616
+ exports.CDK_DROP_LIST_GROUP = CDK_DROP_LIST_GROUP;
3486
3617
  exports.CdkDrag = CdkDrag;
3487
3618
  exports.CdkDragHandle = CdkDragHandle;
3488
3619
  exports.CdkDragPlaceholder = CdkDragPlaceholder;
@@ -3497,7 +3628,8 @@
3497
3628
  exports.copyArrayItem = copyArrayItem;
3498
3629
  exports.moveItemInArray = moveItemInArray;
3499
3630
  exports.transferArrayItem = transferArrayItem;
3500
- exports.ɵangular_material_src_cdk_drag_drop_drag_drop_b = CDK_DRAG_PARENT;
3631
+ exports.ɵangular_material_src_cdk_drag_drop_drag_drop_b = CDK_DROP_LIST;
3632
+ exports.ɵangular_material_src_cdk_drag_drop_drag_drop_c = CDK_DRAG_PARENT;
3501
3633
 
3502
3634
  Object.defineProperty(exports, '__esModule', { value: true });
3503
3635