/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Directionality } from '@angular/cdk/bidi'; import { DOCUMENT } from '@angular/common'; import { ContentChild, ContentChildren, Directive, ElementRef, EventEmitter, Inject, Input, NgZone, Optional, Output, QueryList, SkipSelf, ViewContainerRef, ChangeDetectorRef, Self, InjectionToken, } from '@angular/core'; import { coerceBooleanProperty, coerceNumberProperty, coerceElement, } from '@angular/cdk/coercion'; import { Observable, Subject, merge } from 'rxjs'; import { startWith, take, map, takeUntil, switchMap, tap } from 'rxjs/operators'; import { CDK_DRAG_HANDLE, CdkDragHandle } from './drag-handle'; import { CDK_DRAG_PLACEHOLDER, CdkDragPlaceholder } from './drag-placeholder'; import { CDK_DRAG_PREVIEW, CdkDragPreview } from './drag-preview'; import { CDK_DRAG_PARENT } from '../drag-parent'; import { DragDrop } from '../drag-drop'; import { CDK_DRAG_CONFIG } from './config'; import { assertElementNode } from './assertions'; import * as i0 from "@angular/core"; import * as i1 from "@angular/cdk/bidi"; import * as i2 from "../drag-drop"; import * as i3 from "./drag-handle"; const DRAG_HOST_CLASS = 'cdk-drag'; /** * Injection token that can be used to reference instances of `CdkDropList`. It serves as * alternative token to the actual `CdkDropList` class which could cause unnecessary * retention of the class and its directive metadata. */ export const CDK_DROP_LIST = new InjectionToken('CdkDropList'); /** Element that can be moved inside a CdkDropList container. */ export class CdkDrag { static { this._dragInstances = []; } /** Whether starting to drag this element is disabled. */ get disabled() { return this._disabled || (this.dropContainer && this.dropContainer.disabled); } set disabled(value) { this._disabled = coerceBooleanProperty(value); this._dragRef.disabled = this._disabled; } constructor( /** Element that the draggable is attached to. */ element, /** Droppable container that the draggable is a part of. */ dropContainer, /** * @deprecated `_document` parameter no longer being used and will be removed. * @breaking-change 12.0.0 */ _document, _ngZone, _viewContainerRef, config, _dir, dragDrop, _changeDetectorRef, _selfHandle, _parentDrag) { this.element = element; this.dropContainer = dropContainer; this._ngZone = _ngZone; this._viewContainerRef = _viewContainerRef; this._dir = _dir; this._changeDetectorRef = _changeDetectorRef; this._selfHandle = _selfHandle; this._parentDrag = _parentDrag; this._destroyed = new Subject(); /** Emits when the user starts dragging the item. */ this.started = new EventEmitter(); /** Emits when the user has released a drag item, before any animations have started. */ this.released = new EventEmitter(); /** Emits when the user stops dragging an item in the container. */ this.ended = new EventEmitter(); /** Emits when the user has moved the item into a new container. */ this.entered = new EventEmitter(); /** Emits when the user removes the item its container by dragging it into another container. */ this.exited = new EventEmitter(); /** Emits when the user drops the item inside a container. */ this.dropped = new EventEmitter(); /** * Emits as the user is dragging the item. Use with caution, * because this event will fire for every pixel that the user has dragged. */ this.moved = new Observable((observer) => { const subscription = this._dragRef.moved .pipe(map(movedEvent => ({ source: this, pointerPosition: movedEvent.pointerPosition, event: movedEvent.event, delta: movedEvent.delta, distance: movedEvent.distance, }))) .subscribe(observer); return () => { subscription.unsubscribe(); }; }); this._dragRef = dragDrop.createDrag(element, { dragStartThreshold: config && config.dragStartThreshold != null ? config.dragStartThreshold : 5, pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null ? config.pointerDirectionChangeThreshold : 5, zIndex: config?.zIndex, }); this._dragRef.data = this; // We have to keep track of the drag instances in order to be able to match an element to // a drag instance. We can't go through the global registry of `DragRef`, because the root // element could be different. CdkDrag._dragInstances.push(this); if (config) { this._assignDefaults(config); } // Note that usually the container is assigned when the drop list is picks up the item, but in // some cases (mainly transplanted views with OnPush, see #18341) we may end up in a situation // where there are no items on the first change detection pass, but the items get picked up as // soon as the user triggers another pass by dragging. This is a problem, because the item would // have to switch from standalone mode to drag mode in the middle of the dragging sequence which // is too late since the two modes save different kinds of information. We work around it by // assigning the drop container both from here and the list. if (dropContainer) { this._dragRef._withDropContainer(dropContainer._dropListRef); dropContainer.addItem(this); } this._syncInputs(this._dragRef); this._handleEvents(this._dragRef); } /** * Returns the element that is being used as a placeholder * while the current element is being dragged. */ getPlaceholderElement() { return this._dragRef.getPlaceholderElement(); } /** Returns the root draggable element. */ getRootElement() { return this._dragRef.getRootElement(); } /** Resets a standalone drag item to its initial position. */ reset() { this._dragRef.reset(); } /** * Gets the pixel coordinates of the draggable outside of a drop container. */ getFreeDragPosition() { return this._dragRef.getFreeDragPosition(); } /** * Sets the current position in pixels the draggable outside of a drop container. * @param value New position to be set. */ setFreeDragPosition(value) { this._dragRef.setFreeDragPosition(value); } ngAfterViewInit() { // Normally this isn't in the zone, but it can cause major performance regressions for apps // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes. this._ngZone.runOutsideAngular(() => { // We need to wait for the zone to stabilize, in order for the reference // element to be in the proper place in the DOM. This is mostly relevant // for draggable elements inside portals since they get stamped out in // their original DOM position and then they get transferred to the portal. this._ngZone.onStable.pipe(take(1), takeUntil(this._destroyed)).subscribe(() => { this._updateRootElement(); this._setupHandlesListener(); if (this.freeDragPosition) { this._dragRef.setFreeDragPosition(this.freeDragPosition); } }); }); } ngOnChanges(changes) { const rootSelectorChange = changes['rootElementSelector']; const positionChange = changes['freeDragPosition']; // We don't have to react to the first change since it's being // handled in `ngAfterViewInit` where it needs to be deferred. if (rootSelectorChange && !rootSelectorChange.firstChange) { this._updateRootElement(); } // Skip the first change since it's being handled in `ngAfterViewInit`. if (positionChange && !positionChange.firstChange && this.freeDragPosition) { this._dragRef.setFreeDragPosition(this.freeDragPosition); } } ngOnDestroy() { if (this.dropContainer) { this.dropContainer.removeItem(this); } const index = CdkDrag._dragInstances.indexOf(this); if (index > -1) { CdkDrag._dragInstances.splice(index, 1); } // Unnecessary in most cases, but used to avoid extra change detections with `zone-paths-rxjs`. this._ngZone.runOutsideAngular(() => { this._destroyed.next(); this._destroyed.complete(); this._dragRef.dispose(); }); } /** Syncs the root element with the `DragRef`. */ _updateRootElement() { const element = this.element.nativeElement; let rootElement = element; if (this.rootElementSelector) { rootElement = element.closest !== undefined ? element.closest(this.rootElementSelector) : // Comment tag doesn't have closest method, so use parent's one. element.parentElement?.closest(this.rootElementSelector); } if (rootElement && (typeof ngDevMode === 'undefined' || ngDevMode)) { assertElementNode(rootElement, 'cdkDrag'); } this._dragRef.withRootElement(rootElement || element); } /** Gets the boundary element, based on the `boundaryElement` value. */ _getBoundaryElement() { const boundary = this.boundaryElement; if (!boundary) { return null; } if (typeof boundary === 'string') { return this.element.nativeElement.closest(boundary); } return coerceElement(boundary); } /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */ _syncInputs(ref) { ref.beforeStarted.subscribe(() => { if (!ref.isDragging()) { const dir = this._dir; const dragStartDelay = this.dragStartDelay; const placeholder = this._placeholderTemplate ? { template: this._placeholderTemplate.templateRef, context: this._placeholderTemplate.data, viewContainer: this._viewContainerRef, } : null; const preview = this._previewTemplate ? { template: this._previewTemplate.templateRef, context: this._previewTemplate.data, matchSize: this._previewTemplate.matchSize, viewContainer: this._viewContainerRef, } : null; ref.disabled = this.disabled; ref.lockAxis = this.lockAxis; ref.dragStartDelay = typeof dragStartDelay === 'object' && dragStartDelay ? dragStartDelay : coerceNumberProperty(dragStartDelay); ref.constrainPosition = this.constrainPosition; ref.previewClass = this.previewClass; ref .withBoundaryElement(this._getBoundaryElement()) .withPlaceholderTemplate(placeholder) .withPreviewTemplate(preview) .withPreviewContainer(this.previewContainer || 'global'); if (dir) { ref.withDirection(dir.value); } } }); // This only needs to be resolved once. ref.beforeStarted.pipe(take(1)).subscribe(() => { // If we managed to resolve a parent through DI, use it. if (this._parentDrag) { ref.withParent(this._parentDrag._dragRef); return; } // Otherwise fall back to resolving the parent by looking up the DOM. This can happen if // the item was projected into another item by something like `ngTemplateOutlet`. let parent = this.element.nativeElement.parentElement; while (parent) { if (parent.classList.contains(DRAG_HOST_CLASS)) { ref.withParent(CdkDrag._dragInstances.find(drag => { return drag.element.nativeElement === parent; })?._dragRef || null); break; } parent = parent.parentElement; } }); } /** Handles the events from the underlying `DragRef`. */ _handleEvents(ref) { ref.started.subscribe(startEvent => { this.started.emit({ source: this, event: startEvent.event }); // Since all of these events run outside of change detection, // we need to ensure that everything is marked correctly. this._changeDetectorRef.markForCheck(); }); ref.released.subscribe(releaseEvent => { this.released.emit({ source: this, event: releaseEvent.event }); }); ref.ended.subscribe(endEvent => { this.ended.emit({ source: this, distance: endEvent.distance, dropPoint: endEvent.dropPoint, event: endEvent.event, }); // Since all of these events run outside of change detection, // we need to ensure that everything is marked correctly. this._changeDetectorRef.markForCheck(); }); ref.entered.subscribe(enterEvent => { this.entered.emit({ container: enterEvent.container.data, item: this, currentIndex: enterEvent.currentIndex, }); }); ref.exited.subscribe(exitEvent => { this.exited.emit({ container: exitEvent.container.data, item: this, }); }); ref.dropped.subscribe(dropEvent => { this.dropped.emit({ previousIndex: dropEvent.previousIndex, currentIndex: dropEvent.currentIndex, previousContainer: dropEvent.previousContainer.data, container: dropEvent.container.data, isPointerOverContainer: dropEvent.isPointerOverContainer, item: this, distance: dropEvent.distance, dropPoint: dropEvent.dropPoint, event: dropEvent.event, }); }); } /** Assigns the default input values based on a provided config object. */ _assignDefaults(config) { const { lockAxis, dragStartDelay, constrainPosition, previewClass, boundaryElement, draggingDisabled, rootElementSelector, previewContainer, } = config; this.disabled = draggingDisabled == null ? false : draggingDisabled; this.dragStartDelay = dragStartDelay || 0; if (lockAxis) { this.lockAxis = lockAxis; } if (constrainPosition) { this.constrainPosition = constrainPosition; } if (previewClass) { this.previewClass = previewClass; } if (boundaryElement) { this.boundaryElement = boundaryElement; } if (rootElementSelector) { this.rootElementSelector = rootElementSelector; } if (previewContainer) { this.previewContainer = previewContainer; } } /** Sets up the listener that syncs the handles with the drag ref. */ _setupHandlesListener() { // Listen for any newly-added handles. this._handles.changes .pipe(startWith(this._handles), // Sync the new handles with the DragRef. tap((handles) => { const childHandleElements = handles .filter(handle => handle._parentDrag === this) .map(handle => handle.element); // Usually handles are only allowed to be a descendant of the drag element, but if // the consumer defined a different drag root, we should allow the drag element // itself to be a handle too. if (this._selfHandle && this.rootElementSelector) { childHandleElements.push(this.element); } this._dragRef.withHandles(childHandleElements); }), // Listen if the state of any of the handles changes. switchMap((handles) => { return merge(...handles.map(item => { return item._stateChanges.pipe(startWith(item)); })); }), takeUntil(this._destroyed)) .subscribe(handleInstance => { // Enabled/disable the handle that changed in the DragRef. const dragRef = this._dragRef; const handle = handleInstance.element.nativeElement; handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle); }); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkDrag, deps: [{ token: i0.ElementRef }, { token: CDK_DROP_LIST, optional: true, skipSelf: true }, { token: DOCUMENT }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: CDK_DRAG_CONFIG, optional: true }, { token: i1.Directionality, optional: true }, { token: i2.DragDrop }, { token: i0.ChangeDetectorRef }, { token: CDK_DRAG_HANDLE, optional: true, self: true }, { token: CDK_DRAG_PARENT, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: CdkDrag, isStandalone: true, selector: "[cdkDrag]", inputs: { data: ["cdkDragData", "data"], lockAxis: ["cdkDragLockAxis", "lockAxis"], rootElementSelector: ["cdkDragRootElement", "rootElementSelector"], boundaryElement: ["cdkDragBoundary", "boundaryElement"], dragStartDelay: ["cdkDragStartDelay", "dragStartDelay"], freeDragPosition: ["cdkDragFreeDragPosition", "freeDragPosition"], disabled: ["cdkDragDisabled", "disabled"], constrainPosition: ["cdkDragConstrainPosition", "constrainPosition"], previewClass: ["cdkDragPreviewClass", "previewClass"], previewContainer: ["cdkDragPreviewContainer", "previewContainer"] }, outputs: { started: "cdkDragStarted", released: "cdkDragReleased", ended: "cdkDragEnded", entered: "cdkDragEntered", exited: "cdkDragExited", dropped: "cdkDragDropped", moved: "cdkDragMoved" }, host: { properties: { "class.cdk-drag-disabled": "disabled", "class.cdk-drag-dragging": "_dragRef.isDragging()" }, classAttribute: "cdk-drag" }, providers: [{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }], queries: [{ propertyName: "_previewTemplate", first: true, predicate: CDK_DRAG_PREVIEW, descendants: true }, { propertyName: "_placeholderTemplate", first: true, predicate: CDK_DRAG_PLACEHOLDER, descendants: true }, { propertyName: "_handles", predicate: CDK_DRAG_HANDLE, descendants: true }], exportAs: ["cdkDrag"], usesOnChanges: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkDrag, decorators: [{ type: Directive, args: [{ selector: '[cdkDrag]', exportAs: 'cdkDrag', standalone: true, host: { 'class': DRAG_HOST_CLASS, '[class.cdk-drag-disabled]': 'disabled', '[class.cdk-drag-dragging]': '_dragRef.isDragging()', }, providers: [{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }], }] }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{ type: Inject, args: [CDK_DROP_LIST] }, { type: Optional }, { type: SkipSelf }] }, { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT] }] }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [CDK_DRAG_CONFIG] }] }, { type: i1.Directionality, decorators: [{ type: Optional }] }, { type: i2.DragDrop }, { type: i0.ChangeDetectorRef }, { type: i3.CdkDragHandle, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [CDK_DRAG_HANDLE] }] }, { type: CdkDrag, decorators: [{ type: Optional }, { type: SkipSelf }, { type: Inject, args: [CDK_DRAG_PARENT] }] }]; }, propDecorators: { _handles: [{ type: ContentChildren, args: [CDK_DRAG_HANDLE, { descendants: true }] }], _previewTemplate: [{ type: ContentChild, args: [CDK_DRAG_PREVIEW] }], _placeholderTemplate: [{ type: ContentChild, args: [CDK_DRAG_PLACEHOLDER] }], data: [{ type: Input, args: ['cdkDragData'] }], lockAxis: [{ type: Input, args: ['cdkDragLockAxis'] }], rootElementSelector: [{ type: Input, args: ['cdkDragRootElement'] }], boundaryElement: [{ type: Input, args: ['cdkDragBoundary'] }], dragStartDelay: [{ type: Input, args: ['cdkDragStartDelay'] }], freeDragPosition: [{ type: Input, args: ['cdkDragFreeDragPosition'] }], disabled: [{ type: Input, args: ['cdkDragDisabled'] }], constrainPosition: [{ type: Input, args: ['cdkDragConstrainPosition'] }], previewClass: [{ type: Input, args: ['cdkDragPreviewClass'] }], previewContainer: [{ type: Input, args: ['cdkDragPreviewContainer'] }], started: [{ type: Output, args: ['cdkDragStarted'] }], released: [{ type: Output, args: ['cdkDragReleased'] }], ended: [{ type: Output, args: ['cdkDragEnded'] }], entered: [{ type: Output, args: ['cdkDragEntered'] }], exited: [{ type: Output, args: ['cdkDragExited'] }], dropped: [{ type: Output, args: ['cdkDragDropped'] }], moved: [{ type: Output, args: ['cdkDragMoved'] }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJhZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy9jZGsvZHJhZy1kcm9wL2RpcmVjdGl2ZXMvZHJhZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQUMsY0FBYyxFQUFDLE1BQU0sbUJBQW1CLENBQUM7QUFDakQsT0FBTyxFQUFDLFFBQVEsRUFBQyxNQUFNLGlCQUFpQixDQUFDO0FBQ3pDLE9BQU8sRUFFTCxZQUFZLEVBQ1osZUFBZSxFQUNmLFNBQVMsRUFDVCxVQUFVLEVBQ1YsWUFBWSxFQUNaLE1BQU0sRUFDTixLQUFLLEVBQ0wsTUFBTSxFQUVOLFFBQVEsRUFDUixNQUFNLEVBQ04sU0FBUyxFQUNULFFBQVEsRUFDUixnQkFBZ0IsRUFHaEIsaUJBQWlCLEVBQ2pCLElBQUksRUFDSixjQUFjLEdBQ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cbiAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgdGVtcGxhdGU6IHRoaXMuX3BsYWNlaG9sZGVyVGVtcGxhdGUudGVtcGxhdGVSZWYsXG4gICAgICAgICAgICAgIGNvbnRleHQ6IHRoaXMuX3BsYWNlaG9sZGVyVGVtcGxhdGUuZGF0YSxcbiAgICAgICAgICAgICAgdmlld0NvbnRhaW5lcjogdGhpcy5fdmlld0NvbnRhaW5lclJlZixcbiAgICAgICAgICAgIH1cbiAgICAgICAgICA6IG51bGw7XG4gICAgICAgIGNvbnN0IHByZXZpZXcgPSB0aGlzLl9wcmV2aWV3VGVtcGxhdGVcbiAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgdGVtcGxhdGU6IHRoaXMuX3ByZXZpZXdUZW1wbGF0ZS50ZW1wbGF0ZVJlZixcbiAgICAgICAgICAgICAgY29udGV4dDogdGhpcy5fcHJldmlld1RlbXBsYXRlLmRhdGEsXG4gICAgICAgICAgICAgIG1hdGNoU2l6ZTogdGhpcy5fcHJldmlld1RlbXBsYXRlLm1hdGNoU2l6ZSxcbiAgICAgICAgICAgICAgdmlld0NvbnRhaW5lcjogdGhpcy5fdmlld0NvbnRhaW5lclJlZixcbiAgICAgICAgICAgIH1cbiAgICAgICAgICA6IG51bGw7XG5cbiAgICAgICAgcmVmLmRpc2FibGVkID0gdGhpcy5kaXNhYmxlZDtcbiAgICAgICAgcmVmLmxvY2tBeGlzID0gdGhpcy5sb2NrQXhpcztcbiAgICAgICAgcmVmLmRyYWdTdGFydERlbGF5ID1cbiAgICAgICAgICB0eXBlb2YgZHJhZ1N0YXJ0RGVsYXkgPT09ICdvYmplY3QnICYmIGRyYWdTdGFydERlbGF5XG4gICAgICAgICAgICA/IGRyYWdTdGFydERlbGF5XG4gICAgICAgICAgICA6IGNvZXJjZU51bWJlclByb3BlcnR5KGRyYWdTdGFydERlbGF5KTtcbiAgICAgICAgcmVmLmNvbnN0cmFpblBvc2l0aW9uID0gdGhpcy5jb25zdHJh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