import type { CSSResultGroup } from 'lit'; import DSAIconButton from '../icon-button/icon-button'; import { ShoelaceElement } from '../../internal/shoelace-element'; /** * @summary Drawers slide in from a container to expose additional options and information. * @documentation https://dsa.service-public-autonomie.fr/latest/librairie-webcomponents/tiroir-drawer/web-YWG7jq3p * * @dependency dsa-icon-button * * @slot - The drawer's main content. * @slot label - The drawer's label. Alternatively, you can use the `label` attribute. * @slot header-actions - Optional actions to add to the header. Works best with ``. * @slot footer - The drawer's footer, usually one or more buttons representing various options. * * @event dsa-show - Emitted when the drawer opens. * @event dsa-after-show - Emitted after the drawer opens and all animations are complete. * @event dsa-hide - Emitted when the drawer closes. * @event dsa-after-hide - Emitted after the drawer closes and all animations are complete. * @event dsa-initial-focus - Emitted when the drawer opens and is ready to receive focus. Calling * `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input. * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} dsa-request-close - Emitted when the user attempts to * close the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling * `event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in * destructive behavior such as data loss. */ export default class DSADrawer extends ShoelaceElement { static styles: CSSResultGroup; static dependencies: { 'dsa-icon-button': typeof DSAIconButton; }; private readonly hasSlotController; private readonly localize; private modal; private originalTrigger; drawer: HTMLElement; panel: HTMLElement; overlay: HTMLElement; /** * Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can * use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state. */ open: boolean; /** * The drawer's label as displayed in the header. You should always include a relevant label even when using * `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead. */ label: string; /** The direction from which the drawer will open. */ placement: 'top' | 'end' | 'bottom' | 'start'; /** * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of * its parent element, set this attribute and add `position: relative` to the parent. */ contained: boolean; /** * Removes the header. This will also remove the default close button, so please ensure you provide an easy, * accessible way for users to dismiss the drawer. */ noHeader: boolean; /** * Set to true if the drawer is a filter drawer */ filters: boolean; connectedCallback(): void; firstUpdated(): void; disconnectedCallback(): void; private requestClose; private addOpenListeners; private removeOpenListeners; private handleDocumentKeyDown; handleOpenChange(): Promise; handleNoModalChange(): void; /** Shows the drawer. */ show(): Promise; /** Hides the drawer */ hide(): Promise; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-drawer': DSADrawer; } }