type ListSelectionMode = `none` | `single` | `multiple`; /** * Controls how pointer and keyboard gestures map to selection changes. * * - `implicit` — click always replaces selection (no modifier support) * - `standard` — click replaces; Ctrl/Cmd+click toggles; Shift+click range-selects (multiple only) * - `manual` — no auto-selection; drive state via select()/deselect()/clearSelection() * - `checked` — every click toggles; implies multiple selection regardless of selectionMode * - `sticky` — every tap/click toggles (no checkbox column); implies multiple selection, for touchscreens * - `vscode` — like standard for clicks; Shift+Arrow extends range from the keyboard anchor * * Switching interactionMode clears the current selection. */ type ListInteractionMode = `implicit` | `standard` | `manual` | `checked` | `sticky` | `vscode`; type ListSelectDetail = { readonly selected: ReadonlySet; readonly previous: ReadonlySet; /** * The selection as stable key strings (`data-key` / `data-value`). Empty * when items carry no key. Additive to `selected`. */ readonly selectedKeys: ReadonlySet; /** The previous selection as keys. Additive to `previous`. */ readonly previousKeys: ReadonlySet; }; /** * The key-based subset of `list-select` detail common to every list-like * component (including `ixfx-data-grid`), so one adapter can read any of them. */ type ListSelectKeysDetail = Pick; /** * What the user (or API) is trying to do to the selection. See * {@link ListSelectIntentDetail}. */ type ListSelectIntentKind = `replace` | `toggle` | `extend` | `all` | `marquee` | `match` | `clear`; /** * How a `marquee` combines the covered keys with the current selection: * `replace` (plain drag: the selection becomes the covered keys), `add` * (Shift-drag: covered keys are added), `toggle` (Cmd/Ctrl-drag: each covered * key flips, so a drag can deselect). */ type ListMarqueeMode = `replace` | `add` | `toggle`; type ListSelectIntentSource = `pointer` | `keyboard` | `touch` | `api`; /** * Detail of the cancelable `list-select-intent` event: fired *before* a * component changes its selection, in every interaction mode (including * `manual`). Calling `preventDefault()` means "the caller applies this * itself" — the component then changes nothing (cursor and range anchor still * move). Without `preventDefault()` behaviour is unchanged. * * Only gestures and `selectAll()` fire it. The imperative `select()` / * `selectKeys()` / `clearSelection()` family never does, so a handler can * apply its decision through them without re-entering itself. */ type ListSelectIntentDetail = { readonly kind: ListSelectIntentKind; /** Keys directly affected. Empty for `all` / `clear`. For `extend`, the range (a convenience: callers should use the endpoints). */ readonly keys: readonly string[]; /** Range anchor, for `extend`. */ readonly anchorKey?: string; /** Range end, for `extend`. */ readonly targetKey?: string; /** `marquee`: a modifier was held, i.e. `mode` is not `replace`. */ readonly additive?: boolean; /** `marquee`: how the covered `keys` combine with the selection. */ readonly mode?: ListMarqueeMode; /** `match`: the search text. `keys` holds the current matches (a convenience). */ readonly query?: string; /** * `all`: the group the select-all is confined to (grouped lists with * cross-group selection off). Absent when it is not confined to a group. */ readonly groupKey?: string | null; /** * `toggle` from a branch checkbox in a tree: the toggle applies to the node * and every loaded node under it (`keys` lists them), as a rule rather than * a key list. */ readonly descendants?: boolean; /** `toggle` with `descendants`: the state the branch is being set to (`true` = checked). */ readonly checked?: boolean; /** Multi-column lists (`ixfx-multicol-list`): the column the intent is for. Keys are that column's item keys. */ readonly columnId?: string; readonly source: ListSelectIntentSource; }; type ListTickleDetail = { readonly item: Element; }; type ListActivateDetail = { readonly item: Element; }; type ListItemClickDetail = { readonly item: Element; }; type ListSelectEvent = CustomEvent; type ListSelectIntentEvent = CustomEvent; type ListTickleEvent = CustomEvent; type ListActivateEvent = CustomEvent; type ListItemClickEvent = CustomEvent; interface ListElementEventMap { 'list-select': ListSelectEvent; 'list-select-intent': ListSelectIntentEvent; 'list-tickle': ListTickleEvent; 'list-activate': ListActivateEvent; 'list-item-click': ListItemClickEvent; } export { ListTickleEvent as _, ListItemClickDetail as a, ListSelectDetail as c, ListSelectIntentEvent as d, ListSelectIntentKind as f, ListTickleDetail as g, ListSelectionMode as h, ListInteractionMode as i, ListSelectEvent as l, ListSelectKeysDetail as m, ListActivateEvent as n, ListItemClickEvent as o, ListSelectIntentSource as p, ListElementEventMap as r, ListMarqueeMode as s, ListActivateDetail as t, ListSelectIntentDetail as u };