///
import { IRenderableImageProps } from '../Generic.types';
export declare enum ConfirmMode {
OkCancel = 0,
YesNo = 1,
YesNoCancel = 2
}
export interface IReactModalClasses {
base?: string;
afterOpen?: string;
beforeClose?: string;
}
export interface IModalProps {
/**
* Controls whether the modal is open or not
*/
isOpen: boolean;
/**
* A function to call once the modal requests to be closed.
*/
onRequestClose: (evt: (MouseEvent | KeyboardEvent)) => void;
/**
* Animate opening and closing of the modal.
* @default true
*/
animate?: boolean;
/**
* Apply default padding for the modal.
* @default true
*/
padded?: boolean;
/**
* Display a close button in the top right corner of the modal.
* @default true
*/
showClose?: boolean;
/**
* An object containing three base classes { base, afterOpen, beforeClose } appended to the modal element.
*/
className?: IReactModalClasses;
/**
* An object containing three base classes { base, afterOpen, beforeClose } appended to the overlay.
*/
overlayClassName?: IReactModalClasses;
/**
* Any additional props are passed down to the underlying react-modal component
*/
[key: string]: any;
}
export interface IImageModalProps extends IModalProps, IRenderableImageProps {
/**
* An optional image title.
*/
title?: string;
/**
* An optional description for the image.
*/
description?: string;
}
export interface IDialogProps extends IModalProps {
/**
* The title of the dialog.
*/
title: string;
/**
* A function that should return the set of buttons to render. Preferrably inside a element.
*/
buttons?: () => JSX.Element | JSX.Element[];
/**
* The text on the default OK button. Not used if buttons render-prop is provided.
* @default 'OK'
*/
okText?: string;
/**
The title on the default OK button. Not used if buttons render-prop is provided.
@default 'OK'
*/
okTitle?: string;
/**
* The text on the default Cancel button. Not used if buttons render-prop is provided.
* @default 'Cancel'
*/
cancelText?: string;
/**
* The title on the default Cancel button. Not used if buttons render-prop is provided.
* @default 'Cancel'
*/
cancelTitle?: string;
/**
* The click event for the default OK button. Not used if button render-prop is provided.
* @default onRequestClose
*/
onOk?: (evt: React.MouseEvent) => void;
}
export interface IConfirmProps extends IDialogProps {
/**
* The types of buttons to render in the Confirm dialog
* @default ConfirmMode.OkCancel
*/
buttonMode?: ConfirmMode;
/**
* The text on the default Yes button. Not used if buttons render-prop is provided.
*/
yesText?: string;
/**
* The title on the default Yes button. Not used if buttons render-prop is provided.
*/
yesTitle?: string;
/**
* The text on the default No button. Not used if buttons render-prop is provided.
*/
noText?: string;
/**
* The title on the default No button. Not used if buttons render-prop is provided.
*/
noTitle?: string;
/**
* An optional handler for clicks on the no or cancel button. If not provided onRequestClose is called instead.
* noClicked will be true if the no button initiated the click.
* @default onRequestClose
*/
onNoCancel?: (evt: React.MouseEvent | undefined, noClicked?: boolean) => void;
}
export interface IPromptProps extends IConfirmProps {
/**
* An optional label for the dialog.
* @default 'Please input a value'
*/
label?: string;
/**
* Any additional props to pass to the input element.
* @default {}
*/
inputProps?: React.InputHTMLAttributes;
}