x-next 0.0.0-alpha.14 → 0.0.0-alpha.16
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/_utils/config.d.ts +1 -1
- package/dist/_utils/is.d.ts +2 -0
- package/dist/_utils/vue-eco.d.ts +1 -1
- package/dist/components/button/index.d.ts +25 -25
- package/dist/icons/animation/animation-loading.d.ts +5 -1
- package/dist/index.d.ts +1 -181
- package/dist/index.es.js +186 -173
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/web-types.json +11 -0
- package/package.json +2 -2
- package/volar.d.ts +5 -0
package/dist/index.es.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
var Ye = Object.defineProperty;
|
2
2
|
var Ge = (e, t, n) => t in e ? Ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
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
|
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
5
|
const tt = "X", nt = "x", Fe = (e) => e ? nt + "-" + e : e || "", Y = (e) => tt + e, A = (e) => {
|
6
6
|
const t = Fe(e);
|
7
7
|
return {
|
@@ -17,30 +17,30 @@ function De(e) {
|
|
17
17
|
function ze(e) {
|
18
18
|
return G.call(e) === "[object Object]";
|
19
19
|
}
|
20
|
-
const Le = (e) => G.call(e) === "[object Promise]";
|
20
|
+
const Le = (e) => G.call(e) === "[object Promise]", lt = (e) => B(e) && e.constructor.name === "AsyncFunction", rt = (e) => Le(e) || lt(e);
|
21
21
|
function je(e) {
|
22
22
|
return G.call(e) === "[object String]";
|
23
23
|
}
|
24
|
-
function
|
24
|
+
function ot(e) {
|
25
25
|
return G.call(e) === "[object Number]" && e === e;
|
26
26
|
}
|
27
27
|
function B(e) {
|
28
28
|
return typeof e == "function";
|
29
29
|
}
|
30
|
-
function
|
30
|
+
function ne() {
|
31
31
|
return typeof window < "u";
|
32
32
|
}
|
33
|
-
const W = (e) => e,
|
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
34
|
var l, o;
|
35
35
|
const n = [];
|
36
36
|
for (const r of e ?? [])
|
37
|
-
|
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));
|
38
38
|
return n;
|
39
|
-
},
|
40
|
-
install
|
41
|
-
n.component(e, t);
|
39
|
+
}, dt = (e, t) => Object.assign(t, {
|
40
|
+
install(n) {
|
41
|
+
n.component(e) || n.component(e, t);
|
42
42
|
}
|
43
|
-
}),
|
43
|
+
}), ft = {
|
44
44
|
disabled: Boolean,
|
45
45
|
block: Boolean,
|
46
46
|
loading: Boolean,
|
@@ -80,21 +80,27 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
|
|
80
80
|
type: Boolean,
|
81
81
|
default: !0
|
82
82
|
}
|
83
|
-
},
|
84
|
-
name: "
|
83
|
+
}, mt = /* @__PURE__ */ z({
|
84
|
+
name: "AnimationLoading",
|
85
|
+
props: {
|
86
|
+
cls: String
|
87
|
+
},
|
85
88
|
render() {
|
86
89
|
return f("svg", {
|
87
|
-
viewBox: "0 0
|
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",
|
88
97
|
fill: "none",
|
89
|
-
|
90
|
-
}, [f("path", {
|
91
|
-
d: "M12.2674 15.793C11.9675 16.0787 11.4927 16.0672 11.2071 15.7673L6.20572 10.5168C5.9298 10.2271 5.9298 9.7719 6.20572 9.48223L11.2071 4.23177C11.4927 3.93184 11.9675 3.92031 12.2674 4.206C12.5673 4.49169 12.5789 4.96642 12.2932 5.26634L7.78458 9.99952L12.2932 14.7327C12.5789 15.0326 12.5673 15.5074 12.2674 15.793Z",
|
92
|
-
fill: "currentColor"
|
98
|
+
stroke: "currentColor"
|
93
99
|
}, null)]);
|
94
100
|
}
|
95
|
-
}),
|
96
|
-
name:
|
97
|
-
props:
|
101
|
+
}), gt = /* @__PURE__ */ z({
|
102
|
+
name: "Button",
|
103
|
+
props: ft,
|
98
104
|
emits: ["click"],
|
99
105
|
setup(e, {
|
100
106
|
slots: t,
|
@@ -109,15 +115,20 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
|
|
109
115
|
}, e.debounce));
|
110
116
|
}, s = k(() => e.loading || l.clicked || l.isDebounce), d = qe(), m = (i, a) => {
|
111
117
|
const c = i(a);
|
112
|
-
|
118
|
+
rt(c) && (l.clicked = !0, c.finally(() => {
|
113
119
|
l.clicked = !1;
|
114
120
|
}));
|
115
121
|
}, C = (i) => {
|
116
122
|
var c, p, b, $;
|
117
|
-
if ((p = (c = i.target).blur) == null || p.call(c), s.value) return;
|
123
|
+
if (i.stopPropagation(), (p = (c = i.target).blur) == null || p.call(c), s.value) return;
|
118
124
|
u();
|
119
125
|
const a = ($ = (b = d == null ? void 0 : d.vnode) == null ? void 0 : b.props) == null ? void 0 : $.onClick;
|
120
|
-
|
126
|
+
if (De(a))
|
127
|
+
a.forEach((le) => m(le, i));
|
128
|
+
else if (B(a)) {
|
129
|
+
m(a, i);
|
130
|
+
return;
|
131
|
+
}
|
121
132
|
};
|
122
133
|
return () => {
|
123
134
|
var i;
|
@@ -126,9 +137,13 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
|
|
126
137
|
type: "button",
|
127
138
|
disabled: e.disabled,
|
128
139
|
onClick: C
|
129
|
-
}, [
|
140
|
+
}, [f("span", {
|
141
|
+
style: {
|
142
|
+
width: s.value ? "16px" : "0px",
|
143
|
+
marginRight: s.value ? "4px" : "0px"
|
144
|
+
},
|
130
145
|
class: o.element("loading")
|
131
|
-
}, [f(
|
146
|
+
}, [f(mt, null, null)]), t.prefix && f("span", {
|
132
147
|
class: o.element("prefix")
|
133
148
|
}, [t.prefix()]), f("span", {
|
134
149
|
class: o.element("content")
|
@@ -137,22 +152,22 @@ const W = (e) => e, rt = (e) => !!(e && e.shapeFlag & 1), ot = (e, t) => !!(e &&
|
|
137
152
|
}, [t.suffix()])]);
|
138
153
|
};
|
139
154
|
}
|
140
|
-
}), K =
|
155
|
+
}), K = dt(Y("Button"), gt), we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
141
156
|
__proto__: null,
|
142
157
|
XButton: K
|
143
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
158
|
+
}, Symbol.toStringTag, { value: "Module" })), yt = ["px", "%", "vh", "vw", "calc"], Be = (e, t = "px") => {
|
144
159
|
if (e === void 0) return "";
|
145
160
|
const n = String(e);
|
146
|
-
return
|
147
|
-
},
|
148
|
-
class
|
161
|
+
return yt.some((l) => n.includes(l)) ? n : n + t;
|
162
|
+
}, ht = 1e3, vt = 3e3, Ct = 1;
|
163
|
+
class pt {
|
149
164
|
constructor() {
|
150
165
|
L(this, "popupStack", {
|
151
166
|
popup: /* @__PURE__ */ new Set(),
|
152
167
|
dialog: /* @__PURE__ */ new Set(),
|
153
168
|
message: /* @__PURE__ */ new Set()
|
154
169
|
});
|
155
|
-
L(this, "getNextZIndex", (t) => (t === "message" ? Array.from(this.popupStack.message).pop() ||
|
170
|
+
L(this, "getNextZIndex", (t) => (t === "message" ? Array.from(this.popupStack.message).pop() || vt : Array.from(this.popupStack.popup).pop() || ht) + Ct);
|
156
171
|
L(this, "add", (t) => {
|
157
172
|
const n = this.getNextZIndex(t);
|
158
173
|
return this.popupStack[t].add(n), t === "dialog" && this.popupStack.popup.add(n), n;
|
@@ -163,17 +178,17 @@ class vt {
|
|
163
178
|
L(this, "isLastDialog", (t) => this.popupStack.dialog.size > 1 ? t === Array.from(this.popupStack.dialog).pop() : !0);
|
164
179
|
}
|
165
180
|
}
|
166
|
-
const
|
167
|
-
function
|
181
|
+
const oe = new pt();
|
182
|
+
function de(e, {
|
168
183
|
visible: t,
|
169
184
|
runOnMounted: n
|
170
185
|
} = {}) {
|
171
186
|
const l = R(0), o = () => {
|
172
|
-
l.value =
|
187
|
+
l.value = oe.add(e);
|
173
188
|
}, r = () => {
|
174
|
-
|
175
|
-
}, u = () => e === "dialog" ?
|
176
|
-
return
|
189
|
+
oe.delete(l.value, e);
|
190
|
+
}, u = () => e === "dialog" ? oe.isLastDialog(l.value) : !1;
|
191
|
+
return ce(
|
177
192
|
() => t == null ? void 0 : t.value,
|
178
193
|
(s) => {
|
179
194
|
s ? o() : r();
|
@@ -181,7 +196,7 @@ function fe(e, {
|
|
181
196
|
{
|
182
197
|
immediate: !0
|
183
198
|
}
|
184
|
-
), n && (
|
199
|
+
), n && (ue(() => {
|
185
200
|
o();
|
186
201
|
}), Te(() => {
|
187
202
|
r();
|
@@ -193,17 +208,17 @@ function fe(e, {
|
|
193
208
|
};
|
194
209
|
}
|
195
210
|
const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t, n) => (n == null ? void 0 : n.toUpperCase()) ?? ""), Pe = () => {
|
196
|
-
},
|
197
|
-
if (
|
211
|
+
}, kt = (e, t) => {
|
212
|
+
if (ne)
|
198
213
|
return (t ?? document).querySelector(e) ?? void 0;
|
199
|
-
},
|
214
|
+
}, bt = (e) => {
|
200
215
|
if (e.tagName === "BODY")
|
201
216
|
return window.innerWidth - (document.documentElement.offsetWidth || document.body.offsetWidth);
|
202
217
|
const { borderLeftWidth: t, borderRightWidth: n } = window.getComputedStyle(e), l = Number(t.replace("px", "")) + Number(n.replace("px", ""));
|
203
218
|
return e.offsetWidth - (e.clientWidth + l);
|
204
|
-
},
|
219
|
+
}, wt = (e) => e.tagName === "BODY" ? document.documentElement.scrollHeight > window.innerHeight : e.scrollHeight > e.offsetHeight, Bt = (e, t) => {
|
205
220
|
var l;
|
206
|
-
if (!
|
221
|
+
if (!ne || !e || !t) return "";
|
207
222
|
let n = Ie(t);
|
208
223
|
n === "float" && (n = "cssFloat");
|
209
224
|
try {
|
@@ -224,17 +239,17 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
224
239
|
const l = Ie(t);
|
225
240
|
e.style[l] = n;
|
226
241
|
}
|
227
|
-
},
|
242
|
+
}, fe = (e, t) => {
|
228
243
|
if (je(e)) {
|
229
244
|
const n = e[0] === "#" ? `[id='${e.slice(1)}']` : e;
|
230
|
-
return
|
245
|
+
return kt(n, t);
|
231
246
|
}
|
232
247
|
return e;
|
233
|
-
},
|
248
|
+
}, St = ne ? (e, t, n, l = !1) => {
|
234
249
|
e.addEventListener(t, n, l);
|
235
|
-
} : Pe,
|
250
|
+
} : Pe, $t = ne ? (e, t, n, l = !1) => {
|
236
251
|
e.removeEventListener(t, n, l);
|
237
|
-
} : Pe,
|
252
|
+
} : Pe, Ot = (e, t) => {
|
238
253
|
let n = !1;
|
239
254
|
const l = {
|
240
255
|
overflow: "",
|
@@ -243,8 +258,8 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
243
258
|
if (e.value) {
|
244
259
|
const s = e.value;
|
245
260
|
if (!n && s.style.overflow !== "hidden") {
|
246
|
-
const d =
|
247
|
-
if (d > 0 ||
|
261
|
+
const d = bt(s);
|
262
|
+
if (d > 0 || wt(s)) {
|
248
263
|
l.overflow = s.style.overflow, l.width = s.style.width;
|
249
264
|
let m = 0;
|
250
265
|
o(s) && (m = s.getBoundingClientRect().left || 0), Z(s, {
|
@@ -263,18 +278,18 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
263
278
|
}), n = !1;
|
264
279
|
}
|
265
280
|
};
|
266
|
-
return
|
281
|
+
return ce(
|
267
282
|
() => t == null ? void 0 : t.value,
|
268
283
|
(s) => {
|
269
284
|
e.value && !o(e.value) && (s && Z(s, {
|
270
285
|
position: "absolute"
|
271
|
-
}),
|
286
|
+
}), Bt(e.value, "position") === "static" && Z(e.value, { position: "relative" }));
|
272
287
|
}
|
273
288
|
), {
|
274
289
|
setOverflowHidden: r,
|
275
290
|
resetOverflow: u
|
276
291
|
};
|
277
|
-
},
|
292
|
+
}, Et = {
|
278
293
|
ENTER: "Enter",
|
279
294
|
ESC: "Escape",
|
280
295
|
BACKSPACE: "Backspace",
|
@@ -284,7 +299,7 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
284
299
|
ARROW_DOWN: "ArrowDown",
|
285
300
|
ARROW_LEFT: "ArrowLeft",
|
286
301
|
ARROW_RIGHT: "ArrowRight"
|
287
|
-
},
|
302
|
+
}, Nt = {
|
288
303
|
renderTo: {
|
289
304
|
type: W([String, Object]),
|
290
305
|
default: "body"
|
@@ -370,29 +385,29 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
370
385
|
type: Boolean,
|
371
386
|
default: !1
|
372
387
|
}
|
373
|
-
},
|
388
|
+
}, Tt = ["width", "minWidth", "height", "minHeight"], Mt = z({
|
374
389
|
name: Y("Dialog"),
|
375
390
|
inheritAttrs: !1,
|
376
|
-
props:
|
391
|
+
props: Nt,
|
377
392
|
emits: ["closed", "close", "open", "opened", "update:modelValue"],
|
378
393
|
setup(e, { emit: t }) {
|
379
394
|
const n = A("dialog"), l = n.block, o = A("message-box"), r = o.block, u = k(() => [
|
380
395
|
l,
|
381
396
|
e.messageBox && "is-message-box",
|
382
397
|
e.popupClass && e.popupClass
|
383
|
-
]), s = k(() =>
|
398
|
+
]), s = k(() => fe(e.renderTo)), d = R(), m = k(() => e.disabled || !s.value), C = k(() => ({
|
384
399
|
zIndex: b.value
|
385
400
|
})), i = k(() => {
|
386
401
|
const h = {};
|
387
|
-
return e.fullscreen || (!e.center && e.top && (h.top = Be(e.top)),
|
402
|
+
return e.fullscreen || (!e.center && e.top && (h.top = Be(e.top)), Tt.forEach((T) => {
|
388
403
|
e[T] && (h[T] = Be(e[T]));
|
389
404
|
})), h;
|
390
|
-
}), a = R(!1), c = k(() => e.modelValue), p = k(() => c.value || a.value), { zIndex: b, isLastDialog: $ } =
|
405
|
+
}), a = R(!1), c = k(() => e.modelValue), p = k(() => c.value || a.value), { zIndex: b, isLastDialog: $ } = de("dialog", {
|
391
406
|
visible: c
|
392
|
-
}), { setOverflowHidden:
|
407
|
+
}), { setOverflowHidden: le, resetOverflow: Ce } = Ot(s, d), pe = (h, T) => {
|
393
408
|
t("update:modelValue", !1), t("close", e.messageBox ? h : void 0, e.messageBox ? T : void 0);
|
394
409
|
}, We = () => {
|
395
|
-
a.value = !1,
|
410
|
+
a.value = !1, Ce(), t("closed");
|
396
411
|
}, Ze = () => {
|
397
412
|
t("opened");
|
398
413
|
}, q = Ne({
|
@@ -402,32 +417,32 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
402
417
|
let J = !0;
|
403
418
|
if (q[h] = !0, B(e.onBeforeCancel) && (J = e.onBeforeCancel(h) ?? !1), Le(J)) {
|
404
419
|
J.then((Ke) => {
|
405
|
-
q[h] = !1, Ke &&
|
420
|
+
q[h] = !1, Ke && pe(h, T);
|
406
421
|
});
|
407
422
|
return;
|
408
423
|
}
|
409
|
-
q[h] = !1, J &&
|
410
|
-
},
|
424
|
+
q[h] = !1, J && pe(h, T);
|
425
|
+
}, Ue = () => {
|
411
426
|
e.maskToClose && e.mask && P("cancel");
|
412
|
-
},
|
427
|
+
}, xe = (h) => {
|
413
428
|
P("cancel", h);
|
414
429
|
}, Re = (h) => {
|
415
430
|
P("ok", h);
|
416
431
|
};
|
417
|
-
let
|
418
|
-
const
|
419
|
-
e.escToClose && h.key ===
|
420
|
-
},
|
421
|
-
e.escToClose && !
|
422
|
-
},
|
423
|
-
|
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);
|
424
439
|
};
|
425
440
|
return Te(() => {
|
426
|
-
|
427
|
-
}),
|
441
|
+
Ce(), be();
|
442
|
+
}), ce(
|
428
443
|
() => c.value,
|
429
444
|
(h) => {
|
430
|
-
h ? (t("open"),
|
445
|
+
h ? (t("open"), le(), a.value = !0, Xe()) : be();
|
431
446
|
},
|
432
447
|
{ immediate: !0 }
|
433
448
|
), {
|
@@ -446,8 +461,8 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
446
461
|
interceptClose: P,
|
447
462
|
afterLeave: We,
|
448
463
|
afterEnter: Ze,
|
449
|
-
handleMaskClick:
|
450
|
-
handleCancel:
|
464
|
+
handleMaskClick: Ue,
|
465
|
+
handleCancel: xe,
|
451
466
|
handleOk: Re,
|
452
467
|
loadingObj: q
|
453
468
|
};
|
@@ -458,27 +473,27 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
458
473
|
n[l] = o;
|
459
474
|
return n;
|
460
475
|
};
|
461
|
-
function
|
476
|
+
function At(e, t, n, l, o, r) {
|
462
477
|
return v(), O(Qe, {
|
463
478
|
to: e.teleportContainer,
|
464
479
|
disabled: e.teleportDisabled
|
465
480
|
}, [
|
466
|
-
!e.destroyOnClosed || e.mergeVisible ?
|
481
|
+
!e.destroyOnClosed || e.mergeVisible ? U((v(), S("div", {
|
467
482
|
key: 0,
|
468
483
|
ref: "dialogRef",
|
469
484
|
class: g(e.cls),
|
470
485
|
style: N(e.dialogStyle)
|
471
486
|
}, [
|
472
|
-
f(
|
487
|
+
f(_, {
|
473
488
|
name: "x-fade-in-standard",
|
474
489
|
appear: ""
|
475
490
|
}, {
|
476
|
-
default:
|
477
|
-
e.mask ?
|
491
|
+
default: ee(() => [
|
492
|
+
e.mask ? U((v(), S("div", {
|
478
493
|
key: 0,
|
479
494
|
class: g([e.cn.element("mask")])
|
480
495
|
}, null, 2)), [
|
481
|
-
[
|
496
|
+
[x, e.modelVisible]
|
482
497
|
]) : D("", !0)
|
483
498
|
]),
|
484
499
|
_: 1
|
@@ -487,14 +502,14 @@ function Tt(e, t, n, l, o, r) {
|
|
487
502
|
class: g([e.cn.element("wrapper"), { "is-center": e.center }]),
|
488
503
|
onClick: t[1] || (t[1] = Me((...u) => e.handleMaskClick && e.handleMaskClick(...u), ["self"]))
|
489
504
|
}, [
|
490
|
-
f(
|
505
|
+
f(_, {
|
491
506
|
name: "x-zoom-in",
|
492
507
|
appear: "",
|
493
508
|
onAfterEnter: e.afterEnter,
|
494
509
|
onAfterLeave: e.afterLeave
|
495
510
|
}, {
|
496
|
-
default:
|
497
|
-
|
511
|
+
default: ee(() => [
|
512
|
+
U(y("div", {
|
498
513
|
class: g([e.cn.element("container"), { "is-fullscreen": e.fullscreen }]),
|
499
514
|
style: N(e.containerStyle)
|
500
515
|
}, [
|
@@ -507,7 +522,7 @@ function Tt(e, t, n, l, o, r) {
|
|
507
522
|
j(e.$slots, "title", {}, () => [
|
508
523
|
y("div", {
|
509
524
|
class: g([e.cn.element("header-title")])
|
510
|
-
},
|
525
|
+
}, te(e.title), 3)
|
511
526
|
])
|
512
527
|
], 2),
|
513
528
|
y("div", {
|
@@ -530,18 +545,18 @@ function Tt(e, t, n, l, o, r) {
|
|
530
545
|
onClick: t[0] || (t[0] = (u) => e.interceptClose("cancel"))
|
531
546
|
}, null, 2)) : D("", !0)
|
532
547
|
], 6), [
|
533
|
-
[
|
548
|
+
[x, e.modelVisible]
|
534
549
|
])
|
535
550
|
]),
|
536
551
|
_: 3
|
537
552
|
}, 8, ["onAfterEnter", "onAfterLeave"])
|
538
553
|
], 2)
|
539
554
|
], 6)), [
|
540
|
-
[
|
555
|
+
[x, e.mergeVisible]
|
541
556
|
]) : D("", !0)
|
542
557
|
], 8, ["to", "disabled"]);
|
543
558
|
}
|
544
|
-
const Ve = /* @__PURE__ */ F(
|
559
|
+
const Ve = /* @__PURE__ */ F(Mt, [["render", At]]), He = /* @__PURE__ */ z({
|
545
560
|
name: Y("Space"),
|
546
561
|
props: {
|
547
562
|
direction: {
|
@@ -566,7 +581,7 @@ const Ve = /* @__PURE__ */ F(Nt, [["render", Tt]]), He = /* @__PURE__ */ z({
|
|
566
581
|
}) {
|
567
582
|
const n = A("space"), l = k(() => [n.block, n.element(e.direction), e.fill && "is-fill", n.element(`${e.direction}-${e.align}`)]);
|
568
583
|
function o(u) {
|
569
|
-
if (
|
584
|
+
if (ot(u))
|
570
585
|
return u;
|
571
586
|
switch (u) {
|
572
587
|
case "mini":
|
@@ -595,7 +610,7 @@ const Ve = /* @__PURE__ */ F(Nt, [["render", Tt]]), He = /* @__PURE__ */ z({
|
|
595
610
|
}, [u.map((d, m) => {
|
596
611
|
var i;
|
597
612
|
const C = t.split && m > 0;
|
598
|
-
return f(
|
613
|
+
return f(X, {
|
599
614
|
key: `space-item-${m}`
|
600
615
|
}, [C && f("div", {
|
601
616
|
className: n.element("split"),
|
@@ -639,7 +654,7 @@ const $e = A("dialog"), on = (e) => {
|
|
639
654
|
return f("div", {
|
640
655
|
class: $e.element("content")
|
641
656
|
}, [E(" "), e.content, E(" ")]);
|
642
|
-
}, s = () => () => f(
|
657
|
+
}, s = () => () => f(X, null, [e.title && r(e.title)]), d = () => () => f(X, null, [e.content && u(e.content)]), m = () => {
|
643
658
|
if (w(e.footer) || B(e.footer))
|
644
659
|
return e.footer;
|
645
660
|
const i = (e == null ? void 0 : e.cancelText) || "取消", a = (e == null ? void 0 : e.okText) || "确认";
|
@@ -689,14 +704,14 @@ const $e = A("dialog"), on = (e) => {
|
|
689
704
|
footer: m()
|
690
705
|
});
|
691
706
|
M(C, t);
|
692
|
-
},
|
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") => {
|
693
708
|
if (e === void 0) return "";
|
694
709
|
const n = typeof e == "number" ? `${e}` : e;
|
695
710
|
return ["px", "%", "vh", "vw", "calc"].some((o) => n.includes(o)) ? n : n + t;
|
696
711
|
};
|
697
712
|
function I(e) {
|
698
713
|
return z({
|
699
|
-
name: Fe(`Icon${
|
714
|
+
name: Fe(`Icon${Dt(e)}`),
|
700
715
|
props: {
|
701
716
|
size: {
|
702
717
|
type: [Number, String],
|
@@ -722,7 +737,7 @@ function I(e) {
|
|
722
737
|
setup(t) {
|
723
738
|
const n = "x-icon", l = k(() => {
|
724
739
|
const r = {};
|
725
|
-
return t.size && (r.fontSize =
|
740
|
+
return t.size && (r.fontSize = zt(t.size)), t.rotate && (r.transform = `rotate(${t.rotate}deg)`), t.color && (r.color = t.color), r;
|
726
741
|
});
|
727
742
|
return {
|
728
743
|
cls: k(() => [
|
@@ -736,8 +751,8 @@ function I(e) {
|
|
736
751
|
}
|
737
752
|
});
|
738
753
|
}
|
739
|
-
const
|
740
|
-
function
|
754
|
+
const Lt = I("close-circle-fill");
|
755
|
+
function jt(e, t, n, l, o, r) {
|
741
756
|
return v(), S("div", {
|
742
757
|
class: g(e.cls),
|
743
758
|
style: N(e.styles)
|
@@ -762,8 +777,8 @@ function zt(e, t, n, l, o, r) {
|
|
762
777
|
], -1)
|
763
778
|
]), 6);
|
764
779
|
}
|
765
|
-
const
|
766
|
-
function
|
780
|
+
const me = /* @__PURE__ */ F(Lt, [["render", jt]]), It = I("check-circle-fill");
|
781
|
+
function Pt(e, t, n, l, o, r) {
|
767
782
|
return v(), S("div", {
|
768
783
|
class: g(e.cls),
|
769
784
|
style: N(e.styles)
|
@@ -788,8 +803,8 @@ function jt(e, t, n, l, o, r) {
|
|
788
803
|
], -1)
|
789
804
|
]), 6);
|
790
805
|
}
|
791
|
-
const
|
792
|
-
function
|
806
|
+
const ge = /* @__PURE__ */ F(It, [["render", Pt]]), Vt = I("exclamation-circle-fill");
|
807
|
+
function Ht(e, t, n, l, o, r) {
|
793
808
|
return v(), S("div", {
|
794
809
|
class: g(e.cls),
|
795
810
|
style: N(e.styles)
|
@@ -814,8 +829,8 @@ function Pt(e, t, n, l, o, r) {
|
|
814
829
|
], -1)
|
815
830
|
]), 6);
|
816
831
|
}
|
817
|
-
const
|
818
|
-
function
|
832
|
+
const ye = /* @__PURE__ */ F(Vt, [["render", Ht]]), Wt = I("info-circle-fill");
|
833
|
+
function Zt(e, t, n, l, o, r) {
|
819
834
|
return v(), S("div", {
|
820
835
|
class: g(e.cls),
|
821
836
|
style: N(e.styles)
|
@@ -840,8 +855,8 @@ function Ht(e, t, n, l, o, r) {
|
|
840
855
|
], -1)
|
841
856
|
]), 6);
|
842
857
|
}
|
843
|
-
const
|
844
|
-
function
|
858
|
+
const he = /* @__PURE__ */ F(Wt, [["render", Zt]]), Ut = I("minus-circle-fill");
|
859
|
+
function xt(e, t, n, l, o, r) {
|
845
860
|
return v(), S("div", {
|
846
861
|
class: g(e.cls),
|
847
862
|
style: N(e.styles)
|
@@ -866,16 +881,16 @@ function Zt(e, t, n, l, o, r) {
|
|
866
881
|
], -1)
|
867
882
|
]), 6);
|
868
883
|
}
|
869
|
-
const
|
884
|
+
const ve = /* @__PURE__ */ F(Ut, [["render", xt]]);
|
870
885
|
I("animation-loading");
|
871
|
-
const
|
886
|
+
const Rt = z({
|
872
887
|
name: Y("Message"),
|
873
888
|
components: {
|
874
|
-
CloseCircleFill:
|
875
|
-
CheckCircleFill:
|
876
|
-
ExclamationCircleFill:
|
877
|
-
InfoCircleFill:
|
878
|
-
MinusCircleFill:
|
889
|
+
CloseCircleFill: me,
|
890
|
+
CheckCircleFill: ge,
|
891
|
+
ExclamationCircleFill: ye,
|
892
|
+
InfoCircleFill: he,
|
893
|
+
MinusCircleFill: ve
|
879
894
|
},
|
880
895
|
props: {
|
881
896
|
id: {
|
@@ -936,12 +951,12 @@ const Xt = z({
|
|
936
951
|
l.value = !1;
|
937
952
|
}, e.duration);
|
938
953
|
};
|
939
|
-
|
954
|
+
ue(() => {
|
940
955
|
l.value = !0, e.duration !== 0 && r();
|
941
956
|
}), Ae(() => {
|
942
957
|
clearTimeout(o);
|
943
958
|
});
|
944
|
-
const { zIndex: u } =
|
959
|
+
const { zIndex: u } = de("message", { runOnMounted: !0 }), s = k(() => ({
|
945
960
|
top: `${e.offset}px`,
|
946
961
|
zIndex: u.value
|
947
962
|
}));
|
@@ -955,16 +970,16 @@ const Xt = z({
|
|
955
970
|
}
|
956
971
|
};
|
957
972
|
}
|
958
|
-
}),
|
959
|
-
function
|
973
|
+
}), Xt = ["innerHTML"], Kt = { key: 1 };
|
974
|
+
function Yt(e, t, n, l, o, r) {
|
960
975
|
const u = V("CheckCircleFill"), s = V("ExclamationCircleFill"), d = V("MinusCircleFill"), m = V("CloseCircleFill"), C = V("InfoCircleFill");
|
961
|
-
return v(), O(
|
976
|
+
return v(), O(_, {
|
962
977
|
name: "x-message-slide-top",
|
963
978
|
onBeforeLeave: e.onClose,
|
964
979
|
onAfterLeave: t[1] || (t[1] = (i) => e.$emit("destroy"))
|
965
980
|
}, {
|
966
|
-
default:
|
967
|
-
|
981
|
+
default: ee(() => [
|
982
|
+
U(y("div", {
|
968
983
|
class: g(e.cls),
|
969
984
|
style: N(e.styles)
|
970
985
|
}, [
|
@@ -980,7 +995,7 @@ function xt(e, t, n, l, o, r) {
|
|
980
995
|
e.useHTML ? (v(), S("span", {
|
981
996
|
key: 0,
|
982
997
|
innerHTML: e.message
|
983
|
-
}, null, 8,
|
998
|
+
}, null, 8, Xt)) : (v(), S("span", Kt, te(e.message), 1)),
|
984
999
|
e.showClose ? (v(), S("span", {
|
985
1000
|
key: 2,
|
986
1001
|
class: g([e.cn.element("close-icon")]),
|
@@ -988,19 +1003,19 @@ function xt(e, t, n, l, o, r) {
|
|
988
1003
|
}, null, 2)) : D("", !0)
|
989
1004
|
])
|
990
1005
|
], 6), [
|
991
|
-
[
|
1006
|
+
[x, e.visible]
|
992
1007
|
])
|
993
1008
|
]),
|
994
1009
|
_: 3
|
995
1010
|
}, 8, ["onBeforeLeave"]);
|
996
1011
|
}
|
997
|
-
const
|
1012
|
+
const Gt = /* @__PURE__ */ F(Rt, [["render", Yt]]), se = /* @__PURE__ */ new WeakMap(), ae = (e) => {
|
998
1013
|
(typeof e == "string" || w(e)) && (e = {
|
999
1014
|
message: e
|
1000
1015
|
});
|
1001
|
-
const t =
|
1002
|
-
|
1003
|
-
const n =
|
1016
|
+
const t = fe(e.renderTo || "body");
|
1017
|
+
se.has(t) || se.set(t, []);
|
1018
|
+
const n = se.get(t);
|
1004
1019
|
let l = e.offset || 20;
|
1005
1020
|
n.forEach((i) => {
|
1006
1021
|
var a;
|
@@ -1022,7 +1037,7 @@ const Kt = /* @__PURE__ */ F(Xt, [["render", xt]]), ae = /* @__PURE__ */ new Wea
|
|
1022
1037
|
M(null, m);
|
1023
1038
|
}, offset: l };
|
1024
1039
|
const d = f(
|
1025
|
-
|
1040
|
+
Gt,
|
1026
1041
|
r,
|
1027
1042
|
B(r.message) || w(r.message) ? {
|
1028
1043
|
default: B(r.message) ? r.message : () => r.message
|
@@ -1033,23 +1048,23 @@ const Kt = /* @__PURE__ */ F(Xt, [["render", xt]]), ae = /* @__PURE__ */ new Wea
|
|
1033
1048
|
d.component.proxy.handleClose();
|
1034
1049
|
}
|
1035
1050
|
};
|
1036
|
-
},
|
1037
|
-
|
1038
|
-
|
1051
|
+
}, qt = () => {
|
1052
|
+
Ft.forEach((e) => {
|
1053
|
+
ae[e] = (t) => ze(t) ? ae({
|
1039
1054
|
type: e,
|
1040
1055
|
...t
|
1041
|
-
}) :
|
1056
|
+
}) : ae({
|
1042
1057
|
message: t,
|
1043
1058
|
type: e
|
1044
1059
|
});
|
1045
1060
|
});
|
1046
1061
|
};
|
1047
|
-
|
1048
|
-
const
|
1062
|
+
qt();
|
1063
|
+
const Jt = ["info", "success", "warning", "strong", "error"];
|
1049
1064
|
function Oe(e) {
|
1050
1065
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !w(e);
|
1051
1066
|
}
|
1052
|
-
const
|
1067
|
+
const ie = A("message-box"), Ee = (e) => {
|
1053
1068
|
const t = document.createElement("div"), n = () => {
|
1054
1069
|
M(null, t);
|
1055
1070
|
}, l = (a) => {
|
@@ -1063,38 +1078,38 @@ const ce = A("message-box"), Ee = (e) => {
|
|
1063
1078
|
let c;
|
1064
1079
|
switch (a) {
|
1065
1080
|
case "warning":
|
1066
|
-
c = f(
|
1081
|
+
c = f(ye, {
|
1067
1082
|
size: "22px",
|
1068
1083
|
color: "#f6c64b"
|
1069
1084
|
}, null);
|
1070
1085
|
break;
|
1071
1086
|
case "strong":
|
1072
|
-
c = f(
|
1087
|
+
c = f(ve, {
|
1073
1088
|
size: "22px",
|
1074
1089
|
color: "#ff7125"
|
1075
1090
|
}, null);
|
1076
1091
|
break;
|
1077
1092
|
case "error":
|
1078
|
-
c = f(
|
1093
|
+
c = f(me, {
|
1079
1094
|
size: "22px",
|
1080
1095
|
color: "#e24f48"
|
1081
1096
|
}, null);
|
1082
1097
|
break;
|
1083
1098
|
case "success":
|
1084
|
-
c = f(
|
1099
|
+
c = f(ge, {
|
1085
1100
|
size: "22px",
|
1086
1101
|
color: "#68d1ab"
|
1087
1102
|
}, null);
|
1088
1103
|
break;
|
1089
1104
|
case "info":
|
1090
|
-
c = f(
|
1105
|
+
c = f(he, {
|
1091
1106
|
size: "22px",
|
1092
1107
|
color: "#2355f5"
|
1093
1108
|
}, null);
|
1094
1109
|
break;
|
1095
1110
|
}
|
1096
1111
|
return f("div", {
|
1097
|
-
class:
|
1112
|
+
class: ie.element("icon")
|
1098
1113
|
}, [c]);
|
1099
1114
|
}, u = (a) => {
|
1100
1115
|
if (w(a)) return a;
|
@@ -1103,7 +1118,7 @@ const ce = A("message-box"), Ee = (e) => {
|
|
1103
1118
|
return w(c) ? c : null;
|
1104
1119
|
}
|
1105
1120
|
return f("div", {
|
1106
|
-
class:
|
1121
|
+
class: ie.element("title")
|
1107
1122
|
}, [E(" "), a, E(" ")]);
|
1108
1123
|
}, s = (a) => {
|
1109
1124
|
if (w(a)) return a;
|
@@ -1112,9 +1127,9 @@ const ce = A("message-box"), Ee = (e) => {
|
|
1112
1127
|
return w(c) ? c : null;
|
1113
1128
|
}
|
1114
1129
|
return f("div", {
|
1115
|
-
class:
|
1130
|
+
class: ie.element("content")
|
1116
1131
|
}, [E(" "), e.content, E(" ")]);
|
1117
|
-
}, d = () => () => f(
|
1132
|
+
}, d = () => () => f(X, null, [r(e.type || "success"), e.title && u(e.title)]), m = () => () => f(X, null, [e.content && s(e.content)]), C = () => {
|
1118
1133
|
if (w(e.footer) || B(e.footer))
|
1119
1134
|
return e.footer;
|
1120
1135
|
const a = (e == null ? void 0 : e.cancelText) || "取消", c = (e == null ? void 0 : e.okText) || "确认";
|
@@ -1165,8 +1180,8 @@ const ce = A("message-box"), Ee = (e) => {
|
|
1165
1180
|
footer: C()
|
1166
1181
|
});
|
1167
1182
|
M(i, t);
|
1168
|
-
},
|
1169
|
-
|
1183
|
+
}, Qt = () => {
|
1184
|
+
Jt.forEach((e) => {
|
1170
1185
|
Ee[e] = (t, n) => {
|
1171
1186
|
const l = [], o = [];
|
1172
1187
|
let r = () => !0, u = () => !0;
|
@@ -1195,8 +1210,8 @@ const ce = A("message-box"), Ee = (e) => {
|
|
1195
1210
|
};
|
1196
1211
|
});
|
1197
1212
|
};
|
1198
|
-
|
1199
|
-
const
|
1213
|
+
Qt();
|
1214
|
+
const _t = {
|
1200
1215
|
position: {
|
1201
1216
|
type: String,
|
1202
1217
|
default: "top-right"
|
@@ -1234,12 +1249,12 @@ const Jt = {
|
|
1234
1249
|
type: Boolean,
|
1235
1250
|
default: !1
|
1236
1251
|
}
|
1237
|
-
},
|
1252
|
+
}, en = z({
|
1238
1253
|
name: Y("Notification"),
|
1239
|
-
props:
|
1254
|
+
props: _t,
|
1240
1255
|
emits: ["close", "destroy"],
|
1241
1256
|
setup(e) {
|
1242
|
-
const t = A("notification"), n = t.block, l = k(() => [n, t.modifier(r.value.ver)]), { zIndex: o } =
|
1257
|
+
const t = A("notification"), n = t.block, l = k(() => [n, t.modifier(r.value.ver)]), { zIndex: o } = de("message", { runOnMounted: !0 }), r = k(() => {
|
1243
1258
|
const c = e.position.split("-");
|
1244
1259
|
return {
|
1245
1260
|
hor: c[1],
|
@@ -1254,10 +1269,10 @@ const Jt = {
|
|
1254
1269
|
setTimeout(() => {
|
1255
1270
|
d.value = !1;
|
1256
1271
|
}, e.duration);
|
1257
|
-
}, i = k(() => e.type === "info" ?
|
1272
|
+
}, i = k(() => e.type === "info" ? he : e.type === "warning" ? ye : e.type === "strong" ? ve : e.type === "success" ? ge : e.type === "error" ? me : ""), a = () => {
|
1258
1273
|
d.value = !1;
|
1259
1274
|
};
|
1260
|
-
return
|
1275
|
+
return ue(() => {
|
1261
1276
|
e.duration !== 0 && C(), d.value = !0;
|
1262
1277
|
}), Ae(() => {
|
1263
1278
|
clearTimeout(m);
|
@@ -1274,14 +1289,14 @@ const Jt = {
|
|
1274
1289
|
};
|
1275
1290
|
}
|
1276
1291
|
});
|
1277
|
-
function
|
1278
|
-
return v(), O(
|
1292
|
+
function tn(e, t, n, l, o, r) {
|
1293
|
+
return v(), O(_, {
|
1279
1294
|
name: e.animationClsName,
|
1280
1295
|
onBeforeLeave: t[1] || (t[1] = (u) => e.$emit("close")),
|
1281
1296
|
onAfterLeave: t[2] || (t[2] = (u) => e.$emit("destroy"))
|
1282
1297
|
}, {
|
1283
|
-
default:
|
1284
|
-
|
1298
|
+
default: ee(() => [
|
1299
|
+
U(y("div", {
|
1285
1300
|
class: g(e.cls),
|
1286
1301
|
style: N(e.positionStyle)
|
1287
1302
|
}, [
|
@@ -1296,12 +1311,12 @@ function _t(e, t, n, l, o, r) {
|
|
1296
1311
|
y("div", null, [
|
1297
1312
|
y("div", {
|
1298
1313
|
class: g([e.cn.element("title")])
|
1299
|
-
},
|
1314
|
+
}, te(e.title), 3),
|
1300
1315
|
y("div", {
|
1301
1316
|
class: g([e.cn.element("message")])
|
1302
1317
|
}, [
|
1303
1318
|
j(e.$slots, "default", {}, () => [
|
1304
|
-
E(
|
1319
|
+
E(te(e.message), 1)
|
1305
1320
|
])
|
1306
1321
|
], 2)
|
1307
1322
|
])
|
@@ -1312,14 +1327,14 @@ function _t(e, t, n, l, o, r) {
|
|
1312
1327
|
onClick: t[0] || (t[0] = Me((...u) => e.handleClose && e.handleClose(...u), ["self"]))
|
1313
1328
|
}, null, 2)) : D("", !0)
|
1314
1329
|
], 6), [
|
1315
|
-
[
|
1330
|
+
[x, e.visible]
|
1316
1331
|
])
|
1317
1332
|
]),
|
1318
1333
|
_: 3
|
1319
1334
|
}, 8, ["name"]);
|
1320
1335
|
}
|
1321
|
-
const
|
1322
|
-
const t =
|
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");
|
1323
1338
|
H.get(t) || H.set(t, {}), H.get(t)[e.position] || (H.get(t)[e.position] = []);
|
1324
1339
|
const l = H.get(t)[e.position];
|
1325
1340
|
let o = e.offset || 20;
|
@@ -1342,7 +1357,7 @@ const en = /* @__PURE__ */ F(Qt, [["render", _t]]), H = /* @__PURE__ */ new Weak
|
|
1342
1357
|
}, d = () => {
|
1343
1358
|
M(null, n);
|
1344
1359
|
}, m = f(
|
1345
|
-
|
1360
|
+
nn,
|
1346
1361
|
{
|
1347
1362
|
message: e.message,
|
1348
1363
|
title: e.title,
|
@@ -1360,21 +1375,19 @@ const en = /* @__PURE__ */ F(Qt, [["render", _t]]), H = /* @__PURE__ */ new Weak
|
|
1360
1375
|
} : null
|
1361
1376
|
);
|
1362
1377
|
M(m, n), l.push(m), t == null || t.appendChild(n.firstChild);
|
1363
|
-
},
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
}
|
1369
|
-
|
1370
|
-
install: tn
|
1378
|
+
}, an = {
|
1379
|
+
install: function(e) {
|
1380
|
+
Object.keys(we).forEach((t) => {
|
1381
|
+
const n = we[t];
|
1382
|
+
n.install && e.use(n);
|
1383
|
+
});
|
1384
|
+
}
|
1371
1385
|
};
|
1372
1386
|
export {
|
1373
1387
|
on as Dialog,
|
1374
|
-
|
1388
|
+
ae as Message,
|
1375
1389
|
Ee as MessageBox,
|
1376
1390
|
sn as Notification,
|
1377
1391
|
K as XButton,
|
1378
|
-
an as default
|
1379
|
-
tn as install
|
1392
|
+
an as default
|
1380
1393
|
};
|