import { r as IDataProvider } from "./data-provider-Cq_ylpET.js"; import "./icon-YIyJDwM9.js"; import { LitElement, PropertyValues } from "lit"; type AcTokenItem = { readonly label: string; readonly subLabel?: string; readonly icon?: string; readonly key?: string; readonly data?: unknown; readonly positions?: ReadonlySet; }; /** Per-token visual overrides. Any CSS colour value. Ignored while the chip is selected. */ type AcTokenStyle = { readonly background?: string; readonly color?: string; readonly borderColor?: string; }; /** Given a committed token, returns style overrides for its chip (or undefined for default). */ type AcTokenStyleFn = (item: AcTokenItem) => AcTokenStyle | undefined; type AcTokenizerFn = (text: string) => string[]; type AcTokensChangeDetail = { readonly tokens: readonly AcTokenItem[]; }; type AcTokensChangeEvent = CustomEvent; type AcTokenAddDetail = { readonly item: AcTokenItem; readonly index: number; }; type AcTokenAddEvent = CustomEvent; type AcTokenRemoveDetail = { readonly item: AcTokenItem; readonly index: number; }; type AcTokenRemoveEvent = CustomEvent; interface AcTokenElementEventMap { 'ac-token-change': AcTokensChangeEvent; 'ac-token-add': AcTokenAddEvent; 'ac-token-remove': AcTokenRemoveEvent; } /** * Token/tag input with per-token autocomplete suggestions. * * Users type tokens separated by space, comma or semicolon (default). Each * committed token appears as a chip inline with the text cursor. The * suggestion popup follows the input cursor position. * * @fires {AcTokensChangeEvent} ac-token-change — any time the token list changes * @fires {AcTokenAddEvent} ac-token-add — when a token is added * @fires {AcTokenRemoveEvent} ac-token-remove — when a token is removed * * @example * ```html * * ``` */ declare class AcTokenElement extends LitElement { #private; /** Provides completion results for the current draft token. */ completionProvider: IDataProvider | undefined; /** Custom tokenizer — defaults to splitting on space, comma, semicolon. */ tokenizer: AcTokenizerFn | undefined; /** * Optional per-token styling. Called when rendering each committed chip; * return `{ background, color, borderColor }` overrides, or undefined for * the default look. Selected chips keep the selected style. */ tokenStyle: AcTokenStyleFn | undefined; /** Placeholder text shown when no tokens or draft text are present. */ placeholder: string; /** Maximum number of query results to cache (LRU). */ cacheSize: number; /** Debounce delay in ms before invoking the provider after keystroke. */ debounceMs: number; /** * When true, only suggestions from the popup can be committed. * When false (default), typing text and pressing Enter commits it as-is. */ strict: boolean; /** * When false (default), tokens that have already been committed are * filtered out of the suggestion list. Set to true to show all * suggestions including duplicates. */ allowDuplicates: boolean; private _tokens; private _draft; private _selectedTokenIndex; private _isOpen; /** How many suggestions are in the DOM (the rest render as the popup scrolls). */ private _renderLimit; private _tickled; constructor(); get tokens(): readonly AcTokenItem[]; set tokens(value: readonly AcTokenItem[]); /** * Set the token list programmatically. Unlike the `tokens` property setter, * this does not dispatch `ac-token-change` — use it for initialisation or any * other programmatic update that should not re-enter a parent's own * `ac-token-change` handler. */ setTokens(value: readonly AcTokenItem[]): void; /** All committed token labels joined with commas. */ get value(): string; connectedCallback(): void; disconnectedCallback(): void; protected willUpdate(changedProps: PropertyValues): void; protected updated(changedProps: PropertyValues): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-ac-token': AcTokenElement; } } interface AcTokenElement { addEventListener: ((type: K, listener: (this: AcTokenElement, event: AcTokenElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export { AcTokenItem as a, AcTokenStyle as c, AcTokensChangeDetail as d, AcTokensChangeEvent as f, AcTokenElementEventMap as i, AcTokenStyleFn as l, AcTokenAddDetail as n, AcTokenRemoveDetail as o, AcTokenAddEvent as r, AcTokenRemoveEvent as s, AcTokenElement as t, AcTokenizerFn as u };