chowa
Version:
UI component library based on React
55 lines (54 loc) • 1.82 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 PromptModalProps {
className?: string;
style?: React.CSSProperties;
title?: string;
onConfirm?: (value: string) => void;
onCancel?: (value: string) => void;
visible: boolean;
cancelText?: string;
confirmText?: string;
inputType?: string;
defaultValue?: string;
onHide?: () => void;
}
export interface PromptModalState {
value: string;
}
declare class PromptModal extends React.PureComponent<PromptModalProps, PromptModalState> {
static propTypes: {
className: PropTypes.Requireable<string>;
style: PropTypes.Requireable<object>;
title: PropTypes.Requireable<string>;
onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
visible: PropTypes.Validator<boolean>;
cancelText: PropTypes.Requireable<string>;
confirmText: PropTypes.Requireable<string>;
inputType: PropTypes.Requireable<string>;
defaultValue: PropTypes.Requireable<string | number>;
onHide: PropTypes.Requireable<(...args: any[]) => any>;
};
static defaultProps: {
inputType: string;
};
private inputIns;
constructor(props: PromptModalProps);
componentDidUpdate(preProps: PromptModalProps): void;
componentDidMount(): void;
private autoFocusOnBtn;
private onChangeHandler;
private onCancelHandler;
private onConfirmHandler;
render(): JSX.Element;
}
export default PromptModal;