1 | "use client";
|
2 |
|
3 | import confirm, { modalGlobalConfig, withConfirm, withError, withInfo, withSuccess, withWarn } from './confirm';
|
4 | import destroyFns from './destroyFns';
|
5 | import OriginModal from './Modal';
|
6 | import PurePanel from './PurePanel';
|
7 | import useModal from './useModal';
|
8 | function modalWarn(props) {
|
9 | return confirm(withWarn(props));
|
10 | }
|
11 | const Modal = OriginModal;
|
12 | Modal.useModal = useModal;
|
13 | Modal.info = function infoFn(props) {
|
14 | return confirm(withInfo(props));
|
15 | };
|
16 | Modal.success = function successFn(props) {
|
17 | return confirm(withSuccess(props));
|
18 | };
|
19 | Modal.error = function errorFn(props) {
|
20 | return confirm(withError(props));
|
21 | };
|
22 | Modal.warning = modalWarn;
|
23 | Modal.warn = modalWarn;
|
24 | Modal.confirm = function confirmFn(props) {
|
25 | return confirm(withConfirm(props));
|
26 | };
|
27 | Modal.destroyAll = function destroyAllFn() {
|
28 | while (destroyFns.length) {
|
29 | const close = destroyFns.pop();
|
30 | if (close) {
|
31 | close();
|
32 | }
|
33 | }
|
34 | };
|
35 | Modal.config = modalGlobalConfig;
|
36 | Modal._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
37 | if (process.env.NODE_ENV !== 'production') {
|
38 | Modal.displayName = 'Modal';
|
39 | }
|
40 | export default Modal; |
\ | No newline at end of file |