import { ID } from "../../types/index.mjs"; import { AtomProps } from "../Atom/Atom.vue.mjs"; import "../Atom/index.mjs"; import { SortableTicket, SortableTicketInput } from "../../composables/createSortable/index.mjs"; import { KanbanColumnTicket, KanbanColumnTicketInput, KanbanContext } from "../../composables/createKanban/index.mjs"; import { DragDropContext } from "../../composables/useDragDrop/index.mjs"; import { MaybeRefOrGetter, Ref, ShallowRef } from "vue"; //#region src/components/Kanban/KanbanRoot.vue.d.ts type KanbanOrientation = 'horizontal' | 'vertical'; type KanbanDirection = 'up' | 'down' | 'first' | 'last' | 'prev' | 'next'; interface KanbanColumnInput extends KanbanColumnTicketInput { /** Column name used in announcements */ label?: MaybeRefOrGetter; } type KanbanBoardColumn = KanbanColumnTicket; interface KanbanDrag { type: 'item'; value: { value: unknown; readonly label: string | undefined; }; } interface KanbanMovePayload { /** The moved item's value, as bound on Kanban.Item */ value: unknown; /** Source column id */ from: ID; /** Destination column id */ to: ID; /** Index in the source column before the move */ fromIndex: number; /** Index in the destination column after the move */ toIndex: number; } interface KanbanPosition { /** Column id */ column: ID; /** Index within the column */ index: number; } interface KanbanPointer { /** Column whose list is under the pointer */ column: ID; /** * Slot the drop line is anchored to. * Absent on an empty list, and on the dragged item's own slot (a stay). * `edge: 'before'` anchors the first child only; every other slot is * `'after'` on the previous child. The index still counts the dragged item. */ slot?: { index: number; edge: 'before' | 'after'; }; } interface KanbanGrab { /** The picked-up item's value */ value: unknown; /** Accessible name of the item */ label: string | undefined; /** Where the item currently sits on the board */ origin: KanbanPosition; /** Where a drop would land it — the index it would have after the move */ target: KanbanPosition; } interface KanbanRootContext { /** The underlying board */ kanban: KanbanContext; /** Pointer drag-and-drop context */ dnd: DragDropContext; /** Layout axis columns flow along; items flow along the other */ orientation: Readonly>; /** Whether the whole board is disabled */ isDisabled: Readonly>; /** Keyboard pick-up in progress, or null */ grabbed: Readonly>; /** Pending keyboard drop target, or null when it equals the origin */ preview: Readonly>; /** Accepted pointer hover, or null when nothing is dragged over a list */ pointer: Readonly>; /** Set or clear `pointer`. Lists publish; items and columns read. */ aim: (next: KanbanPointer | null) => void; /** Item value that should take focus after it re-renders */ pending: ShallowRef; /** Latest announcement for Kanban.LiveRegion */ message: Readonly>; /** Id of the mounted Kanban.Instructions element, if any */ instructions: ShallowRef; /** Find the column and ticket that hold an item value */ locate: (value: unknown) => { column: KanbanBoardColumn; ticket: SortableTicket; } | undefined; /** Move an item to a column at an index. Returns false when gated or rejected. */ move: (value: unknown, to: ID, index: number, label?: string) => boolean; /** Move an item and announce where it landed (pointer drops) */ place: (value: unknown, to: ID, index: number, label?: string) => boolean; /** Pick an item up for keyboard moving */ grab: (value: unknown, label?: string) => void; /** Move the drop target one step */ shift: (direction: KanbanDirection) => void; /** Commit the picked-up item to its drop target */ drop: () => void; /** Discard the drop target; the board is not touched */ cancel: () => void; /** Re-read the picked-up item's position after an external board change */ sync: () => void; /** Write a message to the live region */ announce: (text: string) => void; } declare const useKanbanRoot: (key: string, defaultValue?: KanbanRootContext | undefined) => KanbanRootContext, provideKanbanRoot: (key: string, context: KanbanRootContext, app?: import("vue").App) => KanbanRootContext; interface KanbanRootProps extends AtomProps { /** Disable every move on the board */ disabled?: boolean; /** Axis the columns flow along (default: 'horizontal') */ orientation?: KanbanOrientation; /** Accessible name for the board */ label?: string; /** Namespace for context provision */ namespace?: string; } type KanbanRootEmits = { /** An item changed position. Fires once per committed drop. */ move: [payload: KanbanMovePayload]; }; interface KanbanRootSlotProps { /** Whether the board is disabled */ isDisabled: boolean; /** Whether an item is picked up by keyboard or dragged by pointer */ isMoving: boolean; /** Attributes to bind to the board element */ attrs: { 'role': 'group'; 'aria-label': string; 'aria-disabled': boolean; 'data-disabled': true | undefined; 'data-orientation': KanbanOrientation; }; } declare const _default: typeof __VLS_export; declare const __VLS_export: __VLS_WithSlots any; }, string, import("vue").PublicProps, Readonly & Readonly<{ onMove?: ((payload: KanbanMovePayload) => any) | undefined; }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, { default: (props: KanbanRootSlotProps) => any; }>; type __VLS_WithSlots = T & { new (): { $slots: S; }; }; //#endregion export { KanbanBoardColumn, KanbanColumnInput, KanbanDirection, KanbanDrag, KanbanGrab, KanbanMovePayload, KanbanOrientation, KanbanPointer, KanbanPosition, KanbanRootContext, KanbanRootEmits, KanbanRootProps, KanbanRootSlotProps, _default as default, provideKanbanRoot, useKanbanRoot };