UNPKG

@synergy-design-system/components

Version:

This package provides the base of the Synergy Design System as native web components. It uses [lit](https://www.lit.dev) and parts of [shoelace](https://shoelace.style/). Synergy officially supports the latest two versions of all major browsers (as define

50 lines (49 loc) 2.1 kB
/** * --------------------------------------------------------------------- * 🔒 AUTOGENERATED BY VENDORISM * Removing this comment will prevent it from being managed by it. * --------------------------------------------------------------------- */ import SynergyElement from '../../internal/synergy-element.js'; import type { CSSResultGroup } from 'lit'; import type SynMenuItem from '../menu-item/menu-item.component.js'; export interface MenuSelectEventDetail { item: SynMenuItem; } /** * @summary Menus provide a list of options for the user to choose from. * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-menu--docs * @status stable * @since 2.0 * * @slot - The menu's content, including menu items, menu labels, and dividers. * * @event {{ item: SynMenuItem }} syn-select - Emitted when a menu item is selected. */ export default class SynMenu extends SynergyElement { static styles: CSSResultGroup; defaultSlot: HTMLSlotElement; hasMenuItemsWithCheckmarks: boolean; private handleUpdateCheckmarks; private updateCheckMarksByChildPropChange; disconnectedCallback(): void; connectedCallback(): void; private handleClick; private handleKeyDown; private handleMouseDown; private handleSlotChange; private isMenuItem; /** @internal Gets all slotted menu items, ignoring dividers, headers, and other elements. */ getAllItems(): SynMenuItem[]; /** * @internal Gets the current menu item, which is the menu item that has `tabindex="0"` within the roving tab index. * The menu item may or may not have focus, but for keyboard interaction purposes it's considered the "active" item. */ getCurrentItem(): SynMenuItem | undefined; /** * @internal Sets the current menu item to the specified element. This sets `tabindex="0"` on the target element and * `tabindex="-1"` to all other items. This method must be called prior to setting focus on a menu item. */ setCurrentItem(item: SynMenuItem): void; render(): import("lit").TemplateResult<1>; }