x-next 0.0.0-alpha.16 → 0.0.0-alpha.17

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