blob: 39530831752470e794fccd664ae2418f094f0d73 [file] [log] [blame]
{"version":3,"file":"cdk-drag-drop.umd.min.js","sources":["../../src/cdk/drag-drop/directives/drag.ts","../../src/cdk/drag-drop/directives/drop-list-group.ts","../../src/cdk/drag-drop/directives/drop-list.ts","../../src/cdk/drag-drop/drag-drop-module.ts","../../src/cdk/drag-drop/drag-styling.ts","../../src/cdk/drag-drop/transition-duration.ts","../../src/cdk/drag-drop/drag-ref.ts","../../src/cdk/drag-drop/drag-utils.ts","../../src/cdk/drag-drop/drop-list-ref.ts","../../src/cdk/drag-drop/drag-drop-registry.ts","../../src/cdk/drag-drop/drag-drop.ts","../../src/cdk/drag-drop/drop-list-container.ts","../../src/cdk/drag-drop/drag-parent.ts","../../src/cdk/drag-drop/directives/drag-handle.ts","../../src/cdk/drag-drop/directives/drag-placeholder.ts","../../src/cdk/drag-drop/directives/drag-preview.ts"],"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 {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, 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 {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 {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\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","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Parses a CSS time value to milliseconds. */\nfunction parseCssTimeUnitsToMs(value: string): number {\n // Some browsers will return it in seconds, whereas others will return milliseconds.\n const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\n return parseFloat(value) * multiplier;\n}\n\n/** Gets the transform transition duration, including the delay, of an element in milliseconds. */\nexport function getTransformTransitionDurationInMs(element: HTMLElement): number {\n const computedStyle = getComputedStyle(element);\n const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all');\n\n // If there's no transition for `all` or `transform`, we shouldn't do anything.\n if (!property) {\n return 0;\n }\n\n // Get the index of the property that we're interested in and match\n // it up to the same index in `transition-delay` and `transition-duration`.\n const propertyIndex = transitionedProperties.indexOf(property);\n const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n\n return parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\n parseCssTimeUnitsToMs(rawDelays[propertyIndex]);\n}\n\n/** Parses out multiple values from a computed style into an array. */\nfunction parseCssPropertyValue(computedStyle: CSSStyleDeclaration, name: string): string[] {\n const value = computedStyle.getPropertyValue(name);\n return value.split(',').map(part => part.trim());\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EmbeddedViewRef, ElementRef, NgZone, ViewContainerRef, TemplateRef} from '@angular/core';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {Direction} from '@angular/cdk/bidi';\nimport {normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {coerceBooleanProperty, coerceElement} from '@angular/cdk/coercion';\nimport {Subscription, Subject, Observable} from 'rxjs';\nimport {startWith} from 'rxjs/operators';\nimport {DropListRefInternal as DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport {extendStyles, toggleNativeDragInteractions} from './drag-styling';\nimport {getTransformTransitionDurationInMs} from './transition-duration';\n\n/** Object that can be used to configure the behavior of DragRef. */\nexport interface DragRefConfig {\n /**\n * Minimum amount of pixels that the user should\n * drag, before the CDK initiates a drag sequence.\n */\n dragStartThreshold: number;\n\n /**\n * Amount the pixels the user should drag before the CDK\n * considers them to have changed the drag direction.\n */\n pointerDirectionChangeThreshold: number;\n}\n\n/** Options that can be used to bind a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true});\n\n/** Options that can be used to bind an active event listener. */\nconst activeEventListenerOptions = normalizePassiveListenerOptions({passive: false});\n\n/**\n * Time in milliseconds for which to ignore mouse events, after\n * receiving a touch event. Used to avoid doing double work for\n * touch devices where the browser fires fake mouse events, in\n * addition to touch events.\n */\nconst MOUSE_EVENT_IGNORE_TIME = 800;\n\n// TODO(crisbeto): add an API for moving a draggable up/down the\n// list programmatically. Useful for keyboard controls.\n\n/**\n * Internal compile-time-only representation of a `DragRef`.\n * Used to avoid circular import issues between the `DragRef` and the `DropListRef`.\n * @docs-private\n */\nexport interface DragRefInternal extends DragRef {}\n\n/** Template that can be used to create a drag helper element (e.g. a preview or a placeholder). */\ninterface DragHelperTemplate<T = any> {\n template: TemplateRef<T> | null;\n viewContainer: ViewContainerRef;\n context: T;\n}\n\n/**\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/**\n * Moves an item one index in an array to another.\n * @param array Array in which to move the item.\n * @param fromIndex Starting index of the item.\n * @param toIndex Index to which the item should be moved.\n */\nexport function moveItemInArray<T = any>(array: T[], fromIndex: number, toIndex: number): void {\n const from = clamp(fromIndex, array.length - 1);\n const to = clamp(toIndex, array.length - 1);\n\n if (from === to) {\n return;\n }\n\n const target = array[from];\n const delta = to < from ? -1 : 1;\n\n for (let i = from; i !== to; i += delta) {\n array[i] = array[i + delta];\n }\n\n array[to] = target;\n}\n\n\n/**\n * Moves an item from one array to another.\n * @param currentArray Array from which to transfer the item.\n * @param targetArray Array into which to put the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n */\nexport function transferArrayItem<T = any>(currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number): void {\n const from = clamp(currentIndex, currentArray.length - 1);\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n}\n\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @param currentArray Array from which to copy the item.\n * @param targetArray Array into which is copy the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n *\n */\nexport function copyArrayItem<T = any>(currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number): void {\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n}\n\n/** Clamps a number between zero and a maximum. */\nfunction clamp(value: number, max: number): number {\n return Math.max(0, Math.min(max, value));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef, NgZone} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {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\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 {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 {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 {InjectionToken} from '@angular/core';\n\n/**\n * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the\n * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily\n * to avoid circular imports.\n * @docs-private\n */\nexport const CDK_DRAG_PARENT = new InjectionToken<{}>('CDK_DRAG_PARENT');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef, Inject, Optional, Input, OnDestroy} from '@angular/core';\nimport {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 {Directive, TemplateRef, Input} from '@angular/core';\n\n/**\n * Element that will be used as a template for the placeholder of a CdkDrag when\n * it is being dragged. The placeholder is displayed in place of the element being dragged.\n */\n@Directive({\n selector: 'ng-template[cdkDragPlaceholder]'\n})\nexport class CdkDragPlaceholder<T = any> {\n /** Context data to be added to the placeholder template instance. */\n @Input() data: T;\n constructor(public templateRef: TemplateRef<T>) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef, Input} from '@angular/core';\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"],"names":["this","_syncInputs","_dragRef","_handleEvents","Object","defineProperty","CdkDrag","prototype","boundaryElement","selector","_disabled","dropContainer","disabled","value","coerceBooleanProperty","getPlaceholderElement","getRootElement","reset","getFreeDragPosition","ngAfterViewInit","_this","_ngZone","onStable","asObservable","pipe","take","takeUntil","_destroyed","subscribe","_updateRootElement","_handles","changes","startWith","tap","handles","childHandleElements","filter","handle","_parentDrag","map","element","withHandles","switchMap","merge","apply","item","_stateChanges","handleInstance","dragRef","nativeElement","disableHandle","enableHandle","freeDragPosition","setFreeDragPosition","ngOnChanges","rootSelectorChange","positionChange","firstChange","ngOnDestroy","next","complete","dispose","rootElement","rootElementSelector","getClosestMatchingAncestor","nodeType","_document","ELEMENT_NODE","Error","nodeName","withRootElement","_getBoundaryElement","boundary","coerceElement","isDevMode","contains","ref","beforeStarted","isDragging","dir","_dir","placeholder","_placeholderTemplate","template","templateRef","context","data","viewContainer","_viewContainerRef","preview","_previewTemplate","lockAxis","dragStartDelay","coerceNumberProperty","constrainPosition","withBoundaryElement","withPlaceholderTemplate","withPreviewTemplate","withDirection","started","emit","source","_changeDetectorRef","markForCheck","released","ended","event","distance","entered","container","currentIndex","exited","dropped","previousIndex","previousContainer","isPointerOverContainer","type","Directive","args","exportAs","host","class","[class.cdk-drag-disabled]","[class.cdk-drag-dragging]","providers","provide","CDK_DRAG_PARENT","useExisting","ElementRef","undefined","decorators","Inject","CDK_DROP_LIST","Optional","SkipSelf","DOCUMENT","NgZone","ViewContainerRef","CDK_DRAG_CONFIG","Directionality","DragDrop","ChangeDetectorRef","ContentChildren","CdkDragHandle","descendants","ContentChild","CdkDragPreview","static","CdkDragPlaceholder","Input","Output","moved","CdkDropListGroup","_items","Set","clear","_uniqueIdCounter","CdkDropList","dragDrop","_group","Subject","connectedTo","orientation","id","_sortingDisabled","enterPredicate","autoScrollDisabled","EventEmitter","sorted","_dropListRef","createDropList","drag","drop","_dropLists","push","add","ngAfterContentInit","_draggables","items","withItems","index","indexOf","splice","delete","start","enter","pointerX","pointerY","exit","getItemIndex","_sortItem","pointerDelta","_getSiblingContainerFromPosition","x","y","result","_isOverContainer","change","siblings","coerceArray","find","list","forEach","sortingDisabled","withOrientation","useValue","CDK_DROP_LIST_CONTAINER","[id]","[class.cdk-drop-list-disabled]","[class.cdk-drop-list-dragging]","[class.cdk-drop-list-receiving]","forwardRef","DragDropModule","NgModule","declarations","exports","extendStyles","dest","key","hasOwnProperty","toggleNativeDragInteractions","enable","userSelect","style","touchAction","webkitUserDrag","webkitTapHighlightColor","msUserSelect","webkitUserSelect","MozUserSelect","parseCssTimeUnitsToMs","multiplier","toLowerCase","parseFloat","getTransformTransitionDurationInMs","computedStyle","getComputedStyle","transitionedProperties","parseCssPropertyValue","property","prop","propertyIndex","rawDurations","rawDelays","name","getPropertyValue","split","part","trim","getTransform","Math","round","deepCloneNode","node","clone","cloneNode","descendantsWithId","querySelectorAll","descendantCanvases","removeAttribute","i","length","cloneCanvases","correspondingCloneContext","getContext","drawImage","clamp","min","max","removeElement","parentNode","removeChild","isTouchEvent","getPreviewInsertionPoint","documentRef","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","body","moveItemInArray","array","fromIndex","toIndex","from","to","target","delta","transferArrayItem","currentArray","targetArray","targetIndex","copyArrayItem","adjustClientRect","clientRect","top","left","bottom","height","right","width","findIndex","predicate","isInsideClientRect","getMutableClientRect","getBoundingClientRect","incrementVerticalScroll","amount","window","scrollBy","scrollTop","incrementHorizontalScroll","scrollLeft","getVerticalScrollDirection","yThreshold","SCROLL_PROXIMITY_THRESHOLD","getHorizontalScrollDirection","xThreshold","CDK_DRAG_CONFIG_FACTORY","dragStartThreshold","pointerDirectionChangeThreshold","currentElement","matches","msMatchesSelector","parentElement","passiveEventListenerOptions","normalizePassiveListenerOptions","passive","activeEventListenerOptions","DragRef","_config","_viewportRuler","_dragDropRegistry","_passiveTransform","_activeTransform","_moveEvents","_pointerMoveSubscription","Subscription","EMPTY","_pointerUpSubscription","_scrollSubscription","_boundaryElement","_nativeInteractionsEnabled","_disabledHandles","_direction","_pointerDown","targetHandle","has","_initializeDragSequence","_rootElement","_pointerMove","_hasStartedDragging","_previewRect","_preview","constrainedPointerPosition","_getConstrainedPointerPosition","_hasMoved","preventDefault","_updatePointerDirectionDelta","_dropContainer","_updateActiveDropContainer","activeTransform","_pickupPositionOnPage","_applyRootElementTransform","SVGElement","appliedTransform","setAttribute","observers","run","pointerPosition","_getDragDistance","_pointerDirectionDelta","_getPointerPositionOnPage","abs","Date","now","_dragStartTime","_endDragSequence","_startDragSequence","_pointerUp","registerDragItem","newValue","_toggleNativeDragInteractions","_placeholder","_removeRootElementListeners","addEventListener","_initialTransform","_destroyPreview","_destroyPlaceholder","removeDragItem","_removeSubscriptions","_nextSibling","transform","direction","_withDropContainer","position","_sortFromLastPointerPosition","_pointerPositionAtLastDirectionChange","unsubscribe","_previewRef","destroy","_placeholderRef","stopDragging","_rootElementTapHighlight","_stopScrolling","_animatePreviewToPlaceholder","then","_cleanupDragArtifacts","_lastTouchEventTime","nextSibling","_createPreviewElement","_createPlaceholderElement","display","appendChild","replaceChild","referenceElement","stopPropagation","isTouchSequence","isAuxiliaryMouseButton","button","isSyntheticEvent","draggable","_initialContainer","pointerMove","pointerUp","scroll","_scrollPosition","getViewportScrollPosition","_boundaryRect","_pickupPositionInElement","_getPointerPositionInElement","startDragging","insertBefore","_a","newContainer","_startScrollingIfNecessary","previewConfig","previewTemplate","viewRef","createEmbeddedView","rootNodes","elementRect","pointerEvents","zIndex","classList","Promise","resolve","placeholderRect","duration","runOutsideAngular","handler","propertyName","removeEventListener","clearTimeout","timeout","setTimeout","placeholderConfig","placeholderTemplate","handleElement","referenceRect","point","targetTouches","pageX","pageY","touches","changedTouches","constrainedPoint","dropContainerLock","pickupX","pickupY","boundaryRect","previewRect","minY","maxY","minX","maxX","pointerPositionOnPage","positionSinceLastChange","changeX","changeY","shouldEnable","currentPosition","pickupPosition","AUTO_SCROLL_STEP","DropListRef","_isDragging","_itemPositions","_viewportScrollPosition","_previousSwap","_siblings","_orientation","_activeSiblings","_viewportScrollSubscription","_verticalScrollDirection","_horizontalScrollDirection","_stopScrollTimers","_handleScroll","_updateAfterScroll","_startScrollInterval","interval","animationFrameScheduler","_scrollNode","registerDropContainer","_removeListeners","removeDropContainer","_cacheItems","sibling","_startReceiving","newPosition","_clientRect","newIndex","_getItemIndexFromPointerPosition","activeDraggables","_activeDraggables","newPositionReference","_cacheItemPositions","_reset","slice","reverse","currentItem","isReceiving","size","_isPointerNearDropContainer","isHorizontal","siblingAtNewPosition","itemOffset","_getItemOffsetPx","siblingOffset","_getSiblingOffsetPx","oldOrder","isDraggedItem","offset","elementToOffset","scrollNode","verticalScrollDirection","horizontalScrollDirection","getViewportSize","_cacheOwnPosition","sort","a","b","_stopReceiving","immediateSibling","end","_","floor","scrollPosition","newTop","newLeft","extraClientRect","topDifference","leftDifference","_canReceive","elementFromPoint","activeSiblings","activeCapturingEventOptions","capture","DragDropRegistry","_dropInstances","_dragInstances","_activeDragInstances","_globalListeners","Map","_preventDefaultWhileDragging","getDropContainer","startsWith","moveEvent","upEvent","set","e","options","config","_clearGlobalListeners","Array","instance","Injectable","providedIn","DEFAULT_CONFIG","createDrag","ViewportRuler","InjectionToken","parentDrag","TemplateRef","factory","Observable","observer","subscription","movedEvent"],"mappings":";;;;;;;yvBI2BA,SAAgBwN,GACZC,EACApH,GACF,IAAK,GAAIqH,KAAOrH,GACVA,EAAOsH,eAAeD,KACxBD,EAAI,GAAqCpH,EAAM,GAInD,OAAOoH,GAUT,QAAgBG,GAA6BpL,EAAsBqL,GACnE,GAAQC,GAAaD,EAAS,GAAK,MAEjCL,GAAahL,EAAQuL,OACnBC,YAAaH,EAAS,GAAK,OAC3BI,eAAgBJ,EAAS,GAAK,OAC9BK,wBAAyBL,EAAS,GAAK,cACvCC,WAAYA,EACZK,aAAcL,EACdM,iBAAkBN,EAClBO,cAAeP,IC/CnB,QAASQ,GAAsBzN,GAE/B,GAAQ0N,GAAa1N,EAAM2N,cAAcnD,QAAQ,OAAS,EAAI,EAAI,GAChE,OAAOoD,YAAW5N,GAAS0N,EAI7B,QAAgBG,GAAmClM,GACnD,GAAQmM,GAAgBC,iBAAiBpM,GACjCqM,EAAyBC,EAAsBH,EAAe,uBAC9DI,EAAWF,EAAuBrC,KAAI,SAACwC,GAAQ,MAAS,cAATA,GAAiC,QAATA,GAG7E,KAAKD,EACH,MAAO,EAKX,IAAQE,GAAgBJ,EAAuBxD,QAAQ0D,GAC/CG,EAAeJ,EAAsBH,EAAe,uBACpDQ,EAAYL,EAAsBH,EAAe,mBAEvD,OAAOL,GAAsBY,EAAaD,IACnCX,EAAsBa,EAAUF,IAIzC,QAASH,GAAsBH,EAAoCS,GAEjE,MADcT,GAAcU,iBAAiBD,GAChCE,MAAM,KA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