import * as _angular_core from '@angular/core'; import { TemplateRef } from '@angular/core'; import * as i1 from '@angular/cdk/drag-drop'; import { CdkDragDrop } from '@angular/cdk/drag-drop'; /** Payload emitted whenever the user finishes a reorder. */ interface WrSortableReorderEvent { /** The new items array after the move. */ readonly items: readonly T[]; /** Index the item was dragged from. */ readonly previousIndex: number; /** Index the item was dropped at. */ readonly currentIndex: number; /** Convenience handle for the dropped item. */ readonly item: T; } /** * Drag-to-reorder list. Wraps CDK's `cdkDropList` + `cdkDrag` with a * signal-based items binding — the source array is updated in place and * emitted via 2-way `[(items)]`. * * Drop a single template — it's rendered per item with `let-item * let-index="index"`. Add `[handle]="true"` (or `[wrDragHandle]` inside * your template) to restrict drag start to a handle element. * * @example * ```html * * *
* * {{ i + 1 }}. {{ row.label }} *
*
*
* ``` * * @see https://ngwr.dev/components/drag-drop */ declare class WrSortableList { /** Items to render. Two-way — emits the reordered array on drop. */ readonly items: _angular_core.ModelSignal; /** Layout direction. Drives CDK's `cdkDropListOrientation`. @default 'vertical' */ readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">; /** Disable all dragging. @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** Locked axis — restrict drag movement to one axis even diagonally. */ readonly lockAxis: _angular_core.InputSignal<"x" | "y" | undefined>; /** * Delay (ms) before a drag begins after the pointer goes down. The touch * delay is the fix for the classic CDK touch snag: without it, the * `touch-action: none` CDK puts on each item blocks scrolling the list on a * phone. With a small touch delay, a quick swipe scrolls and a brief hold * starts the drag; mouse stays instant. Pass a single number to apply one * delay to both pointers. @default { touch: 150, mouse: 0 } */ readonly dragStartDelay: _angular_core.InputSignal; /** `trackBy` for the inner `@for`. Defaults to identity. */ readonly trackBy: _angular_core.InputSignal<(index: number, item: T) => unknown>; /** Fired after a successful reorder with the new array + indices. */ readonly reorder: _angular_core.OutputEmitterRef>; protected readonly rowTemplate: _angular_core.Signal>; protected onDrop(event: CdkDragDrop): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "wr-sortable-list", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "lockAxis": { "alias": "lockAxis"; "required": false; "isSignal": true; }; "dragStartDelay": { "alias": "dragStartDelay"; "required": false; "isSignal": true; }; "trackBy": { "alias": "trackBy"; "required": false; "isSignal": true; }; }, { "items": "itemsChange"; "reorder": "reorder"; }, ["rowTemplate"], never, true, never>; } /** * Drag handle for {@link WrSortableList} (and any nested `cdkDrag`). * Composes CDK's `cdkDragHandle` via `hostDirectives` so consumers don't * need to import the CDK selector directly. * * @example * ```html * * *
* * {{ row.label }} *
*
*
* ``` */ declare class WrDragHandle { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } export { WrDragHandle, WrSortableList }; export type { WrSortableReorderEvent };