import "./icon-YIyJDwM9.js"; import { LitElement } from "lit"; import { CommandRegistry, KeyboardManager } from "@clinth/ui-commands"; declare class MenuContainer extends LitElement { anchor?: string; registry?: CommandRegistry; keyboardManager?: KeyboardManager; private _popover; private tickled; static styles: import("lit").CSSResult[]; private _updateIconSections; private _propagateContext; updated(changedProperties: Map): void; /** * Sync data-input-mode to :host so CSS variables cascade to slotted items */ willUpdate(changed: Map): void; render(): import("lit").TemplateResult<1>; private _getMenuItems; /** * Sync .tickled class on slotted items to match controller state * This is called via onStateChange whenever the tickled state changes */ private _syncTickledClasses; private _handleMouseOver; focusFirst(): void; private _focusNext; private _focusItem; private _activateFocusedItem; private _handleKeydown; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-container': MenuContainer; } } type MenuMode = `trigger` | `dropdown` | `context`; type Placement = `bottom-start` | `bottom-end` | `right-start`; type MenuTriggerCommandDetail = { readonly command?: string; readonly value?: string; readonly checked?: boolean; }; declare class MenuTrigger extends LitElement { mode: MenuMode; label: string; /** Render an `ixfx-icon` in the default button instead of the text `label`. */ iconName: string; registry?: CommandRegistry; keyboardManager?: KeyboardManager; placement: Placement; /** Set false when a host widget manages its own roving/virtual focus (e.g. crumb-navigation) and opens this menu programmatically, so the trigger button should not be a native Tab stop. */ tabStop: boolean; private _isOpen; private _hasMenu; private _hasTriggerSlot; private _hasContextTarget; private _triggerBtn; private _popup; private static _count; private _anchorName; private _clickListener; /** Element focused when the menu opened; focus returns here on Escape/Tab when there is no trigger button (context-target mode). */ private _focusBeforeOpen; /** A mouse button is currently down on the trigger area. */ private _mouseHeld; /** A context open was requested while the mouse button was still down. */ private _openOnRelease; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(): void; updated(changedProperties: Map): void; private _updatePosition; private _propagateContext; private _handleSlotChange; private _handleTriggerSlotChange; private _handleContextTargetSlotChange; get isOpen(): boolean; openMenu(): void; closeMenu(): void; focusTrigger(): void; private _openMenu; private _handlePopoverToggle; private _closeMenu; private _handleTriggerClick; private _handleClickOutside; private _getMenuContainer; private _handleKeydown; /** * Return focus after a keyboard close. The trigger button is the natural * target, but it is not rendered for a context target — then fall back to * whatever was focused at open (don't rely on the browser's popover focus * restoration), and finally the host. */ private _restoreFocus; private _handleCommand; private _handleRadioChange; private _handlePointerDown; private _removeReleaseListeners; /** * End of a mouse press. If a context open was deferred, open after the * release has been fully dispatched, so popover light-dismiss (which * evaluates the pointerup) does not immediately close the new popover. */ private _handleRelease; /** * Opens the menu at a client point. For hosts that decide for themselves * when a context menu applies (e.g. a canvas whose right-click target is a * node, a wire or the background) and so can't use `mode="context"`'s own * context-target. Call it from the host's `contextmenu` handler; if the * mouse button is still down (macOS fires `contextmenu` on mousedown), wait * for the release first, as `mode="context"` does. */ openAt(clientX: number, clientY: number): void; private _handleContextMenu; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-trigger': MenuTrigger; } } declare class MenuItem extends LitElement { command: string; commandArgs: string; label: string; disabled: boolean; iconName: string; registry?: CommandRegistry; keyboardManager?: KeyboardManager; submenuPopover?: HTMLElement; private _hasChildren; private _slot; private _hoverTimeout; disconnectedCallback(): void; private _handleSlotChange; private _handleMouseEnter; private _handleMouseLeave; private _showSubmenu; private _hideSubmenu; private handleClick; private _resolvedLabel; private _resolvedIcon; willUpdate(changedProperties: Map): void; updated(changedProperties: Map): void; private _getShortcut; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-item': MenuItem; } } export { MenuContainer as i, MenuTrigger as n, MenuTriggerCommandDetail as r, MenuItem as t };