blob: 1665fa15d0d5598408559787776c6e13a57fd99f [file] [log] [blame]
{"version":3,"file":"drag-drop.es5.js","sources":["../../../src/cdk/drag-drop/drag-drop-module.ts","../../../src/cdk/drag-drop/directives/drop-list.ts","../../../src/cdk/drag-drop/directives/drop-list-group.ts","../../../src/cdk/drag-drop/directives/drag.ts","../../../src/cdk/drag-drop/directives/drag-preview.ts","../../../src/cdk/drag-drop/directives/drag-placeholder.ts","../../../src/cdk/drag-drop/directives/drag-handle.ts","../../../src/cdk/drag-drop/drag-parent.ts","../../../src/cdk/drag-drop/drop-list-container.ts","../../../src/cdk/drag-drop/drag-drop.ts","../../../src/cdk/drag-drop/drag-drop-registry.ts","../../../src/cdk/drag-drop/drop-list-ref.ts","../../../src/cdk/drag-drop/drag-utils.ts","../../../src/cdk/drag-drop/drag-ref.ts","../../../src/cdk/drag-drop/transition-duration.ts","../../../src/cdk/drag-drop/drag-styling.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\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 * @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 {coerceArray, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n ContentChildren,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n OnDestroy,\n Output,\n QueryList,\n Optional,\n Directive,\n ChangeDetectorRef,\n SkipSelf,\n AfterContentInit,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {CdkDrag} from './drag';\nimport {CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragSortEvent} from '../drag-events';\nimport {CDK_DROP_LIST_CONTAINER, CdkDropListContainer} from '../drop-list-container';\nimport {CdkDropListGroup} from './drop-list-group';\nimport {DropListRef} from '../drop-list-ref';\nimport {DragRef} from '../drag-ref';\nimport {DragDrop} from '../drag-drop';\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// @breaking-change 8.0.0 `CdkDropList` implements `CdkDropListContainer` for backwards\n// compatiblity. The implements clause, as well as all the methods that it enforces can\n// be removed when `CdkDropListContainer` is deleted.\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_CONTAINER, 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 CdkDropListContainer, 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 /** Draggable items in the container. */\n @ContentChildren(forwardRef(() => CdkDrag), {\n // Explicitly set to false since some of the logic below makes assumptions about it.\n // The `.withItems` call below should be updated if we ever need to switch this to `true`.\n descendants: false\n }) _draggables: QueryList<CdkDrag>;\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: 'horizontal' | 'vertical' = 'vertical';\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: 'x' | 'y';\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 this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n /** Whether sorting within this drop list is disabled. */\n @Input('cdkDropListSortingDisabled')\n get sortingDisabled(): boolean { return this._sortingDisabled; }\n set sortingDisabled(value: boolean) {\n this._sortingDisabled = coerceBooleanProperty(value);\n }\n private _sortingDisabled = 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 @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 = false;\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 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 this._dropListRef = dragDrop.createDropList(element);\n this._dropListRef.data = this;\n this._dropListRef.enterPredicate = (drag: DragRef<CdkDrag>, drop: DropListRef<CdkDropList>) => {\n return this.enterPredicate(drag.data, drop.data);\n };\n\n this._syncInputs(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 this._draggables.changes\n .pipe(startWith(this._draggables), takeUntil(this._destroyed))\n .subscribe((items: QueryList<CdkDrag>) => {\n this._dropListRef.withItems(items.map(drag => drag._dragRef));\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._dropListRef.dispose();\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Starts dragging an item. */\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 drop(item: CdkDrag, currentIndex: number, previousContainer: Partial<CdkDropListContainer>,\n isPointerOverContainer: boolean): void {\n this._dropListRef.drop(item._dragRef, currentIndex,\n (previousContainer as CdkDropList)._dropListRef, isPointerOverContainer);\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 */\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 */\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 */\n getItemIndex(item: CdkDrag): number {\n return this._dropListRef.getItemIndex(item._dragRef);\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: CdkDrag, pointerX: number, pointerY: number,\n pointerDelta: {x: number, y: number}): void {\n return this._dropListRef._sortItem(item._dragRef, pointerX, pointerY, pointerDelta);\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: CdkDrag, x: number, y: number):\n CdkDropListContainer | null {\n const result = this._dropListRef._getSiblingContainerFromPosition(item._dragRef, x, y);\n return result ? result.data : null;\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 this._dropListRef._isOverContainer(x, y);\n }\n\n /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */\n private _syncInputs(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 = this.sortingDisabled;\n ref.autoScrollDisabled = 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._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}\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 {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","/**\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 {coerceBooleanProperty, coerceNumberProperty, coerceElement} 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_DROP_LIST} from '../drop-list-container';\nimport {CDK_DRAG_PARENT} from '../drag-parent';\nimport {DragRef, DragRefConfig, Point} from '../drag-ref';\nimport {CdkDropListInternal as CdkDropList} from './drop-list';\nimport {DragDrop} from '../drag-drop';\n\n/** Injection token that can be used to configure the behavior of `CdkDrag`. */\nexport const CDK_DRAG_CONFIG = new InjectionToken<DragRefConfig>('CDK_DRAG_CONFIG', {\n providedIn: 'root',\n factory: CDK_DRAG_CONFIG_FACTORY\n});\n\n/** @docs-private */\nexport function CDK_DRAG_CONFIG_FACTORY(): DragRefConfig {\n return {dragStartThreshold: 5, pointerDirectionChangeThreshold: 5};\n}\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, {static: false}) _previewTemplate: CdkDragPreview;\n\n /** Template for placeholder element rendered to show where a draggable would be dropped. */\n @ContentChild(CdkDragPlaceholder, {static: false}) _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: 'x' | 'y';\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 * Selector that will be used to determine the element to which the draggable's position will\n * be constrained. Matching starts from the element's parent and goes up the DOM until a matching\n * element has been found\n * @deprecated Use `boundaryElement` instead.\n * @breaking-change 9.0.0\n */\n get boundaryElementSelector(): string {\n return typeof this.boundaryElement === 'string' ? this.boundaryElement : undefined!;\n }\n set boundaryElementSelector(selector: string) {\n this.boundaryElement = selector;\n }\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: number = 0;\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 = false;\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 /** 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, @Inject(CDK_DRAG_CONFIG) config: DragRefConfig,\n @Optional() private _dir: Directionality, dragDrop: DragDrop,\n private _changeDetectorRef: ChangeDetectorRef) {\n this._dragRef = dragDrop.createDrag(element, config);\n this._dragRef.data = this;\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 => item._stateChanges));\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 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 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 viewContainer: this._viewContainerRef\n } : null;\n\n ref.disabled = this.disabled;\n ref.lockAxis = this.lockAxis;\n ref.dragStartDelay = coerceNumberProperty(this.dragStartDelay);\n ref.constrainPosition = this.constrainPosition;\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\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, TemplateRef, Input} from '@angular/core';\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 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';\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, ElementRef, Inject, Optional, Input, OnDestroy} from '@angular/core';\nimport {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","/**\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 {InjectionToken, QueryList, ElementRef} from '@angular/core';\nimport {CdkDrag} from './directives/drag';\n\n\n/**\n * @deprecated To be removed. No longer being used. Previously the interface was used to avoid\n * circular imports between `CdkDrag` and `CdkDropList`, however now we're using the\n * `CdkDropListInternal` interface to achieve the same result, without having to maintain\n * this large of an interface.\n * @breaking-change 8.0.0\n */\nexport interface CdkDropListContainer<T = any> {\n /** DOM node that corresponds to the drop container. */\n element: ElementRef<HTMLElement>;\n\n /** Arbitrary data to attach to all events emitted by this container. */\n data: T;\n\n /** Unique ID for the drop zone. */\n id: string;\n\n /** Direction in which the list is oriented. */\n orientation: 'horizontal' | 'vertical';\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n lockAxis: 'x' | 'y';\n\n /** Whether starting a dragging sequence from this container is disabled. */\n disabled: boolean;\n\n /** Starts dragging an item. */\n start(): void;\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 drop(item: CdkDrag, currentIndex: number, previousContainer: Partial<CdkDropListContainer>,\n isPointerOverContainer: boolean): void;\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 */\n enter(item: CdkDrag, pointerX: number, pointerY: number): void;\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: CdkDrag): void;\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: CdkDrag): number;\n _sortItem(item: CdkDrag, pointerX: number, pointerY: number, delta: {x: number, y: number}): void;\n _draggables: QueryList<CdkDrag>;\n _getSiblingContainerFromPosition(item: CdkDrag, x: number, y: number):\n CdkDropListContainer | null;\n _isOverContainer(x: number, y: number): boolean;\n}\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<CdkDropListContainer>('CDK_DROP_LIST');\n\n/**\n * Injection token that is used to provide a CdkDropList instance to CdkDrag.\n * Used for avoiding circular imports.\n * @deprecated Use `CDK_DROP_LIST` instead.\n * @breaking-change 8.0.0\n */\nexport const CDK_DROP_LIST_CONTAINER = CDK_DROP_LIST;\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 {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 extends {id: string}> 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 if (this.getDropContainer(drop.id)) {\n throw Error(`Drop instance with id \"${drop.id}\" has already been registered.`);\n }\n\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 })\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 /**\n * Gets a drop container by its id.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 8.0.0\n */\n getDropContainer(id: string): C | undefined {\n return Array.from(this._dropInstances).find(instance => instance.id === id);\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 {ElementRef, NgZone} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\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/** Counter used to generate unique ids for drop refs. */\nlet _uniqueIdCounter = 0;\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 * @docs-private\n */\nexport class DropListRef<T = any> {\n private _document: Document;\n\n /** Element that the drop list is attached to. */\n element: HTMLElement | ElementRef<HTMLElement>;\n\n /**\n * Unique ID for the drop list.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 8.0.0\n */\n id = `cdk-drop-list-ref-${_uniqueIdCounter++}`;\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 = true;\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 /** Keeps track of the container's scroll position. */\n private _scrollPosition: ScrollPosition = {top: 0, left: 0};\n\n /** Keeps track of the scroll position of the viewport. */\n private _viewportScrollPosition: ScrollPosition = {top: 0, left: 0};\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 constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>,\n _document: any,\n /**\n * @deprecated _ngZone and _viewportRuler parameters to be made required.\n * @breaking-change 9.0.0\n */\n private _ngZone?: NgZone,\n private _viewportRuler?: ViewportRuler) {\n _dragDropRegistry.registerDropContainer(this);\n this._document = _document;\n this.element = element instanceof ElementRef ? element.nativeElement : element;\n }\n\n /** Removes the drop list functionality from the DOM element. */\n dispose() {\n this._stopScrolling();\n this._stopScrollTimers.complete();\n this._removeListeners();\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._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 element = coerceElement(this.element);\n this.beforeStarted.next();\n this._isDragging = true;\n this._cacheItems();\n this._siblings.forEach(sibling => sibling._startReceiving(this));\n this._removeListeners();\n\n // @breaking-change 9.0.0 Remove check for _ngZone once it's marked as a required param.\n if (this._ngZone) {\n this._ngZone.runOutsideAngular(() => element.addEventListener('scroll', this._handleScroll));\n } else {\n element.addEventListener('scroll', this._handleScroll);\n }\n\n // @breaking-change 9.0.0 Remove check for _viewportRuler once it's marked as a required param.\n if (this._viewportRuler) {\n this._viewportScrollPosition = this._viewportRuler.getViewportScrollPosition();\n this._viewportScrollSubscription = this._dragDropRegistry.scroll.subscribe(() => {\n if (this.isDragging()) {\n const newPosition = this._viewportRuler!.getViewportScrollPosition();\n this._updateAfterScroll(this._viewportScrollPosition, newPosition.top, newPosition.left,\n this._clientRect);\n }\n });\n }\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 */\n enter(item: DragRef, pointerX: number, pointerY: 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 = 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\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 * @breaking-change 9.0.0 `distance` parameter to become required.\n */\n drop(item: DragRef, currentIndex: number, previousContainer: DropListRef,\n isPointerOverContainer: boolean, distance: Point = {x: 0, y: 0}): void {\n this._reset();\n this.dropped.next({\n item,\n currentIndex,\n previousIndex: previousContainer.getItemIndex(item),\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 * 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 || !this._isPointerNearDropContainer(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 // @breaking-change 9.0.0 Remove null check for _viewportRuler once it's a required parameter.\n // Check whether we're in range to scroll the viewport.\n if (this._viewportRuler) {\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 we couldn't find a scroll direction based on the\n // window, try with the container, if the pointer is close by.\n if (!verticalScrollDirection && !horizontalScrollDirection &&\n this._isPointerNearDropContainer(pointerX, pointerY)) {\n verticalScrollDirection = getVerticalScrollDirection(this._clientRect, pointerY);\n horizontalScrollDirection = getHorizontalScrollDirection(this._clientRect, pointerX);\n scrollNode = coerceElement(this.element);\n }\n\n // TODO(crisbeto): we also need to account for whether the view or element are scrollable in\n // the first place. With the current approach we'll still try to scroll them, but it just\n // won't do anything. The only case where this is relevant is that if we have a scrollable\n // list close to the viewport edge where the viewport isn't scrollable. In this case the\n // we'll be trying to scroll the viewport rather than the list.\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 // @breaking-change 9.0.0 Remove null check for `_ngZone` once it is made required.\n if (this._ngZone) {\n this._ngZone.runOutsideAngular(this._startScrollInterval);\n } else {\n this._startScrollInterval();\n }\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 position of the drop list. */\n private _cacheOwnPosition() {\n const element = coerceElement(this.element);\n this._clientRect = getMutableClientRect(element);\n this._scrollPosition = {top: element.scrollTop, left: element.scrollLeft};\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 = this._dragDropRegistry.isDragging(drag) ?\n // If the element is being dragged, we have to measure the\n // placeholder, because the element is hidden.\n drag.getPlaceholderElement() :\n drag.getRootElement();\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 // 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._removeListeners();\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 * Checks whether the pointer coordinates are close to the drop container.\n * @param pointerX Coordinates along the X axis.\n * @param pointerY Coordinates along the Y axis.\n */\n private _isPointerNearDropContainer(pointerX: number, pointerY: number): boolean {\n const {top, right, bottom, left, width, height} = this._clientRect;\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 * 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._cacheOwnPosition();\n }\n\n /**\n * Updates the internal state of the container after a scroll event has happened.\n * @param scrollPosition Object that is keeping track of the scroll position.\n * @param newTop New top scroll position.\n * @param newLeft New left scroll position.\n * @param extraClientRect Extra `ClientRect` object that should be updated, in addition to the\n * ones of the drag items. Useful when the viewport has been scrolled and we also need to update\n * the `ClientRect` of the list.\n */\n private _updateAfterScroll(scrollPosition: ScrollPosition, newTop: number, newLeft: number,\n extraClientRect?: ClientRect) {\n const topDifference = scrollPosition.top - newTop;\n const leftDifference = scrollPosition.left - newLeft;\n\n if (extraClientRect) {\n adjustClientRect(extraClientRect, topDifference, leftDifference);\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 /** Handles the container being scrolled. Has to be an arrow function to preserve the context. */\n private _handleScroll = () => {\n if (!this.isDragging()) {\n return;\n }\n\n const element = coerceElement(this.element);\n this._updateAfterScroll(this._scrollPosition, element.scrollTop, element.scrollLeft);\n }\n\n /** Removes the event listeners associated with this drop list. */\n private _removeListeners() {\n coerceElement(this.element).removeEventListener('scroll', this._handleScroll);\n this._viewportScrollSubscription.unsubscribe();\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 (!this.enterPredicate(item, this) || !isInsideClientRect(this._clientRect, x, y)) {\n return false;\n }\n\n const elementFromPoint = this._document.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._cacheOwnPosition();\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 }\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/**\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 * @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 {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/**\n * Reference to a draggable item. Used to manipulate or dispose of the item.\n * @docs-private\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 * Reference to the element that comes after the draggable in the DOM, at the time\n * it was picked up. Used for restoring its initial position when it's dropped.\n */\n private _nextSibling: Node | null;\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 /** 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 /**\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?: DragHelperTemplate | 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 = 0;\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 /** 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: DragHelperTemplate | 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 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 removeElement(this._rootElement);\n }\n\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._boundaryElement = this._rootElement = this._placeholderTemplate =\n this._previewTemplate = this._nextSibling = 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 removeElement(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 removeElement(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 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.dragStartDelay || 0);\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 event.preventDefault();\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\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._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._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\n // Grab the `nextSibling` before the preview and placeholder\n // have been created so we don't get the preview by accident.\n this._nextSibling = element.nextSibling;\n\n const preview = this._preview = this._createPreviewElement();\n const placeholder = this._placeholder = this._createPlaceholderElement();\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(element.parentNode!.replaceChild(placeholder, element));\n getPreviewInsertionPoint(this._document).appendChild(preview);\n this._dropContainer.start();\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 this._initialContainer = this._dropContainer!;\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 template, the element won't be visible anyway so we avoid the\n // extra `getBoundingClientRect` calls and just move the preview next to the cursor.\n this._pickupPositionInElement = this._previewTemplate && this._previewTemplate.template ?\n {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\n if (this._nextSibling) {\n this._nextSibling.parentNode!.insertBefore(this._rootElement, this._nextSibling);\n } else {\n coerceElement(this._initialContainer.element).appendChild(this._rootElement);\n }\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._initialContainer.getItemIndex(this),\n container: container,\n previousContainer: this._initialContainer,\n isPointerOverContainer,\n distance\n });\n container.drop(this, currentIndex, this._initialContainer, isPointerOverContainer, distance);\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 it's\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 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 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 = viewRef.rootNodes[0];\n this._previewRef = viewRef;\n preview.style.transform =\n getTransform(this._pickupPositionOnPage.x, this._pickupPositionOnPage.y);\n } else {\n const element = this._rootElement;\n const elementRect = element.getBoundingClientRect();\n\n preview = deepCloneNode(element);\n preview.style.width = `${elementRect.width}px`;\n preview.style.height = `${elementRect.height}px`;\n preview.style.transform = getTransform(elementRect.left, elementRect.top);\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 position: 'fixed',\n top: '0',\n left: '0',\n zIndex: '1000'\n });\n\n toggleNativeDragInteractions(preview, false);\n\n preview.classList.add('cdk-drag-preview');\n preview.setAttribute('dir', this._direction);\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 = this._placeholderRef.rootNodes[0];\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\n/** Point on the page or within an element. */\nexport interface Point {\n x: number;\n y: number;\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 an element from the DOM and to do all the necessary null checks.\n * @param element Element to be removed.\n */\nfunction removeElement(element: HTMLElement | null) {\n if (element && element.parentNode) {\n element.parentNode.removeChild(element);\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 * @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\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 as keyof CSSStyleDeclaration] = source[key as keyof CSSStyleDeclaration];\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"],"names":["_uniqueIdCounter","clamp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;Ae2BA,AAAA,SAAgB,YAAY,CACxB,IAAoC,EACpC,MAAwC,EAF5C;IAGE,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;QACtB,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC9B,IAAI,oBAAC,GAAG,GAA8B,GAAG,MAAM,oBAAC,GAAG,GAA8B,CAAC;SACnF;KACF;IAED,OAAO,IAAI,CAAC;CACb;;;;;;;;AASD,AAAA,SAAgB,4BAA4B,CAAC,OAAoB,EAAE,MAAe,EAAlF;;IACA,IAAQ,UAAU,GAAG,MAAM,GAAG,EAAE,GAAG,MAAM,CAAzC;IAEE,YAAY,CAAC,OAAO,CAAC,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