@unicom-cloud/ui 0.8.53 → 0.8.54
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/Affix.js +1 -1
- package/Alert.js +1 -1
- package/Anchor.js +1 -1
- package/AutoComplete.js +3 -3
- package/Avatar.js +1 -1
- package/BackTop.js +1 -1
- package/Badge.js +1 -1
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +3 -3
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +3 -3
- package/Comment.js +1 -1
- package/ConfigProvider.js +2 -2
- package/Copy.js +1 -1
- package/DatePicker.js +3 -3
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Drawer.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Form.js +1 -1
- package/Grid.js +2 -2
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/Input.js +1 -1
- package/InputNumber.js +2 -2
- package/InputTag.js +1 -1
- package/Layout.js +2 -2
- package/Link.js +1 -1
- package/List.js +3 -3
- package/Mentions.js +3 -3
- package/Menu.js +1 -1
- package/Message.js +1 -1
- package/Modal.js +1 -1
- package/Notice.js +2 -2
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Pagination.js +1 -1
- package/Picker.js +1 -1
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/Radio.js +2 -2
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/Select.js +1 -1
- package/SelectView.js +3 -3
- package/Skeleton.js +1 -1
- package/Slider.js +2 -2
- package/Space.js +1 -1
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +1 -1
- package/Table.js +4 -4
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/TimePicker.js +3 -3
- package/Timeline.js +1 -1
- package/Tooltip.js +1 -1
- package/Transfer.js +3 -3
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +1 -1
- package/Typography.js +22 -22
- package/Upload.js +1 -1
- package/VerificationCode.js +1 -1
- package/Watermark.js +1 -1
- package/chunk/{CmEyvBdT.js → BC0PujUD.js} +2 -2
- package/chunk/{B8IzaBdN.js → BH5fVprw.js} +1 -1
- package/chunk/{CyVLxv_U.js → BUQBof6z.js} +3 -3
- package/chunk/{CBaVCRtG.js → BdJcAQ0Q.js} +1 -1
- package/chunk/{BOUZ7hSf.js → BmtF7P8U.js} +2 -2
- package/chunk/{CccPQyYX.js → BzMYgxgO.js} +1 -1
- package/chunk/{DfMf16uZ.js → BzqZZHGK.js} +2 -2
- package/chunk/{CLU6Le34.js → C3I_L73_.js} +1 -1
- package/chunk/{8hWViek4.js → CIc4yo9k.js} +1 -1
- package/chunk/{COWsswcW.js → CK0H_Yi4.js} +2 -2
- package/chunk/{PRN8SqRA.js → CTSIr-Pr.js} +1 -1
- package/chunk/{DY9WA4bf.js → CqcZfQQ4.js} +1 -1
- package/chunk/{Cwp65v9h.js → CzTYWtfa.js} +1 -1
- package/chunk/{D3pUE3-b.js → DG7VgAhL.js} +3 -3
- package/chunk/{DdVbiC4t.js → DTgc2wl4.js} +2 -2
- package/chunk/{D6BMh1k4.js → DZGcv_9A.js} +1 -1
- package/chunk/{-sV-N67P.js → DbtCtriE.js} +1 -1
- package/chunk/{BEiJmFHq.js → DdtfPvgk.js} +1 -1
- package/chunk/{Cz65nXZD.js → Dki1RB5p.js} +2 -2
- package/chunk/{CYyPBcnp.js → Niaq_og8.js} +2 -2
- package/chunk/{BEVtQ2QL.js → PuuHmqnW.js} +2 -2
- package/chunk/{DGK45cuc.js → RL1SNlng.js} +1 -1
- package/chunk/{DNyP-r9G.js → RRWbBHK-.js} +2 -2
- package/chunk/{CRxPui7e.js → ShWkfsJd.js} +2 -2
- package/chunk/{bcn23eHi.js → i1A7W8Qt.js} +1 -1
- package/chunk/qSJXQ1qu.js +640 -0
- package/chunk/{Lyg-9NEt.js → xPzFRQJn.js} +19 -18
- package/index.js +22 -22
- package/package.json +1 -1
- package/types/modal/config.d.ts +1 -0
- package/types/modal/interface.d.ts +1 -0
- package/utils/contextHolder.js +1 -1
- package/chunk/BYMRs7t5.js +0 -607
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as g, useContext as u, useRef as p, useCallback as d, useEffect as C } from "react";
|
|
3
|
-
import { a as h } from "./
|
|
3
|
+
import { a as h } from "./xPzFRQJn.js";
|
|
4
4
|
import x from "../hooks/use-watermark.js";
|
|
5
5
|
import k from "../hooks/useMergeProps.js";
|
|
6
6
|
import w from "@unicom-cloud/utils/class-name";
|
|
@@ -2,7 +2,7 @@ import { jsx as u, jsxs as et } from "react/jsx-runtime";
|
|
|
2
2
|
import ft from "lodash/isFunction";
|
|
3
3
|
import kt from "lodash/isPlainObject";
|
|
4
4
|
import F, { useContext as nt, useRef as j, useState as wt, useEffect as Y, useMemo as at, useCallback as ce, useImperativeHandle as le } from "react";
|
|
5
|
-
import { a as mt, I as pt } from "./
|
|
5
|
+
import { a as mt, I as pt } from "./xPzFRQJn.js";
|
|
6
6
|
import se from "../hooks/useId.js";
|
|
7
7
|
import fe from "../hooks/useMergeProps.js";
|
|
8
8
|
import de from "../hooks/useMergeValue.js";
|
|
@@ -17,7 +17,7 @@ import { setTransformStyle as me } from "../utils/style.js";
|
|
|
17
17
|
import jt from "@unicom-cloud/icons/IconUiDown";
|
|
18
18
|
import Ut from "lodash/isNull";
|
|
19
19
|
import pe from "../Dropdown.js";
|
|
20
|
-
import { M as Mt } from "./
|
|
20
|
+
import { M as Mt } from "./BC0PujUD.js";
|
|
21
21
|
import ge from "lodash/isEqualWith";
|
|
22
22
|
import be from "../utils/throttleByRaf.js";
|
|
23
23
|
import Et from "@unicom-cloud/icons/IconUiLeft";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as N, jsxs as b } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as w, useContext as R, useRef as F, Fragment as j, createElement as z } from "react";
|
|
3
|
-
import { a as D } from "./
|
|
3
|
+
import { a as D } from "./xPzFRQJn.js";
|
|
4
4
|
import E from "../hooks/useMergeProps.js";
|
|
5
|
-
import { I as K } from "./
|
|
5
|
+
import { I as K } from "./CzTYWtfa.js";
|
|
6
6
|
import u from "@unicom-cloud/utils/class-name";
|
|
7
7
|
import L from "../hooks/use-verification-code.js";
|
|
8
8
|
const M = {
|
|
@@ -2,7 +2,7 @@ import { jsxs as W, jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import oe from "@unicom-cloud/icons/IconUiClose";
|
|
3
3
|
import A from "lodash/isArray";
|
|
4
4
|
import { forwardRef as fe, useContext as se, useRef as U, useState as te, useImperativeHandle as ne } from "react";
|
|
5
|
-
import { a as me, I as re } from "./
|
|
5
|
+
import { a as me, I as re } from "./xPzFRQJn.js";
|
|
6
6
|
import q from "@unicom-cloud/utils/class-name";
|
|
7
7
|
import { Enter as ie, Tab as de } from "../utils/keyCode.js";
|
|
8
8
|
import $e from "../utils/omit.js";
|
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
import { jsx as i, jsxs as L, Fragment as en } from "react/jsx-runtime";
|
|
2
|
+
import nn from "@unicom-cloud/icons/IconUiClose";
|
|
3
|
+
import Me from "lodash/isFunction";
|
|
4
|
+
import tn, { forwardRef as De, useState as D, useImperativeHandle as on, useRef as b, useContext as rn, useCallback as U, useEffect as oe } from "react";
|
|
5
|
+
import we from "../Button.js";
|
|
6
|
+
import { d as T, b as $e, g as ln, e as sn, f as an, s as cn, a as un, h as w, I as dn } from "./xPzFRQJn.js";
|
|
7
|
+
import "lodash/isEqualWith";
|
|
8
|
+
import mn from "../hooks/useMergeValue.js";
|
|
9
|
+
import "../utils/is.js";
|
|
10
|
+
import { Esc as fn } from "../utils/keyCode.js";
|
|
11
|
+
import "lodash/isNumber";
|
|
12
|
+
import "lodash/merge";
|
|
13
|
+
import { isServerRendering as pn, contains as Cn } from "../utils/dom.js";
|
|
14
|
+
import "@unicom-cloud/utils/clipboard-copy";
|
|
15
|
+
import "@unicom-cloud/utils/screenfull";
|
|
16
|
+
import "lodash/throttle";
|
|
17
|
+
import "../hooks/useIntersectionObserver.js";
|
|
18
|
+
import hn from "../hooks/useUpdateEffect.js";
|
|
19
|
+
import "../hooks/useLocation.js";
|
|
20
|
+
import bn from "../hooks/useMergeProps.js";
|
|
21
|
+
import "../hooks/useNetworkState.js";
|
|
22
|
+
import gn from "../hooks/useOverflowHidden.js";
|
|
23
|
+
import { render as xn, findDOMNode as vn } from "../utils/reactDOM.js";
|
|
24
|
+
import "@unicom-cloud/utils/tween/easing";
|
|
25
|
+
import kn from "../Portal.js";
|
|
26
|
+
import { P as Te } from "./DQ3uFRJD.js";
|
|
27
|
+
import Ne from "@unicom-cloud/utils/class-name";
|
|
28
|
+
import yn from "../utils/omit.js";
|
|
29
|
+
import En from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
30
|
+
import Mn from "@unicom-cloud/icons/IconUiCloseCircleFill";
|
|
31
|
+
import Pe from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
32
|
+
import wn from "@unicom-cloud/icons/IconUiInfoCircleFill";
|
|
33
|
+
function Tn(n) {
|
|
34
|
+
const { prefixCls: l, simple: c } = sn();
|
|
35
|
+
return /* @__PURE__ */ i(y, { prefixCls: l, simple: c, ...n, children: n.content });
|
|
36
|
+
}
|
|
37
|
+
const V = (n) => {
|
|
38
|
+
let l = n.icon;
|
|
39
|
+
if (!l && l !== null && (l = /* @__PURE__ */ i(Pe, {}), n.isNotice))
|
|
40
|
+
switch (n.noticeType) {
|
|
41
|
+
case "info":
|
|
42
|
+
l = /* @__PURE__ */ i(wn, {});
|
|
43
|
+
break;
|
|
44
|
+
case "success":
|
|
45
|
+
l = /* @__PURE__ */ i(En, {});
|
|
46
|
+
break;
|
|
47
|
+
case "warning":
|
|
48
|
+
l = /* @__PURE__ */ i(Pe, {});
|
|
49
|
+
break;
|
|
50
|
+
case "error":
|
|
51
|
+
l = /* @__PURE__ */ i(Mn, {});
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
return n.noticeType === "show" && (l = n.icon), n.isNotice && (n.hideCancel = !0), n.title = l === null && n.title === null ? null : /* @__PURE__ */ L("span", { children: [
|
|
55
|
+
l,
|
|
56
|
+
n.title
|
|
57
|
+
] }), n;
|
|
58
|
+
};
|
|
59
|
+
function le(n, l) {
|
|
60
|
+
let c;
|
|
61
|
+
const s = document.createElement("div");
|
|
62
|
+
document.body.appendChild(s);
|
|
63
|
+
const f = ln();
|
|
64
|
+
function g(a) {
|
|
65
|
+
const C = /* @__PURE__ */ i($e, { ...f, children: /* @__PURE__ */ i(Tn, { ...a, onCancel: h }) });
|
|
66
|
+
c ? c.render(C) : c = xn(C, s);
|
|
67
|
+
}
|
|
68
|
+
const o = g;
|
|
69
|
+
let r = {
|
|
70
|
+
...n,
|
|
71
|
+
visible: !1
|
|
72
|
+
};
|
|
73
|
+
const u = () => {
|
|
74
|
+
let a;
|
|
75
|
+
const C = n.onOk;
|
|
76
|
+
C && (a = C(h)), a && a.then && (r.confirmLoading = !0, o(r), a.then(
|
|
77
|
+
() => {
|
|
78
|
+
h(!0);
|
|
79
|
+
},
|
|
80
|
+
(p) => {
|
|
81
|
+
console.error(p), r.confirmLoading = !1, o(r);
|
|
82
|
+
}
|
|
83
|
+
)), a || h(!0);
|
|
84
|
+
};
|
|
85
|
+
r.onOk = u, r = V(r), r.visible = !0, o(r);
|
|
86
|
+
function x() {
|
|
87
|
+
c = c == null ? void 0 : c._unmount(), s.parentNode && s.parentNode.removeChild(s);
|
|
88
|
+
for (let a = 0; a < T.length; a++)
|
|
89
|
+
if (T[a] === v) {
|
|
90
|
+
T.splice(a, 1);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function h(a) {
|
|
95
|
+
var C;
|
|
96
|
+
!a && ((C = n.onCancel) == null || C.call(n)), v();
|
|
97
|
+
}
|
|
98
|
+
function M(a) {
|
|
99
|
+
r = {
|
|
100
|
+
...r,
|
|
101
|
+
title: n.title,
|
|
102
|
+
// 避免 newConfig 未传递 title 时,icon 出现多个的问题
|
|
103
|
+
...a
|
|
104
|
+
}, r = V(r), o(r);
|
|
105
|
+
}
|
|
106
|
+
function v() {
|
|
107
|
+
r.visible = !1, r.afterClose = () => {
|
|
108
|
+
var a;
|
|
109
|
+
(a = n.afterClose) == null || a.call(n), x();
|
|
110
|
+
}, o(r);
|
|
111
|
+
}
|
|
112
|
+
return T.push(v), {
|
|
113
|
+
close: v,
|
|
114
|
+
update: M
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function Nn(n, l) {
|
|
118
|
+
const [c, s] = D(!0), [f, g] = D(n);
|
|
119
|
+
on(l, () => ({
|
|
120
|
+
update: (u) => {
|
|
121
|
+
g(u);
|
|
122
|
+
},
|
|
123
|
+
close: () => {
|
|
124
|
+
s(!1);
|
|
125
|
+
}
|
|
126
|
+
}));
|
|
127
|
+
function o() {
|
|
128
|
+
var x;
|
|
129
|
+
const u = (x = f.onOk) == null ? void 0 : x.call(f);
|
|
130
|
+
u && u.then && (g((h) => ({
|
|
131
|
+
...h,
|
|
132
|
+
confirmLoading: !0
|
|
133
|
+
})), u.then(
|
|
134
|
+
() => {
|
|
135
|
+
s(!1);
|
|
136
|
+
},
|
|
137
|
+
(h) => {
|
|
138
|
+
console.error(h), g((M) => ({
|
|
139
|
+
...M,
|
|
140
|
+
confirmLoading: !1
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
)), u || s(!1);
|
|
144
|
+
}
|
|
145
|
+
function r() {
|
|
146
|
+
var u;
|
|
147
|
+
(u = f.onCancel) == null || u.call(f), s(!1);
|
|
148
|
+
}
|
|
149
|
+
return /* @__PURE__ */ i(
|
|
150
|
+
y,
|
|
151
|
+
{
|
|
152
|
+
unmountOnExit: !0,
|
|
153
|
+
simple: !0,
|
|
154
|
+
...f,
|
|
155
|
+
visible: c,
|
|
156
|
+
onOk: o,
|
|
157
|
+
onCancel: r,
|
|
158
|
+
children: f.content
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
const Pn = De(Nn);
|
|
163
|
+
function Dn() {
|
|
164
|
+
const n = b(), l = /* @__PURE__ */ i(an, { ref: n });
|
|
165
|
+
let c = 0;
|
|
166
|
+
function s(o) {
|
|
167
|
+
var C;
|
|
168
|
+
c += 1;
|
|
169
|
+
let r, u = { ...o };
|
|
170
|
+
function x() {
|
|
171
|
+
var p;
|
|
172
|
+
(p = o.afterClose) == null || p.call(o), M();
|
|
173
|
+
}
|
|
174
|
+
const h = /* @__PURE__ */ i(
|
|
175
|
+
Pn,
|
|
176
|
+
{
|
|
177
|
+
ref: (p) => {
|
|
178
|
+
r = p;
|
|
179
|
+
},
|
|
180
|
+
...V({ ...o }),
|
|
181
|
+
afterClose: x
|
|
182
|
+
},
|
|
183
|
+
c
|
|
184
|
+
);
|
|
185
|
+
(C = n.current) == null || C.addInstance(h);
|
|
186
|
+
function M() {
|
|
187
|
+
var p;
|
|
188
|
+
(p = n.current) == null || p.removeInstance(h);
|
|
189
|
+
}
|
|
190
|
+
function v() {
|
|
191
|
+
r == null || r.close();
|
|
192
|
+
}
|
|
193
|
+
function a(p) {
|
|
194
|
+
u = {
|
|
195
|
+
...u,
|
|
196
|
+
...p
|
|
197
|
+
}, r == null || r.update(V({ ...u }));
|
|
198
|
+
}
|
|
199
|
+
return T.push(v), {
|
|
200
|
+
close: v,
|
|
201
|
+
update: a
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function f(o) {
|
|
205
|
+
return s({
|
|
206
|
+
...o
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
const g = {
|
|
210
|
+
confirm: f,
|
|
211
|
+
show: f
|
|
212
|
+
// 潘启宝添加于 2023年10月18日 星期三 10时31分58秒 CST
|
|
213
|
+
};
|
|
214
|
+
return ["info", "success", "warning", "error"].forEach((o) => {
|
|
215
|
+
g[o] = (r) => s({
|
|
216
|
+
...r,
|
|
217
|
+
isNotice: !0,
|
|
218
|
+
noticeType: o
|
|
219
|
+
});
|
|
220
|
+
}), [g, l];
|
|
221
|
+
}
|
|
222
|
+
let re = null, $n = 0;
|
|
223
|
+
pn || document.documentElement.addEventListener(
|
|
224
|
+
"click",
|
|
225
|
+
(n) => {
|
|
226
|
+
re = {
|
|
227
|
+
left: n.clientX,
|
|
228
|
+
top: n.clientY
|
|
229
|
+
}, setTimeout(() => {
|
|
230
|
+
re = null;
|
|
231
|
+
}, 100);
|
|
232
|
+
},
|
|
233
|
+
!0
|
|
234
|
+
);
|
|
235
|
+
const In = {
|
|
236
|
+
mask: !0,
|
|
237
|
+
maskClosable: !0,
|
|
238
|
+
mountOnEnter: !0,
|
|
239
|
+
escToExit: !0,
|
|
240
|
+
getPopupContainer: () => document.body,
|
|
241
|
+
alignCenter: !0
|
|
242
|
+
};
|
|
243
|
+
function On(n, l) {
|
|
244
|
+
var Ee;
|
|
245
|
+
l || (l = b());
|
|
246
|
+
const c = rn(un), s = bn(
|
|
247
|
+
n,
|
|
248
|
+
In,
|
|
249
|
+
(Ee = c.componentConfig) == null ? void 0 : Ee.Modal
|
|
250
|
+
), {
|
|
251
|
+
className: f,
|
|
252
|
+
style: g,
|
|
253
|
+
visible: o,
|
|
254
|
+
simple: r,
|
|
255
|
+
title: u,
|
|
256
|
+
subtitle: x,
|
|
257
|
+
children: h,
|
|
258
|
+
cancelText: M,
|
|
259
|
+
okText: v,
|
|
260
|
+
okButtonProps: a,
|
|
261
|
+
cancelButtonProps: C,
|
|
262
|
+
getPopupContainer: p = () => document.body,
|
|
263
|
+
footer: H,
|
|
264
|
+
afterClose: z,
|
|
265
|
+
confirmLoading: Ie,
|
|
266
|
+
mountOnEnter: q,
|
|
267
|
+
unmountOnExit: W,
|
|
268
|
+
afterOpen: Z,
|
|
269
|
+
hideCancel: Oe,
|
|
270
|
+
maskClosable: Re,
|
|
271
|
+
mask: S,
|
|
272
|
+
alignCenter: Le,
|
|
273
|
+
getChildrenPopupContainer: se,
|
|
274
|
+
wrapClassName: He,
|
|
275
|
+
escToExit: j,
|
|
276
|
+
modalRender: ie,
|
|
277
|
+
maskStyle: Se,
|
|
278
|
+
wrapStyle: Xe,
|
|
279
|
+
closeIcon: ae,
|
|
280
|
+
fullscreenable: Rn,
|
|
281
|
+
...ce
|
|
282
|
+
} = s, $ = b(null), ue = b(null), k = b(null), [de, me] = D(), [fe, Ye] = D(), X = b(null), I = b(!1), [Be, pe] = D(""), [Ce, he] = D(""), A = b(!0);
|
|
283
|
+
o && A.current && (A.current = !1);
|
|
284
|
+
const Y = b();
|
|
285
|
+
Y.current || (Y.current = $n++);
|
|
286
|
+
const [Fe, K] = mn(!1, {
|
|
287
|
+
defaultValue: !1,
|
|
288
|
+
value: Ie
|
|
289
|
+
}), d = c.getPrefixCls("modal", s.prefixCls), { locale: G, rtl: be } = c, Ue = !r || ce.noticeType === "show", Ve = "closable" in s ? s.closable : Ue, ze = U(() => vn(p()), [p]);
|
|
290
|
+
gn(ze, { hidden: o && S });
|
|
291
|
+
function J(e) {
|
|
292
|
+
e.stopPropagation(), Q();
|
|
293
|
+
}
|
|
294
|
+
function Q() {
|
|
295
|
+
var e;
|
|
296
|
+
(e = s.onCancel) == null || e.call(s);
|
|
297
|
+
}
|
|
298
|
+
const qe = (e) => {
|
|
299
|
+
j && o && e.key === fn.key && (e.stopPropagation(), Q());
|
|
300
|
+
}, _ = b(!1), We = (e) => {
|
|
301
|
+
I.current && (I.current = !1, !_.current && Re && S && e.target === e.currentTarget && setTimeout(() => {
|
|
302
|
+
Q();
|
|
303
|
+
}, 100));
|
|
304
|
+
}, Ze = (e) => {
|
|
305
|
+
var m;
|
|
306
|
+
const t = (m = s.onOk ?? s.onConfirm) == null ? void 0 : m(e);
|
|
307
|
+
t != null && t.then && (K(!0), t.then(
|
|
308
|
+
() => {
|
|
309
|
+
K(!1);
|
|
310
|
+
},
|
|
311
|
+
(E) => {
|
|
312
|
+
K(!1), console.error(E);
|
|
313
|
+
}
|
|
314
|
+
));
|
|
315
|
+
};
|
|
316
|
+
hn(() => {
|
|
317
|
+
if (!s.hidePreviousModal || !(l != null && l.current))
|
|
318
|
+
return;
|
|
319
|
+
const e = w.indexOf(l.current);
|
|
320
|
+
if (e !== -1 && w.splice(e, 1), o) {
|
|
321
|
+
for (const m of w)
|
|
322
|
+
m instanceof HTMLElement && m.style instanceof CSSStyleDeclaration && m.style.setProperty("display", "none");
|
|
323
|
+
w.push(l.current);
|
|
324
|
+
}
|
|
325
|
+
const t = w.at(w.length - 1);
|
|
326
|
+
return t instanceof HTMLElement && t.style instanceof CSSStyleDeclaration && t.style.removeProperty("display"), () => {
|
|
327
|
+
};
|
|
328
|
+
}, [o, l == null ? void 0 : l.current]), oe(() => {
|
|
329
|
+
let e = null;
|
|
330
|
+
return j && (e = setTimeout(() => {
|
|
331
|
+
var t;
|
|
332
|
+
Cn(document.body, $.current) && ((t = $.current) == null || t.focus());
|
|
333
|
+
})), () => {
|
|
334
|
+
e && clearTimeout(e);
|
|
335
|
+
};
|
|
336
|
+
}, [o, j]);
|
|
337
|
+
const je = () => {
|
|
338
|
+
var e;
|
|
339
|
+
if (o && fe === void 0 && $.current) {
|
|
340
|
+
const t = +((e = window.getComputedStyle($.current, null)) == null ? void 0 : e.zIndex);
|
|
341
|
+
isNaN(t) || Ye(t + 1);
|
|
342
|
+
}
|
|
343
|
+
}, Ae = () => {
|
|
344
|
+
if (H === null) return;
|
|
345
|
+
const e = /* @__PURE__ */ i(we, { onClick: J, ...C, children: M || G.Modal.cancelText }), t = /* @__PURE__ */ i(
|
|
346
|
+
we,
|
|
347
|
+
{
|
|
348
|
+
loading: Fe,
|
|
349
|
+
onClick: Ze,
|
|
350
|
+
type: "primary",
|
|
351
|
+
...a,
|
|
352
|
+
children: v || G.Modal.okText
|
|
353
|
+
}
|
|
354
|
+
), m = Me(H) ? H(e, t) : H || /* @__PURE__ */ L(en, { children: [
|
|
355
|
+
!Oe && e,
|
|
356
|
+
t
|
|
357
|
+
] });
|
|
358
|
+
return /* @__PURE__ */ i("div", { className: `${d}-footer`, children: m });
|
|
359
|
+
}, ee = b(
|
|
360
|
+
ve()
|
|
361
|
+
), Ke = U((e) => {
|
|
362
|
+
var m, E, N, P, F;
|
|
363
|
+
if (!k.current)
|
|
364
|
+
return;
|
|
365
|
+
e.preventDefault();
|
|
366
|
+
const t = ee.current;
|
|
367
|
+
t.screenX = e.screenX, t.screenY = e.screenY, t.prewTranslateX = t.translateX, t.prewTranslateY = t.translateY, t.boundingClientRect = ((E = (m = k.current) == null ? void 0 : m.getBoundingClientRect) == null ? void 0 : E.call(m)) ?? {}, t.offsetParentBoundingClientRect = ((F = (P = (N = k.current) == null ? void 0 : N.offsetParent) == null ? void 0 : P.getBoundingClientRect) == null ? void 0 : F.call(P)) ?? {}, B(), Ge();
|
|
368
|
+
}, []), ge = U((e) => {
|
|
369
|
+
e.preventDefault();
|
|
370
|
+
const t = ee.current, { left: m, right: E, top: N, bottom: P } = t.boundingClientRect ?? {}, { width: F, height: _e } = t.offsetParentBoundingClientRect ?? {};
|
|
371
|
+
let O = Math.max(e.screenX - t.screenX, -m);
|
|
372
|
+
O = Math.min(O, F - E);
|
|
373
|
+
let R = Math.max(e.screenY - t.screenY, -N);
|
|
374
|
+
R = Math.min(R, _e - P), O += t.prewTranslateX, R += t.prewTranslateY, t.translateX = O, t.translateY = R, pe(`translate(${O}px, ${R}px)`);
|
|
375
|
+
}, []), xe = U((e) => {
|
|
376
|
+
e.preventDefault(), B();
|
|
377
|
+
}, []);
|
|
378
|
+
function Ge() {
|
|
379
|
+
document.documentElement.addEventListener(
|
|
380
|
+
"mousemove",
|
|
381
|
+
ge
|
|
382
|
+
), document.documentElement.addEventListener(
|
|
383
|
+
"mouseup",
|
|
384
|
+
xe
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
function B() {
|
|
388
|
+
document.documentElement.removeEventListener(
|
|
389
|
+
"mousemove",
|
|
390
|
+
ge
|
|
391
|
+
), document.documentElement.removeEventListener(
|
|
392
|
+
"mouseup",
|
|
393
|
+
xe
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
function ve() {
|
|
397
|
+
return {
|
|
398
|
+
screenX: 0,
|
|
399
|
+
screenY: 0,
|
|
400
|
+
prewTranslateX: 0,
|
|
401
|
+
prewTranslateY: 0,
|
|
402
|
+
translateX: 0,
|
|
403
|
+
translateY: 0,
|
|
404
|
+
boundingClientRect: null,
|
|
405
|
+
offsetParentBoundingClientRect: null
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
function ne() {
|
|
409
|
+
ee.current = ve(), pe(""), he("");
|
|
410
|
+
}
|
|
411
|
+
oe(() => () => {
|
|
412
|
+
ne(), B();
|
|
413
|
+
}, []), oe(() => (k.current || (ne(), B()), () => {
|
|
414
|
+
}), [k.current]);
|
|
415
|
+
const Je = /* @__PURE__ */ L(
|
|
416
|
+
$e,
|
|
417
|
+
{
|
|
418
|
+
...c,
|
|
419
|
+
prefixCls: s.prefixCls || c.prefixCls,
|
|
420
|
+
locale: G,
|
|
421
|
+
zIndex: fe || 1050,
|
|
422
|
+
getPopupContainer: (e) => typeof se == "function" ? se(e) : ue.current,
|
|
423
|
+
children: [
|
|
424
|
+
(!!u || !!x) && /* @__PURE__ */ L("div", { className: `${d}-header`, children: [
|
|
425
|
+
!!u && /* @__PURE__ */ i(
|
|
426
|
+
"div",
|
|
427
|
+
{
|
|
428
|
+
className: `${d}-title`,
|
|
429
|
+
id: `pqb-dialog-${Y.current}`,
|
|
430
|
+
children: u
|
|
431
|
+
}
|
|
432
|
+
),
|
|
433
|
+
!!x && /* @__PURE__ */ i("div", { className: `${d}-subtitle`, children: x })
|
|
434
|
+
] }),
|
|
435
|
+
/* @__PURE__ */ i("div", { ref: ue, className: `${d}-content`, children: h }),
|
|
436
|
+
Ae(),
|
|
437
|
+
!s.fullscreenable && s.draggable !== !1 && /* @__PURE__ */ i(
|
|
438
|
+
"div",
|
|
439
|
+
{
|
|
440
|
+
className: `${d}-drag-icon`,
|
|
441
|
+
onMouseDown: Ke,
|
|
442
|
+
onDoubleClick: ne
|
|
443
|
+
}
|
|
444
|
+
),
|
|
445
|
+
(Ve || !!s.fullscreenable) && (ae !== void 0 ? /* @__PURE__ */ i(
|
|
446
|
+
"span",
|
|
447
|
+
{
|
|
448
|
+
className: `${d}-close-icon`,
|
|
449
|
+
onClick: J,
|
|
450
|
+
children: ae
|
|
451
|
+
}
|
|
452
|
+
) : /* @__PURE__ */ i(
|
|
453
|
+
dn,
|
|
454
|
+
{
|
|
455
|
+
tabIndex: -1,
|
|
456
|
+
className: `${d}-close-icon`,
|
|
457
|
+
onClick: J,
|
|
458
|
+
role: "button",
|
|
459
|
+
"aria-label": "Close",
|
|
460
|
+
children: /* @__PURE__ */ i(nn, {})
|
|
461
|
+
}
|
|
462
|
+
))
|
|
463
|
+
]
|
|
464
|
+
}
|
|
465
|
+
), Qe = u ? { "aria-labelledby": `pqb-dialog-${Y.current}` } : {}, ke = /* @__PURE__ */ i(
|
|
466
|
+
"div",
|
|
467
|
+
{
|
|
468
|
+
role: "dialog",
|
|
469
|
+
"aria-modal": "true",
|
|
470
|
+
...Qe,
|
|
471
|
+
className: Ne(
|
|
472
|
+
d,
|
|
473
|
+
{
|
|
474
|
+
[`${d}-simple`]: r,
|
|
475
|
+
[`${d}-rtl`]: be,
|
|
476
|
+
[`${d}-fullscreenable`]: s.fullscreenable
|
|
477
|
+
},
|
|
478
|
+
f
|
|
479
|
+
),
|
|
480
|
+
style: {
|
|
481
|
+
...g,
|
|
482
|
+
transform: Be,
|
|
483
|
+
transformOrigin: Ce
|
|
484
|
+
},
|
|
485
|
+
ref: k,
|
|
486
|
+
children: Je
|
|
487
|
+
}
|
|
488
|
+
), te = (e) => {
|
|
489
|
+
if (Ce)
|
|
490
|
+
return;
|
|
491
|
+
let t = "";
|
|
492
|
+
if (X.current) {
|
|
493
|
+
const m = e.getBoundingClientRect(), { left: E, top: N } = X.current;
|
|
494
|
+
t = `${E - m.left}px ${N - m.top}px`;
|
|
495
|
+
}
|
|
496
|
+
he(t);
|
|
497
|
+
}, ye = A.current ? !q : !!k.current;
|
|
498
|
+
return o || ye ? /* @__PURE__ */ i(
|
|
499
|
+
kn,
|
|
500
|
+
{
|
|
501
|
+
visible: o,
|
|
502
|
+
forceRender: ye,
|
|
503
|
+
getContainer: p,
|
|
504
|
+
children: /* @__PURE__ */ L(
|
|
505
|
+
"div",
|
|
506
|
+
{
|
|
507
|
+
ref: l,
|
|
508
|
+
className: `${d}-container`,
|
|
509
|
+
children: [
|
|
510
|
+
S ? /* @__PURE__ */ i(
|
|
511
|
+
Te,
|
|
512
|
+
{
|
|
513
|
+
in: o,
|
|
514
|
+
timeout: 400,
|
|
515
|
+
appear: !0,
|
|
516
|
+
mountOnEnter: q,
|
|
517
|
+
classNames: "fadeModal",
|
|
518
|
+
unmountOnExit: W,
|
|
519
|
+
onEnter: (e) => {
|
|
520
|
+
e && (e.style.display = "block");
|
|
521
|
+
},
|
|
522
|
+
onExited: (e) => {
|
|
523
|
+
e && (e.style.display = "none");
|
|
524
|
+
},
|
|
525
|
+
children: /* @__PURE__ */ i(
|
|
526
|
+
"div",
|
|
527
|
+
{
|
|
528
|
+
"aria-hidden": !0,
|
|
529
|
+
className: `${d}-mask`,
|
|
530
|
+
style: Se
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
}
|
|
534
|
+
) : null,
|
|
535
|
+
/* @__PURE__ */ i(
|
|
536
|
+
"div",
|
|
537
|
+
{
|
|
538
|
+
...yn(ce, [
|
|
539
|
+
"content",
|
|
540
|
+
"icon",
|
|
541
|
+
"showIcon",
|
|
542
|
+
"isNotice",
|
|
543
|
+
"noticeType",
|
|
544
|
+
"onCancel",
|
|
545
|
+
"onOk",
|
|
546
|
+
"onConfirm",
|
|
547
|
+
"closable",
|
|
548
|
+
"prefixCls"
|
|
549
|
+
]),
|
|
550
|
+
tabIndex: -1,
|
|
551
|
+
ref: (e) => {
|
|
552
|
+
$.current = e, je();
|
|
553
|
+
},
|
|
554
|
+
className: Ne(
|
|
555
|
+
`${d}-wrapper`,
|
|
556
|
+
{
|
|
557
|
+
[`${d}-wrapper-no-mask`]: !S,
|
|
558
|
+
[`${d}-wrapper-align-center`]: Le,
|
|
559
|
+
[`${d}-wrapper-rtl`]: be
|
|
560
|
+
},
|
|
561
|
+
He
|
|
562
|
+
),
|
|
563
|
+
style: {
|
|
564
|
+
...Xe || {},
|
|
565
|
+
// 必须 visible=false,立即设置display:none,否则modal加载react-monaco-editor的时候,编辑器显示异常
|
|
566
|
+
display: o || de ? "block" : "none",
|
|
567
|
+
overflow: !o && de ? "hidden" : ""
|
|
568
|
+
},
|
|
569
|
+
onKeyDown: qe,
|
|
570
|
+
onMouseDown: (e) => {
|
|
571
|
+
I.current = e.target === e.currentTarget;
|
|
572
|
+
},
|
|
573
|
+
onClick: We,
|
|
574
|
+
children: /* @__PURE__ */ i(
|
|
575
|
+
Te,
|
|
576
|
+
{
|
|
577
|
+
in: o,
|
|
578
|
+
timeout: 400,
|
|
579
|
+
appear: !0,
|
|
580
|
+
classNames: "zoomModal",
|
|
581
|
+
unmountOnExit: W,
|
|
582
|
+
mountOnEnter: q,
|
|
583
|
+
onEnter: (e) => {
|
|
584
|
+
e && (me(!0), X.current = re, te(e), k.current = e);
|
|
585
|
+
},
|
|
586
|
+
onEntered: (e) => {
|
|
587
|
+
e && (te(e), X.current = null, Z == null || Z());
|
|
588
|
+
},
|
|
589
|
+
onExit: () => {
|
|
590
|
+
_.current = !0;
|
|
591
|
+
},
|
|
592
|
+
onExited: (e) => {
|
|
593
|
+
e && (me(!1), te(e), z == null || z(), _.current = !1, W && (k.current = null));
|
|
594
|
+
},
|
|
595
|
+
children: tn.cloneElement(
|
|
596
|
+
Me(ie) ? ie(ke) : ke,
|
|
597
|
+
{
|
|
598
|
+
onMouseDown: () => {
|
|
599
|
+
I.current = !1;
|
|
600
|
+
},
|
|
601
|
+
onMouseUp: () => {
|
|
602
|
+
I.current = !1;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
}
|
|
607
|
+
)
|
|
608
|
+
}
|
|
609
|
+
)
|
|
610
|
+
]
|
|
611
|
+
}
|
|
612
|
+
)
|
|
613
|
+
}
|
|
614
|
+
) : null;
|
|
615
|
+
}
|
|
616
|
+
const y = De(
|
|
617
|
+
On
|
|
618
|
+
);
|
|
619
|
+
y.displayName = "Modal";
|
|
620
|
+
y.config = cn;
|
|
621
|
+
y.show = (n) => le({ ...n, noticeType: "show" });
|
|
622
|
+
y.confirm = (n) => le(n);
|
|
623
|
+
y.useModal = Dn;
|
|
624
|
+
["info", "success", "warning", "error"].forEach((n) => {
|
|
625
|
+
y[n] = (l) => le({
|
|
626
|
+
...l,
|
|
627
|
+
isNotice: !0,
|
|
628
|
+
noticeType: n
|
|
629
|
+
});
|
|
630
|
+
});
|
|
631
|
+
y.destroyAll = () => {
|
|
632
|
+
for (; T.length; ) {
|
|
633
|
+
const n = T.pop();
|
|
634
|
+
n && n();
|
|
635
|
+
}
|
|
636
|
+
w.length = 0;
|
|
637
|
+
};
|
|
638
|
+
export {
|
|
639
|
+
y as E
|
|
640
|
+
};
|