x-next 0.0.0-alpha.1 → 0.0.0-alpha.10

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