import * as i0 from '@angular/core'; import * as i1 from 'forty-cdk/drag-drop'; /** Payload of `itemReorder`: the lifted item's previous and new absolute index. */ interface ForVirtualReorderEvent { /** Previous absolute (dataset) index of the lifted item (0-based). */ readonly from: number; /** New absolute (dataset) index the item moves to (0-based) — pass to `moveItemInArray`. */ readonly to: number; } /** * Opt-in **drag-reorder for a windowed `*forVirtualFor` list**, composed over the drag-drop * primitive. Apply it on the same element as `[forVirtualViewport]`; it wraps `[forDropList]` * (via `hostDirectives`) so the rendered rows become a reorderable list, then translates the * drop list's window-relative drop into the dataset-absolute `itemReorder` output. Mark each * row rendered by `*forVirtualFor` as `[forDraggable]` with a `[dragData]`. * * It is the drag-drop-side analogue of `ForTableRowReorder` for non-table virtualized lists, * supplying the three mechanisms a bare `[forDropList]` lacks under virtualization: * * - **Absolute-index translation** — each rendered row's absolute index is read from the * `data-index` attribute `*forVirtualFor` emits, so `itemReorder` carries dataset indices * (not window-relative ones) and `moveItemInArray` over the full array moves the right item. * - **Lifted-row pinning** — the lifted row is pinned into the window via the viewport's * `setReorderingIndex`, so auto-scroll and a dataset-wide keyboard jump can both carry the * window past it without recycling it, and it keeps its DOM node — and therefore its focus — * for the whole gesture. * - **Dataset-wide keyboard reorder** — keyboard stepping runs over the true total count, * scrolling unmounted target rows into view, rather than being confined to the window. * * **One gesture at a time**. The pin is * written when a pointer drag **arms**, not when the press lands, and released on its commit or * cancel — so an ordinary click on a row pins nothing and leaves no retained node behind. Pointer * and keyboard reorder are mutually exclusive: while a keyboard lift is live the coordinator stands * its pointer channel down (no pin, no scrub tracking, no arming), and a lift key pressed during a * pointer drag is ignored. Whichever gesture starts first owns the pin until it commits or aborts. * * A pointer press is refused outright — nothing tracked, no `'pointer'` mode, no pin — when the * list is `disabled`, when a **mouse** press uses a non-primary button (touch and pen presses keep * whatever `button` their engine reports), or when the pressed row's `[forDraggable]` is * `[dragDisabled]` or unregistered. That is the guard set `[forListboxReorder]` and * `[forTreeNodeDrag]` apply at the same seam, and it matches what this coordinator's own keyboard * path already refuses. * * Hold **Shift** during a pointer drag to engage **windowed scrub**: the viewport maps onto the * whole dataset (top edge → first item, bottom edge → last), so a single gesture drops the lifted * item at an arbitrary far item without waiting for auto-scroll to reach it. Without Shift, pointer * resolution is unchanged. * * It **never reorders the items itself** (BYO-data): apply the move to your own array inside * the `(itemReorder)` handler. Vertical lists only (the default scroll axis). * * @example * ```html *
*
* {{ row.label }} *
*
* ``` */ declare class ForVirtualReorder { #private; /** Fires once per committed reorder gesture with the previous / new absolute item index. */ readonly itemReorder: i0.OutputEmitterRef; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export { ForVirtualReorder }; export type { ForVirtualReorderEvent };