ant-design/components/modal/index.tsx

49 lines
997 B
TypeScript
Raw Normal View History

import Modal from './Modal';
2015-09-07 11:48:57 +08:00
import confirm from './confirm';
2016-06-22 13:18:43 +08:00
import assign from 'object-assign';
Modal.info = function (props) {
2016-06-22 13:18:43 +08:00
const config = assign({}, {
type: 'info',
iconType: 'info-circle',
okCancel: false,
2016-06-22 13:18:43 +08:00
}, props);
return confirm(config);
2015-09-07 11:48:57 +08:00
};
Modal.success = function (props) {
2016-06-22 13:18:43 +08:00
const config = assign({}, {
type: 'success',
iconType: 'check-circle',
okCancel: false,
2016-06-22 13:18:43 +08:00
}, props);
return confirm(config);
2015-09-07 11:48:57 +08:00
};
Modal.error = function (props) {
2016-06-22 13:18:43 +08:00
const config = assign({}, {
type: 'error',
iconType: 'cross-circle',
okCancel: false,
2016-06-22 13:18:43 +08:00
}, props);
return confirm(config);
2015-09-07 11:48:57 +08:00
};
2016-05-31 15:29:24 +08:00
Modal.warning = Modal.warn = function (props) {
2016-06-22 13:18:43 +08:00
const config = assign({}, {
2016-04-11 14:59:37 +08:00
type: 'warning',
iconType: 'exclamation-circle',
okCancel: false,
2016-06-22 13:18:43 +08:00
}, props);
2016-04-11 14:59:37 +08:00
return confirm(config);
};
Modal.confirm = function (props) {
2016-06-22 13:18:43 +08:00
const config = assign({}, {
type: 'confirm',
okCancel: true,
2016-06-22 13:18:43 +08:00
}, props);
return confirm(config);
2015-09-07 11:48:57 +08:00
};
export default Modal;