import type{LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';export interface LyraReorderDetail{readonly order:readonly string[];readonly fromIndex:number;readonly toIndex:number;}export interface LyraReorderListEventMap{'lr-reorder':CustomEvent>;} /** * `` — a generic vertical list of `` rows, reorderable via * per-row move-up/move-down buttons (always available) or Ctrl/Cmd+ArrowUp/ArrowDown from focus * anywhere inside a row — the same modifier convention ``'s `reorderable` and * ``'s `cells-draggable` already establish. * * By default this list physically moves its own slotted `` light-DOM nodes * itself, unlike ``'s `reorderable` mode (a *controlled* request — `data` is host-owned * and nothing moves until the host reassigns it): this list has no `data` array prop, its * children are plain author-authored slotted content with nothing to reconcile against, so DOM * order genuinely is the source of truth (the same principle `` relies on for its own * children). Setting `controlled` opts into the ``-style contract instead — see its own * doc comment. Every item must provide a unique, nonempty `value`; invalid or duplicate identities * stay visible but cannot move. The `lr-reorder` event tells the host the resulting stable-id * order, so it can persist it without hand-rolling its own splice/resort logic. * * An `lr-reorder` listener can call `preventDefault()` to hold a move open while its own async * work (e.g. a network call persisting the new order) is in flight -- the same * cancelable-event-plus-host-resolvable-pending-state pattern `` and * `` already establish for their own approve/deny decisions. * * @customElement lr-reorder-list * @slot - `` elements. * @event lr-reorder - `detail: { order, fromIndex, toIndex }` — fired before a move is applied * (button click or Ctrl/Cmd+Arrow). `order` is every valid item's stable `value` in the order the * move WOULD produce; `fromIndex`/`toIndex` are the moved item's * 0-based position before/after. Cancelable: a listener calling `preventDefault()` holds the move * instead of applying it -- the affected `` exposes `:state(pending)`, every move * action becomes disabled, and no other move * can start anywhere in this list -- until the host calls `finalizePendingMove()` to apply it or * `revertPendingMove()` to discard it and restore the prior order. Uncanceled (the default), the * move applies synchronously in the same tick when `controlled` is unset, unchanged from every * release before this option existed; while `controlled` is set it instead waits for a matching * host re-render, per that property's own doc comment. * @csspart base - The list's root wrapper (`role="list"`). * @cssprop [--lr-reorder-list-gap=var(--lr-space-2xs)] - Gap between rows. * @status stable * @since 6.0.0 */ export declare class LyraReorderList extends LyraElement{static styles:import("lit").CSSResultGroup[];protected static readonly immutableEventDetails:readonly string[]; /** Accessible-name fallback for the internal `role="list"` element when the host has no * `aria-label`, matching ``. Native lists don't require an accessible name, * so this has no forced fallback string when both are left unset. */ label:string; /** Disables every item's move-up/move-down buttons and the Ctrl/Cmd+Arrow shortcut, without * removing any item from the DOM or mutating any item's own `disabled` attribute. */ disabled:boolean; /** Opt-in controlled mode. Unset (the default), an uncanceled `lr-reorder` (or a * `finalizePendingMove()` call) moves this list's own slotted `` light-DOM * nodes itself, exactly as before this property existed. Set, this list stops moving anything * itself -- the host is expected to reorder its OWN backing data and re-render the slotted * items in the new order, the same controlled request ``'s `reorderable` already * establishes for its `data`-driven children. This list still has no `data` array prop (its * children stay plain slotted content), so the reconciliation is keyed by each item's stable * `value` rather than by element reference: once a later slot/attribute mutation settles into * exactly the value order this list emitted as the triggering event's `order`, the move is * complete -- boundary state, focus restore, and the `reorderItemMoved` announcement then fire * against whichever element instance now holds that `value` (the host's re-render may have * recreated it). Every move action stays disabled and `:state(busy)`/`aria-busy="true"` apply * list-wide for the whole wait, matching a `preventDefault()`-held move. A host re-render that * never reaches that exact order leaves the move pending indefinitely; one that drops the * moved `value` entirely (removes or renames that row) cancels it silently, with no * announcement -- the host already knows, since it made that edit itself. */ controlled:boolean;private liveRegion?; /** Latest post-move focus target. A generation guard keeps a superseded async restore inert. */ private pendingFocusTarget;private focusRestoreGeneration;private itemObserver?;private stateItems;private moveToken; /** Set while an `lr-reorder` listener has called `preventDefault()`, holding a move until the * host calls `finalizePendingMove()` or `revertPendingMove()`. `moveItem()` refuses to start * any further move while this is set -- at most one move is ever held at a time. */ private pendingMove; /** Set while `controlled` is on and a move awaits a matching host re-render. Like `pendingMove`, * at most one is ever outstanding: `moveItem()` refuses to start another while this is set. */ private pendingReconciliation;private get directItemElements();private get itemElements();private syncBoundaryState;private onSlotChange; /** Checks whether the current light-DOM order now matches a controlled move's expected value * order, completing it (boundary sync + focus restore + announcement, via `finishMove()`) * against whichever element now holds the moved `value`. Drops the reconciliation silently, * with no announcement, once that `value` is no longer present at all -- the host that removed * or renamed the row already knows it did so. Otherwise leaves it pending for a later * mutation. */ private tryCompleteControlledReconciliation;private refreshItemObserver;private pendingMembershipIsCurrent;connectedCallback():void;protected willUpdate(changed:PropertyValues):void;disconnectedCallback():void;private orderValues;private scheduleFocusRestore;private restoreFocusAfterItemUpdate; /** Physically moves `item` (already known to belong at `toIndex`) and hands off to * `finishMove()` for the boundary-recompute / focus-restore / announce steps every completed * move shares, whether it just moved the DOM itself (this method) or is instead reconciling a * `controlled` host's own re-render (`tryCompleteControlledReconciliation()`). */ private applyMove; /** Shared tail of a completed move, physical or `controlled`-reconciled: recomputes boundary * state, schedules focus restore onto `item` (already at `toIndex`), and announces it. */ private finishMove; /** Commits an accepted move: physically applies it, or -- while `controlled` -- starts waiting * for the host's own matching re-render instead. Shared by the immediate (uncanceled) path, a * synchronous in-dispatch `finalize` resolution, and a later `finalizePendingMove()` call. */ private commitMove;private moveItem; /** Applies a move an `lr-reorder` listener held via `preventDefault()`, once the host's own * async work (e.g. persisting the new order) has succeeded. While `controlled`, this starts * waiting for the host's own matching re-render rather than moving anything itself -- see that * property's own doc comment. No-op if nothing is pending. */ finalizePendingMove():void; /** Discards a move an `lr-reorder` listener held via `preventDefault()`, leaving the list at its * prior order -- e.g. once the host's own async work (e.g. persisting the new order) fails, or * a host that is deferring the decision to a flow of its own (a confirmation dialog, say) and * will communicate the outcome itself. Pass `{ silent: true }` to suppress the built-in * `reorderMoveCancelled` announcement for that second case; the default announces exactly as * before. No-op if nothing is pending. */ revertPendingMove(options?:{silent?:boolean;}):void;private onMoveRequest;private onKeyDown;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-reorder-list':LyraReorderList;}}