index.js
839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import OriginModal, { destroyFns } from './Modal';
import confirm, { withWarn, withInfo, withSuccess, withError, withConfirm, globalConfig } from './confirm';
function modalWarn(props) {
return confirm(withWarn(props));
}
var Modal = OriginModal;
Modal.info = function infoFn(props) {
return confirm(withInfo(props));
};
Modal.success = function successFn(props) {
return confirm(withSuccess(props));
};
Modal.error = function errorFn(props) {
return confirm(withError(props));
};
Modal.warning = modalWarn;
Modal.warn = modalWarn;
Modal.confirm = function confirmFn(props) {
return confirm(withConfirm(props));
};
Modal.destroyAll = function destroyAllFn() {
while (destroyFns.length) {
var close = destroyFns.pop();
if (close) {
close();
}
}
};
Modal.config = globalConfig;
export default Modal;