import { FASTElement } from "@microsoft/fast-element"; /** * MenuList * @summary A Menu Custom HTML Element that implements the ARIA menu pattern. * * @example * ```html * * Item 1 * Item 2 * Item 3 * * ``` * * @attr {Element[] | undefined} menuItems - The menu items that are part of the menu list. * @attr {number} focusIndex - The index of the focusable element in the items array defaults to -1. * @attr {MenuItemRole} focusableElementRoles - Static roles that determine if an element is focusable. * @attr {string} role - The ARIA role for the menu list, defaults to 'menu'. * * @prop {Element[] | undefined} items - The menu items that are part of the menu list. * * @slot - The default slot for the menu items. * * @method itemsChanged - Reacts to changes in the items property. Parameters: oldValue: HTMLElement[], newValue: HTMLElement[]. * @method focus - Focuses the first item in the menu. * @method handleMenuKeyDown - Handles keydown events for menu navigation. * @method handleFocusOut - Handles focus out events to reset menu state. * @method handleChange - Observes changes to the hidden attribute of child elements. Parameters: source: any, propertyName: string. * @method setFocus - Sets focus on a menu item based on the provided index and adjustment. Parameters: focusIndex: number, adjustment: number. * * @extends FASTElement * @tagname fabric-menu-list * @public */ export declare class MenuList extends FASTElement { /** * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component. * * @internal */ elementInternals: ElementInternals; /** * @internal */ items: HTMLElement[]; itemsChanged(oldValue: HTMLElement[], newValue: HTMLElement[]): void; menuItems: Element[] | undefined; /** * The index of the focusable element in the items array * defaults to -1 */ focusIndex: number; static readonly focusableElementRoles: { readonly menuitem: "menuitem"; readonly menuitemcheckbox: "menuitemcheckbox"; readonly menuitemradio: "menuitemradio"; }; constructor(); /** * @internal */ connectedCallback(): void; /** * @internal */ disconnectedCallback(): void; /** * @internal */ readonly isNestedMenu: () => boolean; /** * Focuses the first item in the menu. * * @public */ focus(): void; /** * @internal */ handleMenuKeyDown(e: KeyboardEvent): void | boolean; /** * if focus is moving out of the menu, reset to a stable initial state * @internal */ handleFocusOut: (e: FocusEvent) => void; private handleItemFocus; private removeItemListeners; private static elementIndent; protected setItems(): void; /** * Method for Observable changes to the hidden attribute of child elements */ handleChange(source: unknown, propertyName: string): void; /** * Handle change from child MenuItem element and set radio group behavior */ private changedMenuItemHandler; /** * check if the item is a menu item */ protected isMenuItemElement: (el: Element) => el is HTMLElement; /** * check if the item is focusable */ private isFocusableElement; private setFocus; } //# sourceMappingURL=menu-list.d.ts.map