@unicom-cloud/ui 0.8.53 → 0.8.55

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.
Files changed (110) hide show
  1. package/Affix.js +1 -1
  2. package/Alert.js +1 -1
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +3 -3
  5. package/Avatar.js +1 -1
  6. package/BackTop.js +1 -1
  7. package/Badge.js +1 -1
  8. package/Breadcrumb.js +2 -2
  9. package/Button.js +1 -1
  10. package/Calendar.js +3 -3
  11. package/Card.js +1 -1
  12. package/Carousel.js +1 -1
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +3 -3
  17. package/Comment.js +1 -1
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +1 -1
  20. package/DatePicker.js +3 -3
  21. package/Descriptions.js +1 -1
  22. package/Divider.js +1 -1
  23. package/Draggable.js +1 -1
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +1 -1
  26. package/Empty.js +1 -1
  27. package/Form.js +1 -1
  28. package/Grid.js +2 -2
  29. package/Icon.js +1 -1
  30. package/IconHover.js +1 -1
  31. package/Image.js +1 -1
  32. package/Input.js +1 -1
  33. package/InputNumber.js +2 -2
  34. package/InputTag.js +1 -1
  35. package/Layout.js +2 -2
  36. package/Link.js +1 -1
  37. package/List.js +3 -3
  38. package/Mentions.js +3 -3
  39. package/Menu.js +1 -1
  40. package/Message.js +1 -1
  41. package/Modal.js +1 -1
  42. package/Notice.js +2 -2
  43. package/Notification.js +1 -1
  44. package/OverflowEllipsis.js +1 -1
  45. package/PageHeader.js +1 -1
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +1 -1
  49. package/Popover.js +1 -1
  50. package/Progress.js +1 -1
  51. package/Radio.js +2 -2
  52. package/Rate.js +1 -1
  53. package/ResizeBox.js +1 -1
  54. package/Result.js +1 -1
  55. package/Select.js +1 -1
  56. package/SelectView.js +3 -3
  57. package/Skeleton.js +1 -1
  58. package/Slider.js +2 -2
  59. package/Space.js +1 -1
  60. package/Spin.js +1 -1
  61. package/Statistic.js +1 -1
  62. package/Steps.js +1 -1
  63. package/Switch.js +1 -1
  64. package/Table.js +4 -4
  65. package/Tabs.js +1 -1
  66. package/Tag.js +1 -1
  67. package/TimePicker.js +3 -3
  68. package/Timeline.js +1 -1
  69. package/Tooltip.js +1 -1
  70. package/Transfer.js +3 -3
  71. package/Tree.js +1 -1
  72. package/TreeSelect.js +1 -1
  73. package/Trigger.js +1 -1
  74. package/Typography.js +22 -22
  75. package/Upload.js +1 -1
  76. package/VerificationCode.js +1 -1
  77. package/Watermark.js +1 -1
  78. package/chunk/{CmEyvBdT.js → BC0PujUD.js} +2 -2
  79. package/chunk/{B8IzaBdN.js → BH5fVprw.js} +1 -1
  80. package/chunk/{CyVLxv_U.js → BUQBof6z.js} +3 -3
  81. package/chunk/{CBaVCRtG.js → BdJcAQ0Q.js} +1 -1
  82. package/chunk/{BOUZ7hSf.js → BmtF7P8U.js} +2 -2
  83. package/chunk/{CccPQyYX.js → BzMYgxgO.js} +1 -1
  84. package/chunk/{DfMf16uZ.js → BzqZZHGK.js} +2 -2
  85. package/chunk/{CLU6Le34.js → C3I_L73_.js} +1 -1
  86. package/chunk/{8hWViek4.js → CIc4yo9k.js} +1 -1
  87. package/chunk/{COWsswcW.js → CK0H_Yi4.js} +2 -2
  88. package/chunk/{PRN8SqRA.js → CTSIr-Pr.js} +1 -1
  89. package/chunk/CZ8iz63Z.js +641 -0
  90. package/chunk/{DY9WA4bf.js → CqcZfQQ4.js} +1 -1
  91. package/chunk/{Cwp65v9h.js → CzTYWtfa.js} +1 -1
  92. package/chunk/{D3pUE3-b.js → DG7VgAhL.js} +3 -3
  93. package/chunk/{DdVbiC4t.js → DTgc2wl4.js} +2 -2
  94. package/chunk/{D6BMh1k4.js → DZGcv_9A.js} +1 -1
  95. package/chunk/{-sV-N67P.js → DbtCtriE.js} +1 -1
  96. package/chunk/{BEiJmFHq.js → DdtfPvgk.js} +1 -1
  97. package/chunk/{Cz65nXZD.js → Dki1RB5p.js} +2 -2
  98. package/chunk/{CYyPBcnp.js → Niaq_og8.js} +2 -2
  99. package/chunk/{BEVtQ2QL.js → PuuHmqnW.js} +2 -2
  100. package/chunk/{DGK45cuc.js → RL1SNlng.js} +1 -1
  101. package/chunk/{DNyP-r9G.js → RRWbBHK-.js} +2 -2
  102. package/chunk/{CRxPui7e.js → ShWkfsJd.js} +2 -2
  103. package/chunk/{bcn23eHi.js → i1A7W8Qt.js} +1 -1
  104. package/chunk/{Lyg-9NEt.js → xPzFRQJn.js} +19 -18
  105. package/index.js +22 -22
  106. package/package.json +1 -1
  107. package/types/modal/config.d.ts +1 -0
  108. package/types/modal/interface.d.ts +1 -0
  109. package/utils/contextHolder.js +1 -1
  110. package/chunk/BYMRs7t5.js +0 -607
@@ -0,0 +1,641 @@
1
+ import { jsx as s, 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__ */ s(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__ */ s(Pe, {}), n.isNotice))
40
+ switch (n.noticeType) {
41
+ case "info":
42
+ l = /* @__PURE__ */ s(wn, {});
43
+ break;
44
+ case "success":
45
+ l = /* @__PURE__ */ s(En, {});
46
+ break;
47
+ case "warning":
48
+ l = /* @__PURE__ */ s(Pe, {});
49
+ break;
50
+ case "error":
51
+ l = /* @__PURE__ */ s(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 i = document.createElement("div");
62
+ document.body.appendChild(i);
63
+ const f = ln();
64
+ function g(a) {
65
+ const C = /* @__PURE__ */ s($e, { ...f, children: /* @__PURE__ */ s(Tn, { ...a, onCancel: h }) });
66
+ c ? c.render(C) : c = xn(C, i);
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(), i.parentNode && i.parentNode.removeChild(i);
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, i] = D(!0), [f, g] = D(n);
119
+ on(l, () => ({
120
+ update: (u) => {
121
+ g(u);
122
+ },
123
+ close: () => {
124
+ i(!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
+ i(!1);
136
+ },
137
+ (h) => {
138
+ console.error(h), g((M) => ({
139
+ ...M,
140
+ confirmLoading: !1
141
+ }));
142
+ }
143
+ )), u || i(!1);
144
+ }
145
+ function r() {
146
+ var u;
147
+ (u = f.onCancel) == null || u.call(f), i(!1);
148
+ }
149
+ return /* @__PURE__ */ s(
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__ */ s(an, { ref: n });
165
+ let c = 0;
166
+ function i(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__ */ s(
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 i({
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) => i({
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), i = 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: ie,
274
+ wrapClassName: He,
275
+ escToExit: j,
276
+ modalRender: se,
277
+ maskStyle: Se,
278
+ wrapStyle: Xe,
279
+ closeIcon: ae,
280
+ fullscreenable: Rn,
281
+ ...ce
282
+ } = i, $ = 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", i.prefixCls), { locale: G, rtl: be } = c, Ue = !r || ce.noticeType === "show", Ve = "closable" in i ? i.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 = i.onCancel) == null || e.call(i);
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 = i.onOk ?? i.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 (!(l != null && l.current))
318
+ return;
319
+ const e = w.indexOf(l.current);
320
+ if (e !== -1 && w.splice(e, 1), o) {
321
+ if (i.hidePreviousModal)
322
+ for (const m of w)
323
+ m instanceof HTMLElement && m.style instanceof CSSStyleDeclaration && m.style.setProperty("display", "none");
324
+ w.push(l.current);
325
+ }
326
+ const t = w[w.length - 1];
327
+ return t && t instanceof HTMLElement && t.style instanceof CSSStyleDeclaration && t.style.removeProperty("display"), () => {
328
+ };
329
+ }, [o, l == null ? void 0 : l.current]), oe(() => {
330
+ let e = null;
331
+ return j && (e = setTimeout(() => {
332
+ var t;
333
+ Cn(document.body, $.current) && ((t = $.current) == null || t.focus());
334
+ })), () => {
335
+ e && clearTimeout(e);
336
+ };
337
+ }, [o, j]);
338
+ const je = () => {
339
+ var e;
340
+ if (o && fe === void 0 && $.current) {
341
+ const t = +((e = window.getComputedStyle($.current, null)) == null ? void 0 : e.zIndex);
342
+ isNaN(t) || Ye(t + 1);
343
+ }
344
+ }, Ae = () => {
345
+ if (H === null) return;
346
+ const e = /* @__PURE__ */ s(we, { onClick: J, ...C, children: M || G.Modal.cancelText }), t = /* @__PURE__ */ s(
347
+ we,
348
+ {
349
+ loading: Fe,
350
+ onClick: Ze,
351
+ type: "primary",
352
+ ...a,
353
+ children: v || G.Modal.okText
354
+ }
355
+ ), m = Me(H) ? H(e, t) : H || /* @__PURE__ */ L(en, { children: [
356
+ !Oe && e,
357
+ t
358
+ ] });
359
+ return /* @__PURE__ */ s("div", { className: `${d}-footer`, children: m });
360
+ }, ee = b(
361
+ ve()
362
+ ), Ke = U((e) => {
363
+ var m, E, N, P, F;
364
+ if (!k.current)
365
+ return;
366
+ e.preventDefault();
367
+ const t = ee.current;
368
+ 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();
369
+ }, []), ge = U((e) => {
370
+ e.preventDefault();
371
+ const t = ee.current, { left: m, right: E, top: N, bottom: P } = t.boundingClientRect ?? {}, { width: F, height: _e } = t.offsetParentBoundingClientRect ?? {};
372
+ let O = Math.max(e.screenX - t.screenX, -m);
373
+ O = Math.min(O, F - E);
374
+ let R = Math.max(e.screenY - t.screenY, -N);
375
+ R = Math.min(R, _e - P), O += t.prewTranslateX, R += t.prewTranslateY, t.translateX = O, t.translateY = R, pe(`translate(${O}px, ${R}px)`);
376
+ }, []), xe = U((e) => {
377
+ e.preventDefault(), B();
378
+ }, []);
379
+ function Ge() {
380
+ document.documentElement.addEventListener(
381
+ "mousemove",
382
+ ge
383
+ ), document.documentElement.addEventListener(
384
+ "mouseup",
385
+ xe
386
+ );
387
+ }
388
+ function B() {
389
+ document.documentElement.removeEventListener(
390
+ "mousemove",
391
+ ge
392
+ ), document.documentElement.removeEventListener(
393
+ "mouseup",
394
+ xe
395
+ );
396
+ }
397
+ function ve() {
398
+ return {
399
+ screenX: 0,
400
+ screenY: 0,
401
+ prewTranslateX: 0,
402
+ prewTranslateY: 0,
403
+ translateX: 0,
404
+ translateY: 0,
405
+ boundingClientRect: null,
406
+ offsetParentBoundingClientRect: null
407
+ };
408
+ }
409
+ function ne() {
410
+ ee.current = ve(), pe(""), he("");
411
+ }
412
+ oe(() => () => {
413
+ ne(), B();
414
+ }, []), oe(() => (k.current || (ne(), B()), () => {
415
+ }), [k.current]);
416
+ const Je = /* @__PURE__ */ L(
417
+ $e,
418
+ {
419
+ ...c,
420
+ prefixCls: i.prefixCls || c.prefixCls,
421
+ locale: G,
422
+ zIndex: fe || 1050,
423
+ getPopupContainer: (e) => typeof ie == "function" ? ie(e) : ue.current,
424
+ children: [
425
+ (!!u || !!x) && /* @__PURE__ */ L("div", { className: `${d}-header`, children: [
426
+ !!u && /* @__PURE__ */ s(
427
+ "div",
428
+ {
429
+ className: `${d}-title`,
430
+ id: `pqb-dialog-${Y.current}`,
431
+ children: u
432
+ }
433
+ ),
434
+ !!x && /* @__PURE__ */ s("div", { className: `${d}-subtitle`, children: x })
435
+ ] }),
436
+ /* @__PURE__ */ s("div", { ref: ue, className: `${d}-content`, children: h }),
437
+ Ae(),
438
+ !i.fullscreenable && i.draggable !== !1 && /* @__PURE__ */ s(
439
+ "div",
440
+ {
441
+ className: `${d}-drag-icon`,
442
+ onMouseDown: Ke,
443
+ onDoubleClick: ne
444
+ }
445
+ ),
446
+ (Ve || !!i.fullscreenable) && (ae !== void 0 ? /* @__PURE__ */ s(
447
+ "span",
448
+ {
449
+ className: `${d}-close-icon`,
450
+ onClick: J,
451
+ children: ae
452
+ }
453
+ ) : /* @__PURE__ */ s(
454
+ dn,
455
+ {
456
+ tabIndex: -1,
457
+ className: `${d}-close-icon`,
458
+ onClick: J,
459
+ role: "button",
460
+ "aria-label": "Close",
461
+ children: /* @__PURE__ */ s(nn, {})
462
+ }
463
+ ))
464
+ ]
465
+ }
466
+ ), Qe = u ? { "aria-labelledby": `pqb-dialog-${Y.current}` } : {}, ke = /* @__PURE__ */ s(
467
+ "div",
468
+ {
469
+ role: "dialog",
470
+ "aria-modal": "true",
471
+ ...Qe,
472
+ className: Ne(
473
+ d,
474
+ {
475
+ [`${d}-simple`]: r,
476
+ [`${d}-rtl`]: be,
477
+ [`${d}-fullscreenable`]: i.fullscreenable
478
+ },
479
+ f
480
+ ),
481
+ style: {
482
+ ...g,
483
+ transform: Be,
484
+ transformOrigin: Ce
485
+ },
486
+ ref: k,
487
+ children: Je
488
+ }
489
+ ), te = (e) => {
490
+ if (Ce)
491
+ return;
492
+ let t = "";
493
+ if (X.current) {
494
+ const m = e.getBoundingClientRect(), { left: E, top: N } = X.current;
495
+ t = `${E - m.left}px ${N - m.top}px`;
496
+ }
497
+ he(t);
498
+ }, ye = A.current ? !q : !!k.current;
499
+ return o || ye ? /* @__PURE__ */ s(
500
+ kn,
501
+ {
502
+ visible: o,
503
+ forceRender: ye,
504
+ getContainer: p,
505
+ children: /* @__PURE__ */ L(
506
+ "div",
507
+ {
508
+ ref: l,
509
+ className: `${d}-container`,
510
+ children: [
511
+ S ? /* @__PURE__ */ s(
512
+ Te,
513
+ {
514
+ in: o,
515
+ timeout: 400,
516
+ appear: !0,
517
+ mountOnEnter: q,
518
+ classNames: "fadeModal",
519
+ unmountOnExit: W,
520
+ onEnter: (e) => {
521
+ e && (e.style.display = "block");
522
+ },
523
+ onExited: (e) => {
524
+ e && (e.style.display = "none");
525
+ },
526
+ children: /* @__PURE__ */ s(
527
+ "div",
528
+ {
529
+ "aria-hidden": !0,
530
+ className: `${d}-mask`,
531
+ style: Se
532
+ }
533
+ )
534
+ }
535
+ ) : null,
536
+ /* @__PURE__ */ s(
537
+ "div",
538
+ {
539
+ ...yn(ce, [
540
+ "content",
541
+ "icon",
542
+ "showIcon",
543
+ "isNotice",
544
+ "noticeType",
545
+ "onCancel",
546
+ "onOk",
547
+ "onConfirm",
548
+ "closable",
549
+ "prefixCls"
550
+ ]),
551
+ tabIndex: -1,
552
+ ref: (e) => {
553
+ $.current = e, je();
554
+ },
555
+ className: Ne(
556
+ `${d}-wrapper`,
557
+ {
558
+ [`${d}-wrapper-no-mask`]: !S,
559
+ [`${d}-wrapper-align-center`]: Le,
560
+ [`${d}-wrapper-rtl`]: be
561
+ },
562
+ He
563
+ ),
564
+ style: {
565
+ ...Xe || {},
566
+ // 必须 visible=false,立即设置display:none,否则modal加载react-monaco-editor的时候,编辑器显示异常
567
+ display: o || de ? "block" : "none",
568
+ overflow: !o && de ? "hidden" : ""
569
+ },
570
+ onKeyDown: qe,
571
+ onMouseDown: (e) => {
572
+ I.current = e.target === e.currentTarget;
573
+ },
574
+ onClick: We,
575
+ children: /* @__PURE__ */ s(
576
+ Te,
577
+ {
578
+ in: o,
579
+ timeout: 400,
580
+ appear: !0,
581
+ classNames: "zoomModal",
582
+ unmountOnExit: W,
583
+ mountOnEnter: q,
584
+ onEnter: (e) => {
585
+ e && (me(!0), X.current = re, te(e), k.current = e);
586
+ },
587
+ onEntered: (e) => {
588
+ e && (te(e), X.current = null, Z == null || Z());
589
+ },
590
+ onExit: () => {
591
+ _.current = !0;
592
+ },
593
+ onExited: (e) => {
594
+ e && (me(!1), te(e), z == null || z(), _.current = !1, W && (k.current = null));
595
+ },
596
+ children: tn.cloneElement(
597
+ Me(se) ? se(ke) : ke,
598
+ {
599
+ onMouseDown: () => {
600
+ I.current = !1;
601
+ },
602
+ onMouseUp: () => {
603
+ I.current = !1;
604
+ }
605
+ }
606
+ )
607
+ }
608
+ )
609
+ }
610
+ )
611
+ ]
612
+ }
613
+ )
614
+ }
615
+ ) : null;
616
+ }
617
+ const y = De(
618
+ On
619
+ );
620
+ y.displayName = "Modal";
621
+ y.config = cn;
622
+ y.show = (n) => le({ ...n, noticeType: "show" });
623
+ y.confirm = (n) => le(n);
624
+ y.useModal = Dn;
625
+ ["info", "success", "warning", "error"].forEach((n) => {
626
+ y[n] = (l) => le({
627
+ ...l,
628
+ isNotice: !0,
629
+ noticeType: n
630
+ });
631
+ });
632
+ y.destroyAll = () => {
633
+ for (; T.length; ) {
634
+ const n = T.pop();
635
+ n && n();
636
+ }
637
+ w.length = 0;
638
+ };
639
+ export {
640
+ y as E
641
+ };
@@ -1,7 +1,7 @@
1
1
  import { jsx as $, jsxs as Q, Fragment as Te } from "react/jsx-runtime";
2
2
  import { useRef as j, useEffect as X, useCallback as V, createContext as Oe, useContext as se } from "react";
3
3
  import ie from "../Button.js";
4
- import { a as Ce } from "./Lyg-9NEt.js";
4
+ import { a as Ce } from "./xPzFRQJn.js";
5
5
  import ee from "@unicom-cloud/utils/class-name";
6
6
  import { dayjs as g, methods as Y, getDayjsValue as He, getNow as re, toLocal as ce } from "../utils/dayjs.js";
7
7
  import { padStart as O } from "../utils/pad.js";
@@ -3,7 +3,7 @@ import O from "@unicom-cloud/icons/IconUiClose";
3
3
  import tt from "lodash/isFunction";
4
4
  import ot, { useRef as b, useState as A, useImperativeHandle as et, useEffect as T } from "react";
5
5
  import nt from "../hooks/useKeyboardEvent.js";
6
- import { I as rt } from "./Lyg-9NEt.js";
6
+ import { I as rt } from "./xPzFRQJn.js";
7
7
  import V from "@unicom-cloud/utils/class-name";
8
8
  import it from "../utils/fillNBSP.js";
9
9
  import "../utils/is.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx as a, jsxs as _, Fragment as Je } from "react/jsx-runtime";
2
2
  import W, { useContext as O, useState as Oe, useRef as ge, useEffect as te, forwardRef as Ae, createElement as J } from "react";
3
- import { a as A } from "./Lyg-9NEt.js";
3
+ import { a as A } from "./xPzFRQJn.js";
4
4
  import Fe from "../hooks/useMergeProps.js";
5
5
  import le from "../hooks/useMergeValue.js";
6
6
  import q from "@unicom-cloud/utils/class-name";
@@ -12,8 +12,8 @@ import pe from "../hooks/useKeyboardEvent.js";
12
12
  import Be from "lodash/isFunction";
13
13
  import Ke from "lodash/isPlainObject";
14
14
  import ce from "lodash/isUndefined";
15
- import { I as Ve } from "./CyVLxv_U.js";
16
- import { S as fe } from "./BEVtQ2QL.js";
15
+ import { I as Ve } from "./BUQBof6z.js";
16
+ import { S as fe } from "./PuuHmqnW.js";
17
17
  var E = /* @__PURE__ */ ((e) => (e[e.previous = 0] = "previous", e[e.next = 1] = "next", e))(E || {});
18
18
  function De(e) {
19
19
  var M, h, t;
@@ -5,7 +5,7 @@ import _ from "lodash/isNumber";
5
5
  import ee from "lodash/isPlainObject";
6
6
  import Ie from "lodash/isUndefined";
7
7
  import xe, { useContext as re, useMemo as R, useRef as oe, useEffect as G } from "react";
8
- import { a as Ve } from "./Lyg-9NEt.js";
8
+ import { a as Ve } from "./xPzFRQJn.js";
9
9
  import Le from "../hooks/useInView.js";
10
10
  import ye from "../hooks/useKeyboardEvent.js";
11
11
  import Ee from "../hooks/useMergeProps.js";
@@ -13,7 +13,7 @@ import Fe from "../hooks/useMergeValue.js";
13
13
  import h from "@unicom-cloud/utils/class-name";
14
14
  import Re from "../utils/omit.js";
15
15
  import Ge from "@unicom-cloud/icons/IconUiMore";
16
- import { T as Ue, P as ie, a as je, b as Me, u as Se } from "./PRN8SqRA.js";
16
+ import { T as Ue, P as ie, a as je, b as Me, u as Se } from "./CTSIr-Pr.js";
17
17
  function te(v) {
18
18
  const { title: w, description: $, actions: t } = v, a = w || $, l = t && t.length;
19
19
  return [a || l, a, l];
@@ -2,7 +2,7 @@ import { jsx as z } from "react/jsx-runtime";
2
2
  import Q from "lodash/isNumber";
3
3
  import U from "lodash/isPlainObject";
4
4
  import { createContext as L, forwardRef as T, useContext as H, useMemo as W, useState as X, useRef as Y, useEffect as Z } from "react";
5
- import { a as D } from "./Lyg-9NEt.js";
5
+ import { a as D } from "./xPzFRQJn.js";
6
6
  import F from "../hooks/useMergeProps.js";
7
7
  import q from "@unicom-cloud/utils/class-name";
8
8
  import _ from "../utils/omit.js";