UNPKG

@trimble-oss/moduswebcomponents

Version:

Modus Web Components is a modern, accessible UI library built with Stencil JS that provides reusable web components following Trimble's Modus design system. This updated version focuses on improved flexibility, enhanced theming options, comprehensive cust

59 lines (58 loc) 2.27 kB
import { EventEmitter } from '../../stencil-public-runtime'; import { DaisySize, ModusSize, PopoverPlacement } from '../types'; /** * A customizable dropdown menu component used to render a button and toggleable menu. * * The component supports a 'button' and 'menu' `<slot>` for injecting custom HTML content. */ export declare class ModusWcDropdownMenu { private buttonRef?; private inheritedAttributes; private menuRef?; /** Reference to the host element */ el: HTMLElement; /** The aria-label for the dropdown button. */ buttonAriaLabel?: string; /** The color variant of the button. */ buttonColor?: 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger'; /** The shape of the button. */ buttonShape?: 'circle' | 'ellipse' | 'rectangle' | 'square'; /** The size of the button. */ buttonSize?: DaisySize | 'xl'; /** The variant of the button. */ buttonVariant?: 'borderless' | 'filled' | 'outlined'; /** Custom CSS class to apply to the host element. */ customClass?: string; /** If true, the button will be disabled. */ disabled?: boolean; /** Indicates that the menu should have a border. */ menuBordered?: boolean; /** Distance between the button and menu in pixels. */ menuOffset?: number; /** The placement of the menu relative to the button. */ menuPlacement?: PopoverPlacement; /** The size of the menu. */ menuSize?: ModusSize; /** * The positioning strategy for the menu. Use 'fixed' when the dropdown is * inside a clipping ancestor (e.g. overflow:hidden) so the menu escapes to * the viewport coordinate space. */ menuStrategy?: 'absolute' | 'fixed'; /** Indicates that the menu is visible. */ menuVisible: boolean; /** Event emitted when the menuVisible prop changes. */ menuVisibilityChange: EventEmitter<{ isVisible: boolean; }>; private menuPosition; handleDocumentClick(event: Event): void; handleKeyDown(event: KeyboardEvent): void; onMenuVisibilityChange(newValue: boolean): Promise<void>; componentDidLoad(): void; componentWillLoad(): void; private getClasses; private handleButtonClick; private updateMenuPosition; render(): any; }