import { EventEmitter } from '../../stencil-public-runtime'; /** * @slot default - Body of the dialog. * @slot trigger - Content to be placed as the trigger, will override the trigger prop. * @slot header - Content to be placed as the header, will override the header prop. * @slot footer - Content to be placed as the footer, will override the footer prop. */ export declare class NvDialog { el: HTMLNvDialogElement; private dialogElement; private backdropElement; private contentElement; private eventsAttached; private form; private triggerElement; private pointerDownTarget; private suppressOpenWatcher; private transitionToken; private boundFooterElement; private triggerClickEvents; /****************************************************************************/ /** * @internal * Accepts a reference to the DOM element acting as the header. This should * be used when the slot for the header is not defined. */ headerElement: Element; /** * @internal * Accepts a reference to the DOM element acting as the footer. This should * be used when the slot for the footer is not defined. */ footerElement: Element; /** * Use this prop to toggle the visibility of the dialog. Set to true to show * the dialog and false to hide it. */ open: boolean; /** * If true, the dialog cannot be closed by the user. */ readonly undismissable: boolean; /** * If true, the dialog will be closed when the backdrop is clicked. */ readonly clickOutside: boolean; /** * If true, the dialog visibility is managed manually through methods or the * open prop. */ readonly controlled: boolean; /** * If true, the dialog takes full width styling. */ readonly full: boolean; /** * Controls whether the dialog should automatically focus the first focusable * element when opened. When disabled, prevents unwanted tooltip triggers on * dialog open. */ readonly autofocus: boolean; /****************************************************************************/ /** * Call this method to show the dialog, making it visible on the screen. */ show(): Promise; /** * Call this method to hide the dialog, making it disappear from view. */ close(): Promise; /** * Writes `open` without re-entering its watcher. Used for transitions the * component itself initiates, which have already been applied by the time * the watcher would run. * @param {boolean} value - The value to write. * @returns {boolean} True when the value actually changed. */ private setOpenSilently; /** * Sets the autofocus on the first focusable element in the dialog. */ private setAutofocus; /** * Attaches event listeners to the dialog. */ private attachEventListeners; /** * Wires `dialogCanceled` on a consumer-slotted footer so that Cancel closes * the dialog exactly as it does with the default internal footer, which is * the documented contract. Without this the dialog can only be closed by a * consumer round trip, and on an async transport (Blazor Server) that round * trip races the close animation. * Tracks the bound node rather than a boolean so a replaced footer rebinds. */ private attachFooterListeners; /** * Closes the dialog when a slotted footer emits `dialogCanceled`. * * Deliberately does not stop propagation. `dialogCanceled` is declared * `bubbles: false`, so there is nothing to stop, and * `stopImmediatePropagation()` would be harmful here: framework wrappers * bind their own listener for this event on the very same element (that is * how `DialogCanceledEvent` reaches a Blazor consumer), so suppressing * sibling listeners could silently swallow the consumer's cancel handler. */ private handleSlottedFooterCancel; /** * Prevents the body from scrolling when the dialog is open. * Compensates for scrollbar width to prevent layout shift. */ private preventScroll; /** * Allows the body to scroll when the dialog is closed. * Removes the applied overflow and padding styles. */ private allowScroll; private ensureFormId; /** * Checks for and sets up form ID if a form is present */ private checkForForm; /** * Handles the native dialog close event. */ private handleDialogClose; /****************************************************************************/ /** * Emitted when the dialog is closing in order to allow for cleanup, data-capture, etc. * @bind open */ openChanged: EventEmitter; /****************************************************************************/ handleDialogOpenChange(isOpen: boolean): void; /****************************************************************************/ /** * Handles the keydown event to optionally prevent the native dialog from closing when the escape key is pressed. * @param {KeyboardEvent} event - The keydown event. */ handleKeyDown(event: KeyboardEvent): void; /** * Records the pointer down target to distinguish intentional outside clicks * from drag-out gestures (press inside, release outside). * @param {PointerEvent} event - The pointerdown event. */ private handleDialogPointerDown; /** * Handles the click event to close the dialog when clickOutside is true. * Only closes if both pointerdown and click originated on the backdrop, * preventing accidental closes from drag-out gestures. * @param {MouseEvent} event - The click event. */ private handleDialogClick; /** * Only suppresses events from the dialog's own chrome (the `` box * and its backdrop). Events from slotted content MUST bubble so * root-delegated event systems (Blazor, React 17+) receive their * `@onclick`/`onClick` events — stopping propagation here silently breaks * every interactive element inside the dialog. * Isolating content clicks from an ancestor row is the consumer's job; it * cannot be done here without also cutting off the framework's delegated * listener at the document root. The guard must sit on a wrapper element * BETWEEN the dialog and the clickable row (e.g. a * `
` around the dialog) and NOT on the * row itself: Blazor reads an element's stopPropagation flag only after it * has already dispatched that element's own handler. * @param {Event} event - The event whose propagation should be stopped. */ private stopEventPropagation; private checkForOpenPopovers; private closeOpenPopovers; /****************************************************************************/ /** * Lifecycle method that runs before the component loads. * Looks for passed header, and footer elements, either by their slot * attribute or by their tag name (for dialog header/footer) */ componentWillLoad(): void; /** * Looks for consumer-provided header and footer elements. Only fills in what * is still unset, so it is safe to call on every render. * @param {boolean} allowTagFallback - Also accept a bare `nv-dialogheader` / * `nv-dialogfooter` tag with no slot attribute. Only valid BEFORE the first * render: afterwards the dialog has rendered its own default footer, which * that lookup would otherwise pick up and promote to the consumer's. */ private resolveSlottedChrome; componentDidRender(): void; componentDidLoad(): void; disconnectedCallback(): void; /****************************************************************************/ render(): any; }