import { type ComponentType, type MouseEvent, type ReactElement, type ReactNode, type RefObject } from "react"; import { type ArrowOffsets } from "../Bubble/typings.js"; import { type IButtonAccessibilityConfig } from "../Button/typings.js"; import { type IAlignPoint } from "../typings/positioning.js"; /** * @internal */ export interface IDialogBaseProps { children?: ReactNode; className?: string; dataTestId?: string; displayCloseButton?: boolean; accessibilityConfig?: { closeButton?: IButtonAccessibilityConfig; titleElementId?: string; descriptionElementId?: string; isModal?: boolean; title?: string; dialogId?: string; }; isModal?: boolean; submitOnEnterKey?: boolean; shouldCloseOnEscape?: boolean; onCancel?: (data?: any) => void; onClose?: (data?: any) => void; onSubmit?: (data?: any) => void; /** * These properties will be placed to the container, which wraps overlay background and dialog content elements */ containerClassName?: string; shouldCloseOnClick?: (e: Event) => boolean; onClick?: (e: MouseEvent) => void; onMouseOver?: (e: MouseEvent) => void; onMouseUp?: (e: MouseEvent) => void; /** * If true, the dialog will autofocus on the first focusable element when it is opened. * Default is true. */ autofocusOnOpen?: boolean; /** * When this value changes, the dialog will refocus the first focusable element. * Only works when autofocusOnOpen is true. */ refocusKey?: unknown; CloseButton?: ComponentType; initialFocus?: RefObject | string; returnFocusTo?: RefObject | string; returnFocusAfterClose?: boolean; /** * customize if you know that dialog content has some custom focusIn logic which modifies focused element, eg. table which shifts its focus from table wrapper to first table cell * default is check if active element is exactly focused element. */ focusCheckFn?: (element: HTMLElement) => boolean; } /** * @internal */ export interface IDialogProps extends IDialogBaseProps { /** * These properties will be placed to the container, which wraps overlay background and dialog content elements */ containerClassName?: string; shouldCloseOnClick?: (e: Event) => boolean; onClick?: (e: MouseEvent) => void; onMouseOver?: (e: MouseEvent) => void; onMouseUp?: (e: MouseEvent) => void; onClose?: () => void; isModal?: boolean; alignPoints?: IAlignPoint[]; closeOnEscape?: boolean; closeOnParentScroll?: boolean; closeOnMouseDrag?: boolean; } /** * Props of {@link ConfirmDialogFooter} — the default footer of {@link ConfirmDialogBase}. * * @internal */ export interface IConfirmDialogFooterProps { /** * Content rendered before the buttons (the footer-left area). */ footerLeft?: ReactNode; showProgressIndicator?: boolean; cancelButtonText?: string; onCancel?: () => void; isCancelDisabled?: boolean; submitButtonText?: string; onSubmit?: () => void; isSubmitDisabled?: boolean; submitButtonTooltipText?: string; submitButtonTooltipAlignPoints?: IAlignPoint[]; submitButtonTooltipArrowOffsets?: ArrowOffsets; hideSubmitButton?: boolean; isPositive?: boolean; } /** * @internal */ export interface IConfirmDialogBaseProps extends Omit { isSubmitDisabled?: boolean; isCancelDisabled?: boolean; isPositive?: boolean; cancelButtonText?: string; submitButtonText?: string; submitButtonTooltipText?: string; submitButtonTooltipAlignPoints?: IAlignPoint[]; submitButtonTooltipArrowOffsets?: ArrowOffsets; hideSubmitButton?: boolean; warning?: string | ReactElement; showProgressIndicator?: boolean; headerLeftButtonRenderer?: () => ReactElement; /** * Called on the default footer path to render footer-left content. Ignored when * {@link IConfirmDialogBaseProps.footerRenderer} is set — {@link IConfirmDialogBaseProps.footerRenderer} * takes precedence and replaces the whole footer, including this content. */ footerLeftRenderer?: () => ReactElement; /** * When set, replaces the whole footer element ({@link ConfirmDialogFooter}). Takes precedence * over {@link IConfirmDialogBaseProps.footerLeftRenderer}. A renderer that does not render * {@link ConfirmDialogFooter} loses the submit-button contracts it carries (Enter-key submit * detection via its element id, and the validation aria wiring). */ footerRenderer?: () => ReactElement; dialogHeaderClassName?: string; titleRightIconRenderer?: () => ReactElement; headline?: string; initialFocus?: RefObject | string; returnFocusTo?: RefObject | string; returnFocusAfterClose?: boolean; accessibilityConfig?: { closeButton?: IButtonAccessibilityConfig; titleElementId?: string; descriptionElementId?: string; dialogId?: string; }; } /** * @internal */ export interface IExportDialogProps extends IExportDialogBaseProps { containerClassName?: string; } /** * @internal */ export interface IExportDialogBaseProps extends Pick { filterContextText?: string; filterContextTitle?: string | null; filterContextVisible?: boolean; includeFilterContext?: boolean; mergeHeaders?: boolean; mergeHeadersDisabled?: boolean; mergeHeadersText?: string; mergeHeadersTitle?: string | null; onSubmit?: (data: IExportDialogData) => void; } /** * @internal */ export type IDialogCloseButtonProps = Pick & { className?: string; }; /** * @internal */ export type IExportDialogData = Pick; /** * @internal */ export type PageOrientation = "PORTRAIT" | "LANDSCAPE"; /** * @internal */ export type PageSize = "A3" | "A4" | "LETTER"; /** * Data returned by PDF export dialog on submit. * @internal */ export type IExportTabularPdfDialogData = { pageSize?: PageSize; pageOrientation?: PageOrientation; showInfoPage?: boolean; }; /** * Props for the ExportTabularPdfDialog component. * @internal */ export interface IExportTabularPdfDialogProps { pageSize?: PageSize; pageOrientation?: PageOrientation; showInfoPage?: boolean; isShowInfoPageVisible?: boolean; displayCloseButton?: boolean; isPositive?: boolean; isSubmitDisabled?: boolean; cancelButtonText?: string; submitButtonText?: string; onSubmit?: (data: IExportTabularPdfDialogData) => void; onCancel?: () => void; } //# sourceMappingURL=typings.d.ts.map