@cghbcf/xp-ui 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +241 -2
- package/dist/cghbcf-xp-ui.cjs.js +5 -4
- package/dist/cghbcf-xp-ui.es.js +1386 -595
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/cghbcf-xp-ui.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
for (const [
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
},
|
|
1
|
+
import { ref as z, openBlock as a, createBlock as R, Transition as D, withCtx as E, createElementBlock as r, normalizeClass as B, createElementVNode as o, toDisplayString as k, renderSlot as b, createTextVNode as W, createCommentVNode as g, computed as M, normalizeStyle as T, onUnmounted as ie, Teleport as H, createVNode as A, withModifiers as j, Fragment as _, renderList as V, watch as re, onMounted as de, onBeforeUnmount as Q, nextTick as ue, inject as _e, provide as ke, reactive as $e, unref as ce, TransitionGroup as we } from "vue";
|
|
2
|
+
const C = (e, n) => {
|
|
3
|
+
const t = e.__vccOpts || e;
|
|
4
|
+
for (const [s, l] of n)
|
|
5
|
+
t[s] = l;
|
|
6
|
+
return t;
|
|
7
|
+
}, Ce = { class: "xp-alert__icon" }, Se = { class: "xp-alert__content" }, ze = { class: "xp-alert__title" }, Be = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "xp-alert__description"
|
|
10
|
-
},
|
|
10
|
+
}, Me = {
|
|
11
11
|
__name: "Alert",
|
|
12
12
|
props: {
|
|
13
13
|
title: {
|
|
@@ -34,54 +34,54 @@ const v = (e, t) => {
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
emits: ["close"],
|
|
37
|
-
setup(e, { emit:
|
|
38
|
-
const
|
|
37
|
+
setup(e, { emit: n }) {
|
|
38
|
+
const t = n, s = z(!0), l = {
|
|
39
39
|
success: "✓",
|
|
40
40
|
warning: "!",
|
|
41
41
|
danger: "×",
|
|
42
42
|
info: "i"
|
|
43
|
-
},
|
|
44
|
-
|
|
43
|
+
}, u = () => {
|
|
44
|
+
s.value = !1, t("close");
|
|
45
45
|
};
|
|
46
|
-
return (
|
|
47
|
-
default:
|
|
48
|
-
|
|
46
|
+
return (d, x) => (a(), R(D, { name: "xp-alert-fade" }, {
|
|
47
|
+
default: E(() => [
|
|
48
|
+
s.value ? (a(), r("div", {
|
|
49
49
|
key: 0,
|
|
50
|
-
class:
|
|
50
|
+
class: B(["xp-alert", [
|
|
51
51
|
`xp-alert--${e.type}`,
|
|
52
52
|
`xp-alert--${e.effect}`,
|
|
53
53
|
{ "xp-alert--plain": e.effect === "plain" }
|
|
54
54
|
]]),
|
|
55
55
|
role: "alert"
|
|
56
56
|
}, [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
b(
|
|
61
|
-
|
|
57
|
+
o("span", Ce, k(l[e.type]), 1),
|
|
58
|
+
o("div", Se, [
|
|
59
|
+
o("span", ze, [
|
|
60
|
+
b(d.$slots, "default", {}, () => [
|
|
61
|
+
W(k(e.title), 1)
|
|
62
62
|
], !0)
|
|
63
63
|
]),
|
|
64
|
-
|
|
65
|
-
b(
|
|
64
|
+
d.$slots.default ? (a(), r("p", Be, [
|
|
65
|
+
b(d.$slots, "default", {}, void 0, !0)
|
|
66
66
|
])) : g("", !0)
|
|
67
67
|
]),
|
|
68
|
-
e.closable ? (
|
|
68
|
+
e.closable ? (a(), r("i", {
|
|
69
69
|
key: 0,
|
|
70
70
|
class: "xp-alert__close-btn",
|
|
71
|
-
onClick:
|
|
71
|
+
onClick: u
|
|
72
72
|
}, "×")) : g("", !0)
|
|
73
73
|
], 2)) : g("", !0)
|
|
74
74
|
]),
|
|
75
75
|
_: 3
|
|
76
76
|
}));
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, Ie = /* @__PURE__ */ C(Me, [["__scopeId", "data-v-91d792bd"]]), Te = ["src", "alt"], Ve = {
|
|
79
79
|
key: 1,
|
|
80
80
|
class: "xp-avatar__slot"
|
|
81
|
-
},
|
|
81
|
+
}, Ee = {
|
|
82
82
|
key: 2,
|
|
83
83
|
class: "xp-avatar__text"
|
|
84
|
-
},
|
|
84
|
+
}, Ae = {
|
|
85
85
|
__name: "Avatar",
|
|
86
86
|
props: {
|
|
87
87
|
src: {
|
|
@@ -108,32 +108,32 @@ const v = (e, t) => {
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
emits: ["error"],
|
|
111
|
-
setup(e, { emit:
|
|
112
|
-
const
|
|
113
|
-
backgroundColor:
|
|
114
|
-
color:
|
|
115
|
-
})),
|
|
116
|
-
|
|
111
|
+
setup(e, { emit: n }) {
|
|
112
|
+
const t = e, s = n, l = z(!1), u = M(() => ({
|
|
113
|
+
backgroundColor: t.src ? "transparent" : "var(--xp-color-primary-bg)",
|
|
114
|
+
color: t.src ? void 0 : "var(--xp-color-primary)"
|
|
115
|
+
})), d = () => {
|
|
116
|
+
l.value = !0, s("error");
|
|
117
117
|
};
|
|
118
|
-
return (
|
|
119
|
-
class:
|
|
118
|
+
return (x, m) => (a(), r("span", {
|
|
119
|
+
class: B(["xp-avatar", [
|
|
120
120
|
`xp-avatar--${e.shape}`,
|
|
121
121
|
`xp-avatar--${e.size}`,
|
|
122
122
|
{ "xp-avatar--fit": e.src }
|
|
123
123
|
]]),
|
|
124
|
-
style:
|
|
124
|
+
style: T(u.value)
|
|
125
125
|
}, [
|
|
126
|
-
e.src && !
|
|
126
|
+
e.src && !l.value ? (a(), r("img", {
|
|
127
127
|
key: 0,
|
|
128
128
|
src: e.src,
|
|
129
129
|
alt: e.alt,
|
|
130
|
-
onError:
|
|
131
|
-
}, null, 40,
|
|
132
|
-
b(
|
|
133
|
-
])) : (
|
|
130
|
+
onError: d
|
|
131
|
+
}, null, 40, Te)) : x.$slots.default ? (a(), r("span", Ve, [
|
|
132
|
+
b(x.$slots, "default", {}, void 0, !0)
|
|
133
|
+
])) : (a(), r("span", Ee, k(e.alt || "A"), 1))
|
|
134
134
|
], 6));
|
|
135
135
|
}
|
|
136
|
-
},
|
|
136
|
+
}, De = /* @__PURE__ */ C(Ae, [["__scopeId", "data-v-a9a54bc5"]]), je = { key: 0 }, Ne = {
|
|
137
137
|
__name: "Badge",
|
|
138
138
|
props: {
|
|
139
139
|
value: {
|
|
@@ -159,32 +159,32 @@ const v = (e, t) => {
|
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
161
|
setup(e) {
|
|
162
|
-
const
|
|
163
|
-
return (
|
|
164
|
-
class:
|
|
162
|
+
const n = e, t = M(() => typeof n.value == "number" && n.value > n.max ? `${n.max}+` : n.value), s = M(() => n.value !== 0 && n.value !== "" && n.value !== null && n.value !== void 0);
|
|
163
|
+
return (l, u) => (a(), r("div", {
|
|
164
|
+
class: B(["xp-badge", { "xp-badge--dot": e.isDot, "xp-badge--hidden": e.hidden }])
|
|
165
165
|
}, [
|
|
166
|
-
b(
|
|
167
|
-
!e.hidden && (e.isDot ||
|
|
166
|
+
b(l.$slots, "default", {}, void 0, !0),
|
|
167
|
+
!e.hidden && (e.isDot || s.value) ? (a(), r("sup", {
|
|
168
168
|
key: 0,
|
|
169
|
-
class:
|
|
169
|
+
class: B(["xp-badge__content", [
|
|
170
170
|
`xp-badge__content--${e.type}`,
|
|
171
171
|
{ "xp-badge__content--dot": e.isDot }
|
|
172
172
|
]])
|
|
173
173
|
}, [
|
|
174
|
-
e.isDot ? g("", !0) : (
|
|
174
|
+
e.isDot ? g("", !0) : (a(), r("span", je, k(t.value), 1))
|
|
175
175
|
], 2)) : g("", !0)
|
|
176
176
|
], 2));
|
|
177
177
|
}
|
|
178
|
-
},
|
|
178
|
+
}, Fe = /* @__PURE__ */ C(Ne, [["__scopeId", "data-v-207db6dd"]]), Re = ["disabled"], Oe = {
|
|
179
179
|
key: 0,
|
|
180
180
|
class: "xp-button__loading"
|
|
181
|
-
},
|
|
181
|
+
}, Xe = { class: "xp-button__text" }, Le = {
|
|
182
182
|
__name: "Button",
|
|
183
183
|
props: {
|
|
184
184
|
type: {
|
|
185
185
|
type: String,
|
|
186
186
|
default: "default",
|
|
187
|
-
validator: (e) => ["primary", "default", "success", "warning", "danger", "info"].includes(e)
|
|
187
|
+
validator: (e) => ["primary", "default", "success", "warning", "danger", "info", "ghost"].includes(e)
|
|
188
188
|
},
|
|
189
189
|
size: {
|
|
190
190
|
type: String,
|
|
@@ -209,12 +209,12 @@ const v = (e, t) => {
|
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
emits: ["click"],
|
|
212
|
-
setup(e, { emit:
|
|
213
|
-
const
|
|
214
|
-
!
|
|
212
|
+
setup(e, { emit: n }) {
|
|
213
|
+
const t = e, s = n, l = (u) => {
|
|
214
|
+
!t.disabled && !t.loading && s("click", u);
|
|
215
215
|
};
|
|
216
|
-
return (
|
|
217
|
-
class:
|
|
216
|
+
return (u, d) => (a(), r("button", {
|
|
217
|
+
class: B(["xp-button", [
|
|
218
218
|
`xp-button--${e.type}`,
|
|
219
219
|
`xp-button--${e.size}`,
|
|
220
220
|
{
|
|
@@ -225,24 +225,24 @@ const v = (e, t) => {
|
|
|
225
225
|
}
|
|
226
226
|
]]),
|
|
227
227
|
disabled: e.disabled || e.loading,
|
|
228
|
-
onClick:
|
|
228
|
+
onClick: l
|
|
229
229
|
}, [
|
|
230
|
-
e.loading ? (
|
|
231
|
-
|
|
232
|
-
b(
|
|
230
|
+
e.loading ? (a(), r("span", Oe)) : g("", !0),
|
|
231
|
+
o("span", Xe, [
|
|
232
|
+
b(u.$slots, "default", {}, void 0, !0)
|
|
233
233
|
])
|
|
234
|
-
], 10,
|
|
234
|
+
], 10, Re));
|
|
235
235
|
}
|
|
236
|
-
},
|
|
236
|
+
}, K = /* @__PURE__ */ C(Le, [["__scopeId", "data-v-9c6bc634"]]), Pe = {
|
|
237
237
|
key: 0,
|
|
238
238
|
class: "xp-card__header"
|
|
239
|
-
},
|
|
239
|
+
}, We = { class: "xp-card__title" }, Je = {
|
|
240
240
|
key: 0,
|
|
241
241
|
class: "xp-card__extra"
|
|
242
|
-
},
|
|
242
|
+
}, He = { class: "xp-card__body" }, Ue = {
|
|
243
243
|
key: 1,
|
|
244
244
|
class: "xp-card__footer"
|
|
245
|
-
},
|
|
245
|
+
}, Ge = {
|
|
246
246
|
__name: "Card",
|
|
247
247
|
props: {
|
|
248
248
|
title: {
|
|
@@ -264,8 +264,8 @@ const v = (e, t) => {
|
|
|
264
264
|
}
|
|
265
265
|
},
|
|
266
266
|
setup(e) {
|
|
267
|
-
return (
|
|
268
|
-
class:
|
|
267
|
+
return (n, t) => (a(), r("div", {
|
|
268
|
+
class: B(["xp-card", [
|
|
269
269
|
`xp-card--${e.shadow}`,
|
|
270
270
|
{
|
|
271
271
|
"xp-card--bordered": e.bordered,
|
|
@@ -273,23 +273,23 @@ const v = (e, t) => {
|
|
|
273
273
|
}
|
|
274
274
|
]])
|
|
275
275
|
}, [
|
|
276
|
-
e.title ||
|
|
277
|
-
b(
|
|
278
|
-
|
|
276
|
+
e.title || n.$slots.header ? (a(), r("div", Pe, [
|
|
277
|
+
b(n.$slots, "header", {}, () => [
|
|
278
|
+
o("h3", We, k(e.title), 1)
|
|
279
279
|
], !0),
|
|
280
|
-
|
|
281
|
-
b(
|
|
280
|
+
n.$slots.extra ? (a(), r("div", Je, [
|
|
281
|
+
b(n.$slots, "extra", {}, void 0, !0)
|
|
282
282
|
])) : g("", !0)
|
|
283
283
|
])) : g("", !0),
|
|
284
|
-
|
|
285
|
-
b(
|
|
284
|
+
o("div", He, [
|
|
285
|
+
b(n.$slots, "default", {}, void 0, !0)
|
|
286
286
|
]),
|
|
287
|
-
|
|
288
|
-
b(
|
|
287
|
+
n.$slots.footer ? (a(), r("div", Ue, [
|
|
288
|
+
b(n.$slots, "footer", {}, void 0, !0)
|
|
289
289
|
])) : g("", !0)
|
|
290
290
|
], 2));
|
|
291
291
|
}
|
|
292
|
-
},
|
|
292
|
+
}, qe = /* @__PURE__ */ C(Ge, [["__scopeId", "data-v-e65cbe05"]]), Ye = { class: "xp-checkbox__input" }, Ke = ["checked", "disabled", ".indeterminate"], Ze = { class: "xp-checkbox__label" }, Qe = {
|
|
293
293
|
__name: "Checkbox",
|
|
294
294
|
props: {
|
|
295
295
|
modelValue: {
|
|
@@ -306,14 +306,14 @@ const v = (e, t) => {
|
|
|
306
306
|
}
|
|
307
307
|
},
|
|
308
308
|
emits: ["update:modelValue", "change"],
|
|
309
|
-
setup(e, { emit:
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
312
|
-
const
|
|
313
|
-
|
|
309
|
+
setup(e, { emit: n }) {
|
|
310
|
+
const t = e, s = n, l = (u) => {
|
|
311
|
+
if (t.disabled) return;
|
|
312
|
+
const d = u.target.checked;
|
|
313
|
+
s("update:modelValue", d), s("change", d);
|
|
314
314
|
};
|
|
315
|
-
return (
|
|
316
|
-
class:
|
|
315
|
+
return (u, d) => (a(), r("label", {
|
|
316
|
+
class: B(["xp-checkbox", [
|
|
317
317
|
{
|
|
318
318
|
"xp-checkbox--checked": e.modelValue,
|
|
319
319
|
"xp-checkbox--disabled": e.disabled,
|
|
@@ -321,26 +321,101 @@ const v = (e, t) => {
|
|
|
321
321
|
}
|
|
322
322
|
]])
|
|
323
323
|
}, [
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
o("span", Ye, [
|
|
325
|
+
d[0] || (d[0] = o("span", { class: "xp-checkbox__inner" }, null, -1)),
|
|
326
|
+
o("input", {
|
|
327
327
|
type: "checkbox",
|
|
328
328
|
class: "xp-checkbox__original",
|
|
329
329
|
checked: e.modelValue,
|
|
330
330
|
disabled: e.disabled,
|
|
331
|
-
onChange:
|
|
331
|
+
onChange: l,
|
|
332
332
|
".indeterminate": e.indeterminate
|
|
333
|
-
}, null, 40,
|
|
333
|
+
}, null, 40, Ke)
|
|
334
334
|
]),
|
|
335
|
-
|
|
336
|
-
b(
|
|
335
|
+
o("span", Ze, [
|
|
336
|
+
b(u.$slots, "default", {}, void 0, !0)
|
|
337
337
|
])
|
|
338
338
|
], 2));
|
|
339
339
|
}
|
|
340
|
-
},
|
|
340
|
+
}, et = /* @__PURE__ */ C(Qe, [["__scopeId", "data-v-7c078f46"]]), tt = {
|
|
341
|
+
key: 0,
|
|
342
|
+
class: "xp-menu__divider"
|
|
343
|
+
}, nt = ["disabled", "onClick"], ot = {
|
|
344
|
+
key: 0,
|
|
345
|
+
class: "xp-menu__icon",
|
|
346
|
+
"aria-hidden": "true"
|
|
347
|
+
}, st = { class: "xp-menu__label" }, lt = {
|
|
348
|
+
__name: "ContextMenu",
|
|
349
|
+
props: {
|
|
350
|
+
visible: { type: Boolean, default: !1 },
|
|
351
|
+
x: { type: Number, default: 0 },
|
|
352
|
+
y: { type: Number, default: 0 },
|
|
353
|
+
/**
|
|
354
|
+
* 菜单项:{ label, icon?, command?, danger?, disabled?, divider?, onClick? }
|
|
355
|
+
* divider 为 true 时渲染分隔线;select / command 事件与 onClick 三者按需使用
|
|
356
|
+
*/
|
|
357
|
+
items: { type: Array, default: () => [] }
|
|
358
|
+
},
|
|
359
|
+
emits: ["close", "select", "command"],
|
|
360
|
+
setup(e, { emit: n }) {
|
|
361
|
+
const t = e, s = n;
|
|
362
|
+
z(null);
|
|
363
|
+
const l = M(() => {
|
|
364
|
+
const f = Math.min(t.items.filter((h) => !h.divider).length, 12) * 32 + 12;
|
|
365
|
+
let i = t.x, c = t.y;
|
|
366
|
+
return i + 220 > window.innerWidth - 8 && (i = Math.max(8, window.innerWidth - 220 - 8)), c + f > window.innerHeight - 8 && (c = Math.max(8, window.innerHeight - f - 8)), { left: `${i}px`, top: `${c}px` };
|
|
367
|
+
});
|
|
368
|
+
function u() {
|
|
369
|
+
s("close");
|
|
370
|
+
}
|
|
371
|
+
function d(m) {
|
|
372
|
+
m.disabled || (s("close"), s("select", m), s("command", m.command), m.onClick && m.onClick());
|
|
373
|
+
}
|
|
374
|
+
function x(m) {
|
|
375
|
+
m.key === "Escape" && t.visible && s("close");
|
|
376
|
+
}
|
|
377
|
+
return ie(() => window.removeEventListener("keydown", x)), (m, f) => (a(), R(H, { to: "body" }, [
|
|
378
|
+
A(D, { name: "xp-menu" }, {
|
|
379
|
+
default: E(() => [
|
|
380
|
+
e.visible ? (a(), r("div", {
|
|
381
|
+
key: 0,
|
|
382
|
+
class: "xp-menu-mask",
|
|
383
|
+
onMousedown: u,
|
|
384
|
+
onContextmenu: f[2] || (f[2] = j(() => {
|
|
385
|
+
}, ["prevent"]))
|
|
386
|
+
}, [
|
|
387
|
+
o("div", {
|
|
388
|
+
class: "xp-menu",
|
|
389
|
+
style: T(l.value),
|
|
390
|
+
role: "menu",
|
|
391
|
+
onMousedown: f[0] || (f[0] = j(() => {
|
|
392
|
+
}, ["stop"])),
|
|
393
|
+
onMouseup: f[1] || (f[1] = j(() => {
|
|
394
|
+
}, ["stop"]))
|
|
395
|
+
}, [
|
|
396
|
+
(a(!0), r(_, null, V(e.items, (i, c) => (a(), r(_, { key: c }, [
|
|
397
|
+
i.divider ? (a(), r("div", tt)) : (a(), r("button", {
|
|
398
|
+
key: 1,
|
|
399
|
+
class: B(["xp-menu__item", { "xp-menu__item--danger": i.danger, "xp-menu__item--disabled": i.disabled }]),
|
|
400
|
+
role: "menuitem",
|
|
401
|
+
disabled: i.disabled,
|
|
402
|
+
onClick: (h) => d(i)
|
|
403
|
+
}, [
|
|
404
|
+
i.icon ? (a(), r("span", ot, k(i.icon), 1)) : g("", !0),
|
|
405
|
+
o("span", st, k(i.label), 1)
|
|
406
|
+
], 10, nt))
|
|
407
|
+
], 64))), 128))
|
|
408
|
+
], 36)
|
|
409
|
+
], 32)) : g("", !0)
|
|
410
|
+
]),
|
|
411
|
+
_: 1
|
|
412
|
+
})
|
|
413
|
+
]));
|
|
414
|
+
}
|
|
415
|
+
}, at = /* @__PURE__ */ C(lt, [["__scopeId", "data-v-7477a575"]]), it = { class: "xp-dialog__header" }, rt = { class: "xp-dialog__title" }, dt = { class: "xp-dialog__body" }, ut = {
|
|
341
416
|
key: 0,
|
|
342
417
|
class: "xp-dialog__footer"
|
|
343
|
-
},
|
|
418
|
+
}, ct = {
|
|
344
419
|
__name: "Dialog",
|
|
345
420
|
props: {
|
|
346
421
|
visible: {
|
|
@@ -373,59 +448,67 @@ const v = (e, t) => {
|
|
|
373
448
|
}
|
|
374
449
|
},
|
|
375
450
|
emits: ["confirm", "cancel", "update:visible", "close"],
|
|
376
|
-
setup(e, { emit:
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
}, s = () => {
|
|
380
|
-
a.closeOnClickModal && n();
|
|
381
|
-
}, o = () => {
|
|
382
|
-
l("confirm"), n();
|
|
451
|
+
setup(e, { emit: n }) {
|
|
452
|
+
const t = e, s = n, l = () => {
|
|
453
|
+
s("update:visible", !1), s("close");
|
|
383
454
|
}, u = () => {
|
|
384
|
-
l(
|
|
455
|
+
t.closeOnClickModal && l();
|
|
456
|
+
}, d = () => {
|
|
457
|
+
s("confirm"), l();
|
|
458
|
+
}, x = () => {
|
|
459
|
+
s("cancel"), l();
|
|
385
460
|
};
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
461
|
+
function m(f) {
|
|
462
|
+
f.key === "Escape" && t.visible && l();
|
|
463
|
+
}
|
|
464
|
+
return re(
|
|
465
|
+
() => t.visible,
|
|
466
|
+
(f) => {
|
|
467
|
+
f ? window.addEventListener("keydown", m) : window.removeEventListener("keydown", m);
|
|
468
|
+
}
|
|
469
|
+
), ie(() => window.removeEventListener("keydown", m)), (f, i) => (a(), R(H, { to: "body" }, [
|
|
470
|
+
A(D, { name: "xp-dialog-fade" }, {
|
|
471
|
+
default: E(() => [
|
|
472
|
+
e.visible ? (a(), r("div", {
|
|
390
473
|
key: 0,
|
|
391
474
|
class: "xp-dialog__wrapper",
|
|
392
|
-
onClick:
|
|
475
|
+
onClick: j(u, ["self"])
|
|
393
476
|
}, [
|
|
394
|
-
|
|
395
|
-
|
|
477
|
+
i[0] || (i[0] = o("div", { class: "xp-dialog__mask" }, null, -1)),
|
|
478
|
+
A(D, {
|
|
396
479
|
name: "xp-dialog-slide",
|
|
397
480
|
appear: ""
|
|
398
481
|
}, {
|
|
399
|
-
default:
|
|
400
|
-
e.visible ? (
|
|
482
|
+
default: E(() => [
|
|
483
|
+
e.visible ? (a(), r("div", {
|
|
401
484
|
key: 0,
|
|
402
485
|
class: "xp-dialog",
|
|
403
|
-
style:
|
|
486
|
+
style: T({ width: e.width })
|
|
404
487
|
}, [
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
488
|
+
o("div", it, [
|
|
489
|
+
o("h3", rt, k(e.title), 1),
|
|
490
|
+
o("button", {
|
|
408
491
|
class: "xp-dialog__close",
|
|
409
|
-
onClick:
|
|
492
|
+
onClick: l
|
|
410
493
|
}, "×")
|
|
411
494
|
]),
|
|
412
|
-
|
|
495
|
+
o("div", dt, [
|
|
413
496
|
b(f.$slots, "default", {}, void 0, !0)
|
|
414
497
|
]),
|
|
415
|
-
f.$slots.footer || e.showDefaultFooter ? (
|
|
498
|
+
f.$slots.footer || e.showDefaultFooter ? (a(), r("div", ut, [
|
|
416
499
|
b(f.$slots, "footer", {}, () => [
|
|
417
|
-
|
|
418
|
-
default:
|
|
419
|
-
|
|
500
|
+
A(K, { onClick: x }, {
|
|
501
|
+
default: E(() => [
|
|
502
|
+
W(k(e.cancelButtonText), 1)
|
|
420
503
|
]),
|
|
421
504
|
_: 1
|
|
422
505
|
}),
|
|
423
|
-
|
|
506
|
+
A(K, {
|
|
424
507
|
type: "primary",
|
|
425
|
-
onClick:
|
|
508
|
+
onClick: d
|
|
426
509
|
}, {
|
|
427
|
-
default:
|
|
428
|
-
|
|
510
|
+
default: E(() => [
|
|
511
|
+
W(k(e.confirmButtonText), 1)
|
|
429
512
|
]),
|
|
430
513
|
_: 1
|
|
431
514
|
})
|
|
@@ -441,10 +524,10 @@ const v = (e, t) => {
|
|
|
441
524
|
})
|
|
442
525
|
]));
|
|
443
526
|
}
|
|
444
|
-
},
|
|
527
|
+
}, pt = /* @__PURE__ */ C(ct, [["__scopeId", "data-v-f85c5a46"]]), ft = ["onClick"], mt = { key: 0 }, ht = {
|
|
445
528
|
key: 1,
|
|
446
529
|
class: "xp-dropdown__divider"
|
|
447
|
-
},
|
|
530
|
+
}, xt = {
|
|
448
531
|
__name: "Dropdown",
|
|
449
532
|
props: {
|
|
450
533
|
items: {
|
|
@@ -457,58 +540,58 @@ const v = (e, t) => {
|
|
|
457
540
|
}
|
|
458
541
|
},
|
|
459
542
|
emits: ["select", "command", "open", "close"],
|
|
460
|
-
setup(e, { emit:
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
if (!
|
|
464
|
-
const
|
|
465
|
-
let
|
|
466
|
-
I +
|
|
467
|
-
top: `${
|
|
543
|
+
setup(e, { emit: n }) {
|
|
544
|
+
const t = e, s = n, l = z(!1), u = z({}), d = z(null), x = z(null), m = () => {
|
|
545
|
+
ue(() => {
|
|
546
|
+
if (!d.value || !x.value) return;
|
|
547
|
+
const h = d.value.getBoundingClientRect(), $ = x.value.getBoundingClientRect();
|
|
548
|
+
let w = h.bottom + 6, I = h.left;
|
|
549
|
+
I + $.width > window.innerWidth - 10 && (I = window.innerWidth - $.width - 10), w + $.height > window.innerHeight - 10 && (w = h.top - $.height - 6), u.value = {
|
|
550
|
+
top: `${w + window.scrollY}px`,
|
|
468
551
|
left: `${I + window.scrollX}px`
|
|
469
552
|
};
|
|
470
553
|
});
|
|
471
|
-
},
|
|
472
|
-
|
|
473
|
-
},
|
|
474
|
-
|
|
475
|
-
},
|
|
476
|
-
var
|
|
477
|
-
|
|
554
|
+
}, f = () => {
|
|
555
|
+
t.disabled || (l.value = !l.value, l.value ? (m(), s("open")) : s("close"));
|
|
556
|
+
}, i = (h) => {
|
|
557
|
+
h.disabled || h.divider || (s("select", h), h.command !== void 0 && s("command", h.command, h), l.value = !1, s("close"));
|
|
558
|
+
}, c = (h) => {
|
|
559
|
+
var $;
|
|
560
|
+
l.value && d.value && !d.value.contains(h.target) && !(($ = x.value) != null && $.contains(h.target)) && (l.value = !1, s("close"));
|
|
478
561
|
};
|
|
479
|
-
return
|
|
480
|
-
document.addEventListener("click",
|
|
481
|
-
}),
|
|
482
|
-
document.removeEventListener("click",
|
|
483
|
-
}), (
|
|
562
|
+
return de(() => {
|
|
563
|
+
document.addEventListener("click", c);
|
|
564
|
+
}), Q(() => {
|
|
565
|
+
document.removeEventListener("click", c);
|
|
566
|
+
}), (h, $) => (a(), r("div", {
|
|
484
567
|
class: "xp-dropdown",
|
|
485
568
|
ref_key: "dropdownRef",
|
|
486
|
-
ref:
|
|
569
|
+
ref: d
|
|
487
570
|
}, [
|
|
488
|
-
|
|
571
|
+
o("div", {
|
|
489
572
|
class: "xp-dropdown__trigger",
|
|
490
|
-
onClick:
|
|
573
|
+
onClick: f
|
|
491
574
|
}, [
|
|
492
|
-
b(
|
|
575
|
+
b(h.$slots, "default", {}, void 0, !0)
|
|
493
576
|
]),
|
|
494
|
-
(
|
|
495
|
-
|
|
496
|
-
default:
|
|
497
|
-
|
|
577
|
+
(a(), R(H, { to: "body" }, [
|
|
578
|
+
A(D, { name: "xp-dropdown-fade" }, {
|
|
579
|
+
default: E(() => [
|
|
580
|
+
l.value ? (a(), r("div", {
|
|
498
581
|
key: 0,
|
|
499
582
|
class: "xp-dropdown__menu",
|
|
500
|
-
style:
|
|
583
|
+
style: T(u.value),
|
|
501
584
|
ref_key: "menuRef",
|
|
502
|
-
ref:
|
|
585
|
+
ref: x
|
|
503
586
|
}, [
|
|
504
|
-
(
|
|
587
|
+
(a(!0), r(_, null, V(e.items, (w, I) => (a(), r("div", {
|
|
505
588
|
key: I,
|
|
506
|
-
class:
|
|
507
|
-
onClick: (
|
|
589
|
+
class: B(["xp-dropdown__item", { "xp-dropdown__item--disabled": w.disabled, "xp-dropdown__item--divider": w.divider }]),
|
|
590
|
+
onClick: (te) => i(w)
|
|
508
591
|
}, [
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
], 10,
|
|
592
|
+
w.divider ? g("", !0) : (a(), r("span", mt, k(w.label), 1)),
|
|
593
|
+
w.divider ? (a(), r("span", ht)) : g("", !0)
|
|
594
|
+
], 10, ft))), 128))
|
|
512
595
|
], 4)) : g("", !0)
|
|
513
596
|
]),
|
|
514
597
|
_: 1
|
|
@@ -516,19 +599,386 @@ const v = (e, t) => {
|
|
|
516
599
|
]))
|
|
517
600
|
], 512));
|
|
518
601
|
}
|
|
519
|
-
},
|
|
602
|
+
}, vt = /* @__PURE__ */ C(xt, [["__scopeId", "data-v-ad741cd8"]]), gt = { class: "xp-empty" }, yt = { class: "xp-empty__title" }, bt = {
|
|
603
|
+
key: 0,
|
|
604
|
+
class: "xp-empty__hint"
|
|
605
|
+
}, _t = {
|
|
606
|
+
key: 1,
|
|
607
|
+
class: "xp-empty__action"
|
|
608
|
+
}, kt = {
|
|
609
|
+
__name: "Empty",
|
|
610
|
+
props: {
|
|
611
|
+
title: { type: String, default: "暂无内容" },
|
|
612
|
+
hint: { type: String, default: "" }
|
|
613
|
+
},
|
|
614
|
+
setup(e) {
|
|
615
|
+
return (n, t) => (a(), r("div", gt, [
|
|
616
|
+
b(n.$slots, "icon", {}, () => [
|
|
617
|
+
t[0] || (t[0] = o("div", {
|
|
618
|
+
class: "xp-empty__icon",
|
|
619
|
+
"aria-hidden": "true"
|
|
620
|
+
}, [
|
|
621
|
+
o("svg", {
|
|
622
|
+
width: "46",
|
|
623
|
+
height: "46",
|
|
624
|
+
viewBox: "0 0 24 24",
|
|
625
|
+
fill: "none"
|
|
626
|
+
}, [
|
|
627
|
+
o("path", {
|
|
628
|
+
d: "M4 7a2 2 0 0 1 2-2h4l2 2h6a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z",
|
|
629
|
+
stroke: "var(--xp-border-color)",
|
|
630
|
+
"stroke-width": "1.5",
|
|
631
|
+
"stroke-linejoin": "round"
|
|
632
|
+
})
|
|
633
|
+
])
|
|
634
|
+
], -1))
|
|
635
|
+
], !0),
|
|
636
|
+
o("p", yt, k(e.title), 1),
|
|
637
|
+
e.hint ? (a(), r("p", bt, k(e.hint), 1)) : g("", !0),
|
|
638
|
+
n.$slots.default ? (a(), r("div", _t, [
|
|
639
|
+
b(n.$slots, "default", {}, void 0, !0)
|
|
640
|
+
])) : g("", !0)
|
|
641
|
+
]));
|
|
642
|
+
}
|
|
643
|
+
}, $t = /* @__PURE__ */ C(kt, [["__scopeId", "data-v-93d5e1e9"]]), wt = ["width", "height"], Ct = {
|
|
644
|
+
__name: "FileIcon",
|
|
645
|
+
props: {
|
|
646
|
+
type: { type: String, default: "file" },
|
|
647
|
+
size: { type: Number, default: 20 }
|
|
648
|
+
},
|
|
649
|
+
setup(e) {
|
|
650
|
+
return (n, t) => (a(), r("span", {
|
|
651
|
+
class: "xp-file-icon",
|
|
652
|
+
style: T({ width: e.size + "px", height: e.size + "px" }),
|
|
653
|
+
"aria-hidden": "true"
|
|
654
|
+
}, [
|
|
655
|
+
(a(), r("svg", {
|
|
656
|
+
width: e.size,
|
|
657
|
+
height: e.size,
|
|
658
|
+
viewBox: "0 0 24 24",
|
|
659
|
+
fill: "none"
|
|
660
|
+
}, [
|
|
661
|
+
e.type === "folder" ? (a(), r(_, { key: 0 }, [
|
|
662
|
+
t[0] || (t[0] = o("path", {
|
|
663
|
+
d: "M3 6.5A2.5 2.5 0 0 1 5.5 4h4l2 2h7A2.5 2.5 0 0 1 21 8.5v9A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5z",
|
|
664
|
+
fill: "#E8B64E",
|
|
665
|
+
"fill-opacity": "0.9"
|
|
666
|
+
}, null, -1)),
|
|
667
|
+
t[1] || (t[1] = o("path", {
|
|
668
|
+
d: "M3 8.5h18v9A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5z",
|
|
669
|
+
fill: "#F3CE78"
|
|
670
|
+
}, null, -1))
|
|
671
|
+
], 64)) : e.type === "image" ? (a(), r(_, { key: 1 }, [
|
|
672
|
+
t[2] || (t[2] = o("rect", {
|
|
673
|
+
x: "3",
|
|
674
|
+
y: "4",
|
|
675
|
+
width: "18",
|
|
676
|
+
height: "16",
|
|
677
|
+
rx: "2.4",
|
|
678
|
+
fill: "#4FA8C9",
|
|
679
|
+
"fill-opacity": "0.16",
|
|
680
|
+
stroke: "#3D8EAD",
|
|
681
|
+
"stroke-width": "1.4"
|
|
682
|
+
}, null, -1)),
|
|
683
|
+
t[3] || (t[3] = o("circle", {
|
|
684
|
+
cx: "9",
|
|
685
|
+
cy: "10",
|
|
686
|
+
r: "1.8",
|
|
687
|
+
fill: "#3D8EAD"
|
|
688
|
+
}, null, -1)),
|
|
689
|
+
t[4] || (t[4] = o("path", {
|
|
690
|
+
d: "M4.4 17.4l4.6-4.4 3 2.8 3.2-3.2 4.4 4.2",
|
|
691
|
+
stroke: "#3D8EAD",
|
|
692
|
+
"stroke-width": "1.4",
|
|
693
|
+
"stroke-linecap": "round",
|
|
694
|
+
"stroke-linejoin": "round",
|
|
695
|
+
fill: "none"
|
|
696
|
+
}, null, -1))
|
|
697
|
+
], 64)) : e.type === "video" ? (a(), r(_, { key: 2 }, [
|
|
698
|
+
t[5] || (t[5] = o("rect", {
|
|
699
|
+
x: "3",
|
|
700
|
+
y: "5",
|
|
701
|
+
width: "13",
|
|
702
|
+
height: "14",
|
|
703
|
+
rx: "2.4",
|
|
704
|
+
fill: "#9B5FD1",
|
|
705
|
+
"fill-opacity": "0.14",
|
|
706
|
+
stroke: "#8A48C4",
|
|
707
|
+
"stroke-width": "1.4"
|
|
708
|
+
}, null, -1)),
|
|
709
|
+
t[6] || (t[6] = o("path", {
|
|
710
|
+
d: "M16 10.5l5-3v9l-5-3z",
|
|
711
|
+
fill: "#8A48C4"
|
|
712
|
+
}, null, -1))
|
|
713
|
+
], 64)) : e.type === "audio" ? (a(), r(_, { key: 3 }, [
|
|
714
|
+
t[7] || (t[7] = o("path", {
|
|
715
|
+
d: "M9 18V6l10-2v11",
|
|
716
|
+
stroke: "#C2569B",
|
|
717
|
+
"stroke-width": "1.6",
|
|
718
|
+
"stroke-linecap": "round",
|
|
719
|
+
"stroke-linejoin": "round",
|
|
720
|
+
fill: "none"
|
|
721
|
+
}, null, -1)),
|
|
722
|
+
t[8] || (t[8] = o("circle", {
|
|
723
|
+
cx: "6.6",
|
|
724
|
+
cy: "18",
|
|
725
|
+
r: "2.4",
|
|
726
|
+
fill: "#C2569B"
|
|
727
|
+
}, null, -1)),
|
|
728
|
+
t[9] || (t[9] = o("circle", {
|
|
729
|
+
cx: "16.6",
|
|
730
|
+
cy: "15",
|
|
731
|
+
r: "2.4",
|
|
732
|
+
fill: "#C2569B"
|
|
733
|
+
}, null, -1))
|
|
734
|
+
], 64)) : e.type === "pdf" ? (a(), r(_, { key: 4 }, [
|
|
735
|
+
t[10] || (t[10] = o("rect", {
|
|
736
|
+
x: "4",
|
|
737
|
+
y: "3",
|
|
738
|
+
width: "16",
|
|
739
|
+
height: "18",
|
|
740
|
+
rx: "2.4",
|
|
741
|
+
fill: "#D9504A",
|
|
742
|
+
"fill-opacity": "0.14",
|
|
743
|
+
stroke: "#C24842",
|
|
744
|
+
"stroke-width": "1.4"
|
|
745
|
+
}, null, -1)),
|
|
746
|
+
t[11] || (t[11] = o("text", {
|
|
747
|
+
x: "12",
|
|
748
|
+
y: "16.2",
|
|
749
|
+
"text-anchor": "middle",
|
|
750
|
+
"font-size": "9.5",
|
|
751
|
+
"font-weight": "700",
|
|
752
|
+
fill: "#C24842",
|
|
753
|
+
"font-family": "Arial, sans-serif"
|
|
754
|
+
}, "PDF", -1))
|
|
755
|
+
], 64)) : e.type === "doc" ? (a(), r(_, { key: 5 }, [
|
|
756
|
+
t[12] || (t[12] = o("path", {
|
|
757
|
+
d: "M5 3.5h9l5 5v12h-14z",
|
|
758
|
+
fill: "#3B7FD6",
|
|
759
|
+
"fill-opacity": "0.14",
|
|
760
|
+
stroke: "#2F6DC0",
|
|
761
|
+
"stroke-width": "1.4",
|
|
762
|
+
"stroke-linejoin": "round"
|
|
763
|
+
}, null, -1)),
|
|
764
|
+
t[13] || (t[13] = o("path", {
|
|
765
|
+
d: "M14 3.5v5h5",
|
|
766
|
+
fill: "none",
|
|
767
|
+
stroke: "#2F6DC0",
|
|
768
|
+
"stroke-width": "1.4",
|
|
769
|
+
"stroke-linejoin": "round"
|
|
770
|
+
}, null, -1)),
|
|
771
|
+
t[14] || (t[14] = o("path", {
|
|
772
|
+
d: "M7.5 12v5M7.5 14.5h3",
|
|
773
|
+
stroke: "#2F6DC0",
|
|
774
|
+
"stroke-width": "1.4",
|
|
775
|
+
"stroke-linecap": "round"
|
|
776
|
+
}, null, -1)),
|
|
777
|
+
t[15] || (t[15] = o("path", {
|
|
778
|
+
d: "M13.5 12h3M13.5 14.5h3M13.5 17h2",
|
|
779
|
+
stroke: "#2F6DC0",
|
|
780
|
+
"stroke-width": "1.4",
|
|
781
|
+
"stroke-linecap": "round"
|
|
782
|
+
}, null, -1))
|
|
783
|
+
], 64)) : e.type === "sheet" ? (a(), r(_, { key: 6 }, [
|
|
784
|
+
t[16] || (t[16] = o("rect", {
|
|
785
|
+
x: "4",
|
|
786
|
+
y: "3.5",
|
|
787
|
+
width: "16",
|
|
788
|
+
height: "17",
|
|
789
|
+
rx: "2.4",
|
|
790
|
+
fill: "#3E9C5E",
|
|
791
|
+
"fill-opacity": "0.14",
|
|
792
|
+
stroke: "#33854F",
|
|
793
|
+
"stroke-width": "1.4"
|
|
794
|
+
}, null, -1)),
|
|
795
|
+
t[17] || (t[17] = o("path", {
|
|
796
|
+
d: "M4 9h16M4 14h16M10 9v11.5M14.5 9v11.5",
|
|
797
|
+
stroke: "#33854F",
|
|
798
|
+
"stroke-width": "1.2",
|
|
799
|
+
"stroke-linecap": "round"
|
|
800
|
+
}, null, -1))
|
|
801
|
+
], 64)) : e.type === "slide" ? (a(), r(_, { key: 7 }, [
|
|
802
|
+
t[18] || (t[18] = o("rect", {
|
|
803
|
+
x: "3",
|
|
804
|
+
y: "5",
|
|
805
|
+
width: "18",
|
|
806
|
+
height: "12",
|
|
807
|
+
rx: "2.4",
|
|
808
|
+
fill: "#E09A2F",
|
|
809
|
+
"fill-opacity": "0.16",
|
|
810
|
+
stroke: "#CC8420",
|
|
811
|
+
"stroke-width": "1.4"
|
|
812
|
+
}, null, -1)),
|
|
813
|
+
t[19] || (t[19] = o("path", {
|
|
814
|
+
d: "M12 17v3M9.5 20h5",
|
|
815
|
+
stroke: "#CC8420",
|
|
816
|
+
"stroke-width": "1.4",
|
|
817
|
+
"stroke-linecap": "round"
|
|
818
|
+
}, null, -1)),
|
|
819
|
+
t[20] || (t[20] = o("circle", {
|
|
820
|
+
cx: "9",
|
|
821
|
+
cy: "10.4",
|
|
822
|
+
r: "1.3",
|
|
823
|
+
fill: "#CC8420"
|
|
824
|
+
}, null, -1)),
|
|
825
|
+
t[21] || (t[21] = o("path", {
|
|
826
|
+
d: "M6 14.4l2.8-2.8 2 1.8L14 9.6l4 4.4",
|
|
827
|
+
stroke: "#CC8420",
|
|
828
|
+
"stroke-width": "1.4",
|
|
829
|
+
"stroke-linecap": "round",
|
|
830
|
+
"stroke-linejoin": "round",
|
|
831
|
+
fill: "none"
|
|
832
|
+
}, null, -1))
|
|
833
|
+
], 64)) : e.type === "archive" ? (a(), r(_, { key: 8 }, [
|
|
834
|
+
t[22] || (t[22] = o("rect", {
|
|
835
|
+
x: "4",
|
|
836
|
+
y: "3.5",
|
|
837
|
+
width: "16",
|
|
838
|
+
height: "17",
|
|
839
|
+
rx: "2.4",
|
|
840
|
+
fill: "#A97D4E",
|
|
841
|
+
"fill-opacity": "0.16",
|
|
842
|
+
stroke: "#8F6539",
|
|
843
|
+
"stroke-width": "1.4"
|
|
844
|
+
}, null, -1)),
|
|
845
|
+
t[23] || (t[23] = o("path", {
|
|
846
|
+
d: "M9.5 4v16M14.5 4v16M4 12h16",
|
|
847
|
+
stroke: "#8F6539",
|
|
848
|
+
"stroke-width": "1.3"
|
|
849
|
+
}, null, -1))
|
|
850
|
+
], 64)) : e.type === "code" ? (a(), r(_, { key: 9 }, [
|
|
851
|
+
t[24] || (t[24] = o("path", {
|
|
852
|
+
d: "M8.5 8l-4.5 4 4.5 4M15.5 8l4.5 4-4.5 4",
|
|
853
|
+
stroke: "#6B62E0",
|
|
854
|
+
"stroke-width": "1.7",
|
|
855
|
+
"stroke-linecap": "round",
|
|
856
|
+
"stroke-linejoin": "round",
|
|
857
|
+
fill: "none"
|
|
858
|
+
}, null, -1)),
|
|
859
|
+
t[25] || (t[25] = o("path", {
|
|
860
|
+
d: "M13.6 5.8l-3.2 12.4",
|
|
861
|
+
stroke: "#6B62E0",
|
|
862
|
+
"stroke-width": "1.5",
|
|
863
|
+
"stroke-linecap": "round"
|
|
864
|
+
}, null, -1))
|
|
865
|
+
], 64)) : e.type === "text" ? (a(), r(_, { key: 10 }, [
|
|
866
|
+
t[26] || (t[26] = o("path", {
|
|
867
|
+
d: "M4 6.2C4 5 4.9 4 6.5 4h11C19 4 20 5 20 6.2v11.6C20 19 19 20 17.5 20h-11C4.9 20 4 19 4 17.8z",
|
|
868
|
+
fill: "#7D8894",
|
|
869
|
+
"fill-opacity": "0.12",
|
|
870
|
+
stroke: "#5F6B78",
|
|
871
|
+
"stroke-width": "1.4"
|
|
872
|
+
}, null, -1)),
|
|
873
|
+
t[27] || (t[27] = o("path", {
|
|
874
|
+
d: "M7.5 8.5h9M7.5 12h6.5",
|
|
875
|
+
stroke: "#5F6B78",
|
|
876
|
+
"stroke-width": "1.5",
|
|
877
|
+
"stroke-linecap": "round"
|
|
878
|
+
}, null, -1))
|
|
879
|
+
], 64)) : (a(), r(_, { key: 11 }, [
|
|
880
|
+
t[28] || (t[28] = o("path", {
|
|
881
|
+
d: "M6 3.5h8l5 5v12h-13z",
|
|
882
|
+
fill: "#A2AAB4",
|
|
883
|
+
"fill-opacity": "0.16",
|
|
884
|
+
stroke: "#7C8590",
|
|
885
|
+
"stroke-width": "1.4",
|
|
886
|
+
"stroke-linejoin": "round"
|
|
887
|
+
}, null, -1)),
|
|
888
|
+
t[29] || (t[29] = o("path", {
|
|
889
|
+
d: "M14 3.5v5h5",
|
|
890
|
+
fill: "none",
|
|
891
|
+
stroke: "#7C8590",
|
|
892
|
+
"stroke-width": "1.4",
|
|
893
|
+
"stroke-linejoin": "round"
|
|
894
|
+
}, null, -1)),
|
|
895
|
+
t[30] || (t[30] = o("path", {
|
|
896
|
+
d: "M8 12.5h8M8 15.5h8M8 18.5h5",
|
|
897
|
+
stroke: "#7C8590",
|
|
898
|
+
"stroke-width": "1.3",
|
|
899
|
+
"stroke-linecap": "round"
|
|
900
|
+
}, null, -1))
|
|
901
|
+
], 64))
|
|
902
|
+
], 8, wt))
|
|
903
|
+
], 4));
|
|
904
|
+
}
|
|
905
|
+
}, St = /* @__PURE__ */ C(Ct, [["__scopeId", "data-v-c598c294"]]), zt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M330.666667 512c0-14.933333 4.266667-29.866667 14.933333-40.533333l234.666667-277.33333399c23.466667-27.733333 64-29.866667 89.6-8.53333301 27.733333 23.466667 29.866667 64 8.53333299 89.6L477.866667 512l200.53333299 236.8c23.466667 27.733333 19.19999999 68.266667-8.53333299 89.6-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333301l-234.666667-277.33333399c-10.666667-10.666667-14.933333-25.6-14.933333-40.533333z" /></svg>', Bt = ["viewBox", "innerHTML"], Mt = {
|
|
906
|
+
key: 2,
|
|
907
|
+
class: "xp-icon__fallback"
|
|
908
|
+
}, It = {
|
|
909
|
+
__name: "Icon",
|
|
910
|
+
props: {
|
|
911
|
+
name: {
|
|
912
|
+
type: String,
|
|
913
|
+
default: ""
|
|
914
|
+
},
|
|
915
|
+
size: {
|
|
916
|
+
type: [String, Number],
|
|
917
|
+
default: "medium"
|
|
918
|
+
},
|
|
919
|
+
color: {
|
|
920
|
+
type: String,
|
|
921
|
+
default: ""
|
|
922
|
+
},
|
|
923
|
+
spin: {
|
|
924
|
+
type: Boolean,
|
|
925
|
+
default: !1
|
|
926
|
+
},
|
|
927
|
+
rotate: {
|
|
928
|
+
type: Number,
|
|
929
|
+
default: 0
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
setup(e) {
|
|
933
|
+
const n = ["small", "medium", "large"], t = e, s = /* @__PURE__ */ Object.assign({ "./icons/jiantou.svg": zt }), l = (i) => i && i.replace(/\bfill\s*=\s*["'](?!none["'])[^"']+["']/gi, 'fill="currentColor"').replace(/\bstroke\s*=\s*["'](?!none["'])[^"']+["']/gi, 'stroke="currentColor"'), u = M(() => {
|
|
934
|
+
if (!t.name) return null;
|
|
935
|
+
const i = `./icons/${t.name}.svg`, c = s[i];
|
|
936
|
+
if (!c) return null;
|
|
937
|
+
const h = c.match(/<svg[^>]*>([\s\S]*)<\/svg>/i), $ = l(h ? h[1] : c), w = c.match(/viewBox\s*=\s*["']([^"']+)["']/i);
|
|
938
|
+
return {
|
|
939
|
+
inner: $,
|
|
940
|
+
viewBox: w ? w[1] : "0 0 24 24"
|
|
941
|
+
};
|
|
942
|
+
}), d = M(() => n.includes(String(t.size))), x = M(() => {
|
|
943
|
+
if (d.value) return null;
|
|
944
|
+
const i = t.size;
|
|
945
|
+
return typeof i == "number" ? `${i}px` : typeof i == "string" && i.trim() ? /^\d+(\.\d+)?$/.test(i.trim()) ? `${i}px` : i.trim() : null;
|
|
946
|
+
}), m = M(() => {
|
|
947
|
+
const i = [];
|
|
948
|
+
return d.value && i.push(`xp-icon--${t.size}`), t.spin && i.push("xp-icon--spin"), i;
|
|
949
|
+
}), f = M(() => {
|
|
950
|
+
const i = {};
|
|
951
|
+
return t.color && (i.color = t.color), t.rotate && (i.transform = `rotate(${t.rotate}deg)`), x.value && (i.width = x.value, i.height = x.value, i.fontSize = x.value), i;
|
|
952
|
+
});
|
|
953
|
+
return (i, c) => (a(), r("i", {
|
|
954
|
+
class: B(["xp-icon", m.value]),
|
|
955
|
+
style: T(f.value)
|
|
956
|
+
}, [
|
|
957
|
+
i.$slots.default ? b(i.$slots, "default", { key: 0 }, void 0, !0) : u.value ? (a(), r("svg", {
|
|
958
|
+
key: 1,
|
|
959
|
+
viewBox: u.value.viewBox,
|
|
960
|
+
innerHTML: u.value.inner
|
|
961
|
+
}, null, 8, Bt)) : (a(), r("span", Mt, "?"))
|
|
962
|
+
], 6));
|
|
963
|
+
}
|
|
964
|
+
}, Tt = /* @__PURE__ */ C(It, [["__scopeId", "data-v-14319319"]]), Vt = {
|
|
520
965
|
key: 0,
|
|
521
966
|
class: "xp-input__prefix"
|
|
522
|
-
},
|
|
967
|
+
}, Et = ["id", "type", "value", "placeholder", "disabled", "maxlength"], At = {
|
|
523
968
|
key: 2,
|
|
524
969
|
class: "xp-input__suffix"
|
|
525
|
-
},
|
|
970
|
+
}, Dt = {
|
|
526
971
|
__name: "Input",
|
|
527
972
|
props: {
|
|
528
973
|
modelValue: {
|
|
529
974
|
type: [String, Number],
|
|
530
975
|
default: ""
|
|
531
976
|
},
|
|
977
|
+
/** 原生 input 的 id,用于配合 label[for] 聚焦 */
|
|
978
|
+
id: {
|
|
979
|
+
type: String,
|
|
980
|
+
default: ""
|
|
981
|
+
},
|
|
532
982
|
type: {
|
|
533
983
|
type: String,
|
|
534
984
|
default: "text",
|
|
@@ -557,57 +1007,62 @@ const v = (e, t) => {
|
|
|
557
1007
|
}
|
|
558
1008
|
},
|
|
559
1009
|
emits: ["update:modelValue", "focus", "blur", "clear"],
|
|
560
|
-
setup(e, { emit: t }) {
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
},
|
|
564
|
-
|
|
565
|
-
},
|
|
566
|
-
|
|
1010
|
+
setup(e, { expose: n, emit: t }) {
|
|
1011
|
+
const s = t, l = z(null), u = z(!1), d = (i) => {
|
|
1012
|
+
s("update:modelValue", i.target.value);
|
|
1013
|
+
}, x = (i) => {
|
|
1014
|
+
u.value = !0, s("focus", i);
|
|
1015
|
+
}, m = (i) => {
|
|
1016
|
+
u.value = !1, s("blur", i);
|
|
567
1017
|
}, f = () => {
|
|
568
|
-
|
|
1018
|
+
s("update:modelValue", ""), s("clear"), l.value && l.value.focus();
|
|
569
1019
|
};
|
|
570
|
-
return (
|
|
571
|
-
|
|
1020
|
+
return n({
|
|
1021
|
+
focus: () => l.value && l.value.focus(),
|
|
1022
|
+
select: () => l.value && l.value.select(),
|
|
1023
|
+
blur: () => l.value && l.value.blur()
|
|
1024
|
+
}), (i, c) => (a(), r("div", {
|
|
1025
|
+
class: B(["xp-input", [
|
|
572
1026
|
`xp-input--${e.size}`,
|
|
573
1027
|
{
|
|
574
1028
|
"xp-input--disabled": e.disabled,
|
|
575
|
-
"xp-input--prefix":
|
|
576
|
-
"xp-input--suffix":
|
|
577
|
-
"xp-input--focus":
|
|
1029
|
+
"xp-input--prefix": i.$slots.prefix,
|
|
1030
|
+
"xp-input--suffix": i.$slots.suffix || e.showClear,
|
|
1031
|
+
"xp-input--focus": u.value
|
|
578
1032
|
}
|
|
579
1033
|
]])
|
|
580
1034
|
}, [
|
|
581
|
-
|
|
582
|
-
b(
|
|
1035
|
+
i.$slots.prefix ? (a(), r("span", Vt, [
|
|
1036
|
+
b(i.$slots, "prefix", {}, void 0, !0)
|
|
583
1037
|
])) : g("", !0),
|
|
584
|
-
|
|
1038
|
+
o("input", {
|
|
585
1039
|
ref_key: "inputRef",
|
|
586
1040
|
ref: l,
|
|
587
1041
|
class: "xp-input__inner",
|
|
1042
|
+
id: e.id || void 0,
|
|
588
1043
|
type: e.type,
|
|
589
1044
|
value: e.modelValue,
|
|
590
1045
|
placeholder: e.placeholder,
|
|
591
1046
|
disabled: e.disabled,
|
|
592
1047
|
maxlength: e.maxlength,
|
|
593
|
-
onInput:
|
|
594
|
-
onFocus:
|
|
595
|
-
onBlur:
|
|
596
|
-
}, null, 40,
|
|
597
|
-
e.showClear && e.modelValue && !e.disabled ? (
|
|
1048
|
+
onInput: d,
|
|
1049
|
+
onFocus: x,
|
|
1050
|
+
onBlur: m
|
|
1051
|
+
}, null, 40, Et),
|
|
1052
|
+
e.showClear && e.modelValue && !e.disabled ? (a(), r("span", {
|
|
598
1053
|
key: 1,
|
|
599
1054
|
class: "xp-input__clear",
|
|
600
1055
|
onClick: f
|
|
601
1056
|
}, "×")) : g("", !0),
|
|
602
|
-
|
|
603
|
-
b(
|
|
1057
|
+
i.$slots.suffix && !e.showClear ? (a(), r("span", At, [
|
|
1058
|
+
b(i.$slots, "suffix", {}, void 0, !0)
|
|
604
1059
|
])) : g("", !0)
|
|
605
1060
|
], 2));
|
|
606
1061
|
}
|
|
607
|
-
},
|
|
1062
|
+
}, jt = /* @__PURE__ */ C(Dt, [["__scopeId", "data-v-46247483"]]), Nt = {
|
|
608
1063
|
key: 0,
|
|
609
1064
|
class: "xp-progress__text"
|
|
610
|
-
},
|
|
1065
|
+
}, Ft = {
|
|
611
1066
|
__name: "Progress",
|
|
612
1067
|
props: {
|
|
613
1068
|
percentage: {
|
|
@@ -632,27 +1087,37 @@ const v = (e, t) => {
|
|
|
632
1087
|
type: String,
|
|
633
1088
|
default: "",
|
|
634
1089
|
validator: (e) => ["", "success", "warning", "exception"].includes(e)
|
|
1090
|
+
},
|
|
1091
|
+
/** line 模式下进度条轨道/内条高度(px),用于紧凑场景 */
|
|
1092
|
+
strokeWidth: {
|
|
1093
|
+
type: Number,
|
|
1094
|
+
default: 8
|
|
635
1095
|
}
|
|
636
1096
|
},
|
|
637
1097
|
setup(e) {
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
|
|
1098
|
+
const n = e, t = M(
|
|
1099
|
+
() => n.type === "line" ? { height: `${n.strokeWidth}px` } : {}
|
|
1100
|
+
), s = M(() => n.color ? n.color : n.status === "success" ? "var(--xp-color-success)" : n.status === "warning" ? "var(--xp-color-warning)" : n.status === "exception" ? "var(--xp-color-danger)" : "var(--xp-color-primary)");
|
|
1101
|
+
return (l, u) => (a(), r("div", {
|
|
1102
|
+
class: B(["xp-progress", [`xp-progress--${e.type}`]])
|
|
641
1103
|
}, [
|
|
642
|
-
|
|
643
|
-
|
|
1104
|
+
o("div", {
|
|
1105
|
+
class: "xp-progress__bar",
|
|
1106
|
+
style: T(t.value)
|
|
1107
|
+
}, [
|
|
1108
|
+
o("div", {
|
|
644
1109
|
class: "xp-progress__inner",
|
|
645
|
-
style:
|
|
1110
|
+
style: T({ width: `${e.percentage}%`, backgroundColor: s.value })
|
|
646
1111
|
}, null, 4)
|
|
647
|
-
]),
|
|
648
|
-
e.showText ? (
|
|
1112
|
+
], 4),
|
|
1113
|
+
e.showText ? (a(), r("span", Nt, [
|
|
649
1114
|
b(l.$slots, "default", {}, () => [
|
|
650
|
-
|
|
1115
|
+
W(k(e.percentage) + "%", 1)
|
|
651
1116
|
], !0)
|
|
652
1117
|
])) : g("", !0)
|
|
653
1118
|
], 2));
|
|
654
1119
|
}
|
|
655
|
-
},
|
|
1120
|
+
}, Rt = /* @__PURE__ */ C(Ft, [["__scopeId", "data-v-244dca2c"]]), Ot = { class: "xp-radio__input" }, Xt = ["checked", "disabled"], Lt = { class: "xp-radio__label" }, Pt = {
|
|
656
1121
|
__name: "Radio",
|
|
657
1122
|
props: {
|
|
658
1123
|
modelValue: {
|
|
@@ -669,37 +1134,37 @@ const v = (e, t) => {
|
|
|
669
1134
|
}
|
|
670
1135
|
},
|
|
671
1136
|
emits: ["update:modelValue", "change"],
|
|
672
|
-
setup(e, { emit:
|
|
673
|
-
const
|
|
674
|
-
|
|
1137
|
+
setup(e, { emit: n }) {
|
|
1138
|
+
const t = e, s = n, l = () => {
|
|
1139
|
+
t.disabled || (s("update:modelValue", t.value), s("change", t.value));
|
|
675
1140
|
};
|
|
676
|
-
return (
|
|
677
|
-
class:
|
|
1141
|
+
return (u, d) => (a(), r("label", {
|
|
1142
|
+
class: B(["xp-radio", [
|
|
678
1143
|
{
|
|
679
1144
|
"xp-radio--checked": e.modelValue === e.value,
|
|
680
1145
|
"xp-radio--disabled": e.disabled
|
|
681
1146
|
}
|
|
682
1147
|
]])
|
|
683
1148
|
}, [
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
1149
|
+
o("span", Ot, [
|
|
1150
|
+
d[0] || (d[0] = o("span", { class: "xp-radio__inner" }, null, -1)),
|
|
1151
|
+
o("input", {
|
|
687
1152
|
type: "radio",
|
|
688
1153
|
class: "xp-radio__original",
|
|
689
1154
|
checked: e.modelValue === e.value,
|
|
690
1155
|
disabled: e.disabled,
|
|
691
|
-
onChange:
|
|
692
|
-
}, null, 40,
|
|
1156
|
+
onChange: l
|
|
1157
|
+
}, null, 40, Xt)
|
|
693
1158
|
]),
|
|
694
|
-
|
|
695
|
-
b(
|
|
1159
|
+
o("span", Lt, [
|
|
1160
|
+
b(u.$slots, "default", {}, void 0, !0)
|
|
696
1161
|
])
|
|
697
1162
|
], 2));
|
|
698
1163
|
}
|
|
699
|
-
},
|
|
1164
|
+
}, Wt = /* @__PURE__ */ C(Pt, [["__scopeId", "data-v-02a0d80d"]]), Jt = { class: "xp-rate" }, Ht = ["onClick", "onMouseenter"], Ut = { class: "xp-rate__star" }, Gt = {
|
|
700
1165
|
key: 0,
|
|
701
1166
|
class: "xp-rate__text"
|
|
702
|
-
},
|
|
1167
|
+
}, qt = {
|
|
703
1168
|
__name: "Rate",
|
|
704
1169
|
props: {
|
|
705
1170
|
modelValue: {
|
|
@@ -724,39 +1189,39 @@ const v = (e, t) => {
|
|
|
724
1189
|
}
|
|
725
1190
|
},
|
|
726
1191
|
emits: ["update:modelValue", "change"],
|
|
727
|
-
setup(e, { emit:
|
|
728
|
-
const
|
|
729
|
-
const
|
|
730
|
-
return
|
|
731
|
-
},
|
|
732
|
-
|
|
1192
|
+
setup(e, { emit: n }) {
|
|
1193
|
+
const t = e, s = n, l = z(0), u = M(() => l.value || t.modelValue), d = (m) => {
|
|
1194
|
+
const f = u.value - m + 1;
|
|
1195
|
+
return f >= 1 ? 100 : f > 0 ? f * 100 : 0;
|
|
1196
|
+
}, x = (m) => {
|
|
1197
|
+
t.disabled || (s("update:modelValue", m), s("change", m));
|
|
733
1198
|
};
|
|
734
|
-
return (
|
|
735
|
-
(
|
|
736
|
-
key:
|
|
737
|
-
class:
|
|
1199
|
+
return (m, f) => (a(), r("div", Jt, [
|
|
1200
|
+
(a(!0), r(_, null, V(e.max, (i) => (a(), r("span", {
|
|
1201
|
+
key: i,
|
|
1202
|
+
class: B(["xp-rate__item", {
|
|
738
1203
|
"xp-rate__item--disabled": e.disabled
|
|
739
1204
|
}]),
|
|
740
|
-
style:
|
|
741
|
-
onClick: (
|
|
742
|
-
onMouseenter: (
|
|
743
|
-
onMouseleave:
|
|
1205
|
+
style: T({ cursor: e.disabled ? "default" : "pointer" }),
|
|
1206
|
+
onClick: (c) => x(i),
|
|
1207
|
+
onMouseenter: (c) => l.value = i,
|
|
1208
|
+
onMouseleave: f[0] || (f[0] = (c) => l.value = 0)
|
|
744
1209
|
}, [
|
|
745
|
-
|
|
746
|
-
|
|
1210
|
+
o("span", Ut, [
|
|
1211
|
+
f[1] || (f[1] = o("span", { class: "xp-rate__star-outer" }, "★", -1)),
|
|
1212
|
+
o("span", {
|
|
747
1213
|
class: "xp-rate__star-inner",
|
|
748
|
-
style:
|
|
749
|
-
}, " ★ ", 4)
|
|
750
|
-
p[1] || (p[1] = c("span", { class: "xp-rate__star-outer" }, "★", -1))
|
|
1214
|
+
style: T({ width: d(i) + "%", color: e.color })
|
|
1215
|
+
}, " ★ ", 4)
|
|
751
1216
|
])
|
|
752
|
-
], 46,
|
|
753
|
-
e.showText && !e.disabled ? (
|
|
1217
|
+
], 46, Ht))), 128)),
|
|
1218
|
+
e.showText && !e.disabled ? (a(), r("span", Gt, k(e.modelValue) + " / " + k(e.max), 1)) : g("", !0)
|
|
754
1219
|
]));
|
|
755
1220
|
}
|
|
756
|
-
},
|
|
1221
|
+
}, Yt = /* @__PURE__ */ C(qt, [["__scopeId", "data-v-214323a3"]]), Kt = ["aria-checked"], Zt = {
|
|
757
1222
|
key: 0,
|
|
758
1223
|
class: "xp-switch__label"
|
|
759
|
-
},
|
|
1224
|
+
}, Qt = {
|
|
760
1225
|
__name: "Switch",
|
|
761
1226
|
props: {
|
|
762
1227
|
modelValue: {
|
|
@@ -774,14 +1239,14 @@ const v = (e, t) => {
|
|
|
774
1239
|
}
|
|
775
1240
|
},
|
|
776
1241
|
emits: ["update:modelValue", "change"],
|
|
777
|
-
setup(e, { emit:
|
|
778
|
-
const
|
|
779
|
-
if (
|
|
780
|
-
const
|
|
781
|
-
|
|
1242
|
+
setup(e, { emit: n }) {
|
|
1243
|
+
const t = e, s = n, l = () => {
|
|
1244
|
+
if (t.disabled) return;
|
|
1245
|
+
const u = !t.modelValue;
|
|
1246
|
+
s("update:modelValue", u), s("change", u);
|
|
782
1247
|
};
|
|
783
|
-
return (
|
|
784
|
-
class:
|
|
1248
|
+
return (u, d) => (a(), r("div", {
|
|
1249
|
+
class: B(["xp-switch", [
|
|
785
1250
|
`xp-switch--${e.size}`,
|
|
786
1251
|
{
|
|
787
1252
|
"xp-switch--checked": e.modelValue,
|
|
@@ -790,20 +1255,20 @@ const v = (e, t) => {
|
|
|
790
1255
|
]]),
|
|
791
1256
|
role: "switch",
|
|
792
1257
|
"aria-checked": e.modelValue,
|
|
793
|
-
onClick:
|
|
1258
|
+
onClick: l
|
|
794
1259
|
}, [
|
|
795
|
-
|
|
796
|
-
|
|
1260
|
+
d[0] || (d[0] = o("span", { class: "xp-switch__core" }, [
|
|
1261
|
+
o("span", { class: "xp-switch__action" })
|
|
797
1262
|
], -1)),
|
|
798
|
-
|
|
799
|
-
b(
|
|
1263
|
+
u.$slots.default ? (a(), r("span", Zt, [
|
|
1264
|
+
b(u.$slots, "default", {}, void 0, !0)
|
|
800
1265
|
])) : g("", !0)
|
|
801
|
-
], 10,
|
|
1266
|
+
], 10, Kt));
|
|
802
1267
|
}
|
|
803
|
-
},
|
|
1268
|
+
}, en = /* @__PURE__ */ C(Qt, [["__scopeId", "data-v-5a5e33c5"]]), tn = {
|
|
804
1269
|
key: 0,
|
|
805
1270
|
class: "xp-tab-pane"
|
|
806
|
-
},
|
|
1271
|
+
}, nn = {
|
|
807
1272
|
__name: "TabPane",
|
|
808
1273
|
props: {
|
|
809
1274
|
name: {
|
|
@@ -820,19 +1285,19 @@ const v = (e, t) => {
|
|
|
820
1285
|
}
|
|
821
1286
|
},
|
|
822
1287
|
setup(e) {
|
|
823
|
-
const
|
|
824
|
-
return
|
|
825
|
-
|
|
826
|
-
}),
|
|
827
|
-
|
|
828
|
-
}), (
|
|
829
|
-
b(
|
|
1288
|
+
const n = e, t = _e("xpTabs", null), s = M(() => t ? t.currentValue.value === n.name : !0);
|
|
1289
|
+
return de(() => {
|
|
1290
|
+
t && t.addTab && t.addTab({ name: n.name, title: n.title, disabled: n.disabled });
|
|
1291
|
+
}), Q(() => {
|
|
1292
|
+
t && t.removeTab && t.removeTab(n.name);
|
|
1293
|
+
}), (l, u) => s.value ? (a(), r("div", tn, [
|
|
1294
|
+
b(l.$slots, "default", {}, void 0, !0)
|
|
830
1295
|
])) : g("", !0);
|
|
831
1296
|
}
|
|
832
|
-
},
|
|
1297
|
+
}, on = /* @__PURE__ */ C(nn, [["__scopeId", "data-v-6fe7943a"]]), sn = { class: "xp-tabs" }, ln = {
|
|
833
1298
|
class: "xp-tabs__nav",
|
|
834
1299
|
role: "tablist"
|
|
835
|
-
},
|
|
1300
|
+
}, an = ["onClick"], rn = { class: "xp-tabs__content" }, dn = {
|
|
836
1301
|
__name: "Tabs",
|
|
837
1302
|
props: {
|
|
838
1303
|
modelValue: {
|
|
@@ -841,48 +1306,48 @@ const v = (e, t) => {
|
|
|
841
1306
|
}
|
|
842
1307
|
},
|
|
843
1308
|
emits: ["update:modelValue", "change"],
|
|
844
|
-
setup(e, { emit:
|
|
845
|
-
const
|
|
846
|
-
var
|
|
847
|
-
return
|
|
848
|
-
}),
|
|
849
|
-
const
|
|
1309
|
+
setup(e, { emit: n }) {
|
|
1310
|
+
const t = e, s = n, l = z([]), u = M(() => {
|
|
1311
|
+
var i;
|
|
1312
|
+
return t.modelValue !== null && t.modelValue !== void 0 && t.modelValue !== "" ? t.modelValue : ((i = l.value[0]) == null ? void 0 : i.name) ?? null;
|
|
1313
|
+
}), d = M(() => {
|
|
1314
|
+
const i = l.value.findIndex((h) => h.name === u.value);
|
|
850
1315
|
return {
|
|
851
|
-
transform: `translateX(${(
|
|
852
|
-
width: `${
|
|
1316
|
+
transform: `translateX(${(i >= 0 ? i : 0) * 100}%)`,
|
|
1317
|
+
width: `${l.value.length ? 100 / l.value.length : 0}%`
|
|
853
1318
|
};
|
|
854
|
-
}),
|
|
855
|
-
|
|
1319
|
+
}), x = (i) => {
|
|
1320
|
+
i.disabled || (s("update:modelValue", i.name), s("change", i.name));
|
|
856
1321
|
};
|
|
857
|
-
return
|
|
858
|
-
|
|
859
|
-
}, removeTab: (
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
}, currentValue:
|
|
863
|
-
|
|
864
|
-
(
|
|
865
|
-
key:
|
|
866
|
-
class:
|
|
1322
|
+
return ke("xpTabs", { addTab: (i) => {
|
|
1323
|
+
l.value.find((c) => c.name === i.name) || l.value.push(i);
|
|
1324
|
+
}, removeTab: (i) => {
|
|
1325
|
+
const c = l.value.findIndex((h) => h.name === i);
|
|
1326
|
+
c >= 0 && l.value.splice(c, 1);
|
|
1327
|
+
}, currentValue: u }), (i, c) => (a(), r("div", sn, [
|
|
1328
|
+
o("div", ln, [
|
|
1329
|
+
(a(!0), r(_, null, V(l.value, (h, $) => (a(), r("div", {
|
|
1330
|
+
key: h.name || $,
|
|
1331
|
+
class: B(["xp-tabs__item", [
|
|
867
1332
|
{
|
|
868
|
-
"xp-tabs__item--active":
|
|
869
|
-
"xp-tabs__item--disabled":
|
|
1333
|
+
"xp-tabs__item--active": u.value === h.name,
|
|
1334
|
+
"xp-tabs__item--disabled": h.disabled
|
|
870
1335
|
}
|
|
871
1336
|
]]),
|
|
872
1337
|
role: "tab",
|
|
873
|
-
onClick: (
|
|
874
|
-
}, k(
|
|
875
|
-
|
|
1338
|
+
onClick: (w) => x(h)
|
|
1339
|
+
}, k(h.title), 11, an))), 128)),
|
|
1340
|
+
o("div", {
|
|
876
1341
|
class: "xp-tabs__active-bar",
|
|
877
|
-
style:
|
|
1342
|
+
style: T(d.value)
|
|
878
1343
|
}, null, 4)
|
|
879
1344
|
]),
|
|
880
|
-
|
|
881
|
-
b(
|
|
1345
|
+
o("div", rn, [
|
|
1346
|
+
b(i.$slots, "default", {}, void 0, !0)
|
|
882
1347
|
])
|
|
883
1348
|
]));
|
|
884
1349
|
}
|
|
885
|
-
},
|
|
1350
|
+
}, un = /* @__PURE__ */ C(dn, [["__scopeId", "data-v-3e658dba"]]), cn = {
|
|
886
1351
|
__name: "Tag",
|
|
887
1352
|
props: {
|
|
888
1353
|
type: {
|
|
@@ -913,18 +1378,18 @@ const v = (e, t) => {
|
|
|
913
1378
|
}
|
|
914
1379
|
},
|
|
915
1380
|
emits: ["click", "close"],
|
|
916
|
-
setup(e, { emit:
|
|
917
|
-
const
|
|
918
|
-
backgroundColor:
|
|
919
|
-
borderColor:
|
|
1381
|
+
setup(e, { emit: n }) {
|
|
1382
|
+
const t = e, s = n, l = M(() => t.color ? t.color.startsWith("#") || t.color.startsWith("rgb") ? {
|
|
1383
|
+
backgroundColor: t.color,
|
|
1384
|
+
borderColor: t.color,
|
|
920
1385
|
color: "#fff"
|
|
921
|
-
} : {} : {}),
|
|
922
|
-
|
|
923
|
-
},
|
|
924
|
-
|
|
1386
|
+
} : {} : {}), u = (x) => {
|
|
1387
|
+
s("click", x);
|
|
1388
|
+
}, d = (x) => {
|
|
1389
|
+
s("close", x);
|
|
925
1390
|
};
|
|
926
|
-
return (
|
|
927
|
-
class:
|
|
1391
|
+
return (x, m) => (a(), r("span", {
|
|
1392
|
+
class: B(["xp-tag", [
|
|
928
1393
|
`xp-tag--${e.type}`,
|
|
929
1394
|
`xp-tag--${e.size}`,
|
|
930
1395
|
{
|
|
@@ -933,179 +1398,81 @@ const v = (e, t) => {
|
|
|
933
1398
|
"xp-tag--closable": e.closable
|
|
934
1399
|
}
|
|
935
1400
|
]]),
|
|
936
|
-
style:
|
|
937
|
-
onClick:
|
|
1401
|
+
style: T(l.value),
|
|
1402
|
+
onClick: u
|
|
938
1403
|
}, [
|
|
939
|
-
b(
|
|
940
|
-
e.closable ? (
|
|
1404
|
+
b(x.$slots, "default", {}, void 0, !0),
|
|
1405
|
+
e.closable ? (a(), r("span", {
|
|
941
1406
|
key: 0,
|
|
942
1407
|
class: "xp-tag__close",
|
|
943
|
-
onClick:
|
|
1408
|
+
onClick: j(d, ["stop"])
|
|
944
1409
|
}, "×")) : g("", !0)
|
|
945
1410
|
], 6));
|
|
946
1411
|
}
|
|
947
|
-
},
|
|
948
|
-
|
|
949
|
-
props: {
|
|
950
|
-
content: {
|
|
951
|
-
type: String,
|
|
952
|
-
default: ""
|
|
953
|
-
},
|
|
954
|
-
placement: {
|
|
955
|
-
type: String,
|
|
956
|
-
default: "top",
|
|
957
|
-
validator: (e) => ["top", "bottom", "left", "right"].includes(e)
|
|
958
|
-
},
|
|
959
|
-
trigger: {
|
|
960
|
-
type: String,
|
|
961
|
-
default: "hover",
|
|
962
|
-
validator: (e) => ["hover", "click", "manual"].includes(e)
|
|
963
|
-
},
|
|
964
|
-
disabled: {
|
|
965
|
-
type: Boolean,
|
|
966
|
-
default: !1
|
|
967
|
-
}
|
|
968
|
-
},
|
|
969
|
-
setup(e) {
|
|
970
|
-
const t = e, a = _(!1), l = _({}), n = _(null), s = _(null);
|
|
971
|
-
let o = null;
|
|
972
|
-
const u = () => {
|
|
973
|
-
Z(() => {
|
|
974
|
-
if (!n.value || !s.value) return;
|
|
975
|
-
const h = n.value.getBoundingClientRect(), d = s.value.getBoundingClientRect();
|
|
976
|
-
let y = 0, x = 0;
|
|
977
|
-
switch (t.placement) {
|
|
978
|
-
case "top":
|
|
979
|
-
y = h.top - d.height - 8, x = h.left + h.width / 2 - d.width / 2;
|
|
980
|
-
break;
|
|
981
|
-
case "bottom":
|
|
982
|
-
y = h.bottom + 8, x = h.left + h.width / 2 - d.width / 2;
|
|
983
|
-
break;
|
|
984
|
-
case "left":
|
|
985
|
-
y = h.top + h.height / 2 - d.height / 2, x = h.left - d.width - 8;
|
|
986
|
-
break;
|
|
987
|
-
case "right":
|
|
988
|
-
y = h.top + h.height / 2 - d.height / 2, x = h.right + 8;
|
|
989
|
-
break;
|
|
990
|
-
}
|
|
991
|
-
l.value = {
|
|
992
|
-
top: `${y + window.scrollY}px`,
|
|
993
|
-
left: `${x + window.scrollX}px`
|
|
994
|
-
};
|
|
995
|
-
});
|
|
996
|
-
}, f = () => {
|
|
997
|
-
t.disabled || (clearTimeout(o), o = setTimeout(() => {
|
|
998
|
-
a.value = !0, u();
|
|
999
|
-
}, 100));
|
|
1000
|
-
}, p = () => {
|
|
1001
|
-
clearTimeout(o), o = setTimeout(() => {
|
|
1002
|
-
a.value = !1;
|
|
1003
|
-
}, 150);
|
|
1004
|
-
}, m = () => {
|
|
1005
|
-
t.trigger !== "click" || t.disabled || (a.value = !a.value, a.value && u());
|
|
1006
|
-
};
|
|
1007
|
-
return J(() => {
|
|
1008
|
-
clearTimeout(o);
|
|
1009
|
-
}), (h, d) => (r(), i("div", {
|
|
1010
|
-
class: "xp-tooltip",
|
|
1011
|
-
ref_key: "tooltipRef",
|
|
1012
|
-
ref: n
|
|
1013
|
-
}, [
|
|
1014
|
-
c("div", {
|
|
1015
|
-
class: "xp-tooltip__trigger",
|
|
1016
|
-
onMouseenter: f,
|
|
1017
|
-
onMouseleave: p,
|
|
1018
|
-
onClick: m
|
|
1019
|
-
}, [
|
|
1020
|
-
b(h.$slots, "default", {}, void 0, !0)
|
|
1021
|
-
], 32),
|
|
1022
|
-
(r(), z(L, { to: "body" }, [
|
|
1023
|
-
B(N, { name: "xp-tooltip-fade" }, {
|
|
1024
|
-
default: S(() => [
|
|
1025
|
-
a.value ? (r(), i("div", {
|
|
1026
|
-
key: 0,
|
|
1027
|
-
class: $(["xp-tooltip__popper", [`xp-tooltip__popper--${e.placement}`]]),
|
|
1028
|
-
style: C(l.value),
|
|
1029
|
-
ref_key: "popperRef",
|
|
1030
|
-
ref: s
|
|
1031
|
-
}, [
|
|
1032
|
-
c("div", Tt, [
|
|
1033
|
-
b(h.$slots, "content", {}, () => [
|
|
1034
|
-
X(k(e.content), 1)
|
|
1035
|
-
], !0)
|
|
1036
|
-
]),
|
|
1037
|
-
d[0] || (d[0] = c("div", { class: "xp-tooltip__arrow" }, null, -1))
|
|
1038
|
-
], 6)) : g("", !0)
|
|
1039
|
-
]),
|
|
1040
|
-
_: 3
|
|
1041
|
-
})
|
|
1042
|
-
]))
|
|
1043
|
-
], 512));
|
|
1044
|
-
}
|
|
1045
|
-
}, Rt = /* @__PURE__ */ v(It, [["__scopeId", "data-v-6d9af40b"]]), Mt = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, Nt = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*([\d.]+))?\s*\)$/;
|
|
1046
|
-
function E(e) {
|
|
1412
|
+
}, pn = /* @__PURE__ */ C(cn, [["__scopeId", "data-v-903813de"]]), fn = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, mn = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*([\d.]+))?\s*\)$/;
|
|
1413
|
+
function Y(e) {
|
|
1047
1414
|
if (typeof e != "string") return null;
|
|
1048
|
-
const
|
|
1049
|
-
if (
|
|
1050
|
-
let
|
|
1051
|
-
|
|
1052
|
-
const
|
|
1053
|
-
return { r:
|
|
1415
|
+
const n = e.trim(), t = n.match(fn);
|
|
1416
|
+
if (t) {
|
|
1417
|
+
let l = t[1];
|
|
1418
|
+
l.length === 3 && (l = l.split("").map((m) => m + m).join(""));
|
|
1419
|
+
const u = parseInt(l.slice(0, 2), 16), d = parseInt(l.slice(2, 4), 16), x = parseInt(l.slice(4, 6), 16);
|
|
1420
|
+
return { r: u, g: d, b: x, a: 1 };
|
|
1054
1421
|
}
|
|
1055
|
-
const
|
|
1056
|
-
return
|
|
1057
|
-
r: parseInt(
|
|
1058
|
-
g: parseInt(
|
|
1059
|
-
b: parseInt(
|
|
1060
|
-
a:
|
|
1422
|
+
const s = n.match(mn);
|
|
1423
|
+
return s ? {
|
|
1424
|
+
r: parseInt(s[1], 10),
|
|
1425
|
+
g: parseInt(s[2], 10),
|
|
1426
|
+
b: parseInt(s[3], 10),
|
|
1427
|
+
a: s[4] ? parseFloat(s[4]) : 1
|
|
1061
1428
|
} : null;
|
|
1062
1429
|
}
|
|
1063
|
-
function
|
|
1430
|
+
function hn(e) {
|
|
1064
1431
|
return Math.max(0, Math.min(255, Math.round(e)));
|
|
1065
1432
|
}
|
|
1066
|
-
function
|
|
1067
|
-
const
|
|
1068
|
-
return "#" +
|
|
1433
|
+
function xn(e, n, t) {
|
|
1434
|
+
const s = (l) => hn(l).toString(16).padStart(2, "0");
|
|
1435
|
+
return "#" + s(e) + s(n) + s(t);
|
|
1069
1436
|
}
|
|
1070
|
-
function
|
|
1071
|
-
const
|
|
1072
|
-
if (!
|
|
1073
|
-
const
|
|
1074
|
-
return
|
|
1437
|
+
function pe(e, n, t = 0.5) {
|
|
1438
|
+
const s = Y(e), l = Y(n);
|
|
1439
|
+
if (!s || !l) return "#000000";
|
|
1440
|
+
const u = Math.max(0, Math.min(1, t)), d = s.r * (1 - u) + l.r * u, x = s.g * (1 - u) + l.g * u, m = s.b * (1 - u) + l.b * u;
|
|
1441
|
+
return xn(d, x, m);
|
|
1075
1442
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return
|
|
1443
|
+
function G(e, n) {
|
|
1444
|
+
return pe(e, "#ffffff", n);
|
|
1078
1445
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return
|
|
1446
|
+
function q(e, n) {
|
|
1447
|
+
return pe(e, "#000000", n);
|
|
1081
1448
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return
|
|
1449
|
+
function xo(e) {
|
|
1450
|
+
return G(e, 0.3);
|
|
1084
1451
|
}
|
|
1085
|
-
function
|
|
1086
|
-
return
|
|
1452
|
+
function vo(e) {
|
|
1453
|
+
return q(e, 0.2);
|
|
1087
1454
|
}
|
|
1088
|
-
function
|
|
1089
|
-
const
|
|
1090
|
-
if (!
|
|
1091
|
-
const
|
|
1092
|
-
return `rgba(${
|
|
1455
|
+
function go(e, n) {
|
|
1456
|
+
const t = Y(e);
|
|
1457
|
+
if (!t) return e;
|
|
1458
|
+
const s = Math.max(0, Math.min(1, n));
|
|
1459
|
+
return `rgba(${t.r}, ${t.g}, ${t.b}, ${s})`;
|
|
1093
1460
|
}
|
|
1094
|
-
function
|
|
1095
|
-
const
|
|
1096
|
-
return
|
|
1461
|
+
function yo(e) {
|
|
1462
|
+
const n = Y(e);
|
|
1463
|
+
return n ? (n.r * 299 + n.g * 587 + n.b * 114) / 1e3 < 128 : !1;
|
|
1097
1464
|
}
|
|
1098
|
-
function
|
|
1099
|
-
const
|
|
1100
|
-
return { base: e, light:
|
|
1465
|
+
function fe(e, n) {
|
|
1466
|
+
const t = G(e, 0.3), s = q(e, 0.2), l = n === "dark" ? q(e, 0.85) : G(e, 0.9), u = n === "dark" ? q(e, 0.7) : G(e, 0.7);
|
|
1467
|
+
return { base: e, light: t, dark: s, bg: l, border: u };
|
|
1101
1468
|
}
|
|
1102
|
-
const
|
|
1469
|
+
const N = {
|
|
1103
1470
|
primary: "#409eff",
|
|
1104
1471
|
success: "#67c23a",
|
|
1105
1472
|
warning: "#e6a23c",
|
|
1106
1473
|
danger: "#f56c6c",
|
|
1107
1474
|
info: "#909399"
|
|
1108
|
-
},
|
|
1475
|
+
}, J = {
|
|
1109
1476
|
light: {
|
|
1110
1477
|
text: { primary: "#303133", regular: "#606266", secondary: "#909399", placeholder: "#c0c4cc" },
|
|
1111
1478
|
border: { base: "#dcdfe6", light: "#ebeef5", lighter: "#f2f6fc" },
|
|
@@ -1131,83 +1498,83 @@ const V = {
|
|
|
1131
1498
|
}
|
|
1132
1499
|
}
|
|
1133
1500
|
};
|
|
1134
|
-
function
|
|
1501
|
+
function F() {
|
|
1135
1502
|
return {
|
|
1136
|
-
primary: { ...
|
|
1137
|
-
light:
|
|
1138
|
-
dark:
|
|
1503
|
+
primary: { ...N },
|
|
1504
|
+
light: se(J.light),
|
|
1505
|
+
dark: se(J.dark)
|
|
1139
1506
|
};
|
|
1140
1507
|
}
|
|
1141
|
-
function
|
|
1508
|
+
function se(e) {
|
|
1142
1509
|
return JSON.parse(JSON.stringify(e));
|
|
1143
1510
|
}
|
|
1144
|
-
function
|
|
1145
|
-
const
|
|
1146
|
-
for (const
|
|
1147
|
-
const
|
|
1148
|
-
|
|
1511
|
+
function le(e, n) {
|
|
1512
|
+
const t = ["primary", "success", "warning", "danger", "info"], s = [];
|
|
1513
|
+
for (const l of t) {
|
|
1514
|
+
const u = e[l] || N[l], d = fe(u, n);
|
|
1515
|
+
s.push(` --xp-color-${l}: ${u};`), s.push(` --xp-color-${l}-light: ${d.light};`), s.push(` --xp-color-${l}-dark: ${d.dark};`), s.push(` --xp-color-${l}-bg: ${d.bg};`), s.push(` --xp-color-${l}-border: ${d.border};`);
|
|
1149
1516
|
}
|
|
1150
|
-
return
|
|
1517
|
+
return s.join(`
|
|
1151
1518
|
`);
|
|
1152
1519
|
}
|
|
1153
|
-
function
|
|
1154
|
-
const
|
|
1155
|
-
for (const
|
|
1156
|
-
|
|
1157
|
-
for (const
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1520
|
+
function ae(e) {
|
|
1521
|
+
const n = [];
|
|
1522
|
+
for (const t of Object.keys(e.text)) n.push(` --xp-text-color-${t}: ${e.text[t]};`);
|
|
1523
|
+
n.push(` --xp-border-color: ${e.border.base};`), n.push(` --xp-border-color-light: ${e.border.light};`), n.push(` --xp-border-color-lighter: ${e.border.lighter};`);
|
|
1524
|
+
for (const t of Object.keys(e.bg)) {
|
|
1525
|
+
const s = t === "base" ? "" : `-${t}`;
|
|
1526
|
+
n.push(` --xp-bg-color${s}: ${e.bg[t]};`);
|
|
1160
1527
|
}
|
|
1161
|
-
for (const
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1528
|
+
for (const t of Object.keys(e.fill)) {
|
|
1529
|
+
const s = t === "base" ? "" : `-${t}`;
|
|
1530
|
+
n.push(` --xp-fill-color${s}: ${e.fill[t]};`);
|
|
1164
1531
|
}
|
|
1165
|
-
for (const
|
|
1166
|
-
return
|
|
1532
|
+
for (const t of Object.keys(e.shadow)) n.push(` --xp-shadow-${t}: ${e.shadow[t]};`);
|
|
1533
|
+
return n.join(`
|
|
1167
1534
|
`);
|
|
1168
1535
|
}
|
|
1169
|
-
function
|
|
1170
|
-
const
|
|
1171
|
-
for (const
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1536
|
+
function vn(e, n) {
|
|
1537
|
+
const t = {}, s = e.primary || N, l = ["primary", "success", "warning", "danger", "info"];
|
|
1538
|
+
for (const d of l) {
|
|
1539
|
+
const x = s[d] || N[d], m = fe(x, n);
|
|
1540
|
+
t[`--xp-color-${d}`] = x, t[`--xp-color-${d}-light`] = m.light, t[`--xp-color-${d}-dark`] = m.dark, t[`--xp-color-${d}-bg`] = m.bg, t[`--xp-color-${d}-border`] = m.border;
|
|
1174
1541
|
}
|
|
1175
|
-
const
|
|
1176
|
-
for (const
|
|
1177
|
-
|
|
1178
|
-
for (const
|
|
1179
|
-
for (const
|
|
1180
|
-
for (const
|
|
1181
|
-
return
|
|
1542
|
+
const u = e[n] || J[n];
|
|
1543
|
+
for (const d of Object.keys(u.text)) t[`--xp-text-color-${d}`] = u.text[d];
|
|
1544
|
+
t["--xp-border-color"] = u.border.base, t["--xp-border-color-light"] = u.border.light, t["--xp-border-color-lighter"] = u.border.lighter;
|
|
1545
|
+
for (const d of Object.keys(u.bg)) t[`--xp-bg-color${d === "base" ? "" : "-" + d}`] = u.bg[d];
|
|
1546
|
+
for (const d of Object.keys(u.fill)) t[`--xp-fill-color${d === "base" ? "" : "-" + d}`] = u.fill[d];
|
|
1547
|
+
for (const d of Object.keys(u.shadow)) t[`--xp-shadow-${d}`] = u.shadow[d];
|
|
1548
|
+
return t;
|
|
1182
1549
|
}
|
|
1183
|
-
function
|
|
1550
|
+
function me(e) {
|
|
1184
1551
|
return [
|
|
1185
1552
|
':root, [data-theme="light"] {',
|
|
1186
|
-
|
|
1187
|
-
|
|
1553
|
+
le(e.primary || N, "light"),
|
|
1554
|
+
ae(e.light || J.light),
|
|
1188
1555
|
"}",
|
|
1189
1556
|
"",
|
|
1190
1557
|
'[data-theme="dark"] {',
|
|
1191
|
-
|
|
1192
|
-
|
|
1558
|
+
le(e.primary || N, "dark"),
|
|
1559
|
+
ae(e.dark || J.dark),
|
|
1193
1560
|
"}"
|
|
1194
1561
|
].join(`
|
|
1195
1562
|
`);
|
|
1196
1563
|
}
|
|
1197
|
-
let
|
|
1198
|
-
function
|
|
1564
|
+
let U = null;
|
|
1565
|
+
function gn() {
|
|
1199
1566
|
if (typeof document > "u") return null;
|
|
1200
|
-
if (
|
|
1567
|
+
if (U && document.contains(U)) return U;
|
|
1201
1568
|
let e = document.querySelector("style[data-xp-ui-theme]");
|
|
1202
|
-
return e || (e = document.createElement("style"), e.setAttribute("data-xp-ui-theme", "true"), document.head.appendChild(e)),
|
|
1569
|
+
return e || (e = document.createElement("style"), e.setAttribute("data-xp-ui-theme", "true"), document.head.appendChild(e)), U = e, e;
|
|
1203
1570
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1571
|
+
function yn(e) {
|
|
1572
|
+
const n = gn();
|
|
1573
|
+
n && (n.textContent = me(e));
|
|
1207
1574
|
}
|
|
1208
|
-
const
|
|
1209
|
-
function
|
|
1210
|
-
if (["light", "dark"].includes(e) && (
|
|
1575
|
+
const ee = z("light"), he = z(F());
|
|
1576
|
+
function L(e) {
|
|
1577
|
+
if (["light", "dark"].includes(e) && (ee.value = e, typeof document < "u")) {
|
|
1211
1578
|
document.documentElement.setAttribute("data-theme", e);
|
|
1212
1579
|
try {
|
|
1213
1580
|
localStorage.setItem("xp-ui-theme", e);
|
|
@@ -1215,128 +1582,552 @@ function R(e) {
|
|
|
1215
1582
|
}
|
|
1216
1583
|
}
|
|
1217
1584
|
}
|
|
1218
|
-
function
|
|
1219
|
-
|
|
1585
|
+
function bn() {
|
|
1586
|
+
L(ee.value === "light" ? "dark" : "light");
|
|
1220
1587
|
}
|
|
1221
|
-
function
|
|
1588
|
+
function P(e) {
|
|
1222
1589
|
if (!e) return;
|
|
1223
|
-
const
|
|
1224
|
-
e.primary && (
|
|
1590
|
+
const n = F();
|
|
1591
|
+
e.primary && (n.primary = { ...n.primary, ...e.primary }), e.light && (n.light = Z(n.light, e.light)), e.dark && (n.dark = Z(n.dark, e.dark)), he.value = n, yn(n);
|
|
1225
1592
|
try {
|
|
1226
|
-
localStorage.setItem("xp-ui-theme-config", JSON.stringify(
|
|
1593
|
+
localStorage.setItem("xp-ui-theme-config", JSON.stringify(n));
|
|
1227
1594
|
} catch {
|
|
1228
1595
|
}
|
|
1229
1596
|
}
|
|
1230
|
-
function
|
|
1231
|
-
|
|
1597
|
+
function _n() {
|
|
1598
|
+
P(F());
|
|
1232
1599
|
}
|
|
1233
|
-
function
|
|
1600
|
+
function kn() {
|
|
1234
1601
|
if (typeof document > "u") return;
|
|
1235
1602
|
let e = null;
|
|
1236
1603
|
try {
|
|
1237
1604
|
e = localStorage.getItem("xp-ui-theme");
|
|
1238
1605
|
} catch {
|
|
1239
1606
|
}
|
|
1240
|
-
e === "light" || e === "dark" ?
|
|
1241
|
-
let
|
|
1607
|
+
e === "light" || e === "dark" ? L(e) : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? L("dark") : L("light");
|
|
1608
|
+
let n = null;
|
|
1242
1609
|
try {
|
|
1243
|
-
|
|
1610
|
+
n = localStorage.getItem("xp-ui-theme-config");
|
|
1244
1611
|
} catch {
|
|
1245
1612
|
}
|
|
1246
|
-
if (
|
|
1613
|
+
if (n)
|
|
1247
1614
|
try {
|
|
1248
|
-
|
|
1615
|
+
P(JSON.parse(n));
|
|
1249
1616
|
} catch {
|
|
1250
|
-
|
|
1617
|
+
P(F());
|
|
1251
1618
|
}
|
|
1252
1619
|
else
|
|
1253
|
-
|
|
1620
|
+
P(F());
|
|
1254
1621
|
}
|
|
1255
|
-
function
|
|
1256
|
-
if (!
|
|
1257
|
-
const
|
|
1258
|
-
for (const
|
|
1259
|
-
|
|
1260
|
-
return
|
|
1622
|
+
function Z(e, n) {
|
|
1623
|
+
if (!n || typeof n != "object") return e;
|
|
1624
|
+
const t = Array.isArray(e) ? [...e] : { ...e };
|
|
1625
|
+
for (const s of Object.keys(n))
|
|
1626
|
+
n[s] && typeof n[s] == "object" && !Array.isArray(n[s]) ? t[s] = Z(e[s] || {}, n[s]) : t[s] = n[s];
|
|
1627
|
+
return t;
|
|
1261
1628
|
}
|
|
1262
|
-
function
|
|
1629
|
+
function $n() {
|
|
1263
1630
|
return {
|
|
1264
|
-
theme:
|
|
1265
|
-
themeConfig:
|
|
1266
|
-
setTheme:
|
|
1267
|
-
toggleTheme:
|
|
1268
|
-
initTheme:
|
|
1269
|
-
applyThemeConfig:
|
|
1270
|
-
resetThemeConfig:
|
|
1271
|
-
getDefaultThemeConfig:
|
|
1272
|
-
buildCssString:
|
|
1273
|
-
buildCssVars:
|
|
1631
|
+
theme: ee,
|
|
1632
|
+
themeConfig: he,
|
|
1633
|
+
setTheme: L,
|
|
1634
|
+
toggleTheme: bn,
|
|
1635
|
+
initTheme: kn,
|
|
1636
|
+
applyThemeConfig: P,
|
|
1637
|
+
resetThemeConfig: _n,
|
|
1638
|
+
getDefaultThemeConfig: F,
|
|
1639
|
+
buildCssString: me,
|
|
1640
|
+
buildCssVars: vn
|
|
1274
1641
|
};
|
|
1275
1642
|
}
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1643
|
+
const wn = ["data-theme"], Cn = { class: "xp-theme-customizer__header" }, Sn = { class: "xp-theme-customizer__body" }, zn = { class: "xp-theme-customizer__section" }, Bn = { class: "xp-theme-customizer__modes" }, Mn = ["onClick"], In = { class: "xp-theme-customizer__section" }, Tn = { class: "xp-theme-customizer__grid" }, Vn = { class: "xp-theme-customizer__label" }, En = { class: "xp-theme-customizer__input" }, An = ["value", "onInput"], Dn = ["value", "onChange"], jn = { class: "xp-theme-customizer__section" }, Nn = { class: "xp-theme-customizer__grid" }, Fn = { class: "xp-theme-customizer__label" }, Rn = { class: "xp-theme-customizer__input" }, On = ["value", "onInput"], Xn = ["value", "onChange"], Ln = { class: "xp-theme-customizer__section" }, Pn = { class: "xp-theme-customizer__grid" }, Wn = { class: "xp-theme-customizer__label" }, Jn = { class: "xp-theme-customizer__input" }, Hn = ["value", "onInput"], Un = ["value", "onChange"], Gn = { class: "xp-theme-customizer__section" }, qn = { class: "xp-theme-customizer__grid" }, Yn = { class: "xp-theme-customizer__label" }, Kn = { class: "xp-theme-customizer__input" }, Zn = ["value", "onInput"], Qn = ["value", "onChange"], eo = { class: "xp-theme-customizer__label" }, to = { class: "xp-theme-customizer__input" }, no = ["value", "onInput"], oo = ["value", "onChange"], so = {
|
|
1644
|
+
__name: "ThemeCustomizer",
|
|
1645
|
+
props: {
|
|
1646
|
+
modelValue: {
|
|
1647
|
+
type: Boolean,
|
|
1648
|
+
default: !1
|
|
1649
|
+
}
|
|
1650
|
+
},
|
|
1651
|
+
emits: ["update:modelValue"],
|
|
1652
|
+
setup(e, { emit: n }) {
|
|
1653
|
+
const { theme: t, applyThemeConfig: s, resetThemeConfig: l, getDefaultThemeConfig: u, buildCssString: d, themeConfig: x } = $n(), m = {
|
|
1654
|
+
primary: "主色",
|
|
1655
|
+
success: "成功",
|
|
1656
|
+
warning: "警告",
|
|
1657
|
+
danger: "危险",
|
|
1658
|
+
info: "信息",
|
|
1659
|
+
regular: "常规",
|
|
1660
|
+
secondary: "次要",
|
|
1661
|
+
placeholder: "占位",
|
|
1662
|
+
base: "基础",
|
|
1663
|
+
page: "页面",
|
|
1664
|
+
soft: "柔和",
|
|
1665
|
+
light: "亮",
|
|
1666
|
+
lighter: "更亮"
|
|
1667
|
+
}, f = z("light"), i = z(null), c = $e(h(x.value));
|
|
1668
|
+
re(x, (S) => Object.assign(c, h(S)), { deep: !0 });
|
|
1669
|
+
function h(S) {
|
|
1670
|
+
return JSON.parse(JSON.stringify(S));
|
|
1671
|
+
}
|
|
1672
|
+
function $(S) {
|
|
1673
|
+
if (!S) return "#ffffff";
|
|
1674
|
+
if (/^#([0-9a-f]{6})$/i.test(S)) return S.toLowerCase();
|
|
1675
|
+
const v = S.match(/rgba?\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})/);
|
|
1676
|
+
return v ? "#" + [v[1], v[2], v[3]].map((p) => Number(p).toString(16).padStart(2, "0")).join("") : "#ffffff";
|
|
1677
|
+
}
|
|
1678
|
+
function w(S, v) {
|
|
1679
|
+
c.primary[S] = v, s(c);
|
|
1680
|
+
}
|
|
1681
|
+
function I(S, v, p) {
|
|
1682
|
+
c[f.value][S][v] = p, s(c);
|
|
1683
|
+
}
|
|
1684
|
+
function te() {
|
|
1685
|
+
l();
|
|
1686
|
+
}
|
|
1687
|
+
function ve() {
|
|
1688
|
+
ne("xp-ui-theme.json", JSON.stringify(c, null, 2), "application/json");
|
|
1689
|
+
}
|
|
1690
|
+
function ge() {
|
|
1691
|
+
ne("xp-ui-theme.css", d(c), "text/css");
|
|
1692
|
+
}
|
|
1693
|
+
function ye() {
|
|
1694
|
+
i.value && i.value.click();
|
|
1695
|
+
}
|
|
1696
|
+
function be(S) {
|
|
1697
|
+
const v = S.target.files && S.target.files[0];
|
|
1698
|
+
if (!v) return;
|
|
1699
|
+
const p = new FileReader();
|
|
1700
|
+
p.onload = () => {
|
|
1701
|
+
try {
|
|
1702
|
+
const y = JSON.parse(p.result);
|
|
1703
|
+
s(y);
|
|
1704
|
+
} catch (y) {
|
|
1705
|
+
alert(`主题配置解析失败:
|
|
1706
|
+
` + y.message);
|
|
1707
|
+
} finally {
|
|
1708
|
+
S.target.value = "";
|
|
1709
|
+
}
|
|
1710
|
+
}, p.readAsText(v);
|
|
1711
|
+
}
|
|
1712
|
+
function ne(S, v, p) {
|
|
1713
|
+
const y = new Blob([v], { type: p + ";charset=utf-8" }), oe = URL.createObjectURL(y), O = document.createElement("a");
|
|
1714
|
+
O.href = oe, O.download = S, document.body.appendChild(O), O.click(), O.remove(), setTimeout(() => URL.revokeObjectURL(oe), 0);
|
|
1715
|
+
}
|
|
1716
|
+
return (S, v) => (a(), r(_, null, [
|
|
1717
|
+
A(D, { name: "xp-fade" }, {
|
|
1718
|
+
default: E(() => [
|
|
1719
|
+
e.modelValue ? (a(), r("div", {
|
|
1720
|
+
key: 0,
|
|
1721
|
+
class: "xp-theme-customizer-backdrop",
|
|
1722
|
+
onClick: v[0] || (v[0] = j((p) => S.$emit("update:modelValue", !1), ["self"]))
|
|
1723
|
+
})) : g("", !0)
|
|
1724
|
+
]),
|
|
1725
|
+
_: 1
|
|
1726
|
+
}),
|
|
1727
|
+
A(D, { name: "xp-slide" }, {
|
|
1728
|
+
default: E(() => [
|
|
1729
|
+
e.modelValue ? (a(), r("aside", {
|
|
1730
|
+
key: 0,
|
|
1731
|
+
class: "xp-theme-customizer",
|
|
1732
|
+
"data-theme": ce(t)
|
|
1733
|
+
}, [
|
|
1734
|
+
o("header", Cn, [
|
|
1735
|
+
v[2] || (v[2] = o("div", { class: "xp-theme-customizer__title" }, "🎨 主题定制", -1)),
|
|
1736
|
+
o("button", {
|
|
1737
|
+
class: "xp-theme-customizer__close",
|
|
1738
|
+
onClick: v[1] || (v[1] = (p) => S.$emit("update:modelValue", !1)),
|
|
1739
|
+
"aria-label": "关闭"
|
|
1740
|
+
}, "✕")
|
|
1741
|
+
]),
|
|
1742
|
+
o("div", Sn, [
|
|
1743
|
+
o("section", zn, [
|
|
1744
|
+
v[3] || (v[3] = o("p", { class: "xp-theme-customizer__desc" }, " 修改下方颜色即可改变整个示例/库的外观。导出后可直接放进你自己的项目中应用。 ", -1)),
|
|
1745
|
+
o("div", Bn, [
|
|
1746
|
+
(a(), r(_, null, V(["light", "dark"], (p) => o("button", {
|
|
1747
|
+
key: p,
|
|
1748
|
+
class: B(["xp-theme-customizer__mode-btn", { "is-active": f.value === p }]),
|
|
1749
|
+
onClick: (y) => f.value = p
|
|
1750
|
+
}, k(p === "light" ? "浅色" : "暗黑"), 11, Mn)), 64))
|
|
1751
|
+
])
|
|
1752
|
+
]),
|
|
1753
|
+
o("section", In, [
|
|
1754
|
+
v[4] || (v[4] = o("h3", { class: "xp-theme-customizer__h" }, "主色", -1)),
|
|
1755
|
+
o("div", Tn, [
|
|
1756
|
+
(a(), r(_, null, V(["primary", "success", "warning", "danger", "info"], (p) => o("div", {
|
|
1757
|
+
key: p,
|
|
1758
|
+
class: "xp-theme-customizer__item"
|
|
1759
|
+
}, [
|
|
1760
|
+
o("div", Vn, k(m[p]), 1),
|
|
1761
|
+
o("div", En, [
|
|
1762
|
+
o("input", {
|
|
1763
|
+
type: "color",
|
|
1764
|
+
value: c.primary[p],
|
|
1765
|
+
onInput: (y) => w(p, y.target.value)
|
|
1766
|
+
}, null, 40, An),
|
|
1767
|
+
o("input", {
|
|
1768
|
+
type: "text",
|
|
1769
|
+
value: c.primary[p],
|
|
1770
|
+
onChange: (y) => w(p, y.target.value)
|
|
1771
|
+
}, null, 40, Dn)
|
|
1772
|
+
])
|
|
1773
|
+
])), 64))
|
|
1774
|
+
])
|
|
1775
|
+
]),
|
|
1776
|
+
o("section", jn, [
|
|
1777
|
+
v[5] || (v[5] = o("h3", { class: "xp-theme-customizer__h" }, "文本", -1)),
|
|
1778
|
+
o("div", Nn, [
|
|
1779
|
+
(a(), r(_, null, V(["primary", "regular", "secondary", "placeholder"], (p) => o("div", {
|
|
1780
|
+
key: "t-" + p,
|
|
1781
|
+
class: "xp-theme-customizer__item"
|
|
1782
|
+
}, [
|
|
1783
|
+
o("div", Fn, k(m[p]), 1),
|
|
1784
|
+
o("div", Rn, [
|
|
1785
|
+
o("input", {
|
|
1786
|
+
type: "color",
|
|
1787
|
+
value: $(c[f.value].text[p]),
|
|
1788
|
+
onInput: (y) => I("text", p, y.target.value)
|
|
1789
|
+
}, null, 40, On),
|
|
1790
|
+
o("input", {
|
|
1791
|
+
type: "text",
|
|
1792
|
+
value: c[f.value].text[p],
|
|
1793
|
+
onChange: (y) => I("text", p, y.target.value)
|
|
1794
|
+
}, null, 40, Xn)
|
|
1795
|
+
])
|
|
1796
|
+
])), 64))
|
|
1797
|
+
])
|
|
1798
|
+
]),
|
|
1799
|
+
o("section", Ln, [
|
|
1800
|
+
v[6] || (v[6] = o("h3", { class: "xp-theme-customizer__h" }, "背景", -1)),
|
|
1801
|
+
o("div", Pn, [
|
|
1802
|
+
(a(), r(_, null, V(["base", "page", "soft"], (p) => o("div", {
|
|
1803
|
+
key: "bg-" + p,
|
|
1804
|
+
class: "xp-theme-customizer__item"
|
|
1805
|
+
}, [
|
|
1806
|
+
o("div", Wn, k(m[p]), 1),
|
|
1807
|
+
o("div", Jn, [
|
|
1808
|
+
o("input", {
|
|
1809
|
+
type: "color",
|
|
1810
|
+
value: $(c[f.value].bg[p]),
|
|
1811
|
+
onInput: (y) => I("bg", p, y.target.value)
|
|
1812
|
+
}, null, 40, Hn),
|
|
1813
|
+
o("input", {
|
|
1814
|
+
type: "text",
|
|
1815
|
+
value: c[f.value].bg[p],
|
|
1816
|
+
onChange: (y) => I("bg", p, y.target.value)
|
|
1817
|
+
}, null, 40, Un)
|
|
1818
|
+
])
|
|
1819
|
+
])), 64))
|
|
1820
|
+
])
|
|
1821
|
+
]),
|
|
1822
|
+
o("section", Gn, [
|
|
1823
|
+
v[7] || (v[7] = o("h3", { class: "xp-theme-customizer__h" }, "边框 / 填充", -1)),
|
|
1824
|
+
o("div", qn, [
|
|
1825
|
+
(a(), r(_, null, V(["base", "light", "lighter"], (p) => o("div", {
|
|
1826
|
+
key: "bd-" + p,
|
|
1827
|
+
class: "xp-theme-customizer__item"
|
|
1828
|
+
}, [
|
|
1829
|
+
o("div", Yn, "边框 - " + k(m[p]), 1),
|
|
1830
|
+
o("div", Kn, [
|
|
1831
|
+
o("input", {
|
|
1832
|
+
type: "color",
|
|
1833
|
+
value: $(c[f.value].border[p]),
|
|
1834
|
+
onInput: (y) => I("border", p, y.target.value)
|
|
1835
|
+
}, null, 40, Zn),
|
|
1836
|
+
o("input", {
|
|
1837
|
+
type: "text",
|
|
1838
|
+
value: c[f.value].border[p],
|
|
1839
|
+
onChange: (y) => I("border", p, y.target.value)
|
|
1840
|
+
}, null, 40, Qn)
|
|
1841
|
+
])
|
|
1842
|
+
])), 64)),
|
|
1843
|
+
(a(), r(_, null, V(["base", "light", "lighter"], (p) => o("div", {
|
|
1844
|
+
key: "fl-" + p,
|
|
1845
|
+
class: "xp-theme-customizer__item"
|
|
1846
|
+
}, [
|
|
1847
|
+
o("div", eo, "填充 - " + k(m[p]), 1),
|
|
1848
|
+
o("div", to, [
|
|
1849
|
+
o("input", {
|
|
1850
|
+
type: "color",
|
|
1851
|
+
value: $(c[f.value].fill[p]),
|
|
1852
|
+
onInput: (y) => I("fill", p, y.target.value)
|
|
1853
|
+
}, null, 40, no),
|
|
1854
|
+
o("input", {
|
|
1855
|
+
type: "text",
|
|
1856
|
+
value: c[f.value].fill[p],
|
|
1857
|
+
onChange: (y) => I("fill", p, y.target.value)
|
|
1858
|
+
}, null, 40, oo)
|
|
1859
|
+
])
|
|
1860
|
+
])), 64))
|
|
1861
|
+
])
|
|
1862
|
+
]),
|
|
1863
|
+
v[8] || (v[8] = o("section", { class: "xp-theme-customizer__section" }, [
|
|
1864
|
+
o("h3", { class: "xp-theme-customizer__h" }, "实时预览"),
|
|
1865
|
+
o("div", { class: "xp-theme-customizer__preview" }, [
|
|
1866
|
+
o("div", { class: "xp-preview-row" }, [
|
|
1867
|
+
o("button", { class: "xp-preview-btn xp-preview-btn--primary" }, "Primary"),
|
|
1868
|
+
o("button", { class: "xp-preview-btn xp-preview-btn--success" }, "Success"),
|
|
1869
|
+
o("button", { class: "xp-preview-btn xp-preview-btn--warning" }, "Warning"),
|
|
1870
|
+
o("button", { class: "xp-preview-btn xp-preview-btn--danger" }, "Danger")
|
|
1871
|
+
]),
|
|
1872
|
+
o("div", { class: "xp-preview-text xp-preview-text--primary" }, "主标题文本"),
|
|
1873
|
+
o("div", { class: "xp-preview-text" }, "正文内容样例 Regular text"),
|
|
1874
|
+
o("div", { class: "xp-preview-text xp-preview-text--secondary" }, "次要提示")
|
|
1875
|
+
])
|
|
1876
|
+
], -1))
|
|
1877
|
+
]),
|
|
1878
|
+
o("footer", { class: "xp-theme-customizer__footer" }, [
|
|
1879
|
+
o("button", {
|
|
1880
|
+
class: "xp-theme-customizer__action",
|
|
1881
|
+
onClick: te
|
|
1882
|
+
}, "恢复默认"),
|
|
1883
|
+
o("button", {
|
|
1884
|
+
class: "xp-theme-customizer__action xp-theme-customizer__action--secondary",
|
|
1885
|
+
onClick: ye
|
|
1886
|
+
}, "导入 JSON"),
|
|
1887
|
+
o("button", {
|
|
1888
|
+
class: "xp-theme-customizer__action xp-theme-customizer__action--primary",
|
|
1889
|
+
onClick: ve
|
|
1890
|
+
}, "导出 JSON"),
|
|
1891
|
+
o("button", {
|
|
1892
|
+
class: "xp-theme-customizer__action xp-theme-customizer__action--primary",
|
|
1893
|
+
onClick: ge
|
|
1894
|
+
}, "导出 CSS")
|
|
1895
|
+
]),
|
|
1896
|
+
o("input", {
|
|
1897
|
+
ref_key: "importFileInput",
|
|
1898
|
+
ref: i,
|
|
1899
|
+
type: "file",
|
|
1900
|
+
accept: "application/json,.json,.txt",
|
|
1901
|
+
class: "xp-theme-customizer__hidden",
|
|
1902
|
+
onChange: be
|
|
1903
|
+
}, null, 544)
|
|
1904
|
+
], 8, wn)) : g("", !0)
|
|
1905
|
+
]),
|
|
1906
|
+
_: 1
|
|
1907
|
+
})
|
|
1908
|
+
], 64));
|
|
1909
|
+
}
|
|
1910
|
+
}, X = z([]);
|
|
1911
|
+
let lo = 0;
|
|
1912
|
+
function bo() {
|
|
1913
|
+
function e(n, t = "info", s = 2600) {
|
|
1914
|
+
const l = ++lo;
|
|
1915
|
+
X.value.push({ id: l, message: n, type: t }), setTimeout(() => {
|
|
1916
|
+
const u = X.value.findIndex((d) => d.id === l);
|
|
1917
|
+
u >= 0 && X.value.splice(u, 1);
|
|
1918
|
+
}, s);
|
|
1919
|
+
}
|
|
1920
|
+
return {
|
|
1921
|
+
toasts: X,
|
|
1922
|
+
toast: e,
|
|
1923
|
+
success: (n) => e(n, "success", 2200),
|
|
1924
|
+
error: (n) => e(n, "error", 3600),
|
|
1925
|
+
info: (n) => e(n, "info"),
|
|
1926
|
+
warn: (n) => e(n, "warn", 2800)
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
const ao = {
|
|
1930
|
+
class: "xp-toast-wrap",
|
|
1931
|
+
"aria-live": "polite"
|
|
1932
|
+
}, io = { class: "xp-toast__msg" }, ro = {
|
|
1933
|
+
__name: "Toast",
|
|
1934
|
+
setup(e) {
|
|
1935
|
+
return (n, t) => (a(), R(H, { to: "body" }, [
|
|
1936
|
+
o("div", ao, [
|
|
1937
|
+
A(we, { name: "xp-toast" }, {
|
|
1938
|
+
default: E(() => [
|
|
1939
|
+
(a(!0), r(_, null, V(ce(X), (s) => (a(), r("div", {
|
|
1940
|
+
key: s.id,
|
|
1941
|
+
class: B(["xp-toast", `xp-toast--${s.type}`])
|
|
1942
|
+
}, [
|
|
1943
|
+
t[0] || (t[0] = o("span", {
|
|
1944
|
+
class: "xp-toast__dot",
|
|
1945
|
+
"aria-hidden": "true"
|
|
1946
|
+
}, null, -1)),
|
|
1947
|
+
o("span", io, k(s.message), 1)
|
|
1948
|
+
], 2))), 128))
|
|
1949
|
+
]),
|
|
1950
|
+
_: 1
|
|
1951
|
+
})
|
|
1952
|
+
])
|
|
1953
|
+
]));
|
|
1954
|
+
}
|
|
1955
|
+
}, uo = /* @__PURE__ */ C(ro, [["__scopeId", "data-v-b564201c"]]), co = { class: "xp-tooltip__content" }, po = {
|
|
1956
|
+
__name: "Tooltip",
|
|
1957
|
+
props: {
|
|
1958
|
+
content: {
|
|
1959
|
+
type: String,
|
|
1960
|
+
default: ""
|
|
1961
|
+
},
|
|
1962
|
+
placement: {
|
|
1963
|
+
type: String,
|
|
1964
|
+
default: "top",
|
|
1965
|
+
validator: (e) => ["top", "bottom", "left", "right"].includes(e)
|
|
1966
|
+
},
|
|
1967
|
+
trigger: {
|
|
1968
|
+
type: String,
|
|
1969
|
+
default: "hover",
|
|
1970
|
+
validator: (e) => ["hover", "click", "manual"].includes(e)
|
|
1971
|
+
},
|
|
1972
|
+
disabled: {
|
|
1973
|
+
type: Boolean,
|
|
1974
|
+
default: !1
|
|
1975
|
+
}
|
|
1976
|
+
},
|
|
1977
|
+
setup(e) {
|
|
1978
|
+
const n = e, t = z(!1), s = z({}), l = z(null), u = z(null);
|
|
1979
|
+
let d = null;
|
|
1980
|
+
const x = () => {
|
|
1981
|
+
ue(() => {
|
|
1982
|
+
if (!l.value || !u.value) return;
|
|
1983
|
+
const c = l.value.getBoundingClientRect(), h = u.value.getBoundingClientRect();
|
|
1984
|
+
let $ = 0, w = 0;
|
|
1985
|
+
switch (n.placement) {
|
|
1986
|
+
case "top":
|
|
1987
|
+
$ = c.top - h.height - 8, w = c.left + c.width / 2 - h.width / 2;
|
|
1988
|
+
break;
|
|
1989
|
+
case "bottom":
|
|
1990
|
+
$ = c.bottom + 8, w = c.left + c.width / 2 - h.width / 2;
|
|
1991
|
+
break;
|
|
1992
|
+
case "left":
|
|
1993
|
+
$ = c.top + c.height / 2 - h.height / 2, w = c.left - h.width - 8;
|
|
1994
|
+
break;
|
|
1995
|
+
case "right":
|
|
1996
|
+
$ = c.top + c.height / 2 - h.height / 2, w = c.right + 8;
|
|
1997
|
+
break;
|
|
1998
|
+
}
|
|
1999
|
+
s.value = {
|
|
2000
|
+
top: `${$ + window.scrollY}px`,
|
|
2001
|
+
left: `${w + window.scrollX}px`
|
|
2002
|
+
};
|
|
2003
|
+
});
|
|
2004
|
+
}, m = () => {
|
|
2005
|
+
n.disabled || (clearTimeout(d), d = setTimeout(() => {
|
|
2006
|
+
t.value = !0, x();
|
|
2007
|
+
}, 100));
|
|
2008
|
+
}, f = () => {
|
|
2009
|
+
clearTimeout(d), d = setTimeout(() => {
|
|
2010
|
+
t.value = !1;
|
|
2011
|
+
}, 150);
|
|
2012
|
+
}, i = () => {
|
|
2013
|
+
n.trigger !== "click" || n.disabled || (t.value = !t.value, t.value && x());
|
|
2014
|
+
};
|
|
2015
|
+
return Q(() => {
|
|
2016
|
+
clearTimeout(d);
|
|
2017
|
+
}), (c, h) => (a(), r("div", {
|
|
2018
|
+
class: "xp-tooltip",
|
|
2019
|
+
ref_key: "tooltipRef",
|
|
2020
|
+
ref: l
|
|
2021
|
+
}, [
|
|
2022
|
+
o("div", {
|
|
2023
|
+
class: "xp-tooltip__trigger",
|
|
2024
|
+
onMouseenter: m,
|
|
2025
|
+
onMouseleave: f,
|
|
2026
|
+
onClick: i
|
|
2027
|
+
}, [
|
|
2028
|
+
b(c.$slots, "default", {}, void 0, !0)
|
|
2029
|
+
], 32),
|
|
2030
|
+
(a(), R(H, { to: "body" }, [
|
|
2031
|
+
A(D, { name: "xp-tooltip-fade" }, {
|
|
2032
|
+
default: E(() => [
|
|
2033
|
+
t.value ? (a(), r("div", {
|
|
2034
|
+
key: 0,
|
|
2035
|
+
class: B(["xp-tooltip__popper", [`xp-tooltip__popper--${e.placement}`]]),
|
|
2036
|
+
style: T(s.value),
|
|
2037
|
+
ref_key: "popperRef",
|
|
2038
|
+
ref: u
|
|
2039
|
+
}, [
|
|
2040
|
+
o("div", co, [
|
|
2041
|
+
b(c.$slots, "content", {}, () => [
|
|
2042
|
+
W(k(e.content), 1)
|
|
2043
|
+
], !0)
|
|
2044
|
+
]),
|
|
2045
|
+
h[0] || (h[0] = o("div", { class: "xp-tooltip__arrow" }, null, -1))
|
|
2046
|
+
], 6)) : g("", !0)
|
|
2047
|
+
]),
|
|
2048
|
+
_: 3
|
|
2049
|
+
})
|
|
2050
|
+
]))
|
|
2051
|
+
], 512));
|
|
2052
|
+
}
|
|
2053
|
+
}, fo = /* @__PURE__ */ C(po, [["__scopeId", "data-v-6d9af40b"]]), xe = {
|
|
2054
|
+
XpAlert: Ie,
|
|
2055
|
+
XpAvatar: De,
|
|
2056
|
+
XpBadge: Fe,
|
|
2057
|
+
XpButton: K,
|
|
2058
|
+
XpCard: qe,
|
|
2059
|
+
XpCheckbox: et,
|
|
2060
|
+
XpContextMenu: at,
|
|
2061
|
+
XpDialog: pt,
|
|
2062
|
+
XpDropdown: vt,
|
|
2063
|
+
XpEmpty: $t,
|
|
2064
|
+
XpFileIcon: St,
|
|
2065
|
+
XpIcon: Tt,
|
|
2066
|
+
XpInput: jt,
|
|
2067
|
+
XpProgress: Rt,
|
|
2068
|
+
XpRadio: Wt,
|
|
2069
|
+
XpRate: Yt,
|
|
2070
|
+
XpSwitch: en,
|
|
2071
|
+
XpTabPane: on,
|
|
2072
|
+
XpTabs: un,
|
|
2073
|
+
XpTag: pn,
|
|
2074
|
+
XpThemeCustomizer: so,
|
|
2075
|
+
XpToast: uo,
|
|
2076
|
+
XpTooltip: fo
|
|
2077
|
+
}, mo = (e) => {
|
|
2078
|
+
Object.entries(xe).forEach(([n, t]) => {
|
|
2079
|
+
e.component(n, t);
|
|
1297
2080
|
});
|
|
1298
|
-
},
|
|
1299
|
-
install:
|
|
1300
|
-
...
|
|
2081
|
+
}, _o = {
|
|
2082
|
+
install: mo,
|
|
2083
|
+
...xe
|
|
1301
2084
|
};
|
|
1302
2085
|
export {
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
2086
|
+
N as DEFAULT_PRIMARY,
|
|
2087
|
+
J as DEFAULT_TOKENS,
|
|
2088
|
+
Ie as XpAlert,
|
|
2089
|
+
De as XpAvatar,
|
|
2090
|
+
Fe as XpBadge,
|
|
2091
|
+
K as XpButton,
|
|
2092
|
+
qe as XpCard,
|
|
2093
|
+
et as XpCheckbox,
|
|
2094
|
+
at as XpContextMenu,
|
|
2095
|
+
pt as XpDialog,
|
|
2096
|
+
vt as XpDropdown,
|
|
2097
|
+
$t as XpEmpty,
|
|
2098
|
+
St as XpFileIcon,
|
|
2099
|
+
Tt as XpIcon,
|
|
2100
|
+
jt as XpInput,
|
|
2101
|
+
Rt as XpProgress,
|
|
2102
|
+
Wt as XpRadio,
|
|
2103
|
+
Yt as XpRate,
|
|
2104
|
+
en as XpSwitch,
|
|
2105
|
+
on as XpTabPane,
|
|
2106
|
+
un as XpTabs,
|
|
2107
|
+
pn as XpTag,
|
|
2108
|
+
so as XpThemeCustomizer,
|
|
2109
|
+
uo as XpToast,
|
|
2110
|
+
fo as XpTooltip,
|
|
2111
|
+
P as applyThemeConfig,
|
|
2112
|
+
me as buildCssString,
|
|
2113
|
+
vn as buildCssVars,
|
|
2114
|
+
q as darken,
|
|
2115
|
+
_o as default,
|
|
2116
|
+
vo as deriveDark,
|
|
2117
|
+
xo as deriveLight,
|
|
2118
|
+
F as getDefaultThemeConfig,
|
|
2119
|
+
kn as initTheme,
|
|
2120
|
+
mo as install,
|
|
2121
|
+
yo as isDark,
|
|
2122
|
+
G as lighten,
|
|
2123
|
+
pe as mix,
|
|
2124
|
+
Y as parseColor,
|
|
2125
|
+
_n as resetThemeConfig,
|
|
2126
|
+
L as setTheme,
|
|
2127
|
+
xn as toHex,
|
|
2128
|
+
X as toasts,
|
|
2129
|
+
bn as toggleTheme,
|
|
2130
|
+
$n as useTheme,
|
|
2131
|
+
bo as useToast,
|
|
2132
|
+
go as withAlpha
|
|
1342
2133
|
};
|