@unicom-cloud/ui 0.8.106 → 0.8.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.js +7 -0
- package/BackTop.js +2 -4
- package/Calendar.js +2 -2
- package/Modal.js +4 -2
- package/app/App.js +26 -0
- package/app/context.js +9 -0
- package/app/index.js +9 -0
- package/app/interface.js +1 -0
- package/app/useApp.js +8 -0
- package/back-top/index.js +44 -56
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/color-picker/index.js +34 -34
- package/components/common/flex/index.js +4 -4
- package/components/common/icons/file/index.js +13 -11
- package/components/common/utils/dayjs.js +99 -124
- package/components/common/utils/is.js +98 -104
- package/components/common/utils/setDir.js +12 -0
- package/components/common/utils/setTheme.js +13 -13
- package/config-provider/ConfigProvider.js +32 -30
- package/descriptions/index.js +32 -32
- package/divider/index.js +28 -20
- package/empty/index.js +1 -1
- package/grid/Grid.js +55 -88
- package/grid/Item.js +40 -61
- package/grid/context.js +1 -4
- package/grid/hook/useResponsiveState.js +22 -25
- package/grid/util.js +6 -44
- package/index.js +462 -457
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/Search.js +24 -24
- package/modal/Confirm.js +17 -17
- package/modal/Modal.js +247 -237
- package/modal/index.js +4 -2
- package/modal/use-modal/index.js +2 -2
- package/package.json +1 -1
- package/select-view/Core.js +31 -28
- package/splitter/SplitBar.js +44 -46
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/th-resizable/index.js +9 -10
- package/time-picker/util.js +20 -30
- package/types/common/development/interface.d.ts +3 -3
- package/types/common/utils/is.d.ts +3 -4
- package/types/common/utils/setDir.d.ts +2 -0
- package/types/pc/app/App.d.ts +6 -0
- package/types/pc/app/context.d.ts +4 -0
- package/types/pc/app/index.d.ts +5 -0
- package/types/pc/app/interface.d.ts +17 -0
- package/types/pc/app/useApp.d.ts +3 -0
- package/types/pc/back-top/interface.d.ts +4 -17
- package/types/pc/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +1 -1
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/grid/Grid.d.ts +1 -2
- package/types/pc/grid/Item.d.ts +2 -5
- package/types/pc/grid/context.d.ts +4 -10
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +9 -19
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/index.d.ts +3 -1
- package/types/pc/input/Button.d.ts +2 -2
- package/types/pc/message/index.d.ts +1 -9
- package/types/pc/message/interface.d.ts +8 -0
- package/types/pc/message/useMessage.d.ts +1 -2
- package/types/pc/modal/Modal.d.ts +1 -0
- package/types/pc/modal/config.d.ts +1 -2
- package/types/pc/modal/index.d.ts +2 -1
- package/types/pc/modal/interface.d.ts +17 -5
- package/types/pc/notification/index.d.ts +2 -9
- package/types/pc/notification/interface.d.ts +7 -0
- package/types/pc/notification/useNotification.d.ts +1 -2
- package/types/pc/select-view/Core.d.ts +1 -8
- package/types/pc/select-view/index.d.ts +1 -8
- package/types/pc/select-view/interface.d.ts +9 -2
- package/types/pc/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +303 -0
- package/utils/index.js +58 -59
- package/utils/is.js +65 -66
- package/utils/names.js +298 -144
- package/version/index.js +1 -1
package/modal/Modal.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { PqbCSSTransition as
|
|
14
|
-
import
|
|
15
|
-
import { contains as
|
|
16
|
-
import { Esc as
|
|
17
|
-
import { omit as
|
|
18
|
-
import { findDOMNode_ as
|
|
19
|
-
import
|
|
20
|
-
import { setModalConfig as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
let
|
|
24
|
-
|
|
1
|
+
import { jsxs as y, jsx as r, Fragment as nn } from "react/jsx-runtime";
|
|
2
|
+
import tn from "@unicom-cloud/icons/IconUiClose";
|
|
3
|
+
import de from "lodash/isFunction";
|
|
4
|
+
import rn, { forwardRef as on, useContext as ln, useRef as a, useState as N, useCallback as sn, useEffect as U } from "react";
|
|
5
|
+
import me from "../button/index.js";
|
|
6
|
+
import an from "../config-provider/ConfigProvider.js";
|
|
7
|
+
import cn from "../components/common/hooks/useIsFirstRender.js";
|
|
8
|
+
import un from "../components/common/hooks/useMergeProps.js";
|
|
9
|
+
import dn from "../components/common/hooks/useMergeValue.js";
|
|
10
|
+
import mn from "../components/common/hooks/useOverflowHidden.js";
|
|
11
|
+
import fn from "../icon-hover/index.js";
|
|
12
|
+
import pn from "../portal/index.js";
|
|
13
|
+
import { PqbCSSTransition as fe } from "../components/common/utils/PqbCSSTransition.js";
|
|
14
|
+
import W from "@unicom-cloud/utils/class-name";
|
|
15
|
+
import { contains as gn, isServerRendering as Cn } from "../components/common/utils/dom.js";
|
|
16
|
+
import { Esc as bn } from "@unicom-cloud/utils/constant/keyboardCode";
|
|
17
|
+
import { omit as hn } from "../components/common/utils/omit.js";
|
|
18
|
+
import { findDOMNode_ as xn } from "../components/common/utils/reactDOM.js";
|
|
19
|
+
import j from "./Confirm.js";
|
|
20
|
+
import { setModalConfig as vn, destroyList as pe } from "./config.js";
|
|
21
|
+
import kn from "./use-modal/index.js";
|
|
22
|
+
import wn from "../config-provider/context.js";
|
|
23
|
+
let Z = null, Mn = 0;
|
|
24
|
+
Cn || document.documentElement.addEventListener(
|
|
25
25
|
"click",
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
left:
|
|
29
|
-
top:
|
|
26
|
+
(o) => {
|
|
27
|
+
Z = {
|
|
28
|
+
left: o.clientX,
|
|
29
|
+
top: o.clientY
|
|
30
30
|
}, setTimeout(() => {
|
|
31
|
-
|
|
31
|
+
Z = null;
|
|
32
32
|
}, 100);
|
|
33
33
|
},
|
|
34
34
|
!0
|
|
35
35
|
);
|
|
36
|
-
const
|
|
36
|
+
const En = {
|
|
37
37
|
mask: !0,
|
|
38
38
|
maskClosable: !0,
|
|
39
39
|
mountOnEnter: !0,
|
|
@@ -41,153 +41,160 @@ const bn = {
|
|
|
41
41
|
getPopupContainer: () => document.body,
|
|
42
42
|
alignCenter: !0
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
function Tn(o, P) {
|
|
45
|
+
const u = ln(wn), d = un(
|
|
46
|
+
o,
|
|
47
|
+
En,
|
|
48
|
+
u.componentConfig?.Modal
|
|
49
49
|
), {
|
|
50
50
|
className: ge,
|
|
51
51
|
style: Ce,
|
|
52
|
-
visible:
|
|
53
|
-
simple:
|
|
54
|
-
title:
|
|
55
|
-
subtitle:
|
|
52
|
+
visible: l,
|
|
53
|
+
simple: A,
|
|
54
|
+
title: v,
|
|
55
|
+
subtitle: $,
|
|
56
56
|
children: be,
|
|
57
|
-
cancelText:
|
|
58
|
-
okText:
|
|
57
|
+
cancelText: he,
|
|
58
|
+
okText: xe,
|
|
59
59
|
okButtonProps: ve,
|
|
60
|
-
cancelButtonProps:
|
|
60
|
+
cancelButtonProps: ke,
|
|
61
61
|
getPopupContainer: D = () => document.body,
|
|
62
|
-
footer:
|
|
62
|
+
footer: m,
|
|
63
63
|
afterClose: we,
|
|
64
|
-
confirmLoading:
|
|
65
|
-
mountOnEnter:
|
|
66
|
-
unmountOnExit:
|
|
67
|
-
afterOpen:
|
|
68
|
-
hideCancel:
|
|
64
|
+
confirmLoading: Me,
|
|
65
|
+
mountOnEnter: R,
|
|
66
|
+
unmountOnExit: K,
|
|
67
|
+
afterOpen: Ee,
|
|
68
|
+
hideCancel: Te,
|
|
69
69
|
maskClosable: ye,
|
|
70
|
-
mask:
|
|
71
|
-
alignCenter:
|
|
72
|
-
getChildrenPopupContainer:
|
|
73
|
-
wrapClassName:
|
|
74
|
-
escToExit:
|
|
75
|
-
modalRender:
|
|
76
|
-
maskStyle:
|
|
77
|
-
wrapStyle:
|
|
78
|
-
closeIcon:
|
|
79
|
-
fullscreenable:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
mask: Ne,
|
|
71
|
+
alignCenter: Pe,
|
|
72
|
+
getChildrenPopupContainer: _,
|
|
73
|
+
wrapClassName: $e,
|
|
74
|
+
escToExit: I,
|
|
75
|
+
modalRender: G,
|
|
76
|
+
maskStyle: De,
|
|
77
|
+
wrapStyle: Re,
|
|
78
|
+
closeIcon: J,
|
|
79
|
+
fullscreenable: f,
|
|
80
|
+
cancelButton: p,
|
|
81
|
+
okButton: g,
|
|
82
|
+
draggable: Ie,
|
|
83
|
+
closable: Be,
|
|
84
|
+
...Oe
|
|
85
|
+
} = d, k = f ? !1 : Ne, B = f ? !1 : Ie, C = a(null), Q = a(null), i = a(null), [ee, ne] = N(), [te, Xe] = N(), w = a(null), b = a(!1), [Ye, re] = N(""), [Le, oe] = N("");
|
|
86
|
+
cn();
|
|
87
|
+
const O = a(!0);
|
|
88
|
+
l && O.current && (O.current = !1);
|
|
89
|
+
const M = a();
|
|
90
|
+
M.current || (M.current = Mn++);
|
|
91
|
+
const [Se, X] = dn(!1, {
|
|
89
92
|
defaultValue: !1,
|
|
90
|
-
value:
|
|
91
|
-
}), t =
|
|
92
|
-
|
|
93
|
-
function
|
|
94
|
-
e.stopPropagation(),
|
|
93
|
+
value: Me
|
|
94
|
+
}), t = u.getPrefixCls?.("modal"), He = u.getPrefixCls?.("modal-var"), { locale: Y, rtl: le } = u, Ve = !A, Fe = f ? !0 : "closable" in d ? Be : Ve, ze = sn(() => xn(D()), [D]);
|
|
95
|
+
mn(ze, { hidden: l && k });
|
|
96
|
+
function L(e) {
|
|
97
|
+
e.stopPropagation(), S();
|
|
95
98
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
99
|
+
function S() {
|
|
100
|
+
d.onCancel?.();
|
|
98
101
|
}
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
const qe = (e) => {
|
|
103
|
+
I && l && e.key === bn.key && (e.stopPropagation(), S());
|
|
104
|
+
}, H = a(!1), Ue = (e) => {
|
|
105
|
+
b.current && (b.current = !1, !H.current && ye && k && e.target === e.currentTarget && setTimeout(() => {
|
|
106
|
+
S();
|
|
104
107
|
}, 100));
|
|
105
|
-
},
|
|
106
|
-
const n = (
|
|
107
|
-
n?.then && (
|
|
108
|
+
}, We = (e) => {
|
|
109
|
+
const n = (d.onOk ?? d.onConfirm)?.(e);
|
|
110
|
+
n?.then && (X(!0), n.then(
|
|
108
111
|
() => {
|
|
109
|
-
|
|
112
|
+
X(!1);
|
|
110
113
|
},
|
|
111
|
-
(
|
|
112
|
-
|
|
114
|
+
(s) => {
|
|
115
|
+
X(!1), console.error(s);
|
|
113
116
|
}
|
|
114
117
|
));
|
|
115
118
|
};
|
|
116
|
-
|
|
119
|
+
U(() => {
|
|
117
120
|
let e = null;
|
|
118
|
-
return
|
|
119
|
-
|
|
121
|
+
return I && (e = setTimeout(() => {
|
|
122
|
+
gn(document.body, C.current) && C.current?.focus();
|
|
120
123
|
})), () => {
|
|
121
124
|
e && clearTimeout(e);
|
|
122
125
|
};
|
|
123
|
-
}, [
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
const e = +window.getComputedStyle(
|
|
127
|
-
isNaN(e) ||
|
|
126
|
+
}, [l, I]);
|
|
127
|
+
const Ze = () => {
|
|
128
|
+
if (l && te === void 0 && C.current) {
|
|
129
|
+
const e = +window.getComputedStyle(C.current, null)?.zIndex;
|
|
130
|
+
isNaN(e) || Xe(e + 1);
|
|
128
131
|
}
|
|
129
|
-
},
|
|
130
|
-
if (
|
|
132
|
+
}, je = () => {
|
|
133
|
+
if (m === !1 || m === null)
|
|
131
134
|
return;
|
|
132
|
-
const e =
|
|
133
|
-
|
|
135
|
+
const e = p?.visible !== !1 && /* @__PURE__ */ r(
|
|
136
|
+
me,
|
|
134
137
|
{
|
|
135
|
-
onClick:
|
|
136
|
-
...
|
|
137
|
-
...
|
|
138
|
-
children:
|
|
138
|
+
onClick: L,
|
|
139
|
+
...ke,
|
|
140
|
+
...p?.props,
|
|
141
|
+
children: p?.props?.children || p?.label || p?.text || he || Y?.Modal.cancelText
|
|
139
142
|
}
|
|
140
|
-
), n =
|
|
141
|
-
|
|
143
|
+
), n = g?.visible !== !1 && /* @__PURE__ */ r(
|
|
144
|
+
me,
|
|
142
145
|
{
|
|
143
|
-
loading:
|
|
144
|
-
onClick:
|
|
146
|
+
loading: Se,
|
|
147
|
+
onClick: We,
|
|
145
148
|
type: "primary",
|
|
146
149
|
...ve,
|
|
147
|
-
...
|
|
148
|
-
children:
|
|
150
|
+
...g?.props,
|
|
151
|
+
children: g?.props?.children || g?.label || g?.text || xe || Y?.Modal.okText
|
|
149
152
|
}
|
|
150
|
-
),
|
|
151
|
-
!
|
|
153
|
+
), s = de(m) ? m(e, n) : m || /* @__PURE__ */ y(nn, { children: [
|
|
154
|
+
!Te && e,
|
|
152
155
|
n
|
|
153
156
|
] });
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
if (s)
|
|
158
|
+
return /* @__PURE__ */ r("div", { className: `${t}-footer`, children: s });
|
|
159
|
+
}, V = a(
|
|
160
|
+
ie()
|
|
161
|
+
);
|
|
162
|
+
function Ae(e) {
|
|
163
|
+
if (!i.current) return;
|
|
159
164
|
e.preventDefault();
|
|
160
|
-
const n =
|
|
161
|
-
n.screenX = e.screenX, n.screenY = e.screenY, n.prewTranslateX = n.translateX, n.prewTranslateY = n.translateY, n.boundingClientRect =
|
|
162
|
-
}
|
|
165
|
+
const n = V.current;
|
|
166
|
+
n.screenX = e.screenX, n.screenY = e.screenY, n.prewTranslateX = n.translateX, n.prewTranslateY = n.translateY, n.boundingClientRect = i.current?.getBoundingClientRect?.() ?? {}, n.offsetParentBoundingClientRect = i.current?.offsetParent?.getBoundingClientRect?.() ?? {}, Ke();
|
|
167
|
+
}
|
|
168
|
+
function se(e) {
|
|
163
169
|
e.preventDefault();
|
|
164
|
-
const n =
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
let
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
const n = V.current, { left: s, right: z, top: q, bottom: Je } = n.boundingClientRect ?? {}, { width: Qe, height: en } = n.offsetParentBoundingClientRect ?? {};
|
|
171
|
+
let h = Math.max(e.screenX - n.screenX, -s);
|
|
172
|
+
h = Math.min(h, Qe - z);
|
|
173
|
+
let x = Math.max(e.screenY - n.screenY, -q);
|
|
174
|
+
x = Math.min(x, en - Je), h += n.prewTranslateX, x += n.prewTranslateY, n.translateX = h, n.translateY = x, re(`translate(${h}px, ${x}px)`);
|
|
175
|
+
}
|
|
176
|
+
function ae(e) {
|
|
177
|
+
e.preventDefault(), E();
|
|
178
|
+
}
|
|
179
|
+
function Ke() {
|
|
180
|
+
E(), document.documentElement.addEventListener(
|
|
174
181
|
"mousemove",
|
|
175
|
-
|
|
182
|
+
se
|
|
176
183
|
), document.documentElement.addEventListener(
|
|
177
184
|
"mouseup",
|
|
178
|
-
|
|
185
|
+
ae
|
|
179
186
|
);
|
|
180
187
|
}
|
|
181
|
-
function
|
|
188
|
+
function E() {
|
|
182
189
|
document.documentElement.removeEventListener(
|
|
183
190
|
"mousemove",
|
|
184
|
-
|
|
191
|
+
se
|
|
185
192
|
), document.documentElement.removeEventListener(
|
|
186
193
|
"mouseup",
|
|
187
|
-
|
|
194
|
+
ae
|
|
188
195
|
);
|
|
189
196
|
}
|
|
190
|
-
function
|
|
197
|
+
function ie() {
|
|
191
198
|
return {
|
|
192
199
|
screenX: 0,
|
|
193
200
|
screenY: 0,
|
|
@@ -199,138 +206,140 @@ function xn(l, y) {
|
|
|
199
206
|
offsetParentBoundingClientRect: null
|
|
200
207
|
};
|
|
201
208
|
}
|
|
202
|
-
function
|
|
203
|
-
|
|
209
|
+
function F(e) {
|
|
210
|
+
V.current = ie(), re(""), oe("");
|
|
204
211
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}, []),
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
212
|
+
U(() => () => {
|
|
213
|
+
F(), E();
|
|
214
|
+
}, []), U(() => {
|
|
215
|
+
if (B !== !1)
|
|
216
|
+
return i.current || (F(), E()), () => {
|
|
217
|
+
};
|
|
218
|
+
}, [i.current, B]);
|
|
219
|
+
const _e = /* @__PURE__ */ y(
|
|
220
|
+
an,
|
|
211
221
|
{
|
|
212
|
-
...
|
|
222
|
+
...u,
|
|
213
223
|
childrenName: "Modal",
|
|
214
|
-
prefixCls:
|
|
215
|
-
locale:
|
|
216
|
-
zIndex:
|
|
217
|
-
getPopupContainer: (e) => typeof
|
|
224
|
+
prefixCls: u.prefixCls,
|
|
225
|
+
locale: Y,
|
|
226
|
+
zIndex: te || 1050,
|
|
227
|
+
getPopupContainer: (e) => typeof _ == "function" ? _(e) : Q.current,
|
|
218
228
|
children: [
|
|
219
|
-
(!!
|
|
220
|
-
!!
|
|
229
|
+
(!!v || !!$) && /* @__PURE__ */ y("div", { className: `${t}-header`, children: [
|
|
230
|
+
!!v && /* @__PURE__ */ r(
|
|
221
231
|
"div",
|
|
222
232
|
{
|
|
223
233
|
className: `${t}-title`,
|
|
224
234
|
id: `pqb-dialog-${M.current}`,
|
|
225
|
-
children:
|
|
235
|
+
children: v
|
|
226
236
|
}
|
|
227
237
|
),
|
|
228
|
-
|
|
238
|
+
!!$ && /* @__PURE__ */ r("div", { className: `${t}-subtitle`, children: $ })
|
|
229
239
|
] }),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
|
|
232
|
-
|
|
240
|
+
/* @__PURE__ */ r("div", { ref: Q, className: `${t}-content`, children: be }),
|
|
241
|
+
je(),
|
|
242
|
+
B !== !1 && /* @__PURE__ */ r(
|
|
233
243
|
"div",
|
|
234
244
|
{
|
|
235
245
|
className: `${t}-drag-icon`,
|
|
236
|
-
onMouseDown:
|
|
237
|
-
onDoubleClick:
|
|
246
|
+
onMouseDown: Ae,
|
|
247
|
+
onDoubleClick: F
|
|
238
248
|
}
|
|
239
249
|
),
|
|
240
|
-
|
|
250
|
+
Fe && (J !== void 0 ? /* @__PURE__ */ r(
|
|
241
251
|
"span",
|
|
242
252
|
{
|
|
243
253
|
className: `${t}-close-icon`,
|
|
244
|
-
onClick:
|
|
245
|
-
children:
|
|
254
|
+
onClick: L,
|
|
255
|
+
children: J
|
|
246
256
|
}
|
|
247
|
-
) : /* @__PURE__ */
|
|
248
|
-
|
|
257
|
+
) : /* @__PURE__ */ r(
|
|
258
|
+
fn,
|
|
249
259
|
{
|
|
250
260
|
tabIndex: -1,
|
|
251
261
|
className: `${t}-close-icon`,
|
|
252
|
-
onClick:
|
|
262
|
+
onClick: L,
|
|
253
263
|
role: "button",
|
|
254
264
|
"aria-label": "Close",
|
|
255
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ r(tn, {})
|
|
256
266
|
}
|
|
257
267
|
))
|
|
258
268
|
]
|
|
259
269
|
}
|
|
260
|
-
),
|
|
270
|
+
), Ge = v ? { "aria-labelledby": `pqb-dialog-${M.current}` } : {}, ce = /* @__PURE__ */ r(
|
|
261
271
|
"div",
|
|
262
272
|
{
|
|
263
273
|
role: "dialog",
|
|
264
274
|
"aria-modal": "true",
|
|
265
|
-
...
|
|
266
|
-
className:
|
|
275
|
+
...Ge,
|
|
276
|
+
className: W(
|
|
267
277
|
t,
|
|
268
278
|
{
|
|
269
|
-
[`${t}-simple`]:
|
|
270
|
-
[`${t}-rtl`]:
|
|
271
|
-
[`${t}-fullscreenable`]:
|
|
279
|
+
[`${t}-simple`]: A,
|
|
280
|
+
[`${t}-rtl`]: le,
|
|
281
|
+
[`${t}-fullscreenable`]: f
|
|
272
282
|
},
|
|
273
283
|
ge
|
|
274
284
|
),
|
|
275
285
|
style: {
|
|
286
|
+
[`--${He}-transform`]: Ye,
|
|
276
287
|
...Ce,
|
|
277
|
-
|
|
278
|
-
transformOrigin:
|
|
288
|
+
...f ? { width: "100%", height: "100%" } : {},
|
|
289
|
+
transformOrigin: Le
|
|
279
290
|
},
|
|
280
|
-
ref:
|
|
281
|
-
children:
|
|
291
|
+
ref: i,
|
|
292
|
+
children: _e
|
|
282
293
|
}
|
|
283
|
-
),
|
|
284
|
-
if (te)
|
|
285
|
-
return;
|
|
294
|
+
), T = (e) => {
|
|
286
295
|
let n = "";
|
|
287
|
-
if (
|
|
288
|
-
const
|
|
289
|
-
n = `${
|
|
296
|
+
if (w.current) {
|
|
297
|
+
const s = e.getBoundingClientRect(), { left: z, top: q } = w.current;
|
|
298
|
+
n = `${z - s.left}px ${q - s.top}px`;
|
|
290
299
|
}
|
|
291
|
-
|
|
292
|
-
},
|
|
293
|
-
return
|
|
294
|
-
|
|
300
|
+
oe(n);
|
|
301
|
+
}, ue = O.current ? !R : !!i.current;
|
|
302
|
+
return l || ue ? /* @__PURE__ */ r(
|
|
303
|
+
pn,
|
|
295
304
|
{
|
|
296
|
-
visible:
|
|
297
|
-
forceRender:
|
|
305
|
+
visible: l,
|
|
306
|
+
forceRender: ue,
|
|
298
307
|
getContainer: D,
|
|
299
|
-
children: /* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ y(
|
|
300
309
|
"div",
|
|
301
310
|
{
|
|
302
|
-
ref:
|
|
303
|
-
className: `${t}-container
|
|
311
|
+
ref: P,
|
|
312
|
+
className: W(`${t}-container`),
|
|
304
313
|
children: [
|
|
305
|
-
|
|
306
|
-
|
|
314
|
+
k ? /* @__PURE__ */ r(
|
|
315
|
+
fe,
|
|
307
316
|
{
|
|
308
|
-
in:
|
|
317
|
+
in: l,
|
|
309
318
|
timeout: 400,
|
|
310
319
|
appear: !0,
|
|
311
|
-
mountOnEnter:
|
|
320
|
+
mountOnEnter: R,
|
|
312
321
|
classNames: "fadeModal",
|
|
313
|
-
unmountOnExit:
|
|
322
|
+
unmountOnExit: K,
|
|
314
323
|
onEnter: (e) => {
|
|
315
324
|
e && (e.style.display = "block");
|
|
316
325
|
},
|
|
317
326
|
onExited: (e) => {
|
|
318
327
|
e && (e.style.display = "none");
|
|
319
328
|
},
|
|
320
|
-
children: /* @__PURE__ */
|
|
329
|
+
children: /* @__PURE__ */ r(
|
|
321
330
|
"div",
|
|
322
331
|
{
|
|
323
332
|
"aria-hidden": !0,
|
|
324
333
|
className: `${t}-mask`,
|
|
325
|
-
style:
|
|
334
|
+
style: De
|
|
326
335
|
}
|
|
327
336
|
)
|
|
328
337
|
}
|
|
329
338
|
) : null,
|
|
330
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ r(
|
|
331
340
|
"div",
|
|
332
341
|
{
|
|
333
|
-
...
|
|
342
|
+
...hn(Oe, [
|
|
334
343
|
"content",
|
|
335
344
|
"icon",
|
|
336
345
|
"showIcon",
|
|
@@ -344,57 +353,57 @@ function xn(l, y) {
|
|
|
344
353
|
]),
|
|
345
354
|
tabIndex: -1,
|
|
346
355
|
ref: (e) => {
|
|
347
|
-
|
|
356
|
+
C.current = e, Ze();
|
|
348
357
|
},
|
|
349
|
-
className:
|
|
358
|
+
className: W(
|
|
350
359
|
`${t}-wrapper`,
|
|
360
|
+
k ? `${t}-wrapper-mask` : `${t}-wrapper-no-mask`,
|
|
351
361
|
{
|
|
352
|
-
[`${t}-wrapper-
|
|
353
|
-
[`${t}-wrapper-
|
|
354
|
-
[`${t}-wrapper-rtl`]: oe
|
|
362
|
+
[`${t}-wrapper-align-center`]: Pe,
|
|
363
|
+
[`${t}-wrapper-rtl`]: le
|
|
355
364
|
},
|
|
356
|
-
|
|
365
|
+
$e
|
|
357
366
|
),
|
|
358
367
|
style: {
|
|
359
|
-
...
|
|
368
|
+
...Re || {},
|
|
360
369
|
// 必须 visible=false,立即设置display:none,否则modal加载react-monaco-editor的时候,编辑器显示异常
|
|
361
|
-
display:
|
|
362
|
-
overflow: !
|
|
370
|
+
display: l || ee ? "block" : "none",
|
|
371
|
+
overflow: !l && ee ? "hidden" : ""
|
|
363
372
|
},
|
|
364
|
-
onKeyDown:
|
|
373
|
+
onKeyDown: qe,
|
|
365
374
|
onMouseDown: (e) => {
|
|
366
|
-
|
|
375
|
+
b.current = e.target === e.currentTarget;
|
|
367
376
|
},
|
|
368
|
-
onClick:
|
|
369
|
-
children: /* @__PURE__ */
|
|
370
|
-
|
|
377
|
+
onClick: Ue,
|
|
378
|
+
children: /* @__PURE__ */ r(
|
|
379
|
+
fe,
|
|
371
380
|
{
|
|
372
|
-
in:
|
|
381
|
+
in: l,
|
|
373
382
|
timeout: 400,
|
|
374
383
|
appear: !0,
|
|
375
384
|
classNames: "zoomModal",
|
|
376
|
-
unmountOnExit:
|
|
377
|
-
mountOnEnter:
|
|
385
|
+
unmountOnExit: K,
|
|
386
|
+
mountOnEnter: R,
|
|
378
387
|
onEnter: (e) => {
|
|
379
|
-
e && (
|
|
388
|
+
e && (ne(!0), w.current = Z, T(e));
|
|
380
389
|
},
|
|
381
390
|
onEntered: (e) => {
|
|
382
|
-
e && (
|
|
391
|
+
e && (T(e), w.current = null, Ee?.());
|
|
383
392
|
},
|
|
384
|
-
onExit: () => {
|
|
385
|
-
|
|
393
|
+
onExit: (e) => {
|
|
394
|
+
e && (T(e), H.current = !0);
|
|
386
395
|
},
|
|
387
396
|
onExited: (e) => {
|
|
388
|
-
e && (
|
|
397
|
+
e && (ne(!1), T(e), we?.(), H.current = !1);
|
|
389
398
|
},
|
|
390
|
-
children:
|
|
391
|
-
|
|
399
|
+
children: rn.cloneElement(
|
|
400
|
+
de(G) ? G(ce) : ce,
|
|
392
401
|
{
|
|
393
402
|
onMouseDown: () => {
|
|
394
|
-
|
|
403
|
+
b.current = !1;
|
|
395
404
|
},
|
|
396
405
|
onMouseUp: () => {
|
|
397
|
-
|
|
406
|
+
b.current = !1;
|
|
398
407
|
}
|
|
399
408
|
}
|
|
400
409
|
)
|
|
@@ -408,27 +417,28 @@ function xn(l, y) {
|
|
|
408
417
|
}
|
|
409
418
|
) : null;
|
|
410
419
|
}
|
|
411
|
-
const
|
|
412
|
-
|
|
420
|
+
const c = on(
|
|
421
|
+
Tn
|
|
413
422
|
);
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
["info", "success", "warning", "error"].forEach((
|
|
420
|
-
|
|
421
|
-
...
|
|
423
|
+
c.displayName = "Modal";
|
|
424
|
+
c.config = vn;
|
|
425
|
+
c.show = (o) => j({ ...o, noticeType: "show" });
|
|
426
|
+
c.confirm = (o) => j(o);
|
|
427
|
+
c.useModal = kn;
|
|
428
|
+
["info", "success", "warning", "error"].forEach((o) => {
|
|
429
|
+
c[o] = (P) => j({
|
|
430
|
+
...P,
|
|
422
431
|
isNotice: !0,
|
|
423
|
-
noticeType:
|
|
432
|
+
noticeType: o
|
|
424
433
|
});
|
|
425
434
|
});
|
|
426
|
-
|
|
435
|
+
c.destroyAll = () => {
|
|
427
436
|
for (; pe.length; ) {
|
|
428
|
-
const
|
|
429
|
-
|
|
437
|
+
const o = pe.pop();
|
|
438
|
+
o && o();
|
|
430
439
|
}
|
|
431
440
|
};
|
|
432
441
|
export {
|
|
433
|
-
|
|
442
|
+
c as default,
|
|
443
|
+
kn as useModal
|
|
434
444
|
};
|