forty-cdk 0.43.0 → 0.45.0
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.
- package/accordion/README.md +16 -3
- package/combobox/README.md +15 -4
- package/disclosure/README.md +15 -3
- package/fesm2022/forty-cdk-accordion.mjs +64 -17
- package/fesm2022/forty-cdk-accordion.mjs.map +1 -1
- package/fesm2022/forty-cdk-combobox.mjs +2 -2
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
- package/fesm2022/forty-cdk-core.mjs +191 -44
- package/fesm2022/forty-cdk-core.mjs.map +1 -1
- package/fesm2022/forty-cdk-defaults.mjs.map +1 -1
- package/fesm2022/forty-cdk-disclosure.mjs +69 -15
- package/fesm2022/forty-cdk-disclosure.mjs.map +1 -1
- package/fesm2022/forty-cdk-drag-drop.mjs +1 -1
- package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -1
- package/fesm2022/forty-cdk-listbox.mjs +2 -3
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
- package/fesm2022/forty-cdk-number-input.mjs +1 -1
- package/fesm2022/forty-cdk-number-input.mjs.map +1 -1
- package/fesm2022/forty-cdk-otp-input.mjs +1 -2
- package/fesm2022/forty-cdk-otp-input.mjs.map +1 -1
- package/fesm2022/forty-cdk-table.mjs +49 -7
- package/fesm2022/forty-cdk-table.mjs.map +1 -1
- package/fesm2022/forty-cdk-tree.mjs +2 -3
- package/fesm2022/forty-cdk-tree.mjs.map +1 -1
- package/package.json +1 -1
- package/radio-group/README.md +2 -2
- package/table/README.md +2 -0
- package/toggle/README.md +2 -2
- package/types/forty-cdk-accordion.d.ts +27 -4
- package/types/forty-cdk-combobox.d.ts +6 -6
- package/types/forty-cdk-core.d.ts +45 -2
- package/types/forty-cdk-defaults.d.ts +4 -3
- package/types/forty-cdk-disclosure.d.ts +37 -4
- package/types/forty-cdk-table.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forty-cdk-drag-drop.mjs","names":["FOR_DRAG_DROP_DEFAULTS","POINTER_ARM_THRESHOLD_PX","FOR_DRAG_DROP_DEFAULTS"],"sources":["../../../projects/forty-cdk/drag-drop/src/auto-scroll.ts","../../../projects/forty-cdk/drag-drop/src/clip-region.ts","../../../projects/forty-cdk/drag-drop/src/drag-positions.ts","../../../projects/forty-cdk/drag-drop/src/drag-drop-context.ts","../../../projects/forty-cdk/drag-drop/src/drop-list-group.ts","../../../projects/forty-cdk/drag-drop/src/placeholder-position.ts","../../../projects/forty-cdk/drag-drop/src/placeholder-sorter.ts","../../../projects/forty-cdk/drag-drop/src/flip.ts","../../../projects/forty-cdk/drag-drop/src/reorder-animator.ts","../../../projects/forty-cdk/drag-drop/src/drop-list.ts","../../../projects/forty-cdk/drag-drop/src/handle-guard.ts","../../../projects/forty-cdk/drag-drop/src/drag-preview.ts","../../../projects/forty-cdk/drag-drop/src/drag-placeholder.ts","../../../projects/forty-cdk/drag-drop/src/draggable.ts","../../../projects/forty-cdk/drag-drop/src/free-drag.ts","../../../projects/forty-cdk/drag-drop/src/drag-handle.ts","../../../projects/forty-cdk/drag-drop/src/move-item-in-array.ts"],"sourcesContent":["import { composedParentElement, type DragRect } from 'forty-cdk/core';\n\n/** A 2-D scroll velocity vector produced by `computeScrollVelocity`. */\nexport interface AutoScrollVelocity {\n readonly x: number;\n readonly y: number;\n}\n\nconst NO_VELOCITY: AutoScrollVelocity = { x: 0, y: 0 };\n\nfunction axisVelocity(\n pos: number,\n start: number,\n end: number,\n edgeSize: number,\n maxSpeed: number,\n): number {\n if (edgeSize <= 0 || pos < start || pos > end) {\n return 0;\n }\n const distStart = pos - start;\n if (distStart <= edgeSize) {\n return -maxSpeed * (1 - distStart / edgeSize);\n }\n const distEnd = end - pos;\n if (distEnd <= edgeSize) {\n return maxSpeed * (1 - distEnd / edgeSize);\n }\n return 0;\n}\n\n/**\n * Computes a 2-D scroll velocity from the pointer position relative to a\n * scroll container's bounding rect. Each axis is computed independently:\n * negative values scroll toward the start edge, positive toward the end.\n * Velocity scales linearly with proximity; at the edge = ±`maxSpeed`, at\n * `edgeSize` pixels away = 0.\n */\nexport function computeScrollVelocity(\n rect: DragRect,\n point: { readonly x: number; readonly y: number },\n edgeSize: number,\n maxSpeed: number,\n): AutoScrollVelocity {\n return {\n x: axisVelocity(point.x, rect.left, rect.right, edgeSize, maxSpeed),\n y: axisVelocity(point.y, rect.top, rect.bottom, edgeSize, maxSpeed),\n };\n}\n\nfunction isScrollable(el: HTMLElement, win: Window): boolean {\n const style = win.getComputedStyle(el);\n const overflowY = style.overflowY;\n const overflowX = style.overflowX;\n const scrollsY =\n (overflowY === 'auto' || overflowY === 'scroll') && el.scrollHeight > el.clientHeight;\n const scrollsX =\n (overflowX === 'auto' || overflowX === 'scroll') && el.scrollWidth > el.clientWidth;\n return scrollsY || scrollsX;\n}\n\n/**\n * Walks up the composed tree from `start` (inclusive), stopping before\n * `documentElement` and `body`, and returns every scrollable ancestor from the\n * innermost outward. An empty result leaves the viewport as the only target.\n */\nfunction findScrollContainers(start: HTMLElement | null, win: Window): HTMLElement[] {\n const containers: HTMLElement[] = [];\n let el = start;\n while (el !== null && el !== win.document.documentElement && el !== win.document.body) {\n if (isScrollable(el, win)) {\n containers.push(el);\n }\n el = composedParentElement(el);\n }\n return containers;\n}\n\n/** An active auto-scroll controller returned by `createAutoScroller`. */\nexport interface AutoScroller {\n /** Arms or disarms the rAF loop for the given pointer position. */\n update(point: { x: number; y: number }): void;\n /** Cancels the loop and clears cached state. Idempotent. */\n stop(): void;\n}\n\n/** Configuration passed to `createAutoScroller`. */\nexport interface AutoScrollerConfig {\n /** The list host element; used as the fallback start for the scrollable-container search. */\n readonly host: HTMLElement;\n /** The browser `Window`, or `null` in SSR / test environments without a DOM. */\n readonly win: Window | null;\n /** Pixel distance from the scroll edge that arms auto-scroll. */\n readonly edgeSize: number;\n /** Maximum scroll delta (px) applied per animation frame. */\n readonly maxSpeed: number;\n /** Called after each frame that actually scrolls, so callers can re-resolve the drop target. */\n readonly onFrame: () => void;\n /**\n * Optional resolver for the element the scrollable-container search should start from, given the\n * current pointer position. Returns the element under the pointer (or `null` to fall back to\n * `host`). Supplied by callers that drag across connected lists so auto-scroll follows the\n * container the pointer is actually over — not always the origin list. The search is re-run on\n * every `update`, so a pointer crossing from one list into another scrolls the destination\n * container.\n */\n readonly resolveScrollHost?: (point: { x: number; y: number }) => HTMLElement | null;\n}\n\ninterface ScrollTarget {\n velocity(point: { x: number; y: number }, edgeSize: number, maxSpeed: number): AutoScrollVelocity;\n scrollBy(dx: number, dy: number): void;\n}\n\nfunction towardRoom(delta: number, offset: number, max: number): number {\n if (delta < 0) {\n return offset >= 1 ? delta : 0;\n }\n return offset <= max - 1 ? delta : 0;\n}\n\nfunction elementTarget(el: HTMLElement, win: Window): ScrollTarget {\n return {\n velocity(point, edgeSize, maxSpeed): AutoScrollVelocity {\n const r = el.getBoundingClientRect();\n if (point.x < r.left || point.x > r.right || point.y < r.top || point.y > r.bottom) {\n return NO_VELOCITY;\n }\n const v = computeScrollVelocity(r, point, edgeSize, maxSpeed);\n const maxX = el.scrollWidth - el.clientWidth;\n const offsetX =\n v.x !== 0 && win.getComputedStyle(el).direction === 'rtl'\n ? el.scrollLeft + maxX\n : el.scrollLeft;\n return {\n x: towardRoom(v.x, offsetX, maxX),\n y: towardRoom(v.y, el.scrollTop, el.scrollHeight - el.clientHeight),\n };\n },\n scrollBy(dx: number, dy: number): void {\n el.scrollLeft += dx;\n el.scrollTop += dy;\n },\n };\n}\n\nfunction viewportTarget(win: Window): ScrollTarget {\n return {\n velocity(point, edgeSize, maxSpeed): AutoScrollVelocity {\n const rect = { left: 0, top: 0, right: win.innerWidth, bottom: win.innerHeight };\n return computeScrollVelocity(rect, point, edgeSize, maxSpeed);\n },\n scrollBy(dx: number, dy: number): void {\n win.scrollBy(dx, dy);\n },\n };\n}\n\n/**\n * Creates an auto-scroller that drives a `requestAnimationFrame` loop while a\n * pointer drag is near a scroll edge. The candidates are the scrollable\n * containers from the list (or the one under the pointer) outward, then the\n * viewport; each frame scrolls the innermost candidate whose rect holds the\n * pointer, whose edge band the pointer is in, and which can still scroll that\n * way. Deltas are applied instantaneously per frame — no CSS smooth-scroll\n * easing — which is the `prefers-reduced-motion`-safe approach: scrolling is\n * functional, not decorative, so no reduced-motion branch is needed.\n *\n * Returns a no-op controller when `config.win` is falsy or lacks\n * `requestAnimationFrame` (SSR / environments without a window).\n */\nexport function createAutoScroller(config: AutoScrollerConfig): AutoScroller {\n const maybeWin = config.win;\n if (!maybeWin || typeof maybeWin.requestAnimationFrame !== 'function') {\n return { update() {}, stop() {} };\n }\n\n const win: Window = maybeWin;\n\n let targets: readonly ScrollTarget[] = [];\n let point: { x: number; y: number } | null = null;\n let rafId: number | null = null;\n\n function resolveTargets(at: { x: number; y: number }): readonly ScrollTarget[] {\n const start = config.resolveScrollHost\n ? (config.resolveScrollHost(at) ?? config.host)\n : config.host;\n return [\n ...findScrollContainers(start, win).map((el) => elementTarget(el, win)),\n viewportTarget(win),\n ];\n }\n\n function activeScroll(at: {\n x: number;\n y: number;\n }): { target: ScrollTarget; v: AutoScrollVelocity } | null {\n for (const target of targets) {\n const v = target.velocity(at, config.edgeSize, config.maxSpeed);\n if (v.x !== 0 || v.y !== 0) {\n return { target, v };\n }\n }\n return null;\n }\n\n function tick(): void {\n rafId = null;\n if (point === null) {\n return;\n }\n const active = activeScroll(point);\n if (active === null) {\n return;\n }\n active.target.scrollBy(active.v.x, active.v.y);\n config.onFrame();\n rafId = win.requestAnimationFrame(tick);\n }\n\n return {\n update(next: { x: number; y: number }): void {\n point = next;\n targets = resolveTargets(next);\n if (activeScroll(next) === null) {\n if (rafId !== null) {\n win.cancelAnimationFrame(rafId);\n rafId = null;\n }\n } else if (rafId === null) {\n rafId = win.requestAnimationFrame(tick);\n }\n },\n stop(): void {\n if (rafId !== null) {\n win.cancelAnimationFrame(rafId);\n rafId = null;\n }\n targets = [];\n point = null;\n },\n };\n}\n","import { composedParentElement, type DragRect } from 'forty-cdk/core';\n\nexport interface ClippingAncestor {\n readonly el: HTMLElement;\n readonly x: boolean;\n readonly y: boolean;\n}\n\nexport function findClippingAncestors(host: HTMLElement, win: Window): readonly ClippingAncestor[] {\n const doc = win.document;\n const clippers: ClippingAncestor[] = [];\n let position = win.getComputedStyle(host).position;\n for (\n let el = composedParentElement(host);\n el !== null && el !== doc.body && el !== doc.documentElement;\n el = composedParentElement(el)\n ) {\n if (position === 'fixed') {\n break;\n }\n const style = win.getComputedStyle(el);\n if (position === 'absolute' && style.position === 'static') {\n continue;\n }\n position = style.position;\n const x = style.overflowX !== 'visible';\n const y = style.overflowY !== 'visible';\n if (x || y) {\n clippers.push({ el, x, y });\n }\n }\n return clippers;\n}\n\nexport function clipRegion(clippers: readonly ClippingAncestor[]): DragRect | undefined {\n if (clippers.length === 0) {\n return undefined;\n }\n let left = -Infinity;\n let top = -Infinity;\n let right = Infinity;\n let bottom = Infinity;\n for (const { el, x, y } of clippers) {\n const rect = el.getBoundingClientRect();\n if (x) {\n left = Math.max(left, rect.left);\n right = Math.min(right, rect.right);\n }\n if (y) {\n top = Math.max(top, rect.top);\n bottom = Math.min(bottom, rect.bottom);\n }\n }\n return { left, top, right, bottom };\n}\n","/** One reachable keyboard drop position: a container plus an insertion index within it. */\nexport interface DragSlot {\n /** Index into the ordered `[source, ...connected]` container list (0 = source). */\n readonly containerIndex: number;\n /** Insertion index within that container. */\n readonly index: number;\n}\n\n/**\n * Builds the flat, ordered sequence of reachable drop positions for a keyboard drag.\n * - The source container (index 0) contributes one slot per existing item\n * (`0 .. sourceCount - 1`): the dragged item is *reinserted* among the current items, so\n * the valid destination indices are exactly the existing positions.\n * - Each connected container contributes one slot per insertion gap (`0 .. count`,\n * inclusive of the append position), since the item is *added* to it.\n * Order: all source slots, then each connected container's slots in `connectedCounts` order.\n */\nexport function buildDragSlots(\n sourceCount: number,\n connectedCounts: readonly number[],\n): DragSlot[] {\n const slots: DragSlot[] = [];\n const clampedSource = Math.max(0, sourceCount);\n for (let i = 0; i < clampedSource; i++) {\n slots.push({ containerIndex: 0, index: i });\n }\n for (let ci = 0; ci < connectedCounts.length; ci++) {\n const count = Math.max(0, connectedCounts[ci]!);\n for (let i = 0; i <= count; i++) {\n slots.push({ containerIndex: ci + 1, index: i });\n }\n }\n return slots;\n}\n\n/** Flat-sequence position of `(containerIndex, index)`, or `-1` if not present. */\nexport function indexOfSlot(\n slots: readonly DragSlot[],\n containerIndex: number,\n index: number,\n): number {\n return slots.findIndex((s) => s.containerIndex === containerIndex && s.index === index);\n}\n","import { inject, InjectionToken, type Signal } from '@angular/core';\nimport {\n assertRootContext,\n type DragPreview,\n type ListNavigationAction,\n orphanContextError,\n type WritingDirection,\n} from 'forty-cdk/core';\n\n/** A registered draggable item, as seen by its drop list. */\nexport interface ForDraggableHandle {\n readonly host: HTMLElement;\n /** The consumer-supplied data payload for this item. */\n readonly data: Signal<unknown>;\n /** Effective disabled (item's own `dragDisabled` OR the list being disabled). */\n readonly disabled: Signal<boolean>;\n /** The item's `[textValue]`: the name drag announcements use in place of its own. */\n readonly textValue: Signal<string | null>;\n /**\n * Whether a pointer press on `target` may start a drag of this item: `false` for a press inside\n * a draggable nested in it, or outside its `[forDragHandle]`s when it has any.\n */\n acceptsPointerStart(target: EventTarget | null): boolean;\n /** Emit the item's `dragStart` for a drag of it starting at source `index`. */\n emitDragStart(index: number): void;\n /** Emit the item's `dragEnd`; `dropped` is `true` on a committed drop, `false` on cancel. */\n emitDragEnd(dropped: boolean): void;\n}\n\n/**\n * Coordination contract owned by `ForDropList` and consumed by each `ForDraggable`. Also the\n * public handle type used by `[connectedTo]` and the `dragDrop` event's\n * `previousContainer` / `container` — advanced consumers may read `host` / `items`; the\n * interaction methods exist for the directive pieces.\n */\nexport interface ForDropListContext {\n readonly host: HTMLElement;\n readonly orientation: Signal<'horizontal' | 'vertical' | 'mixed'>;\n readonly dir: Signal<WritingDirection>;\n /** Effective disabled of the whole list. */\n readonly disabled: Signal<boolean>;\n readonly items: Signal<readonly ForDraggableHandle[]>;\n /** Insertion index this list is the current drop target at, else `null`. */\n readonly dragOverIndex: Signal<number | null>;\n\n setDragOver(index: number | null): void;\n\n registerItem(handle: ForDraggableHandle): void;\n unregisterItem(handle: ForDraggableHandle): void;\n\n /** Roving tab-stop value for `el` before/after roving engages (mirror Listbox's pattern). */\n itemTabindex(el: HTMLElement): -1 | 0 | null;\n /**\n * Whether an external `FOR_DROP_LIST_ROVING_DELEGATE` — not this list's own roving —\n * decides `el`'s tab order. Drives the `aria-disabled` an item emits: a disabled item\n * whose tab order a composing widget governs is a control of that widget (a\n * `role=\"columnheader\"` in a grid) that merely cannot be lifted, so announcing the host\n * as unavailable would disable the composed control instead of the drag affordance.\n */\n isRovingDelegated(el: HTMLElement): boolean;\n isFirstFocusableItem(el: HTMLElement): boolean;\n isItemHighlighted(el: HTMLElement): boolean;\n /**\n * Whether a live drag of `el` is in progress — this list's own keyboard / pointer lift, or a\n * lift a composing coordinator owns and drives itself (`ForDropList.beginCoordinatorLift`).\n * Drives `[forDraggable]`'s `data-dragging`.\n *\n * Broader than {@link isLifted}, which answers only for the list's own lift —\n * the state {@link moveLifted} / {@link drop} / {@link cancel} act on.\n */\n isItemDragging(el: HTMLElement): boolean;\n setActiveItem(el: HTMLElement): void;\n\n /** Idle roving focus move from `el`. */\n navigate(el: HTMLElement, action: ListNavigationAction): void;\n\n /** Start a keyboard drag for `el`; returns its source index, or `-1` if it could not lift. */\n lift(el: HTMLElement): number;\n /** Whether `el` is the currently lifted item. */\n isLifted(el: HTMLElement): boolean;\n /** Step the logical drop target while lifted. */\n moveLifted(action: ListNavigationAction): void;\n /**\n * Commit the current drag (emits `dragDrop` on the source list). No-op if nothing lifted.\n *\n * After a **keyboard** drop whose lifted item held document focus, focus is restored on the next\n * render to the item whose `dragData` is the dropped item, else to the item at `currentIndex` in\n * the target container — so a cross-list transfer, a `@for` re-render that detaches the lifted\n * element, or one that rebinds its slot to a neighbour does not strand the keyboard user on\n * `<body>` or on the wrong item. The restore is skipped when focus already sits somewhere other than `<body>`, so a\n * consumer who moves focus inside their `(dragDrop)` handler keeps it. Pointer drops never\n * move focus.\n */\n drop(): void;\n /** Abort the current drag without emitting `dragDrop`. */\n cancel(): void;\n /**\n * Begin a pointer drag for `el` at viewport point `point`. Sets up the same session state as a\n * keyboard lift. `preview` is the floating element supplied by the draggable (a consumer\n * `[forDragPreview]` template) — either a full {@link DragPreview} or the minimal\n * `{ moveTo, destroy }` shape; when omitted, the list creates the default cloned preview.\n * Returns the source index, or `-1` if it could not lift.\n */\n pointerLift(\n el: HTMLElement,\n point: { x: number; y: number },\n preview?: DragPreview | { moveTo(x: number, y: number): void; destroy(): void } | null,\n ): number;\n /** Update the live pointer drop target + preview position. No-op if nothing is lifted. */\n pointerMove(point: { x: number; y: number }): void;\n /**\n * Register the rendered placeholder's root nodes with the source list so it can reposition\n * them to the live drop index during a `liveSort` pointer drag, after a composing coordinator's\n * `layoutPlaceholder` has placed them. Pass `null` to clear. Without `liveSort` the nodes stay\n * where they were rendered. Called by `ForDraggable`.\n */\n setLivePlaceholder(nodes: readonly Node[] | null): void;\n}\n\nexport const FOR_DROP_LIST_CONTEXT = new InjectionToken<ForDropListContext>(\n 'FOR_DROP_LIST_CONTEXT',\n);\n\n/**\n * Optional external authority for a `[forDropList]`'s roving tab order, provided on the\n * list host by a wrapper that composes the list into a larger roving model. When present,\n * the list defers each item's roving `tabindex` to the delegate instead of its own\n * `RovingTabindex`, so the composed list shares one tab stop with the surrounding widget\n * rather than exposing a second one.\n *\n * `ForTableColumnReorder` provides one backed by the table's composite grid roving so a\n * sortable + column-reorderable grid exposes a single tab stop across header and body,\n * per the WAI-ARIA Data Grid pattern. The same composed roving can also govern each item's\n * `data-highlighted` styling hook via {@link isItemHighlighted}.\n *\n * Both members return `null` to defer to the list's own roving — a wrapper hands control\n * back for states where the composed model does not apply (e.g. a `mode=\"table\"` header row\n * that is not part of any composite grid).\n */\nexport interface ForDropListRovingDelegate {\n /**\n * Roving `tabindex` for `el` (`0` for the single tab stop, `-1` otherwise), or `null` to\n * defer to the list's own roving.\n *\n * A non-`null` answer is the **whole** tab-order decision for that item: it outranks the\n * item's own disabled state, so answering `0` for a `[dragDisabled]` item makes it\n * focusable and the group's tab stop (what a pinned column in a composite grid needs), and\n * answering `-1` for every item leaves the group with no tab stop. A delegate that does not\n * want that authority for an item returns `null` there. The composed widget also owns focus\n * activation for such an item, since a disabled draggable does not claim the list's active\n * item on focus.\n */\n itemTabindex(el: HTMLElement): -1 | 0 | null;\n /**\n * Whether `el` is the current keyboard-highlighted candidate — drives its `data-highlighted`\n * styling hook — or `null` to defer to the list's own roving highlight. Optional: a delegate\n * that governs only the tab order omits it, and each item's `data-highlighted` follows the\n * list's own roving.\n */\n isItemHighlighted?(el: HTMLElement): boolean | null;\n}\n\nexport const FOR_DROP_LIST_ROVING_DELEGATE = new InjectionToken<ForDropListRovingDelegate>(\n 'FOR_DROP_LIST_ROVING_DELEGATE',\n);\n\n/**\n * A coordinator composing a `[forDropList]` over a rendered window of a larger dataset, provided\n * on the list host — `[forVirtualReorder]` and `[forTableRowReorder]` provide one. With a\n * coordinator in scope the list:\n *\n * - announces every lift, move and drop, and reports `[forDraggable]`'s `dragStart` index, at the\n * positions the coordinator resolves, counted against {@link count};\n * - is a **closed** list: it joins no `[forDropListGroup]`, connects to no other list, and so can\n * neither send an item to another list nor receive one. The coordinator's output describes a\n * reorder within its own dataset, which a transfer is not.\n */\nexport interface ForDropListCoordinator {\n /** The total every drag announcement counts positions against, such as the dataset size. */\n count(): number;\n /**\n * The `from` / `to` positions the coordinator reports for the lifted item at window index\n * `previousIndex` resolved to window insertion index `currentIndex`. A lift is resolved as\n * `resolveReorder(from, from)` and reports its `from`.\n */\n resolveReorder(previousIndex: number, currentIndex: number): { from: number; to: number };\n /**\n * Lays out the `[forDragPlaceholder]` root nodes rendered for the pointer-lifted `lifted` item,\n * once, before they are first painted. A coordinator whose items are positioned out of flow\n * places the placeholder in the lifted item's slot here; without it the placeholder renders as\n * an in-flow sibling of the item.\n */\n layoutPlaceholder?(nodes: readonly Node[], lifted: HTMLElement): void;\n}\n\nexport const FOR_DROP_LIST_COORDINATOR = new InjectionToken<ForDropListCoordinator>(\n 'FOR_DROP_LIST_COORDINATOR',\n);\n\n/**\n * Optional DI seam, provided on an ancestor of the draggables, that restricts\n * which keys may start a keyboard lift on a `[forDraggable]`. When present,\n * `ForDraggable` consults it before lifting on Enter / Space and skips the lift\n * for any key the guard rejects, leaving that key to a co-located affordance\n * that owns it. Absent for a plain `[forDropList]`, where both keys lift.\n *\n * `ForTableColumnReorder` provides one so a header cell that is both sortable and\n * column-reorderable splits the two keyboard activations along WAI-ARIA lines —\n * `Space` lifts the column for reordering, `Enter` is left to the sort header —\n * detecting the co-location by DOM marker rather than importing any table symbol.\n */\nexport interface ForDraggableLiftGuard {\n /**\n * Whether a keyboard `Enter` / `Space` on `host` may start a lift. Return\n * `false` to defer that key to a co-located affordance; `true` to lift.\n */\n canLiftOnKey(event: KeyboardEvent, host: HTMLElement): boolean;\n}\n\nexport const FOR_DRAGGABLE_LIFT_GUARD = new InjectionToken<ForDraggableLiftGuard>(\n 'FOR_DRAGGABLE_LIFT_GUARD',\n);\n\nexport function injectDropListContext(piece: string): ForDropListContext {\n const ctx = inject(FOR_DROP_LIST_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-DRAG-DROP-001',\n piece,\n root: '[forDropList]',\n token: 'FOR_DROP_LIST_CONTEXT',\n });\n }\n return ctx;\n}\n\n/** Emitted by the **source** `ForDropList` on a committed drop (keyboard or pointer). */\nexport interface ForDragDropEvent {\n /**\n * The dropped item's `[dragData]` payload. Typed `unknown` because a\n * `[forDropList]` owns no item data (bring-your-own-data), so there is no\n * input for Angular to infer an item type from. Narrow it against your own\n * model when you need it, or reorder purely by `previousIndex` /\n * `currentIndex` and ignore it.\n */\n readonly item: unknown;\n readonly previousContainer: ForDropListContext;\n readonly container: ForDropListContext;\n readonly previousIndex: number;\n readonly currentIndex: number;\n}\n\n/** Emitted by `ForDraggable` when a drag (keyboard or pointer) starts. */\nexport interface ForDragStartEvent {\n readonly source: ForDropListContext;\n /**\n * The dragged item's source index in its list, or the position a `FOR_DROP_LIST_COORDINATOR`\n * reports for it when one composes the list (a dataset index under virtualization).\n */\n readonly index: number;\n}\n\n/** Emitted by `ForDraggable` when a drag ends (committed or cancelled). */\nexport interface ForDragEndEvent {\n /** `true` on a committed drop, `false` on cancel. */\n readonly dropped: boolean;\n}\n\n/**\n * Internal coordination surface a `ForDraggable` / `ForFreeDrag` exposes to its\n * `[forDragHandle]` children.\n */\nexport interface ForDraggableContext {\n /** Register a handle element; while any handle is registered, pointer drags may only start on one. */\n registerHandle(el: HTMLElement): void;\n unregisterHandle(el: HTMLElement): void;\n}\n\n/** The channels the drag-drop pieces read off their `[forDraggable]` / `[forFreeDrag]` and no consumer calls. */\nexport interface DraggablePieceContext {\n /** `'none'` while a handle should suppress native touch scrolling, `null` while dragging is disabled. */\n handleTouchAction(): 'none' | null;\n /** Register the host of a nested draggable; a press inside it never starts a drag of this one. */\n registerNestedDraggable(el: HTMLElement): void;\n unregisterNestedDraggable(el: HTMLElement): void;\n}\n\n/**\n * Internal view of {@link FOR_DRAGGABLE_CONTEXT}: everything {@link ForDraggableContext}\n * publishes plus the {@link DraggablePieceContext} channels.\n *\n * Never exported from `public-api.ts`. `ForDraggable` and `ForFreeDrag` declare those\n * members TS-`private`, which keeps them out of the emitted `.d.ts` while `useExisting`\n * still satisfies this contract at runtime.\n */\nexport interface DraggableContext extends ForDraggableContext, DraggablePieceContext {}\n\n/**\n * DI token for the coordination surface `[forDraggable]` / `[forFreeDrag]` provide.\n *\n * Publicly typed as {@link ForDraggableContext}. The pieces read the same token at an\n * internal type that adds their channels, so a wrapper re-providing it must alias it to\n * the directive: `{ provide: FOR_DRAGGABLE_CONTEXT, useExisting: MyDraggable }`, where\n * `MyDraggable` extends `ForDraggable` or `ForFreeDrag`. A value that merely satisfies the\n * declared type resolves too, and is rejected in dev mode by the first piece to reach a channel.\n */\nexport const FOR_DRAGGABLE_CONTEXT = new InjectionToken<ForDraggableContext>(\n 'FOR_DRAGGABLE_CONTEXT',\n);\n\nexport function injectDraggableContext(piece: string): DraggableContext {\n const ctx = inject(FOR_DRAGGABLE_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-DRAG-DROP-002',\n piece,\n root: '[forDraggable] or [forFreeDrag]',\n token: 'FOR_DRAGGABLE_CONTEXT',\n });\n }\n return asDraggableContext(ctx, piece);\n}\n\nexport function asDraggableContext(ctx: ForDraggableContext, piece: string): DraggableContext {\n const widened = ctx as unknown as DraggableContext;\n assertRootContext({\n entryPoint: 'drag-drop',\n token: 'FOR_DRAGGABLE_CONTEXT',\n root: '[forDraggable] or [forFreeDrag]',\n piece,\n probe: () => widened.registerNestedDraggable,\n });\n return widened;\n}\n","import { Directive, InjectionToken, signal, type Signal } from '@angular/core';\n\nimport type { ForDropListContext } from './drag-drop-context';\n\nexport const FOR_DROP_LIST_GROUP = new InjectionToken<ForDropListGroup>('FOR_DROP_LIST_GROUP');\n\n/**\n * Groups sibling `[forDropList]` elements so items can be transferred between\n * them without hand-wiring `[connectedTo]` on each list. Every list nested\n * under `[forDropListGroup]` automatically becomes a connected transfer target\n * for every other member of the group.\n */\n@Directive({\n selector: '[forDropListGroup]',\n exportAs: 'forDropListGroup',\n providers: [{ provide: FOR_DROP_LIST_GROUP, useExisting: ForDropListGroup }],\n})\nexport class ForDropListGroup {\n readonly #members = signal<readonly ForDropListContext[]>([]);\n\n /** All registered drop lists in this group, in registration order. */\n readonly members: Signal<readonly ForDropListContext[]> = this.#members.asReadonly();\n\n /** @internal */\n register(ctx: ForDropListContext): void {\n const current = this.#members();\n if (current.includes(ctx)) {\n return;\n }\n this.#members.set([...current, ctx]);\n }\n\n /** @internal */\n unregister(ctx: ForDropListContext): void {\n this.#members.set(this.#members().filter((c) => c !== ctx));\n }\n}\n","/** Where to insert the live-sort placeholder: a parent node and the node to insert before. */\nexport interface PlaceholderInsertion {\n /** The DOM node the placeholder's nodes should be inserted into. */\n readonly parent: Node;\n /** The reference node to insert before; `null` means append to `parent`. */\n readonly ref: Node | null;\n}\n\n/**\n * Computes the DOM insertion point for the live-sort placeholder.\n *\n * @param hosts The target container's non-lifted item host elements, in DOM order.\n * @param index Insertion index within `hosts` (`0 .. hosts.length`, inclusive of append).\n * @param container Fallback parent used when the container has no items.\n * @returns The `parent` node and the `ref` node to insert before (`null` = append).\n */\nexport function placeholderInsertion(\n hosts: readonly HTMLElement[],\n index: number,\n container: HTMLElement,\n): PlaceholderInsertion {\n if (index < hosts.length) {\n const at = hosts[index]!;\n return { parent: at.parentNode ?? container, ref: at };\n }\n const last = hosts[hosts.length - 1];\n if (last) {\n return { parent: last.parentNode ?? container, ref: last.nextSibling };\n }\n return { parent: container, ref: null };\n}\n\n/**\n * Clamps a live-sort placeholder insertion index so it cannot cross a `dragDisabled`\n * (pinned) item. Each disabled host is a hard wall bounding the contiguous run of enabled\n * positions that contains `origin` — the gap the dragged item was lifted from — so the\n * placeholder stops at the first pinned item instead of travelling past it.\n *\n * Visual only: the committed drop index is resolved separately and is left unaffected. With\n * no disabled host the input index is returned unchanged (clamped to the valid range).\n *\n * @param index Raw insertion index resolved from pointer geometry (`0 .. disabled.length`).\n * @param disabled Disabled flag per non-lifted host, in DOM order.\n * @param origin Insertion index the dragged item was lifted from (its source gap).\n * @returns `index` clamped to the enabled run around `origin`.\n */\nexport function fencePlaceholderIndex(\n index: number,\n disabled: readonly boolean[],\n origin: number,\n): number {\n let lower = 0;\n for (let i = origin - 1; i >= 0; i--) {\n if (disabled[i]) {\n lower = i + 1;\n break;\n }\n }\n let upper = disabled.length;\n for (let i = origin; i < disabled.length; i++) {\n if (disabled[i]) {\n upper = i;\n break;\n }\n }\n return Math.max(lower, Math.min(upper, index));\n}\n","import type { ForDraggableHandle, ForDropListContext } from './drag-drop-context';\nimport { fencePlaceholderIndex, placeholderInsertion } from './placeholder-position';\n\n/** Options handed to {@link PlaceholderSorter} at lift time. */\nexport interface PlaceholderSorterOptions {\n /** The source list the drag originates from (the fence is computed against its items). */\n readonly source: ForDropListContext;\n /** The lifted item's host element (excluded from the target item rects). */\n readonly lifted: HTMLElement;\n /** The owning document (a fragment is built from it to batch the node move). */\n readonly doc: Document;\n /** The source list's items, by host, used to compute the `dragDisabled` fence. */\n readonly sourceItems: () => readonly ForDraggableHandle[];\n /** Index of `lifted` within the source list's items (the fence origin). */\n readonly originIndex: () => number;\n}\n\n/**\n * Lazy `liveSort` strategy: relocates the rendered placeholder's root nodes to the live resolved\n * drop index during a pointer drag — within the source list and across connected lists — so\n * siblings part to reveal where the item will land.\n *\n * Created at `pointerLift` only when `liveSort` is on (and on a browser platform); when it is off\n * the list creates no sorter and `#resolveDrop` skips placeholder movement entirely, replacing the\n * former inline `if (this.liveSort())` gate. A `dragDisabled` sibling in the source list acts as a\n * hard visual fence: the placeholder stops at the first pinned item instead of travelling past it.\n *\n * Constructed directly (`new PlaceholderSorter(options)`); it holds no injection context.\n */\nexport class PlaceholderSorter {\n readonly #source: ForDropListContext;\n readonly #lifted: HTMLElement;\n readonly #doc: Document;\n readonly #sourceItems: () => readonly ForDraggableHandle[];\n readonly #originIndex: () => number;\n #nodes: readonly Node[] | null = null;\n\n constructor(options: PlaceholderSorterOptions) {\n this.#source = options.source;\n this.#lifted = options.lifted;\n this.#doc = options.doc;\n this.#sourceItems = options.sourceItems;\n this.#originIndex = options.originIndex;\n }\n\n /** Store (or clear) the placeholder's root nodes supplied by the draggable. */\n setNodes(nodes: readonly Node[] | null): void {\n this.#nodes = nodes;\n }\n\n /** Move the placeholder to the fenced resolved drop index in `targetCtx`. */\n onTargetChange(targetCtx: ForDropListContext, index: number): void {\n this.#move(targetCtx, this.#fencedIndex(targetCtx, index));\n }\n\n #fencedIndex(targetCtx: ForDropListContext, index: number): number {\n if (targetCtx !== this.#source) {\n return index;\n }\n const disabled = this.#sourceItems()\n .filter((h) => h.host !== this.#lifted)\n .map((h) => h.disabled());\n const origin = this.#originIndex();\n return fencePlaceholderIndex(index, disabled, origin < 0 ? 0 : origin);\n }\n\n #move(targetCtx: ForDropListContext, index: number): void {\n const nodes = this.#nodes;\n if (nodes === null || nodes.length === 0) {\n return;\n }\n const fragment = this.#doc.createDocumentFragment();\n for (const node of nodes) {\n fragment.appendChild(node);\n }\n const hosts = targetCtx\n .items()\n .map((h) => h.host)\n .filter((h) => h !== this.#lifted);\n const { parent, ref } = placeholderInsertion(hosts, index, targetCtx.host);\n parent.insertBefore(fragment, ref);\n }\n}\n","import { awaitTransformTransition } from 'forty-cdk/core';\n\n/** A minimal positioned rect — only the top-left corner is needed for a FLIP translate. */\nexport interface FlipRect {\n readonly left: number;\n readonly top: number;\n}\n\n/** The inverted translate (in px) that visually returns `last` to `first`. */\nexport interface FlipDelta {\n readonly dx: number;\n readonly dy: number;\n}\n\n/** Pure: the translate that moves an element from its Last position back to its First. */\nexport function flipDelta(first: FlipRect, last: FlipRect): FlipDelta {\n return { dx: first.left - last.left, dy: first.top - last.top };\n}\n\n/** Styling hook attribute set on each element while its FLIP transition plays. */\nexport const FLIP_ANIMATING_ATTR = 'data-drag-animating';\n\n/** Configuration for {@link playFlip}. */\nexport interface PlayFlipConfig {\n /** Element → its First (pre-change) rect, captured before the data change. */\n readonly first: ReadonlyMap<HTMLElement, FlipRect>;\n /** The browser window (for reflow + timeout), or `null` in SSR / non-DOM environments. */\n readonly win: Window | null;\n /** An element to leave untouched (the dragged host handled by drop-settle). */\n readonly exclude?: HTMLElement | null;\n}\n\n/**\n * Runs the Invert + Play steps of a FLIP transition for every element in `first` that is still\n * connected and has moved. Measures Last via `getBoundingClientRect`, applies the inverted\n * transform with the transition suppressed, forces a reflow, then transitions back to the element's\n * resting inline transform while `data-drag-animating` is present so a consumer CSS rule keyed on\n * it governs duration / easing. An inline `transform` the element already carries, such as a\n * windowed row's positioning offset, is kept: the inverted translate is prepended to it and the\n * transition ends on it. `data-drag-animating` is removed when the element's own `transform`\n * transition ends, or at once when no transition is configured. No-op when `win` is `null`. The\n * library imposes no duration of its own.\n */\nexport function playFlip(config: PlayFlipConfig): void {\n const { first, win, exclude } = config;\n if (!win) {\n return;\n }\n\n const workList: { el: HTMLElement; d: FlipDelta; rest: string }[] = [];\n for (const [el, firstRect] of first) {\n if (el === exclude) {\n continue;\n }\n if (!el.isConnected) {\n continue;\n }\n const r = el.getBoundingClientRect();\n const d = flipDelta(firstRect, r);\n if (d.dx === 0 && d.dy === 0) {\n continue;\n }\n workList.push({ el, d, rest: el.style.transform });\n }\n\n if (workList.length === 0) {\n return;\n }\n\n for (const { el, d, rest } of workList) {\n const invert = `translate(${d.dx}px, ${d.dy}px)`;\n el.style.transition = 'none';\n el.style.transform = rest === '' ? invert : `${invert} ${rest}`;\n }\n\n void workList[0]!.el.offsetWidth;\n\n for (const { el, rest } of workList) {\n el.setAttribute(FLIP_ANIMATING_ATTR, '');\n el.style.transition = '';\n el.style.transform = rest;\n }\n\n for (const { el } of workList) {\n awaitTransformTransition(el, win, () => {\n el.removeAttribute(FLIP_ANIMATING_ATTR);\n el.style.transition = '';\n });\n }\n}\n","import { afterNextRender, type Injector } from '@angular/core';\n\nimport { type DragPreview } from 'forty-cdk/core';\nimport type { ForDropListContext } from './drag-drop-context';\nimport { playFlip, type FlipRect } from './flip';\n\n/** Options handed to {@link ReorderAnimator} at drop time. */\nexport interface ReorderAnimatorOptions {\n /** The source list plus its connected lists, whose items participate in the FLIP. */\n readonly containers: readonly ForDropListContext[];\n /** Injector for the post-commit `afterNextRender` Last-rect capture. */\n readonly injector: Injector;\n /** The browser window (reflow + timeout), or `null` in non-DOM environments. */\n readonly win: Window | null;\n}\n\n/**\n * Lazy `animateReorder` strategy: runs the FLIP reflow of displaced sibling items and settles the\n * floating preview into the final slot on a committed drop.\n *\n * Created in `drop()` only when the animation gate is satisfied (`animateReorder` on, a browser\n * platform, motion not reduced, and the item actually moved); when it is not, the list creates no\n * animator and tears down instantly, replacing the former inline `animate && first` gate.\n *\n * {@link captureFirst} measures every item's pre-change position and must run **before** the\n * `dragDrop` event mutates the DOM **and before the pointer-drag placeholder is torn down**, so\n * the First rects are the parted positions the user last saw — a live-sorted drop then has nothing\n * to animate instead of snapping the siblings back. Hosts that measure zero-area (a `display:none`\n * item standing behind its placeholder) are skipped: they have no First position to invert from.\n * {@link schedule} runs the Invert + Play after the consumer's data change has rendered.\n * Constructed directly (`new ReorderAnimator(options)`); it holds no injection context beyond the\n * injector handed in for `afterNextRender`.\n */\nexport class ReorderAnimator {\n readonly #containers: readonly ForDropListContext[];\n readonly #injector: Injector;\n readonly #win: Window | null;\n #first: ReadonlyMap<HTMLElement, FlipRect> | null = null;\n\n constructor(options: ReorderAnimatorOptions) {\n this.#containers = options.containers;\n this.#injector = options.injector;\n this.#win = options.win;\n }\n\n /** Capture each item's First (pre-change) rect across all containers. Run before the data change. */\n captureFirst(): void {\n const map = new Map<HTMLElement, FlipRect>();\n for (const ctx of this.#containers) {\n for (const h of ctx.items()) {\n const r = h.host.getBoundingClientRect();\n if (r.width === 0 && r.height === 0) {\n continue;\n }\n map.set(h.host, { left: r.left, top: r.top });\n }\n }\n this.#first = map;\n }\n\n /**\n * Schedule the FLIP play (and preview settle, when a preview was kept) after the next render —\n * once the consumer's data change has reflowed the displaced siblings into their new positions.\n *\n * `onSettled` runs at the end of that render, once the animator has released the preview it was\n * handed: by then the preview is either already destroyed or settling under its own\n * `transitionend` / timeout disposal, which is independent of this injector. The caller can drop\n * its own reference to the preview at that point. It does **not** run when there is nothing\n * scheduled (no First rects captured) — the caller still owns the preview in that case.\n */\n schedule(liftedHost: HTMLElement, preview: DragPreview | null, onSettled?: () => void): void {\n const first = this.#first;\n if (first === null) {\n return;\n }\n const win = this.#win;\n afterNextRender(\n () => {\n playFlip({ first, win, exclude: preview ? liftedHost : null });\n if (preview) {\n if (liftedHost.isConnected && win) {\n const r = liftedHost.getBoundingClientRect();\n preview.settle(r.left, r.top, win);\n } else {\n preview.destroy();\n }\n }\n onSettled?.();\n },\n { injector: this.#injector },\n );\n }\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n DOCUMENT,\n ElementRef,\n inject,\n InjectionToken,\n Injector,\n input,\n output,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n clampDragIndex,\n Collection,\n type DragAnnouncedItem,\n type DragAnnouncedPosition,\n DragAnnouncer,\n firstEnabledHost,\n focusWhenMounted,\n type FocusWhenMountedRef,\n registerHandle,\n resolveDropTarget,\n type DropContainerGeometry,\n type DragRect,\n type DragPreview,\n injectPrefersReducedMotion,\n type ListNavigationAction,\n moveIndex,\n type WritingDirection,\n LiveAnnouncer,\n RovingTabindex,\n injectReflectedDirection,\n injectTextDirection,\n isUnset,\n PreviewController,\n resolveBoundaryElement,\n injectRovingFocusRestore,\n stepDragTarget,\n} from 'forty-cdk/core';\nimport { createAutoScroller, type AutoScroller } from './auto-scroll';\nimport { clipRegion, findClippingAncestors, type ClippingAncestor } from './clip-region';\nimport { buildDragSlots, indexOfSlot } from './drag-positions';\nimport {\n FOR_DROP_LIST_CONTEXT,\n FOR_DROP_LIST_COORDINATOR,\n FOR_DROP_LIST_ROVING_DELEGATE,\n type ForDragDropEvent,\n type ForDraggableHandle,\n type ForDropListContext,\n type ForDropListCoordinator,\n} from './drag-drop-context';\nimport { FOR_DRAG_DROP_DEFAULTS } from 'forty-cdk/defaults';\nimport { FOR_DROP_LIST_GROUP } from './drop-list-group';\nimport { PlaceholderSorter } from './placeholder-sorter';\nimport { ReorderAnimator } from './reorder-animator';\n\n/**\n * Optional DI seam overriding the fallback `orientation` of every `[forDropList]` in scope.\n * `ForDropList`'s `orientation` input falls back to this token's value (`'vertical'` when the\n * token is not provided); a consumer `orientation` binding always wins over it. Wrappers\n * compose a horizontal list without leaking `orientation=\"horizontal\"` boilerplate into the\n * consumer's template — `ForTableColumnReorder` provides `'horizontal'` so column reordering\n * resolves along the row axis out of the box.\n */\nexport const FOR_DROP_LIST_DEFAULT_ORIENTATION = new InjectionToken<\n 'horizontal' | 'vertical' | 'mixed'\n>('FOR_DROP_LIST_DEFAULT_ORIENTATION');\n\ninterface DropListGeomEntry {\n items: readonly ForDraggableHandle[];\n containerRect: DragRect;\n scrollLeft: number;\n scrollTop: number;\n itemRects: readonly DragRect[];\n clippers: readonly ClippingAncestor[];\n}\n\nfunction freezeRect(rect: DragRect): DragRect {\n return { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom };\n}\n\nfunction shiftRect(rect: DragRect, dx: number, dy: number): DragRect {\n return {\n left: rect.left + dx,\n top: rect.top + dy,\n right: rect.right + dx,\n bottom: rect.bottom + dy,\n };\n}\n\n/**\n * Root directive of the drag-drop primitive. Apply on any container element to\n * create a reorderable list. Items inside are declared with `[forDraggable]`.\n *\n * Supports both keyboard dragging and pointer (mouse / touch / pen) dragging.\n */\n@Directive({\n selector: '[forDropList]',\n exportAs: 'forDropList',\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.dir]': 'reflectedDir()',\n '[attr.data-disabled]': \"effectiveDisabled() ? '' : null\",\n '[attr.data-dragging]': \"isDragging() ? '' : null\",\n '[attr.data-drag-over]': \"dragOverIndex() !== null ? '' : null\",\n },\n providers: [{ provide: FOR_DROP_LIST_CONTEXT, useExisting: ForDropList }],\n})\nexport class ForDropList implements ForDropListContext {\n readonly #hostRef = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #defaults = inject(FOR_DRAG_DROP_DEFAULTS);\n readonly #announce = new DragAnnouncer(inject(LiveAnnouncer), () => ({\n lift: this.#defaults.announceLift,\n move: this.#defaults.announceMove,\n drop: this.#defaults.announceDrop,\n cancel: this.#defaults.announceCancel,\n }));\n readonly #group = inject(FOR_DROP_LIST_GROUP, { optional: true });\n readonly #document = inject(DOCUMENT);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #destroyRef = inject(DestroyRef);\n readonly #injector = inject(Injector);\n readonly #prefersReducedMotion = injectPrefersReducedMotion();\n readonly #defaultOrientation =\n inject(FOR_DROP_LIST_DEFAULT_ORIENTATION, { optional: true }) ?? 'vertical';\n readonly #rovingDelegate = inject(FOR_DROP_LIST_ROVING_DELEGATE, { optional: true });\n\n /**\n * Layout orientation of the list. Affects which arrow keys move focus and the lifted item, and\n * how a pointer drag resolves the live drop index. Defaults to `'vertical'`, or to\n * `FOR_DROP_LIST_DEFAULT_ORIENTATION` when an in-scope provider sets it (e.g.\n * `ForTableColumnReorder` defaults it to `'horizontal'`).\n *\n * `'mixed'` is for wrapping grids (`flex-wrap` / CSS grid) of uniformly-sized items: the drop\n * index is resolved in 2D so an item flowing across rows lands in the slot under the pointer's\n * row and column, and every arrow key steps the lifted item linearly in DOM order. A `'mixed'`\n * list that happens to render as a single row or single column resolves identically to\n * `'horizontal'` / `'vertical'`.\n */\n readonly orientation = input<'horizontal' | 'vertical' | 'mixed'>(this.#defaultOrientation);\n\n /**\n * Writing direction. When unset (default `null`), the inherited ambient direction is\n * resolved from the nearest ancestor carrying a `dir` attribute (or `<html dir>`),\n * defaulting to `'ltr'`.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n private readonly reflectedDir = injectReflectedDirection(this._dirInput);\n\n /**\n * When true, the entire list and all its items are disabled. Turning it on while an item is\n * keyboard-lifted does not end the lift: the lifted keys still move, drop and cancel it.\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * Other lists this one can transfer items into. Union'd with any `[forDropListGroup]`\n * members. Disabled lists, and lists a `FOR_DROP_LIST_COORDINATOR` composes, are excluded\n * from the effective connected set.\n */\n readonly connectedTo = input<readonly ForDropListContext[]>([]);\n\n /**\n * When true (the default), a pointer drag that nears the edge of the nearest scrollable\n * container (the list, a scrollable ancestor, or the viewport) auto-scrolls it toward that\n * edge so off-screen drop targets become reachable. Set `false` to opt out. Edge size and\n * max speed are configured via `provideForDragDropDefaults`. Keyboard dragging is unaffected.\n */\n readonly autoScroll = input(true, { transform: booleanAttribute });\n\n /**\n * When true, the `[forDragPlaceholder]` follows the live resolved drop index during a\n * **pointer** drag — within this list and across connected lists — so siblings part to\n * reveal where the item will land. When false (the default), the placeholder stays in the\n * dragged item's source slot. Has no effect without a `[forDragPlaceholder]`\n * template, and none on keyboard dragging.\n *\n * A `dragDisabled` sibling acts as a hard fence: the placeholder stops at the first\n * pinned item instead of travelling past it. Live sorting is purely visual: the drop index\n * is resolved from the container geometry measured at lift — before the placeholder is\n * rendered — so the placeholder's live position never feeds back into resolution and a given\n * pointer path commits the same index whether `liveSort` is on or off.\n */\n readonly liveSort = input(false, { transform: booleanAttribute });\n\n /**\n * When true, a committed drop (keyboard or pointer) animates: displaced sibling items\n * transition from their old positions to their new ones (FLIP), and — on a pointer drag — the\n * floating preview settles into the final slot before it is removed. Opt-in and default off.\n * Duration / easing are styled by the consumer via CSS on the published hooks\n * (`[data-drag-animating]` on items, `[data-settling]` on the preview); the library imposes\n * none. Fully skipped under `prefers-reduced-motion: reduce` (teardown stays instant).\n */\n readonly animateReorder = input(false, { transform: booleanAttribute });\n\n /**\n * Confine the pointer-drag preview within a boundary during a pointer drag. Accepts an\n * `HTMLElement`, or a selector string resolved via `closest()` from the list host. `null`\n * (the default) leaves the preview unbounded. Affects the visual preview only — the resolved\n * drop index is unchanged. Has no effect on keyboard dragging (no floating preview).\n */\n readonly boundary = input<HTMLElement | string | null>(null);\n\n /**\n * Constrain pointer-drag preview movement to one axis. `'x'` keeps the preview at its lift-time\n * `y` (horizontal movement); `'y'` keeps it at its lift-time `x` (vertical movement). `null`\n * (the default) is free movement. Independent of `orientation` (which drives the drop index);\n * this is a purely visual constraint, and has no effect on keyboard dragging.\n */\n readonly lockAxis = input<'x' | 'y' | null>(null);\n\n /**\n * Emitted by the **source** list when a drop commits (keyboard or pointer) — whether\n * the item stays in this list (reorder) or moves to a connected list (transfer). Apply\n * `moveItemInArray` or `transferArrayItem` to your data signal inside the handler.\n *\n * After a **keyboard** drop made while focus was on the lifted item or inside it, focus\n * follows the item once the next render settles: back onto the item's own element when the\n * re-render kept it, or onto the item at `currentIndex` in the target container when it\n * replaced it, so the keyboard user is never stranded on `<body>`. Focus something else\n * inside this handler to keep it; pointer drops never move focus.\n */\n readonly dragDrop = output<ForDragDropEvent>();\n\n readonly host = this.#hostRef.nativeElement;\n\n /** Effective disabled — the list's own `disabled` input (fieldset wiring deferred to v2). */\n readonly effectiveDisabled = computed(() => this.disabled());\n\n readonly roving = new RovingTabindex(() => this.#items.items(), { fallback: 'nearest' });\n readonly #items = new Collection<ForDraggableHandle>();\n readonly items = this.#items.items;\n\n readonly #liftedHost = signal<HTMLElement | null>(null);\n readonly #coordinatorLiftedHost = signal<HTMLElement | null>(null);\n readonly #flatIndex = signal(0);\n readonly #dragOver = signal<number | null>(null);\n\n #coordinatorResolved = false;\n #coordinatorValue: ForDropListCoordinator | null = null;\n\n get #coordinator(): ForDropListCoordinator | null {\n if (!this.#coordinatorResolved) {\n this.#coordinatorResolved = true;\n this.#coordinatorValue = this.#injector.get(FOR_DROP_LIST_COORDINATOR, null, {\n self: true,\n optional: true,\n });\n }\n return this.#coordinatorValue;\n }\n\n #previewController: PreviewController | null = null;\n #handedOffPreview: DragPreview | null = null;\n #pointerDrag = false;\n #sorter: PlaceholderSorter | null = null;\n #autoScroller: AutoScroller | null = null;\n #lastPoint: { x: number; y: number } | null = null;\n #resolveRaf: number | null = null;\n #geomCache: Map<ForDropListContext, DropListGeomEntry> | null = null;\n #dropFocus: FocusWhenMountedRef | null = null;\n #pointerDropped: HTMLElement | null = null;\n\n /** Insertion index this list is the current drop target at, else `null`. */\n readonly dragOverIndex = this.#dragOver.asReadonly();\n\n /**\n * `true` while a drag originating from this list is in progress — its own keyboard / pointer\n * lift, or one a composing coordinator owns (see {@link beginCoordinatorLift}). Reflected as\n * `data-dragging` on the list host.\n */\n readonly isDragging = computed(\n () => this.#liftedHost() !== null || this.#coordinatorLiftedHost() !== null,\n );\n\n constructor() {\n injectRovingFocusRestore(this.roving, {\n skip: (departed) => this.#consumePointerDrop(departed),\n });\n const group = this.#group;\n if (group) {\n registerHandle(\n this as ForDropListContext,\n (ctx) => group.register(ctx),\n (ctx) => group.unregister(ctx),\n );\n }\n if (this.#isBrowser) {\n this.#autoScroller = createAutoScroller({\n host: this.host,\n win: this.#document.defaultView,\n edgeSize: this.#defaults.autoScrollEdgeSize,\n maxSpeed: this.#defaults.autoScrollMaxSpeed,\n onFrame: () => this.#onAutoScrollFrame(),\n resolveScrollHost: (point) => this.#scrollHostAt(point),\n });\n this.#destroyRef.onDestroy(() => {\n this.#autoScroller?.stop();\n if (this.#resolveRaf !== null) {\n this.#document.defaultView?.cancelAnimationFrame(this.#resolveRaf);\n this.#resolveRaf = null;\n }\n this.#previewController?.destroy();\n this.#previewController = null;\n this.#handedOffPreview?.destroy();\n this.#handedOffPreview = null;\n });\n }\n }\n\n registerItem(handle: ForDraggableHandle): void {\n this.#items.register(handle);\n }\n\n unregisterItem(handle: ForDraggableHandle): void {\n this.#items.unregister(handle);\n this.roving.unregister(handle.host);\n }\n\n itemTabindex(el: HTMLElement): -1 | 0 | null {\n const delegated = this.#rovingDelegate?.itemTabindex(el);\n if (delegated !== undefined && delegated !== null) {\n return delegated;\n }\n return this.roving.hasActive() ? this.roving.tabindexFor(el) : null;\n }\n\n isRovingDelegated(el: HTMLElement): boolean {\n const delegated = this.#rovingDelegate?.itemTabindex(el);\n return delegated !== undefined && delegated !== null;\n }\n\n isFirstFocusableItem(el: HTMLElement): boolean {\n return firstEnabledHost(this.#items.items()) === el;\n }\n\n isItemHighlighted(el: HTMLElement): boolean {\n const delegated = this.#rovingDelegate?.isItemHighlighted?.(el);\n if (delegated !== undefined && delegated !== null) {\n return delegated;\n }\n return this.roving.active() === el;\n }\n\n isItemDragging(el: HTMLElement): boolean {\n return this.#liftedHost() === el || this.#coordinatorLiftedHost() === el;\n }\n\n /**\n * Start a drag of `el` that a **coordinator** composing this list owns end to end —\n * `[forVirtualReorder]`, and the virtualized branch of `[forTableRowReorder]`. Those wrap the\n * list via `hostDirectives` and intercept the lift key in the capture phase, so `ForDraggable`\n * never reaches {@link lift} and the list holds no lift state of its own for the gesture. For\n * the whole gesture {@link isItemDragging} and {@link isDragging} — and therefore the\n * `data-dragging` hook on both the item and the list host — read `true`, and the item's\n * `[forDraggable]` emits `dragStart` with `index`, the position the coordinator reports.\n *\n * It is **not** folded into the list's own lift state: `moveLifted` / `drop` /\n * `cancel` still act on nothing, because the coordinator owns the target index, the\n * announcements and the teardown. It is still the only gesture in the list: while it is\n * live, `lift` and `pointerLift` return `-1`, so no item's own `[forDraggable]` lifts beside\n * it. End it with {@link endCoordinatorLift}.\n */\n beginCoordinatorLift(el: HTMLElement, index: number): void {\n this.#coordinatorLiftedHost.set(el);\n this.#handleFor(el)?.emitDragStart(index);\n }\n\n /**\n * End the coordinator-owned drag {@link beginCoordinatorLift} started: clears the dragging\n * state and has the item's `[forDraggable]` emit `dragEnd` with `dropped`. A no-op when no\n * coordinator drag is live.\n */\n endCoordinatorLift(dropped: boolean): void {\n const el = this.#coordinatorLiftedHost();\n if (el === null) {\n return;\n }\n this.#coordinatorLiftedHost.set(null);\n this.#handleFor(el)?.emitDragEnd(dropped);\n }\n\n #handleFor(el: HTMLElement): ForDraggableHandle | undefined {\n return this.#items.items().find((h) => h.host === el);\n }\n\n setActiveItem(el: HTMLElement): void {\n this.roving.setActive(el);\n }\n\n navigate(el: HTMLElement, action: ListNavigationAction): void {\n if (this.effectiveDisabled()) {\n return;\n }\n const items = this.#items.items();\n if (items.length === 0) {\n return;\n }\n const currentIndex = items.findIndex((h) => h.host === el);\n const next = moveIndex(currentIndex < 0 ? 0 : currentIndex, items.length, action, {\n loop: false,\n isDisabled: (i) => items[i]!.disabled(),\n });\n if (next === null) {\n return;\n }\n items[next]?.host.focus();\n }\n\n #consumePointerDrop(departed: Element): boolean {\n const dropped = this.#pointerDropped;\n this.#pointerDropped = null;\n return dropped !== null && dropped.contains(departed);\n }\n\n #beginLift(el: HTMLElement): number {\n if (this.effectiveDisabled() || this.isDragging()) {\n return -1;\n }\n this.#pointerDropped = null;\n const items = this.#items.items();\n const handle = items.find((h) => h.host === el);\n this.#dropFocus?.cancel();\n this.#dropFocus = null;\n if (!handle || handle.disabled()) {\n return -1;\n }\n const from = this.#items.indexOfHost(el);\n if (from < 0) {\n return -1;\n }\n const connected = this.#effectiveConnected();\n const slots = buildDragSlots(\n items.length,\n connected.map((c) => c.items().length),\n );\n const flatIndex = indexOfSlot(slots, 0, from);\n this.#pointerDrag = false;\n this.#liftedHost.set(el);\n this.#flatIndex.set(flatIndex < 0 ? 0 : flatIndex);\n this.#dragOver.set(from);\n const position = this.#coordinator?.resolveReorder(from, from).from ?? from;\n this.#announce.lift(this.#announcedItem(el), this.#announcedPosition(this, position));\n handle.emitDragStart(position);\n return from;\n }\n\n #reportedTarget(ctx: ForDropListContext, lifted: HTMLElement, index: number): number {\n const coordinator = this.#coordinator;\n if (!coordinator || ctx !== (this as ForDropListContext)) {\n return index;\n }\n return coordinator.resolveReorder(this.#items.indexOfHost(lifted), index).to;\n }\n\n lift(el: HTMLElement): number {\n return this.#beginLift(el);\n }\n\n pointerLift(\n el: HTMLElement,\n point: { x: number; y: number },\n preview?: DragPreview | { moveTo(x: number, y: number): void; destroy(): void } | null,\n ): number {\n const from = this.#beginLift(el);\n if (from < 0) {\n return -1;\n }\n this.#pointerDrag = true;\n if (this.#isBrowser) {\n this.#previewController = new PreviewController({\n source: el,\n point,\n preview,\n doc: this.#document,\n boundary: resolveBoundaryElement(this.host, this.boundary()),\n lockAxis: this.lockAxis,\n });\n if (this.liveSort()) {\n this.#sorter = new PlaceholderSorter({\n source: this,\n lifted: el,\n doc: this.#document,\n sourceItems: this.#items.items,\n originIndex: () => this.#items.indexOfHost(el),\n });\n }\n this.#snapshotGeometry(el);\n }\n return from;\n }\n\n pointerMove(point: { x: number; y: number }): void {\n const lifted = this.#liftedHost();\n if (lifted === null || !this.#isBrowser) {\n return;\n }\n this.#lastPoint = point;\n if (this.autoScroll()) {\n this.#autoScroller?.update(point);\n } else {\n this.#autoScroller?.stop();\n }\n if (this.#resolveRaf !== null) {\n return;\n }\n this.#resolveDrop(point, lifted);\n const win = this.#document.defaultView;\n if (win) {\n this.#resolveRaf = win.requestAnimationFrame(() => {\n this.#resolveRaf = null;\n const currentLifted = this.#liftedHost();\n const currentPoint = this.#lastPoint;\n if (currentLifted !== null && currentPoint !== null) {\n this.#resolveDrop(currentPoint, currentLifted);\n }\n });\n }\n }\n\n #resolveDrop(point: { x: number; y: number }, lifted: HTMLElement): void {\n const connected = this.#effectiveConnected();\n const containers = [this as ForDropListContext, ...connected];\n const geoms: DropContainerGeometry[] = containers.map((ctx) => this.#geometryFor(ctx, lifted));\n const target = resolveDropTarget(point, geoms);\n if (!target) {\n this.#previewController?.moveTo(point);\n return;\n }\n const slots = buildDragSlots(\n this.#items.items().length,\n connected.map((c) => c.items().length),\n );\n const flat = indexOfSlot(slots, target.containerIndex, target.index);\n if (flat < 0) {\n this.#previewController?.moveTo(point);\n return;\n }\n const changed = flat !== this.#flatIndex();\n const targetCtx = containers[target.containerIndex]!;\n this.#previewController?.moveTo(point);\n containers.forEach((ctx, i) =>\n ctx.setDragOver(i === target.containerIndex ? target.index : null),\n );\n this.#flatIndex.set(flat);\n if (changed) {\n this.#sorter?.onTargetChange(targetCtx, target.index);\n const position = this.#reportedTarget(targetCtx, lifted, target.index);\n this.#announce.move(\n this.#announcedItem(lifted),\n this.#announcedPosition(targetCtx, position),\n );\n }\n }\n\n #snapshotGeometry(lifted: HTMLElement): void {\n const cache = new Map<ForDropListContext, DropListGeomEntry>();\n const containers = [this as ForDropListContext, ...this.#effectiveConnected()];\n for (const ctx of containers) {\n cache.set(ctx, this.#snapshotContainer(ctx, lifted));\n }\n this.#geomCache = cache;\n }\n\n #snapshotContainer(ctx: ForDropListContext, lifted: HTMLElement): DropListGeomEntry {\n const items = ctx.items();\n const win = this.#document.defaultView;\n return {\n items,\n containerRect: freezeRect(ctx.host.getBoundingClientRect()),\n scrollLeft: ctx.host.scrollLeft,\n scrollTop: ctx.host.scrollTop,\n itemRects: items\n .filter((h) => h.host !== lifted)\n .map((h) => freezeRect(h.host.getBoundingClientRect())),\n clippers: win ? findClippingAncestors(ctx.host, win) : [],\n };\n }\n\n #geometryFor(ctx: ForDropListContext, lifted: HTMLElement): DropContainerGeometry {\n const cache = this.#geomCache;\n const cached = cache?.get(ctx);\n const axis = { orientation: ctx.orientation(), dir: ctx.dir() } as const;\n if (!cache || !cached || cached.items !== ctx.items()) {\n const fresh = this.#snapshotContainer(ctx, lifted);\n cache?.set(ctx, fresh);\n return {\n rect: fresh.containerRect,\n itemRects: fresh.itemRects,\n clip: clipRegion(fresh.clippers),\n ...axis,\n };\n }\n const freshRect = ctx.host.getBoundingClientRect();\n const dx =\n freshRect.left - cached.containerRect.left - (ctx.host.scrollLeft - cached.scrollLeft);\n const dy = freshRect.top - cached.containerRect.top - (ctx.host.scrollTop - cached.scrollTop);\n const clip = clipRegion(cached.clippers);\n if (dx === 0 && dy === 0) {\n return { rect: freezeRect(freshRect), itemRects: cached.itemRects, clip, ...axis };\n }\n return {\n rect: freezeRect(freshRect),\n itemRects: cached.itemRects.map((r) => shiftRect(r, dx, dy)),\n clip,\n ...axis,\n };\n }\n\n #announcedItem(host: HTMLElement): DragAnnouncedItem {\n return { host, textValue: this.#handleFor(host)?.textValue() };\n }\n\n #announcedPosition(ctx: ForDropListContext, index: number): DragAnnouncedPosition {\n return { index, total: this.#positionCount(ctx), list: ctx.host, source: this.host };\n }\n\n #positionCount(ctx: ForDropListContext): number {\n if (this.#coordinator && ctx === (this as ForDropListContext)) {\n return this.#coordinator.count();\n }\n const count = ctx.items().length;\n return ctx === (this as ForDropListContext) ? count : count + 1;\n }\n\n #flushResolve(lifted: HTMLElement): void {\n if (this.#resolveRaf !== null) {\n this.#document.defaultView?.cancelAnimationFrame(this.#resolveRaf);\n this.#resolveRaf = null;\n }\n if (this.#lastPoint !== null) {\n this.#resolveDrop(this.#lastPoint, lifted);\n }\n }\n\n #onAutoScrollFrame(): void {\n const lifted = this.#liftedHost();\n const point = this.#lastPoint;\n if (lifted === null || point === null) {\n return;\n }\n this.#resolveDrop(point, lifted);\n }\n\n #scrollHostAt(point: { x: number; y: number }): HTMLElement | null {\n const view = this.#document.defaultView;\n if (!view || typeof this.#document.elementFromPoint !== 'function') {\n return null;\n }\n const under = this.#document.elementFromPoint(point.x, point.y);\n if (under === null) {\n return null;\n }\n const containers = [this as ForDropListContext, ...this.#effectiveConnected()];\n for (const ctx of containers) {\n if (ctx.host === under || ctx.host.contains(under)) {\n return ctx.host;\n }\n }\n return null;\n }\n\n isLifted(el: HTMLElement): boolean {\n return this.#liftedHost() === el;\n }\n\n moveLifted(action: ListNavigationAction): void {\n const liftedHost = this.#liftedHost();\n if (liftedHost === null) {\n return;\n }\n const connected = this.#effectiveConnected();\n const slots = buildDragSlots(\n this.#items.items().length,\n connected.map((c) => c.items().length),\n );\n if (slots.length === 0) {\n return;\n }\n const current = this.#flatIndex();\n const next = stepDragTarget(\n current,\n this.#requestedSlot(action, current, slots.length),\n slots.length,\n );\n if (next === null) {\n return;\n }\n const prevSlot = slots[current];\n const nextSlot = slots[next];\n if (!prevSlot || !nextSlot) {\n return;\n }\n const prevTarget =\n prevSlot.containerIndex === 0 ? this : connected[prevSlot.containerIndex - 1];\n const nextTarget =\n nextSlot.containerIndex === 0 ? this : connected[nextSlot.containerIndex - 1];\n if (prevTarget && prevTarget !== nextTarget) {\n prevTarget.setDragOver(null);\n }\n if (nextTarget) {\n nextTarget.setDragOver(nextSlot.index);\n }\n this.#flatIndex.set(next);\n if (nextTarget) {\n const position = this.#reportedTarget(nextTarget, liftedHost, nextSlot.index);\n this.#announce.move(\n this.#announcedItem(liftedHost),\n this.#announcedPosition(nextTarget, position),\n );\n }\n }\n\n #requestedSlot(action: ListNavigationAction, current: number, count: number): number {\n switch (action) {\n case 'first':\n return 0;\n case 'last':\n return count - 1;\n case 'next':\n return current + 1;\n default:\n return current - 1;\n }\n }\n\n drop(): void {\n const liftedHost = this.#liftedHost();\n if (liftedHost === null) {\n return;\n }\n this.#flushResolve(liftedHost);\n const connected = this.#effectiveConnected();\n const items = this.#items.items();\n const slots = buildDragSlots(\n items.length,\n connected.map((c) => c.items().length),\n );\n const slot = slots[this.#flatIndex()];\n const handle = items.find((h) => h.host === liftedHost);\n if (!slot || (handle !== undefined && isUnset(handle.data()))) {\n this.#teardown(connected);\n handle?.emitDragEnd(false);\n return;\n }\n const previousIndex = this.#items.indexOfHost(liftedHost);\n const currentIndex = slot.index;\n const container: ForDropListContext =\n slot.containerIndex === 0 ? this : (connected[slot.containerIndex - 1] ?? this);\n const item = handle ? handle.data() : undefined;\n const announced = this.#announcedItem(liftedHost);\n const position = this.#reportedTarget(container, liftedHost, currentIndex);\n\n const moved = !(previousIndex === currentIndex && container === (this as ForDropListContext));\n const animate =\n this.animateReorder() && this.#isBrowser && !this.#prefersReducedMotion() && moved;\n const preview = this.#previewController?.preview ?? null;\n if (this.#isBrowser && !this.#pointerDrag) {\n this.#followDropFocus(liftedHost, container, currentIndex, handle);\n } else if (this.#pointerDrag) {\n this.#pointerDropped = liftedHost;\n }\n const animator = animate\n ? new ReorderAnimator({\n containers: [this, ...connected],\n injector: this.#injector,\n win: this.#document.defaultView,\n })\n : null;\n animator?.captureFirst();\n\n this.dragDrop.emit({\n item,\n previousContainer: this,\n container,\n previousIndex,\n currentIndex,\n });\n this.#announce.drop(announced, this.#announcedPosition(container, position));\n\n if (animator) {\n this.#handedOffPreview = preview;\n animator.schedule(liftedHost, preview, () => {\n this.#handedOffPreview = null;\n });\n this.#teardown(connected, true);\n } else {\n this.#teardown(connected);\n }\n handle?.emitDragEnd(true);\n }\n\n #followDropFocus(\n liftedHost: HTMLElement,\n container: ForDropListContext,\n index: number,\n handle: ForDraggableHandle | undefined,\n ): void {\n const item = handle?.data();\n this.#dropFocus = focusWhenMounted({\n injector: this.#injector,\n document: this.#document,\n from: liftedHost,\n target: (origin) => {\n const items = container.items();\n const carriers = handle === undefined ? [] : items.filter((h) => Object.is(h.data(), item));\n if (carriers.some((h) => h.host.contains(origin))) {\n return origin;\n }\n if (carriers.length > 0) {\n return (carriers.find((h) => h === items[index]) ?? carriers[0]!).host;\n }\n if (origin.isConnected) {\n return origin;\n }\n if (items.length === 0) {\n return null;\n }\n return items[clampDragIndex(index, items.length)]?.host ?? null;\n },\n release: () => {\n this.#dropFocus = null;\n },\n });\n }\n\n cancel(): void {\n const liftedHost = this.#liftedHost();\n if (liftedHost === null) {\n return;\n }\n const handle = this.#handleFor(liftedHost);\n this.#announce.cancel(this.#announcedItem(liftedHost));\n this.#teardown(this.#effectiveConnected());\n handle?.emitDragEnd(false);\n }\n\n setDragOver(index: number | null): void {\n this.#dragOver.set(index);\n }\n\n setLivePlaceholder(nodes: readonly Node[] | null): void {\n const lifted = this.#liftedHost();\n if (nodes !== null && lifted !== null) {\n this.#coordinator?.layoutPlaceholder?.(nodes, lifted);\n }\n this.#sorter?.setNodes(nodes);\n }\n\n readonly #effectiveConnected = computed((): readonly ForDropListContext[] => {\n if (this.#coordinator) {\n return [];\n }\n const explicit = this.connectedTo();\n const groupMembers = this.#group?.members() ?? [];\n const seen = new Set<ForDropListContext>();\n seen.add(this);\n const result: ForDropListContext[] = [];\n for (const ctx of [...explicit, ...groupMembers]) {\n const closed = #coordinator in ctx && ctx.#coordinator !== null;\n if (!seen.has(ctx) && !ctx.disabled() && !closed) {\n seen.add(ctx);\n result.push(ctx);\n }\n }\n return result;\n });\n\n #teardown(connected: readonly ForDropListContext[], keepPreview = false): void {\n if (this.#resolveRaf !== null) {\n this.#document.defaultView?.cancelAnimationFrame(this.#resolveRaf);\n this.#resolveRaf = null;\n }\n this.#autoScroller?.stop();\n this.#lastPoint = null;\n this.#dragOver.set(null);\n for (const ctx of connected) {\n ctx.setDragOver(null);\n }\n this.#liftedHost.set(null);\n this.#flatIndex.set(0);\n this.#geomCache = null;\n if (!keepPreview) {\n this.#previewController?.destroy();\n }\n this.#previewController = null;\n this.#sorter = null;\n this.#pointerDrag = false;\n }\n}\n","import { computed, inject, type Signal, signal } from '@angular/core';\n\nimport {\n BOTH_DRAG_AXES,\n dragHandleTouchAction,\n dragSurfaceTouchAction,\n type DragTouchAction,\n NO_DRAG_AXES,\n registerHandle,\n} from 'forty-cdk/core';\nimport { asDraggableContext, FOR_DRAGGABLE_CONTEXT } from './drag-drop-context';\n\n/**\n * Per-directive pointer drag-start guard shared by `ForDraggable` and\n * `ForFreeDrag`: tracks `[forDragHandle]` elements and the draggables nested\n * inside the host, decides whether a `pointerdown` may begin a drag (left mouse\n * button only; never from inside a nested draggable; if any handle is registered\n * the press must originate inside one), and derives the `touch-action` styles\n * that stop native scrolling on the surfaces a drag can start from. The\n * browser's native drag is cancelled by the pointer session itself.\n */\nexport interface PointerHandleGuard {\n /** `'none'` while the host should suppress native touch scrolling, else `null`. */\n readonly touchAction: Signal<DragTouchAction>;\n /** `'none'` while a registered handle should suppress native touch scrolling, else `null`. */\n readonly handleTouchAction: Signal<'none' | null>;\n /** Register a `[forDragHandle]` element. */\n register(el: HTMLElement): void;\n /** Unregister a previously registered handle element. */\n unregister(el: HTMLElement): void;\n /** Register the host of a draggable nested inside this one; presses inside it are its own. */\n registerNested(el: HTMLElement): void;\n /** Unregister a previously registered nested draggable host. */\n unregisterNested(el: HTMLElement): void;\n /** Whether `node` belongs to this draggable rather than to a draggable nested inside it. */\n owns(node: Node): boolean;\n /**\n * Whether a press on `target` may start a drag: dragging is enabled, the press is not inside a\n * nested draggable, and it lands inside a handle when any is registered. Has no side effects.\n */\n accepts(target: EventTarget | null): boolean;\n /** Whether a `pointerdown` event is allowed to start a drag. */\n canStart(event: PointerEvent): boolean;\n}\n\n/**\n * Builds a {@link PointerHandleGuard}. Call from a directive's injection\n * context (field initializer or constructor) so the `computed`s register\n * correctly.\n *\n * @param disabled Signal reporting whether dragging is currently disabled.\n */\nexport function createPointerHandleGuard(disabled: Signal<boolean>): PointerHandleGuard {\n const handles = signal<readonly HTMLElement[]>([]);\n const nested = signal<readonly HTMLElement[]>([]);\n\n const owns = (node: Node): boolean => !nested().some((host) => host.contains(node));\n\n const accepts = (eventTarget: EventTarget | null): boolean => {\n const target = eventTarget as Node | null;\n if (disabled() || (target !== null && !owns(target))) {\n return false;\n }\n const registered = handles();\n return (\n registered.length === 0 ||\n (target !== null && registered.some((handle) => handle.contains(target)))\n );\n };\n\n return {\n touchAction: computed(() =>\n dragSurfaceTouchAction({\n armable: !disabled(),\n handles: handles().length > 0,\n axes: BOTH_DRAG_AXES,\n hostScrolls: NO_DRAG_AXES,\n }),\n ),\n handleTouchAction: computed(() => dragHandleTouchAction(!disabled())),\n register(el: HTMLElement): void {\n handles.update((list) => [...list, el]);\n },\n unregister(el: HTMLElement): void {\n handles.update((list) => list.filter((handle) => handle !== el));\n },\n registerNested(el: HTMLElement): void {\n nested.update((list) => [...list, el]);\n },\n unregisterNested(el: HTMLElement): void {\n nested.update((list) => list.filter((host) => host !== el));\n },\n owns,\n accepts,\n canStart(event: PointerEvent): boolean {\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return false;\n }\n return accepts(event.target);\n },\n };\n}\n\n/**\n * Registers `host` with the nearest enclosing `[forDraggable]` / `[forFreeDrag]`, so a press\n * inside it never starts a drag of the one around it. Call from the nested directive's\n * injection context.\n */\nexport function registerWithEnclosingDraggable(host: HTMLElement, piece: string): void {\n const provided = inject(FOR_DRAGGABLE_CONTEXT, { optional: true, skipSelf: true });\n if (provided) {\n const enclosing = asDraggableContext(provided, piece);\n registerHandle(\n host,\n (el) => enclosing.registerNestedDraggable(el),\n (el) => enclosing.unregisterNestedDraggable(el),\n );\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport { injectDraggableContext } from './drag-drop-context';\n\n/**\n * Optional custom drag preview. Apply `[forDragPreview]` on an `<ng-template>` inside a\n * `[forDraggable]`; its content renders as the floating element that follows the pointer during a\n * pointer drag, replacing the default cloned preview. Has no effect on keyboard dragging.\n */\n@Directive({\n selector: 'ng-template[forDragPreview]',\n exportAs: 'forDragPreview',\n})\nexport class ForDragPreview {\n /** The template rendered as the floating pointer-drag preview. */\n readonly templateRef = inject<TemplateRef<unknown>>(TemplateRef);\n\n constructor() {\n injectDraggableContext('ForDragPreview');\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport { injectDraggableContext } from './drag-drop-context';\n\n/**\n * Optional custom drag placeholder. Apply `[forDragPlaceholder]` on an `<ng-template>` inside a\n * `[forDraggable]`; during a **pointer** drag the dragged item's host is hidden and this template\n * renders in its slot, preserving the gap. Keyboard dragging keeps the default (the lifted item\n * stays in place, reflecting `data-dragging`).\n */\n@Directive({\n selector: 'ng-template[forDragPlaceholder]',\n exportAs: 'forDragPlaceholder',\n})\nexport class ForDragPlaceholder {\n /** The template rendered in the dragged item's slot during a pointer drag. */\n readonly templateRef = inject<TemplateRef<unknown>>(TemplateRef);\n\n constructor() {\n injectDraggableContext('ForDragPlaceholder');\n }\n}\n","import {\n booleanAttribute,\n computed,\n contentChildren,\n DestroyRef,\n Directive,\n DOCUMENT,\n ElementRef,\n type EmbeddedViewRef,\n inject,\n input,\n output,\n PLATFORM_ID,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n assertInputBound,\n isImeComposing,\n navigateFromRovingItem,\n registerHandle,\n resolveListNavigation,\n createPointerDragSession,\n type PointerDragSession,\n createTemplatePreview,\n type DragPreview,\n markDragItemHost,\n resolveText,\n unsetInput,\n} from 'forty-cdk/core';\nimport { createPointerHandleGuard, registerWithEnclosingDraggable } from './handle-guard';\nimport {\n FOR_DRAGGABLE_CONTEXT,\n FOR_DRAGGABLE_LIFT_GUARD,\n injectDropListContext,\n type ForDragEndEvent,\n type ForDragStartEvent,\n type ForDraggableContext,\n type ForDraggableHandle,\n} from './drag-drop-context';\nimport { FOR_DRAG_DROP_DEFAULTS } from 'forty-cdk/defaults';\nimport { ForDragPreview } from './drag-preview';\nimport { ForDragPlaceholder } from './drag-placeholder';\n\nconst POINTER_ARM_THRESHOLD_PX = 5;\n\n/**\n * Marks an element as a draggable item inside a `[forDropList]`. Handles\n * keyboard and pointer interaction for lift, move, drop, and cancel.\n */\n@Directive({\n selector: '[forDraggable]',\n exportAs: 'forDraggable',\n providers: [{ provide: FOR_DRAGGABLE_CONTEXT, useExisting: ForDraggable }],\n host: {\n '[attr.tabindex]': 'tabindex()',\n '[attr.aria-roledescription]': 'roleDescription()',\n '[attr.aria-disabled]': 'ariaDisabled() ? \"true\" : null',\n '[attr.data-dragging]': \"dragging() ? '' : null\",\n '[attr.data-disabled]': \"effectiveDisabled() ? '' : null\",\n '[attr.data-highlighted]': \"highlighted() ? '' : null\",\n '[style.touch-action]': 'touchAction()',\n '[style.display]': \"placeholderActive() ? 'none' : null\",\n '(keydown)': 'onKeyDown($event)',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n },\n})\nexport class ForDraggable implements ForDraggableContext {\n readonly #list = injectDropListContext('ForDraggable');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #defaults = inject(FOR_DRAG_DROP_DEFAULTS);\n readonly #destroyRef = inject(DestroyRef);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #document = inject(DOCUMENT);\n readonly #vcr = inject(ViewContainerRef);\n readonly #liftGuard = inject(FOR_DRAGGABLE_LIFT_GUARD, { optional: true });\n private readonly previewTpls = contentChildren(ForDragPreview, { descendants: true });\n private readonly placeholderTpls = contentChildren(ForDragPlaceholder, { descendants: true });\n #placeholderView: EmbeddedViewRef<unknown> | null = null;\n\n /** `true` while a pointer-drag placeholder template occupies this item's slot (host hidden). */\n private readonly placeholderActive = signal(false);\n\n #pointerDragging = false;\n #pointerSession: PointerDragSession | null = null;\n\n /**\n * Data payload handed back in the `dragDrop` event when this item is dropped. Mandatory — an\n * item with no binding throws in dev mode.\n */\n readonly dragData = input(unsetInput<unknown>());\n\n /**\n * When true, this item cannot be lifted. The item remains focusable, and where a roving\n * delegate governs the list's tab order (`FOR_DROP_LIST_ROVING_DELEGATE`, e.g. a\n * `[forTableColumnReorder]` header row inside a grid) it can still be the group's single\n * tab stop. It also acts as a hard fence for the `liveSort` placeholder: a sibling being\n * dragged cannot move its placeholder across a pinned item (the committed drop index is\n * unaffected). Turning it on while this item is keyboard-lifted does not end the lift: the\n * lifted keys still move, drop and cancel it.\n */\n readonly dragDisabled = input(false, { transform: booleanAttribute });\n\n /**\n * The name drag announcements call this item by. When unset or empty the item is named by its\n * `aria-labelledby` / `aria-label`, else by its text with `aria-hidden` content left out.\n */\n readonly textValue = input<string | null>(null);\n\n /**\n * Emitted when a drag (keyboard or pointer) starts from this item, including one a coordinator\n * composing the list owns (`[forVirtualReorder]`, `[forTableRowReorder]`).\n */\n readonly dragStart = output<ForDragStartEvent>();\n\n /**\n * Emitted when a drag originating from this item ends (committed or cancelled), including one a\n * coordinator composing the list owns. Not emitted when the item is destroyed mid-drag.\n */\n readonly dragEnd = output<ForDragEndEvent>();\n\n readonly effectiveDisabled = computed(() => this.dragDisabled() || this.#list.disabled());\n\n readonly #handleGuard = createPointerHandleGuard(this.effectiveDisabled);\n\n /**\n * `true` when this item is the draggable the list itself lifted, and therefore the one its\n * `moveLifted` / `drop` / `cancel` act on. A drag a composing coordinator owns does not set it\n * — read `data-dragging` (or the context's `isItemDragging`) for \"a drag of this item is live\".\n */\n readonly lifted = computed(() => this.#list.isLifted(this.#host.nativeElement));\n\n /**\n * `true` while a drag of this item is live — the list's own lift, or one owned by a\n * coordinator composing the list (`[forVirtualReorder]`, the virtualized branch of\n * `[forTableRowReorder]`). Reflected as `data-dragging`.\n */\n private readonly dragging = computed(() => this.#list.isItemDragging(this.#host.nativeElement));\n\n /** `true` when this item is the roving-tabindex active candidate. Reflected as `data-highlighted`. */\n private readonly highlighted = computed(() =>\n this.#list.isItemHighlighted(this.#host.nativeElement),\n );\n\n /**\n * `aria-roledescription` from the defaults while this item can be lifted; `null` while it\n * cannot, so an item that cannot move keeps the role name of its own element.\n */\n private readonly roleDescription = computed<string | null>(() =>\n this.effectiveDisabled() ? null : resolveText(this.#defaults.itemRoleDescription) || null,\n );\n\n /**\n * True while this item cannot be lifted, except where a roving delegate governs the host:\n * there the element is a control of the composing widget (a `role=\"columnheader\"` in a\n * column-reorderable grid, which stays sortable, resizable and navigable) and only its lift\n * is disabled, so announcing the host as unavailable would disable the wrong thing.\n * `data-disabled` reflects the state either way.\n */\n private readonly ariaDisabled = computed(\n () => this.effectiveDisabled() && !this.#list.isRovingDelegated(this.#host.nativeElement),\n );\n\n private readonly tabindex = computed<-1 | 0>(() => {\n const rovingTabindex = this.#list.itemTabindex(this.#host.nativeElement);\n if (rovingTabindex !== null) {\n return rovingTabindex;\n }\n if (this.effectiveDisabled()) {\n return -1;\n }\n return this.#list.isFirstFocusableItem(this.#host.nativeElement) ? 0 : -1;\n });\n\n private readonly touchAction = this.#handleGuard.touchAction;\n\n private readonly previewTpl = computed(() =>\n this.previewTpls().find((tpl) =>\n this.#handleGuard.owns(tpl.templateRef.elementRef.nativeElement),\n ),\n );\n\n private readonly placeholderTpl = computed(() =>\n this.placeholderTpls().find((tpl) =>\n this.#handleGuard.owns(tpl.templateRef.elementRef.nativeElement),\n ),\n );\n\n constructor() {\n assertInputBound(this.dragData, 'drag-drop', '[forDraggable]', 'dragData');\n registerWithEnclosingDraggable(this.#host.nativeElement, 'ForDraggable');\n markDragItemHost(this.#host.nativeElement);\n const handle: ForDraggableHandle = {\n host: this.#host.nativeElement,\n data: this.dragData,\n disabled: this.effectiveDisabled,\n textValue: this.textValue,\n acceptsPointerStart: (target) => this.#handleGuard.accepts(target),\n emitDragStart: (index) => {\n if (!this.#destroyRef.destroyed) {\n this.dragStart.emit({ source: this.#list, index });\n }\n },\n emitDragEnd: (dropped) => {\n if (!this.#destroyRef.destroyed) {\n this.dragEnd.emit({ dropped });\n }\n },\n };\n registerHandle(\n handle,\n (h) => this.#list.registerItem(h),\n (h) => this.#list.unregisterItem(h),\n );\n\n if (this.#isBrowser) {\n this.#pointerSession = createPointerDragSession({\n host: this.#host.nativeElement,\n document: this.#document,\n armThreshold: POINTER_ARM_THRESHOLD_PX,\n cancelOnEscape: true,\n capturePointer: true,\n canStart: (event) => this.#handleGuard.canStart(event),\n onLift: (_event, start) => this.#onPointerLift(start),\n onMove: (event) => this.#onPointerMove(event),\n onCommit: () => this.#onPointerCommit(),\n onCancel: () => this.#onPointerCancel(),\n });\n this.#destroyRef.onDestroy(() => {\n if (this.lifted()) {\n this.#list.cancel();\n }\n this.#pointerSession?.destroy();\n this.#clearPlaceholder();\n });\n }\n }\n\n registerHandle(el: HTMLElement): void {\n this.#handleGuard.register(el);\n }\n\n unregisterHandle(el: HTMLElement): void {\n this.#handleGuard.unregister(el);\n }\n\n private handleTouchAction(): 'none' | null {\n return this.#handleGuard.handleTouchAction();\n }\n\n private registerNestedDraggable(el: HTMLElement): void {\n this.#handleGuard.registerNested(el);\n }\n\n private unregisterNestedDraggable(el: HTMLElement): void {\n this.#handleGuard.unregisterNested(el);\n }\n\n #onPointerLift(start: { readonly x: number; readonly y: number }): boolean {\n const preview = this.#buildPreview();\n const index = this.#list.pointerLift(this.#host.nativeElement, start, preview);\n if (index < 0) {\n preview?.destroy();\n return false;\n }\n this.#renderPlaceholder();\n this.#pointerDragging = true;\n return true;\n }\n\n #onPointerMove(event: PointerEvent): void {\n this.#list.pointerMove({ x: event.clientX, y: event.clientY });\n }\n\n #onPointerCommit(): void {\n this.#pointerDragging = false;\n try {\n this.#list.drop();\n } finally {\n this.#clearPlaceholder();\n }\n }\n\n #onPointerCancel(): void {\n if (!this.#pointerDragging) {\n return;\n }\n this.#pointerDragging = false;\n this.#clearPlaceholder();\n this.#list.cancel();\n }\n\n #buildPreview(): DragPreview | null {\n const preview = this.previewTpl();\n if (!preview || !this.#isBrowser) {\n return null;\n }\n const viewRef = this.#vcr.createEmbeddedView(preview.templateRef);\n viewRef.detectChanges();\n return createTemplatePreview(viewRef.rootNodes, this.#host.nativeElement, this.#document, () =>\n viewRef.destroy(),\n );\n }\n\n #renderPlaceholder(): void {\n const placeholder = this.placeholderTpl();\n if (!placeholder || !this.#isBrowser) {\n return;\n }\n this.#placeholderView = this.#vcr.createEmbeddedView(placeholder.templateRef);\n this.#placeholderView.detectChanges();\n this.placeholderActive.set(true);\n this.#list.setLivePlaceholder(this.#placeholderView.rootNodes);\n }\n\n #clearPlaceholder(): void {\n this.#list.setLivePlaceholder(null);\n this.placeholderActive.set(false);\n this.#placeholderView?.destroy();\n this.#placeholderView = null;\n }\n\n private onFocus(): void {\n if (!this.effectiveDisabled()) {\n this.#list.setActiveItem(this.#host.nativeElement);\n }\n }\n\n private onBlur(): void {\n if (this.lifted() && !this.#pointerDragging) {\n this.#list.cancel();\n }\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n if (this.#pointerDragging) {\n return;\n }\n const host = this.#host.nativeElement;\n if (this.lifted()) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.#list.drop();\n return;\n }\n if (event.key === 'Escape' && !isImeComposing(event)) {\n event.preventDefault();\n event.stopPropagation();\n this.#list.cancel();\n return;\n }\n const action = resolveListNavigation(event, {\n orientation: this.#list.orientation(),\n dir: this.#list.dir(),\n });\n if (action) {\n event.preventDefault();\n this.#list.moveLifted(action);\n }\n return;\n }\n if (event.target !== host) {\n return;\n }\n if (this.effectiveDisabled()) {\n this.#navigate(event);\n return;\n }\n if (event.key === ' ' || event.key === 'Enter') {\n if (this.#liftGuard && !this.#liftGuard.canLiftOnKey(event, host)) {\n return;\n }\n event.preventDefault();\n this.#list.lift(host);\n return;\n }\n this.#navigate(event);\n }\n\n #navigate(event: KeyboardEvent): boolean {\n return navigateFromRovingItem(event, {\n groupDisabled: this.#list.disabled(),\n orientation: this.#list.orientation(),\n dir: this.#list.dir(),\n navigate: (action) => this.#list.navigate(this.#host.nativeElement, action),\n });\n }\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n DOCUMENT,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n clampPreviewPosition,\n createPointerDragSession,\n type PointerDragSession,\n markDragItemHost,\n resolveBoundaryElement,\n} from 'forty-cdk/core';\nimport { FOR_DRAGGABLE_CONTEXT, type ForDraggableContext } from './drag-drop-context';\nimport { createPointerHandleGuard, registerWithEnclosingDraggable } from './handle-guard';\n\nconst POINTER_ARM_THRESHOLD_PX = 5;\n\ninterface Point {\n readonly x: number;\n readonly y: number;\n}\n\ninterface LiftSnapshot {\n readonly point: Point;\n readonly position: Point;\n readonly topLeft: Point;\n readonly natural: Point;\n readonly size: { readonly width: number; readonly height: number };\n}\n\ninterface AppliedOffset {\n readonly el: HTMLElement;\n readonly inline: string;\n readonly base: readonly string[];\n readonly offset: Point;\n}\n\nconst ORIGIN: Point = { x: 0, y: 0 };\n\nfunction isOrigin(point: Point): boolean {\n return point.x === 0 && point.y === 0;\n}\n\nfunction splitTranslate(value: string): readonly string[] {\n const parts: string[] = [];\n let depth = 0;\n let current = '';\n for (const char of value.trim()) {\n if (char === '(') {\n depth++;\n } else if (char === ')') {\n depth--;\n }\n if (depth === 0 && /\\s/.test(char)) {\n if (current !== '') {\n parts.push(current);\n current = '';\n }\n continue;\n }\n current += char;\n }\n if (current !== '') {\n parts.push(current);\n }\n return parts.length === 1 && parts[0] === 'none' ? [] : parts;\n}\n\nfunction composeTranslate(base: readonly string[], offset: Point): string {\n const [baseX, baseY, baseZ] = base;\n const x = baseX === undefined ? `${offset.x}px` : `calc(${baseX} + ${offset.x}px)`;\n const y = baseY === undefined ? `${offset.y}px` : `calc(${baseY} + ${offset.y}px)`;\n return baseZ === undefined ? `${x} ${y}` : `${x} ${y} ${baseZ}`;\n}\n\n/**\n * Standalone free-drag directive: repositions its host (or a resolved `rootElement`) by pointer\n * drag via the CSS `translate` property, with **no** `[forDropList]` dependency. The offset\n * composes with the `transform` and the `translate` the element already has, inline or from a\n * stylesheet, so a `translate(-50%, -50%)` or `translate: -50% -50%` centring survives. Unlike\n * `[forDraggable]`, it never commits a reorder — it only moves an arbitrary element around,\n * optionally confined to a `boundary` and locked to one axis. Composes the shared\n * `createPointerDragSession` transport and accepts `[forDragHandle]` children.\n *\n * Its outputs are the `moveStart` / `moveMove` / `moveEnd` trio carrying `{ x, y }` positions —\n * A different vocabulary from `[forDraggable]`'s `dragStart` / `dragEnd`, which carry\n * reorder payloads (`{ source, index }` / `{ dropped }`). Free drag repositions; it never reorders.\n *\n * Pointer-only: there is no WAI-ARIA APG pattern for \"freely reposition an element\", so this is\n * a documented headless exception. It owns no role or ARIA\n * state and must not destroy the moved element's semantics — the consumer keeps the moved\n * element operable at its default position (e.g. a repositionable dialog stays usable by\n * keyboard); dragging is a pointer convenience, not the only way to use it.\n */\n@Directive({\n selector: '[forFreeDrag]',\n exportAs: 'forFreeDrag',\n providers: [{ provide: FOR_DRAGGABLE_CONTEXT, useExisting: ForFreeDrag }],\n host: {\n '[attr.data-dragging]': \"dragging() ? '' : null\",\n '[attr.data-disabled]': \"disabled() ? '' : null\",\n '[style.touch-action]': 'touchAction()',\n },\n})\nexport class ForFreeDrag implements ForDraggableContext {\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #document = inject(DOCUMENT);\n readonly #destroyRef = inject(DestroyRef);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n readonly #lift = signal<LiftSnapshot | null>(null);\n #pointerSession: PointerDragSession | null = null;\n #applied: AppliedOffset | null = null;\n #lastPoint: Point | null = null;\n #scrollListener: AbortController | null = null;\n\n /** When true, the element can't be dragged (it stays focusable; its position doesn't change). */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly #handleGuard = createPointerHandleGuard(this.disabled);\n\n /**\n * The element actually moved: an `HTMLElement`, or a selector resolved via `closest()` from the\n * host. `null` (the default) moves the host itself. Set it to drag a child handle and move an\n * ancestor, e.g. a whole dialog dragged by its header.\n */\n readonly rootElement = input<HTMLElement | string | null>(null);\n\n /**\n * Confine movement within an `HTMLElement`, a `closest()` selector resolved from the host, or\n * `null` (the default) for unbounded movement. Unlike `[forDropList]`'s boundary (which clamps a\n * floating clone), this clamps the **real moved element** so its box stays fully inside.\n */\n readonly boundary = input<HTMLElement | string | null>(null);\n\n /**\n * Constrain movement to one axis. `'x'` pins the element at its lift-time `y` (horizontal-only);\n * `'y'` pins it at its lift-time `x` (vertical-only). `null` (the default) is free.\n */\n readonly lockAxis = input<'x' | 'y' | null>(null);\n\n /** Two-way translate offset (px) from the element's natural position. Controllable / restorable. */\n readonly position = model<{ x: number; y: number }>({ x: 0, y: 0 });\n\n /** Emitted when a pointer drag starts, with the lift-time position. */\n readonly moveStart = output<{ x: number; y: number }>();\n\n /**\n * Emitted on every armed move, and when a scroll during the drag moves the element, with the\n * live position.\n */\n readonly moveMove = output<{ x: number; y: number }>();\n\n /** Emitted when the drag ends, with the final position. */\n readonly moveEnd = output<{ x: number; y: number }>();\n\n /** True while a pointer drag is armed. Reflected as `data-dragging`. */\n readonly dragging = computed(() => this.#lift() !== null);\n\n private readonly touchAction = this.#handleGuard.touchAction;\n\n constructor() {\n registerWithEnclosingDraggable(this.#host.nativeElement, 'ForFreeDrag');\n markDragItemHost(this.#host.nativeElement);\n if (this.#isBrowser) {\n effect(() => {\n this.#applyOffset(this.#resolvedRoot(), this.position());\n });\n this.#destroyRef.onDestroy(() => {\n this.#stopScrollTracking();\n this.#applyOffset(null, ORIGIN);\n });\n this.#pointerSession = createPointerDragSession({\n host: this.#host.nativeElement,\n document: this.#document,\n armThreshold: POINTER_ARM_THRESHOLD_PX,\n cancelOnEscape: true,\n capturePointer: true,\n canStart: (event) => this.#handleGuard.canStart(event),\n onLift: (event, start) => this.#onLift(event, start),\n onMove: (event) => this.#onMove(event),\n onCommit: () => this.#onCommit(),\n onCancel: () => this.#onCancel(),\n });\n this.#destroyRef.onDestroy(() => this.#pointerSession?.destroy());\n }\n }\n\n registerHandle(el: HTMLElement): void {\n this.#handleGuard.register(el);\n }\n\n unregisterHandle(el: HTMLElement): void {\n this.#handleGuard.unregister(el);\n }\n\n private handleTouchAction(): 'none' | null {\n return this.#handleGuard.handleTouchAction();\n }\n\n private registerNestedDraggable(el: HTMLElement): void {\n this.#handleGuard.registerNested(el);\n }\n\n private unregisterNestedDraggable(el: HTMLElement): void {\n this.#handleGuard.unregisterNested(el);\n }\n\n readonly #resolvedRoot = computed<HTMLElement>(() => {\n const root = this.rootElement();\n const host = this.#host.nativeElement;\n if (root === null) {\n return host;\n }\n return typeof root === 'string' ? (host.closest<HTMLElement>(root) ?? host) : root;\n });\n\n #applyOffset(el: HTMLElement | null, offset: Point): void {\n const applied = this.#applied;\n if (applied && (applied.el !== el || isOrigin(offset))) {\n applied.el.style.translate = applied.inline;\n this.#applied = null;\n }\n if (el === null || isOrigin(offset)) {\n return;\n }\n const inline = this.#applied?.inline ?? el.style.translate;\n const base =\n this.#applied?.base ??\n splitTranslate(this.#document.defaultView?.getComputedStyle(el).translate ?? '');\n el.style.translate = composeTranslate(base, offset);\n this.#applied = { el, inline, base, offset };\n }\n\n #naturalOrigin(root: HTMLElement, rect: DOMRect): Point {\n const offset = this.#applied?.el === root ? this.#applied.offset : ORIGIN;\n return { x: rect.left - offset.x, y: rect.top - offset.y };\n }\n\n #onLift(event: PointerEvent, start: Point): boolean {\n const root = this.#resolvedRoot();\n const rect = root.getBoundingClientRect();\n const position = this.position();\n this.#lift.set({\n point: start,\n position,\n topLeft: { x: rect.left, y: rect.top },\n natural: this.#naturalOrigin(root, rect),\n size: { width: rect.width, height: rect.height },\n });\n this.#startScrollTracking({ x: event.clientX, y: event.clientY });\n this.moveStart.emit(position);\n return true;\n }\n\n #onMove(event: PointerEvent): void {\n this.#moveTo({ x: event.clientX, y: event.clientY }, true);\n }\n\n #moveTo(point: Point, emitUnchanged: boolean): void {\n const lift = this.#lift();\n if (!lift) {\n return;\n }\n this.#lastPoint = point;\n const root = this.#resolvedRoot();\n const natural = this.#naturalOrigin(root, root.getBoundingClientRect());\n const pinned = {\n x: lift.topLeft.x + natural.x - lift.natural.x,\n y: lift.topLeft.y + natural.y - lift.natural.y,\n };\n const desired = {\n x: lift.topLeft.x + (point.x - lift.point.x),\n y: lift.topLeft.y + (point.y - lift.point.y),\n };\n const boundaryEl = resolveBoundaryElement(this.#host.nativeElement, this.boundary());\n const boundaryRect = boundaryEl?.getBoundingClientRect() ?? null;\n const clamped = clampPreviewPosition(desired, lift.size, boundaryRect, this.lockAxis(), pinned);\n const next = { x: clamped.x - natural.x, y: clamped.y - natural.y };\n const current = this.position();\n if (!emitUnchanged && next.x === current.x && next.y === current.y) {\n return;\n }\n this.position.set(next);\n this.moveMove.emit(next);\n }\n\n #startScrollTracking(point: Point): void {\n this.#stopScrollTracking();\n this.#lastPoint = point;\n const listener = new AbortController();\n this.#document.addEventListener(\n 'scroll',\n () => {\n const point = this.#lastPoint;\n if (point) {\n this.#moveTo(point, false);\n }\n },\n { capture: true, passive: true, signal: listener.signal },\n );\n this.#scrollListener = listener;\n }\n\n #stopScrollTracking(): void {\n this.#scrollListener?.abort();\n this.#scrollListener = null;\n this.#lastPoint = null;\n }\n\n #onCommit(): void {\n this.#stopScrollTracking();\n this.#lift.set(null);\n this.moveEnd.emit(this.position());\n }\n\n #onCancel(): void {\n const lift = this.#lift();\n if (!lift) {\n return;\n }\n this.#stopScrollTracking();\n this.position.set(lift.position);\n this.#lift.set(null);\n this.moveEnd.emit(this.position());\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectDraggableContext } from './drag-drop-context';\n\n/**\n * Optional drag handle inside a `[forDraggable]`. When at least one handle is present on an item, a pointer\n * drag may only start from within a handle (keyboard dragging is unaffected). Apply on a child element.\n * Sets `touch-action: none` while its item can be dragged, so a touch drag on the handle is not taken\n * by the page's scrolling.\n */\n@Directive({\n selector: '[forDragHandle]',\n exportAs: 'forDragHandle',\n host: {\n '[style.touch-action]': 'context.handleTouchAction()',\n '[attr.data-drag-handle]': \"''\",\n },\n})\nexport class ForDragHandle {\n private readonly context = injectDraggableContext('ForDragHandle');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n registerHandle(\n this.#host.nativeElement,\n (el) => this.context.registerHandle(el),\n (el) => this.context.unregisterHandle(el),\n );\n }\n}\n","/**\n * Returns a copy of `array` with the item at `from` moved to `to`. Indices are clamped to\n * the array bounds; an out-of-range or no-op move returns a shallow copy unchanged.\n */\nexport function moveItemInArray<T>(array: readonly T[], from: number, to: number): T[] {\n const len = array.length;\n if (len === 0) {\n return [];\n }\n const clampedFrom = Math.max(0, Math.min(len - 1, from));\n const clampedTo = Math.max(0, Math.min(len - 1, to));\n const copy = [...array];\n if (clampedFrom === clampedTo) {\n return copy;\n }\n const [item] = copy.splice(clampedFrom, 1);\n copy.splice(clampedTo, 0, item!);\n return copy;\n}\n\n/**\n * Moves the item at `fromIndex` of `from` into `to` at `toIndex`, returning new arrays for\n * both. Does not mutate the inputs. Indices are clamped (`toIndex` may equal `to.length`,\n * i.e. append).\n */\nexport function transferArrayItem<T>(\n from: readonly T[],\n to: readonly T[],\n fromIndex: number,\n toIndex: number,\n): { from: T[]; to: T[] } {\n if (from.length === 0) {\n return { from: [], to: [...to] };\n }\n const clampedFrom = Math.max(0, Math.min(from.length - 1, fromIndex));\n const clampedTo = Math.max(0, Math.min(to.length, toIndex));\n const nextFrom = [...from];\n const [item] = nextFrom.splice(clampedFrom, 1);\n const nextTo = [...to];\n nextTo.splice(clampedTo, 0, item!);\n return { from: nextFrom, to: nextTo };\n}\n"],"mappings":";;;;;AAQA,MAAM,cAAkC;CAAE,GAAG;CAAG,GAAG;AAAC;AAEpD,SAAS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C,OAAO;EAAE,MAAM;EAAU,IAAI;CAAM;AACrC"}
|
|
1
|
+
{"version":3,"file":"forty-cdk-drag-drop.mjs","names":["FOR_DRAG_DROP_DEFAULTS","POINTER_ARM_THRESHOLD_PX","FOR_DRAG_DROP_DEFAULTS"],"sources":["../../../projects/forty-cdk/drag-drop/src/auto-scroll.ts","../../../projects/forty-cdk/drag-drop/src/clip-region.ts","../../../projects/forty-cdk/drag-drop/src/drag-positions.ts","../../../projects/forty-cdk/drag-drop/src/drag-drop-context.ts","../../../projects/forty-cdk/drag-drop/src/drop-list-group.ts","../../../projects/forty-cdk/drag-drop/src/placeholder-position.ts","../../../projects/forty-cdk/drag-drop/src/placeholder-sorter.ts","../../../projects/forty-cdk/drag-drop/src/flip.ts","../../../projects/forty-cdk/drag-drop/src/reorder-animator.ts","../../../projects/forty-cdk/drag-drop/src/drop-list.ts","../../../projects/forty-cdk/drag-drop/src/handle-guard.ts","../../../projects/forty-cdk/drag-drop/src/drag-preview.ts","../../../projects/forty-cdk/drag-drop/src/drag-placeholder.ts","../../../projects/forty-cdk/drag-drop/src/draggable.ts","../../../projects/forty-cdk/drag-drop/src/free-drag.ts","../../../projects/forty-cdk/drag-drop/src/drag-handle.ts","../../../projects/forty-cdk/drag-drop/src/move-item-in-array.ts"],"sourcesContent":["import { composedParentElement, type DragRect } from 'forty-cdk/core';\n\n/** A 2-D scroll velocity vector produced by `computeScrollVelocity`. */\nexport interface AutoScrollVelocity {\n readonly x: number;\n readonly y: number;\n}\n\nconst NO_VELOCITY: AutoScrollVelocity = { x: 0, y: 0 };\n\nfunction axisVelocity(\n pos: number,\n start: number,\n end: number,\n edgeSize: number,\n maxSpeed: number,\n): number {\n if (edgeSize <= 0 || pos < start || pos > end) {\n return 0;\n }\n const distStart = pos - start;\n if (distStart <= edgeSize) {\n return -maxSpeed * (1 - distStart / edgeSize);\n }\n const distEnd = end - pos;\n if (distEnd <= edgeSize) {\n return maxSpeed * (1 - distEnd / edgeSize);\n }\n return 0;\n}\n\n/**\n * Computes a 2-D scroll velocity from the pointer position relative to a\n * scroll container's bounding rect. Each axis is computed independently:\n * negative values scroll toward the start edge, positive toward the end.\n * Velocity scales linearly with proximity; at the edge = ±`maxSpeed`, at\n * `edgeSize` pixels away = 0.\n */\nexport function computeScrollVelocity(\n rect: DragRect,\n point: { readonly x: number; readonly y: number },\n edgeSize: number,\n maxSpeed: number,\n): AutoScrollVelocity {\n return {\n x: axisVelocity(point.x, rect.left, rect.right, edgeSize, maxSpeed),\n y: axisVelocity(point.y, rect.top, rect.bottom, edgeSize, maxSpeed),\n };\n}\n\nfunction isScrollable(el: HTMLElement, win: Window): boolean {\n const style = win.getComputedStyle(el);\n const overflowY = style.overflowY;\n const overflowX = style.overflowX;\n const scrollsY =\n (overflowY === 'auto' || overflowY === 'scroll') && el.scrollHeight > el.clientHeight;\n const scrollsX =\n (overflowX === 'auto' || overflowX === 'scroll') && el.scrollWidth > el.clientWidth;\n return scrollsY || scrollsX;\n}\n\n/**\n * Walks up the composed tree from `start` (inclusive), stopping before\n * `documentElement` and `body`, and returns every scrollable ancestor from the\n * innermost outward. An empty result leaves the viewport as the only target.\n */\nfunction findScrollContainers(start: HTMLElement | null, win: Window): HTMLElement[] {\n const containers: HTMLElement[] = [];\n let el = start;\n while (el !== null && el !== win.document.documentElement && el !== win.document.body) {\n if (isScrollable(el, win)) {\n containers.push(el);\n }\n el = composedParentElement(el);\n }\n return containers;\n}\n\n/** An active auto-scroll controller returned by `createAutoScroller`. */\nexport interface AutoScroller {\n /** Arms or disarms the rAF loop for the given pointer position. */\n update(point: { x: number; y: number }): void;\n /** Cancels the loop and clears cached state. Idempotent. */\n stop(): void;\n}\n\n/** Configuration passed to `createAutoScroller`. */\nexport interface AutoScrollerConfig {\n /** The list host element; used as the fallback start for the scrollable-container search. */\n readonly host: HTMLElement;\n /** The browser `Window`, or `null` in SSR / test environments without a DOM. */\n readonly win: Window | null;\n /** Pixel distance from the scroll edge that arms auto-scroll. */\n readonly edgeSize: number;\n /** Maximum scroll delta (px) applied per animation frame. */\n readonly maxSpeed: number;\n /** Called after each frame that actually scrolls, so callers can re-resolve the drop target. */\n readonly onFrame: () => void;\n /**\n * Optional resolver for the element the scrollable-container search should start from, given the\n * current pointer position. Returns the element under the pointer (or `null` to fall back to\n * `host`). Supplied by callers that drag across connected lists so auto-scroll follows the\n * container the pointer is actually over — not always the origin list. The search is re-run on\n * every `update`, so a pointer crossing from one list into another scrolls the destination\n * container.\n */\n readonly resolveScrollHost?: (point: { x: number; y: number }) => HTMLElement | null;\n}\n\ninterface ScrollTarget {\n velocity(point: { x: number; y: number }, edgeSize: number, maxSpeed: number): AutoScrollVelocity;\n scrollBy(dx: number, dy: number): void;\n}\n\nfunction towardRoom(delta: number, offset: number, max: number): number {\n if (delta < 0) {\n return offset >= 1 ? delta : 0;\n }\n return offset <= max - 1 ? delta : 0;\n}\n\nfunction elementTarget(el: HTMLElement, win: Window): ScrollTarget {\n return {\n velocity(point, edgeSize, maxSpeed): AutoScrollVelocity {\n const r = el.getBoundingClientRect();\n if (point.x < r.left || point.x > r.right || point.y < r.top || point.y > r.bottom) {\n return NO_VELOCITY;\n }\n const v = computeScrollVelocity(r, point, edgeSize, maxSpeed);\n const maxX = el.scrollWidth - el.clientWidth;\n const offsetX =\n v.x !== 0 && win.getComputedStyle(el).direction === 'rtl'\n ? el.scrollLeft + maxX\n : el.scrollLeft;\n return {\n x: towardRoom(v.x, offsetX, maxX),\n y: towardRoom(v.y, el.scrollTop, el.scrollHeight - el.clientHeight),\n };\n },\n scrollBy(dx: number, dy: number): void {\n el.scrollLeft += dx;\n el.scrollTop += dy;\n },\n };\n}\n\nfunction viewportTarget(win: Window): ScrollTarget {\n return {\n velocity(point, edgeSize, maxSpeed): AutoScrollVelocity {\n const rect = { left: 0, top: 0, right: win.innerWidth, bottom: win.innerHeight };\n return computeScrollVelocity(rect, point, edgeSize, maxSpeed);\n },\n scrollBy(dx: number, dy: number): void {\n win.scrollBy(dx, dy);\n },\n };\n}\n\n/**\n * Creates an auto-scroller that drives a `requestAnimationFrame` loop while a\n * pointer drag is near a scroll edge. The candidates are the scrollable\n * containers from the list (or the one under the pointer) outward, then the\n * viewport; each frame scrolls the innermost candidate whose rect holds the\n * pointer, whose edge band the pointer is in, and which can still scroll that\n * way. Deltas are applied instantaneously per frame — no CSS smooth-scroll\n * easing — which is the `prefers-reduced-motion`-safe approach: scrolling is\n * functional, not decorative, so no reduced-motion branch is needed.\n *\n * Returns a no-op controller when `config.win` is falsy or lacks\n * `requestAnimationFrame` (SSR / environments without a window).\n */\nexport function createAutoScroller(config: AutoScrollerConfig): AutoScroller {\n const maybeWin = config.win;\n if (!maybeWin || typeof maybeWin.requestAnimationFrame !== 'function') {\n return { update() {}, stop() {} };\n }\n\n const win: Window = maybeWin;\n\n let targets: readonly ScrollTarget[] = [];\n let point: { x: number; y: number } | null = null;\n let rafId: number | null = null;\n\n function resolveTargets(at: { x: number; y: number }): readonly ScrollTarget[] {\n const start = config.resolveScrollHost\n ? (config.resolveScrollHost(at) ?? config.host)\n : config.host;\n return [\n ...findScrollContainers(start, win).map((el) => elementTarget(el, win)),\n viewportTarget(win),\n ];\n }\n\n function activeScroll(at: {\n x: number;\n y: number;\n }): { target: ScrollTarget; v: AutoScrollVelocity } | null {\n for (const target of targets) {\n const v = target.velocity(at, config.edgeSize, config.maxSpeed);\n if (v.x !== 0 || v.y !== 0) {\n return { target, v };\n }\n }\n return null;\n }\n\n function tick(): void {\n rafId = null;\n if (point === null) {\n return;\n }\n const active = activeScroll(point);\n if (active === null) {\n return;\n }\n active.target.scrollBy(active.v.x, active.v.y);\n config.onFrame();\n rafId = win.requestAnimationFrame(tick);\n }\n\n return {\n update(next: { x: number; y: number }): void {\n point = next;\n targets = resolveTargets(next);\n if (activeScroll(next) === null) {\n if (rafId !== null) {\n win.cancelAnimationFrame(rafId);\n rafId = null;\n }\n } else if (rafId === null) {\n rafId = win.requestAnimationFrame(tick);\n }\n },\n stop(): void {\n if (rafId !== null) {\n win.cancelAnimationFrame(rafId);\n rafId = null;\n }\n targets = [];\n point = null;\n },\n };\n}\n","import { composedParentElement, type DragRect } from 'forty-cdk/core';\n\nexport interface ClippingAncestor {\n readonly el: HTMLElement;\n readonly x: boolean;\n readonly y: boolean;\n}\n\nexport function findClippingAncestors(host: HTMLElement, win: Window): readonly ClippingAncestor[] {\n const doc = win.document;\n const clippers: ClippingAncestor[] = [];\n let position = win.getComputedStyle(host).position;\n for (\n let el = composedParentElement(host);\n el !== null && el !== doc.body && el !== doc.documentElement;\n el = composedParentElement(el)\n ) {\n if (position === 'fixed') {\n break;\n }\n const style = win.getComputedStyle(el);\n if (position === 'absolute' && style.position === 'static') {\n continue;\n }\n position = style.position;\n const x = style.overflowX !== 'visible';\n const y = style.overflowY !== 'visible';\n if (x || y) {\n clippers.push({ el, x, y });\n }\n }\n return clippers;\n}\n\nexport function clipRegion(clippers: readonly ClippingAncestor[]): DragRect | undefined {\n if (clippers.length === 0) {\n return undefined;\n }\n let left = -Infinity;\n let top = -Infinity;\n let right = Infinity;\n let bottom = Infinity;\n for (const { el, x, y } of clippers) {\n const rect = el.getBoundingClientRect();\n if (x) {\n left = Math.max(left, rect.left);\n right = Math.min(right, rect.right);\n }\n if (y) {\n top = Math.max(top, rect.top);\n bottom = Math.min(bottom, rect.bottom);\n }\n }\n return { left, top, right, bottom };\n}\n","/** One reachable keyboard drop position: a container plus an insertion index within it. */\nexport interface DragSlot {\n /** Index into the ordered `[source, ...connected]` container list (0 = source). */\n readonly containerIndex: number;\n /** Insertion index within that container. */\n readonly index: number;\n}\n\n/**\n * Builds the flat, ordered sequence of reachable drop positions for a keyboard drag.\n * - The source container (index 0) contributes one slot per existing item\n * (`0 .. sourceCount - 1`): the dragged item is *reinserted* among the current items, so\n * the valid destination indices are exactly the existing positions.\n * - Each connected container contributes one slot per insertion gap (`0 .. count`,\n * inclusive of the append position), since the item is *added* to it.\n * Order: all source slots, then each connected container's slots in `connectedCounts` order.\n */\nexport function buildDragSlots(\n sourceCount: number,\n connectedCounts: readonly number[],\n): DragSlot[] {\n const slots: DragSlot[] = [];\n const clampedSource = Math.max(0, sourceCount);\n for (let i = 0; i < clampedSource; i++) {\n slots.push({ containerIndex: 0, index: i });\n }\n for (let ci = 0; ci < connectedCounts.length; ci++) {\n const count = Math.max(0, connectedCounts[ci]!);\n for (let i = 0; i <= count; i++) {\n slots.push({ containerIndex: ci + 1, index: i });\n }\n }\n return slots;\n}\n\n/** Flat-sequence position of `(containerIndex, index)`, or `-1` if not present. */\nexport function indexOfSlot(\n slots: readonly DragSlot[],\n containerIndex: number,\n index: number,\n): number {\n return slots.findIndex((s) => s.containerIndex === containerIndex && s.index === index);\n}\n","import { inject, InjectionToken, type Signal } from '@angular/core';\nimport {\n assertRootContext,\n type DragPreview,\n type ListNavigationAction,\n orphanContextError,\n type WritingDirection,\n} from 'forty-cdk/core';\n\n/** A registered draggable item, as seen by its drop list. */\nexport interface ForDraggableHandle {\n readonly host: HTMLElement;\n /** The consumer-supplied data payload for this item. */\n readonly data: Signal<unknown>;\n /** Effective disabled (item's own `dragDisabled` OR the list being disabled). */\n readonly disabled: Signal<boolean>;\n /** The item's `[textValue]`: the name drag announcements use in place of its own. */\n readonly textValue: Signal<string | null>;\n /**\n * Whether a pointer press on `target` may start a drag of this item: `false` for a press inside\n * a draggable nested in it, or outside its `[forDragHandle]`s when it has any.\n */\n acceptsPointerStart(target: EventTarget | null): boolean;\n /** Emit the item's `dragStart` for a drag of it starting at source `index`. */\n emitDragStart(index: number): void;\n /** Emit the item's `dragEnd`; `dropped` is `true` on a committed drop, `false` on cancel. */\n emitDragEnd(dropped: boolean): void;\n}\n\n/**\n * Coordination contract owned by `ForDropList` and consumed by each `ForDraggable`. Also the\n * public handle type used by `[connectedTo]` and the `dragDrop` event's\n * `previousContainer` / `container` — advanced consumers may read `host` / `items`; the\n * interaction methods exist for the directive pieces.\n */\nexport interface ForDropListContext {\n readonly host: HTMLElement;\n readonly orientation: Signal<'horizontal' | 'vertical' | 'mixed'>;\n readonly dir: Signal<WritingDirection>;\n /** Effective disabled of the whole list. */\n readonly disabled: Signal<boolean>;\n readonly items: Signal<readonly ForDraggableHandle[]>;\n /** Insertion index this list is the current drop target at, else `null`. */\n readonly dragOverIndex: Signal<number | null>;\n\n setDragOver(index: number | null): void;\n\n registerItem(handle: ForDraggableHandle): void;\n unregisterItem(handle: ForDraggableHandle): void;\n\n /** Roving tab-stop value for `el` before/after roving engages (mirror Listbox's pattern). */\n itemTabindex(el: HTMLElement): -1 | 0 | null;\n /**\n * Whether an external `FOR_DROP_LIST_ROVING_DELEGATE` — not this list's own roving —\n * decides `el`'s tab order. Drives the `aria-disabled` an item emits: a disabled item\n * whose tab order a composing widget governs is a control of that widget (a\n * `role=\"columnheader\"` in a grid) that merely cannot be lifted, so announcing the host\n * as unavailable would disable the composed control instead of the drag affordance.\n */\n isRovingDelegated(el: HTMLElement): boolean;\n isFirstFocusableItem(el: HTMLElement): boolean;\n isItemHighlighted(el: HTMLElement): boolean;\n /**\n * Whether a live drag of `el` is in progress — this list's own keyboard / pointer lift, or a\n * lift a composing coordinator owns and drives itself (`ForDropList.beginCoordinatorLift`).\n * Drives `[forDraggable]`'s `data-dragging`.\n *\n * Broader than {@link isLifted}, which answers only for the list's own lift —\n * the state {@link moveLifted} / {@link drop} / {@link cancel} act on.\n */\n isItemDragging(el: HTMLElement): boolean;\n setActiveItem(el: HTMLElement): void;\n\n /** Idle roving focus move from `el`. */\n navigate(el: HTMLElement, action: ListNavigationAction): void;\n\n /** Start a keyboard drag for `el`; returns its source index, or `-1` if it could not lift. */\n lift(el: HTMLElement): number;\n /** Whether `el` is the currently lifted item. */\n isLifted(el: HTMLElement): boolean;\n /** Step the logical drop target while lifted. */\n moveLifted(action: ListNavigationAction): void;\n /**\n * Commit the current drag (emits `dragDrop` on the source list). No-op if nothing lifted.\n *\n * After a **keyboard** drop whose lifted item held document focus, focus is restored on the next\n * render to the item whose `dragData` is the dropped item, else to the item at `currentIndex` in\n * the target container — so a cross-list transfer, a `@for` re-render that detaches the lifted\n * element, or one that rebinds its slot to a neighbour does not strand the keyboard user on\n * `<body>` or on the wrong item. The restore is skipped when focus already sits somewhere other than `<body>`, so a\n * consumer who moves focus inside their `(dragDrop)` handler keeps it. Pointer drops never\n * move focus.\n */\n drop(): void;\n /** Abort the current drag without emitting `dragDrop`. */\n cancel(): void;\n /**\n * Begin a pointer drag for `el` at viewport point `point`. Sets up the same session state as a\n * keyboard lift. `preview` is the floating element supplied by the draggable (a consumer\n * `[forDragPreview]` template) — either a full {@link DragPreview} or the minimal\n * `{ moveTo, destroy }` shape; when omitted, the list creates the default cloned preview.\n * Returns the source index, or `-1` if it could not lift.\n */\n pointerLift(\n el: HTMLElement,\n point: { x: number; y: number },\n preview?: DragPreview | { moveTo(x: number, y: number): void; destroy(): void } | null,\n ): number;\n /** Update the live pointer drop target + preview position. No-op if nothing is lifted. */\n pointerMove(point: { x: number; y: number }): void;\n /**\n * Register the rendered placeholder's root nodes with the source list so it can reposition\n * them to the live drop index during a `liveSort` pointer drag, after a composing coordinator's\n * `layoutPlaceholder` has placed them. Pass `null` to clear. Without `liveSort` the nodes stay\n * where they were rendered. Called by `ForDraggable`.\n */\n setLivePlaceholder(nodes: readonly Node[] | null): void;\n}\n\nexport const FOR_DROP_LIST_CONTEXT = new InjectionToken<ForDropListContext>(\n 'FOR_DROP_LIST_CONTEXT',\n);\n\n/**\n * Optional external authority for a `[forDropList]`'s roving tab order, provided on the\n * list host by a wrapper that composes the list into a larger roving model. When present,\n * the list defers each item's roving `tabindex` to the delegate instead of its own\n * `RovingTabindex`, so the composed list shares one tab stop with the surrounding widget\n * rather than exposing a second one.\n *\n * `ForTableColumnReorder` provides one backed by the table's composite grid roving so a\n * sortable + column-reorderable grid exposes a single tab stop across header and body,\n * per the WAI-ARIA Data Grid pattern. The same composed roving can also govern each item's\n * `data-highlighted` styling hook via {@link isItemHighlighted}.\n *\n * Both members return `null` to defer to the list's own roving — a wrapper hands control\n * back for states where the composed model does not apply (e.g. a `mode=\"table\"` header row\n * that is not part of any composite grid).\n */\nexport interface ForDropListRovingDelegate {\n /**\n * Roving `tabindex` for `el` (`0` for the single tab stop, `-1` otherwise), or `null` to\n * defer to the list's own roving.\n *\n * A non-`null` answer is the **whole** tab-order decision for that item: it outranks the\n * item's own disabled state, so answering `0` for a `[dragDisabled]` item makes it\n * focusable and the group's tab stop (what a pinned column in a composite grid needs), and\n * answering `-1` for every item leaves the group with no tab stop. A delegate that does not\n * want that authority for an item returns `null` there. The composed widget also owns focus\n * activation for such an item, since a disabled draggable does not claim the list's active\n * item on focus.\n */\n itemTabindex(el: HTMLElement): -1 | 0 | null;\n /**\n * Whether `el` is the current keyboard-highlighted candidate — drives its `data-highlighted`\n * styling hook — or `null` to defer to the list's own roving highlight. Optional: a delegate\n * that governs only the tab order omits it, and each item's `data-highlighted` follows the\n * list's own roving.\n */\n isItemHighlighted?(el: HTMLElement): boolean | null;\n}\n\nexport const FOR_DROP_LIST_ROVING_DELEGATE = new InjectionToken<ForDropListRovingDelegate>(\n 'FOR_DROP_LIST_ROVING_DELEGATE',\n);\n\n/**\n * A coordinator composing a `[forDropList]` over a rendered window of a larger dataset, provided\n * on the list host — `[forVirtualReorder]` and `[forTableRowReorder]` provide one. With a\n * coordinator in scope the list:\n *\n * - announces every lift, move and drop, and reports `[forDraggable]`'s `dragStart` index, at the\n * positions the coordinator resolves, counted against {@link count};\n * - is a **closed** list: it joins no `[forDropListGroup]`, connects to no other list, and so can\n * neither send an item to another list nor receive one. The coordinator's output describes a\n * reorder within its own dataset, which a transfer is not.\n */\nexport interface ForDropListCoordinator {\n /** The total every drag announcement counts positions against, such as the dataset size. */\n count(): number;\n /**\n * The `from` / `to` positions the coordinator reports for the lifted item at window index\n * `previousIndex` resolved to window insertion index `currentIndex`. A lift is resolved as\n * `resolveReorder(from, from)` and reports its `from`.\n */\n resolveReorder(previousIndex: number, currentIndex: number): { from: number; to: number };\n /**\n * Lays out the `[forDragPlaceholder]` root nodes rendered for the pointer-lifted `lifted` item,\n * once, before they are first painted. A coordinator whose items are positioned out of flow\n * places the placeholder in the lifted item's slot here; without it the placeholder renders as\n * an in-flow sibling of the item.\n */\n layoutPlaceholder?(nodes: readonly Node[], lifted: HTMLElement): void;\n}\n\nexport const FOR_DROP_LIST_COORDINATOR = new InjectionToken<ForDropListCoordinator>(\n 'FOR_DROP_LIST_COORDINATOR',\n);\n\n/**\n * Optional DI seam, provided on an ancestor of the draggables, that restricts\n * which keys may start a keyboard lift on a `[forDraggable]`. When present,\n * `ForDraggable` consults it before lifting on Enter / Space and skips the lift\n * for any key the guard rejects, leaving that key to a co-located affordance\n * that owns it. Absent for a plain `[forDropList]`, where both keys lift.\n *\n * `ForTableColumnReorder` provides one so a header cell that is both sortable and\n * column-reorderable splits the two keyboard activations along WAI-ARIA lines —\n * `Space` lifts the column for reordering, `Enter` is left to the sort header —\n * detecting the co-location by DOM marker rather than importing any table symbol.\n */\nexport interface ForDraggableLiftGuard {\n /**\n * Whether a keyboard `Enter` / `Space` on `host` may start a lift. Return\n * `false` to defer that key to a co-located affordance; `true` to lift.\n */\n canLiftOnKey(event: KeyboardEvent, host: HTMLElement): boolean;\n}\n\nexport const FOR_DRAGGABLE_LIFT_GUARD = new InjectionToken<ForDraggableLiftGuard>(\n 'FOR_DRAGGABLE_LIFT_GUARD',\n);\n\nexport function injectDropListContext(piece: string): ForDropListContext {\n const ctx = inject(FOR_DROP_LIST_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-DRAG-DROP-001',\n piece,\n root: '[forDropList]',\n token: 'FOR_DROP_LIST_CONTEXT',\n });\n }\n return ctx;\n}\n\n/** Emitted by the **source** `ForDropList` on a committed drop (keyboard or pointer). */\nexport interface ForDragDropEvent {\n /**\n * The dropped item's `[dragData]` payload. Typed `unknown` because a\n * `[forDropList]` owns no item data (bring-your-own-data), so there is no\n * input for Angular to infer an item type from. Narrow it against your own\n * model when you need it, or reorder purely by `previousIndex` /\n * `currentIndex` and ignore it.\n */\n readonly item: unknown;\n readonly previousContainer: ForDropListContext;\n readonly container: ForDropListContext;\n readonly previousIndex: number;\n readonly currentIndex: number;\n}\n\n/** Emitted by `ForDraggable` when a drag (keyboard or pointer) starts. */\nexport interface ForDragStartEvent {\n readonly source: ForDropListContext;\n /**\n * The dragged item's source index in its list, or the position a `FOR_DROP_LIST_COORDINATOR`\n * reports for it when one composes the list (a dataset index under virtualization).\n */\n readonly index: number;\n}\n\n/** Emitted by `ForDraggable` when a drag ends (committed or cancelled). */\nexport interface ForDragEndEvent {\n /** `true` on a committed drop, `false` on cancel. */\n readonly dropped: boolean;\n}\n\n/**\n * Internal coordination surface a `ForDraggable` / `ForFreeDrag` exposes to its\n * `[forDragHandle]` children.\n */\nexport interface ForDraggableContext {\n /** Register a handle element; while any handle is registered, pointer drags may only start on one. */\n registerHandle(el: HTMLElement): void;\n unregisterHandle(el: HTMLElement): void;\n}\n\n/** The channels the drag-drop pieces read off their `[forDraggable]` / `[forFreeDrag]` and no consumer calls. */\nexport interface DraggablePieceContext {\n /** `'none'` while a handle should suppress native touch scrolling, `null` while dragging is disabled. */\n handleTouchAction(): 'none' | null;\n /** Register the host of a nested draggable; a press inside it never starts a drag of this one. */\n registerNestedDraggable(el: HTMLElement): void;\n unregisterNestedDraggable(el: HTMLElement): void;\n}\n\n/**\n * Internal view of {@link FOR_DRAGGABLE_CONTEXT}: everything {@link ForDraggableContext}\n * publishes plus the {@link DraggablePieceContext} channels.\n *\n * Never exported from `public-api.ts`. `ForDraggable` and `ForFreeDrag` declare those\n * members TS-`private`, which keeps them out of the emitted `.d.ts` while `useExisting`\n * still satisfies this contract at runtime.\n */\nexport interface DraggableContext extends ForDraggableContext, DraggablePieceContext {}\n\n/**\n * DI token for the coordination surface `[forDraggable]` / `[forFreeDrag]` provide.\n *\n * Publicly typed as {@link ForDraggableContext}. The pieces read the same token at an\n * internal type that adds their channels, so a wrapper re-providing it must alias it to\n * the directive: `{ provide: FOR_DRAGGABLE_CONTEXT, useExisting: MyDraggable }`, where\n * `MyDraggable` extends `ForDraggable` or `ForFreeDrag`. A value that merely satisfies the\n * declared type resolves too, and is rejected in dev mode by the first piece to reach a channel.\n */\nexport const FOR_DRAGGABLE_CONTEXT = new InjectionToken<ForDraggableContext>(\n 'FOR_DRAGGABLE_CONTEXT',\n);\n\nexport function injectDraggableContext(piece: string): DraggableContext {\n const ctx = inject(FOR_DRAGGABLE_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-DRAG-DROP-002',\n piece,\n root: '[forDraggable] or [forFreeDrag]',\n token: 'FOR_DRAGGABLE_CONTEXT',\n });\n }\n return asDraggableContext(ctx, piece);\n}\n\nexport function asDraggableContext(ctx: ForDraggableContext, piece: string): DraggableContext {\n const widened = ctx as unknown as DraggableContext;\n assertRootContext({\n entryPoint: 'drag-drop',\n token: 'FOR_DRAGGABLE_CONTEXT',\n root: '[forDraggable] or [forFreeDrag]',\n piece,\n probe: () => widened.registerNestedDraggable,\n });\n return widened;\n}\n","import { Directive, InjectionToken, signal, type Signal } from '@angular/core';\n\nimport type { ForDropListContext } from './drag-drop-context';\n\nexport const FOR_DROP_LIST_GROUP = new InjectionToken<ForDropListGroup>('FOR_DROP_LIST_GROUP');\n\n/**\n * Groups sibling `[forDropList]` elements so items can be transferred between\n * them without hand-wiring `[connectedTo]` on each list. Every list nested\n * under `[forDropListGroup]` automatically becomes a connected transfer target\n * for every other member of the group.\n */\n@Directive({\n selector: '[forDropListGroup]',\n exportAs: 'forDropListGroup',\n providers: [{ provide: FOR_DROP_LIST_GROUP, useExisting: ForDropListGroup }],\n})\nexport class ForDropListGroup {\n readonly #members = signal<readonly ForDropListContext[]>([]);\n\n /** All registered drop lists in this group, in registration order. */\n readonly members: Signal<readonly ForDropListContext[]> = this.#members.asReadonly();\n\n /** @internal */\n register(ctx: ForDropListContext): void {\n const current = this.#members();\n if (current.includes(ctx)) {\n return;\n }\n this.#members.set([...current, ctx]);\n }\n\n /** @internal */\n unregister(ctx: ForDropListContext): void {\n this.#members.set(this.#members().filter((c) => c !== ctx));\n }\n}\n","/** Where to insert the live-sort placeholder: a parent node and the node to insert before. */\nexport interface PlaceholderInsertion {\n /** The DOM node the placeholder's nodes should be inserted into. */\n readonly parent: Node;\n /** The reference node to insert before; `null` means append to `parent`. */\n readonly ref: Node | null;\n}\n\n/**\n * Computes the DOM insertion point for the live-sort placeholder.\n *\n * @param hosts The target container's non-lifted item host elements, in DOM order.\n * @param index Insertion index within `hosts` (`0 .. hosts.length`, inclusive of append).\n * @param container Fallback parent used when the container has no items.\n * @returns The `parent` node and the `ref` node to insert before (`null` = append).\n */\nexport function placeholderInsertion(\n hosts: readonly HTMLElement[],\n index: number,\n container: HTMLElement,\n): PlaceholderInsertion {\n if (index < hosts.length) {\n const at = hosts[index]!;\n return { parent: at.parentNode ?? container, ref: at };\n }\n const last = hosts[hosts.length - 1];\n if (last) {\n return { parent: last.parentNode ?? container, ref: last.nextSibling };\n }\n return { parent: container, ref: null };\n}\n\n/**\n * Clamps a live-sort placeholder insertion index so it cannot cross a `dragDisabled`\n * (pinned) item. Each disabled host is a hard wall bounding the contiguous run of enabled\n * positions that contains `origin` — the gap the dragged item was lifted from — so the\n * placeholder stops at the first pinned item instead of travelling past it.\n *\n * Visual only: the committed drop index is resolved separately and is left unaffected. With\n * no disabled host the input index is returned unchanged (clamped to the valid range).\n *\n * @param index Raw insertion index resolved from pointer geometry (`0 .. disabled.length`).\n * @param disabled Disabled flag per non-lifted host, in DOM order.\n * @param origin Insertion index the dragged item was lifted from (its source gap).\n * @returns `index` clamped to the enabled run around `origin`.\n */\nexport function fencePlaceholderIndex(\n index: number,\n disabled: readonly boolean[],\n origin: number,\n): number {\n let lower = 0;\n for (let i = origin - 1; i >= 0; i--) {\n if (disabled[i]) {\n lower = i + 1;\n break;\n }\n }\n let upper = disabled.length;\n for (let i = origin; i < disabled.length; i++) {\n if (disabled[i]) {\n upper = i;\n break;\n }\n }\n return Math.max(lower, Math.min(upper, index));\n}\n","import type { ForDraggableHandle, ForDropListContext } from './drag-drop-context';\nimport { fencePlaceholderIndex, placeholderInsertion } from './placeholder-position';\n\n/** Options handed to {@link PlaceholderSorter} at lift time. */\nexport interface PlaceholderSorterOptions {\n /** The source list the drag originates from (the fence is computed against its items). */\n readonly source: ForDropListContext;\n /** The lifted item's host element (excluded from the target item rects). */\n readonly lifted: HTMLElement;\n /** The owning document (a fragment is built from it to batch the node move). */\n readonly doc: Document;\n /** The source list's items, by host, used to compute the `dragDisabled` fence. */\n readonly sourceItems: () => readonly ForDraggableHandle[];\n /** Index of `lifted` within the source list's items (the fence origin). */\n readonly originIndex: () => number;\n}\n\n/**\n * Lazy `liveSort` strategy: relocates the rendered placeholder's root nodes to the live resolved\n * drop index during a pointer drag — within the source list and across connected lists — so\n * siblings part to reveal where the item will land.\n *\n * Created at `pointerLift` only when `liveSort` is on (and on a browser platform); when it is off\n * the list creates no sorter and `#resolveDrop` skips placeholder movement entirely, replacing the\n * former inline `if (this.liveSort())` gate. A `dragDisabled` sibling in the source list acts as a\n * hard visual fence: the placeholder stops at the first pinned item instead of travelling past it.\n *\n * Constructed directly (`new PlaceholderSorter(options)`); it holds no injection context.\n */\nexport class PlaceholderSorter {\n readonly #source: ForDropListContext;\n readonly #lifted: HTMLElement;\n readonly #doc: Document;\n readonly #sourceItems: () => readonly ForDraggableHandle[];\n readonly #originIndex: () => number;\n #nodes: readonly Node[] | null = null;\n\n constructor(options: PlaceholderSorterOptions) {\n this.#source = options.source;\n this.#lifted = options.lifted;\n this.#doc = options.doc;\n this.#sourceItems = options.sourceItems;\n this.#originIndex = options.originIndex;\n }\n\n /** Store (or clear) the placeholder's root nodes supplied by the draggable. */\n setNodes(nodes: readonly Node[] | null): void {\n this.#nodes = nodes;\n }\n\n /** Move the placeholder to the fenced resolved drop index in `targetCtx`. */\n onTargetChange(targetCtx: ForDropListContext, index: number): void {\n this.#move(targetCtx, this.#fencedIndex(targetCtx, index));\n }\n\n #fencedIndex(targetCtx: ForDropListContext, index: number): number {\n if (targetCtx !== this.#source) {\n return index;\n }\n const disabled = this.#sourceItems()\n .filter((h) => h.host !== this.#lifted)\n .map((h) => h.disabled());\n const origin = this.#originIndex();\n return fencePlaceholderIndex(index, disabled, origin < 0 ? 0 : origin);\n }\n\n #move(targetCtx: ForDropListContext, index: number): void {\n const nodes = this.#nodes;\n if (nodes === null || nodes.length === 0) {\n return;\n }\n const fragment = this.#doc.createDocumentFragment();\n for (const node of nodes) {\n fragment.appendChild(node);\n }\n const hosts = targetCtx\n .items()\n .map((h) => h.host)\n .filter((h) => h !== this.#lifted);\n const { parent, ref } = placeholderInsertion(hosts, index, targetCtx.host);\n parent.insertBefore(fragment, ref);\n }\n}\n","import { awaitTransformTransition } from 'forty-cdk/core';\n\n/** A minimal positioned rect — only the top-left corner is needed for a FLIP translate. */\nexport interface FlipRect {\n readonly left: number;\n readonly top: number;\n}\n\n/** The inverted translate (in px) that visually returns `last` to `first`. */\nexport interface FlipDelta {\n readonly dx: number;\n readonly dy: number;\n}\n\n/** Pure: the translate that moves an element from its Last position back to its First. */\nexport function flipDelta(first: FlipRect, last: FlipRect): FlipDelta {\n return { dx: first.left - last.left, dy: first.top - last.top };\n}\n\n/** Styling hook attribute set on each element while its FLIP transition plays. */\nexport const FLIP_ANIMATING_ATTR = 'data-drag-animating';\n\n/** Configuration for {@link playFlip}. */\nexport interface PlayFlipConfig {\n /** Element → its First (pre-change) rect, captured before the data change. */\n readonly first: ReadonlyMap<HTMLElement, FlipRect>;\n /** The browser window (for reflow + timeout), or `null` in SSR / non-DOM environments. */\n readonly win: Window | null;\n /** An element to leave untouched (the dragged host handled by drop-settle). */\n readonly exclude?: HTMLElement | null;\n}\n\n/**\n * Runs the Invert + Play steps of a FLIP transition for every element in `first` that is still\n * connected and has moved. Measures Last via `getBoundingClientRect`, applies the inverted\n * transform with the transition suppressed, forces a reflow, then transitions back to the element's\n * resting inline transform while `data-drag-animating` is present so a consumer CSS rule keyed on\n * it governs duration / easing. An inline `transform` the element already carries, such as a\n * windowed row's positioning offset, is kept: the inverted translate is prepended to it and the\n * transition ends on it. `data-drag-animating` is removed when the element's own `transform`\n * transition ends, or at once when no transition is configured. No-op when `win` is `null`. The\n * library imposes no duration of its own.\n */\nexport function playFlip(config: PlayFlipConfig): void {\n const { first, win, exclude } = config;\n if (!win) {\n return;\n }\n\n const workList: { el: HTMLElement; d: FlipDelta; rest: string }[] = [];\n for (const [el, firstRect] of first) {\n if (el === exclude) {\n continue;\n }\n if (!el.isConnected) {\n continue;\n }\n const r = el.getBoundingClientRect();\n const d = flipDelta(firstRect, r);\n if (d.dx === 0 && d.dy === 0) {\n continue;\n }\n workList.push({ el, d, rest: el.style.transform });\n }\n\n if (workList.length === 0) {\n return;\n }\n\n for (const { el, d, rest } of workList) {\n const invert = `translate(${d.dx}px, ${d.dy}px)`;\n el.style.transition = 'none';\n el.style.transform = rest === '' ? invert : `${invert} ${rest}`;\n }\n\n void workList[0]!.el.offsetWidth;\n\n for (const { el, rest } of workList) {\n el.setAttribute(FLIP_ANIMATING_ATTR, '');\n el.style.transition = '';\n el.style.transform = rest;\n }\n\n for (const { el } of workList) {\n awaitTransformTransition(el, win, () => {\n el.removeAttribute(FLIP_ANIMATING_ATTR);\n el.style.transition = '';\n });\n }\n}\n","import { afterNextRender, type Injector } from '@angular/core';\n\nimport { type DragPreview } from 'forty-cdk/core';\nimport type { ForDropListContext } from './drag-drop-context';\nimport { playFlip, type FlipRect } from './flip';\n\n/** Options handed to {@link ReorderAnimator} at drop time. */\nexport interface ReorderAnimatorOptions {\n /** The source list plus its connected lists, whose items participate in the FLIP. */\n readonly containers: readonly ForDropListContext[];\n /** Injector for the post-commit `afterNextRender` Last-rect capture. */\n readonly injector: Injector;\n /** The browser window (reflow + timeout), or `null` in non-DOM environments. */\n readonly win: Window | null;\n}\n\n/**\n * Lazy `animateReorder` strategy: runs the FLIP reflow of displaced sibling items and settles the\n * floating preview into the final slot on a committed drop.\n *\n * Created in `drop()` only when the animation gate is satisfied (`animateReorder` on, a browser\n * platform, motion not reduced, and the item actually moved); when it is not, the list creates no\n * animator and tears down instantly, replacing the former inline `animate && first` gate.\n *\n * {@link captureFirst} measures every item's pre-change position and must run **before** the\n * `dragDrop` event mutates the DOM **and before the pointer-drag placeholder is torn down**, so\n * the First rects are the parted positions the user last saw — a live-sorted drop then has nothing\n * to animate instead of snapping the siblings back. Hosts that measure zero-area (a `display:none`\n * item standing behind its placeholder) are skipped: they have no First position to invert from.\n * {@link schedule} runs the Invert + Play after the consumer's data change has rendered.\n * Constructed directly (`new ReorderAnimator(options)`); it holds no injection context beyond the\n * injector handed in for `afterNextRender`.\n */\nexport class ReorderAnimator {\n readonly #containers: readonly ForDropListContext[];\n readonly #injector: Injector;\n readonly #win: Window | null;\n #first: ReadonlyMap<HTMLElement, FlipRect> | null = null;\n\n constructor(options: ReorderAnimatorOptions) {\n this.#containers = options.containers;\n this.#injector = options.injector;\n this.#win = options.win;\n }\n\n /** Capture each item's First (pre-change) rect across all containers. Run before the data change. */\n captureFirst(): void {\n const map = new Map<HTMLElement, FlipRect>();\n for (const ctx of this.#containers) {\n for (const h of ctx.items()) {\n const r = h.host.getBoundingClientRect();\n if (r.width === 0 && r.height === 0) {\n continue;\n }\n map.set(h.host, { left: r.left, top: r.top });\n }\n }\n this.#first = map;\n }\n\n /**\n * Schedule the FLIP play (and preview settle, when a preview was kept) after the next render —\n * once the consumer's data change has reflowed the displaced siblings into their new positions.\n *\n * `onSettled` runs at the end of that render, once the animator has released the preview it was\n * handed: by then the preview is either already destroyed or settling under its own\n * `transitionend` / timeout disposal, which is independent of this injector. The caller can drop\n * its own reference to the preview at that point. It does **not** run when there is nothing\n * scheduled (no First rects captured) — the caller still owns the preview in that case.\n */\n schedule(liftedHost: HTMLElement, preview: DragPreview | null, onSettled?: () => void): void {\n const first = this.#first;\n if (first === null) {\n return;\n }\n const win = this.#win;\n afterNextRender(\n () => {\n playFlip({ first, win, exclude: preview ? liftedHost : null });\n if (preview) {\n if (liftedHost.isConnected && win) {\n const r = liftedHost.getBoundingClientRect();\n preview.settle(r.left, r.top, win);\n } else {\n preview.destroy();\n }\n }\n onSettled?.();\n },\n { injector: this.#injector },\n );\n }\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n DOCUMENT,\n ElementRef,\n inject,\n InjectionToken,\n Injector,\n input,\n output,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n clampDragIndex,\n Collection,\n type DragAnnouncedItem,\n type DragAnnouncedPosition,\n DragAnnouncer,\n firstEnabledHost,\n focusWhenMounted,\n type FocusWhenMountedRef,\n registerHandle,\n resolveDropTarget,\n type DropContainerGeometry,\n type DragRect,\n type DragPreview,\n injectPrefersReducedMotion,\n type ListNavigationAction,\n moveIndex,\n type WritingDirection,\n LiveAnnouncer,\n RovingTabindex,\n injectReflectedDirection,\n injectTextDirection,\n isUnset,\n PreviewController,\n resolveBoundaryElement,\n injectRovingFocusRestore,\n stepDragTarget,\n} from 'forty-cdk/core';\nimport { createAutoScroller, type AutoScroller } from './auto-scroll';\nimport { clipRegion, findClippingAncestors, type ClippingAncestor } from './clip-region';\nimport { buildDragSlots, indexOfSlot } from './drag-positions';\nimport {\n FOR_DROP_LIST_CONTEXT,\n FOR_DROP_LIST_COORDINATOR,\n FOR_DROP_LIST_ROVING_DELEGATE,\n type ForDragDropEvent,\n type ForDraggableHandle,\n type ForDropListContext,\n type ForDropListCoordinator,\n} from './drag-drop-context';\nimport { FOR_DRAG_DROP_DEFAULTS } from 'forty-cdk/defaults';\nimport { FOR_DROP_LIST_GROUP } from './drop-list-group';\nimport { PlaceholderSorter } from './placeholder-sorter';\nimport { ReorderAnimator } from './reorder-animator';\n\n/**\n * Optional DI seam overriding the fallback `orientation` of every `[forDropList]` in scope.\n * `ForDropList`'s `orientation` input falls back to this token's value (`'vertical'` when the\n * token is not provided); a consumer `orientation` binding always wins over it. Wrappers\n * compose a horizontal list without leaking `orientation=\"horizontal\"` boilerplate into the\n * consumer's template — `ForTableColumnReorder` provides `'horizontal'` so column reordering\n * resolves along the row axis out of the box.\n */\nexport const FOR_DROP_LIST_DEFAULT_ORIENTATION = new InjectionToken<\n 'horizontal' | 'vertical' | 'mixed'\n>('FOR_DROP_LIST_DEFAULT_ORIENTATION');\n\ninterface DropListGeomEntry {\n items: readonly ForDraggableHandle[];\n containerRect: DragRect;\n scrollLeft: number;\n scrollTop: number;\n itemRects: readonly DragRect[];\n clippers: readonly ClippingAncestor[];\n}\n\nfunction freezeRect(rect: DragRect): DragRect {\n return { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom };\n}\n\nfunction shiftRect(rect: DragRect, dx: number, dy: number): DragRect {\n return {\n left: rect.left + dx,\n top: rect.top + dy,\n right: rect.right + dx,\n bottom: rect.bottom + dy,\n };\n}\n\n/**\n * Root directive of the drag-drop primitive. Apply on any container element to\n * create a reorderable list. Items inside are declared with `[forDraggable]`.\n *\n * Supports both keyboard dragging and pointer (mouse / touch / pen) dragging.\n */\n@Directive({\n selector: '[forDropList]',\n exportAs: 'forDropList',\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.dir]': 'reflectedDir()',\n '[attr.data-disabled]': \"effectiveDisabled() ? '' : null\",\n '[attr.data-dragging]': \"isDragging() ? '' : null\",\n '[attr.data-drag-over]': \"dragOverIndex() !== null ? '' : null\",\n },\n providers: [{ provide: FOR_DROP_LIST_CONTEXT, useExisting: ForDropList }],\n})\nexport class ForDropList implements ForDropListContext {\n readonly #hostRef = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #defaults = inject(FOR_DRAG_DROP_DEFAULTS);\n readonly #announce = new DragAnnouncer(inject(LiveAnnouncer), () => ({\n lift: this.#defaults.announceLift,\n move: this.#defaults.announceMove,\n drop: this.#defaults.announceDrop,\n cancel: this.#defaults.announceCancel,\n }));\n readonly #group = inject(FOR_DROP_LIST_GROUP, { optional: true });\n readonly #document = inject(DOCUMENT);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #destroyRef = inject(DestroyRef);\n readonly #injector = inject(Injector);\n readonly #prefersReducedMotion = injectPrefersReducedMotion();\n readonly #defaultOrientation =\n inject(FOR_DROP_LIST_DEFAULT_ORIENTATION, { optional: true }) ?? 'vertical';\n readonly #rovingDelegate = inject(FOR_DROP_LIST_ROVING_DELEGATE, { optional: true });\n\n /**\n * Layout orientation of the list. Affects which arrow keys move focus and the lifted item, and\n * how a pointer drag resolves the live drop index. Defaults to `'vertical'`, or to\n * `FOR_DROP_LIST_DEFAULT_ORIENTATION` when an in-scope provider sets it (e.g.\n * `ForTableColumnReorder` defaults it to `'horizontal'`).\n *\n * `'mixed'` is for wrapping grids (`flex-wrap` / CSS grid) of uniformly-sized items: the drop\n * index is resolved in 2D so an item flowing across rows lands in the slot under the pointer's\n * row and column, and every arrow key steps the lifted item linearly in DOM order. A `'mixed'`\n * list that happens to render as a single row or single column resolves identically to\n * `'horizontal'` / `'vertical'`.\n */\n readonly orientation = input<'horizontal' | 'vertical' | 'mixed'>(this.#defaultOrientation);\n\n /**\n * Writing direction. When unset (default `null`), the inherited ambient direction is\n * resolved from the nearest ancestor carrying a `dir` attribute (or `<html dir>`),\n * defaulting to `'ltr'`.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n private readonly reflectedDir = injectReflectedDirection(this._dirInput);\n\n /**\n * When true, the entire list and all its items are disabled. Turning it on while an item is\n * keyboard-lifted does not end the lift: the lifted keys still move, drop and cancel it.\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * Other lists this one can transfer items into. Union'd with any `[forDropListGroup]`\n * members. Disabled lists, and lists a `FOR_DROP_LIST_COORDINATOR` composes, are excluded\n * from the effective connected set.\n */\n readonly connectedTo = input<readonly ForDropListContext[]>([]);\n\n /**\n * When true (the default), a pointer drag that nears the edge of the nearest scrollable\n * container (the list, a scrollable ancestor, or the viewport) auto-scrolls it toward that\n * edge so off-screen drop targets become reachable. Set `false` to opt out. Edge size and\n * max speed are configured via `provideForDragDropDefaults`. Keyboard dragging is unaffected.\n */\n readonly autoScroll = input(true, { transform: booleanAttribute });\n\n /**\n * When true, the `[forDragPlaceholder]` follows the live resolved drop index during a\n * **pointer** drag — within this list and across connected lists — so siblings part to\n * reveal where the item will land. When false (the default), the placeholder stays in the\n * dragged item's source slot. Has no effect without a `[forDragPlaceholder]`\n * template, and none on keyboard dragging.\n *\n * A `dragDisabled` sibling acts as a hard fence: the placeholder stops at the first\n * pinned item instead of travelling past it. Live sorting is purely visual: the drop index\n * is resolved from the container geometry measured at lift — before the placeholder is\n * rendered — so the placeholder's live position never feeds back into resolution and a given\n * pointer path commits the same index whether `liveSort` is on or off.\n */\n readonly liveSort = input(false, { transform: booleanAttribute });\n\n /**\n * When true, a committed drop (keyboard or pointer) animates: displaced sibling items\n * transition from their old positions to their new ones (FLIP), and — on a pointer drag — the\n * floating preview settles into the final slot before it is removed. Opt-in and default off.\n * Duration / easing are styled by the consumer via CSS on the published hooks\n * (`[data-drag-animating]` on items, `[data-settling]` on the preview); the library imposes\n * none. Fully skipped under `prefers-reduced-motion: reduce` (teardown stays instant).\n */\n readonly animateReorder = input(false, { transform: booleanAttribute });\n\n /**\n * Confine the pointer-drag preview within a boundary during a pointer drag. Accepts an\n * `HTMLElement`, or a selector string resolved via `closest()` from the list host. `null`\n * (the default) leaves the preview unbounded. Affects the visual preview only — the resolved\n * drop index is unchanged. Has no effect on keyboard dragging (no floating preview).\n */\n readonly boundary = input<HTMLElement | string | null>(null);\n\n /**\n * Constrain pointer-drag preview movement to one axis. `'x'` keeps the preview at its lift-time\n * `y` (horizontal movement); `'y'` keeps it at its lift-time `x` (vertical movement). `null`\n * (the default) is free movement. Independent of `orientation` (which drives the drop index);\n * this is a purely visual constraint, and has no effect on keyboard dragging.\n */\n readonly lockAxis = input<'x' | 'y' | null>(null);\n\n /**\n * Emitted by the **source** list when a drop commits (keyboard or pointer) — whether\n * the item stays in this list (reorder) or moves to a connected list (transfer). Apply\n * `moveItemInArray` or `transferArrayItem` to your data signal inside the handler.\n *\n * After a **keyboard** drop made while focus was on the lifted item or inside it, focus\n * follows the item once the next render settles: back onto the item's own element when the\n * re-render kept it, or onto the item at `currentIndex` in the target container when it\n * replaced it, so the keyboard user is never stranded on `<body>`. Focus something else\n * inside this handler to keep it; pointer drops never move focus.\n */\n readonly dragDrop = output<ForDragDropEvent>();\n\n readonly host = this.#hostRef.nativeElement;\n\n /** Effective disabled — the list's own `disabled` input (fieldset wiring deferred to v2). */\n readonly effectiveDisabled = computed(() => this.disabled());\n\n readonly roving = new RovingTabindex(() => this.#items.items(), { fallback: 'nearest' });\n readonly #items = new Collection<ForDraggableHandle>();\n readonly items = this.#items.items;\n\n readonly #liftedHost = signal<HTMLElement | null>(null);\n readonly #coordinatorLiftedHost = signal<HTMLElement | null>(null);\n readonly #flatIndex = signal(0);\n readonly #dragOver = signal<number | null>(null);\n\n #coordinatorResolved = false;\n #coordinatorValue: ForDropListCoordinator | null = null;\n\n get #coordinator(): ForDropListCoordinator | null {\n if (!this.#coordinatorResolved) {\n this.#coordinatorResolved = true;\n this.#coordinatorValue = this.#injector.get(FOR_DROP_LIST_COORDINATOR, null, {\n self: true,\n optional: true,\n });\n }\n return this.#coordinatorValue;\n }\n\n #previewController: PreviewController | null = null;\n #handedOffPreview: DragPreview | null = null;\n #pointerDrag = false;\n #sorter: PlaceholderSorter | null = null;\n #autoScroller: AutoScroller | null = null;\n #lastPoint: { x: number; y: number } | null = null;\n #resolveRaf: number | null = null;\n #geomCache: Map<ForDropListContext, DropListGeomEntry> | null = null;\n #dropFocus: FocusWhenMountedRef | null = null;\n #pointerDropped: HTMLElement | null = null;\n\n /** Insertion index this list is the current drop target at, else `null`. */\n readonly dragOverIndex = this.#dragOver.asReadonly();\n\n /**\n * `true` while a drag originating from this list is in progress — its own keyboard / pointer\n * lift, or one a composing coordinator owns (see {@link beginCoordinatorLift}). Reflected as\n * `data-dragging` on the list host.\n */\n readonly isDragging = computed(\n () => this.#liftedHost() !== null || this.#coordinatorLiftedHost() !== null,\n );\n\n constructor() {\n injectRovingFocusRestore(this.roving, {\n skip: (departed) => this.#consumePointerDrop(departed),\n });\n const group = this.#group;\n if (group) {\n registerHandle(\n this as ForDropListContext,\n (ctx) => group.register(ctx),\n (ctx) => group.unregister(ctx),\n );\n }\n if (this.#isBrowser) {\n this.#autoScroller = createAutoScroller({\n host: this.host,\n win: this.#document.defaultView,\n edgeSize: this.#defaults.autoScrollEdgeSize,\n maxSpeed: this.#defaults.autoScrollMaxSpeed,\n onFrame: () => this.#onAutoScrollFrame(),\n resolveScrollHost: (point) => this.#scrollHostAt(point),\n });\n this.#destroyRef.onDestroy(() => {\n this.#autoScroller?.stop();\n if (this.#resolveRaf !== null) {\n this.#document.defaultView?.cancelAnimationFrame(this.#resolveRaf);\n this.#resolveRaf = null;\n }\n this.#previewController?.destroy();\n this.#previewController = null;\n this.#handedOffPreview?.destroy();\n this.#handedOffPreview = null;\n });\n }\n }\n\n registerItem(handle: ForDraggableHandle): void {\n this.#items.register(handle);\n }\n\n unregisterItem(handle: ForDraggableHandle): void {\n this.#items.unregister(handle);\n this.roving.unregister(handle.host);\n }\n\n itemTabindex(el: HTMLElement): -1 | 0 | null {\n const delegated = this.#rovingDelegate?.itemTabindex(el);\n if (delegated !== undefined && delegated !== null) {\n return delegated;\n }\n return this.roving.hasActive() ? this.roving.tabindexFor(el) : null;\n }\n\n isRovingDelegated(el: HTMLElement): boolean {\n const delegated = this.#rovingDelegate?.itemTabindex(el);\n return delegated !== undefined && delegated !== null;\n }\n\n isFirstFocusableItem(el: HTMLElement): boolean {\n return firstEnabledHost(this.#items.items()) === el;\n }\n\n isItemHighlighted(el: HTMLElement): boolean {\n const delegated = this.#rovingDelegate?.isItemHighlighted?.(el);\n if (delegated !== undefined && delegated !== null) {\n return delegated;\n }\n return this.roving.isActive(el);\n }\n\n isItemDragging(el: HTMLElement): boolean {\n return this.#liftedHost() === el || this.#coordinatorLiftedHost() === el;\n }\n\n /**\n * Start a drag of `el` that a **coordinator** composing this list owns end to end —\n * `[forVirtualReorder]`, and the virtualized branch of `[forTableRowReorder]`. Those wrap the\n * list via `hostDirectives` and intercept the lift key in the capture phase, so `ForDraggable`\n * never reaches {@link lift} and the list holds no lift state of its own for the gesture. For\n * the whole gesture {@link isItemDragging} and {@link isDragging} — and therefore the\n * `data-dragging` hook on both the item and the list host — read `true`, and the item's\n * `[forDraggable]` emits `dragStart` with `index`, the position the coordinator reports.\n *\n * It is **not** folded into the list's own lift state: `moveLifted` / `drop` /\n * `cancel` still act on nothing, because the coordinator owns the target index, the\n * announcements and the teardown. It is still the only gesture in the list: while it is\n * live, `lift` and `pointerLift` return `-1`, so no item's own `[forDraggable]` lifts beside\n * it. End it with {@link endCoordinatorLift}.\n */\n beginCoordinatorLift(el: HTMLElement, index: number): void {\n this.#coordinatorLiftedHost.set(el);\n this.#handleFor(el)?.emitDragStart(index);\n }\n\n /**\n * End the coordinator-owned drag {@link beginCoordinatorLift} started: clears the dragging\n * state and has the item's `[forDraggable]` emit `dragEnd` with `dropped`. A no-op when no\n * coordinator drag is live.\n */\n endCoordinatorLift(dropped: boolean): void {\n const el = this.#coordinatorLiftedHost();\n if (el === null) {\n return;\n }\n this.#coordinatorLiftedHost.set(null);\n this.#handleFor(el)?.emitDragEnd(dropped);\n }\n\n #handleFor(el: HTMLElement): ForDraggableHandle | undefined {\n return this.#items.items().find((h) => h.host === el);\n }\n\n setActiveItem(el: HTMLElement): void {\n this.roving.setActive(el);\n }\n\n navigate(el: HTMLElement, action: ListNavigationAction): void {\n if (this.effectiveDisabled()) {\n return;\n }\n const items = this.#items.items();\n if (items.length === 0) {\n return;\n }\n const currentIndex = items.findIndex((h) => h.host === el);\n const next = moveIndex(currentIndex < 0 ? 0 : currentIndex, items.length, action, {\n loop: false,\n isDisabled: (i) => items[i]!.disabled(),\n });\n if (next === null) {\n return;\n }\n items[next]?.host.focus();\n }\n\n #consumePointerDrop(departed: Element): boolean {\n const dropped = this.#pointerDropped;\n this.#pointerDropped = null;\n return dropped !== null && dropped.contains(departed);\n }\n\n #beginLift(el: HTMLElement): number {\n if (this.effectiveDisabled() || this.isDragging()) {\n return -1;\n }\n this.#pointerDropped = null;\n const items = this.#items.items();\n const handle = items.find((h) => h.host === el);\n this.#dropFocus?.cancel();\n this.#dropFocus = null;\n if (!handle || handle.disabled()) {\n return -1;\n }\n const from = this.#items.indexOfHost(el);\n if (from < 0) {\n return -1;\n }\n const connected = this.#effectiveConnected();\n const slots = buildDragSlots(\n items.length,\n connected.map((c) => c.items().length),\n );\n const flatIndex = indexOfSlot(slots, 0, from);\n this.#pointerDrag = false;\n this.#liftedHost.set(el);\n this.#flatIndex.set(flatIndex < 0 ? 0 : flatIndex);\n this.#dragOver.set(from);\n const position = this.#coordinator?.resolveReorder(from, from).from ?? from;\n this.#announce.lift(this.#announcedItem(el), this.#announcedPosition(this, position));\n handle.emitDragStart(position);\n return from;\n }\n\n #reportedTarget(ctx: ForDropListContext, lifted: HTMLElement, index: number): number {\n const coordinator = this.#coordinator;\n if (!coordinator || ctx !== (this as ForDropListContext)) {\n return index;\n }\n return coordinator.resolveReorder(this.#items.indexOfHost(lifted), index).to;\n }\n\n lift(el: HTMLElement): number {\n return this.#beginLift(el);\n }\n\n pointerLift(\n el: HTMLElement,\n point: { x: number; y: number },\n preview?: DragPreview | { moveTo(x: number, y: number): void; destroy(): void } | null,\n ): number {\n const from = this.#beginLift(el);\n if (from < 0) {\n return -1;\n }\n this.#pointerDrag = true;\n if (this.#isBrowser) {\n this.#previewController = new PreviewController({\n source: el,\n point,\n preview,\n doc: this.#document,\n boundary: resolveBoundaryElement(this.host, this.boundary()),\n lockAxis: this.lockAxis,\n });\n if (this.liveSort()) {\n this.#sorter = new PlaceholderSorter({\n source: this,\n lifted: el,\n doc: this.#document,\n sourceItems: this.#items.items,\n originIndex: () => this.#items.indexOfHost(el),\n });\n }\n this.#snapshotGeometry(el);\n }\n return from;\n }\n\n pointerMove(point: { x: number; y: number }): void {\n const lifted = this.#liftedHost();\n if (lifted === null || !this.#isBrowser) {\n return;\n }\n this.#lastPoint = point;\n if (this.autoScroll()) {\n this.#autoScroller?.update(point);\n } else {\n this.#autoScroller?.stop();\n }\n if (this.#resolveRaf !== null) {\n return;\n }\n this.#resolveDrop(point, lifted);\n const win = this.#document.defaultView;\n if (win) {\n this.#resolveRaf = win.requestAnimationFrame(() => {\n this.#resolveRaf = null;\n const currentLifted = this.#liftedHost();\n const currentPoint = this.#lastPoint;\n if (currentLifted !== null && currentPoint !== null) {\n this.#resolveDrop(currentPoint, currentLifted);\n }\n });\n }\n }\n\n #resolveDrop(point: { x: number; y: number }, lifted: HTMLElement): void {\n const connected = this.#effectiveConnected();\n const containers = [this as ForDropListContext, ...connected];\n const geoms: DropContainerGeometry[] = containers.map((ctx) => this.#geometryFor(ctx, lifted));\n const target = resolveDropTarget(point, geoms);\n if (!target) {\n this.#previewController?.moveTo(point);\n return;\n }\n const slots = buildDragSlots(\n this.#items.items().length,\n connected.map((c) => c.items().length),\n );\n const flat = indexOfSlot(slots, target.containerIndex, target.index);\n if (flat < 0) {\n this.#previewController?.moveTo(point);\n return;\n }\n const changed = flat !== this.#flatIndex();\n const targetCtx = containers[target.containerIndex]!;\n this.#previewController?.moveTo(point);\n containers.forEach((ctx, i) =>\n ctx.setDragOver(i === target.containerIndex ? target.index : null),\n );\n this.#flatIndex.set(flat);\n if (changed) {\n this.#sorter?.onTargetChange(targetCtx, target.index);\n const position = this.#reportedTarget(targetCtx, lifted, target.index);\n this.#announce.move(\n this.#announcedItem(lifted),\n this.#announcedPosition(targetCtx, position),\n );\n }\n }\n\n #snapshotGeometry(lifted: HTMLElement): void {\n const cache = new Map<ForDropListContext, DropListGeomEntry>();\n const containers = [this as ForDropListContext, ...this.#effectiveConnected()];\n for (const ctx of containers) {\n cache.set(ctx, this.#snapshotContainer(ctx, lifted));\n }\n this.#geomCache = cache;\n }\n\n #snapshotContainer(ctx: ForDropListContext, lifted: HTMLElement): DropListGeomEntry {\n const items = ctx.items();\n const win = this.#document.defaultView;\n return {\n items,\n containerRect: freezeRect(ctx.host.getBoundingClientRect()),\n scrollLeft: ctx.host.scrollLeft,\n scrollTop: ctx.host.scrollTop,\n itemRects: items\n .filter((h) => h.host !== lifted)\n .map((h) => freezeRect(h.host.getBoundingClientRect())),\n clippers: win ? findClippingAncestors(ctx.host, win) : [],\n };\n }\n\n #geometryFor(ctx: ForDropListContext, lifted: HTMLElement): DropContainerGeometry {\n const cache = this.#geomCache;\n const cached = cache?.get(ctx);\n const axis = { orientation: ctx.orientation(), dir: ctx.dir() } as const;\n if (!cache || !cached || cached.items !== ctx.items()) {\n const fresh = this.#snapshotContainer(ctx, lifted);\n cache?.set(ctx, fresh);\n return {\n rect: fresh.containerRect,\n itemRects: fresh.itemRects,\n clip: clipRegion(fresh.clippers),\n ...axis,\n };\n }\n const freshRect = ctx.host.getBoundingClientRect();\n const dx =\n freshRect.left - cached.containerRect.left - (ctx.host.scrollLeft - cached.scrollLeft);\n const dy = freshRect.top - cached.containerRect.top - (ctx.host.scrollTop - cached.scrollTop);\n const clip = clipRegion(cached.clippers);\n if (dx === 0 && dy === 0) {\n return { rect: freezeRect(freshRect), itemRects: cached.itemRects, clip, ...axis };\n }\n return {\n rect: freezeRect(freshRect),\n itemRects: cached.itemRects.map((r) => shiftRect(r, dx, dy)),\n clip,\n ...axis,\n };\n }\n\n #announcedItem(host: HTMLElement): DragAnnouncedItem {\n return { host, textValue: this.#handleFor(host)?.textValue() };\n }\n\n #announcedPosition(ctx: ForDropListContext, index: number): DragAnnouncedPosition {\n return { index, total: this.#positionCount(ctx), list: ctx.host, source: this.host };\n }\n\n #positionCount(ctx: ForDropListContext): number {\n if (this.#coordinator && ctx === (this as ForDropListContext)) {\n return this.#coordinator.count();\n }\n const count = ctx.items().length;\n return ctx === (this as ForDropListContext) ? count : count + 1;\n }\n\n #flushResolve(lifted: HTMLElement): void {\n if (this.#resolveRaf !== null) {\n this.#document.defaultView?.cancelAnimationFrame(this.#resolveRaf);\n this.#resolveRaf = null;\n }\n if (this.#lastPoint !== null) {\n this.#resolveDrop(this.#lastPoint, lifted);\n }\n }\n\n #onAutoScrollFrame(): void {\n const lifted = this.#liftedHost();\n const point = this.#lastPoint;\n if (lifted === null || point === null) {\n return;\n }\n this.#resolveDrop(point, lifted);\n }\n\n #scrollHostAt(point: { x: number; y: number }): HTMLElement | null {\n const view = this.#document.defaultView;\n if (!view || typeof this.#document.elementFromPoint !== 'function') {\n return null;\n }\n const under = this.#document.elementFromPoint(point.x, point.y);\n if (under === null) {\n return null;\n }\n const containers = [this as ForDropListContext, ...this.#effectiveConnected()];\n for (const ctx of containers) {\n if (ctx.host === under || ctx.host.contains(under)) {\n return ctx.host;\n }\n }\n return null;\n }\n\n isLifted(el: HTMLElement): boolean {\n return this.#liftedHost() === el;\n }\n\n moveLifted(action: ListNavigationAction): void {\n const liftedHost = this.#liftedHost();\n if (liftedHost === null) {\n return;\n }\n const connected = this.#effectiveConnected();\n const slots = buildDragSlots(\n this.#items.items().length,\n connected.map((c) => c.items().length),\n );\n if (slots.length === 0) {\n return;\n }\n const current = this.#flatIndex();\n const next = stepDragTarget(\n current,\n this.#requestedSlot(action, current, slots.length),\n slots.length,\n );\n if (next === null) {\n return;\n }\n const prevSlot = slots[current];\n const nextSlot = slots[next];\n if (!prevSlot || !nextSlot) {\n return;\n }\n const prevTarget =\n prevSlot.containerIndex === 0 ? this : connected[prevSlot.containerIndex - 1];\n const nextTarget =\n nextSlot.containerIndex === 0 ? this : connected[nextSlot.containerIndex - 1];\n if (prevTarget && prevTarget !== nextTarget) {\n prevTarget.setDragOver(null);\n }\n if (nextTarget) {\n nextTarget.setDragOver(nextSlot.index);\n }\n this.#flatIndex.set(next);\n if (nextTarget) {\n const position = this.#reportedTarget(nextTarget, liftedHost, nextSlot.index);\n this.#announce.move(\n this.#announcedItem(liftedHost),\n this.#announcedPosition(nextTarget, position),\n );\n }\n }\n\n #requestedSlot(action: ListNavigationAction, current: number, count: number): number {\n switch (action) {\n case 'first':\n return 0;\n case 'last':\n return count - 1;\n case 'next':\n return current + 1;\n default:\n return current - 1;\n }\n }\n\n drop(): void {\n const liftedHost = this.#liftedHost();\n if (liftedHost === null) {\n return;\n }\n this.#flushResolve(liftedHost);\n const connected = this.#effectiveConnected();\n const items = this.#items.items();\n const slots = buildDragSlots(\n items.length,\n connected.map((c) => c.items().length),\n );\n const slot = slots[this.#flatIndex()];\n const handle = items.find((h) => h.host === liftedHost);\n if (!slot || (handle !== undefined && isUnset(handle.data()))) {\n this.#teardown(connected);\n handle?.emitDragEnd(false);\n return;\n }\n const previousIndex = this.#items.indexOfHost(liftedHost);\n const currentIndex = slot.index;\n const container: ForDropListContext =\n slot.containerIndex === 0 ? this : (connected[slot.containerIndex - 1] ?? this);\n const item = handle ? handle.data() : undefined;\n const announced = this.#announcedItem(liftedHost);\n const position = this.#reportedTarget(container, liftedHost, currentIndex);\n\n const moved = !(previousIndex === currentIndex && container === (this as ForDropListContext));\n const animate =\n this.animateReorder() && this.#isBrowser && !this.#prefersReducedMotion() && moved;\n const preview = this.#previewController?.preview ?? null;\n if (this.#isBrowser && !this.#pointerDrag) {\n this.#followDropFocus(liftedHost, container, currentIndex, handle);\n } else if (this.#pointerDrag) {\n this.#pointerDropped = liftedHost;\n }\n const animator = animate\n ? new ReorderAnimator({\n containers: [this, ...connected],\n injector: this.#injector,\n win: this.#document.defaultView,\n })\n : null;\n animator?.captureFirst();\n\n this.dragDrop.emit({\n item,\n previousContainer: this,\n container,\n previousIndex,\n currentIndex,\n });\n this.#announce.drop(announced, this.#announcedPosition(container, position));\n\n if (animator) {\n this.#handedOffPreview = preview;\n animator.schedule(liftedHost, preview, () => {\n this.#handedOffPreview = null;\n });\n this.#teardown(connected, true);\n } else {\n this.#teardown(connected);\n }\n handle?.emitDragEnd(true);\n }\n\n #followDropFocus(\n liftedHost: HTMLElement,\n container: ForDropListContext,\n index: number,\n handle: ForDraggableHandle | undefined,\n ): void {\n const item = handle?.data();\n this.#dropFocus = focusWhenMounted({\n injector: this.#injector,\n document: this.#document,\n from: liftedHost,\n target: (origin) => {\n const items = container.items();\n const carriers = handle === undefined ? [] : items.filter((h) => Object.is(h.data(), item));\n if (carriers.some((h) => h.host.contains(origin))) {\n return origin;\n }\n if (carriers.length > 0) {\n return (carriers.find((h) => h === items[index]) ?? carriers[0]!).host;\n }\n if (origin.isConnected) {\n return origin;\n }\n if (items.length === 0) {\n return null;\n }\n return items[clampDragIndex(index, items.length)]?.host ?? null;\n },\n release: () => {\n this.#dropFocus = null;\n },\n });\n }\n\n cancel(): void {\n const liftedHost = this.#liftedHost();\n if (liftedHost === null) {\n return;\n }\n const handle = this.#handleFor(liftedHost);\n this.#announce.cancel(this.#announcedItem(liftedHost));\n this.#teardown(this.#effectiveConnected());\n handle?.emitDragEnd(false);\n }\n\n setDragOver(index: number | null): void {\n this.#dragOver.set(index);\n }\n\n setLivePlaceholder(nodes: readonly Node[] | null): void {\n const lifted = this.#liftedHost();\n if (nodes !== null && lifted !== null) {\n this.#coordinator?.layoutPlaceholder?.(nodes, lifted);\n }\n this.#sorter?.setNodes(nodes);\n }\n\n readonly #effectiveConnected = computed((): readonly ForDropListContext[] => {\n if (this.#coordinator) {\n return [];\n }\n const explicit = this.connectedTo();\n const groupMembers = this.#group?.members() ?? [];\n const seen = new Set<ForDropListContext>();\n seen.add(this);\n const result: ForDropListContext[] = [];\n for (const ctx of [...explicit, ...groupMembers]) {\n const closed = #coordinator in ctx && ctx.#coordinator !== null;\n if (!seen.has(ctx) && !ctx.disabled() && !closed) {\n seen.add(ctx);\n result.push(ctx);\n }\n }\n return result;\n });\n\n #teardown(connected: readonly ForDropListContext[], keepPreview = false): void {\n if (this.#resolveRaf !== null) {\n this.#document.defaultView?.cancelAnimationFrame(this.#resolveRaf);\n this.#resolveRaf = null;\n }\n this.#autoScroller?.stop();\n this.#lastPoint = null;\n this.#dragOver.set(null);\n for (const ctx of connected) {\n ctx.setDragOver(null);\n }\n this.#liftedHost.set(null);\n this.#flatIndex.set(0);\n this.#geomCache = null;\n if (!keepPreview) {\n this.#previewController?.destroy();\n }\n this.#previewController = null;\n this.#sorter = null;\n this.#pointerDrag = false;\n }\n}\n","import { computed, inject, type Signal, signal } from '@angular/core';\n\nimport {\n BOTH_DRAG_AXES,\n dragHandleTouchAction,\n dragSurfaceTouchAction,\n type DragTouchAction,\n NO_DRAG_AXES,\n registerHandle,\n} from 'forty-cdk/core';\nimport { asDraggableContext, FOR_DRAGGABLE_CONTEXT } from './drag-drop-context';\n\n/**\n * Per-directive pointer drag-start guard shared by `ForDraggable` and\n * `ForFreeDrag`: tracks `[forDragHandle]` elements and the draggables nested\n * inside the host, decides whether a `pointerdown` may begin a drag (left mouse\n * button only; never from inside a nested draggable; if any handle is registered\n * the press must originate inside one), and derives the `touch-action` styles\n * that stop native scrolling on the surfaces a drag can start from. The\n * browser's native drag is cancelled by the pointer session itself.\n */\nexport interface PointerHandleGuard {\n /** `'none'` while the host should suppress native touch scrolling, else `null`. */\n readonly touchAction: Signal<DragTouchAction>;\n /** `'none'` while a registered handle should suppress native touch scrolling, else `null`. */\n readonly handleTouchAction: Signal<'none' | null>;\n /** Register a `[forDragHandle]` element. */\n register(el: HTMLElement): void;\n /** Unregister a previously registered handle element. */\n unregister(el: HTMLElement): void;\n /** Register the host of a draggable nested inside this one; presses inside it are its own. */\n registerNested(el: HTMLElement): void;\n /** Unregister a previously registered nested draggable host. */\n unregisterNested(el: HTMLElement): void;\n /** Whether `node` belongs to this draggable rather than to a draggable nested inside it. */\n owns(node: Node): boolean;\n /**\n * Whether a press on `target` may start a drag: dragging is enabled, the press is not inside a\n * nested draggable, and it lands inside a handle when any is registered. Has no side effects.\n */\n accepts(target: EventTarget | null): boolean;\n /** Whether a `pointerdown` event is allowed to start a drag. */\n canStart(event: PointerEvent): boolean;\n}\n\n/**\n * Builds a {@link PointerHandleGuard}. Call from a directive's injection\n * context (field initializer or constructor) so the `computed`s register\n * correctly.\n *\n * @param disabled Signal reporting whether dragging is currently disabled.\n */\nexport function createPointerHandleGuard(disabled: Signal<boolean>): PointerHandleGuard {\n const handles = signal<readonly HTMLElement[]>([]);\n const nested = signal<readonly HTMLElement[]>([]);\n\n const owns = (node: Node): boolean => !nested().some((host) => host.contains(node));\n\n const accepts = (eventTarget: EventTarget | null): boolean => {\n const target = eventTarget as Node | null;\n if (disabled() || (target !== null && !owns(target))) {\n return false;\n }\n const registered = handles();\n return (\n registered.length === 0 ||\n (target !== null && registered.some((handle) => handle.contains(target)))\n );\n };\n\n return {\n touchAction: computed(() =>\n dragSurfaceTouchAction({\n armable: !disabled(),\n handles: handles().length > 0,\n axes: BOTH_DRAG_AXES,\n hostScrolls: NO_DRAG_AXES,\n }),\n ),\n handleTouchAction: computed(() => dragHandleTouchAction(!disabled())),\n register(el: HTMLElement): void {\n handles.update((list) => [...list, el]);\n },\n unregister(el: HTMLElement): void {\n handles.update((list) => list.filter((handle) => handle !== el));\n },\n registerNested(el: HTMLElement): void {\n nested.update((list) => [...list, el]);\n },\n unregisterNested(el: HTMLElement): void {\n nested.update((list) => list.filter((host) => host !== el));\n },\n owns,\n accepts,\n canStart(event: PointerEvent): boolean {\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return false;\n }\n return accepts(event.target);\n },\n };\n}\n\n/**\n * Registers `host` with the nearest enclosing `[forDraggable]` / `[forFreeDrag]`, so a press\n * inside it never starts a drag of the one around it. Call from the nested directive's\n * injection context.\n */\nexport function registerWithEnclosingDraggable(host: HTMLElement, piece: string): void {\n const provided = inject(FOR_DRAGGABLE_CONTEXT, { optional: true, skipSelf: true });\n if (provided) {\n const enclosing = asDraggableContext(provided, piece);\n registerHandle(\n host,\n (el) => enclosing.registerNestedDraggable(el),\n (el) => enclosing.unregisterNestedDraggable(el),\n );\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport { injectDraggableContext } from './drag-drop-context';\n\n/**\n * Optional custom drag preview. Apply `[forDragPreview]` on an `<ng-template>` inside a\n * `[forDraggable]`; its content renders as the floating element that follows the pointer during a\n * pointer drag, replacing the default cloned preview. Has no effect on keyboard dragging.\n */\n@Directive({\n selector: 'ng-template[forDragPreview]',\n exportAs: 'forDragPreview',\n})\nexport class ForDragPreview {\n /** The template rendered as the floating pointer-drag preview. */\n readonly templateRef = inject<TemplateRef<unknown>>(TemplateRef);\n\n constructor() {\n injectDraggableContext('ForDragPreview');\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport { injectDraggableContext } from './drag-drop-context';\n\n/**\n * Optional custom drag placeholder. Apply `[forDragPlaceholder]` on an `<ng-template>` inside a\n * `[forDraggable]`; during a **pointer** drag the dragged item's host is hidden and this template\n * renders in its slot, preserving the gap. Keyboard dragging keeps the default (the lifted item\n * stays in place, reflecting `data-dragging`).\n */\n@Directive({\n selector: 'ng-template[forDragPlaceholder]',\n exportAs: 'forDragPlaceholder',\n})\nexport class ForDragPlaceholder {\n /** The template rendered in the dragged item's slot during a pointer drag. */\n readonly templateRef = inject<TemplateRef<unknown>>(TemplateRef);\n\n constructor() {\n injectDraggableContext('ForDragPlaceholder');\n }\n}\n","import {\n booleanAttribute,\n computed,\n contentChildren,\n DestroyRef,\n Directive,\n DOCUMENT,\n ElementRef,\n type EmbeddedViewRef,\n inject,\n input,\n output,\n PLATFORM_ID,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n assertInputBound,\n isImeComposing,\n navigateFromRovingItem,\n registerHandle,\n resolveListNavigation,\n createPointerDragSession,\n type PointerDragSession,\n createTemplatePreview,\n type DragPreview,\n markDragItemHost,\n resolveText,\n unsetInput,\n} from 'forty-cdk/core';\nimport { createPointerHandleGuard, registerWithEnclosingDraggable } from './handle-guard';\nimport {\n FOR_DRAGGABLE_CONTEXT,\n FOR_DRAGGABLE_LIFT_GUARD,\n injectDropListContext,\n type ForDragEndEvent,\n type ForDragStartEvent,\n type ForDraggableContext,\n type ForDraggableHandle,\n} from './drag-drop-context';\nimport { FOR_DRAG_DROP_DEFAULTS } from 'forty-cdk/defaults';\nimport { ForDragPreview } from './drag-preview';\nimport { ForDragPlaceholder } from './drag-placeholder';\n\nconst POINTER_ARM_THRESHOLD_PX = 5;\n\n/**\n * Marks an element as a draggable item inside a `[forDropList]`. Handles\n * keyboard and pointer interaction for lift, move, drop, and cancel.\n */\n@Directive({\n selector: '[forDraggable]',\n exportAs: 'forDraggable',\n providers: [{ provide: FOR_DRAGGABLE_CONTEXT, useExisting: ForDraggable }],\n host: {\n '[attr.tabindex]': 'tabindex()',\n '[attr.aria-roledescription]': 'roleDescription()',\n '[attr.aria-disabled]': 'ariaDisabled() ? \"true\" : null',\n '[attr.data-dragging]': \"dragging() ? '' : null\",\n '[attr.data-disabled]': \"effectiveDisabled() ? '' : null\",\n '[attr.data-highlighted]': \"highlighted() ? '' : null\",\n '[style.touch-action]': 'touchAction()',\n '[style.display]': \"placeholderActive() ? 'none' : null\",\n '(keydown)': 'onKeyDown($event)',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n },\n})\nexport class ForDraggable implements ForDraggableContext {\n readonly #list = injectDropListContext('ForDraggable');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #defaults = inject(FOR_DRAG_DROP_DEFAULTS);\n readonly #destroyRef = inject(DestroyRef);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #document = inject(DOCUMENT);\n readonly #vcr = inject(ViewContainerRef);\n readonly #liftGuard = inject(FOR_DRAGGABLE_LIFT_GUARD, { optional: true });\n private readonly previewTpls = contentChildren(ForDragPreview, { descendants: true });\n private readonly placeholderTpls = contentChildren(ForDragPlaceholder, { descendants: true });\n #placeholderView: EmbeddedViewRef<unknown> | null = null;\n\n /** `true` while a pointer-drag placeholder template occupies this item's slot (host hidden). */\n private readonly placeholderActive = signal(false);\n\n #pointerDragging = false;\n #pointerSession: PointerDragSession | null = null;\n\n /**\n * Data payload handed back in the `dragDrop` event when this item is dropped. Mandatory — an\n * item with no binding throws in dev mode.\n */\n readonly dragData = input(unsetInput<unknown>());\n\n /**\n * When true, this item cannot be lifted. The item remains focusable, and where a roving\n * delegate governs the list's tab order (`FOR_DROP_LIST_ROVING_DELEGATE`, e.g. a\n * `[forTableColumnReorder]` header row inside a grid) it can still be the group's single\n * tab stop. It also acts as a hard fence for the `liveSort` placeholder: a sibling being\n * dragged cannot move its placeholder across a pinned item (the committed drop index is\n * unaffected). Turning it on while this item is keyboard-lifted does not end the lift: the\n * lifted keys still move, drop and cancel it.\n */\n readonly dragDisabled = input(false, { transform: booleanAttribute });\n\n /**\n * The name drag announcements call this item by. When unset or empty the item is named by its\n * `aria-labelledby` / `aria-label`, else by its text with `aria-hidden` content left out.\n */\n readonly textValue = input<string | null>(null);\n\n /**\n * Emitted when a drag (keyboard or pointer) starts from this item, including one a coordinator\n * composing the list owns (`[forVirtualReorder]`, `[forTableRowReorder]`).\n */\n readonly dragStart = output<ForDragStartEvent>();\n\n /**\n * Emitted when a drag originating from this item ends (committed or cancelled), including one a\n * coordinator composing the list owns. Not emitted when the item is destroyed mid-drag.\n */\n readonly dragEnd = output<ForDragEndEvent>();\n\n readonly effectiveDisabled = computed(() => this.dragDisabled() || this.#list.disabled());\n\n readonly #handleGuard = createPointerHandleGuard(this.effectiveDisabled);\n\n /**\n * `true` when this item is the draggable the list itself lifted, and therefore the one its\n * `moveLifted` / `drop` / `cancel` act on. A drag a composing coordinator owns does not set it\n * — read `data-dragging` (or the context's `isItemDragging`) for \"a drag of this item is live\".\n */\n readonly lifted = computed(() => this.#list.isLifted(this.#host.nativeElement));\n\n /**\n * `true` while a drag of this item is live — the list's own lift, or one owned by a\n * coordinator composing the list (`[forVirtualReorder]`, the virtualized branch of\n * `[forTableRowReorder]`). Reflected as `data-dragging`.\n */\n private readonly dragging = computed(() => this.#list.isItemDragging(this.#host.nativeElement));\n\n /** `true` when this item is the roving-tabindex active candidate. Reflected as `data-highlighted`. */\n private readonly highlighted = computed(() =>\n this.#list.isItemHighlighted(this.#host.nativeElement),\n );\n\n /**\n * `aria-roledescription` from the defaults while this item can be lifted; `null` while it\n * cannot, so an item that cannot move keeps the role name of its own element.\n */\n private readonly roleDescription = computed<string | null>(() =>\n this.effectiveDisabled() ? null : resolveText(this.#defaults.itemRoleDescription) || null,\n );\n\n /**\n * True while this item cannot be lifted, except where a roving delegate governs the host:\n * there the element is a control of the composing widget (a `role=\"columnheader\"` in a\n * column-reorderable grid, which stays sortable, resizable and navigable) and only its lift\n * is disabled, so announcing the host as unavailable would disable the wrong thing.\n * `data-disabled` reflects the state either way.\n */\n private readonly ariaDisabled = computed(\n () => this.effectiveDisabled() && !this.#list.isRovingDelegated(this.#host.nativeElement),\n );\n\n private readonly tabindex = computed<-1 | 0>(() => {\n const rovingTabindex = this.#list.itemTabindex(this.#host.nativeElement);\n if (rovingTabindex !== null) {\n return rovingTabindex;\n }\n if (this.effectiveDisabled()) {\n return -1;\n }\n return this.#list.isFirstFocusableItem(this.#host.nativeElement) ? 0 : -1;\n });\n\n private readonly touchAction = this.#handleGuard.touchAction;\n\n private readonly previewTpl = computed(() =>\n this.previewTpls().find((tpl) =>\n this.#handleGuard.owns(tpl.templateRef.elementRef.nativeElement),\n ),\n );\n\n private readonly placeholderTpl = computed(() =>\n this.placeholderTpls().find((tpl) =>\n this.#handleGuard.owns(tpl.templateRef.elementRef.nativeElement),\n ),\n );\n\n constructor() {\n assertInputBound(this.dragData, 'drag-drop', '[forDraggable]', 'dragData');\n registerWithEnclosingDraggable(this.#host.nativeElement, 'ForDraggable');\n markDragItemHost(this.#host.nativeElement);\n const handle: ForDraggableHandle = {\n host: this.#host.nativeElement,\n data: this.dragData,\n disabled: this.effectiveDisabled,\n textValue: this.textValue,\n acceptsPointerStart: (target) => this.#handleGuard.accepts(target),\n emitDragStart: (index) => {\n if (!this.#destroyRef.destroyed) {\n this.dragStart.emit({ source: this.#list, index });\n }\n },\n emitDragEnd: (dropped) => {\n if (!this.#destroyRef.destroyed) {\n this.dragEnd.emit({ dropped });\n }\n },\n };\n registerHandle(\n handle,\n (h) => this.#list.registerItem(h),\n (h) => this.#list.unregisterItem(h),\n );\n\n if (this.#isBrowser) {\n this.#pointerSession = createPointerDragSession({\n host: this.#host.nativeElement,\n document: this.#document,\n armThreshold: POINTER_ARM_THRESHOLD_PX,\n cancelOnEscape: true,\n capturePointer: true,\n canStart: (event) => this.#handleGuard.canStart(event),\n onLift: (_event, start) => this.#onPointerLift(start),\n onMove: (event) => this.#onPointerMove(event),\n onCommit: () => this.#onPointerCommit(),\n onCancel: () => this.#onPointerCancel(),\n });\n this.#destroyRef.onDestroy(() => {\n if (this.lifted()) {\n this.#list.cancel();\n }\n this.#pointerSession?.destroy();\n this.#clearPlaceholder();\n });\n }\n }\n\n registerHandle(el: HTMLElement): void {\n this.#handleGuard.register(el);\n }\n\n unregisterHandle(el: HTMLElement): void {\n this.#handleGuard.unregister(el);\n }\n\n private handleTouchAction(): 'none' | null {\n return this.#handleGuard.handleTouchAction();\n }\n\n private registerNestedDraggable(el: HTMLElement): void {\n this.#handleGuard.registerNested(el);\n }\n\n private unregisterNestedDraggable(el: HTMLElement): void {\n this.#handleGuard.unregisterNested(el);\n }\n\n #onPointerLift(start: { readonly x: number; readonly y: number }): boolean {\n const preview = this.#buildPreview();\n const index = this.#list.pointerLift(this.#host.nativeElement, start, preview);\n if (index < 0) {\n preview?.destroy();\n return false;\n }\n this.#renderPlaceholder();\n this.#pointerDragging = true;\n return true;\n }\n\n #onPointerMove(event: PointerEvent): void {\n this.#list.pointerMove({ x: event.clientX, y: event.clientY });\n }\n\n #onPointerCommit(): void {\n this.#pointerDragging = false;\n try {\n this.#list.drop();\n } finally {\n this.#clearPlaceholder();\n }\n }\n\n #onPointerCancel(): void {\n if (!this.#pointerDragging) {\n return;\n }\n this.#pointerDragging = false;\n this.#clearPlaceholder();\n this.#list.cancel();\n }\n\n #buildPreview(): DragPreview | null {\n const preview = this.previewTpl();\n if (!preview || !this.#isBrowser) {\n return null;\n }\n const viewRef = this.#vcr.createEmbeddedView(preview.templateRef);\n viewRef.detectChanges();\n return createTemplatePreview(viewRef.rootNodes, this.#host.nativeElement, this.#document, () =>\n viewRef.destroy(),\n );\n }\n\n #renderPlaceholder(): void {\n const placeholder = this.placeholderTpl();\n if (!placeholder || !this.#isBrowser) {\n return;\n }\n this.#placeholderView = this.#vcr.createEmbeddedView(placeholder.templateRef);\n this.#placeholderView.detectChanges();\n this.placeholderActive.set(true);\n this.#list.setLivePlaceholder(this.#placeholderView.rootNodes);\n }\n\n #clearPlaceholder(): void {\n this.#list.setLivePlaceholder(null);\n this.placeholderActive.set(false);\n this.#placeholderView?.destroy();\n this.#placeholderView = null;\n }\n\n private onFocus(): void {\n if (!this.effectiveDisabled()) {\n this.#list.setActiveItem(this.#host.nativeElement);\n }\n }\n\n private onBlur(): void {\n if (this.lifted() && !this.#pointerDragging) {\n this.#list.cancel();\n }\n }\n\n private onKeyDown(event: KeyboardEvent): void {\n if (this.#pointerDragging) {\n return;\n }\n const host = this.#host.nativeElement;\n if (this.lifted()) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.#list.drop();\n return;\n }\n if (event.key === 'Escape' && !isImeComposing(event)) {\n event.preventDefault();\n event.stopPropagation();\n this.#list.cancel();\n return;\n }\n const action = resolveListNavigation(event, {\n orientation: this.#list.orientation(),\n dir: this.#list.dir(),\n });\n if (action) {\n event.preventDefault();\n this.#list.moveLifted(action);\n }\n return;\n }\n if (event.target !== host) {\n return;\n }\n if (this.effectiveDisabled()) {\n this.#navigate(event);\n return;\n }\n if (event.key === ' ' || event.key === 'Enter') {\n if (this.#liftGuard && !this.#liftGuard.canLiftOnKey(event, host)) {\n return;\n }\n event.preventDefault();\n this.#list.lift(host);\n return;\n }\n this.#navigate(event);\n }\n\n #navigate(event: KeyboardEvent): boolean {\n return navigateFromRovingItem(event, {\n groupDisabled: this.#list.disabled(),\n orientation: this.#list.orientation(),\n dir: this.#list.dir(),\n navigate: (action) => this.#list.navigate(this.#host.nativeElement, action),\n });\n }\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n DOCUMENT,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n clampPreviewPosition,\n createPointerDragSession,\n type PointerDragSession,\n markDragItemHost,\n resolveBoundaryElement,\n} from 'forty-cdk/core';\nimport { FOR_DRAGGABLE_CONTEXT, type ForDraggableContext } from './drag-drop-context';\nimport { createPointerHandleGuard, registerWithEnclosingDraggable } from './handle-guard';\n\nconst POINTER_ARM_THRESHOLD_PX = 5;\n\ninterface Point {\n readonly x: number;\n readonly y: number;\n}\n\ninterface LiftSnapshot {\n readonly point: Point;\n readonly position: Point;\n readonly topLeft: Point;\n readonly natural: Point;\n readonly size: { readonly width: number; readonly height: number };\n}\n\ninterface AppliedOffset {\n readonly el: HTMLElement;\n readonly inline: string;\n readonly base: readonly string[];\n readonly offset: Point;\n}\n\nconst ORIGIN: Point = { x: 0, y: 0 };\n\nfunction isOrigin(point: Point): boolean {\n return point.x === 0 && point.y === 0;\n}\n\nfunction splitTranslate(value: string): readonly string[] {\n const parts: string[] = [];\n let depth = 0;\n let current = '';\n for (const char of value.trim()) {\n if (char === '(') {\n depth++;\n } else if (char === ')') {\n depth--;\n }\n if (depth === 0 && /\\s/.test(char)) {\n if (current !== '') {\n parts.push(current);\n current = '';\n }\n continue;\n }\n current += char;\n }\n if (current !== '') {\n parts.push(current);\n }\n return parts.length === 1 && parts[0] === 'none' ? [] : parts;\n}\n\nfunction composeTranslate(base: readonly string[], offset: Point): string {\n const [baseX, baseY, baseZ] = base;\n const x = baseX === undefined ? `${offset.x}px` : `calc(${baseX} + ${offset.x}px)`;\n const y = baseY === undefined ? `${offset.y}px` : `calc(${baseY} + ${offset.y}px)`;\n return baseZ === undefined ? `${x} ${y}` : `${x} ${y} ${baseZ}`;\n}\n\n/**\n * Standalone free-drag directive: repositions its host (or a resolved `rootElement`) by pointer\n * drag via the CSS `translate` property, with **no** `[forDropList]` dependency. The offset\n * composes with the `transform` and the `translate` the element already has, inline or from a\n * stylesheet, so a `translate(-50%, -50%)` or `translate: -50% -50%` centring survives. Unlike\n * `[forDraggable]`, it never commits a reorder — it only moves an arbitrary element around,\n * optionally confined to a `boundary` and locked to one axis. Composes the shared\n * `createPointerDragSession` transport and accepts `[forDragHandle]` children.\n *\n * Its outputs are the `moveStart` / `moveMove` / `moveEnd` trio carrying `{ x, y }` positions —\n * A different vocabulary from `[forDraggable]`'s `dragStart` / `dragEnd`, which carry\n * reorder payloads (`{ source, index }` / `{ dropped }`). Free drag repositions; it never reorders.\n *\n * Pointer-only: there is no WAI-ARIA APG pattern for \"freely reposition an element\", so this is\n * a documented headless exception. It owns no role or ARIA\n * state and must not destroy the moved element's semantics — the consumer keeps the moved\n * element operable at its default position (e.g. a repositionable dialog stays usable by\n * keyboard); dragging is a pointer convenience, not the only way to use it.\n */\n@Directive({\n selector: '[forFreeDrag]',\n exportAs: 'forFreeDrag',\n providers: [{ provide: FOR_DRAGGABLE_CONTEXT, useExisting: ForFreeDrag }],\n host: {\n '[attr.data-dragging]': \"dragging() ? '' : null\",\n '[attr.data-disabled]': \"disabled() ? '' : null\",\n '[style.touch-action]': 'touchAction()',\n },\n})\nexport class ForFreeDrag implements ForDraggableContext {\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #document = inject(DOCUMENT);\n readonly #destroyRef = inject(DestroyRef);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n readonly #lift = signal<LiftSnapshot | null>(null);\n #pointerSession: PointerDragSession | null = null;\n #applied: AppliedOffset | null = null;\n #lastPoint: Point | null = null;\n #scrollListener: AbortController | null = null;\n\n /** When true, the element can't be dragged (it stays focusable; its position doesn't change). */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly #handleGuard = createPointerHandleGuard(this.disabled);\n\n /**\n * The element actually moved: an `HTMLElement`, or a selector resolved via `closest()` from the\n * host. `null` (the default) moves the host itself. Set it to drag a child handle and move an\n * ancestor, e.g. a whole dialog dragged by its header.\n */\n readonly rootElement = input<HTMLElement | string | null>(null);\n\n /**\n * Confine movement within an `HTMLElement`, a `closest()` selector resolved from the host, or\n * `null` (the default) for unbounded movement. Unlike `[forDropList]`'s boundary (which clamps a\n * floating clone), this clamps the **real moved element** so its box stays fully inside.\n */\n readonly boundary = input<HTMLElement | string | null>(null);\n\n /**\n * Constrain movement to one axis. `'x'` pins the element at its lift-time `y` (horizontal-only);\n * `'y'` pins it at its lift-time `x` (vertical-only). `null` (the default) is free.\n */\n readonly lockAxis = input<'x' | 'y' | null>(null);\n\n /** Two-way translate offset (px) from the element's natural position. Controllable / restorable. */\n readonly position = model<{ x: number; y: number }>({ x: 0, y: 0 });\n\n /** Emitted when a pointer drag starts, with the lift-time position. */\n readonly moveStart = output<{ x: number; y: number }>();\n\n /**\n * Emitted on every armed move, and when a scroll during the drag moves the element, with the\n * live position.\n */\n readonly moveMove = output<{ x: number; y: number }>();\n\n /** Emitted when the drag ends, with the final position. */\n readonly moveEnd = output<{ x: number; y: number }>();\n\n /** True while a pointer drag is armed. Reflected as `data-dragging`. */\n readonly dragging = computed(() => this.#lift() !== null);\n\n private readonly touchAction = this.#handleGuard.touchAction;\n\n constructor() {\n registerWithEnclosingDraggable(this.#host.nativeElement, 'ForFreeDrag');\n markDragItemHost(this.#host.nativeElement);\n if (this.#isBrowser) {\n effect(() => {\n this.#applyOffset(this.#resolvedRoot(), this.position());\n });\n this.#destroyRef.onDestroy(() => {\n this.#stopScrollTracking();\n this.#applyOffset(null, ORIGIN);\n });\n this.#pointerSession = createPointerDragSession({\n host: this.#host.nativeElement,\n document: this.#document,\n armThreshold: POINTER_ARM_THRESHOLD_PX,\n cancelOnEscape: true,\n capturePointer: true,\n canStart: (event) => this.#handleGuard.canStart(event),\n onLift: (event, start) => this.#onLift(event, start),\n onMove: (event) => this.#onMove(event),\n onCommit: () => this.#onCommit(),\n onCancel: () => this.#onCancel(),\n });\n this.#destroyRef.onDestroy(() => this.#pointerSession?.destroy());\n }\n }\n\n registerHandle(el: HTMLElement): void {\n this.#handleGuard.register(el);\n }\n\n unregisterHandle(el: HTMLElement): void {\n this.#handleGuard.unregister(el);\n }\n\n private handleTouchAction(): 'none' | null {\n return this.#handleGuard.handleTouchAction();\n }\n\n private registerNestedDraggable(el: HTMLElement): void {\n this.#handleGuard.registerNested(el);\n }\n\n private unregisterNestedDraggable(el: HTMLElement): void {\n this.#handleGuard.unregisterNested(el);\n }\n\n readonly #resolvedRoot = computed<HTMLElement>(() => {\n const root = this.rootElement();\n const host = this.#host.nativeElement;\n if (root === null) {\n return host;\n }\n return typeof root === 'string' ? (host.closest<HTMLElement>(root) ?? host) : root;\n });\n\n #applyOffset(el: HTMLElement | null, offset: Point): void {\n const applied = this.#applied;\n if (applied && (applied.el !== el || isOrigin(offset))) {\n applied.el.style.translate = applied.inline;\n this.#applied = null;\n }\n if (el === null || isOrigin(offset)) {\n return;\n }\n const inline = this.#applied?.inline ?? el.style.translate;\n const base =\n this.#applied?.base ??\n splitTranslate(this.#document.defaultView?.getComputedStyle(el).translate ?? '');\n el.style.translate = composeTranslate(base, offset);\n this.#applied = { el, inline, base, offset };\n }\n\n #naturalOrigin(root: HTMLElement, rect: DOMRect): Point {\n const offset = this.#applied?.el === root ? this.#applied.offset : ORIGIN;\n return { x: rect.left - offset.x, y: rect.top - offset.y };\n }\n\n #onLift(event: PointerEvent, start: Point): boolean {\n const root = this.#resolvedRoot();\n const rect = root.getBoundingClientRect();\n const position = this.position();\n this.#lift.set({\n point: start,\n position,\n topLeft: { x: rect.left, y: rect.top },\n natural: this.#naturalOrigin(root, rect),\n size: { width: rect.width, height: rect.height },\n });\n this.#startScrollTracking({ x: event.clientX, y: event.clientY });\n this.moveStart.emit(position);\n return true;\n }\n\n #onMove(event: PointerEvent): void {\n this.#moveTo({ x: event.clientX, y: event.clientY }, true);\n }\n\n #moveTo(point: Point, emitUnchanged: boolean): void {\n const lift = this.#lift();\n if (!lift) {\n return;\n }\n this.#lastPoint = point;\n const root = this.#resolvedRoot();\n const natural = this.#naturalOrigin(root, root.getBoundingClientRect());\n const pinned = {\n x: lift.topLeft.x + natural.x - lift.natural.x,\n y: lift.topLeft.y + natural.y - lift.natural.y,\n };\n const desired = {\n x: lift.topLeft.x + (point.x - lift.point.x),\n y: lift.topLeft.y + (point.y - lift.point.y),\n };\n const boundaryEl = resolveBoundaryElement(this.#host.nativeElement, this.boundary());\n const boundaryRect = boundaryEl?.getBoundingClientRect() ?? null;\n const clamped = clampPreviewPosition(desired, lift.size, boundaryRect, this.lockAxis(), pinned);\n const next = { x: clamped.x - natural.x, y: clamped.y - natural.y };\n const current = this.position();\n if (!emitUnchanged && next.x === current.x && next.y === current.y) {\n return;\n }\n this.position.set(next);\n this.moveMove.emit(next);\n }\n\n #startScrollTracking(point: Point): void {\n this.#stopScrollTracking();\n this.#lastPoint = point;\n const listener = new AbortController();\n this.#document.addEventListener(\n 'scroll',\n () => {\n const point = this.#lastPoint;\n if (point) {\n this.#moveTo(point, false);\n }\n },\n { capture: true, passive: true, signal: listener.signal },\n );\n this.#scrollListener = listener;\n }\n\n #stopScrollTracking(): void {\n this.#scrollListener?.abort();\n this.#scrollListener = null;\n this.#lastPoint = null;\n }\n\n #onCommit(): void {\n this.#stopScrollTracking();\n this.#lift.set(null);\n this.moveEnd.emit(this.position());\n }\n\n #onCancel(): void {\n const lift = this.#lift();\n if (!lift) {\n return;\n }\n this.#stopScrollTracking();\n this.position.set(lift.position);\n this.#lift.set(null);\n this.moveEnd.emit(this.position());\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectDraggableContext } from './drag-drop-context';\n\n/**\n * Optional drag handle inside a `[forDraggable]`. When at least one handle is present on an item, a pointer\n * drag may only start from within a handle (keyboard dragging is unaffected). Apply on a child element.\n * Sets `touch-action: none` while its item can be dragged, so a touch drag on the handle is not taken\n * by the page's scrolling.\n */\n@Directive({\n selector: '[forDragHandle]',\n exportAs: 'forDragHandle',\n host: {\n '[style.touch-action]': 'context.handleTouchAction()',\n '[attr.data-drag-handle]': \"''\",\n },\n})\nexport class ForDragHandle {\n private readonly context = injectDraggableContext('ForDragHandle');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n registerHandle(\n this.#host.nativeElement,\n (el) => this.context.registerHandle(el),\n (el) => this.context.unregisterHandle(el),\n );\n }\n}\n","/**\n * Returns a copy of `array` with the item at `from` moved to `to`. Indices are clamped to\n * the array bounds; an out-of-range or no-op move returns a shallow copy unchanged.\n */\nexport function moveItemInArray<T>(array: readonly T[], from: number, to: number): T[] {\n const len = array.length;\n if (len === 0) {\n return [];\n }\n const clampedFrom = Math.max(0, Math.min(len - 1, from));\n const clampedTo = Math.max(0, Math.min(len - 1, to));\n const copy = [...array];\n if (clampedFrom === clampedTo) {\n return copy;\n }\n const [item] = copy.splice(clampedFrom, 1);\n copy.splice(clampedTo, 0, item!);\n return copy;\n}\n\n/**\n * Moves the item at `fromIndex` of `from` into `to` at `toIndex`, returning new arrays for\n * both. Does not mutate the inputs. Indices are clamped (`toIndex` may equal `to.length`,\n * i.e. append).\n */\nexport function transferArrayItem<T>(\n from: readonly T[],\n to: readonly T[],\n fromIndex: number,\n toIndex: number,\n): { from: T[]; to: T[] } {\n if (from.length === 0) {\n return { from: [], to: [...to] };\n }\n const clampedFrom = Math.max(0, Math.min(from.length - 1, fromIndex));\n const clampedTo = Math.max(0, Math.min(to.length, toIndex));\n const nextFrom = [...from];\n const [item] = nextFrom.splice(clampedFrom, 1);\n const nextTo = [...to];\n nextTo.splice(clampedTo, 0, item!);\n return { from: nextFrom, to: nextTo };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