choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
50 lines (43 loc) • 1.18 kB
JavaScript
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import ModalManager from '../modal-manager';
import Modal from './Modal';
import { open } from '../modal-container/ModalContainer';
import confirm from './confirm';
import preview from './preview';
import { normalizeProps } from './utils';
Modal.key = ModalManager.getKey;
Modal.open = open;
Modal.confirm = confirm;
Modal.preview = preview;
Modal.info = function (props) {
return confirm(_objectSpread({
type: 'info',
okCancel: false
}, normalizeProps(props)));
};
Modal.success = function (props) {
return confirm(_objectSpread({
type: 'success',
iconType: 'check_circle',
okCancel: false
}, normalizeProps(props)));
};
Modal.error = function (props) {
return confirm(_objectSpread({
type: 'error',
iconType: 'cancel',
okCancel: false
}, normalizeProps(props)));
};
Modal.warning = function (props) {
return confirm(_objectSpread({
type: 'warning',
iconType: 'warning',
okCancel: false
}, normalizeProps(props)));
};
Modal.destroyAll = function destroyAllFn() {
ModalManager.clear();
};
export default Modal;
//# sourceMappingURL=index.js.map