ngx-virtual-dnd 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-virtual-dnd.mjs","sources":["../../../projects/ngx-virtual-dnd/src/lib/models/drag-drop.models.ts","../../../projects/ngx-virtual-dnd/src/lib/tokens/scroll-container.token.ts","../../../projects/ngx-virtual-dnd/src/lib/tokens/virtual-viewport.token.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-state.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/position-calculator.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/auto-scroll.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/element-clone.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/keyboard-drag.service.ts","../../../projects/ngx-virtual-dnd/src/lib/components/drag-placeholder.component.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/dom-signal-bindings.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-scroll-container.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/drag-preview.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/placeholder.component.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/droppable-group.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/droppable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-sortable-list.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-viewport.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-content.component.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-index-calculator.service.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/draggable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/scrollable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/virtual-for.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/drop-helpers.ts","../../../projects/ngx-virtual-dnd/src/lib/index.ts","../../../projects/ngx-virtual-dnd/src/public-api.ts","../../../projects/ngx-virtual-dnd/src/ngx-virtual-dnd.ts"],"sourcesContent":["/**\n * Represents the item currently being dragged.\n */\nexport interface DraggedItem {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Reference to the dragged element */\n element: HTMLElement;\n /** Cloned element for use in drag preview (auto-generated) */\n clonedElement?: HTMLElement;\n /** Height of the dragged element in pixels */\n height: number;\n /** Width of the dragged element in pixels */\n width: number;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n}\n\n/**\n * Current position of the cursor during drag.\n */\nexport interface CursorPosition {\n x: number;\n y: number;\n}\n\n/**\n * Offset from cursor to the top-left corner of the dragged element.\n * Used to maintain grab position during drag.\n */\nexport interface GrabOffset {\n x: number;\n y: number;\n}\n\n/**\n * Complete state of the drag-and-drop system.\n */\nexport interface DragState {\n /** Whether a drag operation is currently in progress */\n isDragging: boolean;\n /** Information about the item being dragged */\n draggedItem: DraggedItem | null;\n /** ID of the droppable where the drag started */\n sourceDroppableId: string | null;\n /** Original index of the dragged item in the source list */\n sourceIndex: number | null;\n /** ID of the droppable currently being hovered over */\n activeDroppableId: string | null;\n /** ID of the item the placeholder should appear before, or 'END_OF_LIST' */\n placeholderId: string | null;\n /** Index where the placeholder should be inserted (more stable than placeholderId) */\n placeholderIndex: number | null;\n /** Current cursor position */\n cursorPosition: CursorPosition | null;\n /** Offset from cursor to element top-left (for maintaining grab position) */\n grabOffset: GrabOffset | null;\n /** Position when drag started (for axis locking) */\n initialPosition: CursorPosition | null;\n /** Axis to lock movement to ('x' = horizontal only, 'y' = vertical only) */\n lockAxis: 'x' | 'y' | null;\n /** Whether this is a keyboard-initiated drag */\n isKeyboardDrag: boolean;\n /** Target index during keyboard navigation */\n keyboardTargetIndex: number | null;\n}\n\n/**\n * Event emitted when a drag operation starts.\n */\nexport interface DragStartEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n /** Position where the drag started */\n position: CursorPosition;\n /** 0-indexed position in the source list (for screen reader announcements) */\n sourceIndex: number;\n}\n\n/**\n * Event emitted during drag movement.\n */\nexport interface DragMoveEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n sourceDroppableId: string;\n /** ID of the droppable currently being hovered, or null */\n targetDroppableId: string | null;\n /** ID of the item to insert before, or null */\n placeholderId: string | null;\n /** Current cursor position */\n position: CursorPosition;\n /** Current 0-indexed placeholder position (for screen reader announcements) */\n targetIndex: number | null;\n}\n\n/**\n * Event emitted when an item enters a droppable container.\n */\nexport interface DragEnterEvent {\n /** ID of the droppable being entered */\n droppableId: string;\n /** Information about the dragged item */\n draggedItem: DraggedItem;\n}\n\n/**\n * Event emitted when an item leaves a droppable container.\n */\nexport interface DragLeaveEvent {\n /** ID of the droppable being left */\n droppableId: string;\n /** Information about the dragged item */\n draggedItem: DraggedItem;\n}\n\n/**\n * Event emitted while hovering over a droppable container.\n */\nexport interface DragOverEvent {\n /** ID of the droppable being hovered */\n droppableId: string;\n /** Information about the dragged item */\n draggedItem: DraggedItem;\n /** ID of the item the placeholder should appear before */\n placeholderId: string | null;\n /** Current cursor position */\n position: CursorPosition;\n}\n\n/**\n * Source information for a drop event.\n */\nexport interface DropSource {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Original index in the source list */\n index: number;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n}\n\n/**\n * Destination information for a drop event.\n */\nexport interface DropDestination {\n /** ID of the droppable container receiving the item */\n droppableId: string;\n /** ID of the item to insert before, or 'END_OF_LIST' */\n placeholderId: string;\n /** Target index in the destination list */\n index: number;\n /** Optional user-provided data associated with the droppable */\n data?: unknown;\n}\n\n/**\n * Event emitted when an item is dropped.\n */\nexport interface DropEvent {\n /** Information about where the item came from */\n source: DropSource;\n /** Information about where the item is going */\n destination: DropDestination;\n}\n\n/**\n * Event emitted when a drag operation ends (including cancel).\n */\nexport interface DragEndEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Whether the drag was cancelled (escaped, dropped outside) */\n cancelled: boolean;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n /** Original 0-indexed position in source list (for cancel announcements) */\n sourceIndex: number;\n /** Final 0-indexed position (null if cancelled) */\n destinationIndex: number | null;\n}\n\n/**\n * Initial state for the drag state service.\n */\nexport const INITIAL_DRAG_STATE: DragState = {\n isDragging: false,\n draggedItem: null,\n sourceDroppableId: null,\n sourceIndex: null,\n activeDroppableId: null,\n placeholderId: null,\n placeholderIndex: null,\n cursorPosition: null,\n grabOffset: null,\n initialPosition: null,\n lockAxis: null,\n isKeyboardDrag: false,\n keyboardTargetIndex: null,\n};\n\n/**\n * Placeholder ID used when dropping at the end of a list.\n */\nexport const END_OF_LIST = 'END_OF_LIST';\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Interface for a scroll container that can be used with VirtualForDirective.\n * Implement this interface to create custom scroll containers.\n *\n * The scrollTop() and containerHeight() methods should return reactive values\n * (internally backed by signals) so that changes trigger re-computation in\n * the virtual scroll directive.\n */\nexport interface VdndScrollContainer {\n /** The native HTML element that handles scrolling */\n readonly nativeElement: HTMLElement;\n\n /** Current scroll position from top in pixels (reactive) */\n scrollTop(): number;\n\n /** Current container height in pixels (reactive) */\n containerHeight(): number;\n\n /** Scroll to a specific position */\n scrollTo(options: ScrollToOptions): void;\n}\n\n/**\n * Injection token for providing a scroll container to VirtualForDirective.\n *\n * Use the `vdndScrollable` directive to provide this token, or implement\n * `VdndScrollContainer` and provide it manually.\n *\n * @example\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n */\nexport const VDND_SCROLL_CONTAINER = new InjectionToken<VdndScrollContainer>(\n 'VDND_SCROLL_CONTAINER'\n);\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Interface for a virtual viewport that provides wrapper-based positioning.\n * Components implementing this interface provide a content wrapper with\n * GPU-accelerated transform positioning for efficient virtual scrolling.\n */\nexport interface VdndVirtualViewport {\n /** Current scroll position */\n scrollTop(): number;\n\n /** Height of the viewport container */\n containerHeight(): number;\n\n /** Height of each item in pixels */\n itemHeight(): number;\n\n /** Total number of items */\n totalItems(): number;\n\n /** Offset for content below headers (page-level scroll scenarios) */\n contentOffset(): number;\n\n /** The native element of the viewport */\n readonly nativeElement: HTMLElement;\n\n /**\n * Called by VirtualForDirective to inform the viewport of the actual\n * first rendered item index (accounting for overscan). The viewport\n * uses this to position the content wrapper correctly.\n */\n setRenderStartIndex(index: number): void;\n}\n\n/**\n * Injection token for virtual viewport.\n * VirtualForDirective optionally injects this to detect if it's inside\n * a viewport component that handles wrapper-based positioning.\n */\nexport const VDND_VIRTUAL_VIEWPORT = new InjectionToken<VdndVirtualViewport>(\n 'VDND_VIRTUAL_VIEWPORT',\n);\n","import { computed, effect, Injectable, signal } from '@angular/core';\nimport {\n CursorPosition,\n DraggedItem,\n DragState,\n GrabOffset,\n INITIAL_DRAG_STATE,\n} from '../models/drag-drop.models';\n\n/**\n * Central service for managing drag-and-drop state.\n * Uses signals for reactive state management.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DragStateService {\n /** Internal state signal */\n readonly #state = signal<DragState>(INITIAL_DRAG_STATE);\n\n /** Flag indicating if the last drag was cancelled (not dropped) */\n readonly #wasCancelled = signal<boolean>(false);\n\n /** Whether the last drag was cancelled (for droppable to check before emitting drop) */\n readonly wasCancelled = this.#wasCancelled.asReadonly();\n\n /** Read-only access to the full state */\n readonly state = this.#state.asReadonly();\n\n /** Whether a drag operation is in progress */\n readonly isDragging = computed(() => this.#state().isDragging);\n\n /** The currently dragged item, or null */\n readonly draggedItem = computed(() => this.#state().draggedItem);\n\n /** ID of the currently dragged item, or null (convenience signal for filtering) */\n readonly draggedItemId = computed(() => this.#state().draggedItem?.draggableId ?? null);\n\n /** ID of the droppable where the drag started */\n readonly sourceDroppableId = computed(() => this.#state().sourceDroppableId);\n\n /** Original index of the dragged item in the source list */\n readonly sourceIndex = computed(() => this.#state().sourceIndex);\n\n /** ID of the droppable currently being hovered over */\n readonly activeDroppableId = computed(() => this.#state().activeDroppableId);\n\n /** ID of the item the placeholder should appear before */\n readonly placeholderId = computed(() => this.#state().placeholderId);\n\n /** Index where the placeholder should be inserted */\n readonly placeholderIndex = computed(() => this.#state().placeholderIndex);\n\n /** Current cursor position */\n readonly cursorPosition = computed(() => this.#state().cursorPosition);\n\n /** Offset from cursor to element top-left (for maintaining grab position) */\n readonly grabOffset = computed(() => this.#state().grabOffset);\n\n /** Position when drag started (for axis locking) */\n readonly initialPosition = computed(() => this.#state().initialPosition);\n\n /** Axis to lock movement to */\n readonly lockAxis = computed(() => this.#state().lockAxis);\n\n /** Whether this is a keyboard-initiated drag */\n readonly isKeyboardDrag = computed(() => this.#state().isKeyboardDrag);\n\n /** Target index during keyboard navigation */\n readonly keyboardTargetIndex = computed(() => this.#state().keyboardTargetIndex);\n\n constructor() {\n // Inject cursor styles once (for consistent grabbing cursor during drag)\n if (typeof document !== 'undefined') {\n const styleId = 'vdnd-cursor-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n body.vdnd-dragging,\n body.vdnd-dragging * {\n cursor: grabbing !important;\n }\n `;\n document.head.appendChild(style);\n }\n }\n\n // Effect to toggle body class during drag\n effect(() => {\n if (typeof document === 'undefined') return;\n const isDragging = this.isDragging();\n document.body.classList.toggle('vdnd-dragging', isDragging);\n });\n }\n\n /**\n * Start a drag operation.\n */\n startDrag(\n item: DraggedItem,\n cursorPosition?: CursorPosition,\n grabOffset?: GrabOffset,\n lockAxis?: 'x' | 'y' | null,\n activeDroppableId?: string | null,\n placeholderId?: string | null,\n placeholderIndex?: number | null,\n sourceIndex?: number | null,\n isKeyboardDrag?: boolean,\n axisLockPosition?: CursorPosition,\n ): void {\n // Reset cancellation flag at start of new drag\n this.#wasCancelled.set(false);\n this.#state.set({\n isDragging: true,\n draggedItem: item,\n sourceDroppableId: item.droppableId,\n sourceIndex: sourceIndex ?? null,\n activeDroppableId: activeDroppableId ?? null,\n placeholderId: placeholderId ?? null,\n placeholderIndex: placeholderIndex ?? null,\n cursorPosition: cursorPosition ?? null,\n grabOffset: grabOffset ?? null,\n initialPosition: axisLockPosition ?? cursorPosition ?? null,\n lockAxis: lockAxis ?? null,\n isKeyboardDrag: isKeyboardDrag ?? false,\n keyboardTargetIndex: isKeyboardDrag ? (sourceIndex ?? 0) : null,\n });\n }\n\n /**\n * Update the drag position and targets.\n */\n updateDragPosition(update: {\n cursorPosition: CursorPosition;\n activeDroppableId: string | null;\n placeholderId: string | null;\n placeholderIndex: number | null;\n }): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#state.update((state) => ({\n ...state,\n cursorPosition: update.cursorPosition,\n activeDroppableId: update.activeDroppableId,\n placeholderId: update.placeholderId,\n placeholderIndex: update.placeholderIndex,\n }));\n }\n\n /**\n * Update just the active droppable.\n */\n setActiveDroppable(droppableId: string | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#state.update((state) => ({\n ...state,\n activeDroppableId: droppableId,\n }));\n }\n\n /**\n * Update just the placeholder position.\n */\n setPlaceholder(placeholderId: string | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#state.update((state) => ({\n ...state,\n placeholderId,\n }));\n }\n\n /**\n * End the drag operation and reset state (normal drop).\n */\n endDrag(): void {\n this.#wasCancelled.set(false);\n this.#state.set(INITIAL_DRAG_STATE);\n }\n\n /**\n * Cancel the drag operation (escape key, disabled, etc.).\n */\n cancelDrag(): void {\n this.#wasCancelled.set(true);\n this.#state.set(INITIAL_DRAG_STATE);\n }\n\n /**\n * Check if a specific droppable is currently active.\n */\n isDroppableActive(droppableId: string): boolean {\n return this.#state().activeDroppableId === droppableId;\n }\n\n /**\n * Get the current state snapshot (for event creation).\n */\n getStateSnapshot(): DragState {\n return this.#state();\n }\n\n /**\n * Update the keyboard target index (for keyboard drag navigation).\n * Also updates placeholder position to match, applying same-list adjustment.\n */\n setKeyboardTargetIndex(targetIndex: number): void {\n if (!this.#state().isDragging || !this.#state().isKeyboardDrag) {\n return;\n }\n\n this.#state.update((state) => {\n // Same-list adjustment: if target is at or after source, add 1\n // This accounts for the hidden item shifting everything up visually\n const sourceDroppableId = state.draggedItem?.droppableId;\n const activeDroppableId = state.activeDroppableId;\n const isSameList = sourceDroppableId === activeDroppableId;\n const sourceIndex = state.sourceIndex ?? -1;\n\n let placeholderIndex = targetIndex;\n if (isSameList && sourceIndex >= 0 && targetIndex >= sourceIndex) {\n placeholderIndex = targetIndex + 1;\n }\n\n return {\n ...state,\n keyboardTargetIndex: targetIndex,\n placeholderIndex,\n };\n });\n }\n\n /**\n * Update the active droppable during keyboard navigation (for cross-list moves).\n */\n setKeyboardActiveDroppable(droppableId: string | null, targetIndex: number): void {\n if (!this.#state().isDragging || !this.#state().isKeyboardDrag) {\n return;\n }\n\n this.#state.update((state) => {\n // Same-list adjustment: if moving back to source list and target is at or after source, add 1\n const sourceDroppableId = state.draggedItem?.droppableId;\n const isSameList = sourceDroppableId === droppableId;\n const sourceIndex = state.sourceIndex ?? -1;\n\n let placeholderIndex = targetIndex;\n if (isSameList && sourceIndex >= 0 && targetIndex >= sourceIndex) {\n placeholderIndex = targetIndex + 1;\n }\n\n return {\n ...state,\n activeDroppableId: droppableId,\n keyboardTargetIndex: targetIndex,\n placeholderIndex,\n };\n });\n }\n}\n","import { Injectable, isDevMode } from '@angular/core';\n\n/**\n * Service for calculating drop positions and finding elements at cursor positions.\n * This is the core algorithm that makes virtual scroll + drag-and-drop work together.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class PositionCalculatorService {\n /** Data attribute used to identify droppable elements */\n readonly #DROPPABLE_ID_ATTR = 'data-droppable-id';\n\n /** Data attribute used to identify droppable groups */\n readonly #DROPPABLE_GROUP_ATTR = 'data-droppable-group';\n\n /** Data attribute used to identify draggable elements */\n readonly #DRAGGABLE_ID_ATTR = 'data-draggable-id';\n\n /** Maximum DOM levels to traverse when looking for parent elements */\n readonly #MAX_PARENT_TRAVERSAL = 15;\n\n /**\n * Find the droppable element at a given point.\n *\n * This works by temporarily hiding the dragged element, then using\n * document.elementFromPoint to find what's underneath the cursor.\n *\n * @param x - Cursor X coordinate\n * @param y - Cursor Y coordinate\n * @param draggedElement - The element being dragged (will be temporarily hidden)\n * @param groupName - The drag-and-drop group name to filter by\n * @returns The droppable element, or null if none found\n */\n findDroppableAtPoint(\n x: number,\n y: number,\n draggedElement: HTMLElement,\n groupName: string,\n ): HTMLElement | null {\n // Temporarily hide the dragged element to \"see through\" it\n const originalPointerEvents = draggedElement.style.pointerEvents;\n draggedElement.style.pointerEvents = 'none';\n\n try {\n const elementAtPoint = document.elementFromPoint(x, y);\n if (!elementAtPoint) {\n return null;\n }\n\n return this.getDroppableParent(elementAtPoint as HTMLElement, groupName);\n } finally {\n // Always restore pointer events\n draggedElement.style.pointerEvents = originalPointerEvents;\n }\n }\n\n /**\n * Find the draggable element at a given point.\n *\n * @param x - Cursor X coordinate\n * @param y - Cursor Y coordinate\n * @param draggedElement - The element being dragged (will be temporarily hidden)\n * @returns The draggable element, or null if none found\n */\n findDraggableAtPoint(x: number, y: number, draggedElement: HTMLElement): HTMLElement | null {\n // Temporarily hide the dragged element\n const originalPointerEvents = draggedElement.style.pointerEvents;\n draggedElement.style.pointerEvents = 'none';\n\n try {\n const elementAtPoint = document.elementFromPoint(x, y);\n if (!elementAtPoint) {\n return null;\n }\n\n return this.getDraggableParent(elementAtPoint as HTMLElement);\n } finally {\n draggedElement.style.pointerEvents = originalPointerEvents;\n }\n }\n\n /**\n * Walk up the DOM tree to find a droppable parent element.\n *\n * @param element - Starting element\n * @param groupName - The drag-and-drop group name to filter by\n * @returns The droppable parent element, or null if none found\n */\n getDroppableParent(element: HTMLElement, groupName: string): HTMLElement | null {\n let current: HTMLElement | null = element;\n let count = 0;\n\n while (current && current.tagName !== 'BODY' && count < this.#MAX_PARENT_TRAVERSAL) {\n const foundGroup = current.getAttribute(this.#DROPPABLE_GROUP_ATTR);\n\n if (foundGroup && foundGroup === groupName) {\n return current;\n }\n\n current = current.parentElement;\n count++;\n }\n\n return null;\n }\n\n /**\n * Walk up the DOM tree to find a draggable parent element.\n *\n * @param element - Starting element\n * @returns The draggable parent element, or null if none found\n */\n getDraggableParent(element: HTMLElement): HTMLElement | null {\n let current: HTMLElement | null = element;\n let count = 0;\n\n while (current && current.tagName !== 'BODY' && count < this.#MAX_PARENT_TRAVERSAL) {\n const draggableId = current.getAttribute(this.#DRAGGABLE_ID_ATTR);\n\n if (draggableId) {\n return current;\n }\n\n current = current.parentElement;\n count++;\n }\n\n return null;\n }\n\n /**\n * Get the draggable ID from an element.\n */\n getDraggableId(element: HTMLElement): string | null {\n return element.getAttribute(this.#DRAGGABLE_ID_ATTR);\n }\n\n /**\n * Get the droppable ID from an element.\n */\n getDroppableId(element: HTMLElement): string | null {\n return element.getAttribute(this.#DROPPABLE_ID_ATTR);\n }\n\n /**\n * Calculate the drop index based on mathematical position.\n *\n * This is an alternative approach that doesn't require the target element\n * to be in the DOM. Useful when the target might be virtualized away.\n *\n * @param scrollTop - Current scroll position of the container\n * @param cursorY - Cursor Y position (viewport-relative)\n * @param containerTop - Top position of the container (viewport-relative)\n * @param itemHeight - Height of each item\n * @param totalItems - Total number of items in the list\n * @returns The calculated drop index\n */\n calculateDropIndex(\n scrollTop: number,\n cursorY: number,\n containerTop: number,\n itemHeight: number,\n totalItems: number,\n ): number {\n // Calculate the position relative to the container's content\n const relativeY = cursorY - containerTop + scrollTop;\n\n // Calculate which item index this corresponds to\n const index = Math.floor(relativeY / itemHeight);\n\n // Clamp to valid range\n return Math.max(0, Math.min(index, totalItems));\n }\n\n /**\n * Check if a point is within a specific threshold of a container's edge.\n *\n * @param position - Current cursor position\n * @param containerRect - Container's bounding rect\n * @param threshold - Distance from edge to trigger (in pixels)\n * @returns Object indicating which edges are near\n */\n getNearEdge(\n position: { x: number; y: number },\n containerRect: DOMRect,\n threshold: number,\n ): { top: boolean; bottom: boolean; left: boolean; right: boolean } {\n return {\n top: position.y - containerRect.top <= threshold,\n bottom: containerRect.bottom - position.y <= threshold,\n left: position.x - containerRect.left <= threshold,\n right: containerRect.right - position.x <= threshold,\n };\n }\n\n /**\n * Determine if the cursor is inside a container.\n */\n isInsideContainer(position: { x: number; y: number }, containerRect: DOMRect): boolean {\n return (\n position.x >= containerRect.left &&\n position.x <= containerRect.right &&\n position.y >= containerRect.top &&\n position.y <= containerRect.bottom\n );\n }\n\n /**\n * Find an adjacent droppable in the specified direction (left or right).\n * Used for cross-list keyboard navigation.\n *\n * @param currentDroppableId - The ID of the current droppable\n * @param direction - 'left' or 'right'\n * @param groupName - The drag-and-drop group name\n * @returns Object with droppable info, or null if none found\n */\n findAdjacentDroppable(\n currentDroppableId: string,\n direction: 'left' | 'right',\n groupName: string,\n ): { element: HTMLElement; id: string; itemCount: number } | null {\n // Find all droppables in the same group\n const allDroppables = document.querySelectorAll(\n `[${this.#DROPPABLE_GROUP_ATTR}=\"${groupName}\"]`,\n );\n\n if (allDroppables.length <= 1) {\n return null;\n }\n\n // Get bounding rects and IDs, sorted by X position\n const droppableInfos: { element: HTMLElement; id: string; rect: DOMRect }[] = [];\n\n allDroppables.forEach((el) => {\n const htmlEl = el as HTMLElement;\n const id = htmlEl.getAttribute(this.#DROPPABLE_ID_ATTR);\n if (id) {\n droppableInfos.push({\n element: htmlEl,\n id,\n rect: htmlEl.getBoundingClientRect(),\n });\n }\n });\n\n // Sort by X position (left to right)\n droppableInfos.sort((a, b) => a.rect.left - b.rect.left);\n\n // Find current droppable index\n const currentIndex = droppableInfos.findIndex((d) => d.id === currentDroppableId);\n if (currentIndex === -1) {\n return null;\n }\n\n // Get the adjacent droppable\n const targetIndex = direction === 'left' ? currentIndex - 1 : currentIndex + 1;\n if (targetIndex < 0 || targetIndex >= droppableInfos.length) {\n return null;\n }\n\n const target = droppableInfos[targetIndex];\n\n // Get item count from the target droppable\n const itemCount = this.#getDroppableItemCount(target.element);\n\n return {\n element: target.element,\n id: target.id,\n itemCount,\n };\n }\n\n /**\n * Get the total item count in a droppable.\n * Uses virtual scroll data attribute if available, otherwise counts DOM elements.\n */\n #getDroppableItemCount(droppableElement: HTMLElement): number {\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n if (virtualScroll) {\n const scrollHeight = (virtualScroll as HTMLElement).scrollHeight;\n const configuredHeight = virtualScroll.getAttribute('data-item-height');\n\n if (!configuredHeight) {\n if (isDevMode()) {\n console.error(\n '[ngx-virtual-dnd] vdnd-virtual-scroll requires data-item-height attribute ' +\n 'for keyboard navigation. Cross-list keyboard drag will not work correctly.',\n );\n }\n // Short-circuit: return 0 to prevent navigation to this droppable\n return 0;\n }\n\n const itemHeight = parseInt(configuredHeight, 10);\n return Math.floor(scrollHeight / itemHeight);\n }\n // Fallback for non-virtual scroll: DOM count is valid\n return droppableElement.querySelectorAll(`[${this.#DRAGGABLE_ID_ATTR}]`).length;\n }\n}\n","import { inject, Injectable, NgZone } from '@angular/core';\nimport { DragStateService } from './drag-state.service';\nimport { PositionCalculatorService } from './position-calculator.service';\n\n/**\n * Configuration for auto-scroll behavior.\n */\nexport interface AutoScrollConfig {\n /** Distance from edge to start scrolling (in pixels) */\n threshold: number;\n /** Maximum scroll speed (in pixels per frame) */\n maxSpeed: number;\n /** Whether to accelerate scroll based on distance from edge */\n accelerate: boolean;\n}\n\n/**\n * Default auto-scroll configuration.\n */\nconst DEFAULT_CONFIG: AutoScrollConfig = {\n threshold: 50,\n maxSpeed: 15,\n accelerate: true,\n};\n\n/**\n * Service that handles auto-scrolling when dragging near container edges.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AutoScrollService {\n readonly #dragState = inject(DragStateService);\n readonly #positionCalculator = inject(PositionCalculatorService);\n readonly #ngZone = inject(NgZone);\n\n /** Currently registered scrollable containers */\n #scrollableContainers = new Map<\n string,\n {\n element: HTMLElement;\n config: AutoScrollConfig;\n }\n >();\n\n /** Active animation frame ID */\n #animationFrameId: number | null = null;\n\n /** Callback to invoke when scrolling occurs (for placeholder recalculation) */\n #onScrollCallback: (() => void) | null = null;\n\n /** Current scroll state */\n #scrollState: {\n containerId: string | null;\n direction: { x: number; y: number };\n speed: number;\n } = {\n containerId: null,\n direction: { x: 0, y: 0 },\n speed: 0,\n };\n\n /**\n * Register a scrollable container for auto-scrolling.\n */\n registerContainer(\n id: string,\n element: HTMLElement,\n config: Partial<AutoScrollConfig> = {},\n ): void {\n this.#scrollableContainers.set(id, {\n element,\n config: { ...DEFAULT_CONFIG, ...config },\n });\n }\n\n /**\n * Unregister a scrollable container.\n */\n unregisterContainer(id: string): void {\n this.#scrollableContainers.delete(id);\n }\n\n /**\n * Start monitoring for auto-scroll.\n * Call this when a drag starts.\n * @param onScroll Optional callback to invoke when scrolling occurs (for placeholder recalculation)\n */\n startMonitoring(onScroll?: () => void): void {\n if (this.#animationFrameId !== null) {\n return;\n }\n\n this.#onScrollCallback = onScroll ?? null;\n\n this.#ngZone.runOutsideAngular(() => {\n this.#tick();\n });\n }\n\n /**\n * Stop monitoring for auto-scroll.\n * Call this when a drag ends.\n */\n stopMonitoring(): void {\n if (this.#animationFrameId !== null) {\n cancelAnimationFrame(this.#animationFrameId);\n this.#animationFrameId = null;\n }\n\n this.#onScrollCallback = null;\n this.#scrollState = {\n containerId: null,\n direction: { x: 0, y: 0 },\n speed: 0,\n };\n }\n\n /**\n * Animation tick - check cursor position and scroll if needed.\n */\n #tick(): void {\n const cursor = this.#dragState.cursorPosition();\n const isDragging = this.#dragState.isDragging();\n\n // Stop monitoring if drag ended\n if (!isDragging) {\n this.stopMonitoring();\n return;\n }\n\n // Skip this frame if no cursor position yet, but continue monitoring\n if (!cursor) {\n this.#animationFrameId = requestAnimationFrame(() => this.#tick());\n return;\n }\n\n let scrollPerformed = false;\n\n // Check each container\n for (const [id, { element, config }] of this.#scrollableContainers) {\n const rect = element.getBoundingClientRect();\n\n // Check if cursor is inside this container\n const isInside = this.#positionCalculator.isInsideContainer(cursor, rect);\n\n if (!isInside) {\n continue;\n }\n\n // Check edges\n const nearEdge = this.#positionCalculator.getNearEdge(cursor, rect, config.threshold);\n\n // Calculate scroll direction and speed\n const direction = { x: 0, y: 0 };\n let maxDistance = 0;\n\n if (nearEdge.top) {\n direction.y = -1;\n maxDistance = Math.max(maxDistance, config.threshold - (cursor.y - rect.top));\n } else if (nearEdge.bottom) {\n direction.y = 1;\n maxDistance = Math.max(maxDistance, config.threshold - (rect.bottom - cursor.y));\n }\n\n if (nearEdge.left) {\n direction.x = -1;\n maxDistance = Math.max(maxDistance, config.threshold - (cursor.x - rect.left));\n } else if (nearEdge.right) {\n direction.x = 1;\n maxDistance = Math.max(maxDistance, config.threshold - (rect.right - cursor.x));\n }\n\n // If near an edge, start scrolling\n if (direction.x !== 0 || direction.y !== 0) {\n // Calculate speed (accelerate based on distance from edge)\n let speed = config.maxSpeed;\n if (config.accelerate) {\n const distanceRatio = maxDistance / config.threshold;\n speed = Math.min(config.maxSpeed, Math.max(1, config.maxSpeed * distanceRatio));\n }\n\n this.#scrollState = { containerId: id, direction, speed };\n this.#performScroll(element, direction, speed);\n scrollPerformed = true;\n break;\n }\n }\n\n // Reset scroll state if no scrolling was performed\n if (!scrollPerformed) {\n this.#scrollState = {\n containerId: null,\n direction: { x: 0, y: 0 },\n speed: 0,\n };\n }\n\n this.#animationFrameId = requestAnimationFrame(() => this.#tick());\n }\n\n /**\n * Perform the actual scroll operation.\n */\n #performScroll(element: HTMLElement, direction: { x: number; y: number }, speed: number): void {\n const scrollX = direction.x * speed;\n const scrollY = direction.y * speed;\n\n // Check bounds before scrolling\n const maxScrollY = element.scrollHeight - element.clientHeight;\n const maxScrollX = element.scrollWidth - element.clientWidth;\n\n if (direction.y < 0 && element.scrollTop <= 0) {\n return;\n }\n if (direction.y > 0 && element.scrollTop >= maxScrollY) {\n return;\n }\n if (direction.x < 0 && element.scrollLeft <= 0) {\n return;\n }\n if (direction.x > 0 && element.scrollLeft >= maxScrollX) {\n return;\n }\n\n // Use direct property assignment for guaranteed synchronous scroll\n // scrollBy() with 'instant' behavior may have async issues in Safari\n if (scrollY !== 0) {\n element.scrollTop += scrollY;\n }\n if (scrollX !== 0) {\n element.scrollLeft += scrollX;\n }\n\n // Notify callback IMMEDIATELY in the same frame (no RAF delay)\n // Delaying via RAF causes cumulative drift during continuous autoscroll\n // because multiple scrolls happen before each delayed callback runs.\n // Note: No ngZone.run() needed here - the callback (DraggableDirective.#recalculatePlaceholder)\n // already enters the zone when updating drag state.\n this.#onScrollCallback?.();\n }\n\n /**\n * Check if auto-scrolling is currently active.\n */\n isScrolling(): boolean {\n return (\n this.#scrollState.containerId !== null &&\n (this.#scrollState.direction.x !== 0 || this.#scrollState.direction.y !== 0)\n );\n }\n\n /**\n * Get the current scroll direction.\n */\n getScrollDirection(): { x: number; y: number } {\n return this.#scrollState.direction;\n }\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * Service for cloning DOM elements with their computed styles.\n * Used to create visual copies of dragged elements for the drag preview.\n */\n@Injectable({ providedIn: 'root' })\nexport class ElementCloneService {\n /**\n * CSS properties to copy from source to clone.\n * These are the visual properties that affect appearance.\n */\n readonly #stylesToCopy = [\n 'background',\n 'backgroundColor',\n 'backgroundImage',\n 'border',\n 'borderRadius',\n 'boxShadow',\n 'color',\n 'font',\n 'fontFamily',\n 'fontSize',\n 'fontWeight',\n 'lineHeight',\n 'padding',\n 'margin',\n 'display',\n 'flexDirection',\n 'alignItems',\n 'justifyContent',\n 'gap',\n 'textAlign',\n 'textDecoration',\n 'width',\n 'height',\n 'minWidth',\n 'minHeight',\n 'maxWidth',\n 'maxHeight',\n 'overflow',\n 'opacity',\n 'transform',\n 'boxSizing',\n ];\n\n /**\n * Clone an element with its computed styles.\n * Returns an HTMLElement ready for use as a drag preview.\n */\n cloneElement(source: HTMLElement): HTMLElement {\n const clone = source.cloneNode(true) as HTMLElement;\n\n // Apply computed styles as inline styles\n this.#applyComputedStyles(source, clone);\n\n // Handle special elements (canvas, video, etc.)\n this.#handleSpecialElements(source, clone);\n\n // Sanitize the clone for safe use as preview\n this.#sanitizeClone(clone);\n\n return clone;\n }\n\n /**\n * Apply computed styles from source to target element.\n * Recursively applies to all child elements.\n */\n #applyComputedStyles(source: HTMLElement, target: HTMLElement): void {\n const computed = window.getComputedStyle(source);\n\n // Copy essential visual properties\n for (const prop of this.#stylesToCopy) {\n const value = computed.getPropertyValue(this.#camelToKebab(prop));\n if (value) {\n target.style.setProperty(this.#camelToKebab(prop), value);\n }\n }\n\n // Disable animations and transitions on clone\n target.style.animation = 'none';\n target.style.transition = 'none';\n\n // Recursively apply to children\n const sourceChildren = source.children;\n const targetChildren = target.children;\n\n for (let i = 0; i < sourceChildren.length && i < targetChildren.length; i++) {\n const sourceChild = sourceChildren[i];\n const targetChild = targetChildren[i];\n\n if (sourceChild instanceof HTMLElement && targetChild instanceof HTMLElement) {\n this.#applyComputedStyles(sourceChild, targetChild);\n }\n }\n }\n\n /**\n * Handle special elements that require extra processing.\n */\n #handleSpecialElements(source: HTMLElement, clone: HTMLElement): void {\n // Handle canvas elements - copy current content\n const sourceCanvases = source.querySelectorAll('canvas');\n const cloneCanvases = clone.querySelectorAll('canvas');\n\n sourceCanvases.forEach((srcCanvas, i) => {\n const cloneCanvas = cloneCanvases[i] as HTMLCanvasElement;\n if (cloneCanvas) {\n const ctx = cloneCanvas.getContext('2d');\n if (ctx) {\n cloneCanvas.width = srcCanvas.width;\n cloneCanvas.height = srcCanvas.height;\n ctx.drawImage(srcCanvas, 0, 0);\n }\n }\n });\n\n // Handle video elements - replace with poster or placeholder\n const videos = clone.querySelectorAll('video');\n videos.forEach((video) => {\n const poster = video.poster;\n if (poster) {\n const img = document.createElement('img');\n img.src = poster;\n img.style.width = '100%';\n img.style.height = '100%';\n img.style.objectFit = 'cover';\n video.replaceWith(img);\n } else {\n // Create a placeholder\n const placeholder = document.createElement('div');\n placeholder.style.cssText = `\n width: 100%;\n height: 100%;\n background: #333;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666;\n `;\n placeholder.textContent = 'Video';\n video.replaceWith(placeholder);\n }\n });\n\n // Handle iframes - replace with placeholder\n const iframes = clone.querySelectorAll('iframe');\n iframes.forEach((iframe) => {\n const placeholder = document.createElement('div');\n const iframeStyles = window.getComputedStyle(iframe);\n placeholder.style.width = iframeStyles.width;\n placeholder.style.height = iframeStyles.height;\n placeholder.style.background = '#f0f0f0';\n placeholder.style.border = '1px solid #ddd';\n placeholder.style.display = 'flex';\n placeholder.style.alignItems = 'center';\n placeholder.style.justifyContent = 'center';\n placeholder.style.color = '#999';\n placeholder.textContent = 'Embedded content';\n iframe.replaceWith(placeholder);\n });\n }\n\n /**\n * Sanitize the clone to prevent interaction issues.\n */\n #sanitizeClone(clone: HTMLElement): void {\n // Remove draggable directive attributes\n clone.removeAttribute('vdndDraggable');\n clone.removeAttribute('data-draggable-id');\n clone.removeAttribute('data-droppable-id');\n\n // Remove Angular-specific attributes\n const angularAttrs = Array.from(clone.attributes).filter(\n (attr) => attr.name.startsWith('ng-') || attr.name.startsWith('_ng')\n );\n angularAttrs.forEach((attr) => clone.removeAttribute(attr.name));\n\n // Process all descendant elements\n const allElements = clone.querySelectorAll('*');\n allElements.forEach((el) => {\n if (!(el instanceof HTMLElement)) return;\n\n // Remove event-related attributes\n const attrs = Array.from(el.attributes);\n attrs.forEach((attr) => {\n if (\n attr.name.startsWith('on') ||\n attr.name.startsWith('(') ||\n attr.name.startsWith('ng-') ||\n attr.name.startsWith('_ng')\n ) {\n el.removeAttribute(attr.name);\n }\n });\n\n // Remove draggable attributes from children too\n el.removeAttribute('vdndDraggable');\n el.removeAttribute('data-draggable-id');\n el.removeAttribute('data-droppable-id');\n });\n\n // Disable interactive elements\n const interactiveElements = clone.querySelectorAll(\n 'button, input, textarea, select, a, [contenteditable]'\n );\n interactiveElements.forEach((el) => {\n if (el instanceof HTMLElement) {\n el.style.pointerEvents = 'none';\n el.setAttribute('tabindex', '-1');\n el.setAttribute('aria-hidden', 'true');\n el.setAttribute('disabled', 'true');\n }\n });\n\n // Remove focus styling classes that might interfere\n clone.classList.remove('vdnd-draggable-dragging');\n clone.classList.remove('vdnd-draggable-disabled');\n }\n\n /**\n * Convert camelCase to kebab-case for CSS properties.\n */\n #camelToKebab(str: string): string {\n return str.replace(/([A-Z])/g, '-$1').toLowerCase();\n }\n}\n","import { computed, inject, Injectable, signal } from '@angular/core';\nimport { DragStateService } from './drag-state.service';\nimport { DraggedItem, END_OF_LIST, GrabOffset } from '../models/drag-drop.models';\n\n/**\n * Service for managing keyboard-initiated drag operations.\n * Works in conjunction with DragStateService to provide keyboard drag functionality.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class KeyboardDragService {\n readonly #dragState = inject(DragStateService);\n\n /** Total item count for the current droppable (set by droppable on keyboard drag start) */\n readonly #totalItemCount = signal<number>(0);\n\n /** Whether a keyboard drag is currently active */\n readonly isActive = computed(\n () => this.#dragState.isKeyboardDrag() && this.#dragState.isDragging(),\n );\n\n /** Current target index during keyboard navigation */\n readonly targetIndex = computed(() => this.#dragState.keyboardTargetIndex());\n\n /** Source index where the drag started */\n readonly sourceIndex = computed(() => this.#dragState.sourceIndex());\n\n /** Current active droppable ID */\n readonly activeDroppableId = computed(() => this.#dragState.activeDroppableId());\n\n /**\n * Start a keyboard drag operation.\n */\n startKeyboardDrag(\n item: DraggedItem,\n sourceIndex: number,\n totalItemCount: number,\n activeDroppableId: string,\n ): void {\n this.#totalItemCount.set(totalItemCount);\n\n // For keyboard drag, we position the preview at the element's location\n // We use a grab offset of 0,0 since we're not grabbing at a specific point\n const grabOffset: GrabOffset = { x: 0, y: 0 };\n\n // Get the element's position for the cursor position\n // This positions the preview at the element's original location\n const rect = item.element.getBoundingClientRect();\n const cursorPosition = { x: rect.left, y: rect.top };\n\n // Same-list adjustment: at start, targetIndex equals sourceIndex\n // Since sourceIndex >= sourceIndex is always true, add 1 to placeholderIndex\n // This accounts for the hidden item shifting everything up visually\n const initialPlaceholderIndex = sourceIndex + 1;\n\n this.#dragState.startDrag(\n item,\n cursorPosition,\n grabOffset,\n null, // no axis lock for keyboard drag\n activeDroppableId,\n END_OF_LIST,\n initialPlaceholderIndex,\n sourceIndex,\n true, // isKeyboardDrag\n );\n }\n\n /**\n * Move to a specific index during keyboard drag.\n * Returns the clamped target index.\n */\n moveToIndex(targetIndex: number): number {\n if (!this.isActive()) {\n return targetIndex;\n }\n\n const totalItems = this.#totalItemCount();\n const clampedIndex = Math.max(0, Math.min(targetIndex, totalItems));\n\n this.#dragState.setKeyboardTargetIndex(clampedIndex);\n\n return clampedIndex;\n }\n\n /**\n * Move up by one position (ArrowUp).\n * Returns the new target index.\n */\n moveUp(): number {\n const currentTarget = this.targetIndex() ?? 0;\n return this.moveToIndex(currentTarget - 1);\n }\n\n /**\n * Move down by one position (ArrowDown).\n * Returns the new target index.\n */\n moveDown(): number {\n const currentTarget = this.targetIndex() ?? 0;\n return this.moveToIndex(currentTarget + 1);\n }\n\n /**\n * Move to an adjacent droppable (ArrowLeft/ArrowRight).\n * The droppable registry is managed externally.\n */\n moveToDroppable(droppableId: string, targetIndex: number, totalItemCount: number): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#totalItemCount.set(totalItemCount);\n const clampedIndex = Math.max(0, Math.min(targetIndex, totalItemCount));\n this.#dragState.setKeyboardActiveDroppable(droppableId, clampedIndex);\n }\n\n /**\n * Complete the keyboard drag (Space or Enter to drop).\n */\n completeKeyboardDrag(): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#dragState.endDrag();\n }\n\n /**\n * Cancel the keyboard drag (Escape).\n */\n cancelKeyboardDrag(): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#dragState.cancelDrag();\n }\n\n /**\n * Update the total item count (when navigating to a new list).\n */\n setTotalItemCount(count: number): void {\n this.#totalItemCount.set(count);\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/**\n * Renders an empty placeholder that takes up space in the document flow.\n *\n * This component is used internally by virtual scroll containers to show\n * where an item will be dropped. It's rendered inline with items and\n * takes up the same vertical space as an item.\n *\n * The placeholder is just empty space - no borders, no background.\n * Consumers can style it via CSS if desired.\n */\n@Component({\n selector: 'vdnd-drag-placeholder',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'vdnd-drag-placeholder vdnd-drag-placeholder-visible',\n '[style.display]': '\"block\"',\n '[style.height.px]': 'itemHeight()',\n '[style.pointer-events]': '\"none\"',\n },\n template: ``,\n})\nexport class DragPlaceholderComponent {\n /** Item height for sizing */\n itemHeight = input.required<number>();\n}\n","import { NgZone, type WritableSignal } from '@angular/core';\n\nexport function bindRafThrottledScrollTopSignal(options: {\n element: HTMLElement;\n ngZone: NgZone;\n scrollTop: WritableSignal<number>;\n thresholdPx?: number;\n onCommit?: (scrollTop: number) => void;\n}): () => void {\n const { element, ngZone, scrollTop, thresholdPx = 5, onCommit } = options;\n\n let pendingRaf: number | null = null;\n let lastCommittedScrollTop = element.scrollTop;\n\n const onScroll = () => {\n if (pendingRaf !== null) {\n return;\n }\n\n const currentScrollTop = element.scrollTop;\n if (Math.abs(currentScrollTop - lastCommittedScrollTop) < thresholdPx) {\n return;\n }\n\n pendingRaf = requestAnimationFrame(() => {\n pendingRaf = null;\n const finalScrollTop = element.scrollTop;\n if (Math.abs(finalScrollTop - lastCommittedScrollTop) >= thresholdPx) {\n lastCommittedScrollTop = finalScrollTop;\n scrollTop.set(finalScrollTop);\n onCommit?.(finalScrollTop);\n }\n });\n };\n\n ngZone.runOutsideAngular(() => {\n element.addEventListener('scroll', onScroll, { passive: true });\n });\n\n scrollTop.set(lastCommittedScrollTop);\n\n return () => {\n if (pendingRaf !== null) {\n cancelAnimationFrame(pendingRaf);\n pendingRaf = null;\n }\n element.removeEventListener('scroll', onScroll);\n };\n}\n\nexport function bindResizeObserverHeightSignal(options: {\n element: HTMLElement;\n ngZone: NgZone;\n height: WritableSignal<number>;\n minDeltaPx?: number;\n}): () => void {\n const { element, ngZone, height, minDeltaPx = 1 } = options;\n\n if (typeof ResizeObserver === 'undefined') {\n height.set(element.clientHeight);\n return () => undefined;\n }\n\n let observer: ResizeObserver | null = null;\n\n ngZone.runOutsideAngular(() => {\n observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const nextHeight = entry.contentRect.height;\n if (Math.abs(nextHeight - height()) > minDeltaPx) {\n height.set(nextHeight);\n }\n }\n });\n observer.observe(element);\n });\n\n height.set(element.clientHeight);\n\n return () => {\n observer?.disconnect();\n observer = null;\n };\n}\n","import {\n afterNextRender,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n output,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { DragStateService } from '../services/drag-state.service';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport { DragPlaceholderComponent } from './drag-placeholder.component';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\n\n/**\n * Context provided to the item template.\n */\nexport interface VirtualScrollItemContext<T> {\n /** The item data */\n $implicit: T;\n /** The item's index in the original array */\n index: number;\n /** Whether this item is \"sticky\" (always rendered) */\n isSticky: boolean;\n}\n\n/**\n * Event emitted when the visible range changes.\n */\nexport interface VisibleRangeChange {\n start: number;\n end: number;\n}\n\n/**\n * A virtual scroll container that only renders visible items.\n *\n * Key features:\n * - Only renders items within the visible viewport plus an overscan buffer\n * - Supports \"sticky\" items that are always rendered (used for dragged items)\n * - Uses spacer divs to maintain correct scroll height\n * - Integrates with the drag-and-drop system\n * - Automatic height detection via ResizeObserver when containerHeight is not provided\n *\n * @example\n * ```html\n * <!-- With explicit height -->\n * <vdnd-virtual-scroll\n * [items]=\"items()\"\n * [itemHeight]=\"50\"\n * [containerHeight]=\"400\"\n * [trackByFn]=\"trackById\">\n * <ng-template let-item let-index=\"index\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-template>\n * </vdnd-virtual-scroll>\n *\n * <!-- With CSS-based height (auto-detected) -->\n * <vdnd-virtual-scroll\n * style=\"height: 100%\"\n * [items]=\"items()\"\n * [itemHeight]=\"50\"\n * [trackByFn]=\"trackById\">\n * <ng-template let-item let-index=\"index\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-template>\n * </vdnd-virtual-scroll>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-scroll',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, DragPlaceholderComponent],\n host: {\n class: 'vdnd-virtual-scroll',\n '[style.height.px]': 'containerHeight() ?? null',\n '[style.overflow]': '\"auto\"',\n '[style.position]': '\"relative\"',\n '[attr.data-item-height]': 'itemHeight()',\n },\n template: `\n <div class=\"vdnd-virtual-scroll-content\">\n <!-- Single spacer maintains scroll height -->\n <div class=\"vdnd-virtual-scroll-spacer\" [style.height.px]=\"totalHeight()\"></div>\n\n <!-- Content wrapper positioned via GPU-accelerated transform -->\n <div class=\"vdnd-virtual-scroll-content-wrapper\" [style.transform]=\"contentTransform()\">\n @for (entry of renderedItems(); track trackEntry($index, entry)) {\n @if (entry.type === 'placeholder') {\n <vdnd-drag-placeholder [itemHeight]=\"itemHeight()\" />\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate();\n context: {\n $implicit: entry.data,\n index: entry.index,\n isSticky: entry.isSticky,\n }\n \"\n >\n </ng-container>\n }\n }\n </div>\n </div>\n `,\n styles: `\n :host {\n display: block;\n /* Disable browser scroll anchoring - this prevents scroll position from being\n adjusted when the DOM changes (e.g., when placeholder position updates).\n Without this, autoscroll UP would fight with browser's scroll restoration. */\n overflow-anchor: none;\n }\n\n .vdnd-virtual-scroll-content {\n position: relative;\n width: 100%;\n }\n\n .vdnd-virtual-scroll-spacer {\n /* Invisible spacer that maintains scroll height */\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n visibility: hidden;\n pointer-events: none;\n }\n\n .vdnd-virtual-scroll-content-wrapper {\n /* GPU-accelerated positioning */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n will-change: transform;\n }\n `,\n})\nexport class VirtualScrollContainerComponent<T> implements OnInit, AfterViewInit, OnDestroy {\n readonly #dragState = inject(DragStateService);\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #autoScrollService = inject(AutoScrollService);\n readonly #ngZone = inject(NgZone);\n readonly #injector = inject(Injector);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Measured height from ResizeObserver (used when containerHeight is not provided) */\n readonly #measuredHeight = signal(0);\n\n /** Template for rendering each item - passed as input instead of content child for reliability */\n itemTemplate = input.required<TemplateRef<VirtualScrollItemContext<T>>>();\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Array of items to render */\n items = input.required<T[]>();\n\n /** Height of each item in pixels */\n itemHeight = input.required<number>();\n\n /**\n * Height of the container in pixels.\n * If not provided, the container will automatically measure its height from CSS.\n * This allows you to set the height via CSS (e.g., flex, height: 100%, etc.)\n * and the component will adapt automatically, including on resize.\n */\n containerHeight = input<number>();\n\n /**\n * Effective height used for calculations.\n * Uses explicit containerHeight if provided, otherwise uses measured height.\n */\n readonly effectiveHeight = computed(() => this.containerHeight() ?? this.#measuredHeight());\n\n /** Number of items to render above/below the visible area */\n overscan = input<number>(3);\n\n /** IDs of items that should always be rendered (e.g., dragged items) */\n stickyItemIds = input<string[]>([]);\n\n /** Function to get a unique ID from an item */\n itemIdFn = input.required<(item: T) => string>();\n\n /**\n * Track-by function for the @for loop.\n * Optional - if not provided, will be derived from itemIdFn.\n */\n trackByFn = input<(index: number, item: T) => string | number>();\n\n /**\n * ID of the droppable this virtual scroll belongs to.\n * Required for placeholder positioning.\n */\n droppableId = input<string>();\n\n /**\n * Whether to automatically add the dragged item to the sticky list.\n * This ensures the dragged item remains visible during virtual scrolling.\n * @default true\n */\n autoStickyDraggedItem = input<boolean>(true);\n\n /**\n * Effective track-by function - uses provided trackByFn or derives from itemIdFn.\n */\n protected readonly effectiveTrackByFn = computed(() => {\n const userFn = this.trackByFn();\n if (userFn) return userFn;\n\n const idFn = this.itemIdFn();\n return (_index: number, item: T) => idFn(item);\n });\n\n /**\n * Track function for rendered entries (items + placeholder).\n */\n protected trackEntry(\n _index: number,\n entry: { type: 'item' | 'placeholder'; data: T | null; index: number },\n ): string | number {\n if (entry.type === 'placeholder') {\n return '__placeholder__';\n }\n const trackFn = this.effectiveTrackByFn();\n return trackFn(entry.index, entry.data as T);\n }\n\n /**\n * Effective sticky item IDs - combines user-provided IDs with auto-sticky dragged item.\n */\n protected readonly effectiveStickyIds = computed(() => {\n const userIds = this.stickyItemIds();\n\n if (!this.autoStickyDraggedItem()) {\n return userIds;\n }\n\n const draggedId = this.draggedItemId();\n if (!draggedId) {\n return userIds;\n }\n\n // Avoid creating new array if dragged ID is already in the list\n if (userIds.includes(draggedId)) {\n return userIds;\n }\n\n return [...userIds, draggedId];\n });\n\n /** Emits when the visible range changes */\n visibleRangeChange = output<VisibleRangeChange>();\n\n /** Emits when scroll position changes */\n scrollPositionChange = output<number>();\n\n /** Current scroll position */\n readonly #scrollTop = signal(0);\n\n /** Total height of all items (for scrollbar) */\n protected readonly totalHeight = computed(() => {\n const count = this.items().length;\n const draggedId = this.draggedItemId();\n // Only subtract 1 if the dragged item belongs to THIS list (is in our items array).\n // Cross-list drags shouldn't affect the target list's height.\n const isDraggedItemInThisList = draggedId !== null && this.#itemIndexMap().has(draggedId);\n const effectiveCount = isDraggedItemInThisList ? count - 1 : count;\n return effectiveCount * this.itemHeight();\n });\n\n /** First visible item index */\n readonly #firstVisibleIndex = computed(() => {\n return Math.floor(this.#scrollTop() / this.itemHeight());\n });\n\n /** Number of items visible in the viewport */\n readonly #visibleCount = computed(() => {\n const height = this.effectiveHeight();\n if (height <= 0) return 0;\n return Math.ceil(height / this.itemHeight());\n });\n\n /** Range of items to render (with overscan) */\n readonly #renderRange = computed(() => {\n const first = this.#firstVisibleIndex();\n const visible = this.#visibleCount();\n const overscan = this.overscan();\n const total = this.items().length;\n\n const start = Math.max(0, first - overscan);\n const end = Math.min(total - 1, first + visible + overscan);\n\n return { start, end };\n });\n\n /** Transform offset for content wrapper (position of first rendered item) */\n protected readonly contentTransform = computed(() => {\n const { start } = this.#renderRange();\n const draggedIndex = this.#draggedItemIndex();\n // If dragged item is in the unrendered top section, subtract 1 (it's position:absolute)\n const adjustment = draggedIndex >= 0 && draggedIndex < start ? 1 : 0;\n const offset = Math.max(0, start - adjustment) * this.itemHeight();\n return `translateY(${offset}px)`;\n });\n\n /** The ID of the currently dragged item (if any) */\n protected readonly draggedItemId = computed(() => {\n return this.#dragState.draggedItem()?.draggableId ?? null;\n });\n\n /** Map of item IDs to their indices - rebuilt only when items() changes (O(n) once, then O(1) lookups) */\n readonly #itemIndexMap = computed(() => {\n const items = this.items();\n const idFn = this.itemIdFn();\n const map = new Map<string, number>();\n for (let i = 0; i < items.length; i++) {\n map.set(idFn(items[i]), i);\n }\n return map;\n });\n\n /** The index of the currently dragged item in the items array (-1 if not found or not dragging) */\n readonly #draggedItemIndex = computed(() => {\n const draggedId = this.draggedItemId();\n if (!draggedId) return -1;\n return this.#itemIndexMap().get(draggedId) ?? -1;\n });\n\n /** Memoized Set of sticky IDs - rebuilt only when effectiveStickyIds() changes */\n readonly #stickyIdsSet = computed(() => new Set(this.effectiveStickyIds()));\n\n /** Whether the placeholder should be shown in this container */\n protected readonly shouldShowPlaceholder = computed(() => {\n if (!this.#dragState.isDragging()) return false;\n return this.#dragState.activeDroppableId() === this.droppableId();\n });\n\n /** The placeholder index when placeholder should be shown */\n protected readonly placeholderIndex = computed(() => {\n if (!this.shouldShowPlaceholder()) return -1;\n return this.#dragState.placeholderIndex() ?? -1;\n });\n\n /** Items to render, including sticky items and placeholder */\n protected readonly renderedItems = computed(() => {\n const items = this.items();\n const { start, end } = this.#renderRange();\n const stickyIds = this.#stickyIdsSet();\n const idFn = this.itemIdFn();\n const itemIndexMap = this.#itemIndexMap();\n const draggedId = this.draggedItemId();\n const placeholderIdx = this.placeholderIndex();\n\n const result: {\n type: 'item' | 'placeholder';\n data: T | null;\n index: number;\n isSticky: boolean;\n isDragging: boolean;\n }[] = [];\n const renderedIds = new Set<string>();\n let hasPlaceholder = false;\n\n // Add all items in the visible range, inserting placeholder at correct position\n for (let i = start; i <= end && i < items.length; i++) {\n // Insert placeholder before item at placeholderIndex\n if (placeholderIdx === i && !hasPlaceholder) {\n result.push({\n type: 'placeholder',\n data: null,\n index: placeholderIdx,\n isSticky: false,\n isDragging: false,\n });\n hasPlaceholder = true;\n }\n\n const item = items[i];\n const id = idFn(item);\n result.push({\n type: 'item',\n data: item,\n index: i,\n isSticky: stickyIds.has(id),\n isDragging: id === draggedId,\n });\n renderedIds.add(id);\n }\n\n // If placeholder is at the end (after all items), add it\n if (placeholderIdx >= items.length && placeholderIdx >= 0 && !hasPlaceholder) {\n result.push({\n type: 'placeholder',\n data: null,\n index: placeholderIdx,\n isSticky: false,\n isDragging: false,\n });\n hasPlaceholder = true;\n }\n\n // Add any sticky items that aren't already rendered\n const missingStickyIndices: { id: string; index: number }[] = [];\n for (const id of stickyIds) {\n if (renderedIds.has(id)) continue;\n const index = itemIndexMap.get(id);\n if (index === undefined) continue;\n missingStickyIndices.push({ id, index });\n }\n if (missingStickyIndices.length > 1) {\n missingStickyIndices.sort((a, b) => a.index - b.index);\n }\n\n for (const { id, index } of missingStickyIndices) {\n const item = items[index];\n if (item === undefined) continue;\n result.push({\n type: 'item',\n data: item,\n index,\n isSticky: true,\n isDragging: id === draggedId,\n });\n }\n\n return result;\n });\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-scroll-${Math.random().toString(36).slice(2, 9)}`;\n\n /** Track previous dragged ID to detect drag end */\n #previousDraggedId: string | null = null;\n\n constructor() {\n // Emit visible range changes\n effect(() => {\n const range = this.#renderRange();\n this.visibleRangeChange.emit(range);\n });\n\n // Keyboard drag autoscroll: scroll to keep target index visible\n effect(() => {\n // Only apply when this droppable is active during keyboard drag\n if (!this.#dragState.isKeyboardDrag()) return;\n const activeDroppable = this.#dragState.activeDroppableId();\n if (activeDroppable !== this.droppableId()) return;\n\n const targetIndex = this.#dragState.keyboardTargetIndex();\n if (targetIndex === null) return;\n\n const itemHeight = this.itemHeight();\n const height = this.effectiveHeight();\n if (height <= 0) return;\n\n const element = this.#elementRef.nativeElement;\n const currentScrollTop = element.scrollTop;\n\n // Calculate target item position\n const targetTop = targetIndex * itemHeight;\n const targetBottom = targetTop + itemHeight;\n\n // Calculate visible range\n const viewportTop = currentScrollTop;\n const viewportBottom = currentScrollTop + height;\n\n // Check if target is fully visible\n if (targetTop < viewportTop) {\n // Target is above viewport - scroll up\n element.scrollTop = targetTop;\n this.#scrollTop.set(targetTop);\n } else if (targetBottom > viewportBottom) {\n // Target is below viewport - scroll down\n const newScrollTop = targetBottom - height;\n element.scrollTop = newScrollTop;\n this.#scrollTop.set(newScrollTop);\n }\n });\n\n // Preserve scroll position when drag ends at bottom of list\n // During drag, totalHeight is reduced by 1 item (dragged item is hidden)\n // When drag ends, totalHeight increases - we need to adjust scroll if we were at bottom\n effect(() => {\n const currentDraggedId = this.draggedItemId();\n const element = this.#elementRef.nativeElement;\n\n // Detect drag end (was dragging, now not)\n if (this.#previousDraggedId !== null && currentDraggedId === null) {\n const currentScrollTop = element.scrollTop;\n const itemHeight = this.itemHeight();\n const height = this.effectiveHeight();\n const totalItems = this.items().length;\n\n // Calculate if we were at/near bottom (within 10px tolerance)\n // During drag, max scroll was (totalItems - 1) * itemHeight - height\n const dragReducedMaxScroll = (totalItems - 1) * itemHeight - height;\n const wasAtBottom = currentScrollTop >= dragReducedMaxScroll - 10;\n\n if (wasAtBottom && dragReducedMaxScroll > 0) {\n // Adjust scroll to new bottom position after totalHeight increases\n afterNextRender(\n () => {\n const newMaxScroll = Math.max(0, totalItems * itemHeight - height);\n element.scrollTop = newMaxScroll;\n this.#scrollTop.set(newMaxScroll);\n },\n { injector: this.#injector },\n );\n }\n }\n\n this.#previousDraggedId = currentDraggedId;\n });\n }\n\n ngOnInit(): void {\n // Register with auto-scroll service\n if (this.autoScrollEnabled()) {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.registerContainer(\n id,\n this.#elementRef.nativeElement,\n this.autoScrollConfig(),\n );\n }\n }\n\n ngAfterViewInit(): void {\n const element = this.#elementRef.nativeElement;\n\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element,\n ngZone: this.#ngZone,\n height: this.#measuredHeight,\n minDeltaPx: 1,\n });\n\n // Scroll listener outside Angular zone with RAF throttling.\n // This avoids template event binding which would mark the component dirty 60x/sec.\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: 5,\n onCommit: (newScrollTop) => {\n this.scrollPositionChange.emit(newScrollTop);\n },\n });\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n\n // Unregister from auto-scroll service\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.unregisterContainer(id);\n }\n\n /**\n * Scroll to a specific position.\n */\n scrollTo(position: number): void {\n this.#elementRef.nativeElement.scrollTop = position;\n this.#scrollTop.set(position);\n }\n\n /**\n * Scroll to a specific item index.\n */\n scrollToIndex(index: number): void {\n const position = index * this.itemHeight();\n this.scrollTo(position);\n }\n\n /**\n * Get the current scroll position.\n */\n getScrollTop(): number {\n return this.#scrollTop();\n }\n\n /**\n * Get the total scrollable height.\n */\n getScrollHeight(): number {\n return this.totalHeight();\n }\n\n /**\n * Scroll by a delta amount.\n */\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(this.getScrollTop() + delta, this.getScrollHeight() - this.effectiveHeight()),\n );\n this.scrollTo(newPosition);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { DragStateService } from '../services/drag-state.service';\n\n/**\n * Context provided to the drag preview template.\n */\nexport interface DragPreviewContext<T = unknown> {\n /** The data associated with the dragged item */\n $implicit: T;\n /** The draggable ID */\n draggableId: string;\n /** The source droppable ID */\n droppableId: string;\n}\n\n/**\n * Renders a preview of the dragged item that follows the cursor.\n *\n * This component should be placed at the root of your application (or at least\n * outside of any scrollable containers) to ensure the preview is always visible.\n *\n * @example\n * ```html\n * <vdnd-drag-preview>\n * <ng-template let-data let-id=\"draggableId\">\n * <div class=\"drag-preview\">{{ data.name }}</div>\n * </ng-template>\n * </vdnd-drag-preview>\n * ```\n */\n@Component({\n selector: 'vdnd-drag-preview',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n template: `\n @if (isVisible()) {\n <div\n class=\"vdnd-drag-preview\"\n [style.position]=\"'fixed'\"\n [style.left.px]=\"0\"\n [style.top.px]=\"0\"\n [style.transform]=\"transform()\"\n [style.will-change]=\"'transform'\"\n [style.width.px]=\"dimensions().width\"\n [style.height.px]=\"dimensions().height\"\n [style.pointer-events]=\"'none'\"\n [style.z-index]=\"1000\"\n [style.opacity]=\"0.9\"\n >\n @if (previewTemplate()) {\n <ng-container *ngTemplateOutlet=\"previewTemplate()!; context: templateContext()\">\n </ng-container>\n } @else if (clonedElement()) {\n <div class=\"vdnd-drag-preview-clone\" #cloneContainer></div>\n } @else {\n <div class=\"vdnd-drag-preview-default\">\n {{ dragState.draggedItem()?.draggableId }}\n </div>\n }\n </div>\n }\n `,\n styles: `\n .vdnd-drag-preview {\n box-sizing: border-box;\n }\n\n .vdnd-drag-preview-clone {\n width: 100%;\n height: 100%;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n overflow: hidden;\n }\n\n .vdnd-drag-preview-default {\n padding: 8px;\n background: white;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n }\n `,\n})\nexport class DragPreviewComponent<T = unknown> {\n protected readonly dragState = inject(DragStateService);\n\n /** Optional custom template for the preview */\n previewTemplate = input<TemplateRef<DragPreviewContext<T>>>();\n\n /** Offset from cursor to preview (to avoid cursor being on top of preview) */\n cursorOffset = input<{ x: number; y: number }>({ x: 8, y: 8 });\n\n /** Reference to the clone container element (cannot use ES private with viewChild) */\n private readonly cloneContainer = viewChild<ElementRef<HTMLElement>>('cloneContainer');\n\n /** The cloned element from drag state (used when no custom template is provided) */\n protected readonly clonedElement = computed(() => {\n if (this.previewTemplate()) {\n return null; // Custom template takes precedence\n }\n return this.dragState.draggedItem()?.clonedElement ?? null;\n });\n\n constructor() {\n // Effect to insert the cloned element into the container\n effect(() => {\n const container = this.cloneContainer()?.nativeElement;\n const clone = this.clonedElement();\n\n if (!container) {\n return;\n }\n\n // Clear previous content and append the prepared clone element.\n // Avoid cloning again: ElementCloneService already creates a styled/sanitized clone.\n container.innerHTML = '';\n if (clone) {\n container.appendChild(clone);\n }\n });\n }\n\n /** Whether the preview is visible */\n protected readonly isVisible = computed(() => {\n return this.dragState.isDragging() && this.dragState.cursorPosition() !== null;\n });\n\n /** Position of the preview */\n protected readonly position = computed(() => {\n const cursor = this.dragState.cursorPosition();\n const grabOffset = this.dragState.grabOffset();\n const fallbackOffset = this.cursorOffset();\n const initialPosition = this.dragState.initialPosition();\n const lockAxis = this.dragState.lockAxis();\n\n if (!cursor) {\n return { x: 0, y: 0 };\n }\n\n // Use grab offset if available (preserves grab position), otherwise fall back to cursorOffset input\n const offset = grabOffset ?? fallbackOffset;\n\n let x = cursor.x - offset.x;\n let y = cursor.y - offset.y;\n\n // Apply axis locking if configured\n if (lockAxis && initialPosition) {\n if (lockAxis === 'x') {\n // Lock X axis: x stays at initial position\n x = initialPosition.x - offset.x;\n } else if (lockAxis === 'y') {\n // Lock Y axis: y stays at initial position\n y = initialPosition.y - offset.y;\n }\n }\n\n return { x, y };\n });\n\n /** Transform-based positioning for better performance (avoid layout from left/top). */\n protected readonly transform = computed(() => {\n const { x, y } = this.position();\n return `translate3d(${x}px, ${y}px, 0)`;\n });\n\n /** Dimensions of the preview */\n protected readonly dimensions = computed(() => {\n const item = this.dragState.draggedItem();\n\n if (!item) {\n return { width: 100, height: 50 };\n }\n\n return {\n width: item.width,\n height: item.height,\n };\n });\n\n /** Template context */\n protected readonly templateContext = computed((): DragPreviewContext<T> => {\n const item = this.dragState.draggedItem();\n\n return {\n $implicit: (item?.data ?? null) as T,\n draggableId: item?.draggableId ?? '',\n droppableId: item?.droppableId ?? '',\n };\n });\n}\n","import { ChangeDetectionStrategy, Component, input, TemplateRef } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/**\n * Context provided to the custom placeholder template.\n */\nexport interface PlaceholderContext {\n /** The height of the placeholder in pixels */\n $implicit: number;\n /** The height of the placeholder in pixels (explicit property) */\n height: number;\n}\n\n/**\n * A placeholder component that indicates where a dropped item will be inserted.\n *\n * By default, renders as empty/transparent space. Pass a custom template\n * to customize the placeholder appearance.\n *\n * @example\n * ```html\n * <!-- Default: transparent/empty space -->\n * <vdnd-placeholder [height]=\"50\"></vdnd-placeholder>\n *\n * <!-- Custom template with dashed border -->\n * <vdnd-placeholder [height]=\"50\" [template]=\"customPlaceholder\">\n * <ng-template #customPlaceholder let-height>\n * <div class=\"my-placeholder\" [style.height.px]=\"height\">\n * Drop here\n * </div>\n * </ng-template>\n * </vdnd-placeholder>\n * ```\n */\n@Component({\n selector: 'vdnd-placeholder',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n host: {\n class: 'vdnd-placeholder',\n '[style.height.px]': 'height()',\n '[attr.data-draggable-id]': '\"placeholder\"',\n },\n template: `\n @if (template()) {\n <ng-container\n *ngTemplateOutlet=\"template()!; context: { $implicit: height(), height: height() }\">\n </ng-container>\n }\n `,\n styles: `\n :host {\n display: block;\n box-sizing: border-box;\n }\n `,\n})\nexport class PlaceholderComponent {\n /** Height of the placeholder in pixels */\n height = input<number>(50);\n\n /** Optional custom template for the placeholder content */\n template = input<TemplateRef<PlaceholderContext>>();\n}\n","import { Directive, InjectionToken, input, Signal } from '@angular/core';\n\n/**\n * Token for injecting the group context from a parent directive.\n * Allows child draggables and droppables to inherit the group name automatically.\n */\nexport const VDND_GROUP_TOKEN = new InjectionToken<VdndGroupContext>('VDND_GROUP_TOKEN');\n\n/**\n * Context provided by the group directive to its children.\n */\nexport interface VdndGroupContext {\n /** The group name signal */\n readonly group: Signal<string>;\n}\n\n/**\n * Provides a group context to child draggable and droppable directives.\n * When applied to a parent element, child directives can inherit the group name\n * automatically without needing to specify it on each element.\n *\n * @example\n * ```html\n * <!-- Without group directive (verbose) -->\n * <div vdndDroppable=\"list-1\" vdndDroppableGroup=\"my-group\">\n * <div vdndDraggable=\"item-1\" vdndDraggableGroup=\"my-group\">Item 1</div>\n * <div vdndDraggable=\"item-2\" vdndDraggableGroup=\"my-group\">Item 2</div>\n * </div>\n *\n * <!-- With group directive (concise) -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDroppable=\"list-1\">\n * <div vdndDraggable=\"item-1\">Item 1</div>\n * <div vdndDraggable=\"item-2\">Item 2</div>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndGroup]',\n providers: [\n {\n provide: VDND_GROUP_TOKEN,\n useExisting: DroppableGroupDirective,\n },\n ],\n})\nexport class DroppableGroupDirective implements VdndGroupContext {\n /** The group name that will be inherited by child directives */\n readonly group = input.required<string>({ alias: 'vdndGroup' });\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n OnDestroy,\n OnInit,\n output,\n untracked,\n} from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n DragEnterEvent,\n DragLeaveEvent,\n DragOverEvent,\n DragState,\n DropEvent,\n END_OF_LIST,\n} from '../models/drag-drop.models';\nimport { VDND_GROUP_TOKEN } from './droppable-group.directive';\n\n/**\n * Marks an element as a valid drop target within the virtual scroll drag-and-drop system.\n *\n * @example\n * ```html\n * <!-- With explicit group -->\n * <div\n * vdndDroppable=\"list-1\"\n * vdndDroppableGroup=\"my-group\"\n * (drop)=\"onDrop($event)\">\n * <!-- Draggable items here -->\n * </div>\n *\n * <!-- With inherited group from parent vdndGroup directive -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDroppable=\"list-1\" (drop)=\"onDrop($event)\">\n * <!-- Draggable items here -->\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndDroppable]',\n host: {\n '[attr.data-droppable-id]': 'vdndDroppable()',\n '[attr.data-droppable-group]': 'effectiveGroup()',\n '[attr.aria-dropeffect]': '\"move\"',\n '[class.vdnd-droppable]': 'true',\n '[class.vdnd-droppable-active]': 'isActive()',\n '[class.vdnd-droppable-disabled]': 'disabled()',\n },\n})\nexport class DroppableDirective implements OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #dragState = inject(DragStateService);\n readonly #autoScroll = inject(AutoScrollService);\n readonly #parentGroup = inject(VDND_GROUP_TOKEN, { optional: true });\n\n /** Unique identifier for this droppable */\n vdndDroppable = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n vdndDroppableGroup = input<string>();\n\n /**\n * Resolved group name - uses explicit input or falls back to parent group.\n * Returns null (and disables dropping) if neither is available.\n */\n #hasWarnedMissingGroup = false;\n readonly effectiveGroup = computed((): string | null => {\n const explicit = this.vdndDroppableGroup();\n if (explicit) return explicit;\n\n const inherited = this.#parentGroup?.group();\n if (inherited) return inherited;\n\n if (isDevMode() && !this.#hasWarnedMissingGroup) {\n console.warn(\n `[ngx-virtual-dnd] [vdndDroppable=\"${this.vdndDroppable()}\"] requires a group. ` +\n 'Either set vdndDroppableGroup or wrap in a vdndGroup directive. ' +\n 'Dropping will be disabled for this element.',\n );\n this.#hasWarnedMissingGroup = true;\n }\n\n return null;\n });\n\n /** Optional data associated with this droppable */\n vdndDroppableData = input<unknown>();\n\n /** Whether this droppable is disabled */\n disabled = input<boolean>(false);\n\n /** Enable auto-scroll when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Emits when a dragged item enters this droppable */\n dragEnter = output<DragEnterEvent>();\n\n /** Emits when a dragged item leaves this droppable */\n dragLeave = output<DragLeaveEvent>();\n\n /** Emits while a dragged item is over this droppable */\n dragOver = output<DragOverEvent>();\n\n /** Emits when an item is dropped on this droppable */\n // eslint-disable-next-line @angular-eslint/no-output-native\n drop = output<DropEvent>();\n\n /** Whether this droppable is currently being targeted */\n readonly isActive = computed(() => {\n const activeId = this.#dragState.activeDroppableId();\n return activeId === this.vdndDroppable() && !this.disabled();\n });\n\n /** The current placeholder ID when this droppable is active */\n readonly placeholderId = computed(() => {\n if (!this.isActive()) {\n return null;\n }\n return this.#dragState.placeholderId();\n });\n\n /** Track previous active state for enter/leave events */\n #wasActive = false;\n\n /** Track previous placeholder for over events */\n #previousPlaceholder: string | null = null;\n\n /** Cached state for handling drop (since state is cleared before effect fires) */\n #cachedDragState: DragState | null = null;\n\n ngOnInit(): void {\n // Without a group, this droppable can't participate in DnD (fail gracefully).\n if (!this.effectiveGroup()) {\n return;\n }\n\n // Register with auto-scroll service only if this element is actually scrollable\n // (i.e., has overflow: auto/scroll and content taller than container)\n if (this.autoScrollEnabled() && this.#isScrollable()) {\n this.#autoScroll.registerContainer(\n this.vdndDroppable(),\n this.#elementRef.nativeElement,\n this.autoScrollConfig(),\n );\n }\n }\n\n /**\n * Check if this element is actually scrollable.\n */\n #isScrollable(): boolean {\n const el = this.#elementRef.nativeElement;\n const style = window.getComputedStyle(el);\n const overflowY = style.overflowY;\n const overflowX = style.overflowX;\n\n // Check if overflow allows scrolling\n const hasScrollableOverflow =\n overflowY === 'auto' ||\n overflowY === 'scroll' ||\n overflowX === 'auto' ||\n overflowX === 'scroll';\n\n if (!hasScrollableOverflow) {\n return false;\n }\n\n // Check if content is larger than container\n return el.scrollHeight > el.clientHeight || el.scrollWidth > el.clientWidth;\n }\n\n constructor() {\n // React to state changes and emit appropriate events\n effect(() => {\n const active = this.isActive();\n const placeholder = this.placeholderId();\n const draggedItem = this.#dragState.draggedItem();\n const isDragging = this.#dragState.isDragging();\n // NOTE: cursorPosition is read with untracked() below to avoid effect running 60x/sec\n\n // Cache state while active for use during drop handling\n if (active && isDragging && draggedItem) {\n this.#cachedDragState = this.#dragState.getStateSnapshot();\n }\n\n // Handle drag end (drop)\n if (!isDragging && this.#wasActive && draggedItem === null) {\n // Check if drag was cancelled (e.g., Escape key)\n if (!this.#dragState.wasCancelled()) {\n // Drag ended normally - this is a drop\n this.#handleDrop();\n }\n this.#cachedDragState = null;\n }\n\n // Handle enter/leave\n if (active && !this.#wasActive) {\n // Entered\n if (draggedItem) {\n this.dragEnter.emit({\n droppableId: this.vdndDroppable(),\n draggedItem,\n });\n }\n } else if (!active && this.#wasActive) {\n // Left (but not dropped here)\n if (isDragging && draggedItem) {\n this.dragLeave.emit({\n droppableId: this.vdndDroppable(),\n draggedItem,\n });\n }\n // Clear cached state when leaving without dropping\n if (isDragging) {\n this.#cachedDragState = null;\n }\n }\n\n // Handle over (placeholder changed)\n if (active && placeholder !== this.#previousPlaceholder) {\n if (draggedItem) {\n // Use untracked() to read cursorPosition without tracking it as a dependency\n // This prevents the effect from running on every cursor move (60Hz during autoscroll)\n const cursorPosition = untracked(() => this.#dragState.cursorPosition());\n if (cursorPosition) {\n this.dragOver.emit({\n droppableId: this.vdndDroppable(),\n draggedItem,\n placeholderId: placeholder,\n position: cursorPosition,\n });\n }\n }\n }\n\n this.#wasActive = active;\n this.#previousPlaceholder = placeholder;\n });\n }\n\n ngOnDestroy(): void {\n // Clean up if this droppable is destroyed while being active\n if (this.isActive()) {\n this.#dragState.setActiveDroppable(null);\n }\n\n // Unregister from auto-scroll\n this.#autoScroll.unregisterContainer(this.vdndDroppable());\n }\n\n /**\n * Handle a drop on this droppable.\n */\n #handleDrop(): void {\n // Use cached state since the actual state is cleared before this effect fires\n const state = this.#cachedDragState;\n\n if (!state?.draggedItem || state.activeDroppableId !== this.vdndDroppable()) {\n return;\n }\n\n const sourceDroppableId = state.sourceDroppableId ?? '';\n const placeholderId = state.placeholderId ?? END_OF_LIST;\n\n // Use the stored source index from drag state\n // This is critical for virtual scrolling where the original element may no longer\n // be in the DOM after autoscroll (it gets virtualized out of view)\n const sourceIndex =\n state.sourceIndex ?? this.#getItemIndex(state.draggedItem.draggableId, sourceDroppableId);\n\n // Use the pre-calculated placeholderIndex if available (more reliable)\n // Fall back to DOM-based calculation if not\n let destinationIndex =\n state.placeholderIndex !== null && state.placeholderIndex !== undefined\n ? state.placeholderIndex\n : this.#getDestinationIndex(placeholderId);\n\n // Adjust for same-list reordering: if moving within the same list and\n // the destination is after the source, we need to account for the item\n // being removed from its original position\n if (sourceDroppableId === this.vdndDroppable() && sourceIndex < destinationIndex) {\n destinationIndex--;\n }\n\n this.drop.emit({\n source: {\n draggableId: state.draggedItem.draggableId,\n droppableId: sourceDroppableId,\n index: sourceIndex,\n data: state.draggedItem.data,\n },\n destination: {\n droppableId: this.vdndDroppable(),\n placeholderId,\n index: destinationIndex,\n data: this.vdndDroppableData(),\n },\n });\n }\n\n /**\n * Get the index of an item in a droppable.\n * This is a simplified implementation - in practice, the consumer would track this.\n */\n #getItemIndex(draggableId: string, droppableId: string): number {\n // Find all draggables in the source droppable\n const droppable = document.querySelector(`[data-droppable-id=\"${droppableId}\"]`);\n if (!droppable) {\n return 0;\n }\n\n const draggables = droppable.querySelectorAll('[data-draggable-id]');\n for (let i = 0; i < draggables.length; i++) {\n if (draggables[i].getAttribute('data-draggable-id') === draggableId) {\n return i;\n }\n }\n\n return 0;\n }\n\n /**\n * Get the destination index based on the placeholder.\n */\n #getDestinationIndex(placeholderId: string): number {\n // Exclude placeholder elements from the count\n const draggables = this.#elementRef.nativeElement.querySelectorAll(\n '[data-draggable-id]:not([data-draggable-id=\"placeholder\"])',\n );\n\n if (placeholderId === END_OF_LIST) {\n return draggables.length;\n }\n\n // Find the index of the placeholder item\n for (let i = 0; i < draggables.length; i++) {\n if (draggables[i].getAttribute('data-draggable-id') === placeholderId) {\n return i;\n }\n }\n\n return 0;\n }\n\n /**\n * Get the element reference (for external use).\n */\n getElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Manually scroll this droppable.\n */\n scrollBy(delta: number): void {\n this.#elementRef.nativeElement.scrollTop += delta;\n }\n\n /**\n * Get the current scroll position.\n */\n getScrollTop(): number {\n return this.#elementRef.nativeElement.scrollTop;\n }\n\n /**\n * Get the scroll height.\n */\n getScrollHeight(): number {\n return this.#elementRef.nativeElement.scrollHeight;\n }\n}\n","import { ChangeDetectionStrategy, Component, input, output, TemplateRef } from '@angular/core';\nimport {\n VirtualScrollContainerComponent,\n VirtualScrollItemContext,\n VisibleRangeChange,\n} from './virtual-scroll-container.component';\nimport { DroppableDirective } from '../directives/droppable.directive';\nimport { AutoScrollConfig } from '../services/auto-scroll.service';\nimport {\n DragEnterEvent,\n DragLeaveEvent,\n DragOverEvent,\n DropEvent,\n} from '../models/drag-drop.models';\n\n/**\n * A high-level component that combines droppable, virtual scroll, and placeholder\n * functionality into a single, easy-to-use component.\n *\n * This component significantly reduces boilerplate by automatically handling:\n * - Placeholder insertion at the correct position\n * - Sticky item management for the dragged item\n * - Virtual scrolling with proper drag-and-drop integration\n * - Droppable container setup\n *\n * @example\n * ```html\n * <!-- Before (verbose): ~45 lines of boilerplate -->\n * <div vdndDroppable=\"list-1\" vdndDroppableGroup=\"demo\" (drop)=\"onDrop($event)\">\n * <vdnd-virtual-scroll\n * [items]=\"itemsWithPlaceholder()\"\n * [itemHeight]=\"50\"\n * [stickyItemIds]=\"stickyIds()\"\n * [itemIdFn]=\"getItemId\"\n * [trackByFn]=\"trackById\"\n * [itemTemplate]=\"itemTpl\">\n * </vdnd-virtual-scroll>\n * </div>\n *\n * <!-- After (concise): ~8 lines -->\n * <vdnd-sortable-list\n * droppableId=\"list-1\"\n * group=\"demo\"\n * [items]=\"list()\"\n * [itemHeight]=\"50\"\n * [itemIdFn]=\"getItemId\"\n * [itemTemplate]=\"itemTpl\"\n * (drop)=\"onDrop($event)\">\n * </vdnd-sortable-list>\n * ```\n */\n@Component({\n selector: 'vdnd-sortable-list',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [VirtualScrollContainerComponent, DroppableDirective],\n host: {\n class: 'vdnd-sortable-list',\n '[style.display]': '\"block\"',\n },\n template: `\n <div\n class=\"vdnd-sortable-list-droppable\"\n [vdndDroppable]=\"droppableId()\"\n [vdndDroppableGroup]=\"group()\"\n [vdndDroppableData]=\"droppableData()\"\n [disabled]=\"disabled()\"\n (dragEnter)=\"dragEnter.emit($event)\"\n (dragLeave)=\"dragLeave.emit($event)\"\n (dragOver)=\"dragOver.emit($event)\"\n (drop)=\"drop.emit($event)\"\n >\n <vdnd-virtual-scroll\n [items]=\"items()\"\n [itemHeight]=\"itemHeight()\"\n [itemIdFn]=\"itemIdFn()\"\n [trackByFn]=\"trackByFn()\"\n [itemTemplate]=\"itemTemplate()\"\n [droppableId]=\"droppableId()\"\n [autoStickyDraggedItem]=\"true\"\n [containerHeight]=\"containerHeight()\"\n [overscan]=\"overscan()\"\n [autoScrollEnabled]=\"autoScrollEnabled()\"\n [autoScrollConfig]=\"autoScrollConfig()\"\n (visibleRangeChange)=\"visibleRangeChange.emit($event)\"\n (scrollPositionChange)=\"scrollPositionChange.emit($event)\"\n >\n </vdnd-virtual-scroll>\n </div>\n `,\n styles: `\n :host {\n display: block;\n }\n `,\n})\nexport class VirtualSortableListComponent<T> {\n // ========== Required Inputs ==========\n\n /** Unique identifier for this droppable list */\n droppableId = input.required<string>();\n\n /** Drag-and-drop group name */\n group = input.required<string>();\n\n /** Array of items to render */\n items = input.required<T[]>();\n\n /** Height of each item in pixels */\n itemHeight = input.required<number>();\n\n /** Function to get a unique ID from an item */\n itemIdFn = input.required<(item: T) => string>();\n\n /** Template for rendering each item */\n itemTemplate = input.required<TemplateRef<VirtualScrollItemContext<T>>>();\n\n // ========== Optional Inputs ==========\n\n /**\n * Track-by function for the @for loop.\n * Optional - if not provided, will be derived from itemIdFn.\n */\n trackByFn = input<(index: number, item: T) => string | number>();\n\n /** Optional data associated with this droppable */\n droppableData = input<unknown>();\n\n /** Whether this sortable list is disabled */\n disabled = input<boolean>(false);\n\n /**\n * Height of the container in pixels.\n * If not provided, uses CSS-based height detection.\n */\n containerHeight = input<number>();\n\n /** Number of items to render above/below the visible area */\n overscan = input<number>(3);\n\n /** Enable auto-scroll when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== Outputs ==========\n\n /** Emits when an item is dropped on this list */\n // eslint-disable-next-line @angular-eslint/no-output-native\n drop = output<DropEvent>();\n\n /** Emits when a dragged item enters this list */\n dragEnter = output<DragEnterEvent>();\n\n /** Emits when a dragged item leaves this list */\n dragLeave = output<DragLeaveEvent>();\n\n /** Emits while a dragged item is over this list */\n dragOver = output<DragOverEvent>();\n\n /** Emits when the visible range changes */\n visibleRangeChange = output<VisibleRangeChange>();\n\n /** Emits when scroll position changes */\n scrollPositionChange = output<number>();\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { VDND_VIRTUAL_VIEWPORT, VdndVirtualViewport } from '../tokens/virtual-viewport.token';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\n\n/**\n * A virtual viewport component that provides efficient wrapper-based positioning\n * for virtual scrolling. This component acts as the scroll container and provides\n * a content wrapper with GPU-accelerated transform positioning.\n *\n * Use this component when you need virtual scrolling with optimal performance.\n * Items rendered inside via `*vdndVirtualFor` will be positioned using a single\n * transform on the wrapper, rather than individual absolute positioning.\n *\n * @example\n * Basic usage:\n * ```html\n * <vdnd-virtual-viewport\n * [itemHeight]=\"50\"\n * [totalItems]=\"items().length\"\n * style=\"height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n *\n * @example\n * With Ionic (disable Ionic's scroll, use viewport as scroll host):\n * ```html\n * <ion-content [scrollY]=\"false\">\n * <vdnd-virtual-viewport\n * class=\"ion-content-scroll-host\"\n * [itemHeight]=\"72\"\n * [totalItems]=\"tasks().length\"\n * style=\"height: 100%;\">\n * <ng-container *vdndVirtualFor=\"...\">\n * ...\n * </ng-container>\n * </vdnd-virtual-viewport>\n * </ion-content>\n * ```\n *\n * @example\n * With content offset (for headers above the list):\n * ```html\n * <vdnd-virtual-viewport\n * [itemHeight]=\"50\"\n * [totalItems]=\"items().length\"\n * [contentOffset]=\"headerHeight()\"\n * style=\"height: 100%;\">\n * <div class=\"header\" [style.height.px]=\"headerHeight()\">Header</div>\n * <ng-container *vdndVirtualFor=\"...\">\n * ...\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-viewport',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: VDND_VIRTUAL_VIEWPORT, useExisting: VirtualViewportComponent },\n { provide: VDND_SCROLL_CONTAINER, useExisting: VirtualViewportComponent },\n ],\n host: {\n class: 'vdnd-virtual-viewport',\n '[style.display]': '\"block\"',\n '[style.overflow]': '\"auto\"',\n '[style.position]': '\"relative\"',\n // Disable browser scroll anchoring to prevent scroll position adjustments\n // when DOM changes (e.g., placeholder position updates during drag)\n '[style.overflow-anchor]': '\"none\"',\n },\n template: `\n <!-- Spacer maintains total scroll height -->\n <div\n class=\"vdnd-viewport-spacer\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"contentOffset()\"\n [style.left.px]=\"0\"\n [style.width.px]=\"1\"\n [style.height.px]=\"totalHeight()\"\n [style.visibility]=\"'hidden'\"\n [style.pointer-events]=\"'none'\"\n ></div>\n\n <!-- Content wrapper with GPU-accelerated transform -->\n <div\n class=\"vdnd-viewport-content\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"contentOffset()\"\n [style.left.px]=\"0\"\n [style.right.px]=\"0\"\n [style.will-change]=\"'transform'\"\n [style.transform]=\"contentTransform()\"\n >\n <ng-content></ng-content>\n </div>\n `,\n})\nexport class VirtualViewportComponent\n implements VdndVirtualViewport, VdndScrollContainer, OnInit, OnDestroy\n{\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n readonly #autoScrollService = inject(AutoScrollService);\n\n /** Current scroll position (reactive) */\n readonly #scrollTop = signal(0);\n\n /** Measured container height (reactive) */\n readonly #containerHeight = signal(0);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-viewport-${Math.random().toString(36).slice(2, 9)}`;\n\n /**\n * The actual first rendered item index, set by VirtualForDirective.\n * This accounts for overscan and is used for wrapper positioning.\n */\n readonly #renderStartIndex = signal(0);\n\n // ========== Inputs ==========\n\n /** Height of each item in pixels */\n itemHeight = input.required<number>();\n\n /** Total number of items */\n totalItems = input.required<number>();\n\n /** Offset for content below headers (in pixels) */\n contentOffset = input<number>(0);\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== Computed Values ==========\n\n /** Total height of all items (for scroll height) */\n readonly totalHeight = computed(() => this.totalItems() * this.itemHeight());\n\n /** Transform for content wrapper positioning */\n readonly contentTransform = computed(() => {\n const startIndex = this.#renderStartIndex();\n const itemHeight = this.itemHeight();\n return `translateY(${startIndex * itemHeight}px)`;\n });\n\n // ========== VdndVirtualViewport Implementation ==========\n\n scrollTop(): number {\n return this.#scrollTop();\n }\n\n containerHeight(): number {\n return this.#containerHeight();\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Called by VirtualForDirective to inform this viewport of the actual\n * first rendered item index. Used for wrapper positioning.\n */\n setRenderStartIndex(index: number): void {\n this.#renderStartIndex.set(index);\n }\n\n // ========== VdndScrollContainer Implementation ==========\n\n scrollTo(options: ScrollToOptions): void {\n this.nativeElement.scrollTo(options);\n }\n\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(\n this.scrollTop() + delta,\n this.nativeElement.scrollHeight - this.nativeElement.clientHeight,\n ),\n );\n this.scrollTo({ top: newPosition });\n }\n\n // ========== Lifecycle ==========\n\n ngOnInit(): void {\n this.#setupScrollListener();\n this.#setupResizeObserver();\n this.#registerAutoScroll();\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n this.#unregisterAutoScroll();\n }\n\n // ========== Private Methods ==========\n\n /** Minimum scroll delta (px) to trigger signal update */\n readonly #scrollThreshold = 5;\n\n #setupScrollListener(): void {\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: this.#scrollThreshold,\n });\n }\n\n #setupResizeObserver(): void {\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n height: this.#containerHeight,\n minDeltaPx: 1,\n });\n }\n\n #registerAutoScroll(): void {\n if (this.autoScrollEnabled()) {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.registerContainer(id, this.nativeElement, this.autoScrollConfig());\n }\n }\n\n #unregisterAutoScroll(): void {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.unregisterContainer(id);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { VDND_VIRTUAL_VIEWPORT, VdndVirtualViewport } from '../tokens/virtual-viewport.token';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\n\n/**\n * A virtual content component that provides wrapper-based positioning\n * for virtual scrolling within an EXTERNAL scroll container.\n *\n * Use this component when you need virtual scrolling alongside other content\n * (headers, footers) within a shared scroll container. The component provides\n * a content wrapper with GPU-accelerated transform positioning while delegating\n * scroll handling to the parent `vdndScrollable` container.\n *\n * @example\n * Mixed content with header and footer:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 100vh;\">\n * <!-- Header that scrolls away -->\n * <div class=\"header\" #header>Welcome!</div>\n *\n * <!-- Virtual list with wrapper positioning -->\n * <vdnd-virtual-content\n * [itemHeight]=\"50\"\n * [totalItems]=\"items().length\"\n * [contentOffset]=\"header.offsetHeight\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-content>\n *\n * <!-- Footer at the end -->\n * <div class=\"footer\">Load more</div>\n * </div>\n * ```\n *\n * @example\n * With Ionic:\n * ```html\n * <ion-content [scrollY]=\"false\">\n * <div class=\"scroll-container ion-content-scroll-host\" vdndScrollable>\n * <div class=\"page-header\" #header>...</div>\n *\n * <vdnd-virtual-content\n * [itemHeight]=\"72\"\n * [totalItems]=\"tasks().length\"\n * [contentOffset]=\"headerHeight()\">\n * <ng-container *vdndVirtualFor=\"...\">...</ng-container>\n * </vdnd-virtual-content>\n *\n * <div class=\"footer\">...</div>\n * </div>\n * </ion-content>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-content',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: VDND_VIRTUAL_VIEWPORT, useExisting: VirtualContentComponent },\n { provide: VDND_SCROLL_CONTAINER, useExisting: VirtualContentComponent },\n ],\n host: {\n class: 'vdnd-virtual-content',\n '[style.display]': '\"block\"',\n '[style.position]': '\"relative\"',\n '[attr.data-content-offset]': 'contentOffset()',\n '[attr.data-item-height]': 'itemHeight()',\n },\n template: `\n <!-- Spacer maintains scroll height for the virtual list portion -->\n <div\n class=\"vdnd-content-spacer\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"0\"\n [style.left.px]=\"0\"\n [style.width.px]=\"1\"\n [style.height.px]=\"totalHeight()\"\n [style.visibility]=\"'hidden'\"\n [style.pointer-events]=\"'none'\"\n ></div>\n\n <!-- Content wrapper with GPU-accelerated transform -->\n <div\n class=\"vdnd-content-wrapper\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"0\"\n [style.left.px]=\"0\"\n [style.right.px]=\"0\"\n [style.will-change]=\"'transform'\"\n [style.transform]=\"contentTransform()\"\n >\n <ng-content></ng-content>\n </div>\n `,\n})\nexport class VirtualContentComponent implements VdndVirtualViewport, VdndScrollContainer {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * The parent scroll container injected via skip-self to get the actual scrollable element.\n * We provide our own VDND_SCROLL_CONTAINER with adjusted values to children.\n */\n readonly #parentScrollContainer = inject(VDND_SCROLL_CONTAINER, { skipSelf: true });\n\n // ========== Inputs ==========\n\n /** Height of each item in pixels */\n itemHeight = input.required<number>();\n\n /** Total number of items */\n totalItems = input.required<number>();\n\n /** Offset for content above the virtual list (e.g., header height) */\n contentOffset = input<number>(0);\n\n // ========== Internal State ==========\n\n /**\n * The actual first rendered item index, set by VirtualForDirective.\n * This accounts for overscan and is used for wrapper positioning.\n */\n readonly #renderStartIndex = signal(0);\n\n // ========== Computed Values ==========\n\n /** Total height of all items (for scroll height) */\n readonly totalHeight = computed(() => this.totalItems() * this.itemHeight());\n\n /**\n * Adjusted scroll position - subtracts the content offset so the virtual scroll\n * calculates visible items correctly relative to where the list starts.\n */\n readonly #adjustedScrollTop = computed(() => {\n return Math.max(0, this.#parentScrollContainer.scrollTop() - this.contentOffset());\n });\n\n /** Transform for content wrapper positioning */\n readonly contentTransform = computed(() => {\n const startIndex = this.#renderStartIndex();\n const itemHeight = this.itemHeight();\n return `translateY(${startIndex * itemHeight}px)`;\n });\n\n // ========== VdndVirtualViewport Implementation ==========\n\n /** Adjusted scroll position relative to the virtual list start */\n scrollTop(): number {\n return this.#adjustedScrollTop();\n }\n\n containerHeight(): number {\n return this.#parentScrollContainer.containerHeight();\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Called by VirtualForDirective to inform this viewport of the actual\n * first rendered item index. Used for wrapper positioning.\n */\n setRenderStartIndex(index: number): void {\n this.#renderStartIndex.set(index);\n }\n\n // ========== VdndScrollContainer Implementation ==========\n\n /**\n * Scroll to a specific position, adjusting for content offset.\n */\n scrollTo(options: ScrollToOptions): void {\n const adjustedOptions = { ...options };\n if (adjustedOptions.top !== undefined) {\n // Add offset back when scrolling to ensure correct position\n adjustedOptions.top += this.contentOffset();\n }\n this.#parentScrollContainer.scrollTo(adjustedOptions);\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { type CursorPosition, END_OF_LIST, type GrabOffset } from '../models/drag-drop.models';\nimport { PositionCalculatorService } from './position-calculator.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DragIndexCalculatorService {\n readonly #positionCalculator = inject(PositionCalculatorService);\n\n getTotalItemCount(args: {\n droppableElement: HTMLElement;\n isSameList: boolean;\n draggedItemHeight: number;\n }): number {\n return this.#getTotalItemCount(args.droppableElement, args.isSameList, args.draggedItemHeight);\n }\n\n calculatePlaceholderIndex(args: {\n droppableElement: HTMLElement;\n position: CursorPosition;\n grabOffset: GrabOffset | null;\n draggedItemHeight: number;\n sourceDroppableId: string | null;\n sourceIndex: number | null;\n }): { index: number; placeholderId: string } {\n const {\n droppableElement,\n position,\n grabOffset,\n draggedItemHeight,\n sourceDroppableId,\n sourceIndex,\n } = args;\n\n // Get container and measurements - handle both embedded virtual-scroll and page-level scroll\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n const virtualContent = droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content');\n\n let container: HTMLElement;\n let currentScrollTop: number;\n let rect: DOMRect;\n\n if (virtualScroll) {\n // Standard virtual scroll component - scroll container is the virtual scroll element\n container = virtualScroll as HTMLElement;\n rect = container.getBoundingClientRect();\n currentScrollTop = container.scrollTop;\n } else if (virtualContent) {\n // Page-level scroll: find scrollable parent and get adjusted scroll\n const scrollableParent = virtualContent.closest('.vdnd-scrollable') as HTMLElement | null;\n if (scrollableParent) {\n container = scrollableParent;\n // Use scroll container rect + content offset to avoid stale virtualContent rects.\n rect = container.getBoundingClientRect();\n const contentOffsetAttr = (virtualContent as HTMLElement).getAttribute(\n 'data-content-offset',\n );\n const contentOffset = contentOffsetAttr ? parseFloat(contentOffsetAttr) : 0;\n const offsetValue = Number.isFinite(contentOffset) ? contentOffset : 0;\n currentScrollTop = container.scrollTop - offsetValue;\n } else {\n container = virtualContent as HTMLElement;\n rect = container.getBoundingClientRect();\n currentScrollTop = 0;\n }\n } else {\n // Fallback: use droppable element directly\n container = droppableElement;\n rect = container.getBoundingClientRect();\n currentScrollTop = container.scrollTop;\n }\n\n // Prefer configured item height from virtual scroll/content over actual element height.\n // This prevents drift when actual element height differs from grid spacing.\n const configuredHeight =\n virtualScroll?.getAttribute('data-item-height') ??\n (virtualContent as HTMLElement | null)?.getAttribute('data-item-height');\n const parsedHeight = configuredHeight ? parseFloat(configuredHeight) : Number.NaN;\n const itemHeight = Number.isFinite(parsedHeight)\n ? parsedHeight\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 50);\n\n // Calculate preview center position mathematically\n // The preview is positioned at: cursorPosition - grabOffset (see drag-preview.component.ts)\n // So preview center = cursorPosition.y - grabOffset.y + itemHeight/2\n // Using math avoids Safari's stale getBoundingClientRect() issue during autoscroll\n const previewCenterY = position.y - (grabOffset?.y ?? 0) + itemHeight / 2;\n\n // Convert to visual index (which slot the preview center is in)\n const relativeY = previewCenterY - rect.top + currentScrollTop;\n const visualIndex = Math.floor(relativeY / itemHeight);\n\n // Check if same-list drag\n const currentDroppableId = this.#positionCalculator.getDroppableId(droppableElement);\n const isSameList = sourceDroppableId !== null && sourceDroppableId === currentDroppableId;\n\n // Same-list adjustment: if pointing at or after source position, add 1\n // This accounts for the hidden item shifting everything up visually\n let placeholderIndex = visualIndex;\n const sourceIndexValue = isSameList ? (sourceIndex ?? -1) : -1;\n if (isSameList && sourceIndexValue >= 0 && visualIndex >= sourceIndexValue) {\n placeholderIndex = visualIndex + 1;\n }\n\n // Get total items for clamping\n const totalItems = this.#getTotalItemCount(droppableElement, isSameList, draggedItemHeight);\n\n // Edge detection: allow dropping at the END of the list when cursor is near bottom edge.\n // Due to max scroll limits, the math alone can't reach totalItems when the list is longer\n // than the viewport. If cursor is in the bottom portion of the container and we're at\n // or past the last visible slot, snap to totalItems.\n const cursorRelativeToBottom = rect.bottom - previewCenterY;\n const isNearBottomEdge = cursorRelativeToBottom < itemHeight;\n if (isNearBottomEdge && placeholderIndex >= totalItems - 1) {\n placeholderIndex = totalItems;\n }\n\n // Clamp to valid range\n placeholderIndex = Math.max(0, Math.min(placeholderIndex, totalItems));\n\n return { index: placeholderIndex, placeholderId: END_OF_LIST };\n }\n\n #getTotalItemCount(\n droppableElement: HTMLElement,\n isSameList: boolean,\n draggedItemHeight: number,\n ): number {\n // Check for embedded virtual scroll component\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n if (virtualScroll) {\n // Use the spacer's height, NOT scrollHeight, to determine item count.\n // scrollHeight can be inflated by absolutely-positioned elements like the placeholder.\n const spacer = virtualScroll.querySelector(\n '.vdnd-virtual-scroll-spacer',\n ) as HTMLElement | null;\n const configuredHeight = virtualScroll.getAttribute('data-item-height');\n const itemHeight = configuredHeight\n ? parseInt(configuredHeight, 10)\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 50);\n\n let totalHeight: number;\n if (spacer) {\n // Get the spacer's explicit height (set via Angular binding)\n totalHeight = parseFloat(spacer.style.height) || 0;\n } else {\n // Fallback: use scrollHeight if spacer not found\n totalHeight = (virtualScroll as HTMLElement).scrollHeight;\n }\n\n // When same-list, spacer height reflects N-1 items (one is hidden)\n // Add 1 back to get true total\n const count = Math.floor(totalHeight / itemHeight);\n return isSameList ? count + 1 : count;\n }\n\n // Check for page-level scroll (vdnd-virtual-content)\n const virtualContent = droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content');\n if (virtualContent) {\n // Use spacer height to determine total items\n const spacer = virtualContent.querySelector('.vdnd-content-spacer') as HTMLElement | null;\n if (spacer) {\n const totalHeight = parseFloat(spacer.style.height) || 0;\n const configuredHeight = virtualContent.getAttribute('data-item-height');\n const itemHeight = configuredHeight\n ? parseInt(configuredHeight, 10)\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 72);\n const count = Math.floor(totalHeight / itemHeight);\n return isSameList ? count + 1 : count;\n }\n }\n\n // Fallback for non-virtual scroll\n const items = droppableElement.querySelectorAll('[data-draggable-id]');\n return items.length + (isSameList ? 1 : 0);\n }\n\n #getDraggedItemHeightFallback(height: number, fallback: number): number {\n return Number.isFinite(height) && height > 0 ? height : fallback;\n }\n}\n","import {\n afterNextRender,\n computed,\n Directive,\n ElementRef,\n EnvironmentInjector,\n inject,\n input,\n isDevMode,\n NgZone,\n OnDestroy,\n OnInit,\n output,\n signal,\n} from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { PositionCalculatorService } from '../services/position-calculator.service';\nimport { AutoScrollService } from '../services/auto-scroll.service';\nimport { ElementCloneService } from '../services/element-clone.service';\nimport { KeyboardDragService } from '../services/keyboard-drag.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport {\n CursorPosition,\n DragEndEvent,\n DragMoveEvent,\n DragStartEvent,\n GrabOffset,\n} from '../models/drag-drop.models';\nimport { VDND_GROUP_TOKEN } from './droppable-group.directive';\n\n/**\n * Makes an element draggable within the virtual scroll drag-and-drop system.\n *\n * @example\n * ```html\n * <!-- With explicit group -->\n * <div\n * vdndDraggable=\"item-1\"\n * vdndDraggableGroup=\"my-group\"\n * [vdndDraggableData]=\"item\">\n * Drag me!\n * </div>\n *\n * <!-- With inherited group from parent vdndGroup directive -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDraggable=\"item-1\" [vdndDraggableData]=\"item\">\n * Drag me!\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndDraggable]',\n host: {\n '[attr.data-draggable-id]': 'vdndDraggable()',\n '[class.vdnd-draggable]': 'true',\n '[class.vdnd-draggable-dragging]': 'isDragging()',\n '[class.vdnd-draggable-disabled]': 'disabled()',\n '[class.vdnd-drag-pending]': 'isPending()',\n '[style.display]': 'isDragging() ? \"none\" : null',\n '[attr.aria-grabbed]': 'isDragging() ? \"true\" : \"false\"',\n '[tabindex]': 'disabled() ? -1 : 0',\n '(mousedown)': 'onPointerDown($event, false)',\n '(touchstart)': 'onPointerDown($event, true)',\n '(keydown.space)': 'onKeyboardActivate($event)',\n '(keydown.enter)': 'onEnterKey($event)',\n '(keydown.arrowup)': 'onArrowUp($event)',\n '(keydown.arrowdown)': 'onArrowDown($event)',\n '(keydown.arrowleft)': 'onArrowLeft($event)',\n '(keydown.arrowright)': 'onArrowRight($event)',\n '(keydown.escape)': 'onEscape()',\n },\n})\nexport class DraggableDirective implements OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #dragState = inject(DragStateService);\n readonly #positionCalculator = inject(PositionCalculatorService);\n readonly #autoScroll = inject(AutoScrollService);\n readonly #elementClone = inject(ElementCloneService);\n readonly #keyboardDrag = inject(KeyboardDragService);\n readonly #dragIndexCalculator = inject(DragIndexCalculatorService);\n readonly #ngZone = inject(NgZone);\n readonly #envInjector = inject(EnvironmentInjector);\n readonly #parentGroup = inject(VDND_GROUP_TOKEN, { optional: true });\n\n /** Unique identifier for this draggable */\n vdndDraggable = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n vdndDraggableGroup = input<string>();\n\n /**\n * Resolved group name - uses explicit input or falls back to parent group.\n * Returns null (and disables drag) if neither is available.\n */\n #hasWarnedMissingGroup = false;\n readonly #effectiveGroup = computed((): string | null => {\n const explicit = this.vdndDraggableGroup();\n if (explicit) return explicit;\n\n const inherited = this.#parentGroup?.group();\n if (inherited) return inherited;\n\n if (isDevMode() && !this.#hasWarnedMissingGroup) {\n console.warn(\n `[ngx-virtual-dnd] [vdndDraggable=\"${this.vdndDraggable()}\"] requires a group. ` +\n 'Either set vdndDraggableGroup or wrap in a vdndGroup directive. ' +\n 'Drag will be disabled for this element.',\n );\n this.#hasWarnedMissingGroup = true;\n }\n\n return null;\n });\n\n /** Optional data associated with this draggable */\n vdndDraggableData = input<unknown>();\n\n /** Whether this draggable is disabled */\n disabled = input<boolean>(false);\n\n /** CSS selector for drag handle (if not provided, entire element is draggable) */\n dragHandle = input<string>();\n\n /** Minimum distance to move before drag starts (prevents accidental drags) */\n dragThreshold = input<number>(5);\n\n /**\n * Delay in milliseconds before drag starts after pointer down.\n * User must hold without moving for this duration.\n * Set to 0 for immediate drag (default behavior).\n */\n dragDelay = input<number>(0);\n\n /** Lock dragging to a single axis ('x' = horizontal only, 'y' = vertical only) */\n lockAxis = input<'x' | 'y' | null>(null);\n\n /** Emits when drag starts */\n dragStart = output<DragStartEvent>();\n\n /** Emits during drag movement */\n dragMove = output<DragMoveEvent>();\n\n /** Emits when drag ends */\n dragEnd = output<DragEndEvent>();\n\n /** Emits when ready-to-drag state changes (after delay passes) */\n dragReadyChange = output<boolean>();\n\n /** Whether this element is in the \"ready to drag\" state (delay has passed) */\n #isPending = signal(false);\n readonly isPending = this.#isPending.asReadonly();\n\n /** Whether this element is currently being dragged (based on global drag state) */\n readonly isDragging = computed(() => {\n const draggedItem = this.#dragState.draggedItem();\n return draggedItem?.draggableId === this.vdndDraggable();\n });\n\n /** Starting position of the drag */\n #startPosition: CursorPosition | null = null;\n\n /** Whether we're currently tracking a potential drag */\n #isTracking = false;\n\n /** Bound event handlers for cleanup */\n #boundPointerMove: ((e: MouseEvent | TouchEvent) => void) | null = null;\n #boundPointerUp: ((e: MouseEvent | TouchEvent) => void) | null = null;\n #boundKeyDown: ((e: KeyboardEvent) => void) | null = null;\n #boundKeyboardDragKeyDown: ((e: KeyboardEvent) => void) | null = null;\n\n /** Request animation frame ID for drag updates */\n #rafId: number | null = null;\n\n /** Timer ID for drag delay */\n #delayTimerId: ReturnType<typeof setTimeout> | null = null;\n\n /** Whether the delay has been satisfied (user held long enough) */\n #delayReady = false;\n\n /**\n * Update the pending state and emit the change event.\n */\n #setPending(pending: boolean): void {\n if (this.#isPending() !== pending) {\n this.#isPending.set(pending);\n this.dragReadyChange.emit(pending);\n }\n }\n\n ngOnInit(): void {\n // Set up event listeners\n this.#boundPointerMove = this.#onPointerMove.bind(this);\n this.#boundPointerUp = this.#onPointerUp.bind(this);\n this.#boundKeyDown = this.#onKeyDown.bind(this);\n this.#boundKeyboardDragKeyDown = this.#onKeyboardDragKeyDown.bind(this);\n }\n\n ngOnDestroy(): void {\n // If destroyed mid-drag, cancel to avoid stale global state / ongoing RAF loops.\n if (this.isDragging()) {\n this.#endDrag(true);\n }\n this.#cleanup();\n this.#cleanupKeyboardDragListeners();\n }\n\n /**\n * Handle pointer down (mouse or touch).\n */\n protected onPointerDown(event: MouseEvent | TouchEvent, isTouch: boolean): void {\n if (this.disabled()) {\n return;\n }\n\n // Without a group, this draggable can't participate in DnD (fail gracefully).\n if (!this.#effectiveGroup()) {\n return;\n }\n\n // Check for left mouse button only\n if (!isTouch && (event as MouseEvent).button !== 0) {\n return;\n }\n\n // Check if click is on drag handle (if specified)\n const handle = this.dragHandle();\n if (handle) {\n const target = event.target as HTMLElement;\n if (!target.closest(handle)) {\n return;\n }\n }\n\n // Check for elements that should not trigger drag\n const target = event.target as HTMLElement;\n if (\n target.closest('button, input, textarea, select, [contenteditable]') ||\n target.classList.contains('no-drag')\n ) {\n return;\n }\n\n const delay = this.dragDelay();\n\n // For touch events with a delay configured, DON'T call preventDefault() on touchstart.\n // This allows native scrolling to work if the user swipes before the delay fires.\n // For mouse events or touch without delay, prevent default immediately to avoid\n // text selection and other default behaviors.\n if (!isTouch || delay === 0) {\n event.preventDefault();\n }\n event.stopPropagation();\n\n this.#isTracking = true;\n this.#startPosition = this.#getPosition(event);\n\n // Handle drag delay\n if (delay > 0) {\n this.#delayReady = false;\n this.#delayTimerId = setTimeout(() => {\n this.#delayReady = true;\n this.#setPending(true); // Emit ready state when delay passes\n this.#delayTimerId = null;\n }, delay);\n } else {\n this.#delayReady = true;\n }\n\n // Add document-level event listeners\n this.#ngZone.runOutsideAngular(() => {\n if (isTouch) {\n document.addEventListener('touchmove', this.#boundPointerMove!, { passive: false });\n document.addEventListener('touchend', this.#boundPointerUp!);\n document.addEventListener('touchcancel', this.#boundPointerUp!);\n } else {\n document.addEventListener('mousemove', this.#boundPointerMove!);\n document.addEventListener('mouseup', this.#boundPointerUp!);\n }\n // Listen for Escape key on document to cancel drag\n document.addEventListener('keydown', this.#boundKeyDown!);\n });\n }\n\n /**\n * Handle pointer move (mouse or touch).\n */\n #onPointerMove(event: MouseEvent | TouchEvent): void {\n if (!this.#isTracking) {\n return;\n }\n\n const position = this.#getPosition(event);\n\n // Check if we've moved past the threshold\n if (!this.isDragging() && this.#startPosition) {\n const distance = Math.sqrt(\n Math.pow(position.x - this.#startPosition.x, 2) +\n Math.pow(position.y - this.#startPosition.y, 2),\n );\n\n if (distance < this.dragThreshold()) {\n return;\n }\n\n // If delay is configured and not yet ready, cancel the drag attempt\n // (user moved before the delay was satisfied).\n // DON'T call preventDefault() here - let native scrolling take over.\n if (!this.#delayReady) {\n this.#cancelDelayTimer();\n this.#cleanup();\n return;\n }\n\n // Start the drag - now we can prevent default\n event.preventDefault();\n this.#startDrag(position);\n } else if (this.isDragging()) {\n // Already dragging - prevent default to stop scrolling\n event.preventDefault();\n }\n\n // Only update drag if we're actually dragging\n if (!this.isDragging()) {\n return;\n }\n\n // Throttle drag updates with requestAnimationFrame\n if (this.#rafId !== null) {\n cancelAnimationFrame(this.#rafId);\n }\n\n this.#rafId = requestAnimationFrame(() => {\n this.#updateDrag(position);\n this.#rafId = null;\n });\n }\n\n /**\n * Cancel the delay timer if active.\n */\n #cancelDelayTimer(): void {\n if (this.#delayTimerId !== null) {\n clearTimeout(this.#delayTimerId);\n this.#delayTimerId = null;\n }\n this.#delayReady = false;\n }\n\n /**\n * Handle pointer up (mouse or touch).\n */\n #onPointerUp(event: MouseEvent | TouchEvent): void {\n if (!this.#isTracking) {\n return;\n }\n\n // Only prevent default if we were actually dragging\n // Otherwise, allow native touch behavior (like scroll momentum) to complete\n if (this.isDragging()) {\n event.preventDefault();\n this.#endDrag(false);\n }\n\n this.#cleanup();\n }\n\n /**\n * Handle keyboard activation (space key).\n * Starts a keyboard drag if not dragging, or drops if already in keyboard drag mode.\n */\n protected onKeyboardActivate(event: Event): void {\n if (this.disabled()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation(); // Prevent document listener from receiving this event\n\n // If we're in a keyboard drag, Space drops the item\n if (this.#keyboardDrag.isActive()) {\n this.#completeKeyboardDrag();\n return;\n }\n\n // If we're in a pointer drag, ignore\n if (this.isDragging()) {\n return;\n }\n\n // Start keyboard drag\n this.#startKeyboardDrag();\n }\n\n /**\n * Handle Enter key (alternative to Space for dropping during keyboard drag).\n */\n protected onEnterKey(event: Event): void {\n if (this.#keyboardDrag.isActive()) {\n event.preventDefault();\n this.#completeKeyboardDrag();\n }\n }\n\n /**\n * Handle ArrowUp key during keyboard drag.\n */\n protected onArrowUp(event: Event): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n event.preventDefault();\n this.#keyboardDrag.moveUp();\n }\n\n /**\n * Handle ArrowDown key during keyboard drag.\n */\n protected onArrowDown(event: Event): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n event.preventDefault();\n this.#keyboardDrag.moveDown();\n }\n\n /**\n * Handle ArrowLeft key during keyboard drag (cross-list movement).\n */\n protected onArrowLeft(event: Event): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n event.preventDefault();\n this.#moveToAdjacentDroppable('left');\n }\n\n /**\n * Handle ArrowRight key during keyboard drag (cross-list movement).\n */\n protected onArrowRight(event: Event): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n event.preventDefault();\n this.#moveToAdjacentDroppable('right');\n }\n\n /**\n * Move to an adjacent droppable in the specified direction.\n */\n #moveToAdjacentDroppable(direction: 'left' | 'right'): void {\n const currentDroppableId = this.#dragState.activeDroppableId();\n if (!currentDroppableId) {\n return;\n }\n\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n return;\n }\n const adjacent = this.#positionCalculator.findAdjacentDroppable(\n currentDroppableId,\n direction,\n groupName,\n );\n\n if (!adjacent) {\n return;\n }\n\n // Maintain the current target index (clamped to the new list's size)\n const currentTargetIndex = this.#keyboardDrag.targetIndex() ?? 0;\n const targetIndex = Math.min(currentTargetIndex, adjacent.itemCount);\n\n this.#keyboardDrag.moveToDroppable(adjacent.id, targetIndex, adjacent.itemCount);\n }\n\n /**\n * Handle escape key to cancel drag (host binding, fires before element is hidden).\n */\n protected onEscape(): boolean {\n if (this.#keyboardDrag.isActive()) {\n this.#cancelKeyboardDrag();\n return false;\n }\n if (this.isDragging()) {\n this.#endDrag(true);\n this.#cleanup();\n return false; // Prevents default\n }\n return true;\n }\n\n /**\n * Start a keyboard drag operation.\n */\n #startKeyboardDrag(): void {\n const element = this.#elementRef.nativeElement;\n const rect = element.getBoundingClientRect();\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n return;\n }\n\n // Find the parent droppable\n const droppableElement = this.#positionCalculator.getDroppableParent(element, groupName);\n if (!droppableElement) {\n return;\n }\n\n const droppableId = this.#positionCalculator.getDroppableId(droppableElement);\n if (!droppableId) {\n return;\n }\n\n // Calculate source index\n const sourceIndex = this.#calculateSourceIndex(element, droppableElement);\n\n // Get total item count from the droppable\n const totalItemCount = this.#dragIndexCalculator.getTotalItemCount({\n droppableElement,\n isSameList: false,\n draggedItemHeight: rect.height,\n });\n\n // Clone element BEFORE updating drag state\n const clonedElement = this.#elementClone.cloneElement(element);\n\n // Start keyboard drag\n this.#keyboardDrag.startKeyboardDrag(\n {\n draggableId: this.vdndDraggable(),\n droppableId,\n element,\n clonedElement,\n height: rect.height,\n width: rect.width,\n data: this.vdndDraggableData(),\n },\n sourceIndex,\n totalItemCount,\n droppableId,\n );\n\n // Add document-level keyboard listener (since element is hidden with display:none)\n this.#ngZone.runOutsideAngular(() => {\n document.addEventListener('keydown', this.#boundKeyboardDragKeyDown!);\n });\n\n // Emit drag start event\n this.dragStart.emit({\n draggableId: this.vdndDraggable(),\n droppableId,\n data: this.vdndDraggableData(),\n position: { x: rect.left, y: rect.top },\n sourceIndex,\n });\n }\n\n /**\n * Complete a keyboard drag operation (drop the item).\n */\n #completeKeyboardDrag(): void {\n const draggableId = this.vdndDraggable();\n const sourceIndex = this.#dragState.sourceIndex() ?? 0;\n const destinationIndex = this.#dragState.placeholderIndex();\n\n // Remove document listener\n this.#cleanupKeyboardDragListeners();\n\n // Emit drag end event\n this.dragEnd.emit({\n draggableId,\n droppableId: this.#getParentDroppableId() ?? '',\n cancelled: false,\n data: this.vdndDraggableData(),\n sourceIndex,\n destinationIndex,\n });\n\n this.#keyboardDrag.completeKeyboardDrag();\n\n // Restore focus to the moved element after state updates\n this.#restoreFocusAfterKeyboardDrag(draggableId);\n }\n\n /**\n * Cancel a keyboard drag operation.\n */\n #cancelKeyboardDrag(): void {\n const draggableId = this.vdndDraggable();\n const sourceIndex = this.#dragState.sourceIndex() ?? 0;\n\n // Remove document listener\n this.#cleanupKeyboardDragListeners();\n\n // Emit drag end event\n this.dragEnd.emit({\n draggableId,\n droppableId: this.#getParentDroppableId() ?? '',\n cancelled: true,\n data: this.vdndDraggableData(),\n sourceIndex,\n destinationIndex: null,\n });\n\n this.#keyboardDrag.cancelKeyboardDrag();\n\n // Restore focus to the original element after state updates\n this.#restoreFocusAfterKeyboardDrag(draggableId);\n }\n\n /**\n * Restore focus to the dragged element after keyboard drag ends.\n * Uses afterNextRender to ensure Angular has finished updating the DOM\n * (element is no longer hidden after isDragging() becomes false).\n *\n * Uses EnvironmentInjector to ensure callback runs even if this directive\n * is destroyed during cross-list moves.\n */\n #restoreFocusAfterKeyboardDrag(draggableId: string): void {\n // Capture the destination droppable BEFORE scheduling afterNextRender\n // (this directive may be destroyed during cross-list moves)\n const destinationDroppableId = this.#dragState.activeDroppableId();\n\n afterNextRender(\n () => {\n const element = document.querySelector(\n `[data-draggable-id=\"${draggableId}\"]`,\n ) as HTMLElement | null;\n\n if (element) {\n element.focus();\n } else if (destinationDroppableId) {\n // Fallback: focus the first draggable in the destination container\n const firstDraggable = document.querySelector(\n `[data-droppable-id=\"${destinationDroppableId}\"] [data-draggable-id]`,\n ) as HTMLElement | null;\n firstDraggable?.focus();\n }\n },\n { injector: this.#envInjector },\n );\n }\n\n /**\n * Clean up keyboard drag document listeners.\n */\n #cleanupKeyboardDragListeners(): void {\n if (this.#boundKeyboardDragKeyDown) {\n document.removeEventListener('keydown', this.#boundKeyboardDragKeyDown);\n }\n }\n\n /**\n * Handle keydown events during keyboard drag (document-level).\n */\n #onKeyboardDragKeyDown(event: KeyboardEvent): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n\n switch (event.key) {\n case ' ': // Space\n event.preventDefault();\n this.#completeKeyboardDrag();\n break;\n case 'Enter':\n event.preventDefault();\n this.#completeKeyboardDrag();\n break;\n case 'Escape':\n event.preventDefault();\n this.#cancelKeyboardDrag();\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.#keyboardDrag.moveUp();\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.#keyboardDrag.moveDown();\n break;\n case 'ArrowLeft':\n event.preventDefault();\n this.#moveToAdjacentDroppable('left');\n break;\n case 'ArrowRight':\n event.preventDefault();\n this.#moveToAdjacentDroppable('right');\n break;\n case 'Tab':\n // Cancel drag on Tab\n event.preventDefault();\n this.#cancelKeyboardDrag();\n break;\n }\n }\n\n /**\n * Start the drag operation.\n */\n #startDrag(position: CursorPosition): void {\n // Clear pending state - drag is now active\n this.#setPending(false);\n\n const element = this.#elementRef.nativeElement;\n const rect = element.getBoundingClientRect();\n\n // Calculate grab offset using the START position (where user initially pressed down)\n // NOT the current position (where drag threshold was exceeded)\n // This ensures the preview maintains its position relative to where the user grabbed it\n const startPos = this.#startPosition ?? position;\n const grabOffset: GrabOffset = {\n x: startPos.x - rect.left,\n y: startPos.y - rect.top,\n };\n\n // Clone element BEFORE updating drag state (which triggers display:none via host binding)\n const clonedElement = this.#elementClone.cloneElement(element);\n\n const parentDroppableId = this.#getParentDroppableId();\n\n // Find droppable and calculate initial placeholder position\n // This fixes the UI glitch by ensuring placeholder is set before the element is hidden\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n // Misconfigured - cancel tracking and don't start drag.\n this.#cleanup();\n return;\n }\n const droppableElement = this.#positionCalculator.findDroppableAtPoint(\n position.x,\n position.y,\n element,\n groupName,\n );\n\n const activeDroppableId = droppableElement\n ? this.#positionCalculator.getDroppableId(droppableElement)\n : parentDroppableId;\n\n // Calculate source index BEFORE the element is hidden (display: none)\n // This is critical because getBoundingClientRect() returns all zeros for hidden elements\n const sourceIndex = this.#calculateSourceIndex(element, droppableElement);\n\n let initialPlaceholderId: string | null = null;\n let initialPlaceholderIndex: number | null = null;\n\n if (droppableElement) {\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position,\n grabOffset,\n draggedItemHeight: rect.height,\n sourceDroppableId: parentDroppableId,\n sourceIndex,\n });\n initialPlaceholderIndex = indexResult.index;\n initialPlaceholderId = indexResult.placeholderId;\n }\n\n const lockAxis = this.lockAxis();\n\n // Register with drag state service - this triggers isDragging computed to become true\n // which will apply display:none via host binding\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n this.#dragState.startDrag(\n {\n draggableId: this.vdndDraggable(),\n droppableId: parentDroppableId ?? '',\n element,\n clonedElement,\n height: rect.height,\n width: rect.width,\n data: this.vdndDraggableData(),\n },\n position,\n grabOffset,\n lockAxis,\n activeDroppableId,\n initialPlaceholderId,\n initialPlaceholderIndex,\n sourceIndex,\n undefined,\n lockAxis ? startPos : undefined,\n );\n\n // Start auto-scroll monitoring with a callback to recalculate placeholder\n this.#autoScroll.startMonitoring(() => this.#recalculatePlaceholder());\n\n // Emit drag start event\n this.dragStart.emit({\n draggableId: this.vdndDraggable(),\n droppableId: parentDroppableId ?? '',\n data: this.vdndDraggableData(),\n position,\n sourceIndex,\n });\n }\n\n /**\n * Calculate the source index of the dragged element BEFORE it's hidden.\n * This must be called before startDrag updates the state (which triggers display:none).\n */\n #calculateSourceIndex(element: HTMLElement, droppableElement: HTMLElement | null): number {\n if (!droppableElement) {\n return 0;\n }\n\n const rect = element.getBoundingClientRect();\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n const scrollableElement = virtualScroll ?? droppableElement;\n const containerRect = scrollableElement.getBoundingClientRect();\n const scrollTop = scrollableElement.scrollTop;\n\n // Get item height from the element itself\n const itemHeight = rect.height || 50;\n\n // Calculate the logical index based on the element's position\n const relativeY = rect.top - containerRect.top + scrollTop;\n return Math.round(relativeY / itemHeight);\n }\n\n /**\n * Recalculate placeholder position (called during auto-scroll).\n */\n #recalculatePlaceholder(): void {\n const cursorPosition = this.#dragState.cursorPosition();\n if (!cursorPosition || !this.isDragging()) {\n return;\n }\n\n // Recalculate placeholder based on current scroll position\n this.#updateDrag(cursorPosition);\n }\n\n /**\n * Update the drag position.\n * @param position Current cursor position\n */\n #updateDrag(position: CursorPosition): void {\n const element = this.#elementRef.nativeElement;\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n // Group became unavailable mid-drag; cancel to avoid inconsistent state.\n this.#endDrag(true);\n this.#cleanup();\n return;\n }\n\n // Apply axis locking to effective position for droppable detection\n // When axis is locked, use the start position for the locked axis\n const axisLock = this.lockAxis();\n let effectivePosition = position;\n\n if (axisLock && this.#startPosition) {\n effectivePosition = {\n x: axisLock === 'x' ? this.#startPosition.x : position.x,\n y: axisLock === 'y' ? this.#startPosition.y : position.y,\n };\n }\n\n // Find droppable at effective position (respects axis locking)\n const droppableElement = this.#positionCalculator.findDroppableAtPoint(\n effectivePosition.x,\n effectivePosition.y,\n element,\n groupName,\n );\n\n const activeDroppableId = droppableElement\n ? this.#positionCalculator.getDroppableId(droppableElement)\n : null;\n\n let placeholderId: string | null = null;\n let placeholderIndex: number | null = null;\n\n if (droppableElement) {\n // Calculate placeholder index based on effective position using mathematical approach\n // This is more stable than DOM-based detection because it doesn't get affected\n // by the placeholder insertion shifting elements around\n const draggedItemHeight = this.#dragState.draggedItem()?.height ?? 50;\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position: effectivePosition,\n grabOffset: this.#dragState.grabOffset(),\n draggedItemHeight,\n sourceDroppableId: this.#dragState.sourceDroppableId(),\n sourceIndex: this.#dragState.sourceIndex(),\n });\n placeholderIndex = indexResult.index;\n placeholderId = indexResult.placeholderId;\n }\n\n // Update drag state with actual cursor position (for preview rendering)\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n this.#dragState.updateDragPosition({\n cursorPosition: position,\n activeDroppableId,\n placeholderId,\n placeholderIndex,\n });\n\n // Emit drag move event\n this.dragMove.emit({\n draggableId: this.vdndDraggable(),\n sourceDroppableId: this.#getParentDroppableId() ?? '',\n targetDroppableId: activeDroppableId,\n placeholderId,\n position,\n targetIndex: placeholderIndex,\n });\n }\n\n /**\n * End the drag operation.\n */\n #endDrag(cancelled: boolean): void {\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n // Stop auto-scroll monitoring\n this.#autoScroll.stopMonitoring();\n\n const sourceIndex = this.#dragState.sourceIndex() ?? 0;\n const placeholderIndex = this.#dragState.placeholderIndex();\n let destinationIndex = cancelled ? null : placeholderIndex;\n\n // Keep DragEndEvent semantics consistent with DropEvent.destination.index.\n // During same-list drag, placeholderIndex includes the hidden-item adjustment,\n // but the final insertion index must account for removal of the source item.\n if (!cancelled && placeholderIndex !== null) {\n const sourceDroppableId = this.#dragState.sourceDroppableId();\n const activeDroppableId = this.#dragState.activeDroppableId();\n if (sourceDroppableId !== null && sourceDroppableId === activeDroppableId) {\n if (sourceIndex < placeholderIndex) {\n destinationIndex = placeholderIndex - 1;\n }\n }\n }\n\n // Emit drag end event\n this.dragEnd.emit({\n draggableId: this.vdndDraggable(),\n droppableId: this.#getParentDroppableId() ?? '',\n cancelled,\n data: this.vdndDraggableData(),\n sourceIndex,\n destinationIndex,\n });\n\n // Clear drag state - this triggers isDragging computed to become false\n if (cancelled) {\n this.#dragState.cancelDrag();\n } else {\n this.#dragState.endDrag();\n }\n }\n\n /**\n * Get the parent droppable ID.\n */\n #getParentDroppableId(): string | null {\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n return null;\n }\n\n const droppable = this.#positionCalculator.getDroppableParent(\n this.#elementRef.nativeElement,\n groupName,\n );\n\n return droppable ? this.#positionCalculator.getDroppableId(droppable) : null;\n }\n\n /**\n * Get position from mouse or touch event.\n */\n #getPosition(event: MouseEvent | TouchEvent): CursorPosition {\n if ('touches' in event) {\n const touch = event.touches[0] ?? event.changedTouches[0];\n return { x: touch.clientX, y: touch.clientY };\n }\n return { x: event.clientX, y: event.clientY };\n }\n\n /**\n * Clean up event listeners and state.\n */\n #cleanup(): void {\n this.#isTracking = false;\n this.#startPosition = null;\n this.#setPending(false); // Clear pending state on cleanup\n this.#cancelDelayTimer();\n\n if (this.#rafId !== null) {\n cancelAnimationFrame(this.#rafId);\n this.#rafId = null;\n }\n\n // Remove event listeners\n if (this.#boundPointerMove) {\n document.removeEventListener('mousemove', this.#boundPointerMove);\n document.removeEventListener('touchmove', this.#boundPointerMove);\n }\n if (this.#boundPointerUp) {\n document.removeEventListener('mouseup', this.#boundPointerUp);\n document.removeEventListener('touchend', this.#boundPointerUp);\n document.removeEventListener('touchcancel', this.#boundPointerUp);\n }\n if (this.#boundKeyDown) {\n document.removeEventListener('keydown', this.#boundKeyDown);\n }\n }\n\n /**\n * Handle keydown events on document to cancel drag with Escape.\n */\n #onKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.isDragging()) {\n // No ngZone.run() needed - #endDrag uses signals which work outside zone\n this.#endDrag(true);\n this.#cleanup();\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\n\n/**\n * Directive that marks an element as a scrollable container for virtual scrolling.\n *\n * Apply this directive to any scrollable element (with `overflow: auto` or `overflow: scroll`)\n * that contains a `*vdndVirtualFor` directive. The virtual scroll will use this element\n * as its scroll container.\n *\n * @example\n * Basic usage with a custom scroll container:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n *\n * @example\n * With Ionic ion-content:\n * ```html\n * <ion-content vdndScrollable class=\"ion-content-scroll-host\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </ion-content>\n * ```\n *\n * @example\n * With auto-scroll configuration:\n * ```html\n * <div vdndScrollable\n * [autoScrollEnabled]=\"true\"\n * [autoScrollConfig]=\"{ threshold: 80, maxSpeed: 20 }\"\n * style=\"overflow: auto; height: 400px;\">\n * ...\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndScrollable]',\n providers: [{ provide: VDND_SCROLL_CONTAINER, useExisting: ScrollableDirective }],\n host: {\n class: 'vdnd-scrollable',\n '[style.overflow-anchor]': '\"none\"',\n },\n})\nexport class ScrollableDirective implements VdndScrollContainer, OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n readonly #autoScrollService = inject(AutoScrollService);\n\n /** Current scroll position (reactive) */\n readonly #scrollTop = signal(0);\n\n /** Measured container height (reactive) */\n readonly #containerHeight = signal(0);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-scroll-${Math.random().toString(36).slice(2, 9)}`;\n\n // ========== Inputs ==========\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== VdndScrollContainer Implementation ==========\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n scrollTop(): number {\n return this.#scrollTop();\n }\n\n scrollTo(options: ScrollToOptions): void {\n this.nativeElement.scrollTo(options);\n }\n\n // ========== Additional API ==========\n\n /** Get the measured container height */\n containerHeight(): number {\n return this.#containerHeight();\n }\n\n /** Scroll by a delta amount */\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(\n this.scrollTop() + delta,\n this.nativeElement.scrollHeight - this.nativeElement.clientHeight,\n ),\n );\n this.scrollTo({ top: newPosition });\n }\n\n // ========== Lifecycle ==========\n\n ngOnInit(): void {\n this.#setupScrollListener();\n this.#setupResizeObserver();\n this.#registerAutoScroll();\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n this.#unregisterAutoScroll();\n }\n\n // ========== Private Methods ==========\n\n /** Minimum scroll delta (px) to trigger signal update */\n readonly #scrollThreshold = 5;\n\n #setupScrollListener(): void {\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: this.#scrollThreshold,\n });\n }\n\n #setupResizeObserver(): void {\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n height: this.#containerHeight,\n minDeltaPx: 1,\n });\n }\n\n #registerAutoScroll(): void {\n if (this.autoScrollEnabled()) {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.registerContainer(id, this.nativeElement, this.autoScrollConfig());\n }\n }\n\n #unregisterAutoScroll(): void {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.unregisterContainer(id);\n }\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n EmbeddedViewRef,\n inject,\n Injector,\n input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { VDND_SCROLL_CONTAINER } from '../tokens/scroll-container.token';\nimport { VDND_VIRTUAL_VIEWPORT } from '../tokens/virtual-viewport.token';\nimport { DragStateService } from '../services/drag-state.service';\n\n/**\n * Context provided to the template for each virtual item.\n */\nexport interface VirtualForContext<T> {\n /** The item data (also available as implicit context) */\n $implicit: T;\n /** The item's index in the original array */\n index: number;\n /** Whether this is the first visible item */\n first: boolean;\n /** Whether this is the last visible item */\n last: boolean;\n /** Count of total items */\n count: number;\n}\n\n/**\n * A structural directive for virtual scrolling within custom scroll containers.\n * Provides maximum flexibility for advanced use cases where the component wrapper\n * is not suitable.\n *\n * The directive must be placed inside a container marked with the `vdndScrollable`\n * directive, which provides the scroll container context via dependency injection.\n *\n * Placeholders are handled automatically by the parent component (vdnd-virtual-scroll\n * or vdnd-virtual-content) - consumers just render their items normally.\n *\n * @example\n * Basic usage:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n *\n * @example\n * With Ionic ion-content:\n * ```html\n * <ion-content vdndScrollable class=\"ion-content-scroll-host\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </ion-content>\n * ```\n */\n@Directive({\n selector: '[vdndVirtualFor][vdndVirtualForOf]',\n})\nexport class VirtualForDirective<T> implements OnInit, OnDestroy {\n readonly #templateRef = inject(TemplateRef<VirtualForContext<T>>);\n readonly #viewContainer = inject(ViewContainerRef);\n readonly #elementRef = inject(ElementRef<Comment>);\n readonly #scrollContainer = inject(VDND_SCROLL_CONTAINER);\n readonly #injector = inject(Injector);\n readonly #dragState = inject(DragStateService);\n\n /**\n * Optional viewport component that provides wrapper-based positioning.\n * When inside a viewport, items are positioned via the wrapper's transform,\n * so we skip individual absolute positioning.\n */\n readonly #viewport = inject(VDND_VIRTUAL_VIEWPORT, { optional: true });\n\n /** Whether we're inside a viewport component (use wrapper positioning) */\n readonly #useViewportPositioning = this.#viewport !== null;\n\n /** Pool of views for reuse */\n readonly #viewPool: EmbeddedViewRef<VirtualForContext<T>>[] = [];\n\n /** Currently active views keyed by their track-by value */\n readonly #activeViews = new Map<unknown, EmbeddedViewRef<VirtualForContext<T>>>();\n\n /** Single spacer element for scroll height */\n #spacer: HTMLDivElement | null = null;\n\n /** Placeholder element for drag operations */\n #placeholder: HTMLDivElement | null = null;\n\n /** Whether placeholder is currently in the DOM */\n #placeholderInDom = false;\n\n // ========== Inputs ==========\n\n /** The array of items to iterate over */\n vdndVirtualForOf = input.required<T[]>();\n\n /** Height of each item in pixels */\n vdndVirtualForItemHeight = input.required<number>();\n\n /** Track-by function for efficient updates */\n vdndVirtualForTrackBy = input.required<(index: number, item: T) => unknown>();\n\n /** Number of items to render outside the visible area */\n vdndVirtualForOverscan = input<number>(3);\n\n /**\n * ID of the droppable this directive belongs to.\n * Required for placeholder positioning during drag operations.\n */\n vdndVirtualForDroppableId = input<string>();\n\n // ========== Placeholder Computed Values ==========\n\n /** Whether the placeholder should be shown in this container */\n readonly #shouldShowPlaceholder = computed(() => {\n const droppableId = this.vdndVirtualForDroppableId();\n if (!droppableId) return false;\n if (!this.#dragState.isDragging()) return false;\n return this.#dragState.activeDroppableId() === droppableId;\n });\n\n /** The placeholder index when placeholder should be shown */\n readonly #placeholderIndex = computed(() => {\n if (!this.#shouldShowPlaceholder()) return -1;\n return this.#dragState.placeholderIndex() ?? -1;\n });\n\n // ========== Computed Values ==========\n\n /** First visible item index */\n readonly #firstVisibleIndex = computed(() => {\n const itemHeight = this.vdndVirtualForItemHeight();\n if (itemHeight <= 0) return 0;\n return Math.floor(this.#scrollContainer.scrollTop() / itemHeight);\n });\n\n /** Number of visible items */\n readonly #visibleCount = computed(() => {\n const height = this.#scrollContainer.containerHeight();\n const itemHeight = this.vdndVirtualForItemHeight();\n if (height <= 0 || itemHeight <= 0) return 0;\n return Math.ceil(height / itemHeight);\n });\n\n /** Range of items to render */\n readonly #renderRange = computed(() => {\n const first = this.#firstVisibleIndex();\n const visible = this.#visibleCount();\n const overscan = this.vdndVirtualForOverscan();\n const total = this.vdndVirtualForOf().length;\n\n const start = Math.max(0, first - overscan);\n const end = Math.min(total - 1, first + visible + overscan);\n\n return { start, end };\n });\n\n /** Map of trackBy keys to item indices for quick lookup */\n readonly #itemIndexMap = computed(() => {\n const items = this.vdndVirtualForOf();\n const trackByFn = this.vdndVirtualForTrackBy();\n const map = new Map<unknown, number>();\n for (let i = 0; i < items.length; i++) {\n map.set(trackByFn(i, items[i]), i);\n }\n return map;\n });\n\n /** Index of the dragged item in this list (-1 if not present or not dragging) */\n readonly #draggedItemIndex = computed(() => {\n const draggedItem = this.#dragState.draggedItem();\n if (!draggedItem) return -1;\n\n const byId = this.#itemIndexMap().get(draggedItem.draggableId);\n if (byId !== undefined) {\n return byId;\n }\n\n const data = draggedItem.data as T | null | undefined;\n if (data !== null && data !== undefined) {\n return this.vdndVirtualForOf().indexOf(data);\n }\n\n return -1;\n });\n\n constructor() {\n // React to changes and update views\n effect(() => {\n this.#updateViews();\n });\n }\n\n ngOnInit(): void {\n // Only create spacer when NOT inside a viewport component\n // (viewport provides its own spacer and wrapper positioning)\n if (!this.#useViewportPositioning) {\n this.#updateSpacers();\n }\n\n // Create placeholder element for drag operations\n this.#createPlaceholder();\n }\n\n ngOnDestroy(): void {\n this.#viewPool.forEach((view) => view.destroy());\n this.#activeViews.forEach((view) => view.destroy());\n\n // Clean up spacer element (only if we created one)\n this.#spacer?.remove();\n\n // Clean up placeholder element\n this.#placeholder?.remove();\n }\n\n /**\n * Create the placeholder element for drag operations.\n */\n #createPlaceholder(): void {\n const placeholder = document.createElement('div');\n placeholder.className = 'vdnd-drag-placeholder vdnd-drag-placeholder-visible';\n placeholder.style.cssText = 'display: block; pointer-events: none;';\n this.#placeholder = placeholder;\n }\n\n /**\n * Set up spacer element for scroll height.\n */\n #updateSpacers(): void {\n // Create single spacer that maintains total scroll height\n const spacer = document.createElement('div');\n spacer.className = 'vdnd-virtual-for-spacer';\n spacer.style.cssText =\n 'position: absolute; top: 0; left: 0; width: 1px; visibility: hidden; pointer-events: none;';\n\n // Insert spacer before the directive's anchor comment\n const comment = this.#elementRef.nativeElement;\n comment.parentNode?.insertBefore(spacer, comment);\n\n this.#spacer = spacer;\n\n // Update spacer height reactively\n // Must pass injector since we're outside constructor\n effect(\n () => {\n const itemHeight = this.vdndVirtualForItemHeight();\n const total = this.vdndVirtualForOf().length;\n\n // Single spacer with full content height\n spacer.style.height = `${total * itemHeight}px`;\n },\n { injector: this.#injector },\n );\n }\n\n /**\n * Update the rendered views with true view recycling.\n * Views are kept in the DOM and have their context updated in place when possible.\n */\n #updateViews(): void {\n const items = this.vdndVirtualForOf();\n const { start, end } = this.#renderRange();\n const trackByFn = this.vdndVirtualForTrackBy();\n const itemHeight = this.vdndVirtualForItemHeight();\n const placeholderIndex = this.#placeholderIndex();\n const showPlaceholder = this.#shouldShowPlaceholder();\n const draggedIndex = this.#draggedItemIndex();\n const droppableId = this.vdndVirtualForDroppableId();\n const sourceDroppableId = this.#dragState.sourceDroppableId();\n const isSourceList = droppableId ? droppableId === sourceDroppableId : true;\n const shouldKeepDragged =\n this.#dragState.isDragging() &&\n draggedIndex >= 0 &&\n isSourceList &&\n draggedIndex < items.length;\n\n // Notify viewport of render start index for wrapper positioning.\n // Adjust when the dragged item is above the rendered range so the wrapper\n // stays aligned with the collapsed list (dragged item is display:none).\n const shouldAdjustRenderStart =\n this.#useViewportPositioning &&\n this.#dragState.isDragging() &&\n isSourceList &&\n draggedIndex >= 0 &&\n draggedIndex < start;\n const renderStartIndex = shouldAdjustRenderStart ? Math.max(0, start - 1) : start;\n this.#viewport?.setRenderStartIndex(renderStartIndex);\n\n // 1. Calculate which keys we need and build the ordered list of items to render\n const itemsToRender: {\n type: 'item' | 'placeholder';\n key: unknown;\n context: VirtualForContext<T> | null;\n visualIndex: number;\n }[] = [];\n\n for (let i = start; i <= end && i < items.length; i++) {\n // Insert placeholder before item at placeholderIndex\n if (\n showPlaceholder &&\n placeholderIndex === i &&\n !itemsToRender.some((r) => r.type === 'placeholder')\n ) {\n itemsToRender.push({\n type: 'placeholder',\n key: '__placeholder__',\n context: null,\n visualIndex: placeholderIndex,\n });\n }\n\n const item = items[i];\n itemsToRender.push({\n type: 'item',\n key: trackByFn(i, item),\n context: {\n $implicit: item,\n index: i,\n first: i === start,\n last: i === end || i === items.length - 1,\n count: items.length,\n },\n visualIndex: i,\n });\n }\n\n // If placeholder is at the end (after all rendered items), add it\n if (\n showPlaceholder &&\n placeholderIndex >= items.length &&\n !itemsToRender.some((r) => r.type === 'placeholder')\n ) {\n itemsToRender.push({\n type: 'placeholder',\n key: '__placeholder__',\n context: null,\n visualIndex: placeholderIndex,\n });\n }\n\n // Keep the dragged item view alive when it scrolls out of range.\n // This prevents the draggable directive from being recycled during long autoscrolls.\n if (shouldKeepDragged && (draggedIndex < start || draggedIndex > end)) {\n const draggedItem = items[draggedIndex];\n const draggedKey = trackByFn(draggedIndex, draggedItem);\n const alreadyRendered = itemsToRender.some(\n (entry) => entry.type === 'item' && entry.key === draggedKey,\n );\n if (!alreadyRendered) {\n itemsToRender.push({\n type: 'item',\n key: draggedKey,\n context: {\n $implicit: draggedItem,\n index: draggedIndex,\n first: draggedIndex === 0,\n last: draggedIndex === items.length - 1,\n count: items.length,\n },\n visualIndex: draggedIndex,\n });\n }\n }\n\n const neededKeys = new Set(\n itemsToRender.filter((r) => r.type === 'item').map((item) => item.key),\n );\n\n // 2. Remove views we no longer need (move to pool)\n for (const [key, view] of this.#activeViews) {\n if (!neededKeys.has(key)) {\n const index = this.#viewContainer.indexOf(view);\n if (index >= 0) {\n this.#viewContainer.detach(index);\n }\n this.#viewPool.push(view);\n this.#activeViews.delete(key);\n }\n }\n\n // Remove placeholder from DOM if not needed\n if (!showPlaceholder && this.#placeholderInDom && this.#placeholder) {\n this.#placeholder.remove();\n this.#placeholderInDom = false;\n }\n\n // 3. First, process all item views (placeholder is handled separately via DOM)\n let viewContainerIndex = 0;\n let placeholderDomPosition = -1; // Track where placeholder should go in DOM\n\n for (const entry of itemsToRender) {\n if (entry.type === 'placeholder') {\n // Remember the DOM position for placeholder (based on how many items rendered before it)\n placeholderDomPosition = viewContainerIndex;\n continue;\n }\n\n // Handle regular item\n const { key, context } = entry;\n let view = this.#activeViews.get(key);\n\n if (view) {\n // View exists - update context in place (no DOM manipulation needed)\n Object.assign(view.context, context!);\n view.markForCheck();\n } else {\n // Need a new view - try pool first, then create\n view = this.#viewPool.pop();\n if (view) {\n Object.assign(view.context, context!);\n view.markForCheck();\n } else {\n view = this.#templateRef.createEmbeddedView(context!);\n }\n this.#activeViews.set(key, view);\n }\n\n // Ensure view is in ViewContainerRef at correct position\n const currentIndex = this.#viewContainer.indexOf(view);\n if (currentIndex !== viewContainerIndex) {\n if (currentIndex >= 0) {\n this.#viewContainer.move(view, viewContainerIndex);\n } else {\n this.#viewContainer.insert(view, viewContainerIndex);\n }\n }\n\n // Apply absolute positioning only when NOT inside a viewport component\n // (viewport provides wrapper-based transform positioning)\n if (!this.#useViewportPositioning) {\n const topOffset = entry.visualIndex * itemHeight;\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n node.style.position = 'absolute';\n node.style.top = `${topOffset}px`;\n node.style.left = '0';\n node.style.right = '0';\n }\n }\n }\n\n viewContainerIndex++;\n }\n\n // 4. Handle placeholder DOM insertion (separate from ViewContainerRef)\n if (showPlaceholder && this.#placeholder && placeholderDomPosition >= 0) {\n this.#placeholder.style.height = `${itemHeight}px`;\n\n // Get the container element (parent of views)\n const container = this.#viewContainer.element.nativeElement.parentElement;\n if (container) {\n // Find the element to insert before (nth child, excluding spacers and placeholder itself)\n const children = Array.from(container.children).filter((el) => {\n const element = el as Element;\n return (\n !element.classList.contains('vdnd-drag-placeholder') &&\n !element.classList.contains('vdnd-virtual-for-spacer') &&\n !element.classList.contains('vdnd-content-spacer')\n );\n });\n const insertBeforeEl = children[placeholderDomPosition] ?? null;\n\n if (!this.#placeholderInDom) {\n if (insertBeforeEl) {\n container.insertBefore(this.#placeholder, insertBeforeEl);\n } else {\n container.appendChild(this.#placeholder);\n }\n this.#placeholderInDom = true;\n } else {\n // Move placeholder to correct position if needed\n const currentNextSibling = this.#placeholder.nextElementSibling;\n if (insertBeforeEl !== currentNextSibling) {\n if (insertBeforeEl) {\n container.insertBefore(this.#placeholder, insertBeforeEl);\n } else {\n container.appendChild(this.#placeholder);\n }\n }\n }\n }\n }\n\n // 4. Destroy unused views in pool (keep some for reuse)\n while (this.#viewPool.length > 10) {\n const view = this.#viewPool.pop();\n view?.destroy();\n }\n }\n\n /**\n * Static method for Angular's structural directive microsyntax.\n */\n static ngTemplateContextGuard<T>(\n _dir: VirtualForDirective<T>,\n _ctx: unknown,\n ): _ctx is VirtualForContext<T> {\n return true;\n }\n}\n","import { WritableSignal } from '@angular/core';\nimport { DropEvent } from '../models/drag-drop.models';\n\n/**\n * Moves an item between signal-based lists based on a drop event.\n * Handles both same-list reordering and cross-list moves.\n *\n * @example\n * ```typescript\n * // In your component:\n * readonly list1 = signal<Item[]>([...]);\n * readonly list2 = signal<Item[]>([...]);\n *\n * onDrop(event: DropEvent): void {\n * moveItem(event, {\n * 'list-1': this.list1,\n * 'list-2': this.list2,\n * });\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param lists A map of droppable IDs to their corresponding WritableSignal arrays\n */\nexport function moveItem<T>(event: DropEvent, lists: Record<string, WritableSignal<T[]>>): void {\n const sourceList = lists[event.source.droppableId];\n const destList = lists[event.destination.droppableId];\n\n if (!sourceList || !destList) {\n console.warn(\n `[moveItem] Could not find list for droppable \"${event.source.droppableId}\" or \"${event.destination.droppableId}\"`,\n );\n return;\n }\n\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n // Same list reorder\n if (event.source.droppableId === event.destination.droppableId) {\n reorderItems(event, sourceList);\n return;\n }\n\n // Cross-list move\n const sourceItems = sourceList();\n const item = sourceItems[sourceIndex];\n\n if (item === undefined) {\n console.warn(`[moveItem] Could not find item at index ${sourceIndex}`);\n return;\n }\n\n // Remove from source\n sourceList.update((items) => {\n const newItems = [...items];\n newItems.splice(sourceIndex, 1);\n return newItems;\n });\n\n // Insert at destination\n destList.update((items) => {\n const newItems = [...items];\n newItems.splice(destIndex, 0, item);\n return newItems;\n });\n}\n\n/**\n * Reorders items within a single signal-based list.\n *\n * @example\n * ```typescript\n * readonly items = signal<Item[]>([...]);\n *\n * onDrop(event: DropEvent): void {\n * reorderItems(event, this.items);\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param list The WritableSignal array to reorder\n */\nexport function reorderItems<T>(event: DropEvent, list: WritableSignal<T[]>): void {\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n // No-op if same position\n if (sourceIndex === destIndex) {\n return;\n }\n\n list.update((items) => {\n const newItems = [...items];\n const [removed] = newItems.splice(sourceIndex, 1);\n\n // Note: destination.index from DropEvent is already adjusted for same-list\n // reordering by DroppableDirective.#handleDrop(), so we use it directly.\n newItems.splice(destIndex, 0, removed);\n return newItems;\n });\n}\n\n/**\n * Applies a move operation immutably, returning new array objects.\n * Useful for state management patterns that require immutable updates.\n *\n * @example\n * ```typescript\n * onDrop(event: DropEvent): void {\n * const { list1, list2 } = applyMove(event, {\n * 'list-1': this.list1,\n * 'list-2': this.list2,\n * });\n * // Use the returned arrays with your state management\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param lists A map of droppable IDs to their corresponding arrays\n * @returns A new object with the same keys but updated arrays\n */\nexport function applyMove<T>(event: DropEvent, lists: Record<string, T[]>): Record<string, T[]> {\n const result = { ...lists };\n const sourceKey = event.source.droppableId;\n const destKey = event.destination.droppableId;\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n const sourceItems = [...(lists[sourceKey] ?? [])];\n const item = sourceItems[sourceIndex];\n\n if (item === undefined) {\n return result;\n }\n\n // Same list reorder\n // Note: destination.index from DropEvent is already adjusted for same-list\n // reordering by DroppableDirective.#handleDrop(), so we use it directly.\n if (sourceKey === destKey) {\n const [removed] = sourceItems.splice(sourceIndex, 1);\n sourceItems.splice(destIndex, 0, removed);\n result[sourceKey] = sourceItems;\n return result;\n }\n\n // Cross-list move\n const destItems = [...(lists[destKey] ?? [])];\n sourceItems.splice(sourceIndex, 1);\n destItems.splice(destIndex, 0, item);\n\n result[sourceKey] = sourceItems;\n result[destKey] = destItems;\n\n return result;\n}\n\n/**\n * Checks if a drop event represents a no-op (item dropped in its original position).\n * Useful for skipping unnecessary state updates.\n *\n * @example\n * ```typescript\n * onDrop(event: DropEvent): void {\n * if (isNoOpDrop(event)) {\n * return; // No action needed\n * }\n * moveItem(event, this.lists);\n * }\n * ```\n *\n * @param event The drop event to check\n * @returns true if the drop would result in no change\n */\nexport function isNoOpDrop(event: DropEvent): boolean {\n return (\n event.source.droppableId === event.destination.droppableId &&\n event.source.index === event.destination.index\n );\n}\n\n/**\n * Creates a new list with the item inserted at the specified index.\n * Low-level utility for custom implementations.\n *\n * @param list The source array\n * @param item The item to insert\n * @param index The index to insert at\n * @returns A new array with the item inserted\n */\nexport function insertAt<T>(list: T[], item: T, index: number): T[] {\n const result = [...list];\n result.splice(index, 0, item);\n return result;\n}\n\n/**\n * Creates a new list with the item at the specified index removed.\n * Low-level utility for custom implementations.\n *\n * @param list The source array\n * @param index The index to remove\n * @returns A new array with the item removed\n */\nexport function removeAt<T>(list: T[], index: number): T[] {\n const result = [...list];\n result.splice(index, 1);\n return result;\n}\n","// Models\nexport * from './models/drag-drop.models';\n\n// Tokens\nexport { VDND_SCROLL_CONTAINER } from './tokens/scroll-container.token';\nexport type { VdndScrollContainer } from './tokens/scroll-container.token';\nexport { VDND_VIRTUAL_VIEWPORT } from './tokens/virtual-viewport.token';\nexport type { VdndVirtualViewport } from './tokens/virtual-viewport.token';\n\n// Services\nexport { DragStateService } from './services/drag-state.service';\nexport { PositionCalculatorService } from './services/position-calculator.service';\nexport { AutoScrollService } from './services/auto-scroll.service';\nexport type { AutoScrollConfig } from './services/auto-scroll.service';\nexport { ElementCloneService } from './services/element-clone.service';\nexport { KeyboardDragService } from './services/keyboard-drag.service';\n\n// Components\nexport { VirtualScrollContainerComponent } from './components/virtual-scroll-container.component';\nexport type {\n VirtualScrollItemContext,\n VisibleRangeChange,\n} from './components/virtual-scroll-container.component';\nexport { DragPreviewComponent } from './components/drag-preview.component';\nexport type { DragPreviewContext } from './components/drag-preview.component';\nexport { PlaceholderComponent } from './components/placeholder.component';\nexport type { PlaceholderContext } from './components/placeholder.component';\nexport { DragPlaceholderComponent } from './components/drag-placeholder.component';\nexport { VirtualSortableListComponent } from './components/virtual-sortable-list.component';\nexport { VirtualViewportComponent } from './components/virtual-viewport.component';\nexport { VirtualContentComponent } from './components/virtual-content.component';\n\n// Directives\nexport { DraggableDirective } from './directives/draggable.directive';\nexport { DroppableDirective } from './directives/droppable.directive';\nexport { DroppableGroupDirective, VDND_GROUP_TOKEN } from './directives/droppable-group.directive';\nexport type { VdndGroupContext } from './directives/droppable-group.directive';\nexport { ScrollableDirective } from './directives/scrollable.directive';\nexport { VirtualForDirective } from './directives/virtual-for.directive';\nexport type { VirtualForContext } from './directives/virtual-for.directive';\n\n// Utilities\nexport {\n moveItem,\n reorderItems,\n applyMove,\n isNoOpDrop,\n insertAt,\n removeAt,\n} from './utils/drop-helpers';\n","/*\n * Public API Surface of ngx-virtual-dnd\n */\n\nexport * from './lib/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAiMA;;AAEG;AACI,MAAM,kBAAkB,GAAc;AAC3C,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB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AI,EAAE,CAAC,CAAC;AAC7C,IAAA,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IAClC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC;AAEpC,IAAA,MAAM,CAAC,SAAS,CAAC,GAAG,WAAW;AAC/B,IAAA,MAAM,CAAC,OAAO,CAAC,GAAG,SAAS;AAE3B,IAAA,OAAO,MAAM;AACf;AAEA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,UAAU,CAAC,KAAgB,EAAA;IACzC,QACE,KAAK,CAAC,MAAM,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW,CAAC,WAAW;QAC1D,KAAK,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,WAAW,CAAC,KAAK;AAElD;AAEA;;;;;;;;AAQG;SACa,QAAQ,CAAI,IAAS,EAAE,IAAO,EAAE,KAAa,EAAA;AAC3D,IAAA,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC;AAC7B,IAAA,OAAO,MAAM;AACf;AAEA;;;;;;;AAOG;AACG,SAAU,QAAQ,CAAI,IAAS,EAAE,KAAa,EAAA;AAClD,IAAA,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;AACxB,IAAA,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AACvB,IAAA,OAAO,MAAM;AACf;;AChNA;;ACAA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-virtual-dnd.mjs","sources":["../../../projects/ngx-virtual-dnd/src/lib/models/drag-drop.models.ts","../../../projects/ngx-virtual-dnd/src/lib/tokens/scroll-container.token.ts","../../../projects/ngx-virtual-dnd/src/lib/tokens/virtual-viewport.token.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-state.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/position-calculator.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/auto-scroll.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/element-clone.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/keyboard-drag.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/overlay-container.service.ts","../../../projects/ngx-virtual-dnd/src/lib/components/drag-placeholder.component.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/dom-signal-bindings.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-scroll-container.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/drag-preview.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/placeholder.component.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/droppable-group.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/group-resolution.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/droppable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-sortable-list.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-viewport.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-content.component.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-index-calculator.service.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/draggable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/scrollable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/virtual-for.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/drop-helpers.ts","../../../projects/ngx-virtual-dnd/src/lib/index.ts","../../../projects/ngx-virtual-dnd/src/public-api.ts","../../../projects/ngx-virtual-dnd/src/ngx-virtual-dnd.ts"],"sourcesContent":["/**\n * Represents the item currently being dragged.\n */\nexport interface DraggedItem {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Reference to the dragged element */\n element: HTMLElement;\n /** Cloned element for use in drag preview (auto-generated) */\n clonedElement?: HTMLElement;\n /** Height of the dragged element in pixels */\n height: number;\n /** Width of the dragged element in pixels */\n width: number;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n}\n\n/**\n * Current position of the cursor during drag.\n */\nexport interface CursorPosition {\n x: number;\n y: number;\n}\n\n/**\n * Offset from cursor to the top-left corner of the dragged element.\n * Used to maintain grab position during drag.\n */\nexport interface GrabOffset {\n x: number;\n y: number;\n}\n\n/**\n * Complete state of the drag-and-drop system.\n */\nexport interface DragState {\n /** Whether a drag operation is currently in progress */\n isDragging: boolean;\n /** Information about the item being dragged */\n draggedItem: DraggedItem | null;\n /** ID of the droppable where the drag started */\n sourceDroppableId: string | null;\n /** Original index of the dragged item in the source list */\n sourceIndex: number | null;\n /** ID of the droppable currently being hovered over */\n activeDroppableId: string | null;\n /** ID of the item the placeholder should appear before, or 'END_OF_LIST' */\n placeholderId: string | null;\n /** Index where the placeholder should be inserted (more stable than placeholderId) */\n placeholderIndex: number | null;\n /** Current cursor position */\n cursorPosition: CursorPosition | null;\n /** Offset from cursor to element top-left (for maintaining grab position) */\n grabOffset: GrabOffset | null;\n /** Position when drag started (for axis locking) */\n initialPosition: CursorPosition | null;\n /** Axis to lock movement to ('x' = horizontal only, 'y' = vertical only) */\n lockAxis: 'x' | 'y' | null;\n /** Whether this is a keyboard-initiated drag */\n isKeyboardDrag: boolean;\n /** Target index during keyboard navigation */\n keyboardTargetIndex: number | null;\n}\n\n/**\n * Event emitted when a drag operation starts.\n */\nexport interface DragStartEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n /** Position where the drag started */\n position: CursorPosition;\n /** 0-indexed position in the source list (for screen reader announcements) */\n sourceIndex: number;\n}\n\n/**\n * Event emitted during drag movement.\n */\nexport interface DragMoveEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n sourceDroppableId: string;\n /** ID of the droppable currently being hovered, or null */\n targetDroppableId: string | null;\n /** ID of the item to insert before, or null */\n placeholderId: string | null;\n /** Current cursor position */\n position: CursorPosition;\n /** Current 0-indexed placeholder position (for screen reader announcements) */\n targetIndex: number | null;\n}\n\n/**\n * Event emitted when an item enters a droppable container.\n */\nexport interface DragEnterEvent {\n /** ID of the droppable being entered */\n droppableId: string;\n /** Information about the dragged item */\n draggedItem: DraggedItem;\n}\n\n/**\n * Event emitted when an item leaves a droppable container.\n */\nexport interface DragLeaveEvent {\n /** ID of the droppable being left */\n droppableId: string;\n /** Information about the dragged item */\n draggedItem: DraggedItem;\n}\n\n/**\n * Event emitted while hovering over a droppable container.\n */\nexport interface DragOverEvent {\n /** ID of the droppable being hovered */\n droppableId: string;\n /** Information about the dragged item */\n draggedItem: DraggedItem;\n /** ID of the item the placeholder should appear before */\n placeholderId: string | null;\n /** Current cursor position */\n position: CursorPosition;\n}\n\n/**\n * Source information for a drop event.\n */\nexport interface DropSource {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Original index in the source list */\n index: number;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n}\n\n/**\n * Destination information for a drop event.\n */\nexport interface DropDestination {\n /** ID of the droppable container receiving the item */\n droppableId: string;\n /** ID of the item to insert before, or 'END_OF_LIST' */\n placeholderId: string;\n /** Target index in the destination list */\n index: number;\n /** Optional user-provided data associated with the droppable */\n data?: unknown;\n}\n\n/**\n * Event emitted when an item is dropped.\n */\nexport interface DropEvent {\n /** Information about where the item came from */\n source: DropSource;\n /** Information about where the item is going */\n destination: DropDestination;\n}\n\n/**\n * Event emitted when a drag operation ends (including cancel).\n */\nexport interface DragEndEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Whether the drag was cancelled (escaped, dropped outside) */\n cancelled: boolean;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n /** Original 0-indexed position in source list (for cancel announcements) */\n sourceIndex: number;\n /** Final 0-indexed position (null if cancelled) */\n destinationIndex: number | null;\n}\n\n/**\n * Initial state for the drag state service.\n */\nexport const INITIAL_DRAG_STATE: DragState = {\n isDragging: false,\n draggedItem: null,\n sourceDroppableId: null,\n sourceIndex: null,\n activeDroppableId: null,\n placeholderId: null,\n placeholderIndex: null,\n cursorPosition: null,\n grabOffset: null,\n initialPosition: null,\n lockAxis: null,\n isKeyboardDrag: false,\n keyboardTargetIndex: null,\n};\n\n/**\n * Placeholder ID used when dropping at the end of a list.\n */\nexport const END_OF_LIST = 'END_OF_LIST';\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Interface for a scroll container that can be used with VirtualForDirective.\n * Implement this interface to create custom scroll containers.\n *\n * The scrollTop() and containerHeight() methods should return reactive values\n * (internally backed by signals) so that changes trigger re-computation in\n * the virtual scroll directive.\n */\nexport interface VdndScrollContainer {\n /** The native HTML element that handles scrolling */\n readonly nativeElement: HTMLElement;\n\n /** Current scroll position from top in pixels (reactive) */\n scrollTop(): number;\n\n /** Current container height in pixels (reactive) */\n containerHeight(): number;\n\n /** Scroll to a specific position */\n scrollTo(options: ScrollToOptions): void;\n}\n\n/**\n * Injection token for providing a scroll container to VirtualForDirective.\n *\n * Use the `vdndScrollable` directive to provide this token, or implement\n * `VdndScrollContainer` and provide it manually.\n *\n * @example\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n */\nexport const VDND_SCROLL_CONTAINER = new InjectionToken<VdndScrollContainer>(\n 'VDND_SCROLL_CONTAINER'\n);\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Interface for a virtual viewport that provides wrapper-based positioning.\n * Components implementing this interface provide a content wrapper with\n * GPU-accelerated transform positioning for efficient virtual scrolling.\n */\nexport interface VdndVirtualViewport {\n /** Current scroll position */\n scrollTop(): number;\n\n /** Height of the viewport container */\n containerHeight(): number;\n\n /** Height of each item in pixels */\n itemHeight(): number;\n\n /** Total number of items */\n totalItems(): number;\n\n /** Offset for content below headers (page-level scroll scenarios) */\n contentOffset(): number;\n\n /** The native element of the viewport */\n readonly nativeElement: HTMLElement;\n\n /**\n * Called by VirtualForDirective to inform the viewport of the actual\n * first rendered item index (accounting for overscan). The viewport\n * uses this to position the content wrapper correctly.\n */\n setRenderStartIndex(index: number): void;\n}\n\n/**\n * Injection token for virtual viewport.\n * VirtualForDirective optionally injects this to detect if it's inside\n * a viewport component that handles wrapper-based positioning.\n */\nexport const VDND_VIRTUAL_VIEWPORT = new InjectionToken<VdndVirtualViewport>(\n 'VDND_VIRTUAL_VIEWPORT',\n);\n","import { computed, effect, Injectable, signal } from '@angular/core';\nimport {\n CursorPosition,\n DraggedItem,\n DragState,\n GrabOffset,\n INITIAL_DRAG_STATE,\n} from '../models/drag-drop.models';\n\n/**\n * Central service for managing drag-and-drop state.\n * Uses signals for reactive state management.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DragStateService {\n /** Internal state signal */\n readonly #state = signal<DragState>(INITIAL_DRAG_STATE);\n\n /** Flag indicating if the last drag was cancelled (not dropped) */\n readonly #wasCancelled = signal<boolean>(false);\n\n /** Whether the last drag was cancelled (for droppable to check before emitting drop) */\n readonly wasCancelled = this.#wasCancelled.asReadonly();\n\n /** Read-only access to the full state */\n readonly state = this.#state.asReadonly();\n\n /** Whether a drag operation is in progress */\n readonly isDragging = computed(() => this.#state().isDragging);\n\n /** The currently dragged item, or null */\n readonly draggedItem = computed(() => this.#state().draggedItem);\n\n /** ID of the currently dragged item, or null (convenience signal for filtering) */\n readonly draggedItemId = computed(() => this.#state().draggedItem?.draggableId ?? null);\n\n /** ID of the droppable where the drag started */\n readonly sourceDroppableId = computed(() => this.#state().sourceDroppableId);\n\n /** Original index of the dragged item in the source list */\n readonly sourceIndex = computed(() => this.#state().sourceIndex);\n\n /** ID of the droppable currently being hovered over */\n readonly activeDroppableId = computed(() => this.#state().activeDroppableId);\n\n /** ID of the item the placeholder should appear before */\n readonly placeholderId = computed(() => this.#state().placeholderId);\n\n /** Index where the placeholder should be inserted */\n readonly placeholderIndex = computed(() => this.#state().placeholderIndex);\n\n /** Current cursor position */\n readonly cursorPosition = computed(() => this.#state().cursorPosition);\n\n /** Offset from cursor to element top-left (for maintaining grab position) */\n readonly grabOffset = computed(() => this.#state().grabOffset);\n\n /** Position when drag started (for axis locking) */\n readonly initialPosition = computed(() => this.#state().initialPosition);\n\n /** Axis to lock movement to */\n readonly lockAxis = computed(() => this.#state().lockAxis);\n\n /** Whether this is a keyboard-initiated drag */\n readonly isKeyboardDrag = computed(() => this.#state().isKeyboardDrag);\n\n /** Target index during keyboard navigation */\n readonly keyboardTargetIndex = computed(() => this.#state().keyboardTargetIndex);\n\n constructor() {\n // Inject cursor styles once (for consistent grabbing cursor during drag)\n if (typeof document !== 'undefined') {\n const styleId = 'vdnd-cursor-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n body.vdnd-dragging,\n body.vdnd-dragging * {\n cursor: grabbing !important;\n }\n `;\n document.head.appendChild(style);\n }\n }\n\n // Effect to toggle body class during drag\n effect(() => {\n if (typeof document === 'undefined') return;\n const isDragging = this.isDragging();\n document.body.classList.toggle('vdnd-dragging', isDragging);\n });\n }\n\n /**\n * Start a drag operation.\n */\n startDrag(\n item: DraggedItem,\n cursorPosition?: CursorPosition,\n grabOffset?: GrabOffset,\n lockAxis?: 'x' | 'y' | null,\n activeDroppableId?: string | null,\n placeholderId?: string | null,\n placeholderIndex?: number | null,\n sourceIndex?: number | null,\n isKeyboardDrag?: boolean,\n axisLockPosition?: CursorPosition,\n ): void {\n // Reset cancellation flag at start of new drag\n this.#wasCancelled.set(false);\n this.#state.set({\n isDragging: true,\n draggedItem: item,\n sourceDroppableId: item.droppableId,\n sourceIndex: sourceIndex ?? null,\n activeDroppableId: activeDroppableId ?? null,\n placeholderId: placeholderId ?? null,\n placeholderIndex: placeholderIndex ?? null,\n cursorPosition: cursorPosition ?? null,\n grabOffset: grabOffset ?? null,\n initialPosition: axisLockPosition ?? cursorPosition ?? null,\n lockAxis: lockAxis ?? null,\n isKeyboardDrag: isKeyboardDrag ?? false,\n keyboardTargetIndex: isKeyboardDrag ? (sourceIndex ?? 0) : null,\n });\n }\n\n /**\n * Update the drag position and targets.\n */\n updateDragPosition(update: {\n cursorPosition: CursorPosition;\n activeDroppableId: string | null;\n placeholderId: string | null;\n placeholderIndex: number | null;\n }): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#state.update((state) => ({\n ...state,\n cursorPosition: update.cursorPosition,\n activeDroppableId: update.activeDroppableId,\n placeholderId: update.placeholderId,\n placeholderIndex: update.placeholderIndex,\n }));\n }\n\n /**\n * Update just the active droppable.\n */\n setActiveDroppable(droppableId: string | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#state.update((state) => ({\n ...state,\n activeDroppableId: droppableId,\n }));\n }\n\n /**\n * Update just the placeholder position.\n */\n setPlaceholder(placeholderId: string | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#state.update((state) => ({\n ...state,\n placeholderId,\n }));\n }\n\n /**\n * End the drag operation and reset state (normal drop).\n */\n endDrag(): void {\n this.#wasCancelled.set(false);\n this.#state.set(INITIAL_DRAG_STATE);\n }\n\n /**\n * Cancel the drag operation (escape key, disabled, etc.).\n */\n cancelDrag(): void {\n this.#wasCancelled.set(true);\n this.#state.set(INITIAL_DRAG_STATE);\n }\n\n /**\n * Check if a specific droppable is currently active.\n */\n isDroppableActive(droppableId: string): boolean {\n return this.#state().activeDroppableId === droppableId;\n }\n\n /**\n * Get the current state snapshot (for event creation).\n */\n getStateSnapshot(): DragState {\n return this.#state();\n }\n\n /**\n * Update the keyboard target index (for keyboard drag navigation).\n * Also updates placeholder position to match, applying same-list adjustment.\n */\n setKeyboardTargetIndex(targetIndex: number): void {\n if (!this.#state().isDragging || !this.#state().isKeyboardDrag) {\n return;\n }\n\n this.#state.update((state) => {\n // Same-list adjustment: if target is at or after source, add 1\n // This accounts for the hidden item shifting everything up visually\n const sourceDroppableId = state.draggedItem?.droppableId;\n const activeDroppableId = state.activeDroppableId;\n const isSameList = sourceDroppableId === activeDroppableId;\n const sourceIndex = state.sourceIndex ?? -1;\n\n let placeholderIndex = targetIndex;\n if (isSameList && sourceIndex >= 0 && targetIndex >= sourceIndex) {\n placeholderIndex = targetIndex + 1;\n }\n\n return {\n ...state,\n keyboardTargetIndex: targetIndex,\n placeholderIndex,\n };\n });\n }\n\n /**\n * Update the active droppable during keyboard navigation (for cross-list moves).\n */\n setKeyboardActiveDroppable(droppableId: string | null, targetIndex: number): void {\n if (!this.#state().isDragging || !this.#state().isKeyboardDrag) {\n return;\n }\n\n this.#state.update((state) => {\n // Same-list adjustment: if moving back to source list and target is at or after source, add 1\n const sourceDroppableId = state.draggedItem?.droppableId;\n const isSameList = sourceDroppableId === droppableId;\n const sourceIndex = state.sourceIndex ?? -1;\n\n let placeholderIndex = targetIndex;\n if (isSameList && sourceIndex >= 0 && targetIndex >= sourceIndex) {\n placeholderIndex = targetIndex + 1;\n }\n\n return {\n ...state,\n activeDroppableId: droppableId,\n keyboardTargetIndex: targetIndex,\n placeholderIndex,\n };\n });\n }\n}\n","import { Injectable, isDevMode } from '@angular/core';\n\n/**\n * Service for calculating drop positions and finding elements at cursor positions.\n * This is the core algorithm that makes virtual scroll + drag-and-drop work together.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class PositionCalculatorService {\n /** Data attribute used to identify droppable elements */\n readonly #DROPPABLE_ID_ATTR = 'data-droppable-id';\n\n /** Data attribute used to identify droppable groups */\n readonly #DROPPABLE_GROUP_ATTR = 'data-droppable-group';\n\n /** Data attribute used to identify draggable elements */\n readonly #DRAGGABLE_ID_ATTR = 'data-draggable-id';\n\n /** Maximum DOM levels to traverse when looking for parent elements */\n readonly #MAX_PARENT_TRAVERSAL = 15;\n\n /**\n * Find the droppable element at a given point.\n *\n * This works by temporarily hiding the dragged element, then using\n * document.elementFromPoint to find what's underneath the cursor.\n *\n * @param x - Cursor X coordinate\n * @param y - Cursor Y coordinate\n * @param draggedElement - The element being dragged (will be temporarily hidden)\n * @param groupName - The drag-and-drop group name to filter by\n * @returns The droppable element, or null if none found\n */\n findDroppableAtPoint(\n x: number,\n y: number,\n draggedElement: HTMLElement,\n groupName: string,\n ): HTMLElement | null {\n // Temporarily hide the dragged element to \"see through\" it\n const originalPointerEvents = draggedElement.style.pointerEvents;\n draggedElement.style.pointerEvents = 'none';\n\n try {\n const elementAtPoint = document.elementFromPoint(x, y);\n if (!elementAtPoint) {\n return null;\n }\n\n return this.getDroppableParent(elementAtPoint as HTMLElement, groupName);\n } finally {\n // Always restore pointer events\n draggedElement.style.pointerEvents = originalPointerEvents;\n }\n }\n\n /**\n * Find the draggable element at a given point.\n *\n * @param x - Cursor X coordinate\n * @param y - Cursor Y coordinate\n * @param draggedElement - The element being dragged (will be temporarily hidden)\n * @returns The draggable element, or null if none found\n */\n findDraggableAtPoint(x: number, y: number, draggedElement: HTMLElement): HTMLElement | null {\n // Temporarily hide the dragged element\n const originalPointerEvents = draggedElement.style.pointerEvents;\n draggedElement.style.pointerEvents = 'none';\n\n try {\n const elementAtPoint = document.elementFromPoint(x, y);\n if (!elementAtPoint) {\n return null;\n }\n\n return this.getDraggableParent(elementAtPoint as HTMLElement);\n } finally {\n draggedElement.style.pointerEvents = originalPointerEvents;\n }\n }\n\n /**\n * Walk up the DOM tree to find a droppable parent element.\n *\n * @param element - Starting element\n * @param groupName - The drag-and-drop group name to filter by\n * @returns The droppable parent element, or null if none found\n */\n getDroppableParent(element: HTMLElement, groupName: string): HTMLElement | null {\n let current: HTMLElement | null = element;\n let count = 0;\n\n while (current && current.tagName !== 'BODY' && count < this.#MAX_PARENT_TRAVERSAL) {\n const foundGroup = current.getAttribute(this.#DROPPABLE_GROUP_ATTR);\n\n if (foundGroup && foundGroup === groupName) {\n return current;\n }\n\n current = current.parentElement;\n count++;\n }\n\n return null;\n }\n\n /**\n * Walk up the DOM tree to find a draggable parent element.\n *\n * @param element - Starting element\n * @returns The draggable parent element, or null if none found\n */\n getDraggableParent(element: HTMLElement): HTMLElement | null {\n let current: HTMLElement | null = element;\n let count = 0;\n\n while (current && current.tagName !== 'BODY' && count < this.#MAX_PARENT_TRAVERSAL) {\n const draggableId = current.getAttribute(this.#DRAGGABLE_ID_ATTR);\n\n if (draggableId) {\n return current;\n }\n\n current = current.parentElement;\n count++;\n }\n\n return null;\n }\n\n /**\n * Get the draggable ID from an element.\n */\n getDraggableId(element: HTMLElement): string | null {\n return element.getAttribute(this.#DRAGGABLE_ID_ATTR);\n }\n\n /**\n * Get the droppable ID from an element.\n */\n getDroppableId(element: HTMLElement): string | null {\n return element.getAttribute(this.#DROPPABLE_ID_ATTR);\n }\n\n /**\n * Calculate the drop index based on mathematical position.\n *\n * This is an alternative approach that doesn't require the target element\n * to be in the DOM. Useful when the target might be virtualized away.\n *\n * @param scrollTop - Current scroll position of the container\n * @param cursorY - Cursor Y position (viewport-relative)\n * @param containerTop - Top position of the container (viewport-relative)\n * @param itemHeight - Height of each item\n * @param totalItems - Total number of items in the list\n * @returns The calculated drop index\n */\n calculateDropIndex(\n scrollTop: number,\n cursorY: number,\n containerTop: number,\n itemHeight: number,\n totalItems: number,\n ): number {\n // Calculate the position relative to the container's content\n const relativeY = cursorY - containerTop + scrollTop;\n\n // Calculate which item index this corresponds to\n const index = Math.floor(relativeY / itemHeight);\n\n // Clamp to valid range\n return Math.max(0, Math.min(index, totalItems));\n }\n\n /**\n * Check if a point is within a specific threshold of a container's edge.\n *\n * @param position - Current cursor position\n * @param containerRect - Container's bounding rect\n * @param threshold - Distance from edge to trigger (in pixels)\n * @returns Object indicating which edges are near\n */\n getNearEdge(\n position: { x: number; y: number },\n containerRect: DOMRect,\n threshold: number,\n ): { top: boolean; bottom: boolean; left: boolean; right: boolean } {\n return {\n top: position.y - containerRect.top <= threshold,\n bottom: containerRect.bottom - position.y <= threshold,\n left: position.x - containerRect.left <= threshold,\n right: containerRect.right - position.x <= threshold,\n };\n }\n\n /**\n * Determine if the cursor is inside a container.\n */\n isInsideContainer(position: { x: number; y: number }, containerRect: DOMRect): boolean {\n return (\n position.x >= containerRect.left &&\n position.x <= containerRect.right &&\n position.y >= containerRect.top &&\n position.y <= containerRect.bottom\n );\n }\n\n /**\n * Find an adjacent droppable in the specified direction (left or right).\n * Used for cross-list keyboard navigation.\n *\n * @param currentDroppableId - The ID of the current droppable\n * @param direction - 'left' or 'right'\n * @param groupName - The drag-and-drop group name\n * @returns Object with droppable info, or null if none found\n */\n findAdjacentDroppable(\n currentDroppableId: string,\n direction: 'left' | 'right',\n groupName: string,\n ): { element: HTMLElement; id: string; itemCount: number } | null {\n // Find all droppables in the same group\n const allDroppables = document.querySelectorAll(\n `[${this.#DROPPABLE_GROUP_ATTR}=\"${groupName}\"]`,\n );\n\n if (allDroppables.length <= 1) {\n return null;\n }\n\n // Get bounding rects and IDs, sorted by X position\n const droppableInfos: { element: HTMLElement; id: string; rect: DOMRect }[] = [];\n\n allDroppables.forEach((el) => {\n const htmlEl = el as HTMLElement;\n const id = htmlEl.getAttribute(this.#DROPPABLE_ID_ATTR);\n if (id) {\n droppableInfos.push({\n element: htmlEl,\n id,\n rect: htmlEl.getBoundingClientRect(),\n });\n }\n });\n\n // Sort by X position (left to right)\n droppableInfos.sort((a, b) => a.rect.left - b.rect.left);\n\n // Find current droppable index\n const currentIndex = droppableInfos.findIndex((d) => d.id === currentDroppableId);\n if (currentIndex === -1) {\n return null;\n }\n\n // Get the adjacent droppable\n const targetIndex = direction === 'left' ? currentIndex - 1 : currentIndex + 1;\n if (targetIndex < 0 || targetIndex >= droppableInfos.length) {\n return null;\n }\n\n const target = droppableInfos[targetIndex];\n\n // Get item count from the target droppable\n const itemCount = this.#getDroppableItemCount(target.element);\n\n return {\n element: target.element,\n id: target.id,\n itemCount,\n };\n }\n\n /**\n * Get the total item count in a droppable.\n * Uses virtual scroll data attribute if available, otherwise counts DOM elements.\n */\n #getDroppableItemCount(droppableElement: HTMLElement): number {\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n if (virtualScroll) {\n const scrollHeight = (virtualScroll as HTMLElement).scrollHeight;\n const configuredHeight = virtualScroll.getAttribute('data-item-height');\n\n if (!configuredHeight) {\n if (isDevMode()) {\n console.error(\n '[ngx-virtual-dnd] vdnd-virtual-scroll requires data-item-height attribute ' +\n 'for keyboard navigation. Cross-list keyboard drag will not work correctly.',\n );\n }\n // Short-circuit: return 0 to prevent navigation to this droppable\n return 0;\n }\n\n const itemHeight = parseInt(configuredHeight, 10);\n return Math.floor(scrollHeight / itemHeight);\n }\n // Fallback for non-virtual scroll: DOM count is valid\n return droppableElement.querySelectorAll(`[${this.#DRAGGABLE_ID_ATTR}]`).length;\n }\n}\n","import { inject, Injectable, NgZone } from '@angular/core';\nimport { DragStateService } from './drag-state.service';\nimport { PositionCalculatorService } from './position-calculator.service';\n\n/**\n * Configuration for auto-scroll behavior.\n */\nexport interface AutoScrollConfig {\n /** Distance from edge to start scrolling (in pixels) */\n threshold: number;\n /** Maximum scroll speed (in pixels per frame) */\n maxSpeed: number;\n /** Whether to accelerate scroll based on distance from edge */\n accelerate: boolean;\n}\n\n/**\n * Default auto-scroll configuration.\n */\nconst DEFAULT_CONFIG: AutoScrollConfig = {\n threshold: 50,\n maxSpeed: 15,\n accelerate: true,\n};\n\n/**\n * Service that handles auto-scrolling when dragging near container edges.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AutoScrollService {\n readonly #dragState = inject(DragStateService);\n readonly #positionCalculator = inject(PositionCalculatorService);\n readonly #ngZone = inject(NgZone);\n\n /** Currently registered scrollable containers */\n #scrollableContainers = new Map<\n string,\n {\n element: HTMLElement;\n config: AutoScrollConfig;\n }\n >();\n\n /** Active animation frame ID */\n #animationFrameId: number | null = null;\n\n /** Callback to invoke when scrolling occurs (for placeholder recalculation) */\n #onScrollCallback: (() => void) | null = null;\n\n /** Current scroll state */\n #scrollState: {\n containerId: string | null;\n direction: { x: number; y: number };\n speed: number;\n } = {\n containerId: null,\n direction: { x: 0, y: 0 },\n speed: 0,\n };\n\n /**\n * Register a scrollable container for auto-scrolling.\n */\n registerContainer(\n id: string,\n element: HTMLElement,\n config: Partial<AutoScrollConfig> = {},\n ): void {\n this.#scrollableContainers.set(id, {\n element,\n config: { ...DEFAULT_CONFIG, ...config },\n });\n }\n\n /**\n * Unregister a scrollable container.\n */\n unregisterContainer(id: string): void {\n this.#scrollableContainers.delete(id);\n }\n\n /**\n * Start monitoring for auto-scroll.\n * Call this when a drag starts.\n * @param onScroll Optional callback to invoke when scrolling occurs (for placeholder recalculation)\n */\n startMonitoring(onScroll?: () => void): void {\n if (this.#animationFrameId !== null) {\n return;\n }\n\n this.#onScrollCallback = onScroll ?? null;\n\n this.#ngZone.runOutsideAngular(() => {\n this.#tick();\n });\n }\n\n /**\n * Stop monitoring for auto-scroll.\n * Call this when a drag ends.\n */\n stopMonitoring(): void {\n if (this.#animationFrameId !== null) {\n cancelAnimationFrame(this.#animationFrameId);\n this.#animationFrameId = null;\n }\n\n this.#onScrollCallback = null;\n this.#scrollState = {\n containerId: null,\n direction: { x: 0, y: 0 },\n speed: 0,\n };\n }\n\n /**\n * Animation tick - check cursor position and scroll if needed.\n */\n #tick(): void {\n const cursor = this.#dragState.cursorPosition();\n const isDragging = this.#dragState.isDragging();\n\n // Stop monitoring if drag ended\n if (!isDragging) {\n this.stopMonitoring();\n return;\n }\n\n // Skip this frame if no cursor position yet, but continue monitoring\n if (!cursor) {\n this.#animationFrameId = requestAnimationFrame(() => this.#tick());\n return;\n }\n\n let scrollPerformed = false;\n\n // Check each container\n for (const [id, { element, config }] of this.#scrollableContainers) {\n const rect = element.getBoundingClientRect();\n\n // Check if cursor is inside this container\n const isInside = this.#positionCalculator.isInsideContainer(cursor, rect);\n\n if (!isInside) {\n continue;\n }\n\n // Check edges\n const nearEdge = this.#positionCalculator.getNearEdge(cursor, rect, config.threshold);\n\n // Calculate scroll direction and speed\n const direction = { x: 0, y: 0 };\n let maxDistance = 0;\n\n if (nearEdge.top) {\n direction.y = -1;\n maxDistance = Math.max(maxDistance, config.threshold - (cursor.y - rect.top));\n } else if (nearEdge.bottom) {\n direction.y = 1;\n maxDistance = Math.max(maxDistance, config.threshold - (rect.bottom - cursor.y));\n }\n\n if (nearEdge.left) {\n direction.x = -1;\n maxDistance = Math.max(maxDistance, config.threshold - (cursor.x - rect.left));\n } else if (nearEdge.right) {\n direction.x = 1;\n maxDistance = Math.max(maxDistance, config.threshold - (rect.right - cursor.x));\n }\n\n // If near an edge, start scrolling\n if (direction.x !== 0 || direction.y !== 0) {\n // Calculate speed (accelerate based on distance from edge)\n let speed = config.maxSpeed;\n if (config.accelerate) {\n const distanceRatio = maxDistance / config.threshold;\n speed = Math.min(config.maxSpeed, Math.max(1, config.maxSpeed * distanceRatio));\n }\n\n this.#scrollState = { containerId: id, direction, speed };\n this.#performScroll(element, direction, speed);\n scrollPerformed = true;\n break;\n }\n }\n\n // Reset scroll state if no scrolling was performed\n if (!scrollPerformed) {\n this.#scrollState = {\n containerId: null,\n direction: { x: 0, y: 0 },\n speed: 0,\n };\n }\n\n this.#animationFrameId = requestAnimationFrame(() => this.#tick());\n }\n\n /**\n * Perform the actual scroll operation.\n */\n #performScroll(element: HTMLElement, direction: { x: number; y: number }, speed: number): void {\n const scrollX = direction.x * speed;\n const scrollY = direction.y * speed;\n\n // Check bounds before scrolling\n const maxScrollY = element.scrollHeight - element.clientHeight;\n const maxScrollX = element.scrollWidth - element.clientWidth;\n\n if (direction.y < 0 && element.scrollTop <= 0) {\n return;\n }\n if (direction.y > 0 && element.scrollTop >= maxScrollY) {\n return;\n }\n if (direction.x < 0 && element.scrollLeft <= 0) {\n return;\n }\n if (direction.x > 0 && element.scrollLeft >= maxScrollX) {\n return;\n }\n\n // Use direct property assignment for guaranteed synchronous scroll\n // scrollBy() with 'instant' behavior may have async issues in Safari\n if (scrollY !== 0) {\n element.scrollTop += scrollY;\n }\n if (scrollX !== 0) {\n element.scrollLeft += scrollX;\n }\n\n // Notify callback IMMEDIATELY in the same frame (no RAF delay)\n // Delaying via RAF causes cumulative drift during continuous autoscroll\n // because multiple scrolls happen before each delayed callback runs.\n // Note: No ngZone.run() needed here - the callback (DraggableDirective.#recalculatePlaceholder)\n // already enters the zone when updating drag state.\n this.#onScrollCallback?.();\n }\n\n /**\n * Check if auto-scrolling is currently active.\n */\n isScrolling(): boolean {\n return (\n this.#scrollState.containerId !== null &&\n (this.#scrollState.direction.x !== 0 || this.#scrollState.direction.y !== 0)\n );\n }\n\n /**\n * Get the current scroll direction.\n */\n getScrollDirection(): { x: number; y: number } {\n return this.#scrollState.direction;\n }\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * Service for cloning DOM elements with their computed styles.\n * Used to create visual copies of dragged elements for the drag preview.\n */\n@Injectable({ providedIn: 'root' })\nexport class ElementCloneService {\n /**\n * CSS properties to copy from source to clone.\n * These are the visual properties that affect appearance.\n */\n readonly #stylesToCopy = [\n 'background',\n 'backgroundColor',\n 'backgroundImage',\n 'border',\n 'borderRadius',\n 'boxShadow',\n 'color',\n 'font',\n 'fontFamily',\n 'fontSize',\n 'fontWeight',\n 'lineHeight',\n 'padding',\n 'margin',\n 'display',\n 'flexDirection',\n 'alignItems',\n 'justifyContent',\n 'gap',\n 'textAlign',\n 'textDecoration',\n 'width',\n 'height',\n 'minWidth',\n 'minHeight',\n 'maxWidth',\n 'maxHeight',\n 'overflow',\n 'opacity',\n 'transform',\n 'boxSizing',\n ];\n\n /**\n * Clone an element with its computed styles.\n * Returns an HTMLElement ready for use as a drag preview.\n */\n cloneElement(source: HTMLElement): HTMLElement {\n const clone = source.cloneNode(true) as HTMLElement;\n\n // Apply computed styles as inline styles\n this.#applyComputedStyles(source, clone);\n\n // Handle special elements (canvas, video, etc.)\n this.#handleSpecialElements(source, clone);\n\n // Sanitize the clone for safe use as preview\n this.#sanitizeClone(clone);\n\n return clone;\n }\n\n /**\n * Apply computed styles from source to target element.\n * Recursively applies to all child elements.\n */\n #applyComputedStyles(source: HTMLElement, target: HTMLElement): void {\n const computed = window.getComputedStyle(source);\n\n // Copy essential visual properties\n for (const prop of this.#stylesToCopy) {\n const value = computed.getPropertyValue(this.#camelToKebab(prop));\n if (value) {\n target.style.setProperty(this.#camelToKebab(prop), value);\n }\n }\n\n // Disable animations and transitions on clone\n target.style.animation = 'none';\n target.style.transition = 'none';\n\n // Recursively apply to children\n const sourceChildren = source.children;\n const targetChildren = target.children;\n\n for (let i = 0; i < sourceChildren.length && i < targetChildren.length; i++) {\n const sourceChild = sourceChildren[i];\n const targetChild = targetChildren[i];\n\n if (sourceChild instanceof HTMLElement && targetChild instanceof HTMLElement) {\n this.#applyComputedStyles(sourceChild, targetChild);\n }\n }\n }\n\n /**\n * Handle special elements that require extra processing.\n */\n #handleSpecialElements(source: HTMLElement, clone: HTMLElement): void {\n // Handle canvas elements - copy current content\n const sourceCanvases = source.querySelectorAll('canvas');\n const cloneCanvases = clone.querySelectorAll('canvas');\n\n sourceCanvases.forEach((srcCanvas, i) => {\n const cloneCanvas = cloneCanvases[i] as HTMLCanvasElement;\n if (cloneCanvas) {\n const ctx = cloneCanvas.getContext('2d');\n if (ctx) {\n cloneCanvas.width = srcCanvas.width;\n cloneCanvas.height = srcCanvas.height;\n ctx.drawImage(srcCanvas, 0, 0);\n }\n }\n });\n\n // Handle video elements - replace with poster or placeholder\n const videos = clone.querySelectorAll('video');\n videos.forEach((video) => {\n const poster = video.poster;\n if (poster) {\n const img = document.createElement('img');\n img.src = poster;\n img.style.width = '100%';\n img.style.height = '100%';\n img.style.objectFit = 'cover';\n video.replaceWith(img);\n } else {\n // Create a placeholder\n const placeholder = document.createElement('div');\n placeholder.style.cssText = `\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n video.replaceWith(placeholder);\n }\n });\n\n // Handle iframes - replace with placeholder\n const iframes = clone.querySelectorAll('iframe');\n iframes.forEach((iframe) => {\n const placeholder = document.createElement('div');\n const iframeStyles = window.getComputedStyle(iframe);\n placeholder.style.width = iframeStyles.width;\n placeholder.style.height = iframeStyles.height;\n placeholder.style.display = 'flex';\n placeholder.style.alignItems = 'center';\n placeholder.style.justifyContent = 'center';\n iframe.replaceWith(placeholder);\n });\n }\n\n /**\n * Sanitize the clone to prevent interaction issues.\n */\n #sanitizeClone(clone: HTMLElement): void {\n // Remove draggable directive attributes\n clone.removeAttribute('vdndDraggable');\n clone.removeAttribute('data-draggable-id');\n clone.removeAttribute('data-droppable-id');\n\n // Remove Angular-specific attributes\n const angularAttrs = Array.from(clone.attributes).filter(\n (attr) => attr.name.startsWith('ng-') || attr.name.startsWith('_ng'),\n );\n angularAttrs.forEach((attr) => clone.removeAttribute(attr.name));\n\n // Process all descendant elements\n const allElements = clone.querySelectorAll('*');\n allElements.forEach((el) => {\n if (!(el instanceof HTMLElement)) return;\n\n // Remove event-related attributes\n const attrs = Array.from(el.attributes);\n attrs.forEach((attr) => {\n if (\n attr.name.startsWith('on') ||\n attr.name.startsWith('(') ||\n attr.name.startsWith('ng-') ||\n attr.name.startsWith('_ng')\n ) {\n el.removeAttribute(attr.name);\n }\n });\n\n // Remove draggable attributes from children too\n el.removeAttribute('vdndDraggable');\n el.removeAttribute('data-draggable-id');\n el.removeAttribute('data-droppable-id');\n });\n\n // Disable interactive elements\n const interactiveElements = clone.querySelectorAll(\n 'button, input, textarea, select, a, [contenteditable]',\n );\n interactiveElements.forEach((el) => {\n if (el instanceof HTMLElement) {\n el.style.pointerEvents = 'none';\n el.setAttribute('tabindex', '-1');\n el.setAttribute('aria-hidden', 'true');\n el.setAttribute('disabled', 'true');\n }\n });\n\n // Remove focus styling classes that might interfere\n clone.classList.remove('vdnd-draggable-dragging');\n clone.classList.remove('vdnd-draggable-disabled');\n }\n\n /**\n * Convert camelCase to kebab-case for CSS properties.\n */\n #camelToKebab(str: string): string {\n return str.replace(/([A-Z])/g, '-$1').toLowerCase();\n }\n}\n","import { computed, inject, Injectable, signal } from '@angular/core';\nimport { DragStateService } from './drag-state.service';\nimport { DraggedItem, END_OF_LIST, GrabOffset } from '../models/drag-drop.models';\n\n/**\n * Service for managing keyboard-initiated drag operations.\n * Works in conjunction with DragStateService to provide keyboard drag functionality.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class KeyboardDragService {\n readonly #dragState = inject(DragStateService);\n\n /** Total item count for the current droppable (set by droppable on keyboard drag start) */\n readonly #totalItemCount = signal<number>(0);\n\n /** Whether a keyboard drag is currently active */\n readonly isActive = computed(\n () => this.#dragState.isKeyboardDrag() && this.#dragState.isDragging(),\n );\n\n /** Current target index during keyboard navigation */\n readonly targetIndex = computed(() => this.#dragState.keyboardTargetIndex());\n\n /** Source index where the drag started */\n readonly sourceIndex = computed(() => this.#dragState.sourceIndex());\n\n /** Current active droppable ID */\n readonly activeDroppableId = computed(() => this.#dragState.activeDroppableId());\n\n /**\n * Start a keyboard drag operation.\n */\n startKeyboardDrag(\n item: DraggedItem,\n sourceIndex: number,\n totalItemCount: number,\n activeDroppableId: string,\n ): void {\n this.#totalItemCount.set(totalItemCount);\n\n // For keyboard drag, we position the preview at the element's location\n // We use a grab offset of 0,0 since we're not grabbing at a specific point\n const grabOffset: GrabOffset = { x: 0, y: 0 };\n\n // Get the element's position for the cursor position\n // This positions the preview at the element's original location\n const rect = item.element.getBoundingClientRect();\n const cursorPosition = { x: rect.left, y: rect.top };\n\n // Same-list adjustment: at start, targetIndex equals sourceIndex\n // Since sourceIndex >= sourceIndex is always true, add 1 to placeholderIndex\n // This accounts for the hidden item shifting everything up visually\n const initialPlaceholderIndex = sourceIndex + 1;\n\n this.#dragState.startDrag(\n item,\n cursorPosition,\n grabOffset,\n null, // no axis lock for keyboard drag\n activeDroppableId,\n END_OF_LIST,\n initialPlaceholderIndex,\n sourceIndex,\n true, // isKeyboardDrag\n );\n }\n\n /**\n * Move to a specific index during keyboard drag.\n * Returns the clamped target index.\n */\n moveToIndex(targetIndex: number): number {\n if (!this.isActive()) {\n return targetIndex;\n }\n\n const totalItems = this.#totalItemCount();\n const clampedIndex = Math.max(0, Math.min(targetIndex, totalItems));\n\n this.#dragState.setKeyboardTargetIndex(clampedIndex);\n\n return clampedIndex;\n }\n\n /**\n * Move up by one position (ArrowUp).\n * Returns the new target index.\n */\n moveUp(): number {\n const currentTarget = this.targetIndex() ?? 0;\n return this.moveToIndex(currentTarget - 1);\n }\n\n /**\n * Move down by one position (ArrowDown).\n * Returns the new target index.\n */\n moveDown(): number {\n const currentTarget = this.targetIndex() ?? 0;\n return this.moveToIndex(currentTarget + 1);\n }\n\n /**\n * Move to an adjacent droppable (ArrowLeft/ArrowRight).\n * The droppable registry is managed externally.\n */\n moveToDroppable(droppableId: string, targetIndex: number, totalItemCount: number): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#totalItemCount.set(totalItemCount);\n const clampedIndex = Math.max(0, Math.min(targetIndex, totalItemCount));\n this.#dragState.setKeyboardActiveDroppable(droppableId, clampedIndex);\n }\n\n /**\n * Complete the keyboard drag (Space or Enter to drop).\n */\n completeKeyboardDrag(): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#dragState.endDrag();\n }\n\n /**\n * Cancel the keyboard drag (Escape).\n */\n cancelKeyboardDrag(): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#dragState.cancelDrag();\n }\n\n /**\n * Update the total item count (when navigating to a new list).\n */\n setTotalItemCount(count: number): void {\n this.#totalItemCount.set(count);\n }\n}\n","import { Injectable, OnDestroy } from '@angular/core';\n\n/**\n * Service that manages a shared overlay container appended to `document.body`.\n *\n * Elements placed inside the overlay container escape any ancestor CSS `transform`,\n * `perspective`, or `filter` that would create a new containing block for\n * `position: fixed` children. This ensures viewport-relative positioning works\n * correctly regardless of where the consuming component sits in the DOM tree.\n *\n * Mirrors the strategy used by Angular CDK's `OverlayContainer`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class OverlayContainerService implements OnDestroy {\n #containerElement: HTMLElement | null = null;\n\n /**\n * Returns the shared overlay container element, lazily creating it on first access.\n * Returns `null` in non-browser environments (SSR).\n */\n getContainerElement(): HTMLElement | null {\n if (typeof document === 'undefined') {\n return null;\n }\n\n if (!this.#containerElement) {\n this.#containerElement = document.createElement('div');\n this.#containerElement.classList.add('vdnd-overlay-container');\n document.body.appendChild(this.#containerElement);\n }\n\n return this.#containerElement;\n }\n\n ngOnDestroy(): void {\n this.#containerElement?.remove();\n this.#containerElement = null;\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/**\n * Renders an empty placeholder that takes up space in the document flow.\n *\n * This component is used internally by virtual scroll containers to show\n * where an item will be dropped. It's rendered inline with items and\n * takes up the same vertical space as an item.\n *\n * The placeholder is just empty space - no borders, no background.\n * Consumers can style it via CSS if desired.\n */\n@Component({\n selector: 'vdnd-drag-placeholder',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'vdnd-drag-placeholder vdnd-drag-placeholder-visible',\n '[style.display]': '\"block\"',\n '[style.height.px]': 'itemHeight()',\n '[style.pointer-events]': '\"none\"',\n },\n template: ``,\n})\nexport class DragPlaceholderComponent {\n /** Item height for sizing */\n itemHeight = input.required<number>();\n}\n","import { NgZone, type WritableSignal } from '@angular/core';\n\nexport function bindRafThrottledScrollTopSignal(options: {\n element: HTMLElement;\n ngZone: NgZone;\n scrollTop: WritableSignal<number>;\n thresholdPx?: number;\n onCommit?: (scrollTop: number) => void;\n}): () => void {\n const { element, ngZone, scrollTop, thresholdPx = 5, onCommit } = options;\n\n let pendingRaf: number | null = null;\n let lastCommittedScrollTop = element.scrollTop;\n\n const onScroll = () => {\n if (pendingRaf !== null) {\n return;\n }\n\n const currentScrollTop = element.scrollTop;\n if (Math.abs(currentScrollTop - lastCommittedScrollTop) < thresholdPx) {\n return;\n }\n\n pendingRaf = requestAnimationFrame(() => {\n pendingRaf = null;\n const finalScrollTop = element.scrollTop;\n if (Math.abs(finalScrollTop - lastCommittedScrollTop) >= thresholdPx) {\n lastCommittedScrollTop = finalScrollTop;\n scrollTop.set(finalScrollTop);\n onCommit?.(finalScrollTop);\n }\n });\n };\n\n ngZone.runOutsideAngular(() => {\n element.addEventListener('scroll', onScroll, { passive: true });\n });\n\n scrollTop.set(lastCommittedScrollTop);\n\n return () => {\n if (pendingRaf !== null) {\n cancelAnimationFrame(pendingRaf);\n pendingRaf = null;\n }\n element.removeEventListener('scroll', onScroll);\n };\n}\n\nexport function bindResizeObserverHeightSignal(options: {\n element: HTMLElement;\n ngZone: NgZone;\n height: WritableSignal<number>;\n minDeltaPx?: number;\n}): () => void {\n const { element, ngZone, height, minDeltaPx = 1 } = options;\n\n if (typeof ResizeObserver === 'undefined') {\n height.set(element.clientHeight);\n return () => undefined;\n }\n\n let observer: ResizeObserver | null = null;\n\n ngZone.runOutsideAngular(() => {\n observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const nextHeight = entry.contentRect.height;\n if (Math.abs(nextHeight - height()) > minDeltaPx) {\n height.set(nextHeight);\n }\n }\n });\n observer.observe(element);\n });\n\n height.set(element.clientHeight);\n\n return () => {\n observer?.disconnect();\n observer = null;\n };\n}\n","import {\n afterNextRender,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n output,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { DragStateService } from '../services/drag-state.service';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport { DragPlaceholderComponent } from './drag-placeholder.component';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\n\n/**\n * Context provided to the item template.\n */\nexport interface VirtualScrollItemContext<T> {\n /** The item data */\n $implicit: T;\n /** The item's index in the original array */\n index: number;\n /** Whether this item is \"sticky\" (always rendered) */\n isSticky: boolean;\n}\n\n/**\n * Event emitted when the visible range changes.\n */\nexport interface VisibleRangeChange {\n start: number;\n end: number;\n}\n\n/**\n * A virtual scroll container that only renders visible items.\n *\n * Key features:\n * - Only renders items within the visible viewport plus an overscan buffer\n * - Supports \"sticky\" items that are always rendered (used for dragged items)\n * - Uses spacer divs to maintain correct scroll height\n * - Integrates with the drag-and-drop system\n * - Automatic height detection via ResizeObserver when containerHeight is not provided\n *\n * @example\n * ```html\n * <!-- With explicit height -->\n * <vdnd-virtual-scroll\n * [items]=\"items()\"\n * [itemHeight]=\"50\"\n * [containerHeight]=\"400\"\n * [trackByFn]=\"trackById\">\n * <ng-template let-item let-index=\"index\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-template>\n * </vdnd-virtual-scroll>\n *\n * <!-- With CSS-based height (auto-detected) -->\n * <vdnd-virtual-scroll\n * style=\"height: 100%\"\n * [items]=\"items()\"\n * [itemHeight]=\"50\"\n * [trackByFn]=\"trackById\">\n * <ng-template let-item let-index=\"index\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-template>\n * </vdnd-virtual-scroll>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-scroll',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, DragPlaceholderComponent],\n host: {\n class: 'vdnd-virtual-scroll',\n '[style.height.px]': 'containerHeight() ?? null',\n '[style.overflow]': '\"auto\"',\n '[style.position]': '\"relative\"',\n '[attr.data-item-height]': 'itemHeight()',\n },\n template: `\n <div class=\"vdnd-virtual-scroll-content\">\n <!-- Single spacer maintains scroll height -->\n <div class=\"vdnd-virtual-scroll-spacer\" [style.height.px]=\"totalHeight()\"></div>\n\n <!-- Content wrapper positioned via GPU-accelerated transform -->\n <div class=\"vdnd-virtual-scroll-content-wrapper\" [style.transform]=\"contentTransform()\">\n @for (entry of renderedItems(); track trackEntry($index, entry)) {\n @if (entry.type === 'placeholder') {\n <vdnd-drag-placeholder [itemHeight]=\"itemHeight()\" />\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate();\n context: {\n $implicit: entry.data,\n index: entry.index,\n isSticky: entry.isSticky,\n }\n \"\n >\n </ng-container>\n }\n }\n </div>\n </div>\n `,\n styles: `\n :host {\n display: block;\n /* Disable browser scroll anchoring - this prevents scroll position from being\n adjusted when the DOM changes (e.g., when placeholder position updates).\n Without this, autoscroll UP would fight with browser's scroll restoration. */\n overflow-anchor: none;\n }\n\n .vdnd-virtual-scroll-content {\n position: relative;\n width: 100%;\n }\n\n .vdnd-virtual-scroll-spacer {\n /* Invisible spacer that maintains scroll height */\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n visibility: hidden;\n pointer-events: none;\n }\n\n .vdnd-virtual-scroll-content-wrapper {\n /* GPU-accelerated positioning */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n will-change: transform;\n }\n `,\n})\nexport class VirtualScrollContainerComponent<T> implements OnInit, AfterViewInit, OnDestroy {\n readonly #dragState = inject(DragStateService);\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #autoScrollService = inject(AutoScrollService);\n readonly #ngZone = inject(NgZone);\n readonly #injector = inject(Injector);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Measured height from ResizeObserver (used when containerHeight is not provided) */\n readonly #measuredHeight = signal(0);\n\n /** Template for rendering each item - passed as input instead of content child for reliability */\n itemTemplate = input.required<TemplateRef<VirtualScrollItemContext<T>>>();\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Array of items to render */\n items = input.required<T[]>();\n\n /** Height of each item in pixels */\n itemHeight = input.required<number>();\n\n /**\n * Height of the container in pixels.\n * If not provided, the container will automatically measure its height from CSS.\n * This allows you to set the height via CSS (e.g., flex, height: 100%, etc.)\n * and the component will adapt automatically, including on resize.\n */\n containerHeight = input<number>();\n\n /**\n * Effective height used for calculations.\n * Uses explicit containerHeight if provided, otherwise uses measured height.\n */\n readonly effectiveHeight = computed(() => this.containerHeight() ?? this.#measuredHeight());\n\n /** Number of items to render above/below the visible area */\n overscan = input<number>(3);\n\n /** IDs of items that should always be rendered (e.g., dragged items) */\n stickyItemIds = input<string[]>([]);\n\n /** Function to get a unique ID from an item */\n itemIdFn = input.required<(item: T) => string>();\n\n /**\n * Track-by function for the @for loop.\n * Optional - if not provided, will be derived from itemIdFn.\n */\n trackByFn = input<(index: number, item: T) => string | number>();\n\n /**\n * ID of the droppable this virtual scroll belongs to.\n * Required for placeholder positioning.\n */\n droppableId = input<string>();\n\n /**\n * Whether to automatically add the dragged item to the sticky list.\n * This ensures the dragged item remains visible during virtual scrolling.\n * @default true\n */\n autoStickyDraggedItem = input<boolean>(true);\n\n /**\n * Effective track-by function - uses provided trackByFn or derives from itemIdFn.\n */\n protected readonly effectiveTrackByFn = computed(() => {\n const userFn = this.trackByFn();\n if (userFn) return userFn;\n\n const idFn = this.itemIdFn();\n return (_index: number, item: T) => idFn(item);\n });\n\n /**\n * Track function for rendered entries (items + placeholder).\n */\n protected trackEntry(\n _index: number,\n entry: { type: 'item' | 'placeholder'; data: T | null; index: number },\n ): string | number {\n if (entry.type === 'placeholder') {\n return '__placeholder__';\n }\n const trackFn = this.effectiveTrackByFn();\n return trackFn(entry.index, entry.data as T);\n }\n\n /**\n * Effective sticky item IDs - combines user-provided IDs with auto-sticky dragged item.\n */\n protected readonly effectiveStickyIds = computed(() => {\n const userIds = this.stickyItemIds();\n\n if (!this.autoStickyDraggedItem()) {\n return userIds;\n }\n\n const draggedId = this.draggedItemId();\n if (!draggedId) {\n return userIds;\n }\n\n // Avoid creating new array if dragged ID is already in the list\n if (userIds.includes(draggedId)) {\n return userIds;\n }\n\n return [...userIds, draggedId];\n });\n\n /** Emits when the visible range changes */\n visibleRangeChange = output<VisibleRangeChange>();\n\n /** Emits when scroll position changes */\n scrollPositionChange = output<number>();\n\n /** Current scroll position */\n readonly #scrollTop = signal(0);\n\n /** Total height of all items (for scrollbar) */\n protected readonly totalHeight = computed(() => {\n const count = this.items().length;\n const draggedId = this.draggedItemId();\n // Only subtract 1 if the dragged item belongs to THIS list (is in our items array).\n // Cross-list drags shouldn't affect the target list's height.\n const isDraggedItemInThisList = draggedId !== null && this.#itemIndexMap().has(draggedId);\n const effectiveCount = isDraggedItemInThisList ? count - 1 : count;\n return effectiveCount * this.itemHeight();\n });\n\n /** First visible item index */\n readonly #firstVisibleIndex = computed(() => {\n return Math.floor(this.#scrollTop() / this.itemHeight());\n });\n\n /** Number of items visible in the viewport */\n readonly #visibleCount = computed(() => {\n const height = this.effectiveHeight();\n if (height <= 0) return 0;\n return Math.ceil(height / this.itemHeight());\n });\n\n /** Range of items to render (with overscan) */\n readonly #renderRange = computed(() => {\n const first = this.#firstVisibleIndex();\n const visible = this.#visibleCount();\n const overscan = this.overscan();\n const total = this.items().length;\n\n const start = Math.max(0, first - overscan);\n const end = Math.min(total - 1, first + visible + overscan);\n\n return { start, end };\n });\n\n /** Transform offset for content wrapper (position of first rendered item) */\n protected readonly contentTransform = computed(() => {\n const { start } = this.#renderRange();\n const draggedIndex = this.#draggedItemIndex();\n // If dragged item is in the unrendered top section, subtract 1 (it's position:absolute)\n const adjustment = draggedIndex >= 0 && draggedIndex < start ? 1 : 0;\n const offset = Math.max(0, start - adjustment) * this.itemHeight();\n return `translateY(${offset}px)`;\n });\n\n /** The ID of the currently dragged item (if any) */\n protected readonly draggedItemId = computed(() => {\n return this.#dragState.draggedItem()?.draggableId ?? null;\n });\n\n /** Map of item IDs to their indices - rebuilt only when items() changes (O(n) once, then O(1) lookups) */\n readonly #itemIndexMap = computed(() => {\n const items = this.items();\n const idFn = this.itemIdFn();\n const map = new Map<string, number>();\n for (let i = 0; i < items.length; i++) {\n map.set(idFn(items[i]), i);\n }\n return map;\n });\n\n /** The index of the currently dragged item in the items array (-1 if not found or not dragging) */\n readonly #draggedItemIndex = computed(() => {\n const draggedId = this.draggedItemId();\n if (!draggedId) return -1;\n return this.#itemIndexMap().get(draggedId) ?? -1;\n });\n\n /** Memoized Set of sticky IDs - rebuilt only when effectiveStickyIds() changes */\n readonly #stickyIdsSet = computed(() => new Set(this.effectiveStickyIds()));\n\n /** Whether the placeholder should be shown in this container */\n protected readonly shouldShowPlaceholder = computed(() => {\n if (!this.#dragState.isDragging()) return false;\n return this.#dragState.activeDroppableId() === this.droppableId();\n });\n\n /** The placeholder index when placeholder should be shown */\n protected readonly placeholderIndex = computed(() => {\n if (!this.shouldShowPlaceholder()) return -1;\n return this.#dragState.placeholderIndex() ?? -1;\n });\n\n /** Items to render, including sticky items and placeholder */\n protected readonly renderedItems = computed(() => {\n const items = this.items();\n const { start, end } = this.#renderRange();\n const stickyIds = this.#stickyIdsSet();\n const idFn = this.itemIdFn();\n const itemIndexMap = this.#itemIndexMap();\n const draggedId = this.draggedItemId();\n const placeholderIdx = this.placeholderIndex();\n\n const result: {\n type: 'item' | 'placeholder';\n data: T | null;\n index: number;\n isSticky: boolean;\n isDragging: boolean;\n }[] = [];\n const renderedIds = new Set<string>();\n let hasPlaceholder = false;\n\n // Add all items in the visible range, inserting placeholder at correct position\n for (let i = start; i <= end && i < items.length; i++) {\n // Insert placeholder before item at placeholderIndex\n if (placeholderIdx === i && !hasPlaceholder) {\n result.push({\n type: 'placeholder',\n data: null,\n index: placeholderIdx,\n isSticky: false,\n isDragging: false,\n });\n hasPlaceholder = true;\n }\n\n const item = items[i];\n const id = idFn(item);\n result.push({\n type: 'item',\n data: item,\n index: i,\n isSticky: stickyIds.has(id),\n isDragging: id === draggedId,\n });\n renderedIds.add(id);\n }\n\n // If placeholder is at the end (after all items), add it\n if (placeholderIdx >= items.length && placeholderIdx >= 0 && !hasPlaceholder) {\n result.push({\n type: 'placeholder',\n data: null,\n index: placeholderIdx,\n isSticky: false,\n isDragging: false,\n });\n hasPlaceholder = true;\n }\n\n // Add any sticky items that aren't already rendered\n const missingStickyIndices: { id: string; index: number }[] = [];\n for (const id of stickyIds) {\n if (renderedIds.has(id)) continue;\n const index = itemIndexMap.get(id);\n if (index === undefined) continue;\n missingStickyIndices.push({ id, index });\n }\n if (missingStickyIndices.length > 1) {\n missingStickyIndices.sort((a, b) => a.index - b.index);\n }\n\n for (const { id, index } of missingStickyIndices) {\n const item = items[index];\n if (item === undefined) continue;\n result.push({\n type: 'item',\n data: item,\n index,\n isSticky: true,\n isDragging: id === draggedId,\n });\n }\n\n return result;\n });\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-scroll-${Math.random().toString(36).slice(2, 9)}`;\n\n /** Track previous dragged ID to detect drag end */\n #previousDraggedId: string | null = null;\n\n constructor() {\n // Emit visible range changes\n effect(() => {\n const range = this.#renderRange();\n this.visibleRangeChange.emit(range);\n });\n\n // Keyboard drag autoscroll: scroll to keep target index visible\n effect(() => {\n // Only apply when this droppable is active during keyboard drag\n if (!this.#dragState.isKeyboardDrag()) return;\n const activeDroppable = this.#dragState.activeDroppableId();\n if (activeDroppable !== this.droppableId()) return;\n\n const targetIndex = this.#dragState.keyboardTargetIndex();\n if (targetIndex === null) return;\n\n const itemHeight = this.itemHeight();\n const height = this.effectiveHeight();\n if (height <= 0) return;\n\n const element = this.#elementRef.nativeElement;\n const currentScrollTop = element.scrollTop;\n\n // Calculate target item position\n const targetTop = targetIndex * itemHeight;\n const targetBottom = targetTop + itemHeight;\n\n // Calculate visible range\n const viewportTop = currentScrollTop;\n const viewportBottom = currentScrollTop + height;\n\n // Check if target is fully visible\n if (targetTop < viewportTop) {\n // Target is above viewport - scroll up\n element.scrollTop = targetTop;\n this.#scrollTop.set(targetTop);\n } else if (targetBottom > viewportBottom) {\n // Target is below viewport - scroll down\n const newScrollTop = targetBottom - height;\n element.scrollTop = newScrollTop;\n this.#scrollTop.set(newScrollTop);\n }\n });\n\n // Preserve scroll position when drag ends at bottom of list\n // During drag, totalHeight is reduced by 1 item (dragged item is hidden)\n // When drag ends, totalHeight increases - we need to adjust scroll if we were at bottom\n effect(() => {\n const currentDraggedId = this.draggedItemId();\n const element = this.#elementRef.nativeElement;\n\n // Detect drag end (was dragging, now not)\n if (this.#previousDraggedId !== null && currentDraggedId === null) {\n const currentScrollTop = element.scrollTop;\n const itemHeight = this.itemHeight();\n const height = this.effectiveHeight();\n const totalItems = this.items().length;\n\n // Calculate if we were at/near bottom (within 10px tolerance)\n // During drag, max scroll was (totalItems - 1) * itemHeight - height\n const dragReducedMaxScroll = (totalItems - 1) * itemHeight - height;\n const wasAtBottom = currentScrollTop >= dragReducedMaxScroll - 10;\n\n if (wasAtBottom && dragReducedMaxScroll > 0) {\n // Adjust scroll to new bottom position after totalHeight increases\n afterNextRender(\n () => {\n const newMaxScroll = Math.max(0, totalItems * itemHeight - height);\n element.scrollTop = newMaxScroll;\n this.#scrollTop.set(newMaxScroll);\n },\n { injector: this.#injector },\n );\n }\n }\n\n this.#previousDraggedId = currentDraggedId;\n });\n }\n\n ngOnInit(): void {\n // Register with auto-scroll service\n if (this.autoScrollEnabled()) {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.registerContainer(\n id,\n this.#elementRef.nativeElement,\n this.autoScrollConfig(),\n );\n }\n }\n\n ngAfterViewInit(): void {\n const element = this.#elementRef.nativeElement;\n\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element,\n ngZone: this.#ngZone,\n height: this.#measuredHeight,\n minDeltaPx: 1,\n });\n\n // Scroll listener outside Angular zone with RAF throttling.\n // This avoids template event binding which would mark the component dirty 60x/sec.\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: 5,\n onCommit: (newScrollTop) => {\n this.scrollPositionChange.emit(newScrollTop);\n },\n });\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n\n // Unregister from auto-scroll service\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.unregisterContainer(id);\n }\n\n /**\n * Scroll to a specific position.\n */\n scrollTo(position: number): void {\n this.#elementRef.nativeElement.scrollTop = position;\n this.#scrollTop.set(position);\n }\n\n /**\n * Scroll to a specific item index.\n */\n scrollToIndex(index: number): void {\n const position = index * this.itemHeight();\n this.scrollTo(position);\n }\n\n /**\n * Get the current scroll position.\n */\n getScrollTop(): number {\n return this.#scrollTop();\n }\n\n /**\n * Get the total scrollable height.\n */\n getScrollHeight(): number {\n return this.totalHeight();\n }\n\n /**\n * Scroll by a delta amount.\n */\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(this.getScrollTop() + delta, this.getScrollHeight() - this.effectiveHeight()),\n );\n this.scrollTo(newPosition);\n }\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { DragStateService } from '../services/drag-state.service';\nimport { OverlayContainerService } from '../services/overlay-container.service';\n\n/**\n * Context provided to the drag preview template.\n */\nexport interface DragPreviewContext<T = unknown> {\n /** The data associated with the dragged item */\n $implicit: T;\n /** The draggable ID */\n draggableId: string;\n /** The source droppable ID */\n droppableId: string;\n}\n\n/**\n * Renders a preview of the dragged item that follows the cursor.\n *\n * The component automatically teleports itself into a body-level overlay container,\n * so it works correctly even inside ancestors with CSS `transform` (e.g. Ionic pages).\n * It can be placed anywhere in the component tree.\n *\n * @example\n * ```html\n * <vdnd-drag-preview>\n * <ng-template let-data let-id=\"draggableId\">\n * <div class=\"drag-preview\">{{ data.name }}</div>\n * </ng-template>\n * </vdnd-drag-preview>\n * ```\n */\n@Component({\n selector: 'vdnd-drag-preview',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n template: `\n @if (isVisible()) {\n <div\n class=\"vdnd-drag-preview\"\n data-testid=\"vdnd-drag-preview\"\n [style.position]=\"'fixed'\"\n [style.left.px]=\"0\"\n [style.top.px]=\"0\"\n [style.transform]=\"transform()\"\n [style.will-change]=\"'transform'\"\n [style.width.px]=\"dimensions().width\"\n [style.height.px]=\"dimensions().height\"\n [style.pointer-events]=\"'none'\"\n [style.z-index]=\"1000\"\n >\n @if (previewTemplate()) {\n <ng-container *ngTemplateOutlet=\"previewTemplate()!; context: templateContext()\">\n </ng-container>\n } @else if (clonedElement()) {\n <div class=\"vdnd-drag-preview-clone\" #cloneContainer></div>\n } @else {\n <div class=\"vdnd-drag-preview-default\">\n {{ dragState.draggedItem()?.draggableId }}\n </div>\n }\n </div>\n }\n `,\n styles: `\n .vdnd-drag-preview {\n box-sizing: border-box;\n }\n\n .vdnd-drag-preview-clone {\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n `,\n})\nexport class DragPreviewComponent<T = unknown> implements OnDestroy {\n protected readonly dragState = inject(DragStateService);\n readonly #overlayContainer = inject(OverlayContainerService);\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n\n /** Optional custom template for the preview */\n previewTemplate = input<TemplateRef<DragPreviewContext<T>>>();\n\n /** Offset from cursor to preview (to avoid cursor being on top of preview) */\n cursorOffset = input<{ x: number; y: number }>({ x: 8, y: 8 });\n\n /** Reference to the clone container element (cannot use ES private with viewChild) */\n private readonly cloneContainer = viewChild<ElementRef<HTMLElement>>('cloneContainer');\n\n /** The cloned element from drag state (used when no custom template is provided) */\n protected readonly clonedElement = computed(() => {\n if (this.previewTemplate()) {\n return null; // Custom template takes precedence\n }\n return this.dragState.draggedItem()?.clonedElement ?? null;\n });\n\n constructor() {\n // Teleport host element into the body-level overlay container after first render.\n // This escapes any ancestor CSS transforms that would break position: fixed.\n afterNextRender(() => {\n const container = this.#overlayContainer.getContainerElement();\n if (container) {\n container.appendChild(this.#elementRef.nativeElement);\n }\n });\n\n // Effect to insert the cloned element into the container\n effect(() => {\n const container = this.cloneContainer()?.nativeElement;\n const clone = this.clonedElement();\n\n if (!container) {\n return;\n }\n\n // Clear previous content and append the prepared clone element.\n // Avoid cloning again: ElementCloneService already creates a styled/sanitized clone.\n container.innerHTML = '';\n if (clone) {\n container.appendChild(clone);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.#elementRef.nativeElement.remove();\n }\n\n /** Whether the preview is visible */\n protected readonly isVisible = computed(() => {\n return this.dragState.isDragging() && this.dragState.cursorPosition() !== null;\n });\n\n /** Position of the preview */\n protected readonly position = computed(() => {\n const cursor = this.dragState.cursorPosition();\n const grabOffset = this.dragState.grabOffset();\n const fallbackOffset = this.cursorOffset();\n const initialPosition = this.dragState.initialPosition();\n const lockAxis = this.dragState.lockAxis();\n\n if (!cursor) {\n return { x: 0, y: 0 };\n }\n\n // Use grab offset if available (preserves grab position), otherwise fall back to cursorOffset input\n const offset = grabOffset ?? fallbackOffset;\n\n let x = cursor.x - offset.x;\n let y = cursor.y - offset.y;\n\n // Apply axis locking if configured\n if (lockAxis && initialPosition) {\n if (lockAxis === 'x') {\n // Lock X axis: x stays at initial position\n x = initialPosition.x - offset.x;\n } else if (lockAxis === 'y') {\n // Lock Y axis: y stays at initial position\n y = initialPosition.y - offset.y;\n }\n }\n\n return { x, y };\n });\n\n /** Transform-based positioning for better performance (avoid layout from left/top). */\n protected readonly transform = computed(() => {\n const { x, y } = this.position();\n return `translate3d(${x}px, ${y}px, 0)`;\n });\n\n /** Dimensions of the preview */\n protected readonly dimensions = computed(() => {\n const item = this.dragState.draggedItem();\n\n if (!item) {\n return { width: 100, height: 50 };\n }\n\n return {\n width: item.width,\n height: item.height,\n };\n });\n\n /** Template context */\n protected readonly templateContext = computed((): DragPreviewContext<T> => {\n const item = this.dragState.draggedItem();\n\n return {\n $implicit: (item?.data ?? null) as T,\n draggableId: item?.draggableId ?? '',\n droppableId: item?.droppableId ?? '',\n };\n });\n}\n","import { ChangeDetectionStrategy, Component, input, TemplateRef } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/**\n * Context provided to the custom placeholder template.\n */\nexport interface PlaceholderContext {\n /** The height of the placeholder in pixels */\n $implicit: number;\n /** The height of the placeholder in pixels (explicit property) */\n height: number;\n}\n\n/**\n * A placeholder component that indicates where a dropped item will be inserted.\n *\n * By default, renders as empty/transparent space. Pass a custom template\n * to customize the placeholder appearance.\n *\n * @example\n * ```html\n * <!-- Default: transparent/empty space -->\n * <vdnd-placeholder [height]=\"50\"></vdnd-placeholder>\n *\n * <!-- Custom template with dashed border -->\n * <vdnd-placeholder [height]=\"50\" [template]=\"customPlaceholder\">\n * <ng-template #customPlaceholder let-height>\n * <div class=\"my-placeholder\" [style.height.px]=\"height\">\n * Drop here\n * </div>\n * </ng-template>\n * </vdnd-placeholder>\n * ```\n */\n@Component({\n selector: 'vdnd-placeholder',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n host: {\n class: 'vdnd-placeholder',\n '[style.height.px]': 'height()',\n '[attr.data-draggable-id]': '\"placeholder\"',\n },\n template: `\n @if (template()) {\n <ng-container\n *ngTemplateOutlet=\"template()!; context: { $implicit: height(), height: height() }\"\n >\n </ng-container>\n }\n `,\n styles: `\n :host {\n display: block;\n box-sizing: border-box;\n }\n `,\n})\nexport class PlaceholderComponent {\n /** Height of the placeholder in pixels */\n height = input<number>(50);\n\n /** Optional custom template for the placeholder content */\n template = input<TemplateRef<PlaceholderContext>>();\n}\n","import { Directive, InjectionToken, input, Signal } from '@angular/core';\n\n/**\n * Token for injecting the group context from a parent directive.\n * Allows child draggables and droppables to inherit the group name automatically.\n */\nexport const VDND_GROUP_TOKEN = new InjectionToken<VdndGroupContext>('VDND_GROUP_TOKEN');\n\n/**\n * Context provided by the group directive to its children.\n */\nexport interface VdndGroupContext {\n /** The group name signal */\n readonly group: Signal<string>;\n}\n\n/**\n * Provides a group context to child draggable and droppable directives.\n * When applied to a parent element, child directives can inherit the group name\n * automatically without needing to specify it on each element.\n *\n * @example\n * ```html\n * <!-- Without group directive (verbose) -->\n * <div vdndDroppable=\"list-1\" vdndDroppableGroup=\"my-group\">\n * <div vdndDraggable=\"item-1\" vdndDraggableGroup=\"my-group\">Item 1</div>\n * <div vdndDraggable=\"item-2\" vdndDraggableGroup=\"my-group\">Item 2</div>\n * </div>\n *\n * <!-- With group directive (concise) -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDroppable=\"list-1\">\n * <div vdndDraggable=\"item-1\">Item 1</div>\n * <div vdndDraggable=\"item-2\">Item 2</div>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndGroup]',\n providers: [\n {\n provide: VDND_GROUP_TOKEN,\n useExisting: DroppableGroupDirective,\n },\n ],\n})\nexport class DroppableGroupDirective implements VdndGroupContext {\n /** The group name that will be inherited by child directives */\n readonly group = input.required<string>({ alias: 'vdndGroup' });\n}\n","import { computed, isDevMode, type Signal } from '@angular/core';\nimport type { VdndGroupContext } from '../directives/droppable-group.directive';\n\n/**\n * Configuration options for creating an effective group signal.\n */\nexport interface GroupResolutionOptions {\n /** The explicit group input signal */\n explicitGroup: Signal<string | undefined>;\n /** The parent group context injected via VDND_GROUP_TOKEN (may be null) */\n parentGroup: VdndGroupContext | null;\n /** The element ID signal for warning messages */\n elementId: Signal<string>;\n /** The type of element ('draggable' or 'droppable') for warning messages */\n elementType: 'draggable' | 'droppable';\n}\n\n/**\n * State tracker for group resolution to avoid repeated warnings.\n */\ninterface GroupResolutionState {\n hasWarnedMissingGroup: boolean;\n}\n\n/**\n * Creates a computed signal that resolves the effective group name for a draggable or droppable.\n *\n * Resolution order:\n * 1. Explicit group input (vdndDraggableGroup or vdndDroppableGroup)\n * 2. Inherited group from parent vdndGroup directive\n * 3. null (with dev-mode warning)\n *\n * @example\n * ```typescript\n * readonly #effectiveGroup = createEffectiveGroupSignal({\n * explicitGroup: this.vdndDraggableGroup,\n * parentGroup: this.#parentGroup,\n * elementId: this.vdndDraggable,\n * elementType: 'draggable',\n * });\n * ```\n */\nexport function createEffectiveGroupSignal(options: GroupResolutionOptions): Signal<string | null> {\n const { explicitGroup, parentGroup, elementId, elementType } = options;\n\n // State object to track whether we've warned (mutable closure state)\n const state: GroupResolutionState = { hasWarnedMissingGroup: false };\n\n return computed((): string | null => {\n const explicit = explicitGroup();\n if (explicit) return explicit;\n\n const inherited = parentGroup?.group();\n if (inherited) return inherited;\n\n if (isDevMode() && !state.hasWarnedMissingGroup) {\n const directive = elementType === 'draggable' ? 'vdndDraggable' : 'vdndDroppable';\n const groupInput = elementType === 'draggable' ? 'vdndDraggableGroup' : 'vdndDroppableGroup';\n const action = elementType === 'draggable' ? 'Drag' : 'Dropping';\n\n console.warn(\n `[ngx-virtual-dnd] [${directive}=\"${elementId()}\"] requires a group. ` +\n `Either set ${groupInput} or wrap in a vdndGroup directive. ` +\n `${action} will be disabled for this element.`,\n );\n state.hasWarnedMissingGroup = true;\n }\n\n return null;\n });\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n output,\n untracked,\n} from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n DragEnterEvent,\n DragLeaveEvent,\n DragOverEvent,\n DragState,\n DropEvent,\n END_OF_LIST,\n} from '../models/drag-drop.models';\nimport { VDND_GROUP_TOKEN } from './droppable-group.directive';\nimport { createEffectiveGroupSignal } from '../utils/group-resolution';\n\n/**\n * Marks an element as a valid drop target within the virtual scroll drag-and-drop system.\n *\n * @example\n * ```html\n * <!-- With explicit group -->\n * <div\n * vdndDroppable=\"list-1\"\n * vdndDroppableGroup=\"my-group\"\n * (drop)=\"onDrop($event)\">\n * <!-- Draggable items here -->\n * </div>\n *\n * <!-- With inherited group from parent vdndGroup directive -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDroppable=\"list-1\" (drop)=\"onDrop($event)\">\n * <!-- Draggable items here -->\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndDroppable]',\n host: {\n '[attr.data-droppable-id]': 'vdndDroppable()',\n '[attr.data-droppable-group]': 'effectiveGroup()',\n '[attr.aria-dropeffect]': '\"move\"',\n '[class.vdnd-droppable]': 'true',\n '[class.vdnd-droppable-active]': 'isActive()',\n '[class.vdnd-droppable-disabled]': 'disabled()',\n },\n})\nexport class DroppableDirective implements OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #dragState = inject(DragStateService);\n readonly #autoScroll = inject(AutoScrollService);\n readonly #parentGroup = inject(VDND_GROUP_TOKEN, { optional: true });\n\n /** Unique identifier for this droppable */\n vdndDroppable = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n vdndDroppableGroup = input<string>();\n\n /**\n * Resolved group name - uses explicit input or falls back to parent group.\n * Returns null (and disables dropping) if neither is available.\n */\n readonly effectiveGroup = createEffectiveGroupSignal({\n explicitGroup: this.vdndDroppableGroup,\n parentGroup: this.#parentGroup,\n elementId: this.vdndDroppable,\n elementType: 'droppable',\n });\n\n /** Optional data associated with this droppable */\n vdndDroppableData = input<unknown>();\n\n /** Whether this droppable is disabled */\n disabled = input<boolean>(false);\n\n /** Enable auto-scroll when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Emits when a dragged item enters this droppable */\n dragEnter = output<DragEnterEvent>();\n\n /** Emits when a dragged item leaves this droppable */\n dragLeave = output<DragLeaveEvent>();\n\n /** Emits while a dragged item is over this droppable */\n dragOver = output<DragOverEvent>();\n\n /** Emits when an item is dropped on this droppable */\n // eslint-disable-next-line @angular-eslint/no-output-native\n drop = output<DropEvent>();\n\n /** Whether this droppable is currently being targeted */\n readonly isActive = computed(() => {\n const activeId = this.#dragState.activeDroppableId();\n return activeId === this.vdndDroppable() && !this.disabled();\n });\n\n /** The current placeholder ID when this droppable is active */\n readonly placeholderId = computed(() => {\n if (!this.isActive()) {\n return null;\n }\n return this.#dragState.placeholderId();\n });\n\n /** Track previous active state for enter/leave events */\n #wasActive = false;\n\n /** Track previous placeholder for over events */\n #previousPlaceholder: string | null = null;\n\n /** Cached state for handling drop (since state is cleared before effect fires) */\n #cachedDragState: DragState | null = null;\n\n ngOnInit(): void {\n // Without a group, this droppable can't participate in DnD (fail gracefully).\n if (!this.effectiveGroup()) {\n return;\n }\n\n // Register with auto-scroll service only if this element is actually scrollable\n // (i.e., has overflow: auto/scroll and content taller than container)\n if (this.autoScrollEnabled() && this.#isScrollable()) {\n this.#autoScroll.registerContainer(\n this.vdndDroppable(),\n this.#elementRef.nativeElement,\n this.autoScrollConfig(),\n );\n }\n }\n\n /**\n * Check if this element is actually scrollable.\n */\n #isScrollable(): boolean {\n const el = this.#elementRef.nativeElement;\n const style = window.getComputedStyle(el);\n const overflowY = style.overflowY;\n const overflowX = style.overflowX;\n\n // Check if overflow allows scrolling\n const hasScrollableOverflow =\n overflowY === 'auto' ||\n overflowY === 'scroll' ||\n overflowX === 'auto' ||\n overflowX === 'scroll';\n\n if (!hasScrollableOverflow) {\n return false;\n }\n\n // Check if content is larger than container\n return el.scrollHeight > el.clientHeight || el.scrollWidth > el.clientWidth;\n }\n\n constructor() {\n // React to state changes and emit appropriate events\n effect(() => {\n const active = this.isActive();\n const placeholder = this.placeholderId();\n const draggedItem = this.#dragState.draggedItem();\n const isDragging = this.#dragState.isDragging();\n // NOTE: cursorPosition is read with untracked() below to avoid effect running 60x/sec\n\n // Cache state while active for use during drop handling\n if (active && isDragging && draggedItem) {\n this.#cachedDragState = this.#dragState.getStateSnapshot();\n }\n\n // Handle drag end (drop)\n if (!isDragging && this.#wasActive && draggedItem === null) {\n // Check if drag was cancelled (e.g., Escape key)\n if (!this.#dragState.wasCancelled()) {\n // Drag ended normally - this is a drop\n this.#handleDrop();\n }\n this.#cachedDragState = null;\n }\n\n // Handle enter/leave\n if (active && !this.#wasActive) {\n // Entered\n if (draggedItem) {\n this.dragEnter.emit({\n droppableId: this.vdndDroppable(),\n draggedItem,\n });\n }\n } else if (!active && this.#wasActive) {\n // Left (but not dropped here)\n if (isDragging && draggedItem) {\n this.dragLeave.emit({\n droppableId: this.vdndDroppable(),\n draggedItem,\n });\n }\n // Clear cached state when leaving without dropping\n if (isDragging) {\n this.#cachedDragState = null;\n }\n }\n\n // Handle over (placeholder changed)\n if (active && placeholder !== this.#previousPlaceholder) {\n if (draggedItem) {\n // Use untracked() to read cursorPosition without tracking it as a dependency\n // This prevents the effect from running on every cursor move (60Hz during autoscroll)\n const cursorPosition = untracked(() => this.#dragState.cursorPosition());\n if (cursorPosition) {\n this.dragOver.emit({\n droppableId: this.vdndDroppable(),\n draggedItem,\n placeholderId: placeholder,\n position: cursorPosition,\n });\n }\n }\n }\n\n this.#wasActive = active;\n this.#previousPlaceholder = placeholder;\n });\n }\n\n ngOnDestroy(): void {\n // Clean up if this droppable is destroyed while being active\n if (this.isActive()) {\n this.#dragState.setActiveDroppable(null);\n }\n\n // Unregister from auto-scroll\n this.#autoScroll.unregisterContainer(this.vdndDroppable());\n }\n\n /**\n * Handle a drop on this droppable.\n */\n #handleDrop(): void {\n // Use cached state since the actual state is cleared before this effect fires\n const state = this.#cachedDragState;\n\n if (!state?.draggedItem || state.activeDroppableId !== this.vdndDroppable()) {\n return;\n }\n\n const sourceDroppableId = state.sourceDroppableId ?? '';\n const placeholderId = state.placeholderId ?? END_OF_LIST;\n\n // Use the stored source index from drag state\n // This is critical for virtual scrolling where the original element may no longer\n // be in the DOM after autoscroll (it gets virtualized out of view)\n const sourceIndex =\n state.sourceIndex ?? this.#getItemIndex(state.draggedItem.draggableId, sourceDroppableId);\n\n // Use the pre-calculated placeholderIndex if available (more reliable)\n // Fall back to DOM-based calculation if not\n let destinationIndex =\n state.placeholderIndex !== null && state.placeholderIndex !== undefined\n ? state.placeholderIndex\n : this.#getDestinationIndex(placeholderId);\n\n // Adjust for same-list reordering: if moving within the same list and\n // the destination is after the source, we need to account for the item\n // being removed from its original position\n if (sourceDroppableId === this.vdndDroppable() && sourceIndex < destinationIndex) {\n destinationIndex--;\n }\n\n this.drop.emit({\n source: {\n draggableId: state.draggedItem.draggableId,\n droppableId: sourceDroppableId,\n index: sourceIndex,\n data: state.draggedItem.data,\n },\n destination: {\n droppableId: this.vdndDroppable(),\n placeholderId,\n index: destinationIndex,\n data: this.vdndDroppableData(),\n },\n });\n }\n\n /**\n * Get the index of an item in a droppable.\n * This is a simplified implementation - in practice, the consumer would track this.\n */\n #getItemIndex(draggableId: string, droppableId: string): number {\n // Find all draggables in the source droppable\n const droppable = document.querySelector(`[data-droppable-id=\"${droppableId}\"]`);\n if (!droppable) {\n return 0;\n }\n\n const draggables = droppable.querySelectorAll('[data-draggable-id]');\n for (let i = 0; i < draggables.length; i++) {\n if (draggables[i].getAttribute('data-draggable-id') === draggableId) {\n return i;\n }\n }\n\n return 0;\n }\n\n /**\n * Get the destination index based on the placeholder.\n */\n #getDestinationIndex(placeholderId: string): number {\n // Exclude placeholder elements from the count\n const draggables = this.#elementRef.nativeElement.querySelectorAll(\n '[data-draggable-id]:not([data-draggable-id=\"placeholder\"])',\n );\n\n if (placeholderId === END_OF_LIST) {\n return draggables.length;\n }\n\n // Find the index of the placeholder item\n for (let i = 0; i < draggables.length; i++) {\n if (draggables[i].getAttribute('data-draggable-id') === placeholderId) {\n return i;\n }\n }\n\n return 0;\n }\n\n /**\n * Get the element reference (for external use).\n */\n getElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Manually scroll this droppable.\n */\n scrollBy(delta: number): void {\n this.#elementRef.nativeElement.scrollTop += delta;\n }\n\n /**\n * Get the current scroll position.\n */\n getScrollTop(): number {\n return this.#elementRef.nativeElement.scrollTop;\n }\n\n /**\n * Get the scroll height.\n */\n getScrollHeight(): number {\n return this.#elementRef.nativeElement.scrollHeight;\n }\n}\n","import { ChangeDetectionStrategy, Component, input, output, TemplateRef } from '@angular/core';\nimport {\n VirtualScrollContainerComponent,\n VirtualScrollItemContext,\n VisibleRangeChange,\n} from './virtual-scroll-container.component';\nimport { DroppableDirective } from '../directives/droppable.directive';\nimport { AutoScrollConfig } from '../services/auto-scroll.service';\nimport {\n DragEnterEvent,\n DragLeaveEvent,\n DragOverEvent,\n DropEvent,\n} from '../models/drag-drop.models';\n\n/**\n * A high-level component that combines droppable, virtual scroll, and placeholder\n * functionality into a single, easy-to-use component.\n *\n * This component significantly reduces boilerplate by automatically handling:\n * - Placeholder insertion at the correct position\n * - Sticky item management for the dragged item\n * - Virtual scrolling with proper drag-and-drop integration\n * - Droppable container setup\n *\n * @example\n * ```html\n * <!-- Before (verbose): ~45 lines of boilerplate -->\n * <div vdndDroppable=\"list-1\" vdndDroppableGroup=\"demo\" (drop)=\"onDrop($event)\">\n * <vdnd-virtual-scroll\n * [items]=\"itemsWithPlaceholder()\"\n * [itemHeight]=\"50\"\n * [stickyItemIds]=\"stickyIds()\"\n * [itemIdFn]=\"getItemId\"\n * [trackByFn]=\"trackById\"\n * [itemTemplate]=\"itemTpl\">\n * </vdnd-virtual-scroll>\n * </div>\n *\n * <!-- After (concise): ~8 lines -->\n * <vdnd-sortable-list\n * droppableId=\"list-1\"\n * group=\"demo\"\n * [items]=\"list()\"\n * [itemHeight]=\"50\"\n * [itemIdFn]=\"getItemId\"\n * [itemTemplate]=\"itemTpl\"\n * (drop)=\"onDrop($event)\">\n * </vdnd-sortable-list>\n * ```\n */\n@Component({\n selector: 'vdnd-sortable-list',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [VirtualScrollContainerComponent, DroppableDirective],\n host: {\n class: 'vdnd-sortable-list',\n '[style.display]': '\"block\"',\n },\n template: `\n <div\n class=\"vdnd-sortable-list-droppable\"\n [vdndDroppable]=\"droppableId()\"\n [vdndDroppableGroup]=\"group()\"\n [vdndDroppableData]=\"droppableData()\"\n [disabled]=\"disabled()\"\n (dragEnter)=\"dragEnter.emit($event)\"\n (dragLeave)=\"dragLeave.emit($event)\"\n (dragOver)=\"dragOver.emit($event)\"\n (drop)=\"drop.emit($event)\"\n >\n <vdnd-virtual-scroll\n [items]=\"items()\"\n [itemHeight]=\"itemHeight()\"\n [itemIdFn]=\"itemIdFn()\"\n [trackByFn]=\"trackByFn()\"\n [itemTemplate]=\"itemTemplate()\"\n [droppableId]=\"droppableId()\"\n [autoStickyDraggedItem]=\"true\"\n [containerHeight]=\"containerHeight()\"\n [overscan]=\"overscan()\"\n [autoScrollEnabled]=\"autoScrollEnabled()\"\n [autoScrollConfig]=\"autoScrollConfig()\"\n (visibleRangeChange)=\"visibleRangeChange.emit($event)\"\n (scrollPositionChange)=\"scrollPositionChange.emit($event)\"\n >\n </vdnd-virtual-scroll>\n </div>\n `,\n styles: `\n :host {\n display: block;\n }\n `,\n})\nexport class VirtualSortableListComponent<T> {\n // ========== Required Inputs ==========\n\n /** Unique identifier for this droppable list */\n droppableId = input.required<string>();\n\n /** Drag-and-drop group name */\n group = input.required<string>();\n\n /** Array of items to render */\n items = input.required<T[]>();\n\n /** Height of each item in pixels */\n itemHeight = input.required<number>();\n\n /** Function to get a unique ID from an item */\n itemIdFn = input.required<(item: T) => string>();\n\n /** Template for rendering each item */\n itemTemplate = input.required<TemplateRef<VirtualScrollItemContext<T>>>();\n\n // ========== Optional Inputs ==========\n\n /**\n * Track-by function for the @for loop.\n * Optional - if not provided, will be derived from itemIdFn.\n */\n trackByFn = input<(index: number, item: T) => string | number>();\n\n /** Optional data associated with this droppable */\n droppableData = input<unknown>();\n\n /** Whether this sortable list is disabled */\n disabled = input<boolean>(false);\n\n /**\n * Height of the container in pixels.\n * If not provided, uses CSS-based height detection.\n */\n containerHeight = input<number>();\n\n /** Number of items to render above/below the visible area */\n overscan = input<number>(3);\n\n /** Enable auto-scroll when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== Outputs ==========\n\n /** Emits when an item is dropped on this list */\n // eslint-disable-next-line @angular-eslint/no-output-native\n drop = output<DropEvent>();\n\n /** Emits when a dragged item enters this list */\n dragEnter = output<DragEnterEvent>();\n\n /** Emits when a dragged item leaves this list */\n dragLeave = output<DragLeaveEvent>();\n\n /** Emits while a dragged item is over this list */\n dragOver = output<DragOverEvent>();\n\n /** Emits when the visible range changes */\n visibleRangeChange = output<VisibleRangeChange>();\n\n /** Emits when scroll position changes */\n scrollPositionChange = output<number>();\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { VDND_VIRTUAL_VIEWPORT, VdndVirtualViewport } from '../tokens/virtual-viewport.token';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\n\n/**\n * A virtual viewport component that provides efficient wrapper-based positioning\n * for virtual scrolling. This component acts as the scroll container and provides\n * a content wrapper with GPU-accelerated transform positioning.\n *\n * Use this component when you need virtual scrolling with optimal performance.\n * Items rendered inside via `*vdndVirtualFor` will be positioned using a single\n * transform on the wrapper, rather than individual absolute positioning.\n *\n * @example\n * Basic usage:\n * ```html\n * <vdnd-virtual-viewport\n * [itemHeight]=\"50\"\n * [totalItems]=\"items().length\"\n * style=\"height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n *\n * @example\n * With Ionic (disable Ionic's scroll, use viewport as scroll host):\n * ```html\n * <ion-content [scrollY]=\"false\">\n * <vdnd-virtual-viewport\n * class=\"ion-content-scroll-host\"\n * [itemHeight]=\"72\"\n * [totalItems]=\"tasks().length\"\n * style=\"height: 100%;\">\n * <ng-container *vdndVirtualFor=\"...\">\n * ...\n * </ng-container>\n * </vdnd-virtual-viewport>\n * </ion-content>\n * ```\n *\n * @example\n * With content offset (for headers above the list):\n * ```html\n * <vdnd-virtual-viewport\n * [itemHeight]=\"50\"\n * [totalItems]=\"items().length\"\n * [contentOffset]=\"headerHeight()\"\n * style=\"height: 100%;\">\n * <div class=\"header\" [style.height.px]=\"headerHeight()\">Header</div>\n * <ng-container *vdndVirtualFor=\"...\">\n * ...\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-viewport',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: VDND_VIRTUAL_VIEWPORT, useExisting: VirtualViewportComponent },\n { provide: VDND_SCROLL_CONTAINER, useExisting: VirtualViewportComponent },\n ],\n host: {\n class: 'vdnd-virtual-viewport',\n '[style.display]': '\"block\"',\n '[style.overflow]': '\"auto\"',\n '[style.position]': '\"relative\"',\n // Disable browser scroll anchoring to prevent scroll position adjustments\n // when DOM changes (e.g., placeholder position updates during drag)\n '[style.overflow-anchor]': '\"none\"',\n },\n template: `\n <!-- Spacer maintains total scroll height -->\n <div\n class=\"vdnd-viewport-spacer\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"contentOffset()\"\n [style.left.px]=\"0\"\n [style.width.px]=\"1\"\n [style.height.px]=\"totalHeight()\"\n [style.visibility]=\"'hidden'\"\n [style.pointer-events]=\"'none'\"\n ></div>\n\n <!-- Content wrapper with GPU-accelerated transform -->\n <div\n class=\"vdnd-viewport-content\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"contentOffset()\"\n [style.left.px]=\"0\"\n [style.right.px]=\"0\"\n [style.will-change]=\"'transform'\"\n [style.transform]=\"contentTransform()\"\n >\n <ng-content></ng-content>\n </div>\n `,\n})\nexport class VirtualViewportComponent\n implements VdndVirtualViewport, VdndScrollContainer, OnInit, OnDestroy\n{\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n readonly #autoScrollService = inject(AutoScrollService);\n\n /** Current scroll position (reactive) */\n readonly #scrollTop = signal(0);\n\n /** Measured container height (reactive) */\n readonly #containerHeight = signal(0);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-viewport-${Math.random().toString(36).slice(2, 9)}`;\n\n /**\n * The actual first rendered item index, set by VirtualForDirective.\n * This accounts for overscan and is used for wrapper positioning.\n */\n readonly #renderStartIndex = signal(0);\n\n // ========== Inputs ==========\n\n /** Height of each item in pixels */\n itemHeight = input.required<number>();\n\n /** Total number of items */\n totalItems = input.required<number>();\n\n /** Offset for content below headers (in pixels) */\n contentOffset = input<number>(0);\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== Computed Values ==========\n\n /** Total height of all items (for scroll height) */\n readonly totalHeight = computed(() => this.totalItems() * this.itemHeight());\n\n /** Transform for content wrapper positioning */\n readonly contentTransform = computed(() => {\n const startIndex = this.#renderStartIndex();\n const itemHeight = this.itemHeight();\n return `translateY(${startIndex * itemHeight}px)`;\n });\n\n // ========== VdndVirtualViewport Implementation ==========\n\n scrollTop(): number {\n return this.#scrollTop();\n }\n\n containerHeight(): number {\n return this.#containerHeight();\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Called by VirtualForDirective to inform this viewport of the actual\n * first rendered item index. Used for wrapper positioning.\n */\n setRenderStartIndex(index: number): void {\n this.#renderStartIndex.set(index);\n }\n\n // ========== VdndScrollContainer Implementation ==========\n\n scrollTo(options: ScrollToOptions): void {\n this.nativeElement.scrollTo(options);\n }\n\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(\n this.scrollTop() + delta,\n this.nativeElement.scrollHeight - this.nativeElement.clientHeight,\n ),\n );\n this.scrollTo({ top: newPosition });\n }\n\n // ========== Lifecycle ==========\n\n ngOnInit(): void {\n this.#setupScrollListener();\n this.#setupResizeObserver();\n this.#registerAutoScroll();\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n this.#unregisterAutoScroll();\n }\n\n // ========== Private Methods ==========\n\n /** Minimum scroll delta (px) to trigger signal update */\n readonly #scrollThreshold = 5;\n\n #setupScrollListener(): void {\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: this.#scrollThreshold,\n });\n }\n\n #setupResizeObserver(): void {\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n height: this.#containerHeight,\n minDeltaPx: 1,\n });\n }\n\n #registerAutoScroll(): void {\n if (this.autoScrollEnabled()) {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.registerContainer(id, this.nativeElement, this.autoScrollConfig());\n }\n }\n\n #unregisterAutoScroll(): void {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.unregisterContainer(id);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { VDND_VIRTUAL_VIEWPORT, VdndVirtualViewport } from '../tokens/virtual-viewport.token';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\n\n/**\n * A virtual content component that provides wrapper-based positioning\n * for virtual scrolling within an EXTERNAL scroll container.\n *\n * Use this component when you need virtual scrolling alongside other content\n * (headers, footers) within a shared scroll container. The component provides\n * a content wrapper with GPU-accelerated transform positioning while delegating\n * scroll handling to the parent `vdndScrollable` container.\n *\n * @example\n * Mixed content with header and footer:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 100vh;\">\n * <!-- Header that scrolls away -->\n * <div class=\"header\" #header>Welcome!</div>\n *\n * <!-- Virtual list with wrapper positioning -->\n * <vdnd-virtual-content\n * [itemHeight]=\"50\"\n * [totalItems]=\"items().length\"\n * [contentOffset]=\"header.offsetHeight\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-content>\n *\n * <!-- Footer at the end -->\n * <div class=\"footer\">Load more</div>\n * </div>\n * ```\n *\n * @example\n * With Ionic:\n * ```html\n * <ion-content [scrollY]=\"false\">\n * <div class=\"scroll-container ion-content-scroll-host\" vdndScrollable>\n * <div class=\"page-header\" #header>...</div>\n *\n * <vdnd-virtual-content\n * [itemHeight]=\"72\"\n * [totalItems]=\"tasks().length\"\n * [contentOffset]=\"headerHeight()\">\n * <ng-container *vdndVirtualFor=\"...\">...</ng-container>\n * </vdnd-virtual-content>\n *\n * <div class=\"footer\">...</div>\n * </div>\n * </ion-content>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-content',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: VDND_VIRTUAL_VIEWPORT, useExisting: VirtualContentComponent },\n { provide: VDND_SCROLL_CONTAINER, useExisting: VirtualContentComponent },\n ],\n host: {\n class: 'vdnd-virtual-content',\n '[style.display]': '\"block\"',\n '[style.position]': '\"relative\"',\n '[attr.data-content-offset]': 'contentOffset()',\n '[attr.data-item-height]': 'itemHeight()',\n },\n template: `\n <!-- Spacer maintains scroll height for the virtual list portion -->\n <div\n class=\"vdnd-content-spacer\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"0\"\n [style.left.px]=\"0\"\n [style.width.px]=\"1\"\n [style.height.px]=\"totalHeight()\"\n [style.visibility]=\"'hidden'\"\n [style.pointer-events]=\"'none'\"\n ></div>\n\n <!-- Content wrapper with GPU-accelerated transform -->\n <div\n class=\"vdnd-content-wrapper\"\n [style.position]=\"'absolute'\"\n [style.top.px]=\"0\"\n [style.left.px]=\"0\"\n [style.right.px]=\"0\"\n [style.will-change]=\"'transform'\"\n [style.transform]=\"contentTransform()\"\n >\n <ng-content></ng-content>\n </div>\n `,\n})\nexport class VirtualContentComponent implements VdndVirtualViewport, VdndScrollContainer {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * The parent scroll container injected via skip-self to get the actual scrollable element.\n * We provide our own VDND_SCROLL_CONTAINER with adjusted values to children.\n */\n readonly #parentScrollContainer = inject(VDND_SCROLL_CONTAINER, { skipSelf: true });\n\n // ========== Inputs ==========\n\n /** Height of each item in pixels */\n itemHeight = input.required<number>();\n\n /** Total number of items */\n totalItems = input.required<number>();\n\n /** Offset for content above the virtual list (e.g., header height) */\n contentOffset = input<number>(0);\n\n // ========== Internal State ==========\n\n /**\n * The actual first rendered item index, set by VirtualForDirective.\n * This accounts for overscan and is used for wrapper positioning.\n */\n readonly #renderStartIndex = signal(0);\n\n // ========== Computed Values ==========\n\n /** Total height of all items (for scroll height) */\n readonly totalHeight = computed(() => this.totalItems() * this.itemHeight());\n\n /**\n * Adjusted scroll position - subtracts the content offset so the virtual scroll\n * calculates visible items correctly relative to where the list starts.\n */\n readonly #adjustedScrollTop = computed(() => {\n return Math.max(0, this.#parentScrollContainer.scrollTop() - this.contentOffset());\n });\n\n /** Transform for content wrapper positioning */\n readonly contentTransform = computed(() => {\n const startIndex = this.#renderStartIndex();\n const itemHeight = this.itemHeight();\n return `translateY(${startIndex * itemHeight}px)`;\n });\n\n // ========== VdndVirtualViewport Implementation ==========\n\n /** Adjusted scroll position relative to the virtual list start */\n scrollTop(): number {\n return this.#adjustedScrollTop();\n }\n\n containerHeight(): number {\n return this.#parentScrollContainer.containerHeight();\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Called by VirtualForDirective to inform this viewport of the actual\n * first rendered item index. Used for wrapper positioning.\n */\n setRenderStartIndex(index: number): void {\n this.#renderStartIndex.set(index);\n }\n\n // ========== VdndScrollContainer Implementation ==========\n\n /**\n * Scroll to a specific position, adjusting for content offset.\n */\n scrollTo(options: ScrollToOptions): void {\n const adjustedOptions = { ...options };\n if (adjustedOptions.top !== undefined) {\n // Add offset back when scrolling to ensure correct position\n adjustedOptions.top += this.contentOffset();\n }\n this.#parentScrollContainer.scrollTo(adjustedOptions);\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { type CursorPosition, END_OF_LIST, type GrabOffset } from '../models/drag-drop.models';\nimport { PositionCalculatorService } from './position-calculator.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DragIndexCalculatorService {\n readonly #positionCalculator = inject(PositionCalculatorService);\n\n getTotalItemCount(args: {\n droppableElement: HTMLElement;\n isSameList: boolean;\n draggedItemHeight: number;\n }): number {\n return this.#getTotalItemCount(args.droppableElement, args.isSameList, args.draggedItemHeight);\n }\n\n calculatePlaceholderIndex(args: {\n droppableElement: HTMLElement;\n position: CursorPosition;\n grabOffset: GrabOffset | null;\n draggedItemHeight: number;\n sourceDroppableId: string | null;\n sourceIndex: number | null;\n }): { index: number; placeholderId: string } {\n const {\n droppableElement,\n position,\n grabOffset,\n draggedItemHeight,\n sourceDroppableId,\n sourceIndex,\n } = args;\n\n // Get container and measurements - handle both embedded virtual-scroll and page-level scroll\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n const virtualContent = droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content');\n\n let container: HTMLElement;\n let currentScrollTop: number;\n let rect: DOMRect;\n\n if (virtualScroll) {\n // Standard virtual scroll component - scroll container is the virtual scroll element\n container = virtualScroll as HTMLElement;\n rect = container.getBoundingClientRect();\n currentScrollTop = container.scrollTop;\n } else if (virtualContent) {\n // Page-level scroll: find scrollable parent and get adjusted scroll\n const scrollableParent = virtualContent.closest('.vdnd-scrollable') as HTMLElement | null;\n if (scrollableParent) {\n container = scrollableParent;\n // Use scroll container rect + content offset to avoid stale virtualContent rects.\n rect = container.getBoundingClientRect();\n const contentOffsetAttr = (virtualContent as HTMLElement).getAttribute(\n 'data-content-offset',\n );\n const contentOffset = contentOffsetAttr ? parseFloat(contentOffsetAttr) : 0;\n const offsetValue = Number.isFinite(contentOffset) ? contentOffset : 0;\n currentScrollTop = container.scrollTop - offsetValue;\n } else {\n container = virtualContent as HTMLElement;\n rect = container.getBoundingClientRect();\n currentScrollTop = 0;\n }\n } else {\n // Fallback: use droppable element directly\n container = droppableElement;\n rect = container.getBoundingClientRect();\n currentScrollTop = container.scrollTop;\n }\n\n // Prefer configured item height from virtual scroll/content over actual element height.\n // This prevents drift when actual element height differs from grid spacing.\n const configuredHeight =\n virtualScroll?.getAttribute('data-item-height') ??\n (virtualContent as HTMLElement | null)?.getAttribute('data-item-height');\n const parsedHeight = configuredHeight ? parseFloat(configuredHeight) : Number.NaN;\n const itemHeight = Number.isFinite(parsedHeight)\n ? parsedHeight\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 50);\n\n // Calculate preview center position mathematically\n // The preview is positioned at: cursorPosition - grabOffset (see drag-preview.component.ts)\n // So preview center = cursorPosition.y - grabOffset.y + itemHeight/2\n // Using math avoids Safari's stale getBoundingClientRect() issue during autoscroll\n const previewCenterY = position.y - (grabOffset?.y ?? 0) + itemHeight / 2;\n\n // Convert to visual index (which slot the preview center is in)\n const relativeY = previewCenterY - rect.top + currentScrollTop;\n const visualIndex = Math.floor(relativeY / itemHeight);\n\n // Check if same-list drag\n const currentDroppableId = this.#positionCalculator.getDroppableId(droppableElement);\n const isSameList = sourceDroppableId !== null && sourceDroppableId === currentDroppableId;\n\n // Same-list adjustment: if pointing at or after source position, add 1\n // This accounts for the hidden item shifting everything up visually\n let placeholderIndex = visualIndex;\n const sourceIndexValue = isSameList ? (sourceIndex ?? -1) : -1;\n if (isSameList && sourceIndexValue >= 0 && visualIndex >= sourceIndexValue) {\n placeholderIndex = visualIndex + 1;\n }\n\n // Get total items for clamping\n const totalItems = this.#getTotalItemCount(droppableElement, isSameList, draggedItemHeight);\n\n // Edge detection: allow dropping at the END of the list when cursor is near bottom edge.\n // Due to max scroll limits, the math alone can't reach totalItems when the list is longer\n // than the viewport. If cursor is in the bottom portion of the container and we're at\n // or past the last visible slot, snap to totalItems.\n const cursorRelativeToBottom = rect.bottom - previewCenterY;\n const isNearBottomEdge = cursorRelativeToBottom < itemHeight;\n if (isNearBottomEdge && placeholderIndex >= totalItems - 1) {\n placeholderIndex = totalItems;\n }\n\n // Clamp to valid range\n placeholderIndex = Math.max(0, Math.min(placeholderIndex, totalItems));\n\n return { index: placeholderIndex, placeholderId: END_OF_LIST };\n }\n\n #getTotalItemCount(\n droppableElement: HTMLElement,\n isSameList: boolean,\n draggedItemHeight: number,\n ): number {\n // Check for embedded virtual scroll component\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n if (virtualScroll) {\n // Use the spacer's height, NOT scrollHeight, to determine item count.\n // scrollHeight can be inflated by absolutely-positioned elements like the placeholder.\n const spacer = virtualScroll.querySelector(\n '.vdnd-virtual-scroll-spacer',\n ) as HTMLElement | null;\n const configuredHeight = virtualScroll.getAttribute('data-item-height');\n const itemHeight = configuredHeight\n ? parseInt(configuredHeight, 10)\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 50);\n\n let totalHeight: number;\n if (spacer) {\n // Get the spacer's explicit height (set via Angular binding)\n totalHeight = parseFloat(spacer.style.height) || 0;\n } else {\n // Fallback: use scrollHeight if spacer not found\n totalHeight = (virtualScroll as HTMLElement).scrollHeight;\n }\n\n // When same-list, spacer height reflects N-1 items (one is hidden)\n // Add 1 back to get true total\n const count = Math.floor(totalHeight / itemHeight);\n return isSameList ? count + 1 : count;\n }\n\n // Check for page-level scroll (vdnd-virtual-content)\n const virtualContent = droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content');\n if (virtualContent) {\n // Use spacer height to determine total items\n const spacer = virtualContent.querySelector('.vdnd-content-spacer') as HTMLElement | null;\n if (spacer) {\n const totalHeight = parseFloat(spacer.style.height) || 0;\n const configuredHeight = virtualContent.getAttribute('data-item-height');\n const itemHeight = configuredHeight\n ? parseInt(configuredHeight, 10)\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 72);\n const count = Math.floor(totalHeight / itemHeight);\n return isSameList ? count + 1 : count;\n }\n }\n\n // Fallback for non-virtual scroll\n const items = droppableElement.querySelectorAll('[data-draggable-id]');\n return items.length + (isSameList ? 1 : 0);\n }\n\n #getDraggedItemHeightFallback(height: number, fallback: number): number {\n return Number.isFinite(height) && height > 0 ? height : fallback;\n }\n}\n","import {\n afterNextRender,\n computed,\n Directive,\n ElementRef,\n EnvironmentInjector,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n output,\n signal,\n} from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { PositionCalculatorService } from '../services/position-calculator.service';\nimport { AutoScrollService } from '../services/auto-scroll.service';\nimport { ElementCloneService } from '../services/element-clone.service';\nimport { KeyboardDragService } from '../services/keyboard-drag.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport {\n CursorPosition,\n DragEndEvent,\n DragMoveEvent,\n DragStartEvent,\n GrabOffset,\n} from '../models/drag-drop.models';\nimport { VDND_GROUP_TOKEN } from './droppable-group.directive';\nimport { createEffectiveGroupSignal } from '../utils/group-resolution';\n\n/**\n * Makes an element draggable within the virtual scroll drag-and-drop system.\n *\n * @example\n * ```html\n * <!-- With explicit group -->\n * <div\n * vdndDraggable=\"item-1\"\n * vdndDraggableGroup=\"my-group\"\n * [vdndDraggableData]=\"item\">\n * Drag me!\n * </div>\n *\n * <!-- With inherited group from parent vdndGroup directive -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDraggable=\"item-1\" [vdndDraggableData]=\"item\">\n * Drag me!\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndDraggable]',\n host: {\n '[attr.data-draggable-id]': 'vdndDraggable()',\n '[class.vdnd-draggable]': 'true',\n '[class.vdnd-draggable-dragging]': 'isDragging()',\n '[class.vdnd-draggable-disabled]': 'disabled()',\n '[class.vdnd-drag-pending]': 'isPending()',\n '[style.display]': 'isDragging() ? \"none\" : null',\n '[attr.aria-grabbed]': 'isDragging() ? \"true\" : \"false\"',\n '[tabindex]': 'disabled() ? -1 : 0',\n '(mousedown)': 'onPointerDown($event, false)',\n '(touchstart)': 'onPointerDown($event, true)',\n '(keydown.space)': 'onKeyboardActivate($event)',\n '(keydown.enter)': 'onEnterKey($event)',\n '(keydown.arrowup)': 'onArrowUp($event)',\n '(keydown.arrowdown)': 'onArrowDown($event)',\n '(keydown.arrowleft)': 'onArrowLeft($event)',\n '(keydown.arrowright)': 'onArrowRight($event)',\n '(keydown.escape)': 'onEscape()',\n },\n})\nexport class DraggableDirective implements OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #dragState = inject(DragStateService);\n readonly #positionCalculator = inject(PositionCalculatorService);\n readonly #autoScroll = inject(AutoScrollService);\n readonly #elementClone = inject(ElementCloneService);\n readonly #keyboardDrag = inject(KeyboardDragService);\n readonly #dragIndexCalculator = inject(DragIndexCalculatorService);\n readonly #ngZone = inject(NgZone);\n readonly #envInjector = inject(EnvironmentInjector);\n readonly #parentGroup = inject(VDND_GROUP_TOKEN, { optional: true });\n\n /** Unique identifier for this draggable */\n vdndDraggable = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n vdndDraggableGroup = input<string>();\n\n /**\n * Resolved group name - uses explicit input or falls back to parent group.\n * Returns null (and disables drag) if neither is available.\n */\n readonly #effectiveGroup = createEffectiveGroupSignal({\n explicitGroup: this.vdndDraggableGroup,\n parentGroup: this.#parentGroup,\n elementId: this.vdndDraggable,\n elementType: 'draggable',\n });\n\n /** Optional data associated with this draggable */\n vdndDraggableData = input<unknown>();\n\n /** Whether this draggable is disabled */\n disabled = input<boolean>(false);\n\n /** CSS selector for drag handle (if not provided, entire element is draggable) */\n dragHandle = input<string>();\n\n /** Minimum distance to move before drag starts (prevents accidental drags) */\n dragThreshold = input<number>(5);\n\n /**\n * Delay in milliseconds before drag starts after pointer down.\n * User must hold without moving for this duration.\n * Set to 0 for immediate drag (default behavior).\n */\n dragDelay = input<number>(0);\n\n /** Lock dragging to a single axis ('x' = horizontal only, 'y' = vertical only) */\n lockAxis = input<'x' | 'y' | null>(null);\n\n /** Emits when drag starts */\n dragStart = output<DragStartEvent>();\n\n /** Emits during drag movement */\n dragMove = output<DragMoveEvent>();\n\n /** Emits when drag ends */\n dragEnd = output<DragEndEvent>();\n\n /** Emits when ready-to-drag state changes (after delay passes) */\n dragReadyChange = output<boolean>();\n\n /** Whether this element is in the \"ready to drag\" state (delay has passed) */\n #isPending = signal(false);\n readonly isPending = this.#isPending.asReadonly();\n\n /** Whether this element is currently being dragged (based on global drag state) */\n readonly isDragging = computed(() => {\n const draggedItem = this.#dragState.draggedItem();\n return draggedItem?.draggableId === this.vdndDraggable();\n });\n\n /** Starting position of the drag */\n #startPosition: CursorPosition | null = null;\n\n /** Whether we're currently tracking a potential drag */\n #isTracking = false;\n\n /** Bound event handlers for cleanup */\n #boundPointerMove: ((e: MouseEvent | TouchEvent) => void) | null = null;\n #boundPointerUp: ((e: MouseEvent | TouchEvent) => void) | null = null;\n #boundKeyDown: ((e: KeyboardEvent) => void) | null = null;\n #boundKeyboardDragKeyDown: ((e: KeyboardEvent) => void) | null = null;\n\n /** Request animation frame ID for drag updates */\n #rafId: number | null = null;\n\n /** Timer ID for drag delay */\n #delayTimerId: ReturnType<typeof setTimeout> | null = null;\n\n /** Whether the delay has been satisfied (user held long enough) */\n #delayReady = false;\n\n /**\n * Update the pending state and emit the change event.\n */\n #setPending(pending: boolean): void {\n if (this.#isPending() !== pending) {\n this.#isPending.set(pending);\n this.dragReadyChange.emit(pending);\n }\n }\n\n ngOnInit(): void {\n // Set up event listeners\n this.#boundPointerMove = this.#onPointerMove.bind(this);\n this.#boundPointerUp = this.#onPointerUp.bind(this);\n this.#boundKeyDown = this.#onKeyDown.bind(this);\n this.#boundKeyboardDragKeyDown = this.#onKeyboardDragKeyDown.bind(this);\n }\n\n ngOnDestroy(): void {\n // If destroyed mid-drag, cancel to avoid stale global state / ongoing RAF loops.\n if (this.isDragging()) {\n this.#endDrag(true);\n }\n this.#cleanup();\n this.#cleanupKeyboardDragListeners();\n }\n\n /**\n * Handle pointer down (mouse or touch).\n */\n protected onPointerDown(event: MouseEvent | TouchEvent, isTouch: boolean): void {\n if (this.disabled()) {\n return;\n }\n\n // Without a group, this draggable can't participate in DnD (fail gracefully).\n if (!this.#effectiveGroup()) {\n return;\n }\n\n // Check for left mouse button only\n if (!isTouch && (event as MouseEvent).button !== 0) {\n return;\n }\n\n // Check if click is on drag handle (if specified)\n const handle = this.dragHandle();\n if (handle) {\n const target = event.target as HTMLElement;\n if (!target.closest(handle)) {\n return;\n }\n }\n\n // Check for elements that should not trigger drag\n const target = event.target as HTMLElement;\n if (\n target.closest('button, input, textarea, select, [contenteditable]') ||\n target.classList.contains('no-drag')\n ) {\n return;\n }\n\n const delay = this.dragDelay();\n\n // For touch events with a delay configured, DON'T call preventDefault() on touchstart.\n // This allows native scrolling to work if the user swipes before the delay fires.\n // For mouse events or touch without delay, prevent default immediately to avoid\n // text selection and other default behaviors.\n if (!isTouch || delay === 0) {\n event.preventDefault();\n }\n event.stopPropagation();\n\n this.#isTracking = true;\n this.#startPosition = this.#getPosition(event);\n\n // Handle drag delay\n if (delay > 0) {\n this.#delayReady = false;\n this.#delayTimerId = setTimeout(() => {\n this.#delayReady = true;\n this.#setPending(true); // Emit ready state when delay passes\n this.#delayTimerId = null;\n }, delay);\n } else {\n this.#delayReady = true;\n }\n\n // Add document-level event listeners\n this.#ngZone.runOutsideAngular(() => {\n if (isTouch) {\n document.addEventListener('touchmove', this.#boundPointerMove!, { passive: false });\n document.addEventListener('touchend', this.#boundPointerUp!);\n document.addEventListener('touchcancel', this.#boundPointerUp!);\n } else {\n document.addEventListener('mousemove', this.#boundPointerMove!);\n document.addEventListener('mouseup', this.#boundPointerUp!);\n }\n // Listen for Escape key on document to cancel drag\n document.addEventListener('keydown', this.#boundKeyDown!);\n });\n }\n\n /**\n * Handle pointer move (mouse or touch).\n */\n #onPointerMove(event: MouseEvent | TouchEvent): void {\n if (!this.#isTracking) {\n return;\n }\n\n const position = this.#getPosition(event);\n\n // Check if we've moved past the threshold\n if (!this.isDragging() && this.#startPosition) {\n const distance = Math.sqrt(\n Math.pow(position.x - this.#startPosition.x, 2) +\n Math.pow(position.y - this.#startPosition.y, 2),\n );\n\n if (distance < this.dragThreshold()) {\n return;\n }\n\n // If delay is configured and not yet ready, cancel the drag attempt\n // (user moved before the delay was satisfied).\n // DON'T call preventDefault() here - let native scrolling take over.\n if (!this.#delayReady) {\n this.#cancelDelayTimer();\n this.#cleanup();\n return;\n }\n\n // Start the drag - now we can prevent default\n event.preventDefault();\n this.#startDrag(position);\n } else if (this.isDragging()) {\n // Already dragging - prevent default to stop scrolling\n event.preventDefault();\n }\n\n // Only update drag if we're actually dragging\n if (!this.isDragging()) {\n return;\n }\n\n // Throttle drag updates with requestAnimationFrame\n if (this.#rafId !== null) {\n cancelAnimationFrame(this.#rafId);\n }\n\n this.#rafId = requestAnimationFrame(() => {\n this.#updateDrag(position);\n this.#rafId = null;\n });\n }\n\n /**\n * Cancel the delay timer if active.\n */\n #cancelDelayTimer(): void {\n if (this.#delayTimerId !== null) {\n clearTimeout(this.#delayTimerId);\n this.#delayTimerId = null;\n }\n this.#delayReady = false;\n }\n\n /**\n * Handle pointer up (mouse or touch).\n */\n #onPointerUp(event: MouseEvent | TouchEvent): void {\n if (!this.#isTracking) {\n return;\n }\n\n // Only prevent default if we were actually dragging\n // Otherwise, allow native touch behavior (like scroll momentum) to complete\n if (this.isDragging()) {\n event.preventDefault();\n this.#endDrag(false);\n }\n\n this.#cleanup();\n }\n\n /**\n * Handle keyboard activation (space key).\n * Starts a keyboard drag if not dragging, or drops if already in keyboard drag mode.\n */\n protected onKeyboardActivate(event: Event): void {\n if (this.disabled()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation(); // Prevent document listener from receiving this event\n\n // If we're in a keyboard drag, Space drops the item\n if (this.#keyboardDrag.isActive()) {\n this.#completeKeyboardDrag();\n return;\n }\n\n // If we're in a pointer drag, ignore\n if (this.isDragging()) {\n return;\n }\n\n // Start keyboard drag\n this.#startKeyboardDrag();\n }\n\n /**\n * Handle Enter key (alternative to Space for dropping during keyboard drag).\n */\n protected onEnterKey(event: Event): void {\n if (this.#keyboardDrag.isActive()) {\n event.preventDefault();\n this.#completeKeyboardDrag();\n }\n }\n\n /**\n * Handle ArrowUp key during keyboard drag.\n */\n protected onArrowUp(event: Event): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n event.preventDefault();\n this.#keyboardDrag.moveUp();\n }\n\n /**\n * Handle ArrowDown key during keyboard drag.\n */\n protected onArrowDown(event: Event): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n event.preventDefault();\n this.#keyboardDrag.moveDown();\n }\n\n /**\n * Handle ArrowLeft key during keyboard drag (cross-list movement).\n */\n protected onArrowLeft(event: Event): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n event.preventDefault();\n this.#moveToAdjacentDroppable('left');\n }\n\n /**\n * Handle ArrowRight key during keyboard drag (cross-list movement).\n */\n protected onArrowRight(event: Event): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n event.preventDefault();\n this.#moveToAdjacentDroppable('right');\n }\n\n /**\n * Move to an adjacent droppable in the specified direction.\n */\n #moveToAdjacentDroppable(direction: 'left' | 'right'): void {\n const currentDroppableId = this.#dragState.activeDroppableId();\n if (!currentDroppableId) {\n return;\n }\n\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n return;\n }\n const adjacent = this.#positionCalculator.findAdjacentDroppable(\n currentDroppableId,\n direction,\n groupName,\n );\n\n if (!adjacent) {\n return;\n }\n\n // Maintain the current target index (clamped to the new list's size)\n const currentTargetIndex = this.#keyboardDrag.targetIndex() ?? 0;\n const targetIndex = Math.min(currentTargetIndex, adjacent.itemCount);\n\n this.#keyboardDrag.moveToDroppable(adjacent.id, targetIndex, adjacent.itemCount);\n }\n\n /**\n * Handle escape key to cancel drag (host binding, fires before element is hidden).\n */\n protected onEscape(): boolean {\n if (this.#keyboardDrag.isActive()) {\n this.#cancelKeyboardDrag();\n return false;\n }\n if (this.isDragging()) {\n this.#endDrag(true);\n this.#cleanup();\n return false; // Prevents default\n }\n return true;\n }\n\n /**\n * Start a keyboard drag operation.\n */\n #startKeyboardDrag(): void {\n const element = this.#elementRef.nativeElement;\n const rect = element.getBoundingClientRect();\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n return;\n }\n\n // Find the parent droppable\n const droppableElement = this.#positionCalculator.getDroppableParent(element, groupName);\n if (!droppableElement) {\n return;\n }\n\n const droppableId = this.#positionCalculator.getDroppableId(droppableElement);\n if (!droppableId) {\n return;\n }\n\n // Calculate source index\n const sourceIndex = this.#calculateSourceIndex(element, droppableElement);\n\n // Get total item count from the droppable\n const totalItemCount = this.#dragIndexCalculator.getTotalItemCount({\n droppableElement,\n isSameList: false,\n draggedItemHeight: rect.height,\n });\n\n // Clone element BEFORE updating drag state\n const clonedElement = this.#elementClone.cloneElement(element);\n\n // Start keyboard drag\n this.#keyboardDrag.startKeyboardDrag(\n {\n draggableId: this.vdndDraggable(),\n droppableId,\n element,\n clonedElement,\n height: rect.height,\n width: rect.width,\n data: this.vdndDraggableData(),\n },\n sourceIndex,\n totalItemCount,\n droppableId,\n );\n\n // Add document-level keyboard listener (since element is hidden with display:none)\n this.#ngZone.runOutsideAngular(() => {\n document.addEventListener('keydown', this.#boundKeyboardDragKeyDown!);\n });\n\n // Emit drag start event\n this.dragStart.emit({\n draggableId: this.vdndDraggable(),\n droppableId,\n data: this.vdndDraggableData(),\n position: { x: rect.left, y: rect.top },\n sourceIndex,\n });\n }\n\n /**\n * Complete a keyboard drag operation (drop the item).\n */\n #completeKeyboardDrag(): void {\n const draggableId = this.vdndDraggable();\n const sourceIndex = this.#dragState.sourceIndex() ?? 0;\n const destinationIndex = this.#dragState.placeholderIndex();\n\n // Remove document listener\n this.#cleanupKeyboardDragListeners();\n\n // Emit drag end event\n this.dragEnd.emit({\n draggableId,\n droppableId: this.#getParentDroppableId() ?? '',\n cancelled: false,\n data: this.vdndDraggableData(),\n sourceIndex,\n destinationIndex,\n });\n\n this.#keyboardDrag.completeKeyboardDrag();\n\n // Restore focus to the moved element after state updates\n this.#restoreFocusAfterKeyboardDrag(draggableId);\n }\n\n /**\n * Cancel a keyboard drag operation.\n */\n #cancelKeyboardDrag(): void {\n const draggableId = this.vdndDraggable();\n const sourceIndex = this.#dragState.sourceIndex() ?? 0;\n\n // Remove document listener\n this.#cleanupKeyboardDragListeners();\n\n // Emit drag end event\n this.dragEnd.emit({\n draggableId,\n droppableId: this.#getParentDroppableId() ?? '',\n cancelled: true,\n data: this.vdndDraggableData(),\n sourceIndex,\n destinationIndex: null,\n });\n\n this.#keyboardDrag.cancelKeyboardDrag();\n\n // Restore focus to the original element after state updates\n this.#restoreFocusAfterKeyboardDrag(draggableId);\n }\n\n /**\n * Restore focus to the dragged element after keyboard drag ends.\n * Uses afterNextRender to ensure Angular has finished updating the DOM\n * (element is no longer hidden after isDragging() becomes false).\n *\n * Uses EnvironmentInjector to ensure callback runs even if this directive\n * is destroyed during cross-list moves.\n */\n #restoreFocusAfterKeyboardDrag(draggableId: string): void {\n // Capture the destination droppable BEFORE scheduling afterNextRender\n // (this directive may be destroyed during cross-list moves)\n const destinationDroppableId = this.#dragState.activeDroppableId();\n\n afterNextRender(\n () => {\n const element = document.querySelector(\n `[data-draggable-id=\"${draggableId}\"]`,\n ) as HTMLElement | null;\n\n if (element) {\n element.focus();\n } else if (destinationDroppableId) {\n // Fallback: focus the first draggable in the destination container\n const firstDraggable = document.querySelector(\n `[data-droppable-id=\"${destinationDroppableId}\"] [data-draggable-id]`,\n ) as HTMLElement | null;\n firstDraggable?.focus();\n }\n },\n { injector: this.#envInjector },\n );\n }\n\n /**\n * Clean up keyboard drag document listeners.\n */\n #cleanupKeyboardDragListeners(): void {\n if (this.#boundKeyboardDragKeyDown) {\n document.removeEventListener('keydown', this.#boundKeyboardDragKeyDown);\n }\n }\n\n /**\n * Handle keydown events during keyboard drag (document-level).\n */\n #onKeyboardDragKeyDown(event: KeyboardEvent): void {\n if (!this.#keyboardDrag.isActive()) {\n return;\n }\n\n switch (event.key) {\n case ' ': // Space\n event.preventDefault();\n this.#completeKeyboardDrag();\n break;\n case 'Enter':\n event.preventDefault();\n this.#completeKeyboardDrag();\n break;\n case 'Escape':\n event.preventDefault();\n this.#cancelKeyboardDrag();\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.#keyboardDrag.moveUp();\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.#keyboardDrag.moveDown();\n break;\n case 'ArrowLeft':\n event.preventDefault();\n this.#moveToAdjacentDroppable('left');\n break;\n case 'ArrowRight':\n event.preventDefault();\n this.#moveToAdjacentDroppable('right');\n break;\n case 'Tab':\n // Cancel drag on Tab\n event.preventDefault();\n this.#cancelKeyboardDrag();\n break;\n }\n }\n\n /**\n * Start the drag operation.\n */\n #startDrag(position: CursorPosition): void {\n // Clear pending state - drag is now active\n this.#setPending(false);\n\n const element = this.#elementRef.nativeElement;\n const rect = element.getBoundingClientRect();\n\n // Calculate grab offset using the START position (where user initially pressed down)\n // NOT the current position (where drag threshold was exceeded)\n // This ensures the preview maintains its position relative to where the user grabbed it\n const startPos = this.#startPosition ?? position;\n const grabOffset: GrabOffset = {\n x: startPos.x - rect.left,\n y: startPos.y - rect.top,\n };\n\n // Clone element BEFORE updating drag state (which triggers display:none via host binding)\n const clonedElement = this.#elementClone.cloneElement(element);\n\n const parentDroppableId = this.#getParentDroppableId();\n\n // Find droppable and calculate initial placeholder position\n // This fixes the UI glitch by ensuring placeholder is set before the element is hidden\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n // Misconfigured - cancel tracking and don't start drag.\n this.#cleanup();\n return;\n }\n const droppableElement = this.#positionCalculator.findDroppableAtPoint(\n position.x,\n position.y,\n element,\n groupName,\n );\n\n const activeDroppableId = droppableElement\n ? this.#positionCalculator.getDroppableId(droppableElement)\n : parentDroppableId;\n\n // Calculate source index BEFORE the element is hidden (display: none)\n // This is critical because getBoundingClientRect() returns all zeros for hidden elements\n const sourceIndex = this.#calculateSourceIndex(element, droppableElement);\n\n let initialPlaceholderId: string | null = null;\n let initialPlaceholderIndex: number | null = null;\n\n if (droppableElement) {\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position,\n grabOffset,\n draggedItemHeight: rect.height,\n sourceDroppableId: parentDroppableId,\n sourceIndex,\n });\n initialPlaceholderIndex = indexResult.index;\n initialPlaceholderId = indexResult.placeholderId;\n }\n\n const lockAxis = this.lockAxis();\n\n // Register with drag state service - this triggers isDragging computed to become true\n // which will apply display:none via host binding\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n this.#dragState.startDrag(\n {\n draggableId: this.vdndDraggable(),\n droppableId: parentDroppableId ?? '',\n element,\n clonedElement,\n height: rect.height,\n width: rect.width,\n data: this.vdndDraggableData(),\n },\n position,\n grabOffset,\n lockAxis,\n activeDroppableId,\n initialPlaceholderId,\n initialPlaceholderIndex,\n sourceIndex,\n undefined,\n lockAxis ? startPos : undefined,\n );\n\n // Start auto-scroll monitoring with a callback to recalculate placeholder\n this.#autoScroll.startMonitoring(() => this.#recalculatePlaceholder());\n\n // Emit drag start event\n this.dragStart.emit({\n draggableId: this.vdndDraggable(),\n droppableId: parentDroppableId ?? '',\n data: this.vdndDraggableData(),\n position,\n sourceIndex,\n });\n }\n\n /**\n * Calculate the source index of the dragged element BEFORE it's hidden.\n * This must be called before startDrag updates the state (which triggers display:none).\n */\n #calculateSourceIndex(element: HTMLElement, droppableElement: HTMLElement | null): number {\n if (!droppableElement) {\n return 0;\n }\n\n const rect = element.getBoundingClientRect();\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n const scrollableElement = virtualScroll ?? droppableElement;\n const containerRect = scrollableElement.getBoundingClientRect();\n const scrollTop = scrollableElement.scrollTop;\n\n // Get item height from the element itself\n const itemHeight = rect.height || 50;\n\n // Calculate the logical index based on the element's position\n const relativeY = rect.top - containerRect.top + scrollTop;\n return Math.round(relativeY / itemHeight);\n }\n\n /**\n * Recalculate placeholder position (called during auto-scroll).\n */\n #recalculatePlaceholder(): void {\n const cursorPosition = this.#dragState.cursorPosition();\n if (!cursorPosition || !this.isDragging()) {\n return;\n }\n\n // Recalculate placeholder based on current scroll position\n this.#updateDrag(cursorPosition);\n }\n\n /**\n * Update the drag position.\n * @param position Current cursor position\n */\n #updateDrag(position: CursorPosition): void {\n const element = this.#elementRef.nativeElement;\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n // Group became unavailable mid-drag; cancel to avoid inconsistent state.\n this.#endDrag(true);\n this.#cleanup();\n return;\n }\n\n // Apply axis locking to effective position for droppable detection\n // When axis is locked, use the start position for the locked axis\n const axisLock = this.lockAxis();\n let effectivePosition = position;\n\n if (axisLock && this.#startPosition) {\n effectivePosition = {\n x: axisLock === 'x' ? this.#startPosition.x : position.x,\n y: axisLock === 'y' ? this.#startPosition.y : position.y,\n };\n }\n\n // Find droppable at effective position (respects axis locking)\n const droppableElement = this.#positionCalculator.findDroppableAtPoint(\n effectivePosition.x,\n effectivePosition.y,\n element,\n groupName,\n );\n\n const activeDroppableId = droppableElement\n ? this.#positionCalculator.getDroppableId(droppableElement)\n : null;\n\n let placeholderId: string | null = null;\n let placeholderIndex: number | null = null;\n\n if (droppableElement) {\n // Calculate placeholder index based on effective position using mathematical approach\n // This is more stable than DOM-based detection because it doesn't get affected\n // by the placeholder insertion shifting elements around\n const draggedItemHeight = this.#dragState.draggedItem()?.height ?? 50;\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position: effectivePosition,\n grabOffset: this.#dragState.grabOffset(),\n draggedItemHeight,\n sourceDroppableId: this.#dragState.sourceDroppableId(),\n sourceIndex: this.#dragState.sourceIndex(),\n });\n placeholderIndex = indexResult.index;\n placeholderId = indexResult.placeholderId;\n }\n\n // Update drag state with actual cursor position (for preview rendering)\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n this.#dragState.updateDragPosition({\n cursorPosition: position,\n activeDroppableId,\n placeholderId,\n placeholderIndex,\n });\n\n // Emit drag move event\n this.dragMove.emit({\n draggableId: this.vdndDraggable(),\n sourceDroppableId: this.#getParentDroppableId() ?? '',\n targetDroppableId: activeDroppableId,\n placeholderId,\n position,\n targetIndex: placeholderIndex,\n });\n }\n\n /**\n * End the drag operation.\n */\n #endDrag(cancelled: boolean): void {\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n // Stop auto-scroll monitoring\n this.#autoScroll.stopMonitoring();\n\n const sourceIndex = this.#dragState.sourceIndex() ?? 0;\n const placeholderIndex = this.#dragState.placeholderIndex();\n let destinationIndex = cancelled ? null : placeholderIndex;\n\n // Keep DragEndEvent semantics consistent with DropEvent.destination.index.\n // During same-list drag, placeholderIndex includes the hidden-item adjustment,\n // but the final insertion index must account for removal of the source item.\n if (!cancelled && placeholderIndex !== null) {\n const sourceDroppableId = this.#dragState.sourceDroppableId();\n const activeDroppableId = this.#dragState.activeDroppableId();\n if (sourceDroppableId !== null && sourceDroppableId === activeDroppableId) {\n if (sourceIndex < placeholderIndex) {\n destinationIndex = placeholderIndex - 1;\n }\n }\n }\n\n // Emit drag end event\n this.dragEnd.emit({\n draggableId: this.vdndDraggable(),\n droppableId: this.#getParentDroppableId() ?? '',\n cancelled,\n data: this.vdndDraggableData(),\n sourceIndex,\n destinationIndex,\n });\n\n // Clear drag state - this triggers isDragging computed to become false\n if (cancelled) {\n this.#dragState.cancelDrag();\n } else {\n this.#dragState.endDrag();\n }\n }\n\n /**\n * Get the parent droppable ID.\n */\n #getParentDroppableId(): string | null {\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n return null;\n }\n\n const droppable = this.#positionCalculator.getDroppableParent(\n this.#elementRef.nativeElement,\n groupName,\n );\n\n return droppable ? this.#positionCalculator.getDroppableId(droppable) : null;\n }\n\n /**\n * Get position from mouse or touch event.\n */\n #getPosition(event: MouseEvent | TouchEvent): CursorPosition {\n if ('touches' in event) {\n const touch = event.touches[0] ?? event.changedTouches[0];\n return { x: touch.clientX, y: touch.clientY };\n }\n return { x: event.clientX, y: event.clientY };\n }\n\n /**\n * Clean up event listeners and state.\n */\n #cleanup(): void {\n this.#isTracking = false;\n this.#startPosition = null;\n this.#setPending(false); // Clear pending state on cleanup\n this.#cancelDelayTimer();\n\n if (this.#rafId !== null) {\n cancelAnimationFrame(this.#rafId);\n this.#rafId = null;\n }\n\n // Remove event listeners\n if (this.#boundPointerMove) {\n document.removeEventListener('mousemove', this.#boundPointerMove);\n document.removeEventListener('touchmove', this.#boundPointerMove);\n }\n if (this.#boundPointerUp) {\n document.removeEventListener('mouseup', this.#boundPointerUp);\n document.removeEventListener('touchend', this.#boundPointerUp);\n document.removeEventListener('touchcancel', this.#boundPointerUp);\n }\n if (this.#boundKeyDown) {\n document.removeEventListener('keydown', this.#boundKeyDown);\n }\n }\n\n /**\n * Handle keydown events on document to cancel drag with Escape.\n */\n #onKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.isDragging()) {\n // No ngZone.run() needed - #endDrag uses signals which work outside zone\n this.#endDrag(true);\n this.#cleanup();\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\n\n/**\n * Directive that marks an element as a scrollable container for virtual scrolling.\n *\n * Apply this directive to any scrollable element (with `overflow: auto` or `overflow: scroll`)\n * that contains a `*vdndVirtualFor` directive. The virtual scroll will use this element\n * as its scroll container.\n *\n * @example\n * Basic usage with a custom scroll container:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n *\n * @example\n * With Ionic ion-content:\n * ```html\n * <ion-content vdndScrollable class=\"ion-content-scroll-host\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </ion-content>\n * ```\n *\n * @example\n * With auto-scroll configuration:\n * ```html\n * <div vdndScrollable\n * [autoScrollEnabled]=\"true\"\n * [autoScrollConfig]=\"{ threshold: 80, maxSpeed: 20 }\"\n * style=\"overflow: auto; height: 400px;\">\n * ...\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndScrollable]',\n providers: [{ provide: VDND_SCROLL_CONTAINER, useExisting: ScrollableDirective }],\n host: {\n class: 'vdnd-scrollable',\n '[style.overflow-anchor]': '\"none\"',\n },\n})\nexport class ScrollableDirective implements VdndScrollContainer, OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n readonly #autoScrollService = inject(AutoScrollService);\n\n /** Current scroll position (reactive) */\n readonly #scrollTop = signal(0);\n\n /** Measured container height (reactive) */\n readonly #containerHeight = signal(0);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-scroll-${Math.random().toString(36).slice(2, 9)}`;\n\n // ========== Inputs ==========\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== VdndScrollContainer Implementation ==========\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n scrollTop(): number {\n return this.#scrollTop();\n }\n\n scrollTo(options: ScrollToOptions): void {\n this.nativeElement.scrollTo(options);\n }\n\n // ========== Additional API ==========\n\n /** Get the measured container height */\n containerHeight(): number {\n return this.#containerHeight();\n }\n\n /** Scroll by a delta amount */\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(\n this.scrollTop() + delta,\n this.nativeElement.scrollHeight - this.nativeElement.clientHeight,\n ),\n );\n this.scrollTo({ top: newPosition });\n }\n\n // ========== Lifecycle ==========\n\n ngOnInit(): void {\n this.#setupScrollListener();\n this.#setupResizeObserver();\n this.#registerAutoScroll();\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n this.#unregisterAutoScroll();\n }\n\n // ========== Private Methods ==========\n\n /** Minimum scroll delta (px) to trigger signal update */\n readonly #scrollThreshold = 5;\n\n #setupScrollListener(): void {\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: this.#scrollThreshold,\n });\n }\n\n #setupResizeObserver(): void {\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n height: this.#containerHeight,\n minDeltaPx: 1,\n });\n }\n\n #registerAutoScroll(): void {\n if (this.autoScrollEnabled()) {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.registerContainer(id, this.nativeElement, this.autoScrollConfig());\n }\n }\n\n #unregisterAutoScroll(): void {\n const id = this.scrollContainerId() ?? this.#generatedScrollId;\n this.#autoScrollService.unregisterContainer(id);\n }\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n EmbeddedViewRef,\n inject,\n Injector,\n input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { VDND_SCROLL_CONTAINER } from '../tokens/scroll-container.token';\nimport { VDND_VIRTUAL_VIEWPORT } from '../tokens/virtual-viewport.token';\nimport { DragStateService } from '../services/drag-state.service';\n\n/**\n * Context provided to the template for each virtual item.\n */\nexport interface VirtualForContext<T> {\n /** The item data (also available as implicit context) */\n $implicit: T;\n /** The item's index in the original array */\n index: number;\n /** Whether this is the first visible item */\n first: boolean;\n /** Whether this is the last visible item */\n last: boolean;\n /** Count of total items */\n count: number;\n}\n\n/**\n * Represents an item entry in the render queue for virtual scrolling.\n * @internal\n */\ninterface RenderEntry<T> {\n type: 'item' | 'placeholder';\n key: unknown;\n context: VirtualForContext<T> | null;\n visualIndex: number;\n}\n\n/**\n * A structural directive for virtual scrolling within custom scroll containers.\n * Provides maximum flexibility for advanced use cases where the component wrapper\n * is not suitable.\n *\n * The directive must be placed inside a container marked with the `vdndScrollable`\n * directive, which provides the scroll container context via dependency injection.\n *\n * Placeholders are handled automatically by the parent component (vdnd-virtual-scroll\n * or vdnd-virtual-content) - consumers just render their items normally.\n *\n * @example\n * Basic usage:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n *\n * @example\n * With Ionic ion-content:\n * ```html\n * <ion-content vdndScrollable class=\"ion-content-scroll-host\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </ion-content>\n * ```\n */\n@Directive({\n selector: '[vdndVirtualFor][vdndVirtualForOf]',\n})\nexport class VirtualForDirective<T> implements OnInit, OnDestroy {\n readonly #templateRef = inject(TemplateRef<VirtualForContext<T>>);\n readonly #viewContainer = inject(ViewContainerRef);\n readonly #elementRef = inject(ElementRef<Comment>);\n readonly #scrollContainer = inject(VDND_SCROLL_CONTAINER);\n readonly #injector = inject(Injector);\n readonly #dragState = inject(DragStateService);\n\n /**\n * Optional viewport component that provides wrapper-based positioning.\n * When inside a viewport, items are positioned via the wrapper's transform,\n * so we skip individual absolute positioning.\n */\n readonly #viewport = inject(VDND_VIRTUAL_VIEWPORT, { optional: true });\n\n /** Whether we're inside a viewport component (use wrapper positioning) */\n readonly #useViewportPositioning = this.#viewport !== null;\n\n /** Pool of views for reuse */\n readonly #viewPool: EmbeddedViewRef<VirtualForContext<T>>[] = [];\n\n /** Currently active views keyed by their track-by value */\n readonly #activeViews = new Map<unknown, EmbeddedViewRef<VirtualForContext<T>>>();\n\n /** Single spacer element for scroll height */\n #spacer: HTMLDivElement | null = null;\n\n /** Placeholder element for drag operations */\n #placeholder: HTMLDivElement | null = null;\n\n /** Whether placeholder is currently in the DOM */\n #placeholderInDom = false;\n\n // ========== Inputs ==========\n\n /** The array of items to iterate over */\n vdndVirtualForOf = input.required<T[]>();\n\n /** Height of each item in pixels */\n vdndVirtualForItemHeight = input.required<number>();\n\n /** Track-by function for efficient updates */\n vdndVirtualForTrackBy = input.required<(index: number, item: T) => unknown>();\n\n /** Number of items to render outside the visible area */\n vdndVirtualForOverscan = input<number>(3);\n\n /**\n * ID of the droppable this directive belongs to.\n * Required for placeholder positioning during drag operations.\n */\n vdndVirtualForDroppableId = input<string>();\n\n // ========== Placeholder Computed Values ==========\n\n /** Whether the placeholder should be shown in this container */\n readonly #shouldShowPlaceholder = computed(() => {\n const droppableId = this.vdndVirtualForDroppableId();\n if (!droppableId) return false;\n if (!this.#dragState.isDragging()) return false;\n return this.#dragState.activeDroppableId() === droppableId;\n });\n\n /** The placeholder index when placeholder should be shown */\n readonly #placeholderIndex = computed(() => {\n if (!this.#shouldShowPlaceholder()) return -1;\n return this.#dragState.placeholderIndex() ?? -1;\n });\n\n // ========== Computed Values ==========\n\n /** First visible item index */\n readonly #firstVisibleIndex = computed(() => {\n const itemHeight = this.vdndVirtualForItemHeight();\n if (itemHeight <= 0) return 0;\n return Math.floor(this.#scrollContainer.scrollTop() / itemHeight);\n });\n\n /** Number of visible items */\n readonly #visibleCount = computed(() => {\n const height = this.#scrollContainer.containerHeight();\n const itemHeight = this.vdndVirtualForItemHeight();\n if (height <= 0 || itemHeight <= 0) return 0;\n return Math.ceil(height / itemHeight);\n });\n\n /** Range of items to render */\n readonly #renderRange = computed(() => {\n const first = this.#firstVisibleIndex();\n const visible = this.#visibleCount();\n const overscan = this.vdndVirtualForOverscan();\n const total = this.vdndVirtualForOf().length;\n\n const start = Math.max(0, first - overscan);\n const end = Math.min(total - 1, first + visible + overscan);\n\n return { start, end };\n });\n\n /** Map of trackBy keys to item indices for quick lookup */\n readonly #itemIndexMap = computed(() => {\n const items = this.vdndVirtualForOf();\n const trackByFn = this.vdndVirtualForTrackBy();\n const map = new Map<unknown, number>();\n for (let i = 0; i < items.length; i++) {\n map.set(trackByFn(i, items[i]), i);\n }\n return map;\n });\n\n /** Index of the dragged item in this list (-1 if not present or not dragging) */\n readonly #draggedItemIndex = computed(() => {\n const draggedItem = this.#dragState.draggedItem();\n if (!draggedItem) return -1;\n\n const byId = this.#itemIndexMap().get(draggedItem.draggableId);\n if (byId !== undefined) {\n return byId;\n }\n\n const data = draggedItem.data as T | null | undefined;\n if (data !== null && data !== undefined) {\n return this.vdndVirtualForOf().indexOf(data);\n }\n\n return -1;\n });\n\n constructor() {\n // React to changes and update views\n effect(() => {\n this.#updateViews();\n });\n }\n\n ngOnInit(): void {\n // Only create spacer when NOT inside a viewport component\n // (viewport provides its own spacer and wrapper positioning)\n if (!this.#useViewportPositioning) {\n this.#updateSpacers();\n }\n\n // Create placeholder element for drag operations\n this.#createPlaceholder();\n }\n\n ngOnDestroy(): void {\n this.#viewPool.forEach((view) => view.destroy());\n this.#activeViews.forEach((view) => view.destroy());\n\n // Clean up spacer element (only if we created one)\n this.#spacer?.remove();\n\n // Clean up placeholder element\n this.#placeholder?.remove();\n }\n\n /**\n * Create the placeholder element for drag operations.\n */\n #createPlaceholder(): void {\n const placeholder = document.createElement('div');\n placeholder.className = 'vdnd-drag-placeholder vdnd-drag-placeholder-visible';\n placeholder.style.cssText = 'display: block; pointer-events: none;';\n this.#placeholder = placeholder;\n }\n\n /**\n * Set up spacer element for scroll height.\n */\n #updateSpacers(): void {\n // Create single spacer that maintains total scroll height\n const spacer = document.createElement('div');\n spacer.className = 'vdnd-virtual-for-spacer';\n spacer.style.cssText =\n 'position: absolute; top: 0; left: 0; width: 1px; visibility: hidden; pointer-events: none;';\n\n // Insert spacer before the directive's anchor comment\n const comment = this.#elementRef.nativeElement;\n comment.parentNode?.insertBefore(spacer, comment);\n\n this.#spacer = spacer;\n\n // Update spacer height reactively\n // Must pass injector since we're outside constructor\n effect(\n () => {\n const itemHeight = this.vdndVirtualForItemHeight();\n const total = this.vdndVirtualForOf().length;\n\n // Single spacer with full content height\n spacer.style.height = `${total * itemHeight}px`;\n },\n { injector: this.#injector },\n );\n }\n\n /**\n * Update the rendered views with true view recycling.\n * Views are kept in the DOM and have their context updated in place when possible.\n */\n #updateViews(): void {\n const items = this.vdndVirtualForOf();\n const { start, end } = this.#renderRange();\n const itemHeight = this.vdndVirtualForItemHeight();\n const placeholderIndex = this.#placeholderIndex();\n const showPlaceholder = this.#shouldShowPlaceholder();\n const draggedIndex = this.#draggedItemIndex();\n const droppableId = this.vdndVirtualForDroppableId();\n const sourceDroppableId = this.#dragState.sourceDroppableId();\n const isSourceList = droppableId ? droppableId === sourceDroppableId : true;\n const shouldKeepDragged =\n this.#dragState.isDragging() &&\n draggedIndex >= 0 &&\n isSourceList &&\n draggedIndex < items.length;\n\n // Notify viewport of render start index for wrapper positioning\n this.#notifyViewportRenderStart(start, isSourceList, draggedIndex);\n\n // 1. Build the list of items to render\n const itemsToRender = this.#calculateItemsToRender({\n items,\n start,\n end,\n showPlaceholder,\n placeholderIndex,\n shouldKeepDragged,\n draggedIndex,\n });\n\n // 2. Reconcile views with the DOM\n const placeholderDomPosition = this.#reconcileViews(itemsToRender, showPlaceholder, itemHeight);\n\n // 3. Position placeholder in DOM\n this.#positionPlaceholder(showPlaceholder, placeholderDomPosition, itemHeight);\n\n // 4. Trim view pool to prevent memory bloat\n this.#trimViewPool();\n }\n\n /**\n * Notify viewport of render start index for wrapper positioning.\n * Adjusts when the dragged item is above the rendered range.\n */\n #notifyViewportRenderStart(start: number, isSourceList: boolean, draggedIndex: number): void {\n if (!this.#useViewportPositioning) return;\n\n const shouldAdjustRenderStart =\n this.#dragState.isDragging() && isSourceList && draggedIndex >= 0 && draggedIndex < start;\n\n const renderStartIndex = shouldAdjustRenderStart ? Math.max(0, start - 1) : start;\n this.#viewport?.setRenderStartIndex(renderStartIndex);\n }\n\n /**\n * Calculate the list of items to render, including placeholder positioning\n * and keeping the dragged item alive when scrolled out of range.\n */\n #calculateItemsToRender(params: {\n items: T[];\n start: number;\n end: number;\n showPlaceholder: boolean;\n placeholderIndex: number;\n shouldKeepDragged: boolean;\n draggedIndex: number;\n }): RenderEntry<T>[] {\n const {\n items,\n start,\n end,\n showPlaceholder,\n placeholderIndex,\n shouldKeepDragged,\n draggedIndex,\n } = params;\n const trackByFn = this.vdndVirtualForTrackBy();\n const itemsToRender: RenderEntry<T>[] = [];\n\n // Build render list for visible range\n for (let i = start; i <= end && i < items.length; i++) {\n // Insert placeholder before item at placeholderIndex\n if (\n showPlaceholder &&\n placeholderIndex === i &&\n !itemsToRender.some((r) => r.type === 'placeholder')\n ) {\n itemsToRender.push({\n type: 'placeholder',\n key: '__placeholder__',\n context: null,\n visualIndex: placeholderIndex,\n });\n }\n\n const item = items[i];\n itemsToRender.push({\n type: 'item',\n key: trackByFn(i, item),\n context: {\n $implicit: item,\n index: i,\n first: i === start,\n last: i === end || i === items.length - 1,\n count: items.length,\n },\n visualIndex: i,\n });\n }\n\n // Add placeholder at end if needed\n if (\n showPlaceholder &&\n placeholderIndex >= items.length &&\n !itemsToRender.some((r) => r.type === 'placeholder')\n ) {\n itemsToRender.push({\n type: 'placeholder',\n key: '__placeholder__',\n context: null,\n visualIndex: placeholderIndex,\n });\n }\n\n // Keep dragged item view alive when scrolled out of range\n if (shouldKeepDragged && (draggedIndex < start || draggedIndex > end)) {\n const draggedItem = items[draggedIndex];\n const draggedKey = trackByFn(draggedIndex, draggedItem);\n const alreadyRendered = itemsToRender.some(\n (entry) => entry.type === 'item' && entry.key === draggedKey,\n );\n if (!alreadyRendered) {\n itemsToRender.push({\n type: 'item',\n key: draggedKey,\n context: {\n $implicit: draggedItem,\n index: draggedIndex,\n first: draggedIndex === 0,\n last: draggedIndex === items.length - 1,\n count: items.length,\n },\n visualIndex: draggedIndex,\n });\n }\n }\n\n return itemsToRender;\n }\n\n /**\n * Reconcile views with the calculated items to render.\n * Moves unused views to pool, updates existing views, creates new views as needed.\n * Returns the DOM position where placeholder should be inserted.\n */\n #reconcileViews(\n itemsToRender: RenderEntry<T>[],\n showPlaceholder: boolean,\n itemHeight: number,\n ): number {\n // Determine which keys we need\n const neededKeys = new Set(\n itemsToRender.filter((r) => r.type === 'item').map((item) => item.key),\n );\n\n // Move unused views to pool\n for (const [key, view] of this.#activeViews) {\n if (!neededKeys.has(key)) {\n const index = this.#viewContainer.indexOf(view);\n if (index >= 0) {\n this.#viewContainer.detach(index);\n }\n this.#viewPool.push(view);\n this.#activeViews.delete(key);\n }\n }\n\n // Remove placeholder from DOM if not needed\n if (!showPlaceholder && this.#placeholderInDom && this.#placeholder) {\n this.#placeholder.remove();\n this.#placeholderInDom = false;\n }\n\n // Process items and track placeholder position\n let viewContainerIndex = 0;\n let placeholderDomPosition = -1;\n\n for (const entry of itemsToRender) {\n if (entry.type === 'placeholder') {\n placeholderDomPosition = viewContainerIndex;\n continue;\n }\n\n const view = this.#getOrCreateView(entry.key, entry.context!);\n\n // Ensure view is at correct position in ViewContainerRef\n const currentIndex = this.#viewContainer.indexOf(view);\n if (currentIndex !== viewContainerIndex) {\n if (currentIndex >= 0) {\n this.#viewContainer.move(view, viewContainerIndex);\n } else {\n this.#viewContainer.insert(view, viewContainerIndex);\n }\n }\n\n // Apply absolute positioning when not using viewport wrapper\n if (!this.#useViewportPositioning) {\n this.#applyAbsolutePositioning(view, entry.visualIndex * itemHeight);\n }\n\n viewContainerIndex++;\n }\n\n return placeholderDomPosition;\n }\n\n /**\n * Get an existing view or create/recycle one from the pool.\n */\n #getOrCreateView(\n key: unknown,\n context: VirtualForContext<T>,\n ): EmbeddedViewRef<VirtualForContext<T>> {\n let view = this.#activeViews.get(key);\n\n if (view) {\n // Update existing view context\n Object.assign(view.context, context);\n view.markForCheck();\n } else {\n // Try pool first, then create new\n view = this.#viewPool.pop();\n if (view) {\n Object.assign(view.context, context);\n view.markForCheck();\n } else {\n view = this.#templateRef.createEmbeddedView(context);\n }\n this.#activeViews.set(key, view);\n }\n\n return view;\n }\n\n /**\n * Apply absolute positioning styles to a view's root nodes.\n */\n #applyAbsolutePositioning(view: EmbeddedViewRef<VirtualForContext<T>>, topOffset: number): void {\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n node.style.position = 'absolute';\n node.style.top = `${topOffset}px`;\n node.style.left = '0';\n node.style.right = '0';\n }\n }\n }\n\n /**\n * Position the placeholder element in the DOM at the correct index.\n */\n #positionPlaceholder(\n showPlaceholder: boolean,\n placeholderDomPosition: number,\n itemHeight: number,\n ): void {\n if (!showPlaceholder || !this.#placeholder || placeholderDomPosition < 0) {\n return;\n }\n\n this.#placeholder.style.height = `${itemHeight}px`;\n\n const container = this.#viewContainer.element.nativeElement.parentElement;\n if (!container) return;\n\n // Find children excluding spacers and placeholder itself\n const children = Array.from(container.children).filter((el) => {\n const element = el as Element;\n return (\n !element.classList.contains('vdnd-drag-placeholder') &&\n !element.classList.contains('vdnd-virtual-for-spacer') &&\n !element.classList.contains('vdnd-content-spacer')\n );\n });\n const insertBeforeEl = children[placeholderDomPosition] ?? null;\n\n if (!this.#placeholderInDom) {\n // First insertion\n if (insertBeforeEl) {\n container.insertBefore(this.#placeholder, insertBeforeEl);\n } else {\n container.appendChild(this.#placeholder);\n }\n this.#placeholderInDom = true;\n } else {\n // Move to correct position if needed\n const currentNextSibling = this.#placeholder.nextElementSibling;\n if (insertBeforeEl !== currentNextSibling) {\n if (insertBeforeEl) {\n container.insertBefore(this.#placeholder, insertBeforeEl);\n } else {\n container.appendChild(this.#placeholder);\n }\n }\n }\n }\n\n /**\n * Trim the view pool to prevent memory bloat, keeping a reasonable buffer.\n */\n #trimViewPool(): void {\n const maxPoolSize = 10;\n while (this.#viewPool.length > maxPoolSize) {\n const view = this.#viewPool.pop();\n view?.destroy();\n }\n }\n\n /**\n * Static method for Angular's structural directive microsyntax.\n */\n static ngTemplateContextGuard<T>(\n _dir: VirtualForDirective<T>,\n _ctx: unknown,\n ): _ctx is VirtualForContext<T> {\n return true;\n }\n}\n","import { WritableSignal } from '@angular/core';\nimport { DropEvent } from '../models/drag-drop.models';\n\n/**\n * Moves an item between signal-based lists based on a drop event.\n * Handles both same-list reordering and cross-list moves.\n *\n * @example\n * ```typescript\n * // In your component:\n * readonly list1 = signal<Item[]>([...]);\n * readonly list2 = signal<Item[]>([...]);\n *\n * onDrop(event: DropEvent): void {\n * moveItem(event, {\n * 'list-1': this.list1,\n * 'list-2': this.list2,\n * });\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param lists A map of droppable IDs to their corresponding WritableSignal arrays\n */\nexport function moveItem<T>(event: DropEvent, lists: Record<string, WritableSignal<T[]>>): void {\n const sourceList = lists[event.source.droppableId];\n const destList = lists[event.destination.droppableId];\n\n if (!sourceList || !destList) {\n console.warn(\n `[moveItem] Could not find list for droppable \"${event.source.droppableId}\" or \"${event.destination.droppableId}\"`,\n );\n return;\n }\n\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n // Same list reorder\n if (event.source.droppableId === event.destination.droppableId) {\n reorderItems(event, sourceList);\n return;\n }\n\n // Cross-list move\n const sourceItems = sourceList();\n const item = sourceItems[sourceIndex];\n\n if (item === undefined) {\n console.warn(`[moveItem] Could not find item at index ${sourceIndex}`);\n return;\n }\n\n // Remove from source\n sourceList.update((items) => {\n const newItems = [...items];\n newItems.splice(sourceIndex, 1);\n return newItems;\n });\n\n // Insert at destination\n destList.update((items) => {\n const newItems = [...items];\n newItems.splice(destIndex, 0, item);\n return newItems;\n });\n}\n\n/**\n * Reorders items within a single signal-based list.\n *\n * @example\n * ```typescript\n * readonly items = signal<Item[]>([...]);\n *\n * onDrop(event: DropEvent): void {\n * reorderItems(event, this.items);\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param list The WritableSignal array to reorder\n */\nexport function reorderItems<T>(event: DropEvent, list: WritableSignal<T[]>): void {\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n // No-op if same position\n if (sourceIndex === destIndex) {\n return;\n }\n\n list.update((items) => {\n const newItems = [...items];\n const [removed] = newItems.splice(sourceIndex, 1);\n\n // Note: destination.index from DropEvent is already adjusted for same-list\n // reordering by DroppableDirective.#handleDrop(), so we use it directly.\n newItems.splice(destIndex, 0, removed);\n return newItems;\n });\n}\n\n/**\n * Applies a move operation immutably, returning new array objects.\n * Useful for state management patterns that require immutable updates.\n *\n * @example\n * ```typescript\n * onDrop(event: DropEvent): void {\n * const { list1, list2 } = applyMove(event, {\n * 'list-1': this.list1,\n * 'list-2': this.list2,\n * });\n * // Use the returned arrays with your state management\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param lists A map of droppable IDs to their corresponding arrays\n * @returns A new object with the same keys but updated arrays\n */\nexport function applyMove<T>(event: DropEvent, lists: Record<string, T[]>): Record<string, T[]> {\n const result = { ...lists };\n const sourceKey = event.source.droppableId;\n const destKey = event.destination.droppableId;\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n const sourceItems = [...(lists[sourceKey] ?? [])];\n const item = sourceItems[sourceIndex];\n\n if (item === undefined) {\n return result;\n }\n\n // Same list reorder\n // Note: destination.index from DropEvent is already adjusted for same-list\n // reordering by DroppableDirective.#handleDrop(), so we use it directly.\n if (sourceKey === destKey) {\n const [removed] = sourceItems.splice(sourceIndex, 1);\n sourceItems.splice(destIndex, 0, removed);\n result[sourceKey] = sourceItems;\n return result;\n }\n\n // Cross-list move\n const destItems = [...(lists[destKey] ?? [])];\n sourceItems.splice(sourceIndex, 1);\n destItems.splice(destIndex, 0, item);\n\n result[sourceKey] = sourceItems;\n result[destKey] = destItems;\n\n return result;\n}\n\n/**\n * Checks if a drop event represents a no-op (item dropped in its original position).\n * Useful for skipping unnecessary state updates.\n *\n * @example\n * ```typescript\n * onDrop(event: DropEvent): void {\n * if (isNoOpDrop(event)) {\n * return; // No action needed\n * }\n * moveItem(event, this.lists);\n * }\n * ```\n *\n * @param event The drop event to check\n * @returns true if the drop would result in no change\n */\nexport function isNoOpDrop(event: DropEvent): boolean {\n return (\n event.source.droppableId === event.destination.droppableId &&\n event.source.index === event.destination.index\n );\n}\n\n/**\n * Creates a new list with the item inserted at the specified index.\n * Low-level utility for custom implementations.\n *\n * @param list The source array\n * @param item The item to insert\n * @param index The index to insert at\n * @returns A new array with the item inserted\n */\nexport function insertAt<T>(list: T[], item: T, index: number): T[] {\n const result = [...list];\n result.splice(index, 0, item);\n return result;\n}\n\n/**\n * Creates a new list with the item at the specified index removed.\n * Low-level utility for custom implementations.\n *\n * @param list The source array\n * @param index The index to remove\n * @returns A new array with the item removed\n */\nexport function removeAt<T>(list: T[], index: number): T[] {\n const result = [...list];\n result.splice(index, 1);\n return result;\n}\n","// Models\nexport * from './models/drag-drop.models';\n\n// Tokens\nexport { VDND_SCROLL_CONTAINER } from './tokens/scroll-container.token';\nexport type { VdndScrollContainer } from './tokens/scroll-container.token';\nexport { VDND_VIRTUAL_VIEWPORT } from './tokens/virtual-viewport.token';\nexport type { VdndVirtualViewport } from './tokens/virtual-viewport.token';\n\n// Services\nexport { DragStateService } from './services/drag-state.service';\nexport { PositionCalculatorService } from './services/position-calculator.service';\nexport { AutoScrollService } from './services/auto-scroll.service';\nexport type { AutoScrollConfig } from './services/auto-scroll.service';\nexport { ElementCloneService } from './services/element-clone.service';\nexport { KeyboardDragService } from './services/keyboard-drag.service';\nexport { OverlayContainerService } from './services/overlay-container.service';\n\n// Components\nexport { VirtualScrollContainerComponent } from './components/virtual-scroll-container.component';\nexport type {\n VirtualScrollItemContext,\n VisibleRangeChange,\n} from './components/virtual-scroll-container.component';\nexport { DragPreviewComponent } from './components/drag-preview.component';\nexport type { DragPreviewContext } from './components/drag-preview.component';\nexport { PlaceholderComponent } from './components/placeholder.component';\nexport type { PlaceholderContext } from './components/placeholder.component';\nexport { DragPlaceholderComponent } from './components/drag-placeholder.component';\nexport { VirtualSortableListComponent } from './components/virtual-sortable-list.component';\nexport { VirtualViewportComponent } from './components/virtual-viewport.component';\nexport { VirtualContentComponent } from './components/virtual-content.component';\n\n// Directives\nexport { DraggableDirective } from './directives/draggable.directive';\nexport { DroppableDirective } from './directives/droppable.directive';\nexport { DroppableGroupDirective, VDND_GROUP_TOKEN } from './directives/droppable-group.directive';\nexport type { VdndGroupContext } from './directives/droppable-group.directive';\nexport { ScrollableDirective } from './directives/scrollable.directive';\nexport { VirtualForDirective } from './directives/virtual-for.directive';\nexport type { VirtualForContext } from './directives/virtual-for.directive';\n\n// Utilities\nexport {\n moveItem,\n reorderItems,\n applyMove,\n isNoOpDrop,\n insertAt,\n removeAt,\n} from './utils/drop-helpers';\n","/*\n * Public API Surface of ngx-virtual-dnd\n */\n\nexport * from './lib/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAiMA;;AAEG;AACI,MAAM,kBAAkB,GAAc;AAC3C,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB,EAAE,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