chowa
Version:
UI component library based on React
51 lines (50 loc) • 1.7 kB
TypeScript
/**
* @license chowa v1.1.3
*
* Copyright (c) Chowa Techonlogies Co.,Ltd.(http://www.chowa.cn).
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';
import * as PropTypes from 'prop-types';
export interface ConfirmModalProps {
className?: string;
style?: React.CSSProperties;
title?: string;
content: React.ReactNode;
onConfirm?: () => void;
onCancel?: () => void;
visible: boolean;
loading?: boolean;
cancelText?: string;
confirmText?: string;
onHide?: () => void;
}
declare class ConfirmModal extends React.PureComponent<ConfirmModalProps, any> {
static propTypes: {
className: PropTypes.Requireable<string>;
style: PropTypes.Requireable<object>;
title: PropTypes.Requireable<string>;
content: PropTypes.Validator<PropTypes.ReactNodeLike>;
onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
visible: PropTypes.Validator<boolean>;
loading: PropTypes.Requireable<boolean>;
cancelText: PropTypes.Requireable<string>;
confirmText: PropTypes.Requireable<string>;
onHide: PropTypes.Requireable<(...args: any[]) => any>;
};
static defaultProps: {
loading: boolean;
};
private btnIns;
constructor(props: ConfirmModalProps);
private onCancelHandler;
private onConfirmHandler;
componentDidUpdate(preProps: ConfirmModalProps): void;
componentDidMount(): void;
private autoFocusOnBtn;
render(): JSX.Element;
}
export default ConfirmModal;