import { a as ListDropTarget, f as ListTargetDropEvent, g as ItemTagKeys, i as ListDropPositions, l as ListReorderEvent, m as ItemTagBehaviour, n as ListCanReorder, s as ListReorderBlocked, t as ListCanDrop, u as ListResolveInternalDrag } from "./list-drop-types-Bye1r3Ub.js"; import { a as ViewStateBase, t as GetViewStateOptions } from "./types-16GC5k1z.js"; import { H as ListNativeDragStartEvent, P as ListDragDataTransferWriter, R as ListDragPreviewRenderer, z as ListDragPreviewSourceResolver } from "./tree-component-BE7OEIiH.js"; import { h as ListSelectionMode, i as ListInteractionMode, r as ListElementEventMap } from "./list-selection-types-CKTt7Rrw.js"; import { n as ListViewportChangeEvent } from "./list-viewport-types-BJ8c6qur.js"; import "./index-Cdcek1Oj.js"; import { S as ListSearchController } from "./index-C3N2TOmf.js"; import "./editable-label-CiHCDlhC.js"; import { LitElement, PropertyValues } from "lit"; import { CommandId, CommandRegistry } from "@clinth/ui-commands"; /** * Named entry / exit effect for a whole set of rows. * * - `none` — rows appear and disappear without a staged animation. * - `sweep` — rows enter from the right, staggered; on exit they continue off * to the left, staggered. * * The motion is plain CSS (`@keyframes` + `animation-delay`), selected by the * `data-item-phase` attribute. See {@link listItemEffectStyles}. */ type ListItemEffect = `none` | `sweep`; /** * Which way an effect travels. `forward`: rows enter from the right and leave to * the left (going "down" into something). `backward`: the mirror image (going * back "up"). */ type ListItemEffectDirection = `forward` | `backward`; /** Highest stagger step; later rows share it, so a long list doesn't take forever. */ declare const LIST_ITEM_EFFECT_MAX_STEPS = 16; /** * Shadow-DOM CSS for the named effects, for a host whose rows are slotted * (`::slotted`). Tunable from outside with: * * - `--ixfx-item-effect-duration` (default `260ms`) * - `--ixfx-item-effect-stagger` (default `30ms`, delay added per row) * - `--ixfx-item-effect-easing` (entrance, default `ease-out`: arrives fast, settles) * - `--ixfx-item-effect-exit-easing` (exit, default `ease-in`: leaves slowly, then accelerates away) * * Under `prefers-reduced-motion: reduce` no animation runs. */ declare const listItemEffectStyles: import("lit").CSSResult; /** * Play the host's `item-effect` on `rows` and resolve when every animation has * finished. Rows get `data-item-phase` (`in` | `out`) and a `--ixfx-item-step` * stagger index; the stylesheet does the rest. * * `in` clears its markers once finished. `out` leaves them (the rows are * detached by the caller next), so there is no flash back to full size. * Resolves at once when nothing animates (`none`, reduced motion, no CSS). */ declare function runListItemEffect(rows: readonly HTMLElement[], phase: `in` | `out`): Promise; /** * `list-drag-over` / `list-drop`. `key` and `item` are `undefined` when the * drag is over empty list space rather than a row. */ type ListDropDetail = { readonly key: string | undefined; readonly item: Element | undefined; readonly dataTransfer: DataTransfer; /** What the drag is over — `on` a row, `between` two rows, or `empty` space. `key` / `item` describe an `on` target. */ readonly target?: ListDropTarget; }; type ListDragLeaveDetail = { readonly key: string | undefined; }; type ListContextMenuDetail = { readonly key: string | undefined; readonly item: Element; /** Viewport coordinates to open the menu at. */ readonly x: number; readonly y: number; /** The selection at the time of the request — a row that was not selected has been selected first. */ readonly selectedKeys: ReadonlySet; }; type ListEditCommitDetail = { readonly key: string | undefined; readonly value: string; }; type ListEditCancelDetail = { readonly key: string | undefined; }; type ListDragOverEvent = CustomEvent; /** `list-drop`: the same event, and detail, as every list component — see `ListTargetDropDetail`. */ type ListDropEvent = ListTargetDropEvent; type ListDragLeaveEvent = CustomEvent; type ListContextMenuEvent = CustomEvent; type ListEditCommitEvent = CustomEvent; type ListEditCancelEvent = CustomEvent; /** * Pure helpers behind `ixfx-vertical-list`'s view state. The component runs * them whenever its items change (light-DOM edits, `addItem` / `setItems` / * `clearItems`, adapter rebuilds, virtual registry changes), so state keyed to * rows that left the list goes pending and comes back when those keys reappear. */ /** * `ixfx-vertical-list` view state. All fields are the shared base fields: * `selected` (the checked set in `checked` mode), `focus` (keyboard cursor) * and `scroll`. Keys are each row's `data-key` / `data-value`. */ type VerticalListViewState = ViewStateBase; interface CustomCheckboxOptions { renderer: (checked: boolean) => unknown; margin?: string; width?: string; } interface AddItemOptions { /** * In `checked` interaction mode, adds the item without a checkbox column and * without the ability to be checked/selected. Equivalent to setting the * `not-checked` attribute on the item. Ignored outside `checked` mode. */ notChecked?: boolean; } declare class VerticalListElement extends LitElement { #private; selectionMode: ListSelectionMode; interactionMode: ListInteractionMode; /** * Entry / exit effect for rows built from `items` (CSS animation). `sweep`: * the old rows leave to the left, staggered, then the new rows enter from the * right, staggered. Ignored while `virtualize` is active, and under * `prefers-reduced-motion`. */ itemEffect: ListItemEffect; /** * Which way `item-effect` travels. `forward` (default): enter from the right, * leave to the left. `backward`: enter from the left, leave to the right. * Set it before changing `items`. */ itemEffectDirection: ListItemEffectDirection; filterPredicate: ((el: Element) => boolean) | undefined; /** * Whether keyboard navigation wraps from last to first and vice versa. * - 'stop' (default): navigation stops at the boundary * - 'wrap': navigation wraps around */ itemWrap: `stop` | `wrap`; /** * Optional renderer for the checkbox shown in `checked` interactionMode. * Receives the current `checked` state and returns a Lit template result. * * When set, the per-row checkbox becomes a `` whose * contents are whatever this returns (rendered with `lit`'s `render()`). * When unset, a native `` is used. * * @example * list.checkboxRenderer = (checked) => checked * ? html` * * ` * : html``; */ checkboxRenderer: ((checked: boolean) => unknown) | CustomCheckboxOptions | undefined; /** * Space-separated subset of `navigate select filter` — limits which * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search * disabled. See `docs/infra-incremental.md`. */ searchModes: string | undefined; /** * Enable native browser drag-and-drop for selectable items. When true, * selectable rows become draggable and the list emits * `list-native-drag-start` when a drag begins. */ itemsDraggable: boolean; /** * Custom drag preview renderer (synchronous). Defaults to the shared * built-in HTML+canvas preview. */ dragPreviewRenderer: ListDragPreviewRenderer | undefined; /** * Write an application payload onto the drag's `DataTransfer` (e.g. a custom * MIME type). Called once per drag, synchronously inside `dragstart`, after a * non-cancelled `list-native-drag-start`. */ writeDataTransfer: ListDragDataTransferWriter | undefined; dragPreviewSource: ListDragPreviewSourceResolver | undefined; /** * Object/adapter item mode (mirrors `ixfx-detail-list`). When set, the list * builds one `
  • ` per entry and owns its light-DOM children; `formatter` * renders each entry and `keyProperty` stamps `data-key` so `selectKeys` / * `focusKey` / `getItemByKey` keep working. * * Additive: `addItem(element)` / `setItems(elements)` keep working while * `items` is unset. While `items` is set, a rebuild (on `items` / * `formatter` / `keyProperty` change) discards hand-added children. */ items: readonly unknown[] | undefined; /** * Property name on each `items` entry used for stable identity — stamped * as `data-key` on the built row. Preserves selection across rebuilds. */ keyProperty: string; /** * Renders one adapter-mode entry. The result may be a `string` (row text), * a `Node` (appended into the row `
  • `), a full row `Element` (an `
  • ` * or a `[data-list-item]` custom element, used directly), or a Lit template * result (rendered into the row `
  • ` with `render()`). Without a * formatter, string entries become row text and `Node` entries are * appended. */ formatter: ((item: unknown, index: number) => unknown) | undefined; /** * Per-item icon for adapter (`items`) mode, prepended to the row — a DOM * `Node` or anything Lit can render (usually a `TemplateResult` wrapping an * `` or an inline SVG). Ignored when the `formatter` returns a * full row element (the formatter then owns the whole row, icon included). */ icon: ((item: unknown, index: number) => unknown) | undefined; /** * CSS colour tinting the per-item `icon`. Icons paint from `currentColor`, * so this recolours them. Inline, so it wins over selection styling. */ iconColor: ((item: unknown, index: number) => string | undefined) | undefined; /** * CSS colour for the row's text. Inline, so it wins over the selected / * tickled text colours — keep it legible against both. */ textColor: ((item: unknown, index: number) => string | undefined) | undefined; /** * Finder-style badge for the row, right-justified after the text — a * `TemplateResult`, a DOM `Node`, or anything Lit can render. The row is * flex, so the badge self-justifies to the trailing edge. */ badge: ((item: unknown, index: number) => unknown) | undefined; /** * Virtualize the list: only the overscanned viewport window exists in the * DOM; offscreen rows are recycled through an off-DOM pool as the list * scrolls. Works for hand-supplied elements AND adapter (`items`) rows — * both are detached/reattached by identity, so selection, cursor and * component state survive scrolling. * * Requires `item-height`: every row must be exactly that tall (use * `--list-item-height` to match). `data-key`s are required for the key * APIs (`selectKeys`, `focusKey`, `renderedKeys`); selection by reference * (click, `select()`) works regardless. * * Limitations while active: drag-select is disabled (the window shifts * under a drag), and incremental-search `filter` mode is excluded (it * collapses rows via `hidden`, corrupting the fixed-stride geometry). * Keyboard navigation stays within the rendered window — scroll first. */ virtualize: boolean; /** * Fixed row height in px. Required for `virtualize` — the window math is * pure stride arithmetic (no DOM measurement), mirroring * `ixfx-grid-list`'s `itemSize`. */ itemHeight: number; /** * Make rows (and the empty space around them) drop targets for native * drags — including OS drags carrying files. The list fires `list-drag-over` * (cancelable: `preventDefault()` accepts the drop), `list-drop` and * `list-drag-leave`, and highlights the row under the drag with * `data-drop-target` (`--list-drop-target-bg`, `--list-drop-target-outline`). */ itemsDroppable: boolean; /** * Which targets a drag can resolve to: onto a row (`on`, the default), into the gap between two rows * (`between`), or both (`both`: the top and bottom quarter of a row mean `between`, the middle half * means `on`). `list-drop` reports the resolved `ListDropTarget`. */ dropPositions: ListDropPositions; /** * A drag that starts in this list and ends between its own rows is a **reorder** (`list-reorder`), not * a drop. Implies `items-draggable`, and `between` targets for internal drags. The list never reorders * its own items — the host owns the order (see `applyListReorder`). */ itemsReorderable: boolean; /** Sync gate for internal moves (e.g. nothing may go above a pinned row). `false` ⇒ no indicator and no event. */ canReorder: ListCanReorder | undefined; /** * For a host that cancels the browser drag in `list-native-drag-start` and starts an OS drag in its * place: say which keys a drag carries, so a drop inside this list is still a `list-reorder`. */ resolveInternalDrag: ListResolveInternalDrag | undefined; /** Why `between` drops are refused, or `undefined` when they work. Always `undefined` here: a vertical list is never sorted or grouped. */ get reorderBlocked(): ListReorderBlocked | undefined; /** * Opt in to in-place rename (`beginEdit`). Called with the typed text and * the row's key when the user commits; return `false` to reject it (the * edit then ends as a cancel). Without it `beginEdit` does nothing and rows * stay plain text. */ editValidator: ((value: string, key: string | undefined) => boolean) | undefined; /** * Refuse a drop before any event fires or any highlight shows. Given the resolved target — `on` a * row, `between` two rows, or `empty` space — and the drag's `DataTransfer`. Only used while * `itemsDroppable` is set (or for the `on` targets of an internal drag). A `between` target of an * internal move is gated by {@link canReorder} instead. */ canDrop: ListCanDrop | undefined; private readonly selection; private tickled; private _syncNativeDraggable; /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */ readonly search: ListSearchController; /** Command registry carrying this list's `list.search.*` commands. */ get registry(): CommandRegistry | undefined; connectedCallback(): void; disconnectedCallback(): void; /** * The shadow scroll list only exists after the first render; start * watching it so resizes move the window (virtualized) and the visible * set (plain) too. */ protected firstUpdated(): void; updated(changed: PropertyValues): void; /** The most recently selected item, or `undefined` if nothing is selected. */ get selectedItem(): Element | undefined; /** The full current selection set (read-only). */ get selectedItems(): ReadonlySet; addItem(item: Element | string, options?: AddItemOptions): void; /** * Collapse + fade `item` out, then detach it. The rows below slide up to * close the gap. Resolves once the element has actually been removed. * Under `prefers-reduced-motion: reduce` it's removed immediately. * A pooled (offscreen) row under virtualization is removed immediately. */ removeItem(item: Element): Promise; /** {@link removeItem} for several items at once. */ removeItems(items: Iterable): Promise; clearItems(): void; /** * Replace the entire item list in one call. * Equivalent to `clearItems()` followed by `addItem()` for each element. * Preserves `interactionMode` checkbox wrapping. */ setItems(items: readonly Element[]): void; /** * Dispatch a command to this list — used by `ixfx-grouped-item-lister` to * forward commands to all sub-components. Routes through the command registry * (so `list.search.*` and any other registered commands work). */ dispatch(commandId: CommandId, args?: Record): void; select(item: Element): void; selectMany(items: Iterable): void; deselect(item: Element): void; clearSelection(): void; selectAll(): void; /** The selection as stable `data-key` / `data-value` strings. */ get selectedKeys(): ReadonlySet; /** * Tags assigned by key, apart from the item data (like {@link partialKeys}): * tag name → keys carrying it. Each tag is mirrored on the row as `data-tags` * (`li[data-tags~="foo"]`); `tagBehaviour` can switch off selection, focus, * drag or search per tag. */ get tagKeys(): ItemTagKeys | undefined; set tagKeys(value: ItemTagKeys | undefined); /** * Interaction flags per tag name: `selectable`, `focusable`, `draggable`, * `searchable` (`false` switches one off; omitted keeps the default). With * several tags the most restrictive wins. Rows stay rendered. */ get tagBehaviour(): ItemTagBehaviour | undefined; set tagBehaviour(value: ItemTagBehaviour | undefined); /** Re-apply `data-tags` to the rows and refresh drag state. Called automatically on change and after each update. */ refreshTags(): void; /** * Rows shown as *partially* selected (a part of the resource is selected): * `data-partial`, an indeterminate checkbox in `checked` mode, and an * accessible description. Independent of `selectedKeys` — a key in both * counts as selected. Replace-on-set; keys without a row are kept for when * the row appears. */ get partialKeys(): ReadonlySet; set partialKeys(keys: Iterable); /** The key of the item under the cursor, or `undefined`. */ get tickledKey(): string | undefined; /** Replace the selection with the items carrying these keys (unknown keys ignored). */ selectKeys(keys: Iterable): void; /** Add items by key to the selection (multi-select modes only). */ addSelectedKeys(keys: Iterable): void; /** Remove items by key from the selection. */ removeSelectedKeys(keys: Iterable): void; /** * Move the cursor to the item with this key and scroll it into view. * Under virtualization the key's index is scrolled into the rendered * window first (a no-op for unknown keys). */ focusKey(key: string): void; /** The item carrying this `data-key`, or `undefined`. */ getItemByKey(key: string): Element | undefined; /** * Snapshot selection (the checked set in `checked` mode), keyboard cursor * and scroll as plain JSON keyed by `data-key` / `data-value`. Includes * pending state for keys not currently in the list. */ getViewState(options?: GetViewStateOptions): VerticalListViewState; /** * Apply saved view state. Fields present replace the current ones; keys * not in the list yet are applied as matching rows appear. */ setViewState(state: Partial): void; clearPendingViewState(): void; /** * Keys of items currently intersecting the viewport — for prioritising * viewport-first work (e.g. metadata/thumbnail fetches). A rect-intersection * test against the scroll container over the already-created rows (the same * cheap trick as `ixfx-detail-list.visibleKeys()`); hidden (filtered-out) * and keyless items are omitted. */ visibleKeys(): string[]; /** * Keys of the currently rendered window (viewport + overscan) — the * priority set for prefetching, mirroring `ixfx-grid-list.renderedKeys()`. * Use {@link visibleKeys} for the strict viewport intersection. Keyless * rows are omitted. Without virtualization, every visible row's key. */ renderedKeys(): string[]; selectedFilter(kind: `selected` | `checked` | `either`): Generator; /** * Get the source object behind a row built from `items`. Returns * `undefined` for declarative / programmatic elements. */ getItemData(item: Element): unknown; /** * Adapter mode: re-render the row carrying `key` in place — scroll and * selection are untouched. Unknown keys, and keys on rows not built from * `items`, are ignored. A no-op unless `items` is set. * * Rows whose formatter returns a full row element are swapped for the fresh * element; `
  • ` rows are refilled. (A custom-element row with a * non-element formatter result cannot be re-rendered in place and is left * alone — have the formatter return a replacement element instead.) */ updateItem(key: string, data: unknown): void; getUpdateComplete(): Promise; private _getVisibleItems; private _isCheckable; private _syncItemStates; private _syncCheckboxes; /** * Native checkbox cell: a span that stretches to the row's full cross-axis * (so the entire column height is a click target) with a real `` * centred inside. The span owns the click; the input is purely visual and * has `pointer-events:none` so a single click produces one toggle. */ private _createNativeCheckboxCell; /** * Custom checkbox cell: same shape as the native cell (a stretching span) * so behaviour is identical. The renderer's content goes inside. */ private _createCustomCheckbox; private _findListItem; private _dispatch; private _dispatchCancelable; private _onPointerOver; private _onPointerLeave; private _onKeyDown; private _onClick; private _onDblClick; private _activateItem; activateKey(key: string): void; private _onContextMenu; /** The key of the row being edited, if any. */ get editingKey(): string | undefined; /** * Edit a row's label in place with an `ixfx-editable-label`. The editor * replaces the row's `[data-edit-label]` element (else the whole row) and * the original content returns when editing ends. Fires `list-edit-commit` * `{ key, value }` when the text changed, otherwise `list-edit-cancel` * `{ key }` (Escape, an unchanged value, or one the label rejects). The list * never rewrites the label itself — update your data in response. * * Returns false when `editValidator` is not set, or the row is unknown or * not currently rendered. */ beginEdit(key: string): boolean; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-vertical-list': VerticalListElement; } interface HTMLElementEventMap extends VerticalListElementEventMap {} } interface VerticalListElementEventMap extends ListElementEventMap { 'vertical-list-viewport-change': ListViewportChangeEvent; 'list-native-drag-start': ListNativeDragStartEvent; 'list-drag-over': ListDragOverEvent; 'list-drop': ListTargetDropEvent; 'list-reorder': ListReorderEvent; 'list-drag-leave': ListDragLeaveEvent; 'list-context-menu': ListContextMenuEvent; 'list-edit-commit': ListEditCommitEvent; 'list-edit-cancel': ListEditCancelEvent; } export { LIST_ITEM_EFFECT_MAX_STEPS as _, VerticalListViewState as a, runListItemEffect as b, ListDragLeaveDetail as c, ListDropDetail as d, ListDropEvent as f, ListEditCommitEvent as g, ListEditCommitDetail as h, VerticalListElementEventMap as i, ListDragLeaveEvent as l, ListEditCancelEvent as m, CustomCheckboxOptions as n, ListContextMenuDetail as o, ListEditCancelDetail as p, VerticalListElement as r, ListContextMenuEvent as s, AddItemOptions as t, ListDragOverEvent as u, ListItemEffect as v, listItemEffectStyles as y };