import * as Stacks from "../../stacks"; export declare class ModalController extends Stacks.StacksController { static targets: string[]; readonly modalTarget: HTMLElement; readonly initialFocusTargets: HTMLElement[]; private _boundClickFn; private _boundKeypressFn; private returnElement; private _boundTabTrap; connect(): void; /** * Disconnects all added event listeners on controller disconnect */ disconnect(): void; /** * Toggles the visibility of the modal */ toggle(dispatcher?: Event | Element | null): void; /** * Shows the modal */ show(dispatcher?: Event | Element | null): void; /** * Hides the modal */ hide(dispatcher?: Event | Element | null): void; /** * Validates the modal settings and attempts to set necessary internal variables */ private validate; /** * Toggles the visibility of the modal element * @param show Optional parameter that force shows/hides the element or toggles it if left undefined */ private _toggle; /** * Listens for the s-modal:hidden event and focuses the returnElement when it is fired */ private focusReturnElement; /** * Remove the element on hide if the `remove-when-hidden` flag is set */ private removeModalOnHide; /** * Gets all elements within the modal that could receive keyboard focus. */ private getAllTabbables; /** * Returns the first visible element in an array or `undefined` if no elements are visible. */ private firstVisible; /** * Returns the last visible element in an array or `undefined` if no elements are visible. */ private lastVisible; /** * Attempts to shift keyboard focus into the modal. * If elements with `data-s-modal-target="initialFocus"` are present and visible, one of those will be selected. * Otherwise, the first visible focusable element will receive focus. */ private focusInsideModal; /** * Returns keyboard focus to the modal if it has left or is about to leave. */ private keepFocusWithinModal; /** * Binds global events to the document for hiding popovers on user interaction */ private bindDocumentEvents; /** * Unbinds global events to the document for hiding popovers on user interaction */ private unbindDocumentEvents; /** * Forces the popover to hide if a user clicks outside of it or its reference element */ private hideOnOutsideClick; /** * Forces the popover to hide if the user presses escape while it, one of its childen, or the reference element are focused */ private hideOnEscapePress; /** * Determines the correct dispatching element from a potential input * @param dispatcher The event or element to get the dispatcher from */ private getDispatcher; } /** * Helper to manually show an s-modal element via external JS * @param element the element the `data-controller="s-modal"` attribute is on */ export declare function showModal(element: HTMLElement): void; /** * Helper to manually hide an s-modal element via external JS * @param element the element the `data-controller="s-modal"` attribute is on */ export declare function hideModal(element: HTMLElement): void;