x-next 0.0.0-alpha.4 → 0.0.0-alpha.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/_container/client-only.d.ts +4 -0
  2. package/dist/_container/parent-scroll-observer.d.ts +6 -0
  3. package/dist/_container/resize-observer.d.ts +6 -0
  4. package/dist/_container/utils.d.ts +12 -0
  5. package/dist/_hooks/_types.d.ts +4 -0
  6. package/dist/_hooks/use-first-element.d.ts +5 -0
  7. package/dist/_hooks/use-index.d.ts +9 -0
  8. package/dist/_hooks/use-overflow.d.ts +5 -0
  9. package/dist/_hooks/use-popup-manager.d.ts +11 -0
  10. package/dist/_hooks/use-resize-observer.d.ts +8 -0
  11. package/dist/_props/css.d.ts +13 -0
  12. package/dist/_props/global.d.ts +1 -0
  13. package/dist/_utils/click.d.ts +13 -0
  14. package/dist/_utils/config.d.ts +9 -0
  15. package/dist/_utils/constant.d.ts +17 -0
  16. package/dist/_utils/convert-case.d.ts +3 -0
  17. package/dist/_utils/dom.d.ts +10 -0
  18. package/dist/_utils/helpers.d.ts +12 -0
  19. package/dist/_utils/is.d.ts +25 -0
  20. package/dist/_utils/keyboard.d.ts +24 -0
  21. package/dist/_utils/number.d.ts +0 -0
  22. package/dist/_utils/vue-eco.d.ts +38 -0
  23. package/dist/components/button/Button.d.ts +97 -0
  24. package/dist/components/button/index.d.ts +181 -0
  25. package/dist/components/button/props.d.ts +45 -0
  26. package/dist/components/dialog/Dialog.d.ts +188 -0
  27. package/dist/components/dialog/index.d.ts +334 -0
  28. package/dist/components/dialog/props.d.ts +83 -0
  29. package/dist/components/dialog/use-props.d.ts +33 -0
  30. package/dist/components/dialog/use.d.ts +3 -0
  31. package/dist/components/dialog/warp.d.ts +2 -0
  32. package/dist/components/form/constants.d.ts +4 -0
  33. package/dist/components/form/form-item.d.ts +31 -0
  34. package/dist/components/form/form.d.ts +39 -0
  35. package/dist/components/form/hooks.d.ts +4 -0
  36. package/dist/components/form/types.d.ts +31 -0
  37. package/dist/components/index.d.ts +10 -0
  38. package/dist/components/input/Input.d.ts +220 -0
  39. package/dist/components/input/index.d.ts +394 -0
  40. package/dist/components/input/props.d.ts +95 -0
  41. package/dist/components/input/utils.d.ts +6 -0
  42. package/dist/components/message/Message.d.ts +108 -0
  43. package/dist/components/message/MessageVue.vue.d.ts +362 -0
  44. package/dist/components/message/index.d.ts +193 -0
  45. package/dist/components/message/props.d.ts +31 -0
  46. package/dist/components/message/warp.d.ts +3 -0
  47. package/dist/components/message-box/MessageBox.d.ts +3 -0
  48. package/dist/components/message-box/index.d.ts +4 -0
  49. package/dist/components/message-box/props.d.ts +52 -0
  50. package/dist/components/message-box/warp.d.ts +2 -0
  51. package/dist/components/notification/Notification.d.ts +89 -0
  52. package/dist/components/notification/index.d.ts +166 -0
  53. package/dist/components/notification/props.d.ts +54 -0
  54. package/dist/components/notification/warp.d.ts +3 -0
  55. package/dist/components/popconfirm/index.d.ts +193 -0
  56. package/dist/components/popconfirm/src/Popconfirm.d.ts +104 -0
  57. package/dist/components/popconfirm/src/popup.vue.d.ts +407 -0
  58. package/dist/components/popconfirm/src/props.d.ts +45 -0
  59. package/dist/components/popconfirm/src/types.d.ts +3 -0
  60. package/dist/components/scrollbar/index.d.ts +0 -0
  61. package/dist/components/scrollbar/props.d.ts +16 -0
  62. package/dist/components/space/Space.d.ts +42 -0
  63. package/dist/components/space/index.d.ts +82 -0
  64. package/dist/components/tag-cloud/index.d.ts +0 -0
  65. package/dist/components/timeline/index.d.ts +58 -0
  66. package/dist/components/timeline/src/context.d.ts +12 -0
  67. package/dist/components/timeline/src/props.d.ts +31 -0
  68. package/dist/components/timeline/src/timeline-item.d.ts +12 -0
  69. package/dist/components/timeline/src/timeline.d.ts +24 -0
  70. package/dist/components/timeline/src/types.d.ts +9 -0
  71. package/dist/components/timeline-item/index.d.ts +34 -0
  72. package/dist/components/trend-chart/components/TrendChart.d.ts +277 -0
  73. package/dist/components/trend-chart/components/trend-chart-curve.d.ts +111 -0
  74. package/dist/components/trend-chart/components/trend-chart-grid.d.ts +55 -0
  75. package/dist/components/trend-chart/components/trend-chart-labels.d.ts +22 -0
  76. package/dist/components/trend-chart/helpers/genPath.d.ts +8 -0
  77. package/dist/components/trend-chart/helpers/genPoints.d.ts +3 -0
  78. package/dist/components/trend-chart/helpers/getPadding.d.ts +7 -0
  79. package/dist/components/trend-chart/helpers/validatePadding.d.ts +2 -0
  80. package/dist/components/trend-chart/index.d.ts +535 -0
  81. package/dist/components/trend-chart/props.d.ts +203 -0
  82. package/dist/components/trend-chart/themes.d.ts +128 -0
  83. package/dist/components/trend-chart.bak/components/trend-chart-curve.d.ts +111 -0
  84. package/dist/components/trend-chart.bak/components/trend-chart-grid.d.ts +55 -0
  85. package/dist/components/trend-chart.bak/components/trend-chart-labels.d.ts +22 -0
  86. package/dist/components/trend-chart.bak/components/trend-chart.d.ts +274 -0
  87. package/dist/components/trend-chart.bak/helpers/genPath.d.ts +8 -0
  88. package/dist/components/trend-chart.bak/helpers/genPoints.d.ts +3 -0
  89. package/dist/components/trend-chart.bak/helpers/getPadding.d.ts +7 -0
  90. package/dist/components/trend-chart.bak/helpers/validatePadding.d.ts +2 -0
  91. package/dist/components/trend-chart.bak/index.d.ts +530 -0
  92. package/dist/components/trend-chart.bak/props.d.ts +211 -0
  93. package/dist/components/trend-chart.bak/themes.d.ts +152 -0
  94. package/dist/components/trigger/index.d.ts +487 -0
  95. package/dist/components/trigger/src/_trigger.d.ts +217 -0
  96. package/dist/components/trigger/src/constant.d.ts +8 -0
  97. package/dist/components/trigger/src/trigger.d.ts +288 -0
  98. package/dist/components/trigger/src/utils.d.ts +50 -0
  99. package/dist/directives/clipboard/cache.d.ts +8 -0
  100. package/dist/directives/clipboard/clipboard.d.ts +18 -0
  101. package/dist/directives/clipboard/convert.d.ts +3 -0
  102. package/dist/directives/clipboard/index.d.ts +3 -0
  103. package/dist/directives/clipboard/plugin.d.ts +2 -0
  104. package/dist/directives/clipboard/textarea.d.ts +3 -0
  105. package/dist/icons/animation/animation-loading.d.ts +50 -0
  106. package/dist/icons/default/check-circle-fill.d.ts +50 -0
  107. package/dist/icons/default/close-circle-fill.d.ts +50 -0
  108. package/dist/icons/default/exclamation-circle-fill.d.ts +50 -0
  109. package/dist/icons/default/info-circle-fill.d.ts +50 -0
  110. package/dist/icons/default/logo-simple.d.ts +50 -0
  111. package/dist/icons/default/minus-circle-fill.d.ts +50 -0
  112. package/dist/icons/icon.d.ts +51 -0
  113. package/dist/icons/index.d.ts +8 -0
  114. package/dist/index.d.ts +13 -0
  115. package/dist/index.es.js +3166 -0
  116. package/dist/index.umd.js +1 -1
  117. package/dist/style.css +1 -0
  118. package/dist/types.d.ts +13 -0
  119. package/package.json +25 -11
  120. package/volar.d.ts +17 -0
@@ -0,0 +1,3166 @@
1
+ var $t = Object.defineProperty;
2
+ var At = (e, t, n) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var Q = (e, t, n) => At(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { cloneVNode as Pt, defineComponent as E, computed as v, createVNode as c, h as p, reactive as re, getCurrentInstance as Ft, ref as O, watch as G, onMounted as W, onBeforeUnmount as ct, readonly as It, Teleport as jt, Transition as te, createTextVNode as P, onUnmounted as oe, Comment as Vt, Fragment as Z, render as j, isVNode as M, resolveComponent as H, createBlock as Y, openBlock as A, withCtx as me, withDirectives as ut, createElementVNode as ee, normalizeStyle as dt, normalizeClass as X, renderSlot as qe, toDisplayString as Oe, vShow as ft, toRefs as ht, nextTick as Te, provide as Dt, onUpdated as Ht, inject as Xt, mergeProps as Qe, createElementBlock as ke, createCommentVNode as De } from "vue";
5
+ const Wt = "X", Yt = "x", mt = (e) => e ? Yt + "-" + e : e || "", S = (e) => Wt + e, z = (e) => {
6
+ const t = mt(e);
7
+ return {
8
+ block: t,
9
+ element: (o) => `${t}--${o}`,
10
+ modifier: (o) => `${t}-${o}`,
11
+ is: (o) => `${t}-is-${o}`
12
+ };
13
+ }, ye = Object.prototype.toString;
14
+ function ge(e) {
15
+ return ye.call(e) === "[object Array]";
16
+ }
17
+ function vt(e) {
18
+ return ye.call(e) === "[object Object]";
19
+ }
20
+ const Ne = (e) => ye.call(e) === "[object Promise]", qt = (e) => x(e) && e.constructor.name === "AsyncFunction", Gt = (e) => Ne(e) || qt(e);
21
+ function bt(e) {
22
+ return ye.call(e) === "[object String]";
23
+ }
24
+ function Zt(e) {
25
+ return ye.call(e) === "[object Number]" && e === e;
26
+ }
27
+ function Ut(e) {
28
+ return e === void 0;
29
+ }
30
+ function x(e) {
31
+ return typeof e == "function";
32
+ }
33
+ function Ee() {
34
+ return typeof window < "u";
35
+ }
36
+ const N = (e) => e, Ue = (e) => !!(e && e.shapeFlag & 1), Ke = (e, t) => !!(e && e.shapeFlag & 6), Kt = (e, t) => !!(e && e.shapeFlag & 8), Je = (e, t) => !!(e && e.shapeFlag & 16), Jt = (e, t) => !!(e && e.shapeFlag & 32), Le = (e, t = !1) => {
37
+ var l, r;
38
+ const n = [];
39
+ for (const o of e ?? [])
40
+ Ue(o) || Ke(o) || t && Kt(o, o.children) ? n.push(o) : Je(o, o.children) ? n.push(...Le(o.children, t)) : Jt(o, o.children) ? n.push(...Le((r = (l = o.children).default) == null ? void 0 : r.call(l), t)) : ge(o) && n.push(...Le(o, t));
41
+ return n;
42
+ }, Se = (e) => {
43
+ if (ge(e))
44
+ for (const t of e) {
45
+ const n = Se(t);
46
+ if (n) return n;
47
+ }
48
+ else {
49
+ if (Ue(e))
50
+ return e.el;
51
+ if (Ke(e)) {
52
+ if (e.el.nodeType === 1)
53
+ return e.el;
54
+ if (e.component) {
55
+ const t = Se(e.component.subTree);
56
+ if (t) return t;
57
+ }
58
+ } else if (Je(e, e.children))
59
+ for (const t of e.children) {
60
+ const n = Se(t);
61
+ if (n) return n;
62
+ }
63
+ }
64
+ return null;
65
+ }, Qt = (e) => {
66
+ if (Je(e, e.children))
67
+ return e.children;
68
+ if (ge(e))
69
+ return e;
70
+ }, yt = (e, t) => {
71
+ if (e && e.length > 0)
72
+ for (let n = 0; n < e.length; n++) {
73
+ const l = e[n];
74
+ if (Ue(l) || Ke(l)) {
75
+ const o = x(t) ? t(l) : t;
76
+ return e[n] = Pt(l, o, !0), !0;
77
+ }
78
+ const r = Qt(l);
79
+ if (r && r.length > 0 && yt(r, t))
80
+ return !0;
81
+ }
82
+ return !1;
83
+ }, V = (e, t) => Object.assign(t, {
84
+ install(n) {
85
+ n.component(e) || n.component(e, t);
86
+ }
87
+ }), Rt = {
88
+ disabled: Boolean,
89
+ block: Boolean,
90
+ loading: Boolean,
91
+ loadingFill: {
92
+ type: Boolean,
93
+ default: !1
94
+ },
95
+ debounce: {
96
+ type: Number,
97
+ default: 0
98
+ },
99
+ shape: {
100
+ type: N(String),
101
+ default: void 0
102
+ },
103
+ link: {
104
+ type: Boolean,
105
+ default: !1
106
+ },
107
+ type: {
108
+ type: N(String),
109
+ default: void 0
110
+ },
111
+ status: {
112
+ type: N(String),
113
+ default: void 0
114
+ },
115
+ plain: {
116
+ type: Boolean,
117
+ default: !1
118
+ },
119
+ size: {
120
+ type: N(String),
121
+ default: "medium"
122
+ },
123
+ border: {
124
+ type: Boolean,
125
+ default: !0
126
+ }
127
+ }, en = (e) => bt(e) ? e.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join("") : "", tn = (e, t = "px") => {
128
+ if (e === void 0) return "";
129
+ const n = typeof e == "number" ? `${e}` : e;
130
+ return ["px", "%", "vh", "vw", "calc"].some((r) => n.includes(r)) ? n : n + t;
131
+ };
132
+ function U(e, t) {
133
+ return /* @__PURE__ */ E({
134
+ name: mt(`Icon${en(e)}`),
135
+ props: {
136
+ size: {
137
+ type: [Number, String],
138
+ default: void 0
139
+ },
140
+ rotate: {
141
+ type: Number,
142
+ default: void 0
143
+ },
144
+ spin: {
145
+ type: Boolean,
146
+ default: !1
147
+ },
148
+ color: {
149
+ type: String,
150
+ default: void 0
151
+ },
152
+ fillColor: {
153
+ type: Array,
154
+ default: void 0
155
+ }
156
+ },
157
+ setup(n) {
158
+ const l = "x-icon", r = v(() => {
159
+ const a = {};
160
+ return n.size && (a.fontSize = tn(n.size)), n.rotate && (a.transform = `rotate(${n.rotate}deg)`), n.color && (a.color = n.color), a;
161
+ }), o = v(() => [l, {
162
+ [`${l}-loading`]: n.spin
163
+ }]);
164
+ return () => c("div", {
165
+ class: o.value,
166
+ style: r.value
167
+ }, [t]);
168
+ }
169
+ });
170
+ }
171
+ const nn = U("InfoCircleFill", p(c("svg", {
172
+ viewBox: "0 0 50 50",
173
+ class: "x-icon-loading-svg"
174
+ }, [c("circle", {
175
+ cx: "25",
176
+ cy: "25",
177
+ r: "20",
178
+ class: "path",
179
+ fill: "none",
180
+ stroke: "currentColor"
181
+ }, null)]))), ln = /* @__PURE__ */ E({
182
+ name: "Button",
183
+ props: Rt,
184
+ emits: ["click"],
185
+ // 显式导入插槽
186
+ $slots: ["prefix", "suffix"],
187
+ setup(e, {
188
+ slots: t,
189
+ emit: n
190
+ }) {
191
+ const l = re({
192
+ clicked: !1,
193
+ isDebounce: !1
194
+ }), r = z("button"), o = v(() => [r.block, e.size && r.modifier(e.size), e.type && r.modifier(e.type), e.status && r.modifier(e.status), e.disabled && r.is("disabled"), e.block && r.modifier("block"), e.plain && r.is("plain"), e.shape && r.modifier(e.shape), e.link && r.modifier("is-link"), !e.border && r.modifier("is-hide-border"), i.value && r.modifier("is-loading")]), a = () => {
195
+ e.debounce > 0 && !l.isDebounce && (l.isDebounce = !0, setTimeout(() => {
196
+ l.isDebounce = !1;
197
+ }, e.debounce));
198
+ }, i = v(() => e.loading || l.clicked || l.isDebounce), d = Ft(), s = (u, f) => {
199
+ const h = u(f);
200
+ Gt(h) && (l.clicked = !0, h.finally(() => {
201
+ l.clicked = !1;
202
+ }));
203
+ }, m = (u) => {
204
+ var h, g, y, T;
205
+ if (u.stopPropagation(), (g = (h = u.target).blur) == null || g.call(h), i.value) return;
206
+ a();
207
+ const f = (T = (y = d == null ? void 0 : d.vnode) == null ? void 0 : y.props) == null ? void 0 : T.onClick;
208
+ if (ge(f))
209
+ f.forEach(($) => s($, u));
210
+ else if (x(f)) {
211
+ s(f, u);
212
+ return;
213
+ }
214
+ };
215
+ return () => {
216
+ var u;
217
+ return c("button", {
218
+ class: o.value,
219
+ type: "button",
220
+ disabled: e.disabled,
221
+ onClick: m
222
+ }, [c("span", {
223
+ style: {
224
+ display: i.value ? "flex" : "none",
225
+ marginRight: i.value ? "4px" : "0px"
226
+ },
227
+ class: r.element("loading")
228
+ }, [c(nn, null, null)]), t.prefix && c("span", {
229
+ class: r.element("prefix")
230
+ }, [t.prefix()]), c("span", {
231
+ class: r.element("content")
232
+ }, [(u = t.default) == null ? void 0 : u.call(t)]), t.suffix && c("span", {
233
+ class: r.element("suffix")
234
+ }, [t.suffix()])]);
235
+ };
236
+ }
237
+ }), ne = V(S("Button"), ln), rn = ["px", "%", "vh", "vw", "calc"], Re = (e, t = "px") => {
238
+ if (e === void 0) return "";
239
+ const n = String(e);
240
+ return rn.some((l) => n.includes(l)) ? n : n + t;
241
+ }, on = 1e3, an = 3e3, sn = 1;
242
+ class cn {
243
+ constructor() {
244
+ Q(this, "popupStack", {
245
+ popup: /* @__PURE__ */ new Set(),
246
+ dialog: /* @__PURE__ */ new Set(),
247
+ message: /* @__PURE__ */ new Set()
248
+ });
249
+ Q(this, "getNextZIndex", (t) => (t === "message" ? Array.from(this.popupStack.message).pop() || an : Array.from(this.popupStack.popup).pop() || on) + sn);
250
+ Q(this, "add", (t) => {
251
+ const n = this.getNextZIndex(t);
252
+ return this.popupStack[t].add(n), t === "dialog" && this.popupStack.popup.add(n), n;
253
+ });
254
+ Q(this, "delete", (t, n) => {
255
+ this.popupStack[n].delete(t), n === "dialog" && this.popupStack.popup.delete(t);
256
+ });
257
+ Q(this, "isLastDialog", (t) => this.popupStack.dialog.size > 1 ? t === Array.from(this.popupStack.dialog).pop() : !0);
258
+ }
259
+ }
260
+ const He = new cn();
261
+ function Ce(e, {
262
+ visible: t,
263
+ runOnMounted: n
264
+ } = {}) {
265
+ const l = O(0), r = () => {
266
+ l.value = He.add(e);
267
+ }, o = () => {
268
+ He.delete(l.value, e);
269
+ }, a = () => e === "dialog" ? He.isLastDialog(l.value) : !1;
270
+ return G(
271
+ () => t == null ? void 0 : t.value,
272
+ (i) => {
273
+ i ? r() : o();
274
+ },
275
+ {
276
+ immediate: !0
277
+ }
278
+ ), n && (W(r), ct(o)), {
279
+ zIndex: It(l),
280
+ open: r,
281
+ close: o,
282
+ isLastDialog: a
283
+ };
284
+ }
285
+ const gt = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t, n) => (n == null ? void 0 : n.toUpperCase()) ?? ""), Ct = () => {
286
+ }, un = (e, t) => {
287
+ if (Ee)
288
+ return (t ?? document).querySelector(e) ?? void 0;
289
+ }, dn = (e) => {
290
+ if (e.tagName === "BODY")
291
+ return window.innerWidth - (document.documentElement.offsetWidth || document.body.offsetWidth);
292
+ const { borderLeftWidth: t, borderRightWidth: n } = window.getComputedStyle(e), l = Number(t.replace("px", "")) + Number(n.replace("px", ""));
293
+ return e.offsetWidth - (e.clientWidth + l);
294
+ }, fn = (e) => e.tagName === "BODY" ? document.documentElement.scrollHeight > window.innerHeight : e.scrollHeight > e.offsetHeight, hn = (e, t) => {
295
+ var l;
296
+ if (!Ee || !e) return "";
297
+ let n = gt(t);
298
+ n === "float" && (n = "cssFloat");
299
+ try {
300
+ const r = e.style[n];
301
+ if (r) return r;
302
+ const o = (l = document.defaultView) == null ? void 0 : l.getComputedStyle(e, "");
303
+ return o ? o[n] : "";
304
+ } catch {
305
+ return e.style[n];
306
+ }
307
+ }, q = (e, t, n) => {
308
+ if (!(!e || !t))
309
+ if (vt(t))
310
+ Object.entries(t).forEach(
311
+ ([l, r]) => q(e, l, r)
312
+ );
313
+ else {
314
+ const l = gt(t);
315
+ e.style[l] = n;
316
+ }
317
+ }, be = (e, t) => {
318
+ if (bt(e)) {
319
+ const n = e[0] === "#" ? `[id='${e.slice(1)}']` : e;
320
+ return un(n, t);
321
+ }
322
+ return e;
323
+ }, wt = Ee ? (e, t, n, l = !1) => {
324
+ e.addEventListener(t, n, l);
325
+ } : Ct, kt = Ee ? (e, t, n, l = !1) => {
326
+ e.removeEventListener(t, n, l);
327
+ } : Ct, mn = (e, t) => {
328
+ let n = !1;
329
+ const l = {
330
+ overflow: "",
331
+ width: ""
332
+ }, r = (i) => i.tagName === "BODY", o = () => {
333
+ if (e.value) {
334
+ const i = e.value;
335
+ if (!n && i.style.overflow !== "hidden") {
336
+ const d = dn(i);
337
+ if (d > 0 || fn(i)) {
338
+ l.overflow = i.style.overflow, l.width = i.style.width;
339
+ let s = 0;
340
+ r(i) && (s = i.getBoundingClientRect().left || 0), q(i, {
341
+ width: `calc(100% - ${Math.ceil(d - s)}px)`,
342
+ overflow: "hidden"
343
+ }), n = !0;
344
+ }
345
+ }
346
+ }
347
+ }, a = () => {
348
+ if (e.value && n) {
349
+ const i = e.value;
350
+ q(i, {
351
+ overflow: l.overflow,
352
+ width: l.width
353
+ }), n = !1;
354
+ }
355
+ };
356
+ return G(
357
+ () => t == null ? void 0 : t.value,
358
+ (i) => {
359
+ e.value && !r(e.value) && (i && q(i, {
360
+ position: "absolute"
361
+ }), hn(e.value, "position") === "static" && q(e.value, { position: "relative" }));
362
+ }
363
+ ), {
364
+ setOverflowHidden: o,
365
+ resetOverflow: a
366
+ };
367
+ }, vn = {
368
+ ESC: "Escape"
369
+ }, bn = {
370
+ renderTo: {
371
+ type: N([String, Object]),
372
+ default: "body"
373
+ },
374
+ disabled: {
375
+ type: Boolean,
376
+ default: !1
377
+ },
378
+ modelValue: {
379
+ type: Boolean,
380
+ default: !1
381
+ },
382
+ top: {
383
+ type: [String, Number],
384
+ default: "3vh"
385
+ },
386
+ center: {
387
+ type: Boolean,
388
+ default: !1
389
+ },
390
+ width: {
391
+ type: [String, Number],
392
+ default: 0
393
+ },
394
+ height: {
395
+ type: [String, Number],
396
+ default: 0
397
+ },
398
+ minWidth: {
399
+ type: [String, Number],
400
+ default: 0
401
+ },
402
+ minHeight: {
403
+ type: [String, Number],
404
+ default: 0
405
+ },
406
+ title: {
407
+ type: String,
408
+ default: ""
409
+ },
410
+ mask: {
411
+ type: Boolean,
412
+ default: !0
413
+ },
414
+ // 关闭时卸载
415
+ destroyOnClosed: {
416
+ type: Boolean,
417
+ default: !0
418
+ },
419
+ // 关闭前回调检查是否可以关闭
420
+ onBeforeCancel: {
421
+ type: Function
422
+ },
423
+ // 是否点击遮罩层关闭
424
+ maskToClose: {
425
+ type: Boolean,
426
+ default: !0
427
+ },
428
+ // esc键关闭
429
+ escToClose: {
430
+ type: Boolean,
431
+ default: !0
432
+ },
433
+ // 全屏
434
+ fullscreen: {
435
+ type: Boolean,
436
+ default: !1
437
+ },
438
+ // 是否是messageBox
439
+ messageBox: {
440
+ type: Boolean,
441
+ default: !1
442
+ },
443
+ popupClass: {
444
+ type: String,
445
+ default: void 0
446
+ },
447
+ showClose: {
448
+ type: Boolean,
449
+ default: !0
450
+ },
451
+ showHeaderBottomLine: {
452
+ type: Boolean,
453
+ default: !1
454
+ }
455
+ }, yn = ["width", "minWidth", "height", "minHeight"], pt = /* @__PURE__ */ E({
456
+ name: S("Dialog"),
457
+ inheritAttrs: !1,
458
+ props: bn,
459
+ emits: ["closed", "close", "open", "opened", "update:modelValue"],
460
+ setup(e, {
461
+ emit: t,
462
+ slots: n
463
+ }) {
464
+ const l = z("dialog"), r = l.block, o = z("message-box");
465
+ o.block;
466
+ const a = v(() => [r, e.messageBox && "is-message-box", e.popupClass && e.popupClass]), i = v(() => be(e.renderTo)), d = O(), s = v(() => e.disabled || !i.value), m = v(() => ({
467
+ zIndex: y.value
468
+ })), u = v(() => {
469
+ const w = {};
470
+ return e.fullscreen || (!e.center && e.top && (w.top = Re(e.top)), yn.forEach((I) => {
471
+ e[I] && (w[I] = Re(e[I]));
472
+ })), w;
473
+ }), f = O(!1), h = v(() => e.modelValue), g = v(() => h.value || f.value), {
474
+ zIndex: y,
475
+ isLastDialog: T
476
+ } = Ce("dialog", {
477
+ visible: h
478
+ }), {
479
+ setOverflowHidden: $,
480
+ resetOverflow: b
481
+ } = mn(i, d), C = (w, I) => {
482
+ t("update:modelValue", !1), t("close", e.messageBox ? w : void 0, e.messageBox ? I : void 0);
483
+ }, k = () => {
484
+ f.value = !1, b(), t("closed");
485
+ }, _ = () => {
486
+ t("opened");
487
+ }, B = re({
488
+ ok: !1,
489
+ cancel: !1
490
+ }), F = (w, I) => {
491
+ let J = !0;
492
+ if (B[w] = !0, x(e.onBeforeCancel) && (J = e.onBeforeCancel(w) ?? !1), Ne(J)) {
493
+ J.then((Ve) => {
494
+ B[w] = !1, Ve && C(w, I);
495
+ });
496
+ return;
497
+ }
498
+ B[w] = !1, J && C(w, I);
499
+ }, K = () => {
500
+ e.maskToClose && e.mask && F("cancel");
501
+ }, Ie = (w) => {
502
+ F("cancel", w);
503
+ }, je = (w) => {
504
+ F("ok", w);
505
+ };
506
+ let ae = !1;
507
+ const L = (w) => {
508
+ e.escToClose && w.key === vn.ESC && T() && F("cancel");
509
+ }, D = () => {
510
+ e.escToClose && !ae && (ae = !0, wt(document.documentElement, "keydown", L));
511
+ }, ie = () => {
512
+ ae = !1, kt(document.documentElement, "keydown", L);
513
+ };
514
+ return ct(() => {
515
+ b(), ie();
516
+ }), G(() => h.value, (w) => {
517
+ w ? (t("open"), $(), f.value = !0, D()) : ie();
518
+ }, {
519
+ immediate: !0
520
+ }), () => c(jt, {
521
+ to: i.value,
522
+ disabled: s.value
523
+ }, {
524
+ default: () => [g.value && c("div", {
525
+ ref: d,
526
+ class: a.value,
527
+ style: m.value
528
+ }, [c(te, {
529
+ name: "x-fade-in-standard",
530
+ appear: !0
531
+ }, {
532
+ default: () => [e.mask && h.value && c("div", {
533
+ class: l.element("mask")
534
+ }, null)]
535
+ }), c("div", {
536
+ class: [l.element("wrapper"), {
537
+ "is-center": e.center
538
+ }],
539
+ onClick: (w) => w.target === w.currentTarget && K()
540
+ }, [c(te, {
541
+ name: "x-zoom-in",
542
+ appear: !0,
543
+ onAfterEnter: _,
544
+ onAfterLeave: k
545
+ }, {
546
+ default: () => [h.value && c("div", {
547
+ class: [l.element("container"), {
548
+ "is-fullscreen": e.fullscreen
549
+ }],
550
+ style: u.value
551
+ }, [c("div", {
552
+ class: [e.messageBox ? o.element("header") : l.element("header"), e.showHeaderBottomLine && "is-bottom-line"]
553
+ }, [n.title ? n.title() : c("div", {
554
+ class: [l.element("header-title")]
555
+ }, [e.title])]), c("div", {
556
+ class: [e.messageBox ? o.element("body") : l.element("body")]
557
+ }, [n.default && n.default()]), c("div", {
558
+ class: [e.messageBox ? o.element("footer") : l.element("footer")]
559
+ }, [n.footer && n.footer({
560
+ cancel: Ie,
561
+ ok: je,
562
+ "loading-obj": B
563
+ })]), e.showClose && c("span", {
564
+ class: [l.element("close-icon"), e.messageBox && o.element("close-icon")],
565
+ onClick: () => F("cancel")
566
+ }, null)])]
567
+ })])])]
568
+ });
569
+ }
570
+ }), xt = V(S("Dialog"), pt), _e = U("CloseCircleFill", p(c("svg", {
571
+ viewBox: "0 0 48 48",
572
+ fill: "none",
573
+ xmlns: "http://www.w3.org/2000/svg",
574
+ stroke: "currentColor",
575
+ "stroke-width": "4",
576
+ "stroke-linecap": "butt",
577
+ "stroke-linejoin": "miter",
578
+ filter: ""
579
+ }, [c("path", {
580
+ "fill-rule": "evenodd",
581
+ "clip-rule": "evenodd",
582
+ 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",
583
+ fill: "currentColor",
584
+ stroke: "none"
585
+ }, null)]))), ze = U("CheckCircleFill", p(c("svg", {
586
+ viewBox: "0 0 48 48",
587
+ fill: "none",
588
+ xmlns: "http://www.w3.org/2000/svg",
589
+ stroke: "currentColor",
590
+ "stroke-width": "4",
591
+ "stroke-linecap": "butt",
592
+ "stroke-linejoin": "miter",
593
+ filter: ""
594
+ }, [c("path", {
595
+ "fill-rule": "evenodd",
596
+ "clip-rule": "evenodd",
597
+ 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",
598
+ fill: "currentColor",
599
+ stroke: "none"
600
+ }, null)]))), $e = U("ExclamationCircleFill", p(c("svg", {
601
+ viewBox: "0 0 48 48",
602
+ fill: "none",
603
+ xmlns: "http://www.w3.org/2000/svg",
604
+ stroke: "currentColor",
605
+ "stroke-width": "4",
606
+ "stroke-linecap": "butt",
607
+ "stroke-linejoin": "miter",
608
+ filter: ""
609
+ }, [c("path", {
610
+ "fill-rule": "evenodd",
611
+ "clip-rule": "evenodd",
612
+ 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",
613
+ fill: "currentColor",
614
+ stroke: "none"
615
+ }, null)]))), we = U("InfoCircleFill", p(c("svg", {
616
+ viewBox: "0 0 48 48",
617
+ fill: "none",
618
+ xmlns: "http://www.w3.org/2000/svg",
619
+ stroke: "currentColor",
620
+ "stroke-width": "4",
621
+ "stroke-linecap": "butt",
622
+ "stroke-linejoin": "miter",
623
+ filter: ""
624
+ }, [c("path", {
625
+ "fill-rule": "evenodd",
626
+ "clip-rule": "evenodd",
627
+ 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",
628
+ fill: "currentColor",
629
+ stroke: "none"
630
+ }, null)]))), Ae = U("MinusCircleFill", p(c("svg", {
631
+ viewBox: "0 0 48 48",
632
+ fill: "none",
633
+ xmlns: "http://www.w3.org/2000/svg",
634
+ stroke: "currentColor",
635
+ "stroke-width": "4",
636
+ "stroke-linecap": "butt",
637
+ "stroke-linejoin": "miter",
638
+ filter: ""
639
+ }, [c("path", {
640
+ "fill-rule": "evenodd",
641
+ "clip-rule": "evenodd",
642
+ 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",
643
+ fill: "currentColor",
644
+ stroke: "none"
645
+ }, null)])));
646
+ U("LogoSimple", p(c("svg", {
647
+ width: "61.000000",
648
+ height: "41.000000",
649
+ viewBox: "0 0 61 41",
650
+ fill: "none",
651
+ xmlns: "http://www.w3.org/2000/svg",
652
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
653
+ }, [c("desc", null, [P("Created with Pixso.")]), c("defs", null, null), c("path", {
654
+ id: "path",
655
+ d: "M32 29.5L32 41L49.4 41C55.8 41 61 35.85 61 29.5C61 23.14 55.8 18 49.4 18C42.99 18 37.79 23.14 37.79 29.5L32 29.5Z",
656
+ fill: "#00C1FF",
657
+ "fill-opacity": "1.000000",
658
+ "fill-rule": "nonzero"
659
+ }, null), c("path", {
660
+ id: "path",
661
+ d: "M10 20.5C10 27.14 13.15 33.04 18.05 36.79L18.05 41L30.5 41C41.82 41 51 31.82 51 20.5C51 9.17 41.82 0 30.5 0C19.17 0 10 9.17 10 20.5Z",
662
+ fill: "#1C99FF",
663
+ "fill-opacity": "1.000000",
664
+ "fill-rule": "nonzero"
665
+ }, null), c("path", {
666
+ id: "path",
667
+ d: "M32 25C32 25.52 31.97 26.04 31.92 26.56C31.87 27.08 31.79 27.6 31.69 28.12C31.59 28.63 31.46 29.14 31.31 29.64C31.15 30.14 30.98 30.63 30.78 31.12C30.58 31.6 30.35 32.08 30.11 32.54C29.86 33 29.59 33.45 29.3 33.88C29.01 34.32 28.7 34.74 28.36 35.15C28.03 35.55 27.68 35.94 27.31 36.31C26.94 36.68 26.55 37.03 26.15 37.36C25.74 37.7 25.32 38.01 24.88 38.3C24.45 38.59 24 38.86 23.54 39.11C23.08 39.35 22.6 39.58 22.12 39.78C21.63 39.98 21.14 40.15 20.64 40.31C20.14 40.46 19.63 40.59 19.12 40.69C18.6 40.79 18.08 40.87 17.56 40.92C17.04 40.97 16.52 41 16 41C15.47 41 14.95 40.97 14.43 40.92C13.91 40.87 13.39 40.79 12.87 40.69C12.36 40.59 11.85 40.46 11.35 40.31C10.85 40.15 10.36 39.98 9.87 39.78C9.39 39.58 8.91 39.35 8.45 39.11C7.99 38.86 7.54 38.59 7.11 38.3C6.67 38.01 6.25 37.7 5.84 37.36C5.44 37.03 5.05 36.68 4.68 36.31C4.31 35.94 3.96 35.55 3.63 35.15C3.29 34.74 2.98 34.32 2.69 33.88C2.4 33.45 2.13 33 1.88 32.54C1.64 32.08 1.41 31.6 1.21 31.12C1.01 30.63 0.84 30.14 0.68 29.64C0.53 29.14 0.4 28.63 0.3 28.12C0.2 27.6 0.12 27.08 0.07 26.56C0.02 26.04 0 25.52 0 25C0 24.47 0.02 23.95 0.07 23.43C0.12 22.91 0.2 22.39 0.3 21.87C0.4 21.36 0.53 20.85 0.68 20.35C0.84 19.85 1.01 19.36 1.21 18.87C1.41 18.39 1.64 17.91 1.88 17.45C2.13 16.99 2.4 16.54 2.69 16.11C2.98 15.67 3.29 15.25 3.63 14.84C3.96 14.44 4.31 14.05 4.68 13.68C5.05 13.31 5.44 12.96 5.84 12.63C6.25 12.29 6.67 11.98 7.11 11.69C7.54 11.4 7.99 11.13 8.45 10.88C8.91 10.64 9.39 10.41 9.87 10.21C10.36 10.01 10.85 9.84 11.35 9.68C11.85 9.53 12.36 9.4 12.87 9.3C13.39 9.2 13.91 9.12 14.43 9.07C14.95 9.02 15.47 9 16 9C16.52 9 17.04 9.02 17.56 9.07C18.08 9.12 18.6 9.2 19.12 9.3C19.63 9.4 20.14 9.53 20.64 9.68C21.14 9.84 21.63 10.01 22.12 10.21C22.6 10.41 23.08 10.64 23.54 10.88C24 11.13 24.45 11.4 24.88 11.69C25.32 11.98 25.74 12.29 26.15 12.63C26.55 12.96 26.94 13.31 27.31 13.68C27.68 14.05 28.03 14.44 28.36 14.84C28.7 15.25 29.01 15.67 29.3 16.11C29.59 16.54 29.86 16.99 30.11 17.45C30.35 17.91 30.58 18.39 30.78 18.87C30.98 19.36 31.15 19.85 31.31 20.35C31.46 20.85 31.59 21.36 31.69 21.87C31.79 22.39 31.87 22.91 31.92 23.43C31.97 23.95 32 24.47 32 25Z",
668
+ fill: "#1666FF",
669
+ "fill-opacity": "1.000000",
670
+ "fill-rule": "nonzero"
671
+ }, null)])));
672
+ const gn = /* @__PURE__ */ E({
673
+ name: S("Message"),
674
+ props: {
675
+ id: {
676
+ type: String,
677
+ default: ""
678
+ },
679
+ message: {
680
+ type: [String, Number, Object],
681
+ default: ""
682
+ },
683
+ type: {
684
+ type: String,
685
+ default: "success"
686
+ },
687
+ duration: {
688
+ type: Number,
689
+ default: 1500
690
+ },
691
+ center: {
692
+ type: Boolean,
693
+ default: !1
694
+ },
695
+ onClose: {
696
+ type: Function,
697
+ default: () => {
698
+ }
699
+ },
700
+ offset: {
701
+ type: Number,
702
+ default: 20
703
+ },
704
+ zIndex: {
705
+ type: Number,
706
+ default: 0
707
+ },
708
+ showClose: {
709
+ type: Boolean,
710
+ default: !1
711
+ },
712
+ useHTML: {
713
+ type: Boolean,
714
+ default: !1
715
+ },
716
+ popupClass: {
717
+ type: String,
718
+ default: void 0
719
+ }
720
+ },
721
+ emits: ["destroy"],
722
+ setup(e, {
723
+ emit: t,
724
+ slots: n
725
+ }) {
726
+ const l = z("message"), r = O(!1), o = O(null), a = v(() => [l.block, l.modifier(e.type), e.center && l.modifier("center"), e.showClose && !e.center && l.element("show-close"), e.popupClass]), {
727
+ zIndex: i
728
+ } = Ce("message", {
729
+ runOnMounted: !0
730
+ }), d = v(() => ({
731
+ top: `${e.offset}px`,
732
+ zIndex: i.value
733
+ })), s = () => {
734
+ if (n.icon) return n.icon();
735
+ switch (e.type) {
736
+ case "success":
737
+ return c(ze, null, null);
738
+ case "warning":
739
+ return c($e, null, null);
740
+ case "strong":
741
+ return c(Ae, null, null);
742
+ case "error":
743
+ return c(_e, null, null);
744
+ case "info":
745
+ return c(we, null, null);
746
+ default:
747
+ return null;
748
+ }
749
+ }, m = () => {
750
+ e.duration > 0 && (o.value = setTimeout(() => {
751
+ r.value = !1;
752
+ }, e.duration));
753
+ }, u = () => {
754
+ o.value && (clearTimeout(o.value), o.value = null);
755
+ };
756
+ W(() => {
757
+ r.value = !0, m();
758
+ }), oe(() => {
759
+ u();
760
+ });
761
+ const f = () => {
762
+ var h;
763
+ r.value = !1, u(), (h = e.onClose) == null || h.call(e);
764
+ };
765
+ return () => c(te, {
766
+ name: "x-message-slide-top",
767
+ onBeforeLeave: e.onClose,
768
+ onAfterLeave: () => t("destroy")
769
+ }, {
770
+ default: () => [r.value && c("div", {
771
+ class: a.value,
772
+ style: d.value
773
+ }, [c("span", {
774
+ class: [l.element("icon"), l.modifier(`icon-${e.type}`)]
775
+ }, [s()]), c("div", null, [n.default ? n.default() : e.useHTML ? c("span", {
776
+ innerHTML: e.message
777
+ }, null) : c("span", null, [e.message]), e.showClose && c("span", {
778
+ class: l.element("close-icon"),
779
+ onClick: f
780
+ }, null)])])]
781
+ });
782
+ }
783
+ }), Cn = V(S("Message"), gn), wn = /* @__PURE__ */ E({
784
+ name: "Space",
785
+ props: {
786
+ direction: {
787
+ type: String,
788
+ default: "horizontal"
789
+ },
790
+ size: {
791
+ type: [Number, String],
792
+ default: "small"
793
+ },
794
+ align: {
795
+ type: String,
796
+ default: "center"
797
+ },
798
+ fill: {
799
+ type: Boolean,
800
+ default: !1
801
+ }
802
+ },
803
+ setup(e, {
804
+ slots: t
805
+ }) {
806
+ const n = z("space"), l = v(() => [n.block, n.element(e.direction), e.fill && "is-fill", n.element(`${e.direction}-${e.align}`)]);
807
+ function r(a) {
808
+ if (Zt(a))
809
+ return a;
810
+ switch (a) {
811
+ case "mini":
812
+ return 4;
813
+ case "small":
814
+ return 8;
815
+ case "medium":
816
+ return 16;
817
+ case "large":
818
+ return 24;
819
+ default:
820
+ return 8;
821
+ }
822
+ }
823
+ const o = (a) => {
824
+ const i = {};
825
+ if (a) return i;
826
+ const d = `${r(e.size)}px`, s = `${r(e.size)}px`;
827
+ return e.direction === "horizontal" && (i.marginRight = d), e.direction === "vertical" && (i.marginBottom = s), i;
828
+ };
829
+ return () => {
830
+ var i;
831
+ const a = Le((i = t.default) == null ? void 0 : i.call(t), !0).filter((d) => d.type !== Vt);
832
+ return c("div", {
833
+ class: [l.value]
834
+ }, [a.map((d, s) => {
835
+ var u;
836
+ const m = t.split && s > 0;
837
+ return c(Z, {
838
+ key: `space-item-${s}`
839
+ }, [m && c("div", {
840
+ className: n.element("split"),
841
+ style: o(!1)
842
+ }, [(u = t.split) == null ? void 0 : u.call(t)]), c("div", {
843
+ className: n.element("item"),
844
+ style: o(s === a.length - 1)
845
+ }, [d])]);
846
+ })]);
847
+ };
848
+ }
849
+ }), Pe = V(S("Space"), wn), kn = ["info", "success", "warning", "strong", "error"];
850
+ function et(e) {
851
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
852
+ }
853
+ const Xe = z("message-box"), Ge = (e) => {
854
+ const t = document.createElement("div"), n = () => {
855
+ j(null, t);
856
+ }, l = (f) => {
857
+ if (f === "cancel")
858
+ return e.beforeOnCancel ? e.beforeOnCancel() : !0;
859
+ if (f === "ok")
860
+ return e.beforeOnOk ? e.beforeOnOk() : !0;
861
+ }, r = (f, h) => {
862
+ f === "cancel" && e.onCancel && e.onCancel(h), f === "ok" && e.onOk && e.onOk(h);
863
+ }, o = (f) => {
864
+ let h;
865
+ switch (f) {
866
+ case "warning":
867
+ h = c($e, {
868
+ size: "22px",
869
+ color: "#f6c64b"
870
+ }, null);
871
+ break;
872
+ case "strong":
873
+ h = c(Ae, {
874
+ size: "22px",
875
+ color: "#ff7125"
876
+ }, null);
877
+ break;
878
+ case "error":
879
+ h = c(_e, {
880
+ size: "22px",
881
+ color: "#e24f48"
882
+ }, null);
883
+ break;
884
+ case "success":
885
+ h = c(ze, {
886
+ size: "22px",
887
+ color: "#68d1ab"
888
+ }, null);
889
+ break;
890
+ case "info":
891
+ h = c(we, {
892
+ size: "22px",
893
+ color: "#2355f5"
894
+ }, null);
895
+ break;
896
+ }
897
+ return c("div", {
898
+ class: Xe.element("icon")
899
+ }, [h]);
900
+ }, a = (f) => {
901
+ if (M(f)) return f;
902
+ if (x(f)) {
903
+ const h = f();
904
+ return M(h) ? h : null;
905
+ }
906
+ return c("div", {
907
+ class: Xe.element("title")
908
+ }, [P(" "), f, P(" ")]);
909
+ }, i = (f) => {
910
+ if (M(f)) return f;
911
+ if (x(f)) {
912
+ const h = f();
913
+ return M(h) ? h : null;
914
+ }
915
+ return c("div", {
916
+ class: Xe.element("content")
917
+ }, [P(" "), e.content, P(" ")]);
918
+ }, d = () => () => c(Z, null, [o(e.type || "success"), e.title && a(e.title)]), s = () => () => c(Z, null, [e.content && i(e.content)]), m = () => {
919
+ if (M(e.footer) || x(e.footer))
920
+ return e.footer;
921
+ const f = (e == null ? void 0 : e.cancelText) || "取消", h = (e == null ? void 0 : e.okText) || "确认";
922
+ return (g) => c(Pe, {
923
+ size: 12
924
+ }, {
925
+ default: () => {
926
+ var y, T;
927
+ return [!e.hideCancel && c(ne, {
928
+ size: "small",
929
+ onClick: g.cancel,
930
+ loading: (y = g.loadingObj) == null ? void 0 : y.cancel
931
+ }, et(f) ? f : {
932
+ default: () => [f]
933
+ }), !e.hideOk && c(ne, {
934
+ type: "primary",
935
+ size: "small",
936
+ onClick: g.ok,
937
+ loading: (T = g.loadingObj) == null ? void 0 : T.ok
938
+ }, et(h) ? h : {
939
+ default: () => [h]
940
+ })];
941
+ }
942
+ });
943
+ }, u = c(xt, {
944
+ messageBox: !0,
945
+ width: (e == null ? void 0 : e.width) ?? 358,
946
+ height: (e == null ? void 0 : e.height) ?? "auto",
947
+ modelValue: !0,
948
+ renderTo: e == null ? void 0 : e.renderTo,
949
+ center: e != null && e.top ? !1 : (e == null ? void 0 : e.center) ?? !0,
950
+ top: (e == null ? void 0 : e.top) ?? 0,
951
+ mask: (e == null ? void 0 : e.mask) ?? !0,
952
+ maskToClose: (e == null ? void 0 : e.maskToClose) ?? !0,
953
+ popupClass: e.popupClass,
954
+ onClose: r,
955
+ onBeforeCancel: l,
956
+ "onUpdate:modelValue": () => {
957
+ u.component.props.modelValue = !1;
958
+ },
959
+ // 等待动画完全结束后销毁vm
960
+ onClosed: n,
961
+ onOpened: () => {
962
+ }
963
+ }, {
964
+ title: d(),
965
+ default: s(),
966
+ footer: m()
967
+ });
968
+ j(u, t);
969
+ }, pn = () => {
970
+ kn.forEach((e) => {
971
+ Ge[e] = (t, n) => {
972
+ const l = [], r = [];
973
+ let o = () => !0, a = () => !0;
974
+ return setTimeout(() => {
975
+ Ge({
976
+ title: t,
977
+ content: n,
978
+ type: e,
979
+ beforeOnCancel: a,
980
+ beforeOnOk: o,
981
+ onOk: () => {
982
+ l.forEach((i) => x(i) && i());
983
+ },
984
+ onCancel: () => {
985
+ r.forEach((i) => x(i) && i());
986
+ }
987
+ });
988
+ }, 0), {
989
+ ok(...i) {
990
+ return i.length === 1 && l.push(i[0]), i.length === 2 && (o = i[0], l.push(i[1])), this;
991
+ },
992
+ cancel(...i) {
993
+ return i.length === 1 && r.push(i[0]), i.length === 2 && (a = i[0], r.push(i[1])), this;
994
+ }
995
+ };
996
+ };
997
+ });
998
+ };
999
+ pn();
1000
+ const xn = V(S("MessageBox"), Ge), On = {
1001
+ position: {
1002
+ type: String,
1003
+ default: "top-right"
1004
+ },
1005
+ offset: {
1006
+ type: Number,
1007
+ default: 0
1008
+ },
1009
+ title: {
1010
+ type: String,
1011
+ default: ""
1012
+ },
1013
+ type: {
1014
+ type: String,
1015
+ default: "info"
1016
+ },
1017
+ message: {
1018
+ type: String,
1019
+ default: void 0
1020
+ },
1021
+ duration: {
1022
+ type: Number,
1023
+ default: 3e3
1024
+ },
1025
+ showClose: {
1026
+ type: Boolean,
1027
+ default: !0
1028
+ },
1029
+ onClose: {
1030
+ type: Function,
1031
+ default: () => {
1032
+ }
1033
+ },
1034
+ renderToBody: {
1035
+ type: Boolean,
1036
+ default: !1
1037
+ }
1038
+ }, Ot = /* @__PURE__ */ E({
1039
+ name: S("Notification"),
1040
+ props: On,
1041
+ emits: ["close", "destroy"],
1042
+ setup(e, {
1043
+ emit: t,
1044
+ slots: n
1045
+ }) {
1046
+ const l = z("notification"), r = l.block, o = v(() => [r, l.modifier(i.value.ver)]), {
1047
+ zIndex: a
1048
+ } = Ce("message", {
1049
+ runOnMounted: !0
1050
+ }), i = v(() => {
1051
+ const y = e.position.split("-");
1052
+ return {
1053
+ hor: y[1],
1054
+ ver: y[0]
1055
+ };
1056
+ }), d = v(() => `x-notification-slide-${i.value.hor}`), s = v(() => {
1057
+ const y = {};
1058
+ return y.position = e.renderToBody ? "fixed" : "absolute", y.zIndex = a.value, y[i.value.hor] = "20px", y[i.value.ver] = `${e.offset}px`, y;
1059
+ }), m = O(!1);
1060
+ let u = 0;
1061
+ const f = () => {
1062
+ u = setTimeout(() => {
1063
+ m.value = !1;
1064
+ }, e.duration);
1065
+ }, h = v(() => e.type === "info" ? we : e.type === "warning" ? $e : e.type === "strong" ? Ae : e.type === "success" ? ze : e.type === "error" ? _e : ""), g = () => {
1066
+ m.value = !1;
1067
+ };
1068
+ return W(() => {
1069
+ e.duration !== 0 && f(), m.value = !0;
1070
+ }), oe(() => {
1071
+ clearTimeout(u);
1072
+ }), () => c(te, {
1073
+ name: d.value,
1074
+ onBeforeLeave: () => t("close"),
1075
+ onAfterLeave: () => t("destroy")
1076
+ }, {
1077
+ default: () => {
1078
+ var y;
1079
+ return [m.value && c("div", {
1080
+ class: o.value,
1081
+ style: s.value
1082
+ }, [c("div", {
1083
+ class: [l.element("header")]
1084
+ }, [c("div", {
1085
+ class: [l.element("icon"), l.modifier(`icon-${e.type}`)]
1086
+ }, [h.value && c(h.value, null, null)]), c("div", null, [c("div", {
1087
+ class: [l.element("title")]
1088
+ }, [e.title]), c("div", {
1089
+ class: [l.element("message")]
1090
+ }, [((y = n.default) == null ? void 0 : y.call(n)) || e.message])])]), e.showClose && c("span", {
1091
+ class: [l.element("close-icon")],
1092
+ onClick: g
1093
+ }, null)])];
1094
+ }
1095
+ });
1096
+ }
1097
+ }), Ln = V(S("Notification"), Ot), Sn = () => {
1098
+ const { body: e } = document, t = document.documentElement;
1099
+ let n;
1100
+ try {
1101
+ n = (window.top || window.self || window).document.body;
1102
+ } catch {
1103
+ }
1104
+ return {
1105
+ height: Math.max(
1106
+ e.scrollHeight,
1107
+ e.offsetHeight,
1108
+ t.clientHeight,
1109
+ t.scrollHeight,
1110
+ t.offsetHeight,
1111
+ (n == null ? void 0 : n.scrollHeight) || 0,
1112
+ (n == null ? void 0 : n.clientHeight) || 0
1113
+ ),
1114
+ width: Math.max(
1115
+ e.scrollWidth,
1116
+ e.offsetWidth,
1117
+ t.clientWidth,
1118
+ t.scrollWidth,
1119
+ t.offsetWidth,
1120
+ (n == null ? void 0 : n.scrollWidth) || 0,
1121
+ (n == null ? void 0 : n.clientWidth) || 0
1122
+ )
1123
+ };
1124
+ }, Tn = () => {
1125
+ const { height: e, width: t } = Sn();
1126
+ return {
1127
+ width: Math.min(t, window.innerWidth),
1128
+ height: Math.min(e, window.innerHeight)
1129
+ };
1130
+ }, tt = (e, t) => {
1131
+ const n = e.getBoundingClientRect();
1132
+ return {
1133
+ top: n.top,
1134
+ bottom: n.bottom,
1135
+ left: n.left,
1136
+ right: n.right,
1137
+ scrollTop: n.top - t.top,
1138
+ scrollBottom: n.bottom - t.top,
1139
+ scrollLeft: n.left - t.left,
1140
+ scrollRight: n.right - t.left,
1141
+ width: e.offsetWidth ?? e.clientWidth,
1142
+ height: e.offsetHeight ?? e.clientHeight
1143
+ };
1144
+ }, Nn = (e) => {
1145
+ switch (e) {
1146
+ case "top":
1147
+ case "tl":
1148
+ case "tr":
1149
+ return "top";
1150
+ case "bottom":
1151
+ case "bl":
1152
+ case "br":
1153
+ return "bottom";
1154
+ case "left":
1155
+ case "lt":
1156
+ case "lb":
1157
+ return "left";
1158
+ case "right":
1159
+ case "rt":
1160
+ case "rb":
1161
+ return "right";
1162
+ default:
1163
+ return "top";
1164
+ }
1165
+ }, pe = (e, t) => {
1166
+ switch (t) {
1167
+ case "top":
1168
+ switch (e) {
1169
+ case "bottom":
1170
+ return "top";
1171
+ case "bl":
1172
+ return "tl";
1173
+ case "br":
1174
+ return "tr";
1175
+ default:
1176
+ return e;
1177
+ }
1178
+ case "bottom":
1179
+ switch (e) {
1180
+ case "top":
1181
+ return "bottom";
1182
+ case "tl":
1183
+ return "bl";
1184
+ case "tr":
1185
+ return "br";
1186
+ default:
1187
+ return e;
1188
+ }
1189
+ case "left":
1190
+ switch (e) {
1191
+ case "right":
1192
+ return "left";
1193
+ case "rt":
1194
+ return "lt";
1195
+ case "rb":
1196
+ return "lb";
1197
+ default:
1198
+ return e;
1199
+ }
1200
+ case "right":
1201
+ switch (e) {
1202
+ case "left":
1203
+ return "right";
1204
+ case "lt":
1205
+ return "rt";
1206
+ case "lb":
1207
+ return "rb";
1208
+ default:
1209
+ return e;
1210
+ }
1211
+ default:
1212
+ return e;
1213
+ }
1214
+ }, Bn = (e, t, {
1215
+ containerRect: n,
1216
+ triggerRect: l,
1217
+ popupRect: r,
1218
+ offset: o,
1219
+ translate: a
1220
+ }) => {
1221
+ const i = Nn(e), d = Tn(), s = {
1222
+ top: n.top + t.top,
1223
+ // prettier-ignore
1224
+ bottom: d.height - (n.top + t.top + r.height),
1225
+ left: n.left + t.left,
1226
+ // prettier-ignore
1227
+ right: d.width - (n.left + t.left + r.width)
1228
+ };
1229
+ let m = e;
1230
+ if (i === "top" && s.top < 0)
1231
+ if (l.top > r.height)
1232
+ t.top = -n.top;
1233
+ else {
1234
+ const u = ve("bottom", l, r, {
1235
+ offset: o,
1236
+ translate: a
1237
+ });
1238
+ d.height - (n.top + u.top + r.height) > 0 && (m = pe(e, "bottom"), t.top = u.top);
1239
+ }
1240
+ if (i === "bottom" && s.bottom < 0)
1241
+ if (d.height - l.bottom > r.height)
1242
+ t.top = -n.top + (d.height - r.height);
1243
+ else {
1244
+ const u = ve("top", l, r, {
1245
+ offset: o,
1246
+ translate: a
1247
+ });
1248
+ n.top + u.top > 0 && (m = pe(e, "top"), t.top = u.top);
1249
+ }
1250
+ if (i === "left" && s.left < 0)
1251
+ if (l.left > r.width)
1252
+ t.left = -n.left;
1253
+ else {
1254
+ const u = ve("right", l, r, {
1255
+ offset: o,
1256
+ translate: a
1257
+ });
1258
+ d.width - (n.left + u.left + r.width) > 0 && (m = pe(e, "right"), t.left = u.left);
1259
+ }
1260
+ if (i === "right" && s.right < 0)
1261
+ if (d.width - l.right > r.width)
1262
+ t.left = -n.left + (d.width - r.width);
1263
+ else {
1264
+ const u = ve("left", l, r, {
1265
+ offset: o,
1266
+ translate: a
1267
+ });
1268
+ n.left + u.left > 0 && (m = pe(e, "left"), t.left = u.left);
1269
+ }
1270
+ return (i === "top" || i === "bottom") && (s.left < 0 ? t.left = -n.left : s.right < 0 && (t.left = -n.left + (d.width - r.width))), (i === "left" || i === "right") && (s.top < 0 ? t.top = -n.top : s.bottom < 0 && (t.top = -n.top + (d.height - r.height))), {
1271
+ popupPosition: t,
1272
+ position: m
1273
+ };
1274
+ }, ve = (e, t, n, {
1275
+ offset: l = 0,
1276
+ translate: r = [0, 0]
1277
+ } = {}) => {
1278
+ const o = (ge(r) ? r : r[e]) ?? [0, 0];
1279
+ switch (e) {
1280
+ case "top":
1281
+ return {
1282
+ left: t.scrollLeft + Math.round(t.width / 2) - Math.round(n.width / 2) + o[0],
1283
+ top: t.scrollTop - n.height - l + o[1]
1284
+ };
1285
+ case "tl":
1286
+ return {
1287
+ left: t.scrollLeft + o[0],
1288
+ top: t.scrollTop - n.height - l + o[1]
1289
+ };
1290
+ case "tr":
1291
+ return {
1292
+ left: t.scrollRight - n.width + o[0],
1293
+ top: t.scrollTop - n.height - l + o[1]
1294
+ };
1295
+ case "bottom":
1296
+ return {
1297
+ left: t.scrollLeft + Math.round(t.width / 2) - Math.round(n.width / 2) + o[0],
1298
+ top: t.scrollBottom + l + o[1]
1299
+ };
1300
+ case "bl":
1301
+ return {
1302
+ left: t.scrollLeft + o[0],
1303
+ top: t.scrollBottom + l + o[1]
1304
+ };
1305
+ case "br":
1306
+ return {
1307
+ left: t.scrollRight - n.width + o[0],
1308
+ top: t.scrollBottom + l + o[1]
1309
+ };
1310
+ case "left":
1311
+ return {
1312
+ left: t.scrollLeft - n.width - l + o[0],
1313
+ top: t.scrollTop + Math.round(t.height / 2) - Math.round(n.height / 2) + o[1]
1314
+ };
1315
+ case "lt":
1316
+ return {
1317
+ left: t.scrollLeft - n.width - l + o[0],
1318
+ top: t.scrollTop + o[1]
1319
+ };
1320
+ case "lb":
1321
+ return {
1322
+ left: t.scrollLeft - n.width - l + o[0],
1323
+ top: t.scrollBottom - n.height + o[1]
1324
+ };
1325
+ case "right":
1326
+ return {
1327
+ left: t.scrollRight + l + o[0],
1328
+ top: t.scrollTop + Math.round(t.height / 2) - Math.round(n.height / 2) + o[1]
1329
+ };
1330
+ case "rt":
1331
+ return {
1332
+ left: t.scrollRight + l + o[0],
1333
+ top: t.scrollTop + o[1]
1334
+ };
1335
+ case "rb":
1336
+ return {
1337
+ left: t.scrollRight + l + o[0],
1338
+ top: t.scrollBottom - n.height + o[1]
1339
+ };
1340
+ default:
1341
+ return {
1342
+ left: 0,
1343
+ top: 0
1344
+ };
1345
+ }
1346
+ }, Mn = (e, t, n, l, {
1347
+ offset: r = 0,
1348
+ translate: o = [0, 0],
1349
+ customStyle: a = {},
1350
+ autoFitPosition: i = !1
1351
+ } = {}) => {
1352
+ let d = e, s = ve(e, n, l, {
1353
+ offset: r,
1354
+ translate: o
1355
+ });
1356
+ if (i) {
1357
+ const u = Bn(e, s, {
1358
+ containerRect: t,
1359
+ popupRect: l,
1360
+ triggerRect: n,
1361
+ offset: r,
1362
+ translate: o
1363
+ });
1364
+ s = u.popupPosition, d = u.position;
1365
+ }
1366
+ return {
1367
+ style: {
1368
+ left: `${s.left}px`,
1369
+ top: `${s.top}px`,
1370
+ ...a
1371
+ },
1372
+ position: d
1373
+ };
1374
+ }, En = (e, t, n, {
1375
+ customStyle: l = {}
1376
+ }) => {
1377
+ if (["top", "tl", "tr", "bottom", "bl", "br"].includes(e)) {
1378
+ let o = Math.abs(
1379
+ t.scrollLeft + t.width / 2 - n.scrollLeft
1380
+ );
1381
+ return o > n.width - 8 && (t.width > n.width ? o = n.width / 2 : o = n.width - 8), ["top", "tl", "tr"].includes(e) ? {
1382
+ left: `${o}px`,
1383
+ bottom: "0",
1384
+ transform: "translate(-50%,100%)",
1385
+ "border-color": "var(--bn-trigger-arrow-background-color) transparent transparent transparent",
1386
+ ...l
1387
+ } : {
1388
+ left: `${o}px`,
1389
+ top: "0",
1390
+ transform: "translate(-50%,-100%)",
1391
+ "border-color": "transparent transparent var(--bn-trigger-arrow-background-color) transparent",
1392
+ ...l
1393
+ };
1394
+ }
1395
+ let r = Math.abs(t.scrollTop + t.height / 2 - n.scrollTop);
1396
+ return r > n.height - 8 && (t.height > n.height ? r = n.height / 2 : r = n.height - 8), ["left", "lt", "lb"].includes(e) ? {
1397
+ top: `${r}px`,
1398
+ right: "0",
1399
+ transform: "translate(100%,-50%)",
1400
+ "border-color": "transparent transparent transparent var(--bn-trigger-arrow-background-color)",
1401
+ ...l
1402
+ } : {
1403
+ top: `${r}px`,
1404
+ left: "0",
1405
+ transform: "translate(-100%,-50%)",
1406
+ "border-color": "transparent var(--bn-trigger-arrow-background-color) transparent transparent",
1407
+ ...l
1408
+ };
1409
+ };
1410
+ var Lt = function() {
1411
+ if (typeof Map < "u")
1412
+ return Map;
1413
+ function e(t, n) {
1414
+ var l = -1;
1415
+ return t.some(function(r, o) {
1416
+ return r[0] === n ? (l = o, !0) : !1;
1417
+ }), l;
1418
+ }
1419
+ return (
1420
+ /** @class */
1421
+ function() {
1422
+ function t() {
1423
+ this.__entries__ = [];
1424
+ }
1425
+ return Object.defineProperty(t.prototype, "size", {
1426
+ /**
1427
+ * @returns {boolean}
1428
+ */
1429
+ get: function() {
1430
+ return this.__entries__.length;
1431
+ },
1432
+ enumerable: !0,
1433
+ configurable: !0
1434
+ }), t.prototype.get = function(n) {
1435
+ var l = e(this.__entries__, n), r = this.__entries__[l];
1436
+ return r && r[1];
1437
+ }, t.prototype.set = function(n, l) {
1438
+ var r = e(this.__entries__, n);
1439
+ ~r ? this.__entries__[r][1] = l : this.__entries__.push([n, l]);
1440
+ }, t.prototype.delete = function(n) {
1441
+ var l = this.__entries__, r = e(l, n);
1442
+ ~r && l.splice(r, 1);
1443
+ }, t.prototype.has = function(n) {
1444
+ return !!~e(this.__entries__, n);
1445
+ }, t.prototype.clear = function() {
1446
+ this.__entries__.splice(0);
1447
+ }, t.prototype.forEach = function(n, l) {
1448
+ l === void 0 && (l = null);
1449
+ for (var r = 0, o = this.__entries__; r < o.length; r++) {
1450
+ var a = o[r];
1451
+ n.call(l, a[1], a[0]);
1452
+ }
1453
+ }, t;
1454
+ }()
1455
+ );
1456
+ }(), Ze = typeof window < "u" && typeof document < "u" && window.document === document, Be = function() {
1457
+ return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
1458
+ }(), _n = function() {
1459
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(Be) : function(e) {
1460
+ return setTimeout(function() {
1461
+ return e(Date.now());
1462
+ }, 1e3 / 60);
1463
+ };
1464
+ }(), zn = 2;
1465
+ function $n(e, t) {
1466
+ var n = !1, l = !1, r = 0;
1467
+ function o() {
1468
+ n && (n = !1, e()), l && i();
1469
+ }
1470
+ function a() {
1471
+ _n(o);
1472
+ }
1473
+ function i() {
1474
+ var d = Date.now();
1475
+ if (n) {
1476
+ if (d - r < zn)
1477
+ return;
1478
+ l = !0;
1479
+ } else
1480
+ n = !0, l = !1, setTimeout(a, t);
1481
+ r = d;
1482
+ }
1483
+ return i;
1484
+ }
1485
+ var An = 20, Pn = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], Fn = typeof MutationObserver < "u", In = (
1486
+ /** @class */
1487
+ function() {
1488
+ function e() {
1489
+ this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = $n(this.refresh.bind(this), An);
1490
+ }
1491
+ return e.prototype.addObserver = function(t) {
1492
+ ~this.observers_.indexOf(t) || this.observers_.push(t), this.connected_ || this.connect_();
1493
+ }, e.prototype.removeObserver = function(t) {
1494
+ var n = this.observers_, l = n.indexOf(t);
1495
+ ~l && n.splice(l, 1), !n.length && this.connected_ && this.disconnect_();
1496
+ }, e.prototype.refresh = function() {
1497
+ var t = this.updateObservers_();
1498
+ t && this.refresh();
1499
+ }, e.prototype.updateObservers_ = function() {
1500
+ var t = this.observers_.filter(function(n) {
1501
+ return n.gatherActive(), n.hasActive();
1502
+ });
1503
+ return t.forEach(function(n) {
1504
+ return n.broadcastActive();
1505
+ }), t.length > 0;
1506
+ }, e.prototype.connect_ = function() {
1507
+ !Ze || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), Fn ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
1508
+ attributes: !0,
1509
+ childList: !0,
1510
+ characterData: !0,
1511
+ subtree: !0
1512
+ })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
1513
+ }, e.prototype.disconnect_ = function() {
1514
+ !Ze || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
1515
+ }, e.prototype.onTransitionEnd_ = function(t) {
1516
+ var n = t.propertyName, l = n === void 0 ? "" : n, r = Pn.some(function(o) {
1517
+ return !!~l.indexOf(o);
1518
+ });
1519
+ r && this.refresh();
1520
+ }, e.getInstance = function() {
1521
+ return this.instance_ || (this.instance_ = new e()), this.instance_;
1522
+ }, e.instance_ = null, e;
1523
+ }()
1524
+ ), St = function(e, t) {
1525
+ for (var n = 0, l = Object.keys(t); n < l.length; n++) {
1526
+ var r = l[n];
1527
+ Object.defineProperty(e, r, {
1528
+ value: t[r],
1529
+ enumerable: !1,
1530
+ writable: !1,
1531
+ configurable: !0
1532
+ });
1533
+ }
1534
+ return e;
1535
+ }, le = function(e) {
1536
+ var t = e && e.ownerDocument && e.ownerDocument.defaultView;
1537
+ return t || Be;
1538
+ }, Tt = Fe(0, 0, 0, 0);
1539
+ function Me(e) {
1540
+ return parseFloat(e) || 0;
1541
+ }
1542
+ function nt(e) {
1543
+ for (var t = [], n = 1; n < arguments.length; n++)
1544
+ t[n - 1] = arguments[n];
1545
+ return t.reduce(function(l, r) {
1546
+ var o = e["border-" + r + "-width"];
1547
+ return l + Me(o);
1548
+ }, 0);
1549
+ }
1550
+ function jn(e) {
1551
+ for (var t = ["top", "right", "bottom", "left"], n = {}, l = 0, r = t; l < r.length; l++) {
1552
+ var o = r[l], a = e["padding-" + o];
1553
+ n[o] = Me(a);
1554
+ }
1555
+ return n;
1556
+ }
1557
+ function Vn(e) {
1558
+ var t = e.getBBox();
1559
+ return Fe(0, 0, t.width, t.height);
1560
+ }
1561
+ function Dn(e) {
1562
+ var t = e.clientWidth, n = e.clientHeight;
1563
+ if (!t && !n)
1564
+ return Tt;
1565
+ var l = le(e).getComputedStyle(e), r = jn(l), o = r.left + r.right, a = r.top + r.bottom, i = Me(l.width), d = Me(l.height);
1566
+ if (l.boxSizing === "border-box" && (Math.round(i + o) !== t && (i -= nt(l, "left", "right") + o), Math.round(d + a) !== n && (d -= nt(l, "top", "bottom") + a)), !Xn(e)) {
1567
+ var s = Math.round(i + o) - t, m = Math.round(d + a) - n;
1568
+ Math.abs(s) !== 1 && (i -= s), Math.abs(m) !== 1 && (d -= m);
1569
+ }
1570
+ return Fe(r.left, r.top, i, d);
1571
+ }
1572
+ var Hn = /* @__PURE__ */ function() {
1573
+ return typeof SVGGraphicsElement < "u" ? function(e) {
1574
+ return e instanceof le(e).SVGGraphicsElement;
1575
+ } : function(e) {
1576
+ return e instanceof le(e).SVGElement && typeof e.getBBox == "function";
1577
+ };
1578
+ }();
1579
+ function Xn(e) {
1580
+ return e === le(e).document.documentElement;
1581
+ }
1582
+ function Wn(e) {
1583
+ return Ze ? Hn(e) ? Vn(e) : Dn(e) : Tt;
1584
+ }
1585
+ function Yn(e) {
1586
+ var t = e.x, n = e.y, l = e.width, r = e.height, o = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, a = Object.create(o.prototype);
1587
+ return St(a, {
1588
+ x: t,
1589
+ y: n,
1590
+ width: l,
1591
+ height: r,
1592
+ top: n,
1593
+ right: t + l,
1594
+ bottom: r + n,
1595
+ left: t
1596
+ }), a;
1597
+ }
1598
+ function Fe(e, t, n, l) {
1599
+ return { x: e, y: t, width: n, height: l };
1600
+ }
1601
+ var qn = (
1602
+ /** @class */
1603
+ function() {
1604
+ function e(t) {
1605
+ this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = Fe(0, 0, 0, 0), this.target = t;
1606
+ }
1607
+ return e.prototype.isActive = function() {
1608
+ var t = Wn(this.target);
1609
+ return this.contentRect_ = t, t.width !== this.broadcastWidth || t.height !== this.broadcastHeight;
1610
+ }, e.prototype.broadcastRect = function() {
1611
+ var t = this.contentRect_;
1612
+ return this.broadcastWidth = t.width, this.broadcastHeight = t.height, t;
1613
+ }, e;
1614
+ }()
1615
+ ), Gn = (
1616
+ /** @class */
1617
+ /* @__PURE__ */ function() {
1618
+ function e(t, n) {
1619
+ var l = Yn(n);
1620
+ St(this, { target: t, contentRect: l });
1621
+ }
1622
+ return e;
1623
+ }()
1624
+ ), Zn = (
1625
+ /** @class */
1626
+ function() {
1627
+ function e(t, n, l) {
1628
+ if (this.activeObservations_ = [], this.observations_ = new Lt(), typeof t != "function")
1629
+ throw new TypeError("The callback provided as parameter 1 is not a function.");
1630
+ this.callback_ = t, this.controller_ = n, this.callbackCtx_ = l;
1631
+ }
1632
+ return e.prototype.observe = function(t) {
1633
+ if (!arguments.length)
1634
+ throw new TypeError("1 argument required, but only 0 present.");
1635
+ if (!(typeof Element > "u" || !(Element instanceof Object))) {
1636
+ if (!(t instanceof le(t).Element))
1637
+ throw new TypeError('parameter 1 is not of type "Element".');
1638
+ var n = this.observations_;
1639
+ n.has(t) || (n.set(t, new qn(t)), this.controller_.addObserver(this), this.controller_.refresh());
1640
+ }
1641
+ }, e.prototype.unobserve = function(t) {
1642
+ if (!arguments.length)
1643
+ throw new TypeError("1 argument required, but only 0 present.");
1644
+ if (!(typeof Element > "u" || !(Element instanceof Object))) {
1645
+ if (!(t instanceof le(t).Element))
1646
+ throw new TypeError('parameter 1 is not of type "Element".');
1647
+ var n = this.observations_;
1648
+ n.has(t) && (n.delete(t), n.size || this.controller_.removeObserver(this));
1649
+ }
1650
+ }, e.prototype.disconnect = function() {
1651
+ this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
1652
+ }, e.prototype.gatherActive = function() {
1653
+ var t = this;
1654
+ this.clearActive(), this.observations_.forEach(function(n) {
1655
+ n.isActive() && t.activeObservations_.push(n);
1656
+ });
1657
+ }, e.prototype.broadcastActive = function() {
1658
+ if (this.hasActive()) {
1659
+ var t = this.callbackCtx_, n = this.activeObservations_.map(function(l) {
1660
+ return new Gn(l.target, l.broadcastRect());
1661
+ });
1662
+ this.callback_.call(t, n, t), this.clearActive();
1663
+ }
1664
+ }, e.prototype.clearActive = function() {
1665
+ this.activeObservations_.splice(0);
1666
+ }, e.prototype.hasActive = function() {
1667
+ return this.activeObservations_.length > 0;
1668
+ }, e;
1669
+ }()
1670
+ ), Nt = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new Lt(), Bt = (
1671
+ /** @class */
1672
+ /* @__PURE__ */ function() {
1673
+ function e(t) {
1674
+ if (!(this instanceof e))
1675
+ throw new TypeError("Cannot call a class as a function.");
1676
+ if (!arguments.length)
1677
+ throw new TypeError("1 argument required, but only 0 present.");
1678
+ var n = In.getInstance(), l = new Zn(t, n, this);
1679
+ Nt.set(this, l);
1680
+ }
1681
+ return e;
1682
+ }()
1683
+ );
1684
+ [
1685
+ "observe",
1686
+ "unobserve",
1687
+ "disconnect"
1688
+ ].forEach(function(e) {
1689
+ Bt.prototype[e] = function() {
1690
+ var t;
1691
+ return (t = Nt.get(this))[e].apply(t, arguments);
1692
+ };
1693
+ });
1694
+ var Un = function() {
1695
+ return typeof Be.ResizeObserver < "u" ? Be.ResizeObserver : Bt;
1696
+ }();
1697
+ const Kn = ({
1698
+ elementRef: e,
1699
+ onResize: t
1700
+ }) => {
1701
+ let n;
1702
+ return {
1703
+ createResizeObserver: () => {
1704
+ e.value && (n = new Un((o) => {
1705
+ const a = o[0];
1706
+ x(t) && t(a);
1707
+ }), n.observe(e.value));
1708
+ },
1709
+ destroyResizeObserver: () => {
1710
+ n && (n.disconnect(), n = null);
1711
+ }
1712
+ };
1713
+ }, Jn = ["px", "%", "vh", "vw", "calc"], Qn = (e, t = "px") => {
1714
+ if (e === void 0) return "";
1715
+ const n = String(e);
1716
+ return Jn.some((l) => n.includes(l)) ? n : n + t;
1717
+ }, Rn = E({
1718
+ name: "PopconfirmPopup",
1719
+ components: {
1720
+ Space: Pe,
1721
+ Button: ne,
1722
+ InfoCircleFill: we
1723
+ },
1724
+ props: {
1725
+ width: {
1726
+ type: [String, Number],
1727
+ default: ""
1728
+ },
1729
+ content: {
1730
+ type: Object,
1731
+ default: () => ({})
1732
+ },
1733
+ okText: {
1734
+ type: String,
1735
+ default: "String"
1736
+ },
1737
+ cancelText: {
1738
+ type: String,
1739
+ default: ""
1740
+ },
1741
+ popupClass: {
1742
+ type: String,
1743
+ default: void 0
1744
+ },
1745
+ onBeforeCancel: {
1746
+ type: Function,
1747
+ default: void 0
1748
+ },
1749
+ onBeforeOk: {
1750
+ type: Function,
1751
+ default: void 0
1752
+ },
1753
+ type: {
1754
+ type: String,
1755
+ default: void 0
1756
+ }
1757
+ },
1758
+ emits: ["ok", "cancel", "close", "destroy"],
1759
+ setup(e, { emit: t }) {
1760
+ const n = z("popconfirm"), l = O(!0), r = v(() => [
1761
+ n.block,
1762
+ e.popupClass && e.popupClass,
1763
+ e.type && n.modifier(e.type)
1764
+ ]), o = v(() => {
1765
+ const f = {};
1766
+ return f["--bn-trigger-arrow-background-color"] = "#fff", f.width = Qn(e.width), f;
1767
+ }), a = re({
1768
+ ok: !1,
1769
+ cancel: !1
1770
+ }), i = (f) => {
1771
+ l.value = f;
1772
+ }, d = (f) => {
1773
+ const h = e.onBeforeOk;
1774
+ let g = !0;
1775
+ if (x(h) && (g = h(), Ne(g))) {
1776
+ a.ok = !0, g.then((y) => {
1777
+ a.ok = !1, y && t("ok", f);
1778
+ });
1779
+ return;
1780
+ }
1781
+ g && t("ok", f);
1782
+ }, s = (f) => {
1783
+ const h = e.onBeforeCancel;
1784
+ let g = !0;
1785
+ if (x(h) && (g = h(), Ne(g))) {
1786
+ a.cancel = !0, g.then((y) => {
1787
+ a.cancel = !1, y && t("cancel", f);
1788
+ });
1789
+ return;
1790
+ }
1791
+ g && t("cancel", f);
1792
+ }, m = () => {
1793
+ t("close");
1794
+ }, u = () => {
1795
+ t("destroy");
1796
+ };
1797
+ return oe(() => {
1798
+ l.value = !1;
1799
+ }), {
1800
+ ns: n.block,
1801
+ visible: l,
1802
+ popupCls: r,
1803
+ popupStyle: o,
1804
+ loadingObj: a,
1805
+ changeVisible: i,
1806
+ handleOk: d,
1807
+ handleCancel: s,
1808
+ beforeLeave: m,
1809
+ afterLeave: u
1810
+ };
1811
+ }
1812
+ }), Mt = (e, t) => {
1813
+ const n = e.__vccOpts || e;
1814
+ for (const [l, r] of t)
1815
+ n[l] = r;
1816
+ return n;
1817
+ };
1818
+ function el(e, t, n, l, r, o) {
1819
+ const a = H("InfoCircleFill"), i = H("Button"), d = H("Space");
1820
+ return A(), Y(te, {
1821
+ name: "x-fade-in-standard",
1822
+ appear: "",
1823
+ onBeforeLeave: e.beforeLeave,
1824
+ onAfterLeave: e.afterLeave
1825
+ }, {
1826
+ default: me(() => [
1827
+ ut(ee("div", {
1828
+ class: X(e.popupCls),
1829
+ style: dt(e.popupStyle)
1830
+ }, [
1831
+ ee("div", {
1832
+ class: X([`${e.ns}--content`])
1833
+ }, [
1834
+ qe(e.$slots, "content", {}, () => {
1835
+ var s;
1836
+ return [
1837
+ c(a, {
1838
+ class: X([`${e.ns}--icon`]),
1839
+ size: 16
1840
+ }, null, 8, ["class"]),
1841
+ ee("div", {
1842
+ class: X([`${e.ns}--title`])
1843
+ }, Oe((s = e.content) == null ? void 0 : s.value), 3)
1844
+ ];
1845
+ })
1846
+ ], 2),
1847
+ ee("div", {
1848
+ class: X([`${e.ns}--footer`])
1849
+ }, [
1850
+ c(d, { size: 12 }, {
1851
+ default: me(() => [
1852
+ c(i, {
1853
+ size: "mini",
1854
+ loading: e.loadingObj.cancel,
1855
+ onClick: e.handleCancel
1856
+ }, {
1857
+ default: me(() => [
1858
+ P(Oe(e.cancelText), 1)
1859
+ ]),
1860
+ _: 1
1861
+ }, 8, ["loading", "onClick"]),
1862
+ c(i, {
1863
+ size: "mini",
1864
+ type: "primary",
1865
+ loading: e.loadingObj.ok,
1866
+ onClick: e.handleOk
1867
+ }, {
1868
+ default: me(() => [
1869
+ P(Oe(e.okText), 1)
1870
+ ]),
1871
+ _: 1
1872
+ }, 8, ["loading", "onClick"])
1873
+ ]),
1874
+ _: 1
1875
+ })
1876
+ ], 2),
1877
+ t[0] || (t[0] = ee("div", { class: "arrow" }, null, -1))
1878
+ ], 6), [
1879
+ [ft, e.visible]
1880
+ ])
1881
+ ]),
1882
+ _: 3
1883
+ }, 8, ["onBeforeLeave", "onAfterLeave"]);
1884
+ }
1885
+ const tl = /* @__PURE__ */ Mt(Rn, [["render", el]]), nl = {
1886
+ modelValue: {
1887
+ type: Boolean,
1888
+ default: void 0
1889
+ },
1890
+ disabled: {
1891
+ type: Boolean,
1892
+ default: !1
1893
+ },
1894
+ width: {
1895
+ type: [String, Number],
1896
+ default: 150
1897
+ },
1898
+ type: {
1899
+ type: String,
1900
+ default: "danger"
1901
+ },
1902
+ content: [String, Number],
1903
+ position: {
1904
+ type: String,
1905
+ default: "top"
1906
+ },
1907
+ okText: {
1908
+ type: String,
1909
+ default: "确认"
1910
+ },
1911
+ cancelText: {
1912
+ type: String,
1913
+ default: "取消"
1914
+ },
1915
+ // 点击ok前拦截
1916
+ onBeforeOk: {
1917
+ type: Function,
1918
+ default: void 0
1919
+ },
1920
+ // 点击cancel前拦截
1921
+ onBeforeCancel: {
1922
+ type: Function,
1923
+ default: void 0
1924
+ },
1925
+ renderTo: {
1926
+ type: [String, Object]
1927
+ },
1928
+ popupClass: String
1929
+ }, ll = /* @__PURE__ */ E({
1930
+ name: "Popconfirm",
1931
+ props: nl,
1932
+ emits: ["ok", "cancel", "change", "update:modelValue"],
1933
+ setup(e, {
1934
+ slots: t,
1935
+ emit: n
1936
+ }) {
1937
+ const l = be(e.renderTo || document.body);
1938
+ let r, o, a;
1939
+ const i = document.createElement("div"), d = O(!1), s = v(() => e.modelValue ?? d.value), m = (L) => {
1940
+ var D;
1941
+ o && ((D = o.component) == null ? void 0 : D.proxy).changeVisible(L);
1942
+ }, u = () => {
1943
+ }, f = () => {
1944
+ i && (j(null, i), a = null, o = null, d.value = !1, n("update:modelValue", !1), n("change", !1), $());
1945
+ }, h = (L) => {
1946
+ m(!1), n("cancel", L);
1947
+ }, g = (L) => {
1948
+ m(!1), n("ok", L);
1949
+ }, y = (L) => {
1950
+ a && (a.contains(L.target) || m(!1));
1951
+ }, T = () => {
1952
+ wt(document.documentElement, "click", y);
1953
+ }, $ = () => {
1954
+ kt(document.documentElement, "click", y);
1955
+ }, {
1956
+ zIndex: b
1957
+ } = Ce("popup", {
1958
+ visible: s
1959
+ }), C = async () => {
1960
+ if (!a || !r) return;
1961
+ const L = Se(r), D = l.getBoundingClientRect(), ie = tt(L, D), w = () => tt(a, D), {
1962
+ style: I,
1963
+ position: J
1964
+ } = Mn(e.position, D, ie, w(), {
1965
+ autoFitPosition: !0,
1966
+ offset: 16
1967
+ }), Ve = {
1968
+ ...I,
1969
+ position: "absolute",
1970
+ "z-index": b.value
1971
+ };
1972
+ q(a, Ve), await Te();
1973
+ const _t = En(J, ie, w(), {
1974
+ customStyle: {
1975
+ position: "absolute",
1976
+ "border-width": "6px",
1977
+ "border-style": "solid",
1978
+ zIndex: 0
1979
+ }
1980
+ }), zt = be(".arrow", a);
1981
+ q(zt, _t);
1982
+ }, k = async () => {
1983
+ await C();
1984
+ }, {
1985
+ createResizeObserver: _,
1986
+ destroyResizeObserver: B
1987
+ } = Kn({
1988
+ elementRef: O(l),
1989
+ onResize: k
1990
+ });
1991
+ W(() => {
1992
+ _();
1993
+ }), oe(() => {
1994
+ m(!1), B();
1995
+ });
1996
+ const {
1997
+ content: F
1998
+ } = ht(e), K = {
1999
+ ...e,
2000
+ onClose: u,
2001
+ onDestroy: f,
2002
+ onCancel: h,
2003
+ onOk: g,
2004
+ content: F
2005
+ }, Ie = () => {
2006
+ a || (o = c(tl, K, {
2007
+ content: t.content
2008
+ }), j(o, i), a = i.firstChild, l.appendChild(a), C(), setTimeout(() => {
2009
+ T();
2010
+ }, 0));
2011
+ }, je = () => {
2012
+ d.value = !0;
2013
+ }, ae = v(() => ({
2014
+ cursor: e.disabled ? "not-allowed" : "pointer",
2015
+ // color: props.disabled
2016
+ // ? 'var(--x-text-color)'
2017
+ // : computedVisible.value
2018
+ // ? 'var(--x-primary)'
2019
+ // : 'var(--x-text-color)',
2020
+ userSelect: "none"
2021
+ }));
2022
+ return G(() => s.value, (L) => {
2023
+ e.disabled || (L ? (Te(Ie), n("change", !0)) : m(!1));
2024
+ }, {
2025
+ immediate: !0
2026
+ }), () => {
2027
+ var L;
2028
+ return r = (L = t.default) == null ? void 0 : L.call(t), yt(r, {
2029
+ onClick: je,
2030
+ style: ae.value,
2031
+ disabled: e.disabled
2032
+ }), r;
2033
+ };
2034
+ }
2035
+ }), rl = V(S("Popconfirm"), ll), ol = {
2036
+ /**
2037
+ * @description 是否倒序
2038
+ */
2039
+ reverse: {
2040
+ type: Boolean
2041
+ },
2042
+ /**
2043
+ * @description 轴线样式
2044
+ */
2045
+ lineType: {
2046
+ type: String,
2047
+ default: "solid"
2048
+ }
2049
+ }, al = {
2050
+ /**
2051
+ * @description 小圆点颜色
2052
+ */
2053
+ dotColor: {
2054
+ type: String
2055
+ }
2056
+ }, Et = Symbol("timelineKey"), il = "TimelineItem", sl = /* @__PURE__ */ E({
2057
+ name: "Timeline",
2058
+ components: {},
2059
+ props: ol,
2060
+ emits: ["update:current", "change"],
2061
+ setup(e, {
2062
+ slots: t
2063
+ }) {
2064
+ const n = z("timeline"), l = v(() => [n.block, e.reverse && "is-reverse"]), {
2065
+ reverse: r,
2066
+ lineType: o
2067
+ } = ht(e), a = O(0), i = (u) => Array.isArray(u) && u.length > 0 ? u.filter((f) => {
2068
+ var h;
2069
+ if (Array.isArray(f.children) && f.children.length > 0 && typeof f.type == "symbol")
2070
+ return f.children = i(f.children), f.children.length > 0 ? f : null;
2071
+ if (((h = f == null ? void 0 : f.type) == null ? void 0 : h.name) === il)
2072
+ return f;
2073
+ }) : [], d = (u) => {
2074
+ let f = 0;
2075
+ return u.forEach((h) => {
2076
+ Array.isArray(h.children) ? f += d(h.children) : f += 1;
2077
+ }), f;
2078
+ }, s = (u) => {
2079
+ const f = i(u);
2080
+ return a.value = d(f), f;
2081
+ }, m = re({
2082
+ reverse: r,
2083
+ parentCls: n.block,
2084
+ count: a,
2085
+ lineType: o
2086
+ });
2087
+ return Dt(Et, m), () => {
2088
+ var u;
2089
+ return c("div", {
2090
+ class: l.value
2091
+ }, [s((u = t.default) == null ? void 0 : u.call(t))]);
2092
+ };
2093
+ }
2094
+ }), cl = V(S("Timeline"), sl), ul = ({
2095
+ itemRef: e,
2096
+ selector: t,
2097
+ index: n,
2098
+ parentClassName: l
2099
+ }) => {
2100
+ const r = O(-1), o = v(() => (n == null ? void 0 : n.value) ?? r.value), a = O(), i = () => {
2101
+ var m;
2102
+ let s = ((m = e.value) == null ? void 0 : m.parentElement) ?? void 0;
2103
+ if (l)
2104
+ for (; s && !s.className.includes(l); )
2105
+ s = s.parentElement ?? void 0;
2106
+ return s;
2107
+ }, d = () => {
2108
+ if (Ut(n == null ? void 0 : n.value) && a.value && e.value) {
2109
+ const s = Array.from(a.value.querySelectorAll(t)).indexOf(e.value);
2110
+ s !== r.value && (r.value = s);
2111
+ }
2112
+ };
2113
+ return G(e, () => {
2114
+ e.value && !a.value && (a.value = i());
2115
+ }), W(() => {
2116
+ e.value && (a.value = i()), d();
2117
+ }), Ht(() => d()), {
2118
+ innerIndex: o
2119
+ };
2120
+ }, dl = /* @__PURE__ */ E({
2121
+ name: "TimelineItem",
2122
+ props: al,
2123
+ emits: ["close"],
2124
+ setup(e, {
2125
+ slots: t
2126
+ }) {
2127
+ const n = z("timeline-item"), l = Xt(Et), r = O(null), o = O(e.dotColor), {
2128
+ innerIndex: a
2129
+ } = ul({
2130
+ itemRef: r,
2131
+ selector: `.${n.block}`,
2132
+ parentClassName: l == null ? void 0 : l.parentCls
2133
+ }), i = v(() => l ? l.reverse ? a.value === 0 : a.value + 1 === l.count : !1), d = v(() => [n.block, i.value && "is-last"]), s = v(() => ({
2134
+ borderLeftStyle: l == null ? void 0 : l.lineType
2135
+ })), m = v(() => t.icon ? [`${n.block}--dot--icon`, "is-slot-icon"] : [`${n.block}--dot--icon`]);
2136
+ return () => {
2137
+ var u, f;
2138
+ return c("div", {
2139
+ ref: r,
2140
+ class: d.value
2141
+ }, [c("div", {
2142
+ class: `${n.block}--dot`
2143
+ }, [!i.value && c("div", {
2144
+ class: `${n.block}--dot--line`,
2145
+ style: s.value
2146
+ }, null), c("div", {
2147
+ class: m.value
2148
+ }, [t.icon ? t.icon() : c("i", {
2149
+ class: "icon",
2150
+ style: {
2151
+ backgroundColor: o.value
2152
+ }
2153
+ }, null)])]), c("div", {
2154
+ class: `${n.block}--content`
2155
+ }, [t.default ? t.default() : c(Z, null, [c("div", {
2156
+ class: `${n.block}--content--label`
2157
+ }, [(u = t.label) == null ? void 0 : u.call(t)]), c("div", {
2158
+ class: `${n.block}--content--description`
2159
+ }, [(f = t.description) == null ? void 0 : f.call(t)])])])]);
2160
+ };
2161
+ }
2162
+ }), fl = V(S("TimelineItem"), dl), hl = (e) => {
2163
+ const t = e.split(" ").filter((l) => l !== "").map((l) => parseInt(l));
2164
+ let n = {};
2165
+ switch (t.length) {
2166
+ case 4:
2167
+ n = { top: t[0], right: t[1], bottom: t[2], left: t[3] };
2168
+ break;
2169
+ case 3:
2170
+ n = { top: t[0], right: t[1], bottom: t[2], left: t[1] };
2171
+ break;
2172
+ case 2:
2173
+ n = { top: t[0], right: t[1], bottom: t[0], left: t[1] };
2174
+ break;
2175
+ default:
2176
+ n = { top: t[0], right: t[0], bottom: t[0], left: t[0] };
2177
+ }
2178
+ return n;
2179
+ }, ml = (e) => {
2180
+ const t = e.split(" ").filter((n) => n !== "").map((n) => parseInt(n));
2181
+ return t.length < 1 || t.length > 4 ? !1 : t.every((n) => typeof n == "number" && n >= 0);
2182
+ }, vl = {
2183
+ // 数据集
2184
+ dataset: {
2185
+ required: !0,
2186
+ type: N(Array),
2187
+ default: () => []
2188
+ },
2189
+ status: {
2190
+ type: N(String),
2191
+ default: void 0
2192
+ },
2193
+ // 网格属性
2194
+ grid: {
2195
+ default: null,
2196
+ type: N(Object)
2197
+ },
2198
+ // 标签属性
2199
+ labels: {
2200
+ default: null,
2201
+ type: N(Object)
2202
+ },
2203
+ // 最大值,默认数据集最大值
2204
+ max: {
2205
+ type: Number
2206
+ },
2207
+ // 最小值,默认数据集最小值
2208
+ min: {
2209
+ type: Number
2210
+ },
2211
+ // 绘制边距
2212
+ padding: {
2213
+ default: "5",
2214
+ type: String,
2215
+ validator(e) {
2216
+ return ml(e);
2217
+ }
2218
+ },
2219
+ // 开启交互,开启后启用onmousemove事件
2220
+ interactive: {
2221
+ default: !1,
2222
+ type: Boolean
2223
+ },
2224
+ // 主题
2225
+ theme: {
2226
+ type: N(Object),
2227
+ default: () => ({
2228
+ activeLineColor: "#CCC"
2229
+ })
2230
+ }
2231
+ }, bl = {
2232
+ boundary: {
2233
+ required: !0,
2234
+ type: N(Object),
2235
+ default: () => {
2236
+ }
2237
+ },
2238
+ minValue: {
2239
+ required: !0,
2240
+ type: Number
2241
+ },
2242
+ maxValue: {
2243
+ required: !0,
2244
+ type: Number
2245
+ },
2246
+ maxAmount: {
2247
+ required: !0,
2248
+ type: Number
2249
+ },
2250
+ activeLineParams: {
2251
+ type: Object
2252
+ },
2253
+ data: {
2254
+ required: !0,
2255
+ type: N(Array),
2256
+ default: () => []
2257
+ },
2258
+ className: {
2259
+ type: String
2260
+ },
2261
+ // 平滑
2262
+ smooth: {
2263
+ default: !0,
2264
+ type: Boolean
2265
+ },
2266
+ stroke: {
2267
+ default: !0,
2268
+ type: Boolean
2269
+ },
2270
+ // 填充
2271
+ fill: {
2272
+ default: !0,
2273
+ type: Boolean
2274
+ },
2275
+ // 鼠标
2276
+ showPoints: {
2277
+ default: !0,
2278
+ type: Boolean
2279
+ },
2280
+ theme: {
2281
+ type: N(Object)
2282
+ },
2283
+ mainTheme: {
2284
+ type: N(Object)
2285
+ }
2286
+ }, yl = {
2287
+ boundary: {
2288
+ required: !0,
2289
+ type: N(Object),
2290
+ default: () => {
2291
+ }
2292
+ },
2293
+ verticalLines: {
2294
+ default: !1,
2295
+ type: Boolean
2296
+ },
2297
+ verticalLinesNumber: {
2298
+ default: 0,
2299
+ type: Number
2300
+ },
2301
+ horizontalLines: {
2302
+ default: !1,
2303
+ type: Boolean
2304
+ },
2305
+ horizontalLinesNumber: {
2306
+ default: 0,
2307
+ type: Number
2308
+ }
2309
+ }, gl = {
2310
+ boundary: {
2311
+ required: !0,
2312
+ type: N(Object),
2313
+ default: () => {
2314
+ }
2315
+ },
2316
+ minValue: {
2317
+ type: Number,
2318
+ required: !0
2319
+ },
2320
+ maxValue: {
2321
+ type: Number,
2322
+ required: !0
2323
+ },
2324
+ xLabels: {
2325
+ type: Array
2326
+ },
2327
+ yLabels: {
2328
+ type: Number,
2329
+ required: !0
2330
+ },
2331
+ yLabelsTextFormatter: {
2332
+ default: (e) => e,
2333
+ type: Function
2334
+ }
2335
+ }, lt = E({
2336
+ name: S("TrendChartGrid"),
2337
+ props: yl,
2338
+ setup(e) {
2339
+ const t = (o) => {
2340
+ const a = e.verticalLinesNumber > 1 ? (e.boundary.maxX - e.boundary.minX) / (e.verticalLinesNumber - 1) : 0, i = e.boundary.minX + a * (o - 1), d = e.boundary.minY, s = e.boundary.maxY;
2341
+ return {
2342
+ x1: i,
2343
+ x2: i,
2344
+ y1: d,
2345
+ y2: s,
2346
+ stroke: "rgba(0,0,0,0.1)"
2347
+ };
2348
+ }, n = (o) => {
2349
+ const a = e.horizontalLinesNumber > 1 ? (e.boundary.maxY - e.boundary.minY) / (e.horizontalLinesNumber - 1) : 0, i = e.boundary.maxY - a * (o - 1), d = e.boundary.minX, s = e.boundary.maxX;
2350
+ return {
2351
+ x1: d,
2352
+ x2: s,
2353
+ y1: i,
2354
+ y2: i,
2355
+ stroke: "rgba(0,0,0,0.1)"
2356
+ };
2357
+ }, l = v(() => {
2358
+ if (e.verticalLines && e.verticalLinesNumber > 0) {
2359
+ const o = [];
2360
+ for (let a = 1; a <= e.verticalLinesNumber; a++)
2361
+ o.push(
2362
+ p("line", {
2363
+ class: "line",
2364
+ ...t(a)
2365
+ })
2366
+ );
2367
+ return p("g", { class: "vertical" }, o);
2368
+ }
2369
+ return null;
2370
+ }), r = v(() => {
2371
+ if (e.horizontalLines && e.horizontalLinesNumber > 0) {
2372
+ const o = [];
2373
+ for (let a = 1; a <= e.horizontalLinesNumber; a++)
2374
+ o.push(
2375
+ p("line", {
2376
+ class: "line",
2377
+ ...n(a)
2378
+ })
2379
+ );
2380
+ return p("g", { class: "horizontal" }, o);
2381
+ }
2382
+ return null;
2383
+ });
2384
+ return () => {
2385
+ const o = [];
2386
+ return l.value && o.push(l.value), r.value && o.push(r.value), o.length === 0 ? null : p("g", null, o);
2387
+ };
2388
+ }
2389
+ }), rt = E({
2390
+ name: S("TrendChartLabels"),
2391
+ props: gl,
2392
+ setup(e) {
2393
+ const t = re({
2394
+ xLabelHeight: 0,
2395
+ yLabelHeight: 0
2396
+ }), n = O(null), l = O(null), r = (d) => {
2397
+ const s = (e.boundary.maxX - e.boundary.minX) / (e.xLabels.length - 1), m = e.boundary.minX + s * d, u = e.boundary.maxY;
2398
+ return { transform: `translate(${m}, ${u})` };
2399
+ }, o = (d) => {
2400
+ const s = (e.boundary.maxY - e.boundary.minY) / (e.yLabels - 1), m = e.boundary.minX, u = e.boundary.maxY - s * d;
2401
+ return { transform: `translate(${m}, ${u})` };
2402
+ };
2403
+ W(() => {
2404
+ var d, s;
2405
+ n.value && e.xLabels && e.xLabels.length && (t.xLabelHeight = ((d = n.value.querySelector("text")) == null ? void 0 : d.getBoundingClientRect().height) || 0), l.value && e.yLabels && e.yLabels > 0 && (t.yLabelHeight = ((s = l.value.querySelector("text")) == null ? void 0 : s.getBoundingClientRect().height) || 0);
2406
+ });
2407
+ const a = v(() => e.xLabels && e.xLabels.length ? p(
2408
+ "g",
2409
+ { class: "x-labels", ref: n },
2410
+ e.xLabels.map(
2411
+ (d, s) => p("g", { class: "label", ...r(s) }, [
2412
+ p(
2413
+ "text",
2414
+ {
2415
+ dy: t.xLabelHeight + 5,
2416
+ "text-anchor": "middle"
2417
+ },
2418
+ d
2419
+ ),
2420
+ p("line", { stroke: "rgba(0,0,0,0.1)", y2: 5 })
2421
+ ])
2422
+ )
2423
+ ) : null), i = v(() => {
2424
+ if (e.yLabels && e.yLabels > 0) {
2425
+ const d = [];
2426
+ for (let s = 0; s < e.yLabels; s++)
2427
+ d.push(
2428
+ p("g", { class: "label", ...o(s) }, [
2429
+ p(
2430
+ "text",
2431
+ {
2432
+ dx: -10,
2433
+ dy: t.yLabelHeight / 4,
2434
+ "text-anchor": "end"
2435
+ },
2436
+ e.yLabelsTextFormatter(
2437
+ e.minValue + (e.maxValue - e.minValue) / (e.yLabels - 1) * s
2438
+ )
2439
+ ),
2440
+ p("line", { stroke: "rgba(0,0,0,0.1)", x1: 0, x2: -5 })
2441
+ ])
2442
+ );
2443
+ return p("g", { class: "y-labels", ref: l }, d);
2444
+ }
2445
+ return null;
2446
+ });
2447
+ return () => {
2448
+ const d = [];
2449
+ return a.value && d.push(a.value), i.value && d.push(i.value), p("g", d);
2450
+ };
2451
+ }
2452
+ }), Cl = (e, t, n, l, r) => {
2453
+ const o = l - 1e-3, a = (t.maxX - t.minX) / (r - 1), i = (t.maxY - t.minY) / (n + 1e-3 - o);
2454
+ return e.map((d, s) => ({
2455
+ x: s * a + t.minX,
2456
+ y: t.maxY - (d - o) * i + +(s === r - 1) * 1e-5 - +(s === 0) * 1e-5
2457
+ }));
2458
+ }, wl = (e, t, { maxY: n }) => {
2459
+ const l = e.shift(), r = e[e.length - 1], a = (e[0].x - l.x) / 2;
2460
+ let i = `M ${l.x},${l.y}`;
2461
+ e.forEach((s, m) => {
2462
+ if (!t) i += ` L${s.x},${s.y}`;
2463
+ else {
2464
+ const u = e[m - 1] || l;
2465
+ i += ` C ${a + u.x},${u.y} ${a + u.x},${s.y} ${s.x},${s.y}`;
2466
+ }
2467
+ });
2468
+ let d = i;
2469
+ return r.y !== n && (d += ` L${r.x},${n}`), l.y !== n && (d += ` L${l.x},${n}`), d += " Z", { linePath: i, fillPath: d };
2470
+ }, ot = /* @__PURE__ */ E({
2471
+ name: S("TrendChartCurve"),
2472
+ props: bl,
2473
+ setup(e) {
2474
+ const t = v(() => Cl(e.data, e.boundary, e.maxValue, e.minValue, e.maxAmount)), n = v(() => wl([...t.value], e.smooth, e.boundary)), l = v(() => {
2475
+ var a, i, d, s, m, u, f, h, g, y, T, $;
2476
+ const r = [];
2477
+ e.fill && ((a = n.value) != null && a.fillPath) && r.push(c("path", {
2478
+ class: "x-trend-chart-fill",
2479
+ d: n.value.fillPath,
2480
+ fill: "none",
2481
+ style: {
2482
+ fill: ((d = (i = e.theme) == null ? void 0 : i.fill) == null ? void 0 : d.color) || "#585858",
2483
+ opacity: ((m = (s = e.theme) == null ? void 0 : s.fill) == null ? void 0 : m.opacity) || 0.1
2484
+ }
2485
+ }, null)), e.stroke && ((u = n.value) != null && u.linePath) && r.push(c("path", {
2486
+ class: "x-trend-chart-stroke",
2487
+ d: n.value.linePath,
2488
+ fill: "none",
2489
+ stroke: "none",
2490
+ style: {
2491
+ stroke: (h = (f = e.theme) == null ? void 0 : f.stroke) == null ? void 0 : h.color,
2492
+ strokeWidth: (y = (g = e.theme) == null ? void 0 : g.stroke) == null ? void 0 : y.width,
2493
+ opacity: ($ = (T = e.theme) == null ? void 0 : T.stroke) == null ? void 0 : $.opacity
2494
+ }
2495
+ }, null));
2496
+ const o = (b) => {
2497
+ var C, k, _, B;
2498
+ return b ? {
2499
+ stroke: (k = (C = e.theme) == null ? void 0 : C.point) == null ? void 0 : k.color,
2500
+ strokeWidth: (B = (_ = e.theme) == null ? void 0 : _.point) == null ? void 0 : B.width,
2501
+ r: 1
2502
+ } : {};
2503
+ };
2504
+ if (e.showPoints && t.value) {
2505
+ const b = t.value.map((C, k) => {
2506
+ var _, B;
2507
+ return c("circle", {
2508
+ class: {
2509
+ point: !0,
2510
+ "x-trend-chart-point-active": ((_ = e.activeLineParams) == null ? void 0 : _.index) === k
2511
+ },
2512
+ cx: C.x,
2513
+ cy: C.y,
2514
+ style: o(((B = e.activeLineParams) == null ? void 0 : B.index) === k)
2515
+ }, null);
2516
+ });
2517
+ r.push(c("g", {
2518
+ class: "x-trend-chart-points"
2519
+ }, [b]));
2520
+ }
2521
+ return r;
2522
+ });
2523
+ return () => c("g", {
2524
+ class: e.className
2525
+ }, [l.value]);
2526
+ }
2527
+ }), xe = "#f00", se = "#ff7126", ce = "#ffc703", ue = "#363636", de = "#25c341", fe = "#0056ff", R = {
2528
+ DANGER: {
2529
+ // 主题色
2530
+ color: "#f00",
2531
+ // 点
2532
+ point: {
2533
+ width: 3,
2534
+ color: xe
2535
+ },
2536
+ // 描边
2537
+ stroke: {
2538
+ width: 3,
2539
+ color: xe,
2540
+ opacity: 0.8
2541
+ },
2542
+ // 填充
2543
+ fill: {
2544
+ color: xe,
2545
+ opacity: 0.1
2546
+ },
2547
+ axisLine: {
2548
+ color: xe,
2549
+ width: 2,
2550
+ opacity: 0.9
2551
+ }
2552
+ },
2553
+ STRONG: {
2554
+ // 主题色
2555
+ color: se,
2556
+ // 点
2557
+ point: {
2558
+ width: 4,
2559
+ color: se
2560
+ },
2561
+ stroke: {
2562
+ width: 3,
2563
+ color: se,
2564
+ opacity: 0.8
2565
+ },
2566
+ fill: {
2567
+ color: se,
2568
+ opacity: 0.1
2569
+ },
2570
+ axisLine: {
2571
+ color: se,
2572
+ width: 2,
2573
+ opacity: 0.9
2574
+ }
2575
+ },
2576
+ WARNING: {
2577
+ // 主题色
2578
+ color: ce,
2579
+ // 点
2580
+ point: {
2581
+ width: 4,
2582
+ color: ce
2583
+ },
2584
+ stroke: {
2585
+ width: 3,
2586
+ color: ce,
2587
+ opacity: 1
2588
+ },
2589
+ fill: {
2590
+ color: ce,
2591
+ opacity: 0.1
2592
+ },
2593
+ axisLine: {
2594
+ color: ce,
2595
+ width: 2,
2596
+ opacity: 0.9
2597
+ }
2598
+ },
2599
+ SUCCESS: {
2600
+ // 主题色
2601
+ color: de,
2602
+ // 点
2603
+ point: {
2604
+ width: 4,
2605
+ color: de
2606
+ },
2607
+ stroke: {
2608
+ width: 3,
2609
+ color: de,
2610
+ opacity: 1
2611
+ },
2612
+ fill: {
2613
+ color: de,
2614
+ opacity: 0.1
2615
+ },
2616
+ axisLine: {
2617
+ color: de,
2618
+ width: 2,
2619
+ opacity: 0.9
2620
+ }
2621
+ },
2622
+ INFO: {
2623
+ // 主题色
2624
+ color: ue,
2625
+ // 点
2626
+ point: {
2627
+ width: 4,
2628
+ color: ue
2629
+ },
2630
+ stroke: {
2631
+ width: 3,
2632
+ color: ue,
2633
+ opacity: 1
2634
+ },
2635
+ fill: {
2636
+ color: ue,
2637
+ opacity: 0.1
2638
+ },
2639
+ axisLine: {
2640
+ color: ue,
2641
+ width: 2,
2642
+ opacity: 0.9
2643
+ }
2644
+ },
2645
+ PRIMARY: {
2646
+ // 主题色
2647
+ color: fe,
2648
+ // 点
2649
+ point: {
2650
+ width: 4,
2651
+ color: fe
2652
+ },
2653
+ stroke: {
2654
+ width: 3,
2655
+ color: fe,
2656
+ opacity: 0.9
2657
+ },
2658
+ fill: {
2659
+ color: fe,
2660
+ opacity: 0.1
2661
+ },
2662
+ axisLine: {
2663
+ color: fe,
2664
+ width: 2,
2665
+ opacity: 0.9
2666
+ }
2667
+ }
2668
+ }, kl = /* @__PURE__ */ E({
2669
+ name: S("TrendChart"),
2670
+ components: {
2671
+ TrendChartGrid: lt,
2672
+ TrendChartLabels: rt,
2673
+ TrendChartCurve: ot
2674
+ },
2675
+ props: vl,
2676
+ emits: {
2677
+ "mouse-move": (e) => !0
2678
+ },
2679
+ setup(e, {
2680
+ emit: t
2681
+ }) {
2682
+ const n = re({
2683
+ width: null,
2684
+ height: null,
2685
+ labelsOverflowObject: {
2686
+ top: 0,
2687
+ right: 0,
2688
+ bottom: 0,
2689
+ left: 0
2690
+ },
2691
+ activeLine: null,
2692
+ activeLineParams: null
2693
+ }), l = v(() => {
2694
+ let b = R.INFO;
2695
+ return e.status === "primary" ? b = R.PRIMARY : e.status === "success" ? b = R.SUCCESS : e.status === "danger" ? b = R.DANGER : e.status === "warning" ? b = R.WARNING : e.status === "strong" && (b = R.STRONG), {
2696
+ ...b,
2697
+ ...e.theme
2698
+ };
2699
+ }), r = v(() => hl(e.padding || "0")), o = v(() => ({
2700
+ minX: Number(r.value.left) + Number(n.labelsOverflowObject.left),
2701
+ minY: Number(r.value.top) + Number(n.labelsOverflowObject.top),
2702
+ maxX: (n.width ?? 0) - Number(r.value.right) - Number(n.labelsOverflowObject.right),
2703
+ maxY: (n.height ?? 0) - Number(r.value.bottom) - Number(n.labelsOverflowObject.bottom)
2704
+ })), a = v(() => {
2705
+ let b = -1 / 0, C = 1 / 0, k = 0;
2706
+ return b = Math.max(b, ...e.dataset), C = Math.min(C, ...e.dataset), k = Math.max(k, e.dataset.length), e.max !== void 0 && (b = Math.max(b, e.max)), e.min !== void 0 && (C = Math.min(C, e.min)), {
2707
+ maxValue: b,
2708
+ minValue: C,
2709
+ maxAmount: k
2710
+ };
2711
+ }), i = v(() => ({
2712
+ x: o.value.minX,
2713
+ y: o.value.minY,
2714
+ width: Math.max(0, o.value.maxX - o.value.minX),
2715
+ height: Math.max(0, o.value.maxY - o.value.minY),
2716
+ opacity: 0
2717
+ })), d = v(() => {
2718
+ const b = (o.value.maxX - o.value.minX) / (a.value.maxAmount - 1);
2719
+ return Array.from({
2720
+ length: a.value.maxAmount
2721
+ }, (C, k) => Math.round(o.value.minX + b * k));
2722
+ }), s = O(null), m = O(null), u = () => {
2723
+ if (s.value) {
2724
+ const b = s.value.getBoundingClientRect();
2725
+ n.width = b.width, n.height = b.height;
2726
+ }
2727
+ }, f = () => {
2728
+ if (m.value) {
2729
+ const b = s.value.getBoundingClientRect(), C = m.value.$el.getBoundingClientRect();
2730
+ n.labelsOverflowObject = {
2731
+ top: Math.max(0, Number(b.top) - Number(C.top) + Number(r.value.top)),
2732
+ right: Math.max(0, Number(C.right) - Number(b.right) + Number(r.value.right)),
2733
+ bottom: Math.max(0, Number(C.bottom) - Number(b.bottom) + Number(r.value.bottom)),
2734
+ left: Math.max(0, Number(r.value.left) - Number(C.left) + Number(b.left))
2735
+ };
2736
+ } else
2737
+ n.labelsOverflowObject = {
2738
+ top: 0,
2739
+ right: 0,
2740
+ bottom: 0,
2741
+ left: 0
2742
+ };
2743
+ }, h = () => {
2744
+ u(), Te(f);
2745
+ }, g = (b) => d.value.reduce((C, k) => Math.abs(C - b) > Math.abs(k - b) ? k : C, 1 / 0), y = (b) => {
2746
+ if (s.value) {
2747
+ const C = s.value.getBoundingClientRect();
2748
+ n.activeLine = g(b.clientX - C.left);
2749
+ }
2750
+ }, T = () => {
2751
+ n.activeLine = null, n.activeLineParams = null;
2752
+ }, $ = () => {
2753
+ u();
2754
+ };
2755
+ return W(() => {
2756
+ h(), window.addEventListener("resize", $);
2757
+ }), oe(() => {
2758
+ window.removeEventListener("resize", $);
2759
+ }), G(() => n.activeLine, (b) => {
2760
+ if (b !== null) {
2761
+ const C = d.value.indexOf(b);
2762
+ n.activeLineParams = {
2763
+ index: C
2764
+ }, t("mouse-move", {
2765
+ ...n.activeLineParams,
2766
+ data: e.dataset[C]
2767
+ });
2768
+ } else
2769
+ t("mouse-move", null);
2770
+ }), G(() => e.labels, () => {
2771
+ n.labelsOverflowObject = {
2772
+ top: 0,
2773
+ right: 0,
2774
+ bottom: 0,
2775
+ left: 0
2776
+ }, Te(f);
2777
+ }, {
2778
+ deep: !0
2779
+ }), () => {
2780
+ var b, C, k, _, B, F, K;
2781
+ return c("svg", {
2782
+ class: "x-trend-chart",
2783
+ ref: s,
2784
+ xmlns: "http://www.w3.org/2000/svg",
2785
+ width: "100%",
2786
+ height: "100%"
2787
+ }, [e.grid && c(lt, {
2788
+ class: "grid",
2789
+ verticalLines: e.grid.verticalLines,
2790
+ verticalLinesNumber: e.grid.verticalLinesNumber || a.value.maxAmount,
2791
+ horizontalLines: e.grid.horizontalLines,
2792
+ horizontalLinesNumber: e.grid.horizontalLinesNumber || (((b = e.labels) == null ? void 0 : b.yLabels) ?? 0),
2793
+ boundary: o.value
2794
+ }, null), e.labels && c(rt, Qe({
2795
+ ref: m,
2796
+ class: "labels"
2797
+ }, e.labels, {
2798
+ boundary: o.value,
2799
+ minValue: a.value.minValue,
2800
+ maxValue: a.value.maxValue
2801
+ }), null), c(ot, {
2802
+ class: "curve",
2803
+ data: e.dataset,
2804
+ boundary: o.value,
2805
+ minValue: a.value.minValue,
2806
+ maxValue: a.value.maxValue,
2807
+ maxAmount: a.value.maxAmount,
2808
+ activeLineParams: n.activeLineParams,
2809
+ theme: l.value
2810
+ }, null), e.interactive && c(Z, null, [c("line", {
2811
+ class: "x-trend-chart-active-line",
2812
+ x1: n.activeLine ?? o.value.minX,
2813
+ x2: n.activeLine ?? o.value.minX,
2814
+ y1: o.value.minY,
2815
+ y2: o.value.maxY,
2816
+ visibility: n.activeLine ? "visible" : "hidden",
2817
+ style: {
2818
+ stroke: (k = (C = l.value) == null ? void 0 : C.axisLine) == null ? void 0 : k.color,
2819
+ strokeWidth: (B = (_ = l.value) == null ? void 0 : _.axisLine) == null ? void 0 : B.width,
2820
+ strokeOpacity: (K = (F = l.value) == null ? void 0 : F.axisLine) == null ? void 0 : K.opacity
2821
+ }
2822
+ }, null), c("rect", Qe(i.value, {
2823
+ onMousemove: y,
2824
+ onMouseout: T
2825
+ }), null)])]);
2826
+ };
2827
+ }
2828
+ }), pl = V(S("TrendChart"), kl), at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2829
+ __proto__: null,
2830
+ XButton: ne,
2831
+ XDialog: xt,
2832
+ XMessage: Cn,
2833
+ XMessageBox: xn,
2834
+ XNotification: Ln,
2835
+ XPopconfirm: rl,
2836
+ XSpace: Pe,
2837
+ XTimeline: cl,
2838
+ XTimelineItem: fl,
2839
+ XTrendChart: pl
2840
+ }, Symbol.toStringTag, { value: "Module" }));
2841
+ function it(e) {
2842
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
2843
+ }
2844
+ const st = z("dialog"), _l = (e) => {
2845
+ const t = document.createElement("div"), n = () => {
2846
+ j(null, t);
2847
+ }, l = (u) => {
2848
+ if (u === "cancel")
2849
+ return e.beforeOnCancel ? e.beforeOnCancel() : !0;
2850
+ if (u === "ok")
2851
+ return e.beforeOnOk ? e.beforeOnOk() : !0;
2852
+ }, r = (u, f) => {
2853
+ u === "cancel" && e.onCancel && e.onCancel(f), u === "ok" && e.onOk && e.onOk(f);
2854
+ }, o = (u) => {
2855
+ if (M(u)) return u;
2856
+ if (x(u)) {
2857
+ const f = u();
2858
+ return M(f) ? f : null;
2859
+ }
2860
+ return c("div", {
2861
+ class: st.element("header-title")
2862
+ }, [P(" "), u, P(" ")]);
2863
+ }, a = (u) => {
2864
+ if (M(u)) return u;
2865
+ if (x(u)) {
2866
+ const f = u();
2867
+ return M(f) ? f : null;
2868
+ }
2869
+ return c("div", {
2870
+ class: st.element("content")
2871
+ }, [P(" "), e.content, P(" ")]);
2872
+ }, i = () => () => c(Z, null, [e.title && o(e.title)]), d = () => () => c(Z, null, [e.content && a(e.content)]), s = () => {
2873
+ if (M(e.footer) || x(e.footer))
2874
+ return e.footer;
2875
+ const u = (e == null ? void 0 : e.cancelText) || "取消", f = (e == null ? void 0 : e.okText) || "确认";
2876
+ return (h) => c(Pe, {
2877
+ size: 12
2878
+ }, {
2879
+ default: () => {
2880
+ var g, y;
2881
+ return [!e.hideCancel && c(ne, {
2882
+ size: "small",
2883
+ onClick: h.cancel,
2884
+ loading: (g = h.loadingObj) == null ? void 0 : g.cancel
2885
+ }, it(u) ? u : {
2886
+ default: () => [u]
2887
+ }), !e.hideOk && c(ne, {
2888
+ type: "primary",
2889
+ size: "small",
2890
+ onClick: h.ok,
2891
+ loading: (y = h.loadingObj) == null ? void 0 : y.ok
2892
+ }, it(f) ? f : {
2893
+ default: () => [f]
2894
+ })];
2895
+ }
2896
+ });
2897
+ }, m = c(pt, {
2898
+ width: (e == null ? void 0 : e.width) ?? 368,
2899
+ height: (e == null ? void 0 : e.height) ?? "auto",
2900
+ modelValue: !0,
2901
+ renderTo: e == null ? void 0 : e.renderTo,
2902
+ center: e != null && e.top ? !1 : (e == null ? void 0 : e.center) ?? !0,
2903
+ top: (e == null ? void 0 : e.top) ?? 0,
2904
+ mask: (e == null ? void 0 : e.mask) ?? !0,
2905
+ maskToClose: (e == null ? void 0 : e.maskToClose) ?? !0,
2906
+ popupClass: e.popupClass,
2907
+ onClose: r,
2908
+ onBeforeCancel: l,
2909
+ "onUpdate:modelValue": () => {
2910
+ m.component.props.modelValue = !1;
2911
+ },
2912
+ // 等待动画完全结束后销毁vm
2913
+ onClosed: n,
2914
+ onOpened: () => {
2915
+ }
2916
+ }, {
2917
+ title: i(),
2918
+ default: d(),
2919
+ footer: s()
2920
+ });
2921
+ j(m, t);
2922
+ }, xl = ["success", "warning", "error", "strong", "info"], Ol = E({
2923
+ name: S("Message"),
2924
+ components: {
2925
+ CloseCircleFill: _e,
2926
+ CheckCircleFill: ze,
2927
+ ExclamationCircleFill: $e,
2928
+ InfoCircleFill: we,
2929
+ MinusCircleFill: Ae
2930
+ },
2931
+ props: {
2932
+ id: {
2933
+ type: String,
2934
+ default: ""
2935
+ },
2936
+ message: {
2937
+ type: [String, Number, Object],
2938
+ default: ""
2939
+ },
2940
+ type: {
2941
+ type: String,
2942
+ default: "success"
2943
+ },
2944
+ duration: {
2945
+ type: Number,
2946
+ default: 1500
2947
+ },
2948
+ center: {
2949
+ type: Boolean,
2950
+ default: !1
2951
+ },
2952
+ onClose: {
2953
+ type: Function,
2954
+ default: () => {
2955
+ }
2956
+ },
2957
+ offset: {
2958
+ type: Number,
2959
+ default: 20
2960
+ },
2961
+ zIndex: {
2962
+ type: Number,
2963
+ default: 0
2964
+ },
2965
+ showClose: {
2966
+ type: Boolean,
2967
+ default: !1
2968
+ },
2969
+ useHTML: Boolean,
2970
+ popupClass: {
2971
+ type: String,
2972
+ default: void 0
2973
+ }
2974
+ },
2975
+ emits: ["destroy"],
2976
+ setup(e) {
2977
+ const t = z("message"), n = v(() => [
2978
+ t.block,
2979
+ t.modifier(e.type),
2980
+ e.center && t.modifier("center"),
2981
+ e.showClose && !e.center && t.element("show-close"),
2982
+ e.popupClass && e.popupClass
2983
+ ]), l = O(!1);
2984
+ let r = null;
2985
+ const o = () => {
2986
+ r = setTimeout(() => {
2987
+ l.value = !1;
2988
+ }, e.duration);
2989
+ };
2990
+ W(() => {
2991
+ l.value = !0, e.duration !== 0 && o();
2992
+ }), oe(() => {
2993
+ clearTimeout(r);
2994
+ });
2995
+ const { zIndex: a } = Ce("message", { runOnMounted: !0 }), i = v(() => ({
2996
+ top: `${e.offset}px`,
2997
+ zIndex: a.value
2998
+ }));
2999
+ return {
3000
+ cn: t,
3001
+ cls: n,
3002
+ styles: i,
3003
+ visible: l,
3004
+ handleClose: () => {
3005
+ l.value = !1;
3006
+ }
3007
+ };
3008
+ }
3009
+ }), Ll = ["innerHTML"], Sl = { key: 1 };
3010
+ function Tl(e, t, n, l, r, o) {
3011
+ const a = H("CheckCircleFill"), i = H("ExclamationCircleFill"), d = H("MinusCircleFill"), s = H("CloseCircleFill"), m = H("InfoCircleFill");
3012
+ return A(), Y(te, {
3013
+ name: "x-message-slide-top",
3014
+ onBeforeLeave: e.onClose,
3015
+ onAfterLeave: t[1] || (t[1] = (u) => e.$emit("destroy"))
3016
+ }, {
3017
+ default: me(() => [
3018
+ ut(ee("div", {
3019
+ class: X(e.cls),
3020
+ style: dt(e.styles)
3021
+ }, [
3022
+ e.$slots.icon ? De("", !0) : (A(), ke("span", {
3023
+ key: 0,
3024
+ class: X([e.cn.element("icon"), e.cn.modifier(`icon-${e.type}`)])
3025
+ }, [
3026
+ qe(e.$slots, "icon", {}, () => [
3027
+ e.type === "success" ? (A(), Y(a, { key: 0 })) : e.type === "warning" ? (A(), Y(i, { key: 1 })) : e.type === "strong" ? (A(), Y(d, { key: 2 })) : e.type === "error" ? (A(), Y(s, { key: 3 })) : e.type === "info" ? (A(), Y(m, { key: 4 })) : De("", !0)
3028
+ ])
3029
+ ], 2)),
3030
+ qe(e.$slots, "default", {}, () => [
3031
+ e.useHTML ? (A(), ke("span", {
3032
+ key: 0,
3033
+ innerHTML: e.message
3034
+ }, null, 8, Ll)) : (A(), ke("span", Sl, Oe(e.message), 1)),
3035
+ e.showClose ? (A(), ke("span", {
3036
+ key: 2,
3037
+ class: X([e.cn.element("close-icon")]),
3038
+ onClick: t[0] || (t[0] = (...u) => e.handleClose && e.handleClose(...u))
3039
+ }, null, 2)) : De("", !0)
3040
+ ])
3041
+ ], 6), [
3042
+ [ft, e.visible]
3043
+ ])
3044
+ ]),
3045
+ _: 3
3046
+ }, 8, ["onBeforeLeave"]);
3047
+ }
3048
+ const Nl = /* @__PURE__ */ Mt(Ol, [["render", Tl]]), We = /* @__PURE__ */ new WeakMap(), Ye = (e) => {
3049
+ (typeof e == "string" || M(e)) && (e = {
3050
+ message: e
3051
+ });
3052
+ const t = be(e.renderTo || "body"), n = document.createElement("div");
3053
+ We.has(t) || We.set(t, []);
3054
+ const l = We.get(t);
3055
+ let r = e.offset || 20;
3056
+ l.forEach((u) => {
3057
+ var f;
3058
+ r += ((f = u.el) == null ? void 0 : f.offsetHeight) + 20;
3059
+ });
3060
+ const o = e.onClose;
3061
+ let a = {};
3062
+ a = { ...e, onClose: () => {
3063
+ var h;
3064
+ const u = l.findIndex((g) => g === s);
3065
+ if (u < 0) return;
3066
+ const f = ((h = s.el) == null ? void 0 : h.offsetHeight) + 20;
3067
+ l.slice(u + 1).forEach((g) => {
3068
+ var T;
3069
+ const y = (T = g.component) == null ? void 0 : T.props.offset;
3070
+ g.component.props.offset = y - f;
3071
+ }), l.splice(u, 1), o && o(s);
3072
+ }, onDestroy: () => {
3073
+ j(null, n);
3074
+ }, offset: r };
3075
+ const s = c(
3076
+ Nl,
3077
+ a,
3078
+ x(a.message) || M(a.message) ? {
3079
+ default: x(a.message) ? a.message : () => a.message
3080
+ } : null
3081
+ );
3082
+ return j(s, n), t.tagName === "BODY" ? s.el.style.position = "fixed" : (t.style.position = "relative", s.el.style.position = "absolute"), t.appendChild(n.firstElementChild), l.push(s), {
3083
+ close: () => {
3084
+ s.component.proxy.handleClose();
3085
+ }
3086
+ };
3087
+ }, Bl = () => {
3088
+ xl.forEach((e) => {
3089
+ Ye[e] = (t) => vt(t) ? Ye({
3090
+ type: e,
3091
+ ...t
3092
+ }) : Ye({
3093
+ message: t,
3094
+ type: e
3095
+ });
3096
+ });
3097
+ };
3098
+ Bl();
3099
+ const he = /* @__PURE__ */ new WeakMap(), zl = (e) => {
3100
+ const t = be(e.renderTo || "body"), n = document.createElement("div");
3101
+ he.get(t) || he.set(t, {}), he.get(t)[e.position] || (he.get(t)[e.position] = []);
3102
+ const l = he.get(t)[e.position];
3103
+ let r = e.offset || 20;
3104
+ l.forEach((m) => {
3105
+ var u;
3106
+ r += ((u = m.el) == null ? void 0 : u.offsetHeight) + 20;
3107
+ });
3108
+ const o = t.tagName === "BODY";
3109
+ o || (t.style.position = "relative", t.style.overflowX = "hidden");
3110
+ const a = e.onClose, i = () => {
3111
+ var f;
3112
+ const m = l.findIndex((h) => h === s);
3113
+ if (m < 0) return;
3114
+ const u = ((f = s.el) == null ? void 0 : f.offsetHeight) + 20;
3115
+ l.slice(m + 1).forEach((h) => {
3116
+ var y;
3117
+ const g = (y = h.component) == null ? void 0 : y.props.offset;
3118
+ h.component.props.offset = g - u;
3119
+ }), l.splice(m, 1), a && a(s);
3120
+ }, d = () => {
3121
+ j(null, n);
3122
+ }, s = c(
3123
+ Ot,
3124
+ {
3125
+ message: e.message,
3126
+ title: e.title,
3127
+ type: e.type,
3128
+ offset: r,
3129
+ renderToBody: o,
3130
+ position: e.position,
3131
+ duration: e.duration ?? 3e3,
3132
+ showClose: e.showClose ?? !0,
3133
+ onClose: i,
3134
+ onDestroy: d
3135
+ },
3136
+ x(e.message) || M(e.message) ? {
3137
+ default: x(e.message) ? e.message : () => e.message
3138
+ } : null
3139
+ );
3140
+ j(s, n), l.push(s), t == null || t.appendChild(n.firstChild);
3141
+ }, $l = {
3142
+ install: function(e) {
3143
+ Object.keys(at).forEach((t) => {
3144
+ const n = at[t];
3145
+ n.install && e.use(n);
3146
+ });
3147
+ }
3148
+ };
3149
+ export {
3150
+ _l as Dialog,
3151
+ Ye as Message,
3152
+ Ge as MessageBox,
3153
+ zl as Notification,
3154
+ R as TrendChartTheme,
3155
+ ne as XButton,
3156
+ xt as XDialog,
3157
+ Cn as XMessage,
3158
+ xn as XMessageBox,
3159
+ Ln as XNotification,
3160
+ rl as XPopconfirm,
3161
+ Pe as XSpace,
3162
+ cl as XTimeline,
3163
+ fl as XTimelineItem,
3164
+ pl as XTrendChart,
3165
+ $l as default
3166
+ };