import { EventEmitter } from "../../stencil-public-runtime"; /** * @slot - Menu label * @slot header - Header to display as the first entry of the open menu. * @slot item - Single entry of the section. Can be slotted multiple times to insert items onto the menu. Set the `data-active` HTML attribute on the element to highlight it (`active` also works but `data-active` is preferable). Use `z-menu-section` for submenus. * @cssprop --z-menu-label-color - Color of the label's text. */ export declare class ZMenu { host: HTMLZMenuElement; /** Flag to set the active status of the menu. */ active?: boolean; /** * Flag to set the display mode of the list. * If true, the list will be absolutely positioned under the menu label, * stacked beneath it otherwise. */ floating?: boolean; /** The opening state of the menu. */ open: boolean; /** * Tells the component that it's placed in a vertical context with other `ZMenu`s (usually in the ZAppHeader's offcanvas). * A small border is placed under it as a separator from other elements. */ verticalContext: boolean; /** * Tabindex value to set on the menu label. * Useful to manage keyboard navigation focus with roving tabindex handled by this component's parent (usually ZAppHeader). */ htmlTabindex: number; hasHeader: boolean; hasContent: boolean; /** The menu has been opened. */ opened: EventEmitter; /** The menu has been closed. */ closed: EventEmitter; private labelButton; private content; private items; /** Animation frame request id. */ private raf; private get focusableItem(); private toggle; /** * Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`. * @param ev Slotchange event */ private onLabelSlotChange; /** * Correctly set position of the floating menu in order to prevent overflow. * @param live Should run the method on every refresh frame. */ private reflow; /** * Check if some content slot is set. */ private checkContent; private setItemTabindex; /** * Set `menuitem` role to all menu items (ZMenuSection items already have it). * Set -1 to the tabindex of the items and 0 to the first one. */ private setItemsA11yAttrs; private onItemsChange; /** * Move focus and adjust the tabindex value of `receiver` and `current` elements, * setting -1 to the `current` and 0 to the `receiver`, then focus the `receiver` element. * If the receiver is a ZMenuSection and it's open, focus its first focusable item. */ private moveFocus; private onLabelClick; private onLabelKeydown; /** Set tabindex of the label to 0, then focus it. */ setFocus(): Promise; /** * Focus the last item. */ focusLastItem(): Promise; onOpenChanged(): void; setLabelA11yAttrs(): void; /** * Set tabindex to -1 to all siblings of the clicked item. */ onItemClick(ev: MouseEvent): void; onKeyDown(ev: KeyboardEvent): void; constructor(); componentWillLoad(): void; render(): HTMLDivElement | HTMLZMenuElement; }