1 | {"version":3,"file":"angular-draggable-droppable.mjs","sources":["../../../projects/angular-draggable-droppable/src/lib/util.ts","../../../projects/angular-draggable-droppable/src/lib/draggable-helper.provider.ts","../../../projects/angular-draggable-droppable/src/lib/draggable-scroll-container.directive.ts","../../../projects/angular-draggable-droppable/src/lib/draggable.directive.ts","../../../projects/angular-draggable-droppable/src/lib/droppable.directive.ts","../../../projects/angular-draggable-droppable/src/lib/drag-and-drop.module.ts","../../../projects/angular-draggable-droppable/src/public_api.ts","../../../projects/angular-draggable-droppable/src/angular-draggable-droppable.ts"],"sourcesContent":["import { ElementRef, Renderer2 } from '@angular/core';\n\nexport function addClass(\n renderer: Renderer2,\n element: ElementRef<HTMLElement>,\n classToAdd: string\n) {\n if (classToAdd) {\n classToAdd\n .split(' ')\n .forEach((className) =>\n renderer.addClass(element.nativeElement, className)\n );\n }\n}\n\nexport function removeClass(\n renderer: Renderer2,\n element: ElementRef<HTMLElement>,\n classToRemove: string\n) {\n if (classToRemove) {\n classToRemove\n .split(' ')\n .forEach((className) =>\n renderer.removeClass(element.nativeElement, className)\n );\n }\n}\n","import { Subject } from 'rxjs';\nimport { Injectable } from '@angular/core';\n\nexport interface CurrentDragData {\n clientX: number;\n clientY: number;\n dropData: any;\n target: EventTarget;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DraggableHelper {\n currentDrag = new Subject<Subject<CurrentDragData>>();\n}\n","import { Directive, ElementRef } from '@angular/core';\n\n/**\n * If the window isn't scrollable, then place this on the scrollable container that draggable elements are inside. e.g.\n * ```html\n <div style=\"overflow: scroll\" mwlDraggableScrollContainer>\n <div mwlDraggable>Drag me!</div>\n </div>\n ```\n */\n@Directive({\n selector: '[mwlDraggableScrollContainer]',\n})\nexport class DraggableScrollContainerDirective {\n /**\n * @hidden\n */\n constructor(public elementRef: ElementRef<HTMLElement>) {}\n}\n","import {\n Directive,\n OnInit,\n ElementRef,\n Renderer2,\n Output,\n EventEmitter,\n Input,\n OnDestroy,\n OnChanges,\n NgZone,\n SimpleChanges,\n Inject,\n TemplateRef,\n ViewContainerRef,\n Optional,\n} from '@angular/core';\nimport {\n Subject,\n Observable,\n merge,\n ReplaySubject,\n combineLatest,\n fromEvent,\n} from 'rxjs';\nimport {\n map,\n mergeMap,\n takeUntil,\n take,\n takeLast,\n pairwise,\n share,\n filter,\n count,\n startWith,\n} from 'rxjs/operators';\nimport { CurrentDragData, DraggableHelper } from './draggable-helper.provider';\nimport { DOCUMENT } from '@angular/common';\nimport autoScroll from '@mattlewis92/dom-autoscroller';\nimport { DraggableScrollContainerDirective } from './draggable-scroll-container.directive';\nimport { addClass, removeClass } from './util';\n\nexport interface Coordinates {\n x: number;\n y: number;\n}\n\nexport interface DragAxis {\n x: boolean;\n y: boolean;\n}\n\nexport interface SnapGrid {\n x?: number;\n y?: number;\n}\n\nexport interface DragPointerDownEvent extends Coordinates {}\n\nexport interface DragStartEvent {\n cancelDrag$: ReplaySubject<void>;\n}\n\nexport interface DragMoveEvent extends Coordinates {}\n\nexport interface DragEndEvent extends Coordinates {\n dragCancelled: boolean;\n}\n\nexport interface ValidateDragParams extends Coordinates {\n transform: {\n x: number;\n y: number;\n };\n}\n\nexport type ValidateDrag = (params: ValidateDragParams) => boolean;\n\nexport interface PointerEvent {\n clientX: number;\n clientY: number;\n event: MouseEvent | TouchEvent;\n}\n\nexport interface TimeLongPress {\n timerBegin: number;\n timerEnd: number;\n}\n\nexport interface GhostElementCreatedEvent {\n clientX: number;\n clientY: number;\n element: HTMLElement;\n}\n\n@Directive({\n selector: '[mwlDraggable]',\n})\nexport class DraggableDirective implements OnInit, OnChanges, OnDestroy {\n /**\n * an object of data you can pass to the drop event\n */\n @Input() dropData: any;\n\n /**\n * The axis along which the element is draggable\n */\n @Input() dragAxis: DragAxis = { x: true, y: true };\n\n /**\n * Snap all drags to an x / y grid\n */\n @Input() dragSnapGrid: SnapGrid = {};\n\n /**\n * Show a ghost element that shows the drag when dragging\n */\n @Input() ghostDragEnabled: boolean = true;\n\n /**\n * Show the original element when ghostDragEnabled is true\n */\n @Input() showOriginalElementWhileDragging: boolean = false;\n\n /**\n * Allow custom behaviour to control when the element is dragged\n */\n @Input() validateDrag: ValidateDrag;\n\n /**\n * The cursor to use when hovering over a draggable element\n */\n @Input() dragCursor: string = '';\n\n /**\n * The css class to apply when the element is being dragged\n */\n @Input() dragActiveClass: string;\n\n /**\n * The element the ghost element will be appended to. Default is next to the dragged element\n */\n @Input() ghostElementAppendTo: HTMLElement;\n\n /**\n * An ng-template to be inserted into the parent element of the ghost element. It will overwrite any child nodes.\n */\n @Input() ghostElementTemplate: TemplateRef<any>;\n\n /**\n * Amount of milliseconds to wait on touch devices before starting to drag the element (so that you can scroll the page by touching a draggable element)\n */\n @Input() touchStartLongPress: { delay: number; delta: number };\n\n /*\n * Options used to control the behaviour of auto scrolling: https://www.npmjs.com/package/dom-autoscroller\n */\n @Input() autoScroll: {\n margin:\n | number\n | { top?: number; left?: number; right?: number; bottom?: number };\n maxSpeed?:\n | number\n | { top?: number; left?: number; right?: number; bottom?: number };\n scrollWhenOutside?: boolean;\n } = {\n margin: 20,\n };\n\n /**\n * Called when the element can be dragged along one axis and has the mouse or pointer device pressed on it\n */\n @Output() dragPointerDown = new EventEmitter<DragPointerDownEvent>();\n\n /**\n * Called when the element has started to be dragged.\n * Only called after at least one mouse or touch move event.\n * If you call $event.cancelDrag$.emit() it will cancel the current drag\n */\n @Output() dragStart = new EventEmitter<DragStartEvent>();\n\n /**\n * Called after the ghost element has been created\n */\n @Output() ghostElementCreated = new EventEmitter<GhostElementCreatedEvent>();\n\n /**\n * Called when the element is being dragged\n */\n @Output() dragging = new EventEmitter<DragMoveEvent>();\n\n /**\n * Called after the element is dragged\n */\n @Output() dragEnd = new EventEmitter<DragEndEvent>();\n\n /**\n * @hidden\n */\n pointerDown$ = new Subject<PointerEvent>();\n\n /**\n * @hidden\n */\n pointerMove$ = new Subject<PointerEvent>();\n\n /**\n * @hidden\n */\n pointerUp$ = new Subject<PointerEvent>();\n\n private eventListenerSubscriptions: {\n mousemove?: () => void;\n mousedown?: () => void;\n mouseup?: () => void;\n mouseenter?: () => void;\n mouseleave?: () => void;\n touchstart?: () => void;\n touchmove?: () => void;\n touchend?: () => void;\n touchcancel?: () => void;\n } = {};\n\n private ghostElement: HTMLElement | null;\n\n private destroy$ = new Subject<void>();\n\n private timeLongPress: TimeLongPress = { timerBegin: 0, timerEnd: 0 };\n\n private scroller: { destroy: () => void };\n\n /**\n * @hidden\n */\n constructor(\n private element: ElementRef<HTMLElement>,\n private renderer: Renderer2,\n private draggableHelper: DraggableHelper,\n private zone: NgZone,\n private vcr: ViewContainerRef,\n @Optional() private scrollContainer: DraggableScrollContainerDirective,\n @Inject(DOCUMENT) private document: any\n ) {}\n\n ngOnInit(): void {\n this.checkEventListeners();\n\n const pointerDragged$: Observable<any> = this.pointerDown$.pipe(\n filter(() => this.canDrag()),\n mergeMap((pointerDownEvent: PointerEvent) => {\n // fix for https://github.com/mattlewis92/angular-draggable-droppable/issues/61\n // stop mouse events propagating up the chain\n if (pointerDownEvent.event.stopPropagation && !this.scrollContainer) {\n pointerDownEvent.event.stopPropagation();\n }\n\n // hack to prevent text getting selected in safari while dragging\n const globalDragStyle: HTMLStyleElement =\n this.renderer.createElement('style');\n this.renderer.setAttribute(globalDragStyle, 'type', 'text/css');\n this.renderer.appendChild(\n globalDragStyle,\n this.renderer.createText(`\n body * {\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n }\n `)\n );\n requestAnimationFrame(() => {\n this.document.head.appendChild(globalDragStyle);\n });\n\n const startScrollPosition = this.getScrollPosition();\n\n const scrollContainerScroll$ = new Observable((observer) => {\n const scrollContainer = this.scrollContainer\n ? this.scrollContainer.elementRef.nativeElement\n : 'window';\n return this.renderer.listen(scrollContainer, 'scroll', (e) =>\n observer.next(e)\n );\n }).pipe(\n startWith(startScrollPosition),\n map(() => this.getScrollPosition())\n );\n\n const currentDrag$ = new Subject<CurrentDragData>();\n const cancelDrag$ = new ReplaySubject<void>();\n\n if (this.dragPointerDown.observers.length > 0) {\n this.zone.run(() => {\n this.dragPointerDown.next({ x: 0, y: 0 });\n });\n }\n\n const dragComplete$ = merge(\n this.pointerUp$,\n this.pointerDown$,\n cancelDrag$,\n this.destroy$\n ).pipe(share());\n\n const pointerMove = combineLatest([\n this.pointerMove$,\n scrollContainerScroll$,\n ]).pipe(\n map(([pointerMoveEvent, scroll]) => {\n return {\n currentDrag$,\n transformX: pointerMoveEvent.clientX - pointerDownEvent.clientX,\n transformY: pointerMoveEvent.clientY - pointerDownEvent.clientY,\n clientX: pointerMoveEvent.clientX,\n clientY: pointerMoveEvent.clientY,\n scrollLeft: scroll.left,\n scrollTop: scroll.top,\n target: pointerMoveEvent.event.target,\n };\n }),\n map((moveData) => {\n if (this.dragSnapGrid.x) {\n moveData.transformX =\n Math.round(moveData.transformX / this.dragSnapGrid.x) *\n this.dragSnapGrid.x;\n }\n\n if (this.dragSnapGrid.y) {\n moveData.transformY =\n Math.round(moveData.transformY / this.dragSnapGrid.y) *\n this.dragSnapGrid.y;\n }\n\n return moveData;\n }),\n map((moveData) => {\n if (!this.dragAxis.x) {\n moveData.transformX = 0;\n }\n\n if (!this.dragAxis.y) {\n moveData.transformY = 0;\n }\n\n return moveData;\n }),\n map((moveData) => {\n const scrollX = moveData.scrollLeft - startScrollPosition.left;\n const scrollY = moveData.scrollTop - startScrollPosition.top;\n return {\n ...moveData,\n x: moveData.transformX + scrollX,\n y: moveData.transformY + scrollY,\n };\n }),\n filter(\n ({ x, y, transformX, transformY }) =>\n !this.validateDrag ||\n this.validateDrag({\n x,\n y,\n transform: { x: transformX, y: transformY },\n })\n ),\n takeUntil(dragComplete$),\n share()\n );\n\n const dragStarted$ = pointerMove.pipe(take(1), share());\n const dragEnded$ = pointerMove.pipe(takeLast(1), share());\n\n dragStarted$.subscribe(({ clientX, clientY, x, y }) => {\n if (this.dragStart.observers.length > 0) {\n this.zone.run(() => {\n this.dragStart.next({ cancelDrag$ });\n });\n }\n\n this.scroller = autoScroll(\n [\n this.scrollContainer\n ? this.scrollContainer.elementRef.nativeElement\n : this.document.defaultView,\n ],\n {\n ...this.autoScroll,\n autoScroll() {\n return true;\n },\n }\n );\n addClass(this.renderer, this.element, this.dragActiveClass);\n\n if (this.ghostDragEnabled) {\n const rect = this.element.nativeElement.getBoundingClientRect();\n const clone = this.element.nativeElement.cloneNode(\n true\n ) as HTMLElement;\n if (!this.showOriginalElementWhileDragging) {\n this.renderer.setStyle(\n this.element.nativeElement,\n 'visibility',\n 'hidden'\n );\n }\n\n if (this.ghostElementAppendTo) {\n this.ghostElementAppendTo.appendChild(clone);\n } else {\n this.element.nativeElement.parentNode!.insertBefore(\n clone,\n this.element.nativeElement.nextSibling\n );\n }\n\n this.ghostElement = clone;\n\n this.document.body.style.cursor = this.dragCursor;\n\n this.setElementStyles(clone, {\n position: 'fixed',\n top: `${rect.top}px`,\n left: `${rect.left}px`,\n width: `${rect.width}px`,\n height: `${rect.height}px`,\n cursor: this.dragCursor,\n margin: '0',\n willChange: 'transform',\n pointerEvents: 'none',\n });\n\n if (this.ghostElementTemplate) {\n const viewRef = this.vcr.createEmbeddedView(\n this.ghostElementTemplate\n );\n clone.innerHTML = '';\n viewRef.rootNodes\n .filter((node) => node instanceof Node)\n .forEach((node) => {\n clone.appendChild(node);\n });\n dragEnded$.subscribe(() => {\n this.vcr.remove(this.vcr.indexOf(viewRef));\n });\n }\n\n if (this.ghostElementCreated.observers.length > 0) {\n this.zone.run(() => {\n this.ghostElementCreated.emit({\n clientX: clientX - x,\n clientY: clientY - y,\n element: clone,\n });\n });\n }\n\n dragEnded$.subscribe(() => {\n clone.parentElement!.removeChild(clone);\n this.ghostElement = null;\n this.renderer.setStyle(\n this.element.nativeElement,\n 'visibility',\n ''\n );\n });\n }\n\n this.draggableHelper.currentDrag.next(currentDrag$);\n });\n\n dragEnded$\n .pipe(\n mergeMap((dragEndData) => {\n const dragEndData$ = cancelDrag$.pipe(\n count(),\n take(1),\n map((calledCount) => ({\n ...dragEndData,\n dragCancelled: calledCount > 0,\n }))\n );\n cancelDrag$.complete();\n return dragEndData$;\n })\n )\n .subscribe(({ x, y, dragCancelled }) => {\n this.scroller.destroy();\n if (this.dragEnd.observers.length > 0) {\n this.zone.run(() => {\n this.dragEnd.next({ x, y, dragCancelled });\n });\n }\n removeClass(this.renderer, this.element, this.dragActiveClass);\n currentDrag$.complete();\n });\n\n merge(dragComplete$, dragEnded$)\n .pipe(take(1))\n .subscribe(() => {\n requestAnimationFrame(() => {\n this.document.head.removeChild(globalDragStyle);\n });\n });\n\n return pointerMove;\n }),\n share()\n );\n\n merge(\n pointerDragged$.pipe(\n take(1),\n map((value) => [, value])\n ),\n pointerDragged$.pipe(pairwise())\n )\n .pipe(\n filter(([previous, next]) => {\n if (!previous) {\n return true;\n }\n return previous.x !== next.x || previous.y !== next.y;\n }),\n map(([previous, next]) => next)\n )\n .subscribe(\n ({\n x,\n y,\n currentDrag$,\n clientX,\n clientY,\n transformX,\n transformY,\n target,\n }) => {\n if (this.dragging.observers.length > 0) {\n this.zone.run(() => {\n this.dragging.next({ x, y });\n });\n }\n requestAnimationFrame(() => {\n if (this.ghostElement) {\n const transform = `translate3d(${transformX}px, ${transformY}px, 0px)`;\n this.setElementStyles(this.ghostElement, {\n transform,\n '-webkit-transform': transform,\n '-ms-transform': transform,\n '-moz-transform': transform,\n '-o-transform': transform,\n });\n }\n });\n currentDrag$.next({\n clientX,\n clientY,\n dropData: this.dropData,\n target,\n });\n }\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.dragAxis) {\n this.checkEventListeners();\n }\n }\n\n ngOnDestroy(): void {\n this.unsubscribeEventListeners();\n this.pointerDown$.complete();\n this.pointerMove$.complete();\n this.pointerUp$.complete();\n this.destroy$.next();\n }\n\n private checkEventListeners(): void {\n const canDrag: boolean = this.canDrag();\n const hasEventListeners: boolean =\n Object.keys(this.eventListenerSubscriptions).length > 0;\n\n if (canDrag && !hasEventListeners) {\n this.zone.runOutsideAngular(() => {\n this.eventListenerSubscriptions.mousedown = this.renderer.listen(\n this.element.nativeElement,\n 'mousedown',\n (event: MouseEvent) => {\n this.onMouseDown(event);\n }\n );\n\n this.eventListenerSubscriptions.mouseup = this.renderer.listen(\n 'document',\n 'mouseup',\n (event: MouseEvent) => {\n this.onMouseUp(event);\n }\n );\n\n this.eventListenerSubscriptions.touchstart = this.renderer.listen(\n this.element.nativeElement,\n 'touchstart',\n (event: TouchEvent) => {\n this.onTouchStart(event);\n }\n );\n\n this.eventListenerSubscriptions.touchend = this.renderer.listen(\n 'document',\n 'touchend',\n (event: TouchEvent) => {\n this.onTouchEnd(event);\n }\n );\n\n this.eventListenerSubscriptions.touchcancel = this.renderer.listen(\n 'document',\n 'touchcancel',\n (event: TouchEvent) => {\n this.onTouchEnd(event);\n }\n );\n\n this.eventListenerSubscriptions.mouseenter = this.renderer.listen(\n this.element.nativeElement,\n 'mouseenter',\n () => {\n this.onMouseEnter();\n }\n );\n\n this.eventListenerSubscriptions.mouseleave = this.renderer.listen(\n this.element.nativeElement,\n 'mouseleave',\n () => {\n this.onMouseLeave();\n }\n );\n });\n } else if (!canDrag && hasEventListeners) {\n this.unsubscribeEventListeners();\n }\n }\n\n private onMouseDown(event: MouseEvent): void {\n if (event.button === 0) {\n if (!this.eventListenerSubscriptions.mousemove) {\n this.eventListenerSubscriptions.mousemove = this.renderer.listen(\n 'document',\n 'mousemove',\n (mouseMoveEvent: MouseEvent) => {\n this.pointerMove$.next({\n event: mouseMoveEvent,\n clientX: mouseMoveEvent.clientX,\n clientY: mouseMoveEvent.clientY,\n });\n }\n );\n }\n this.pointerDown$.next({\n event,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n }\n }\n\n private onMouseUp(event: MouseEvent): void {\n if (event.button === 0) {\n if (this.eventListenerSubscriptions.mousemove) {\n this.eventListenerSubscriptions.mousemove();\n delete this.eventListenerSubscriptions.mousemove;\n }\n this.pointerUp$.next({\n event,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n }\n }\n\n private onTouchStart(event: TouchEvent): void {\n let startScrollPosition: any;\n let isDragActivated: boolean;\n let hasContainerScrollbar: boolean;\n if (this.touchStartLongPress) {\n this.timeLongPress.timerBegin = Date.now();\n isDragActivated = false;\n hasContainerScrollbar = this.hasScrollbar();\n startScrollPosition = this.getScrollPosition();\n }\n\n if (!this.eventListenerSubscriptions.touchmove) {\n const contextMenuListener = fromEvent<Event>(\n this.document,\n 'contextmenu'\n ).subscribe((e) => {\n e.preventDefault();\n });\n\n const touchMoveListener = fromEvent<TouchEvent>(\n this.document,\n 'touchmove',\n {\n passive: false,\n }\n ).subscribe((touchMoveEvent) => {\n if (\n this.touchStartLongPress &&\n !isDragActivated &&\n hasContainerScrollbar\n ) {\n isDragActivated = this.shouldBeginDrag(\n event,\n touchMoveEvent,\n startScrollPosition\n );\n }\n if (\n !this.touchStartLongPress ||\n !hasContainerScrollbar ||\n isDragActivated\n ) {\n touchMoveEvent.preventDefault();\n this.pointerMove$.next({\n event: touchMoveEvent,\n clientX: touchMoveEvent.targetTouches[0].clientX,\n clientY: touchMoveEvent.targetTouches[0].clientY,\n });\n }\n });\n\n this.eventListenerSubscriptions.touchmove = () => {\n contextMenuListener.unsubscribe();\n touchMoveListener.unsubscribe();\n };\n }\n this.pointerDown$.next({\n event,\n clientX: event.touches[0].clientX,\n clientY: event.touches[0].clientY,\n });\n }\n\n private onTouchEnd(event: TouchEvent): void {\n if (this.eventListenerSubscriptions.touchmove) {\n this.eventListenerSubscriptions.touchmove();\n delete this.eventListenerSubscriptions.touchmove;\n\n if (this.touchStartLongPress) {\n this.enableScroll();\n }\n }\n this.pointerUp$.next({\n event,\n clientX: event.changedTouches[0].clientX,\n clientY: event.changedTouches[0].clientY,\n });\n }\n\n private onMouseEnter(): void {\n this.setCursor(this.dragCursor);\n }\n\n private onMouseLeave(): void {\n this.setCursor('');\n }\n\n private canDrag(): boolean {\n return this.dragAxis.x || this.dragAxis.y;\n }\n\n private setCursor(value: string): void {\n if (!this.eventListenerSubscriptions.mousemove) {\n this.renderer.setStyle(this.element.nativeElement, 'cursor', value);\n }\n }\n\n private unsubscribeEventListeners(): void {\n Object.keys(this.eventListenerSubscriptions).forEach((type) => {\n (this as any).eventListenerSubscriptions[type]();\n delete (this as any).eventListenerSubscriptions[type];\n });\n }\n\n private setElementStyles(\n element: HTMLElement,\n styles: { [key: string]: string }\n ) {\n Object.keys(styles).forEach((key) => {\n this.renderer.setStyle(element, key, styles[key]);\n });\n }\n\n private getScrollElement() {\n if (this.scrollContainer) {\n return this.scrollContainer.elementRef.nativeElement;\n } else {\n return this.document.body;\n }\n }\n\n private getScrollPosition() {\n if (this.scrollContainer) {\n return {\n top: this.scrollContainer.elementRef.nativeElement.scrollTop,\n left: this.scrollContainer.elementRef.nativeElement.scrollLeft,\n };\n } else {\n return {\n top: window.pageYOffset || this.document.documentElement.scrollTop,\n left: window.pageXOffset || this.document.documentElement.scrollLeft,\n };\n }\n }\n\n private shouldBeginDrag(\n event: TouchEvent,\n touchMoveEvent: TouchEvent,\n startScrollPosition: { top: number; left: number }\n ): boolean {\n const moveScrollPosition = this.getScrollPosition();\n const deltaScroll = {\n top: Math.abs(moveScrollPosition.top - startScrollPosition.top),\n left: Math.abs(moveScrollPosition.left - startScrollPosition.left),\n };\n const deltaX =\n Math.abs(\n touchMoveEvent.targetTouches[0].clientX - event.touches[0].clientX\n ) - deltaScroll.left;\n const deltaY =\n Math.abs(\n touchMoveEvent.targetTouches[0].clientY - event.touches[0].clientY\n ) - deltaScroll.top;\n const deltaTotal = deltaX + deltaY;\n const longPressConfig = this.touchStartLongPress;\n if (\n deltaTotal > longPressConfig.delta ||\n deltaScroll.top > 0 ||\n deltaScroll.left > 0\n ) {\n this.timeLongPress.timerBegin = Date.now();\n }\n this.timeLongPress.timerEnd = Date.now();\n const duration =\n this.timeLongPress.timerEnd - this.timeLongPress.timerBegin;\n if (duration >= longPressConfig.delay) {\n this.disableScroll();\n return true;\n }\n return false;\n }\n\n private enableScroll() {\n if (this.scrollContainer) {\n this.renderer.setStyle(\n this.scrollContainer.elementRef.nativeElement,\n 'overflow',\n ''\n );\n }\n this.renderer.setStyle(this.document.body, 'overflow', '');\n }\n\n private disableScroll() {\n /* istanbul ignore next */\n if (this.scrollContainer) {\n this.renderer.setStyle(\n this.scrollContainer.elementRef.nativeElement,\n 'overflow',\n 'hidden'\n );\n }\n this.renderer.setStyle(this.document.body, 'overflow', 'hidden');\n }\n\n private hasScrollbar(): boolean {\n const scrollContainer = this.getScrollElement();\n const containerHasHorizontalScroll =\n scrollContainer.scrollWidth > scrollContainer.clientWidth;\n const containerHasVerticalScroll =\n scrollContainer.scrollHeight > scrollContainer.clientHeight;\n return containerHasHorizontalScroll || containerHasVerticalScroll;\n }\n}\n","import {\n Directive,\n OnInit,\n ElementRef,\n OnDestroy,\n Output,\n EventEmitter,\n NgZone,\n Input,\n Renderer2,\n Optional,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { distinctUntilChanged, pairwise, filter, map } from 'rxjs/operators';\nimport { DraggableHelper } from './draggable-helper.provider';\nimport { DraggableScrollContainerDirective } from './draggable-scroll-container.directive';\nimport { addClass, removeClass } from './util';\n\nfunction isCoordinateWithinRectangle(\n clientX: number,\n clientY: number,\n rect: ClientRect\n): boolean {\n return (\n clientX >= rect.left &&\n clientX <= rect.right &&\n clientY >= rect.top &&\n clientY <= rect.bottom\n );\n}\n\nexport interface DropEvent<T = any> {\n dropData: T;\n /**\n * ClientX value of the mouse location where the drop occurred\n */\n clientX: number;\n /**\n * ClientY value of the mouse location where the drop occurred\n */\n clientY: number;\n /**\n * The target of the event where the drop occurred\n */\n target: EventTarget;\n}\n\nexport interface DragEvent<T = any> extends DropEvent<T> {}\n\nexport interface ValidateDropParams extends DropEvent {}\n\nexport type ValidateDrop = (params: ValidateDropParams) => boolean;\n\n@Directive({\n selector: '[mwlDroppable]',\n})\nexport class DroppableDirective implements OnInit, OnDestroy {\n /**\n * Added to the element when an element is dragged over it\n */\n @Input() dragOverClass: string;\n\n /**\n * Added to the element any time a draggable element is being dragged\n */\n @Input() dragActiveClass: string;\n\n /**\n * Allow custom behaviour to control when the element is dropped\n */\n @Input() validateDrop: ValidateDrop;\n\n /**\n * Called when a draggable element starts overlapping the element\n */\n @Output() dragEnter = new EventEmitter<DropEvent>();\n\n /**\n * Called when a draggable element stops overlapping the element\n */\n @Output() dragLeave = new EventEmitter<DropEvent>();\n\n /**\n * Called when a draggable element is moved over the element\n */\n @Output() dragOver = new EventEmitter<DropEvent>();\n\n /**\n * Called when a draggable element is dropped on this element\n */\n @Output() drop = new EventEmitter<DropEvent>(); // eslint-disable-line @angular-eslint/no-output-native\n\n currentDragSubscription: Subscription;\n\n constructor(\n private element: ElementRef<HTMLElement>,\n private draggableHelper: DraggableHelper,\n private zone: NgZone,\n private renderer: Renderer2,\n @Optional() private scrollContainer: DraggableScrollContainerDirective\n ) {}\n\n ngOnInit() {\n this.currentDragSubscription = this.draggableHelper.currentDrag.subscribe(\n (drag$) => {\n addClass(this.renderer, this.element, this.dragActiveClass);\n const droppableElement: {\n rect?: ClientRect;\n updateCache: boolean;\n scrollContainerRect?: ClientRect;\n } = {\n updateCache: true,\n };\n\n const deregisterScrollListener = this.renderer.listen(\n this.scrollContainer\n ? this.scrollContainer.elementRef.nativeElement\n : 'window',\n 'scroll',\n () => {\n droppableElement.updateCache = true;\n }\n );\n\n let currentDragEvent: DragEvent;\n const overlaps$ = drag$.pipe(\n map(({ clientX, clientY, dropData, target }) => {\n currentDragEvent = { clientX, clientY, dropData, target };\n if (droppableElement.updateCache) {\n droppableElement.rect =\n this.element.nativeElement.getBoundingClientRect();\n if (this.scrollContainer) {\n droppableElement.scrollContainerRect =\n this.scrollContainer.elementRef.nativeElement.getBoundingClientRect();\n }\n droppableElement.updateCache = false;\n }\n const isWithinElement = isCoordinateWithinRectangle(\n clientX,\n clientY,\n droppableElement.rect as ClientRect\n );\n\n const isDropAllowed =\n !this.validateDrop ||\n this.validateDrop({ clientX, clientY, target, dropData });\n\n if (droppableElement.scrollContainerRect) {\n return (\n isWithinElement &&\n isDropAllowed &&\n isCoordinateWithinRectangle(\n clientX,\n clientY,\n droppableElement.scrollContainerRect as ClientRect\n )\n );\n } else {\n return isWithinElement && isDropAllowed;\n }\n })\n );\n\n const overlapsChanged$ = overlaps$.pipe(distinctUntilChanged());\n\n let dragOverActive: boolean; // TODO - see if there's a way of doing this via rxjs\n\n overlapsChanged$\n .pipe(filter((overlapsNow) => overlapsNow))\n .subscribe(() => {\n dragOverActive = true;\n addClass(this.renderer, this.element, this.dragOverClass);\n if (this.dragEnter.observers.length > 0) {\n this.zone.run(() => {\n this.dragEnter.next(currentDragEvent);\n });\n }\n });\n\n overlaps$.pipe(filter((overlapsNow) => overlapsNow)).subscribe(() => {\n if (this.dragOver.observers.length > 0) {\n this.zone.run(() => {\n this.dragOver.next(currentDragEvent);\n });\n }\n });\n\n overlapsChanged$\n .pipe(\n pairwise(),\n filter(([didOverlap, overlapsNow]) => didOverlap && !overlapsNow)\n )\n .subscribe(() => {\n dragOverActive = false;\n removeClass(this.renderer, this.element, this.dragOverClass);\n if (this.dragLeave.observers.length > 0) {\n this.zone.run(() => {\n this.dragLeave.next(currentDragEvent);\n });\n }\n });\n\n drag$.subscribe({\n complete: () => {\n deregisterScrollListener();\n removeClass(this.renderer, this.element, this.dragActiveClass);\n if (dragOverActive) {\n removeClass(this.renderer, this.element, this.dragOverClass);\n if (this.drop.observers.length > 0) {\n this.zone.run(() => {\n this.drop.next(currentDragEvent);\n });\n }\n }\n },\n });\n }\n );\n }\n\n ngOnDestroy() {\n if (this.currentDragSubscription) {\n this.currentDragSubscription.unsubscribe();\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DraggableDirective } from './draggable.directive';\nimport { DroppableDirective } from './droppable.directive';\nimport { DraggableScrollContainerDirective } from './draggable-scroll-container.directive';\n\n@NgModule({\n declarations: [\n DraggableDirective,\n DroppableDirective,\n DraggableScrollContainerDirective,\n ],\n exports: [\n DraggableDirective,\n DroppableDirective,\n DraggableScrollContainerDirective,\n ],\n})\nexport class DragAndDropModule {}\n","/*\n * Public API Surface of angular-draggable-droppable\n */\n\nexport * from './lib/drag-and-drop.module';\nexport {\n DropEvent,\n ValidateDrop,\n ValidateDropParams,\n DroppableDirective,\n} from './lib/droppable.directive';\nexport {\n DragPointerDownEvent,\n DragStartEvent,\n DragMoveEvent,\n DragEndEvent,\n GhostElementCreatedEvent,\n ValidateDrag,\n ValidateDragParams,\n DraggableDirective,\n} from './lib/draggable.directive';\nexport { DraggableScrollContainerDirective } from './lib/draggable-scroll-container.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.DraggableHelper","i2.DraggableScrollContainerDirective"],"mappings":";;;;;;;SAEgB,QAAQ,CACtB,QAAmB,EACnB,OAAgC,EAChC,UAAkB,EAAA;AAElB,IAAA,IAAI,UAAU,EAAE;QACd,UAAU;aACP,KAAK,CAAC,GAAG,CAAC;AACV,aAAA,OAAO,CAAC,CAAC,SAAS,KACjB,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CACpD,CAAC;AACL,KAAA;AACH,CAAC;SAEe,WAAW,CACzB,QAAmB,EACnB,OAAgC,EAChC,aAAqB,EAAA;AAErB,IAAA,IAAI,aAAa,EAAE;QACjB,aAAa;aACV,KAAK,CAAC,GAAG,CAAC;AACV,aAAA,OAAO,CAAC,CAAC,SAAS,KACjB,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CACvD,CAAC;AACL,KAAA;AACH;;MCfa,eAAe,CAAA;AAH5B,IAAA,WAAA,GAAA;AAIE,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,OAAO,EAA4B,CAAC;KACvD;;4GAFY,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UA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