import * as i0 from '@angular/core';
import { AfterViewInit, OnDestroy, EventEmitter, TemplateRef, ElementRef, QueryList } from '@angular/core';
import { TemplatePortal } from '@angular/cdk/portal';
import * as i1 from '@eui/components/shared';
import { BaseStatesDirective } from '@eui/components/shared';
import { EuiDialogInterface } from '@eui/components/eui-dialog';
/**
* @description
* Component for displaying modal message boxes with structured content and customizable actions.
* This component provides a user-friendly interface for confirmation dialogs, alerts, and other
* types of modal messages.
*
* The component supports various styling variants through the BaseStatesDirective hostDirective,
* customizable buttons, and configurable behavior for dialog actions.
*
* @usageNotes
* ### Basic Usage
* ```html
*
* Are you sure you want to proceed?
*
* ```
*
* ```typescript
* @ViewChild('messageBox') messageBox: EuiMessageBoxComponent;
*
* showMessage() {
* this.messageBox.openMessageBox();
* }
* ```
*
* ### With Custom Footer
* ```html
*
*
Message content
*
*
*
*
* ```
*
* ### Accessibility
* - Modal traps focus within the dialog
* - Escape key closes the dialog by default
* - Accept/Dismiss buttons are keyboard accessible
*
* ### Notes
* - Use `openMessageBox()` and `closeMessageBox()` methods to control visibility
* - Supports draggable positioning with `isDraggable` input
* - Variant styling (primary, danger, warning, etc.) via BaseStatesDirective
*/
declare class EuiMessageBoxComponent implements AfterViewInit, OnDestroy {
/**
* Data attribute for e2e testing purposes.
* @default 'eui-dialog'
*/
e2eAttr: string;
/**
* Title text displayed in the message box header.
*/
title: string;
/**
* Width of the message box.
* @default '33rem'
*/
width: string;
/**
* Height of the message box.
* @default 'auto'
*/
height: string;
/**
* Whether to show the accept/confirm button.
* @default true
*/
hasAcceptButton: boolean;
/**
* Whether to show the dismiss/cancel button.
* @default true
*/
hasDismissButton: boolean;
/**
* Label for the accept/confirm button. Can be a translation key.
* @default 'eui.OK'
*/
acceptLabel: string;
/**
* Label for the dismiss/cancel button. Can be a translation key.
* @default 'eui.CANCEL'
*/
dismissLabel: string;
/**
* Whether to manually handle closing the dialog on dismiss button click.
* @default false
*/
isHandleCloseOnDismiss: boolean;
/**
* Whether to manually handle closing the dialog on close button click.
* @default false
*/
isHandleCloseOnClose: boolean;
/**
* Whether to manually handle closing the dialog on accept button click.
* @default false
*/
isHandleCloseOnAccept: boolean;
/**
* Whether the message box can be dragged around the screen.
* @default false
*/
isDraggable: boolean;
/**
* Whether to remove padding from the message box body.
* @default false
*/
hasNoBodyPadding: boolean;
/**
* Event emitted when the message box opens.
*/
messageBoxOpen: EventEmitter;
/**
* Event emitted when the message box closes.
*/
messageBoxClose: EventEmitter;
/**
* Event emitted when the dismiss/cancel button is clicked.
*/
dismiss: EventEmitter;
/**
* Event emitted when the accept/confirm button is clicked.
*/
accept: EventEmitter;
/**
* Reference to the template containing the message box content.
* This will be used to create a portal for the content section.
*/
templateRefContent: TemplateRef;
/**
* Reference to the template containing the message box footer.
* This will be used to create a portal for the footer section.
*/
templateRefFooter: TemplateRef;
/**
* Reference to any custom footer content provided through the eui-message-box-footer directive.
* Forward reference is used to resolve the circular dependency between the component and directive.
*/
euiMessageBoxFooterDirective: QueryList;
baseStatesDirective: BaseStatesDirective;
/**
* Content that will be displayed in the message box body.
* Can be either a simple string message or a TemplatePortal for more complex content.
*/
content: string | TemplatePortal;
/**
* Portal instance for the content section of the message box.
* Created from the templateRefContent template reference.
*/
private templatePortalContent;
/**
* Portal instance for the footer section of the message box.
* Created from the templateRefFooter template reference when a custom footer is provided.
*/
private templatePortalFooter;
/**
* Subject used for cleaning up subscriptions when the component is destroyed.
*/
private destroy$;
private viewContainerRef;
private euiMessageBoxService;
/**
* Lifecycle hook called after Angular has fully initialized the component's view.
* Creates the template portals for content and footer (if available).
*/
ngAfterViewInit(): void;
/**
* Lifecycle hook that's called when the component is destroyed.
* Cleans up any subscriptions to prevent memory leaks.
*/
ngOnDestroy(): void;
/**
* Opens the message box with the current configuration.
* This method configures and displays the message box using the EuiMessageBoxService.
*/
openMessageBox(): void;
/**
* Closes the currently open message box.
* This method uses the EuiMessageBoxService to close the dialog.
*/
closeMessageBox(): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
static ngAcceptInputType_hasAcceptButton: unknown;
static ngAcceptInputType_hasDismissButton: unknown;
static ngAcceptInputType_isHandleCloseOnDismiss: unknown;
static ngAcceptInputType_isHandleCloseOnClose: unknown;
static ngAcceptInputType_isHandleCloseOnAccept: unknown;
static ngAcceptInputType_isDraggable: unknown;
static ngAcceptInputType_hasNoBodyPadding: unknown;
}
declare class EuiMessageBoxFooterDirective {
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵdir: i0.ɵɵDirectiveDeclaration;
}
/**
* @description
* Service for programmatically creating, opening, and controlling message boxes in the eui application.
*
* The EuiMessageBoxService wraps the EuiDialogService to provide a simplified API specifically
* for message box functionality. Message boxes are specialized dialog windows typically used
* for alerts, confirmations, and prompts.
*
* The service handles the configuration of common message box properties and delegates to the
* underlying dialog service for rendering.
*
*
* @see EuiMessageBoxComponent
* @see EuiDialogService
*/
declare class EuiMessageBoxService {
private euiDialogService;
/**
* Opens a message box with the specified configuration.
*
* This method sets default message box properties and delegates to the dialog service
* to render the message box. Message boxes don't close on outside click or escape key,
* and have no header component or close button by default.
*
* @param config - Configuration options for the message box
* @typeParam HC - Header content type
* @typeParam HCC - Header component context type
* @typeParam BC - Body content type
* @typeParam BCC - Body component context type
* @typeParam FC - Footer content type
* @typeParam FCC - Footer component context type
*/
openMessageBox(config?: EuiDialogInterface): void;
/**
* Closes the currently active message box.
*
* This method delegates to the dialog service to close any open dialog.
*/
closeMessageBox(): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵprov: i0.ɵɵInjectableDeclaration;
}
declare class EuiMessageBoxConfig implements EuiDialogInterface {
e2eAttr: string;
acceptLabel: string;
dismissLabel: string;
variant: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'accent' | string;
width: string;
height: string;
hasCloseButton: boolean;
hasAcceptButton: boolean;
hasDismissButton: boolean;
hasClosedOnClickOutside: boolean;
hasClosedOnEscape: boolean;
isHandleCloseOnDismiss: boolean;
isHandleCloseOnClose: boolean;
isHandleCloseOnAccept: boolean;
isHandleCloseOnClickOutside: boolean;
isHandleCloseOnEscape: boolean;
hasFooter: boolean;
isMessageBox: boolean;
header: any;
headerComponent: any;
constructor(values: EuiDialogInterface);
}
declare class EuiMessageBoxComponentInstances {
headerComponent: HC;
bodyComponent: BC;
footerComponent: FC;
}
declare const EUI_MESSAGE_BOX: readonly [typeof EuiMessageBoxComponent, typeof EuiMessageBoxFooterDirective];
export { EUI_MESSAGE_BOX, EuiMessageBoxComponent, EuiMessageBoxComponentInstances, EuiMessageBoxConfig, EuiMessageBoxFooterDirective, EuiMessageBoxService };
//# sourceMappingURL=eui-components-eui-message-box.d.ts.map