index.js
1.19 KB
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
41
42
43
44
45
46
47
48
49
50
51
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _Modal = _interopRequireWildcard(require("./Modal"));
var _confirm = _interopRequireWildcard(require("./confirm"));
function modalWarn(props) {
return (0, _confirm["default"])((0, _confirm.withWarn)(props));
}
var Modal = _Modal["default"];
Modal.info = function infoFn(props) {
return (0, _confirm["default"])((0, _confirm.withInfo)(props));
};
Modal.success = function successFn(props) {
return (0, _confirm["default"])((0, _confirm.withSuccess)(props));
};
Modal.error = function errorFn(props) {
return (0, _confirm["default"])((0, _confirm.withError)(props));
};
Modal.warning = modalWarn;
Modal.warn = modalWarn;
Modal.confirm = function confirmFn(props) {
return (0, _confirm["default"])((0, _confirm.withConfirm)(props));
};
Modal.destroyAll = function destroyAllFn() {
while (_Modal.destroyFns.length) {
var close = _Modal.destroyFns.pop();
if (close) {
close();
}
}
};
Modal.config = _confirm.globalConfig;
var _default = Modal;
exports["default"] = _default;