/** * a _ValueElement_ is any element that counts as having a "value" in the context of ``. * * In short its either a `
  • ` element or any other element that has `[data-value]` set. * * ## Custom popover with values * * They can be used to specify options within a [_Popover_](./popover.ts) * * @example * ```html * * *
      *
    • some value
    • *
    *
    *
    * ``` * * ## Pre-selecting values * * With _ValueElement_ it is also possible to "pre-select" values, like this: * * @example * ```html * *
      *
    • some value
    • *
    *
    * ``` * * @privateRemarks * * This element is then "enriched" with a value (idl+content). The IDL and * content attributes are guaranteed to be in sync. * * * @module */ import { SupportedIdlType } from "../uwc-input.js"; /** * an attribute name with which template children can specify which attributes * from the source ValueElement to carry over * * TODO: somehow this feels like a generic functionality but I can't find a place for that yet. Don't want to start a rendering library for this */ export declare const attributeTransferAttributeName = "data-slot-attributes"; /** * @internal */ export declare const selector = ":where(li, [data-value])"; /** * @internal */ export type ValueElement = { /** * the backing HTML element */ element: HTMLElement; /** * the content attributes value - i.e. a strictly non-localized string representation of the idl attribute */ content: string; /** * the fully parsed value */ idl: SupportedIdlType; }; /** * the minimal properties to uniquely identify a {@link ValueElement} * * @internal */ export type Id = Pick; /** * @internal */ export declare function fromElement(input: UwcInputElement, element: HTMLElement): ValueElement; /** * @internal */ export declare function fromEvent(input: UwcInputElement, event: Event): ValueElement | undefined; /** * return all ValueElements in a given element * * @internal */ export declare function getAllIn(input: UwcInputElement, element: HTMLElement): ValueElement[]; /** * @internal */ export declare function get(input: UwcInputElement, element: Id): ValueElement | undefined; /** * @internal */ export declare function has(input: UwcInputElement, element: Id): boolean; /** * @internal */ export declare function add(input: UwcInputElement, valueElement: ValueElement): void; /** * add a new ValueElement to the list of selected elements and take the values * from another given ValueElement * * @internal */ export declare function addFromExisting(input: UwcInputElement, valueElement: ValueElement): void; /** * @internal */ export declare function remove(input: UwcInputElement, element: Id): void; /** * @internal */ export declare function toggle(input: UwcInputElement, valueElement: ValueElement): void; /** * @internal */ export declare function observe(input: UwcInputElement, onChange: () => void, abortController: { signal: AbortSignal; }): void; /** * @internal */ export declare function getSelected(input: UwcInputElement): ValueElement[]; /** * @internal */ export declare function getLastSelected(input: UwcInputElement): ValueElement | undefined; /** * @internal */ export declare function removeSelected(input: UwcInputElement): void; /** * @internal */ export declare function equals(element: ValueElement, other: ValueElement): boolean; /** * Update a ValueElements ariaSelected state. * * @internal */ export declare function updateSelected(element: ValueElement, updateFn: (current: boolean) => boolean): void; /** * @internal */ export declare function allEqual(elements: ValueElement[], others: ValueElement[]): boolean; /** * @internal */ export declare function hasChanges(input: UwcInputElement, comparedTo: ValueElement[]): boolean; /** * @internal */ export declare function connectSelected(input: UwcInputElement, abortController: { signal: AbortSignal; }): void;