/** * @description Framework-free periodic-table input shared by MolVis * consumers. It defaults to carbon (`"C"`), reflects `value` and `disabled` * between properties and attributes, and accepts `compact` as a presence-only * toolbar attribute. Element symbols are normalized and validated; assigning * an invalid `value` throws `TypeError` without changing the prior value. * * Importing this module does not register a tag. After explicit registration, * a user selection emits bubbling, composed `input` followed by `change`; * programmatic value changes emit neither event. * * @example * ```ts * import { defineMolvisElementPicker } from * "@molcrafts/molvis-core/element-picker"; * * defineMolvisElementPicker(); * const picker = document.createElement("molvis-element-picker"); * picker.value = "Fe"; * picker.addEventListener("input", () => console.log(picker.value)); * document.body.append(picker); * ``` */ export declare class MolvisElementPickerElement extends HTMLElement { static get observedAttributes(): readonly string[]; private currentValue; private reflectingValue; private readonly trigger; private readonly triggerSymbol; private readonly triggerName; private readonly popoverPanel; private readonly buttons; private connectionAbortController; constructor(); /** * Selected chemical symbol. Defaults to `"C"`, normalizes letter case, and * reflects to the `value` attribute. Invalid symbols throw `TypeError`. */ get value(): string; set value(value: string); /** * Whether interaction is disabled. This reflects the boolean `disabled` * attribute, prevents opening or selection, and closes an open picker. */ get disabled(): boolean; set disabled(value: boolean); connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; private readonly repositionIfOpen; private createElementButton; private reflectValue; private setCurrentValue; private updateUi; private updateDisabled; private isPickerOpen; private togglePicker; private positionPopover; private handleGridKeydown; private findNeighbor; private selectFromUser; } /** * @description Idempotently register the shared periodic-table picker. The * function consults `customElements.get()` first, so repeated calls for the * same tag are safe. Importing the module alone has no registration side * effect. * * @param {string} tag - Custom-element tag to register. Defaults to * `"molvis-element-picker"`. * @returns {void} * * @example * ```ts * defineMolvisElementPicker(); * document.body.append(document.createElement("molvis-element-picker")); * ``` */ export declare function defineMolvisElementPicker(tag?: string): void; declare global { interface HTMLElementTagNameMap { "molvis-element-picker": MolvisElementPickerElement; } }