@angular/cdk 9.1.1 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/a11y/focus-monitor/focus-monitor.d.ts +36 -2
  2. package/a11y/index.metadata.json +1 -1
  3. package/bundles/cdk-a11y.umd.js +241 -19
  4. package/bundles/cdk-a11y.umd.js.map +1 -1
  5. package/bundles/cdk-a11y.umd.min.js +25 -10
  6. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  7. package/bundles/cdk-clipboard.umd.js +1 -1
  8. package/bundles/cdk-clipboard.umd.js.map +1 -1
  9. package/bundles/cdk-clipboard.umd.min.js +1 -1
  10. package/bundles/cdk-clipboard.umd.min.js.map +1 -1
  11. package/bundles/cdk-coercion.umd.js +0 -1
  12. package/bundles/cdk-coercion.umd.js.map +1 -1
  13. package/bundles/cdk-coercion.umd.min.js.map +1 -1
  14. package/bundles/cdk-collections.umd.js +203 -6
  15. package/bundles/cdk-collections.umd.js.map +1 -1
  16. package/bundles/cdk-collections.umd.min.js +17 -10
  17. package/bundles/cdk-collections.umd.min.js.map +1 -1
  18. package/bundles/cdk-drag-drop.umd.js +217 -23
  19. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  20. package/bundles/cdk-drag-drop.umd.min.js +25 -10
  21. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  22. package/bundles/cdk-overlay.umd.js +210 -12
  23. package/bundles/cdk-overlay.umd.js.map +1 -1
  24. package/bundles/cdk-overlay.umd.min.js +27 -12
  25. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  26. package/bundles/cdk-platform.umd.js +11 -0
  27. package/bundles/cdk-platform.umd.js.map +1 -1
  28. package/bundles/cdk-platform.umd.min.js +6 -6
  29. package/bundles/cdk-platform.umd.min.js.map +1 -1
  30. package/bundles/cdk-portal.umd.js +211 -14
  31. package/bundles/cdk-portal.umd.js.map +1 -1
  32. package/bundles/cdk-portal.umd.min.js +19 -4
  33. package/bundles/cdk-portal.umd.min.js.map +1 -1
  34. package/bundles/cdk-scrolling.umd.js +242 -14
  35. package/bundles/cdk-scrolling.umd.js.map +1 -1
  36. package/bundles/cdk-scrolling.umd.min.js +14 -6
  37. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  38. package/bundles/cdk-table.umd.js +278 -50
  39. package/bundles/cdk-table.umd.js.map +1 -1
  40. package/bundles/cdk-table.umd.min.js +29 -7
  41. package/bundles/cdk-table.umd.min.js.map +1 -1
  42. package/bundles/cdk-testing-protractor.umd.js +254 -49
  43. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  44. package/bundles/cdk-testing-protractor.umd.min.js +16 -9
  45. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  46. package/bundles/cdk-testing-testbed.umd.js +257 -54
  47. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  48. package/bundles/cdk-testing-testbed.umd.min.js +23 -8
  49. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  50. package/bundles/cdk-testing.umd.js +243 -46
  51. package/bundles/cdk-testing.umd.js.map +1 -1
  52. package/bundles/cdk-testing.umd.min.js +20 -5
  53. package/bundles/cdk-testing.umd.min.js.map +1 -1
  54. package/bundles/cdk-text-field.umd.js +21 -6
  55. package/bundles/cdk-text-field.umd.js.map +1 -1
  56. package/bundles/cdk-text-field.umd.min.js +3 -3
  57. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  58. package/bundles/cdk-tree.umd.js +212 -15
  59. package/bundles/cdk-tree.umd.js.map +1 -1
  60. package/bundles/cdk-tree.umd.min.js +17 -3
  61. package/bundles/cdk-tree.umd.min.js.map +1 -1
  62. package/bundles/cdk.umd.js +1 -1
  63. package/bundles/cdk.umd.js.map +1 -1
  64. package/bundles/cdk.umd.min.js +1 -1
  65. package/bundles/cdk.umd.min.js.map +1 -1
  66. package/coercion/array.d.ts +1 -0
  67. package/esm2015/a11y/focus-monitor/focus-monitor.js +93 -12
  68. package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
  69. package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
  70. package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
  71. package/esm2015/a11y/public-api.js +2 -2
  72. package/esm2015/bidi/directionality.js +1 -1
  73. package/esm2015/clipboard/pending-copy.js +3 -3
  74. package/esm2015/coercion/array.js +1 -2
  75. package/esm2015/drag-drop/drag-drop.js +1 -1
  76. package/esm2015/drag-drop/drag-ref.js +7 -5
  77. package/esm2015/drag-drop/drop-list-ref.js +11 -19
  78. package/esm2015/layout/breakpoints-observer.js +1 -1
  79. package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -2
  80. package/esm2015/overlay/position/overlay-position-builder.js +1 -1
  81. package/esm2015/platform/features/shadow-dom.js +16 -1
  82. package/esm2015/platform/public-api.js +2 -2
  83. package/esm2015/scrolling/scroll-dispatcher.js +38 -5
  84. package/esm2015/scrolling/viewport-ruler.js +44 -5
  85. package/esm2015/table/cell.js +18 -8
  86. package/esm2015/table/public-api.js +3 -2
  87. package/esm2015/table/row.js +24 -8
  88. package/esm2015/table/table.js +26 -12
  89. package/esm2015/table/text-column.js +3 -26
  90. package/esm2015/table/tokens.js +44 -0
  91. package/esm2015/testing/protractor/protractor-element.js +4 -2
  92. package/esm2015/testing/protractor/protractor-harness-environment.js +13 -8
  93. package/esm2015/testing/testbed/testbed-harness-environment.js +16 -10
  94. package/esm2015/text-field/autosize.js +38 -4
  95. package/esm2015/version.js +1 -1
  96. package/esm5/a11y/focus-monitor/focus-monitor.js +39 -13
  97. package/esm5/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
  98. package/esm5/a11y/focus-trap/focus-trap.js +1 -1
  99. package/esm5/a11y/live-announcer/live-announcer.js +1 -1
  100. package/esm5/bidi/directionality.js +1 -1
  101. package/esm5/clipboard/pending-copy.js +2 -2
  102. package/esm5/coercion/array.js +1 -2
  103. package/esm5/drag-drop/drag-drop.js +1 -1
  104. package/esm5/drag-drop/drag-ref.js +7 -5
  105. package/esm5/drag-drop/drop-list-ref.js +9 -14
  106. package/esm5/layout/breakpoints-observer.js +1 -1
  107. package/esm5/overlay/position/flexible-connected-position-strategy.js +3 -2
  108. package/esm5/overlay/position/overlay-position-builder.js +1 -1
  109. package/esm5/platform/features/shadow-dom.js +11 -1
  110. package/esm5/scrolling/scroll-dispatcher.js +21 -5
  111. package/esm5/scrolling/viewport-ruler.js +24 -5
  112. package/esm5/table/cell.js +13 -8
  113. package/esm5/table/public-api.js +2 -1
  114. package/esm5/table/row.js +21 -11
  115. package/esm5/table/table.js +16 -11
  116. package/esm5/table/text-column.js +3 -4
  117. package/esm5/table/tokens.js +16 -0
  118. package/esm5/testing/protractor/protractor-element.js +4 -2
  119. package/esm5/testing/protractor/protractor-harness-environment.js +17 -11
  120. package/esm5/testing/testbed/testbed-harness-environment.js +17 -11
  121. package/esm5/text-field/autosize.js +20 -4
  122. package/esm5/version.js +1 -1
  123. package/fesm2015/a11y.js +89 -11
  124. package/fesm2015/a11y.js.map +1 -1
  125. package/fesm2015/cdk.js +1 -1
  126. package/fesm2015/cdk.js.map +1 -1
  127. package/fesm2015/clipboard.js +2 -2
  128. package/fesm2015/clipboard.js.map +1 -1
  129. package/fesm2015/coercion.js +0 -1
  130. package/fesm2015/coercion.js.map +1 -1
  131. package/fesm2015/drag-drop.js +16 -22
  132. package/fesm2015/drag-drop.js.map +1 -1
  133. package/fesm2015/overlay.js +2 -1
  134. package/fesm2015/overlay.js.map +1 -1
  135. package/fesm2015/platform.js +16 -1
  136. package/fesm2015/platform.js.map +1 -1
  137. package/fesm2015/scrolling.js +76 -7
  138. package/fesm2015/scrolling.js.map +1 -1
  139. package/fesm2015/table.js +98 -49
  140. package/fesm2015/table.js.map +1 -1
  141. package/fesm2015/testing/protractor.js +16 -9
  142. package/fesm2015/testing/protractor.js.map +1 -1
  143. package/fesm2015/testing/testbed.js +15 -9
  144. package/fesm2015/testing/testbed.js.map +1 -1
  145. package/fesm2015/text-field.js +37 -3
  146. package/fesm2015/text-field.js.map +1 -1
  147. package/fesm5/a11y.js +36 -12
  148. package/fesm5/a11y.js.map +1 -1
  149. package/fesm5/cdk.js +1 -1
  150. package/fesm5/cdk.js.map +1 -1
  151. package/fesm5/clipboard.js +1 -1
  152. package/fesm5/clipboard.js.map +1 -1
  153. package/fesm5/coercion.js +0 -1
  154. package/fesm5/coercion.js.map +1 -1
  155. package/fesm5/drag-drop.js +14 -17
  156. package/fesm5/drag-drop.js.map +1 -1
  157. package/fesm5/overlay.js +2 -1
  158. package/fesm5/overlay.js.map +1 -1
  159. package/fesm5/platform.js +11 -1
  160. package/fesm5/platform.js.map +1 -1
  161. package/fesm5/scrolling.js +39 -7
  162. package/fesm5/scrolling.js.map +1 -1
  163. package/fesm5/table.js +59 -29
  164. package/fesm5/table.js.map +1 -1
  165. package/fesm5/testing/protractor.js +20 -12
  166. package/fesm5/testing/protractor.js.map +1 -1
  167. package/fesm5/testing/testbed.js +16 -10
  168. package/fesm5/testing/testbed.js.map +1 -1
  169. package/fesm5/text-field.js +19 -3
  170. package/fesm5/text-field.js.map +1 -1
  171. package/package.json +1 -1
  172. package/platform/features/shadow-dom.d.ts +2 -0
  173. package/platform/index.metadata.json +1 -1
  174. package/schematics/ng-add/index.js +1 -1
  175. package/schematics/ng-update/upgrade-rules/class-names-rule.js +3 -1
  176. package/schematics/utils/ast/ng-module-imports.js +3 -2
  177. package/scrolling/index.metadata.json +1 -1
  178. package/scrolling/scroll-dispatcher.d.ts +9 -1
  179. package/scrolling/viewport-ruler.d.ts +9 -1
  180. package/table/cell.d.ts +2 -0
  181. package/table/index.metadata.json +1 -1
  182. package/table/public-api.d.ts +1 -0
  183. package/table/row.d.ts +6 -3
  184. package/table/table.d.ts +2 -0
  185. package/table/text-column.d.ts +2 -13
  186. package/table/tokens.d.ts +25 -0
  187. package/testing/protractor/protractor-harness-environment.d.ts +10 -3
  188. package/testing/testbed/testbed-harness-environment.d.ts +12 -4
  189. package/text-field/autosize.d.ts +9 -1
  190. package/text-field/index.metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"drag-drop.js","sources":["../../../../../../src/cdk/drag-drop/drag-styling.ts","../../../../../../src/cdk/drag-drop/transition-duration.ts","../../../../../../src/cdk/drag-drop/drag-ref.ts","../../../../../../src/cdk/drag-drop/drag-utils.ts","../../../../../../src/cdk/drag-drop/drop-list-ref.ts","../../../../../../src/cdk/drag-drop/drag-drop-registry.ts","../../../../../../src/cdk/drag-drop/drag-drop.ts","../../../../../../src/cdk/drag-drop/drag-events.ts","../../../../../../src/cdk/drag-drop/drag-parent.ts","../../../../../../src/cdk/drag-drop/directives/drag-handle.ts","../../../../../../src/cdk/drag-drop/directives/drag-placeholder.ts","../../../../../../src/cdk/drag-drop/directives/drag-preview.ts","../../../../../../src/cdk/drag-drop/directives/config.ts","../../../../../../src/cdk/drag-drop/directives/drag.ts","../../../../../../src/cdk/drag-drop/directives/drop-list-group.ts","../../../../../../src/cdk/drag-drop/directives/drop-list.ts","../../../../../../src/cdk/drag-drop/drag-drop-module.ts","../../../../../../src/cdk/drag-drop/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n// Helper type that ignores `readonly` properties. This is used in\n// `extendStyles` to ignore the readonly properties on CSSStyleDeclaration\n// since we won't be touching those anyway.\ntype Writeable<T> = { -readonly [P in keyof T]-?: T[P] };\n\n/**\n * Extended CSSStyleDeclaration that includes a couple of drag-related\n * properties that aren't in the built-in TS typings.\n */\ninterface DragCSSStyleDeclaration extends CSSStyleDeclaration {\n webkitUserDrag: string;\n MozUserSelect: string; // For some reason the Firefox property is in PascalCase.\n}\n\n/**\n * Shallow-extends a stylesheet object with another stylesheet object.\n * @docs-private\n */\nexport function extendStyles(\n dest: Writeable<CSSStyleDeclaration>,\n source: Partial<DragCSSStyleDeclaration>) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n dest[key] = source[key]!;\n }\n }\n\n return dest;\n}\n\n\n/**\n * Toggles whether the native drag interactions should be enabled for an element.\n * @param element Element on which to toggle the drag interactions.\n * @param enable Whether the drag interactions should be enabled.\n * @docs-private\n */\nexport function toggleNativeDragInteractions(element: HTMLElement, enable: boolean) {\n const userSelect = enable ? '' : 'none';\n\n extendStyles(element.style, {\n touchAction: enable ? '' : 'none',\n webkitUserDrag: enable ? '' : 'none',\n webkitTapHighlightColor: enable ? '' : 'transparent',\n userSelect: userSelect,\n msUserSelect: userSelect,\n webkitUserSelect: userSelect,\n MozUserSelect: userSelect\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Parses a CSS time value to milliseconds. */\nfunction parseCssTimeUnitsToMs(value: string): number {\n // Some browsers will return it in seconds, whereas others will return milliseconds.\n const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\n return parseFloat(value) * multiplier;\n}\n\n/** Gets the transform transition duration, including the delay, of an element in milliseconds. */\nexport function getTransformTransitionDurationInMs(element: HTMLElement): number {\n const computedStyle = getComputedStyle(element);\n const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all');\n\n // If there's no transition for `all` or `transform`, we shouldn't do anything.\n if (!property) {\n return 0;\n }\n\n // Get the index of the property that we're interested in and match\n // it up to the same index in `transition-delay` and `transition-duration`.\n const propertyIndex = transitionedProperties.indexOf(property);\n const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n\n return parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\n parseCssTimeUnitsToMs(rawDelays[propertyIndex]);\n}\n\n/** Parses out multiple values from a computed style into an array. */\nfunction parseCssPropertyValue(computedStyle: CSSStyleDeclaration, name: string): string[] {\n const value = computedStyle.getPropertyValue(name);\n return value.split(',').map(part => part.trim());\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EmbeddedViewRef, ElementRef, NgZone, ViewContainerRef, TemplateRef} from '@angular/core';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {Direction} from '@angular/cdk/bidi';\nimport {normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {coerceBooleanProperty, coerceElement} from '@angular/cdk/coercion';\nimport {Subscription, Subject, Observable} from 'rxjs';\nimport {startWith} from 'rxjs/operators';\nimport {DropListRefInternal as DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport {extendStyles, toggleNativeDragInteractions} from './drag-styling';\nimport {getTransformTransitionDurationInMs} from './transition-duration';\n\n/** Object that can be used to configure the behavior of DragRef. */\nexport interface DragRefConfig {\n /**\n * Minimum amount of pixels that the user should\n * drag, before the CDK initiates a drag sequence.\n */\n dragStartThreshold: number;\n\n /**\n * Amount the pixels the user should drag before the CDK\n * considers them to have changed the drag direction.\n */\n pointerDirectionChangeThreshold: number;\n}\n\n/** Options that can be used to bind a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true});\n\n/** Options that can be used to bind an active event listener. */\nconst activeEventListenerOptions = normalizePassiveListenerOptions({passive: false});\n\n/**\n * Time in milliseconds for which to ignore mouse events, after\n * receiving a touch event. Used to avoid doing double work for\n * touch devices where the browser fires fake mouse events, in\n * addition to touch events.\n */\nconst MOUSE_EVENT_IGNORE_TIME = 800;\n\n// TODO(crisbeto): add an API for moving a draggable up/down the\n// list programmatically. Useful for keyboard controls.\n\n/**\n * Internal compile-time-only representation of a `DragRef`.\n * Used to avoid circular import issues between the `DragRef` and the `DropListRef`.\n * @docs-private\n */\nexport interface DragRefInternal extends DragRef {}\n\n/** Template that can be used to create a drag helper element (e.g. a preview or a placeholder). */\ninterface DragHelperTemplate<T = any> {\n template: TemplateRef<T> | null;\n viewContainer: ViewContainerRef;\n context: T;\n}\n\n/** Template that can be used to create a drag preview element. */\ninterface DragPreviewTemplate<T = any> extends DragHelperTemplate<T> {\n matchSize?: boolean;\n}\n\n/** Point on the page or within an element. */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * Reference to a draggable item. Used to manipulate or dispose of the item.\n */\nexport class DragRef<T = any> {\n /** Element displayed next to the user's pointer while the element is dragged. */\n private _preview: HTMLElement;\n\n /** Reference to the view of the preview element. */\n private _previewRef: EmbeddedViewRef<any> | null;\n\n /** Reference to the view of the placeholder element. */\n private _placeholderRef: EmbeddedViewRef<any> | null;\n\n /** Element that is rendered instead of the draggable item while it is being sorted. */\n private _placeholder: HTMLElement;\n\n /** Coordinates within the element at which the user picked up the element. */\n private _pickupPositionInElement: Point;\n\n /** Coordinates on the page at which the user picked up the element. */\n private _pickupPositionOnPage: Point;\n\n /**\n * Anchor node used to save the place in the DOM where the element was\n * picked up so that it can be restored at the end of the drag sequence.\n */\n private _anchor: Comment;\n\n /**\n * CSS `transform` applied to the element when it isn't being dragged. We need a\n * passive transform in order for the dragged element to retain its new position\n * after the user has stopped dragging and because we need to know the relative\n * position in case they start dragging again. This corresponds to `element.style.transform`.\n */\n private _passiveTransform: Point = {x: 0, y: 0};\n\n /** CSS `transform` that is applied to the element while it's being dragged. */\n private _activeTransform: Point = {x: 0, y: 0};\n\n /** Inline `transform` value that the element had before the first dragging sequence. */\n private _initialTransform?: string;\n\n /**\n * Whether the dragging sequence has been started. Doesn't\n * necessarily mean that the element has been moved.\n */\n private _hasStartedDragging: boolean;\n\n /** Whether the element has moved since the user started dragging it. */\n private _hasMoved: boolean;\n\n /** Drop container in which the DragRef resided when dragging began. */\n private _initialContainer: DropListRef;\n\n /** Index at which the item started in its initial container. */\n private _initialIndex: number;\n\n /** Cached scroll position on the page when the element was picked up. */\n private _scrollPosition: {top: number, left: number};\n\n /** Emits when the item is being moved. */\n private _moveEvents = new Subject<{\n source: DragRef;\n pointerPosition: {x: number, y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1, y: -1 | 0 | 1};\n }>();\n\n /** Keeps track of the direction in which the user is dragging along each axis. */\n private _pointerDirectionDelta: {x: -1 | 0 | 1, y: -1 | 0 | 1};\n\n /** Pointer position at which the last change in the delta occurred. */\n private _pointerPositionAtLastDirectionChange: Point;\n\n /**\n * Root DOM node of the drag instance. This is the element that will\n * be moved around as the user is dragging.\n */\n private _rootElement: HTMLElement;\n\n /**\n * Inline style value of `-webkit-tap-highlight-color` at the time the\n * dragging was started. Used to restore the value once we're done dragging.\n */\n private _rootElementTapHighlight: string | null;\n\n /** Subscription to pointer movement events. */\n private _pointerMoveSubscription = Subscription.EMPTY;\n\n /** Subscription to the event that is dispatched when the user lifts their pointer. */\n private _pointerUpSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being scrolled. */\n private _scrollSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being resized. */\n private _resizeSubscription = Subscription.EMPTY;\n\n /**\n * Time at which the last touch event occurred. Used to avoid firing the same\n * events multiple times on touch devices where the browser will fire a fake\n * mouse event for each touch event, after a certain time.\n */\n private _lastTouchEventTime: number;\n\n /** Time at which the last dragging sequence was started. */\n private _dragStartTime: number;\n\n /** Cached reference to the boundary element. */\n private _boundaryElement: HTMLElement | null = null;\n\n /** Whether the native dragging interactions have been enabled on the root element. */\n private _nativeInteractionsEnabled = true;\n\n /** Cached dimensions of the preview element. */\n private _previewRect?: ClientRect;\n\n /** Cached dimensions of the boundary element. */\n private _boundaryRect?: ClientRect;\n\n /** Element that will be used as a template to create the draggable item's preview. */\n private _previewTemplate?: DragPreviewTemplate | null;\n\n /** Template for placeholder element rendered to show where a draggable would be dropped. */\n private _placeholderTemplate?: DragHelperTemplate | null;\n\n /** Elements that can be used to drag the draggable item. */\n private _handles: HTMLElement[] = [];\n\n /** Registered handles that are currently disabled. */\n private _disabledHandles = new Set<HTMLElement>();\n\n /** Droppable container that the draggable is a part of. */\n private _dropContainer?: DropListRef;\n\n /** Layout direction of the item. */\n private _direction: Direction = 'ltr';\n\n /** Axis along which dragging is locked. */\n lockAxis: 'x' | 'y';\n\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n dragStartDelay: number | {touch: number, mouse: number} = 0;\n\n /** Class to be added to the preview element. */\n previewClass: string|string[]|undefined;\n\n /** Whether starting to drag this element is disabled. */\n get disabled(): boolean {\n return this._disabled || !!(this._dropContainer && this._dropContainer.disabled);\n }\n set disabled(value: boolean) {\n const newValue = coerceBooleanProperty(value);\n\n if (newValue !== this._disabled) {\n this._disabled = newValue;\n this._toggleNativeDragInteractions();\n }\n }\n private _disabled = false;\n\n /** Emits as the drag sequence is being prepared. */\n beforeStarted = new Subject<void>();\n\n /** Emits when the user starts dragging the item. */\n started = new Subject<{source: DragRef}>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n released = new Subject<{source: DragRef}>();\n\n /** Emits when the user stops dragging an item in the container. */\n ended = new Subject<{source: DragRef, distance: Point}>();\n\n /** Emits when the user has moved the item into a new container. */\n entered = new Subject<{container: DropListRef, item: DragRef, currentIndex: number}>();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n exited = new Subject<{container: DropListRef, item: DragRef}>();\n\n /** Emits when the user drops the item inside a container. */\n dropped = new Subject<{\n previousIndex: number;\n currentIndex: number;\n item: DragRef;\n container: DropListRef;\n previousContainer: DropListRef;\n distance: Point;\n isPointerOverContainer: boolean;\n }>();\n\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n moved: Observable<{\n source: DragRef;\n pointerPosition: {x: number, y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1, y: -1 | 0 | 1};\n }> = this._moveEvents.asObservable();\n\n /** Arbitrary data that can be attached to the drag item. */\n data: T;\n\n /**\n * Function that can be used to customize the logic of how the position of the drag item\n * is limited while it's being dragged. Gets called with a point containing the current position\n * of the user's pointer on the page and should return a point describing where the item should\n * be rendered.\n */\n constrainPosition?: (point: Point, dragRef: DragRef) => Point;\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _config: DragRefConfig,\n private _document: Document,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>) {\n\n this.withRootElement(element);\n _dragDropRegistry.registerDragItem(this);\n }\n\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement(): HTMLElement {\n return this._placeholder;\n }\n\n /** Returns the root draggable element. */\n getRootElement(): HTMLElement {\n return this._rootElement;\n }\n\n /**\n * Gets the currently-visible element that represents the drag item.\n * While dragging this is the placeholder, otherwise it's the root element.\n */\n getVisibleElement(): HTMLElement {\n return this.isDragging() ? this.getPlaceholderElement() : this.getRootElement();\n }\n\n /** Registers the handles that can be used to drag the element. */\n withHandles(handles: (HTMLElement | ElementRef<HTMLElement>)[]): this {\n this._handles = handles.map(handle => coerceElement(handle));\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, false));\n this._toggleNativeDragInteractions();\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag preview.\n * @param template Template that from which to stamp out the preview.\n */\n withPreviewTemplate(template: DragPreviewTemplate | null): this {\n this._previewTemplate = template;\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag placeholder.\n * @param template Template that from which to stamp out the placeholder.\n */\n withPlaceholderTemplate(template: DragHelperTemplate | null): this {\n this._placeholderTemplate = template;\n return this;\n }\n\n /**\n * Sets an alternate drag root element. The root element is the element that will be moved as\n * the user is dragging. Passing an alternate root element is useful when trying to enable\n * dragging on an element that you might not have access to.\n */\n withRootElement(rootElement: ElementRef<HTMLElement> | HTMLElement): this {\n const element = coerceElement(rootElement);\n\n if (element !== this._rootElement) {\n if (this._rootElement) {\n this._removeRootElementListeners(this._rootElement);\n }\n\n element.addEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.addEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n this._initialTransform = undefined;\n this._rootElement = element;\n }\n\n return this;\n }\n\n /**\n * Element to which the draggable's position will be constrained.\n */\n withBoundaryElement(boundaryElement: ElementRef<HTMLElement> | HTMLElement | null): this {\n this._boundaryElement = boundaryElement ? coerceElement(boundaryElement) : null;\n this._resizeSubscription.unsubscribe();\n if (boundaryElement) {\n this._resizeSubscription = this._viewportRuler\n .change(10)\n .subscribe(() => this._containInsideBoundaryOnResize());\n }\n return this;\n }\n\n /** Removes the dragging functionality from the DOM element. */\n dispose() {\n this._removeRootElementListeners(this._rootElement);\n\n // Do this check before removing from the registry since it'll\n // stop being considered as dragged once it is removed.\n if (this.isDragging()) {\n // Since we move out the element to the end of the body while it's being\n // dragged, we have to make sure that it's removed if it gets destroyed.\n removeNode(this._rootElement);\n }\n\n removeNode(this._anchor);\n this._destroyPreview();\n this._destroyPlaceholder();\n this._dragDropRegistry.removeDragItem(this);\n this._removeSubscriptions();\n this.beforeStarted.complete();\n this.started.complete();\n this.released.complete();\n this.ended.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this._moveEvents.complete();\n this._handles = [];\n this._disabledHandles.clear();\n this._dropContainer = undefined;\n this._resizeSubscription.unsubscribe();\n this._boundaryElement = this._rootElement = this._placeholderTemplate =\n this._previewTemplate = this._anchor = null!;\n }\n\n /** Checks whether the element is currently being dragged. */\n isDragging(): boolean {\n return this._hasStartedDragging && this._dragDropRegistry.isDragging(this);\n }\n\n /** Resets a standalone drag item to its initial position. */\n reset(): void {\n this._rootElement.style.transform = this._initialTransform || '';\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform = {x: 0, y: 0};\n }\n\n /**\n * Sets a handle as disabled. While a handle is disabled, it'll capture and interrupt dragging.\n * @param handle Handle element that should be disabled.\n */\n disableHandle(handle: HTMLElement) {\n if (this._handles.indexOf(handle) > -1) {\n this._disabledHandles.add(handle);\n }\n }\n\n /**\n * Enables a handle, if it has been disabled.\n * @param handle Handle element to be enabled.\n */\n enableHandle(handle: HTMLElement) {\n this._disabledHandles.delete(handle);\n }\n\n /** Sets the layout direction of the draggable item. */\n withDirection(direction: Direction): this {\n this._direction = direction;\n return this;\n }\n\n /** Sets the container that the item is part of. */\n _withDropContainer(container: DropListRef) {\n this._dropContainer = container;\n }\n\n /**\n * Gets the current position in pixels the draggable outside of a drop container.\n */\n getFreeDragPosition(): Readonly<Point> {\n const position = this.isDragging() ? this._activeTransform : this._passiveTransform;\n return {x: position.x, y: position.y};\n }\n\n /**\n * Sets the current position in pixels the draggable outside of a drop container.\n * @param value New position to be set.\n */\n setFreeDragPosition(value: Point): this {\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform.x = value.x;\n this._passiveTransform.y = value.y;\n\n if (!this._dropContainer) {\n this._applyRootElementTransform(value.x, value.y);\n }\n\n return this;\n }\n\n /** Updates the item's sort order based on the last-known pointer position. */\n _sortFromLastPointerPosition() {\n const position = this._pointerPositionAtLastDirectionChange;\n\n if (position && this._dropContainer) {\n this._updateActiveDropContainer(position);\n }\n }\n\n /** Unsubscribes from the global subscriptions. */\n private _removeSubscriptions() {\n this._pointerMoveSubscription.unsubscribe();\n this._pointerUpSubscription.unsubscribe();\n this._scrollSubscription.unsubscribe();\n }\n\n /** Destroys the preview element and its ViewRef. */\n private _destroyPreview() {\n if (this._preview) {\n removeNode(this._preview);\n }\n\n if (this._previewRef) {\n this._previewRef.destroy();\n }\n\n this._preview = this._previewRef = null!;\n }\n\n /** Destroys the placeholder element and its ViewRef. */\n private _destroyPlaceholder() {\n if (this._placeholder) {\n removeNode(this._placeholder);\n }\n\n if (this._placeholderRef) {\n this._placeholderRef.destroy();\n }\n\n this._placeholder = this._placeholderRef = null!;\n }\n\n /** Handler for the `mousedown`/`touchstart` events. */\n private _pointerDown = (event: MouseEvent | TouchEvent) => {\n this.beforeStarted.next();\n\n // Delegate the event based on whether it started from a handle or the element itself.\n if (this._handles.length) {\n const targetHandle = this._handles.find(handle => {\n const target = event.target;\n return !!target && (target === handle || handle.contains(target as HTMLElement));\n });\n\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n this._initializeDragSequence(targetHandle, event);\n }\n } else if (!this.disabled) {\n this._initializeDragSequence(this._rootElement, event);\n }\n }\n\n /** Handler that is invoked when the user moves their pointer after they've initiated a drag. */\n private _pointerMove = (event: MouseEvent | TouchEvent) => {\n // Prevent the default action as early as possible in order to block\n // native actions like dragging the selected text or images with the mouse.\n event.preventDefault();\n\n if (!this._hasStartedDragging) {\n const pointerPosition = this._getPointerPositionOnPage(event);\n const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x);\n const distanceY = Math.abs(pointerPosition.y - this._pickupPositionOnPage.y);\n const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold;\n\n // Only start dragging after the user has moved more than the minimum distance in either\n // direction. Note that this is preferrable over doing something like `skip(minimumDistance)`\n // in the `pointerMove` subscription, because we're not guaranteed to have one move event\n // per pixel of movement (e.g. if the user moves their pointer quickly).\n if (isOverThreshold) {\n const isDelayElapsed = Date.now() >= this._dragStartTime + this._getDragStartDelay(event);\n if (!isDelayElapsed) {\n this._endDragSequence(event);\n return;\n }\n\n // Prevent other drag sequences from starting while something in the container is still\n // being dragged. This can happen while we're waiting for the drop animation to finish\n // and can cause errors, because some elements might still be moving around.\n if (!this._dropContainer || !this._dropContainer.isDragging()) {\n this._hasStartedDragging = true;\n this._ngZone.run(() => this._startDragSequence(event));\n }\n }\n\n return;\n }\n\n // We only need the preview dimensions if we have a boundary element.\n if (this._boundaryElement) {\n // Cache the preview element rect if we haven't cached it already or if\n // we cached it too early before the element dimensions were computed.\n if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {\n this._previewRect = (this._preview || this._rootElement).getBoundingClientRect();\n }\n }\n\n const constrainedPointerPosition = this._getConstrainedPointerPosition(event);\n this._hasMoved = true;\n this._updatePointerDirectionDelta(constrainedPointerPosition);\n\n if (this._dropContainer) {\n this._updateActiveDropContainer(constrainedPointerPosition);\n } else {\n const activeTransform = this._activeTransform;\n activeTransform.x =\n constrainedPointerPosition.x - this._pickupPositionOnPage.x + this._passiveTransform.x;\n activeTransform.y =\n constrainedPointerPosition.y - this._pickupPositionOnPage.y + this._passiveTransform.y;\n\n this._applyRootElementTransform(activeTransform.x, activeTransform.y);\n\n // Apply transform as attribute if dragging and svg element to work for IE\n if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) {\n const appliedTransform = `translate(${activeTransform.x} ${activeTransform.y})`;\n this._rootElement.setAttribute('transform', appliedTransform);\n }\n }\n\n // Since this event gets fired for every pixel while dragging, we only\n // want to fire it if the consumer opted into it. Also we have to\n // re-enter the zone because we run all of the events on the outside.\n if (this._moveEvents.observers.length) {\n this._ngZone.run(() => {\n this._moveEvents.next({\n source: this,\n pointerPosition: constrainedPointerPosition,\n event,\n distance: this._getDragDistance(constrainedPointerPosition),\n delta: this._pointerDirectionDelta\n });\n });\n }\n }\n\n /** Handler that is invoked when the user lifts their pointer up, after initiating a drag. */\n private _pointerUp = (event: MouseEvent | TouchEvent) => {\n this._endDragSequence(event);\n }\n\n /**\n * Clears subscriptions and stops the dragging sequence.\n * @param event Browser event object that ended the sequence.\n */\n private _endDragSequence(event: MouseEvent | TouchEvent) {\n // Note that here we use `isDragging` from the service, rather than from `this`.\n // The difference is that the one from the service reflects whether a dragging sequence\n // has been initiated, whereas the one on `this` includes whether the user has passed\n // the minimum dragging threshold.\n if (!this._dragDropRegistry.isDragging(this)) {\n return;\n }\n\n this._removeSubscriptions();\n this._dragDropRegistry.stopDragging(this);\n this._toggleNativeDragInteractions();\n\n if (this._handles) {\n this._rootElement.style.webkitTapHighlightColor = this._rootElementTapHighlight;\n }\n\n if (!this._hasStartedDragging) {\n return;\n }\n\n this.released.next({source: this});\n\n if (this._dropContainer) {\n // Stop scrolling immediately, instead of waiting for the animation to finish.\n this._dropContainer._stopScrolling();\n this._animatePreviewToPlaceholder().then(() => {\n this._cleanupDragArtifacts(event);\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n });\n } else {\n // Convert the active transform into a passive one. This means that next time\n // the user starts dragging the item, its position will be calculated relatively\n // to the new passive transform.\n this._passiveTransform.x = this._activeTransform.x;\n this._passiveTransform.y = this._activeTransform.y;\n this._ngZone.run(() => {\n this.ended.next({\n source: this,\n distance: this._getDragDistance(this._getPointerPositionOnPage(event))\n });\n });\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n }\n }\n\n /** Starts the dragging sequence. */\n private _startDragSequence(event: MouseEvent | TouchEvent) {\n // Emit the event on the item before the one on the container.\n this.started.next({source: this});\n\n if (isTouchEvent(event)) {\n this._lastTouchEventTime = Date.now();\n }\n\n this._toggleNativeDragInteractions();\n\n if (this._dropContainer) {\n const element = this._rootElement;\n const parent = element.parentNode!;\n const preview = this._preview = this._createPreviewElement();\n const placeholder = this._placeholder = this._createPlaceholderElement();\n const anchor = this._anchor = this._anchor || this._document.createComment('');\n\n // Insert an anchor node so that we can restore the element's position in the DOM.\n parent.insertBefore(anchor, element);\n\n // We move the element out at the end of the body and we make it hidden, because keeping it in\n // place will throw off the consumer's `:last-child` selectors. We can't remove the element\n // from the DOM completely, because iOS will stop firing all subsequent events in the chain.\n element.style.display = 'none';\n this._document.body.appendChild(parent.replaceChild(placeholder, element));\n getPreviewInsertionPoint(this._document).appendChild(preview);\n this._dropContainer.start();\n this._initialContainer = this._dropContainer;\n this._initialIndex = this._dropContainer.getItemIndex(this);\n } else {\n this._initialContainer = this._initialIndex = undefined!;\n }\n }\n\n /**\n * Sets up the different variables and subscriptions\n * that will be necessary for the dragging sequence.\n * @param referenceElement Element that started the drag sequence.\n * @param event Browser event object that started the sequence.\n */\n private _initializeDragSequence(referenceElement: HTMLElement, event: MouseEvent | TouchEvent) {\n // Always stop propagation for the event that initializes\n // the dragging sequence, in order to prevent it from potentially\n // starting another sequence for a draggable parent somewhere up the DOM tree.\n event.stopPropagation();\n\n const isDragging = this.isDragging();\n const isTouchSequence = isTouchEvent(event);\n const isAuxiliaryMouseButton = !isTouchSequence && (event as MouseEvent).button !== 0;\n const rootElement = this._rootElement;\n const isSyntheticEvent = !isTouchSequence && this._lastTouchEventTime &&\n this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now();\n\n // If the event started from an element with the native HTML drag&drop, it'll interfere\n // with our own dragging (e.g. `img` tags do it by default). Prevent the default action\n // to stop it from happening. Note that preventing on `dragstart` also seems to work, but\n // it's flaky and it fails if the user drags it away quickly. Also note that we only want\n // to do this for `mousedown` since doing the same for `touchstart` will stop any `click`\n // events from firing on touch devices.\n if (event.target && (event.target as HTMLElement).draggable && event.type === 'mousedown') {\n event.preventDefault();\n }\n\n // Abort if the user is already dragging or is using a mouse button other than the primary one.\n if (isDragging || isAuxiliaryMouseButton || isSyntheticEvent) {\n return;\n }\n\n // If we've got handles, we need to disable the tap highlight on the entire root element,\n // otherwise iOS will still add it, even though all the drag interactions on the handle\n // are disabled.\n if (this._handles.length) {\n this._rootElementTapHighlight = rootElement.style.webkitTapHighlightColor;\n rootElement.style.webkitTapHighlightColor = 'transparent';\n }\n\n this._hasStartedDragging = this._hasMoved = false;\n\n // Avoid multiple subscriptions and memory leaks when multi touch\n // (isDragging check above isn't enough because of possible temporal and/or dimensional delays)\n this._removeSubscriptions();\n this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);\n this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);\n this._scrollSubscription = this._dragDropRegistry.scroll.pipe(startWith(null)).subscribe(() => {\n this._scrollPosition = this._viewportRuler.getViewportScrollPosition();\n });\n\n if (this._boundaryElement) {\n this._boundaryRect = this._boundaryElement.getBoundingClientRect();\n }\n\n // If we have a custom preview we can't know ahead of time how large it'll be so we position\n // it next to the cursor. The exception is when the consumer has opted into making the preview\n // the same size as the root element, in which case we do know the size.\n const previewTemplate = this._previewTemplate;\n this._pickupPositionInElement = previewTemplate && previewTemplate.template &&\n !previewTemplate.matchSize ? {x: 0, y: 0} :\n this._getPointerPositionInElement(referenceElement, event);\n const pointerPosition = this._pickupPositionOnPage = this._getPointerPositionOnPage(event);\n this._pointerDirectionDelta = {x: 0, y: 0};\n this._pointerPositionAtLastDirectionChange = {x: pointerPosition.x, y: pointerPosition.y};\n this._dragStartTime = Date.now();\n this._dragDropRegistry.startDragging(this, event);\n }\n\n /** Cleans up the DOM artifacts that were added to facilitate the element being dragged. */\n private _cleanupDragArtifacts(event: MouseEvent | TouchEvent) {\n // Restore the element's visibility and insert it at its old position in the DOM.\n // It's important that we maintain the position, because moving the element around in the DOM\n // can throw off `NgFor` which does smart diffing and re-creates elements only when necessary,\n // while moving the existing elements in all other cases.\n this._rootElement.style.display = '';\n this._anchor.parentNode!.replaceChild(this._rootElement, this._anchor);\n\n this._destroyPreview();\n this._destroyPlaceholder();\n this._boundaryRect = this._previewRect = undefined;\n\n // Re-enter the NgZone since we bound `document` events on the outside.\n this._ngZone.run(() => {\n const container = this._dropContainer!;\n const currentIndex = container.getItemIndex(this);\n const pointerPosition = this._getPointerPositionOnPage(event);\n const distance = this._getDragDistance(this._getPointerPositionOnPage(event));\n const isPointerOverContainer = container._isOverContainer(\n pointerPosition.x, pointerPosition.y);\n\n this.ended.next({source: this, distance});\n this.dropped.next({\n item: this,\n currentIndex,\n previousIndex: this._initialIndex,\n container: container,\n previousContainer: this._initialContainer,\n isPointerOverContainer,\n distance\n });\n container.drop(this, currentIndex, this._initialContainer, isPointerOverContainer, distance,\n this._initialIndex);\n this._dropContainer = this._initialContainer;\n });\n }\n\n /**\n * Updates the item's position in its drop container, or moves it\n * into a new one, depending on its current drag position.\n */\n private _updateActiveDropContainer({x, y}: Point) {\n // Drop container that draggable has been moved into.\n let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y);\n\n // If we couldn't find a new container to move the item into, and the item has left its\n // initial container, check whether the it's over the initial container. This handles the\n // case where two containers are connected one way and the user tries to undo dragging an\n // item into a new container.\n if (!newContainer && this._dropContainer !== this._initialContainer &&\n this._initialContainer._isOverContainer(x, y)) {\n newContainer = this._initialContainer;\n }\n\n if (newContainer && newContainer !== this._dropContainer) {\n this._ngZone.run(() => {\n // Notify the old container that the item has left.\n this.exited.next({item: this, container: this._dropContainer!});\n this._dropContainer!.exit(this);\n // Notify the new container that the item has entered.\n this._dropContainer = newContainer!;\n this._dropContainer.enter(this, x, y,\n // If we're re-entering the initial container,\n // put item the into its starting index to begin with.\n newContainer === this._initialContainer ? this._initialIndex : undefined);\n this.entered.next({\n item: this,\n container: newContainer!,\n currentIndex: newContainer!.getItemIndex(this)\n });\n });\n }\n\n this._dropContainer!._startScrollingIfNecessary(x, y);\n this._dropContainer!._sortItem(this, x, y, this._pointerDirectionDelta);\n this._preview.style.transform =\n getTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y);\n }\n\n /**\n * Creates the element that will be rendered next to the user's pointer\n * and will be used as a preview of the element that is being dragged.\n */\n private _createPreviewElement(): HTMLElement {\n const previewConfig = this._previewTemplate;\n const previewClass = this.previewClass;\n const previewTemplate = previewConfig ? previewConfig.template : null;\n let preview: HTMLElement;\n\n if (previewTemplate) {\n const viewRef = previewConfig!.viewContainer.createEmbeddedView(previewTemplate,\n previewConfig!.context);\n preview = getRootNode(viewRef, this._document);\n this._previewRef = viewRef;\n\n if (previewConfig!.matchSize) {\n matchElementSize(preview, this._rootElement);\n } else {\n preview.style.transform =\n getTransform(this._pickupPositionOnPage.x, this._pickupPositionOnPage.y);\n }\n } else {\n const element = this._rootElement;\n preview = deepCloneNode(element);\n matchElementSize(preview, element);\n }\n\n extendStyles(preview.style, {\n // It's important that we disable the pointer events on the preview, because\n // it can throw off the `document.elementFromPoint` calls in the `CdkDropList`.\n pointerEvents: 'none',\n // We have to reset the margin, because it can throw off positioning relative to the viewport.\n margin: '0',\n position: 'fixed',\n top: '0',\n left: '0',\n zIndex: '1000'\n });\n\n toggleNativeDragInteractions(preview, false);\n preview.classList.add('cdk-drag-preview');\n preview.setAttribute('dir', this._direction);\n\n if (previewClass) {\n if (Array.isArray(previewClass)) {\n previewClass.forEach(className => preview.classList.add(className));\n } else {\n preview.classList.add(previewClass);\n }\n }\n\n return preview;\n }\n\n /**\n * Animates the preview element from its current position to the location of the drop placeholder.\n * @returns Promise that resolves when the animation completes.\n */\n private _animatePreviewToPlaceholder(): Promise<void> {\n // If the user hasn't moved yet, the transitionend event won't fire.\n if (!this._hasMoved) {\n return Promise.resolve();\n }\n\n const placeholderRect = this._placeholder.getBoundingClientRect();\n\n // Apply the class that adds a transition to the preview.\n this._preview.classList.add('cdk-drag-animating');\n\n // Move the preview to the placeholder position.\n this._preview.style.transform = getTransform(placeholderRect.left, placeholderRect.top);\n\n // If the element doesn't have a `transition`, the `transitionend` event won't fire. Since\n // we need to trigger a style recalculation in order for the `cdk-drag-animating` class to\n // apply its style, we take advantage of the available info to figure out whether we need to\n // bind the event in the first place.\n const duration = getTransformTransitionDurationInMs(this._preview);\n\n if (duration === 0) {\n return Promise.resolve();\n }\n\n return this._ngZone.runOutsideAngular(() => {\n return new Promise(resolve => {\n const handler = ((event: TransitionEvent) => {\n if (!event || (event.target === this._preview && event.propertyName === 'transform')) {\n this._preview.removeEventListener('transitionend', handler);\n resolve();\n clearTimeout(timeout);\n }\n }) as EventListenerOrEventListenerObject;\n\n // If a transition is short enough, the browser might not fire the `transitionend` event.\n // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll\n // fire if the transition hasn't completed when it was supposed to.\n const timeout = setTimeout(handler as Function, duration * 1.5);\n this._preview.addEventListener('transitionend', handler);\n });\n });\n }\n\n /** Creates an element that will be shown instead of the current element while dragging. */\n private _createPlaceholderElement(): HTMLElement {\n const placeholderConfig = this._placeholderTemplate;\n const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null;\n let placeholder: HTMLElement;\n\n if (placeholderTemplate) {\n this._placeholderRef = placeholderConfig!.viewContainer.createEmbeddedView(\n placeholderTemplate,\n placeholderConfig!.context\n );\n placeholder = getRootNode(this._placeholderRef, this._document);\n } else {\n placeholder = deepCloneNode(this._rootElement);\n }\n\n placeholder.classList.add('cdk-drag-placeholder');\n return placeholder;\n }\n\n /**\n * Figures out the coordinates at which an element was picked up.\n * @param referenceElement Element that initiated the dragging.\n * @param event Event that initiated the dragging.\n */\n private _getPointerPositionInElement(referenceElement: HTMLElement,\n event: MouseEvent | TouchEvent): Point {\n const elementRect = this._rootElement.getBoundingClientRect();\n const handleElement = referenceElement === this._rootElement ? null : referenceElement;\n const referenceRect = handleElement ? handleElement.getBoundingClientRect() : elementRect;\n const point = isTouchEvent(event) ? event.targetTouches[0] : event;\n const x = point.pageX - referenceRect.left - this._scrollPosition.left;\n const y = point.pageY - referenceRect.top - this._scrollPosition.top;\n\n return {\n x: referenceRect.left - elementRect.left + x,\n y: referenceRect.top - elementRect.top + y\n };\n }\n\n /** Determines the point of the page that was touched by the user. */\n private _getPointerPositionOnPage(event: MouseEvent | TouchEvent): Point {\n // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\n const point = isTouchEvent(event) ? (event.touches[0] || event.changedTouches[0]) : event;\n\n return {\n x: point.pageX - this._scrollPosition.left,\n y: point.pageY - this._scrollPosition.top\n };\n }\n\n\n /** Gets the pointer position on the page, accounting for any position constraints. */\n private _getConstrainedPointerPosition(event: MouseEvent | TouchEvent): Point {\n const point = this._getPointerPositionOnPage(event);\n const constrainedPoint = this.constrainPosition ? this.constrainPosition(point, this) : point;\n const dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null;\n\n if (this.lockAxis === 'x' || dropContainerLock === 'x') {\n constrainedPoint.y = this._pickupPositionOnPage.y;\n } else if (this.lockAxis === 'y' || dropContainerLock === 'y') {\n constrainedPoint.x = this._pickupPositionOnPage.x;\n }\n\n if (this._boundaryRect) {\n const {x: pickupX, y: pickupY} = this._pickupPositionInElement;\n const boundaryRect = this._boundaryRect;\n const previewRect = this._previewRect!;\n const minY = boundaryRect.top + pickupY;\n const maxY = boundaryRect.bottom - (previewRect.height - pickupY);\n const minX = boundaryRect.left + pickupX;\n const maxX = boundaryRect.right - (previewRect.width - pickupX);\n\n constrainedPoint.x = clamp(constrainedPoint.x, minX, maxX);\n constrainedPoint.y = clamp(constrainedPoint.y, minY, maxY);\n }\n\n return constrainedPoint;\n }\n\n\n /** Updates the current drag delta, based on the user's current pointer position on the page. */\n private _updatePointerDirectionDelta(pointerPositionOnPage: Point) {\n const {x, y} = pointerPositionOnPage;\n const delta = this._pointerDirectionDelta;\n const positionSinceLastChange = this._pointerPositionAtLastDirectionChange;\n\n // Amount of pixels the user has dragged since the last time the direction changed.\n const changeX = Math.abs(x - positionSinceLastChange.x);\n const changeY = Math.abs(y - positionSinceLastChange.y);\n\n // Because we handle pointer events on a per-pixel basis, we don't want the delta\n // to change for every pixel, otherwise anything that depends on it can look erratic.\n // To make the delta more consistent, we track how much the user has moved since the last\n // delta change and we only update it after it has reached a certain threshold.\n if (changeX > this._config.pointerDirectionChangeThreshold) {\n delta.x = x > positionSinceLastChange.x ? 1 : -1;\n positionSinceLastChange.x = x;\n }\n\n if (changeY > this._config.pointerDirectionChangeThreshold) {\n delta.y = y > positionSinceLastChange.y ? 1 : -1;\n positionSinceLastChange.y = y;\n }\n\n return delta;\n }\n\n /** Toggles the native drag interactions, based on how many handles are registered. */\n private _toggleNativeDragInteractions() {\n if (!this._rootElement || !this._handles) {\n return;\n }\n\n const shouldEnable = this._handles.length > 0 || !this.isDragging();\n\n if (shouldEnable !== this._nativeInteractionsEnabled) {\n this._nativeInteractionsEnabled = shouldEnable;\n toggleNativeDragInteractions(this._rootElement, shouldEnable);\n }\n }\n\n /** Removes the manually-added event listeners from the root element. */\n private _removeRootElementListeners(element: HTMLElement) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n }\n\n /**\n * Applies a `transform` to the root element, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n private _applyRootElementTransform(x: number, y: number) {\n const transform = getTransform(x, y);\n\n // Cache the previous transform amount only after the first drag sequence, because\n // we don't want our own transforms to stack on top of each other.\n if (this._initialTransform == null) {\n this._initialTransform = this._rootElement.style.transform || '';\n }\n\n // Preserve the previous `transform` value, if there was one. Note that we apply our own\n // transform before the user's, because things like rotation can affect which direction\n // the element will be translated towards.\n this._rootElement.style.transform = this._initialTransform ?\n transform + ' ' + this._initialTransform : transform;\n }\n\n /**\n * Gets the distance that the user has dragged during the current drag sequence.\n * @param currentPosition Current position of the user's pointer.\n */\n private _getDragDistance(currentPosition: Point): Point {\n const pickupPosition = this._pickupPositionOnPage;\n\n if (pickupPosition) {\n return {x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y};\n }\n\n return {x: 0, y: 0};\n }\n\n /** Cleans up any cached element dimensions that we don't need after dragging has stopped. */\n private _cleanupCachedDimensions() {\n this._boundaryRect = this._previewRect = undefined;\n }\n\n /**\n * Checks whether the element is still inside its boundary after the viewport has been resized.\n * If not, the position is adjusted so that the element fits again.\n */\n private _containInsideBoundaryOnResize() {\n let {x, y} = this._passiveTransform;\n\n if ((x === 0 && y === 0) || this.isDragging() || !this._boundaryElement) {\n return;\n }\n\n const boundaryRect = this._boundaryElement.getBoundingClientRect();\n const elementRect = this._rootElement.getBoundingClientRect();\n\n // It's possible that the element got hidden away after dragging (e.g. by switching to a\n // different tab). Don't do anything in this case so we don't clear the user's position.\n if ((boundaryRect.width === 0 && boundaryRect.height === 0) ||\n (elementRect.width === 0 && elementRect.height === 0)) {\n return;\n }\n\n const leftOverflow = boundaryRect.left - elementRect.left;\n const rightOverflow = elementRect.right - boundaryRect.right;\n const topOverflow = boundaryRect.top - elementRect.top;\n const bottomOverflow = elementRect.bottom - boundaryRect.bottom;\n\n // If the element has become wider than the boundary, we can't\n // do much to make it fit so we just anchor it to the left.\n if (boundaryRect.width > elementRect.width) {\n if (leftOverflow > 0) {\n x += leftOverflow;\n }\n\n if (rightOverflow > 0) {\n x -= rightOverflow;\n }\n } else {\n x = 0;\n }\n\n // If the element has become taller than the boundary, we can't\n // do much to make it fit so we just anchor it to the top.\n if (boundaryRect.height > elementRect.height) {\n if (topOverflow > 0) {\n y += topOverflow;\n }\n\n if (bottomOverflow > 0) {\n y -= bottomOverflow;\n }\n } else {\n y = 0;\n }\n\n if (x !== this._passiveTransform.x || y !== this._passiveTransform.y) {\n this.setFreeDragPosition({y, x});\n }\n }\n\n /** Gets the drag start delay, based on the event type. */\n private _getDragStartDelay(event: MouseEvent | TouchEvent): number {\n const value = this.dragStartDelay;\n\n if (typeof value === 'number') {\n return value;\n } else if (isTouchEvent(event)) {\n return value.touch;\n }\n\n return value ? value.mouse : 0;\n }\n}\n\n/**\n * Gets a 3d `transform` that can be applied to an element.\n * @param x Desired position of the element along the X axis.\n * @param y Desired position of the element along the Y axis.\n */\nfunction getTransform(x: number, y: number): string {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;\n}\n\n/** Creates a deep clone of an element. */\nfunction deepCloneNode(node: HTMLElement): HTMLElement {\n const clone = node.cloneNode(true) as HTMLElement;\n const descendantsWithId = clone.querySelectorAll('[id]');\n const descendantCanvases = node.querySelectorAll('canvas');\n\n // Remove the `id` to avoid having multiple elements with the same id on the page.\n clone.removeAttribute('id');\n\n for (let i = 0; i < descendantsWithId.length; i++) {\n descendantsWithId[i].removeAttribute('id');\n }\n\n // `cloneNode` won't transfer the content of `canvas` elements so we have to do it ourselves.\n // We match up the cloned canvas to their sources using their index in the DOM.\n if (descendantCanvases.length) {\n const cloneCanvases = clone.querySelectorAll('canvas');\n\n for (let i = 0; i < descendantCanvases.length; i++) {\n const correspondingCloneContext = cloneCanvases[i].getContext('2d');\n\n if (correspondingCloneContext) {\n correspondingCloneContext.drawImage(descendantCanvases[i], 0, 0);\n }\n }\n }\n\n return clone;\n}\n\n/** Clamps a value between a minimum and a maximum. */\nfunction clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * Helper to remove a node from the DOM and to do all the necessary null checks.\n * @param node Node to be removed.\n */\nfunction removeNode(node: Node | null) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\n\n/** Determines whether an event is a touch event. */\nfunction isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {\n // This function is called for every pixel that the user has dragged so we need it to be\n // as fast as possible. Since we only bind mouse events and touch events, we can assume\n // that if the event's name starts with `t`, it's a touch event.\n return event.type[0] === 't';\n}\n\n/** Gets the element into which the drag preview should be inserted. */\nfunction getPreviewInsertionPoint(documentRef: any): HTMLElement {\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n // TODO(crisbeto): dedupe this with the `FullscreenOverlayContainer` eventually.\n return documentRef.fullscreenElement ||\n documentRef.webkitFullscreenElement ||\n documentRef.mozFullScreenElement ||\n documentRef.msFullscreenElement ||\n documentRef.body;\n}\n\n/**\n * Gets the root HTML element of an embedded view.\n * If the root is not an HTML element it gets wrapped in one.\n */\nfunction getRootNode(viewRef: EmbeddedViewRef<any>, _document: Document): HTMLElement {\n const rootNode: Node = viewRef.rootNodes[0];\n\n if (rootNode.nodeType !== _document.ELEMENT_NODE) {\n const wrapper = _document.createElement('div');\n wrapper.appendChild(rootNode);\n return wrapper;\n }\n\n return rootNode as HTMLElement;\n}\n\n/**\n * Matches the target element's size to the source's size.\n * @param target Element that needs to be resized.\n * @param source Element whose size needs to be matched.\n */\nfunction matchElementSize(target: HTMLElement, source: HTMLElement): void {\n const sourceRect = source.getBoundingClientRect();\n\n target.style.width = `${sourceRect.width}px`;\n target.style.height = `${sourceRect.height}px`;\n target.style.transform = getTransform(sourceRect.left, sourceRect.top);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Moves an item one index in an array to another.\n * @param array Array in which to move the item.\n * @param fromIndex Starting index of the item.\n * @param toIndex Index to which the item should be moved.\n */\nexport function moveItemInArray<T = any>(array: T[], fromIndex: number, toIndex: number): void {\n const from = clamp(fromIndex, array.length - 1);\n const to = clamp(toIndex, array.length - 1);\n\n if (from === to) {\n return;\n }\n\n const target = array[from];\n const delta = to < from ? -1 : 1;\n\n for (let i = from; i !== to; i += delta) {\n array[i] = array[i + delta];\n }\n\n array[to] = target;\n}\n\n\n/**\n * Moves an item from one array to another.\n * @param currentArray Array from which to transfer the item.\n * @param targetArray Array into which to put the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n */\nexport function transferArrayItem<T = any>(currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number): void {\n const from = clamp(currentIndex, currentArray.length - 1);\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n}\n\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @param currentArray Array from which to copy the item.\n * @param targetArray Array into which is copy the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n *\n */\nexport function copyArrayItem<T = any>(currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number): void {\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n}\n\n/** Clamps a number between zero and a maximum. */\nfunction clamp(value: number, max: number): number {\n return Math.max(0, Math.min(max, value));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef, NgZone} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {_supportsShadowDom} from '@angular/cdk/platform';\nimport {Subject, Subscription, interval, animationFrameScheduler} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {moveItemInArray} from './drag-utils';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport {DragRefInternal as DragRef, Point} from './drag-ref';\n\n/**\n * Proximity, as a ratio to width/height, at which a\n * dragged item will affect the drop container.\n */\nconst DROP_PROXIMITY_THRESHOLD = 0.05;\n\n/**\n * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the\n * viewport. The value comes from trying it out manually until it feels right.\n */\nconst SCROLL_PROXIMITY_THRESHOLD = 0.05;\n\n/**\n * Number of pixels to scroll for each frame when auto-scrolling an element.\n * The value comes from trying it out manually until it feels right.\n */\nconst AUTO_SCROLL_STEP = 2;\n\n/**\n * Entry in the position cache for draggable items.\n * @docs-private\n */\ninterface CachedItemPosition {\n /** Instance of the drag item. */\n drag: DragRef;\n /** Dimensions of the item. */\n clientRect: ClientRect;\n /** Amount by which the item has been moved since dragging started. */\n offset: number;\n}\n\n/** Object holding the scroll position of something. */\ninterface ScrollPosition {\n top: number;\n left: number;\n}\n\n/** Vertical direction in which we can auto-scroll. */\nconst enum AutoScrollVerticalDirection {NONE, UP, DOWN}\n\n/** Horizontal direction in which we can auto-scroll. */\nconst enum AutoScrollHorizontalDirection {NONE, LEFT, RIGHT}\n\n/**\n * Internal compile-time-only representation of a `DropListRef`.\n * Used to avoid circular import issues between the `DropListRef` and the `DragRef`.\n * @docs-private\n */\nexport interface DropListRefInternal extends DropListRef {}\n\n/**\n * Reference to a drop list. Used to manipulate or dispose of the container.\n */\nexport class DropListRef<T = any> {\n /** Element that the drop list is attached to. */\n element: HTMLElement | ElementRef<HTMLElement>;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n disabled: boolean = false;\n\n /** Whether sorting items within the list is disabled. */\n sortingDisabled: boolean = false;\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n lockAxis: 'x' | 'y';\n\n /**\n * Whether auto-scrolling the view when the user\n * moves their pointer close to the edges is disabled.\n */\n autoScrollDisabled: boolean = false;\n\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n enterPredicate: (drag: DragRef, drop: DropListRef) => boolean = () => true;\n\n /** Emits right before dragging has started. */\n beforeStarted = new Subject<void>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n entered = new Subject<{item: DragRef, container: DropListRef, currentIndex: number}>();\n\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n exited = new Subject<{item: DragRef, container: DropListRef}>();\n\n /** Emits when the user drops an item inside the container. */\n dropped = new Subject<{\n item: DragRef,\n currentIndex: number,\n previousIndex: number,\n container: DropListRef,\n previousContainer: DropListRef,\n isPointerOverContainer: boolean,\n distance: Point;\n }>();\n\n /** Emits as the user is swapping items while actively dragging. */\n sorted = new Subject<{\n previousIndex: number,\n currentIndex: number,\n container: DropListRef,\n item: DragRef\n }>();\n\n /** Arbitrary data that can be attached to the drop list. */\n data: T;\n\n /** Whether an item in the list is being dragged. */\n private _isDragging = false;\n\n /** Cache of the dimensions of all the items inside the container. */\n private _itemPositions: CachedItemPosition[] = [];\n\n /** Cached positions of the scrollable parent elements. */\n private _parentPositions = new Map<Document|HTMLElement, {\n scrollPosition: ScrollPosition,\n clientRect?: ClientRect\n }>();\n\n /** Cached `ClientRect` of the drop list. */\n private _clientRect: ClientRect;\n\n /**\n * Draggable items that are currently active inside the container. Includes the items\n * from `_draggables`, as well as any items that have been dragged in, but haven't\n * been dropped yet.\n */\n private _activeDraggables: DragRef[];\n\n /**\n * Keeps track of the item that was last swapped with the dragged item, as\n * well as what direction the pointer was moving in when the swap occured.\n */\n private _previousSwap = {drag: null as DragRef | null, delta: 0};\n\n /** Draggable items in the container. */\n private _draggables: ReadonlyArray<DragRef>;\n\n /** Drop lists that are connected to the current one. */\n private _siblings: ReadonlyArray<DropListRef> = [];\n\n /** Direction in which the list is oriented. */\n private _orientation: 'horizontal' | 'vertical' = 'vertical';\n\n /** Connected siblings that currently have a dragged item. */\n private _activeSiblings = new Set<DropListRef>();\n\n /** Layout direction of the drop list. */\n private _direction: Direction = 'ltr';\n\n /** Subscription to the window being scrolled. */\n private _viewportScrollSubscription = Subscription.EMPTY;\n\n /** Vertical direction in which the list is currently scrolling. */\n private _verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n\n /** Horizontal direction in which the list is currently scrolling. */\n private _horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n /** Node that is being auto-scrolled. */\n private _scrollNode: HTMLElement | Window;\n\n /** Used to signal to the current auto-scroll sequence when to stop. */\n private _stopScrollTimers = new Subject<void>();\n\n /** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */\n private _cachedShadowRoot: DocumentOrShadowRoot | null = null;\n\n /** Reference to the document. */\n private _document: Document;\n\n /** Elements that can be scrolled while the user is dragging. */\n private _scrollableElements: HTMLElement[];\n\n /** Initial value for the element's `scroll-snap-type` style. */\n private _initialScrollSnap: string;\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>,\n _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler) {\n this.element = coerceElement(element);\n this._document = _document;\n this.withScrollableParents([this.element]);\n _dragDropRegistry.registerDropContainer(this);\n }\n\n /** Removes the drop list functionality from the DOM element. */\n dispose() {\n this._stopScrolling();\n this._stopScrollTimers.complete();\n this._viewportScrollSubscription.unsubscribe();\n this.beforeStarted.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this.sorted.complete();\n this._activeSiblings.clear();\n this._scrollNode = null!;\n this._parentPositions.clear();\n this._dragDropRegistry.removeDropContainer(this);\n }\n\n /** Whether an item from this list is currently being dragged. */\n isDragging() {\n return this._isDragging;\n }\n\n /** Starts dragging an item. */\n start(): void {\n const styles = coerceElement(this.element).style;\n this.beforeStarted.next();\n this._isDragging = true;\n\n // We need to disable scroll snapping while the user is dragging, because it breaks automatic\n // scrolling. The browser seems to round the value based on the snapping points which means\n // that we can't increment/decrement the scroll position.\n this._initialScrollSnap = styles.msScrollSnapType || (styles as any).scrollSnapType || '';\n (styles as any).scrollSnapType = styles.msScrollSnapType = 'none';\n this._cacheItems();\n this._siblings.forEach(sibling => sibling._startReceiving(this));\n this._viewportScrollSubscription.unsubscribe();\n this._listenToScrollEvents();\n }\n\n /**\n * Emits an event to indicate that the user moved an item into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void {\n this.start();\n\n // If sorting is disabled, we want the item to return to its starting\n // position if the user is returning it to its initial container.\n let newIndex: number;\n\n if (index == null) {\n newIndex = this.sortingDisabled ? this._draggables.indexOf(item) : -1;\n\n if (newIndex === -1) {\n // We use the coordinates of where the item entered the drop\n // zone to figure out at which index it should be inserted.\n newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY);\n }\n } else {\n newIndex = index;\n }\n\n const activeDraggables = this._activeDraggables;\n const currentIndex = activeDraggables.indexOf(item);\n const placeholder = item.getPlaceholderElement();\n let newPositionReference: DragRef | undefined = activeDraggables[newIndex];\n\n // If the item at the new position is the same as the item that is being dragged,\n // it means that we're trying to restore the item to its initial position. In this\n // case we should use the next item from the list as the reference.\n if (newPositionReference === item) {\n newPositionReference = activeDraggables[newIndex + 1];\n }\n\n // Since the item may be in the `activeDraggables` already (e.g. if the user dragged it\n // into another container and back again), we have to ensure that it isn't duplicated.\n if (currentIndex > -1) {\n activeDraggables.splice(currentIndex, 1);\n }\n\n // Don't use items that are being dragged as a reference, because\n // their element has been moved down to the bottom of the body.\n if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) {\n const element = newPositionReference.getRootElement();\n element.parentElement!.insertBefore(placeholder, element);\n activeDraggables.splice(newIndex, 0, item);\n } else {\n coerceElement(this.element).appendChild(placeholder);\n activeDraggables.push(item);\n }\n\n // The transform needs to be cleared so it doesn't throw off the measurements.\n placeholder.style.transform = '';\n\n // Note that the positions were already cached when we called `start` above,\n // but we need to refresh them since the amount of items has changed.\n this._cacheItemPositions();\n this.entered.next({item, container: this, currentIndex: this.getItemIndex(item)});\n }\n\n /**\n * Removes an item from the container after it was dragged into another container by the user.\n * @param item Item that was dragged out.\n */\n exit(item: DragRef): void {\n this._reset();\n this.exited.next({item, container: this});\n }\n\n /**\n * Drops an item into this container.\n * @param item Item being dropped into the container.\n * @param currentIndex Index at which the item should be inserted.\n * @param previousContainer Container from which the item got dragged in.\n * @param isPointerOverContainer Whether the user's pointer was over the\n * container when the item was dropped.\n * @param distance Distance the user has dragged since the start of the dragging sequence.\n * @param previousIndex Index of the item when dragging started.\n *\n * @breaking-change 11.0.0 `previousIndex` parameter to become required.\n */\n drop(item: DragRef, currentIndex: number, previousContainer: DropListRef,\n isPointerOverContainer: boolean, distance: Point, previousIndex?: number): void {\n this._reset();\n\n // @breaking-change 11.0.0 Remove this fallback logic once `previousIndex` is a required param.\n if (previousIndex == null) {\n previousIndex = previousContainer.getItemIndex(item);\n }\n\n this.dropped.next({item,\n currentIndex,\n previousIndex,\n container: this,\n previousContainer,\n isPointerOverContainer,\n distance\n });\n }\n\n /**\n * Sets the draggable items that are a part of this list.\n * @param items Items that are a part of this list.\n */\n withItems(items: DragRef[]): this {\n this._draggables = items;\n items.forEach(item => item._withDropContainer(this));\n\n if (this.isDragging()) {\n this._cacheItems();\n }\n\n return this;\n }\n\n /** Sets the layout direction of the drop list. */\n withDirection(direction: Direction): this {\n this._direction = direction;\n return this;\n }\n\n /**\n * Sets the containers that are connected to this one. When two or more containers are\n * connected, the user will be allowed to transfer items between them.\n * @param connectedTo Other containers that the current containers should be connected to.\n */\n connectedTo(connectedTo: DropListRef[]): this {\n this._siblings = connectedTo.slice();\n return this;\n }\n\n /**\n * Sets the orientation of the container.\n * @param orientation New orientation for the container.\n */\n withOrientation(orientation: 'vertical' | 'horizontal'): this {\n this._orientation = orientation;\n return this;\n }\n\n /**\n * Sets which parent elements are can be scrolled while the user is dragging.\n * @param elements Elements that can be scrolled.\n */\n withScrollableParents(elements: HTMLElement[]): this {\n const element = coerceElement(this.element);\n\n // We always allow the current element to be scrollable\n // so we need to ensure that it's in the array.\n this._scrollableElements =\n elements.indexOf(element) === -1 ? [element, ...elements] : elements.slice();\n return this;\n }\n\n /**\n * Figures out the index of an item in the container.\n * @param item Item whose index should be determined.\n */\n getItemIndex(item: DragRef): number {\n if (!this._isDragging) {\n return this._draggables.indexOf(item);\n }\n\n // Items are sorted always by top/left in the cache, however they flow differently in RTL.\n // The rest of the logic still stands no matter what orientation we're in, however\n // we need to invert the array when determining the index.\n const items = this._orientation === 'horizontal' && this._direction === 'rtl' ?\n this._itemPositions.slice().reverse() : this._itemPositions;\n\n return findIndex(items, currentItem => currentItem.drag === item);\n }\n\n /**\n * Whether the list is able to receive the item that\n * is currently being dragged inside a connected drop list.\n */\n isReceiving(): boolean {\n return this._activeSiblings.size > 0;\n }\n\n /**\n * Sorts an item inside the container based on its position.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n _sortItem(item: DragRef, pointerX: number, pointerY: number,\n pointerDelta: {x: number, y: number}): void {\n // Don't sort the item if sorting is disabled or it's out of range.\n if (this.sortingDisabled || !isPointerNearClientRect(this._clientRect, pointerX, pointerY)) {\n return;\n }\n\n const siblings = this._itemPositions;\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta);\n\n if (newIndex === -1 && siblings.length > 0) {\n return;\n }\n\n const isHorizontal = this._orientation === 'horizontal';\n const currentIndex = findIndex(siblings, currentItem => currentItem.drag === item);\n const siblingAtNewPosition = siblings[newIndex];\n const currentPosition = siblings[currentIndex].clientRect;\n const newPosition = siblingAtNewPosition.clientRect;\n const delta = currentIndex > newIndex ? 1 : -1;\n\n this._previousSwap.drag = siblingAtNewPosition.drag;\n this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y;\n\n // How many pixels the item's placeholder should be offset.\n const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta);\n\n // How many pixels all the other items should be offset.\n const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta);\n\n // Save the previous order of the items before moving the item to its new index.\n // We use this to check whether an item has been moved as a result of the sorting.\n const oldOrder = siblings.slice();\n\n // Shuffle the array in place.\n moveItemInArray(siblings, currentIndex, newIndex);\n\n this.sorted.next({\n previousIndex: currentIndex,\n currentIndex: newIndex,\n container: this,\n item\n });\n\n siblings.forEach((sibling, index) => {\n // Don't do anything if the position hasn't changed.\n if (oldOrder[index] === sibling) {\n return;\n }\n\n const isDraggedItem = sibling.drag === item;\n const offset = isDraggedItem ? itemOffset : siblingOffset;\n const elementToOffset = isDraggedItem ? item.getPlaceholderElement() :\n sibling.drag.getRootElement();\n\n // Update the offset to reflect the new position.\n sibling.offset += offset;\n\n // Since we're moving the items with a `transform`, we need to adjust their cached\n // client rects to reflect their new position, as well as swap their positions in the cache.\n // Note that we shouldn't use `getBoundingClientRect` here to update the cache, because the\n // elements may be mid-animation which will give us a wrong result.\n if (isHorizontal) {\n // Round the transforms since some browsers will\n // blur the elements, for sub-pixel transforms.\n elementToOffset.style.transform = `translate3d(${Math.round(sibling.offset)}px, 0, 0)`;\n adjustClientRect(sibling.clientRect, 0, offset);\n } else {\n elementToOffset.style.transform = `translate3d(0, ${Math.round(sibling.offset)}px, 0)`;\n adjustClientRect(sibling.clientRect, offset, 0);\n }\n });\n }\n\n /**\n * Checks whether the user's pointer is close to the edges of either the\n * viewport or the drop list and starts the auto-scroll sequence.\n * @param pointerX User's pointer position along the x axis.\n * @param pointerY User's pointer position along the y axis.\n */\n _startScrollingIfNecessary(pointerX: number, pointerY: number) {\n if (this.autoScrollDisabled) {\n return;\n }\n\n let scrollNode: HTMLElement | Window | undefined;\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Check whether we should start scrolling any of the parent containers.\n this._parentPositions.forEach((position, element) => {\n // We have special handling for the `document` below. Also this would be\n // nicer with a for...of loop, but it requires changing a compiler flag.\n if (element === this._document || !position.clientRect || scrollNode) {\n return;\n }\n\n if (isPointerNearClientRect(position.clientRect, pointerX, pointerY)) {\n [verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(\n element as HTMLElement, position.clientRect, pointerX, pointerY);\n\n if (verticalScrollDirection || horizontalScrollDirection) {\n scrollNode = element as HTMLElement;\n }\n }\n });\n\n // Otherwise check if we can start scrolling the viewport.\n if (!verticalScrollDirection && !horizontalScrollDirection) {\n const {width, height} = this._viewportRuler.getViewportSize();\n const clientRect = {width, height, top: 0, right: width, bottom: height, left: 0};\n verticalScrollDirection = getVerticalScrollDirection(clientRect, pointerY);\n horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);\n scrollNode = window;\n }\n\n if (scrollNode && (verticalScrollDirection !== this._verticalScrollDirection ||\n horizontalScrollDirection !== this._horizontalScrollDirection ||\n scrollNode !== this._scrollNode)) {\n this._verticalScrollDirection = verticalScrollDirection;\n this._horizontalScrollDirection = horizontalScrollDirection;\n this._scrollNode = scrollNode;\n\n if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) {\n this._ngZone.runOutsideAngular(this._startScrollInterval);\n } else {\n this._stopScrolling();\n }\n }\n }\n\n /** Stops any currently-running auto-scroll sequences. */\n _stopScrolling() {\n this._stopScrollTimers.next();\n }\n\n /** Caches the positions of the configured scrollable parents. */\n private _cacheParentPositions() {\n this._parentPositions.clear();\n this._parentPositions.set(this._document, {\n scrollPosition: this._viewportRuler!.getViewportScrollPosition(),\n });\n this._scrollableElements.forEach(element => {\n const clientRect = getMutableClientRect(element);\n\n // We keep the ClientRect cached in two properties, because it's referenced in a lot of\n // performance-sensitive places and we want to avoid the extra lookups. The `element` is\n // guaranteed to always be in the `_scrollableElements` so this should always match.\n if (element === this.element) {\n this._clientRect = clientRect;\n }\n\n this._parentPositions.set(element, {\n scrollPosition: {top: element.scrollTop, left: element.scrollLeft},\n clientRect\n });\n });\n }\n\n /** Refreshes the position cache of the items and sibling containers. */\n private _cacheItemPositions() {\n const isHorizontal = this._orientation === 'horizontal';\n\n this._itemPositions = this._activeDraggables.map(drag => {\n const elementToMeasure = drag.getVisibleElement();\n return {drag, offset: 0, clientRect: getMutableClientRect(elementToMeasure)};\n }).sort((a, b) => {\n return isHorizontal ? a.clientRect.left - b.clientRect.left :\n a.clientRect.top - b.clientRect.top;\n });\n }\n\n /** Resets the container to its initial state. */\n private _reset() {\n this._isDragging = false;\n\n const styles = coerceElement(this.element).style;\n (styles as any).scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap;\n\n // TODO(crisbeto): may have to wait for the animations to finish.\n this._activeDraggables.forEach(item => item.getRootElement().style.transform = '');\n this._siblings.forEach(sibling => sibling._stopReceiving(this));\n this._activeDraggables = [];\n this._itemPositions = [];\n this._previousSwap.drag = null;\n this._previousSwap.delta = 0;\n this._stopScrolling();\n this._viewportScrollSubscription.unsubscribe();\n this._parentPositions.clear();\n }\n\n /**\n * Gets the offset in pixels by which the items that aren't being dragged should be moved.\n * @param currentIndex Index of the item currently being dragged.\n * @param siblings All of the items in the list.\n * @param delta Direction in which the user is moving.\n */\n private _getSiblingOffsetPx(currentIndex: number,\n siblings: CachedItemPosition[],\n delta: 1 | -1) {\n\n const isHorizontal = this._orientation === 'horizontal';\n const currentPosition = siblings[currentIndex].clientRect;\n const immediateSibling = siblings[currentIndex + delta * -1];\n let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta;\n\n if (immediateSibling) {\n const start = isHorizontal ? 'left' : 'top';\n const end = isHorizontal ? 'right' : 'bottom';\n\n // Get the spacing between the start of the current item and the end of the one immediately\n // after it in the direction in which the user is dragging, or vice versa. We add it to the\n // offset in order to push the element to where it will be when it's inline and is influenced\n // by the `margin` of its siblings.\n if (delta === -1) {\n siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end];\n } else {\n siblingOffset += currentPosition[start] - immediateSibling.clientRect[end];\n }\n }\n\n return siblingOffset;\n }\n\n /**\n * Gets the offset in pixels by which the item that is being dragged should be moved.\n * @param currentPosition Current position of the item.\n * @param newPosition Position of the item where the current item should be moved.\n * @param delta Direction in which the user is moving.\n */\n private _getItemOffsetPx(currentPosition: ClientRect, newPosition: ClientRect, delta: 1 | -1) {\n const isHorizontal = this._orientation === 'horizontal';\n let itemOffset = isHorizontal ? newPosition.left - currentPosition.left :\n newPosition.top - currentPosition.top;\n\n // Account for differences in the item width/height.\n if (delta === -1) {\n itemOffset += isHorizontal ? newPosition.width - currentPosition.width :\n newPosition.height - currentPosition.height;\n }\n\n return itemOffset;\n }\n\n /**\n * Gets the index of an item in the drop container, based on the position of the user's pointer.\n * @param item Item that is being sorted.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n * @param delta Direction in which the user is moving their pointer.\n */\n private _getItemIndexFromPointerPosition(item: DragRef, pointerX: number, pointerY: number,\n delta?: {x: number, y: number}) {\n const isHorizontal = this._orientation === 'horizontal';\n\n return findIndex(this._itemPositions, ({drag, clientRect}, _, array) => {\n if (drag === item) {\n // If there's only one item left in the container, it must be\n // the dragged item itself so we use it as a reference.\n return array.length < 2;\n }\n\n if (delta) {\n const direction = isHorizontal ? delta.x : delta.y;\n\n // If the user is still hovering over the same item as last time, and they didn't change\n // the direction in which they're dragging, we don't consider it a direction swap.\n if (drag === this._previousSwap.drag && direction === this._previousSwap.delta) {\n return false;\n }\n }\n\n return isHorizontal ?\n // Round these down since most browsers report client rects with\n // sub-pixel precision, whereas the pointer coordinates are rounded to pixels.\n pointerX >= Math.floor(clientRect.left) && pointerX <= Math.floor(clientRect.right) :\n pointerY >= Math.floor(clientRect.top) && pointerY <= Math.floor(clientRect.bottom);\n });\n }\n\n /** Caches the current items in the list and their positions. */\n private _cacheItems(): void {\n this._activeDraggables = this._draggables.slice();\n this._cacheItemPositions();\n this._cacheParentPositions();\n }\n\n /**\n * Updates the internal state of the container after a scroll event has happened.\n * @param scrolledParent Element that was scrolled.\n * @param newTop New top scroll position.\n * @param newLeft New left scroll position.\n */\n private _updateAfterScroll(scrolledParent: HTMLElement | Document,\n newTop: number,\n newLeft: number) {\n const scrollPosition = this._parentPositions.get(scrolledParent)!.scrollPosition;\n const topDifference = scrollPosition.top - newTop;\n const leftDifference = scrollPosition.left - newLeft;\n\n // Go through and update the cached positions of the scroll\n // parents that are inside the element that was scrolled.\n this._parentPositions.forEach((position, node) => {\n if (position.clientRect && scrolledParent !== node && scrolledParent.contains(node)) {\n adjustClientRect(position.clientRect, topDifference, leftDifference);\n }\n });\n\n // Since we know the amount that the user has scrolled we can shift all of the client rectangles\n // ourselves. This is cheaper than re-measuring everything and we can avoid inconsistent\n // behavior where we might be measuring the element before its position has changed.\n this._itemPositions.forEach(({clientRect}) => {\n adjustClientRect(clientRect, topDifference, leftDifference);\n });\n\n // We need two loops for this, because we want all of the cached\n // positions to be up-to-date before we re-sort the item.\n this._itemPositions.forEach(({drag}) => {\n if (this._dragDropRegistry.isDragging(drag)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n drag._sortFromLastPointerPosition();\n }\n });\n\n scrollPosition.top = newTop;\n scrollPosition.left = newLeft;\n }\n\n /** Starts the interval that'll auto-scroll the element. */\n private _startScrollInterval = () => {\n this._stopScrolling();\n\n interval(0, animationFrameScheduler)\n .pipe(takeUntil(this._stopScrollTimers))\n .subscribe(() => {\n const node = this._scrollNode;\n\n if (this._verticalScrollDirection === AutoScrollVerticalDirection.UP) {\n incrementVerticalScroll(node, -AUTO_SCROLL_STEP);\n } else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {\n incrementVerticalScroll(node, AUTO_SCROLL_STEP);\n }\n\n if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {\n incrementHorizontalScroll(node, -AUTO_SCROLL_STEP);\n } else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {\n incrementHorizontalScroll(node, AUTO_SCROLL_STEP);\n }\n });\n }\n\n /**\n * Checks whether the user's pointer is positioned over the container.\n * @param x Pointer position along the X axis.\n * @param y Pointer position along the Y axis.\n */\n _isOverContainer(x: number, y: number): boolean {\n return isInsideClientRect(this._clientRect, x, y);\n }\n\n /**\n * Figures out whether an item should be moved into a sibling\n * drop container, based on its current position.\n * @param item Drag item that is being moved.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _getSiblingContainerFromPosition(item: DragRef, x: number, y: number): DropListRef | undefined {\n return this._siblings.find(sibling => sibling._canReceive(item, x, y));\n }\n\n /**\n * Checks whether the drop list can receive the passed-in item.\n * @param item Item that is being dragged into the list.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _canReceive(item: DragRef, x: number, y: number): boolean {\n if (!isInsideClientRect(this._clientRect, x, y) || !this.enterPredicate(item, this)) {\n return false;\n }\n\n const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y) as HTMLElement | null;\n\n // If there's no element at the pointer position, then\n // the client rect is probably scrolled out of the view.\n if (!elementFromPoint) {\n return false;\n }\n\n const nativeElement = coerceElement(this.element);\n\n // The `ClientRect`, that we're using to find the container over which the user is\n // hovering, doesn't give us any information on whether the element has been scrolled\n // out of the view or whether it's overlapping with other containers. This means that\n // we could end up transferring the item into a container that's invisible or is positioned\n // below another one. We use the result from `elementFromPoint` to get the top-most element\n // at the pointer position and to find whether it's one of the intersecting drop containers.\n return elementFromPoint === nativeElement || nativeElement.contains(elementFromPoint);\n }\n\n /**\n * Called by one of the connected drop lists when a dragging sequence has started.\n * @param sibling Sibling in which dragging has started.\n */\n _startReceiving(sibling: DropListRef) {\n const activeSiblings = this._activeSiblings;\n\n if (!activeSiblings.has(sibling)) {\n activeSiblings.add(sibling);\n this._cacheParentPositions();\n this._listenToScrollEvents();\n }\n }\n\n /**\n * Called by a connected drop list when dragging has stopped.\n * @param sibling Sibling whose dragging has stopped.\n */\n _stopReceiving(sibling: DropListRef) {\n this._activeSiblings.delete(sibling);\n this._viewportScrollSubscription.unsubscribe();\n }\n\n /**\n * Starts listening to scroll events on the viewport.\n * Used for updating the internal state of the list.\n */\n private _listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry.scroll.subscribe(event => {\n if (this.isDragging()) {\n const target = event.target as HTMLElement | Document;\n const position = this._parentPositions.get(target);\n\n if (position) {\n let newTop: number;\n let newLeft: number;\n\n if (target === this._document) {\n const scrollPosition = this._viewportRuler!.getViewportScrollPosition();\n newTop = scrollPosition.top;\n newLeft = scrollPosition.left;\n } else {\n newTop = (target as HTMLElement).scrollTop;\n newLeft = (target as HTMLElement).scrollLeft;\n }\n\n this._updateAfterScroll(target, newTop, newLeft);\n }\n } else if (this.isReceiving()) {\n this._cacheParentPositions();\n }\n });\n }\n\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n private _getShadowRoot(): DocumentOrShadowRoot {\n if (!this._cachedShadowRoot) {\n this._cachedShadowRoot = getShadowRoot(coerceElement(this.element)) || this._document;\n }\n\n return this._cachedShadowRoot;\n }\n}\n\n\n/**\n * Updates the top/left positions of a `ClientRect`, as well as their bottom/right counterparts.\n * @param clientRect `ClientRect` that should be updated.\n * @param top Amount to add to the `top` position.\n * @param left Amount to add to the `left` position.\n */\nfunction adjustClientRect(clientRect: ClientRect, top: number, left: number) {\n clientRect.top += top;\n clientRect.bottom = clientRect.top + clientRect.height;\n\n clientRect.left += left;\n clientRect.right = clientRect.left + clientRect.width;\n}\n\n/**\n * Checks whether the pointer coordinates are close to a ClientRect.\n * @param rect ClientRect to check against.\n * @param pointerX Coordinates along the X axis.\n * @param pointerY Coordinates along the Y axis.\n */\nfunction isPointerNearClientRect(rect: ClientRect, pointerX: number, pointerY: number): boolean {\n const {top, right, bottom, left, width, height} = rect;\n const xThreshold = width * DROP_PROXIMITY_THRESHOLD;\n const yThreshold = height * DROP_PROXIMITY_THRESHOLD;\n\n return pointerY > top - yThreshold && pointerY < bottom + yThreshold &&\n pointerX > left - xThreshold && pointerX < right + xThreshold;\n}\n\n/**\n * Finds the index of an item that matches a predicate function. Used as an equivalent\n * of `Array.prototype.findIndex` which isn't part of the standard Google typings.\n * @param array Array in which to look for matches.\n * @param predicate Function used to determine whether an item is a match.\n */\nfunction findIndex<T>(array: T[],\n predicate: (value: T, index: number, obj: T[]) => boolean): number {\n\n for (let i = 0; i < array.length; i++) {\n if (predicate(array[i], i, array)) {\n return i;\n }\n }\n\n return -1;\n}\n\n\n/**\n * Checks whether some coordinates are within a `ClientRect`.\n * @param clientRect ClientRect that is being checked.\n * @param x Coordinates along the X axis.\n * @param y Coordinates along the Y axis.\n */\nfunction isInsideClientRect(clientRect: ClientRect, x: number, y: number) {\n const {top, bottom, left, right} = clientRect;\n return y >= top && y <= bottom && x >= left && x <= right;\n}\n\n\n/** Gets a mutable version of an element's bounding `ClientRect`. */\nfunction getMutableClientRect(element: Element): ClientRect {\n const clientRect = element.getBoundingClientRect();\n\n // We need to clone the `clientRect` here, because all the values on it are readonly\n // and we need to be able to update them. Also we can't use a spread here, because\n // the values on a `ClientRect` aren't own properties. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes\n return {\n top: clientRect.top,\n right: clientRect.right,\n bottom: clientRect.bottom,\n left: clientRect.left,\n width: clientRect.width,\n height: clientRect.height\n };\n}\n\n/**\n * Increments the vertical scroll position of a node.\n * @param node Node whose scroll position should change.\n * @param amount Amount of pixels that the `node` should be scrolled.\n */\nfunction incrementVerticalScroll(node: HTMLElement | Window, amount: number) {\n if (node === window) {\n (node as Window).scrollBy(0, amount);\n } else {\n // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\n (node as HTMLElement).scrollTop += amount;\n }\n}\n\n/**\n * Increments the horizontal scroll position of a node.\n * @param node Node whose scroll position should change.\n * @param amount Amount of pixels that the `node` should be scrolled.\n */\nfunction incrementHorizontalScroll(node: HTMLElement | Window, amount: number) {\n if (node === window) {\n (node as Window).scrollBy(amount, 0);\n } else {\n // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\n (node as HTMLElement).scrollLeft += amount;\n }\n}\n\n/**\n * Gets whether the vertical auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getVerticalScrollDirection(clientRect: ClientRect, pointerY: number) {\n const {top, bottom, height} = clientRect;\n const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {\n return AutoScrollVerticalDirection.UP;\n } else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {\n return AutoScrollVerticalDirection.DOWN;\n }\n\n return AutoScrollVerticalDirection.NONE;\n}\n\n/**\n * Gets whether the horizontal auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerX Position of the user's pointer along the x axis.\n */\nfunction getHorizontalScrollDirection(clientRect: ClientRect, pointerX: number) {\n const {left, right, width} = clientRect;\n const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {\n return AutoScrollHorizontalDirection.LEFT;\n } else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {\n return AutoScrollHorizontalDirection.RIGHT;\n }\n\n return AutoScrollHorizontalDirection.NONE;\n}\n\n/**\n * Gets the directions in which an element node should be scrolled,\n * assuming that the user's pointer is already within it scrollable region.\n * @param element Element for which we should calculate the scroll direction.\n * @param clientRect Bounding client rectangle of the element.\n * @param pointerX Position of the user's pointer along the x axis.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getElementScrollDirections(element: HTMLElement, clientRect: ClientRect, pointerX: number,\n pointerY: number): [AutoScrollVerticalDirection, AutoScrollHorizontalDirection] {\n const computedVertical = getVerticalScrollDirection(clientRect, pointerY);\n const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX);\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Note that we here we do some extra checks for whether the element is actually scrollable in\n // a certain direction and we only assign the scroll direction if it is. We do this so that we\n // can allow other elements to be scrolled, if the current element can't be scrolled anymore.\n // This allows us to handle cases where the scroll regions of two scrollable elements overlap.\n if (computedVertical) {\n const scrollTop = element.scrollTop;\n\n if (computedVertical === AutoScrollVerticalDirection.UP) {\n if (scrollTop > 0) {\n verticalScrollDirection = AutoScrollVerticalDirection.UP;\n }\n } else if (element.scrollHeight - scrollTop > element.clientHeight) {\n verticalScrollDirection = AutoScrollVerticalDirection.DOWN;\n }\n }\n\n if (computedHorizontal) {\n const scrollLeft = element.scrollLeft;\n\n if (computedHorizontal === AutoScrollHorizontalDirection.LEFT) {\n if (scrollLeft > 0) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;\n }\n } else if (element.scrollWidth - scrollLeft > element.clientWidth) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;\n }\n }\n\n return [verticalScrollDirection, horizontalScrollDirection];\n}\n\n/** Gets the shadow root of an element, if any. */\nfunction getShadowRoot(element: HTMLElement): DocumentOrShadowRoot | null {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n if (rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, NgZone, OnDestroy, Inject} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {Subject} from 'rxjs';\n\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = normalizePassiveListenerOptions({\n passive: false,\n capture: true\n});\n\n/**\n * Service that keeps track of all the drag item and drop container\n * instances, and manages global event listeners on the `document`.\n * @docs-private\n */\n// Note: this class is generic, rather than referencing CdkDrag and CdkDropList directly, in order\n// to avoid circular imports. If we were to reference them here, importing the registry into the\n// classes that are registering themselves will introduce a circular import.\n@Injectable({providedIn: 'root'})\nexport class DragDropRegistry<I, C> implements OnDestroy {\n private _document: Document;\n\n /** Registered drop container instances. */\n private _dropInstances = new Set<C>();\n\n /** Registered drag item instances. */\n private _dragInstances = new Set<I>();\n\n /** Drag item instances that are currently being dragged. */\n private _activeDragInstances = new Set<I>();\n\n /** Keeps track of the event listeners that we've bound to the `document`. */\n private _globalListeners = new Map<string, {\n handler: (event: Event) => void,\n options?: AddEventListenerOptions | boolean\n }>();\n\n /**\n * Emits the `touchmove` or `mousemove` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerMove: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n /**\n * Emits the `touchend` or `mouseup` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerUp: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n /** Emits when the viewport has been scrolled while the user is dragging an item. */\n readonly scroll: Subject<Event> = new Subject<Event>();\n\n constructor(\n private _ngZone: NgZone,\n @Inject(DOCUMENT) _document: any) {\n this._document = _document;\n }\n\n /** Adds a drop container to the registry. */\n registerDropContainer(drop: C) {\n if (!this._dropInstances.has(drop)) {\n this._dropInstances.add(drop);\n }\n }\n\n /** Adds a drag item instance to the registry. */\n registerDragItem(drag: I) {\n this._dragInstances.add(drag);\n\n // The `touchmove` event gets bound once, ahead of time, because WebKit\n // won't preventDefault on a dynamically-added `touchmove` listener.\n // See https://bugs.webkit.org/show_bug.cgi?id=184250.\n if (this._dragInstances.size === 1) {\n this._ngZone.runOutsideAngular(() => {\n // The event handler has to be explicitly active,\n // because newer browsers make it passive by default.\n this._document.addEventListener('touchmove', this._preventDefaultWhileDragging,\n activeCapturingEventOptions);\n });\n }\n }\n\n /** Removes a drop container from the registry. */\n removeDropContainer(drop: C) {\n this._dropInstances.delete(drop);\n }\n\n /** Removes a drag item instance from the registry. */\n removeDragItem(drag: I) {\n this._dragInstances.delete(drag);\n this.stopDragging(drag);\n\n if (this._dragInstances.size === 0) {\n this._document.removeEventListener('touchmove', this._preventDefaultWhileDragging,\n activeCapturingEventOptions);\n }\n }\n\n /**\n * Starts the dragging sequence for a drag instance.\n * @param drag Drag instance which is being dragged.\n * @param event Event that initiated the dragging.\n */\n startDragging(drag: I, event: TouchEvent | MouseEvent) {\n // Do not process the same drag twice to avoid memory leaks and redundant listeners\n if (this._activeDragInstances.has(drag)) {\n return;\n }\n\n this._activeDragInstances.add(drag);\n\n if (this._activeDragInstances.size === 1) {\n const isTouchEvent = event.type.startsWith('touch');\n const moveEvent = isTouchEvent ? 'touchmove' : 'mousemove';\n const upEvent = isTouchEvent ? 'touchend' : 'mouseup';\n\n // We explicitly bind __active__ listeners here, because newer browsers will default to\n // passive ones for `mousemove` and `touchmove`. The events need to be active, because we\n // use `preventDefault` to prevent the page from scrolling while the user is dragging.\n this._globalListeners\n .set(moveEvent, {\n handler: (e: Event) => this.pointerMove.next(e as TouchEvent | MouseEvent),\n options: activeCapturingEventOptions\n })\n .set(upEvent, {\n handler: (e: Event) => this.pointerUp.next(e as TouchEvent | MouseEvent),\n options: true\n })\n .set('scroll', {\n handler: (e: Event) => this.scroll.next(e),\n // Use capturing so that we pick up scroll changes in any scrollable nodes that aren't\n // the document. See https://github.com/angular/components/issues/17144.\n options: true\n })\n // Preventing the default action on `mousemove` isn't enough to disable text selection\n // on Safari so we need to prevent the selection event as well. Alternatively this can\n // be done by setting `user-select: none` on the `body`, however it has causes a style\n // recalculation which can be expensive on pages with a lot of elements.\n .set('selectstart', {\n handler: this._preventDefaultWhileDragging,\n options: activeCapturingEventOptions\n });\n\n this._ngZone.runOutsideAngular(() => {\n this._globalListeners.forEach((config, name) => {\n this._document.addEventListener(name, config.handler, config.options);\n });\n });\n }\n }\n\n /** Stops dragging a drag item instance. */\n stopDragging(drag: I) {\n this._activeDragInstances.delete(drag);\n\n if (this._activeDragInstances.size === 0) {\n this._clearGlobalListeners();\n }\n }\n\n /** Gets whether a drag item instance is currently being dragged. */\n isDragging(drag: I) {\n return this._activeDragInstances.has(drag);\n }\n\n ngOnDestroy() {\n this._dragInstances.forEach(instance => this.removeDragItem(instance));\n this._dropInstances.forEach(instance => this.removeDropContainer(instance));\n this._clearGlobalListeners();\n this.pointerMove.complete();\n this.pointerUp.complete();\n }\n\n /**\n * Event listener that will prevent the default browser action while the user is dragging.\n * @param event Event whose default action should be prevented.\n */\n private _preventDefaultWhileDragging = (event: Event) => {\n if (this._activeDragInstances.size) {\n event.preventDefault();\n }\n }\n\n /** Clears out the global event listeners from the `document`. */\n private _clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n\n this._globalListeners.clear();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, Inject, NgZone, ElementRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {DragRef, DragRefConfig} from './drag-ref';\nimport {DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\n\n/** Default configuration to be used when creating a `DragRef`. */\nconst DEFAULT_CONFIG = {\n dragStartThreshold: 5,\n pointerDirectionChangeThreshold: 5\n};\n\n/**\n * Service that allows for drag-and-drop functionality to be attached to DOM elements.\n */\n@Injectable({providedIn: 'root'})\nexport class DragDrop {\n constructor(\n @Inject(DOCUMENT) private _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>) {}\n\n /**\n * Turns an element into a draggable item.\n * @param element Element to which to attach the dragging functionality.\n * @param config Object used to configure the dragging behavior.\n */\n createDrag<T = any>(element: ElementRef<HTMLElement> | HTMLElement,\n config: DragRefConfig = DEFAULT_CONFIG): DragRef<T> {\n\n return new DragRef<T>(element, config, this._document, this._ngZone, this._viewportRuler,\n this._dragDropRegistry);\n }\n\n /**\n * Turns an element into a drop list.\n * @param element Element to which to attach the drop list functionality.\n */\n createDropList<T = any>(element: ElementRef<HTMLElement> | HTMLElement): DropListRef<T> {\n return new DropListRef<T>(element, this._dragDropRegistry, this._document, this._ngZone,\n this._viewportRuler);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CdkDrag} from './directives/drag';\nimport {CdkDropList} from './directives/drop-list';\n\n/** Event emitted when the user starts dragging a draggable. */\nexport interface CdkDragStart<T = any> {\n /** Draggable that emitted the event. */\n source: CdkDrag<T>;\n}\n\n/** Event emitted when the user releases an item, before any animations have started. */\nexport interface CdkDragRelease<T = any> {\n /** Draggable that emitted the event. */\n source: CdkDrag<T>;\n}\n\n/** Event emitted when the user stops dragging a draggable. */\nexport interface CdkDragEnd<T = any> {\n /** Draggable that emitted the event. */\n source: CdkDrag<T>;\n /** Distance in pixels that the user has dragged since the drag sequence started. */\n distance: {x: number, y: number};\n}\n\n/** Event emitted when the user moves an item into a new drop container. */\nexport interface CdkDragEnter<T = any, I = T> {\n /** Container into which the user has moved the item. */\n container: CdkDropList<T>;\n /** Item that was moved into the container. */\n item: CdkDrag<I>;\n /** Index at which the item has entered the container. */\n currentIndex: number;\n}\n\n/**\n * Event emitted when the user removes an item from a\n * drop container by moving it into another one.\n */\nexport interface CdkDragExit<T = any, I = T> {\n /** Container from which the user has a removed an item. */\n container: CdkDropList<T>;\n /** Item that was removed from the container. */\n item: CdkDrag<I>;\n}\n\n\n/** Event emitted when the user drops a draggable item inside a drop container. */\nexport interface CdkDragDrop<T, O = T> {\n /** Index of the item when it was picked up. */\n previousIndex: number;\n /** Current index of the item. */\n currentIndex: number;\n /** Item that is being dropped. */\n item: CdkDrag;\n /** Container in which the item was dropped. */\n container: CdkDropList<T>;\n /** Container from which the item was picked up. Can be the same as the `container`. */\n previousContainer: CdkDropList<O>;\n /** Whether the user's pointer was over the container when the item was dropped. */\n isPointerOverContainer: boolean;\n /** Distance in pixels that the user has dragged since the drag sequence started. */\n distance: {x: number, y: number};\n}\n\n/** Event emitted as the user is dragging a draggable item. */\nexport interface CdkDragMove<T = any> {\n /** Item that is being dragged. */\n source: CdkDrag<T>;\n /** Position of the user's pointer on the page. */\n pointerPosition: {x: number, y: number};\n /** Native event that is causing the dragging. */\n event: MouseEvent | TouchEvent;\n /** Distance in pixels that the user has dragged since the drag sequence started. */\n distance: {x: number, y: number};\n /**\n * Indicates the direction in which the user is dragging the element along each axis.\n * `1` means that the position is increasing (e.g. the user is moving to the right or downwards),\n * whereas `-1` means that it's decreasing (they're moving to the left or upwards). `0` means\n * that the position hasn't changed.\n */\n delta: {x: -1 | 0 | 1, y: -1 | 0 | 1};\n}\n\n/** Event emitted when the user swaps the position of two drag items. */\nexport interface CdkDragSortEvent<T = any, I = T> {\n /** Index from which the item was sorted previously. */\n previousIndex: number;\n /** Index that the item is currently in. */\n currentIndex: number;\n /** Container that the item belongs to. */\n container: CdkDropList<T>;\n /** Item that is being sorted. */\n item: CdkDrag<I>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\n/**\n * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the\n * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily\n * to avoid circular imports.\n * @docs-private\n */\nexport const CDK_DRAG_PARENT = new InjectionToken<{}>('CDK_DRAG_PARENT');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef, Inject, Optional, Input, OnDestroy} from '@angular/core';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Subject} from 'rxjs';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {toggleNativeDragInteractions} from '../drag-styling';\n\n/** Handle that can be used to drag and CdkDrag instance. */\n@Directive({\n selector: '[cdkDragHandle]',\n host: {\n 'class': 'cdk-drag-handle'\n }\n})\nexport class CdkDragHandle implements OnDestroy {\n /** Closest parent draggable instance. */\n _parentDrag: {} | undefined;\n\n /** Emits when the state of the handle has changed. */\n _stateChanges = new Subject<CdkDragHandle>();\n\n /** Whether starting to drag through this handle is disabled. */\n @Input('cdkDragHandleDisabled')\n get disabled(): boolean { return this._disabled; }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n this._stateChanges.next(this);\n }\n private _disabled = false;\n\n constructor(\n public element: ElementRef<HTMLElement>,\n @Inject(CDK_DRAG_PARENT) @Optional() parentDrag?: any) {\n\n this._parentDrag = parentDrag;\n toggleNativeDragInteractions(element.nativeElement, false);\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef, Input} from '@angular/core';\n\n/**\n * Element that will be used as a template for the placeholder of a CdkDrag when\n * it is being dragged. The placeholder is displayed in place of the element being dragged.\n */\n@Directive({\n selector: 'ng-template[cdkDragPlaceholder]'\n})\nexport class CdkDragPlaceholder<T = any> {\n /** Context data to be added to the placeholder template instance. */\n @Input() data: T;\n constructor(public templateRef: TemplateRef<T>) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef, Input} from '@angular/core';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\n\n/**\n * Element that will be used as a template for the preview\n * of a CdkDrag when it is being dragged.\n */\n@Directive({\n selector: 'ng-template[cdkDragPreview]'\n})\nexport class CdkDragPreview<T = any> {\n /** Context data to be added to the preview template instance. */\n @Input() data: T;\n\n /** Whether the preview should preserve the same size as the item that is being dragged. */\n @Input()\n get matchSize(): boolean { return this._matchSize; }\n set matchSize(value: boolean) { this._matchSize = coerceBooleanProperty(value); }\n private _matchSize = false;\n\n constructor(public templateRef: TemplateRef<T>) {}\n\n static ngAcceptInputType_matchSize: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {DragRefConfig, Point, DragRef} from '../drag-ref';\n\n/** Possible values that can be used to configure the drag start delay. */\nexport type DragStartDelay = number | {touch: number, mouse: number};\n\n/** Possible axis along which dragging can be locked. */\nexport type DragAxis = 'x' | 'y';\n\n/** Function that can be used to constrain the position of a dragged element. */\nexport type DragConstrainPosition = (point: Point, dragRef: DragRef) => Point;\n\n/** Possible orientations for a drop list. */\nexport type DropListOrientation = 'horizontal' | 'vertical';\n\n/**\n * Injection token that can be used to configure the\n * behavior of the drag&drop-related components.\n */\nexport const CDK_DRAG_CONFIG = new InjectionToken<DragDropConfig>('CDK_DRAG_CONFIG');\n\n/**\n * Object that can be used to configure the drag\n * items and drop lists within a module or a component.\n */\nexport interface DragDropConfig extends Partial<DragRefConfig> {\n lockAxis?: DragAxis;\n dragStartDelay?: DragStartDelay;\n constrainPosition?: DragConstrainPosition;\n previewClass?: string | string[];\n boundaryElement?: string;\n rootElementSelector?: string;\n draggingDisabled?: boolean;\n sortingDisabled?: boolean;\n listAutoScrollDisabled?: boolean;\n listOrientation?: DropListOrientation;\n}\n\n/**\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n * @docs-private\n */\nexport function CDK_DRAG_CONFIG_FACTORY(): DragDropConfig {\n return {dragStartThreshold: 5, pointerDirectionChangeThreshold: 5};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewInit,\n ContentChild,\n ContentChildren,\n Directive,\n ElementRef,\n EventEmitter,\n Inject,\n InjectionToken,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n SkipSelf,\n ViewContainerRef,\n OnChanges,\n SimpleChanges,\n ChangeDetectorRef,\n isDevMode,\n} from '@angular/core';\nimport {\n coerceBooleanProperty,\n coerceNumberProperty,\n coerceElement,\n BooleanInput\n} from '@angular/cdk/coercion';\nimport {Observable, Observer, Subject, merge} from 'rxjs';\nimport {startWith, take, map, takeUntil, switchMap, tap} from 'rxjs/operators';\nimport {\n CdkDragDrop,\n CdkDragEnd,\n CdkDragEnter,\n CdkDragExit,\n CdkDragMove,\n CdkDragStart,\n CdkDragRelease,\n} from '../drag-events';\nimport {CdkDragHandle} from './drag-handle';\nimport {CdkDragPlaceholder} from './drag-placeholder';\nimport {CdkDragPreview} from './drag-preview';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {DragRef, Point} from '../drag-ref';\nimport {CdkDropListInternal as CdkDropList} from './drop-list';\nimport {DragDrop} from '../drag-drop';\nimport {CDK_DRAG_CONFIG, DragDropConfig, DragStartDelay, DragAxis} from './config';\n\n/**\n * Injection token that is used to provide a CdkDropList instance to CdkDrag.\n * Used for avoiding circular imports.\n */\nexport const CDK_DROP_LIST = new InjectionToken<CdkDropList>('CDK_DROP_LIST');\n\n/** Element that can be moved inside a CdkDropList container. */\n@Directive({\n selector: '[cdkDrag]',\n exportAs: 'cdkDrag',\n host: {\n 'class': 'cdk-drag',\n '[class.cdk-drag-disabled]': 'disabled',\n '[class.cdk-drag-dragging]': '_dragRef.isDragging()',\n },\n providers: [{provide: CDK_DRAG_PARENT, useExisting: CdkDrag}]\n})\nexport class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {\n private _destroyed = new Subject<void>();\n\n /** Reference to the underlying drag instance. */\n _dragRef: DragRef<CdkDrag<T>>;\n\n /** Elements that can be used to drag the draggable item. */\n @ContentChildren(CdkDragHandle, {descendants: true}) _handles: QueryList<CdkDragHandle>;\n\n /** Element that will be used as a template to create the draggable item's preview. */\n @ContentChild(CdkDragPreview) _previewTemplate: CdkDragPreview;\n\n /** Template for placeholder element rendered to show where a draggable would be dropped. */\n @ContentChild(CdkDragPlaceholder) _placeholderTemplate: CdkDragPlaceholder;\n\n /** Arbitrary data to attach to this drag instance. */\n @Input('cdkDragData') data: T;\n\n /** Locks the position of the dragged element along the specified axis. */\n @Input('cdkDragLockAxis') lockAxis: DragAxis;\n\n /**\n * Selector that will be used to determine the root draggable element, starting from\n * the `cdkDrag` element and going up the DOM. Passing an alternate root element is useful\n * when trying to enable dragging on an element that you might not have access to.\n */\n @Input('cdkDragRootElement') rootElementSelector: string;\n\n /**\n * Node or selector that will be used to determine the element to which the draggable's\n * position will be constrained. If a string is passed in, it'll be used as a selector that\n * will be matched starting from the element's parent and going up the DOM until a match\n * has been found.\n */\n @Input('cdkDragBoundary') boundaryElement: string | ElementRef<HTMLElement> | HTMLElement;\n\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n @Input('cdkDragStartDelay') dragStartDelay: DragStartDelay;\n\n /**\n * Sets the position of a `CdkDrag` that is outside of a drop container.\n * Can be used to restore the element's position for a returning user.\n */\n @Input('cdkDragFreeDragPosition') freeDragPosition: {x: number, y: number};\n\n /** Whether starting to drag this element is disabled. */\n @Input('cdkDragDisabled')\n get disabled(): boolean {\n return this._disabled || (this.dropContainer && this.dropContainer.disabled);\n }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n this._dragRef.disabled = this._disabled;\n }\n private _disabled: boolean;\n\n /**\n * Function that can be used to customize the logic of how the position of the drag item\n * is limited while it's being dragged. Gets called with a point containing the current position\n * of the user's pointer on the page and should return a point describing where the item should\n * be rendered.\n */\n @Input('cdkDragConstrainPosition') constrainPosition?: (point: Point, dragRef: DragRef) => Point;\n\n /** Class to be added to the preview element. */\n @Input('cdkDragPreviewClass') previewClass: string | string[];\n\n /** Emits when the user starts dragging the item. */\n @Output('cdkDragStarted') started: EventEmitter<CdkDragStart> = new EventEmitter<CdkDragStart>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n @Output('cdkDragReleased') released: EventEmitter<CdkDragRelease> =\n new EventEmitter<CdkDragRelease>();\n\n /** Emits when the user stops dragging an item in the container. */\n @Output('cdkDragEnded') ended: EventEmitter<CdkDragEnd> = new EventEmitter<CdkDragEnd>();\n\n /** Emits when the user has moved the item into a new container. */\n @Output('cdkDragEntered') entered: EventEmitter<CdkDragEnter<any>> =\n new EventEmitter<CdkDragEnter<any>>();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n @Output('cdkDragExited') exited: EventEmitter<CdkDragExit<any>> =\n new EventEmitter<CdkDragExit<any>>();\n\n /** Emits when the user drops the item inside a container. */\n @Output('cdkDragDropped') dropped: EventEmitter<CdkDragDrop<any>> =\n new EventEmitter<CdkDragDrop<any>>();\n\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n @Output('cdkDragMoved') moved: Observable<CdkDragMove<T>> =\n new Observable((observer: Observer<CdkDragMove<T>>) => {\n const subscription = this._dragRef.moved.pipe(map(movedEvent => ({\n source: this,\n pointerPosition: movedEvent.pointerPosition,\n event: movedEvent.event,\n delta: movedEvent.delta,\n distance: movedEvent.distance\n }))).subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n };\n });\n\n constructor(\n /** Element that the draggable is attached to. */\n public element: ElementRef<HTMLElement>,\n /** Droppable container that the draggable is a part of. */\n @Inject(CDK_DROP_LIST) @Optional() @SkipSelf() public dropContainer: CdkDropList,\n @Inject(DOCUMENT) private _document: any, private _ngZone: NgZone,\n private _viewContainerRef: ViewContainerRef,\n @Optional() @Inject(CDK_DRAG_CONFIG) config: DragDropConfig,\n @Optional() private _dir: Directionality, dragDrop: DragDrop,\n private _changeDetectorRef: ChangeDetectorRef) {\n this._dragRef = dragDrop.createDrag(element, {\n dragStartThreshold: config && config.dragStartThreshold != null ?\n config.dragStartThreshold : 5,\n pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null ?\n config.pointerDirectionChangeThreshold : 5\n });\n this._dragRef.data = this;\n\n if (config) {\n this._assignDefaults(config);\n }\n\n // Note that usually the container is assigned when the drop list is picks up the item, but in\n // some cases (mainly transplanted views with OnPush, see #18341) we may end up in a situation\n // where there are no items on the first change detection pass, but the items get picked up as\n // soon as the user triggers another pass by dragging. This is a problem, because the item would\n // have to switch from standalone mode to drag mode in the middle of the dragging sequence which\n // is too late since the two modes save different kinds of information. We work around it by\n // assigning the drop container both from here and the list.\n if (dropContainer) {\n this._dragRef._withDropContainer(dropContainer._dropListRef);\n dropContainer.addItem(this);\n }\n\n this._syncInputs(this._dragRef);\n this._handleEvents(this._dragRef);\n }\n\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement(): HTMLElement {\n return this._dragRef.getPlaceholderElement();\n }\n\n /** Returns the root draggable element. */\n getRootElement(): HTMLElement {\n return this._dragRef.getRootElement();\n }\n\n /** Resets a standalone drag item to its initial position. */\n reset(): void {\n this._dragRef.reset();\n }\n\n /**\n * Gets the pixel coordinates of the draggable outside of a drop container.\n */\n getFreeDragPosition(): {readonly x: number, readonly y: number} {\n return this._dragRef.getFreeDragPosition();\n }\n\n ngAfterViewInit() {\n // We need to wait for the zone to stabilize, in order for the reference\n // element to be in the proper place in the DOM. This is mostly relevant\n // for draggable elements inside portals since they get stamped out in\n // their original DOM position and then they get transferred to the portal.\n this._ngZone.onStable.asObservable()\n .pipe(take(1), takeUntil(this._destroyed))\n .subscribe(() => {\n this._updateRootElement();\n\n // Listen for any newly-added handles.\n this._handles.changes.pipe(\n startWith(this._handles),\n // Sync the new handles with the DragRef.\n tap((handles: QueryList<CdkDragHandle>) => {\n const childHandleElements = handles\n .filter(handle => handle._parentDrag === this)\n .map(handle => handle.element);\n this._dragRef.withHandles(childHandleElements);\n }),\n // Listen if the state of any of the handles changes.\n switchMap((handles: QueryList<CdkDragHandle>) => {\n return merge(...handles.map(item => {\n return item._stateChanges.pipe(startWith(item));\n })) as Observable<CdkDragHandle>;\n }),\n takeUntil(this._destroyed)\n ).subscribe(handleInstance => {\n // Enabled/disable the handle that changed in the DragRef.\n const dragRef = this._dragRef;\n const handle = handleInstance.element.nativeElement;\n handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);\n });\n\n if (this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n });\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const rootSelectorChange = changes['rootElementSelector'];\n const positionChange = changes['freeDragPosition'];\n\n // We don't have to react to the first change since it's being\n // handled in `ngAfterViewInit` where it needs to be deferred.\n if (rootSelectorChange && !rootSelectorChange.firstChange) {\n this._updateRootElement();\n }\n\n // Skip the first change since it's being handled in `ngAfterViewInit`.\n if (positionChange && !positionChange.firstChange && this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n }\n\n ngOnDestroy() {\n if (this.dropContainer) {\n this.dropContainer.removeItem(this);\n }\n\n this._destroyed.next();\n this._destroyed.complete();\n this._dragRef.dispose();\n }\n\n /** Syncs the root element with the `DragRef`. */\n private _updateRootElement() {\n const element = this.element.nativeElement;\n const rootElement = this.rootElementSelector ?\n getClosestMatchingAncestor(element, this.rootElementSelector) : element;\n\n if (rootElement && rootElement.nodeType !== this._document.ELEMENT_NODE) {\n throw Error(`cdkDrag must be attached to an element node. ` +\n `Currently attached to \"${rootElement.nodeName}\".`);\n }\n\n this._dragRef.withRootElement(rootElement || element);\n }\n\n /** Gets the boundary element, based on the `boundaryElement` value. */\n private _getBoundaryElement() {\n const boundary = this.boundaryElement;\n\n if (!boundary) {\n return null;\n }\n\n if (typeof boundary === 'string') {\n return getClosestMatchingAncestor(this.element.nativeElement, boundary);\n }\n\n const element = coerceElement(boundary);\n\n if (isDevMode() && !element.contains(this.element.nativeElement)) {\n throw Error('Draggable element is not inside of the node passed into cdkDragBoundary.');\n }\n\n return element;\n }\n\n /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */\n private _syncInputs(ref: DragRef<CdkDrag<T>>) {\n ref.beforeStarted.subscribe(() => {\n if (!ref.isDragging()) {\n const dir = this._dir;\n const dragStartDelay = this.dragStartDelay;\n const placeholder = this._placeholderTemplate ? {\n template: this._placeholderTemplate.templateRef,\n context: this._placeholderTemplate.data,\n viewContainer: this._viewContainerRef\n } : null;\n const preview = this._previewTemplate ? {\n template: this._previewTemplate.templateRef,\n context: this._previewTemplate.data,\n matchSize: this._previewTemplate.matchSize,\n viewContainer: this._viewContainerRef\n } : null;\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.dragStartDelay = (typeof dragStartDelay === 'object' && dragStartDelay) ?\n dragStartDelay : coerceNumberProperty(dragStartDelay);\n ref.constrainPosition = this.constrainPosition;\n ref.previewClass = this.previewClass;\n ref\n .withBoundaryElement(this._getBoundaryElement())\n .withPlaceholderTemplate(placeholder)\n .withPreviewTemplate(preview);\n\n if (dir) {\n ref.withDirection(dir.value);\n }\n }\n });\n }\n\n /** Handles the events from the underlying `DragRef`. */\n private _handleEvents(ref: DragRef<CdkDrag<T>>) {\n ref.started.subscribe(() => {\n this.started.emit({source: this});\n\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n\n ref.released.subscribe(() => {\n this.released.emit({source: this});\n });\n\n ref.ended.subscribe(event => {\n this.ended.emit({source: this, distance: event.distance});\n\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n\n ref.entered.subscribe(event => {\n this.entered.emit({\n container: event.container.data,\n item: this,\n currentIndex: event.currentIndex\n });\n });\n\n ref.exited.subscribe(event => {\n this.exited.emit({\n container: event.container.data,\n item: this\n });\n });\n\n ref.dropped.subscribe(event => {\n this.dropped.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n previousContainer: event.previousContainer.data,\n container: event.container.data,\n isPointerOverContainer: event.isPointerOverContainer,\n item: this,\n distance: event.distance\n });\n });\n }\n\n /** Assigns the default input values based on a provided config object. */\n private _assignDefaults(config: DragDropConfig) {\n const {\n lockAxis, dragStartDelay, constrainPosition, previewClass,\n boundaryElement, draggingDisabled, rootElementSelector\n } = config;\n\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.dragStartDelay = dragStartDelay || 0;\n\n if (lockAxis) {\n this.lockAxis = lockAxis;\n }\n\n if (constrainPosition) {\n this.constrainPosition = constrainPosition;\n }\n\n if (previewClass) {\n this.previewClass = previewClass;\n }\n\n if (boundaryElement) {\n this.boundaryElement = boundaryElement;\n }\n\n if (rootElementSelector) {\n this.rootElementSelector = rootElementSelector;\n }\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n\n/** Gets the closest ancestor of an element that matches a selector. */\nfunction getClosestMatchingAncestor(element: HTMLElement, selector: string) {\n let currentElement = element.parentElement as HTMLElement | null;\n\n while (currentElement) {\n // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.\n if (currentElement.matches ? currentElement.matches(selector) :\n (currentElement as any).msMatchesSelector(selector)) {\n return currentElement;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return null;\n}\n\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, OnDestroy, Input} from '@angular/core';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\n\n/**\n * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`\n * elements that are placed inside a `cdkDropListGroup` will be connected to each other\n * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input\n * from `cdkDropList`.\n */\n@Directive({\n selector: '[cdkDropListGroup]',\n exportAs: 'cdkDropListGroup',\n})\nexport class CdkDropListGroup<T> implements OnDestroy {\n /** Drop lists registered inside the group. */\n readonly _items = new Set<T>();\n\n /** Whether starting a dragging sequence from inside this group is disabled. */\n @Input('cdkDropListGroupDisabled')\n get disabled(): boolean { return this._disabled; }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n ngOnDestroy() {\n this._items.clear();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceArray, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n Optional,\n Directive,\n ChangeDetectorRef,\n SkipSelf,\n AfterContentInit,\n Inject,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {ScrollDispatcher} from '@angular/cdk/scrolling';\nimport {CdkDrag, CDK_DROP_LIST} from './drag';\nimport {CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragSortEvent} from '../drag-events';\nimport {CdkDropListGroup} from './drop-list-group';\nimport {DropListRef} from '../drop-list-ref';\nimport {DragRef} from '../drag-ref';\nimport {DragDrop} from '../drag-drop';\nimport {DropListOrientation, DragAxis, DragDropConfig, CDK_DRAG_CONFIG} from './config';\nimport {Subject} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\n\n/** Counter used to generate unique ids for drop zones. */\nlet _uniqueIdCounter = 0;\n\n/**\n * Internal compile-time-only representation of a `CdkDropList`.\n * Used to avoid circular import issues between the `CdkDropList` and the `CdkDrag`.\n * @docs-private\n */\nexport interface CdkDropListInternal extends CdkDropList {}\n\n/** Container that wraps a set of draggable items. */\n@Directive({\n selector: '[cdkDropList], cdk-drop-list',\n exportAs: 'cdkDropList',\n providers: [\n // Prevent child drop lists from picking up the same group as their parent.\n {provide: CdkDropListGroup, useValue: undefined},\n {provide: CDK_DROP_LIST, useExisting: CdkDropList},\n ],\n host: {\n 'class': 'cdk-drop-list',\n '[id]': 'id',\n '[class.cdk-drop-list-disabled]': 'disabled',\n '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()',\n '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()',\n }\n})\nexport class CdkDropList<T = any> implements AfterContentInit, OnDestroy {\n /** Emits when the list has been destroyed. */\n private _destroyed = new Subject<void>();\n\n /** Keeps track of the drop lists that are currently on the page. */\n private static _dropLists: CdkDropList[] = [];\n\n /** Reference to the underlying drop list instance. */\n _dropListRef: DropListRef<CdkDropList<T>>;\n\n /**\n * Other draggable containers that this container is connected to and into which the\n * container's items can be transferred. Can either be references to other drop containers,\n * or their unique IDs.\n */\n @Input('cdkDropListConnectedTo')\n connectedTo: (CdkDropList | string)[] | CdkDropList | string = [];\n\n /** Arbitrary data to attach to this container. */\n @Input('cdkDropListData') data: T;\n\n /** Direction in which the list is oriented. */\n @Input('cdkDropListOrientation') orientation: DropListOrientation;\n\n /**\n * Unique ID for the drop zone. Can be used as a reference\n * in the `connectedTo` of another `CdkDropList`.\n */\n @Input() id: string = `cdk-drop-list-${_uniqueIdCounter++}`;\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n @Input('cdkDropListLockAxis') lockAxis: DragAxis;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n @Input('cdkDropListDisabled')\n get disabled(): boolean {\n return this._disabled || (!!this._group && this._group.disabled);\n }\n set disabled(value: boolean) {\n // Usually we sync the directive and ref state right before dragging starts, in order to have\n // a single point of failure and to avoid having to use setters for everything. `disabled` is\n // a special case, because it can prevent the `beforeStarted` event from firing, which can lock\n // the user in a disabled state, so we also need to sync it as it's being set.\n this._dropListRef.disabled = this._disabled = coerceBooleanProperty(value);\n }\n private _disabled: boolean;\n\n /** Whether sorting within this drop list is disabled. */\n @Input('cdkDropListSortingDisabled')\n sortingDisabled: boolean;\n\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n @Input('cdkDropListEnterPredicate')\n enterPredicate: (drag: CdkDrag, drop: CdkDropList) => boolean = () => true\n\n /** Whether to auto-scroll the view when the user moves their pointer close to the edges. */\n @Input('cdkDropListAutoScrollDisabled')\n autoScrollDisabled: boolean;\n\n /** Emits when the user drops an item inside the container. */\n @Output('cdkDropListDropped')\n dropped: EventEmitter<CdkDragDrop<T, any>> = new EventEmitter<CdkDragDrop<T, any>>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n @Output('cdkDropListEntered')\n entered: EventEmitter<CdkDragEnter<T>> = new EventEmitter<CdkDragEnter<T>>();\n\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n @Output('cdkDropListExited')\n exited: EventEmitter<CdkDragExit<T>> = new EventEmitter<CdkDragExit<T>>();\n\n /** Emits as the user is swapping items while actively dragging. */\n @Output('cdkDropListSorted')\n sorted: EventEmitter<CdkDragSortEvent<T>> = new EventEmitter<CdkDragSortEvent<T>>();\n\n /**\n * Keeps track of the items that are registered with this container. Historically we used to\n * do this with a `ContentChildren` query, however queries don't handle transplanted views very\n * well which means that we can't handle cases like dragging the headers of a `mat-table`\n * correctly. What we do instead is to have the items register themselves with the container\n * and then we sort them based on their position in the DOM.\n */\n private _unsortedItems = new Set<CdkDrag>();\n\n constructor(\n /** Element that the drop list is attached to. */\n public element: ElementRef<HTMLElement>, dragDrop: DragDrop,\n private _changeDetectorRef: ChangeDetectorRef, @Optional() private _dir?: Directionality,\n @Optional() @SkipSelf() private _group?: CdkDropListGroup<CdkDropList>,\n\n /**\n * @deprecated _scrollDispatcher parameter to become required.\n * @breaking-change 11.0.0\n */\n private _scrollDispatcher?: ScrollDispatcher,\n @Optional() @Inject(CDK_DRAG_CONFIG) config?: DragDropConfig) {\n this._dropListRef = dragDrop.createDropList(element);\n this._dropListRef.data = this;\n\n if (config) {\n this._assignDefaults(config);\n }\n\n this._dropListRef.enterPredicate = (drag: DragRef<CdkDrag>, drop: DropListRef<CdkDropList>) => {\n return this.enterPredicate(drag.data, drop.data);\n };\n\n this._setupInputSyncSubscription(this._dropListRef);\n this._handleEvents(this._dropListRef);\n CdkDropList._dropLists.push(this);\n\n if (_group) {\n _group._items.add(this);\n }\n }\n\n ngAfterContentInit() {\n // @breaking-change 11.0.0 Remove null check for _scrollDispatcher once it's required.\n if (this._scrollDispatcher) {\n const scrollableParents = this._scrollDispatcher\n .getAncestorScrollContainers(this.element)\n .map(scrollable => scrollable.getElementRef().nativeElement);\n this._dropListRef.withScrollableParents(scrollableParents);\n }\n }\n\n /** Registers an items with the drop list. */\n addItem(item: CdkDrag): void {\n this._unsortedItems.add(item);\n\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef();\n }\n }\n\n /** Removes an item from the drop list. */\n removeItem(item: CdkDrag): void {\n this._unsortedItems.delete(item);\n\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef();\n }\n }\n\n /** Gets the registered items in the list, sorted by their position in the DOM. */\n getSortedItems(): CdkDrag[] {\n return Array.from(this._unsortedItems).sort((a: CdkDrag, b: CdkDrag) => {\n const documentPosition =\n a._dragRef.getVisibleElement().compareDocumentPosition(b._dragRef.getVisibleElement());\n\n // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n // tslint:disable-next-line:no-bitwise\n return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n });\n }\n\n ngOnDestroy() {\n const index = CdkDropList._dropLists.indexOf(this);\n\n if (index > -1) {\n CdkDropList._dropLists.splice(index, 1);\n }\n\n if (this._group) {\n this._group._items.delete(this);\n }\n\n this._unsortedItems.clear();\n this._dropListRef.dispose();\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /**\n * Starts dragging an item.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n start(): void {\n this._dropListRef.start();\n }\n\n /**\n * Drops an item into this container.\n * @param item Item being dropped into the container.\n * @param currentIndex Index at which the item should be inserted.\n * @param previousContainer Container from which the item got dragged in.\n * @param isPointerOverContainer Whether the user's pointer was over the\n * container when the item was dropped.\n *\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n drop(item: CdkDrag, currentIndex: number, previousContainer: CdkDropList,\n isPointerOverContainer: boolean): void {\n this._dropListRef.drop(item._dragRef, currentIndex, previousContainer._dropListRef,\n isPointerOverContainer, {x: 0, y: 0});\n }\n\n /**\n * Emits an event to indicate that the user moved an item into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n enter(item: CdkDrag, pointerX: number, pointerY: number): void {\n this._dropListRef.enter(item._dragRef, pointerX, pointerY);\n }\n\n /**\n * Removes an item from the container after it was dragged into another container by the user.\n * @param item Item that was dragged out.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n exit(item: CdkDrag): void {\n this._dropListRef.exit(item._dragRef);\n }\n\n /**\n * Figures out the index of an item in the container.\n * @param item Item whose index should be determined.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n getItemIndex(item: CdkDrag): number {\n return this._dropListRef.getItemIndex(item._dragRef);\n }\n\n /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */\n private _setupInputSyncSubscription(ref: DropListRef<CdkDropList>) {\n if (this._dir) {\n this._dir.change\n .pipe(startWith(this._dir.value), takeUntil(this._destroyed))\n .subscribe(value => ref.withDirection(value));\n }\n\n ref.beforeStarted.subscribe(() => {\n const siblings = coerceArray(this.connectedTo).map(drop => {\n return typeof drop === 'string' ?\n CdkDropList._dropLists.find(list => list.id === drop)! : drop;\n });\n\n if (this._group) {\n this._group._items.forEach(drop => {\n if (siblings.indexOf(drop) === -1) {\n siblings.push(drop);\n }\n });\n }\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.sortingDisabled = coerceBooleanProperty(this.sortingDisabled);\n ref.autoScrollDisabled = coerceBooleanProperty(this.autoScrollDisabled);\n ref\n .connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))\n .withOrientation(this.orientation);\n });\n }\n\n /** Handles events from the underlying DropListRef. */\n private _handleEvents(ref: DropListRef<CdkDropList>) {\n ref.beforeStarted.subscribe(() => {\n this._syncItemsWithRef();\n this._changeDetectorRef.markForCheck();\n });\n\n ref.entered.subscribe(event => {\n this.entered.emit({\n container: this,\n item: event.item.data,\n currentIndex: event.currentIndex\n });\n });\n\n ref.exited.subscribe(event => {\n this.exited.emit({\n container: this,\n item: event.item.data\n });\n this._changeDetectorRef.markForCheck();\n });\n\n ref.sorted.subscribe(event => {\n this.sorted.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n container: this,\n item: event.item.data\n });\n });\n\n ref.dropped.subscribe(event => {\n this.dropped.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n previousContainer: event.previousContainer.data,\n container: event.container.data,\n item: event.item.data,\n isPointerOverContainer: event.isPointerOverContainer,\n distance: event.distance\n });\n\n // Mark for check since all of these events run outside of change\n // detection and we're not guaranteed for something else to have triggered it.\n this._changeDetectorRef.markForCheck();\n });\n }\n\n /** Assigns the default input values based on a provided config object. */\n private _assignDefaults(config: DragDropConfig) {\n const {\n lockAxis, draggingDisabled, sortingDisabled, listAutoScrollDisabled, listOrientation\n } = config;\n\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled;\n this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled;\n this.orientation = listOrientation || 'vertical';\n\n if (lockAxis) {\n this.lockAxis = lockAxis;\n }\n }\n\n /** Syncs up the registered drag items with underlying drop list ref. */\n private _syncItemsWithRef() {\n this._dropListRef.withItems(this.getSortedItems().map(item => item._dragRef));\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_sortingDisabled: BooleanInput;\n static ngAcceptInputType_autoScrollDisabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkDropList} from './directives/drop-list';\nimport {CdkDropListGroup} from './directives/drop-list-group';\nimport {CdkDrag} from './directives/drag';\nimport {CdkDragHandle} from './directives/drag-handle';\nimport {CdkDragPreview} from './directives/drag-preview';\nimport {CdkDragPlaceholder} from './directives/drag-placeholder';\nimport {DragDrop} from './drag-drop';\n\n@NgModule({\n declarations: [\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n ],\n exports: [\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n ],\n providers: [\n DragDrop,\n ]\n})\nexport class DragDropModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {CdkDropListInternal as ɵangular_material_src_cdk_drag_drop_drag_drop_a} from './directives/drop-list';\nexport {CDK_DRAG_PARENT as ɵangular_material_src_cdk_drag_drop_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B;sBAIrC,MAAM,SAAC,oBAAoB;sBAM3B,MAAM,SAAC,oBAAoB;qBAO3B,MAAM,SAAC,mBAAmB;qBAI1B,MAAM,SAAC,mBAAmB;;;;;;;;IA3E3B,uBAA8C;;IAiV9C,uCAAgD;;IAChD,8CAAuD;;IACvD,iDAA0D;;;;;;IAtV1D,iCAAyC;;;;;IAMzC,mCAA0C;;;;;;;IAO1C,kCACkE;;;;;IAGlE,2BAAkC;;;;;IAGlC,kCAAkE;;;;;;IAMlE,yBAA4D;;;;;IAG5D,+BAAiD;;;;;IAcjD,gCAA2B;;;;;IAG3B,sCACyB;;;;;;IAMzB,qCAC0E;;;;;IAG1E,yCAC4B;;;;;IAG5B,8BACqF;;;;;IAKrF,8BAC6E;;;;;;IAM7E,6BAC0E;;;;;IAG1E,6BACoF;;;;;;;;;;IASpF,qCAA4C;;;;;IAIxC,8BAAuC;;;;;IACvC,yCAA6C;;;;;IAAE,2BAAyC;;;;;IACxF,6BAAsE;;;;;;;IAMtE,wCAA4C;;;;;;;;MC7HrC,cAAc;;;YArB1B,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,WAAW;oBACX,gBAAgB;oBAChB,OAAO;oBACP,aAAa;oBACb,cAAc;oBACd,kBAAkB;iBACnB;gBACD,OAAO,EAAE;oBACP,WAAW;oBACX,gBAAgB;oBAChB,OAAO;oBACP,aAAa;oBACb,cAAc;oBACd,kBAAkB;iBACnB;gBACD,SAAS,EAAE;oBACT,QAAQ;iBACT;aACF;;;;;;;;;ACrCD;;GAEG;;;;"}
1
+ {"version":3,"file":"drag-drop.js","sources":["../../../../../../src/cdk/drag-drop/drag-styling.ts","../../../../../../src/cdk/drag-drop/transition-duration.ts","../../../../../../src/cdk/drag-drop/drag-ref.ts","../../../../../../src/cdk/drag-drop/drag-utils.ts","../../../../../../src/cdk/drag-drop/drop-list-ref.ts","../../../../../../src/cdk/drag-drop/drag-drop-registry.ts","../../../../../../src/cdk/drag-drop/drag-drop.ts","../../../../../../src/cdk/drag-drop/drag-events.ts","../../../../../../src/cdk/drag-drop/drag-parent.ts","../../../../../../src/cdk/drag-drop/directives/drag-handle.ts","../../../../../../src/cdk/drag-drop/directives/drag-placeholder.ts","../../../../../../src/cdk/drag-drop/directives/drag-preview.ts","../../../../../../src/cdk/drag-drop/directives/config.ts","../../../../../../src/cdk/drag-drop/directives/drag.ts","../../../../../../src/cdk/drag-drop/directives/drop-list-group.ts","../../../../../../src/cdk/drag-drop/directives/drop-list.ts","../../../../../../src/cdk/drag-drop/drag-drop-module.ts","../../../../../../src/cdk/drag-drop/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n// Helper type that ignores `readonly` properties. This is used in\n// `extendStyles` to ignore the readonly properties on CSSStyleDeclaration\n// since we won't be touching those anyway.\ntype Writeable<T> = { -readonly [P in keyof T]-?: T[P] };\n\n/**\n * Extended CSSStyleDeclaration that includes a couple of drag-related\n * properties that aren't in the built-in TS typings.\n */\ninterface DragCSSStyleDeclaration extends CSSStyleDeclaration {\n webkitUserDrag: string;\n MozUserSelect: string; // For some reason the Firefox property is in PascalCase.\n}\n\n/**\n * Shallow-extends a stylesheet object with another stylesheet object.\n * @docs-private\n */\nexport function extendStyles(\n dest: Writeable<CSSStyleDeclaration>,\n source: Partial<DragCSSStyleDeclaration>) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n dest[key] = source[key]!;\n }\n }\n\n return dest;\n}\n\n\n/**\n * Toggles whether the native drag interactions should be enabled for an element.\n * @param element Element on which to toggle the drag interactions.\n * @param enable Whether the drag interactions should be enabled.\n * @docs-private\n */\nexport function toggleNativeDragInteractions(element: HTMLElement, enable: boolean) {\n const userSelect = enable ? '' : 'none';\n\n extendStyles(element.style, {\n touchAction: enable ? '' : 'none',\n webkitUserDrag: enable ? '' : 'none',\n webkitTapHighlightColor: enable ? '' : 'transparent',\n userSelect: userSelect,\n msUserSelect: userSelect,\n webkitUserSelect: userSelect,\n MozUserSelect: userSelect\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Parses a CSS time value to milliseconds. */\nfunction parseCssTimeUnitsToMs(value: string): number {\n // Some browsers will return it in seconds, whereas others will return milliseconds.\n const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\n return parseFloat(value) * multiplier;\n}\n\n/** Gets the transform transition duration, including the delay, of an element in milliseconds. */\nexport function getTransformTransitionDurationInMs(element: HTMLElement): number {\n const computedStyle = getComputedStyle(element);\n const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all');\n\n // If there's no transition for `all` or `transform`, we shouldn't do anything.\n if (!property) {\n return 0;\n }\n\n // Get the index of the property that we're interested in and match\n // it up to the same index in `transition-delay` and `transition-duration`.\n const propertyIndex = transitionedProperties.indexOf(property);\n const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n\n return parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\n parseCssTimeUnitsToMs(rawDelays[propertyIndex]);\n}\n\n/** Parses out multiple values from a computed style into an array. */\nfunction parseCssPropertyValue(computedStyle: CSSStyleDeclaration, name: string): string[] {\n const value = computedStyle.getPropertyValue(name);\n return value.split(',').map(part => part.trim());\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EmbeddedViewRef, ElementRef, NgZone, ViewContainerRef, TemplateRef} from '@angular/core';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {Direction} from '@angular/cdk/bidi';\nimport {normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {coerceBooleanProperty, coerceElement} from '@angular/cdk/coercion';\nimport {Subscription, Subject, Observable} from 'rxjs';\nimport {startWith} from 'rxjs/operators';\nimport {DropListRefInternal as DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport {extendStyles, toggleNativeDragInteractions} from './drag-styling';\nimport {getTransformTransitionDurationInMs} from './transition-duration';\n\n/** Object that can be used to configure the behavior of DragRef. */\nexport interface DragRefConfig {\n /**\n * Minimum amount of pixels that the user should\n * drag, before the CDK initiates a drag sequence.\n */\n dragStartThreshold: number;\n\n /**\n * Amount the pixels the user should drag before the CDK\n * considers them to have changed the drag direction.\n */\n pointerDirectionChangeThreshold: number;\n}\n\n/** Options that can be used to bind a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true});\n\n/** Options that can be used to bind an active event listener. */\nconst activeEventListenerOptions = normalizePassiveListenerOptions({passive: false});\n\n/**\n * Time in milliseconds for which to ignore mouse events, after\n * receiving a touch event. Used to avoid doing double work for\n * touch devices where the browser fires fake mouse events, in\n * addition to touch events.\n */\nconst MOUSE_EVENT_IGNORE_TIME = 800;\n\n// TODO(crisbeto): add an API for moving a draggable up/down the\n// list programmatically. Useful for keyboard controls.\n\n/**\n * Internal compile-time-only representation of a `DragRef`.\n * Used to avoid circular import issues between the `DragRef` and the `DropListRef`.\n * @docs-private\n */\nexport interface DragRefInternal extends DragRef {}\n\n/** Template that can be used to create a drag helper element (e.g. a preview or a placeholder). */\ninterface DragHelperTemplate<T = any> {\n template: TemplateRef<T> | null;\n viewContainer: ViewContainerRef;\n context: T;\n}\n\n/** Template that can be used to create a drag preview element. */\ninterface DragPreviewTemplate<T = any> extends DragHelperTemplate<T> {\n matchSize?: boolean;\n}\n\n/** Point on the page or within an element. */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * Reference to a draggable item. Used to manipulate or dispose of the item.\n */\nexport class DragRef<T = any> {\n /** Element displayed next to the user's pointer while the element is dragged. */\n private _preview: HTMLElement;\n\n /** Reference to the view of the preview element. */\n private _previewRef: EmbeddedViewRef<any> | null;\n\n /** Reference to the view of the placeholder element. */\n private _placeholderRef: EmbeddedViewRef<any> | null;\n\n /** Element that is rendered instead of the draggable item while it is being sorted. */\n private _placeholder: HTMLElement;\n\n /** Coordinates within the element at which the user picked up the element. */\n private _pickupPositionInElement: Point;\n\n /** Coordinates on the page at which the user picked up the element. */\n private _pickupPositionOnPage: Point;\n\n /**\n * Anchor node used to save the place in the DOM where the element was\n * picked up so that it can be restored at the end of the drag sequence.\n */\n private _anchor: Comment;\n\n /**\n * CSS `transform` applied to the element when it isn't being dragged. We need a\n * passive transform in order for the dragged element to retain its new position\n * after the user has stopped dragging and because we need to know the relative\n * position in case they start dragging again. This corresponds to `element.style.transform`.\n */\n private _passiveTransform: Point = {x: 0, y: 0};\n\n /** CSS `transform` that is applied to the element while it's being dragged. */\n private _activeTransform: Point = {x: 0, y: 0};\n\n /** Inline `transform` value that the element had before the first dragging sequence. */\n private _initialTransform?: string;\n\n /**\n * Whether the dragging sequence has been started. Doesn't\n * necessarily mean that the element has been moved.\n */\n private _hasStartedDragging: boolean;\n\n /** Whether the element has moved since the user started dragging it. */\n private _hasMoved: boolean;\n\n /** Drop container in which the DragRef resided when dragging began. */\n private _initialContainer: DropListRef;\n\n /** Index at which the item started in its initial container. */\n private _initialIndex: number;\n\n /** Cached scroll position on the page when the element was picked up. */\n private _scrollPosition: {top: number, left: number};\n\n /** Emits when the item is being moved. */\n private _moveEvents = new Subject<{\n source: DragRef;\n pointerPosition: {x: number, y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1, y: -1 | 0 | 1};\n }>();\n\n /** Keeps track of the direction in which the user is dragging along each axis. */\n private _pointerDirectionDelta: {x: -1 | 0 | 1, y: -1 | 0 | 1};\n\n /** Pointer position at which the last change in the delta occurred. */\n private _pointerPositionAtLastDirectionChange: Point;\n\n /**\n * Root DOM node of the drag instance. This is the element that will\n * be moved around as the user is dragging.\n */\n private _rootElement: HTMLElement;\n\n /**\n * Inline style value of `-webkit-tap-highlight-color` at the time the\n * dragging was started. Used to restore the value once we're done dragging.\n */\n private _rootElementTapHighlight: string | null;\n\n /** Subscription to pointer movement events. */\n private _pointerMoveSubscription = Subscription.EMPTY;\n\n /** Subscription to the event that is dispatched when the user lifts their pointer. */\n private _pointerUpSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being scrolled. */\n private _scrollSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being resized. */\n private _resizeSubscription = Subscription.EMPTY;\n\n /**\n * Time at which the last touch event occurred. Used to avoid firing the same\n * events multiple times on touch devices where the browser will fire a fake\n * mouse event for each touch event, after a certain time.\n */\n private _lastTouchEventTime: number;\n\n /** Time at which the last dragging sequence was started. */\n private _dragStartTime: number;\n\n /** Cached reference to the boundary element. */\n private _boundaryElement: HTMLElement | null = null;\n\n /** Whether the native dragging interactions have been enabled on the root element. */\n private _nativeInteractionsEnabled = true;\n\n /** Cached dimensions of the preview element. */\n private _previewRect?: ClientRect;\n\n /** Cached dimensions of the boundary element. */\n private _boundaryRect?: ClientRect;\n\n /** Element that will be used as a template to create the draggable item's preview. */\n private _previewTemplate?: DragPreviewTemplate | null;\n\n /** Template for placeholder element rendered to show where a draggable would be dropped. */\n private _placeholderTemplate?: DragHelperTemplate | null;\n\n /** Elements that can be used to drag the draggable item. */\n private _handles: HTMLElement[] = [];\n\n /** Registered handles that are currently disabled. */\n private _disabledHandles = new Set<HTMLElement>();\n\n /** Droppable container that the draggable is a part of. */\n private _dropContainer?: DropListRef;\n\n /** Layout direction of the item. */\n private _direction: Direction = 'ltr';\n\n /** Axis along which dragging is locked. */\n lockAxis: 'x' | 'y';\n\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n dragStartDelay: number | {touch: number, mouse: number} = 0;\n\n /** Class to be added to the preview element. */\n previewClass: string|string[]|undefined;\n\n /** Whether starting to drag this element is disabled. */\n get disabled(): boolean {\n return this._disabled || !!(this._dropContainer && this._dropContainer.disabled);\n }\n set disabled(value: boolean) {\n const newValue = coerceBooleanProperty(value);\n\n if (newValue !== this._disabled) {\n this._disabled = newValue;\n this._toggleNativeDragInteractions();\n }\n }\n private _disabled = false;\n\n /** Emits as the drag sequence is being prepared. */\n beforeStarted = new Subject<void>();\n\n /** Emits when the user starts dragging the item. */\n started = new Subject<{source: DragRef}>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n released = new Subject<{source: DragRef}>();\n\n /** Emits when the user stops dragging an item in the container. */\n ended = new Subject<{source: DragRef, distance: Point}>();\n\n /** Emits when the user has moved the item into a new container. */\n entered = new Subject<{container: DropListRef, item: DragRef, currentIndex: number}>();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n exited = new Subject<{container: DropListRef, item: DragRef}>();\n\n /** Emits when the user drops the item inside a container. */\n dropped = new Subject<{\n previousIndex: number;\n currentIndex: number;\n item: DragRef;\n container: DropListRef;\n previousContainer: DropListRef;\n distance: Point;\n isPointerOverContainer: boolean;\n }>();\n\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n moved: Observable<{\n source: DragRef;\n pointerPosition: {x: number, y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1, y: -1 | 0 | 1};\n }> = this._moveEvents.asObservable();\n\n /** Arbitrary data that can be attached to the drag item. */\n data: T;\n\n /**\n * Function that can be used to customize the logic of how the position of the drag item\n * is limited while it's being dragged. Gets called with a point containing the current position\n * of the user's pointer on the page and should return a point describing where the item should\n * be rendered.\n */\n constrainPosition?: (point: Point, dragRef: DragRef) => Point;\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _config: DragRefConfig,\n private _document: Document,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>) {\n\n this.withRootElement(element);\n _dragDropRegistry.registerDragItem(this);\n }\n\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement(): HTMLElement {\n return this._placeholder;\n }\n\n /** Returns the root draggable element. */\n getRootElement(): HTMLElement {\n return this._rootElement;\n }\n\n /**\n * Gets the currently-visible element that represents the drag item.\n * While dragging this is the placeholder, otherwise it's the root element.\n */\n getVisibleElement(): HTMLElement {\n return this.isDragging() ? this.getPlaceholderElement() : this.getRootElement();\n }\n\n /** Registers the handles that can be used to drag the element. */\n withHandles(handles: (HTMLElement | ElementRef<HTMLElement>)[]): this {\n this._handles = handles.map(handle => coerceElement(handle));\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, false));\n this._toggleNativeDragInteractions();\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag preview.\n * @param template Template that from which to stamp out the preview.\n */\n withPreviewTemplate(template: DragPreviewTemplate | null): this {\n this._previewTemplate = template;\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag placeholder.\n * @param template Template that from which to stamp out the placeholder.\n */\n withPlaceholderTemplate(template: DragHelperTemplate | null): this {\n this._placeholderTemplate = template;\n return this;\n }\n\n /**\n * Sets an alternate drag root element. The root element is the element that will be moved as\n * the user is dragging. Passing an alternate root element is useful when trying to enable\n * dragging on an element that you might not have access to.\n */\n withRootElement(rootElement: ElementRef<HTMLElement> | HTMLElement): this {\n const element = coerceElement(rootElement);\n\n if (element !== this._rootElement) {\n if (this._rootElement) {\n this._removeRootElementListeners(this._rootElement);\n }\n\n element.addEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.addEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n this._initialTransform = undefined;\n this._rootElement = element;\n }\n\n return this;\n }\n\n /**\n * Element to which the draggable's position will be constrained.\n */\n withBoundaryElement(boundaryElement: ElementRef<HTMLElement> | HTMLElement | null): this {\n this._boundaryElement = boundaryElement ? coerceElement(boundaryElement) : null;\n this._resizeSubscription.unsubscribe();\n if (boundaryElement) {\n this._resizeSubscription = this._viewportRuler\n .change(10)\n .subscribe(() => this._containInsideBoundaryOnResize());\n }\n return this;\n }\n\n /** Removes the dragging functionality from the DOM element. */\n dispose() {\n this._removeRootElementListeners(this._rootElement);\n\n // Do this check before removing from the registry since it'll\n // stop being considered as dragged once it is removed.\n if (this.isDragging()) {\n // Since we move out the element to the end of the body while it's being\n // dragged, we have to make sure that it's removed if it gets destroyed.\n removeNode(this._rootElement);\n }\n\n removeNode(this._anchor);\n this._destroyPreview();\n this._destroyPlaceholder();\n this._dragDropRegistry.removeDragItem(this);\n this._removeSubscriptions();\n this.beforeStarted.complete();\n this.started.complete();\n this.released.complete();\n this.ended.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this._moveEvents.complete();\n this._handles = [];\n this._disabledHandles.clear();\n this._dropContainer = undefined;\n this._resizeSubscription.unsubscribe();\n this._boundaryElement = this._rootElement = this._placeholderTemplate =\n this._previewTemplate = this._anchor = null!;\n }\n\n /** Checks whether the element is currently being dragged. */\n isDragging(): boolean {\n return this._hasStartedDragging && this._dragDropRegistry.isDragging(this);\n }\n\n /** Resets a standalone drag item to its initial position. */\n reset(): void {\n this._rootElement.style.transform = this._initialTransform || '';\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform = {x: 0, y: 0};\n }\n\n /**\n * Sets a handle as disabled. While a handle is disabled, it'll capture and interrupt dragging.\n * @param handle Handle element that should be disabled.\n */\n disableHandle(handle: HTMLElement) {\n if (this._handles.indexOf(handle) > -1) {\n this._disabledHandles.add(handle);\n }\n }\n\n /**\n * Enables a handle, if it has been disabled.\n * @param handle Handle element to be enabled.\n */\n enableHandle(handle: HTMLElement) {\n this._disabledHandles.delete(handle);\n }\n\n /** Sets the layout direction of the draggable item. */\n withDirection(direction: Direction): this {\n this._direction = direction;\n return this;\n }\n\n /** Sets the container that the item is part of. */\n _withDropContainer(container: DropListRef) {\n this._dropContainer = container;\n }\n\n /**\n * Gets the current position in pixels the draggable outside of a drop container.\n */\n getFreeDragPosition(): Readonly<Point> {\n const position = this.isDragging() ? this._activeTransform : this._passiveTransform;\n return {x: position.x, y: position.y};\n }\n\n /**\n * Sets the current position in pixels the draggable outside of a drop container.\n * @param value New position to be set.\n */\n setFreeDragPosition(value: Point): this {\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform.x = value.x;\n this._passiveTransform.y = value.y;\n\n if (!this._dropContainer) {\n this._applyRootElementTransform(value.x, value.y);\n }\n\n return this;\n }\n\n /** Updates the item's sort order based on the last-known pointer position. */\n _sortFromLastPointerPosition() {\n const position = this._pointerPositionAtLastDirectionChange;\n\n if (position && this._dropContainer) {\n this._updateActiveDropContainer(position);\n }\n }\n\n /** Unsubscribes from the global subscriptions. */\n private _removeSubscriptions() {\n this._pointerMoveSubscription.unsubscribe();\n this._pointerUpSubscription.unsubscribe();\n this._scrollSubscription.unsubscribe();\n }\n\n /** Destroys the preview element and its ViewRef. */\n private _destroyPreview() {\n if (this._preview) {\n removeNode(this._preview);\n }\n\n if (this._previewRef) {\n this._previewRef.destroy();\n }\n\n this._preview = this._previewRef = null!;\n }\n\n /** Destroys the placeholder element and its ViewRef. */\n private _destroyPlaceholder() {\n if (this._placeholder) {\n removeNode(this._placeholder);\n }\n\n if (this._placeholderRef) {\n this._placeholderRef.destroy();\n }\n\n this._placeholder = this._placeholderRef = null!;\n }\n\n /** Handler for the `mousedown`/`touchstart` events. */\n private _pointerDown = (event: MouseEvent | TouchEvent) => {\n this.beforeStarted.next();\n\n // Delegate the event based on whether it started from a handle or the element itself.\n if (this._handles.length) {\n const targetHandle = this._handles.find(handle => {\n const target = event.target;\n return !!target && (target === handle || handle.contains(target as HTMLElement));\n });\n\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n this._initializeDragSequence(targetHandle, event);\n }\n } else if (!this.disabled) {\n this._initializeDragSequence(this._rootElement, event);\n }\n }\n\n /** Handler that is invoked when the user moves their pointer after they've initiated a drag. */\n private _pointerMove = (event: MouseEvent | TouchEvent) => {\n // Prevent the default action as early as possible in order to block\n // native actions like dragging the selected text or images with the mouse.\n event.preventDefault();\n\n if (!this._hasStartedDragging) {\n const pointerPosition = this._getPointerPositionOnPage(event);\n const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x);\n const distanceY = Math.abs(pointerPosition.y - this._pickupPositionOnPage.y);\n const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold;\n\n // Only start dragging after the user has moved more than the minimum distance in either\n // direction. Note that this is preferrable over doing something like `skip(minimumDistance)`\n // in the `pointerMove` subscription, because we're not guaranteed to have one move event\n // per pixel of movement (e.g. if the user moves their pointer quickly).\n if (isOverThreshold) {\n const isDelayElapsed = Date.now() >= this._dragStartTime + this._getDragStartDelay(event);\n if (!isDelayElapsed) {\n this._endDragSequence(event);\n return;\n }\n\n // Prevent other drag sequences from starting while something in the container is still\n // being dragged. This can happen while we're waiting for the drop animation to finish\n // and can cause errors, because some elements might still be moving around.\n if (!this._dropContainer || !this._dropContainer.isDragging()) {\n this._hasStartedDragging = true;\n this._ngZone.run(() => this._startDragSequence(event));\n }\n }\n\n return;\n }\n\n // We only need the preview dimensions if we have a boundary element.\n if (this._boundaryElement) {\n // Cache the preview element rect if we haven't cached it already or if\n // we cached it too early before the element dimensions were computed.\n if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {\n this._previewRect = (this._preview || this._rootElement).getBoundingClientRect();\n }\n }\n\n const constrainedPointerPosition = this._getConstrainedPointerPosition(event);\n this._hasMoved = true;\n this._updatePointerDirectionDelta(constrainedPointerPosition);\n\n if (this._dropContainer) {\n this._updateActiveDropContainer(constrainedPointerPosition);\n } else {\n const activeTransform = this._activeTransform;\n activeTransform.x =\n constrainedPointerPosition.x - this._pickupPositionOnPage.x + this._passiveTransform.x;\n activeTransform.y =\n constrainedPointerPosition.y - this._pickupPositionOnPage.y + this._passiveTransform.y;\n\n this._applyRootElementTransform(activeTransform.x, activeTransform.y);\n\n // Apply transform as attribute if dragging and svg element to work for IE\n if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) {\n const appliedTransform = `translate(${activeTransform.x} ${activeTransform.y})`;\n this._rootElement.setAttribute('transform', appliedTransform);\n }\n }\n\n // Since this event gets fired for every pixel while dragging, we only\n // want to fire it if the consumer opted into it. Also we have to\n // re-enter the zone because we run all of the events on the outside.\n if (this._moveEvents.observers.length) {\n this._ngZone.run(() => {\n this._moveEvents.next({\n source: this,\n pointerPosition: constrainedPointerPosition,\n event,\n distance: this._getDragDistance(constrainedPointerPosition),\n delta: this._pointerDirectionDelta\n });\n });\n }\n }\n\n /** Handler that is invoked when the user lifts their pointer up, after initiating a drag. */\n private _pointerUp = (event: MouseEvent | TouchEvent) => {\n this._endDragSequence(event);\n }\n\n /**\n * Clears subscriptions and stops the dragging sequence.\n * @param event Browser event object that ended the sequence.\n */\n private _endDragSequence(event: MouseEvent | TouchEvent) {\n // Note that here we use `isDragging` from the service, rather than from `this`.\n // The difference is that the one from the service reflects whether a dragging sequence\n // has been initiated, whereas the one on `this` includes whether the user has passed\n // the minimum dragging threshold.\n if (!this._dragDropRegistry.isDragging(this)) {\n return;\n }\n\n this._removeSubscriptions();\n this._dragDropRegistry.stopDragging(this);\n this._toggleNativeDragInteractions();\n\n if (this._handles) {\n this._rootElement.style.webkitTapHighlightColor = this._rootElementTapHighlight;\n }\n\n if (!this._hasStartedDragging) {\n return;\n }\n\n this.released.next({source: this});\n\n if (this._dropContainer) {\n // Stop scrolling immediately, instead of waiting for the animation to finish.\n this._dropContainer._stopScrolling();\n this._animatePreviewToPlaceholder().then(() => {\n this._cleanupDragArtifacts(event);\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n });\n } else {\n // Convert the active transform into a passive one. This means that next time\n // the user starts dragging the item, its position will be calculated relatively\n // to the new passive transform.\n this._passiveTransform.x = this._activeTransform.x;\n this._passiveTransform.y = this._activeTransform.y;\n this._ngZone.run(() => {\n this.ended.next({\n source: this,\n distance: this._getDragDistance(this._getPointerPositionOnPage(event))\n });\n });\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n }\n }\n\n /** Starts the dragging sequence. */\n private _startDragSequence(event: MouseEvent | TouchEvent) {\n // Emit the event on the item before the one on the container.\n this.started.next({source: this});\n\n if (isTouchEvent(event)) {\n this._lastTouchEventTime = Date.now();\n }\n\n this._toggleNativeDragInteractions();\n\n if (this._dropContainer) {\n const element = this._rootElement;\n const parent = element.parentNode!;\n const preview = this._preview = this._createPreviewElement();\n const placeholder = this._placeholder = this._createPlaceholderElement();\n const anchor = this._anchor = this._anchor || this._document.createComment('');\n\n // Insert an anchor node so that we can restore the element's position in the DOM.\n parent.insertBefore(anchor, element);\n\n // We move the element out at the end of the body and we make it hidden, because keeping it in\n // place will throw off the consumer's `:last-child` selectors. We can't remove the element\n // from the DOM completely, because iOS will stop firing all subsequent events in the chain.\n element.style.display = 'none';\n this._document.body.appendChild(parent.replaceChild(placeholder, element));\n getPreviewInsertionPoint(this._document).appendChild(preview);\n this._dropContainer.start();\n this._initialContainer = this._dropContainer;\n this._initialIndex = this._dropContainer.getItemIndex(this);\n } else {\n this._initialContainer = this._initialIndex = undefined!;\n }\n }\n\n /**\n * Sets up the different variables and subscriptions\n * that will be necessary for the dragging sequence.\n * @param referenceElement Element that started the drag sequence.\n * @param event Browser event object that started the sequence.\n */\n private _initializeDragSequence(referenceElement: HTMLElement, event: MouseEvent | TouchEvent) {\n // Always stop propagation for the event that initializes\n // the dragging sequence, in order to prevent it from potentially\n // starting another sequence for a draggable parent somewhere up the DOM tree.\n event.stopPropagation();\n\n const isDragging = this.isDragging();\n const isTouchSequence = isTouchEvent(event);\n const isAuxiliaryMouseButton = !isTouchSequence && (event as MouseEvent).button !== 0;\n const rootElement = this._rootElement;\n const isSyntheticEvent = !isTouchSequence && this._lastTouchEventTime &&\n this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now();\n\n // If the event started from an element with the native HTML drag&drop, it'll interfere\n // with our own dragging (e.g. `img` tags do it by default). Prevent the default action\n // to stop it from happening. Note that preventing on `dragstart` also seems to work, but\n // it's flaky and it fails if the user drags it away quickly. Also note that we only want\n // to do this for `mousedown` since doing the same for `touchstart` will stop any `click`\n // events from firing on touch devices.\n if (event.target && (event.target as HTMLElement).draggable && event.type === 'mousedown') {\n event.preventDefault();\n }\n\n // Abort if the user is already dragging or is using a mouse button other than the primary one.\n if (isDragging || isAuxiliaryMouseButton || isSyntheticEvent) {\n return;\n }\n\n // If we've got handles, we need to disable the tap highlight on the entire root element,\n // otherwise iOS will still add it, even though all the drag interactions on the handle\n // are disabled.\n if (this._handles.length) {\n this._rootElementTapHighlight = rootElement.style.webkitTapHighlightColor;\n rootElement.style.webkitTapHighlightColor = 'transparent';\n }\n\n this._hasStartedDragging = this._hasMoved = false;\n\n // Avoid multiple subscriptions and memory leaks when multi touch\n // (isDragging check above isn't enough because of possible temporal and/or dimensional delays)\n this._removeSubscriptions();\n this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);\n this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);\n this._scrollSubscription = this._dragDropRegistry.scroll.pipe(startWith(null)).subscribe(() => {\n this._scrollPosition = this._viewportRuler.getViewportScrollPosition();\n });\n\n if (this._boundaryElement) {\n this._boundaryRect = this._boundaryElement.getBoundingClientRect();\n }\n\n // If we have a custom preview we can't know ahead of time how large it'll be so we position\n // it next to the cursor. The exception is when the consumer has opted into making the preview\n // the same size as the root element, in which case we do know the size.\n const previewTemplate = this._previewTemplate;\n this._pickupPositionInElement = previewTemplate && previewTemplate.template &&\n !previewTemplate.matchSize ? {x: 0, y: 0} :\n this._getPointerPositionInElement(referenceElement, event);\n const pointerPosition = this._pickupPositionOnPage = this._getPointerPositionOnPage(event);\n this._pointerDirectionDelta = {x: 0, y: 0};\n this._pointerPositionAtLastDirectionChange = {x: pointerPosition.x, y: pointerPosition.y};\n this._dragStartTime = Date.now();\n this._dragDropRegistry.startDragging(this, event);\n }\n\n /** Cleans up the DOM artifacts that were added to facilitate the element being dragged. */\n private _cleanupDragArtifacts(event: MouseEvent | TouchEvent) {\n // Restore the element's visibility and insert it at its old position in the DOM.\n // It's important that we maintain the position, because moving the element around in the DOM\n // can throw off `NgFor` which does smart diffing and re-creates elements only when necessary,\n // while moving the existing elements in all other cases.\n this._rootElement.style.display = '';\n this._anchor.parentNode!.replaceChild(this._rootElement, this._anchor);\n\n this._destroyPreview();\n this._destroyPlaceholder();\n this._boundaryRect = this._previewRect = undefined;\n\n // Re-enter the NgZone since we bound `document` events on the outside.\n this._ngZone.run(() => {\n const container = this._dropContainer!;\n const currentIndex = container.getItemIndex(this);\n const pointerPosition = this._getPointerPositionOnPage(event);\n const distance = this._getDragDistance(this._getPointerPositionOnPage(event));\n const isPointerOverContainer = container._isOverContainer(\n pointerPosition.x, pointerPosition.y);\n\n this.ended.next({source: this, distance});\n this.dropped.next({\n item: this,\n currentIndex,\n previousIndex: this._initialIndex,\n container: container,\n previousContainer: this._initialContainer,\n isPointerOverContainer,\n distance\n });\n container.drop(this, currentIndex, this._initialContainer, isPointerOverContainer, distance,\n this._initialIndex);\n this._dropContainer = this._initialContainer;\n });\n }\n\n /**\n * Updates the item's position in its drop container, or moves it\n * into a new one, depending on its current drag position.\n */\n private _updateActiveDropContainer({x, y}: Point) {\n // Drop container that draggable has been moved into.\n let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y);\n\n // If we couldn't find a new container to move the item into, and the item has left its\n // initial container, check whether the it's over the initial container. This handles the\n // case where two containers are connected one way and the user tries to undo dragging an\n // item into a new container.\n if (!newContainer && this._dropContainer !== this._initialContainer &&\n this._initialContainer._isOverContainer(x, y)) {\n newContainer = this._initialContainer;\n }\n\n if (newContainer && newContainer !== this._dropContainer) {\n this._ngZone.run(() => {\n // Notify the old container that the item has left.\n this.exited.next({item: this, container: this._dropContainer!});\n this._dropContainer!.exit(this);\n // Notify the new container that the item has entered.\n this._dropContainer = newContainer!;\n this._dropContainer.enter(this, x, y, newContainer === this._initialContainer &&\n // If we're re-entering the initial container and sorting is disabled,\n // put item the into its starting index to begin with.\n newContainer.sortingDisabled ? this._initialIndex : undefined);\n this.entered.next({\n item: this,\n container: newContainer!,\n currentIndex: newContainer!.getItemIndex(this)\n });\n });\n }\n\n this._dropContainer!._startScrollingIfNecessary(x, y);\n this._dropContainer!._sortItem(this, x, y, this._pointerDirectionDelta);\n this._preview.style.transform =\n getTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y);\n }\n\n /**\n * Creates the element that will be rendered next to the user's pointer\n * and will be used as a preview of the element that is being dragged.\n */\n private _createPreviewElement(): HTMLElement {\n const previewConfig = this._previewTemplate;\n const previewClass = this.previewClass;\n const previewTemplate = previewConfig ? previewConfig.template : null;\n let preview: HTMLElement;\n\n if (previewTemplate) {\n const viewRef = previewConfig!.viewContainer.createEmbeddedView(previewTemplate,\n previewConfig!.context);\n viewRef.detectChanges();\n preview = getRootNode(viewRef, this._document);\n this._previewRef = viewRef;\n\n if (previewConfig!.matchSize) {\n matchElementSize(preview, this._rootElement);\n } else {\n preview.style.transform =\n getTransform(this._pickupPositionOnPage.x, this._pickupPositionOnPage.y);\n }\n } else {\n const element = this._rootElement;\n preview = deepCloneNode(element);\n matchElementSize(preview, element);\n }\n\n extendStyles(preview.style, {\n // It's important that we disable the pointer events on the preview, because\n // it can throw off the `document.elementFromPoint` calls in the `CdkDropList`.\n pointerEvents: 'none',\n // We have to reset the margin, because it can throw off positioning relative to the viewport.\n margin: '0',\n position: 'fixed',\n top: '0',\n left: '0',\n zIndex: '1000'\n });\n\n toggleNativeDragInteractions(preview, false);\n preview.classList.add('cdk-drag-preview');\n preview.setAttribute('dir', this._direction);\n\n if (previewClass) {\n if (Array.isArray(previewClass)) {\n previewClass.forEach(className => preview.classList.add(className));\n } else {\n preview.classList.add(previewClass);\n }\n }\n\n return preview;\n }\n\n /**\n * Animates the preview element from its current position to the location of the drop placeholder.\n * @returns Promise that resolves when the animation completes.\n */\n private _animatePreviewToPlaceholder(): Promise<void> {\n // If the user hasn't moved yet, the transitionend event won't fire.\n if (!this._hasMoved) {\n return Promise.resolve();\n }\n\n const placeholderRect = this._placeholder.getBoundingClientRect();\n\n // Apply the class that adds a transition to the preview.\n this._preview.classList.add('cdk-drag-animating');\n\n // Move the preview to the placeholder position.\n this._preview.style.transform = getTransform(placeholderRect.left, placeholderRect.top);\n\n // If the element doesn't have a `transition`, the `transitionend` event won't fire. Since\n // we need to trigger a style recalculation in order for the `cdk-drag-animating` class to\n // apply its style, we take advantage of the available info to figure out whether we need to\n // bind the event in the first place.\n const duration = getTransformTransitionDurationInMs(this._preview);\n\n if (duration === 0) {\n return Promise.resolve();\n }\n\n return this._ngZone.runOutsideAngular(() => {\n return new Promise(resolve => {\n const handler = ((event: TransitionEvent) => {\n if (!event || (event.target === this._preview && event.propertyName === 'transform')) {\n this._preview.removeEventListener('transitionend', handler);\n resolve();\n clearTimeout(timeout);\n }\n }) as EventListenerOrEventListenerObject;\n\n // If a transition is short enough, the browser might not fire the `transitionend` event.\n // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll\n // fire if the transition hasn't completed when it was supposed to.\n const timeout = setTimeout(handler as Function, duration * 1.5);\n this._preview.addEventListener('transitionend', handler);\n });\n });\n }\n\n /** Creates an element that will be shown instead of the current element while dragging. */\n private _createPlaceholderElement(): HTMLElement {\n const placeholderConfig = this._placeholderTemplate;\n const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null;\n let placeholder: HTMLElement;\n\n if (placeholderTemplate) {\n this._placeholderRef = placeholderConfig!.viewContainer.createEmbeddedView(\n placeholderTemplate,\n placeholderConfig!.context\n );\n this._placeholderRef.detectChanges();\n placeholder = getRootNode(this._placeholderRef, this._document);\n } else {\n placeholder = deepCloneNode(this._rootElement);\n }\n\n placeholder.classList.add('cdk-drag-placeholder');\n return placeholder;\n }\n\n /**\n * Figures out the coordinates at which an element was picked up.\n * @param referenceElement Element that initiated the dragging.\n * @param event Event that initiated the dragging.\n */\n private _getPointerPositionInElement(referenceElement: HTMLElement,\n event: MouseEvent | TouchEvent): Point {\n const elementRect = this._rootElement.getBoundingClientRect();\n const handleElement = referenceElement === this._rootElement ? null : referenceElement;\n const referenceRect = handleElement ? handleElement.getBoundingClientRect() : elementRect;\n const point = isTouchEvent(event) ? event.targetTouches[0] : event;\n const x = point.pageX - referenceRect.left - this._scrollPosition.left;\n const y = point.pageY - referenceRect.top - this._scrollPosition.top;\n\n return {\n x: referenceRect.left - elementRect.left + x,\n y: referenceRect.top - elementRect.top + y\n };\n }\n\n /** Determines the point of the page that was touched by the user. */\n private _getPointerPositionOnPage(event: MouseEvent | TouchEvent): Point {\n // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\n const point = isTouchEvent(event) ? (event.touches[0] || event.changedTouches[0]) : event;\n\n return {\n x: point.pageX - this._scrollPosition.left,\n y: point.pageY - this._scrollPosition.top\n };\n }\n\n\n /** Gets the pointer position on the page, accounting for any position constraints. */\n private _getConstrainedPointerPosition(event: MouseEvent | TouchEvent): Point {\n const point = this._getPointerPositionOnPage(event);\n const constrainedPoint = this.constrainPosition ? this.constrainPosition(point, this) : point;\n const dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null;\n\n if (this.lockAxis === 'x' || dropContainerLock === 'x') {\n constrainedPoint.y = this._pickupPositionOnPage.y;\n } else if (this.lockAxis === 'y' || dropContainerLock === 'y') {\n constrainedPoint.x = this._pickupPositionOnPage.x;\n }\n\n if (this._boundaryRect) {\n const {x: pickupX, y: pickupY} = this._pickupPositionInElement;\n const boundaryRect = this._boundaryRect;\n const previewRect = this._previewRect!;\n const minY = boundaryRect.top + pickupY;\n const maxY = boundaryRect.bottom - (previewRect.height - pickupY);\n const minX = boundaryRect.left + pickupX;\n const maxX = boundaryRect.right - (previewRect.width - pickupX);\n\n constrainedPoint.x = clamp(constrainedPoint.x, minX, maxX);\n constrainedPoint.y = clamp(constrainedPoint.y, minY, maxY);\n }\n\n return constrainedPoint;\n }\n\n\n /** Updates the current drag delta, based on the user's current pointer position on the page. */\n private _updatePointerDirectionDelta(pointerPositionOnPage: Point) {\n const {x, y} = pointerPositionOnPage;\n const delta = this._pointerDirectionDelta;\n const positionSinceLastChange = this._pointerPositionAtLastDirectionChange;\n\n // Amount of pixels the user has dragged since the last time the direction changed.\n const changeX = Math.abs(x - positionSinceLastChange.x);\n const changeY = Math.abs(y - positionSinceLastChange.y);\n\n // Because we handle pointer events on a per-pixel basis, we don't want the delta\n // to change for every pixel, otherwise anything that depends on it can look erratic.\n // To make the delta more consistent, we track how much the user has moved since the last\n // delta change and we only update it after it has reached a certain threshold.\n if (changeX > this._config.pointerDirectionChangeThreshold) {\n delta.x = x > positionSinceLastChange.x ? 1 : -1;\n positionSinceLastChange.x = x;\n }\n\n if (changeY > this._config.pointerDirectionChangeThreshold) {\n delta.y = y > positionSinceLastChange.y ? 1 : -1;\n positionSinceLastChange.y = y;\n }\n\n return delta;\n }\n\n /** Toggles the native drag interactions, based on how many handles are registered. */\n private _toggleNativeDragInteractions() {\n if (!this._rootElement || !this._handles) {\n return;\n }\n\n const shouldEnable = this._handles.length > 0 || !this.isDragging();\n\n if (shouldEnable !== this._nativeInteractionsEnabled) {\n this._nativeInteractionsEnabled = shouldEnable;\n toggleNativeDragInteractions(this._rootElement, shouldEnable);\n }\n }\n\n /** Removes the manually-added event listeners from the root element. */\n private _removeRootElementListeners(element: HTMLElement) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n }\n\n /**\n * Applies a `transform` to the root element, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n private _applyRootElementTransform(x: number, y: number) {\n const transform = getTransform(x, y);\n\n // Cache the previous transform amount only after the first drag sequence, because\n // we don't want our own transforms to stack on top of each other.\n if (this._initialTransform == null) {\n this._initialTransform = this._rootElement.style.transform || '';\n }\n\n // Preserve the previous `transform` value, if there was one. Note that we apply our own\n // transform before the user's, because things like rotation can affect which direction\n // the element will be translated towards.\n this._rootElement.style.transform = this._initialTransform ?\n transform + ' ' + this._initialTransform : transform;\n }\n\n /**\n * Gets the distance that the user has dragged during the current drag sequence.\n * @param currentPosition Current position of the user's pointer.\n */\n private _getDragDistance(currentPosition: Point): Point {\n const pickupPosition = this._pickupPositionOnPage;\n\n if (pickupPosition) {\n return {x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y};\n }\n\n return {x: 0, y: 0};\n }\n\n /** Cleans up any cached element dimensions that we don't need after dragging has stopped. */\n private _cleanupCachedDimensions() {\n this._boundaryRect = this._previewRect = undefined;\n }\n\n /**\n * Checks whether the element is still inside its boundary after the viewport has been resized.\n * If not, the position is adjusted so that the element fits again.\n */\n private _containInsideBoundaryOnResize() {\n let {x, y} = this._passiveTransform;\n\n if ((x === 0 && y === 0) || this.isDragging() || !this._boundaryElement) {\n return;\n }\n\n const boundaryRect = this._boundaryElement.getBoundingClientRect();\n const elementRect = this._rootElement.getBoundingClientRect();\n\n // It's possible that the element got hidden away after dragging (e.g. by switching to a\n // different tab). Don't do anything in this case so we don't clear the user's position.\n if ((boundaryRect.width === 0 && boundaryRect.height === 0) ||\n (elementRect.width === 0 && elementRect.height === 0)) {\n return;\n }\n\n const leftOverflow = boundaryRect.left - elementRect.left;\n const rightOverflow = elementRect.right - boundaryRect.right;\n const topOverflow = boundaryRect.top - elementRect.top;\n const bottomOverflow = elementRect.bottom - boundaryRect.bottom;\n\n // If the element has become wider than the boundary, we can't\n // do much to make it fit so we just anchor it to the left.\n if (boundaryRect.width > elementRect.width) {\n if (leftOverflow > 0) {\n x += leftOverflow;\n }\n\n if (rightOverflow > 0) {\n x -= rightOverflow;\n }\n } else {\n x = 0;\n }\n\n // If the element has become taller than the boundary, we can't\n // do much to make it fit so we just anchor it to the top.\n if (boundaryRect.height > elementRect.height) {\n if (topOverflow > 0) {\n y += topOverflow;\n }\n\n if (bottomOverflow > 0) {\n y -= bottomOverflow;\n }\n } else {\n y = 0;\n }\n\n if (x !== this._passiveTransform.x || y !== this._passiveTransform.y) {\n this.setFreeDragPosition({y, x});\n }\n }\n\n /** Gets the drag start delay, based on the event type. */\n private _getDragStartDelay(event: MouseEvent | TouchEvent): number {\n const value = this.dragStartDelay;\n\n if (typeof value === 'number') {\n return value;\n } else if (isTouchEvent(event)) {\n return value.touch;\n }\n\n return value ? value.mouse : 0;\n }\n}\n\n/**\n * Gets a 3d `transform` that can be applied to an element.\n * @param x Desired position of the element along the X axis.\n * @param y Desired position of the element along the Y axis.\n */\nfunction getTransform(x: number, y: number): string {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;\n}\n\n/** Creates a deep clone of an element. */\nfunction deepCloneNode(node: HTMLElement): HTMLElement {\n const clone = node.cloneNode(true) as HTMLElement;\n const descendantsWithId = clone.querySelectorAll('[id]');\n const descendantCanvases = node.querySelectorAll('canvas');\n\n // Remove the `id` to avoid having multiple elements with the same id on the page.\n clone.removeAttribute('id');\n\n for (let i = 0; i < descendantsWithId.length; i++) {\n descendantsWithId[i].removeAttribute('id');\n }\n\n // `cloneNode` won't transfer the content of `canvas` elements so we have to do it ourselves.\n // We match up the cloned canvas to their sources using their index in the DOM.\n if (descendantCanvases.length) {\n const cloneCanvases = clone.querySelectorAll('canvas');\n\n for (let i = 0; i < descendantCanvases.length; i++) {\n const correspondingCloneContext = cloneCanvases[i].getContext('2d');\n\n if (correspondingCloneContext) {\n correspondingCloneContext.drawImage(descendantCanvases[i], 0, 0);\n }\n }\n }\n\n return clone;\n}\n\n/** Clamps a value between a minimum and a maximum. */\nfunction clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/**\n * Helper to remove a node from the DOM and to do all the necessary null checks.\n * @param node Node to be removed.\n */\nfunction removeNode(node: Node | null) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\n\n/** Determines whether an event is a touch event. */\nfunction isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {\n // This function is called for every pixel that the user has dragged so we need it to be\n // as fast as possible. Since we only bind mouse events and touch events, we can assume\n // that if the event's name starts with `t`, it's a touch event.\n return event.type[0] === 't';\n}\n\n/** Gets the element into which the drag preview should be inserted. */\nfunction getPreviewInsertionPoint(documentRef: any): HTMLElement {\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n // TODO(crisbeto): dedupe this with the `FullscreenOverlayContainer` eventually.\n return documentRef.fullscreenElement ||\n documentRef.webkitFullscreenElement ||\n documentRef.mozFullScreenElement ||\n documentRef.msFullscreenElement ||\n documentRef.body;\n}\n\n/**\n * Gets the root HTML element of an embedded view.\n * If the root is not an HTML element it gets wrapped in one.\n */\nfunction getRootNode(viewRef: EmbeddedViewRef<any>, _document: Document): HTMLElement {\n const rootNode: Node = viewRef.rootNodes[0];\n\n if (rootNode.nodeType !== _document.ELEMENT_NODE) {\n const wrapper = _document.createElement('div');\n wrapper.appendChild(rootNode);\n return wrapper;\n }\n\n return rootNode as HTMLElement;\n}\n\n/**\n * Matches the target element's size to the source's size.\n * @param target Element that needs to be resized.\n * @param source Element whose size needs to be matched.\n */\nfunction matchElementSize(target: HTMLElement, source: HTMLElement): void {\n const sourceRect = source.getBoundingClientRect();\n\n target.style.width = `${sourceRect.width}px`;\n target.style.height = `${sourceRect.height}px`;\n target.style.transform = getTransform(sourceRect.left, sourceRect.top);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Moves an item one index in an array to another.\n * @param array Array in which to move the item.\n * @param fromIndex Starting index of the item.\n * @param toIndex Index to which the item should be moved.\n */\nexport function moveItemInArray<T = any>(array: T[], fromIndex: number, toIndex: number): void {\n const from = clamp(fromIndex, array.length - 1);\n const to = clamp(toIndex, array.length - 1);\n\n if (from === to) {\n return;\n }\n\n const target = array[from];\n const delta = to < from ? -1 : 1;\n\n for (let i = from; i !== to; i += delta) {\n array[i] = array[i + delta];\n }\n\n array[to] = target;\n}\n\n\n/**\n * Moves an item from one array to another.\n * @param currentArray Array from which to transfer the item.\n * @param targetArray Array into which to put the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n */\nexport function transferArrayItem<T = any>(currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number): void {\n const from = clamp(currentIndex, currentArray.length - 1);\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n}\n\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @param currentArray Array from which to copy the item.\n * @param targetArray Array into which is copy the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n *\n */\nexport function copyArrayItem<T = any>(currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number): void {\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n}\n\n/** Clamps a number between zero and a maximum. */\nfunction clamp(value: number, max: number): number {\n return Math.max(0, Math.min(max, value));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef, NgZone} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {_getShadowRoot} from '@angular/cdk/platform';\nimport {Subject, Subscription, interval, animationFrameScheduler} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {moveItemInArray} from './drag-utils';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport {DragRefInternal as DragRef, Point} from './drag-ref';\n\n/**\n * Proximity, as a ratio to width/height, at which a\n * dragged item will affect the drop container.\n */\nconst DROP_PROXIMITY_THRESHOLD = 0.05;\n\n/**\n * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the\n * viewport. The value comes from trying it out manually until it feels right.\n */\nconst SCROLL_PROXIMITY_THRESHOLD = 0.05;\n\n/**\n * Number of pixels to scroll for each frame when auto-scrolling an element.\n * The value comes from trying it out manually until it feels right.\n */\nconst AUTO_SCROLL_STEP = 2;\n\n/**\n * Entry in the position cache for draggable items.\n * @docs-private\n */\ninterface CachedItemPosition {\n /** Instance of the drag item. */\n drag: DragRef;\n /** Dimensions of the item. */\n clientRect: ClientRect;\n /** Amount by which the item has been moved since dragging started. */\n offset: number;\n}\n\n/** Object holding the scroll position of something. */\ninterface ScrollPosition {\n top: number;\n left: number;\n}\n\n/** Vertical direction in which we can auto-scroll. */\nconst enum AutoScrollVerticalDirection {NONE, UP, DOWN}\n\n/** Horizontal direction in which we can auto-scroll. */\nconst enum AutoScrollHorizontalDirection {NONE, LEFT, RIGHT}\n\n/**\n * Internal compile-time-only representation of a `DropListRef`.\n * Used to avoid circular import issues between the `DropListRef` and the `DragRef`.\n * @docs-private\n */\nexport interface DropListRefInternal extends DropListRef {}\n\n/**\n * Reference to a drop list. Used to manipulate or dispose of the container.\n */\nexport class DropListRef<T = any> {\n /** Element that the drop list is attached to. */\n element: HTMLElement | ElementRef<HTMLElement>;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n disabled: boolean = false;\n\n /** Whether sorting items within the list is disabled. */\n sortingDisabled: boolean = false;\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n lockAxis: 'x' | 'y';\n\n /**\n * Whether auto-scrolling the view when the user\n * moves their pointer close to the edges is disabled.\n */\n autoScrollDisabled: boolean = false;\n\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n enterPredicate: (drag: DragRef, drop: DropListRef) => boolean = () => true;\n\n /** Emits right before dragging has started. */\n beforeStarted = new Subject<void>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n entered = new Subject<{item: DragRef, container: DropListRef, currentIndex: number}>();\n\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n exited = new Subject<{item: DragRef, container: DropListRef}>();\n\n /** Emits when the user drops an item inside the container. */\n dropped = new Subject<{\n item: DragRef,\n currentIndex: number,\n previousIndex: number,\n container: DropListRef,\n previousContainer: DropListRef,\n isPointerOverContainer: boolean,\n distance: Point;\n }>();\n\n /** Emits as the user is swapping items while actively dragging. */\n sorted = new Subject<{\n previousIndex: number,\n currentIndex: number,\n container: DropListRef,\n item: DragRef\n }>();\n\n /** Arbitrary data that can be attached to the drop list. */\n data: T;\n\n /** Whether an item in the list is being dragged. */\n private _isDragging = false;\n\n /** Cache of the dimensions of all the items inside the container. */\n private _itemPositions: CachedItemPosition[] = [];\n\n /** Cached positions of the scrollable parent elements. */\n private _parentPositions = new Map<Document|HTMLElement, {\n scrollPosition: ScrollPosition,\n clientRect?: ClientRect\n }>();\n\n /** Cached `ClientRect` of the drop list. */\n private _clientRect: ClientRect;\n\n /**\n * Draggable items that are currently active inside the container. Includes the items\n * from `_draggables`, as well as any items that have been dragged in, but haven't\n * been dropped yet.\n */\n private _activeDraggables: DragRef[];\n\n /**\n * Keeps track of the item that was last swapped with the dragged item, as\n * well as what direction the pointer was moving in when the swap occured.\n */\n private _previousSwap = {drag: null as DragRef | null, delta: 0};\n\n /** Draggable items in the container. */\n private _draggables: ReadonlyArray<DragRef>;\n\n /** Drop lists that are connected to the current one. */\n private _siblings: ReadonlyArray<DropListRef> = [];\n\n /** Direction in which the list is oriented. */\n private _orientation: 'horizontal' | 'vertical' = 'vertical';\n\n /** Connected siblings that currently have a dragged item. */\n private _activeSiblings = new Set<DropListRef>();\n\n /** Layout direction of the drop list. */\n private _direction: Direction = 'ltr';\n\n /** Subscription to the window being scrolled. */\n private _viewportScrollSubscription = Subscription.EMPTY;\n\n /** Vertical direction in which the list is currently scrolling. */\n private _verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n\n /** Horizontal direction in which the list is currently scrolling. */\n private _horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n /** Node that is being auto-scrolled. */\n private _scrollNode: HTMLElement | Window;\n\n /** Used to signal to the current auto-scroll sequence when to stop. */\n private _stopScrollTimers = new Subject<void>();\n\n /** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */\n private _cachedShadowRoot: DocumentOrShadowRoot | null = null;\n\n /** Reference to the document. */\n private _document: Document;\n\n /** Elements that can be scrolled while the user is dragging. */\n private _scrollableElements: HTMLElement[];\n\n /** Initial value for the element's `scroll-snap-type` style. */\n private _initialScrollSnap: string;\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>,\n _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler) {\n this.element = coerceElement(element);\n this._document = _document;\n this.withScrollableParents([this.element]);\n _dragDropRegistry.registerDropContainer(this);\n }\n\n /** Removes the drop list functionality from the DOM element. */\n dispose() {\n this._stopScrolling();\n this._stopScrollTimers.complete();\n this._viewportScrollSubscription.unsubscribe();\n this.beforeStarted.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this.sorted.complete();\n this._activeSiblings.clear();\n this._scrollNode = null!;\n this._parentPositions.clear();\n this._dragDropRegistry.removeDropContainer(this);\n }\n\n /** Whether an item from this list is currently being dragged. */\n isDragging() {\n return this._isDragging;\n }\n\n /** Starts dragging an item. */\n start(): void {\n const styles = coerceElement(this.element).style;\n this.beforeStarted.next();\n this._isDragging = true;\n\n // We need to disable scroll snapping while the user is dragging, because it breaks automatic\n // scrolling. The browser seems to round the value based on the snapping points which means\n // that we can't increment/decrement the scroll position.\n this._initialScrollSnap = styles.msScrollSnapType || (styles as any).scrollSnapType || '';\n (styles as any).scrollSnapType = styles.msScrollSnapType = 'none';\n this._cacheItems();\n this._siblings.forEach(sibling => sibling._startReceiving(this));\n this._viewportScrollSubscription.unsubscribe();\n this._listenToScrollEvents();\n }\n\n /**\n * Emits an event to indicate that the user moved an item into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void {\n this.start();\n\n // If sorting is disabled, we want the item to return to its starting\n // position if the user is returning it to its initial container.\n let newIndex: number;\n\n if (index == null) {\n newIndex = this.sortingDisabled ? this._draggables.indexOf(item) : -1;\n\n if (newIndex === -1) {\n // We use the coordinates of where the item entered the drop\n // zone to figure out at which index it should be inserted.\n newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY);\n }\n } else {\n newIndex = index;\n }\n\n const activeDraggables = this._activeDraggables;\n const currentIndex = activeDraggables.indexOf(item);\n const placeholder = item.getPlaceholderElement();\n let newPositionReference: DragRef | undefined = activeDraggables[newIndex];\n\n // If the item at the new position is the same as the item that is being dragged,\n // it means that we're trying to restore the item to its initial position. In this\n // case we should use the next item from the list as the reference.\n if (newPositionReference === item) {\n newPositionReference = activeDraggables[newIndex + 1];\n }\n\n // Since the item may be in the `activeDraggables` already (e.g. if the user dragged it\n // into another container and back again), we have to ensure that it isn't duplicated.\n if (currentIndex > -1) {\n activeDraggables.splice(currentIndex, 1);\n }\n\n // Don't use items that are being dragged as a reference, because\n // their element has been moved down to the bottom of the body.\n if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) {\n const element = newPositionReference.getRootElement();\n element.parentElement!.insertBefore(placeholder, element);\n activeDraggables.splice(newIndex, 0, item);\n } else {\n coerceElement(this.element).appendChild(placeholder);\n activeDraggables.push(item);\n }\n\n // The transform needs to be cleared so it doesn't throw off the measurements.\n placeholder.style.transform = '';\n\n // Note that the positions were already cached when we called `start` above,\n // but we need to refresh them since the amount of items has changed.\n this._cacheItemPositions();\n this.entered.next({item, container: this, currentIndex: this.getItemIndex(item)});\n }\n\n /**\n * Removes an item from the container after it was dragged into another container by the user.\n * @param item Item that was dragged out.\n */\n exit(item: DragRef): void {\n this._reset();\n this.exited.next({item, container: this});\n }\n\n /**\n * Drops an item into this container.\n * @param item Item being dropped into the container.\n * @param currentIndex Index at which the item should be inserted.\n * @param previousContainer Container from which the item got dragged in.\n * @param isPointerOverContainer Whether the user's pointer was over the\n * container when the item was dropped.\n * @param distance Distance the user has dragged since the start of the dragging sequence.\n * @param previousIndex Index of the item when dragging started.\n *\n * @breaking-change 11.0.0 `previousIndex` parameter to become required.\n */\n drop(item: DragRef, currentIndex: number, previousContainer: DropListRef,\n isPointerOverContainer: boolean, distance: Point, previousIndex?: number): void {\n this._reset();\n\n // @breaking-change 11.0.0 Remove this fallback logic once `previousIndex` is a required param.\n if (previousIndex == null) {\n previousIndex = previousContainer.getItemIndex(item);\n }\n\n this.dropped.next({item,\n currentIndex,\n previousIndex,\n container: this,\n previousContainer,\n isPointerOverContainer,\n distance\n });\n }\n\n /**\n * Sets the draggable items that are a part of this list.\n * @param items Items that are a part of this list.\n */\n withItems(items: DragRef[]): this {\n this._draggables = items;\n items.forEach(item => item._withDropContainer(this));\n\n if (this.isDragging()) {\n this._cacheItems();\n }\n\n return this;\n }\n\n /** Sets the layout direction of the drop list. */\n withDirection(direction: Direction): this {\n this._direction = direction;\n return this;\n }\n\n /**\n * Sets the containers that are connected to this one. When two or more containers are\n * connected, the user will be allowed to transfer items between them.\n * @param connectedTo Other containers that the current containers should be connected to.\n */\n connectedTo(connectedTo: DropListRef[]): this {\n this._siblings = connectedTo.slice();\n return this;\n }\n\n /**\n * Sets the orientation of the container.\n * @param orientation New orientation for the container.\n */\n withOrientation(orientation: 'vertical' | 'horizontal'): this {\n this._orientation = orientation;\n return this;\n }\n\n /**\n * Sets which parent elements are can be scrolled while the user is dragging.\n * @param elements Elements that can be scrolled.\n */\n withScrollableParents(elements: HTMLElement[]): this {\n const element = coerceElement(this.element);\n\n // We always allow the current element to be scrollable\n // so we need to ensure that it's in the array.\n this._scrollableElements =\n elements.indexOf(element) === -1 ? [element, ...elements] : elements.slice();\n return this;\n }\n\n /**\n * Figures out the index of an item in the container.\n * @param item Item whose index should be determined.\n */\n getItemIndex(item: DragRef): number {\n if (!this._isDragging) {\n return this._draggables.indexOf(item);\n }\n\n // Items are sorted always by top/left in the cache, however they flow differently in RTL.\n // The rest of the logic still stands no matter what orientation we're in, however\n // we need to invert the array when determining the index.\n const items = this._orientation === 'horizontal' && this._direction === 'rtl' ?\n this._itemPositions.slice().reverse() : this._itemPositions;\n\n return findIndex(items, currentItem => currentItem.drag === item);\n }\n\n /**\n * Whether the list is able to receive the item that\n * is currently being dragged inside a connected drop list.\n */\n isReceiving(): boolean {\n return this._activeSiblings.size > 0;\n }\n\n /**\n * Sorts an item inside the container based on its position.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n _sortItem(item: DragRef, pointerX: number, pointerY: number,\n pointerDelta: {x: number, y: number}): void {\n // Don't sort the item if sorting is disabled or it's out of range.\n if (this.sortingDisabled || !isPointerNearClientRect(this._clientRect, pointerX, pointerY)) {\n return;\n }\n\n const siblings = this._itemPositions;\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta);\n\n if (newIndex === -1 && siblings.length > 0) {\n return;\n }\n\n const isHorizontal = this._orientation === 'horizontal';\n const currentIndex = findIndex(siblings, currentItem => currentItem.drag === item);\n const siblingAtNewPosition = siblings[newIndex];\n const currentPosition = siblings[currentIndex].clientRect;\n const newPosition = siblingAtNewPosition.clientRect;\n const delta = currentIndex > newIndex ? 1 : -1;\n\n this._previousSwap.drag = siblingAtNewPosition.drag;\n this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y;\n\n // How many pixels the item's placeholder should be offset.\n const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta);\n\n // How many pixels all the other items should be offset.\n const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta);\n\n // Save the previous order of the items before moving the item to its new index.\n // We use this to check whether an item has been moved as a result of the sorting.\n const oldOrder = siblings.slice();\n\n // Shuffle the array in place.\n moveItemInArray(siblings, currentIndex, newIndex);\n\n this.sorted.next({\n previousIndex: currentIndex,\n currentIndex: newIndex,\n container: this,\n item\n });\n\n siblings.forEach((sibling, index) => {\n // Don't do anything if the position hasn't changed.\n if (oldOrder[index] === sibling) {\n return;\n }\n\n const isDraggedItem = sibling.drag === item;\n const offset = isDraggedItem ? itemOffset : siblingOffset;\n const elementToOffset = isDraggedItem ? item.getPlaceholderElement() :\n sibling.drag.getRootElement();\n\n // Update the offset to reflect the new position.\n sibling.offset += offset;\n\n // Since we're moving the items with a `transform`, we need to adjust their cached\n // client rects to reflect their new position, as well as swap their positions in the cache.\n // Note that we shouldn't use `getBoundingClientRect` here to update the cache, because the\n // elements may be mid-animation which will give us a wrong result.\n if (isHorizontal) {\n // Round the transforms since some browsers will\n // blur the elements, for sub-pixel transforms.\n elementToOffset.style.transform = `translate3d(${Math.round(sibling.offset)}px, 0, 0)`;\n adjustClientRect(sibling.clientRect, 0, offset);\n } else {\n elementToOffset.style.transform = `translate3d(0, ${Math.round(sibling.offset)}px, 0)`;\n adjustClientRect(sibling.clientRect, offset, 0);\n }\n });\n }\n\n /**\n * Checks whether the user's pointer is close to the edges of either the\n * viewport or the drop list and starts the auto-scroll sequence.\n * @param pointerX User's pointer position along the x axis.\n * @param pointerY User's pointer position along the y axis.\n */\n _startScrollingIfNecessary(pointerX: number, pointerY: number) {\n if (this.autoScrollDisabled) {\n return;\n }\n\n let scrollNode: HTMLElement | Window | undefined;\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Check whether we should start scrolling any of the parent containers.\n this._parentPositions.forEach((position, element) => {\n // We have special handling for the `document` below. Also this would be\n // nicer with a for...of loop, but it requires changing a compiler flag.\n if (element === this._document || !position.clientRect || scrollNode) {\n return;\n }\n\n if (isPointerNearClientRect(position.clientRect, pointerX, pointerY)) {\n [verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(\n element as HTMLElement, position.clientRect, pointerX, pointerY);\n\n if (verticalScrollDirection || horizontalScrollDirection) {\n scrollNode = element as HTMLElement;\n }\n }\n });\n\n // Otherwise check if we can start scrolling the viewport.\n if (!verticalScrollDirection && !horizontalScrollDirection) {\n const {width, height} = this._viewportRuler.getViewportSize();\n const clientRect = {width, height, top: 0, right: width, bottom: height, left: 0};\n verticalScrollDirection = getVerticalScrollDirection(clientRect, pointerY);\n horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);\n scrollNode = window;\n }\n\n if (scrollNode && (verticalScrollDirection !== this._verticalScrollDirection ||\n horizontalScrollDirection !== this._horizontalScrollDirection ||\n scrollNode !== this._scrollNode)) {\n this._verticalScrollDirection = verticalScrollDirection;\n this._horizontalScrollDirection = horizontalScrollDirection;\n this._scrollNode = scrollNode;\n\n if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) {\n this._ngZone.runOutsideAngular(this._startScrollInterval);\n } else {\n this._stopScrolling();\n }\n }\n }\n\n /** Stops any currently-running auto-scroll sequences. */\n _stopScrolling() {\n this._stopScrollTimers.next();\n }\n\n /** Caches the positions of the configured scrollable parents. */\n private _cacheParentPositions() {\n this._parentPositions.clear();\n this._parentPositions.set(this._document, {\n scrollPosition: this._viewportRuler!.getViewportScrollPosition(),\n });\n this._scrollableElements.forEach(element => {\n const clientRect = getMutableClientRect(element);\n\n // We keep the ClientRect cached in two properties, because it's referenced in a lot of\n // performance-sensitive places and we want to avoid the extra lookups. The `element` is\n // guaranteed to always be in the `_scrollableElements` so this should always match.\n if (element === this.element) {\n this._clientRect = clientRect;\n }\n\n this._parentPositions.set(element, {\n scrollPosition: {top: element.scrollTop, left: element.scrollLeft},\n clientRect\n });\n });\n }\n\n /** Refreshes the position cache of the items and sibling containers. */\n private _cacheItemPositions() {\n const isHorizontal = this._orientation === 'horizontal';\n\n this._itemPositions = this._activeDraggables.map(drag => {\n const elementToMeasure = drag.getVisibleElement();\n return {drag, offset: 0, clientRect: getMutableClientRect(elementToMeasure)};\n }).sort((a, b) => {\n return isHorizontal ? a.clientRect.left - b.clientRect.left :\n a.clientRect.top - b.clientRect.top;\n });\n }\n\n /** Resets the container to its initial state. */\n private _reset() {\n this._isDragging = false;\n\n const styles = coerceElement(this.element).style;\n (styles as any).scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap;\n\n // TODO(crisbeto): may have to wait for the animations to finish.\n this._activeDraggables.forEach(item => item.getRootElement().style.transform = '');\n this._siblings.forEach(sibling => sibling._stopReceiving(this));\n this._activeDraggables = [];\n this._itemPositions = [];\n this._previousSwap.drag = null;\n this._previousSwap.delta = 0;\n this._stopScrolling();\n this._viewportScrollSubscription.unsubscribe();\n this._parentPositions.clear();\n }\n\n /**\n * Gets the offset in pixels by which the items that aren't being dragged should be moved.\n * @param currentIndex Index of the item currently being dragged.\n * @param siblings All of the items in the list.\n * @param delta Direction in which the user is moving.\n */\n private _getSiblingOffsetPx(currentIndex: number,\n siblings: CachedItemPosition[],\n delta: 1 | -1) {\n\n const isHorizontal = this._orientation === 'horizontal';\n const currentPosition = siblings[currentIndex].clientRect;\n const immediateSibling = siblings[currentIndex + delta * -1];\n let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta;\n\n if (immediateSibling) {\n const start = isHorizontal ? 'left' : 'top';\n const end = isHorizontal ? 'right' : 'bottom';\n\n // Get the spacing between the start of the current item and the end of the one immediately\n // after it in the direction in which the user is dragging, or vice versa. We add it to the\n // offset in order to push the element to where it will be when it's inline and is influenced\n // by the `margin` of its siblings.\n if (delta === -1) {\n siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end];\n } else {\n siblingOffset += currentPosition[start] - immediateSibling.clientRect[end];\n }\n }\n\n return siblingOffset;\n }\n\n /**\n * Gets the offset in pixels by which the item that is being dragged should be moved.\n * @param currentPosition Current position of the item.\n * @param newPosition Position of the item where the current item should be moved.\n * @param delta Direction in which the user is moving.\n */\n private _getItemOffsetPx(currentPosition: ClientRect, newPosition: ClientRect, delta: 1 | -1) {\n const isHorizontal = this._orientation === 'horizontal';\n let itemOffset = isHorizontal ? newPosition.left - currentPosition.left :\n newPosition.top - currentPosition.top;\n\n // Account for differences in the item width/height.\n if (delta === -1) {\n itemOffset += isHorizontal ? newPosition.width - currentPosition.width :\n newPosition.height - currentPosition.height;\n }\n\n return itemOffset;\n }\n\n /**\n * Gets the index of an item in the drop container, based on the position of the user's pointer.\n * @param item Item that is being sorted.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n * @param delta Direction in which the user is moving their pointer.\n */\n private _getItemIndexFromPointerPosition(item: DragRef, pointerX: number, pointerY: number,\n delta?: {x: number, y: number}) {\n const isHorizontal = this._orientation === 'horizontal';\n\n return findIndex(this._itemPositions, ({drag, clientRect}, _, array) => {\n if (drag === item) {\n // If there's only one item left in the container, it must be\n // the dragged item itself so we use it as a reference.\n return array.length < 2;\n }\n\n if (delta) {\n const direction = isHorizontal ? delta.x : delta.y;\n\n // If the user is still hovering over the same item as last time, and they didn't change\n // the direction in which they're dragging, we don't consider it a direction swap.\n if (drag === this._previousSwap.drag && direction === this._previousSwap.delta) {\n return false;\n }\n }\n\n return isHorizontal ?\n // Round these down since most browsers report client rects with\n // sub-pixel precision, whereas the pointer coordinates are rounded to pixels.\n pointerX >= Math.floor(clientRect.left) && pointerX <= Math.floor(clientRect.right) :\n pointerY >= Math.floor(clientRect.top) && pointerY <= Math.floor(clientRect.bottom);\n });\n }\n\n /** Caches the current items in the list and their positions. */\n private _cacheItems(): void {\n this._activeDraggables = this._draggables.slice();\n this._cacheItemPositions();\n this._cacheParentPositions();\n }\n\n /**\n * Updates the internal state of the container after a scroll event has happened.\n * @param scrolledParent Element that was scrolled.\n * @param newTop New top scroll position.\n * @param newLeft New left scroll position.\n */\n private _updateAfterScroll(scrolledParent: HTMLElement | Document,\n newTop: number,\n newLeft: number) {\n // Used when figuring out whether an element is inside the scroll parent. If the scrolled\n // parent is the `document`, we use the `documentElement`, because IE doesn't support `contains`\n // on the `document`.\n const scrolledParentNode =\n scrolledParent === this._document ? scrolledParent.documentElement : scrolledParent;\n const scrollPosition = this._parentPositions.get(scrolledParent)!.scrollPosition;\n const topDifference = scrollPosition.top - newTop;\n const leftDifference = scrollPosition.left - newLeft;\n\n // Go through and update the cached positions of the scroll\n // parents that are inside the element that was scrolled.\n this._parentPositions.forEach((position, node) => {\n if (position.clientRect && scrolledParent !== node && scrolledParentNode.contains(node)) {\n adjustClientRect(position.clientRect, topDifference, leftDifference);\n }\n });\n\n // Since we know the amount that the user has scrolled we can shift all of the client rectangles\n // ourselves. This is cheaper than re-measuring everything and we can avoid inconsistent\n // behavior where we might be measuring the element before its position has changed.\n this._itemPositions.forEach(({clientRect}) => {\n adjustClientRect(clientRect, topDifference, leftDifference);\n });\n\n // We need two loops for this, because we want all of the cached\n // positions to be up-to-date before we re-sort the item.\n this._itemPositions.forEach(({drag}) => {\n if (this._dragDropRegistry.isDragging(drag)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n drag._sortFromLastPointerPosition();\n }\n });\n\n scrollPosition.top = newTop;\n scrollPosition.left = newLeft;\n }\n\n /** Starts the interval that'll auto-scroll the element. */\n private _startScrollInterval = () => {\n this._stopScrolling();\n\n interval(0, animationFrameScheduler)\n .pipe(takeUntil(this._stopScrollTimers))\n .subscribe(() => {\n const node = this._scrollNode;\n\n if (this._verticalScrollDirection === AutoScrollVerticalDirection.UP) {\n incrementVerticalScroll(node, -AUTO_SCROLL_STEP);\n } else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {\n incrementVerticalScroll(node, AUTO_SCROLL_STEP);\n }\n\n if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {\n incrementHorizontalScroll(node, -AUTO_SCROLL_STEP);\n } else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {\n incrementHorizontalScroll(node, AUTO_SCROLL_STEP);\n }\n });\n }\n\n /**\n * Checks whether the user's pointer is positioned over the container.\n * @param x Pointer position along the X axis.\n * @param y Pointer position along the Y axis.\n */\n _isOverContainer(x: number, y: number): boolean {\n return isInsideClientRect(this._clientRect, x, y);\n }\n\n /**\n * Figures out whether an item should be moved into a sibling\n * drop container, based on its current position.\n * @param item Drag item that is being moved.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _getSiblingContainerFromPosition(item: DragRef, x: number, y: number): DropListRef | undefined {\n return this._siblings.find(sibling => sibling._canReceive(item, x, y));\n }\n\n /**\n * Checks whether the drop list can receive the passed-in item.\n * @param item Item that is being dragged into the list.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _canReceive(item: DragRef, x: number, y: number): boolean {\n if (!isInsideClientRect(this._clientRect, x, y) || !this.enterPredicate(item, this)) {\n return false;\n }\n\n const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y) as HTMLElement | null;\n\n // If there's no element at the pointer position, then\n // the client rect is probably scrolled out of the view.\n if (!elementFromPoint) {\n return false;\n }\n\n const nativeElement = coerceElement(this.element);\n\n // The `ClientRect`, that we're using to find the container over which the user is\n // hovering, doesn't give us any information on whether the element has been scrolled\n // out of the view or whether it's overlapping with other containers. This means that\n // we could end up transferring the item into a container that's invisible or is positioned\n // below another one. We use the result from `elementFromPoint` to get the top-most element\n // at the pointer position and to find whether it's one of the intersecting drop containers.\n return elementFromPoint === nativeElement || nativeElement.contains(elementFromPoint);\n }\n\n /**\n * Called by one of the connected drop lists when a dragging sequence has started.\n * @param sibling Sibling in which dragging has started.\n */\n _startReceiving(sibling: DropListRef) {\n const activeSiblings = this._activeSiblings;\n\n if (!activeSiblings.has(sibling)) {\n activeSiblings.add(sibling);\n this._cacheParentPositions();\n this._listenToScrollEvents();\n }\n }\n\n /**\n * Called by a connected drop list when dragging has stopped.\n * @param sibling Sibling whose dragging has stopped.\n */\n _stopReceiving(sibling: DropListRef) {\n this._activeSiblings.delete(sibling);\n this._viewportScrollSubscription.unsubscribe();\n }\n\n /**\n * Starts listening to scroll events on the viewport.\n * Used for updating the internal state of the list.\n */\n private _listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry.scroll.subscribe(event => {\n if (this.isDragging()) {\n const target = event.target as HTMLElement | Document;\n const position = this._parentPositions.get(target);\n\n if (position) {\n let newTop: number;\n let newLeft: number;\n\n if (target === this._document) {\n const scrollPosition = this._viewportRuler!.getViewportScrollPosition();\n newTop = scrollPosition.top;\n newLeft = scrollPosition.left;\n } else {\n newTop = (target as HTMLElement).scrollTop;\n newLeft = (target as HTMLElement).scrollLeft;\n }\n\n this._updateAfterScroll(target, newTop, newLeft);\n }\n } else if (this.isReceiving()) {\n this._cacheParentPositions();\n }\n });\n }\n\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n private _getShadowRoot(): DocumentOrShadowRoot {\n if (!this._cachedShadowRoot) {\n const shadowRoot = _getShadowRoot(coerceElement(this.element)) as ShadowRoot | null;\n this._cachedShadowRoot = shadowRoot || this._document;\n }\n\n return this._cachedShadowRoot;\n }\n}\n\n\n/**\n * Updates the top/left positions of a `ClientRect`, as well as their bottom/right counterparts.\n * @param clientRect `ClientRect` that should be updated.\n * @param top Amount to add to the `top` position.\n * @param left Amount to add to the `left` position.\n */\nfunction adjustClientRect(clientRect: ClientRect, top: number, left: number) {\n clientRect.top += top;\n clientRect.bottom = clientRect.top + clientRect.height;\n\n clientRect.left += left;\n clientRect.right = clientRect.left + clientRect.width;\n}\n\n/**\n * Checks whether the pointer coordinates are close to a ClientRect.\n * @param rect ClientRect to check against.\n * @param pointerX Coordinates along the X axis.\n * @param pointerY Coordinates along the Y axis.\n */\nfunction isPointerNearClientRect(rect: ClientRect, pointerX: number, pointerY: number): boolean {\n const {top, right, bottom, left, width, height} = rect;\n const xThreshold = width * DROP_PROXIMITY_THRESHOLD;\n const yThreshold = height * DROP_PROXIMITY_THRESHOLD;\n\n return pointerY > top - yThreshold && pointerY < bottom + yThreshold &&\n pointerX > left - xThreshold && pointerX < right + xThreshold;\n}\n\n/**\n * Finds the index of an item that matches a predicate function. Used as an equivalent\n * of `Array.prototype.findIndex` which isn't part of the standard Google typings.\n * @param array Array in which to look for matches.\n * @param predicate Function used to determine whether an item is a match.\n */\nfunction findIndex<T>(array: T[],\n predicate: (value: T, index: number, obj: T[]) => boolean): number {\n\n for (let i = 0; i < array.length; i++) {\n if (predicate(array[i], i, array)) {\n return i;\n }\n }\n\n return -1;\n}\n\n\n/**\n * Checks whether some coordinates are within a `ClientRect`.\n * @param clientRect ClientRect that is being checked.\n * @param x Coordinates along the X axis.\n * @param y Coordinates along the Y axis.\n */\nfunction isInsideClientRect(clientRect: ClientRect, x: number, y: number) {\n const {top, bottom, left, right} = clientRect;\n return y >= top && y <= bottom && x >= left && x <= right;\n}\n\n\n/** Gets a mutable version of an element's bounding `ClientRect`. */\nfunction getMutableClientRect(element: Element): ClientRect {\n const clientRect = element.getBoundingClientRect();\n\n // We need to clone the `clientRect` here, because all the values on it are readonly\n // and we need to be able to update them. Also we can't use a spread here, because\n // the values on a `ClientRect` aren't own properties. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes\n return {\n top: clientRect.top,\n right: clientRect.right,\n bottom: clientRect.bottom,\n left: clientRect.left,\n width: clientRect.width,\n height: clientRect.height\n };\n}\n\n/**\n * Increments the vertical scroll position of a node.\n * @param node Node whose scroll position should change.\n * @param amount Amount of pixels that the `node` should be scrolled.\n */\nfunction incrementVerticalScroll(node: HTMLElement | Window, amount: number) {\n if (node === window) {\n (node as Window).scrollBy(0, amount);\n } else {\n // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\n (node as HTMLElement).scrollTop += amount;\n }\n}\n\n/**\n * Increments the horizontal scroll position of a node.\n * @param node Node whose scroll position should change.\n * @param amount Amount of pixels that the `node` should be scrolled.\n */\nfunction incrementHorizontalScroll(node: HTMLElement | Window, amount: number) {\n if (node === window) {\n (node as Window).scrollBy(amount, 0);\n } else {\n // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\n (node as HTMLElement).scrollLeft += amount;\n }\n}\n\n/**\n * Gets whether the vertical auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getVerticalScrollDirection(clientRect: ClientRect, pointerY: number) {\n const {top, bottom, height} = clientRect;\n const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {\n return AutoScrollVerticalDirection.UP;\n } else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {\n return AutoScrollVerticalDirection.DOWN;\n }\n\n return AutoScrollVerticalDirection.NONE;\n}\n\n/**\n * Gets whether the horizontal auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerX Position of the user's pointer along the x axis.\n */\nfunction getHorizontalScrollDirection(clientRect: ClientRect, pointerX: number) {\n const {left, right, width} = clientRect;\n const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {\n return AutoScrollHorizontalDirection.LEFT;\n } else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {\n return AutoScrollHorizontalDirection.RIGHT;\n }\n\n return AutoScrollHorizontalDirection.NONE;\n}\n\n/**\n * Gets the directions in which an element node should be scrolled,\n * assuming that the user's pointer is already within it scrollable region.\n * @param element Element for which we should calculate the scroll direction.\n * @param clientRect Bounding client rectangle of the element.\n * @param pointerX Position of the user's pointer along the x axis.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getElementScrollDirections(element: HTMLElement, clientRect: ClientRect, pointerX: number,\n pointerY: number): [AutoScrollVerticalDirection, AutoScrollHorizontalDirection] {\n const computedVertical = getVerticalScrollDirection(clientRect, pointerY);\n const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX);\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Note that we here we do some extra checks for whether the element is actually scrollable in\n // a certain direction and we only assign the scroll direction if it is. We do this so that we\n // can allow other elements to be scrolled, if the current element can't be scrolled anymore.\n // This allows us to handle cases where the scroll regions of two scrollable elements overlap.\n if (computedVertical) {\n const scrollTop = element.scrollTop;\n\n if (computedVertical === AutoScrollVerticalDirection.UP) {\n if (scrollTop > 0) {\n verticalScrollDirection = AutoScrollVerticalDirection.UP;\n }\n } else if (element.scrollHeight - scrollTop > element.clientHeight) {\n verticalScrollDirection = AutoScrollVerticalDirection.DOWN;\n }\n }\n\n if (computedHorizontal) {\n const scrollLeft = element.scrollLeft;\n\n if (computedHorizontal === AutoScrollHorizontalDirection.LEFT) {\n if (scrollLeft > 0) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;\n }\n } else if (element.scrollWidth - scrollLeft > element.clientWidth) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;\n }\n }\n\n return [verticalScrollDirection, horizontalScrollDirection];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, NgZone, OnDestroy, Inject} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {Subject} from 'rxjs';\n\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = normalizePassiveListenerOptions({\n passive: false,\n capture: true\n});\n\n/**\n * Service that keeps track of all the drag item and drop container\n * instances, and manages global event listeners on the `document`.\n * @docs-private\n */\n// Note: this class is generic, rather than referencing CdkDrag and CdkDropList directly, in order\n// to avoid circular imports. If we were to reference them here, importing the registry into the\n// classes that are registering themselves will introduce a circular import.\n@Injectable({providedIn: 'root'})\nexport class DragDropRegistry<I, C> implements OnDestroy {\n private _document: Document;\n\n /** Registered drop container instances. */\n private _dropInstances = new Set<C>();\n\n /** Registered drag item instances. */\n private _dragInstances = new Set<I>();\n\n /** Drag item instances that are currently being dragged. */\n private _activeDragInstances = new Set<I>();\n\n /** Keeps track of the event listeners that we've bound to the `document`. */\n private _globalListeners = new Map<string, {\n handler: (event: Event) => void,\n options?: AddEventListenerOptions | boolean\n }>();\n\n /**\n * Emits the `touchmove` or `mousemove` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerMove: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n /**\n * Emits the `touchend` or `mouseup` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerUp: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n /** Emits when the viewport has been scrolled while the user is dragging an item. */\n readonly scroll: Subject<Event> = new Subject<Event>();\n\n constructor(\n private _ngZone: NgZone,\n @Inject(DOCUMENT) _document: any) {\n this._document = _document;\n }\n\n /** Adds a drop container to the registry. */\n registerDropContainer(drop: C) {\n if (!this._dropInstances.has(drop)) {\n this._dropInstances.add(drop);\n }\n }\n\n /** Adds a drag item instance to the registry. */\n registerDragItem(drag: I) {\n this._dragInstances.add(drag);\n\n // The `touchmove` event gets bound once, ahead of time, because WebKit\n // won't preventDefault on a dynamically-added `touchmove` listener.\n // See https://bugs.webkit.org/show_bug.cgi?id=184250.\n if (this._dragInstances.size === 1) {\n this._ngZone.runOutsideAngular(() => {\n // The event handler has to be explicitly active,\n // because newer browsers make it passive by default.\n this._document.addEventListener('touchmove', this._preventDefaultWhileDragging,\n activeCapturingEventOptions);\n });\n }\n }\n\n /** Removes a drop container from the registry. */\n removeDropContainer(drop: C) {\n this._dropInstances.delete(drop);\n }\n\n /** Removes a drag item instance from the registry. */\n removeDragItem(drag: I) {\n this._dragInstances.delete(drag);\n this.stopDragging(drag);\n\n if (this._dragInstances.size === 0) {\n this._document.removeEventListener('touchmove', this._preventDefaultWhileDragging,\n activeCapturingEventOptions);\n }\n }\n\n /**\n * Starts the dragging sequence for a drag instance.\n * @param drag Drag instance which is being dragged.\n * @param event Event that initiated the dragging.\n */\n startDragging(drag: I, event: TouchEvent | MouseEvent) {\n // Do not process the same drag twice to avoid memory leaks and redundant listeners\n if (this._activeDragInstances.has(drag)) {\n return;\n }\n\n this._activeDragInstances.add(drag);\n\n if (this._activeDragInstances.size === 1) {\n const isTouchEvent = event.type.startsWith('touch');\n const moveEvent = isTouchEvent ? 'touchmove' : 'mousemove';\n const upEvent = isTouchEvent ? 'touchend' : 'mouseup';\n\n // We explicitly bind __active__ listeners here, because newer browsers will default to\n // passive ones for `mousemove` and `touchmove`. The events need to be active, because we\n // use `preventDefault` to prevent the page from scrolling while the user is dragging.\n this._globalListeners\n .set(moveEvent, {\n handler: (e: Event) => this.pointerMove.next(e as TouchEvent | MouseEvent),\n options: activeCapturingEventOptions\n })\n .set(upEvent, {\n handler: (e: Event) => this.pointerUp.next(e as TouchEvent | MouseEvent),\n options: true\n })\n .set('scroll', {\n handler: (e: Event) => this.scroll.next(e),\n // Use capturing so that we pick up scroll changes in any scrollable nodes that aren't\n // the document. See https://github.com/angular/components/issues/17144.\n options: true\n })\n // Preventing the default action on `mousemove` isn't enough to disable text selection\n // on Safari so we need to prevent the selection event as well. Alternatively this can\n // be done by setting `user-select: none` on the `body`, however it has causes a style\n // recalculation which can be expensive on pages with a lot of elements.\n .set('selectstart', {\n handler: this._preventDefaultWhileDragging,\n options: activeCapturingEventOptions\n });\n\n this._ngZone.runOutsideAngular(() => {\n this._globalListeners.forEach((config, name) => {\n this._document.addEventListener(name, config.handler, config.options);\n });\n });\n }\n }\n\n /** Stops dragging a drag item instance. */\n stopDragging(drag: I) {\n this._activeDragInstances.delete(drag);\n\n if (this._activeDragInstances.size === 0) {\n this._clearGlobalListeners();\n }\n }\n\n /** Gets whether a drag item instance is currently being dragged. */\n isDragging(drag: I) {\n return this._activeDragInstances.has(drag);\n }\n\n ngOnDestroy() {\n this._dragInstances.forEach(instance => this.removeDragItem(instance));\n this._dropInstances.forEach(instance => this.removeDropContainer(instance));\n this._clearGlobalListeners();\n this.pointerMove.complete();\n this.pointerUp.complete();\n }\n\n /**\n * Event listener that will prevent the default browser action while the user is dragging.\n * @param event Event whose default action should be prevented.\n */\n private _preventDefaultWhileDragging = (event: Event) => {\n if (this._activeDragInstances.size) {\n event.preventDefault();\n }\n }\n\n /** Clears out the global event listeners from the `document`. */\n private _clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n\n this._globalListeners.clear();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, Inject, NgZone, ElementRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {DragRef, DragRefConfig} from './drag-ref';\nimport {DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\n\n/** Default configuration to be used when creating a `DragRef`. */\nconst DEFAULT_CONFIG = {\n dragStartThreshold: 5,\n pointerDirectionChangeThreshold: 5\n};\n\n/**\n * Service that allows for drag-and-drop functionality to be attached to DOM elements.\n */\n@Injectable({providedIn: 'root'})\nexport class DragDrop {\n constructor(\n @Inject(DOCUMENT) private _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>) {}\n\n /**\n * Turns an element into a draggable item.\n * @param element Element to which to attach the dragging functionality.\n * @param config Object used to configure the dragging behavior.\n */\n createDrag<T = any>(element: ElementRef<HTMLElement> | HTMLElement,\n config: DragRefConfig = DEFAULT_CONFIG): DragRef<T> {\n\n return new DragRef<T>(element, config, this._document, this._ngZone, this._viewportRuler,\n this._dragDropRegistry);\n }\n\n /**\n * Turns an element into a drop list.\n * @param element Element to which to attach the drop list functionality.\n */\n createDropList<T = any>(element: ElementRef<HTMLElement> | HTMLElement): DropListRef<T> {\n return new DropListRef<T>(element, this._dragDropRegistry, this._document, this._ngZone,\n this._viewportRuler);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CdkDrag} from './directives/drag';\nimport {CdkDropList} from './directives/drop-list';\n\n/** Event emitted when the user starts dragging a draggable. */\nexport interface CdkDragStart<T = any> {\n /** Draggable that emitted the event. */\n source: CdkDrag<T>;\n}\n\n/** Event emitted when the user releases an item, before any animations have started. */\nexport interface CdkDragRelease<T = any> {\n /** Draggable that emitted the event. */\n source: CdkDrag<T>;\n}\n\n/** Event emitted when the user stops dragging a draggable. */\nexport interface CdkDragEnd<T = any> {\n /** Draggable that emitted the event. */\n source: CdkDrag<T>;\n /** Distance in pixels that the user has dragged since the drag sequence started. */\n distance: {x: number, y: number};\n}\n\n/** Event emitted when the user moves an item into a new drop container. */\nexport interface CdkDragEnter<T = any, I = T> {\n /** Container into which the user has moved the item. */\n container: CdkDropList<T>;\n /** Item that was moved into the container. */\n item: CdkDrag<I>;\n /** Index at which the item has entered the container. */\n currentIndex: number;\n}\n\n/**\n * Event emitted when the user removes an item from a\n * drop container by moving it into another one.\n */\nexport interface CdkDragExit<T = any, I = T> {\n /** Container from which the user has a removed an item. */\n container: CdkDropList<T>;\n /** Item that was removed from the container. */\n item: CdkDrag<I>;\n}\n\n\n/** Event emitted when the user drops a draggable item inside a drop container. */\nexport interface CdkDragDrop<T, O = T> {\n /** Index of the item when it was picked up. */\n previousIndex: number;\n /** Current index of the item. */\n currentIndex: number;\n /** Item that is being dropped. */\n item: CdkDrag;\n /** Container in which the item was dropped. */\n container: CdkDropList<T>;\n /** Container from which the item was picked up. Can be the same as the `container`. */\n previousContainer: CdkDropList<O>;\n /** Whether the user's pointer was over the container when the item was dropped. */\n isPointerOverContainer: boolean;\n /** Distance in pixels that the user has dragged since the drag sequence started. */\n distance: {x: number, y: number};\n}\n\n/** Event emitted as the user is dragging a draggable item. */\nexport interface CdkDragMove<T = any> {\n /** Item that is being dragged. */\n source: CdkDrag<T>;\n /** Position of the user's pointer on the page. */\n pointerPosition: {x: number, y: number};\n /** Native event that is causing the dragging. */\n event: MouseEvent | TouchEvent;\n /** Distance in pixels that the user has dragged since the drag sequence started. */\n distance: {x: number, y: number};\n /**\n * Indicates the direction in which the user is dragging the element along each axis.\n * `1` means that the position is increasing (e.g. the user is moving to the right or downwards),\n * whereas `-1` means that it's decreasing (they're moving to the left or upwards). `0` means\n * that the position hasn't changed.\n */\n delta: {x: -1 | 0 | 1, y: -1 | 0 | 1};\n}\n\n/** Event emitted when the user swaps the position of two drag items. */\nexport interface CdkDragSortEvent<T = any, I = T> {\n /** Index from which the item was sorted previously. */\n previousIndex: number;\n /** Index that the item is currently in. */\n currentIndex: number;\n /** Container that the item belongs to. */\n container: CdkDropList<T>;\n /** Item that is being sorted. */\n item: CdkDrag<I>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\n/**\n * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the\n * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily\n * to avoid circular imports.\n * @docs-private\n */\nexport const CDK_DRAG_PARENT = new InjectionToken<{}>('CDK_DRAG_PARENT');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef, Inject, Optional, Input, OnDestroy} from '@angular/core';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Subject} from 'rxjs';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {toggleNativeDragInteractions} from '../drag-styling';\n\n/** Handle that can be used to drag and CdkDrag instance. */\n@Directive({\n selector: '[cdkDragHandle]',\n host: {\n 'class': 'cdk-drag-handle'\n }\n})\nexport class CdkDragHandle implements OnDestroy {\n /** Closest parent draggable instance. */\n _parentDrag: {} | undefined;\n\n /** Emits when the state of the handle has changed. */\n _stateChanges = new Subject<CdkDragHandle>();\n\n /** Whether starting to drag through this handle is disabled. */\n @Input('cdkDragHandleDisabled')\n get disabled(): boolean { return this._disabled; }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n this._stateChanges.next(this);\n }\n private _disabled = false;\n\n constructor(\n public element: ElementRef<HTMLElement>,\n @Inject(CDK_DRAG_PARENT) @Optional() parentDrag?: any) {\n\n this._parentDrag = parentDrag;\n toggleNativeDragInteractions(element.nativeElement, false);\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef, Input} from '@angular/core';\n\n/**\n * Element that will be used as a template for the placeholder of a CdkDrag when\n * it is being dragged. The placeholder is displayed in place of the element being dragged.\n */\n@Directive({\n selector: 'ng-template[cdkDragPlaceholder]'\n})\nexport class CdkDragPlaceholder<T = any> {\n /** Context data to be added to the placeholder template instance. */\n @Input() data: T;\n constructor(public templateRef: TemplateRef<T>) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef, Input} from '@angular/core';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\n\n/**\n * Element that will be used as a template for the preview\n * of a CdkDrag when it is being dragged.\n */\n@Directive({\n selector: 'ng-template[cdkDragPreview]'\n})\nexport class CdkDragPreview<T = any> {\n /** Context data to be added to the preview template instance. */\n @Input() data: T;\n\n /** Whether the preview should preserve the same size as the item that is being dragged. */\n @Input()\n get matchSize(): boolean { return this._matchSize; }\n set matchSize(value: boolean) { this._matchSize = coerceBooleanProperty(value); }\n private _matchSize = false;\n\n constructor(public templateRef: TemplateRef<T>) {}\n\n static ngAcceptInputType_matchSize: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {DragRefConfig, Point, DragRef} from '../drag-ref';\n\n/** Possible values that can be used to configure the drag start delay. */\nexport type DragStartDelay = number | {touch: number, mouse: number};\n\n/** Possible axis along which dragging can be locked. */\nexport type DragAxis = 'x' | 'y';\n\n/** Function that can be used to constrain the position of a dragged element. */\nexport type DragConstrainPosition = (point: Point, dragRef: DragRef) => Point;\n\n/** Possible orientations for a drop list. */\nexport type DropListOrientation = 'horizontal' | 'vertical';\n\n/**\n * Injection token that can be used to configure the\n * behavior of the drag&drop-related components.\n */\nexport const CDK_DRAG_CONFIG = new InjectionToken<DragDropConfig>('CDK_DRAG_CONFIG');\n\n/**\n * Object that can be used to configure the drag\n * items and drop lists within a module or a component.\n */\nexport interface DragDropConfig extends Partial<DragRefConfig> {\n lockAxis?: DragAxis;\n dragStartDelay?: DragStartDelay;\n constrainPosition?: DragConstrainPosition;\n previewClass?: string | string[];\n boundaryElement?: string;\n rootElementSelector?: string;\n draggingDisabled?: boolean;\n sortingDisabled?: boolean;\n listAutoScrollDisabled?: boolean;\n listOrientation?: DropListOrientation;\n}\n\n/**\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n * @docs-private\n */\nexport function CDK_DRAG_CONFIG_FACTORY(): DragDropConfig {\n return {dragStartThreshold: 5, pointerDirectionChangeThreshold: 5};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewInit,\n ContentChild,\n ContentChildren,\n Directive,\n ElementRef,\n EventEmitter,\n Inject,\n InjectionToken,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n SkipSelf,\n ViewContainerRef,\n OnChanges,\n SimpleChanges,\n ChangeDetectorRef,\n isDevMode,\n} from '@angular/core';\nimport {\n coerceBooleanProperty,\n coerceNumberProperty,\n coerceElement,\n BooleanInput\n} from '@angular/cdk/coercion';\nimport {Observable, Observer, Subject, merge} from 'rxjs';\nimport {startWith, take, map, takeUntil, switchMap, tap} from 'rxjs/operators';\nimport {\n CdkDragDrop,\n CdkDragEnd,\n CdkDragEnter,\n CdkDragExit,\n CdkDragMove,\n CdkDragStart,\n CdkDragRelease,\n} from '../drag-events';\nimport {CdkDragHandle} from './drag-handle';\nimport {CdkDragPlaceholder} from './drag-placeholder';\nimport {CdkDragPreview} from './drag-preview';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {DragRef, Point} from '../drag-ref';\nimport {CdkDropListInternal as CdkDropList} from './drop-list';\nimport {DragDrop} from '../drag-drop';\nimport {CDK_DRAG_CONFIG, DragDropConfig, DragStartDelay, DragAxis} from './config';\n\n/**\n * Injection token that is used to provide a CdkDropList instance to CdkDrag.\n * Used for avoiding circular imports.\n */\nexport const CDK_DROP_LIST = new InjectionToken<CdkDropList>('CDK_DROP_LIST');\n\n/** Element that can be moved inside a CdkDropList container. */\n@Directive({\n selector: '[cdkDrag]',\n exportAs: 'cdkDrag',\n host: {\n 'class': 'cdk-drag',\n '[class.cdk-drag-disabled]': 'disabled',\n '[class.cdk-drag-dragging]': '_dragRef.isDragging()',\n },\n providers: [{provide: CDK_DRAG_PARENT, useExisting: CdkDrag}]\n})\nexport class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {\n private _destroyed = new Subject<void>();\n\n /** Reference to the underlying drag instance. */\n _dragRef: DragRef<CdkDrag<T>>;\n\n /** Elements that can be used to drag the draggable item. */\n @ContentChildren(CdkDragHandle, {descendants: true}) _handles: QueryList<CdkDragHandle>;\n\n /** Element that will be used as a template to create the draggable item's preview. */\n @ContentChild(CdkDragPreview) _previewTemplate: CdkDragPreview;\n\n /** Template for placeholder element rendered to show where a draggable would be dropped. */\n @ContentChild(CdkDragPlaceholder) _placeholderTemplate: CdkDragPlaceholder;\n\n /** Arbitrary data to attach to this drag instance. */\n @Input('cdkDragData') data: T;\n\n /** Locks the position of the dragged element along the specified axis. */\n @Input('cdkDragLockAxis') lockAxis: DragAxis;\n\n /**\n * Selector that will be used to determine the root draggable element, starting from\n * the `cdkDrag` element and going up the DOM. Passing an alternate root element is useful\n * when trying to enable dragging on an element that you might not have access to.\n */\n @Input('cdkDragRootElement') rootElementSelector: string;\n\n /**\n * Node or selector that will be used to determine the element to which the draggable's\n * position will be constrained. If a string is passed in, it'll be used as a selector that\n * will be matched starting from the element's parent and going up the DOM until a match\n * has been found.\n */\n @Input('cdkDragBoundary') boundaryElement: string | ElementRef<HTMLElement> | HTMLElement;\n\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n @Input('cdkDragStartDelay') dragStartDelay: DragStartDelay;\n\n /**\n * Sets the position of a `CdkDrag` that is outside of a drop container.\n * Can be used to restore the element's position for a returning user.\n */\n @Input('cdkDragFreeDragPosition') freeDragPosition: {x: number, y: number};\n\n /** Whether starting to drag this element is disabled. */\n @Input('cdkDragDisabled')\n get disabled(): boolean {\n return this._disabled || (this.dropContainer && this.dropContainer.disabled);\n }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n this._dragRef.disabled = this._disabled;\n }\n private _disabled: boolean;\n\n /**\n * Function that can be used to customize the logic of how the position of the drag item\n * is limited while it's being dragged. Gets called with a point containing the current position\n * of the user's pointer on the page and should return a point describing where the item should\n * be rendered.\n */\n @Input('cdkDragConstrainPosition') constrainPosition?: (point: Point, dragRef: DragRef) => Point;\n\n /** Class to be added to the preview element. */\n @Input('cdkDragPreviewClass') previewClass: string | string[];\n\n /** Emits when the user starts dragging the item. */\n @Output('cdkDragStarted') started: EventEmitter<CdkDragStart> = new EventEmitter<CdkDragStart>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n @Output('cdkDragReleased') released: EventEmitter<CdkDragRelease> =\n new EventEmitter<CdkDragRelease>();\n\n /** Emits when the user stops dragging an item in the container. */\n @Output('cdkDragEnded') ended: EventEmitter<CdkDragEnd> = new EventEmitter<CdkDragEnd>();\n\n /** Emits when the user has moved the item into a new container. */\n @Output('cdkDragEntered') entered: EventEmitter<CdkDragEnter<any>> =\n new EventEmitter<CdkDragEnter<any>>();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n @Output('cdkDragExited') exited: EventEmitter<CdkDragExit<any>> =\n new EventEmitter<CdkDragExit<any>>();\n\n /** Emits when the user drops the item inside a container. */\n @Output('cdkDragDropped') dropped: EventEmitter<CdkDragDrop<any>> =\n new EventEmitter<CdkDragDrop<any>>();\n\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n @Output('cdkDragMoved') moved: Observable<CdkDragMove<T>> =\n new Observable((observer: Observer<CdkDragMove<T>>) => {\n const subscription = this._dragRef.moved.pipe(map(movedEvent => ({\n source: this,\n pointerPosition: movedEvent.pointerPosition,\n event: movedEvent.event,\n delta: movedEvent.delta,\n distance: movedEvent.distance\n }))).subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n };\n });\n\n constructor(\n /** Element that the draggable is attached to. */\n public element: ElementRef<HTMLElement>,\n /** Droppable container that the draggable is a part of. */\n @Inject(CDK_DROP_LIST) @Optional() @SkipSelf() public dropContainer: CdkDropList,\n @Inject(DOCUMENT) private _document: any, private _ngZone: NgZone,\n private _viewContainerRef: ViewContainerRef,\n @Optional() @Inject(CDK_DRAG_CONFIG) config: DragDropConfig,\n @Optional() private _dir: Directionality, dragDrop: DragDrop,\n private _changeDetectorRef: ChangeDetectorRef) {\n this._dragRef = dragDrop.createDrag(element, {\n dragStartThreshold: config && config.dragStartThreshold != null ?\n config.dragStartThreshold : 5,\n pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null ?\n config.pointerDirectionChangeThreshold : 5\n });\n this._dragRef.data = this;\n\n if (config) {\n this._assignDefaults(config);\n }\n\n // Note that usually the container is assigned when the drop list is picks up the item, but in\n // some cases (mainly transplanted views with OnPush, see #18341) we may end up in a situation\n // where there are no items on the first change detection pass, but the items get picked up as\n // soon as the user triggers another pass by dragging. This is a problem, because the item would\n // have to switch from standalone mode to drag mode in the middle of the dragging sequence which\n // is too late since the two modes save different kinds of information. We work around it by\n // assigning the drop container both from here and the list.\n if (dropContainer) {\n this._dragRef._withDropContainer(dropContainer._dropListRef);\n dropContainer.addItem(this);\n }\n\n this._syncInputs(this._dragRef);\n this._handleEvents(this._dragRef);\n }\n\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement(): HTMLElement {\n return this._dragRef.getPlaceholderElement();\n }\n\n /** Returns the root draggable element. */\n getRootElement(): HTMLElement {\n return this._dragRef.getRootElement();\n }\n\n /** Resets a standalone drag item to its initial position. */\n reset(): void {\n this._dragRef.reset();\n }\n\n /**\n * Gets the pixel coordinates of the draggable outside of a drop container.\n */\n getFreeDragPosition(): {readonly x: number, readonly y: number} {\n return this._dragRef.getFreeDragPosition();\n }\n\n ngAfterViewInit() {\n // We need to wait for the zone to stabilize, in order for the reference\n // element to be in the proper place in the DOM. This is mostly relevant\n // for draggable elements inside portals since they get stamped out in\n // their original DOM position and then they get transferred to the portal.\n this._ngZone.onStable.asObservable()\n .pipe(take(1), takeUntil(this._destroyed))\n .subscribe(() => {\n this._updateRootElement();\n\n // Listen for any newly-added handles.\n this._handles.changes.pipe(\n startWith(this._handles),\n // Sync the new handles with the DragRef.\n tap((handles: QueryList<CdkDragHandle>) => {\n const childHandleElements = handles\n .filter(handle => handle._parentDrag === this)\n .map(handle => handle.element);\n this._dragRef.withHandles(childHandleElements);\n }),\n // Listen if the state of any of the handles changes.\n switchMap((handles: QueryList<CdkDragHandle>) => {\n return merge(...handles.map(item => {\n return item._stateChanges.pipe(startWith(item));\n })) as Observable<CdkDragHandle>;\n }),\n takeUntil(this._destroyed)\n ).subscribe(handleInstance => {\n // Enabled/disable the handle that changed in the DragRef.\n const dragRef = this._dragRef;\n const handle = handleInstance.element.nativeElement;\n handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);\n });\n\n if (this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n });\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const rootSelectorChange = changes['rootElementSelector'];\n const positionChange = changes['freeDragPosition'];\n\n // We don't have to react to the first change since it's being\n // handled in `ngAfterViewInit` where it needs to be deferred.\n if (rootSelectorChange && !rootSelectorChange.firstChange) {\n this._updateRootElement();\n }\n\n // Skip the first change since it's being handled in `ngAfterViewInit`.\n if (positionChange && !positionChange.firstChange && this.freeDragPosition) {\n this._dragRef.setFreeDragPosition(this.freeDragPosition);\n }\n }\n\n ngOnDestroy() {\n if (this.dropContainer) {\n this.dropContainer.removeItem(this);\n }\n\n this._destroyed.next();\n this._destroyed.complete();\n this._dragRef.dispose();\n }\n\n /** Syncs the root element with the `DragRef`. */\n private _updateRootElement() {\n const element = this.element.nativeElement;\n const rootElement = this.rootElementSelector ?\n getClosestMatchingAncestor(element, this.rootElementSelector) : element;\n\n if (rootElement && rootElement.nodeType !== this._document.ELEMENT_NODE) {\n throw Error(`cdkDrag must be attached to an element node. ` +\n `Currently attached to \"${rootElement.nodeName}\".`);\n }\n\n this._dragRef.withRootElement(rootElement || element);\n }\n\n /** Gets the boundary element, based on the `boundaryElement` value. */\n private _getBoundaryElement() {\n const boundary = this.boundaryElement;\n\n if (!boundary) {\n return null;\n }\n\n if (typeof boundary === 'string') {\n return getClosestMatchingAncestor(this.element.nativeElement, boundary);\n }\n\n const element = coerceElement(boundary);\n\n if (isDevMode() && !element.contains(this.element.nativeElement)) {\n throw Error('Draggable element is not inside of the node passed into cdkDragBoundary.');\n }\n\n return element;\n }\n\n /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */\n private _syncInputs(ref: DragRef<CdkDrag<T>>) {\n ref.beforeStarted.subscribe(() => {\n if (!ref.isDragging()) {\n const dir = this._dir;\n const dragStartDelay = this.dragStartDelay;\n const placeholder = this._placeholderTemplate ? {\n template: this._placeholderTemplate.templateRef,\n context: this._placeholderTemplate.data,\n viewContainer: this._viewContainerRef\n } : null;\n const preview = this._previewTemplate ? {\n template: this._previewTemplate.templateRef,\n context: this._previewTemplate.data,\n matchSize: this._previewTemplate.matchSize,\n viewContainer: this._viewContainerRef\n } : null;\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.dragStartDelay = (typeof dragStartDelay === 'object' && dragStartDelay) ?\n dragStartDelay : coerceNumberProperty(dragStartDelay);\n ref.constrainPosition = this.constrainPosition;\n ref.previewClass = this.previewClass;\n ref\n .withBoundaryElement(this._getBoundaryElement())\n .withPlaceholderTemplate(placeholder)\n .withPreviewTemplate(preview);\n\n if (dir) {\n ref.withDirection(dir.value);\n }\n }\n });\n }\n\n /** Handles the events from the underlying `DragRef`. */\n private _handleEvents(ref: DragRef<CdkDrag<T>>) {\n ref.started.subscribe(() => {\n this.started.emit({source: this});\n\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n\n ref.released.subscribe(() => {\n this.released.emit({source: this});\n });\n\n ref.ended.subscribe(event => {\n this.ended.emit({source: this, distance: event.distance});\n\n // Since all of these events run outside of change detection,\n // we need to ensure that everything is marked correctly.\n this._changeDetectorRef.markForCheck();\n });\n\n ref.entered.subscribe(event => {\n this.entered.emit({\n container: event.container.data,\n item: this,\n currentIndex: event.currentIndex\n });\n });\n\n ref.exited.subscribe(event => {\n this.exited.emit({\n container: event.container.data,\n item: this\n });\n });\n\n ref.dropped.subscribe(event => {\n this.dropped.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n previousContainer: event.previousContainer.data,\n container: event.container.data,\n isPointerOverContainer: event.isPointerOverContainer,\n item: this,\n distance: event.distance\n });\n });\n }\n\n /** Assigns the default input values based on a provided config object. */\n private _assignDefaults(config: DragDropConfig) {\n const {\n lockAxis, dragStartDelay, constrainPosition, previewClass,\n boundaryElement, draggingDisabled, rootElementSelector\n } = config;\n\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.dragStartDelay = dragStartDelay || 0;\n\n if (lockAxis) {\n this.lockAxis = lockAxis;\n }\n\n if (constrainPosition) {\n this.constrainPosition = constrainPosition;\n }\n\n if (previewClass) {\n this.previewClass = previewClass;\n }\n\n if (boundaryElement) {\n this.boundaryElement = boundaryElement;\n }\n\n if (rootElementSelector) {\n this.rootElementSelector = rootElementSelector;\n }\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n\n/** Gets the closest ancestor of an element that matches a selector. */\nfunction getClosestMatchingAncestor(element: HTMLElement, selector: string) {\n let currentElement = element.parentElement as HTMLElement | null;\n\n while (currentElement) {\n // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.\n if (currentElement.matches ? currentElement.matches(selector) :\n (currentElement as any).msMatchesSelector(selector)) {\n return currentElement;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return null;\n}\n\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, OnDestroy, Input} from '@angular/core';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\n\n/**\n * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`\n * elements that are placed inside a `cdkDropListGroup` will be connected to each other\n * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input\n * from `cdkDropList`.\n */\n@Directive({\n selector: '[cdkDropListGroup]',\n exportAs: 'cdkDropListGroup',\n})\nexport class CdkDropListGroup<T> implements OnDestroy {\n /** Drop lists registered inside the group. */\n readonly _items = new Set<T>();\n\n /** Whether starting a dragging sequence from inside this group is disabled. */\n @Input('cdkDropListGroupDisabled')\n get disabled(): boolean { return this._disabled; }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n ngOnDestroy() {\n this._items.clear();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceArray, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n Optional,\n Directive,\n ChangeDetectorRef,\n SkipSelf,\n AfterContentInit,\n Inject,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {ScrollDispatcher} from '@angular/cdk/scrolling';\nimport {CdkDrag, CDK_DROP_LIST} from './drag';\nimport {CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragSortEvent} from '../drag-events';\nimport {CdkDropListGroup} from './drop-list-group';\nimport {DropListRef} from '../drop-list-ref';\nimport {DragRef} from '../drag-ref';\nimport {DragDrop} from '../drag-drop';\nimport {DropListOrientation, DragAxis, DragDropConfig, CDK_DRAG_CONFIG} from './config';\nimport {Subject} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\n\n/** Counter used to generate unique ids for drop zones. */\nlet _uniqueIdCounter = 0;\n\n/**\n * Internal compile-time-only representation of a `CdkDropList`.\n * Used to avoid circular import issues between the `CdkDropList` and the `CdkDrag`.\n * @docs-private\n */\nexport interface CdkDropListInternal extends CdkDropList {}\n\n/** Container that wraps a set of draggable items. */\n@Directive({\n selector: '[cdkDropList], cdk-drop-list',\n exportAs: 'cdkDropList',\n providers: [\n // Prevent child drop lists from picking up the same group as their parent.\n {provide: CdkDropListGroup, useValue: undefined},\n {provide: CDK_DROP_LIST, useExisting: CdkDropList},\n ],\n host: {\n 'class': 'cdk-drop-list',\n '[id]': 'id',\n '[class.cdk-drop-list-disabled]': 'disabled',\n '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()',\n '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()',\n }\n})\nexport class CdkDropList<T = any> implements AfterContentInit, OnDestroy {\n /** Emits when the list has been destroyed. */\n private _destroyed = new Subject<void>();\n\n /** Keeps track of the drop lists that are currently on the page. */\n private static _dropLists: CdkDropList[] = [];\n\n /** Reference to the underlying drop list instance. */\n _dropListRef: DropListRef<CdkDropList<T>>;\n\n /**\n * Other draggable containers that this container is connected to and into which the\n * container's items can be transferred. Can either be references to other drop containers,\n * or their unique IDs.\n */\n @Input('cdkDropListConnectedTo')\n connectedTo: (CdkDropList | string)[] | CdkDropList | string = [];\n\n /** Arbitrary data to attach to this container. */\n @Input('cdkDropListData') data: T;\n\n /** Direction in which the list is oriented. */\n @Input('cdkDropListOrientation') orientation: DropListOrientation;\n\n /**\n * Unique ID for the drop zone. Can be used as a reference\n * in the `connectedTo` of another `CdkDropList`.\n */\n @Input() id: string = `cdk-drop-list-${_uniqueIdCounter++}`;\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n @Input('cdkDropListLockAxis') lockAxis: DragAxis;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n @Input('cdkDropListDisabled')\n get disabled(): boolean {\n return this._disabled || (!!this._group && this._group.disabled);\n }\n set disabled(value: boolean) {\n // Usually we sync the directive and ref state right before dragging starts, in order to have\n // a single point of failure and to avoid having to use setters for everything. `disabled` is\n // a special case, because it can prevent the `beforeStarted` event from firing, which can lock\n // the user in a disabled state, so we also need to sync it as it's being set.\n this._dropListRef.disabled = this._disabled = coerceBooleanProperty(value);\n }\n private _disabled: boolean;\n\n /** Whether sorting within this drop list is disabled. */\n @Input('cdkDropListSortingDisabled')\n sortingDisabled: boolean;\n\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n @Input('cdkDropListEnterPredicate')\n enterPredicate: (drag: CdkDrag, drop: CdkDropList) => boolean = () => true\n\n /** Whether to auto-scroll the view when the user moves their pointer close to the edges. */\n @Input('cdkDropListAutoScrollDisabled')\n autoScrollDisabled: boolean;\n\n /** Emits when the user drops an item inside the container. */\n @Output('cdkDropListDropped')\n dropped: EventEmitter<CdkDragDrop<T, any>> = new EventEmitter<CdkDragDrop<T, any>>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n @Output('cdkDropListEntered')\n entered: EventEmitter<CdkDragEnter<T>> = new EventEmitter<CdkDragEnter<T>>();\n\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n @Output('cdkDropListExited')\n exited: EventEmitter<CdkDragExit<T>> = new EventEmitter<CdkDragExit<T>>();\n\n /** Emits as the user is swapping items while actively dragging. */\n @Output('cdkDropListSorted')\n sorted: EventEmitter<CdkDragSortEvent<T>> = new EventEmitter<CdkDragSortEvent<T>>();\n\n /**\n * Keeps track of the items that are registered with this container. Historically we used to\n * do this with a `ContentChildren` query, however queries don't handle transplanted views very\n * well which means that we can't handle cases like dragging the headers of a `mat-table`\n * correctly. What we do instead is to have the items register themselves with the container\n * and then we sort them based on their position in the DOM.\n */\n private _unsortedItems = new Set<CdkDrag>();\n\n constructor(\n /** Element that the drop list is attached to. */\n public element: ElementRef<HTMLElement>, dragDrop: DragDrop,\n private _changeDetectorRef: ChangeDetectorRef, @Optional() private _dir?: Directionality,\n @Optional() @SkipSelf() private _group?: CdkDropListGroup<CdkDropList>,\n\n /**\n * @deprecated _scrollDispatcher parameter to become required.\n * @breaking-change 11.0.0\n */\n private _scrollDispatcher?: ScrollDispatcher,\n @Optional() @Inject(CDK_DRAG_CONFIG) config?: DragDropConfig) {\n this._dropListRef = dragDrop.createDropList(element);\n this._dropListRef.data = this;\n\n if (config) {\n this._assignDefaults(config);\n }\n\n this._dropListRef.enterPredicate = (drag: DragRef<CdkDrag>, drop: DropListRef<CdkDropList>) => {\n return this.enterPredicate(drag.data, drop.data);\n };\n\n this._setupInputSyncSubscription(this._dropListRef);\n this._handleEvents(this._dropListRef);\n CdkDropList._dropLists.push(this);\n\n if (_group) {\n _group._items.add(this);\n }\n }\n\n ngAfterContentInit() {\n // @breaking-change 11.0.0 Remove null check for _scrollDispatcher once it's required.\n if (this._scrollDispatcher) {\n const scrollableParents = this._scrollDispatcher\n .getAncestorScrollContainers(this.element)\n .map(scrollable => scrollable.getElementRef().nativeElement);\n this._dropListRef.withScrollableParents(scrollableParents);\n }\n }\n\n /** Registers an items with the drop list. */\n addItem(item: CdkDrag): void {\n this._unsortedItems.add(item);\n\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef();\n }\n }\n\n /** Removes an item from the drop list. */\n removeItem(item: CdkDrag): void {\n this._unsortedItems.delete(item);\n\n if (this._dropListRef.isDragging()) {\n this._syncItemsWithRef();\n }\n }\n\n /** Gets the registered items in the list, sorted by their position in the DOM. */\n getSortedItems(): CdkDrag[] {\n return Array.from(this._unsortedItems).sort((a: CdkDrag, b: CdkDrag) => {\n const documentPosition =\n a._dragRef.getVisibleElement().compareDocumentPosition(b._dragRef.getVisibleElement());\n\n // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n // tslint:disable-next-line:no-bitwise\n return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n });\n }\n\n ngOnDestroy() {\n const index = CdkDropList._dropLists.indexOf(this);\n\n if (index > -1) {\n CdkDropList._dropLists.splice(index, 1);\n }\n\n if (this._group) {\n this._group._items.delete(this);\n }\n\n this._unsortedItems.clear();\n this._dropListRef.dispose();\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /**\n * Starts dragging an item.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n start(): void {\n this._dropListRef.start();\n }\n\n /**\n * Drops an item into this container.\n * @param item Item being dropped into the container.\n * @param currentIndex Index at which the item should be inserted.\n * @param previousContainer Container from which the item got dragged in.\n * @param isPointerOverContainer Whether the user's pointer was over the\n * container when the item was dropped.\n *\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n drop(item: CdkDrag, currentIndex: number, previousContainer: CdkDropList,\n isPointerOverContainer: boolean): void {\n this._dropListRef.drop(item._dragRef, currentIndex, previousContainer._dropListRef,\n isPointerOverContainer, {x: 0, y: 0});\n }\n\n /**\n * Emits an event to indicate that the user moved an item into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n enter(item: CdkDrag, pointerX: number, pointerY: number): void {\n this._dropListRef.enter(item._dragRef, pointerX, pointerY);\n }\n\n /**\n * Removes an item from the container after it was dragged into another container by the user.\n * @param item Item that was dragged out.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n exit(item: CdkDrag): void {\n this._dropListRef.exit(item._dragRef);\n }\n\n /**\n * Figures out the index of an item in the container.\n * @param item Item whose index should be determined.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 10.0.0\n */\n getItemIndex(item: CdkDrag): number {\n return this._dropListRef.getItemIndex(item._dragRef);\n }\n\n /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */\n private _setupInputSyncSubscription(ref: DropListRef<CdkDropList>) {\n if (this._dir) {\n this._dir.change\n .pipe(startWith(this._dir.value), takeUntil(this._destroyed))\n .subscribe(value => ref.withDirection(value));\n }\n\n ref.beforeStarted.subscribe(() => {\n const siblings = coerceArray(this.connectedTo).map(drop => {\n return typeof drop === 'string' ?\n CdkDropList._dropLists.find(list => list.id === drop)! : drop;\n });\n\n if (this._group) {\n this._group._items.forEach(drop => {\n if (siblings.indexOf(drop) === -1) {\n siblings.push(drop);\n }\n });\n }\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.sortingDisabled = coerceBooleanProperty(this.sortingDisabled);\n ref.autoScrollDisabled = coerceBooleanProperty(this.autoScrollDisabled);\n ref\n .connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))\n .withOrientation(this.orientation);\n });\n }\n\n /** Handles events from the underlying DropListRef. */\n private _handleEvents(ref: DropListRef<CdkDropList>) {\n ref.beforeStarted.subscribe(() => {\n this._syncItemsWithRef();\n this._changeDetectorRef.markForCheck();\n });\n\n ref.entered.subscribe(event => {\n this.entered.emit({\n container: this,\n item: event.item.data,\n currentIndex: event.currentIndex\n });\n });\n\n ref.exited.subscribe(event => {\n this.exited.emit({\n container: this,\n item: event.item.data\n });\n this._changeDetectorRef.markForCheck();\n });\n\n ref.sorted.subscribe(event => {\n this.sorted.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n container: this,\n item: event.item.data\n });\n });\n\n ref.dropped.subscribe(event => {\n this.dropped.emit({\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n previousContainer: event.previousContainer.data,\n container: event.container.data,\n item: event.item.data,\n isPointerOverContainer: event.isPointerOverContainer,\n distance: event.distance\n });\n\n // Mark for check since all of these events run outside of change\n // detection and we're not guaranteed for something else to have triggered it.\n this._changeDetectorRef.markForCheck();\n });\n }\n\n /** Assigns the default input values based on a provided config object. */\n private _assignDefaults(config: DragDropConfig) {\n const {\n lockAxis, draggingDisabled, sortingDisabled, listAutoScrollDisabled, listOrientation\n } = config;\n\n this.disabled = draggingDisabled == null ? false : draggingDisabled;\n this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled;\n this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled;\n this.orientation = listOrientation || 'vertical';\n\n if (lockAxis) {\n this.lockAxis = lockAxis;\n }\n }\n\n /** Syncs up the registered drag items with underlying drop list ref. */\n private _syncItemsWithRef() {\n this._dropListRef.withItems(this.getSortedItems().map(item => item._dragRef));\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_sortingDisabled: BooleanInput;\n static ngAcceptInputType_autoScrollDisabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkDropList} from './directives/drop-list';\nimport {CdkDropListGroup} from './directives/drop-list-group';\nimport {CdkDrag} from './directives/drag';\nimport {CdkDragHandle} from './directives/drag-handle';\nimport {CdkDragPreview} from './directives/drag-preview';\nimport {CdkDragPlaceholder} from './directives/drag-placeholder';\nimport {DragDrop} from './drag-drop';\n\n@NgModule({\n declarations: [\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n ],\n exports: [\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n ],\n providers: [\n DragDrop,\n ]\n})\nexport class DragDropModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {CdkDropListInternal as ɵangular_material_src_cdk_drag_drop_drag_drop_a} from './directives/drop-list';\nexport {CDK_DRAG_PARENT as ɵangular_material_src_cdk_drag_drop_drag_drop_b} from './drag-parent';"],"names":["clamp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,sCAGC;;;IAFC,iDAAuB;;IACvB,gDAAsB;;;;;;;;;AAOxB,SAAgB,YAAY,CACxB,IAAoC,EACpC,MAAwC;IAC1C,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;QACtB,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAA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