import { i as ListGroupChangeEvent, n as ListGroupBy, o as ListGroupInfo, s as ListGroupLabel, u as ListGroupToggleEvent } from "./grouping-OoQ8WaKc.js"; import { a as ViewStateBase, t as GetViewStateOptions } from "./types-16GC5k1z.js"; import { h as ListSelectionMode, i as ListInteractionMode, p as ListSelectIntentSource, s as ListMarqueeMode, u as ListSelectIntentDetail } from "./list-selection-types-CKTt7Rrw.js"; import { a as ListDropTarget, c as ListReorderDetail, d as ListTargetDropDetail, f as ListTargetDropEvent, g as ItemTagKeys, i as ListDropPositions, l as ListReorderEvent, m as ItemTagBehaviour, n as ListCanReorder, o as ListFullOrder, r as ListDropBetween, s as ListReorderBlocked, t as ListCanDrop, u as ListResolveInternalDrag } from "./list-drop-types-Bye1r3Ub.js"; import "./list-native-drag-controller-BgGnS04E.js"; import { i as TickledItem, n as TickledController } from "./tickled-controller-B4Tql3HN.js"; import "./index-Cdcek1Oj.js"; import { H as ListNativeDragStartEvent, P as ListDragDataTransferWriter, R as ListDragPreviewRenderer, z as ListDragPreviewSourceResolver } from "./tree-component-BE7OEIiH.js"; import { S as ListSearchController } from "./index-C3N2TOmf.js"; import "./list-group-header.js"; import "./pan-text-DKe2zinH.js"; import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost, html } from "lit"; import { CommandRegistry } from "@clinth/ui-commands"; /** * Pure helpers for *pending* view state: keyed intent that is waiting for a * matching item to appear in the data. * * Pending sets / maps are insertion-ordered (oldest first) and capped so a * long-running app with churning data can't grow them without bound. */ /** Default cap on pending keys per facet. Oldest entries are dropped first. */ declare const MAX_PENDING_KEYS = 2000; type PendingKeys = ReadonlySet; type PendingFlags = ReadonlyMap; declare const EMPTY_KEYS: PendingKeys; declare const EMPTY_FLAGS: PendingFlags; /** * Split `keys` into those `has` reports present (to apply now) and those * still missing (to keep pending). Returns the input set untouched as * `missing` when nothing matched, so callers can cheaply detect "no change". */ declare function partitionKeys(keys: PendingKeys, has: (key: string) => boolean): { readonly present: readonly string[]; readonly missing: PendingKeys; }; /** As {@link partitionKeys}, for keyed boolean flags (e.g. expanded / collapsed). */ declare function partitionFlags(flags: PendingFlags, has: (key: string) => boolean): { readonly present: ReadonlyArray; readonly missing: PendingFlags; }; /** Keep at most `max` keys, dropping the oldest. */ declare function capKeys(keys: PendingKeys, max?: number): PendingKeys; /** Keep at most `max` flags, dropping the oldest. */ declare function capFlags(flags: PendingFlags, max?: number): PendingFlags; /** `flags` without `key` (same instance when absent). */ declare function withoutFlag(flags: PendingFlags, key: string): PendingFlags; /** JSON record → flags map. Non-boolean values are ignored. */ declare function flagsFromRecord(record: Readonly> | undefined): PendingFlags; /** * Combine pending and live flags into one JSON record. Live entries win when * a key is in both (it shouldn't be — matched keys leave pending). */ declare function flagsToRecord(...sources: Array>): Record; /** Pending keys followed by live keys, de-duplicated, as a JSON array. */ declare function keysToArray(...sources: Array>): string[]; /** Map `keys` to `true` flags — for components that record a plain key set. */ declare function keysAsFlags(keys: Iterable, value?: boolean): Iterable; /** Surface-relative rectangle: origin at the scroll container's top-left. */ type DragSelectRect = { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; type ListDragSelectControllerConfig = { /** Element the marquee is drawn in and pointer geometry is measured against. */ getSurface: () => HTMLElement | undefined; /** Is drag-select currently allowed? (multi-capable, has items, not disabled) */ isEnabled: () => boolean; /** Pointer types that may start a drag. Default ['mouse', 'pen'] — touch still scrolls. */ pointerTypes?: readonly string[]; /** Movement in px before a press becomes a drag. Default 4. */ threshold?: number; /** Map a surface-relative rect to covered items. */ hitTest: (rect: DragSelectRect) => Iterable; /** * Selection snapshotted when the drag starts, combined with the hit set * while modifiers are held: Shift adds (`base + hit`), Cmd / Ctrl inverts * (covered items toggle, the rest is untouched). */ getBaseSelection: () => ReadonlySet; /** Continuous visual feedback: the preview set + current rect (undefined when idle). */ onPreview: (preview: ReadonlySet, rect: DragSelectRect | undefined) => void; /** * Fired once on release with the final set. Host applies it to its * selection. `additive` is `true` when the drag ran with Shift (add) or * Cmd / Ctrl (invert) held. `covered` is the set the marquee itself hit, * before combining with the base selection. */ onCommit: (finalSet: ReadonlySet, info: { additive: boolean; covered: ReadonlySet; mode: ListMarqueeMode; }) => void; /** Optional: scroll the surface when the pointer nears an edge during a drag. */ autoScroll?: (dx: number, dy: number) => void; /** * Optional predicate called on pointerdown before the controller records its * pointer id or later calls setPointerCapture/preventDefault. Return false * to yield to another gesture (e.g. native item drag). */ shouldStart?: (event: PointerEvent) => boolean; }; type DragHost$1 = ReactiveControllerHost & HTMLElement; /** * Shared pointer-drag (marquee / rubber-band) selection for list components. * * Owns all pointer plumbing and rectangle state; knows nothing about DOM * geometry or the selection model — those are host callbacks. Mirrors the * `TickledController` attach pattern (`new ListDragSelectController(this, …)`). * * Behaviour: `pointerdown` on the surface records a start point; once the * pointer moves past `threshold`, the surface captures the pointer and every * move recomputes the rect, hit-tests, and calls `onPreview`. On release the * final set is delivered once via `onCommit`. A press that never crosses the * threshold does nothing (the normal `@click` path runs). */ declare class ListDragSelectController implements ReactiveController { #private; constructor(host: DragHost$1, config: ListDragSelectControllerConfig); /** `true` while a drag is in progress or its trailing click is still pending. */ get isDragging(): boolean; /** `true` once the press has crossed the threshold and a rect is live. */ get isActive(): boolean; hostConnected(): void; hostDisconnected(): void; /** Re-bind when the surface element appears/changes (e.g. first render). */ hostUpdated(): void; } /** * Pure drop-target resolution for the list components. Nothing here touches the DOM, so every * rule (which gap, which neighbours, what is a no-op, where the moved block lands) is unit-tested * directly; the components only supply geometry. */ /** Which side of an item a pointer resolved to, or `on` the item itself. */ type ListDropSide = `before` | `after` | `on`; /** Share of an item, at each end of the flow axis, that means `between` when `positions` is `both`. */ declare const BETWEEN_BAND = 0.25; /** * Pick the side of an item for a pointer `frac` (0…1) along the flow axis. * * `accepts` is the host's veto (`canDrop` / `canReorder`). With `both`, a refused side hands the whole * item to the other: refuse `on` and `between` takes both halves; refuse the `between` side the pointer * is in and `on` takes it. */ declare function resolveSide(frac: number, positions: ListDropPositions, accepts?: (side: ListDropSide) => boolean): ListDropSide | undefined; /** * The gap directly after `afterKey` (`undefined` ⇒ the start of the list), in full item order. * `undefined` when `afterKey` isn't an item. */ declare function betweenAfter(afterKey: string | undefined, order: ListFullOrder): ListDropBetween | undefined; /** Visible (effective-order) items, as the pointer sees them. */ type ListVisibleOrder = { readonly count: number; keyAt: (index: number) => string | undefined; }; /** * Build the target for `side` of the visible item at `visibleIndex`. * * `before` item *i* is the gap after visible item *i − 1* — the same gap as `after` item *i − 1*, so a * row or column wrap reports one target. Hidden (filtered) items are skipped: the drop goes directly * after the visible item before the gap. */ declare function targetForSide(side: ListDropSide, visibleIndex: number, visible: ListVisibleOrder, order: ListFullOrder): ListDropTarget | undefined; /** * Whether moving `keys` to the gap `target` would leave the order unchanged: the gap is inside the * block or right next to it. A block that isn't contiguous always changes the order (it gets gathered). */ declare function isNoopReorder(keys: readonly string[], target: ListDropBetween, order: ListFullOrder): boolean; /** What a pointer is over, from the component's geometry. */ type ListDropHit = { readonly kind: `item`; readonly index: number; readonly frac: number; } | /** Past the last item, or in blank space (also an empty list). */ { readonly kind: `end`; } | /** Over something that isn't a target (e.g. a group header). */ { readonly kind: `none`; }; /** Where the indicator goes: a side of the visible item at `index` (`end`/empty lists anchor to the edge). */ type ListDropAnchor = { readonly index: number; readonly side: ListDropSide; }; type ListDropResolution = { readonly target: ListDropTarget; readonly anchor: ListDropAnchor | undefined; }; type ResolveListDropInput = { readonly hit: ListDropHit; /** Targets this drag may resolve to. */ readonly positions: ListDropPositions; /** `false` when the order isn't meaningful (sorted / grouped): `between` is refused. */ readonly betweenAllowed: boolean; readonly visible: ListVisibleOrder; readonly order: ListFullOrder; /** The dragged block for an internal drag (reorderable keys, display order). */ readonly dragged?: readonly string[] | undefined; /** Host veto, applied to the candidate target. */ readonly accepts?: ((target: ListDropTarget) => boolean) | undefined; }; /** * Resolve a hit to a drop target (and where to draw the indicator), or `undefined` when nothing may be * dropped there: a refused target, `between` while the order isn't meaningful, or an internal move * that changes nothing. */ declare function resolveListDrop(input: ResolveListDropInput): ListDropResolution | undefined; /** * Apply a `list-reorder` to the host's items: the dragged block moves, in its existing relative order, to * the gap `detail.target` names. Pure — returns a new array, never mutates, never throws; an unresolvable * detail (unknown keys, a gap that no longer exists) returns an unchanged copy. * * `target.index` counts positions in `items` **before** the block is lifted out, so the off-by-one when * the block moves down is handled here, once. If `items` no longer matches the index (stale detail), the * gap is re-found from `afterKey` / `beforeKey`. */ declare function applyListReorder(items: readonly T[], keyOf: (item: T) => string, detail: ListReorderDetail): T[]; /** Where to draw the insertion indicator, in viewport (client) pixels. */ type ListDropIndicatorBox = { /** `vertical`: a caret between cells (`x` is the gap's centre). `horizontal`: a line between rows (`y` is its centre). */ readonly orientation: `vertical` | `horizontal`; /** Gap centre on the cross axis of the line: `x` for vertical, `y` for horizontal. */ readonly at: number; /** Where the line starts along its own axis: `y` for vertical, `x` for horizontal. */ readonly from: number; readonly length: number; }; /** What the controller currently resolves the drag to. */ type ListDropState = { readonly target: ListDropTarget; readonly anchor: ListDropAnchor | undefined; /** The drag started in this list (so `between` is a reorder). */ readonly internal: boolean; }; type ListDropControllerConfig = { /** `items-droppable`: items and empty space accept drops. */ isDroppable: () => boolean; /** `items-reorderable`: a drag that starts here and ends between its own items is a reorder. */ isReorderable: () => boolean; getPositions: () => ListDropPositions; /** Why `between` is refused (sorted / grouped), if it is. */ getBlocked: () => ListReorderBlocked | undefined; /** The full, unfiltered item order. */ getFullOrder: () => ListFullOrder; /** The visible (effective) item order. */ getVisibleOrder: () => ListVisibleOrder; /** * Map a pointer (viewport coordinates) to what is under it, from layout geometry — not from rendered * elements, so a gap whose neighbours are off-screen can still be targeted. `event` is the drag event * being handled (`undefined` when re-resolving after a scroll, for a pointer that hasn't moved). */ hitTest: (clientX: number, clientY: number, event?: DragEvent) => ListDropHit; /** Where to draw the indicator for `anchor`, in viewport coordinates. `undefined` ⇒ not drawable. */ indicatorBox: (anchor: ListDropAnchor) => ListDropIndicatorBox | undefined; /** The scroll container, for edge auto-scroll. */ getScroller: () => HTMLElement | undefined; /** The axis the list scrolls along. */ scrollAxis: () => `x` | `y`; getCanDrop: () => ListCanDrop | undefined; getCanReorder: () => ListCanReorder | undefined; getResolveInternalDrag: () => ListResolveInternalDrag | undefined; /** `false` ⇒ the item can't be moved by a reorder (`tagBehaviour.reorderable: false`). */ isKeyReorderable?: (key: string) => boolean; /** Skip events that belong to something else (e.g. an inline editor). */ shouldIgnore?: (event: DragEvent) => boolean; /** * Optional last word on a resolved target, per `dragover` (e.g. a cancelable `list-drag-over`). * Return `false` to refuse. `reorder` is `true` for an internal move between items. */ onDragOver?: (target: ListDropTarget, dataTransfer: DataTransfer, reorder: boolean) => boolean; /** An external drag (or an internal drop on an item) landed. */ onDrop: (detail: ListTargetDropDetail) => void; /** An internal drag landed between its own items. Return `false` if the host cancelled the event. */ onReorder: (detail: ListReorderDetail) => boolean; /** The resolved target changed (`undefined` ⇒ the drag left or was refused). */ onStateChange?: (state: ListDropState | undefined, previous: ListDropState | undefined) => void; /** The drag left the list without dropping. */ onLeave?: () => void; }; type DragHost = ReactiveControllerHost & HTMLElement; /** * Shared positional-drop handling for the list components. * * Listens for `dragenter` / `dragover` / `dragleave` / `drop` on the host; resolves the pointer to a * {@link ListDropTarget} (`on` / `between` / `empty`) through the component's layout geometry; draws * the insertion indicator; edge-auto-scrolls and re-resolves for the still pointer after each scroll; * and reports either `list-drop` (external) or `list-reorder` (the drag started here). * * The controller never reorders anything — the host owns the order. */ declare class ListDropController implements ReactiveController { #private; constructor(host: DragHost, config: ListDropControllerConfig); /** What the drag currently resolves to, or `undefined` when nothing would be dropped. */ get state(): ListDropState | undefined; /** The key a drag is over, when it resolved to `on`. */ get onKey(): string | undefined; /** `true` while a drag is over the list and being handled. */ get isActive(): boolean; /** * Record the keys of a drag that started in this list (display order), or `undefined` once it ended. * The keys are held here, so they survive their cells being recycled or scrolled out. */ setInternalDrag(keys: readonly string[] | undefined): void; hostConnected(): void; hostDisconnected(): void; /** Re-resolve for the last pointer position — call after anything that moves cells under a still pointer. */ refresh(): void; } /** Modifier state needed to route a click gesture per interaction mode. */ type ListSelectionGesture = { readonly ctrlKey: boolean; readonly metaKey: boolean; readonly shiftKey: boolean; /** `PointerEvent.pointerType`, when known; a `touch` tap reports source `touch`. */ readonly pointerType?: string; }; /** Capture the modifier / pointer-type state of a click for `handleClick`. */ declare function gestureOf(e: MouseEvent): ListSelectionGesture; type ListSelectionModes = { readonly selectionMode: ListSelectionMode; readonly interactionMode: ListInteractionMode; }; /** * Configuration supplied by the host component. * * The controller owns selection *state* only — everything DOM- or * component-specific is expressed through these callbacks. */ type ListSelectionControllerConfig = { /** Visible items in navigation order — used for range selection and select-all. */ readonly getOrderedItems: () => readonly T[]; /** Whether an item may join the selection (e.g. reject `not-checked` rows). */ readonly isSelectable: (item: T) => boolean; /** Current modes; read on every gesture so property changes apply immediately. */ readonly getModes: () => ListSelectionModes; /** * Fired after every selection change. The host syncs DOM state * (`data-selected` / `data-checked`), dispatches `list-select`, and * requests an update. */ readonly onChange: (selected: ReadonlySet, previous: ReadonlySet) => void; /** * Optional: called with the intent behind a gesture (or `selectAll()`) * before the selection changes. Return `true` when the caller took over * (`preventDefault()`); the controller then leaves the selection alone but * still moves the range anchor. */ readonly onIntent?: (intent: ListSelectIntentDetail) => boolean; /** * Optional: derive a stable string key for an item. Enables `selectedKeys` * and `selectKeys()`. When omitted, `selectedKeys` is always empty. */ readonly getKey?: (item: T) => string | undefined; /** * Optional: the group an item belongs to (`null` when ungrouped or the item * cannot be resolved). With this set and `crossGroupSelection` off, gestures * are confined to a single group — same rules as `ixfx-data-grid` and * `ixfx-grouped-item-lister`. Programmatic key APIs are never clamped. */ readonly getGroupKey?: (item: T) => string | null; /** Whether selection may span groups. Read on every gesture; defaults to `false`. */ readonly crossGroupSelection?: () => boolean; /** Group used by `selectAll` when there is no anchor (e.g. the cursor's group). */ readonly getFallbackGroupKey?: () => string | null; }; /** Whether the interaction mode allows building a multi-item selection. */ declare function isMultiMode(mode: ListInteractionMode): boolean; /** * Generic selection state machine shared by list components. * * Owns the selected set plus the range-selection anchor, the selection * primitives (`replace` / `toggle` / `rangeTo` / `clear` / `selectAll` / * `selectMany` / `deselect`) and the per-interactionMode gesture routers * (`handleClick` / `handleSpace`). * * Identity is generic: both `ixfx-vertical-list` and `ixfx-detail-list` use * `ListSelectionController`. * * @example * ```ts * const selection = new ListSelectionController({ * getOrderedItems: () => this.getVisibleItems(), * isSelectable: el => !el.hasAttribute(`not-checked`), * getModes: () => ({ selectionMode: this.selectionMode, interactionMode: this.interactionMode }), * onChange: (selected, previous) => { * this.syncItemStates(); * this.dispatchEvent(new CustomEvent(`list-select`, { detail: { selected, previous } })); * }, * }); * ``` */ declare class ListSelectionController { #private; constructor(config: ListSelectionControllerConfig); /** The current selection set (read-only). */ get selected(): ReadonlySet; /** * The current selection as stable string keys (read-only). Empty unless a * `getKey` was supplied in config. Items whose `getKey` returns `undefined` * are omitted. */ get selectedKeys(): ReadonlySet; /** Anchor for range (shift) selection — the last plainly-selected item. */ get anchor(): T | undefined; /** Whether "select all" (Cmd/Ctrl+A) is currently permitted. */ canSelectAll(): boolean; /** Whether a multi-item selection can be built in the current modes. */ canSelectMultiple(): boolean; /** Replace the entire selection with a single item; updates the anchor. */ replace(item: T): void; /** Toggle a single item in/out of the selection without replacing it. Anchor unchanged. */ toggle(item: T): void; /** Select the contiguous ordered range from the anchor to `item`. Anchor unchanged. */ rangeTo(item: T): void; /** Clear the selection. No change event when the selection is already empty. */ clear(): void; /** * Select every ordered item that passes `isSelectable`. Fires an `all` * intent first; the caller may take over. */ selectAll(source?: ListSelectIntentSource): void; /** * Replace the selection with many items at once. Requires * `selectionMode="multiple"`, throws otherwise. Updates the anchor. */ selectMany(items: Iterable): void; /** * Whether a drag / marquee gesture may build a selection in the current * modes: `selectionMode="multiple"`, or a multi interaction mode * (`checked` / `sticky` / `vscode`) outside `selectionMode="none"`. * Stricter than `canSelectMultiple()` — `single` + `standard` does not * qualify (a drag there would be a surprising multi-select). */ canDragSelect(): boolean; /** * Replace the selection with `items` from a drag / marquee gesture. Like * `selectMany` but gated on `canDragSelect()` instead of throwing, and a * no-op in single/none modes. Non-selectable items are dropped; the anchor * moves to the last item. Fires `onChange` once. An empty result clears a * non-empty selection (e.g. a Cmd-drag that toggles everything off) but is * a no-op when nothing is selected. */ applyDragSelection(items: Iterable, info?: { additive: boolean; covered: Iterable; mode?: ListMarqueeMode; }): void; /** Remove a single item from the selection. */ deselect(item: T): void; /** * Replace the selection with the items resolved from `keys`. Keys that * `resolve` cannot map yet are kept pending and selected when their items * appear (see `resolvePending()`); keys that resolve to a non-selectable * item are ignored. `selectionMode="none"` is a no-op. When multi-select is * not available, only the last key is kept. `onChange` fires once. */ selectKeys(keys: Iterable, resolve: (key: string) => T | undefined): void; /** * Add the items resolved from `keys` to the selection (multi-select only; * a no-op otherwise). Keys not present yet are kept pending. `onChange` * fires once if anything changed. */ addKeys(keys: Iterable, resolve: (key: string) => T | undefined): void; /** * Remove the items resolved from `keys` from the selection, and drop them * from the pending keys. `onChange` fires once if anything changed. */ removeKeys(keys: Iterable, resolve: (key: string) => T | undefined): void; /** Selected keys waiting for their items to appear. */ get pendingKeys(): PendingKeys; /** * Restore a selection by key: keys that resolve are selected now (one * `onChange`), the rest are kept pending for `resolvePending()`. Replaces * any previous selection and pending keys. Unlike `selectKeys`, this works * in `selectionMode="none"` only to the extent of holding keys pending. */ restoreKeys(keys: Iterable, resolve: (key: string) => T | undefined): void; /** * Select pending keys whose items now resolve (call after items are added * or rebuilt). Fires `onChange` once when anything was selected; returns * whether it did. */ resolvePending(resolve: (key: string) => T | undefined): boolean; /** * Silently deselect `items` that left the data, keeping their keys pending * so they are re-selected if the same keys come back (data reset, re-fetch). * No `onChange`; returns whether the selection changed. */ demote(items: Iterable): boolean; /** Drop pending keys without touching the live selection. */ clearPending(): void; /** * Route a click on `item` according to the current interaction mode. In * `manual` mode nothing is selected, but the intent is still reported so * the caller can apply it. */ handleClick(item: T, gesture: ListSelectionGesture): void; /** Route a Space keypress on `item` according to the current interaction mode. */ handleSpace(item: T): void; /** Route a checkbox (checked-mode) toggle on `item`. */ handleCheckbox(item: T, source?: ListSelectIntentSource): void; /** Route a plain "select only this" gesture (Enter, double-click) on `item`. */ handleReplace(item: T, source?: ListSelectIntentSource): void; /** Route Shift+Arrow: extend the range from the anchor to the cursor `item`. */ handleExtend(item: T): void; /** * Route a keyboard cursor move that has just landed on `item`, according to * the current interaction mode: * * - `implicit`: the selection follows the cursor (replace). * - `standard`: a plain move replaces the selection with the item under the * cursor; Shift+move grows it from the anchor (a plain replace when the * modes can't hold more than one item). * - `vscode` / `manual`: a plain move leaves the selection alone; * Shift+move extends from the anchor. * - `checked` / `sticky`: the cursor never changes the selection. */ handleCursorMove(item: T, shiftKey: boolean): void; /** * Route Escape / empty-space click: clear the selection. `reportOnly` * suppresses the default action in `manual` mode (the caller owns it). */ handleClear(source?: ListSelectIntentSource, reportOnly?: boolean): void; /** Drop the range-selection anchor (e.g. when the interaction mode changes). */ clearAnchor(): void; /** * Re-key the selection across an identity boundary — e.g. when items are * wrapped/unwrapped and the selected Element references change. Silent: * no `onChange` is fired. */ remap(fn: (item: T) => T): void; /** * Hard reset: empty the selection and clear the anchor without firing * `onChange` (e.g. when all items are removed). Keyed selected items become * pending, so a rebuilt item set re-selects them via `resolvePending()`. */ reset(): void; /** * Replace the selection and anchor silently (no `onChange`). Used to * re-key the selection when items are rebuilt from data — e.g. matching * new elements to previously selected keys. */ seed(items: Iterable, anchor?: T): void; } type TreeKeyboardNavItemId = string; type TreeKeyboardNavCallbacks = { getItems: () => ReadonlyArray>; onExpand: (id: TreeKeyboardNavItemId) => void; onCollapse: (id: TreeKeyboardNavItemId) => void; onActivate: (id: TreeKeyboardNavItemId) => void; onSelect?: (id: TreeKeyboardNavItemId) => void; onEscape?: () => void; isLeaf: (id: TreeKeyboardNavItemId) => boolean; isExpanded: (id: TreeKeyboardNavItemId) => boolean; getParentId?: (id: TreeKeyboardNavItemId) => TreeKeyboardNavItemId | undefined; }; type TreeKeyboardNavControllerConfig = { callbacks: TreeKeyboardNavCallbacks; disableKeyboardNavigation?: () => boolean; }; declare class TreeKeyboardNavController implements ReactiveController { #private; private host; private tickled; private callbacks; private disableKeyboardNavigation; constructor(host: ReactiveControllerHost, tickled: TickledController, config: TreeKeyboardNavControllerConfig); hostConnected(): void; hostDisconnected(): void; handleKeyDown: (event: KeyboardEvent) => void; } /** * Adapter for data-backed grid list mode. * @param T The type of data item. */ type GridListDataAdapter = { key: (item: T, index: number) => string; label?: (item: T, index: number) => string; render: (item: T, index: number) => unknown; disabled?: (item: T, index: number) => boolean; /** * Caller-assigned tags for the item (`undefined` ⇒ none). Each tag is exposed as a * `tag-` token in the cell's `part` and in `data-tags`; `tagBehaviour` can * switch off selection, focus, drag or search per tag. Re-read on every render, so * `updateItem` / `updateItems` pick up changes. */ tags?: (item: T, index: number) => readonly string[] | undefined; searchableText?: (item: T, index: number) => string; /** * Per-item icon, rendered above `render`'s output inside the cell's content * well. Anything Lit can render — a `TemplateResult` (e.g. * `html```), a DOM `Node`, or a string. * Return `undefined` for items without an icon. */ icon?: (item: T, index: number) => unknown; /** * CSS colour applied to this item's icon, tinting any `currentColor` glyph. * Ignored when `icon` returns nothing. Inline, so it wins over selection * styling. */ iconColor?: (item: T, index: number) => string | undefined; /** * CSS colour applied to this item's caption. Inline, so it wins over the * selected/tickled caption colours — keep it legible against both. */ textColor?: (item: T, index: number) => string | undefined; /** * Finder-style badge rendered inline at the head of the caption, before the * filename — anything Lit can render, e.g. a colour-tag chip as inline SVG. */ badge?: (item: T, index: number) => unknown; }; /** * One entry of a batched item update — see `GridListElement.updateItems`. * * @typeParam T The type of data item. */ type GridListItemUpdate = { /** Key of the item to replace. Unknown keys are ignored. */ readonly key: string; /** The new value for that item. */ readonly item: T; }; /** * Common detail for per-item events (activate, click, tickle), key-first in * BOTH element and data modes. `item` is the backward-compat field — Element in * element mode, T in data mode. */ type GridListItemEventDetail = { readonly key: string; readonly index: number; readonly item: T | Element; readonly element: Element | undefined; }; /** * How the caption relates to the cell's content. * - `hidden`: no caption is rendered. * - `separate`: content sits in a square; the caption is a detached label * below it. Square and caption are highlighted separately, like macOS * Finder icon view. * - `under` (default): the whole cell is one box — content on top, caption in * its own strip below it, inside the same box. One selection outline. * - `overlaid`: the caption floats on top of the content (see * `GridListCaptionPosition` / `GridListCaptionBackdrop`). */ type GridListCaptionStyle = `hidden` | `separate` | `under` | `overlaid`; /** Horizontal alignment of caption text (`middle` is the default). */ type GridListCaptionAlign = `left` | `middle` | `right`; /** Vertical placement of an `overlaid` caption (`bottom` is the default). */ type GridListCaptionPosition = `top` | `middle` | `bottom`; /** * Backdrop behind an `overlaid` caption. * - `scrim` (default): flat translucent panel. * - `gradient`: translucent gradient fading away from the caption edge. * - `blur`: frosted / backdrop-blurred panel. * - `none`: no panel — caption text only, with a shadow for legibility. */ type GridListCaptionBackdrop = `scrim` | `gradient` | `blur` | `none`; /** * Layout / scroll direction. * - `grid` (default): items wrap across as many columns as fit and the list * scrolls vertically. * - `row`: a single row of items that scrolls horizontally. * - `column`: a single column of items that scrolls vertically. */ type GridListOrientation = `grid` | `row` | `column`; interface GridListSelectDetail { readonly selected: ReadonlySet; readonly previous: ReadonlySet; readonly selectedKeys: ReadonlySet; readonly previousKeys: ReadonlySet; } type GridListSelectEvent = CustomEvent; /** * `item` is the backward-compatible field: the light-DOM `Element` in element * mode, the data value `T` in data mode. Use `element` when you specifically * need the DOM node (`undefined` in data mode). `key` / `index` are the stable * contract in both modes. */ interface GridListActivateDetail { readonly item: unknown; readonly key: string; readonly index: number; readonly element: Element | undefined; } type GridListActivateEvent = CustomEvent; interface GridListItemClickDetail { readonly item: unknown; readonly key: string; readonly index: number; readonly element: Element | undefined; } type GridListItemClickEvent = CustomEvent; interface GridListTickleDetail { readonly item: unknown; readonly key: string; readonly index: number; readonly element: Element | undefined; } type GridListTickleEvent = CustomEvent; interface GridListElementEventMap { 'list-drop': ListTargetDropEvent; 'list-reorder': ListReorderEvent; 'list-select': GridListSelectEvent; 'list-activate': GridListActivateEvent; 'list-item-click': GridListItemClickEvent; 'list-tickle': GridListTickleEvent; 'list-group-toggle': ListGroupToggleEvent; 'list-group-change': ListGroupChangeEvent; } type GridListViewportChangeDetail = { readonly renderedKeys: string[]; readonly visibleKeys: string[]; }; type GridListViewportChangeEvent = CustomEvent; interface GridListFullElementEventMap extends GridListElementEventMap { 'grid-list-viewport-change': GridListViewportChangeEvent; 'list-native-drag-start': ListNativeDragStartEvent; } /** * Pure view-state helpers for `ixfx-grid-list`. The component runs * {@link reconcileGroups} whenever its item set or grouping changes, so a * group's collapsed state survives the group disappearing (data reset, * filter, streaming) and comes back when the group does. Scroll is captured * and restored arithmetically from the virtual layout, along the main axis * (`scrollLeft` in `row` orientation, `scrollTop` otherwise). */ /** * `ixfx-grid-list` view state. All fields are the shared base fields: * `selected` (item keys), `focus` (keyboard cursor key), `scroll`, and * `expanded` (group key → open; groups default open, so only `false` entries * are ever recorded). */ type GridListViewState = ViewStateBase; declare class GridListElement extends LitElement { #private; static styles: import("lit").CSSResult[]; selectionMode: ListSelectionMode; interactionMode: ListInteractionMode; /** * Disable hover tickling: pointer hover no longer moves the cursor, fires * `list-tickle`, or changes where keyboard navigation resumes from. Keyboard * navigation, selection, and `focusKey()` are unaffected. */ disableHoverTickle: boolean; /** * Let hover follow cells that scroll beneath a stationary pointer. Off by * default: with virtualisation, a wheel / trackpad gesture replaces the cell * beneath the pointer, and following its `pointerenter` would move the * cursor and emit `list-tickle` even though the pointer never moved. While a * scroll gesture is active those enters are ignored and the host carries a * `data-scroll-hover-suppress` attribute that gates the CSS `:hover` * highlight, so the visual cursor holds still too. Hover resumes on the next * real pointer movement, or after the pointer leaves the list. Click * selection, keyboard navigation, and `focusKey()` are unaffected. */ scrollHoverTickle: boolean; itemSize: number; gap: number; /** * Layout / scroll direction. * - `grid` (default): items wrap across as many columns as fit, scrolls vertically. * - `row`: a single row of items, scrolls horizontally. * - `column`: a single column of items, scrolls vertically. */ orientation: GridListOrientation; /** * How the caption relates to the content — see {@link GridListCaptionStyle}. * - `hidden`: no caption. * - `separate`: detached label below the square, each highlighted on its own. * - `under` (default): one box, content on top, caption strip below it inside. * - `overlaid`: caption floats over the content. */ captionStyle: GridListCaptionStyle; /** Horizontal alignment of the caption text: `left`, `middle` (default), `right`. */ captionAlign: GridListCaptionAlign; /** Vertical placement of caption: `top`, `middle` (default), `bottom`. `middle` only has effect for `overlaid` style. */ captionPosition: GridListCaptionPosition; /** `overlaid` only — backdrop behind the caption: `scrim` (default), `gradient`, `blur`, `none`. */ captionBackdrop: GridListCaptionBackdrop; /** * Height reserved for the caption in `separate` / `under` styles, in pixels. * Ignored by `overlaid` and `hidden`. */ captionHeight: number; itemWrap: `stop` | `wrap`; /** * Element-mode filter predicate (also driven by incremental filter-search). * Light-DOM items for which it returns `false` are removed from layout and * navigation. For data mode use {@link itemFilterPredicate}. */ filterPredicate: ((el: Element) => boolean) | undefined; /** * Data-mode filter predicate. Items for which it returns `false` are removed * from layout and navigation without any element being materialised. */ itemFilterPredicate: ((item: T, index: number) => boolean) | undefined; /** * Space-separated subset of `navigate select filter` — limits which * incremental-search modes are offered (as commands and in-popover switches). * Unset ⇒ all three; empty ⇒ search disabled. See `docs/infra-incremental.md`. */ /** * Enable native browser drag-and-drop for selectable items. When true, * selectable cells become draggable and the grid emits * `list-native-drag-start` when a drag begins. */ itemsDraggable: boolean; /** * Items and the empty space around them accept native drops: `list-drop` fires with the resolved * {@link ListDropTarget}. A drag that starts in this list is a reorder instead (see `itemsReorderable`) * when it lands between items. */ itemsDroppable: boolean; /** * Which targets a drag can resolve to: onto an item (`on`), into the gap between two items (`between`), * or both (`both`: the outer quarters of a cell, along the flow axis, mean `between`; the middle half * means `on`). Gaps follow the flow axis: left / right of a cell in `grid` and `row`, above / below in `column`. */ dropPositions: ListDropPositions; /** * A drag that starts in this list and ends between its own items is a **reorder** (`list-reorder`), not * a drop. Implies `items-draggable`, and `between` targets for internal drags. The grid never reorders * its own items — the host owns the order (see `applyListReorder`). */ itemsReorderable: boolean; /** * Sync gate on every `dragover`, given the resolved target. `false` ⇒ no indicator and no event. * Not consulted for `between` targets of an internal move — see {@link canReorder}. */ canDrop: ListCanDrop | undefined; /** Sync gate for internal moves: e.g. only some items may move, or nothing may go above a pinned item. */ 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. Items grouped by `groupBy` have no * single order to insert into; `on` drops still work. */ get reorderBlocked(): ListReorderBlocked | undefined; /** * Allow a marquee (region) selection to start from a cell's blank well area — * a press that lands on the cell's content container (`.content` / `.thumb`) * itself rather than on the item content, caption, or an interactive control. * The same press is prevented from starting the cell's native drag. * * Off by default. The consumer must ensure blank areas are not covered by * pointer-eventful slotted nodes (size content to its box and/or set * `pointer-events: none` on filler), otherwise the blank area still counts as * content and this has no effect. */ marqueeFromCellBlank: boolean; /** * Custom drag preview renderer. Receives the selection snapshot and returns * an element for `DataTransfer.setDragImage()` plus an optional pre-painted * canvas for native hosts. Synchronous by contract — pre-decode thumbnails * as selection changes. Defaults to the shared built-in 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; /** * Optional synchronous resolver that supplies an already-loaded * `CanvasImageSource` for each drag entry's preview thumbnail. * * Called before the default descendant-`` lookup. Must return an * already-decoded image (e.g. ``, ``, `