ngx-kit 8.0.1 → 8.0.2
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.
|
@@ -1928,19 +1928,29 @@ class DragDropService {
|
|
|
1928
1928
|
}
|
|
1929
1929
|
/** Nearest registered drop list starting at (and including) `start`, walking up the DOM. */
|
|
1930
1930
|
findAncestorDropList(start) {
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
if (
|
|
1934
|
-
|
|
1931
|
+
let node = start;
|
|
1932
|
+
while (node) {
|
|
1933
|
+
if (node instanceof HTMLElement) {
|
|
1934
|
+
const found = this.listsByEl.get(node);
|
|
1935
|
+
if (found) {
|
|
1936
|
+
return found;
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
node = node instanceof ShadowRoot ? node.host : node.parentNode;
|
|
1935
1940
|
}
|
|
1936
1941
|
return null;
|
|
1937
1942
|
}
|
|
1938
1943
|
/** Nearest registered drop-list group starting at (and including) `start`, walking up the DOM. */
|
|
1939
1944
|
findAncestorGroup(start) {
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
if (
|
|
1943
|
-
|
|
1945
|
+
let node = start;
|
|
1946
|
+
while (node) {
|
|
1947
|
+
if (node instanceof HTMLElement) {
|
|
1948
|
+
const found = this.groupsByEl.get(node);
|
|
1949
|
+
if (found) {
|
|
1950
|
+
return found;
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
node = node instanceof ShadowRoot ? node.host : node.parentNode;
|
|
1944
1954
|
}
|
|
1945
1955
|
return null;
|
|
1946
1956
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-kit-drag-resize.mjs","sources":["../../../projects/libs/drag-resize/utils/check-boundary.ts","../../../projects/libs/drag-resize/utils/styling.ts","../../../projects/libs/drag-resize/utils/clone-drag-element-in-body.ts","../../../projects/libs/drag-resize/drag-ref.ts","../../../projects/libs/drag-resize/placeholder-ref.ts","../../../projects/libs/drag-resize/sorting/layout-geometry.ts","../../../projects/libs/drag-resize/utils/scroll-frame.ts","../../../projects/libs/drag-resize/sorting/sort-session.ts","../../../projects/libs/drag-resize/utils/rtl.ts","../../../projects/libs/drag-resize/drop-list-ref.ts","../../../projects/libs/drag-resize/drop-list-group-ref.ts","../../../projects/libs/drag-resize/services/drag-drop.service.ts","../../../projects/libs/drag-resize/utils/auto-scroll.ts","../../../projects/libs/drag-resize/directives/ngx-draggable.directive.ts","../../../projects/libs/drag-resize/directives/ngx-resizable.directive.ts","../../../projects/libs/drag-resize/directives/ngx-place-holder.directive.ts","../../../projects/libs/drag-resize/directives/ngx-drop-list.directive.ts","../../../projects/libs/drag-resize/directives/ngx-drop-list-group.directive.ts","../../../projects/libs/drag-resize/utils/drag-utils.ts","../../../projects/libs/drag-resize/ngx-kit-drag-resize.ts"],"sourcesContent":["/**\n * Boundary clamping utilities.\n * All functions work purely in viewport (\"client\") coordinates so they can be\n * reused identically for translate-based dragging and left/top-based resizing.\n */\nconst TOLERANCE = 0.5;\n\n/** Clamps a proposed vertical delta so the element's rect stays inside the boundary rect. */\nexport function checkBoundY(\n selfRect: DOMRect,\n boundaryRect: DOMRect | undefined,\n offsetY: number,\n): number {\n if (!boundaryRect) return offsetY;\n const newTop = selfRect.top + offsetY;\n const newBottom = selfRect.bottom + offsetY;\n if (newTop < boundaryRect.top + TOLERANCE) return offsetY + (boundaryRect.top - newTop);\n if (newBottom > boundaryRect.bottom - TOLERANCE)\n return offsetY - (newBottom - boundaryRect.bottom);\n return offsetY;\n}\n\n/** Clamps a proposed horizontal delta so the element's rect stays inside the boundary rect. */\nexport function checkBoundX(\n selfRect: DOMRect,\n boundaryRect: DOMRect | undefined,\n offsetX: number,\n): number {\n if (!boundaryRect) return offsetX;\n const newLeft = selfRect.left + offsetX;\n const newRight = selfRect.right + offsetX;\n if (newLeft < boundaryRect.left + TOLERANCE) return offsetX + (boundaryRect.left - newLeft);\n if (newRight > boundaryRect.right - TOLERANCE) return offsetX - (newRight - boundaryRect.right);\n return offsetX;\n}\n\n/**\n * Clamps a resize result (width/height/left/top, all relative CSS px deltas from the\n * element's start position) so the element never grows/moves outside `boundaryRect`.\n * `startRect` is the element's `getBoundingClientRect()` captured at resize-start.\n */\nexport function clampResizeWithinBoundary(\n boundaryRect: DOMRect | undefined,\n startRect: DOMRect,\n width: number,\n height: number,\n left: number,\n top: number,\n): { width: number; height: number; left: number; top: number } {\n if (!boundaryRect) return { width, height, left, top };\n\n // Viewport position implied by the proposed left/top deltas.\n const viewportLeft = startRect.left + left;\n const viewportTop = startRect.top + top;\n\n let clampedWidth = width;\n let clampedHeight = height;\n let clampedLeft = left;\n let clampedTop = top;\n\n if (viewportLeft < boundaryRect.left) {\n const overflow = boundaryRect.left - viewportLeft;\n clampedLeft = left + overflow;\n clampedWidth = Math.max(0, clampedWidth - overflow);\n }\n if (viewportTop < boundaryRect.top) {\n const overflow = boundaryRect.top - viewportTop;\n clampedTop = top + overflow;\n clampedHeight = Math.max(0, clampedHeight - overflow);\n }\n\n const clampedViewportLeft = startRect.left + clampedLeft;\n const rightEdge = clampedViewportLeft + clampedWidth;\n if (rightEdge > boundaryRect.right) {\n clampedWidth = Math.max(0, boundaryRect.right - clampedViewportLeft);\n }\n\n const clampedViewportTop = startRect.top + clampedTop;\n const bottomEdge = clampedViewportTop + clampedHeight;\n if (bottomEdge > boundaryRect.bottom) {\n clampedHeight = Math.max(0, boundaryRect.bottom - clampedViewportTop);\n }\n\n return { width: clampedWidth, height: clampedHeight, left: clampedLeft, top: clampedTop };\n}\n\n/** Current page zoom level (1 = 100%). Falls back to devicePixelRatio pre visualViewport. */\nexport function getPageZoom(): number {\n return window.visualViewport?.scale ?? window.devicePixelRatio ?? 1;\n}\n\n/** Adjusts a raw pointer-derived value for the current page zoom level. */\nexport function adjustForZoom(value: number): number {\n const zoom = getPageZoom();\n return zoom ? value / zoom : value;\n}\n","/**\n * Copy the browser-resolved visual state of an element.\n *\n * A drag preview is moved to <body>, so selectors depending on ancestors no\n * longer apply. Copying computed styles (including custom properties) makes\n * the preview visually independent from the original DOM subtree.\n */\nexport function copyComputedStyle(source: Element, target: Element): void {\n copyStyleValues(source, target);\n\n // Make the preview deterministic once it is taken out of normal flow (root only:\n // descendants keep their own margins so the internal layout is unchanged).\n (target as HTMLElement).style.setProperty('margin', '0', 'important');\n (target as HTMLElement).style.setProperty('box-sizing', 'border-box', 'important');\n}\n\nfunction copyStyleValues(source: Element, target: Element): void {\n const computed = window.getComputedStyle(source);\n\n for (let i = 0; i < computed.length; i++) {\n const property = computed.item(i);\n const value = computed.getPropertyValue(property);\n\n if (value) {\n (target as HTMLElement).style.setProperty(property, value, computed.getPropertyPriority(property));\n }\n }\n}\n\nexport function copyComputedStyleTree(source: Element, target: Element): void {\n copyComputedStyle(source, target);\n copyDescendants(source, target);\n}\n\nfunction copyDescendants(source: Element, target: Element): void {\n\n const sourceChildren = Array.from(source.children);\n const targetChildren = Array.from(target.children);\n\n const count = Math.min(sourceChildren.length, targetChildren.length);\n\n for (let i = 0; i < count; i++) {\n copyStyleValues(sourceChildren[i], targetChildren[i]);\n copyDescendants(sourceChildren[i], targetChildren[i]);\n }\n}\n\n/** Backward-compatible helper retained for consumers of older versions. */\nexport function copyEssentialStyles(source: HTMLElement, target: HTMLElement): void {\n copyComputedStyle(source, target);\n target.style.setProperty('box-sizing', 'border-box');\n}\n\nexport function combineTransforms(transform: string, initialTransform?: string): string {\n return initialTransform && initialTransform !== 'none'\n ? transform + ' ' + initialTransform\n : transform;\n}\n","import { copyComputedStyleTree } from './styling';\n\nexport interface DragPreviewState {\n element: HTMLElement;\n offsetX: number;\n offsetY: number;\n}\n\n/** Above any app chrome (modals, sticky headers) but below the browser's own UI. */\nconst PREVIEW_Z_INDEX = '2147483000';\n\n/**\n * Creates the visual that follows the pointer while an item of a drop list is dragged.\n *\n * It is appended to `<body>` with `position: fixed`, so no ancestor of the original item\n * (`overflow: hidden`, scroll containers, clipping, transformed/positioned parents) can clip\n * or offset it. Computed styles are copied recursively first, because once the clone leaves\n * its list every selector that depended on an ancestor (`.column .card {}`) and every\n * inherited property (font, colour, `direction`) would otherwise be lost.\n *\n * Only used for drop-list drags. Free drag never calls this.\n */\nexport function cloneDragElementInBody(\n dragEl: HTMLElement,\n rect: DOMRect,\n pointerX: number,\n pointerY: number,\n): DragPreviewState {\n const doc = dragEl.ownerDocument;\n const preview = dragEl.cloneNode(true) as HTMLElement;\n\n // Avoid duplicated ids in the document.\n preview.removeAttribute('id');\n preview.querySelectorAll('[id]').forEach((n) => n.removeAttribute('id'));\n preview.classList.add('ngx-drag-preview');\n preview.setAttribute('aria-hidden', 'true');\n preview.setAttribute('inert', '');\n\n copyComputedStyleTree(dragEl, preview);\n\n Object.assign(preview.style, {\n position: 'fixed',\n top: `${rect.top}px`,\n left: `${rect.left}px`,\n right: 'auto',\n bottom: 'auto',\n width: `${rect.width}px`,\n height: `${rect.height}px`,\n margin: '0',\n pointerEvents: 'none',\n boxSizing: 'border-box',\n transition: 'none',\n animation: 'none',\n transform: 'none',\n visibility: 'visible',\n display: preview.style.display === 'none' ? '' : preview.style.display,\n willChange: 'transform',\n zIndex: PREVIEW_Z_INDEX,\n });\n\n doc.body.appendChild(preview);\n\n return {\n element: preview,\n offsetX: pointerX - rect.left,\n offsetY: pointerY - rect.top,\n };\n}\n","import { signal } from '@angular/core';\nimport { IPosition } from './contracts/IPosition';\nimport { DropListRef } from './drop-list-ref';\nimport { PlaceHolderRef } from './placeholder-ref';\nimport { DropListGroupRef } from './drop-list-group-ref';\nimport { DragDropService } from './services/drag-drop.service';\nimport { checkBoundX, checkBoundY } from './utils/check-boundary';\nimport { cloneDragElementInBody } from './utils/clone-drag-element-in-body';\n\nexport type DragAxis = 'x' | 'y' | undefined;\n\nlet zIndexCounter = 1000;\n\nexport class DragRef<T = unknown> {\n data?: T;\n el!: HTMLElement;\n boundary?: HTMLElement;\n lockAxis?: DragAxis;\n\n /**\n * The list this draggable BELONGS to (set by the template). Dragging never changes it.\n * The list the pointer is currently over is `activeDropList`.\n */\n dropList: DropListRef<T> | null = null;\n dropListGroup?: DropListGroupRef | null;\n /** Used to find the drop list under the pointer. Set by the directive; optional. */\n service?: DragDropService;\n /** Drop list currently under the pointer during a drop-list drag (null = outside every list). */\n activeDropList: DropListRef<T> | null = null;\n\n placeholder?: PlaceHolderRef;\n originDropList: DropListRef<T> | null = null;\n originIndex = -1;\n\n readonly isDragging = signal(false);\n readonly position = signal<IPosition>({ x: 0, y: 0 });\n\n private startPointer = { x: 0, y: 0 };\n private startRect!: DOMRect;\n private lastPointer = { x: 0, y: 0 };\n\n private previousTransform = '';\n private previousZIndex = '';\n\n private moveDx = 0;\n private moveDy = 0;\n private scrollCompensation = { x: 0, y: 0 };\n private preview?: HTMLElement;\n private previewOffsetX = 0;\n private previewOffsetY = 0;\n private sourceVisibility = '';\n private sourceDisplay = '';\n private sourcePointerEvents = '';\n private sourceTransition = '';\n\n /** True while a drop-list drag (body preview + placeholder) is in progress. Free drag: always false. */\n private listDrag = false;\n private cachedLists: DropListRef<T>[] = [];\n /**\n * Candidate lists for hit-testing, filtered (connected to the origin; not inside the dragged\n * element) and sorted deepest-first — both computed ONCE, not on every pointer move, since\n * neither ever changes mid-drag. Kept in sync with the live registry (see `dropListsSnapshot`)\n * so a list that appears or disappears mid-drag (e.g. behind an `@if`) is still picked up.\n */\n private dropCandidates: { list: DropListRef<T>; depth: number }[] = [];\n private dropListsSnapshot: readonly DropListRef<any>[] | null = null;\n private lastEffective: IPosition = { x: 0, y: 0 };\n private scrollListener?: () => void;\n private resizeListener?: () => void;\n\n init(): void {\n this.previousTransform = getComputedStyle(this.el).getPropertyValue('transform');\n }\n\n withDropList(list: DropListRef<T> | null): this {\n if (this.dropList === list) return this;\n\n this.dropList?.removeItem(this);\n this.dropList = list;\n list?.addItem(this);\n return this;\n }\n\n clearDropList(): void {\n this.dropList?.removeItem(this);\n this.dropList = null;\n }\n\n pointerDown(pointer: IPosition): void {\n this.startPointer = { ...pointer };\n this.lastPointer = { ...pointer };\n }\n\n startDrag(pointer: IPosition): void {\n this.startRect = this.el.getBoundingClientRect();\n\n this.startPointer = { ...pointer };\n this.lastPointer = { ...pointer };\n this.moveDx = 0;\n this.moveDy = 0;\n this.scrollCompensation = { x: 0, y: 0 };\n\n // Only draggables that are direct children of their drop list take part in sorting.\n // Everything else is a plain free drag.\n const list = this.dropList && this.dropList.el === this.el.parentElement ? this.dropList : null;\n this.originDropList = list;\n this.originIndex = list?.getItemIndex(this) ?? -1;\n this.previousTransform = getComputedStyle(this.el).getPropertyValue('transform');\n\n this.isDragging.set(true);\n\n this.previousZIndex = this.el.style.zIndex;\n this.sourceVisibility = this.el.style.visibility;\n this.sourceDisplay = this.el.style.display;\n this.sourcePointerEvents = this.el.style.pointerEvents;\n this.sourceTransition = this.el.style.transition;\n\n this.el.classList.add('ngx-draggable--dragging');\n this.el.style.willChange = 'transform';\n this.el.style.transition = 'none';\n this.el.style.zIndex = String(++zIndexCounter);\n\n /*\n * IMPORTANT:\n *\n * Normal Drag:\n * absolutely nothing changes in the element's rendering mechanism.\n *\n * DropList Drag:\n * create a body-level preview because the original element can be\n * inside an overflow:auto/hidden container such as a Kanban column.\n */\n if (list) {\n this.listDrag = true;\n\n // Order matters: clone while the source is still visible and fully styled, hide it,\n // and only THEN measure (the placeholder takes over the source's slot).\n const preview = cloneDragElementInBody(this.el, this.startRect, pointer.x, pointer.y);\n\n this.preview = preview.element;\n this.previewOffsetX = preview.offsetX;\n this.previewOffsetY = preview.offsetY;\n\n this.el.style.visibility = 'hidden';\n this.el.style.display = 'none';\n this.el.style.pointerEvents = 'none';\n\n this.beginListDrag(list, pointer);\n this.updatePreview();\n } else {\n // KEEP THE ORIGINAL DRAG BEHAVIOR.\n this.applyTransform();\n }\n }\n\n dragMove(pointer: IPosition): void {\n if (!this.isDragging()) return;\n\n this.lastPointer = { ...pointer };\n\n let dx = pointer.x - this.startPointer.x;\n let dy = pointer.y - this.startPointer.y;\n\n if (this.boundary) {\n dx = checkBoundX(this.startRect, this.boundary.getBoundingClientRect(), dx);\n\n dy = checkBoundY(this.startRect, this.boundary.getBoundingClientRect(), dy);\n }\n\n if (this.lockAxis === 'x') dy = 0;\n if (this.lockAxis === 'y') dx = 0;\n\n this.moveDx = dx;\n this.moveDy = dy;\n\n this.position.set({\n x: dx,\n y: dy,\n });\n\n if (this.listDrag) {\n this.updatePreview();\n // Sorting follows the (axis/boundary constrained) pointer, not the raw one.\n this.lastEffective = { x: this.startPointer.x + dx, y: this.startPointer.y + dy };\n this.updateDropTarget(this.lastEffective);\n } else {\n this.applyTransform();\n }\n }\n\n nudge(dx: number, dy: number): void {\n if (!this.isDragging()) this.startDrag(this.lastPointer);\n\n this.dragMove({\n x: this.startPointer.x + this.moveDx + dx,\n y: this.startPointer.y + this.moveDy + dy,\n });\n }\n\n endDrag(): void {\n if (!this.isDragging()) return;\n\n if (this.listDrag) {\n this.isDragging.set(false);\n this.finishListDrag(true);\n return;\n }\n\n // ---- free drag: unchanged ----\n this.isDragging.set(false);\n\n this.placeholder?.detach();\n this.placeholder = undefined;\n\n this.preview?.remove();\n this.preview = undefined;\n\n this.el.classList.remove('ngx-draggable--dragging');\n\n this.el.style.visibility = this.sourceVisibility;\n this.el.style.display = this.sourceDisplay;\n this.el.style.pointerEvents = this.sourcePointerEvents;\n this.el.style.willChange = '';\n this.el.style.zIndex = this.previousZIndex;\n }\n\n cancelDrag(): void {\n if (!this.isDragging()) return;\n\n this.moveDx = 0;\n this.moveDy = 0;\n\n this.position.set({ x: 0, y: 0 });\n\n if (this.listDrag) {\n // Rollback: nothing was ever committed to the DOM or the model, so restoring is just cleanup.\n this.isDragging.set(false);\n this.finishListDrag(false);\n return;\n }\n\n // ---- free drag: unchanged ----\n this.el.style.transform = this.previousTransform;\n this.el.style.visibility = this.sourceVisibility;\n this.el.style.pointerEvents = this.sourcePointerEvents;\n this.scrollCompensation = { x: 0, y: 0 };\n\n this.endDrag();\n }\n\n /** Abort without emitting anything (the directive was destroyed mid-drag). Idempotent. */\n dispose(): void {\n if (!this.listDrag) return;\n this.isDragging.set(false);\n this.finishListDrag(false);\n }\n\n /** True while a drop-list drag is running. */\n get isListDrag(): boolean {\n return this.listDrag;\n }\n\n /** Inline `display` the source element had before it was hidden for the drag. */\n get originalDisplay(): string {\n return this.sourceDisplay;\n }\n\n get x(): number {\n return this.moveDx;\n }\n\n get y(): number {\n return this.moveDy;\n }\n\n get pointer(): IPosition {\n return this.lastPointer;\n }\n\n get start(): DOMRect {\n return this.startRect;\n }\n\n getPlaceholderElement(): HTMLElement | undefined {\n return this.placeholder?.element;\n }\n\n /**\n * صدا زده میشود هر بار که container یا window در حین درگ اسکرول شود\n * (چه توسط auto-scroll خودمان، چه با wheel/اسکرولبار دستی کاربر).\n * transform را فوراً تصحیح میکند تا عنصر زیر پوینتر بماند.\n */\n notifyScroll(dx: number, dy: number): void {\n if (!this.isDragging()) return;\n // Drop-list drags are position:fixed in <body> and follow the pointer in viewport space, so\n // scrolling needs no compensation; sorting listens to scroll on its own (see beginListDrag).\n if (this.listDrag) return;\n this.scrollCompensation = {\n x: this.scrollCompensation.x + dx,\n y: this.scrollCompensation.y + dy,\n };\n this.applyTransform();\n }\n\n private applyTransform(): void {\n const base =\n this.previousTransform && this.previousTransform !== 'none'\n ? this.previousTransform + ' '\n : '';\n\n const tx = this.moveDx + this.scrollCompensation.x;\n const ty = this.moveDy + this.scrollCompensation.y;\n\n this.el.style.transform = `${base}translate3d(${tx}px, ${ty}px, 0)`;\n }\n // -------------------------------------------------------------------------------------\n // drop-list drag\n // -------------------------------------------------------------------------------------\n\n private beginListDrag(origin: DropListRef<T>, pointer: IPosition): void {\n const doc = this.el.ownerDocument;\n const win = doc.defaultView ?? window;\n\n this.dropListsSnapshot = null; // force refreshDropCandidates() to do a full pass below\n this.refreshDropCandidates(origin);\n\n this.lastEffective = { ...pointer };\n this.activeDropList = origin;\n origin.enter(this, pointer.x, pointer.y);\n // The origin is (re-)measured AFTER its placeholder took over the source's slot, so its box\n // still covers the whole list (the hidden source no longer occupies space).\n origin._cacheGeometry();\n\n this.scrollListener = () => {\n for (const l of this.cachedLists) l._onScroll();\n this.updateDropTarget(this.lastEffective);\n };\n this.resizeListener = () => {\n for (const l of this.cachedLists) l._refresh();\n this.updateDropTarget(this.lastEffective);\n };\n // Capture: `scroll` does not bubble, and any ancestor (or the page) may be the one scrolling.\n doc.addEventListener('scroll', this.scrollListener, { capture: true, passive: true });\n win.addEventListener('resize', this.resizeListener, { passive: true });\n }\n\n /**\n * Recomputes which registered lists are valid targets for this drag — connected to the\n * origin, and not nested inside the element being dragged — plus each one's nesting depth.\n *\n * `DragDropService.dropLists()` is an Angular signal: its array is a NEW reference only when a\n * list actually registers or unregisters, so the check below is a single reference comparison\n * on every pointer move and the (heavier) connectivity/containment/depth work below it only\n * runs on the rare event a list appears or disappears mid-drag — never on every pointer move.\n */\n private refreshDropCandidates(origin: DropListRef<T>): void {\n const all = this.service?.dropLists() ?? [];\n if (all === this.dropListsSnapshot) return;\n this.dropListsSnapshot = all;\n\n const already = new Set(this.dropCandidates.map((c) => c.list));\n const next: { list: DropListRef<T>; depth: number }[] = [{ list: origin, depth: origin.depth }];\n for (const l of all as DropListRef<T>[]) {\n if (l === origin || !l.el || !origin.isConnectedTo(l)) continue;\n if (this.el !== l.el && this.el.contains(l.el)) continue;\n if (!already.has(l)) l._cacheGeometry(); // newly eligible mid-drag: measure it now\n next.push({ list: l, depth: l.depth });\n }\n this.dropCandidates = next;\n this.cachedLists = next.map((c) => c.list);\n }\n\n /**\n * Decide which list is under the pointer, switch if needed, then re-sort in the active one.\n *\n * The origin list is the one exception to \"exiting a list resets/releases it\": while the\n * pointer dives into one of the origin's OWN nested lists (at any depth), the origin's\n * placeholder and sibling displacement are left exactly as they are — frozen, not reset —\n * so returning to the origin's own level doesn't snap items back and then forward again.\n * Every OTHER (foreign) list still fully releases the moment the pointer leaves it, exactly\n * as before; nesting multiple foreign sessions alive at once would let their own internal\n * sibling displacement compound in ways a single flat `ancestorOffset` cannot represent.\n */\n private updateDropTarget(pointer: IPosition): void {\n const origin = this.originDropList;\n if (!origin) return;\n\n this.refreshDropCandidates(origin);\n const next = this.resolveDropList(pointer);\n if (next === this.activeDropList) {\n next?.sortItem(this, pointer);\n return;\n }\n\n const prev = this.activeDropList;\n if (prev && prev !== origin) prev.exit(this);\n\n const nextWithinOrigin = !!next && (next === origin || isDescendantOfList(next, origin));\n if (nextWithinOrigin) {\n if (prev === origin) origin._freeze(); // no longer the innermost, but stays engaged\n } else {\n origin.exit(this); // truly outside the origin's territory now: reset it (idempotent)\n }\n\n this.activeDropList = next;\n next?.enter(this, pointer.x, pointer.y); // fresh entry, or resumes a still-alive (frozen) session\n }\n\n /**\n * Innermost connected list under the pointer, from the precomputed candidates: deeper always\n * beats shallower; among lists at the same depth (unrelated, visually overlapping lists) the\n * currently active one is kept to avoid flicker, otherwise the smaller one wins. No DOM\n * reads and no `.contains()` calls happen here — everything needed was precomputed above.\n */\n private resolveDropList(pointer: IPosition): DropListRef<T> | null {\n let best: DropListRef<T> | null = null;\n let bestDepth = -1;\n for (const { list, depth } of this.dropCandidates) {\n if (!list._containsPoint(pointer.x, pointer.y)) continue;\n if (!best || depth > bestDepth) {\n best = list;\n bestDepth = depth;\n } else if (depth === bestDepth && best !== this.activeDropList) {\n if (list === this.activeDropList || list._area() < best._area()) best = list;\n }\n }\n return best;\n }\n\n /**\n * Single teardown path for every way a drop-list drag can end (drop on a list, drop outside,\n * Escape, pointercancel, destroy). Everything transient is removed here, so nothing can leak\n * regardless of how the drag ended. Only then is the drop event emitted.\n */\n private finishListDrag(commit: boolean): void {\n const doc = this.el.ownerDocument;\n if (this.scrollListener)\n doc.removeEventListener('scroll', this.scrollListener, { capture: true });\n if (this.resizeListener)\n (doc.defaultView ?? window).removeEventListener('resize', this.resizeListener);\n this.scrollListener = this.resizeListener = undefined;\n\n const target = commit ? this.activeDropList : null;\n const event = target?._finish(this, true) ?? null;\n for (const l of this.cachedLists) l._release(this);\n\n this.preview?.remove();\n this.preview = undefined;\n this.placeholder = undefined;\n this.activeDropList = null;\n this.cachedLists = [];\n this.dropCandidates = [];\n this.dropListsSnapshot = null;\n this.listDrag = false;\n\n // The source element is put back exactly as it was (its transform was never touched).\n this.el.classList.remove('ngx-draggable--dragging');\n this.el.style.visibility = this.sourceVisibility;\n this.el.style.display = this.sourceDisplay;\n this.el.style.pointerEvents = this.sourcePointerEvents;\n this.el.style.transition = this.sourceTransition;\n this.el.style.willChange = '';\n this.el.style.zIndex = this.previousZIndex;\n\n if (event && target) target.onDrop.emit(event);\n }\n\n private updatePreview(): void {\n if (!this.preview) return;\n\n this.preview.style.transform = `translate3d(${this.moveDx}px, ${this.moveDy}px, 0)`;\n }\n}\n\n/** Is `list` nested (at any depth) inside `ancestor`, per the parent/child list tree? */\nfunction isDescendantOfList(list: DropListRef<any>, ancestor: DropListRef<any>): boolean {\n for (let p: DropListRef<any> | null = list.parentList; p; p = p.parentList) {\n if (p === ancestor) return true;\n }\n return false;\n}\n","import { ApplicationRef, TemplateRef, type EmbeddedViewRef } from '@angular/core';\nimport { DropListRef } from './drop-list-ref';\n\nexport class PlaceHolderRef {\n /**\n * Custom placeholder content, from `*ngxPlaceholder` inside the `ngxDropList`. When unset,\n * `attach()` falls back to a shallow clone of the dragged element (previous behaviour).\n *\n * Example:\n *\n * <div ngxDropList>\n * <span class=\"my-placeholder\" *ngxPlaceholder></span>\n * ...\n * </div>\n */\n tpl?: TemplateRef<unknown>;\n /** Set by `NgxPlaceholder` so the embedded view can join Angular's change-detection tree. */\n appRef?: ApplicationRef;\n dropList?: DropListRef;\n element?: HTMLElement;\n\n private _visible = false;\n private _view?: EmbeddedViewRef<unknown>;\n /** True once `this.element` was built from `tpl` (as opposed to the fallback clone). */\n private isCustom = false;\n\n attach(container: HTMLElement, source: HTMLElement, reference?: Node | null): HTMLElement {\n if (!this.element) {\n if (this.tpl) {\n this._view = this.tpl.createEmbeddedView({});\n this.appRef?.attachView(this._view);\n // Render bindings inside the embedded view before we move its DOM nodes.\n this._view.detectChanges();\n\n const element = this._view.rootNodes.find(\n (node): node is HTMLElement => node instanceof HTMLElement,\n );\n\n if (!element) {\n this.appRef?.detachView(this._view);\n this._view.destroy();\n this._view = undefined;\n\n throw new Error(\n 'ngxPlaceholder template must contain exactly one HTMLElement root node ' +\n '(other root nodes, if any, are ignored).',\n );\n }\n\n this.element = element;\n this.isCustom = true;\n } else {\n // Fallback: keep the same tag/attributes as the dragged item so selectors such as\n // \".list > article\" and grid/flex item rules continue to apply.\n this.element = source.cloneNode(false) as HTMLElement;\n this.element.removeAttribute('id');\n this.element.classList.add('ngx-drag-placeholder');\n this.element.setAttribute('aria-hidden', 'true');\n this.element.setAttribute('inert', '');\n this.element.removeAttribute('tabindex');\n this.isCustom = false;\n }\n }\n\n // Safety overrides that apply regardless of who authored the element: it must never\n // inherit a live drag transform/animation (transform/transition are left free for the\n // sort session to drive, translate3d-ing the placeholder to the current insertion slot),\n // never intercept pointer events, and never be display:none.\n this.element.style.removeProperty('transform');\n this.element.style.removeProperty('transition');\n this.element.style.removeProperty('will-change');\n this.element.style.setProperty('animation', 'none', 'important');\n this.element.style.setProperty('pointer-events', 'none', 'important');\n this.element.style.setProperty('visibility', 'visible', 'important');\n\n if (!this.isCustom) {\n // Only the auto-generated clone gets the default \"phantom box\" look. A custom\n // *ngxPlaceholder template is styled entirely by the caller.\n this.element.style.setProperty('opacity', '0.16', 'important');\n this.element.style.setProperty('outline', '2px dashed currentColor', 'important');\n this.element.style.setProperty('outline-offset', '-2px', 'important');\n }\n\n this._visible = true;\n\n if (reference && reference.parentNode === container) {\n if (this.element !== reference) container.insertBefore(this.element, reference);\n } else if (this.element.parentNode !== container) {\n container.appendChild(this.element);\n }\n\n return this.element;\n }\n\n /** True while the currently attached element came from a custom `*ngxPlaceholder` template. */\n get custom(): boolean {\n return this.isCustom;\n }\n\n detach(): void {\n this.element?.remove();\n\n if (this._view) {\n this.appRef?.detachView(this._view);\n this._view.destroy();\n this._view = undefined;\n }\n\n this.element = undefined;\n this._visible = false;\n }\n\n get visible(): boolean {\n return this._visible && !!this.element?.isConnected;\n }\n}\n","/**\n * Pure geometry used by the drop-list sorting engine.\n *\n * Nothing in this file touches the DOM. Everything is a deterministic function of\n * `(rectangles, pointer)`, which is what makes sorting reversible: the same pointer over the\n * same snapshot always yields the same insertion index, regardless of what the previous\n * pointer positions were.\n *\n * Layout direction is *derived from the rectangles* (row clustering + the order in which DOM\n * siblings actually appear on screen) rather than from `flex-direction` / `direction`. That is\n * what lets one algorithm handle block flow, inline flow, flex (row/column/wrap/reverse),\n * grid, RTL and `order:`-reshuffled layouts. Computed style is only a fallback for lists that\n * are too small (0 or 1 item) to reveal their own orientation.\n */\n\nexport interface Box {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\nexport interface Point {\n x: number;\n y: number;\n}\n\n/** `x` = one row, `y` = one column, `grid` = several rows containing several items. */\nexport type Axis = 'x' | 'y' | 'grid';\nexport type Sign = 1 | -1;\n\nexport interface LayoutModel {\n axis: Axis;\n /** +1: DOM order advances left→right inside a row. -1: right→left (RTL, row-reverse...). */\n dirX: Sign;\n /** +1: rows/items advance top→bottom in DOM order. -1: bottom→top (column-reverse, wrap-reverse). */\n dirY: Sign;\n /** Row index (in DOM order) of every box. */\n rowOf: number[];\n /** Horizontal direction of every row (a single row can differ from the global one). */\n rowDirX: Sign[];\n /** Mid-lines separating consecutive rows, in DOM row order. Length = rowCount - 1. */\n rowBounds: number[];\n /** Outer edges of the first / last row along the row direction (see `dirY`). */\n yStart: number;\n yEnd: number;\n rowCount: number;\n}\n\n/**\n * Hysteresis is the only \"magic\" number in the algorithm and it is deliberate: without it a\n * pointer resting exactly on a sibling's mid-line flips the placeholder on every sub-pixel\n * jitter (and on every rounding difference between two layouts). It is proportional to the\n * sibling's size and capped, so it can never make a small item feel sticky.\n */\nexport const HYSTERESIS_RATIO = 0.1;\nexport const HYSTERESIS_MAX_PX = 6;\n\nexport function hysteresis(size: number): number {\n return Math.min(HYSTERESIS_MAX_PX, Math.max(0, size) * HYSTERESIS_RATIO);\n}\n\nconst cx = (b: Box) => (b.left + b.right) / 2;\nconst cy = (b: Box) => (b.top + b.bottom) / 2;\nconst width = (b: Box) => b.right - b.left;\nconst height = (b: Box) => b.bottom - b.top;\nconst sign = (n: number): Sign => (n < 0 ? -1 : 1);\n\ninterface RowAcc {\n top: number;\n bottom: number;\n first: number;\n last: number;\n count: number;\n}\n\n/**\n * Builds a layout model from DOM-ordered boxes.\n *\n * @param fallbackAxis orientation to assume when there are fewer than two boxes.\n * @param fallbackRtl inline direction to assume when no row contains two items.\n */\nexport function analyzeLayout(\n boxes: readonly Box[],\n fallbackAxis: 'x' | 'y' = 'y',\n fallbackRtl = false,\n): LayoutModel {\n const rows: RowAcc[] = [];\n const rowOf: number[] = [];\n\n boxes.forEach((b, i) => {\n const row = rows[rows.length - 1];\n if (row) {\n const overlap = Math.min(b.bottom, row.bottom) - Math.max(b.top, row.top);\n const smaller = Math.min(height(b), row.bottom - row.top);\n // Same row when the boxes share at least half of the smaller one's height. Touching or\n // sub-pixel-overlapping boxes (fractional heights) therefore start a new row.\n if (overlap > 0 && overlap >= smaller * 0.5) {\n row.top = Math.min(row.top, b.top);\n row.bottom = Math.max(row.bottom, b.bottom);\n row.last = i;\n row.count++;\n rowOf.push(rows.length - 1);\n return;\n }\n }\n rows.push({ top: b.top, bottom: b.bottom, first: i, last: i, count: 1 });\n rowOf.push(rows.length - 1);\n });\n\n const rowCount = rows.length;\n\n // Vertical direction: which way do successive rows travel?\n const dirY: Sign =\n rowCount > 1\n ? sign((rows[rowCount - 1].top + rows[rowCount - 1].bottom) / 2 - (rows[0].top + rows[0].bottom) / 2)\n : 1;\n\n // Horizontal direction per row (from the first/last item of that row) + a global vote.\n const rowDirX: Sign[] = [];\n let votes = 0;\n for (const r of rows) {\n if (r.count > 1) {\n const d = sign(cx(boxes[r.last]) - cx(boxes[r.first]));\n rowDirX.push(d);\n votes += d;\n } else {\n rowDirX.push(0 as unknown as Sign); // resolved below once the global vote is known\n }\n }\n const dirX: Sign = votes !== 0 ? sign(votes) : fallbackRtl ? -1 : 1;\n for (let i = 0; i < rowDirX.length; i++) if (!rowDirX[i]) rowDirX[i] = dirX;\n\n const rowBounds: number[] = [];\n for (let r = 0; r < rowCount - 1; r++) {\n rowBounds.push(dirY === 1 ? (rows[r].bottom + rows[r + 1].top) / 2 : (rows[r].top + rows[r + 1].bottom) / 2);\n }\n\n const first = rows[0];\n const lastRow = rows[rowCount - 1];\n const yStart = first ? (dirY === 1 ? first.top : first.bottom) : 0;\n const yEnd = lastRow ? (dirY === 1 ? lastRow.bottom : lastRow.top) : 0;\n\n let axis: Axis;\n if (boxes.length < 2) axis = fallbackAxis;\n else if (rowCount === 1) axis = 'x';\n else if (rows.every((r) => r.count === 1)) axis = 'y';\n else axis = 'grid';\n\n return { axis, dirX, dirY, rowOf, rowDirX, rowBounds, yStart, yEnd, rowCount };\n}\n\nfunction rowAt(model: LayoutModel, y: number): number {\n let r = 0;\n for (const bound of model.rowBounds) {\n if (model.dirY === 1 ? y > bound : y < bound) r++;\n else break;\n }\n return r;\n}\n\n/**\n * Where should the dragged item be inserted, given the pointer?\n *\n * The result is the number of *other* items that end up before the dragged one, i.e. the\n * dragged item's final index. `slot` is the index (in `boxes`) of the dragged item's own slot\n * (its placeholder), or -1 when the list does not contain one yet.\n *\n * `current` is the index the slot currently has in \"others space\"; it only decides on which\n * side of a sibling's mid-line the small hysteresis band applies. Pass `null` for a first\n * placement (no history, no hysteresis).\n *\n * Pure: depends only on its arguments.\n */\nexport function resolveInsertionIndex(\n model: LayoutModel,\n boxes: readonly Box[],\n slot: number,\n pointer: Point,\n current: number | null,\n): number {\n let before = 0;\n let others = 0;\n\n for (let i = 0; i < boxes.length; i++) {\n if (i === slot) continue;\n const o = others++;\n const b = boxes[i];\n // Sign of the hysteresis band: +1 favours \"stays before the pointer\", -1 favours \"stays after\".\n const bias = current === null ? 0 : o < current ? 1 : -1;\n\n let isBefore: boolean;\n if (model.axis === 'x') {\n isBefore = model.dirX * (pointer.x - cx(b)) + bias * hysteresis(width(b)) > 0;\n } else if (model.axis === 'y') {\n isBefore = model.dirY * (pointer.y - cy(b)) + bias * hysteresis(height(b)) > 0;\n } else {\n const row = model.rowOf[i];\n const py = pointer.y + model.dirY * bias * hysteresis(height(b));\n const pointerRow = rowAt(model, py);\n if (model.dirY * (py - model.yStart) < 0) {\n isBefore = false; // above the first row: nothing precedes the pointer\n } else if (model.dirY * (py - model.yEnd) > 0) {\n isBefore = true; // below the last row: everything does (append)\n } else if (pointerRow !== row) {\n isBefore = pointerRow > row;\n } else {\n isBefore = model.rowDirX[row] * (pointer.x - cx(b)) + bias * hysteresis(width(b)) > 0;\n }\n }\n if (isBefore) before++;\n }\n return before;\n}\n\n/**\n * Along-axis displacement of every box when the slot moves to `target` (others-space index).\n *\n * The result is where each box has to be translated so that the boxes, re-ordered, occupy the\n * same run of space they occupied before, using each box's own size and the *measured* gaps\n * between the original slots (so `gap`, margins and inline whitespace are handled by\n * construction, not by assumption). Only meaningful for `x` / `y` axes; `grid` returns zeros.\n */\nexport function computeAxisOffsets(model: LayoutModel, boxes: readonly Box[], slot: number, target: number): number[] {\n const n = boxes.length;\n const offsets = new Array<number>(n).fill(0);\n if (model.axis === 'grid' || n < 2 || slot < 0) return offsets;\n\n const horizontal = model.axis === 'x';\n const dir = horizontal ? model.dirX : model.dirY;\n\n // Mirror into a frame where DOM order is ascending, so one code path serves LTR and RTL.\n const lo = boxes.map((b) => (horizontal ? (dir === 1 ? b.left : -b.right) : dir === 1 ? b.top : -b.bottom));\n const hi = boxes.map((b) => (horizontal ? (dir === 1 ? b.right : -b.left) : dir === 1 ? b.bottom : -b.top));\n\n const order: number[] = [];\n for (let i = 0; i < n; i++) if (i !== slot) order.push(i);\n order.splice(Math.max(0, Math.min(target, n - 1)), 0, slot);\n\n let cursor = lo[0];\n for (let p = 0; p < n; p++) {\n const item = order[p];\n const delta = cursor - lo[item];\n offsets[item] = Math.abs(delta) < 1e-6 ? 0 : dir * delta;\n cursor += hi[item] - lo[item] + (p < n - 1 ? lo[p + 1] - hi[p] : 0);\n }\n return offsets;\n}\n\n/** Intersection of two boxes, or `null` when they do not overlap. */\nexport function intersectBoxes(a: Box, b: Box): Box | null {\n const left = Math.max(a.left, b.left);\n const top = Math.max(a.top, b.top);\n const right = Math.min(a.right, b.right);\n const bottom = Math.min(a.bottom, b.bottom);\n return right > left && bottom > top ? { left, top, right, bottom } : null;\n}\n\nexport function boxContains(b: Box, x: number, y: number): boolean {\n return x >= b.left && x <= b.right && y >= b.top && y <= b.bottom;\n}\n\nexport function toBox(r: { left: number; top: number; right: number; bottom: number }): Box {\n return { left: r.left, top: r.top, right: r.right, bottom: r.bottom };\n}\n","/**\n * Tracks how far the scrollable ancestors of an element (and the window) have scrolled since\n * the frame was created.\n *\n * Geometry is measured once, when a drag enters a list. Scrolling afterwards moves the\n * content under a stationary pointer, which is equivalent to moving the pointer by the scroll\n * delta in the frame the geometry was measured in. Shifting the *pointer* (one point) instead\n * of re-measuring every item keeps cached rectangles valid across page scroll, parent scroll\n * and nested scroll without any layout reads on the hot path.\n *\n * `delta()` only reads `scrollLeft/Top` after `invalidate()` (called from a scroll event), so\n * ordinary pointer moves perform zero scroll reads.\n */\nexport class ScrollFrame {\n private readonly targets: Array<HTMLElement | Window> = [];\n private origin: Point = { x: 0, y: 0 };\n private cached: Point = { x: 0, y: 0 };\n private dirty = false;\n\n /**\n * @param start first element to inspect (walks up through its ancestors)\n * @param includeStart whether `start` itself counts (true for a list whose own scroll moves its items)\n */\n constructor(\n start: HTMLElement | null,\n includeStart = true,\n private readonly win: Window = window,\n ) {\n let node: HTMLElement | null = includeStart ? start : (start?.parentElement ?? null);\n const root = start?.ownerDocument.documentElement;\n while (node) {\n // <html> scrolling is reported through `window`; counting both would double the delta.\n if (node !== root && scrolls(node)) this.targets.push(node);\n node = node.parentElement;\n }\n this.targets.push(win);\n this.origin = this.read();\n }\n\n /** Call when any scroll event fires. */\n invalidate(): void {\n this.dirty = true;\n }\n\n /** Total scroll distance (px) of all tracked containers since construction. */\n delta(): Point {\n if (this.dirty) {\n const now = this.read();\n this.cached = { x: now.x - this.origin.x, y: now.y - this.origin.y };\n this.dirty = false;\n }\n return this.cached;\n }\n\n private read(): Point {\n let x = 0;\n let y = 0;\n for (const t of this.targets) {\n if (t === this.win) {\n x += this.win.scrollX;\n y += this.win.scrollY;\n } else {\n x += (t as HTMLElement).scrollLeft;\n y += (t as HTMLElement).scrollTop;\n }\n }\n return { x, y };\n }\n}\n\ninterface Point {\n x: number;\n y: number;\n}\n\nfunction scrolls(el: HTMLElement): boolean {\n const s = getComputedStyle(el);\n // `hidden` containers still scroll programmatically; `clip` never does.\n const scrollish = (v: string) => v === 'auto' || v === 'scroll' || v === 'overlay' || v === 'hidden';\n return scrollish(s.overflowX) || scrollish(s.overflowY);\n}\n","import { ScrollFrame } from '../utils/scroll-frame';\nimport {\n Axis,\n Box,\n LayoutModel,\n Point,\n analyzeLayout,\n computeAxisOffsets,\n resolveInsertionIndex,\n toBox,\n} from './layout-geometry';\n\nexport interface SortSessionInit {\n /** The drop list element. */\n container: HTMLElement;\n /** The placeholder for the dragged item. Must already be attached inside `container`. */\n placeholder: HTMLElement;\n /** Slot elements (direct children of `container`) of every draggable EXCEPT the dragged one. */\n itemElements: ReadonlySet<HTMLElement>;\n /** Used only while the list is too small to reveal its own orientation. */\n fallbackAxis: 'x' | 'y';\n fallbackRtl: boolean;\n /** Sibling animation in ms (0 disables). */\n animationMs: number;\n /** Whitespace separator already inserted next to the placeholder (inline layouts only). */\n spacer?: Text | null;\n /**\n * Notified whenever an entry's `translate3d` offset changes (including back to `{0,0}`).\n * A displaced item can contain OTHER registered drop lists (a tree of nested lists); their\n * cached hit-test geometry was measured before any displacement, so without this hook their\n * on-screen position and their hit-test box silently disagree once a sibling moves.\n */\n onOffsetChange?: (el: HTMLElement, offset: Point) => void;\n}\n\n/**\n * Inline / inline-block layouts get their inter-item gap from whitespace TEXT nodes. A\n * placeholder that is moved (or freshly inserted) without one would collapse that gap and shift\n * everything after it by a space width, so it carries a separator of its own. Returns `null`\n * for layouts that have no whitespace nodes (flex, grid, Angular-trimmed templates).\n */\nexport function makeSpacer(container: HTMLElement): Text | null {\n for (const n of Array.from(container.childNodes)) {\n if (n.nodeType === Node.TEXT_NODE && n.nodeValue && /^\\s+$/.test(n.nodeValue)) {\n return container.ownerDocument.createTextNode(n.nodeValue);\n }\n }\n return null;\n}\n\ninterface Entry {\n el: HTMLElement;\n isSlot: boolean;\n /** Computed transform the element had before we touched it (so e.g. rotations survive). */\n base: string;\n savedTransform: string;\n savedTransition: string;\n savedWillChange: string;\n}\n\nconst EASING = 'cubic-bezier(0, 0, 0.2, 1)';\n\n/**\n * One drag's view of one drop list.\n *\n * Lifecycle\n * ---------\n * snapshot ──► resolve(pointer) ──► apply(index) ──► ... ──► dispose()\n *\n * The snapshot (`boxes`) is taken once, with the dragged item's slot already in place, and is\n * never re-read while the drag is over the list. `resolve` is a pure function of the pointer\n * and that snapshot, so moving the pointer back always restores the previous state.\n *\n * Two ways to *show* the result, chosen from the measured layout:\n *\n * - `transform` (one row or one column; the common case): the DOM is never touched. Siblings\n * and the placeholder are displaced with `translate3d`, computed from measured sizes and\n * gaps, exactly like Angular CDK's single-axis strategy.\n * - `flow` (grid / wrapping layouts): an exact translate cannot be derived without\n * re-implementing the browser's layout engine, so the single placeholder node is moved and\n * the browser lays the list out. Siblings are then animated from their old to new position\n * with FLIP `translate3d` so the motion is still transform-driven and smooth. Decisions\n * keep using the immutable snapshot, so the reflow can never feed back into them.\n */\nexport class SortSession {\n readonly mode: 'transform' | 'flow';\n\n private readonly container: HTMLElement;\n private readonly placeholder: HTMLElement;\n private readonly itemElements: ReadonlySet<HTMLElement>;\n private readonly animationMs: number;\n private readonly fallbackAxis: 'x' | 'y';\n private readonly fallbackRtl: boolean;\n\n private entries: Entry[] = [];\n private boxes: Box[] = [];\n private model!: LayoutModel;\n /** Index of the slot (placeholder) inside `entries`/`boxes` at snapshot time. */\n private slotIdx = -1;\n /** For each visible \"other\" item: its index among ALL other items (hidden ones included). */\n private otherModelIndex: number[] = [];\n private frame: ScrollFrame;\n private applied = new Map<HTMLElement, Point>();\n private targetIdx = 0;\n private disposed = false;\n /** undefined = not created yet, null = this layout has no whitespace separators. */\n private spacer: Text | null | undefined;\n private readonly onOffsetChange?: (el: HTMLElement, offset: Point) => void;\n\n constructor(init: SortSessionInit) {\n this.spacer = init.spacer;\n this.onOffsetChange = init.onOffsetChange;\n this.container = init.container;\n this.placeholder = init.placeholder;\n this.itemElements = init.itemElements;\n this.animationMs = init.animationMs;\n this.fallbackAxis = init.fallbackAxis;\n this.fallbackRtl = init.fallbackRtl;\n\n this.snapshot();\n this.frame = new ScrollFrame(this.container, true);\n this.mode = this.model.axis === 'grid' ? 'flow' : 'transform';\n this.targetIdx = this.slotIdx;\n\n const transition = this.animationMs > 0 ? `transform ${this.animationMs}ms ${EASING}` : '';\n for (const e of this.entries) {\n e.el.style.willChange = 'transform';\n if (transition) e.el.style.transition = transition;\n }\n }\n\n /** Detected orientation (useful for tests/diagnostics). */\n get axis(): Axis {\n return this.model.axis;\n }\n\n /** Current insertion index among the *visible other* items. */\n get target(): number {\n return this.targetIdx;\n }\n\n /** Index at which the session started (the slot's original position). */\n get origin(): number {\n return this.slotIdx;\n }\n\n /** Insertion index among ALL other items of the list (what consumers see as `currentIndex`). */\n get modelIndex(): number {\n const idx = this.otherModelIndex;\n if (this.targetIdx < idx.length) return idx[this.targetIdx];\n return idx.length ? idx[idx.length - 1] + 1 : 0;\n }\n\n /** Where would the dragged item be inserted if released at `pointer`? Pure; no side effects. */\n resolve(pointer: Point): number {\n const d = this.frame.delta();\n return resolveInsertionIndex(\n this.model,\n this.boxes,\n this.slotIdx,\n { x: pointer.x + d.x, y: pointer.y + d.y },\n this.targetIdx,\n );\n }\n\n /** Visually place the slot at `index`. Idempotent. */\n apply(index: number): void {\n if (this.disposed || index === this.targetIdx) return;\n this.targetIdx = index;\n if (this.mode === 'transform') this.applyTransforms(index);\n else this.applyFlow(index);\n }\n\n /** Put everything back where it started (slot at its original index). */\n reset(): void {\n this.apply(this.slotIdx);\n }\n\n /** A scroll event happened somewhere: cached scroll deltas must be re-read once. */\n onScroll(): void {\n this.frame.invalidate();\n }\n\n /**\n * Re-baseline from the live layout (e.g. the window was resized mid-drag). Not called during\n * normal sorting, because re-measuring while items are displaced is exactly what would\n * re-introduce feedback into the decision.\n */\n refresh(): void {\n if (this.disposed) return;\n const target = this.targetIdx;\n this.clearDisplacement();\n this.snapshot();\n this.frame = new ScrollFrame(this.container, true);\n if (this.mode === 'transform') {\n this.targetIdx = this.slotIdx;\n this.apply(Math.min(target, this.boxes.length - 1));\n } else {\n this.targetIdx = this.slotIdx;\n }\n }\n\n /** Restore every inline style this session touched. Safe to call more than once. */\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n for (const e of this.entries) {\n e.el.style.transform = e.savedTransform;\n e.el.style.transition = e.savedTransition;\n e.el.style.willChange = e.savedWillChange;\n if (this.applied.has(e.el)) this.onOffsetChange?.(e.el, { x: 0, y: 0 });\n }\n this.applied.clear();\n this.spacer?.remove();\n }\n\n // ---------------------------------------------------------------------------------------\n // snapshot\n // ---------------------------------------------------------------------------------------\n\n private snapshot(): void {\n const previous = new Map(this.entries.map((e) => [e.el, e] as const));\n\n const entries: Entry[] = [];\n const boxes: Box[] = [];\n const otherModelIndex: number[] = [];\n let slot = -1;\n let allOthers = 0;\n\n for (const node of Array.from(this.container.children)) {\n if (!(node instanceof HTMLElement)) continue;\n const isSlot = node === this.placeholder;\n if (!isSlot && !this.itemElements.has(node)) continue;\n\n const modelIdx = isSlot ? -1 : allOthers++;\n const rect = node.getBoundingClientRect();\n const off = this.applied.get(node);\n const box = toBox(rect);\n if (off) {\n // Strip our own displacement so the snapshot always describes the *undisplaced* layout.\n box.left -= off.x;\n box.right -= off.x;\n box.top -= off.y;\n box.bottom -= off.y;\n }\n const hidden = !isSlot && rect.width === 0 && rect.height === 0;\n if (hidden) continue;\n\n if (isSlot) slot = entries.length;\n else otherModelIndex.push(modelIdx);\n\n const known = previous.get(node);\n entries.push(\n known ?? {\n el: node,\n isSlot,\n base: initialTransform(node),\n savedTransform: node.style.transform,\n savedTransition: node.style.transition,\n savedWillChange: node.style.willChange,\n },\n );\n boxes.push(box);\n }\n\n this.entries = entries;\n this.boxes = boxes;\n this.slotIdx = slot;\n this.otherModelIndex = otherModelIndex;\n this.model = analyzeLayout(boxes, this.fallbackAxis, this.fallbackRtl);\n }\n\n // ---------------------------------------------------------------------------------------\n // transform strategy (DOM stays untouched)\n // ---------------------------------------------------------------------------------------\n\n private applyTransforms(target: number): void {\n const offsets = computeAxisOffsets(this.model, this.boxes, this.slotIdx, target);\n const horizontal = this.model.axis === 'x';\n this.entries.forEach((e, i) => {\n const o = offsets[i];\n this.setOffset(e, horizontal ? { x: o, y: 0 } : { x: 0, y: o });\n });\n }\n\n private setOffset(e: Entry, off: Point): void {\n const prev = this.applied.get(e.el);\n if ((prev?.x ?? 0) === off.x && (prev?.y ?? 0) === off.y) return;\n if (off.x === 0 && off.y === 0) {\n this.applied.delete(e.el);\n e.el.style.transform = e.savedTransform;\n } else {\n this.applied.set(e.el, off);\n e.el.style.transform = `translate3d(${off.x}px, ${off.y}px, 0)${e.base}`;\n }\n this.onOffsetChange?.(e.el, off);\n }\n\n // ---------------------------------------------------------------------------------------\n // flow strategy (single placeholder move + FLIP transforms)\n // ---------------------------------------------------------------------------------------\n\n private applyFlow(target: number): void {\n const entries = this.entries;\n\n // 1. READ: where everything visually is right now (including in-flight animations).\n const first = entries.map((e) => e.el.getBoundingClientRect());\n\n // 2. WRITE: move the one placeholder node; drop any FLIP transforms.\n this.placeAt(target);\n for (const e of entries) {\n e.el.style.transition = 'none';\n e.el.style.transform = e.savedTransform;\n }\n\n // 3. READ: where everything is after the browser re-flowed the list.\n const last = entries.map((e) => e.el.getBoundingClientRect());\n\n // 4. WRITE: invert (put each item back where it was), then play (animate to its new home).\n const moved: Entry[] = [];\n entries.forEach((e, i) => {\n const dx = first[i].left - last[i].left;\n const dy = first[i].top - last[i].top;\n if (this.animationMs > 0 && (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5)) {\n e.el.style.transform = `translate3d(${dx}px, ${dy}px, 0)${e.base}`;\n moved.push(e);\n }\n });\n\n const transition = this.animationMs > 0 ? `transform ${this.animationMs}ms ${EASING}` : '';\n if (moved.length) void this.container.offsetWidth; // commit the inverted frame\n for (const e of entries) e.el.style.transition = transition || e.savedTransition;\n for (const e of moved) e.el.style.transform = e.savedTransform;\n }\n\n private placeAt(target: number): void {\n const container = this.container;\n if (this.spacer === undefined) this.spacer = makeSpacer(container);\n const spacer = this.spacer;\n spacer?.remove();\n\n const others = this.entries.filter((e) => !e.isSlot);\n const ref = others[target]?.el;\n if (ref) {\n // ... [placeholder][separator][ref]: the separator that used to sit before `ref` still\n // separates it from its previous sibling, the new one separates it from the placeholder.\n container.insertBefore(this.placeholder, ref);\n if (spacer) container.insertBefore(spacer, ref);\n return;\n }\n const last = others[others.length - 1]?.el;\n const after = last ? last.nextSibling : null;\n if (spacer) container.insertBefore(spacer, after);\n container.insertBefore(this.placeholder, after);\n }\n\n private clearDisplacement(): void {\n for (const e of this.entries) {\n e.el.style.transition = 'none';\n e.el.style.transform = e.savedTransform;\n if (this.applied.has(e.el)) this.onOffsetChange?.(e.el, { x: 0, y: 0 });\n }\n this.applied.clear();\n }\n}\n\nfunction initialTransform(el: HTMLElement): string {\n const t = getComputedStyle(el).transform;\n return t && t !== 'none' ? ` ${t}` : '';\n}\n","import { ResizeDirection } from '../contracts/IResizableOutput';\n\n/**\n * Logical directions that resolve differently depending on text direction.\n * 'n' and 's' never change - only the horizontal component is direction-aware.\n */\ntype LogicalDirectionKey = 'start' | 'end' | 'n-start' | 'n-end' | 's-start' | 's-end';\n\n/** Base (LTR) physical direction for every logical direction. */\nconst LTR_BASE: Record<LogicalDirectionKey, ResizeDirection> = {\n start: 'w',\n end: 'e',\n 'n-start': 'nw',\n 'n-end': 'ne',\n 's-start': 'sw',\n 's-end': 'se',\n};\n\n/** Mirrors the horizontal component of a physical direction. 'n' / 's' pass through unchanged. */\nconst MIRROR: Record<ResizeDirection, ResizeDirection> = {\n n: 'n',\n s: 's',\n e: 'w',\n w: 'e',\n ne: 'nw',\n nw: 'ne',\n se: 'sw',\n sw: 'se',\n};\n\nfunction isLogicalDirection(dir: string): dir is LogicalDirectionKey {\n return Object.prototype.hasOwnProperty.call(LTR_BASE, dir);\n}\n\n/**\n * True when `element` sits inside a right-to-left context.\n *\n * Reads the *computed* `direction` style instead of `element.dir`, because\n * `direction` is inherited and is almost never set on the resizable element\n * itself - it's usually set on `<html>`, `<body>`, or some ancestor wrapper.\n */\nexport function isRtl(element: HTMLElement): boolean {\n if (typeof window === 'undefined') {\n return false;\n }\n\n return window.getComputedStyle(element).direction === 'rtl';\n}\n\n/**\n * Resolves a logical direction ('start' | 'end' | 'n-start' | 'n-end' | 's-start' | 's-end')\n * to a physical, viewport-space direction ('n' | 'e' | 's' | 'w' | 'ne' | 'nw' | 'se' | 'sw')\n * based on `rtl`.\n *\n * Physical directions pass through untouched, so it's always safe to call this\n * even when `dir` might already be physical (e.g. resolving a direction that was\n * already resolved once before).\n */\nexport function resolveLogicalDirection(dir: string, rtl: boolean): ResizeDirection {\n if (!isLogicalDirection(dir)) {\n return dir as ResizeDirection;\n }\n\n const base = LTR_BASE[dir];\n\n return rtl ? MIRROR[base] : base;\n}\n","import { EventEmitter } from '@angular/core';\nimport { IDropEvent } from './contracts/IDropEvent';\nimport { IPosition } from './contracts/IPosition';\nimport { DragRef } from './drag-ref';\nimport { DropListGroupRef } from './drop-list-group-ref';\nimport { PlaceHolderRef } from './placeholder-ref';\nimport {\n Box,\n Point,\n analyzeLayout,\n boxContains,\n resolveInsertionIndex,\n toBox,\n} from './sorting/layout-geometry';\nimport { SortSession, makeSpacer } from './sorting/sort-session';\nimport { isRtl } from './utils/rtl';\nimport { ScrollFrame } from './utils/scroll-frame';\n\n/**\n * A drop list.\n *\n * Membership (`_draggables`) only ever reflects which draggables *belong* to this list in the\n * template. It is never changed by dragging. Everything that is transient during a drag lives\n * in a single `SortSession` (see sorting/sort-session.ts) that is created when a drag enters\n * the list and disposed when it leaves or the drag ends:\n *\n * - the list the drag started in keeps its session for the whole drag (its placeholder holds\n * the item's original slot, so leaving and re-entering is stable);\n * - any other list gets a fresh session on every entry and drops it on every exit.\n */\nexport class DropListRef<T = any> {\n data?: T;\n el!: HTMLElement;\n disableSort = false;\n connectedTo: HTMLElement[] = [];\n dropListGroup?: DropListGroupRef | null;\n /** Duration (ms) of the sibling slide animation. `0` disables animation. */\n sortAnimationDuration = 200;\n\n readonly _draggables = new Set<DragRef<T>>();\n readonly onDrop = new EventEmitter<IDropEvent<T>>();\n\n /**\n * Nesting: the nearest ENCLOSING drop list (null for a top-level list), and this list's own\n * direct nested lists — i.e. lists whose nearest enclosing list is this one, not a list at any\n * depth. Set by `NgxDropList` at init from a `skipSelf` DI lookup. Used for two things: (1)\n * `depth` for \"innermost wins\" in `DragRef`'s target resolution, without any DOM `.contains()`\n * calls on the hot path, and (2) cascading `_setAncestorOffset` (below) to every list nested\n * inside an item that gets displaced by sorting, at any depth.\n */\n parentList: DropListRef<any> | null = null;\n readonly childLists = new Set<DropListRef<any>>();\n\n private session: SortSession | null = null;\n private placeholder?: PlaceHolderRef;\n customPlaceholder?: PlaceHolderRef;\n private activeDrag: DragRef<T> | null = null;\n private isOrigin = false;\n private hovered = false;\n\n private hit: HitGeometry | null = null;\n /** Pre-insertion geometry of a foreign list, restored when the drag leaves it. */\n private naturalHit: HitGeometry | null = null;\n private hitCached = false;\n /**\n * Screen-space offset contributed by displaced ANCESTOR item(s) (see `parentList` above).\n * `{0,0}` outside of that (the overwhelmingly common case). Kept as a SUM of independent\n * per-source contributions, not a single overwritten value: while the pointer hovers a\n * FOREIGN (non-origin) list nested inside the origin's own displaced item, up to two ancestor\n * sessions can be displacing this list at once — the origin's (frozen, still active further\n * up) and that foreign list's own — and one clearing its contribution on release must not\n * wipe out the other's, still-active, contribution.\n */\n private readonly ancestorContributions = new Map<DropListRef<any>, Point>();\n private ancestorOffset: Point = { x: 0, y: 0 };\n /** Entries this list itself pushed via a one-time placeholder-insertion reflow (see below). */\n private readonly reflowContributions = new Map<HTMLElement, Point>();\n\n /** How many enclosing drop lists this one is nested inside. Root lists are depth 0. */\n get depth(): number {\n let d = 0;\n for (let p: DropListRef<any> | null = this.parentList; p; p = p.parentList) d++;\n return d;\n }\n\n _registerChild(child: DropListRef<any>): void {\n child.parentList = this;\n this.childLists.add(child);\n }\n\n _unregisterChild(child: DropListRef<any>): void {\n if (child.parentList === this) child.parentList = null;\n this.childLists.delete(child);\n }\n\n /**\n * One ancestor SESSION's contribution to this list's total displacement just changed (or\n * cleared, `{0,0}`). `source` identifies WHICH session — the list whose own item is doing the\n * displacing — so that this list's own recomputed total is a SUM across every currently-active\n * source, and cascades the SAME (source, offset) pair on to every nested list at any depth\n * unchanged, so a list several levels down stays hit-testable at its true on-screen position\n * regardless of which ancestor(s) are currently sorting.\n */\n _setAncestorOffset(source: DropListRef<any>, offset: Point): void {\n const prev = this.ancestorContributions.get(source);\n if (prev && prev.x === offset.x && prev.y === offset.y) return;\n if (offset.x === 0 && offset.y === 0) this.ancestorContributions.delete(source);\n else this.ancestorContributions.set(source, offset);\n\n let x = 0;\n let y = 0;\n for (const o of this.ancestorContributions.values()) {\n x += o.x;\n y += o.y;\n }\n if (x === this.ancestorOffset.x && y === this.ancestorOffset.y) return; // no net change\n this.ancestorOffset = { x, y };\n for (const child of this.childLists) child._setAncestorOffset(source, offset);\n }\n\n /** Which of this list's DIRECT nested lists live inside `el`, notified of its new offset. */\n private propagateOffset(el: HTMLElement, offset: Point): void {\n for (const child of this.childLists) {\n if (el.contains(child.el)) child._setAncestorOffset(this, offset);\n }\n }\n\n /** Rects, right now, of every `other` entry that contains one of this list's nested lists. */\n private trackedEntryRects(others: ReadonlySet<HTMLElement>): Map<HTMLElement, DOMRect> {\n const map = new Map<HTMLElement, DOMRect>();\n for (const child of this.childLists) {\n for (const el of others) {\n if (el.contains(child.el)) {\n if (!map.has(el)) map.set(el, el.getBoundingClientRect());\n break;\n }\n }\n }\n return map;\n }\n\n /** Turns the real reflow a fresh placeholder insertion just caused into ordinary offsets. */\n private propagateReflow(before: Map<HTMLElement, DOMRect>): void {\n for (const [el, prev] of before) {\n const now = el.getBoundingClientRect();\n const dx = now.left - prev.left;\n const dy = now.top - prev.top;\n if (dx || dy) {\n this.propagateOffset(el, { x: dx, y: dy });\n this.reflowContributions.set(el, { x: dx, y: dy });\n }\n }\n }\n\n addItem(item: DragRef<T>): void {\n this._draggables.add(item);\n }\n\n removeItem(item: DragRef<T>): void {\n this._draggables.delete(item);\n }\n\n isConnectedTo(other: DropListRef<any>): boolean {\n if (other === this) return true;\n if (this.connectedTo.includes(other.el) || other.connectedTo.includes(this.el)) return true;\n return !!this.dropListGroup && this.dropListGroup.has(other);\n }\n\n // ---------------------------------------------------------------------------------------\n // hit testing (cached for the duration of a drag)\n // ---------------------------------------------------------------------------------------\n\n /**\n * Measure the list and its clipping ancestors once, at drag start (or the moment a nested\n * list becomes a candidate mid-drag). `measureHit` reads live `getBoundingClientRect()`s,\n * which already include any `translate3d` an ancestor item's displacement has applied — so if\n * this list is currently offset (nested inside a sibling that sorting is displacing right\n * now), the measurement is normalized back to the zero-offset frame `_containsPoint` expects,\n * by subtracting that offset straight back out. Without this, entering a nested list while\n * its ancestor is mid-displacement would double-count the offset on every check afterwards.\n */\n _cacheGeometry(): void {\n const hit = measureHit(this.el);\n if (hit && (this.ancestorOffset.x || this.ancestorOffset.y)) {\n hit.box.left -= this.ancestorOffset.x;\n hit.box.right -= this.ancestorOffset.x;\n hit.box.top -= this.ancestorOffset.y;\n hit.box.bottom -= this.ancestorOffset.y;\n }\n this.hit = hit;\n this.hitCached = true;\n }\n\n /**\n * Is the point over the *visible* part of this list? Scroll-aware without re-measuring.\n *\n * The list box and every clipping ancestor are tracked separately because they react to scroll\n * differently: scrolling a container moves the list but not the container's own clip window.\n */\n _containsPoint(x: number, y: number): boolean {\n const hit = this.hitCached ? this.hit : measureHit(this.el);\n if (!hit) return false;\n // The list's own box shifts with any ancestor displacement; a clip window (a scroll/overflow\n // ancestor) normally does not, since it is not itself an item being sorted, so it is tested\n // against the raw pointer.\n const d0 = hit.frame.delta();\n if (!boxContains(hit.box, x - this.ancestorOffset.x + d0.x, y - this.ancestorOffset.y + d0.y))\n return false;\n for (const clip of hit.clips) {\n const d = clip.frame.delta();\n if (!boxContains(clip.box, x + d.x, y + d.y)) return false;\n }\n return true;\n }\n\n /** Approximate area, used to break ties between overlapping, unrelated lists. */\n _area(): number {\n const b = (this.hit ?? measureHit(this.el))?.box;\n return b ? (b.right - b.left) * (b.bottom - b.top) : 0;\n }\n\n _onScroll(): void {\n this.hit?.frame.invalidate();\n this.hit?.clips.forEach((c) => c.frame.invalidate());\n this.session?.onScroll();\n }\n\n /** Re-measure after a viewport resize. */\n _refresh(): void {\n if (this.hitCached) this._cacheGeometry();\n this.session?.refresh();\n }\n\n // ---------------------------------------------------------------------------------------\n // drag lifecycle\n // ---------------------------------------------------------------------------------------\n\n /** Backwards-compatible entry point: makes this list the drag's target. */\n createPlaceholder(drag: DragRef<T>): PlaceHolderRef {\n this.enter(drag, drag.pointer.x, drag.pointer.y);\n return drag.placeholder!;\n }\n\n /** The drag pointer entered this list (or the drag started inside it). */\n enter(drag: DragRef<T>, x = 0, y = 0): void {\n if (this.session && this.activeDrag === drag) {\n // Resuming a session that's still alive: either this is the origin list (its slot is\n // always kept), or the pointer dove into one of its own nested lists and came back up\n // (frozen rather than released in `exit()`, see there).\n this.hovered = true;\n this.el.classList.add('ngx-drop-list--active');\n drag.placeholder = this.placeholder;\n this.sortItem(drag, { x, y });\n return;\n }\n\n this.releaseSession(); // never keep stale state from a previous drag (geometry cache stays)\n this.begin(drag, { x, y });\n this.hovered = true;\n this.el.classList.add('ngx-drop-list--active');\n }\n\n /** Re-evaluate the insertion index for the pointer. Returns the new index, or null if unchanged. */\n sortItem(drag: DragRef<T>, position: IPosition): number | null {\n const s = this.session;\n if (!s || this.activeDrag !== drag || !this.hovered || this.disableSort) return null;\n\n const next = s.resolve(position);\n if (next === s.target) return null;\n s.apply(next);\n return s.modelIndex;\n }\n\n /** The pointer left this list. */\n /**\n * The pointer truly left this list (as opposed to moving deeper into one of its own nested\n * lists — see `DragRef`'s chain tracking, which never calls `exit()` for a list that remains\n * an ancestor of the new target, so this always means \"left this list's territory\").\n */\n exit(drag: DragRef<T>): void {\n if (!this.session || this.activeDrag !== drag) return;\n this.hovered = false;\n this.el.classList.remove('ngx-drop-list--active');\n\n if (this.isOrigin) {\n // Keep the original slot (the item logically still lives here) but stop displacing siblings.\n this.session.reset();\n } else {\n // A foreign list forgets the drag on exit; its geometry stays cached until the drag ends.\n this.releaseSession(drag);\n }\n }\n\n /**\n * The pointer dove into one of this list's own nested lists: this list is no longer the\n * innermost target, but it isn't being left either — its placeholder and sibling displacement\n * stay exactly as they are (avoids a snap-back-then-forward flicker), only the \"currently\n * hovered\" bookkeeping (and its visual highlight) is cleared. `DragRef`'s chain tracking calls\n * this instead of `exit()` for every list that remains an ancestor of the new target.\n */\n _freeze(): void {\n this.hovered = false;\n this.el.classList.remove('ngx-drop-list--active');\n }\n\n /**\n * Ends the drag for this list. Returns the drop event when the pointer was released over this\n * list, `null` otherwise (nothing to emit). All transient state is disposed either way.\n */\n _finish(drag: DragRef<T>, commit: boolean): IDropEvent<T> | null {\n const s = this.session;\n if (!s || this.activeDrag !== drag) return null;\n\n const event: IDropEvent<T> | null =\n commit && this.hovered\n ? {\n previousIndex: Math.max(0, drag.originIndex),\n currentIndex: s.modelIndex,\n item: drag,\n container: this,\n previousContainer: drag.originDropList ?? this,\n isPointerOverContainer: true,\n }\n : null;\n\n this.releaseSession(drag);\n return event;\n }\n\n /** Compatibility wrapper: finish + emit. */\n finishDrag(drag: DragRef<T>): void {\n const event = this._finish(drag, true);\n if (event) this.onDrop.emit(event);\n }\n\n resetSortTransforms(): void {\n this.session?.reset();\n }\n\n getFinalIndex(): number {\n return this.session ? this.session.modelIndex : 0;\n }\n\n getItemIndex(item: DragRef<T>): number {\n return this.indexOf(item);\n }\n\n /** End of the drag: dispose EVERYTHING this list holds, including cached geometry. Idempotent. */\n _release(drag?: DragRef<T>): void {\n if (drag && this.activeDrag && this.activeDrag !== drag) return;\n this.releaseSession(drag);\n this.hit = null;\n this.hitCached = false;\n // `ancestorOffset` is deliberately NOT reset here: `enter()` calls this unconditionally as a\n // safety-clear on every (re-)entry, including while a currently-active ancestor transform\n // still legitimately applies to this list. It self-corrects when that transform actually\n // reverts to zero, via the `onOffsetChange` cascade (see `_setAncestorOffset`), which also\n // covers the true end of a drag (the displaced list's own session disposes and reports\n // every entry back to `{0,0}`).\n }\n\n /** Dispose the sort session, placeholder and drag ownership. */\n private releaseSession(drag?: DragRef<T>): void {\n if (drag && this.activeDrag && this.activeDrag !== drag) return;\n\n this.session?.dispose();\n this.session = null;\n if (this.reflowContributions.size) {\n // The one-time reflow from this list's own placeholder insertion (see `propagateReflow`)\n // never went through the session's own `applied` map, so its `dispose()` above cannot\n // have cleared it — do that here instead, or it would linger as a stale contribution.\n for (const [el] of this.reflowContributions) this.propagateOffset(el, { x: 0, y: 0 });\n this.reflowContributions.clear();\n }\n\n this.placeholder?.detach();\n if (this.activeDrag && this.activeDrag.placeholder === this.placeholder) {\n this.activeDrag.placeholder = undefined;\n }\n this.placeholder = undefined;\n\n if (this.naturalHit) {\n this.hit = this.naturalHit;\n this.naturalHit = null;\n }\n\n this.activeDrag = null;\n this.isOrigin = false;\n this.hovered = false;\n this.el?.classList.remove('ngx-drop-list--active');\n }\n\n // ---------------------------------------------------------------------------------------\n // internals\n // ---------------------------------------------------------------------------------------\n\n private begin(drag: DragRef<T>, pointer: IPosition): void {\n const origin = drag.originDropList === this;\n const others = this.otherSlots(drag);\n const rtl = isRtl(this.el);\n const axis = fallbackAxis(this.el);\n\n const ph = this.customPlaceholder ?? new PlaceHolderRef();\n\n ph.dropList = this;\n let spacer: Text | null | undefined;\n\n if (origin) {\n // The placeholder takes over the exact slot of the (now hidden) source element.\n ph.attach(this.el, drag.el, drag.el);\n this.lockPlaceholderGeometry(drag, ph, drag.start);\n } else {\n ph.detach();\n // Only the \"other\" entries that contain a nested list are worth measuring (usually none,\n // or very few, even in a large tree): inserting the placeholder is a REAL DOM node, so it\n // shifts later siblings via ordinary CSS reflow, not `translate3d` — a one-time event this\n // list's own SortSession never reports through `onOffsetChange`, since (being sized and\n // positioned by `foreignInsertionReference` to already match where it belongs) it never\n // needs to actually transform anything afterwards. Measuring the small tracked set just\n // before and after the insertion turns that one-time reflow into an ordinary ancestor\n // contribution, exactly like any other displaced entry.\n const tracked = this.childLists.size ? this.trackedEntryRects(others) : null;\n const reference = this.foreignInsertionReference(others, pointer, axis, rtl);\n ph.attach(this.el, drag.el, reference);\n // Sized to its final footprint BEFORE measuring the reflow it causes: an unsized clone\n // (still near-zero height) wouldn't have pushed `others` at all yet.\n this.lockPlaceholderGeometry(drag, ph, drag.start);\n if (tracked) this.propagateReflow(tracked);\n spacer = makeSpacer(this.el);\n if (spacer) this.el.insertBefore(spacer, reference ?? ph.element!);\n }\n\n this.placeholder = ph;\n this.activeDrag = drag;\n this.isOrigin = origin;\n drag.placeholder = ph;\n\n this.session = new SortSession({\n container: this.el,\n placeholder: ph.element!,\n itemElements: others,\n fallbackAxis: axis,\n fallbackRtl: rtl,\n animationMs: this.sortAnimationDuration,\n spacer,\n onOffsetChange: this.childLists.size\n ? (el, offset) => this.propagateOffset(el, offset)\n : undefined,\n });\n\n if (!origin && this.hitCached) {\n // Inserting the placeholder made this list bigger; the grown box is what the user sees\n // (and must be able to reach, e.g. to append below the last item). The natural box comes\n // back on exit, so entering/leaving at the old edge cannot flicker.\n this.naturalHit = this.hit;\n this._cacheGeometry();\n }\n }\n\n /**\n * First placement into a list that does not contain the item yet: the node the placeholder\n * must be inserted before (null = append). Same pure resolver as sorting, no hysteresis.\n */\n private foreignInsertionReference(\n others: ReadonlySet<HTMLElement>,\n pointer: IPosition,\n axis: 'x' | 'y',\n rtl: boolean,\n ): Node | null {\n const els: HTMLElement[] = [];\n const boxes: Box[] = [];\n for (const node of Array.from(this.el.children)) {\n if (!(node instanceof HTMLElement) || !others.has(node)) continue;\n const r = node.getBoundingClientRect();\n if (r.width === 0 && r.height === 0) continue;\n els.push(node);\n boxes.push(toBox(r));\n }\n if (!els.length) return null;\n\n const index = this.disableSort\n ? els.length\n : resolveInsertionIndex(analyzeLayout(boxes, axis, rtl), boxes, -1, pointer, null);\n\n return index < els.length ? els[index] : els[els.length - 1].nextSibling;\n }\n\n private otherSlots(drag: DragRef<T>): Set<HTMLElement> {\n const set = new Set<HTMLElement>();\n for (const d of this._draggables) {\n if (d !== drag && d.el?.parentElement === this.el) set.add(d.el);\n }\n return set;\n }\n\n private indexOf(item: DragRef<T>): number {\n const byElement = new Map<HTMLElement, DragRef<T>>();\n for (const d of this._draggables) if (d.el) byElement.set(d.el, d);\n\n let index = 0;\n for (const node of Array.from(this.el.children)) {\n if (!(node instanceof HTMLElement)) continue;\n if (node === this.placeholder?.element) continue;\n if (node.classList.contains('ngx-drag-placeholder')) continue;\n if (node.classList.contains('ngx-drag-preview')) continue;\n const ref = byElement.get(node);\n if (!ref) continue;\n if (ref === item) return index;\n index++;\n }\n return -1;\n }\n\n private lockPlaceholderGeometry(drag: DragRef<T>, ph: PlaceHolderRef, rect: DOMRect): void {\n const placeholder = ph.element!;\n const set = (k: string, v: string) => placeholder.style.setProperty(k, v, 'important');\n\n placeholder.style.zIndex = '';\n placeholder.style.removeProperty('will-change');\n\n if (ph.custom) return;\n\n placeholder.style.display = drag.originalDisplay;\n\n // Occupies exactly the dragged item's footprint, so the gap reserved in the list — and the\n // sibling-displacement math derived from it — matches the item's real size.\n set('width', `${rect.width}px`);\n set('height', `${rect.height}px`);\n // set('min-width', `${rect.width}px`);\n // set('min-height', `${rect.height}px`);\n // set('max-width', `${rect.width}px`);\n // set('max-height', `${rect.height}px`);\n set('visibility', 'visible');\n set('opacity', '0.16');\n set('pointer-events', 'none');\n set('animation', 'none');\n set('box-sizing', 'border-box');\n }\n}\n\n/** Orientation to assume while a list has fewer than two items to measure. */\nfunction fallbackAxis(container: HTMLElement): 'x' | 'y' {\n const s = getComputedStyle(container);\n if (s.display.includes('flex')) return s.flexDirection.startsWith('column') ? 'y' : 'x';\n if (s.display.includes('grid')) return 'y';\n const child = container.firstElementChild;\n if (child && getComputedStyle(child).display.startsWith('inline')) return 'x';\n return 'y';\n}\n\ninterface HitGeometry {\n box: Box;\n frame: ScrollFrame;\n clips: { box: Box; frame: ScrollFrame }[];\n}\n\n/** Rect of the list plus one clip window per clipping (overflow != visible) ancestor. */\nfunction measureHit(el: HTMLElement): HitGeometry | null {\n const r = el.getBoundingClientRect();\n if (r.right <= r.left || r.bottom <= r.top) return null;\n\n const clips: HitGeometry['clips'] = [];\n const root = el.ownerDocument.documentElement;\n for (let node = el.parentElement; node && node !== root; node = node.parentElement) {\n const s = getComputedStyle(node);\n const cx = s.overflowX !== 'visible';\n const cy = s.overflowY !== 'visible';\n if (!cx && !cy) continue;\n const c = node.getBoundingClientRect();\n clips.push({\n box: {\n left: cx ? c.left : -Infinity,\n right: cx ? c.right : Infinity,\n top: cy ? c.top : -Infinity,\n bottom: cy ? c.bottom : Infinity,\n },\n // A clip window only moves when something ABOVE the clipping element scrolls.\n frame: new ScrollFrame(node, false),\n });\n }\n return { box: toBox(r), frame: new ScrollFrame(el, false), clips };\n}\n","import { DropListRef } from './drop-list-ref';\n\n/**\n * Groups multiple drop lists so items can be dragged between them without\n * needing an explicit `connectedTo` list on every single one.\n * Lists register themselves automatically when `NgxDropListGroup` wraps them.\n */\nexport class DropListGroupRef {\n readonly lists = new Set<DropListRef<any>>();\n\n add(list: DropListRef<any>): void {\n this.lists.add(list);\n }\n remove(list: DropListRef<any>): void {\n this.lists.delete(list);\n }\n has(list: DropListRef<any> | null | undefined): boolean {\n return !!list && this.lists.has(list);\n }\n}\n","import { Injectable, signal } from '@angular/core';\nimport { DragRef } from '../drag-ref';\nimport { DropListRef } from '../drop-list-ref';\nimport { DropListGroupRef } from '../drop-list-group-ref';\n\n@Injectable({ providedIn: 'root' })\nexport class DragDropService {\n readonly drags = signal<readonly DragRef[]>([]);\n readonly dropLists = signal<readonly DropListRef[]>([]);\n readonly activeDrag = signal<DragRef | null>(null);\n\n /**\n * DOM-position registries, used to find the nearest enclosing list/group by walking real\n * ancestor elements instead of Angular's element-injector tree.\n *\n * This matters for `ngTemplateOutlet`-based recursive trees (a list of items whose own\n * children are rendered by re-invoking the SAME `<ng-template>`, as in a tree/outliner UI):\n * each invocation gets a FRESH embedded view whose injector context is wherever the outlet\n * was written in the template, not wherever its content ends up in the DOM. So `inject(TOKEN,\n * {skipSelf})` from one recursion level can never see a provider from another level — the\n * only fix within Angular's own DI is to manually thread `ngTemplateOutletInjector` through\n * every recursive call, which isn't reasonable to require of every consumer of this library.\n * A plain DOM walk has no such limitation: it only cares where elements actually ended up.\n */\n private readonly listsByEl = new Map<HTMLElement, DropListRef>();\n private readonly groupsByEl = new Map<HTMLElement, DropListGroupRef>();\n\n registerDragItem(ref: DragRef<any>): void {\n this.drags.update((items) => (items.includes(ref) ? items : [...items, ref]));\n }\n\n removeDragItem(ref: DragRef<any>): void {\n this.drags.update((items) => items.filter((x) => x !== ref));\n if (this.activeDrag() === ref) this.activeDrag.set(null);\n }\n\n registerDropList(ref: DropListRef): void {\n this.dropLists.update((items) => (items.includes(ref) ? items : [...items, ref]));\n if (ref.el) this.listsByEl.set(ref.el, ref);\n }\n\n removeDropList(ref: DropListRef<any>): void {\n this.dropLists.update((items) => items.filter((x) => x !== ref));\n if (ref.el && this.listsByEl.get(ref.el) === ref) this.listsByEl.delete(ref.el);\n }\n\n registerGroup(el: HTMLElement, ref: DropListGroupRef): void {\n this.groupsByEl.set(el, ref);\n }\n\n removeGroup(el: HTMLElement): void {\n this.groupsByEl.delete(el);\n }\n\n /** Nearest registered drop list starting at (and including) `start`, walking up the DOM. */\n findAncestorDropList(start: HTMLElement | null): DropListRef | null {\n for (let n = start; n; n = n.parentElement) {\n const found = this.listsByEl.get(n);\n if (found) return found;\n }\n return null;\n }\n\n /** Nearest registered drop-list group starting at (and including) `start`, walking up the DOM. */\n findAncestorGroup(start: HTMLElement | null): DropListGroupRef | null {\n for (let n = start; n; n = n.parentElement) {\n const found = this.groupsByEl.get(n);\n if (found) return found;\n }\n return null;\n }\n\n begin(ref: DragRef<any>): void {\n this.activeDrag.set(ref);\n }\n\n end(ref: DragRef<any>): void {\n if (this.activeDrag() === ref) this.activeDrag.set(null);\n }\n\n cancelActive(): void {\n const ref = this.activeDrag();\n if (!ref) return;\n ref.cancelDrag();\n this.activeDrag.set(null);\n }\n\n /**\n * Which drop list is under `point`?\n *\n * - Only lists connected to the drag's ORIGIN list qualify (connectivity is not transitive, so\n * A→B→C never lets an item hop A→C). Without an origin (a free-drag element) nothing\n * qualifies: free dragging is never captured by a list.\n * - Only the visible (clip-aware) part of a list counts.\n * - A list inside the dragged element itself is never a target.\n * - Nested lists: the innermost qualifying list wins. Among unrelated overlapping lists the\n * current one is kept (no flicker), otherwise the smallest.\n */\n findDropList(\n point: { x: number; y: number },\n current?: DropListRef | null,\n origin?: DropListRef | null,\n dragEl?: HTMLElement | null,\n ): DropListRef | null {\n const source = origin ?? null;\n if (!source) return null;\n\n let best: DropListRef | null = null;\n for (const list of this.dropLists()) {\n if (!list.el || !source.isConnectedTo(list)) continue;\n if (dragEl && dragEl !== list.el && dragEl.contains(list.el)) continue;\n if (!list._containsPoint(point.x, point.y)) continue;\n\n if (!best) best = list;\n else if (best.el.contains(list.el)) best = list; // deeper wins\n else if (list.el.contains(best.el)) continue;\n else if (list === current) best = list;\n else if (best !== current && list._area() < best._area()) best = list;\n }\n return best;\n }\n}\n","/**\n * Auto-scrolls the nearest scrollable ancestor (or window) while the pointer\n * is dragged near the edge of the scrollable viewport. Direction-agnostic —\n * works the same in RTL and LTR since it operates on physical scroll deltas.\n */\nexport class AutoScroller {\n private raf = 0;\n private container: HTMLElement | Window = window;\n private speed = { x: 0, y: 0 };\n private onTick?: () => void;\n private readonly edge: number;\n private readonly maxSpeed: number;\n\n constructor(edge = 56, maxSpeed = 18) {\n this.edge = edge;\n this.maxSpeed = maxSpeed;\n }\n\n /** onTick اجرا میشود بعد از هر گام اسکرول، تا با آخرین موقعیت pointer، sort/placeholder بهروز شود. */\n start(fromEl: HTMLElement, onTick?: () => void): void {\n this.container = findScrollableAncestor(fromEl);\n this.onTick = onTick;\n }\n\n /** فقط container را عوض میکند بدون قطع حلقهی در حال اجرا یا صفر کردن speed. */\n retarget(fromEl: HTMLElement): void {\n this.container = findScrollableAncestor(fromEl);\n }\n\n update(clientX: number, clientY: number): void {\n const rect = getScrollRect(this.container);\n this.speed = {\n x: edgeSpeed(clientX, rect.left, rect.right, this.edge, this.maxSpeed),\n y: edgeSpeed(clientY, rect.top, rect.bottom, this.edge, this.maxSpeed),\n };\n if ((this.speed.x || this.speed.y) && !this.raf) {\n this.raf = requestAnimationFrame(this.tick);\n }\n }\n\n stop(): void {\n if (this.raf) cancelAnimationFrame(this.raf);\n this.raf = 0;\n this.speed = { x: 0, y: 0 };\n this.onTick = undefined;\n }\n\n private tick = (): void => {\n if (!this.speed.x && !this.speed.y) {\n this.raf = 0;\n return;\n }\n if (this.container instanceof Window) {\n this.container.scrollBy(this.speed.x, this.speed.y);\n } else {\n this.container.scrollLeft += this.speed.x;\n this.container.scrollTop += this.speed.y;\n }\n // pointer ثابت مونده ولی محتوای زیرش اسکرول شده — پس sort/placeholder را\n // دوباره با آخرین موقعیت شناختهشده اجرا کن.\n this.onTick?.();\n this.raf = requestAnimationFrame(this.tick);\n };\n}\nfunction edgeSpeed(pos: number, min: number, max: number, edge: number, maxSpeed: number): number {\n if (pos < min + edge) return -maxSpeed * (1 - Math.max(0, pos - min) / edge);\n if (pos > max - edge) return maxSpeed * (1 - Math.max(0, max - pos) / edge);\n return 0;\n}\n\nfunction getScrollRect(container: HTMLElement | Window): {\n left: number;\n right: number;\n top: number;\n bottom: number;\n} {\n if (container instanceof Window) {\n return { left: 0, top: 0, right: window.innerWidth, bottom: window.innerHeight };\n }\n return container.getBoundingClientRect();\n}\n\nexport function findScrollableAncestor(el: HTMLElement): HTMLElement | Window {\n let node: HTMLElement | null = el;\n while (node) {\n const style = getComputedStyle(node);\n const scrollable = /(auto|scroll|overlay)/.test(style.overflowY + style.overflowX);\n if (scrollable && node.scrollHeight > node.clientHeight) return node;\n node = node.parentElement;\n }\n return window;\n}\n\nexport function getScrollPosition(container: HTMLElement | Window): { left: number; top: number } {\n if (container instanceof Window) {\n return { left: window.scrollX, top: window.scrollY };\n }\n return { left: container.scrollLeft, top: container.scrollTop };\n}\n","import {\n Directive,\n ElementRef,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Renderer2,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { DragDropService } from '../services/drag-drop.service';\nimport { DragRef, DragAxis } from '../drag-ref';\nimport { IPosition } from '../contracts/IPosition';\nimport { AutoScroller, findScrollableAncestor, getScrollPosition } from '../utils/auto-scroll';\n\n/** Pointer events already claimed by an (inner) draggable. */\nconst claimedPointerEvents = new WeakSet<Event>();\n\nexport const NGX_DRAGGABLE = new InjectionToken<NgxDraggable>('ngx-draggable');\n\nconst DEFAULT_KEYBOARD_STEP = 8;\n\n@Directive({\n selector: '[NgxDraggable],[ngxDraggable]',\n providers: [{ provide: NGX_DRAGGABLE, useExisting: NgxDraggable }],\n host: {\n '[style.touch-action]': '\"none\"',\n '[attr.tabindex]': 'disabled() ? null : 0',\n '[attr.aria-grabbed]': 'dragging()',\n class: 'ngx-draggable',\n '[class.disable-drag]': 'disabled()',\n },\n})\nexport class NgxDraggable<T = unknown> implements OnInit, OnDestroy {\n readonly disabled = model<boolean>(false);\n /** Element whose rect constrains the drag. Now actually enforced. */\n readonly boundary = input<HTMLElement>();\n readonly dragRootElement = model<string>('');\n /** CSS selector for a drag handle. When set, only pointerdowns inside it start a drag. */\n readonly dragHandle = model<string>('');\n /** Restrict movement to a single axis. */\n readonly lockAxis = input<DragAxis>();\n /** Minimum pointer travel (px) before a drag starts, so clicks still register normally. */\n readonly dragThreshold = input<number>(3);\n /** Pixel step used when dragging via the keyboard (arrow keys, focus required). */\n readonly keyboardStep = input<number>(DEFAULT_KEYBOARD_STEP);\n /** Auto-scroll the nearest scrollable ancestor while dragging near its edge. */\n readonly autoScroll = input<boolean>(true);\n @Input('data') set data(v: T) {\n this._ref.data = v;\n }\n\n readonly dragStart = output<IPosition>();\n readonly dragMove = output<IPosition>();\n readonly dragEnd = output<IPosition>();\n\n readonly _ref = new DragRef<T>();\n readonly dragging = signal(false);\n\n private readonly doc = inject(DOCUMENT);\n private readonly service = inject(DragDropService);\n private readonly scroller = new AutoScroller();\n\n private down = false;\n private start = { x: 0, y: 0 };\n private pointerId = -1;\n private lastPointer: IPosition = { x: 0, y: 0 };\n private removeDown?: () => void;\n private removeMove?: () => void;\n private removeUp?: () => void;\n private removeKeydown?: () => void;\n private removeEscape?: () => void;\n private removeCancel?: () => void;\n private removeLostCapture?: () => void;\n private scrollTarget: HTMLElement | Window = window;\n private lastScroll = { left: 0, top: 0 };\n private lastWindowScroll = { left: 0, top: 0 };\n private removeContainerScroll?: () => void;\n private removeWindowScroll?: () => void;\n\n protected readonly renderer = inject(Renderer2);\n constructor(private readonly host: ElementRef<HTMLElement>) {\n effect(() => {\n this._ref.el = this.dragRootElement()\n ? (this.host.nativeElement.closest(this.dragRootElement()) ?? this.host.nativeElement)\n : this.host.nativeElement;\n });\n }\n\n ngOnInit(): void {\n this._ref.el = this.dragRootElement()\n ? (this.host.nativeElement.closest(this.dragRootElement()) ?? this.host.nativeElement)\n : this.host.nativeElement;\n this._ref.boundary = this.boundary();\n this._ref.lockAxis = this.lockAxis();\n // Found by walking the real DOM, not Angular's element-injector tree — see the matching\n // comment in `ngx-drop-list.directive.ts` for why: a draggable rendered by a recursively\n // invoked `ngTemplateOutlet` needs this just as much as a nested list does.\n const parentEl = this.host.nativeElement.parentElement;\n const list = this.service.findAncestorDropList(parentEl);\n this._ref.dropListGroup = list?.dropListGroup ?? this.service.findAncestorGroup(parentEl);\n this._ref.service = this.service;\n this._ref.init();\n this._ref.withDropList(list ?? null);\n this.service.registerDragItem(this._ref);\n this.removeDown = this.renderer.listen(\n this.host.nativeElement,\n 'pointerdown',\n (e: PointerEvent) => this.pointerDown(e),\n );\n this.removeKeydown = this.renderer.listen(\n this.host.nativeElement,\n 'keydown',\n (e: KeyboardEvent) => this.keyDown(e),\n );\n }\n\n ngOnDestroy(): void {\n this.removeDown?.();\n this.removeMove?.();\n this.removeUp?.();\n this.removeKeydown?.();\n this.removeEscape?.();\n this.removeCancel?.();\n this.removeLostCapture?.();\n this.scroller.stop();\n this.stopScrollTracking();\n // Destroyed mid-drag (e.g. the model changed underneath us): never leave a body clone behind.\n this._ref.dispose();\n this.service.removeDragItem(this._ref);\n this._ref.dropList?.removeItem(this._ref);\n }\n\n private pointerDown(e: PointerEvent): void {\n if (\n this.disabled() ||\n e.button !== 0 ||\n // this.isInteractive(e.target) ||\n !this.isOnHandle(e.target)\n )\n return;\n // Nested draggables: pointerdown bubbles, so without this an ancestor draggable would start\n // its own drag from the very same gesture. The innermost enabled draggable claims it.\n if (claimedPointerEvents.has(e)) return;\n claimedPointerEvents.add(e);\n e.preventDefault();\n this.down = true;\n this.pointerId = e.pointerId;\n this.start = { x: e.clientX, y: e.clientY };\n this._ref.boundary = this.boundary();\n this._ref.lockAxis = this.lockAxis();\n this._ref.pointerDown(this.start);\n this.removeMove = this.renderer.listen(this.doc, 'pointermove', (ev: PointerEvent) =>\n this.pointerMove(ev),\n );\n this.removeUp = this.renderer.listen(this.doc, 'pointerup', (ev: PointerEvent) =>\n this.pointerUp(ev),\n );\n this.removeEscape = this.renderer.listen(this.doc, 'keydown', (ev: KeyboardEvent) => {\n if (ev.key === 'Escape' && this.dragging()) this.cancel();\n });\n this.removeCancel = this.renderer.listen(this.doc, 'pointercancel', (ev: PointerEvent) =>\n this.pointerCancel(ev),\n );\n this.removeLostCapture = this.renderer.listen(\n this.doc,\n 'lostpointercapture',\n (ev: PointerEvent) => this.pointerCancel(ev),\n );\n }\n private applyDragUpdate(p: IPosition): void {\n const before = this._ref.activeDropList;\n // DragRef decides everything (preview, target list, placeholder). A free drag never\n // interacts with drop lists.\n this._ref.dragMove(p);\n\n if (this._ref.isListDrag && this.autoScroll()) {\n const after = this._ref.activeDropList;\n // Follow the hovered list; outside every list, scroll the page.\n if (after !== before) this.scroller.retarget(after?.el ?? this.doc.body);\n }\n this.dragMove.emit(p);\n }\n /** فراخوانی میشود دقیقاً وقتی drag واقعاً شروع میشود (چه با موس، چه با کیبورد). */\n private startScrollTracking(): void {\n this.scrollTarget = findScrollableAncestor(this._ref.el);\n this.lastScroll = getScrollPosition(this.scrollTarget);\n this.lastWindowScroll = { left: window.scrollX, top: window.scrollY };\n\n if (this.scrollTarget !== window) {\n this.removeContainerScroll = this.renderer.listen(this.scrollTarget, 'scroll', () =>\n this.handleContainerScroll(),\n );\n }\n // همیشه window رو هم جدا گوش میدیم؛ چون ممکنه container محلی نداشته باشیم\n // ولی خودِ صفحه اسکرول بشه.\n this.removeWindowScroll = this.renderer.listen('window', 'scroll', () =>\n this.handleWindowScroll(),\n );\n }\n\n private handleContainerScroll(): void {\n const pos = getScrollPosition(this.scrollTarget);\n const dx = pos.left - this.lastScroll.left;\n const dy = pos.top - this.lastScroll.top;\n this.lastScroll = pos;\n this._ref.notifyScroll(dx, dy);\n }\n\n private handleWindowScroll(): void {\n const left = window.scrollX;\n const top = window.scrollY;\n const dx = left - this.lastWindowScroll.left;\n const dy = top - this.lastWindowScroll.top;\n this.lastWindowScroll = { left, top };\n this._ref.notifyScroll(dx, dy);\n }\n\n private stopScrollTracking(): void {\n this.removeContainerScroll?.();\n this.removeWindowScroll?.();\n this.removeContainerScroll = this.removeWindowScroll = undefined;\n }\n\n private pointerMove(e: PointerEvent): void {\n if (!this.down || e.pointerId !== this.pointerId) return;\n const p = { x: e.clientX, y: e.clientY };\n this.lastPointer = p;\n if (\n !this.dragging() &&\n Math.hypot(p.x - this.start.x, p.y - this.start.y) < this.dragThreshold()\n )\n return;\n if (!this.dragging()) {\n this._ref.startDrag(p);\n this.dragging.set(true);\n this.service.begin(this._ref);\n this.startScrollTracking();\n if (this.autoScroll()) {\n this.scroller.start(this._ref.el, () => this.applyDragUpdate(this.lastPointer));\n }\n this.dragStart.emit(p);\n }\n\n this.applyDragUpdate(p);\n\n if (this.autoScroll()) this.scroller.update(p.x, p.y);\n }\n private pointerUp(e: PointerEvent): void {\n if (!this.down || e.pointerId !== this.pointerId) return;\n if (this.dragging()) {\n // Also when released OUTSIDE every list: endDrag() rolls the drag back and cleans up.\n if (this._ref.isListDrag) {\n // The release position is authoritative for the drop target (a fast flick may end with\n // a pointerup that has no preceding pointermove at that position).\n const p = { x: e.clientX, y: e.clientY };\n if (p.x !== this.lastPointer.x || p.y !== this.lastPointer.y) this._ref.dragMove(p);\n this._ref.endDrag();\n }\n this.service.end(this._ref);\n }\n this.finish();\n this.dragEnd.emit(this._ref.pointer);\n }\n\n /** Browser cancelled the pointer (touch takeover, lost capture...). */\n private pointerCancel(e: PointerEvent): void {\n if (!this.down || e.pointerId !== this.pointerId) return;\n if (this.dragging() && this._ref.isListDrag) {\n this.cancel();\n return;\n }\n this.pointerUp(e);\n }\n\n private cancel(): void {\n this._ref.cancelDrag();\n this.service.end(this._ref);\n this.finish();\n }\n\n private finish(): void {\n this.dragging.set(false);\n this.down = false;\n this.scroller.stop();\n this.stopScrollTracking();\n this.removeMove?.();\n this.removeUp?.();\n this.removeEscape?.();\n this.removeCancel?.();\n this.removeLostCapture?.();\n this.removeMove = this.removeUp = this.removeEscape = undefined;\n this.removeCancel = this.removeLostCapture = undefined;\n }\n\n /** Arrow-key movement for keyboard/assistive-tech users. Shift multiplies the step by 4. */\n private keyDown(e: KeyboardEvent): void {\n if (this.disabled()) return;\n const step = this.keyboardStep() * (e.shiftKey ? 4 : 1);\n const deltas: Record<string, IPosition> = {\n ArrowLeft: { x: -step, y: 0 },\n ArrowRight: { x: step, y: 0 },\n ArrowUp: { x: 0, y: -step },\n ArrowDown: { x: 0, y: step },\n };\n const delta = deltas[e.key];\n if (delta) {\n e.preventDefault();\n if (!this.dragging()) {\n // Free drag keeps its (0,0) pseudo pointer. A list item starts from its own centre so\n // that keyboard sorting resolves against real geometry.\n const inList = !!this._ref.dropList && this._ref.dropList.el === this._ref.el.parentElement;\n const r = this._ref.el.getBoundingClientRect();\n const origin = inList\n ? { x: r.left + r.width / 2, y: r.top + r.height / 2 }\n : { x: 0, y: 0 };\n this._ref.pointerDown(origin);\n this._ref.boundary = this.boundary();\n this._ref.lockAxis = this.lockAxis();\n this._ref.startDrag(origin);\n this.dragging.set(true);\n this.service.begin(this._ref);\n this.startScrollTracking();\n this.dragStart.emit(origin);\n }\n this._ref.nudge(delta.x, delta.y);\n this.dragMove.emit(this._ref.pointer);\n return;\n }\n if ((e.key === 'Enter' || e.key === ' ') && this.dragging()) {\n e.preventDefault();\n this._ref.endDrag();\n this.service.end(this._ref);\n this.dragEnd.emit(this._ref.pointer);\n this.dragging.set(false);\n this.stopScrollTracking();\n } else if (e.key === 'Escape' && this.dragging()) {\n e.preventDefault();\n this._ref.cancelDrag();\n this.service.end(this._ref);\n this.dragging.set(false);\n }\n }\n\n private isOnHandle(target: EventTarget | null): boolean {\n if (!this.dragHandle()) return true;\n return target instanceof HTMLElement && !!target.closest(this.dragHandle());\n }\n\n private isInteractive(target: EventTarget | null): boolean {\n return (\n target instanceof HTMLElement &&\n !!target.closest('button,a,input,textarea,select,[data-no-drag]')\n );\n }\n}\n","import { Directive, ElementRef, HostListener, input, model, output, signal } from '@angular/core';\nimport {\n IResizableOutput,\n LogicalResizeDirection,\n ResizeDirection,\n} from '../contracts/IResizableOutput';\nimport { clampResizeWithinBoundary } from '../utils/check-boundary';\nimport { isRtl, resolveLogicalDirection } from '../utils/rtl';\n\nconst ALL_DIRECTIONS: ResizeDirection[] = ['n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'];\nconst KEYBOARD_STEP = 8;\n\n@Directive({\n selector: '[NgxResizable],[ngxResizable]',\n host: {\n '[style.touch-action]': '\"none\"',\n class: 'ngx-resizable',\n },\n})\nexport class NgxResizable {\n disabled = model<boolean>(false);\n readonly minWidth = model<number>(20);\n readonly minHeight = model<number>(20);\n readonly maxWidth = model<number>(Infinity);\n readonly maxHeight = model<number>(Infinity);\n readonly directions = input<LogicalResizeDirection[]>([...ALL_DIRECTIONS]);\n readonly grid = input<number | { x: number; y: number }>();\n\n /** Element whose rect constrains the resize. Previously accepted nowhere on this directive. */\n readonly boundary = input<HTMLElement>();\n /** Pixel step used when resizing via the keyboard (arrow keys, focus required). */\n readonly keyboardStep = input<number>(KEYBOARD_STEP);\n\n readonly resizeStart = output<IResizableOutput>();\n readonly resizeMove = output<IResizableOutput>();\n readonly resizeEnd = output<IResizableOutput>();\n\n readonly resizing = signal(false);\n private direction: ResizeDirection = 'se';\n\n private start!: DOMRect;\n private pointer = {\n x: 0,\n y: 0,\n };\n private beforeTransition = '';\n private beforeWidth = '';\n private beforeHeight = '';\n private beforeTransform = '';\n private pointerId = -1;\n constructor(private readonly el: ElementRef<HTMLElement>) {}\n\n @HostListener('pointerdown', ['$event'])\n onPointerDown(e: PointerEvent): void {\n if (this.disabled() || e.button !== 0) {\n return;\n }\n\n const dir = this.hitDirection(e);\n\n if (!dir) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n\n const element = this.el.nativeElement;\n this.direction = dir;\n this.pointerId = e.pointerId;\n /**\n * This is the actual visual rectangle.\n * It already contains any transform created by DragRef.\n */\n this.start = element.getBoundingClientRect();\n\n this.pointer = {\n x: e.clientX,\n y: e.clientY,\n };\n\n this.beforeTransition = element.style.transition;\n\n /**\n * Keep DragRef's transform as the immutable base.\n *\n * Resize will temporarily add its own translation\n * on top of this transform.\n */\n this.beforeTransform = element.style.transform;\n\n this.resizing.set(true);\n element.style.transition = 'none';\n element.setPointerCapture?.(e.pointerId);\n const out = this.calculate(e);\n this.apply(out);\n this.resizeStart.emit(out);\n }\n\n @HostListener('document:pointermove', ['$event'])\n onPointerMove(e: PointerEvent): void {\n if (!this.resizing() || e.pointerId !== this.pointerId) {\n return;\n }\n const out = this.calculate(e);\n this.apply(out);\n this.resizeMove.emit(out);\n }\n\n @HostListener('document:pointerup', ['$event'])\n onPointerUp(e: PointerEvent): void {\n if (!this.resizing() || e.pointerId !== this.pointerId) {\n return;\n }\n const out = this.calculate(e);\n this.apply(out);\n this.resizeEnd.emit(out);\n this.finish();\n }\n\n @HostListener('document:keydown', ['$event'])\n onDocumentKeyDown(e: KeyboardEvent): void {\n if (!this.resizing()) {\n return;\n }\n if (e.key !== 'Escape') {\n return;\n }\n e.preventDefault();\n const element = this.el.nativeElement;\n element.style.width = this.beforeWidth;\n element.style.height = this.beforeHeight;\n element.style.transform = this.beforeTransform;\n this.finish();\n }\n\n @HostListener('keydown', ['$event'])\n onHandleKeyDown(e: KeyboardEvent): void {\n if (this.disabled()) {\n return;\n }\n\n const rtl = isRtl(this.el.nativeElement);\n const step = this.keyboardStep() * (e.shiftKey ? 4 : 1);\n let dw = 0;\n let dh = 0;\n if (e.key === 'ArrowRight') {\n dw = rtl ? -step : step;\n } else if (e.key === 'ArrowLeft') {\n dw = rtl ? step : -step;\n } else if (e.key === 'ArrowDown') {\n dh = step;\n } else if (e.key === 'ArrowUp') {\n dh = -step;\n } else {\n return;\n }\n\n e.preventDefault();\n const rect = this.el.nativeElement.getBoundingClientRect();\n const width = this.clampGrid(\n Math.max(this.minWidth(), Math.min(this.maxWidth(), rect.width + dw)),\n 'x',\n );\n const height = this.clampGrid(\n Math.max(this.minHeight(), Math.min(this.maxHeight(), rect.height + dh)),\n 'y',\n );\n this.el.nativeElement.style.width = `${width}px`;\n this.el.nativeElement.style.height = `${height}px`;\n const out: IResizableOutput = {\n width,\n height,\n moveLeft: 0,\n moveTop: 0,\n left: rect.left,\n top: rect.top,\n direction: 'se',\n };\n this.resizeMove.emit(out);\n this.resizeEnd.emit(out);\n }\n\n private calculate(e: PointerEvent): IResizableOutput {\n const dx = e.clientX - this.pointer.x;\n const dy = e.clientY - this.pointer.y;\n\n let width = this.start.width;\n let height = this.start.height;\n /**\n * East\n */\n if (this.direction.includes('e')) {\n width += dx;\n }\n\n /**\n * West\n */\n if (this.direction.includes('w')) {\n width -= dx;\n }\n\n /**\n * South\n */\n if (this.direction.includes('s')) {\n height += dy;\n }\n\n /**\n * North\n */\n if (this.direction.includes('n')) {\n height -= dy;\n }\n\n width = this.clampGrid(Math.max(this.minWidth(), Math.min(this.maxWidth(), width)), 'x');\n\n height = this.clampGrid(Math.max(this.minHeight(), Math.min(this.maxHeight(), height)), 'y');\n\n /**\n * Calculate the intended visual position.\n *\n * This is useful for boundary calculations and\n * emitted resize events.\n */\n let left = this.start.left;\n let top = this.start.top;\n\n if (this.direction.includes('w')) {\n left = this.start.right - width;\n }\n\n if (this.direction.includes('n')) {\n top = this.start.bottom - height;\n }\n\n let moveLeft = left - this.start.left;\n let moveTop = top - this.start.top;\n /**\n * Boundary constraint.\n */\n if (this.boundary) {\n const clamped = clampResizeWithinBoundary(\n this.boundary()?.getBoundingClientRect(),\n this.start,\n width,\n height,\n moveLeft,\n moveTop,\n );\n width = clamped.width;\n height = clamped.height;\n moveLeft = clamped.left;\n moveTop = clamped.top;\n left = this.start.left + moveLeft;\n top = this.start.top + moveTop;\n }\n\n return {\n width,\n height,\n moveLeft,\n moveTop,\n left,\n top,\n direction: this.direction,\n };\n }\n\n private apply(out: IResizableOutput): void {\n const element = this.el.nativeElement;\n /**\n * Always reset to the transform that existed before\n * this resize operation started.\n *\n * This prevents resize corrections from accumulating.\n */\n element.style.transform = this.beforeTransform;\n\n /**\n * Apply the actual size first.\n *\n * Changing width/height may cause the browser to re-layout\n * the element, especially for relative/flex/grid/static layouts.\n */\n element.style.width = `${out.width}px`;\n element.style.height = `${out.height}px`;\n\n /**\n * Force/read layout after changing the size.\n */\n const current = element.getBoundingClientRect();\n\n /**\n * These are the positions where the element MUST visually be.\n *\n * `out.moveLeft` / `out.moveTop` are calculated in `calculate()`\n * from the original visual rectangle.\n */\n const targetLeft = this.start.left + out.moveLeft;\n const targetTop = this.start.top + out.moveTop;\n\n /**\n * Browser's actual position after width/height changed.\n *\n * The difference between target and current position is the\n * correction that must be applied using transform.\n */\n const correctionX = targetLeft - current.left;\n const correctionY = targetTop - current.top;\n const hasCorrection = correctionX !== 0 || correctionY !== 0;\n if (!hasCorrection) {\n element.style.transform = this.beforeTransform;\n return;\n }\n /**\n * Preserve DragRef's existing transform and add only the\n * correction required by Resize.\n */\n const baseTransform =\n this.beforeTransform && this.beforeTransform !== 'none' ? `${this.beforeTransform} ` : '';\n element.style.transform =\n `${baseTransform}translate3d(` + `${correctionX}px, ` + `${correctionY}px, 0)`;\n }\n\n private clampGrid(value: number, axis: 'x' | 'y'): number {\n const grid = typeof this.grid() === 'number' ? this.grid : (this.grid() as any)?.[axis];\n if (!grid || grid <= 0) {\n return value;\n }\n return Math.round(value / grid) * grid;\n }\n\n private finish(): void {\n this.resizing.set(false);\n this.el.nativeElement.style.transition = this.beforeTransition;\n this.pointerId = -1;\n this.beforeTransform = '';\n }\n\n private resolvedDirections(): ResizeDirection[] {\n const rtl = isRtl(this.el.nativeElement);\n const set = new Set<ResizeDirection>();\n for (const direction of this.directions()) {\n set.add(resolveLogicalDirection(direction, rtl) as ResizeDirection);\n }\n return [...set];\n }\n\n private hitDirection(e: PointerEvent): ResizeDirection | null {\n const element = this.el.nativeElement;\n const rect = element.getBoundingClientRect();\n const edge = Math.min(12, Math.max(6, Math.min(rect.width, rect.height) * 0.18));\n const isLeft = e.clientX - rect.left <= edge;\n const isRight = rect.right - e.clientX <= edge;\n const isTop = e.clientY - rect.top <= edge;\n const isBottom = rect.bottom - e.clientY <= edge;\n /**\n * Explicit resize handle has priority.\n */\n const handle =\n e.target instanceof HTMLElement\n ? e.target.closest<HTMLElement>('[data-ngx-resize-handle]')\n : null;\n\n if (handle && element.contains(handle)) {\n const raw = handle.dataset['ngxResizeHandle'] as LogicalResizeDirection | undefined;\n\n if (!raw) {\n return null;\n }\n const resolved = resolveLogicalDirection(raw, isRtl(element)) as ResizeDirection;\n return this.resolvedDirections().includes(resolved) ? resolved : null;\n }\n\n /**\n * These are PHYSICAL screen directions.\n *\n * left -> w\n * right -> e\n *\n * RTL is handled only when a logical direction\n * such as \"start\" / \"end\" is requested.\n */\n const direction =\n isTop && isLeft\n ? 'nw'\n : isTop && isRight\n ? 'ne'\n : isBottom && isLeft\n ? 'sw'\n : isBottom && isRight\n ? 'se'\n : isTop\n ? 'n'\n : isRight\n ? 'e'\n : isBottom\n ? 's'\n : isLeft\n ? 'w'\n : null;\n\n if (!direction) {\n return null;\n }\n return this.resolvedDirections().includes(direction) ? direction : null;\n }\n}\n","import { ApplicationRef, Directive, InjectionToken, TemplateRef, inject } from '@angular/core';\nimport { PlaceHolderRef } from '../placeholder-ref';\nimport { NGX_DROPLIST } from './ngx-drop-list.directive';\n\nexport const NGX_PLACEHOLDER = new InjectionToken<PlaceHolderRef>('ngx-place-holder');\n\n@Directive({\n selector: '[NgxPlaceholder],[ngxPlaceholder]',\n providers: [{ provide: NGX_PLACEHOLDER, useExisting: NgxPlaceholder }],\n})\nexport class NgxPlaceholder {\n readonly _ref = new PlaceHolderRef();\n private readonly list = inject(NGX_DROPLIST, { optional: true, skipSelf: true });\n constructor(public readonly tpl: TemplateRef<unknown>) {\n this._ref.tpl = tpl;\n this._ref.dropList = this.list?._ref;\n // Lets the embedded view join Angular's change-detection tree (matters in zoneless apps,\n // and for app-stability tracking) instead of being rendered once and left dangling.\n this._ref.appRef = inject(ApplicationRef);\n }\n}\n","import {\n ContentChild,\n Directive,\n ElementRef,\n EventEmitter,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Output,\n inject,\n type AfterContentInit,\n} from '@angular/core';\nimport { DropListRef } from '../drop-list-ref';\nimport { DragDropService } from '../services/drag-drop.service';\nimport { IDropEvent } from '../contracts/IDropEvent';\nimport { NGX_PLACEHOLDER, NgxPlaceholder } from './ngx-place-holder.directive';\n\nexport const NGX_DROPLIST = new InjectionToken<NgxDropList>('ngx-drop-list');\n\n@Directive({\n selector: '[NgxDropList],[ngxDropList]',\n providers: [{ provide: NGX_DROPLIST, useExisting: NgxDropList }],\n host: { class: 'ngx-drop-list' },\n})\nexport class NgxDropList<T = any> implements OnInit, OnDestroy, AfterContentInit {\n readonly _ref = new DropListRef<T>();\n @Input('data') set data(value: T) {\n this._ref.data = value;\n }\n @Input() set connectedTo(value: HTMLElement[] | null | undefined) {\n this._ref.connectedTo = value ?? [];\n }\n @Input() set disableSort(value: boolean) {\n this._ref.disableSort = value === true;\n }\n @Output() readonly drop = new EventEmitter<IDropEvent<T>>();\n @ContentChild(NgxPlaceholder, {\n descendants: true,\n })\n private readonly customPlaceholder?: NgxPlaceholder;\n private sub?: { unsubscribe(): void };\n private readonly service = inject(DragDropService);\n\n constructor(private readonly el: ElementRef<HTMLElement>) {}\n\n ngOnInit(): void {\n this._ref.el = this.el.nativeElement;\n\n // Found by walking the real DOM (not Angular's element-injector tree): a list rendered by a\n // recursively-invoked `ngTemplateOutlet` (a tree/outliner UI, where every level re-uses the\n // SAME `<ng-template>`) gets a fresh injector context per invocation, so `inject(TOKEN,\n // {skipSelf})` can never see a provider from another recursion level — the DOM position is\n // what actually determines nesting/grouping for this library's purposes anyway.\n const parentEl = this.el.nativeElement.parentElement;\n const group = this.service.findAncestorGroup(parentEl);\n const parent = this.service.findAncestorDropList(parentEl);\n\n this._ref.dropListGroup = group ?? null;\n group?.add(this._ref);\n parent?._registerChild(this._ref);\n this.sub = this._ref.onDrop.subscribe((e) => this.drop.emit(e));\n this.service.registerDropList(this._ref);\n }\n ngAfterContentInit(): void {\n if (this.customPlaceholder) {\n this._ref.customPlaceholder = this.customPlaceholder._ref;\n }\n }\n\n ngOnDestroy(): void {\n this.sub?.unsubscribe();\n this._ref._release();\n this._ref.parentList?._unregisterChild(this._ref);\n this._ref.dropListGroup?.remove(this._ref);\n this.service.removeDropList(this._ref);\n }\n}\n","import { Directive, ElementRef, InjectionToken, OnDestroy, OnInit, inject } from '@angular/core';\nimport { DropListGroupRef } from '../drop-list-group-ref';\nimport { DragDropService } from '../services/drag-drop.service';\n\nexport const NGX_DROPLIST_GROUP = new InjectionToken<NgxDropListGroup>('ngx-drop-list-group');\n\n/** Wrap several `ngxDropList`s to let items move freely between them. */\n@Directive({\n selector: '[NgxDropListGroup],[ngxDropListGroup]',\n providers: [{ provide: NGX_DROPLIST_GROUP, useExisting: NgxDropListGroup }],\n})\nexport class NgxDropListGroup implements OnInit, OnDestroy {\n readonly _ref = new DropListGroupRef();\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly service = inject(DragDropService);\n\n ngOnInit(): void {\n // Registered by DOM element (not just provided via DI) so a list nested inside a recursive\n // `ngTemplateOutlet` tree can still find this group by walking its real ancestors — see the\n // comment on `DragDropService`'s registries for why DI alone can't do this.\n this.service.registerGroup(this.el.nativeElement, this._ref);\n }\n\n ngOnDestroy(): void {\n this._ref.lists.clear();\n this.service.removeGroup(this.el.nativeElement);\n }\n}\n","export function moveItemInArray<T>(array: T[], from: number, to: number): void {\n const f = clamp(from, array.length - 1);\n const t = clamp(to, array.length - 1);\n if (f === t) return;\n const target = array[f];\n const delta = t < f ? -1 : 1;\n for (let i = f; i !== t; i += delta) array[i] = array[i + delta];\n array[t] = target;\n}\n\nexport function transferArrayItem<T>(src: T[], dst: T[], from: number, to: number): void {\n const f = clamp(from, src.length - 1);\n const t = clamp(to, dst.length);\n if (src.length) dst.splice(t, 0, src.splice(f, 1)[0]);\n}\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @param currentArray Array from which to copy the item.\n * @param targetArray Array into which is copy the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n *\n */\nexport function copyArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n}\n\nfunction clamp(v: number, max: number) {\n return Math.max(0, Math.min(max, v));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;AAIG;AACH,MAAM,SAAS,GAAG,GAAG;AAErB;SACgB,WAAW,CACzB,QAAiB,EACjB,YAAiC,EACjC,OAAe,EAAA;AAEf,IAAA,IAAI,CAAC,YAAY;AAAE,QAAA,OAAO,OAAO;AACjC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,GAAG,OAAO;AACrC,IAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,GAAG,OAAO;AAC3C,IAAA,IAAI,MAAM,GAAG,YAAY,CAAC,GAAG,GAAG,SAAS;QAAE,OAAO,OAAO,IAAI,YAAY,CAAC,GAAG,GAAG,MAAM,CAAC;AACvF,IAAA,IAAI,SAAS,GAAG,YAAY,CAAC,MAAM,GAAG,SAAS;QAC7C,OAAO,OAAO,IAAI,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC;AACpD,IAAA,OAAO,OAAO;AAChB;AAEA;SACgB,WAAW,CACzB,QAAiB,EACjB,YAAiC,EACjC,OAAe,EAAA;AAEf,IAAA,IAAI,CAAC,YAAY;AAAE,QAAA,OAAO,OAAO;AACjC,IAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,GAAG,OAAO;AACvC,IAAA,MAAM,QAAQ,GAAG,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CAAC;IACvD;AACF;AAEA,SAAS,KAAK,CAAC,CAAS,EAAE,GAAW,EAAA;AACnC,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACtC;;ACvCA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-kit-drag-resize.mjs","sources":["../../../projects/libs/drag-resize/utils/check-boundary.ts","../../../projects/libs/drag-resize/utils/styling.ts","../../../projects/libs/drag-resize/utils/clone-drag-element-in-body.ts","../../../projects/libs/drag-resize/drag-ref.ts","../../../projects/libs/drag-resize/placeholder-ref.ts","../../../projects/libs/drag-resize/sorting/layout-geometry.ts","../../../projects/libs/drag-resize/utils/scroll-frame.ts","../../../projects/libs/drag-resize/sorting/sort-session.ts","../../../projects/libs/drag-resize/utils/rtl.ts","../../../projects/libs/drag-resize/drop-list-ref.ts","../../../projects/libs/drag-resize/drop-list-group-ref.ts","../../../projects/libs/drag-resize/services/drag-drop.service.ts","../../../projects/libs/drag-resize/utils/auto-scroll.ts","../../../projects/libs/drag-resize/directives/ngx-draggable.directive.ts","../../../projects/libs/drag-resize/directives/ngx-resizable.directive.ts","../../../projects/libs/drag-resize/directives/ngx-place-holder.directive.ts","../../../projects/libs/drag-resize/directives/ngx-drop-list.directive.ts","../../../projects/libs/drag-resize/directives/ngx-drop-list-group.directive.ts","../../../projects/libs/drag-resize/utils/drag-utils.ts","../../../projects/libs/drag-resize/ngx-kit-drag-resize.ts"],"sourcesContent":["/**\n * Boundary clamping utilities.\n * All functions work purely in viewport (\"client\") coordinates so they can be\n * reused identically for translate-based dragging and left/top-based resizing.\n */\nconst TOLERANCE = 0.5;\n\n/** Clamps a proposed vertical delta so the element's rect stays inside the boundary rect. */\nexport function checkBoundY(\n selfRect: DOMRect,\n boundaryRect: DOMRect | undefined,\n offsetY: number,\n): number {\n if (!boundaryRect) return offsetY;\n const newTop = selfRect.top + offsetY;\n const newBottom = selfRect.bottom + offsetY;\n if (newTop < boundaryRect.top + TOLERANCE) return offsetY + (boundaryRect.top - newTop);\n if (newBottom > boundaryRect.bottom - TOLERANCE)\n return offsetY - (newBottom - boundaryRect.bottom);\n return offsetY;\n}\n\n/** Clamps a proposed horizontal delta so the element's rect stays inside the boundary rect. */\nexport function checkBoundX(\n selfRect: DOMRect,\n boundaryRect: DOMRect | undefined,\n offsetX: number,\n): number {\n if (!boundaryRect) return offsetX;\n const newLeft = selfRect.left + offsetX;\n const newRight = selfRect.right + offsetX;\n if (newLeft < boundaryRect.left + TOLERANCE) return offsetX + (boundaryRect.left - newLeft);\n if (newRight > boundaryRect.right - TOLERANCE) return offsetX - (newRight - boundaryRect.right);\n return offsetX;\n}\n\n/**\n * Clamps a resize result (width/height/left/top, all relative CSS px deltas from the\n * element's start position) so the element never grows/moves outside `boundaryRect`.\n * `startRect` is the element's `getBoundingClientRect()` captured at resize-start.\n */\nexport function clampResizeWithinBoundary(\n boundaryRect: DOMRect | undefined,\n startRect: DOMRect,\n width: number,\n height: number,\n left: number,\n top: number,\n): { width: number; height: number; left: number; top: number } {\n if (!boundaryRect) return { width, height, left, top };\n\n // Viewport position implied by the proposed left/top deltas.\n const viewportLeft = startRect.left + left;\n const viewportTop = startRect.top + top;\n\n let clampedWidth = width;\n let clampedHeight = height;\n let clampedLeft = left;\n let clampedTop = top;\n\n if (viewportLeft < boundaryRect.left) {\n const overflow = boundaryRect.left - viewportLeft;\n clampedLeft = left + overflow;\n clampedWidth = Math.max(0, clampedWidth - overflow);\n }\n if (viewportTop < boundaryRect.top) {\n const overflow = boundaryRect.top - viewportTop;\n clampedTop = top + overflow;\n clampedHeight = Math.max(0, clampedHeight - overflow);\n }\n\n const clampedViewportLeft = startRect.left + clampedLeft;\n const rightEdge = clampedViewportLeft + clampedWidth;\n if (rightEdge > boundaryRect.right) {\n clampedWidth = Math.max(0, boundaryRect.right - clampedViewportLeft);\n }\n\n const clampedViewportTop = startRect.top + clampedTop;\n const bottomEdge = clampedViewportTop + clampedHeight;\n if (bottomEdge > boundaryRect.bottom) {\n clampedHeight = Math.max(0, boundaryRect.bottom - clampedViewportTop);\n }\n\n return { width: clampedWidth, height: clampedHeight, left: clampedLeft, top: clampedTop };\n}\n\n/** Current page zoom level (1 = 100%). Falls back to devicePixelRatio pre visualViewport. */\nexport function getPageZoom(): number {\n return window.visualViewport?.scale ?? window.devicePixelRatio ?? 1;\n}\n\n/** Adjusts a raw pointer-derived value for the current page zoom level. */\nexport function adjustForZoom(value: number): number {\n const zoom = getPageZoom();\n return zoom ? value / zoom : value;\n}\n","/**\n * Copy the browser-resolved visual state of an element.\n *\n * A drag preview is moved to <body>, so selectors depending on ancestors no\n * longer apply. Copying computed styles (including custom properties) makes\n * the preview visually independent from the original DOM subtree.\n */\nexport function copyComputedStyle(source: Element, target: Element): void {\n copyStyleValues(source, target);\n\n // Make the preview deterministic once it is taken out of normal flow (root only:\n // descendants keep their own margins so the internal layout is unchanged).\n (target as HTMLElement).style.setProperty('margin', '0', 'important');\n (target as HTMLElement).style.setProperty('box-sizing', 'border-box', 'important');\n}\n\nfunction copyStyleValues(source: Element, target: Element): void {\n const computed = window.getComputedStyle(source);\n\n for (let i = 0; i < computed.length; i++) {\n const property = computed.item(i);\n const value = computed.getPropertyValue(property);\n\n if (value) {\n (target as HTMLElement).style.setProperty(property, value, computed.getPropertyPriority(property));\n }\n }\n}\n\nexport function copyComputedStyleTree(source: Element, target: Element): void {\n copyComputedStyle(source, target);\n copyDescendants(source, target);\n}\n\nfunction copyDescendants(source: Element, target: Element): void {\n\n const sourceChildren = Array.from(source.children);\n const targetChildren = Array.from(target.children);\n\n const count = Math.min(sourceChildren.length, targetChildren.length);\n\n for (let i = 0; i < count; i++) {\n copyStyleValues(sourceChildren[i], targetChildren[i]);\n copyDescendants(sourceChildren[i], targetChildren[i]);\n }\n}\n\n/** Backward-compatible helper retained for consumers of older versions. */\nexport function copyEssentialStyles(source: HTMLElement, target: HTMLElement): void {\n copyComputedStyle(source, target);\n target.style.setProperty('box-sizing', 'border-box');\n}\n\nexport function combineTransforms(transform: string, initialTransform?: string): string {\n return initialTransform && initialTransform !== 'none'\n ? transform + ' ' + initialTransform\n : transform;\n}\n","import { copyComputedStyleTree } from './styling';\n\nexport interface DragPreviewState {\n element: HTMLElement;\n offsetX: number;\n offsetY: number;\n}\n\n/** Above any app chrome (modals, sticky headers) but below the browser's own UI. */\nconst PREVIEW_Z_INDEX = '2147483000';\n\n/**\n * Creates the visual that follows the pointer while an item of a drop list is dragged.\n *\n * It is appended to `<body>` with `position: fixed`, so no ancestor of the original item\n * (`overflow: hidden`, scroll containers, clipping, transformed/positioned parents) can clip\n * or offset it. Computed styles are copied recursively first, because once the clone leaves\n * its list every selector that depended on an ancestor (`.column .card {}`) and every\n * inherited property (font, colour, `direction`) would otherwise be lost.\n *\n * Only used for drop-list drags. Free drag never calls this.\n */\nexport function cloneDragElementInBody(\n dragEl: HTMLElement,\n rect: DOMRect,\n pointerX: number,\n pointerY: number,\n): DragPreviewState {\n const doc = dragEl.ownerDocument;\n const preview = dragEl.cloneNode(true) as HTMLElement;\n\n // Avoid duplicated ids in the document.\n preview.removeAttribute('id');\n preview.querySelectorAll('[id]').forEach((n) => n.removeAttribute('id'));\n preview.classList.add('ngx-drag-preview');\n preview.setAttribute('aria-hidden', 'true');\n preview.setAttribute('inert', '');\n\n copyComputedStyleTree(dragEl, preview);\n\n Object.assign(preview.style, {\n position: 'fixed',\n top: `${rect.top}px`,\n left: `${rect.left}px`,\n right: 'auto',\n bottom: 'auto',\n width: `${rect.width}px`,\n height: `${rect.height}px`,\n margin: '0',\n pointerEvents: 'none',\n boxSizing: 'border-box',\n transition: 'none',\n animation: 'none',\n transform: 'none',\n visibility: 'visible',\n display: preview.style.display === 'none' ? '' : preview.style.display,\n willChange: 'transform',\n zIndex: PREVIEW_Z_INDEX,\n });\n\n doc.body.appendChild(preview);\n\n return {\n element: preview,\n offsetX: pointerX - rect.left,\n offsetY: pointerY - rect.top,\n };\n}\n","import { signal } from '@angular/core';\nimport { IPosition } from './contracts/IPosition';\nimport { DropListRef } from './drop-list-ref';\nimport { PlaceHolderRef } from './placeholder-ref';\nimport { DropListGroupRef } from './drop-list-group-ref';\nimport { DragDropService } from './services/drag-drop.service';\nimport { checkBoundX, checkBoundY } from './utils/check-boundary';\nimport { cloneDragElementInBody } from './utils/clone-drag-element-in-body';\n\nexport type DragAxis = 'x' | 'y' | undefined;\n\nlet zIndexCounter = 1000;\n\nexport class DragRef<T = unknown> {\n data?: T;\n el!: HTMLElement;\n boundary?: HTMLElement;\n lockAxis?: DragAxis;\n\n /**\n * The list this draggable BELONGS to (set by the template). Dragging never changes it.\n * The list the pointer is currently over is `activeDropList`.\n */\n dropList: DropListRef<T> | null = null;\n dropListGroup?: DropListGroupRef | null;\n /** Used to find the drop list under the pointer. Set by the directive; optional. */\n service?: DragDropService;\n /** Drop list currently under the pointer during a drop-list drag (null = outside every list). */\n activeDropList: DropListRef<T> | null = null;\n\n placeholder?: PlaceHolderRef;\n originDropList: DropListRef<T> | null = null;\n originIndex = -1;\n\n readonly isDragging = signal(false);\n readonly position = signal<IPosition>({ x: 0, y: 0 });\n\n private startPointer = { x: 0, y: 0 };\n private startRect!: DOMRect;\n private lastPointer = { x: 0, y: 0 };\n\n private previousTransform = '';\n private previousZIndex = '';\n\n private moveDx = 0;\n private moveDy = 0;\n private scrollCompensation = { x: 0, y: 0 };\n private preview?: HTMLElement;\n private previewOffsetX = 0;\n private previewOffsetY = 0;\n private sourceVisibility = '';\n private sourceDisplay = '';\n private sourcePointerEvents = '';\n private sourceTransition = '';\n\n /** True while a drop-list drag (body preview + placeholder) is in progress. Free drag: always false. */\n private listDrag = false;\n private cachedLists: DropListRef<T>[] = [];\n /**\n * Candidate lists for hit-testing, filtered (connected to the origin; not inside the dragged\n * element) and sorted deepest-first — both computed ONCE, not on every pointer move, since\n * neither ever changes mid-drag. Kept in sync with the live registry (see `dropListsSnapshot`)\n * so a list that appears or disappears mid-drag (e.g. behind an `@if`) is still picked up.\n */\n private dropCandidates: { list: DropListRef<T>; depth: number }[] = [];\n private dropListsSnapshot: readonly DropListRef<any>[] | null = null;\n private lastEffective: IPosition = { x: 0, y: 0 };\n private scrollListener?: () => void;\n private resizeListener?: () => void;\n\n init(): void {\n this.previousTransform = getComputedStyle(this.el).getPropertyValue('transform');\n }\n\n withDropList(list: DropListRef<T> | null): this {\n if (this.dropList === list) return this;\n\n this.dropList?.removeItem(this);\n this.dropList = list;\n list?.addItem(this);\n return this;\n }\n\n clearDropList(): void {\n this.dropList?.removeItem(this);\n this.dropList = null;\n }\n\n pointerDown(pointer: IPosition): void {\n this.startPointer = { ...pointer };\n this.lastPointer = { ...pointer };\n }\n\n startDrag(pointer: IPosition): void {\n this.startRect = this.el.getBoundingClientRect();\n\n this.startPointer = { ...pointer };\n this.lastPointer = { ...pointer };\n this.moveDx = 0;\n this.moveDy = 0;\n this.scrollCompensation = { x: 0, y: 0 };\n\n // Only draggables that are direct children of their drop list take part in sorting.\n // Everything else is a plain free drag.\n const list = this.dropList && this.dropList.el === this.el.parentElement ? this.dropList : null;\n this.originDropList = list;\n this.originIndex = list?.getItemIndex(this) ?? -1;\n this.previousTransform = getComputedStyle(this.el).getPropertyValue('transform');\n\n this.isDragging.set(true);\n\n this.previousZIndex = this.el.style.zIndex;\n this.sourceVisibility = this.el.style.visibility;\n this.sourceDisplay = this.el.style.display;\n this.sourcePointerEvents = this.el.style.pointerEvents;\n this.sourceTransition = this.el.style.transition;\n\n this.el.classList.add('ngx-draggable--dragging');\n this.el.style.willChange = 'transform';\n this.el.style.transition = 'none';\n this.el.style.zIndex = String(++zIndexCounter);\n\n /*\n * IMPORTANT:\n *\n * Normal Drag:\n * absolutely nothing changes in the element's rendering mechanism.\n *\n * DropList Drag:\n * create a body-level preview because the original element can be\n * inside an overflow:auto/hidden container such as a Kanban column.\n */\n if (list) {\n this.listDrag = true;\n\n // Order matters: clone while the source is still visible and fully styled, hide it,\n // and only THEN measure (the placeholder takes over the source's slot).\n const preview = cloneDragElementInBody(this.el, this.startRect, pointer.x, pointer.y);\n\n this.preview = preview.element;\n this.previewOffsetX = preview.offsetX;\n this.previewOffsetY = preview.offsetY;\n\n this.el.style.visibility = 'hidden';\n this.el.style.display = 'none';\n this.el.style.pointerEvents = 'none';\n\n this.beginListDrag(list, pointer);\n this.updatePreview();\n } else {\n // KEEP THE ORIGINAL DRAG BEHAVIOR.\n this.applyTransform();\n }\n }\n\n dragMove(pointer: IPosition): void {\n if (!this.isDragging()) return;\n\n this.lastPointer = { ...pointer };\n\n let dx = pointer.x - this.startPointer.x;\n let dy = pointer.y - this.startPointer.y;\n\n if (this.boundary) {\n dx = checkBoundX(this.startRect, this.boundary.getBoundingClientRect(), dx);\n\n dy = checkBoundY(this.startRect, this.boundary.getBoundingClientRect(), dy);\n }\n\n if (this.lockAxis === 'x') dy = 0;\n if (this.lockAxis === 'y') dx = 0;\n\n this.moveDx = dx;\n this.moveDy = dy;\n\n this.position.set({\n x: dx,\n y: dy,\n });\n\n if (this.listDrag) {\n this.updatePreview();\n // Sorting follows the (axis/boundary constrained) pointer, not the raw one.\n this.lastEffective = { x: this.startPointer.x + dx, y: this.startPointer.y + dy };\n this.updateDropTarget(this.lastEffective);\n } else {\n this.applyTransform();\n }\n }\n\n nudge(dx: number, dy: number): void {\n if (!this.isDragging()) this.startDrag(this.lastPointer);\n\n this.dragMove({\n x: this.startPointer.x + this.moveDx + dx,\n y: this.startPointer.y + this.moveDy + dy,\n });\n }\n\n endDrag(): void {\n if (!this.isDragging()) return;\n\n if (this.listDrag) {\n this.isDragging.set(false);\n this.finishListDrag(true);\n return;\n }\n\n // ---- free drag: unchanged ----\n this.isDragging.set(false);\n\n this.placeholder?.detach();\n this.placeholder = undefined;\n\n this.preview?.remove();\n this.preview = undefined;\n\n this.el.classList.remove('ngx-draggable--dragging');\n\n this.el.style.visibility = this.sourceVisibility;\n this.el.style.display = this.sourceDisplay;\n this.el.style.pointerEvents = this.sourcePointerEvents;\n this.el.style.willChange = '';\n this.el.style.zIndex = this.previousZIndex;\n }\n\n cancelDrag(): void {\n if (!this.isDragging()) return;\n\n this.moveDx = 0;\n this.moveDy = 0;\n\n this.position.set({ x: 0, y: 0 });\n\n if (this.listDrag) {\n // Rollback: nothing was ever committed to the DOM or the model, so restoring is just cleanup.\n this.isDragging.set(false);\n this.finishListDrag(false);\n return;\n }\n\n // ---- free drag: unchanged ----\n this.el.style.transform = this.previousTransform;\n this.el.style.visibility = this.sourceVisibility;\n this.el.style.pointerEvents = this.sourcePointerEvents;\n this.scrollCompensation = { x: 0, y: 0 };\n\n this.endDrag();\n }\n\n /** Abort without emitting anything (the directive was destroyed mid-drag). Idempotent. */\n dispose(): void {\n if (!this.listDrag) return;\n this.isDragging.set(false);\n this.finishListDrag(false);\n }\n\n /** True while a drop-list drag is running. */\n get isListDrag(): boolean {\n return this.listDrag;\n }\n\n /** Inline `display` the source element had before it was hidden for the drag. */\n get originalDisplay(): string {\n return this.sourceDisplay;\n }\n\n get x(): number {\n return this.moveDx;\n }\n\n get y(): number {\n return this.moveDy;\n }\n\n get pointer(): IPosition {\n return this.lastPointer;\n }\n\n get start(): DOMRect {\n return this.startRect;\n }\n\n getPlaceholderElement(): HTMLElement | undefined {\n return this.placeholder?.element;\n }\n\n /**\n * صدا زده میشود هر بار که container یا window در حین درگ اسکرول شود\n * (چه توسط auto-scroll خودمان، چه با wheel/اسکرولبار دستی کاربر).\n * transform را فوراً تصحیح میکند تا عنصر زیر پوینتر بماند.\n */\n notifyScroll(dx: number, dy: number): void {\n if (!this.isDragging()) return;\n // Drop-list drags are position:fixed in <body> and follow the pointer in viewport space, so\n // scrolling needs no compensation; sorting listens to scroll on its own (see beginListDrag).\n if (this.listDrag) return;\n this.scrollCompensation = {\n x: this.scrollCompensation.x + dx,\n y: this.scrollCompensation.y + dy,\n };\n this.applyTransform();\n }\n\n private applyTransform(): void {\n const base =\n this.previousTransform && this.previousTransform !== 'none'\n ? this.previousTransform + ' '\n : '';\n\n const tx = this.moveDx + this.scrollCompensation.x;\n const ty = this.moveDy + this.scrollCompensation.y;\n\n this.el.style.transform = `${base}translate3d(${tx}px, ${ty}px, 0)`;\n }\n // -------------------------------------------------------------------------------------\n // drop-list drag\n // -------------------------------------------------------------------------------------\n\n private beginListDrag(origin: DropListRef<T>, pointer: IPosition): void {\n const doc = this.el.ownerDocument;\n const win = doc.defaultView ?? window;\n\n this.dropListsSnapshot = null; // force refreshDropCandidates() to do a full pass below\n this.refreshDropCandidates(origin);\n\n this.lastEffective = { ...pointer };\n this.activeDropList = origin;\n origin.enter(this, pointer.x, pointer.y);\n // The origin is (re-)measured AFTER its placeholder took over the source's slot, so its box\n // still covers the whole list (the hidden source no longer occupies space).\n origin._cacheGeometry();\n\n this.scrollListener = () => {\n for (const l of this.cachedLists) l._onScroll();\n this.updateDropTarget(this.lastEffective);\n };\n this.resizeListener = () => {\n for (const l of this.cachedLists) l._refresh();\n this.updateDropTarget(this.lastEffective);\n };\n // Capture: `scroll` does not bubble, and any ancestor (or the page) may be the one scrolling.\n doc.addEventListener('scroll', this.scrollListener, { capture: true, passive: true });\n win.addEventListener('resize', this.resizeListener, { passive: true });\n }\n\n /**\n * Recomputes which registered lists are valid targets for this drag — connected to the\n * origin, and not nested inside the element being dragged — plus each one's nesting depth.\n *\n * `DragDropService.dropLists()` is an Angular signal: its array is a NEW reference only when a\n * list actually registers or unregisters, so the check below is a single reference comparison\n * on every pointer move and the (heavier) connectivity/containment/depth work below it only\n * runs on the rare event a list appears or disappears mid-drag — never on every pointer move.\n */\n private refreshDropCandidates(origin: DropListRef<T>): void {\n const all = this.service?.dropLists() ?? [];\n if (all === this.dropListsSnapshot) return;\n this.dropListsSnapshot = all;\n\n const already = new Set(this.dropCandidates.map((c) => c.list));\n const next: { list: DropListRef<T>; depth: number }[] = [{ list: origin, depth: origin.depth }];\n for (const l of all as DropListRef<T>[]) {\n if (l === origin || !l.el || !origin.isConnectedTo(l)) continue;\n if (this.el !== l.el && this.el.contains(l.el)) continue;\n if (!already.has(l)) l._cacheGeometry(); // newly eligible mid-drag: measure it now\n next.push({ list: l, depth: l.depth });\n }\n this.dropCandidates = next;\n this.cachedLists = next.map((c) => c.list);\n }\n\n /**\n * Decide which list is under the pointer, switch if needed, then re-sort in the active one.\n *\n * The origin list is the one exception to \"exiting a list resets/releases it\": while the\n * pointer dives into one of the origin's OWN nested lists (at any depth), the origin's\n * placeholder and sibling displacement are left exactly as they are — frozen, not reset —\n * so returning to the origin's own level doesn't snap items back and then forward again.\n * Every OTHER (foreign) list still fully releases the moment the pointer leaves it, exactly\n * as before; nesting multiple foreign sessions alive at once would let their own internal\n * sibling displacement compound in ways a single flat `ancestorOffset` cannot represent.\n */\n private updateDropTarget(pointer: IPosition): void {\n const origin = this.originDropList;\n if (!origin) return;\n\n this.refreshDropCandidates(origin);\n const next = this.resolveDropList(pointer);\n if (next === this.activeDropList) {\n next?.sortItem(this, pointer);\n return;\n }\n\n const prev = this.activeDropList;\n if (prev && prev !== origin) prev.exit(this);\n\n const nextWithinOrigin = !!next && (next === origin || isDescendantOfList(next, origin));\n if (nextWithinOrigin) {\n if (prev === origin) origin._freeze(); // no longer the innermost, but stays engaged\n } else {\n origin.exit(this); // truly outside the origin's territory now: reset it (idempotent)\n }\n\n this.activeDropList = next;\n next?.enter(this, pointer.x, pointer.y); // fresh entry, or resumes a still-alive (frozen) session\n }\n\n /**\n * Innermost connected list under the pointer, from the precomputed candidates: deeper always\n * beats shallower; among lists at the same depth (unrelated, visually overlapping lists) the\n * currently active one is kept to avoid flicker, otherwise the smaller one wins. No DOM\n * reads and no `.contains()` calls happen here — everything needed was precomputed above.\n */\n private resolveDropList(pointer: IPosition): DropListRef<T> | null {\n let best: DropListRef<T> | null = null;\n let bestDepth = -1;\n for (const { list, depth } of this.dropCandidates) {\n if (!list._containsPoint(pointer.x, pointer.y)) continue;\n if (!best || depth > bestDepth) {\n best = list;\n bestDepth = depth;\n } else if (depth === bestDepth && best !== this.activeDropList) {\n if (list === this.activeDropList || list._area() < best._area()) best = list;\n }\n }\n return best;\n }\n\n /**\n * Single teardown path for every way a drop-list drag can end (drop on a list, drop outside,\n * Escape, pointercancel, destroy). Everything transient is removed here, so nothing can leak\n * regardless of how the drag ended. Only then is the drop event emitted.\n */\n private finishListDrag(commit: boolean): void {\n const doc = this.el.ownerDocument;\n if (this.scrollListener)\n doc.removeEventListener('scroll', this.scrollListener, { capture: true });\n if (this.resizeListener)\n (doc.defaultView ?? window).removeEventListener('resize', this.resizeListener);\n this.scrollListener = this.resizeListener = undefined;\n\n const target = commit ? this.activeDropList : null;\n const event = target?._finish(this, true) ?? null;\n for (const l of this.cachedLists) l._release(this);\n\n this.preview?.remove();\n this.preview = undefined;\n this.placeholder = undefined;\n this.activeDropList = null;\n this.cachedLists = [];\n this.dropCandidates = [];\n this.dropListsSnapshot = null;\n this.listDrag = false;\n\n // The source element is put back exactly as it was (its transform was never touched).\n this.el.classList.remove('ngx-draggable--dragging');\n this.el.style.visibility = this.sourceVisibility;\n this.el.style.display = this.sourceDisplay;\n this.el.style.pointerEvents = this.sourcePointerEvents;\n this.el.style.transition = this.sourceTransition;\n this.el.style.willChange = '';\n this.el.style.zIndex = this.previousZIndex;\n\n if (event && target) target.onDrop.emit(event);\n }\n\n private updatePreview(): void {\n if (!this.preview) return;\n\n this.preview.style.transform = `translate3d(${this.moveDx}px, ${this.moveDy}px, 0)`;\n }\n}\n\n/** Is `list` nested (at any depth) inside `ancestor`, per the parent/child list tree? */\nfunction isDescendantOfList(list: DropListRef<any>, ancestor: DropListRef<any>): boolean {\n for (let p: DropListRef<any> | null = list.parentList; p; p = p.parentList) {\n if (p === ancestor) return true;\n }\n return false;\n}\n","import { ApplicationRef, TemplateRef, type EmbeddedViewRef } from '@angular/core';\nimport { DropListRef } from './drop-list-ref';\n\nexport class PlaceHolderRef {\n /**\n * Custom placeholder content, from `*ngxPlaceholder` inside the `ngxDropList`. When unset,\n * `attach()` falls back to a shallow clone of the dragged element (previous behaviour).\n *\n * Example:\n *\n * <div ngxDropList>\n * <span class=\"my-placeholder\" *ngxPlaceholder></span>\n * ...\n * </div>\n */\n tpl?: TemplateRef<unknown>;\n /** Set by `NgxPlaceholder` so the embedded view can join Angular's change-detection tree. */\n appRef?: ApplicationRef;\n dropList?: DropListRef;\n element?: HTMLElement;\n\n private _visible = false;\n private _view?: EmbeddedViewRef<unknown>;\n /** True once `this.element` was built from `tpl` (as opposed to the fallback clone). */\n private isCustom = false;\n\n attach(container: HTMLElement, source: HTMLElement, reference?: Node | null): HTMLElement {\n if (!this.element) {\n if (this.tpl) {\n this._view = this.tpl.createEmbeddedView({});\n this.appRef?.attachView(this._view);\n // Render bindings inside the embedded view before we move its DOM nodes.\n this._view.detectChanges();\n\n const element = this._view.rootNodes.find(\n (node): node is HTMLElement => node instanceof HTMLElement,\n );\n\n if (!element) {\n this.appRef?.detachView(this._view);\n this._view.destroy();\n this._view = undefined;\n\n throw new Error(\n 'ngxPlaceholder template must contain exactly one HTMLElement root node ' +\n '(other root nodes, if any, are ignored).',\n );\n }\n\n this.element = element;\n this.isCustom = true;\n } else {\n // Fallback: keep the same tag/attributes as the dragged item so selectors such as\n // \".list > article\" and grid/flex item rules continue to apply.\n this.element = source.cloneNode(false) as HTMLElement;\n this.element.removeAttribute('id');\n this.element.classList.add('ngx-drag-placeholder');\n this.element.setAttribute('aria-hidden', 'true');\n this.element.setAttribute('inert', '');\n this.element.removeAttribute('tabindex');\n this.isCustom = false;\n }\n }\n\n // Safety overrides that apply regardless of who authored the element: it must never\n // inherit a live drag transform/animation (transform/transition are left free for the\n // sort session to drive, translate3d-ing the placeholder to the current insertion slot),\n // never intercept pointer events, and never be display:none.\n this.element.style.removeProperty('transform');\n this.element.style.removeProperty('transition');\n this.element.style.removeProperty('will-change');\n this.element.style.setProperty('animation', 'none', 'important');\n this.element.style.setProperty('pointer-events', 'none', 'important');\n this.element.style.setProperty('visibility', 'visible', 'important');\n\n if (!this.isCustom) {\n // Only the auto-generated clone gets the default \"phantom box\" look. A custom\n // *ngxPlaceholder template is styled entirely by the caller.\n this.element.style.setProperty('opacity', '0.16', 'important');\n this.element.style.setProperty('outline', '2px dashed currentColor', 'important');\n this.element.style.setProperty('outline-offset', '-2px', 'important');\n }\n\n this._visible = true;\n\n if (reference && reference.parentNode === container) {\n if (this.element !== reference) container.insertBefore(this.element, reference);\n } else if (this.element.parentNode !== container) {\n container.appendChild(this.element);\n }\n\n return this.element;\n }\n\n /** True while the currently attached element came from a custom `*ngxPlaceholder` template. */\n get custom(): boolean {\n return this.isCustom;\n }\n\n detach(): void {\n this.element?.remove();\n\n if (this._view) {\n this.appRef?.detachView(this._view);\n this._view.destroy();\n this._view = undefined;\n }\n\n this.element = undefined;\n this._visible = false;\n }\n\n get visible(): boolean {\n return this._visible && !!this.element?.isConnected;\n }\n}\n","/**\n * Pure geometry used by the drop-list sorting engine.\n *\n * Nothing in this file touches the DOM. Everything is a deterministic function of\n * `(rectangles, pointer)`, which is what makes sorting reversible: the same pointer over the\n * same snapshot always yields the same insertion index, regardless of what the previous\n * pointer positions were.\n *\n * Layout direction is *derived from the rectangles* (row clustering + the order in which DOM\n * siblings actually appear on screen) rather than from `flex-direction` / `direction`. That is\n * what lets one algorithm handle block flow, inline flow, flex (row/column/wrap/reverse),\n * grid, RTL and `order:`-reshuffled layouts. Computed style is only a fallback for lists that\n * are too small (0 or 1 item) to reveal their own orientation.\n */\n\nexport interface Box {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\nexport interface Point {\n x: number;\n y: number;\n}\n\n/** `x` = one row, `y` = one column, `grid` = several rows containing several items. */\nexport type Axis = 'x' | 'y' | 'grid';\nexport type Sign = 1 | -1;\n\nexport interface LayoutModel {\n axis: Axis;\n /** +1: DOM order advances left→right inside a row. -1: right→left (RTL, row-reverse...). */\n dirX: Sign;\n /** +1: rows/items advance top→bottom in DOM order. -1: bottom→top (column-reverse, wrap-reverse). */\n dirY: Sign;\n /** Row index (in DOM order) of every box. */\n rowOf: number[];\n /** Horizontal direction of every row (a single row can differ from the global one). */\n rowDirX: Sign[];\n /** Mid-lines separating consecutive rows, in DOM row order. Length = rowCount - 1. */\n rowBounds: number[];\n /** Outer edges of the first / last row along the row direction (see `dirY`). */\n yStart: number;\n yEnd: number;\n rowCount: number;\n}\n\n/**\n * Hysteresis is the only \"magic\" number in the algorithm and it is deliberate: without it a\n * pointer resting exactly on a sibling's mid-line flips the placeholder on every sub-pixel\n * jitter (and on every rounding difference between two layouts). It is proportional to the\n * sibling's size and capped, so it can never make a small item feel sticky.\n */\nexport const HYSTERESIS_RATIO = 0.1;\nexport const HYSTERESIS_MAX_PX = 6;\n\nexport function hysteresis(size: number): number {\n return Math.min(HYSTERESIS_MAX_PX, Math.max(0, size) * HYSTERESIS_RATIO);\n}\n\nconst cx = (b: Box) => (b.left + b.right) / 2;\nconst cy = (b: Box) => (b.top + b.bottom) / 2;\nconst width = (b: Box) => b.right - b.left;\nconst height = (b: Box) => b.bottom - b.top;\nconst sign = (n: number): Sign => (n < 0 ? -1 : 1);\n\ninterface RowAcc {\n top: number;\n bottom: number;\n first: number;\n last: number;\n count: number;\n}\n\n/**\n * Builds a layout model from DOM-ordered boxes.\n *\n * @param fallbackAxis orientation to assume when there are fewer than two boxes.\n * @param fallbackRtl inline direction to assume when no row contains two items.\n */\nexport function analyzeLayout(\n boxes: readonly Box[],\n fallbackAxis: 'x' | 'y' = 'y',\n fallbackRtl = false,\n): LayoutModel {\n const rows: RowAcc[] = [];\n const rowOf: number[] = [];\n\n boxes.forEach((b, i) => {\n const row = rows[rows.length - 1];\n if (row) {\n const overlap = Math.min(b.bottom, row.bottom) - Math.max(b.top, row.top);\n const smaller = Math.min(height(b), row.bottom - row.top);\n // Same row when the boxes share at least half of the smaller one's height. Touching or\n // sub-pixel-overlapping boxes (fractional heights) therefore start a new row.\n if (overlap > 0 && overlap >= smaller * 0.5) {\n row.top = Math.min(row.top, b.top);\n row.bottom = Math.max(row.bottom, b.bottom);\n row.last = i;\n row.count++;\n rowOf.push(rows.length - 1);\n return;\n }\n }\n rows.push({ top: b.top, bottom: b.bottom, first: i, last: i, count: 1 });\n rowOf.push(rows.length - 1);\n });\n\n const rowCount = rows.length;\n\n // Vertical direction: which way do successive rows travel?\n const dirY: Sign =\n rowCount > 1\n ? sign((rows[rowCount - 1].top + rows[rowCount - 1].bottom) / 2 - (rows[0].top + rows[0].bottom) / 2)\n : 1;\n\n // Horizontal direction per row (from the first/last item of that row) + a global vote.\n const rowDirX: Sign[] = [];\n let votes = 0;\n for (const r of rows) {\n if (r.count > 1) {\n const d = sign(cx(boxes[r.last]) - cx(boxes[r.first]));\n rowDirX.push(d);\n votes += d;\n } else {\n rowDirX.push(0 as unknown as Sign); // resolved below once the global vote is known\n }\n }\n const dirX: Sign = votes !== 0 ? sign(votes) : fallbackRtl ? -1 : 1;\n for (let i = 0; i < rowDirX.length; i++) if (!rowDirX[i]) rowDirX[i] = dirX;\n\n const rowBounds: number[] = [];\n for (let r = 0; r < rowCount - 1; r++) {\n rowBounds.push(dirY === 1 ? (rows[r].bottom + rows[r + 1].top) / 2 : (rows[r].top + rows[r + 1].bottom) / 2);\n }\n\n const first = rows[0];\n const lastRow = rows[rowCount - 1];\n const yStart = first ? (dirY === 1 ? first.top : first.bottom) : 0;\n const yEnd = lastRow ? (dirY === 1 ? lastRow.bottom : lastRow.top) : 0;\n\n let axis: Axis;\n if (boxes.length < 2) axis = fallbackAxis;\n else if (rowCount === 1) axis = 'x';\n else if (rows.every((r) => r.count === 1)) axis = 'y';\n else axis = 'grid';\n\n return { axis, dirX, dirY, rowOf, rowDirX, rowBounds, yStart, yEnd, rowCount };\n}\n\nfunction rowAt(model: LayoutModel, y: number): number {\n let r = 0;\n for (const bound of model.rowBounds) {\n if (model.dirY === 1 ? y > bound : y < bound) r++;\n else break;\n }\n return r;\n}\n\n/**\n * Where should the dragged item be inserted, given the pointer?\n *\n * The result is the number of *other* items that end up before the dragged one, i.e. the\n * dragged item's final index. `slot` is the index (in `boxes`) of the dragged item's own slot\n * (its placeholder), or -1 when the list does not contain one yet.\n *\n * `current` is the index the slot currently has in \"others space\"; it only decides on which\n * side of a sibling's mid-line the small hysteresis band applies. Pass `null` for a first\n * placement (no history, no hysteresis).\n *\n * Pure: depends only on its arguments.\n */\nexport function resolveInsertionIndex(\n model: LayoutModel,\n boxes: readonly Box[],\n slot: number,\n pointer: Point,\n current: number | null,\n): number {\n let before = 0;\n let others = 0;\n\n for (let i = 0; i < boxes.length; i++) {\n if (i === slot) continue;\n const o = others++;\n const b = boxes[i];\n // Sign of the hysteresis band: +1 favours \"stays before the pointer\", -1 favours \"stays after\".\n const bias = current === null ? 0 : o < current ? 1 : -1;\n\n let isBefore: boolean;\n if (model.axis === 'x') {\n isBefore = model.dirX * (pointer.x - cx(b)) + bias * hysteresis(width(b)) > 0;\n } else if (model.axis === 'y') {\n isBefore = model.dirY * (pointer.y - cy(b)) + bias * hysteresis(height(b)) > 0;\n } else {\n const row = model.rowOf[i];\n const py = pointer.y + model.dirY * bias * hysteresis(height(b));\n const pointerRow = rowAt(model, py);\n if (model.dirY * (py - model.yStart) < 0) {\n isBefore = false; // above the first row: nothing precedes the pointer\n } else if (model.dirY * (py - model.yEnd) > 0) {\n isBefore = true; // below the last row: everything does (append)\n } else if (pointerRow !== row) {\n isBefore = pointerRow > row;\n } else {\n isBefore = model.rowDirX[row] * (pointer.x - cx(b)) + bias * hysteresis(width(b)) > 0;\n }\n }\n if (isBefore) before++;\n }\n return before;\n}\n\n/**\n * Along-axis displacement of every box when the slot moves to `target` (others-space index).\n *\n * The result is where each box has to be translated so that the boxes, re-ordered, occupy the\n * same run of space they occupied before, using each box's own size and the *measured* gaps\n * between the original slots (so `gap`, margins and inline whitespace are handled by\n * construction, not by assumption). Only meaningful for `x` / `y` axes; `grid` returns zeros.\n */\nexport function computeAxisOffsets(model: LayoutModel, boxes: readonly Box[], slot: number, target: number): number[] {\n const n = boxes.length;\n const offsets = new Array<number>(n).fill(0);\n if (model.axis === 'grid' || n < 2 || slot < 0) return offsets;\n\n const horizontal = model.axis === 'x';\n const dir = horizontal ? model.dirX : model.dirY;\n\n // Mirror into a frame where DOM order is ascending, so one code path serves LTR and RTL.\n const lo = boxes.map((b) => (horizontal ? (dir === 1 ? b.left : -b.right) : dir === 1 ? b.top : -b.bottom));\n const hi = boxes.map((b) => (horizontal ? (dir === 1 ? b.right : -b.left) : dir === 1 ? b.bottom : -b.top));\n\n const order: number[] = [];\n for (let i = 0; i < n; i++) if (i !== slot) order.push(i);\n order.splice(Math.max(0, Math.min(target, n - 1)), 0, slot);\n\n let cursor = lo[0];\n for (let p = 0; p < n; p++) {\n const item = order[p];\n const delta = cursor - lo[item];\n offsets[item] = Math.abs(delta) < 1e-6 ? 0 : dir * delta;\n cursor += hi[item] - lo[item] + (p < n - 1 ? lo[p + 1] - hi[p] : 0);\n }\n return offsets;\n}\n\n/** Intersection of two boxes, or `null` when they do not overlap. */\nexport function intersectBoxes(a: Box, b: Box): Box | null {\n const left = Math.max(a.left, b.left);\n const top = Math.max(a.top, b.top);\n const right = Math.min(a.right, b.right);\n const bottom = Math.min(a.bottom, b.bottom);\n return right > left && bottom > top ? { left, top, right, bottom } : null;\n}\n\nexport function boxContains(b: Box, x: number, y: number): boolean {\n return x >= b.left && x <= b.right && y >= b.top && y <= b.bottom;\n}\n\nexport function toBox(r: { left: number; top: number; right: number; bottom: number }): Box {\n return { left: r.left, top: r.top, right: r.right, bottom: r.bottom };\n}\n","/**\n * Tracks how far the scrollable ancestors of an element (and the window) have scrolled since\n * the frame was created.\n *\n * Geometry is measured once, when a drag enters a list. Scrolling afterwards moves the\n * content under a stationary pointer, which is equivalent to moving the pointer by the scroll\n * delta in the frame the geometry was measured in. Shifting the *pointer* (one point) instead\n * of re-measuring every item keeps cached rectangles valid across page scroll, parent scroll\n * and nested scroll without any layout reads on the hot path.\n *\n * `delta()` only reads `scrollLeft/Top` after `invalidate()` (called from a scroll event), so\n * ordinary pointer moves perform zero scroll reads.\n */\nexport class ScrollFrame {\n private readonly targets: Array<HTMLElement | Window> = [];\n private origin: Point = { x: 0, y: 0 };\n private cached: Point = { x: 0, y: 0 };\n private dirty = false;\n\n /**\n * @param start first element to inspect (walks up through its ancestors)\n * @param includeStart whether `start` itself counts (true for a list whose own scroll moves its items)\n */\n constructor(\n start: HTMLElement | null,\n includeStart = true,\n private readonly win: Window = window,\n ) {\n let node: HTMLElement | null = includeStart ? start : (start?.parentElement ?? null);\n const root = start?.ownerDocument.documentElement;\n while (node) {\n // <html> scrolling is reported through `window`; counting both would double the delta.\n if (node !== root && scrolls(node)) this.targets.push(node);\n node = node.parentElement;\n }\n this.targets.push(win);\n this.origin = this.read();\n }\n\n /** Call when any scroll event fires. */\n invalidate(): void {\n this.dirty = true;\n }\n\n /** Total scroll distance (px) of all tracked containers since construction. */\n delta(): Point {\n if (this.dirty) {\n const now = this.read();\n this.cached = { x: now.x - this.origin.x, y: now.y - this.origin.y };\n this.dirty = false;\n }\n return this.cached;\n }\n\n private read(): Point {\n let x = 0;\n let y = 0;\n for (const t of this.targets) {\n if (t === this.win) {\n x += this.win.scrollX;\n y += this.win.scrollY;\n } else {\n x += (t as HTMLElement).scrollLeft;\n y += (t as HTMLElement).scrollTop;\n }\n }\n return { x, y };\n }\n}\n\ninterface Point {\n x: number;\n y: number;\n}\n\nfunction scrolls(el: HTMLElement): boolean {\n const s = getComputedStyle(el);\n // `hidden` containers still scroll programmatically; `clip` never does.\n const scrollish = (v: string) => v === 'auto' || v === 'scroll' || v === 'overlay' || v === 'hidden';\n return scrollish(s.overflowX) || scrollish(s.overflowY);\n}\n","import { ScrollFrame } from '../utils/scroll-frame';\nimport {\n Axis,\n Box,\n LayoutModel,\n Point,\n analyzeLayout,\n computeAxisOffsets,\n resolveInsertionIndex,\n toBox,\n} from './layout-geometry';\n\nexport interface SortSessionInit {\n /** The drop list element. */\n container: HTMLElement;\n /** The placeholder for the dragged item. Must already be attached inside `container`. */\n placeholder: HTMLElement;\n /** Slot elements (direct children of `container`) of every draggable EXCEPT the dragged one. */\n itemElements: ReadonlySet<HTMLElement>;\n /** Used only while the list is too small to reveal its own orientation. */\n fallbackAxis: 'x' | 'y';\n fallbackRtl: boolean;\n /** Sibling animation in ms (0 disables). */\n animationMs: number;\n /** Whitespace separator already inserted next to the placeholder (inline layouts only). */\n spacer?: Text | null;\n /**\n * Notified whenever an entry's `translate3d` offset changes (including back to `{0,0}`).\n * A displaced item can contain OTHER registered drop lists (a tree of nested lists); their\n * cached hit-test geometry was measured before any displacement, so without this hook their\n * on-screen position and their hit-test box silently disagree once a sibling moves.\n */\n onOffsetChange?: (el: HTMLElement, offset: Point) => void;\n}\n\n/**\n * Inline / inline-block layouts get their inter-item gap from whitespace TEXT nodes. A\n * placeholder that is moved (or freshly inserted) without one would collapse that gap and shift\n * everything after it by a space width, so it carries a separator of its own. Returns `null`\n * for layouts that have no whitespace nodes (flex, grid, Angular-trimmed templates).\n */\nexport function makeSpacer(container: HTMLElement): Text | null {\n for (const n of Array.from(container.childNodes)) {\n if (n.nodeType === Node.TEXT_NODE && n.nodeValue && /^\\s+$/.test(n.nodeValue)) {\n return container.ownerDocument.createTextNode(n.nodeValue);\n }\n }\n return null;\n}\n\ninterface Entry {\n el: HTMLElement;\n isSlot: boolean;\n /** Computed transform the element had before we touched it (so e.g. rotations survive). */\n base: string;\n savedTransform: string;\n savedTransition: string;\n savedWillChange: string;\n}\n\nconst EASING = 'cubic-bezier(0, 0, 0.2, 1)';\n\n/**\n * One drag's view of one drop list.\n *\n * Lifecycle\n * ---------\n * snapshot ──► resolve(pointer) ──► apply(index) ──► ... ──► dispose()\n *\n * The snapshot (`boxes`) is taken once, with the dragged item's slot already in place, and is\n * never re-read while the drag is over the list. `resolve` is a pure function of the pointer\n * and that snapshot, so moving the pointer back always restores the previous state.\n *\n * Two ways to *show* the result, chosen from the measured layout:\n *\n * - `transform` (one row or one column; the common case): the DOM is never touched. Siblings\n * and the placeholder are displaced with `translate3d`, computed from measured sizes and\n * gaps, exactly like Angular CDK's single-axis strategy.\n * - `flow` (grid / wrapping layouts): an exact translate cannot be derived without\n * re-implementing the browser's layout engine, so the single placeholder node is moved and\n * the browser lays the list out. Siblings are then animated from their old to new position\n * with FLIP `translate3d` so the motion is still transform-driven and smooth. Decisions\n * keep using the immutable snapshot, so the reflow can never feed back into them.\n */\nexport class SortSession {\n readonly mode: 'transform' | 'flow';\n\n private readonly container: HTMLElement;\n private readonly placeholder: HTMLElement;\n private readonly itemElements: ReadonlySet<HTMLElement>;\n private readonly animationMs: number;\n private readonly fallbackAxis: 'x' | 'y';\n private readonly fallbackRtl: boolean;\n\n private entries: Entry[] = [];\n private boxes: Box[] = [];\n private model!: LayoutModel;\n /** Index of the slot (placeholder) inside `entries`/`boxes` at snapshot time. */\n private slotIdx = -1;\n /** For each visible \"other\" item: its index among ALL other items (hidden ones included). */\n private otherModelIndex: number[] = [];\n private frame: ScrollFrame;\n private applied = new Map<HTMLElement, Point>();\n private targetIdx = 0;\n private disposed = false;\n /** undefined = not created yet, null = this layout has no whitespace separators. */\n private spacer: Text | null | undefined;\n private readonly onOffsetChange?: (el: HTMLElement, offset: Point) => void;\n\n constructor(init: SortSessionInit) {\n this.spacer = init.spacer;\n this.onOffsetChange = init.onOffsetChange;\n this.container = init.container;\n this.placeholder = init.placeholder;\n this.itemElements = init.itemElements;\n this.animationMs = init.animationMs;\n this.fallbackAxis = init.fallbackAxis;\n this.fallbackRtl = init.fallbackRtl;\n\n this.snapshot();\n this.frame = new ScrollFrame(this.container, true);\n this.mode = this.model.axis === 'grid' ? 'flow' : 'transform';\n this.targetIdx = this.slotIdx;\n\n const transition = this.animationMs > 0 ? `transform ${this.animationMs}ms ${EASING}` : '';\n for (const e of this.entries) {\n e.el.style.willChange = 'transform';\n if (transition) e.el.style.transition = transition;\n }\n }\n\n /** Detected orientation (useful for tests/diagnostics). */\n get axis(): Axis {\n return this.model.axis;\n }\n\n /** Current insertion index among the *visible other* items. */\n get target(): number {\n return this.targetIdx;\n }\n\n /** Index at which the session started (the slot's original position). */\n get origin(): number {\n return this.slotIdx;\n }\n\n /** Insertion index among ALL other items of the list (what consumers see as `currentIndex`). */\n get modelIndex(): number {\n const idx = this.otherModelIndex;\n if (this.targetIdx < idx.length) return idx[this.targetIdx];\n return idx.length ? idx[idx.length - 1] + 1 : 0;\n }\n\n /** Where would the dragged item be inserted if released at `pointer`? Pure; no side effects. */\n resolve(pointer: Point): number {\n const d = this.frame.delta();\n return resolveInsertionIndex(\n this.model,\n this.boxes,\n this.slotIdx,\n { x: pointer.x + d.x, y: pointer.y + d.y },\n this.targetIdx,\n );\n }\n\n /** Visually place the slot at `index`. Idempotent. */\n apply(index: number): void {\n if (this.disposed || index === this.targetIdx) return;\n this.targetIdx = index;\n if (this.mode === 'transform') this.applyTransforms(index);\n else this.applyFlow(index);\n }\n\n /** Put everything back where it started (slot at its original index). */\n reset(): void {\n this.apply(this.slotIdx);\n }\n\n /** A scroll event happened somewhere: cached scroll deltas must be re-read once. */\n onScroll(): void {\n this.frame.invalidate();\n }\n\n /**\n * Re-baseline from the live layout (e.g. the window was resized mid-drag). Not called during\n * normal sorting, because re-measuring while items are displaced is exactly what would\n * re-introduce feedback into the decision.\n */\n refresh(): void {\n if (this.disposed) return;\n const target = this.targetIdx;\n this.clearDisplacement();\n this.snapshot();\n this.frame = new ScrollFrame(this.container, true);\n if (this.mode === 'transform') {\n this.targetIdx = this.slotIdx;\n this.apply(Math.min(target, this.boxes.length - 1));\n } else {\n this.targetIdx = this.slotIdx;\n }\n }\n\n /** Restore every inline style this session touched. Safe to call more than once. */\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n for (const e of this.entries) {\n e.el.style.transform = e.savedTransform;\n e.el.style.transition = e.savedTransition;\n e.el.style.willChange = e.savedWillChange;\n if (this.applied.has(e.el)) this.onOffsetChange?.(e.el, { x: 0, y: 0 });\n }\n this.applied.clear();\n this.spacer?.remove();\n }\n\n // ---------------------------------------------------------------------------------------\n // snapshot\n // ---------------------------------------------------------------------------------------\n\n private snapshot(): void {\n const previous = new Map(this.entries.map((e) => [e.el, e] as const));\n\n const entries: Entry[] = [];\n const boxes: Box[] = [];\n const otherModelIndex: number[] = [];\n let slot = -1;\n let allOthers = 0;\n\n for (const node of Array.from(this.container.children)) {\n if (!(node instanceof HTMLElement)) continue;\n const isSlot = node === this.placeholder;\n if (!isSlot && !this.itemElements.has(node)) continue;\n\n const modelIdx = isSlot ? -1 : allOthers++;\n const rect = node.getBoundingClientRect();\n const off = this.applied.get(node);\n const box = toBox(rect);\n if (off) {\n // Strip our own displacement so the snapshot always describes the *undisplaced* layout.\n box.left -= off.x;\n box.right -= off.x;\n box.top -= off.y;\n box.bottom -= off.y;\n }\n const hidden = !isSlot && rect.width === 0 && rect.height === 0;\n if (hidden) continue;\n\n if (isSlot) slot = entries.length;\n else otherModelIndex.push(modelIdx);\n\n const known = previous.get(node);\n entries.push(\n known ?? {\n el: node,\n isSlot,\n base: initialTransform(node),\n savedTransform: node.style.transform,\n savedTransition: node.style.transition,\n savedWillChange: node.style.willChange,\n },\n );\n boxes.push(box);\n }\n\n this.entries = entries;\n this.boxes = boxes;\n this.slotIdx = slot;\n this.otherModelIndex = otherModelIndex;\n this.model = analyzeLayout(boxes, this.fallbackAxis, this.fallbackRtl);\n }\n\n // ---------------------------------------------------------------------------------------\n // transform strategy (DOM stays untouched)\n // ---------------------------------------------------------------------------------------\n\n private applyTransforms(target: number): void {\n const offsets = computeAxisOffsets(this.model, this.boxes, this.slotIdx, target);\n const horizontal = this.model.axis === 'x';\n this.entries.forEach((e, i) => {\n const o = offsets[i];\n this.setOffset(e, horizontal ? { x: o, y: 0 } : { x: 0, y: o });\n });\n }\n\n private setOffset(e: Entry, off: Point): void {\n const prev = this.applied.get(e.el);\n if ((prev?.x ?? 0) === off.x && (prev?.y ?? 0) === off.y) return;\n if (off.x === 0 && off.y === 0) {\n this.applied.delete(e.el);\n e.el.style.transform = e.savedTransform;\n } else {\n this.applied.set(e.el, off);\n e.el.style.transform = `translate3d(${off.x}px, ${off.y}px, 0)${e.base}`;\n }\n this.onOffsetChange?.(e.el, off);\n }\n\n // ---------------------------------------------------------------------------------------\n // flow strategy (single placeholder move + FLIP transforms)\n // ---------------------------------------------------------------------------------------\n\n private applyFlow(target: number): void {\n const entries = this.entries;\n\n // 1. READ: where everything visually is right now (including in-flight animations).\n const first = entries.map((e) => e.el.getBoundingClientRect());\n\n // 2. WRITE: move the one placeholder node; drop any FLIP transforms.\n this.placeAt(target);\n for (const e of entries) {\n e.el.style.transition = 'none';\n e.el.style.transform = e.savedTransform;\n }\n\n // 3. READ: where everything is after the browser re-flowed the list.\n const last = entries.map((e) => e.el.getBoundingClientRect());\n\n // 4. WRITE: invert (put each item back where it was), then play (animate to its new home).\n const moved: Entry[] = [];\n entries.forEach((e, i) => {\n const dx = first[i].left - last[i].left;\n const dy = first[i].top - last[i].top;\n if (this.animationMs > 0 && (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5)) {\n e.el.style.transform = `translate3d(${dx}px, ${dy}px, 0)${e.base}`;\n moved.push(e);\n }\n });\n\n const transition = this.animationMs > 0 ? `transform ${this.animationMs}ms ${EASING}` : '';\n if (moved.length) void this.container.offsetWidth; // commit the inverted frame\n for (const e of entries) e.el.style.transition = transition || e.savedTransition;\n for (const e of moved) e.el.style.transform = e.savedTransform;\n }\n\n private placeAt(target: number): void {\n const container = this.container;\n if (this.spacer === undefined) this.spacer = makeSpacer(container);\n const spacer = this.spacer;\n spacer?.remove();\n\n const others = this.entries.filter((e) => !e.isSlot);\n const ref = others[target]?.el;\n if (ref) {\n // ... [placeholder][separator][ref]: the separator that used to sit before `ref` still\n // separates it from its previous sibling, the new one separates it from the placeholder.\n container.insertBefore(this.placeholder, ref);\n if (spacer) container.insertBefore(spacer, ref);\n return;\n }\n const last = others[others.length - 1]?.el;\n const after = last ? last.nextSibling : null;\n if (spacer) container.insertBefore(spacer, after);\n container.insertBefore(this.placeholder, after);\n }\n\n private clearDisplacement(): void {\n for (const e of this.entries) {\n e.el.style.transition = 'none';\n e.el.style.transform = e.savedTransform;\n if (this.applied.has(e.el)) this.onOffsetChange?.(e.el, { x: 0, y: 0 });\n }\n this.applied.clear();\n }\n}\n\nfunction initialTransform(el: HTMLElement): string {\n const t = getComputedStyle(el).transform;\n return t && t !== 'none' ? ` ${t}` : '';\n}\n","import { ResizeDirection } from '../contracts/IResizableOutput';\n\n/**\n * Logical directions that resolve differently depending on text direction.\n * 'n' and 's' never change - only the horizontal component is direction-aware.\n */\ntype LogicalDirectionKey = 'start' | 'end' | 'n-start' | 'n-end' | 's-start' | 's-end';\n\n/** Base (LTR) physical direction for every logical direction. */\nconst LTR_BASE: Record<LogicalDirectionKey, ResizeDirection> = {\n start: 'w',\n end: 'e',\n 'n-start': 'nw',\n 'n-end': 'ne',\n 's-start': 'sw',\n 's-end': 'se',\n};\n\n/** Mirrors the horizontal component of a physical direction. 'n' / 's' pass through unchanged. */\nconst MIRROR: Record<ResizeDirection, ResizeDirection> = {\n n: 'n',\n s: 's',\n e: 'w',\n w: 'e',\n ne: 'nw',\n nw: 'ne',\n se: 'sw',\n sw: 'se',\n};\n\nfunction isLogicalDirection(dir: string): dir is LogicalDirectionKey {\n return Object.prototype.hasOwnProperty.call(LTR_BASE, dir);\n}\n\n/**\n * True when `element` sits inside a right-to-left context.\n *\n * Reads the *computed* `direction` style instead of `element.dir`, because\n * `direction` is inherited and is almost never set on the resizable element\n * itself - it's usually set on `<html>`, `<body>`, or some ancestor wrapper.\n */\nexport function isRtl(element: HTMLElement): boolean {\n if (typeof window === 'undefined') {\n return false;\n }\n\n return window.getComputedStyle(element).direction === 'rtl';\n}\n\n/**\n * Resolves a logical direction ('start' | 'end' | 'n-start' | 'n-end' | 's-start' | 's-end')\n * to a physical, viewport-space direction ('n' | 'e' | 's' | 'w' | 'ne' | 'nw' | 'se' | 'sw')\n * based on `rtl`.\n *\n * Physical directions pass through untouched, so it's always safe to call this\n * even when `dir` might already be physical (e.g. resolving a direction that was\n * already resolved once before).\n */\nexport function resolveLogicalDirection(dir: string, rtl: boolean): ResizeDirection {\n if (!isLogicalDirection(dir)) {\n return dir as ResizeDirection;\n }\n\n const base = LTR_BASE[dir];\n\n return rtl ? MIRROR[base] : base;\n}\n","import { EventEmitter } from '@angular/core';\nimport { IDropEvent } from './contracts/IDropEvent';\nimport { IPosition } from './contracts/IPosition';\nimport { DragRef } from './drag-ref';\nimport { DropListGroupRef } from './drop-list-group-ref';\nimport { PlaceHolderRef } from './placeholder-ref';\nimport {\n Box,\n Point,\n analyzeLayout,\n boxContains,\n resolveInsertionIndex,\n toBox,\n} from './sorting/layout-geometry';\nimport { SortSession, makeSpacer } from './sorting/sort-session';\nimport { isRtl } from './utils/rtl';\nimport { ScrollFrame } from './utils/scroll-frame';\n\n/**\n * A drop list.\n *\n * Membership (`_draggables`) only ever reflects which draggables *belong* to this list in the\n * template. It is never changed by dragging. Everything that is transient during a drag lives\n * in a single `SortSession` (see sorting/sort-session.ts) that is created when a drag enters\n * the list and disposed when it leaves or the drag ends:\n *\n * - the list the drag started in keeps its session for the whole drag (its placeholder holds\n * the item's original slot, so leaving and re-entering is stable);\n * - any other list gets a fresh session on every entry and drops it on every exit.\n */\nexport class DropListRef<T = any> {\n data?: T;\n el!: HTMLElement;\n disableSort = false;\n connectedTo: HTMLElement[] = [];\n dropListGroup?: DropListGroupRef | null;\n /** Duration (ms) of the sibling slide animation. `0` disables animation. */\n sortAnimationDuration = 200;\n\n readonly _draggables = new Set<DragRef<T>>();\n readonly onDrop = new EventEmitter<IDropEvent<T>>();\n\n /**\n * Nesting: the nearest ENCLOSING drop list (null for a top-level list), and this list's own\n * direct nested lists — i.e. lists whose nearest enclosing list is this one, not a list at any\n * depth. Set by `NgxDropList` at init from a `skipSelf` DI lookup. Used for two things: (1)\n * `depth` for \"innermost wins\" in `DragRef`'s target resolution, without any DOM `.contains()`\n * calls on the hot path, and (2) cascading `_setAncestorOffset` (below) to every list nested\n * inside an item that gets displaced by sorting, at any depth.\n */\n parentList: DropListRef<any> | null = null;\n readonly childLists = new Set<DropListRef<any>>();\n\n private session: SortSession | null = null;\n private placeholder?: PlaceHolderRef;\n customPlaceholder?: PlaceHolderRef;\n private activeDrag: DragRef<T> | null = null;\n private isOrigin = false;\n private hovered = false;\n\n private hit: HitGeometry | null = null;\n /** Pre-insertion geometry of a foreign list, restored when the drag leaves it. */\n private naturalHit: HitGeometry | null = null;\n private hitCached = false;\n /**\n * Screen-space offset contributed by displaced ANCESTOR item(s) (see `parentList` above).\n * `{0,0}` outside of that (the overwhelmingly common case). Kept as a SUM of independent\n * per-source contributions, not a single overwritten value: while the pointer hovers a\n * FOREIGN (non-origin) list nested inside the origin's own displaced item, up to two ancestor\n * sessions can be displacing this list at once — the origin's (frozen, still active further\n * up) and that foreign list's own — and one clearing its contribution on release must not\n * wipe out the other's, still-active, contribution.\n */\n private readonly ancestorContributions = new Map<DropListRef<any>, Point>();\n private ancestorOffset: Point = { x: 0, y: 0 };\n /** Entries this list itself pushed via a one-time placeholder-insertion reflow (see below). */\n private readonly reflowContributions = new Map<HTMLElement, Point>();\n\n /** How many enclosing drop lists this one is nested inside. Root lists are depth 0. */\n get depth(): number {\n let d = 0;\n for (let p: DropListRef<any> | null = this.parentList; p; p = p.parentList) d++;\n return d;\n }\n\n _registerChild(child: DropListRef<any>): void {\n child.parentList = this;\n this.childLists.add(child);\n }\n\n _unregisterChild(child: DropListRef<any>): void {\n if (child.parentList === this) child.parentList = null;\n this.childLists.delete(child);\n }\n\n /**\n * One ancestor SESSION's contribution to this list's total displacement just changed (or\n * cleared, `{0,0}`). `source` identifies WHICH session — the list whose own item is doing the\n * displacing — so that this list's own recomputed total is a SUM across every currently-active\n * source, and cascades the SAME (source, offset) pair on to every nested list at any depth\n * unchanged, so a list several levels down stays hit-testable at its true on-screen position\n * regardless of which ancestor(s) are currently sorting.\n */\n _setAncestorOffset(source: DropListRef<any>, offset: Point): void {\n const prev = this.ancestorContributions.get(source);\n if (prev && prev.x === offset.x && prev.y === offset.y) return;\n if (offset.x === 0 && offset.y === 0) this.ancestorContributions.delete(source);\n else this.ancestorContributions.set(source, offset);\n\n let x = 0;\n let y = 0;\n for (const o of this.ancestorContributions.values()) {\n x += o.x;\n y += o.y;\n }\n if (x === this.ancestorOffset.x && y === this.ancestorOffset.y) return; // no net change\n this.ancestorOffset = { x, y };\n for (const child of this.childLists) child._setAncestorOffset(source, offset);\n }\n\n /** Which of this list's DIRECT nested lists live inside `el`, notified of its new offset. */\n private propagateOffset(el: HTMLElement, offset: Point): void {\n for (const child of this.childLists) {\n if (el.contains(child.el)) child._setAncestorOffset(this, offset);\n }\n }\n\n /** Rects, right now, of every `other` entry that contains one of this list's nested lists. */\n private trackedEntryRects(others: ReadonlySet<HTMLElement>): Map<HTMLElement, DOMRect> {\n const map = new Map<HTMLElement, DOMRect>();\n for (const child of this.childLists) {\n for (const el of others) {\n if (el.contains(child.el)) {\n if (!map.has(el)) map.set(el, el.getBoundingClientRect());\n break;\n }\n }\n }\n return map;\n }\n\n /** Turns the real reflow a fresh placeholder insertion just caused into ordinary offsets. */\n private propagateReflow(before: Map<HTMLElement, DOMRect>): void {\n for (const [el, prev] of before) {\n const now = el.getBoundingClientRect();\n const dx = now.left - prev.left;\n const dy = now.top - prev.top;\n if (dx || dy) {\n this.propagateOffset(el, { x: dx, y: dy });\n this.reflowContributions.set(el, { x: dx, y: dy });\n }\n }\n }\n\n addItem(item: DragRef<T>): void {\n this._draggables.add(item);\n }\n\n removeItem(item: DragRef<T>): void {\n this._draggables.delete(item);\n }\n\n isConnectedTo(other: DropListRef<any>): boolean {\n if (other === this) return true;\n if (this.connectedTo.includes(other.el) || other.connectedTo.includes(this.el)) return true;\n return !!this.dropListGroup && this.dropListGroup.has(other);\n }\n\n // ---------------------------------------------------------------------------------------\n // hit testing (cached for the duration of a drag)\n // ---------------------------------------------------------------------------------------\n\n /**\n * Measure the list and its clipping ancestors once, at drag start (or the moment a nested\n * list becomes a candidate mid-drag). `measureHit` reads live `getBoundingClientRect()`s,\n * which already include any `translate3d` an ancestor item's displacement has applied — so if\n * this list is currently offset (nested inside a sibling that sorting is displacing right\n * now), the measurement is normalized back to the zero-offset frame `_containsPoint` expects,\n * by subtracting that offset straight back out. Without this, entering a nested list while\n * its ancestor is mid-displacement would double-count the offset on every check afterwards.\n */\n _cacheGeometry(): void {\n const hit = measureHit(this.el);\n if (hit && (this.ancestorOffset.x || this.ancestorOffset.y)) {\n hit.box.left -= this.ancestorOffset.x;\n hit.box.right -= this.ancestorOffset.x;\n hit.box.top -= this.ancestorOffset.y;\n hit.box.bottom -= this.ancestorOffset.y;\n }\n this.hit = hit;\n this.hitCached = true;\n }\n\n /**\n * Is the point over the *visible* part of this list? Scroll-aware without re-measuring.\n *\n * The list box and every clipping ancestor are tracked separately because they react to scroll\n * differently: scrolling a container moves the list but not the container's own clip window.\n */\n _containsPoint(x: number, y: number): boolean {\n const hit = this.hitCached ? this.hit : measureHit(this.el);\n if (!hit) return false;\n // The list's own box shifts with any ancestor displacement; a clip window (a scroll/overflow\n // ancestor) normally does not, since it is not itself an item being sorted, so it is tested\n // against the raw pointer.\n const d0 = hit.frame.delta();\n if (!boxContains(hit.box, x - this.ancestorOffset.x + d0.x, y - this.ancestorOffset.y + d0.y))\n return false;\n for (const clip of hit.clips) {\n const d = clip.frame.delta();\n if (!boxContains(clip.box, x + d.x, y + d.y)) return false;\n }\n return true;\n }\n\n /** Approximate area, used to break ties between overlapping, unrelated lists. */\n _area(): number {\n const b = (this.hit ?? measureHit(this.el))?.box;\n return b ? (b.right - b.left) * (b.bottom - b.top) : 0;\n }\n\n _onScroll(): void {\n this.hit?.frame.invalidate();\n this.hit?.clips.forEach((c) => c.frame.invalidate());\n this.session?.onScroll();\n }\n\n /** Re-measure after a viewport resize. */\n _refresh(): void {\n if (this.hitCached) this._cacheGeometry();\n this.session?.refresh();\n }\n\n // ---------------------------------------------------------------------------------------\n // drag lifecycle\n // ---------------------------------------------------------------------------------------\n\n /** Backwards-compatible entry point: makes this list the drag's target. */\n createPlaceholder(drag: DragRef<T>): PlaceHolderRef {\n this.enter(drag, drag.pointer.x, drag.pointer.y);\n return drag.placeholder!;\n }\n\n /** The drag pointer entered this list (or the drag started inside it). */\n enter(drag: DragRef<T>, x = 0, y = 0): void {\n if (this.session && this.activeDrag === drag) {\n // Resuming a session that's still alive: either this is the origin list (its slot is\n // always kept), or the pointer dove into one of its own nested lists and came back up\n // (frozen rather than released in `exit()`, see there).\n this.hovered = true;\n this.el.classList.add('ngx-drop-list--active');\n drag.placeholder = this.placeholder;\n this.sortItem(drag, { x, y });\n return;\n }\n\n this.releaseSession(); // never keep stale state from a previous drag (geometry cache stays)\n this.begin(drag, { x, y });\n this.hovered = true;\n this.el.classList.add('ngx-drop-list--active');\n }\n\n /** Re-evaluate the insertion index for the pointer. Returns the new index, or null if unchanged. */\n sortItem(drag: DragRef<T>, position: IPosition): number | null {\n const s = this.session;\n if (!s || this.activeDrag !== drag || !this.hovered || this.disableSort) return null;\n\n const next = s.resolve(position);\n if (next === s.target) return null;\n s.apply(next);\n return s.modelIndex;\n }\n\n /** The pointer left this list. */\n /**\n * The pointer truly left this list (as opposed to moving deeper into one of its own nested\n * lists — see `DragRef`'s chain tracking, which never calls `exit()` for a list that remains\n * an ancestor of the new target, so this always means \"left this list's territory\").\n */\n exit(drag: DragRef<T>): void {\n if (!this.session || this.activeDrag !== drag) return;\n this.hovered = false;\n this.el.classList.remove('ngx-drop-list--active');\n\n if (this.isOrigin) {\n // Keep the original slot (the item logically still lives here) but stop displacing siblings.\n this.session.reset();\n } else {\n // A foreign list forgets the drag on exit; its geometry stays cached until the drag ends.\n this.releaseSession(drag);\n }\n }\n\n /**\n * The pointer dove into one of this list's own nested lists: this list is no longer the\n * innermost target, but it isn't being left either — its placeholder and sibling displacement\n * stay exactly as they are (avoids a snap-back-then-forward flicker), only the \"currently\n * hovered\" bookkeeping (and its visual highlight) is cleared. `DragRef`'s chain tracking calls\n * this instead of `exit()` for every list that remains an ancestor of the new target.\n */\n _freeze(): void {\n this.hovered = false;\n this.el.classList.remove('ngx-drop-list--active');\n }\n\n /**\n * Ends the drag for this list. Returns the drop event when the pointer was released over this\n * list, `null` otherwise (nothing to emit). All transient state is disposed either way.\n */\n _finish(drag: DragRef<T>, commit: boolean): IDropEvent<T> | null {\n const s = this.session;\n if (!s || this.activeDrag !== drag) return null;\n\n const event: IDropEvent<T> | null =\n commit && this.hovered\n ? {\n previousIndex: Math.max(0, drag.originIndex),\n currentIndex: s.modelIndex,\n item: drag,\n container: this,\n previousContainer: drag.originDropList ?? this,\n isPointerOverContainer: true,\n }\n : null;\n\n this.releaseSession(drag);\n return event;\n }\n\n /** Compatibility wrapper: finish + emit. */\n finishDrag(drag: DragRef<T>): void {\n const event = this._finish(drag, true);\n if (event) this.onDrop.emit(event);\n }\n\n resetSortTransforms(): void {\n this.session?.reset();\n }\n\n getFinalIndex(): number {\n return this.session ? this.session.modelIndex : 0;\n }\n\n getItemIndex(item: DragRef<T>): number {\n return this.indexOf(item);\n }\n\n /** End of the drag: dispose EVERYTHING this list holds, including cached geometry. Idempotent. */\n _release(drag?: DragRef<T>): void {\n if (drag && this.activeDrag && this.activeDrag !== drag) return;\n this.releaseSession(drag);\n this.hit = null;\n this.hitCached = false;\n // `ancestorOffset` is deliberately NOT reset here: `enter()` calls this unconditionally as a\n // safety-clear on every (re-)entry, including while a currently-active ancestor transform\n // still legitimately applies to this list. It self-corrects when that transform actually\n // reverts to zero, via the `onOffsetChange` cascade (see `_setAncestorOffset`), which also\n // covers the true end of a drag (the displaced list's own session disposes and reports\n // every entry back to `{0,0}`).\n }\n\n /** Dispose the sort session, placeholder and drag ownership. */\n private releaseSession(drag?: DragRef<T>): void {\n if (drag && this.activeDrag && this.activeDrag !== drag) return;\n\n this.session?.dispose();\n this.session = null;\n if (this.reflowContributions.size) {\n // The one-time reflow from this list's own placeholder insertion (see `propagateReflow`)\n // never went through the session's own `applied` map, so its `dispose()` above cannot\n // have cleared it — do that here instead, or it would linger as a stale contribution.\n for (const [el] of this.reflowContributions) this.propagateOffset(el, { x: 0, y: 0 });\n this.reflowContributions.clear();\n }\n\n this.placeholder?.detach();\n if (this.activeDrag && this.activeDrag.placeholder === this.placeholder) {\n this.activeDrag.placeholder = undefined;\n }\n this.placeholder = undefined;\n\n if (this.naturalHit) {\n this.hit = this.naturalHit;\n this.naturalHit = null;\n }\n\n this.activeDrag = null;\n this.isOrigin = false;\n this.hovered = false;\n this.el?.classList.remove('ngx-drop-list--active');\n }\n\n // ---------------------------------------------------------------------------------------\n // internals\n // ---------------------------------------------------------------------------------------\n\n private begin(drag: DragRef<T>, pointer: IPosition): void {\n const origin = drag.originDropList === this;\n const others = this.otherSlots(drag);\n const rtl = isRtl(this.el);\n const axis = fallbackAxis(this.el);\n\n const ph = this.customPlaceholder ?? new PlaceHolderRef();\n\n ph.dropList = this;\n let spacer: Text | null | undefined;\n\n if (origin) {\n // The placeholder takes over the exact slot of the (now hidden) source element.\n ph.attach(this.el, drag.el, drag.el);\n this.lockPlaceholderGeometry(drag, ph, drag.start);\n } else {\n ph.detach();\n // Only the \"other\" entries that contain a nested list are worth measuring (usually none,\n // or very few, even in a large tree): inserting the placeholder is a REAL DOM node, so it\n // shifts later siblings via ordinary CSS reflow, not `translate3d` — a one-time event this\n // list's own SortSession never reports through `onOffsetChange`, since (being sized and\n // positioned by `foreignInsertionReference` to already match where it belongs) it never\n // needs to actually transform anything afterwards. Measuring the small tracked set just\n // before and after the insertion turns that one-time reflow into an ordinary ancestor\n // contribution, exactly like any other displaced entry.\n const tracked = this.childLists.size ? this.trackedEntryRects(others) : null;\n const reference = this.foreignInsertionReference(others, pointer, axis, rtl);\n ph.attach(this.el, drag.el, reference);\n // Sized to its final footprint BEFORE measuring the reflow it causes: an unsized clone\n // (still near-zero height) wouldn't have pushed `others` at all yet.\n this.lockPlaceholderGeometry(drag, ph, drag.start);\n if (tracked) this.propagateReflow(tracked);\n spacer = makeSpacer(this.el);\n if (spacer) this.el.insertBefore(spacer, reference ?? ph.element!);\n }\n\n this.placeholder = ph;\n this.activeDrag = drag;\n this.isOrigin = origin;\n drag.placeholder = ph;\n\n this.session = new SortSession({\n container: this.el,\n placeholder: ph.element!,\n itemElements: others,\n fallbackAxis: axis,\n fallbackRtl: rtl,\n animationMs: this.sortAnimationDuration,\n spacer,\n onOffsetChange: this.childLists.size\n ? (el, offset) => this.propagateOffset(el, offset)\n : undefined,\n });\n\n if (!origin && this.hitCached) {\n // Inserting the placeholder made this list bigger; the grown box is what the user sees\n // (and must be able to reach, e.g. to append below the last item). The natural box comes\n // back on exit, so entering/leaving at the old edge cannot flicker.\n this.naturalHit = this.hit;\n this._cacheGeometry();\n }\n }\n\n /**\n * First placement into a list that does not contain the item yet: the node the placeholder\n * must be inserted before (null = append). Same pure resolver as sorting, no hysteresis.\n */\n private foreignInsertionReference(\n others: ReadonlySet<HTMLElement>,\n pointer: IPosition,\n axis: 'x' | 'y',\n rtl: boolean,\n ): Node | null {\n const els: HTMLElement[] = [];\n const boxes: Box[] = [];\n for (const node of Array.from(this.el.children)) {\n if (!(node instanceof HTMLElement) || !others.has(node)) continue;\n const r = node.getBoundingClientRect();\n if (r.width === 0 && r.height === 0) continue;\n els.push(node);\n boxes.push(toBox(r));\n }\n if (!els.length) return null;\n\n const index = this.disableSort\n ? els.length\n : resolveInsertionIndex(analyzeLayout(boxes, axis, rtl), boxes, -1, pointer, null);\n\n return index < els.length ? els[index] : els[els.length - 1].nextSibling;\n }\n\n private otherSlots(drag: DragRef<T>): Set<HTMLElement> {\n const set = new Set<HTMLElement>();\n for (const d of this._draggables) {\n if (d !== drag && d.el?.parentElement === this.el) set.add(d.el);\n }\n return set;\n }\n\n private indexOf(item: DragRef<T>): number {\n const byElement = new Map<HTMLElement, DragRef<T>>();\n for (const d of this._draggables) if (d.el) byElement.set(d.el, d);\n\n let index = 0;\n for (const node of Array.from(this.el.children)) {\n if (!(node instanceof HTMLElement)) continue;\n if (node === this.placeholder?.element) continue;\n if (node.classList.contains('ngx-drag-placeholder')) continue;\n if (node.classList.contains('ngx-drag-preview')) continue;\n const ref = byElement.get(node);\n if (!ref) continue;\n if (ref === item) return index;\n index++;\n }\n return -1;\n }\n\n private lockPlaceholderGeometry(drag: DragRef<T>, ph: PlaceHolderRef, rect: DOMRect): void {\n const placeholder = ph.element!;\n const set = (k: string, v: string) => placeholder.style.setProperty(k, v, 'important');\n\n placeholder.style.zIndex = '';\n placeholder.style.removeProperty('will-change');\n\n if (ph.custom) return;\n\n placeholder.style.display = drag.originalDisplay;\n\n // Occupies exactly the dragged item's footprint, so the gap reserved in the list — and the\n // sibling-displacement math derived from it — matches the item's real size.\n set('width', `${rect.width}px`);\n set('height', `${rect.height}px`);\n // set('min-width', `${rect.width}px`);\n // set('min-height', `${rect.height}px`);\n // set('max-width', `${rect.width}px`);\n // set('max-height', `${rect.height}px`);\n set('visibility', 'visible');\n set('opacity', '0.16');\n set('pointer-events', 'none');\n set('animation', 'none');\n set('box-sizing', 'border-box');\n }\n}\n\n/** Orientation to assume while a list has fewer than two items to measure. */\nfunction fallbackAxis(container: HTMLElement): 'x' | 'y' {\n const s = getComputedStyle(container);\n if (s.display.includes('flex')) return s.flexDirection.startsWith('column') ? 'y' : 'x';\n if (s.display.includes('grid')) return 'y';\n const child = container.firstElementChild;\n if (child && getComputedStyle(child).display.startsWith('inline')) return 'x';\n return 'y';\n}\n\ninterface HitGeometry {\n box: Box;\n frame: ScrollFrame;\n clips: { box: Box; frame: ScrollFrame }[];\n}\n\n/** Rect of the list plus one clip window per clipping (overflow != visible) ancestor. */\nfunction measureHit(el: HTMLElement): HitGeometry | null {\n const r = el.getBoundingClientRect();\n if (r.right <= r.left || r.bottom <= r.top) return null;\n\n const clips: HitGeometry['clips'] = [];\n const root = el.ownerDocument.documentElement;\n for (let node = el.parentElement; node && node !== root; node = node.parentElement) {\n const s = getComputedStyle(node);\n const cx = s.overflowX !== 'visible';\n const cy = s.overflowY !== 'visible';\n if (!cx && !cy) continue;\n const c = node.getBoundingClientRect();\n clips.push({\n box: {\n left: cx ? c.left : -Infinity,\n right: cx ? c.right : Infinity,\n top: cy ? c.top : -Infinity,\n bottom: cy ? c.bottom : Infinity,\n },\n // A clip window only moves when something ABOVE the clipping element scrolls.\n frame: new ScrollFrame(node, false),\n });\n }\n return { box: toBox(r), frame: new ScrollFrame(el, false), clips };\n}\n","import { DropListRef } from './drop-list-ref';\n\n/**\n * Groups multiple drop lists so items can be dragged between them without\n * needing an explicit `connectedTo` list on every single one.\n * Lists register themselves automatically when `NgxDropListGroup` wraps them.\n */\nexport class DropListGroupRef {\n readonly lists = new Set<DropListRef<any>>();\n\n add(list: DropListRef<any>): void {\n this.lists.add(list);\n }\n remove(list: DropListRef<any>): void {\n this.lists.delete(list);\n }\n has(list: DropListRef<any> | null | undefined): boolean {\n return !!list && this.lists.has(list);\n }\n}\n","import { Injectable, signal } from '@angular/core';\nimport { DragRef } from '../drag-ref';\nimport { DropListRef } from '../drop-list-ref';\nimport { DropListGroupRef } from '../drop-list-group-ref';\n\n@Injectable({ providedIn: 'root' })\nexport class DragDropService {\n readonly drags = signal<readonly DragRef[]>([]);\n readonly dropLists = signal<readonly DropListRef[]>([]);\n readonly activeDrag = signal<DragRef | null>(null);\n\n /**\n * DOM-position registries, used to find the nearest enclosing list/group by walking real\n * ancestor elements instead of Angular's element-injector tree.\n *\n * This matters for `ngTemplateOutlet`-based recursive trees (a list of items whose own\n * children are rendered by re-invoking the SAME `<ng-template>`, as in a tree/outliner UI):\n * each invocation gets a FRESH embedded view whose injector context is wherever the outlet\n * was written in the template, not wherever its content ends up in the DOM. So `inject(TOKEN,\n * {skipSelf})` from one recursion level can never see a provider from another level — the\n * only fix within Angular's own DI is to manually thread `ngTemplateOutletInjector` through\n * every recursive call, which isn't reasonable to require of every consumer of this library.\n * A plain DOM walk has no such limitation: it only cares where elements actually ended up.\n */\n private readonly listsByEl = new Map<HTMLElement, DropListRef>();\n private readonly groupsByEl = new Map<HTMLElement, DropListGroupRef>();\n\n registerDragItem(ref: DragRef<any>): void {\n this.drags.update((items) => (items.includes(ref) ? items : [...items, ref]));\n }\n\n removeDragItem(ref: DragRef<any>): void {\n this.drags.update((items) => items.filter((x) => x !== ref));\n if (this.activeDrag() === ref) this.activeDrag.set(null);\n }\n\n registerDropList(ref: DropListRef): void {\n this.dropLists.update((items) => (items.includes(ref) ? items : [...items, ref]));\n if (ref.el) this.listsByEl.set(ref.el, ref);\n }\n\n removeDropList(ref: DropListRef<any>): void {\n this.dropLists.update((items) => items.filter((x) => x !== ref));\n if (ref.el && this.listsByEl.get(ref.el) === ref) this.listsByEl.delete(ref.el);\n }\n\n registerGroup(el: HTMLElement, ref: DropListGroupRef): void {\n this.groupsByEl.set(el, ref);\n }\n\n removeGroup(el: HTMLElement): void {\n this.groupsByEl.delete(el);\n }\n\n /** Nearest registered drop list starting at (and including) `start`, walking up the DOM. */\n findAncestorDropList(start: HTMLElement | ParentNode | null): DropListRef | null {\n let node = start;\n while (node) {\n if (node instanceof HTMLElement) {\n const found = this.listsByEl.get(node);\n if (found) {\n return found;\n }\n }\n node = node instanceof ShadowRoot ? node.host : node.parentNode;\n }\n return null;\n }\n\n /** Nearest registered drop-list group starting at (and including) `start`, walking up the DOM. */\n findAncestorGroup(start: HTMLElement | ParentNode | null): DropListGroupRef | null {\n let node = start;\n while (node) {\n if (node instanceof HTMLElement) {\n const found = this.groupsByEl.get(node);\n if (found) {\n return found;\n }\n }\n node = node instanceof ShadowRoot ? node.host : node.parentNode;\n }\n return null;\n }\n\n begin(ref: DragRef<any>): void {\n this.activeDrag.set(ref);\n }\n\n end(ref: DragRef<any>): void {\n if (this.activeDrag() === ref) this.activeDrag.set(null);\n }\n\n cancelActive(): void {\n const ref = this.activeDrag();\n if (!ref) return;\n ref.cancelDrag();\n this.activeDrag.set(null);\n }\n\n /**\n * Which drop list is under `point`?\n *\n * - Only lists connected to the drag's ORIGIN list qualify (connectivity is not transitive, so\n * A→B→C never lets an item hop A→C). Without an origin (a free-drag element) nothing\n * qualifies: free dragging is never captured by a list.\n * - Only the visible (clip-aware) part of a list counts.\n * - A list inside the dragged element itself is never a target.\n * - Nested lists: the innermost qualifying list wins. Among unrelated overlapping lists the\n * current one is kept (no flicker), otherwise the smallest.\n */\n findDropList(\n point: { x: number; y: number },\n current?: DropListRef | null,\n origin?: DropListRef | null,\n dragEl?: HTMLElement | null,\n ): DropListRef | null {\n const source = origin ?? null;\n if (!source) return null;\n\n let best: DropListRef | null = null;\n for (const list of this.dropLists()) {\n if (!list.el || !source.isConnectedTo(list)) continue;\n if (dragEl && dragEl !== list.el && dragEl.contains(list.el)) continue;\n if (!list._containsPoint(point.x, point.y)) continue;\n\n if (!best) best = list;\n else if (best.el.contains(list.el))\n best = list; // deeper wins\n else if (list.el.contains(best.el)) continue;\n else if (list === current) best = list;\n else if (best !== current && list._area() < best._area()) best = list;\n }\n return best;\n }\n}\n","/**\n * Auto-scrolls the nearest scrollable ancestor (or window) while the pointer\n * is dragged near the edge of the scrollable viewport. Direction-agnostic —\n * works the same in RTL and LTR since it operates on physical scroll deltas.\n */\nexport class AutoScroller {\n private raf = 0;\n private container: HTMLElement | Window = window;\n private speed = { x: 0, y: 0 };\n private onTick?: () => void;\n private readonly edge: number;\n private readonly maxSpeed: number;\n\n constructor(edge = 56, maxSpeed = 18) {\n this.edge = edge;\n this.maxSpeed = maxSpeed;\n }\n\n /** onTick اجرا میشود بعد از هر گام اسکرول، تا با آخرین موقعیت pointer، sort/placeholder بهروز شود. */\n start(fromEl: HTMLElement, onTick?: () => void): void {\n this.container = findScrollableAncestor(fromEl);\n this.onTick = onTick;\n }\n\n /** فقط container را عوض میکند بدون قطع حلقهی در حال اجرا یا صفر کردن speed. */\n retarget(fromEl: HTMLElement): void {\n this.container = findScrollableAncestor(fromEl);\n }\n\n update(clientX: number, clientY: number): void {\n const rect = getScrollRect(this.container);\n this.speed = {\n x: edgeSpeed(clientX, rect.left, rect.right, this.edge, this.maxSpeed),\n y: edgeSpeed(clientY, rect.top, rect.bottom, this.edge, this.maxSpeed),\n };\n if ((this.speed.x || this.speed.y) && !this.raf) {\n this.raf = requestAnimationFrame(this.tick);\n }\n }\n\n stop(): void {\n if (this.raf) cancelAnimationFrame(this.raf);\n this.raf = 0;\n this.speed = { x: 0, y: 0 };\n this.onTick = undefined;\n }\n\n private tick = (): void => {\n if (!this.speed.x && !this.speed.y) {\n this.raf = 0;\n return;\n }\n if (this.container instanceof Window) {\n this.container.scrollBy(this.speed.x, this.speed.y);\n } else {\n this.container.scrollLeft += this.speed.x;\n this.container.scrollTop += this.speed.y;\n }\n // pointer ثابت مونده ولی محتوای زیرش اسکرول شده — پس sort/placeholder را\n // دوباره با آخرین موقعیت شناختهشده اجرا کن.\n this.onTick?.();\n this.raf = requestAnimationFrame(this.tick);\n };\n}\nfunction edgeSpeed(pos: number, min: number, max: number, edge: number, maxSpeed: number): number {\n if (pos < min + edge) return -maxSpeed * (1 - Math.max(0, pos - min) / edge);\n if (pos > max - edge) return maxSpeed * (1 - Math.max(0, max - pos) / edge);\n return 0;\n}\n\nfunction getScrollRect(container: HTMLElement | Window): {\n left: number;\n right: number;\n top: number;\n bottom: number;\n} {\n if (container instanceof Window) {\n return { left: 0, top: 0, right: window.innerWidth, bottom: window.innerHeight };\n }\n return container.getBoundingClientRect();\n}\n\nexport function findScrollableAncestor(el: HTMLElement): HTMLElement | Window {\n let node: HTMLElement | null = el;\n while (node) {\n const style = getComputedStyle(node);\n const scrollable = /(auto|scroll|overlay)/.test(style.overflowY + style.overflowX);\n if (scrollable && node.scrollHeight > node.clientHeight) return node;\n node = node.parentElement;\n }\n return window;\n}\n\nexport function getScrollPosition(container: HTMLElement | Window): { left: number; top: number } {\n if (container instanceof Window) {\n return { left: window.scrollX, top: window.scrollY };\n }\n return { left: container.scrollLeft, top: container.scrollTop };\n}\n","import {\n Directive,\n ElementRef,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Renderer2,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { DragDropService } from '../services/drag-drop.service';\nimport { DragRef, DragAxis } from '../drag-ref';\nimport { IPosition } from '../contracts/IPosition';\nimport { AutoScroller, findScrollableAncestor, getScrollPosition } from '../utils/auto-scroll';\n\n/** Pointer events already claimed by an (inner) draggable. */\nconst claimedPointerEvents = new WeakSet<Event>();\n\nexport const NGX_DRAGGABLE = new InjectionToken<NgxDraggable>('ngx-draggable');\n\nconst DEFAULT_KEYBOARD_STEP = 8;\n\n@Directive({\n selector: '[NgxDraggable],[ngxDraggable]',\n providers: [{ provide: NGX_DRAGGABLE, useExisting: NgxDraggable }],\n host: {\n '[style.touch-action]': '\"none\"',\n '[attr.tabindex]': 'disabled() ? null : 0',\n '[attr.aria-grabbed]': 'dragging()',\n class: 'ngx-draggable',\n '[class.disable-drag]': 'disabled()',\n },\n})\nexport class NgxDraggable<T = unknown> implements OnInit, OnDestroy {\n readonly disabled = model<boolean>(false);\n /** Element whose rect constrains the drag. Now actually enforced. */\n readonly boundary = input<HTMLElement>();\n readonly dragRootElement = model<string>('');\n /** CSS selector for a drag handle. When set, only pointerdowns inside it start a drag. */\n readonly dragHandle = model<string>('');\n /** Restrict movement to a single axis. */\n readonly lockAxis = input<DragAxis>();\n /** Minimum pointer travel (px) before a drag starts, so clicks still register normally. */\n readonly dragThreshold = input<number>(3);\n /** Pixel step used when dragging via the keyboard (arrow keys, focus required). */\n readonly keyboardStep = input<number>(DEFAULT_KEYBOARD_STEP);\n /** Auto-scroll the nearest scrollable ancestor while dragging near its edge. */\n readonly autoScroll = input<boolean>(true);\n @Input('data') set data(v: T) {\n this._ref.data = v;\n }\n\n readonly dragStart = output<IPosition>();\n readonly dragMove = output<IPosition>();\n readonly dragEnd = output<IPosition>();\n\n readonly _ref = new DragRef<T>();\n readonly dragging = signal(false);\n\n private readonly doc = inject(DOCUMENT);\n private readonly service = inject(DragDropService);\n private readonly scroller = new AutoScroller();\n\n private down = false;\n private start = { x: 0, y: 0 };\n private pointerId = -1;\n private lastPointer: IPosition = { x: 0, y: 0 };\n private removeDown?: () => void;\n private removeMove?: () => void;\n private removeUp?: () => void;\n private removeKeydown?: () => void;\n private removeEscape?: () => void;\n private removeCancel?: () => void;\n private removeLostCapture?: () => void;\n private scrollTarget: HTMLElement | Window = window;\n private lastScroll = { left: 0, top: 0 };\n private lastWindowScroll = { left: 0, top: 0 };\n private removeContainerScroll?: () => void;\n private removeWindowScroll?: () => void;\n\n protected readonly renderer = inject(Renderer2);\n constructor(private readonly host: ElementRef<HTMLElement>) {\n effect(() => {\n this._ref.el = this.dragRootElement()\n ? (this.host.nativeElement.closest(this.dragRootElement()) ?? this.host.nativeElement)\n : this.host.nativeElement;\n });\n }\n\n ngOnInit(): void {\n this._ref.el = this.dragRootElement()\n ? (this.host.nativeElement.closest(this.dragRootElement()) ?? this.host.nativeElement)\n : this.host.nativeElement;\n this._ref.boundary = this.boundary();\n this._ref.lockAxis = this.lockAxis();\n // Found by walking the real DOM, not Angular's element-injector tree — see the matching\n // comment in `ngx-drop-list.directive.ts` for why: a draggable rendered by a recursively\n // invoked `ngTemplateOutlet` needs this just as much as a nested list does.\n const parentEl = this.host.nativeElement.parentElement;\n const list = this.service.findAncestorDropList(parentEl);\n this._ref.dropListGroup = list?.dropListGroup ?? this.service.findAncestorGroup(parentEl);\n this._ref.service = this.service;\n this._ref.init();\n this._ref.withDropList(list ?? null);\n this.service.registerDragItem(this._ref);\n this.removeDown = this.renderer.listen(\n this.host.nativeElement,\n 'pointerdown',\n (e: PointerEvent) => this.pointerDown(e),\n );\n this.removeKeydown = this.renderer.listen(\n this.host.nativeElement,\n 'keydown',\n (e: KeyboardEvent) => this.keyDown(e),\n );\n }\n\n ngOnDestroy(): void {\n this.removeDown?.();\n this.removeMove?.();\n this.removeUp?.();\n this.removeKeydown?.();\n this.removeEscape?.();\n this.removeCancel?.();\n this.removeLostCapture?.();\n this.scroller.stop();\n this.stopScrollTracking();\n // Destroyed mid-drag (e.g. the model changed underneath us): never leave a body clone behind.\n this._ref.dispose();\n this.service.removeDragItem(this._ref);\n this._ref.dropList?.removeItem(this._ref);\n }\n\n private pointerDown(e: PointerEvent): void {\n if (\n this.disabled() ||\n e.button !== 0 ||\n // this.isInteractive(e.target) ||\n !this.isOnHandle(e.target)\n )\n return;\n // Nested draggables: pointerdown bubbles, so without this an ancestor draggable would start\n // its own drag from the very same gesture. The innermost enabled draggable claims it.\n if (claimedPointerEvents.has(e)) return;\n claimedPointerEvents.add(e);\n e.preventDefault();\n this.down = true;\n this.pointerId = e.pointerId;\n this.start = { x: e.clientX, y: e.clientY };\n this._ref.boundary = this.boundary();\n this._ref.lockAxis = this.lockAxis();\n this._ref.pointerDown(this.start);\n this.removeMove = this.renderer.listen(this.doc, 'pointermove', (ev: PointerEvent) =>\n this.pointerMove(ev),\n );\n this.removeUp = this.renderer.listen(this.doc, 'pointerup', (ev: PointerEvent) =>\n this.pointerUp(ev),\n );\n this.removeEscape = this.renderer.listen(this.doc, 'keydown', (ev: KeyboardEvent) => {\n if (ev.key === 'Escape' && this.dragging()) this.cancel();\n });\n this.removeCancel = this.renderer.listen(this.doc, 'pointercancel', (ev: PointerEvent) =>\n this.pointerCancel(ev),\n );\n this.removeLostCapture = this.renderer.listen(\n this.doc,\n 'lostpointercapture',\n (ev: PointerEvent) => this.pointerCancel(ev),\n );\n }\n private applyDragUpdate(p: IPosition): void {\n const before = this._ref.activeDropList;\n // DragRef decides everything (preview, target list, placeholder). A free drag never\n // interacts with drop lists.\n this._ref.dragMove(p);\n\n if (this._ref.isListDrag && this.autoScroll()) {\n const after = this._ref.activeDropList;\n // Follow the hovered list; outside every list, scroll the page.\n if (after !== before) this.scroller.retarget(after?.el ?? this.doc.body);\n }\n this.dragMove.emit(p);\n }\n /** فراخوانی میشود دقیقاً وقتی drag واقعاً شروع میشود (چه با موس، چه با کیبورد). */\n private startScrollTracking(): void {\n this.scrollTarget = findScrollableAncestor(this._ref.el);\n this.lastScroll = getScrollPosition(this.scrollTarget);\n this.lastWindowScroll = { left: window.scrollX, top: window.scrollY };\n\n if (this.scrollTarget !== window) {\n this.removeContainerScroll = this.renderer.listen(this.scrollTarget, 'scroll', () =>\n this.handleContainerScroll(),\n );\n }\n // همیشه window رو هم جدا گوش میدیم؛ چون ممکنه container محلی نداشته باشیم\n // ولی خودِ صفحه اسکرول بشه.\n this.removeWindowScroll = this.renderer.listen('window', 'scroll', () =>\n this.handleWindowScroll(),\n );\n }\n\n private handleContainerScroll(): void {\n const pos = getScrollPosition(this.scrollTarget);\n const dx = pos.left - this.lastScroll.left;\n const dy = pos.top - this.lastScroll.top;\n this.lastScroll = pos;\n this._ref.notifyScroll(dx, dy);\n }\n\n private handleWindowScroll(): void {\n const left = window.scrollX;\n const top = window.scrollY;\n const dx = left - this.lastWindowScroll.left;\n const dy = top - this.lastWindowScroll.top;\n this.lastWindowScroll = { left, top };\n this._ref.notifyScroll(dx, dy);\n }\n\n private stopScrollTracking(): void {\n this.removeContainerScroll?.();\n this.removeWindowScroll?.();\n this.removeContainerScroll = this.removeWindowScroll = undefined;\n }\n\n private pointerMove(e: PointerEvent): void {\n if (!this.down || e.pointerId !== this.pointerId) return;\n const p = { x: e.clientX, y: e.clientY };\n this.lastPointer = p;\n if (\n !this.dragging() &&\n Math.hypot(p.x - this.start.x, p.y - this.start.y) < this.dragThreshold()\n )\n return;\n if (!this.dragging()) {\n this._ref.startDrag(p);\n this.dragging.set(true);\n this.service.begin(this._ref);\n this.startScrollTracking();\n if (this.autoScroll()) {\n this.scroller.start(this._ref.el, () => this.applyDragUpdate(this.lastPointer));\n }\n this.dragStart.emit(p);\n }\n\n this.applyDragUpdate(p);\n\n if (this.autoScroll()) this.scroller.update(p.x, p.y);\n }\n private pointerUp(e: PointerEvent): void {\n if (!this.down || e.pointerId !== this.pointerId) return;\n if (this.dragging()) {\n // Also when released OUTSIDE every list: endDrag() rolls the drag back and cleans up.\n if (this._ref.isListDrag) {\n // The release position is authoritative for the drop target (a fast flick may end with\n // a pointerup that has no preceding pointermove at that position).\n const p = { x: e.clientX, y: e.clientY };\n if (p.x !== this.lastPointer.x || p.y !== this.lastPointer.y) this._ref.dragMove(p);\n this._ref.endDrag();\n }\n this.service.end(this._ref);\n }\n this.finish();\n this.dragEnd.emit(this._ref.pointer);\n }\n\n /** Browser cancelled the pointer (touch takeover, lost capture...). */\n private pointerCancel(e: PointerEvent): void {\n if (!this.down || e.pointerId !== this.pointerId) return;\n if (this.dragging() && this._ref.isListDrag) {\n this.cancel();\n return;\n }\n this.pointerUp(e);\n }\n\n private cancel(): void {\n this._ref.cancelDrag();\n this.service.end(this._ref);\n this.finish();\n }\n\n private finish(): void {\n this.dragging.set(false);\n this.down = false;\n this.scroller.stop();\n this.stopScrollTracking();\n this.removeMove?.();\n this.removeUp?.();\n this.removeEscape?.();\n this.removeCancel?.();\n this.removeLostCapture?.();\n this.removeMove = this.removeUp = this.removeEscape = undefined;\n this.removeCancel = this.removeLostCapture = undefined;\n }\n\n /** Arrow-key movement for keyboard/assistive-tech users. Shift multiplies the step by 4. */\n private keyDown(e: KeyboardEvent): void {\n if (this.disabled()) return;\n const step = this.keyboardStep() * (e.shiftKey ? 4 : 1);\n const deltas: Record<string, IPosition> = {\n ArrowLeft: { x: -step, y: 0 },\n ArrowRight: { x: step, y: 0 },\n ArrowUp: { x: 0, y: -step },\n ArrowDown: { x: 0, y: step },\n };\n const delta = deltas[e.key];\n if (delta) {\n e.preventDefault();\n if (!this.dragging()) {\n // Free drag keeps its (0,0) pseudo pointer. A list item starts from its own centre so\n // that keyboard sorting resolves against real geometry.\n const inList = !!this._ref.dropList && this._ref.dropList.el === this._ref.el.parentElement;\n const r = this._ref.el.getBoundingClientRect();\n const origin = inList\n ? { x: r.left + r.width / 2, y: r.top + r.height / 2 }\n : { x: 0, y: 0 };\n this._ref.pointerDown(origin);\n this._ref.boundary = this.boundary();\n this._ref.lockAxis = this.lockAxis();\n this._ref.startDrag(origin);\n this.dragging.set(true);\n this.service.begin(this._ref);\n this.startScrollTracking();\n this.dragStart.emit(origin);\n }\n this._ref.nudge(delta.x, delta.y);\n this.dragMove.emit(this._ref.pointer);\n return;\n }\n if ((e.key === 'Enter' || e.key === ' ') && this.dragging()) {\n e.preventDefault();\n this._ref.endDrag();\n this.service.end(this._ref);\n this.dragEnd.emit(this._ref.pointer);\n this.dragging.set(false);\n this.stopScrollTracking();\n } else if (e.key === 'Escape' && this.dragging()) {\n e.preventDefault();\n this._ref.cancelDrag();\n this.service.end(this._ref);\n this.dragging.set(false);\n }\n }\n\n private isOnHandle(target: EventTarget | null): boolean {\n if (!this.dragHandle()) return true;\n return target instanceof HTMLElement && !!target.closest(this.dragHandle());\n }\n\n private isInteractive(target: EventTarget | null): boolean {\n return (\n target instanceof HTMLElement &&\n !!target.closest('button,a,input,textarea,select,[data-no-drag]')\n );\n }\n}\n","import { Directive, ElementRef, HostListener, input, model, output, signal } from '@angular/core';\nimport {\n IResizableOutput,\n LogicalResizeDirection,\n ResizeDirection,\n} from '../contracts/IResizableOutput';\nimport { clampResizeWithinBoundary } from '../utils/check-boundary';\nimport { isRtl, resolveLogicalDirection } from '../utils/rtl';\n\nconst ALL_DIRECTIONS: ResizeDirection[] = ['n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'];\nconst KEYBOARD_STEP = 8;\n\n@Directive({\n selector: '[NgxResizable],[ngxResizable]',\n host: {\n '[style.touch-action]': '\"none\"',\n class: 'ngx-resizable',\n },\n})\nexport class NgxResizable {\n disabled = model<boolean>(false);\n readonly minWidth = model<number>(20);\n readonly minHeight = model<number>(20);\n readonly maxWidth = model<number>(Infinity);\n readonly maxHeight = model<number>(Infinity);\n readonly directions = input<LogicalResizeDirection[]>([...ALL_DIRECTIONS]);\n readonly grid = input<number | { x: number; y: number }>();\n\n /** Element whose rect constrains the resize. Previously accepted nowhere on this directive. */\n readonly boundary = input<HTMLElement>();\n /** Pixel step used when resizing via the keyboard (arrow keys, focus required). */\n readonly keyboardStep = input<number>(KEYBOARD_STEP);\n\n readonly resizeStart = output<IResizableOutput>();\n readonly resizeMove = output<IResizableOutput>();\n readonly resizeEnd = output<IResizableOutput>();\n\n readonly resizing = signal(false);\n private direction: ResizeDirection = 'se';\n\n private start!: DOMRect;\n private pointer = {\n x: 0,\n y: 0,\n };\n private beforeTransition = '';\n private beforeWidth = '';\n private beforeHeight = '';\n private beforeTransform = '';\n private pointerId = -1;\n constructor(private readonly el: ElementRef<HTMLElement>) {}\n\n @HostListener('pointerdown', ['$event'])\n onPointerDown(e: PointerEvent): void {\n if (this.disabled() || e.button !== 0) {\n return;\n }\n\n const dir = this.hitDirection(e);\n\n if (!dir) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n\n const element = this.el.nativeElement;\n this.direction = dir;\n this.pointerId = e.pointerId;\n /**\n * This is the actual visual rectangle.\n * It already contains any transform created by DragRef.\n */\n this.start = element.getBoundingClientRect();\n\n this.pointer = {\n x: e.clientX,\n y: e.clientY,\n };\n\n this.beforeTransition = element.style.transition;\n\n /**\n * Keep DragRef's transform as the immutable base.\n *\n * Resize will temporarily add its own translation\n * on top of this transform.\n */\n this.beforeTransform = element.style.transform;\n\n this.resizing.set(true);\n element.style.transition = 'none';\n element.setPointerCapture?.(e.pointerId);\n const out = this.calculate(e);\n this.apply(out);\n this.resizeStart.emit(out);\n }\n\n @HostListener('document:pointermove', ['$event'])\n onPointerMove(e: PointerEvent): void {\n if (!this.resizing() || e.pointerId !== this.pointerId) {\n return;\n }\n const out = this.calculate(e);\n this.apply(out);\n this.resizeMove.emit(out);\n }\n\n @HostListener('document:pointerup', ['$event'])\n onPointerUp(e: PointerEvent): void {\n if (!this.resizing() || e.pointerId !== this.pointerId) {\n return;\n }\n const out = this.calculate(e);\n this.apply(out);\n this.resizeEnd.emit(out);\n this.finish();\n }\n\n @HostListener('document:keydown', ['$event'])\n onDocumentKeyDown(e: KeyboardEvent): void {\n if (!this.resizing()) {\n return;\n }\n if (e.key !== 'Escape') {\n return;\n }\n e.preventDefault();\n const element = this.el.nativeElement;\n element.style.width = this.beforeWidth;\n element.style.height = this.beforeHeight;\n element.style.transform = this.beforeTransform;\n this.finish();\n }\n\n @HostListener('keydown', ['$event'])\n onHandleKeyDown(e: KeyboardEvent): void {\n if (this.disabled()) {\n return;\n }\n\n const rtl = isRtl(this.el.nativeElement);\n const step = this.keyboardStep() * (e.shiftKey ? 4 : 1);\n let dw = 0;\n let dh = 0;\n if (e.key === 'ArrowRight') {\n dw = rtl ? -step : step;\n } else if (e.key === 'ArrowLeft') {\n dw = rtl ? step : -step;\n } else if (e.key === 'ArrowDown') {\n dh = step;\n } else if (e.key === 'ArrowUp') {\n dh = -step;\n } else {\n return;\n }\n\n e.preventDefault();\n const rect = this.el.nativeElement.getBoundingClientRect();\n const width = this.clampGrid(\n Math.max(this.minWidth(), Math.min(this.maxWidth(), rect.width + dw)),\n 'x',\n );\n const height = this.clampGrid(\n Math.max(this.minHeight(), Math.min(this.maxHeight(), rect.height + dh)),\n 'y',\n );\n this.el.nativeElement.style.width = `${width}px`;\n this.el.nativeElement.style.height = `${height}px`;\n const out: IResizableOutput = {\n width,\n height,\n moveLeft: 0,\n moveTop: 0,\n left: rect.left,\n top: rect.top,\n direction: 'se',\n };\n this.resizeMove.emit(out);\n this.resizeEnd.emit(out);\n }\n\n private calculate(e: PointerEvent): IResizableOutput {\n const dx = e.clientX - this.pointer.x;\n const dy = e.clientY - this.pointer.y;\n\n let width = this.start.width;\n let height = this.start.height;\n /**\n * East\n */\n if (this.direction.includes('e')) {\n width += dx;\n }\n\n /**\n * West\n */\n if (this.direction.includes('w')) {\n width -= dx;\n }\n\n /**\n * South\n */\n if (this.direction.includes('s')) {\n height += dy;\n }\n\n /**\n * North\n */\n if (this.direction.includes('n')) {\n height -= dy;\n }\n\n width = this.clampGrid(Math.max(this.minWidth(), Math.min(this.maxWidth(), width)), 'x');\n\n height = this.clampGrid(Math.max(this.minHeight(), Math.min(this.maxHeight(), height)), 'y');\n\n /**\n * Calculate the intended visual position.\n *\n * This is useful for boundary calculations and\n * emitted resize events.\n */\n let left = this.start.left;\n let top = this.start.top;\n\n if (this.direction.includes('w')) {\n left = this.start.right - width;\n }\n\n if (this.direction.includes('n')) {\n top = this.start.bottom - height;\n }\n\n let moveLeft = left - this.start.left;\n let moveTop = top - this.start.top;\n /**\n * Boundary constraint.\n */\n if (this.boundary) {\n const clamped = clampResizeWithinBoundary(\n this.boundary()?.getBoundingClientRect(),\n this.start,\n width,\n height,\n moveLeft,\n moveTop,\n );\n width = clamped.width;\n height = clamped.height;\n moveLeft = clamped.left;\n moveTop = clamped.top;\n left = this.start.left + moveLeft;\n top = this.start.top + moveTop;\n }\n\n return {\n width,\n height,\n moveLeft,\n moveTop,\n left,\n top,\n direction: this.direction,\n };\n }\n\n private apply(out: IResizableOutput): void {\n const element = this.el.nativeElement;\n /**\n * Always reset to the transform that existed before\n * this resize operation started.\n *\n * This prevents resize corrections from accumulating.\n */\n element.style.transform = this.beforeTransform;\n\n /**\n * Apply the actual size first.\n *\n * Changing width/height may cause the browser to re-layout\n * the element, especially for relative/flex/grid/static layouts.\n */\n element.style.width = `${out.width}px`;\n element.style.height = `${out.height}px`;\n\n /**\n * Force/read layout after changing the size.\n */\n const current = element.getBoundingClientRect();\n\n /**\n * These are the positions where the element MUST visually be.\n *\n * `out.moveLeft` / `out.moveTop` are calculated in `calculate()`\n * from the original visual rectangle.\n */\n const targetLeft = this.start.left + out.moveLeft;\n const targetTop = this.start.top + out.moveTop;\n\n /**\n * Browser's actual position after width/height changed.\n *\n * The difference between target and current position is the\n * correction that must be applied using transform.\n */\n const correctionX = targetLeft - current.left;\n const correctionY = targetTop - current.top;\n const hasCorrection = correctionX !== 0 || correctionY !== 0;\n if (!hasCorrection) {\n element.style.transform = this.beforeTransform;\n return;\n }\n /**\n * Preserve DragRef's existing transform and add only the\n * correction required by Resize.\n */\n const baseTransform =\n this.beforeTransform && this.beforeTransform !== 'none' ? `${this.beforeTransform} ` : '';\n element.style.transform =\n `${baseTransform}translate3d(` + `${correctionX}px, ` + `${correctionY}px, 0)`;\n }\n\n private clampGrid(value: number, axis: 'x' | 'y'): number {\n const grid = typeof this.grid() === 'number' ? this.grid : (this.grid() as any)?.[axis];\n if (!grid || grid <= 0) {\n return value;\n }\n return Math.round(value / grid) * grid;\n }\n\n private finish(): void {\n this.resizing.set(false);\n this.el.nativeElement.style.transition = this.beforeTransition;\n this.pointerId = -1;\n this.beforeTransform = '';\n }\n\n private resolvedDirections(): ResizeDirection[] {\n const rtl = isRtl(this.el.nativeElement);\n const set = new Set<ResizeDirection>();\n for (const direction of this.directions()) {\n set.add(resolveLogicalDirection(direction, rtl) as ResizeDirection);\n }\n return [...set];\n }\n\n private hitDirection(e: PointerEvent): ResizeDirection | null {\n const element = this.el.nativeElement;\n const rect = element.getBoundingClientRect();\n const edge = Math.min(12, Math.max(6, Math.min(rect.width, rect.height) * 0.18));\n const isLeft = e.clientX - rect.left <= edge;\n const isRight = rect.right - e.clientX <= edge;\n const isTop = e.clientY - rect.top <= edge;\n const isBottom = rect.bottom - e.clientY <= edge;\n /**\n * Explicit resize handle has priority.\n */\n const handle =\n e.target instanceof HTMLElement\n ? e.target.closest<HTMLElement>('[data-ngx-resize-handle]')\n : null;\n\n if (handle && element.contains(handle)) {\n const raw = handle.dataset['ngxResizeHandle'] as LogicalResizeDirection | undefined;\n\n if (!raw) {\n return null;\n }\n const resolved = resolveLogicalDirection(raw, isRtl(element)) as ResizeDirection;\n return this.resolvedDirections().includes(resolved) ? resolved : null;\n }\n\n /**\n * These are PHYSICAL screen directions.\n *\n * left -> w\n * right -> e\n *\n * RTL is handled only when a logical direction\n * such as \"start\" / \"end\" is requested.\n */\n const direction =\n isTop && isLeft\n ? 'nw'\n : isTop && isRight\n ? 'ne'\n : isBottom && isLeft\n ? 'sw'\n : isBottom && isRight\n ? 'se'\n : isTop\n ? 'n'\n : isRight\n ? 'e'\n : isBottom\n ? 's'\n : isLeft\n ? 'w'\n : null;\n\n if (!direction) {\n return null;\n }\n return this.resolvedDirections().includes(direction) ? direction : null;\n }\n}\n","import { ApplicationRef, Directive, InjectionToken, TemplateRef, inject } from '@angular/core';\nimport { PlaceHolderRef } from '../placeholder-ref';\nimport { NGX_DROPLIST } from './ngx-drop-list.directive';\n\nexport const NGX_PLACEHOLDER = new InjectionToken<PlaceHolderRef>('ngx-place-holder');\n\n@Directive({\n selector: '[NgxPlaceholder],[ngxPlaceholder]',\n providers: [{ provide: NGX_PLACEHOLDER, useExisting: NgxPlaceholder }],\n})\nexport class NgxPlaceholder {\n readonly _ref = new PlaceHolderRef();\n private readonly list = inject(NGX_DROPLIST, { optional: true, skipSelf: true });\n constructor(public readonly tpl: TemplateRef<unknown>) {\n this._ref.tpl = tpl;\n this._ref.dropList = this.list?._ref;\n // Lets the embedded view join Angular's change-detection tree (matters in zoneless apps,\n // and for app-stability tracking) instead of being rendered once and left dangling.\n this._ref.appRef = inject(ApplicationRef);\n }\n}\n","import {\n ContentChild,\n Directive,\n ElementRef,\n EventEmitter,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Output,\n inject,\n type AfterContentInit,\n} from '@angular/core';\nimport { DropListRef } from '../drop-list-ref';\nimport { DragDropService } from '../services/drag-drop.service';\nimport { IDropEvent } from '../contracts/IDropEvent';\nimport { NGX_PLACEHOLDER, NgxPlaceholder } from './ngx-place-holder.directive';\n\nexport const NGX_DROPLIST = new InjectionToken<NgxDropList>('ngx-drop-list');\n\n@Directive({\n selector: '[NgxDropList],[ngxDropList]',\n providers: [{ provide: NGX_DROPLIST, useExisting: NgxDropList }],\n host: { class: 'ngx-drop-list' },\n})\nexport class NgxDropList<T = any> implements OnInit, OnDestroy, AfterContentInit {\n readonly _ref = new DropListRef<T>();\n @Input('data') set data(value: T) {\n this._ref.data = value;\n }\n @Input() set connectedTo(value: HTMLElement[] | null | undefined) {\n this._ref.connectedTo = value ?? [];\n }\n @Input() set disableSort(value: boolean) {\n this._ref.disableSort = value === true;\n }\n @Output() readonly drop = new EventEmitter<IDropEvent<T>>();\n @ContentChild(NgxPlaceholder, {\n descendants: true,\n })\n private readonly customPlaceholder?: NgxPlaceholder;\n private sub?: { unsubscribe(): void };\n private readonly service = inject(DragDropService);\n\n constructor(private readonly el: ElementRef<HTMLElement>) {}\n\n ngOnInit(): void {\n this._ref.el = this.el.nativeElement;\n\n // Found by walking the real DOM (not Angular's element-injector tree): a list rendered by a\n // recursively-invoked `ngTemplateOutlet` (a tree/outliner UI, where every level re-uses the\n // SAME `<ng-template>`) gets a fresh injector context per invocation, so `inject(TOKEN,\n // {skipSelf})` can never see a provider from another recursion level — the DOM position is\n // what actually determines nesting/grouping for this library's purposes anyway.\n const parentEl = this.el.nativeElement.parentElement;\n const group = this.service.findAncestorGroup(parentEl);\n const parent = this.service.findAncestorDropList(parentEl);\n\n this._ref.dropListGroup = group ?? null;\n group?.add(this._ref);\n parent?._registerChild(this._ref);\n this.sub = this._ref.onDrop.subscribe((e) => this.drop.emit(e));\n this.service.registerDropList(this._ref);\n }\n ngAfterContentInit(): void {\n if (this.customPlaceholder) {\n this._ref.customPlaceholder = this.customPlaceholder._ref;\n }\n }\n\n ngOnDestroy(): void {\n this.sub?.unsubscribe();\n this._ref._release();\n this._ref.parentList?._unregisterChild(this._ref);\n this._ref.dropListGroup?.remove(this._ref);\n this.service.removeDropList(this._ref);\n }\n}\n","import { Directive, ElementRef, InjectionToken, OnDestroy, OnInit, inject } from '@angular/core';\nimport { DropListGroupRef } from '../drop-list-group-ref';\nimport { DragDropService } from '../services/drag-drop.service';\n\nexport const NGX_DROPLIST_GROUP = new InjectionToken<NgxDropListGroup>('ngx-drop-list-group');\n\n/** Wrap several `ngxDropList`s to let items move freely between them. */\n@Directive({\n selector: '[NgxDropListGroup],[ngxDropListGroup]',\n providers: [{ provide: NGX_DROPLIST_GROUP, useExisting: NgxDropListGroup }],\n})\nexport class NgxDropListGroup implements OnInit, OnDestroy {\n readonly _ref = new DropListGroupRef();\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly service = inject(DragDropService);\n\n ngOnInit(): void {\n // Registered by DOM element (not just provided via DI) so a list nested inside a recursive\n // `ngTemplateOutlet` tree can still find this group by walking its real ancestors — see the\n // comment on `DragDropService`'s registries for why DI alone can't do this.\n this.service.registerGroup(this.el.nativeElement, this._ref);\n }\n\n ngOnDestroy(): void {\n this._ref.lists.clear();\n this.service.removeGroup(this.el.nativeElement);\n }\n}\n","export function moveItemInArray<T>(array: T[], from: number, to: number): void {\n const f = clamp(from, array.length - 1);\n const t = clamp(to, array.length - 1);\n if (f === t) return;\n const target = array[f];\n const delta = t < f ? -1 : 1;\n for (let i = f; i !== t; i += delta) array[i] = array[i + delta];\n array[t] = target;\n}\n\nexport function transferArrayItem<T>(src: T[], dst: T[], from: number, to: number): void {\n const f = clamp(from, src.length - 1);\n const t = clamp(to, dst.length);\n if (src.length) dst.splice(t, 0, src.splice(f, 1)[0]);\n}\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @param currentArray Array from which to copy the item.\n * @param targetArray Array into which is copy the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n *\n */\nexport function copyArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n}\n\nfunction clamp(v: number, max: number) {\n return Math.max(0, Math.min(max, v));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;AAIG;AACH,MAAM,SAAS,GAAG,GAAG;AAErB;SACgB,WAAW,CACzB,QAAiB,EACjB,YAAiC,EACjC,OAAe,EAAA;AAEf,IAAA,IAAI,CAAC,YAAY;AAAE,QAAA,OAAO,OAAO;AACjC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,GAAG,O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,CAAC,CAAC,CAAC,GAAG,MAAM;AACnB;AAEM,SAAU,iBAAiB,CAAI,GAAQ,EAAE,GAAQ,EAAE,IAAY,EAAE,EAAU,EAAA;AAC/E,IAAA,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;IACrC,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC;IAC/B,IAAI,GAAG,CAAC,MAAM;AAAE,QAAA,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD;AACA;;;;;;;;AAQG;AACG,SAAU,aAAa,CAC3B,YAAiB,EACjB,WAAgB,EAChB,YAAoB,EACpB,WAAmB,EAAA;IAEnB,MAAM,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;AAEjD,IAAA,IAAI,YAAY,CAAC,MAAM,EAAE;AACvB,QAAA,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;IACvD;AACF;AAEA,SAAS,KAAK,CAAC,CAAS,EAAE,GAAW,EAAA;AACnC,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACtC;;ACvCA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -222,9 +222,9 @@ declare class DragDropService {
|
|
|
222
222
|
registerGroup(el: HTMLElement, ref: DropListGroupRef): void;
|
|
223
223
|
removeGroup(el: HTMLElement): void;
|
|
224
224
|
/** Nearest registered drop list starting at (and including) `start`, walking up the DOM. */
|
|
225
|
-
findAncestorDropList(start: HTMLElement | null): DropListRef | null;
|
|
225
|
+
findAncestorDropList(start: HTMLElement | ParentNode | null): DropListRef | null;
|
|
226
226
|
/** Nearest registered drop-list group starting at (and including) `start`, walking up the DOM. */
|
|
227
|
-
findAncestorGroup(start: HTMLElement | null): DropListGroupRef | null;
|
|
227
|
+
findAncestorGroup(start: HTMLElement | ParentNode | null): DropListGroupRef | null;
|
|
228
228
|
begin(ref: DragRef<any>): void;
|
|
229
229
|
end(ref: DragRef<any>): void;
|
|
230
230
|
cancelActive(): void;
|