import { r as IDataProvider } from "./data-provider-Cq_ylpET.js"; import { a as ListGroupEventMap, o as ListGroupInfo, s as ListGroupLabel } from "./grouping-OoQ8WaKc.js"; import { 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, s as ViewStateChangeEvent, 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 { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-DPWHc6w1.js"; import { S as ListSearchController } from "./index-C3N2TOmf.js"; import "./icon-YIyJDwM9.js"; import "./list-group-header.js"; import { LitElement, PropertyValues } from "lit"; import { CommandId, CommandRegistry } from "@clinth/ui-commands"; /** * Pure helpers behind `ixfx-detail-list`'s view state (see * `docs/infra-view-state.md`). The component keeps only the wiring. * * - `selected` — selected item keys (in `checked` mode, the checked set: * `data-checked` is derived from the selection, not stored separately). * - `expanded` — `{ [groupKey]: false }` for collapsed groups. Groups default * open, so only collapses are recorded; `true` re-opens. * - `focus` — keyboard-cursor key. * - `scroll` — horizontal: `left` plus an anchor on the top item of the first * visible column. */ type DetailListViewState = ViewStateBase; /** Sort direction applied to the item columns. */ type DetailSortMode = `none` | `ascending` | `descending`; /** Per-item view of a row passed to `sortComparator`. */ type DetailSortItem = { readonly element: HTMLElement; readonly data: unknown; readonly label: string; }; /** Custom comparator — return negative when `a` sorts before `b`. */ type DetailSortComparator = (a: DetailSortItem, b: DetailSortItem) => number; /** Turns one object item into row content — a plain string or a DOM node. */ type DetailFormatter = (item: unknown, index: number) => string | Node; /** * How a detail list derives an item's group key: a property name (object * items) or `data-` attribute, or a function of the item's data (`undefined` * for declarative rows) and its `
  • ` element. */ type DetailGroupBy = string | ((data: unknown, el: Element) => string); /** * A list that scales horizontally, not vertically. * * Items are laid out in equal-width columns; they flow top→bottom down a * column, then wrap to the top of the next column to the right. The * component has a fixed vertical extent and scrolls horizontally. * * Selection semantics match `ixfx-vertical-list` — same modes, same * `list-*` events, same keyboard gestures — but navigation is a 2-D grid * (Up/Down move within a column, Left/Right jump columns). * * Items come from any of three sources (later writes win): * 1. declarative `
  • ` children in light DOM, * 2. `addItem()` / `setItems()`, * 3. an `items` array of objects rendered via `displayProperty` / * `formatter`, optionally streamed in via a `provider`. */ declare class DetailListElement extends LitElement { #private; selectionMode: ListSelectionMode; interactionMode: ListInteractionMode; sort: DetailSortMode; sortBy: string; sortComparator: DetailSortComparator | undefined; items: readonly unknown[]; provider: IDataProvider | undefined; displayProperty: string; formatter: DetailFormatter | undefined; /** * Text incremental search matches for an object item. Defaults to the * caption when it is a string (`displayProperty` or a string `formatter`), * else the row's whole text — set this when `formatter` returns a `Node` * carrying more than the name (sublines, sizes, dates). */ searchText: ((item: unknown, index: number) => string) | undefined; iconProperty: string; /** * Property on each `items` entry holding a CSS colour for the item's * ``. Only read when `iconProperty` also resolves an icon. */ iconColorProperty: string; /** * Property on each `items` entry holding a CSS colour for the item's caption * text. Inline, so it wins over the selected/tickled text colours. */ textColorProperty: string; /** * Property on each `items` entry holding a Finder-style badge — a * `TemplateResult`, a DOM `Node`, or anything Lit can render. Rendered * right-justified on the row, after the caption. */ badgeProperty: string; keyProperty: string; /** * Caller-assigned tags for an object item (`undefined` ⇒ none). Each tag is * mirrored on the row as `data-tags` (style with `li[data-tags~="foo"]`), and * `tagBehaviour` can switch off selection, focus, drag or search per tag. * Re-evaluated when `items`, `tags`, `tagKeys` or `tagBehaviour` change, or on * {@link refreshTags}. */ tags: ((item: unknown, index: number) => readonly string[] | undefined) | undefined; /** * Tags assigned by key, apart from the item data (like `partialKeys`): * tag name → keys carrying it. Merged with the `tags` hook; works for * declarative rows too. */ 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 and keep their * place in layout. */ get tagBehaviour(): ItemTagBehaviour | undefined; set tagBehaviour(value: ItemTagBehaviour | undefined); /** Re-evaluate every row's tags (call after mutating data the `tags` hook reads). */ refreshTags(): void; 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. */ 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; /** * Items and the empty space around them accept native drops: `list-drop` fires with the resolved * `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 top and bottom quarter of a row mean `between`, the middle half * means `on`). Items flow down a column, so the gap is drawn as a line within the 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 list never * reorders its own items — the host owns the order (see `applyListReorder`). Refused while the list * is sorted (`sort`) or grouped (`groupBy`): see {@link reorderBlocked}. */ itemsReorderable: boolean; /** Sync gate on every `dragover`, given the resolved target. `false` ⇒ no indicator and no event. */ canDrop: ListCanDrop | undefined; /** Sync gate for internal moves (e.g. 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 (`sorted` / `grouped`), or `undefined` when they work. `on` drops still work. */ get reorderBlocked(): ListReorderBlocked | undefined; /** * 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; /** * Group rows under collapsible headers that flow inline in the columns. A * string names an item property (object items) or a `data-` attribute; * a function derives the key from `(data, element)`. `null` = ungrouped. * Groups appear in first-encounter order (after sorting and filtering). */ groupBy: DetailGroupBy | null; /** Header label for a group. Defaults to the key (`(none)` for the empty key). */ groupLabel: ListGroupLabel | undefined; /** * Let selection span groups. When `false` (default) selecting in one group * clears the others and Shift-range / select-all stay inside one group. */ crossGroupSelection: boolean; private _collapsedGroups; private _listEl; 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; firstUpdated(): void; protected willUpdate(changed: PropertyValues): 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; /** * Force an immediate geometry recompute. Called automatically on resize, * DOM changes, sort/filter/search changes — only needed when layout is * changed by outside forces (e.g. an external font load). */ refreshLayout(): void; /** * Rebuild every object-item row, for when something the `formatter` (or * `searchText`) reads has changed but the items themselves haven't — * reassigning the same objects keeps their rows as they are. Assigning a new * `formatter` function has the same effect. */ reformat(): void; addItem(item: Element | string, options?: AddItemOptions): void; /** * Collapse + fade `item` out, then detach it; the rows after it slide up to * close the gap. Resolves once removed. Immediate under reduced motion. */ 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. */ setItems(items: readonly Element[]): void; /** * Get the source object behind an `
  • ` built from an `items` array or * provider. Returns `undefined` for declarative / programmatic elements. */ getItemData(item: HTMLLIElement): unknown; /** * Keys of items currently intersecting the viewport — for prioritising * viewport-first work (e.g. metadata/thumbnail fetches). Items are laid * out as a fixed-height, horizontally-scrolling column grid, so this is a * horizontal intersection test against the scroll container; every row of * an intersecting column counts as visible. Hidden (filtered-out) and * keyless items are omitted. Mirrors `ixfx-grid-list.visibleKeys()` / * `ixfx-data-grid.getVisibleRange()`. */ visibleKeys(): string[]; /** * Dispatch a command to this list — used by `ixfx-grouped-item-lister` to * forward commands. 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; /** 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. */ focusKey(key: string): void; selectedFilter(kind: `selected` | `checked` | `either`): Generator; /** * Snapshot selection, collapsed groups, cursor and scroll as plain JSON, * keyed by item / group key. Includes pending state for keys not present. */ getViewState(options?: GetViewStateOptions): DetailListViewState; /** * Apply saved view state. Fields present replace the current ones; keys not * in the data are applied as matching items arrive (rebuilds, provider * batches, `addItem`, light-DOM appends). */ setViewState(state: Partial): void; clearPendingViewState(): void; /** Groups in display order (empty when ungrouped). */ get groups(): readonly ListGroupInfo[]; /** Collapse or expand one group. Fires `list-group-toggle` when the state changes. */ setGroupCollapsed(groupKey: string, collapsed: boolean): void; toggleGroup(groupKey: string): void; collapseAllGroups(): void; expandAllGroups(): void; /** * Visible items in DOM order. Cached — every per-hover / per-frame path * reads it — and validated on each call, so it is never stale. */ private _getVisibleItems; /** * Set the column width to fit the widest visible item. * * This is opt-in; detail lists continue to use `--detail-list-column-width` * (or its 220px fallback) until this method is called. The measured value is * set directly on this element, so it takes precedence over an inherited * value. Returns the applied width in pixels, or 0 when there are no items. */ fitColumnWidth(): Promise; private _isCheckable; /** Appends the caption span; returns it so callers can style it per item. */ private _setLabel; /** * Reflect cursor / selection / checked state onto the items. After the item * set changes (or the interaction mode does) every item is visited; otherwise * only the items whose state changed are touched, so hovering is O(1). */ private _syncItemStates; /** * 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. */ get partialKeys(): ReadonlySet; set partialKeys(keys: Iterable); 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; renderer content inside. */ private _createCustomCheckbox; private _findListItem; private _dispatch; private _dispatchCancelable; private _onPointerOver; private _onPointerLeave; /** Restores hover transitions once the pointer takes over from the keyboard. */ private _endKeyboardNav; private _onKeyDown; private _onClick; private _onDblClick; private _onWheel; private _activateItem; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-detail-list': DetailListElement; } interface HTMLElementEventMap extends DetailListElementEventMap {} } interface DetailListElementEventMap extends ListElementEventMap, ListGroupEventMap { 'list-drop': ListTargetDropEvent; 'list-reorder': ListReorderEvent; 'detail-list-viewport-change': ListViewportChangeEvent; 'list-native-drag-start': ListNativeDragStartEvent; 'view-state-change': ViewStateChangeEvent; } export { DetailSortComparator as a, DetailListViewState as c, DetailGroupBy as i, DetailListElementEventMap as n, DetailSortItem as o, DetailFormatter as r, DetailSortMode as s, DetailListElement as t };