x-next 0.0.0-alpha.2 → 0.0.0-alpha.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/README.md +15 -84
  2. package/dist/{types/_hooks → _hooks}/use-overflow.d.ts +1 -1
  3. package/dist/{types/_hooks → _hooks}/use-popup-manager.d.ts +1 -1
  4. package/dist/{types/_utils → _utils}/config.d.ts +1 -1
  5. package/dist/{types/_utils → _utils}/dom.d.ts +1 -1
  6. package/dist/{types/_utils → _utils}/is.d.ts +5 -6
  7. package/dist/{types/_utils → _utils}/keyboard.d.ts +1 -1
  8. package/dist/{types/_utils → _utils}/vue-eco.d.ts +10 -11
  9. package/dist/{types/componets/button/index.vue.d.ts → components/button/Button.d.ts} +18 -28
  10. package/dist/components/button/index.d.ts +181 -0
  11. package/dist/{types/componets → components}/button/props.d.ts +4 -4
  12. package/dist/{types/componets/dialog/index.vue.d.ts → components/dialog/Dialog.d.ts} +9 -42
  13. package/dist/components/dialog/index.d.ts +334 -0
  14. package/dist/{types/componets → components}/dialog/props.d.ts +7 -7
  15. package/dist/{types/componets → components}/dialog/use-props.d.ts +1 -1
  16. package/dist/{types/componets → components}/dialog/use.d.ts +1 -1
  17. package/dist/components/dialog/warp.d.ts +2 -0
  18. package/dist/components/index.d.ts +6 -0
  19. package/dist/{types/componets/message/index.vue.d.ts → components/message/Message.d.ts} +19 -27
  20. package/dist/components/message/MessageVue.vue.d.ts +362 -0
  21. package/dist/components/message/index.d.ts +193 -0
  22. package/dist/{types/componets → components}/message/props.d.ts +1 -1
  23. package/dist/{types/componets → components}/message/warp.d.ts +1 -1
  24. package/dist/{types/componets/message-box/index.d.ts → components/message-box/MessageBox.d.ts} +1 -1
  25. package/dist/components/message-box/index.d.ts +4 -0
  26. package/dist/{types/componets → components}/message-box/props.d.ts +1 -1
  27. package/dist/components/message-box/warp.d.ts +2 -0
  28. package/dist/components/notification/Notification.d.ts +89 -0
  29. package/dist/components/notification/index.d.ts +166 -0
  30. package/dist/{types/componets → components}/notification/props.d.ts +2 -2
  31. package/dist/{types/componets → components}/notification/warp.d.ts +1 -1
  32. package/dist/{types/componets/space/index.d.ts → components/space/Space.d.ts} +9 -9
  33. package/dist/components/space/index.d.ts +82 -0
  34. package/dist/{types/componets → components}/trend-chart/components/trend-chart-curve.d.ts +17 -17
  35. package/dist/{types/componets → components}/trend-chart/components/trend-chart-grid.d.ts +7 -7
  36. package/dist/{types/componets → components}/trend-chart/components/trend-chart-labels.d.ts +7 -7
  37. package/dist/{types/componets → components}/trend-chart/components/trend-chart.d.ts +47 -47
  38. package/dist/{types/componets → components}/trend-chart/helpers/genPoints.d.ts +1 -1
  39. package/dist/components/trend-chart/index.d.ts +2 -0
  40. package/dist/{types/componets → components}/trend-chart/props.d.ts +2 -2
  41. package/dist/directives/clipboard/cache.d.ts +8 -0
  42. package/dist/directives/clipboard/clipboard.d.ts +18 -0
  43. package/dist/directives/clipboard/convert.d.ts +3 -0
  44. package/dist/directives/clipboard/index.d.ts +3 -0
  45. package/dist/directives/clipboard/plugin.d.ts +2 -0
  46. package/dist/directives/clipboard/textarea.d.ts +3 -0
  47. package/dist/{types/icons/default/exclamation-circle-fill.vue.d.ts → icons/animation/animation-loading.d.ts} +5 -10
  48. package/dist/{types/icons/default/close-circle-fill.vue.d.ts → icons/default/check-circle-fill.d.ts} +5 -10
  49. package/dist/{types/icons/animation/animation-loading.vue.d.ts → icons/default/close-circle-fill.d.ts} +5 -10
  50. package/dist/{types/icons/default/check-circle-fill.vue.d.ts → icons/default/exclamation-circle-fill.d.ts} +5 -10
  51. package/dist/icons/default/info-circle-fill.d.ts +50 -0
  52. package/dist/icons/default/minus-circle-fill.d.ts +50 -0
  53. package/dist/icons/icon.d.ts +51 -0
  54. package/dist/icons/index.d.ts +7 -0
  55. package/dist/index.d.ts +12 -0
  56. package/dist/index.es.js +1368 -0
  57. package/dist/index.umd.js +1 -0
  58. package/dist/style.css +1 -0
  59. package/dist/types.d.ts +11 -0
  60. package/package.json +45 -48
  61. package/volar.d.ts +12 -0
  62. package/LICENSE +0 -21
  63. package/dist/favicon.ico +0 -0
  64. package/dist/types/_utils/icon.d.ts +0 -59
  65. package/dist/types/componets/dialog/warp.d.ts +0 -2
  66. package/dist/types/componets/message-box/warp.d.ts +0 -2
  67. package/dist/types/componets/notification/index.vue.d.ts +0 -160
  68. package/dist/types/componets/trend-chart/index.d.ts +0 -2
  69. package/dist/types/icons/default/info-circle-fill.vue.d.ts +0 -55
  70. package/dist/types/icons/default/minus-circle-fill.vue.d.ts +0 -55
  71. package/dist/types/icons/index.d.ts +0 -7
  72. package/dist/types/ui.d.ts +0 -5
  73. package/dist/ui.cjs.js +0 -2
  74. package/dist/ui.es.js +0 -1395
  75. package/dist/ui.umd.js +0 -3
  76. /package/dist/{types/_props → _props}/css.d.ts +0 -0
  77. /package/dist/{types/_props → _props}/global.d.ts +0 -0
  78. /package/dist/{types/_utils → _utils}/convert-case.d.ts +0 -0
  79. /package/dist/{types/_utils → _utils}/helpers.d.ts +0 -0
  80. /package/dist/{types/_utils → _utils}/number.d.ts +0 -0
  81. /package/dist/{types/componets → components}/tag-cloud/index.d.ts +0 -0
  82. /package/dist/{types/componets → components}/trend-chart/helpers/genPath.d.ts +0 -0
  83. /package/dist/{types/componets → components}/trend-chart/helpers/getPadding.d.ts +0 -0
  84. /package/dist/{types/componets → components}/trend-chart/helpers/validatePadding.d.ts +0 -0
@@ -0,0 +1,1368 @@
1
+ var Ze = Object.defineProperty;
2
+ var Xe = (e, t, n) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var M = (e, t, n) => Xe(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as E, computed as C, createVNode as r, h as A, reactive as xe, getCurrentInstance as Ue, ref as T, watch as de, onMounted as K, onBeforeUnmount as Oe, readonly as Re, Teleport as Ke, Transition as H, onUnmounted as fe, Comment as Ye, Fragment as _, render as N, isVNode as k, createTextVNode as O, resolveComponent as I, openBlock as B, createBlock as F, withCtx as Ge, withDirectives as qe, createElementVNode as Je, normalizeClass as re, normalizeStyle as Qe, createElementBlock as U, renderSlot as ke, createCommentVNode as oe, toDisplayString as et, vShow as tt } from "vue";
5
+ const nt = "X", lt = "x", Ne = (e) => e ? lt + "-" + e : e || "", S = (e) => nt + e, p = (e) => {
6
+ const t = Ne(e);
7
+ return {
8
+ block: t,
9
+ element: (s) => `${t}--${s}`,
10
+ modifier: (s) => `${t}-${s}`,
11
+ is: (s) => `${t}-is-${s}`
12
+ };
13
+ }, W = Object.prototype.toString;
14
+ function Te(e) {
15
+ return W.call(e) === "[object Array]";
16
+ }
17
+ function Ee(e) {
18
+ return W.call(e) === "[object Object]";
19
+ }
20
+ const Me = (e) => W.call(e) === "[object Promise]", rt = (e) => b(e) && e.constructor.name === "AsyncFunction", ot = (e) => Me(e) || rt(e);
21
+ function Fe(e) {
22
+ return W.call(e) === "[object String]";
23
+ }
24
+ function at(e) {
25
+ return W.call(e) === "[object Number]" && e === e;
26
+ }
27
+ function b(e) {
28
+ return typeof e == "function";
29
+ }
30
+ function Y() {
31
+ return typeof window < "u";
32
+ }
33
+ const j = (e) => e, st = (e) => !!(e && e.shapeFlag & 1), ct = (e, t) => !!(e && e.shapeFlag & 6), it = (e, t) => !!(e && e.shapeFlag & 8), ut = (e, t) => !!(e && e.shapeFlag & 16), dt = (e, t) => !!(e && e.shapeFlag & 32), R = (e, t = !1) => {
34
+ var l, a;
35
+ const n = [];
36
+ for (const s of e ?? [])
37
+ st(s) || ct(s) || t && it(s, s.children) ? n.push(s) : ut(s, s.children) ? n.push(...R(s.children, t)) : dt(s, s.children) ? n.push(...R((a = (l = s.children).default) == null ? void 0 : a.call(l), t)) : Te(s) && n.push(...R(s, t));
38
+ return n;
39
+ }, $ = (e, t) => Object.assign(t, {
40
+ install(n) {
41
+ n.component(e) || n.component(e, t);
42
+ }
43
+ }), ft = {
44
+ disabled: Boolean,
45
+ block: Boolean,
46
+ loading: Boolean,
47
+ loadingFill: {
48
+ type: Boolean,
49
+ default: !1
50
+ },
51
+ debounce: {
52
+ type: Number,
53
+ default: 0
54
+ },
55
+ shape: {
56
+ type: j(String),
57
+ default: void 0
58
+ },
59
+ link: {
60
+ type: Boolean,
61
+ default: !1
62
+ },
63
+ type: {
64
+ type: j(String),
65
+ default: void 0
66
+ },
67
+ status: {
68
+ type: j(String),
69
+ default: void 0
70
+ },
71
+ plain: {
72
+ type: Boolean,
73
+ default: !1
74
+ },
75
+ size: {
76
+ type: j(String),
77
+ default: "medium"
78
+ },
79
+ border: {
80
+ type: Boolean,
81
+ default: !0
82
+ }
83
+ }, mt = (e) => Fe(e) ? e.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join("") : "", gt = (e, t = "px") => {
84
+ if (e === void 0) return "";
85
+ const n = typeof e == "number" ? `${e}` : e;
86
+ return ["px", "%", "vh", "vw", "calc"].some((a) => n.includes(a)) ? n : n + t;
87
+ };
88
+ function z(e, t) {
89
+ return /* @__PURE__ */ E({
90
+ name: Ne(`Icon${mt(e)}`),
91
+ props: {
92
+ size: {
93
+ type: [Number, String],
94
+ default: void 0
95
+ },
96
+ rotate: {
97
+ type: Number,
98
+ default: void 0
99
+ },
100
+ spin: {
101
+ type: Boolean,
102
+ default: !1
103
+ },
104
+ color: {
105
+ type: String,
106
+ default: void 0
107
+ },
108
+ fillColor: {
109
+ type: Array,
110
+ default: void 0
111
+ }
112
+ },
113
+ setup(n) {
114
+ const l = "x-icon", a = C(() => {
115
+ const d = {};
116
+ return n.size && (d.fontSize = gt(n.size)), n.rotate && (d.transform = `rotate(${n.rotate}deg)`), n.color && (d.color = n.color), d;
117
+ }), s = C(() => [l, {
118
+ [`${l}-loading`]: n.spin
119
+ }]);
120
+ return () => r("div", {
121
+ class: s.value,
122
+ style: a.value
123
+ }, [t]);
124
+ }
125
+ });
126
+ }
127
+ const yt = z("InfoCircleFill", A(r("svg", {
128
+ viewBox: "0 0 50 50",
129
+ class: "x-icon-loading-svg"
130
+ }, [r("circle", {
131
+ cx: "25",
132
+ cy: "25",
133
+ r: "20",
134
+ class: "path",
135
+ fill: "none",
136
+ stroke: "currentColor"
137
+ }, null)]))), ht = /* @__PURE__ */ E({
138
+ name: "Button",
139
+ props: ft,
140
+ emits: ["click"],
141
+ // 显式导入插槽
142
+ $slots: ["prefix", "suffix"],
143
+ setup(e, {
144
+ slots: t,
145
+ emit: n
146
+ }) {
147
+ const l = xe({
148
+ clicked: !1,
149
+ isDebounce: !1
150
+ }), a = p("button"), s = C(() => [a.block, e.type && a.modifier(e.type), e.status && a.modifier(e.status), e.disabled && a.is("disabled"), e.block && a.modifier("block"), e.plain && a.is("plain"), e.shape && a.modifier(e.shape), e.link && a.modifier("is-link"), e.size && a.modifier(e.size), !e.border && a.modifier("is-hide-border"), o.value && a.modifier("is-loading")]), d = () => {
151
+ e.debounce > 0 && !l.isDebounce && (l.isDebounce = !0, setTimeout(() => {
152
+ l.isDebounce = !1;
153
+ }, e.debounce));
154
+ }, o = C(() => e.loading || l.clicked || l.isDebounce), m = Ue(), f = (c, i) => {
155
+ const u = c(i);
156
+ ot(u) && (l.clicked = !0, u.finally(() => {
157
+ l.clicked = !1;
158
+ }));
159
+ }, y = (c) => {
160
+ var u, v, g, w;
161
+ if (c.stopPropagation(), (v = (u = c.target).blur) == null || v.call(u), o.value) return;
162
+ d();
163
+ const i = (w = (g = m == null ? void 0 : m.vnode) == null ? void 0 : g.props) == null ? void 0 : w.onClick;
164
+ if (Te(i))
165
+ i.forEach((ne) => f(ne, c));
166
+ else if (b(i)) {
167
+ f(i, c);
168
+ return;
169
+ }
170
+ };
171
+ return () => {
172
+ var c;
173
+ return r("button", {
174
+ class: s.value,
175
+ type: "button",
176
+ disabled: e.disabled,
177
+ onClick: y
178
+ }, [r("span", {
179
+ style: {
180
+ display: o.value ? "flex" : "none",
181
+ marginRight: o.value ? "4px" : "0px"
182
+ },
183
+ class: a.element("loading")
184
+ }, [r(yt, null, null)]), t.prefix && r("span", {
185
+ class: a.element("prefix")
186
+ }, [t.prefix()]), r("span", {
187
+ class: a.element("content")
188
+ }, [(c = t.default) == null ? void 0 : c.call(t)]), t.suffix && r("span", {
189
+ class: a.element("suffix")
190
+ }, [t.suffix()])]);
191
+ };
192
+ }
193
+ }), V = $(S("Button"), ht), vt = ["px", "%", "vh", "vw", "calc"], be = (e, t = "px") => {
194
+ if (e === void 0) return "";
195
+ const n = String(e);
196
+ return vt.some((l) => n.includes(l)) ? n : n + t;
197
+ }, Ct = 1e3, kt = 3e3, bt = 1;
198
+ class wt {
199
+ constructor() {
200
+ M(this, "popupStack", {
201
+ popup: /* @__PURE__ */ new Set(),
202
+ dialog: /* @__PURE__ */ new Set(),
203
+ message: /* @__PURE__ */ new Set()
204
+ });
205
+ M(this, "getNextZIndex", (t) => (t === "message" ? Array.from(this.popupStack.message).pop() || kt : Array.from(this.popupStack.popup).pop() || Ct) + bt);
206
+ M(this, "add", (t) => {
207
+ const n = this.getNextZIndex(t);
208
+ return this.popupStack[t].add(n), t === "dialog" && this.popupStack.popup.add(n), n;
209
+ });
210
+ M(this, "delete", (t, n) => {
211
+ this.popupStack[n].delete(t), n === "dialog" && this.popupStack.popup.delete(t);
212
+ });
213
+ M(this, "isLastDialog", (t) => this.popupStack.dialog.size > 1 ? t === Array.from(this.popupStack.dialog).pop() : !0);
214
+ }
215
+ }
216
+ const ae = new wt();
217
+ function G(e, {
218
+ visible: t,
219
+ runOnMounted: n
220
+ } = {}) {
221
+ const l = T(0), a = () => {
222
+ l.value = ae.add(e);
223
+ }, s = () => {
224
+ ae.delete(l.value, e);
225
+ }, d = () => e === "dialog" ? ae.isLastDialog(l.value) : !1;
226
+ return de(
227
+ () => t == null ? void 0 : t.value,
228
+ (o) => {
229
+ o ? a() : s();
230
+ },
231
+ {
232
+ immediate: !0
233
+ }
234
+ ), n && (K(a), Oe(s)), {
235
+ zIndex: Re(l),
236
+ open: a,
237
+ close: s,
238
+ isLastDialog: d
239
+ };
240
+ }
241
+ const Ae = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t, n) => (n == null ? void 0 : n.toUpperCase()) ?? ""), $e = () => {
242
+ }, Bt = (e, t) => {
243
+ if (Y)
244
+ return (t ?? document).querySelector(e) ?? void 0;
245
+ }, St = (e) => {
246
+ if (e.tagName === "BODY")
247
+ return window.innerWidth - (document.documentElement.offsetWidth || document.body.offsetWidth);
248
+ const { borderLeftWidth: t, borderRightWidth: n } = window.getComputedStyle(e), l = Number(t.replace("px", "")) + Number(n.replace("px", ""));
249
+ return e.offsetWidth - (e.clientWidth + l);
250
+ }, pt = (e) => e.tagName === "BODY" ? document.documentElement.scrollHeight > window.innerHeight : e.scrollHeight > e.offsetHeight, xt = (e, t) => {
251
+ var l;
252
+ if (!Y || !e || !t) return "";
253
+ let n = Ae(t);
254
+ n === "float" && (n = "cssFloat");
255
+ try {
256
+ const a = e.style[n];
257
+ if (a) return a;
258
+ const s = (l = document.defaultView) == null ? void 0 : l.getComputedStyle(e, "");
259
+ return s ? s[n] : "";
260
+ } catch {
261
+ return e.style[n];
262
+ }
263
+ }, P = (e, t, n) => {
264
+ if (!(!e || !t))
265
+ if (Ee(t))
266
+ Object.entries(t).forEach(
267
+ ([l, a]) => P(e, l, a)
268
+ );
269
+ else {
270
+ const l = Ae(t);
271
+ e.style[l] = n;
272
+ }
273
+ }, me = (e, t) => {
274
+ if (Fe(e)) {
275
+ const n = e[0] === "#" ? `[id='${e.slice(1)}']` : e;
276
+ return Bt(n, t);
277
+ }
278
+ return e;
279
+ }, Ot = Y ? (e, t, n, l = !1) => {
280
+ e.addEventListener(t, n, l);
281
+ } : $e, Nt = Y ? (e, t, n, l = !1) => {
282
+ e.removeEventListener(t, n, l);
283
+ } : $e, Tt = (e, t) => {
284
+ let n = !1;
285
+ const l = {
286
+ overflow: "",
287
+ width: ""
288
+ }, a = (o) => o.tagName === "BODY", s = () => {
289
+ if (e.value) {
290
+ const o = e.value;
291
+ if (!n && o.style.overflow !== "hidden") {
292
+ const m = St(o);
293
+ if (m > 0 || pt(o)) {
294
+ l.overflow = o.style.overflow, l.width = o.style.width;
295
+ let f = 0;
296
+ a(o) && (f = o.getBoundingClientRect().left || 0), P(o, {
297
+ width: `calc(100% - ${Math.ceil(m - f)}px)`,
298
+ overflow: "hidden"
299
+ }), n = !0;
300
+ }
301
+ }
302
+ }
303
+ }, d = () => {
304
+ if (e.value && n) {
305
+ const o = e.value;
306
+ P(o, {
307
+ overflow: l.overflow,
308
+ width: l.width
309
+ }), n = !1;
310
+ }
311
+ };
312
+ return de(
313
+ () => t == null ? void 0 : t.value,
314
+ (o) => {
315
+ e.value && !a(e.value) && (o && P(o, {
316
+ position: "absolute"
317
+ }), xt(e.value, "position") === "static" && P(e.value, { position: "relative" }));
318
+ }
319
+ ), {
320
+ setOverflowHidden: s,
321
+ resetOverflow: d
322
+ };
323
+ }, Et = {
324
+ ENTER: "Enter",
325
+ ESC: "Escape",
326
+ BACKSPACE: "Backspace",
327
+ TAB: "Tab",
328
+ SPACE: " ",
329
+ ARROW_UP: "ArrowUp",
330
+ ARROW_DOWN: "ArrowDown",
331
+ ARROW_LEFT: "ArrowLeft",
332
+ ARROW_RIGHT: "ArrowRight"
333
+ }, Mt = {
334
+ renderTo: {
335
+ type: j([String, Object]),
336
+ default: "body"
337
+ },
338
+ disabled: {
339
+ type: Boolean,
340
+ default: !1
341
+ },
342
+ modelValue: {
343
+ type: Boolean,
344
+ default: !1
345
+ },
346
+ top: {
347
+ type: [String, Number],
348
+ default: "3vh"
349
+ },
350
+ center: {
351
+ type: Boolean,
352
+ default: !1
353
+ },
354
+ width: {
355
+ type: [String, Number],
356
+ default: 0
357
+ },
358
+ height: {
359
+ type: [String, Number],
360
+ default: 0
361
+ },
362
+ minWidth: {
363
+ type: [String, Number],
364
+ default: 0
365
+ },
366
+ minHeight: {
367
+ type: [String, Number],
368
+ default: 0
369
+ },
370
+ title: {
371
+ type: String,
372
+ default: ""
373
+ },
374
+ mask: {
375
+ type: Boolean,
376
+ default: !0
377
+ },
378
+ // 关闭时卸载
379
+ destroyOnClosed: {
380
+ type: Boolean,
381
+ default: !0
382
+ },
383
+ // 关闭前回调检查是否可以关闭
384
+ onBeforeCancel: {
385
+ type: Function
386
+ },
387
+ // 是否点击遮罩层关闭
388
+ maskToClose: {
389
+ type: Boolean,
390
+ default: !0
391
+ },
392
+ // esc键关闭
393
+ escToClose: {
394
+ type: Boolean,
395
+ default: !0
396
+ },
397
+ // 全屏
398
+ fullscreen: {
399
+ type: Boolean,
400
+ default: !1
401
+ },
402
+ // 是否是messageBox
403
+ messageBox: {
404
+ type: Boolean,
405
+ default: !1
406
+ },
407
+ popupClass: {
408
+ type: String,
409
+ default: void 0
410
+ },
411
+ showClose: {
412
+ type: Boolean,
413
+ default: !0
414
+ },
415
+ showHeaderBottomLine: {
416
+ type: Boolean,
417
+ default: !1
418
+ }
419
+ }, Ft = ["width", "minWidth", "height", "minHeight"], ze = /* @__PURE__ */ E({
420
+ name: S("Dialog"),
421
+ inheritAttrs: !1,
422
+ props: Mt,
423
+ emits: ["closed", "close", "open", "opened", "update:modelValue"],
424
+ setup(e, {
425
+ emit: t,
426
+ slots: n
427
+ }) {
428
+ const l = p("dialog"), a = l.block, s = p("message-box");
429
+ s.block;
430
+ const d = C(() => [a, e.messageBox && "is-message-box", e.popupClass && e.popupClass]), o = C(() => me(e.renderTo)), m = T(), f = C(() => e.disabled || !o.value), y = C(() => ({
431
+ zIndex: g.value
432
+ })), c = C(() => {
433
+ const h = {};
434
+ return e.fullscreen || (!e.center && e.top && (h.top = be(e.top)), Ft.forEach((x) => {
435
+ e[x] && (h[x] = be(e[x]));
436
+ })), h;
437
+ }), i = T(!1), u = C(() => e.modelValue), v = C(() => u.value || i.value), {
438
+ zIndex: g,
439
+ isLastDialog: w
440
+ } = G("dialog", {
441
+ visible: u
442
+ }), {
443
+ setOverflowHidden: ne,
444
+ resetOverflow: ye
445
+ } = Tt(o, m), he = (h, x) => {
446
+ t("update:modelValue", !1), t("close", e.messageBox ? h : void 0, e.messageBox ? x : void 0);
447
+ }, Le = () => {
448
+ i.value = !1, ye(), t("closed");
449
+ }, je = () => {
450
+ t("opened");
451
+ }, Z = xe({
452
+ ok: !1,
453
+ cancel: !1
454
+ }), D = (h, x) => {
455
+ let X = !0;
456
+ if (Z[h] = !0, b(e.onBeforeCancel) && (X = e.onBeforeCancel(h) ?? !1), Me(X)) {
457
+ X.then((We) => {
458
+ Z[h] = !1, We && he(h, x);
459
+ });
460
+ return;
461
+ }
462
+ Z[h] = !1, X && he(h, x);
463
+ }, Pe = () => {
464
+ e.maskToClose && e.mask && D("cancel");
465
+ }, He = (h) => {
466
+ D("cancel", h);
467
+ }, _e = (h) => {
468
+ D("ok", h);
469
+ };
470
+ let le = !1;
471
+ const ve = (h) => {
472
+ e.escToClose && h.key === Et.ESC && w() && D("cancel");
473
+ }, Ve = () => {
474
+ e.escToClose && !le && (le = !0, Ot(document.documentElement, "keydown", ve));
475
+ }, Ce = () => {
476
+ le = !1, Nt(document.documentElement, "keydown", ve);
477
+ };
478
+ return Oe(() => {
479
+ ye(), Ce();
480
+ }), de(() => u.value, (h) => {
481
+ h ? (t("open"), ne(), i.value = !0, Ve()) : Ce();
482
+ }, {
483
+ immediate: !0
484
+ }), () => r(Ke, {
485
+ to: o.value,
486
+ disabled: f.value
487
+ }, {
488
+ default: () => [v.value && r("div", {
489
+ ref: m,
490
+ class: d.value,
491
+ style: y.value
492
+ }, [r(H, {
493
+ name: "x-fade-in-standard",
494
+ appear: !0
495
+ }, {
496
+ default: () => [e.mask && u.value && r("div", {
497
+ class: l.element("mask")
498
+ }, null)]
499
+ }), r("div", {
500
+ class: [l.element("wrapper"), {
501
+ "is-center": e.center
502
+ }],
503
+ onClick: (h) => h.target === h.currentTarget && Pe()
504
+ }, [r(H, {
505
+ name: "x-zoom-in",
506
+ appear: !0,
507
+ onAfterEnter: je,
508
+ onAfterLeave: Le
509
+ }, {
510
+ default: () => [u.value && r("div", {
511
+ class: [l.element("container"), {
512
+ "is-fullscreen": e.fullscreen
513
+ }],
514
+ style: c.value
515
+ }, [r("div", {
516
+ class: [e.messageBox ? s.element("header") : l.element("header"), e.showHeaderBottomLine && "is-bottom-line"]
517
+ }, [n.title ? n.title() : r("div", {
518
+ class: [l.element("header-title")]
519
+ }, [e.title])]), r("div", {
520
+ class: [e.messageBox ? s.element("body") : l.element("body")]
521
+ }, [n.default && n.default()]), r("div", {
522
+ class: [e.messageBox ? s.element("footer") : l.element("footer")]
523
+ }, [n.footer && n.footer({
524
+ cancel: He,
525
+ ok: _e,
526
+ "loading-obj": Z
527
+ })]), e.showClose && r("span", {
528
+ class: [l.element("close-icon"), e.messageBox && s.element("close-icon")],
529
+ onClick: () => D("cancel")
530
+ }, null)])]
531
+ })])])]
532
+ });
533
+ }
534
+ }), De = $(S("Dialog"), ze), q = z("CloseCircleFill", A(r("svg", {
535
+ viewBox: "0 0 48 48",
536
+ fill: "none",
537
+ xmlns: "http://www.w3.org/2000/svg",
538
+ stroke: "currentColor",
539
+ "stroke-width": "4",
540
+ "stroke-linecap": "butt",
541
+ "stroke-linejoin": "miter",
542
+ filter: ""
543
+ }, [r("path", {
544
+ "fill-rule": "evenodd",
545
+ "clip-rule": "evenodd",
546
+ d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",
547
+ fill: "currentColor",
548
+ stroke: "none"
549
+ }, null)]))), J = z("CheckCircleFill", A(r("svg", {
550
+ viewBox: "0 0 48 48",
551
+ fill: "none",
552
+ xmlns: "http://www.w3.org/2000/svg",
553
+ stroke: "currentColor",
554
+ "stroke-width": "4",
555
+ "stroke-linecap": "butt",
556
+ "stroke-linejoin": "miter",
557
+ filter: ""
558
+ }, [r("path", {
559
+ "fill-rule": "evenodd",
560
+ "clip-rule": "evenodd",
561
+ d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",
562
+ fill: "currentColor",
563
+ stroke: "none"
564
+ }, null)]))), Q = z("ExclamationCircleFill", A(r("svg", {
565
+ viewBox: "0 0 48 48",
566
+ fill: "none",
567
+ xmlns: "http://www.w3.org/2000/svg",
568
+ stroke: "currentColor",
569
+ "stroke-width": "4",
570
+ "stroke-linecap": "butt",
571
+ "stroke-linejoin": "miter",
572
+ filter: ""
573
+ }, [r("path", {
574
+ "fill-rule": "evenodd",
575
+ "clip-rule": "evenodd",
576
+ d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",
577
+ fill: "currentColor",
578
+ stroke: "none"
579
+ }, null)]))), ee = z("InfoCircleFill", A(r("svg", {
580
+ viewBox: "0 0 48 48",
581
+ fill: "none",
582
+ xmlns: "http://www.w3.org/2000/svg",
583
+ stroke: "currentColor",
584
+ "stroke-width": "4",
585
+ "stroke-linecap": "butt",
586
+ "stroke-linejoin": "miter",
587
+ filter: ""
588
+ }, [r("path", {
589
+ "fill-rule": "evenodd",
590
+ "clip-rule": "evenodd",
591
+ d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",
592
+ fill: "currentColor",
593
+ stroke: "none"
594
+ }, null)]))), te = z("MinusCircleFill", A(r("svg", {
595
+ viewBox: "0 0 48 48",
596
+ fill: "none",
597
+ xmlns: "http://www.w3.org/2000/svg",
598
+ stroke: "currentColor",
599
+ "stroke-width": "4",
600
+ "stroke-linecap": "butt",
601
+ "stroke-linejoin": "miter",
602
+ filter: ""
603
+ }, [r("path", {
604
+ "fill-rule": "evenodd",
605
+ "clip-rule": "evenodd",
606
+ d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-7-22a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H17Z",
607
+ fill: "currentColor",
608
+ stroke: "none"
609
+ }, null)]))), At = /* @__PURE__ */ E({
610
+ name: S("Message"),
611
+ props: {
612
+ id: {
613
+ type: String,
614
+ default: ""
615
+ },
616
+ message: {
617
+ type: [String, Number, Object],
618
+ default: ""
619
+ },
620
+ type: {
621
+ type: String,
622
+ default: "success"
623
+ },
624
+ duration: {
625
+ type: Number,
626
+ default: 1500
627
+ },
628
+ center: {
629
+ type: Boolean,
630
+ default: !1
631
+ },
632
+ onClose: {
633
+ type: Function,
634
+ default: () => {
635
+ }
636
+ },
637
+ offset: {
638
+ type: Number,
639
+ default: 20
640
+ },
641
+ zIndex: {
642
+ type: Number,
643
+ default: 0
644
+ },
645
+ showClose: {
646
+ type: Boolean,
647
+ default: !1
648
+ },
649
+ useHTML: {
650
+ type: Boolean,
651
+ default: !1
652
+ },
653
+ popupClass: {
654
+ type: String,
655
+ default: void 0
656
+ }
657
+ },
658
+ emits: ["destroy"],
659
+ setup(e, {
660
+ emit: t,
661
+ slots: n
662
+ }) {
663
+ const l = p("message"), a = T(!1), s = T(null), d = C(() => [l.block, l.modifier(e.type), e.center && l.modifier("center"), e.showClose && !e.center && l.element("show-close"), e.popupClass]), {
664
+ zIndex: o
665
+ } = G("message", {
666
+ runOnMounted: !0
667
+ }), m = C(() => ({
668
+ top: `${e.offset}px`,
669
+ zIndex: o.value
670
+ })), f = () => {
671
+ if (n.icon) return n.icon();
672
+ switch (e.type) {
673
+ case "success":
674
+ return r(J, null, null);
675
+ case "warning":
676
+ return r(Q, null, null);
677
+ case "strong":
678
+ return r(te, null, null);
679
+ case "error":
680
+ return r(q, null, null);
681
+ case "info":
682
+ return r(ee, null, null);
683
+ default:
684
+ return null;
685
+ }
686
+ }, y = () => {
687
+ e.duration > 0 && (s.value = setTimeout(() => {
688
+ a.value = !1;
689
+ }, e.duration));
690
+ }, c = () => {
691
+ s.value && (clearTimeout(s.value), s.value = null);
692
+ };
693
+ K(() => {
694
+ a.value = !0, y();
695
+ }), fe(() => {
696
+ c();
697
+ });
698
+ const i = () => {
699
+ var u;
700
+ a.value = !1, c(), (u = e.onClose) == null || u.call(e);
701
+ };
702
+ return () => r(H, {
703
+ name: "x-message-slide-top",
704
+ onBeforeLeave: e.onClose,
705
+ onAfterLeave: () => t("destroy")
706
+ }, {
707
+ default: () => [a.value && r("div", {
708
+ class: d.value,
709
+ style: m.value
710
+ }, [r("span", {
711
+ class: [l.element("icon"), l.modifier(`icon-${e.type}`)]
712
+ }, [f()]), r("div", null, [n.default ? n.default() : e.useHTML ? r("span", {
713
+ innerHTML: e.message
714
+ }, null) : r("span", null, [e.message]), e.showClose && r("span", {
715
+ class: l.element("close-icon"),
716
+ onClick: i
717
+ }, null)])])]
718
+ });
719
+ }
720
+ }), $t = $(S("Message"), At), zt = /* @__PURE__ */ E({
721
+ name: "Space",
722
+ props: {
723
+ direction: {
724
+ type: String,
725
+ default: "horizontal"
726
+ },
727
+ size: {
728
+ type: [Number, String],
729
+ default: "small"
730
+ },
731
+ align: {
732
+ type: String,
733
+ default: "center"
734
+ },
735
+ fill: {
736
+ type: Boolean,
737
+ default: !1
738
+ }
739
+ },
740
+ setup(e, {
741
+ slots: t
742
+ }) {
743
+ const n = p("space"), l = C(() => [n.block, n.element(e.direction), e.fill && "is-fill", n.element(`${e.direction}-${e.align}`)]);
744
+ function a(d) {
745
+ if (at(d))
746
+ return d;
747
+ switch (d) {
748
+ case "mini":
749
+ return 4;
750
+ case "small":
751
+ return 8;
752
+ case "medium":
753
+ return 16;
754
+ case "large":
755
+ return 24;
756
+ default:
757
+ return 8;
758
+ }
759
+ }
760
+ const s = (d) => {
761
+ const o = {};
762
+ if (d) return o;
763
+ const m = `${a(e.size)}px`, f = `${a(e.size)}px`;
764
+ return e.direction === "horizontal" && (o.marginRight = m), e.direction === "vertical" && (o.marginBottom = f), o;
765
+ };
766
+ return () => {
767
+ var o;
768
+ const d = R((o = t.default) == null ? void 0 : o.call(t), !0).filter((m) => m.type !== Ye);
769
+ return r("div", {
770
+ class: [l.value]
771
+ }, [d.map((m, f) => {
772
+ var c;
773
+ const y = t.split && f > 0;
774
+ return r(_, {
775
+ key: `space-item-${f}`
776
+ }, [y && r("div", {
777
+ className: n.element("split"),
778
+ style: s(!1)
779
+ }, [(c = t.split) == null ? void 0 : c.call(t)]), r("div", {
780
+ className: n.element("item"),
781
+ style: s(f === d.length - 1)
782
+ }, [m])]);
783
+ })]);
784
+ };
785
+ }
786
+ }), ge = $(S("Space"), zt), Dt = ["info", "success", "warning", "strong", "error"];
787
+ function we(e) {
788
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !k(e);
789
+ }
790
+ const se = p("message-box"), ue = (e) => {
791
+ const t = document.createElement("div"), n = () => {
792
+ N(null, t);
793
+ }, l = (i) => {
794
+ if (i === "cancel")
795
+ return e.beforeOnCancel ? e.beforeOnCancel() : !0;
796
+ if (i === "ok")
797
+ return e.beforeOnOk ? e.beforeOnOk() : !0;
798
+ }, a = (i, u) => {
799
+ i === "cancel" && e.onCancel && e.onCancel(u), i === "ok" && e.onOk && e.onOk(u);
800
+ }, s = (i) => {
801
+ let u;
802
+ switch (i) {
803
+ case "warning":
804
+ u = r(Q, {
805
+ size: "22px",
806
+ color: "#f6c64b"
807
+ }, null);
808
+ break;
809
+ case "strong":
810
+ u = r(te, {
811
+ size: "22px",
812
+ color: "#ff7125"
813
+ }, null);
814
+ break;
815
+ case "error":
816
+ u = r(q, {
817
+ size: "22px",
818
+ color: "#e24f48"
819
+ }, null);
820
+ break;
821
+ case "success":
822
+ u = r(J, {
823
+ size: "22px",
824
+ color: "#68d1ab"
825
+ }, null);
826
+ break;
827
+ case "info":
828
+ u = r(ee, {
829
+ size: "22px",
830
+ color: "#2355f5"
831
+ }, null);
832
+ break;
833
+ }
834
+ return r("div", {
835
+ class: se.element("icon")
836
+ }, [u]);
837
+ }, d = (i) => {
838
+ if (k(i)) return i;
839
+ if (b(i)) {
840
+ const u = i();
841
+ return k(u) ? u : null;
842
+ }
843
+ return r("div", {
844
+ class: se.element("title")
845
+ }, [O(" "), i, O(" ")]);
846
+ }, o = (i) => {
847
+ if (k(i)) return i;
848
+ if (b(i)) {
849
+ const u = i();
850
+ return k(u) ? u : null;
851
+ }
852
+ return r("div", {
853
+ class: se.element("content")
854
+ }, [O(" "), e.content, O(" ")]);
855
+ }, m = () => () => r(_, null, [s(e.type || "success"), e.title && d(e.title)]), f = () => () => r(_, null, [e.content && o(e.content)]), y = () => {
856
+ if (k(e.footer) || b(e.footer))
857
+ return e.footer;
858
+ const i = (e == null ? void 0 : e.cancelText) || "取消", u = (e == null ? void 0 : e.okText) || "确认";
859
+ return (v) => r(ge, {
860
+ size: 12
861
+ }, {
862
+ default: () => {
863
+ var g, w;
864
+ return [!e.hideCancel && r(V, {
865
+ size: "small",
866
+ onClick: v.cancel,
867
+ loading: (g = v.loadingObj) == null ? void 0 : g.cancel
868
+ }, we(i) ? i : {
869
+ default: () => [i]
870
+ }), !e.hideOk && r(V, {
871
+ type: "primary",
872
+ size: "small",
873
+ onClick: v.ok,
874
+ loading: (w = v.loadingObj) == null ? void 0 : w.ok
875
+ }, we(u) ? u : {
876
+ default: () => [u]
877
+ })];
878
+ }
879
+ });
880
+ }, c = r(De, {
881
+ messageBox: !0,
882
+ width: (e == null ? void 0 : e.width) ?? 358,
883
+ height: (e == null ? void 0 : e.height) ?? "auto",
884
+ modelValue: !0,
885
+ renderTo: e == null ? void 0 : e.renderTo,
886
+ center: e != null && e.top ? !1 : (e == null ? void 0 : e.center) ?? !0,
887
+ top: (e == null ? void 0 : e.top) ?? 0,
888
+ mask: (e == null ? void 0 : e.mask) ?? !0,
889
+ maskToClose: (e == null ? void 0 : e.maskToClose) ?? !0,
890
+ popupClass: e.popupClass,
891
+ onClose: a,
892
+ onBeforeCancel: l,
893
+ "onUpdate:modelValue": () => {
894
+ c.component.props.modelValue = !1;
895
+ },
896
+ // 等待动画完全结束后销毁vm
897
+ onClosed: n,
898
+ onOpened: () => {
899
+ }
900
+ }, {
901
+ title: m(),
902
+ default: f(),
903
+ footer: y()
904
+ });
905
+ N(c, t);
906
+ }, It = () => {
907
+ Dt.forEach((e) => {
908
+ ue[e] = (t, n) => {
909
+ const l = [], a = [];
910
+ let s = () => !0, d = () => !0;
911
+ return setTimeout(() => {
912
+ ue({
913
+ title: t,
914
+ content: n,
915
+ type: e,
916
+ beforeOnCancel: d,
917
+ beforeOnOk: s,
918
+ onOk: () => {
919
+ l.forEach((o) => b(o) && o());
920
+ },
921
+ onCancel: () => {
922
+ a.forEach((o) => b(o) && o());
923
+ }
924
+ });
925
+ }, 0), {
926
+ ok(...o) {
927
+ return o.length === 1 && l.push(o[0]), o.length === 2 && (s = o[0], l.push(o[1])), this;
928
+ },
929
+ cancel(...o) {
930
+ return o.length === 1 && a.push(o[0]), o.length === 2 && (d = o[0], a.push(o[1])), this;
931
+ }
932
+ };
933
+ };
934
+ });
935
+ };
936
+ It();
937
+ const Lt = $(S("MessageBox"), ue), jt = {
938
+ position: {
939
+ type: String,
940
+ default: "top-right"
941
+ },
942
+ offset: {
943
+ type: Number,
944
+ default: 0
945
+ },
946
+ title: {
947
+ type: String,
948
+ default: ""
949
+ },
950
+ type: {
951
+ type: String,
952
+ default: "info"
953
+ },
954
+ message: {
955
+ type: String,
956
+ default: void 0
957
+ },
958
+ duration: {
959
+ type: Number,
960
+ default: 3e3
961
+ },
962
+ showClose: {
963
+ type: Boolean,
964
+ default: !0
965
+ },
966
+ onClose: {
967
+ type: Function,
968
+ default: () => {
969
+ }
970
+ },
971
+ renderToBody: {
972
+ type: Boolean,
973
+ default: !1
974
+ }
975
+ }, Ie = /* @__PURE__ */ E({
976
+ name: S("Notification"),
977
+ props: jt,
978
+ emits: ["close", "destroy"],
979
+ setup(e, {
980
+ emit: t,
981
+ slots: n
982
+ }) {
983
+ const l = p("notification"), a = l.block, s = C(() => [a, l.modifier(o.value.ver)]), {
984
+ zIndex: d
985
+ } = G("message", {
986
+ runOnMounted: !0
987
+ }), o = C(() => {
988
+ const g = e.position.split("-");
989
+ return {
990
+ hor: g[1],
991
+ ver: g[0]
992
+ };
993
+ }), m = C(() => `x-notification-slide-${o.value.hor}`), f = C(() => {
994
+ const g = {};
995
+ return g.position = e.renderToBody ? "fixed" : "absolute", g.zIndex = d.value, g[o.value.hor] = "20px", g[o.value.ver] = `${e.offset}px`, g;
996
+ }), y = T(!1);
997
+ let c = 0;
998
+ const i = () => {
999
+ c = setTimeout(() => {
1000
+ y.value = !1;
1001
+ }, e.duration);
1002
+ }, u = C(() => e.type === "info" ? ee : e.type === "warning" ? Q : e.type === "strong" ? te : e.type === "success" ? J : e.type === "error" ? q : ""), v = () => {
1003
+ y.value = !1;
1004
+ };
1005
+ return K(() => {
1006
+ e.duration !== 0 && i(), y.value = !0;
1007
+ }), fe(() => {
1008
+ clearTimeout(c);
1009
+ }), () => r(H, {
1010
+ name: m.value,
1011
+ onBeforeLeave: () => t("close"),
1012
+ onAfterLeave: () => t("destroy")
1013
+ }, {
1014
+ default: () => {
1015
+ var g;
1016
+ return [y.value && r("div", {
1017
+ class: s.value,
1018
+ style: f.value
1019
+ }, [r("div", {
1020
+ class: [l.element("header")]
1021
+ }, [r("div", {
1022
+ class: [l.element("icon"), l.modifier(`icon-${e.type}`)]
1023
+ }, [u.value && r(u.value, null, null)]), r("div", null, [r("div", {
1024
+ class: [l.element("title")]
1025
+ }, [e.title]), r("div", {
1026
+ class: [l.element("message")]
1027
+ }, [((g = n.default) == null ? void 0 : g.call(n)) || e.message])])]), e.showClose && r("span", {
1028
+ class: [l.element("close-icon")],
1029
+ onClick: v
1030
+ }, null)])];
1031
+ }
1032
+ });
1033
+ }
1034
+ }), Pt = $(S("Notification"), Ie), Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1035
+ __proto__: null,
1036
+ XButton: V,
1037
+ XDialog: De,
1038
+ XMessage: $t,
1039
+ XMessageBox: Lt,
1040
+ XNotification: Pt,
1041
+ XSpace: ge
1042
+ }, Symbol.toStringTag, { value: "Module" }));
1043
+ function Se(e) {
1044
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !k(e);
1045
+ }
1046
+ const pe = p("dialog"), Gt = (e) => {
1047
+ const t = document.createElement("div"), n = () => {
1048
+ N(null, t);
1049
+ }, l = (c) => {
1050
+ if (c === "cancel")
1051
+ return e.beforeOnCancel ? e.beforeOnCancel() : !0;
1052
+ if (c === "ok")
1053
+ return e.beforeOnOk ? e.beforeOnOk() : !0;
1054
+ }, a = (c, i) => {
1055
+ c === "cancel" && e.onCancel && e.onCancel(i), c === "ok" && e.onOk && e.onOk(i);
1056
+ }, s = (c) => {
1057
+ if (k(c)) return c;
1058
+ if (b(c)) {
1059
+ const i = c();
1060
+ return k(i) ? i : null;
1061
+ }
1062
+ return r("div", {
1063
+ class: pe.element("header-title")
1064
+ }, [O(" "), c, O(" ")]);
1065
+ }, d = (c) => {
1066
+ if (k(c)) return c;
1067
+ if (b(c)) {
1068
+ const i = c();
1069
+ return k(i) ? i : null;
1070
+ }
1071
+ return r("div", {
1072
+ class: pe.element("content")
1073
+ }, [O(" "), e.content, O(" ")]);
1074
+ }, o = () => () => r(_, null, [e.title && s(e.title)]), m = () => () => r(_, null, [e.content && d(e.content)]), f = () => {
1075
+ if (k(e.footer) || b(e.footer))
1076
+ return e.footer;
1077
+ const c = (e == null ? void 0 : e.cancelText) || "取消", i = (e == null ? void 0 : e.okText) || "确认";
1078
+ return (u) => r(ge, {
1079
+ size: 12
1080
+ }, {
1081
+ default: () => {
1082
+ var v, g;
1083
+ return [!e.hideCancel && r(V, {
1084
+ size: "small",
1085
+ onClick: u.cancel,
1086
+ loading: (v = u.loadingObj) == null ? void 0 : v.cancel
1087
+ }, Se(c) ? c : {
1088
+ default: () => [c]
1089
+ }), !e.hideOk && r(V, {
1090
+ type: "primary",
1091
+ size: "small",
1092
+ onClick: u.ok,
1093
+ loading: (g = u.loadingObj) == null ? void 0 : g.ok
1094
+ }, Se(i) ? i : {
1095
+ default: () => [i]
1096
+ })];
1097
+ }
1098
+ });
1099
+ }, y = r(ze, {
1100
+ width: (e == null ? void 0 : e.width) ?? 368,
1101
+ height: (e == null ? void 0 : e.height) ?? "auto",
1102
+ modelValue: !0,
1103
+ renderTo: e == null ? void 0 : e.renderTo,
1104
+ center: e != null && e.top ? !1 : (e == null ? void 0 : e.center) ?? !0,
1105
+ top: (e == null ? void 0 : e.top) ?? 0,
1106
+ mask: (e == null ? void 0 : e.mask) ?? !0,
1107
+ maskToClose: (e == null ? void 0 : e.maskToClose) ?? !0,
1108
+ popupClass: e.popupClass,
1109
+ onClose: a,
1110
+ onBeforeCancel: l,
1111
+ "onUpdate:modelValue": () => {
1112
+ y.component.props.modelValue = !1;
1113
+ },
1114
+ // 等待动画完全结束后销毁vm
1115
+ onClosed: n,
1116
+ onOpened: () => {
1117
+ }
1118
+ }, {
1119
+ title: o(),
1120
+ default: m(),
1121
+ footer: f()
1122
+ });
1123
+ N(y, t);
1124
+ }, Ht = ["success", "warning", "error", "strong", "info"], _t = E({
1125
+ name: S("Message"),
1126
+ components: {
1127
+ CloseCircleFill: q,
1128
+ CheckCircleFill: J,
1129
+ ExclamationCircleFill: Q,
1130
+ InfoCircleFill: ee,
1131
+ MinusCircleFill: te
1132
+ },
1133
+ props: {
1134
+ id: {
1135
+ type: String,
1136
+ default: ""
1137
+ },
1138
+ message: {
1139
+ type: [String, Number, Object],
1140
+ default: ""
1141
+ },
1142
+ type: {
1143
+ type: String,
1144
+ default: "success"
1145
+ },
1146
+ duration: {
1147
+ type: Number,
1148
+ default: 1500
1149
+ },
1150
+ center: {
1151
+ type: Boolean,
1152
+ default: !1
1153
+ },
1154
+ onClose: {
1155
+ type: Function,
1156
+ default: () => {
1157
+ }
1158
+ },
1159
+ offset: {
1160
+ type: Number,
1161
+ default: 20
1162
+ },
1163
+ zIndex: {
1164
+ type: Number,
1165
+ default: 0
1166
+ },
1167
+ showClose: {
1168
+ type: Boolean,
1169
+ default: !1
1170
+ },
1171
+ useHTML: Boolean,
1172
+ popupClass: {
1173
+ type: String,
1174
+ default: void 0
1175
+ }
1176
+ },
1177
+ emits: ["destroy"],
1178
+ setup(e) {
1179
+ const t = p("message"), n = C(() => [
1180
+ t.block,
1181
+ t.modifier(e.type),
1182
+ e.center && t.modifier("center"),
1183
+ e.showClose && !e.center && t.element("show-close"),
1184
+ e.popupClass && e.popupClass
1185
+ ]), l = T(!1);
1186
+ let a = null;
1187
+ const s = () => {
1188
+ a = setTimeout(() => {
1189
+ l.value = !1;
1190
+ }, e.duration);
1191
+ };
1192
+ K(() => {
1193
+ l.value = !0, e.duration !== 0 && s();
1194
+ }), fe(() => {
1195
+ clearTimeout(a);
1196
+ });
1197
+ const { zIndex: d } = G("message", { runOnMounted: !0 }), o = C(() => ({
1198
+ top: `${e.offset}px`,
1199
+ zIndex: d.value
1200
+ }));
1201
+ return {
1202
+ cn: t,
1203
+ cls: n,
1204
+ styles: o,
1205
+ visible: l,
1206
+ handleClose: () => {
1207
+ l.value = !1;
1208
+ }
1209
+ };
1210
+ }
1211
+ }), Vt = (e, t) => {
1212
+ const n = e.__vccOpts || e;
1213
+ for (const [l, a] of t)
1214
+ n[l] = a;
1215
+ return n;
1216
+ }, Wt = ["innerHTML"], Zt = { key: 1 };
1217
+ function Xt(e, t, n, l, a, s) {
1218
+ const d = I("CheckCircleFill"), o = I("ExclamationCircleFill"), m = I("MinusCircleFill"), f = I("CloseCircleFill"), y = I("InfoCircleFill");
1219
+ return B(), F(H, {
1220
+ name: "x-message-slide-top",
1221
+ onBeforeLeave: e.onClose,
1222
+ onAfterLeave: t[1] || (t[1] = (c) => e.$emit("destroy"))
1223
+ }, {
1224
+ default: Ge(() => [
1225
+ qe(Je("div", {
1226
+ class: re(e.cls),
1227
+ style: Qe(e.styles)
1228
+ }, [
1229
+ e.$slots.icon ? oe("", !0) : (B(), U("span", {
1230
+ key: 0,
1231
+ class: re([e.cn.element("icon"), e.cn.modifier(`icon-${e.type}`)])
1232
+ }, [
1233
+ ke(e.$slots, "icon", {}, () => [
1234
+ e.type === "success" ? (B(), F(d, { key: 0 })) : e.type === "warning" ? (B(), F(o, { key: 1 })) : e.type === "strong" ? (B(), F(m, { key: 2 })) : e.type === "error" ? (B(), F(f, { key: 3 })) : e.type === "info" ? (B(), F(y, { key: 4 })) : oe("", !0)
1235
+ ])
1236
+ ], 2)),
1237
+ ke(e.$slots, "default", {}, () => [
1238
+ e.useHTML ? (B(), U("span", {
1239
+ key: 0,
1240
+ innerHTML: e.message
1241
+ }, null, 8, Wt)) : (B(), U("span", Zt, et(e.message), 1)),
1242
+ e.showClose ? (B(), U("span", {
1243
+ key: 2,
1244
+ class: re([e.cn.element("close-icon")]),
1245
+ onClick: t[0] || (t[0] = (...c) => e.handleClose && e.handleClose(...c))
1246
+ }, null, 2)) : oe("", !0)
1247
+ ])
1248
+ ], 6), [
1249
+ [tt, e.visible]
1250
+ ])
1251
+ ]),
1252
+ _: 3
1253
+ }, 8, ["onBeforeLeave"]);
1254
+ }
1255
+ const Ut = /* @__PURE__ */ Vt(_t, [["render", Xt]]), ce = /* @__PURE__ */ new WeakMap(), ie = (e) => {
1256
+ (typeof e == "string" || k(e)) && (e = {
1257
+ message: e
1258
+ });
1259
+ const t = me(e.renderTo || "body"), n = document.createElement("div");
1260
+ ce.has(t) || ce.set(t, []);
1261
+ const l = ce.get(t);
1262
+ let a = e.offset || 20;
1263
+ l.forEach((c) => {
1264
+ var i;
1265
+ a += ((i = c.el) == null ? void 0 : i.offsetHeight) + 20;
1266
+ });
1267
+ const s = e.onClose;
1268
+ let d = {};
1269
+ d = { ...e, onClose: () => {
1270
+ var u;
1271
+ const c = l.findIndex((v) => v === f);
1272
+ if (c < 0) return;
1273
+ const i = ((u = f.el) == null ? void 0 : u.offsetHeight) + 20;
1274
+ l.slice(c + 1).forEach((v) => {
1275
+ var w;
1276
+ const g = (w = v.component) == null ? void 0 : w.props.offset;
1277
+ v.component.props.offset = g - i;
1278
+ }), l.splice(c, 1), s && s(f);
1279
+ }, onDestroy: () => {
1280
+ N(null, n);
1281
+ }, offset: a };
1282
+ const f = r(
1283
+ Ut,
1284
+ d,
1285
+ b(d.message) || k(d.message) ? {
1286
+ default: b(d.message) ? d.message : () => d.message
1287
+ } : null
1288
+ );
1289
+ return console.log("VM----", f), N(f, n), t.tagName === "BODY" ? f.el.style.position = "fixed" : (t.style.position = "relative", f.el.style.position = "absolute"), t.appendChild(n.firstElementChild), l.push(f), {
1290
+ close: () => {
1291
+ f.component.proxy.handleClose();
1292
+ }
1293
+ };
1294
+ }, Rt = () => {
1295
+ Ht.forEach((e) => {
1296
+ ie[e] = (t) => Ee(t) ? ie({
1297
+ type: e,
1298
+ ...t
1299
+ }) : ie({
1300
+ message: t,
1301
+ type: e
1302
+ });
1303
+ });
1304
+ };
1305
+ Rt();
1306
+ const L = /* @__PURE__ */ new WeakMap(), qt = (e) => {
1307
+ const t = me(e.renderTo || "body"), n = document.createElement("div");
1308
+ L.get(t) || L.set(t, {}), L.get(t)[e.position] || (L.get(t)[e.position] = []);
1309
+ const l = L.get(t)[e.position];
1310
+ let a = e.offset || 20;
1311
+ l.forEach((y) => {
1312
+ var c;
1313
+ a += ((c = y.el) == null ? void 0 : c.offsetHeight) + 20;
1314
+ });
1315
+ const s = t.tagName === "BODY";
1316
+ s || (t.style.position = "relative", t.style.overflowX = "hidden");
1317
+ const d = e.onClose, o = () => {
1318
+ var i;
1319
+ const y = l.findIndex((u) => u === f);
1320
+ if (y < 0) return;
1321
+ const c = ((i = f.el) == null ? void 0 : i.offsetHeight) + 20;
1322
+ l.slice(y + 1).forEach((u) => {
1323
+ var g;
1324
+ const v = (g = u.component) == null ? void 0 : g.props.offset;
1325
+ u.component.props.offset = v - c;
1326
+ }), l.splice(y, 1), d && d(f);
1327
+ }, m = () => {
1328
+ N(null, n);
1329
+ }, f = r(
1330
+ Ie,
1331
+ {
1332
+ message: e.message,
1333
+ title: e.title,
1334
+ type: e.type,
1335
+ offset: a,
1336
+ renderToBody: s,
1337
+ position: e.position,
1338
+ duration: e.duration ?? 3e3,
1339
+ showClose: e.showClose ?? !0,
1340
+ onClose: o,
1341
+ onDestroy: m
1342
+ },
1343
+ b(e.message) || k(e.message) ? {
1344
+ default: b(e.message) ? e.message : () => e.message
1345
+ } : null
1346
+ );
1347
+ N(f, n), l.push(f), t == null || t.appendChild(n.firstChild);
1348
+ }, Jt = {
1349
+ install: function(e) {
1350
+ Object.keys(Be).forEach((t) => {
1351
+ const n = Be[t];
1352
+ n.install && e.use(n);
1353
+ });
1354
+ }
1355
+ };
1356
+ export {
1357
+ Gt as Dialog,
1358
+ ie as Message,
1359
+ ue as MessageBox,
1360
+ qt as Notification,
1361
+ V as XButton,
1362
+ De as XDialog,
1363
+ $t as XMessage,
1364
+ Lt as XMessageBox,
1365
+ Pt as XNotification,
1366
+ ge as XSpace,
1367
+ Jt as default
1368
+ };