import type { CSSResultGroup } from 'lit'; import DSAPopup from '../popup/popup'; import { ShoelaceElement } from '../../internal/shoelace-element'; /** * @summary Dropdowns expose additional content that "drops down" in a panel. * @documentation https://dsa.service-public-autonomie.fr/latest/librairie-webcomponents/actions/bouton-liste-deroulante-dropdown/web-ApvM1qoB * * @dependency dsa-popup * * @slot - The dropdown's main content. * @slot trigger - The dropdown's trigger, usually a `` element. * * @event dsa-show - Emitted when the dropdown opens. * @event dsa-after-show - Emitted after the dropdown opens and all animations are complete. * @event dsa-hide - Emitted when the dropdown closes. * @event dsa-after-hide - Emitted after the dropdown closes and all animations are complete. */ export default class DSADropdown extends ShoelaceElement { static styles: CSSResultGroup; static dependencies: { 'dsa-popup': typeof DSAPopup; }; popup: DSAPopup; trigger: HTMLSlotElement; panel: HTMLSlotElement; private readonly localize; /** * Indicates whether or not the dropdown is open. You can toggle this attribute to show and hide the dropdown, or you * can use the `show()` and `hide()` methods and this attribute will reflect the dropdown's open state. */ open: boolean; /** * The preferred placement of the dropdown panel. Note that the actual placement may vary as needed to keep the panel * inside of the viewport. */ placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end'; /** Disables the dropdown so the panel will not open. */ disabled: boolean; /** * The dropdown will close when the user interacts outside of this element (e.g. clicking). Useful for composing other * components that use a dropdown internally. */ containingElement?: HTMLElement; /** The distance in pixels from which to offset the panel along its trigger. */ skidding: number; /** * Enable this option to prevent the panel from being clipped when the component is placed inside a container with * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios. */ hoist: boolean; /** * Close the dropdown when the user clicks inside the panel. */ closePanelOnClick: boolean; connectedCallback(): void; firstUpdated(): void; disconnectedCallback(): void; private focusOnTrigger; private handleKeyDown; private handleDocumentKeyDown; private handleDocumentMouseDown; private handleTriggerClick; private handleTriggerKeyDown; private handleTriggerKeyUp; private handleTriggerSlotChange; private handlePanelClick; private getTrigger; handleDisabledChange(): void; updateAccessibleTrigger(): void; /** Shows the dropdown panel. */ show(): Promise; /** Hides the dropdown panel */ hide(): Promise; /** * Instructs the dropdown menu to reposition. Useful when the position or size of the trigger changes when the menu * is activated. */ reposition(): void; private addOpenListeners; private removeOpenListeners; handleOpenChange(): Promise; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-dropdown': DSADropdown; } }