@cghbcf/xp-ui 1.0.1 → 1.2.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 +259 -2
- package/dist/cghbcf-xp-ui.cjs.js +5 -4
- package/dist/cghbcf-xp-ui.es.js +1407 -616
- 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 S, openBlock as i, createBlock as R, Transition as A, withCtx as j, createElementBlock as a, normalizeClass as B, createElementVNode as n, toDisplayString as b, renderSlot as y, createTextVNode as H, createCommentVNode as x, computed as z, normalizeStyle as T, onUnmounted as re, Teleport as J, createVNode as E, withModifiers as D, Fragment as k, renderList as V, watch as ae, onMounted as de, onBeforeUnmount as Q, nextTick as ue, inject as ke, provide as be, reactive as we, unref as ce, TransitionGroup as $e } from "vue";
|
|
2
|
+
const C = (e, o) => {
|
|
3
|
+
const t = e.__vccOpts || e;
|
|
4
|
+
for (const [s, l] of o)
|
|
5
|
+
t[s] = l;
|
|
6
|
+
return t;
|
|
7
|
+
}, Ce = { class: "xp-alert__icon" }, Me = { class: "xp-alert__content" }, Se = { class: "xp-alert__title" }, Be = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "xp-alert__description"
|
|
10
|
-
},
|
|
10
|
+
}, ze = {
|
|
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: o }) {
|
|
38
|
+
const t = o, s = S(!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, v) => (i(), R(A, { name: "xp-alert-fade" }, {
|
|
47
|
+
default: j(() => [
|
|
48
|
+
s.value ? (i(), a("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
|
-
|
|
61
|
-
|
|
57
|
+
n("span", Ce, b(l[e.type]), 1),
|
|
58
|
+
n("div", Me, [
|
|
59
|
+
n("span", Se, [
|
|
60
|
+
y(d.$slots, "default", {}, () => [
|
|
61
|
+
H(b(e.title), 1)
|
|
62
62
|
], !0)
|
|
63
63
|
]),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
])) :
|
|
64
|
+
d.$slots.default ? (i(), a("p", Be, [
|
|
65
|
+
y(d.$slots, "default", {}, void 0, !0)
|
|
66
|
+
])) : x("", !0)
|
|
67
67
|
]),
|
|
68
|
-
e.closable ? (
|
|
68
|
+
e.closable ? (i(), a("i", {
|
|
69
69
|
key: 0,
|
|
70
70
|
class: "xp-alert__close-btn",
|
|
71
|
-
onClick:
|
|
72
|
-
}, "×")) :
|
|
73
|
-
], 2)) :
|
|
71
|
+
onClick: u
|
|
72
|
+
}, "×")) : x("", !0)
|
|
73
|
+
], 2)) : x("", !0)
|
|
74
74
|
]),
|
|
75
75
|
_: 3
|
|
76
76
|
}));
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, Ie = /* @__PURE__ */ C(ze, [["__scopeId", "data-v-91d792bd"]]), Te = ["src", "alt"], Ve = {
|
|
79
79
|
key: 1,
|
|
80
80
|
class: "xp-avatar__slot"
|
|
81
|
-
},
|
|
81
|
+
}, je = {
|
|
82
82
|
key: 2,
|
|
83
83
|
class: "xp-avatar__text"
|
|
84
|
-
},
|
|
84
|
+
}, Ee = {
|
|
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: o }) {
|
|
112
|
+
const t = e, s = o, l = S(!1), u = z(() => ({
|
|
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 (v, h) => (i(), a("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 ? (i(), a("img", {
|
|
127
127
|
key: 0,
|
|
128
128
|
src: e.src,
|
|
129
129
|
alt: e.alt,
|
|
130
|
-
onError:
|
|
131
|
-
}, null, 40,
|
|
132
|
-
|
|
133
|
-
])) : (
|
|
130
|
+
onError: d
|
|
131
|
+
}, null, 40, Te)) : v.$slots.default ? (i(), a("span", Ve, [
|
|
132
|
+
y(v.$slots, "default", {}, void 0, !0)
|
|
133
|
+
])) : (i(), a("span", je, b(e.alt || "A"), 1))
|
|
134
134
|
], 6));
|
|
135
135
|
}
|
|
136
|
-
},
|
|
136
|
+
}, Ae = /* @__PURE__ */ C(Ee, [["__scopeId", "data-v-a9a54bc5"]]), De = { 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 o = e, t = z(() => typeof o.value == "number" && o.value > o.max ? `${o.max}+` : o.value), s = z(() => o.value !== 0 && o.value !== "" && o.value !== null && o.value !== void 0);
|
|
163
|
+
return (l, u) => (i(), a("div", {
|
|
164
|
+
class: B(["xp-badge", { "xp-badge--dot": e.isDot, "xp-badge--hidden": e.hidden }])
|
|
165
165
|
}, [
|
|
166
|
-
|
|
167
|
-
!e.hidden && (e.isDot ||
|
|
166
|
+
y(l.$slots, "default", {}, void 0, !0),
|
|
167
|
+
!e.hidden && (e.isDot || s.value) ? (i(), a("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 ?
|
|
175
|
-
], 2)) :
|
|
174
|
+
e.isDot ? x("", !0) : (i(), a("span", De, b(t.value), 1))
|
|
175
|
+
], 2)) : x("", !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: o }) {
|
|
213
|
+
const t = e, s = o, l = (u) => {
|
|
214
|
+
!t.disabled && !t.loading && s("click", u);
|
|
215
215
|
};
|
|
216
|
-
return (
|
|
217
|
-
class:
|
|
216
|
+
return (u, d) => (i(), a("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
|
-
|
|
230
|
+
e.loading ? (i(), a("span", Oe)) : x("", !0),
|
|
231
|
+
n("span", Xe, [
|
|
232
|
+
y(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
|
+
}, He = { class: "xp-card__title" }, We = {
|
|
240
240
|
key: 0,
|
|
241
241
|
class: "xp-card__extra"
|
|
242
|
-
},
|
|
242
|
+
}, Je = { 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 (o, t) => (i(), a("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
|
-
|
|
278
|
-
|
|
276
|
+
e.title || o.$slots.header ? (i(), a("div", Pe, [
|
|
277
|
+
y(o.$slots, "header", {}, () => [
|
|
278
|
+
n("h3", He, b(e.title), 1)
|
|
279
279
|
], !0),
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
])) :
|
|
283
|
-
])) :
|
|
284
|
-
|
|
285
|
-
|
|
280
|
+
o.$slots.extra ? (i(), a("div", We, [
|
|
281
|
+
y(o.$slots, "extra", {}, void 0, !0)
|
|
282
|
+
])) : x("", !0)
|
|
283
|
+
])) : x("", !0),
|
|
284
|
+
n("div", Je, [
|
|
285
|
+
y(o.$slots, "default", {}, void 0, !0)
|
|
286
286
|
]),
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
])) :
|
|
287
|
+
o.$slots.footer ? (i(), a("div", Ue, [
|
|
288
|
+
y(o.$slots, "footer", {}, void 0, !0)
|
|
289
|
+
])) : x("", !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: o }) {
|
|
310
|
+
const t = e, s = o, 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) => (i(), a("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
|
+
n("span", Ye, [
|
|
325
|
+
d[0] || (d[0] = n("span", { class: "xp-checkbox__inner" }, null, -1)),
|
|
326
|
+
n("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
|
-
|
|
335
|
+
n("span", Ze, [
|
|
336
|
+
y(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
|
+
}, ot = ["disabled", "onClick"], nt = {
|
|
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: o }) {
|
|
361
|
+
const t = e, s = o;
|
|
362
|
+
S(null);
|
|
363
|
+
const l = z(() => {
|
|
364
|
+
const f = Math.min(t.items.filter((m) => !m.divider).length, 12) * 32 + 12;
|
|
365
|
+
let r = t.x, c = t.y;
|
|
366
|
+
return r + 220 > window.innerWidth - 8 && (r = Math.max(8, window.innerWidth - 220 - 8)), c + f > window.innerHeight - 8 && (c = Math.max(8, window.innerHeight - f - 8)), { left: `${r}px`, top: `${c}px` };
|
|
367
|
+
});
|
|
368
|
+
function u() {
|
|
369
|
+
s("close");
|
|
370
|
+
}
|
|
371
|
+
function d(h) {
|
|
372
|
+
h.disabled || (s("close"), s("select", h), s("command", h.command), h.onClick && h.onClick());
|
|
373
|
+
}
|
|
374
|
+
function v(h) {
|
|
375
|
+
h.key === "Escape" && t.visible && s("close");
|
|
376
|
+
}
|
|
377
|
+
return re(() => window.removeEventListener("keydown", v)), (h, f) => (i(), R(J, { to: "body" }, [
|
|
378
|
+
E(A, { name: "xp-menu" }, {
|
|
379
|
+
default: j(() => [
|
|
380
|
+
e.visible ? (i(), a("div", {
|
|
381
|
+
key: 0,
|
|
382
|
+
class: "xp-menu-mask",
|
|
383
|
+
onMousedown: u,
|
|
384
|
+
onContextmenu: f[2] || (f[2] = D(() => {
|
|
385
|
+
}, ["prevent"]))
|
|
386
|
+
}, [
|
|
387
|
+
n("div", {
|
|
388
|
+
class: "xp-menu",
|
|
389
|
+
style: T(l.value),
|
|
390
|
+
role: "menu",
|
|
391
|
+
onMousedown: f[0] || (f[0] = D(() => {
|
|
392
|
+
}, ["stop"])),
|
|
393
|
+
onMouseup: f[1] || (f[1] = D(() => {
|
|
394
|
+
}, ["stop"]))
|
|
395
|
+
}, [
|
|
396
|
+
(i(!0), a(k, null, V(e.items, (r, c) => (i(), a(k, { key: c }, [
|
|
397
|
+
r.divider ? (i(), a("div", tt)) : (i(), a("button", {
|
|
398
|
+
key: 1,
|
|
399
|
+
class: B(["xp-menu__item", { "xp-menu__item--danger": r.danger, "xp-menu__item--disabled": r.disabled }]),
|
|
400
|
+
role: "menuitem",
|
|
401
|
+
disabled: r.disabled,
|
|
402
|
+
onClick: (m) => d(r)
|
|
403
|
+
}, [
|
|
404
|
+
r.icon ? (i(), a("span", nt, b(r.icon), 1)) : x("", !0),
|
|
405
|
+
n("span", st, b(r.label), 1)
|
|
406
|
+
], 10, ot))
|
|
407
|
+
], 64))), 128))
|
|
408
|
+
], 36)
|
|
409
|
+
], 32)) : x("", !0)
|
|
410
|
+
]),
|
|
411
|
+
_: 1
|
|
412
|
+
})
|
|
413
|
+
]));
|
|
414
|
+
}
|
|
415
|
+
}, it = /* @__PURE__ */ C(lt, [["__scopeId", "data-v-7477a575"]]), rt = { class: "xp-dialog__header" }, at = { 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,78 +448,86 @@ 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: o }) {
|
|
452
|
+
const t = e, s = o, l = () => {
|
|
453
|
+
s("update:visible", !1), s("close");
|
|
383
454
|
}, u = () => {
|
|
384
|
-
l(
|
|
455
|
+
t.closeOnClickModal && l();
|
|
456
|
+
}, d = () => {
|
|
457
|
+
s("confirm"), l();
|
|
458
|
+
}, v = () => {
|
|
459
|
+
s("cancel"), l();
|
|
385
460
|
};
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
461
|
+
function h(f) {
|
|
462
|
+
f.key === "Escape" && t.visible && l();
|
|
463
|
+
}
|
|
464
|
+
return ae(
|
|
465
|
+
() => t.visible,
|
|
466
|
+
(f) => {
|
|
467
|
+
f ? window.addEventListener("keydown", h) : window.removeEventListener("keydown", h);
|
|
468
|
+
}
|
|
469
|
+
), re(() => window.removeEventListener("keydown", h)), (f, r) => (i(), R(J, { to: "body" }, [
|
|
470
|
+
E(A, { name: "xp-dialog-fade" }, {
|
|
471
|
+
default: j(() => [
|
|
472
|
+
e.visible ? (i(), a("div", {
|
|
390
473
|
key: 0,
|
|
391
474
|
class: "xp-dialog__wrapper",
|
|
392
|
-
onClick:
|
|
475
|
+
onClick: D(u, ["self"])
|
|
393
476
|
}, [
|
|
394
|
-
|
|
395
|
-
|
|
477
|
+
r[0] || (r[0] = n("div", { class: "xp-dialog__mask" }, null, -1)),
|
|
478
|
+
E(A, {
|
|
396
479
|
name: "xp-dialog-slide",
|
|
397
480
|
appear: ""
|
|
398
481
|
}, {
|
|
399
|
-
default:
|
|
400
|
-
e.visible ? (
|
|
482
|
+
default: j(() => [
|
|
483
|
+
e.visible ? (i(), a("div", {
|
|
401
484
|
key: 0,
|
|
402
485
|
class: "xp-dialog",
|
|
403
|
-
style:
|
|
486
|
+
style: T({ width: e.width })
|
|
404
487
|
}, [
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
488
|
+
n("div", rt, [
|
|
489
|
+
n("h3", at, b(e.title), 1),
|
|
490
|
+
n("button", {
|
|
408
491
|
class: "xp-dialog__close",
|
|
409
|
-
onClick:
|
|
492
|
+
onClick: l
|
|
410
493
|
}, "×")
|
|
411
494
|
]),
|
|
412
|
-
|
|
413
|
-
|
|
495
|
+
n("div", dt, [
|
|
496
|
+
y(f.$slots, "default", {}, void 0, !0)
|
|
414
497
|
]),
|
|
415
|
-
f.$slots.footer || e.showDefaultFooter ? (
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
default:
|
|
419
|
-
|
|
498
|
+
f.$slots.footer || e.showDefaultFooter ? (i(), a("div", ut, [
|
|
499
|
+
y(f.$slots, "footer", {}, () => [
|
|
500
|
+
E(K, { onClick: v }, {
|
|
501
|
+
default: j(() => [
|
|
502
|
+
H(b(e.cancelButtonText), 1)
|
|
420
503
|
]),
|
|
421
504
|
_: 1
|
|
422
505
|
}),
|
|
423
|
-
|
|
506
|
+
E(K, {
|
|
424
507
|
type: "primary",
|
|
425
|
-
onClick:
|
|
508
|
+
onClick: d
|
|
426
509
|
}, {
|
|
427
|
-
default:
|
|
428
|
-
|
|
510
|
+
default: j(() => [
|
|
511
|
+
H(b(e.confirmButtonText), 1)
|
|
429
512
|
]),
|
|
430
513
|
_: 1
|
|
431
514
|
})
|
|
432
515
|
], !0)
|
|
433
|
-
])) :
|
|
434
|
-
], 4)) :
|
|
516
|
+
])) : x("", !0)
|
|
517
|
+
], 4)) : x("", !0)
|
|
435
518
|
]),
|
|
436
519
|
_: 3
|
|
437
520
|
})
|
|
438
|
-
])) :
|
|
521
|
+
])) : x("", !0)
|
|
439
522
|
]),
|
|
440
523
|
_: 3
|
|
441
524
|
})
|
|
442
525
|
]));
|
|
443
526
|
}
|
|
444
|
-
},
|
|
527
|
+
}, pt = /* @__PURE__ */ C(ct, [["__scopeId", "data-v-f85c5a46"]]), ft = ["onClick"], ht = { key: 0 }, mt = {
|
|
445
528
|
key: 1,
|
|
446
529
|
class: "xp-dropdown__divider"
|
|
447
|
-
},
|
|
530
|
+
}, vt = {
|
|
448
531
|
__name: "Dropdown",
|
|
449
532
|
props: {
|
|
450
533
|
items: {
|
|
@@ -457,78 +540,445 @@ 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: o }) {
|
|
544
|
+
const t = e, s = o, l = S(!1), u = S({}), d = S(null), v = S(null), h = () => {
|
|
545
|
+
ue(() => {
|
|
546
|
+
if (!d.value || !v.value) return;
|
|
547
|
+
const m = d.value.getBoundingClientRect(), w = v.value.getBoundingClientRect();
|
|
548
|
+
let $ = m.bottom + 6, I = m.left;
|
|
549
|
+
I + w.width > window.innerWidth - 10 && (I = window.innerWidth - w.width - 10), $ + w.height > window.innerHeight - 10 && ($ = m.top - w.height - 6), u.value = {
|
|
550
|
+
top: `${$ + 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 ? (h(), s("open")) : s("close"));
|
|
556
|
+
}, r = (m) => {
|
|
557
|
+
m.disabled || m.divider || (s("select", m), m.command !== void 0 && s("command", m.command, m), l.value = !1, s("close"));
|
|
558
|
+
}, c = (m) => {
|
|
559
|
+
var w;
|
|
560
|
+
l.value && d.value && !d.value.contains(m.target) && !((w = v.value) != null && w.contains(m.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
|
+
}), (m, w) => (i(), a("div", {
|
|
484
567
|
class: "xp-dropdown",
|
|
485
568
|
ref_key: "dropdownRef",
|
|
486
|
-
ref:
|
|
569
|
+
ref: d
|
|
487
570
|
}, [
|
|
488
|
-
|
|
571
|
+
n("div", {
|
|
489
572
|
class: "xp-dropdown__trigger",
|
|
490
|
-
onClick:
|
|
573
|
+
onClick: f
|
|
491
574
|
}, [
|
|
492
|
-
|
|
575
|
+
y(m.$slots, "default", {}, void 0, !0)
|
|
493
576
|
]),
|
|
494
|
-
(
|
|
495
|
-
|
|
496
|
-
default:
|
|
497
|
-
|
|
577
|
+
(i(), R(J, { to: "body" }, [
|
|
578
|
+
E(A, { name: "xp-dropdown-fade" }, {
|
|
579
|
+
default: j(() => [
|
|
580
|
+
l.value ? (i(), a("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: v
|
|
503
586
|
}, [
|
|
504
|
-
(
|
|
587
|
+
(i(!0), a(k, null, V(e.items, ($, I) => (i(), a("div", {
|
|
505
588
|
key: I,
|
|
506
|
-
class:
|
|
507
|
-
onClick: (
|
|
589
|
+
class: B(["xp-dropdown__item", { "xp-dropdown__item--disabled": $.disabled, "xp-dropdown__item--divider": $.divider }]),
|
|
590
|
+
onClick: (te) => r($)
|
|
508
591
|
}, [
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
], 10,
|
|
512
|
-
], 4)) :
|
|
592
|
+
$.divider ? x("", !0) : (i(), a("span", ht, b($.label), 1)),
|
|
593
|
+
$.divider ? (i(), a("span", mt)) : x("", !0)
|
|
594
|
+
], 10, ft))), 128))
|
|
595
|
+
], 4)) : x("", !0)
|
|
513
596
|
]),
|
|
514
597
|
_: 1
|
|
515
598
|
})
|
|
516
599
|
]))
|
|
517
600
|
], 512));
|
|
518
601
|
}
|
|
519
|
-
},
|
|
602
|
+
}, gt = /* @__PURE__ */ C(vt, [["__scopeId", "data-v-ad741cd8"]]), xt = { class: "xp-empty" }, _t = { class: "xp-empty__title" }, yt = {
|
|
603
|
+
key: 0,
|
|
604
|
+
class: "xp-empty__hint"
|
|
605
|
+
}, kt = {
|
|
606
|
+
key: 1,
|
|
607
|
+
class: "xp-empty__action"
|
|
608
|
+
}, bt = {
|
|
609
|
+
__name: "Empty",
|
|
610
|
+
props: {
|
|
611
|
+
title: { type: String, default: "暂无内容" },
|
|
612
|
+
hint: { type: String, default: "" }
|
|
613
|
+
},
|
|
614
|
+
setup(e) {
|
|
615
|
+
return (o, t) => (i(), a("div", xt, [
|
|
616
|
+
y(o.$slots, "icon", {}, () => [
|
|
617
|
+
t[0] || (t[0] = n("div", {
|
|
618
|
+
class: "xp-empty__icon",
|
|
619
|
+
"aria-hidden": "true"
|
|
620
|
+
}, [
|
|
621
|
+
n("svg", {
|
|
622
|
+
width: "46",
|
|
623
|
+
height: "46",
|
|
624
|
+
viewBox: "0 0 24 24",
|
|
625
|
+
fill: "none"
|
|
626
|
+
}, [
|
|
627
|
+
n("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
|
+
n("p", _t, b(e.title), 1),
|
|
637
|
+
e.hint ? (i(), a("p", yt, b(e.hint), 1)) : x("", !0),
|
|
638
|
+
o.$slots.default ? (i(), a("div", kt, [
|
|
639
|
+
y(o.$slots, "default", {}, void 0, !0)
|
|
640
|
+
])) : x("", !0)
|
|
641
|
+
]));
|
|
642
|
+
}
|
|
643
|
+
}, wt = /* @__PURE__ */ C(bt, [["__scopeId", "data-v-93d5e1e9"]]), $t = ["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 (o, t) => (i(), a("span", {
|
|
651
|
+
class: "xp-file-icon",
|
|
652
|
+
style: T({ width: e.size + "px", height: e.size + "px" }),
|
|
653
|
+
"aria-hidden": "true"
|
|
654
|
+
}, [
|
|
655
|
+
(i(), a("svg", {
|
|
656
|
+
width: e.size,
|
|
657
|
+
height: e.size,
|
|
658
|
+
viewBox: "0 0 24 24",
|
|
659
|
+
fill: "none"
|
|
660
|
+
}, [
|
|
661
|
+
e.type === "folder" ? (i(), a(k, { key: 0 }, [
|
|
662
|
+
t[0] || (t[0] = n("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] = n("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" ? (i(), a(k, { key: 1 }, [
|
|
672
|
+
t[2] || (t[2] = n("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] = n("circle", {
|
|
684
|
+
cx: "9",
|
|
685
|
+
cy: "10",
|
|
686
|
+
r: "1.8",
|
|
687
|
+
fill: "#3D8EAD"
|
|
688
|
+
}, null, -1)),
|
|
689
|
+
t[4] || (t[4] = n("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" ? (i(), a(k, { key: 2 }, [
|
|
698
|
+
t[5] || (t[5] = n("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] = n("path", {
|
|
710
|
+
d: "M16 10.5l5-3v9l-5-3z",
|
|
711
|
+
fill: "#8A48C4"
|
|
712
|
+
}, null, -1))
|
|
713
|
+
], 64)) : e.type === "audio" ? (i(), a(k, { key: 3 }, [
|
|
714
|
+
t[7] || (t[7] = n("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] = n("circle", {
|
|
723
|
+
cx: "6.6",
|
|
724
|
+
cy: "18",
|
|
725
|
+
r: "2.4",
|
|
726
|
+
fill: "#C2569B"
|
|
727
|
+
}, null, -1)),
|
|
728
|
+
t[9] || (t[9] = n("circle", {
|
|
729
|
+
cx: "16.6",
|
|
730
|
+
cy: "15",
|
|
731
|
+
r: "2.4",
|
|
732
|
+
fill: "#C2569B"
|
|
733
|
+
}, null, -1))
|
|
734
|
+
], 64)) : e.type === "pdf" ? (i(), a(k, { key: 4 }, [
|
|
735
|
+
t[10] || (t[10] = n("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] = n("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" ? (i(), a(k, { key: 5 }, [
|
|
756
|
+
t[12] || (t[12] = n("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] = n("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] = n("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] = n("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" ? (i(), a(k, { key: 6 }, [
|
|
784
|
+
t[16] || (t[16] = n("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] = n("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" ? (i(), a(k, { key: 7 }, [
|
|
802
|
+
t[18] || (t[18] = n("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] = n("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] = n("circle", {
|
|
820
|
+
cx: "9",
|
|
821
|
+
cy: "10.4",
|
|
822
|
+
r: "1.3",
|
|
823
|
+
fill: "#CC8420"
|
|
824
|
+
}, null, -1)),
|
|
825
|
+
t[21] || (t[21] = n("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" ? (i(), a(k, { key: 8 }, [
|
|
834
|
+
t[22] || (t[22] = n("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] = n("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" ? (i(), a(k, { key: 9 }, [
|
|
851
|
+
t[24] || (t[24] = n("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] = n("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" ? (i(), a(k, { key: 10 }, [
|
|
866
|
+
t[26] || (t[26] = n("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] = n("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)) : (i(), a(k, { key: 11 }, [
|
|
880
|
+
t[28] || (t[28] = n("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] = n("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] = n("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, $t))
|
|
903
|
+
], 4));
|
|
904
|
+
}
|
|
905
|
+
}, Mt = /* @__PURE__ */ C(Ct, [["__scopeId", "data-v-c598c294"]]), St = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M4 12h10M10 8l4 4-4 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>', Bt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M15 5l-7 7 7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>', zt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 9l6 6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>', It = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 14l6-6 6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>', Tt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 6l12 12M18 6L6 18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>', Vt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M12 11v5M9.5 13.5h5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>', jt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>', Et = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M9 5l7 7-7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>', At = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><rect x="4" y="4" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/><rect x="14" y="4" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/><rect x="4" y="14" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/><rect x="14" y="14" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/></svg>', Dt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M4 11l8-7 8 7v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/><path d="M10 21v-6h4v6" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg>', Nt = '<?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>', Ft = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M4 6h16M4 12h16M4 18h16" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>', Rt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M20 12a8 8 0 1 1-2.34-5.66M20 4v5h-5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>', Ot = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><circle cx="12" cy="12" r="3.2" stroke="currentColor" stroke-width="1.8"/><path d="M12 2.8v2.6M12 18.6v2.6M2.8 12h2.6M18.6 12h2.6M5.5 5.5l1.8 1.8M16.7 16.7l1.8 1.8M18.5 5.5l-1.8 1.8M7.3 16.7l-1.8 1.8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>', Xt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z" fill="currentColor" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/></svg>', Lt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/></svg>', Pt = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 19V6M6 12l6-6 6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>', Ht = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 16V5M7.5 9.5L12 5l4.5 4.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>', Wt = ["viewBox", "innerHTML"], Jt = {
|
|
906
|
+
key: 2,
|
|
907
|
+
class: "xp-icon__fallback"
|
|
908
|
+
}, Ut = {
|
|
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 o = ["small", "medium", "large"], t = e, s = /* @__PURE__ */ Object.assign({ "./icons/arrow-right.svg": St, "./icons/back.svg": Bt, "./icons/chevron-down.svg": zt, "./icons/chevron-up.svg": It, "./icons/close.svg": Tt, "./icons/folder-add.svg": Vt, "./icons/folder.svg": jt, "./icons/forward.svg": Et, "./icons/grid.svg": At, "./icons/home.svg": Dt, "./icons/jiantou.svg": Nt, "./icons/list.svg": Ft, "./icons/refresh.svg": Rt, "./icons/settings.svg": Ot, "./icons/star-fill.svg": Xt, "./icons/star.svg": Lt, "./icons/up.svg": Pt, "./icons/upload.svg": Ht }), l = (r) => r && r.replace(/\bfill\s*=\s*["'](?!none["'])[^"']+["']/gi, 'fill="currentColor"').replace(/\bstroke\s*=\s*["'](?!none["'])[^"']+["']/gi, 'stroke="currentColor"'), u = z(() => {
|
|
934
|
+
if (!t.name) return null;
|
|
935
|
+
const r = `./icons/${t.name}.svg`, c = s[r];
|
|
936
|
+
if (!c) return null;
|
|
937
|
+
const m = c.match(/<svg[^>]*>([\s\S]*)<\/svg>/i), w = l(m ? m[1] : c), $ = c.match(/viewBox\s*=\s*["']([^"']+)["']/i);
|
|
938
|
+
return {
|
|
939
|
+
inner: w,
|
|
940
|
+
viewBox: $ ? $[1] : "0 0 24 24"
|
|
941
|
+
};
|
|
942
|
+
}), d = z(() => o.includes(String(t.size))), v = z(() => {
|
|
943
|
+
if (d.value) return null;
|
|
944
|
+
const r = t.size;
|
|
945
|
+
return typeof r == "number" ? `${r}px` : typeof r == "string" && r.trim() ? /^\d+(\.\d+)?$/.test(r.trim()) ? `${r}px` : r.trim() : null;
|
|
946
|
+
}), h = z(() => {
|
|
947
|
+
const r = [];
|
|
948
|
+
return d.value && r.push(`xp-icon--${t.size}`), t.spin && r.push("xp-icon--spin"), r;
|
|
949
|
+
}), f = z(() => {
|
|
950
|
+
const r = {};
|
|
951
|
+
return t.color && (r.color = t.color), t.rotate && (r.transform = `rotate(${t.rotate}deg)`), v.value && (r.width = v.value, r.height = v.value, r.fontSize = v.value), r;
|
|
952
|
+
});
|
|
953
|
+
return (r, c) => (i(), a("i", {
|
|
954
|
+
class: B(["xp-icon", h.value]),
|
|
955
|
+
style: T(f.value)
|
|
956
|
+
}, [
|
|
957
|
+
r.$slots.default ? y(r.$slots, "default", { key: 0 }, void 0, !0) : u.value ? (i(), a("svg", {
|
|
958
|
+
key: 1,
|
|
959
|
+
viewBox: u.value.viewBox,
|
|
960
|
+
innerHTML: u.value.inner
|
|
961
|
+
}, null, 8, Wt)) : (i(), a("span", Jt, "?"))
|
|
962
|
+
], 6));
|
|
963
|
+
}
|
|
964
|
+
}, Gt = /* @__PURE__ */ C(Ut, [["__scopeId", "data-v-9ed9f36d"]]), qt = {
|
|
520
965
|
key: 0,
|
|
521
966
|
class: "xp-input__prefix"
|
|
522
|
-
},
|
|
967
|
+
}, Yt = ["id", "type", "value", "placeholder", "disabled", "maxlength"], Kt = {
|
|
523
968
|
key: 2,
|
|
524
969
|
class: "xp-input__suffix"
|
|
525
|
-
},
|
|
970
|
+
}, Zt = {
|
|
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: o, emit: t }) {
|
|
1011
|
+
const s = t, l = S(null), u = S(!1), d = (r) => {
|
|
1012
|
+
s("update:modelValue", r.target.value);
|
|
1013
|
+
}, v = (r) => {
|
|
1014
|
+
u.value = !0, s("focus", r);
|
|
1015
|
+
}, h = (r) => {
|
|
1016
|
+
u.value = !1, s("blur", r);
|
|
567
1017
|
}, f = () => {
|
|
568
|
-
|
|
1018
|
+
s("update:modelValue", ""), s("clear"), l.value && l.value.focus();
|
|
569
1019
|
};
|
|
570
|
-
return (
|
|
571
|
-
|
|
1020
|
+
return o({
|
|
1021
|
+
focus: () => l.value && l.value.focus(),
|
|
1022
|
+
select: () => l.value && l.value.select(),
|
|
1023
|
+
blur: () => l.value && l.value.blur()
|
|
1024
|
+
}), (r, c) => (i(), a("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": r.$slots.prefix,
|
|
1030
|
+
"xp-input--suffix": r.$slots.suffix || e.showClear,
|
|
1031
|
+
"xp-input--focus": u.value
|
|
578
1032
|
}
|
|
579
1033
|
]])
|
|
580
1034
|
}, [
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
])) :
|
|
584
|
-
|
|
1035
|
+
r.$slots.prefix ? (i(), a("span", qt, [
|
|
1036
|
+
y(r.$slots, "prefix", {}, void 0, !0)
|
|
1037
|
+
])) : x("", !0),
|
|
1038
|
+
n("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: v,
|
|
1050
|
+
onBlur: h
|
|
1051
|
+
}, null, 40, Yt),
|
|
1052
|
+
e.showClear && e.modelValue && !e.disabled ? (i(), a("span", {
|
|
598
1053
|
key: 1,
|
|
599
1054
|
class: "xp-input__clear",
|
|
600
1055
|
onClick: f
|
|
601
|
-
}, "×")) :
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
])) :
|
|
1056
|
+
}, "×")) : x("", !0),
|
|
1057
|
+
r.$slots.suffix && !e.showClear ? (i(), a("span", Kt, [
|
|
1058
|
+
y(r.$slots, "suffix", {}, void 0, !0)
|
|
1059
|
+
])) : x("", !0)
|
|
605
1060
|
], 2));
|
|
606
1061
|
}
|
|
607
|
-
},
|
|
1062
|
+
}, Qt = /* @__PURE__ */ C(Zt, [["__scopeId", "data-v-46247483"]]), eo = {
|
|
608
1063
|
key: 0,
|
|
609
1064
|
class: "xp-progress__text"
|
|
610
|
-
},
|
|
1065
|
+
}, to = {
|
|
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 o = e, t = z(
|
|
1099
|
+
() => o.type === "line" ? { height: `${o.strokeWidth}px` } : {}
|
|
1100
|
+
), s = z(() => o.color ? o.color : o.status === "success" ? "var(--xp-color-success)" : o.status === "warning" ? "var(--xp-color-warning)" : o.status === "exception" ? "var(--xp-color-danger)" : "var(--xp-color-primary)");
|
|
1101
|
+
return (l, u) => (i(), a("div", {
|
|
1102
|
+
class: B(["xp-progress", [`xp-progress--${e.type}`]])
|
|
641
1103
|
}, [
|
|
642
|
-
|
|
643
|
-
|
|
1104
|
+
n("div", {
|
|
1105
|
+
class: "xp-progress__bar",
|
|
1106
|
+
style: T(t.value)
|
|
1107
|
+
}, [
|
|
1108
|
+
n("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 ? (
|
|
649
|
-
|
|
650
|
-
|
|
1112
|
+
], 4),
|
|
1113
|
+
e.showText ? (i(), a("span", eo, [
|
|
1114
|
+
y(l.$slots, "default", {}, () => [
|
|
1115
|
+
H(b(e.percentage) + "%", 1)
|
|
651
1116
|
], !0)
|
|
652
|
-
])) :
|
|
1117
|
+
])) : x("", !0)
|
|
653
1118
|
], 2));
|
|
654
1119
|
}
|
|
655
|
-
},
|
|
1120
|
+
}, oo = /* @__PURE__ */ C(to, [["__scopeId", "data-v-244dca2c"]]), no = { class: "xp-radio__input" }, so = ["checked", "disabled"], lo = { class: "xp-radio__label" }, io = {
|
|
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: o }) {
|
|
1138
|
+
const t = e, s = o, l = () => {
|
|
1139
|
+
t.disabled || (s("update:modelValue", t.value), s("change", t.value));
|
|
675
1140
|
};
|
|
676
|
-
return (
|
|
677
|
-
class:
|
|
1141
|
+
return (u, d) => (i(), a("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
|
+
n("span", no, [
|
|
1150
|
+
d[0] || (d[0] = n("span", { class: "xp-radio__inner" }, null, -1)),
|
|
1151
|
+
n("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, so)
|
|
693
1158
|
]),
|
|
694
|
-
|
|
695
|
-
|
|
1159
|
+
n("span", lo, [
|
|
1160
|
+
y(u.$slots, "default", {}, void 0, !0)
|
|
696
1161
|
])
|
|
697
1162
|
], 2));
|
|
698
1163
|
}
|
|
699
|
-
},
|
|
1164
|
+
}, ro = /* @__PURE__ */ C(io, [["__scopeId", "data-v-02a0d80d"]]), ao = { class: "xp-rate" }, uo = ["onClick", "onMouseenter"], co = { class: "xp-rate__star" }, po = {
|
|
700
1165
|
key: 0,
|
|
701
1166
|
class: "xp-rate__text"
|
|
702
|
-
},
|
|
1167
|
+
}, fo = {
|
|
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: o }) {
|
|
1193
|
+
const t = e, s = o, l = S(0), u = z(() => l.value || t.modelValue), d = (h) => {
|
|
1194
|
+
const f = u.value - h + 1;
|
|
1195
|
+
return f >= 1 ? 100 : f > 0 ? f * 100 : 0;
|
|
1196
|
+
}, v = (h) => {
|
|
1197
|
+
t.disabled || (s("update:modelValue", h), s("change", h));
|
|
733
1198
|
};
|
|
734
|
-
return (
|
|
735
|
-
(
|
|
736
|
-
key:
|
|
737
|
-
class:
|
|
1199
|
+
return (h, f) => (i(), a("div", ao, [
|
|
1200
|
+
(i(!0), a(k, null, V(e.max, (r) => (i(), a("span", {
|
|
1201
|
+
key: r,
|
|
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) => v(r),
|
|
1207
|
+
onMouseenter: (c) => l.value = r,
|
|
1208
|
+
onMouseleave: f[0] || (f[0] = (c) => l.value = 0)
|
|
744
1209
|
}, [
|
|
745
|
-
|
|
746
|
-
|
|
1210
|
+
n("span", co, [
|
|
1211
|
+
f[1] || (f[1] = n("span", { class: "xp-rate__star-outer" }, "★", -1)),
|
|
1212
|
+
n("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(r) + "%", color: e.color })
|
|
1215
|
+
}, " ★ ", 4)
|
|
751
1216
|
])
|
|
752
|
-
], 46,
|
|
753
|
-
e.showText && !e.disabled ? (
|
|
1217
|
+
], 46, uo))), 128)),
|
|
1218
|
+
e.showText && !e.disabled ? (i(), a("span", po, b(e.modelValue) + " / " + b(e.max), 1)) : x("", !0)
|
|
754
1219
|
]));
|
|
755
1220
|
}
|
|
756
|
-
},
|
|
1221
|
+
}, ho = /* @__PURE__ */ C(fo, [["__scopeId", "data-v-214323a3"]]), mo = ["aria-checked"], vo = {
|
|
757
1222
|
key: 0,
|
|
758
1223
|
class: "xp-switch__label"
|
|
759
|
-
},
|
|
1224
|
+
}, go = {
|
|
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: o }) {
|
|
1243
|
+
const t = e, s = o, 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) => (i(), a("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] = n("span", { class: "xp-switch__core" }, [
|
|
1261
|
+
n("span", { class: "xp-switch__action" })
|
|
797
1262
|
], -1)),
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
])) :
|
|
801
|
-
], 10,
|
|
1263
|
+
u.$slots.default ? (i(), a("span", vo, [
|
|
1264
|
+
y(u.$slots, "default", {}, void 0, !0)
|
|
1265
|
+
])) : x("", !0)
|
|
1266
|
+
], 10, mo));
|
|
802
1267
|
}
|
|
803
|
-
},
|
|
1268
|
+
}, xo = /* @__PURE__ */ C(go, [["__scopeId", "data-v-5a5e33c5"]]), _o = {
|
|
804
1269
|
key: 0,
|
|
805
1270
|
class: "xp-tab-pane"
|
|
806
|
-
},
|
|
1271
|
+
}, yo = {
|
|
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
|
-
|
|
830
|
-
])) :
|
|
1288
|
+
const o = e, t = ke("xpTabs", null), s = z(() => t ? t.currentValue.value === o.name : !0);
|
|
1289
|
+
return de(() => {
|
|
1290
|
+
t && t.addTab && t.addTab({ name: o.name, title: o.title, disabled: o.disabled });
|
|
1291
|
+
}), Q(() => {
|
|
1292
|
+
t && t.removeTab && t.removeTab(o.name);
|
|
1293
|
+
}), (l, u) => s.value ? (i(), a("div", _o, [
|
|
1294
|
+
y(l.$slots, "default", {}, void 0, !0)
|
|
1295
|
+
])) : x("", !0);
|
|
831
1296
|
}
|
|
832
|
-
},
|
|
1297
|
+
}, ko = /* @__PURE__ */ C(yo, [["__scopeId", "data-v-6fe7943a"]]), bo = { class: "xp-tabs" }, wo = {
|
|
833
1298
|
class: "xp-tabs__nav",
|
|
834
1299
|
role: "tablist"
|
|
835
|
-
},
|
|
1300
|
+
}, $o = ["onClick"], Co = { class: "xp-tabs__content" }, Mo = {
|
|
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: o }) {
|
|
1310
|
+
const t = e, s = o, l = S([]), u = z(() => {
|
|
1311
|
+
var r;
|
|
1312
|
+
return t.modelValue !== null && t.modelValue !== void 0 && t.modelValue !== "" ? t.modelValue : ((r = l.value[0]) == null ? void 0 : r.name) ?? null;
|
|
1313
|
+
}), d = z(() => {
|
|
1314
|
+
const r = l.value.findIndex((m) => m.name === u.value);
|
|
850
1315
|
return {
|
|
851
|
-
transform: `translateX(${(
|
|
852
|
-
width: `${
|
|
1316
|
+
transform: `translateX(${(r >= 0 ? r : 0) * 100}%)`,
|
|
1317
|
+
width: `${l.value.length ? 100 / l.value.length : 0}%`
|
|
853
1318
|
};
|
|
854
|
-
}),
|
|
855
|
-
|
|
1319
|
+
}), v = (r) => {
|
|
1320
|
+
r.disabled || (s("update:modelValue", r.name), s("change", r.name));
|
|
856
1321
|
};
|
|
857
|
-
return
|
|
858
|
-
|
|
859
|
-
}, removeTab: (
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
}, currentValue:
|
|
863
|
-
|
|
864
|
-
(
|
|
865
|
-
key:
|
|
866
|
-
class:
|
|
1322
|
+
return be("xpTabs", { addTab: (r) => {
|
|
1323
|
+
l.value.find((c) => c.name === r.name) || l.value.push(r);
|
|
1324
|
+
}, removeTab: (r) => {
|
|
1325
|
+
const c = l.value.findIndex((m) => m.name === r);
|
|
1326
|
+
c >= 0 && l.value.splice(c, 1);
|
|
1327
|
+
}, currentValue: u }), (r, c) => (i(), a("div", bo, [
|
|
1328
|
+
n("div", wo, [
|
|
1329
|
+
(i(!0), a(k, null, V(l.value, (m, w) => (i(), a("div", {
|
|
1330
|
+
key: m.name || w,
|
|
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 === m.name,
|
|
1334
|
+
"xp-tabs__item--disabled": m.disabled
|
|
870
1335
|
}
|
|
871
1336
|
]]),
|
|
872
1337
|
role: "tab",
|
|
873
|
-
onClick: (
|
|
874
|
-
},
|
|
875
|
-
|
|
1338
|
+
onClick: ($) => v(m)
|
|
1339
|
+
}, b(m.title), 11, $o))), 128)),
|
|
1340
|
+
n("div", {
|
|
876
1341
|
class: "xp-tabs__active-bar",
|
|
877
|
-
style:
|
|
1342
|
+
style: T(d.value)
|
|
878
1343
|
}, null, 4)
|
|
879
1344
|
]),
|
|
880
|
-
|
|
881
|
-
|
|
1345
|
+
n("div", Co, [
|
|
1346
|
+
y(r.$slots, "default", {}, void 0, !0)
|
|
882
1347
|
])
|
|
883
1348
|
]));
|
|
884
1349
|
}
|
|
885
|
-
},
|
|
1350
|
+
}, So = /* @__PURE__ */ C(Mo, [["__scopeId", "data-v-3e658dba"]]), Bo = {
|
|
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: o }) {
|
|
1382
|
+
const t = e, s = o, l = z(() => 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 = (v) => {
|
|
1387
|
+
s("click", v);
|
|
1388
|
+
}, d = (v) => {
|
|
1389
|
+
s("close", v);
|
|
925
1390
|
};
|
|
926
|
-
return (
|
|
927
|
-
class:
|
|
1391
|
+
return (v, h) => (i(), a("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
|
-
|
|
940
|
-
e.closable ? (
|
|
1404
|
+
y(v.$slots, "default", {}, void 0, !0),
|
|
1405
|
+
e.closable ? (i(), a("span", {
|
|
941
1406
|
key: 0,
|
|
942
1407
|
class: "xp-tag__close",
|
|
943
|
-
onClick:
|
|
944
|
-
}, "×")) :
|
|
1408
|
+
onClick: D(d, ["stop"])
|
|
1409
|
+
}, "×")) : x("", !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
|
+
}, zo = /* @__PURE__ */ C(Bo, [["__scopeId", "data-v-903813de"]]), Io = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, To = /^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 o = e.trim(), t = o.match(Io);
|
|
1416
|
+
if (t) {
|
|
1417
|
+
let l = t[1];
|
|
1418
|
+
l.length === 3 && (l = l.split("").map((h) => h + h).join(""));
|
|
1419
|
+
const u = parseInt(l.slice(0, 2), 16), d = parseInt(l.slice(2, 4), 16), v = parseInt(l.slice(4, 6), 16);
|
|
1420
|
+
return { r: u, g: d, b: v, a: 1 };
|
|
1054
1421
|
}
|
|
1055
|
-
const
|
|
1056
|
-
return
|
|
1057
|
-
r: parseInt(
|
|
1058
|
-
g: parseInt(
|
|
1059
|
-
b: parseInt(
|
|
1060
|
-
a:
|
|
1422
|
+
const s = o.match(To);
|
|
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 Vo(e) {
|
|
1064
1431
|
return Math.max(0, Math.min(255, Math.round(e)));
|
|
1065
1432
|
}
|
|
1066
|
-
function
|
|
1067
|
-
const
|
|
1068
|
-
return "#" +
|
|
1433
|
+
function jo(e, o, t) {
|
|
1434
|
+
const s = (l) => Vo(l).toString(16).padStart(2, "0");
|
|
1435
|
+
return "#" + s(e) + s(o) + s(t);
|
|
1069
1436
|
}
|
|
1070
|
-
function
|
|
1071
|
-
const
|
|
1072
|
-
if (!
|
|
1073
|
-
const
|
|
1074
|
-
return
|
|
1437
|
+
function pe(e, o, t = 0.5) {
|
|
1438
|
+
const s = Y(e), l = Y(o);
|
|
1439
|
+
if (!s || !l) return "#000000";
|
|
1440
|
+
const u = Math.max(0, Math.min(1, t)), d = s.r * (1 - u) + l.r * u, v = s.g * (1 - u) + l.g * u, h = s.b * (1 - u) + l.b * u;
|
|
1441
|
+
return jo(d, v, h);
|
|
1075
1442
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return
|
|
1443
|
+
function G(e, o) {
|
|
1444
|
+
return pe(e, "#ffffff", o);
|
|
1078
1445
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return
|
|
1446
|
+
function q(e, o) {
|
|
1447
|
+
return pe(e, "#000000", o);
|
|
1081
1448
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return
|
|
1449
|
+
function jn(e) {
|
|
1450
|
+
return G(e, 0.3);
|
|
1084
1451
|
}
|
|
1085
|
-
function
|
|
1086
|
-
return
|
|
1452
|
+
function En(e) {
|
|
1453
|
+
return q(e, 0.2);
|
|
1087
1454
|
}
|
|
1088
|
-
function
|
|
1089
|
-
const
|
|
1090
|
-
if (!
|
|
1091
|
-
const
|
|
1092
|
-
return `rgba(${
|
|
1455
|
+
function An(e, o) {
|
|
1456
|
+
const t = Y(e);
|
|
1457
|
+
if (!t) return e;
|
|
1458
|
+
const s = Math.max(0, Math.min(1, o));
|
|
1459
|
+
return `rgba(${t.r}, ${t.g}, ${t.b}, ${s})`;
|
|
1093
1460
|
}
|
|
1094
|
-
function
|
|
1095
|
-
const
|
|
1096
|
-
return
|
|
1461
|
+
function Dn(e) {
|
|
1462
|
+
const o = Y(e);
|
|
1463
|
+
return o ? (o.r * 299 + o.g * 587 + o.b * 114) / 1e3 < 128 : !1;
|
|
1097
1464
|
}
|
|
1098
|
-
function
|
|
1099
|
-
const
|
|
1100
|
-
return { base: e, light:
|
|
1465
|
+
function fe(e, o) {
|
|
1466
|
+
const t = G(e, 0.3), s = q(e, 0.2), l = o === "dark" ? q(e, 0.85) : G(e, 0.9), u = o === "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
|
+
}, W = {
|
|
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(W.light),
|
|
1505
|
+
dark: se(W.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, o) {
|
|
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, o);
|
|
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 ie(e) {
|
|
1521
|
+
const o = [];
|
|
1522
|
+
for (const t of Object.keys(e.text)) o.push(` --xp-text-color-${t}: ${e.text[t]};`);
|
|
1523
|
+
o.push(` --xp-border-color: ${e.border.base};`), o.push(` --xp-border-color-light: ${e.border.light};`), o.push(` --xp-border-color-lighter: ${e.border.lighter};`);
|
|
1524
|
+
for (const t of Object.keys(e.bg)) {
|
|
1525
|
+
const s = t === "base" ? "" : `-${t}`;
|
|
1526
|
+
o.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
|
+
o.push(` --xp-fill-color${s}: ${e.fill[t]};`);
|
|
1164
1531
|
}
|
|
1165
|
-
for (const
|
|
1166
|
-
return
|
|
1532
|
+
for (const t of Object.keys(e.shadow)) o.push(` --xp-shadow-${t}: ${e.shadow[t]};`);
|
|
1533
|
+
return o.join(`
|
|
1167
1534
|
`);
|
|
1168
1535
|
}
|
|
1169
|
-
function
|
|
1170
|
-
const
|
|
1171
|
-
for (const
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1536
|
+
function Eo(e, o) {
|
|
1537
|
+
const t = {}, s = e.primary || N, l = ["primary", "success", "warning", "danger", "info"];
|
|
1538
|
+
for (const d of l) {
|
|
1539
|
+
const v = s[d] || N[d], h = fe(v, o);
|
|
1540
|
+
t[`--xp-color-${d}`] = v, t[`--xp-color-${d}-light`] = h.light, t[`--xp-color-${d}-dark`] = h.dark, t[`--xp-color-${d}-bg`] = h.bg, t[`--xp-color-${d}-border`] = h.border;
|
|
1174
1541
|
}
|
|
1175
|
-
const
|
|
1176
|
-
for (const
|
|
1177
|
-
|
|
1178
|
-
for (const
|
|
1179
|
-
for (const
|
|
1180
|
-
for (const
|
|
1181
|
-
return
|
|
1542
|
+
const u = e[o] || W[o];
|
|
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 he(e) {
|
|
1184
1551
|
return [
|
|
1185
1552
|
':root, [data-theme="light"] {',
|
|
1186
|
-
|
|
1187
|
-
|
|
1553
|
+
le(e.primary || N, "light"),
|
|
1554
|
+
ie(e.light || W.light),
|
|
1188
1555
|
"}",
|
|
1189
1556
|
"",
|
|
1190
1557
|
'[data-theme="dark"] {',
|
|
1191
|
-
|
|
1192
|
-
|
|
1558
|
+
le(e.primary || N, "dark"),
|
|
1559
|
+
ie(e.dark || W.dark),
|
|
1193
1560
|
"}"
|
|
1194
1561
|
].join(`
|
|
1195
1562
|
`);
|
|
1196
1563
|
}
|
|
1197
|
-
let
|
|
1198
|
-
function
|
|
1564
|
+
let U = null;
|
|
1565
|
+
function Ao() {
|
|
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 Do(e) {
|
|
1572
|
+
const o = Ao();
|
|
1573
|
+
o && (o.textContent = he(e));
|
|
1207
1574
|
}
|
|
1208
|
-
const
|
|
1209
|
-
function
|
|
1210
|
-
if (["light", "dark"].includes(e) && (
|
|
1575
|
+
const ee = S("light"), me = S(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 No() {
|
|
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 o = F();
|
|
1591
|
+
e.primary && (o.primary = { ...o.primary, ...e.primary }), e.light && (o.light = Z(o.light, e.light)), e.dark && (o.dark = Z(o.dark, e.dark)), me.value = o, Do(o);
|
|
1225
1592
|
try {
|
|
1226
|
-
localStorage.setItem("xp-ui-theme-config", JSON.stringify(
|
|
1593
|
+
localStorage.setItem("xp-ui-theme-config", JSON.stringify(o));
|
|
1227
1594
|
} catch {
|
|
1228
1595
|
}
|
|
1229
1596
|
}
|
|
1230
|
-
function
|
|
1231
|
-
|
|
1597
|
+
function Fo() {
|
|
1598
|
+
P(F());
|
|
1232
1599
|
}
|
|
1233
|
-
function
|
|
1600
|
+
function Ro() {
|
|
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 o = null;
|
|
1242
1609
|
try {
|
|
1243
|
-
|
|
1610
|
+
o = localStorage.getItem("xp-ui-theme-config");
|
|
1244
1611
|
} catch {
|
|
1245
1612
|
}
|
|
1246
|
-
if (
|
|
1613
|
+
if (o)
|
|
1247
1614
|
try {
|
|
1248
|
-
|
|
1615
|
+
P(JSON.parse(o));
|
|
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, o) {
|
|
1623
|
+
if (!o || typeof o != "object") return e;
|
|
1624
|
+
const t = Array.isArray(e) ? [...e] : { ...e };
|
|
1625
|
+
for (const s of Object.keys(o))
|
|
1626
|
+
o[s] && typeof o[s] == "object" && !Array.isArray(o[s]) ? t[s] = Z(e[s] || {}, o[s]) : t[s] = o[s];
|
|
1627
|
+
return t;
|
|
1261
1628
|
}
|
|
1262
|
-
function
|
|
1629
|
+
function Oo() {
|
|
1630
|
+
return {
|
|
1631
|
+
theme: ee,
|
|
1632
|
+
themeConfig: me,
|
|
1633
|
+
setTheme: L,
|
|
1634
|
+
toggleTheme: No,
|
|
1635
|
+
initTheme: Ro,
|
|
1636
|
+
applyThemeConfig: P,
|
|
1637
|
+
resetThemeConfig: Fo,
|
|
1638
|
+
getDefaultThemeConfig: F,
|
|
1639
|
+
buildCssString: he,
|
|
1640
|
+
buildCssVars: Eo
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
const Xo = ["data-theme"], Lo = { class: "xp-theme-customizer__header" }, Po = { class: "xp-theme-customizer__body" }, Ho = { class: "xp-theme-customizer__section" }, Wo = { class: "xp-theme-customizer__modes" }, Jo = ["onClick"], Uo = { class: "xp-theme-customizer__section" }, Go = { class: "xp-theme-customizer__grid" }, qo = { class: "xp-theme-customizer__label" }, Yo = { class: "xp-theme-customizer__input" }, Ko = ["value", "onInput"], Zo = ["value", "onChange"], Qo = { class: "xp-theme-customizer__section" }, en = { class: "xp-theme-customizer__grid" }, tn = { class: "xp-theme-customizer__label" }, on = { class: "xp-theme-customizer__input" }, nn = ["value", "onInput"], sn = ["value", "onChange"], ln = { class: "xp-theme-customizer__section" }, rn = { class: "xp-theme-customizer__grid" }, an = { class: "xp-theme-customizer__label" }, dn = { class: "xp-theme-customizer__input" }, un = ["value", "onInput"], cn = ["value", "onChange"], pn = { class: "xp-theme-customizer__section" }, fn = { class: "xp-theme-customizer__grid" }, hn = { class: "xp-theme-customizer__label" }, mn = { class: "xp-theme-customizer__input" }, vn = ["value", "onInput"], gn = ["value", "onChange"], xn = { class: "xp-theme-customizer__label" }, _n = { class: "xp-theme-customizer__input" }, yn = ["value", "onInput"], kn = ["value", "onChange"], bn = {
|
|
1644
|
+
__name: "ThemeCustomizer",
|
|
1645
|
+
props: {
|
|
1646
|
+
modelValue: {
|
|
1647
|
+
type: Boolean,
|
|
1648
|
+
default: !1
|
|
1649
|
+
}
|
|
1650
|
+
},
|
|
1651
|
+
emits: ["update:modelValue"],
|
|
1652
|
+
setup(e, { emit: o }) {
|
|
1653
|
+
const { theme: t, applyThemeConfig: s, resetThemeConfig: l, getDefaultThemeConfig: u, buildCssString: d, themeConfig: v } = Oo(), h = {
|
|
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 = S("light"), r = S(null), c = we(m(v.value));
|
|
1668
|
+
ae(v, (M) => Object.assign(c, m(M)), { deep: !0 });
|
|
1669
|
+
function m(M) {
|
|
1670
|
+
return JSON.parse(JSON.stringify(M));
|
|
1671
|
+
}
|
|
1672
|
+
function w(M) {
|
|
1673
|
+
if (!M) return "#ffffff";
|
|
1674
|
+
if (/^#([0-9a-f]{6})$/i.test(M)) return M.toLowerCase();
|
|
1675
|
+
const g = M.match(/rgba?\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})/);
|
|
1676
|
+
return g ? "#" + [g[1], g[2], g[3]].map((p) => Number(p).toString(16).padStart(2, "0")).join("") : "#ffffff";
|
|
1677
|
+
}
|
|
1678
|
+
function $(M, g) {
|
|
1679
|
+
c.primary[M] = g, s(c);
|
|
1680
|
+
}
|
|
1681
|
+
function I(M, g, p) {
|
|
1682
|
+
c[f.value][M][g] = p, s(c);
|
|
1683
|
+
}
|
|
1684
|
+
function te() {
|
|
1685
|
+
l();
|
|
1686
|
+
}
|
|
1687
|
+
function ge() {
|
|
1688
|
+
oe("xp-ui-theme.json", JSON.stringify(c, null, 2), "application/json");
|
|
1689
|
+
}
|
|
1690
|
+
function xe() {
|
|
1691
|
+
oe("xp-ui-theme.css", d(c), "text/css");
|
|
1692
|
+
}
|
|
1693
|
+
function _e() {
|
|
1694
|
+
r.value && r.value.click();
|
|
1695
|
+
}
|
|
1696
|
+
function ye(M) {
|
|
1697
|
+
const g = M.target.files && M.target.files[0];
|
|
1698
|
+
if (!g) return;
|
|
1699
|
+
const p = new FileReader();
|
|
1700
|
+
p.onload = () => {
|
|
1701
|
+
try {
|
|
1702
|
+
const _ = JSON.parse(p.result);
|
|
1703
|
+
s(_);
|
|
1704
|
+
} catch (_) {
|
|
1705
|
+
alert(`主题配置解析失败:
|
|
1706
|
+
` + _.message);
|
|
1707
|
+
} finally {
|
|
1708
|
+
M.target.value = "";
|
|
1709
|
+
}
|
|
1710
|
+
}, p.readAsText(g);
|
|
1711
|
+
}
|
|
1712
|
+
function oe(M, g, p) {
|
|
1713
|
+
const _ = new Blob([g], { type: p + ";charset=utf-8" }), ne = URL.createObjectURL(_), O = document.createElement("a");
|
|
1714
|
+
O.href = ne, O.download = M, document.body.appendChild(O), O.click(), O.remove(), setTimeout(() => URL.revokeObjectURL(ne), 0);
|
|
1715
|
+
}
|
|
1716
|
+
return (M, g) => (i(), a(k, null, [
|
|
1717
|
+
E(A, { name: "xp-fade" }, {
|
|
1718
|
+
default: j(() => [
|
|
1719
|
+
e.modelValue ? (i(), a("div", {
|
|
1720
|
+
key: 0,
|
|
1721
|
+
class: "xp-theme-customizer-backdrop",
|
|
1722
|
+
onClick: g[0] || (g[0] = D((p) => M.$emit("update:modelValue", !1), ["self"]))
|
|
1723
|
+
})) : x("", !0)
|
|
1724
|
+
]),
|
|
1725
|
+
_: 1
|
|
1726
|
+
}),
|
|
1727
|
+
E(A, { name: "xp-slide" }, {
|
|
1728
|
+
default: j(() => [
|
|
1729
|
+
e.modelValue ? (i(), a("aside", {
|
|
1730
|
+
key: 0,
|
|
1731
|
+
class: "xp-theme-customizer",
|
|
1732
|
+
"data-theme": ce(t)
|
|
1733
|
+
}, [
|
|
1734
|
+
n("header", Lo, [
|
|
1735
|
+
g[2] || (g[2] = n("div", { class: "xp-theme-customizer__title" }, "🎨 主题定制", -1)),
|
|
1736
|
+
n("button", {
|
|
1737
|
+
class: "xp-theme-customizer__close",
|
|
1738
|
+
onClick: g[1] || (g[1] = (p) => M.$emit("update:modelValue", !1)),
|
|
1739
|
+
"aria-label": "关闭"
|
|
1740
|
+
}, "✕")
|
|
1741
|
+
]),
|
|
1742
|
+
n("div", Po, [
|
|
1743
|
+
n("section", Ho, [
|
|
1744
|
+
g[3] || (g[3] = n("p", { class: "xp-theme-customizer__desc" }, " 修改下方颜色即可改变整个示例/库的外观。导出后可直接放进你自己的项目中应用。 ", -1)),
|
|
1745
|
+
n("div", Wo, [
|
|
1746
|
+
(i(), a(k, null, V(["light", "dark"], (p) => n("button", {
|
|
1747
|
+
key: p,
|
|
1748
|
+
class: B(["xp-theme-customizer__mode-btn", { "is-active": f.value === p }]),
|
|
1749
|
+
onClick: (_) => f.value = p
|
|
1750
|
+
}, b(p === "light" ? "浅色" : "暗黑"), 11, Jo)), 64))
|
|
1751
|
+
])
|
|
1752
|
+
]),
|
|
1753
|
+
n("section", Uo, [
|
|
1754
|
+
g[4] || (g[4] = n("h3", { class: "xp-theme-customizer__h" }, "主色", -1)),
|
|
1755
|
+
n("div", Go, [
|
|
1756
|
+
(i(), a(k, null, V(["primary", "success", "warning", "danger", "info"], (p) => n("div", {
|
|
1757
|
+
key: p,
|
|
1758
|
+
class: "xp-theme-customizer__item"
|
|
1759
|
+
}, [
|
|
1760
|
+
n("div", qo, b(h[p]), 1),
|
|
1761
|
+
n("div", Yo, [
|
|
1762
|
+
n("input", {
|
|
1763
|
+
type: "color",
|
|
1764
|
+
value: c.primary[p],
|
|
1765
|
+
onInput: (_) => $(p, _.target.value)
|
|
1766
|
+
}, null, 40, Ko),
|
|
1767
|
+
n("input", {
|
|
1768
|
+
type: "text",
|
|
1769
|
+
value: c.primary[p],
|
|
1770
|
+
onChange: (_) => $(p, _.target.value)
|
|
1771
|
+
}, null, 40, Zo)
|
|
1772
|
+
])
|
|
1773
|
+
])), 64))
|
|
1774
|
+
])
|
|
1775
|
+
]),
|
|
1776
|
+
n("section", Qo, [
|
|
1777
|
+
g[5] || (g[5] = n("h3", { class: "xp-theme-customizer__h" }, "文本", -1)),
|
|
1778
|
+
n("div", en, [
|
|
1779
|
+
(i(), a(k, null, V(["primary", "regular", "secondary", "placeholder"], (p) => n("div", {
|
|
1780
|
+
key: "t-" + p,
|
|
1781
|
+
class: "xp-theme-customizer__item"
|
|
1782
|
+
}, [
|
|
1783
|
+
n("div", tn, b(h[p]), 1),
|
|
1784
|
+
n("div", on, [
|
|
1785
|
+
n("input", {
|
|
1786
|
+
type: "color",
|
|
1787
|
+
value: w(c[f.value].text[p]),
|
|
1788
|
+
onInput: (_) => I("text", p, _.target.value)
|
|
1789
|
+
}, null, 40, nn),
|
|
1790
|
+
n("input", {
|
|
1791
|
+
type: "text",
|
|
1792
|
+
value: c[f.value].text[p],
|
|
1793
|
+
onChange: (_) => I("text", p, _.target.value)
|
|
1794
|
+
}, null, 40, sn)
|
|
1795
|
+
])
|
|
1796
|
+
])), 64))
|
|
1797
|
+
])
|
|
1798
|
+
]),
|
|
1799
|
+
n("section", ln, [
|
|
1800
|
+
g[6] || (g[6] = n("h3", { class: "xp-theme-customizer__h" }, "背景", -1)),
|
|
1801
|
+
n("div", rn, [
|
|
1802
|
+
(i(), a(k, null, V(["base", "page", "soft"], (p) => n("div", {
|
|
1803
|
+
key: "bg-" + p,
|
|
1804
|
+
class: "xp-theme-customizer__item"
|
|
1805
|
+
}, [
|
|
1806
|
+
n("div", an, b(h[p]), 1),
|
|
1807
|
+
n("div", dn, [
|
|
1808
|
+
n("input", {
|
|
1809
|
+
type: "color",
|
|
1810
|
+
value: w(c[f.value].bg[p]),
|
|
1811
|
+
onInput: (_) => I("bg", p, _.target.value)
|
|
1812
|
+
}, null, 40, un),
|
|
1813
|
+
n("input", {
|
|
1814
|
+
type: "text",
|
|
1815
|
+
value: c[f.value].bg[p],
|
|
1816
|
+
onChange: (_) => I("bg", p, _.target.value)
|
|
1817
|
+
}, null, 40, cn)
|
|
1818
|
+
])
|
|
1819
|
+
])), 64))
|
|
1820
|
+
])
|
|
1821
|
+
]),
|
|
1822
|
+
n("section", pn, [
|
|
1823
|
+
g[7] || (g[7] = n("h3", { class: "xp-theme-customizer__h" }, "边框 / 填充", -1)),
|
|
1824
|
+
n("div", fn, [
|
|
1825
|
+
(i(), a(k, null, V(["base", "light", "lighter"], (p) => n("div", {
|
|
1826
|
+
key: "bd-" + p,
|
|
1827
|
+
class: "xp-theme-customizer__item"
|
|
1828
|
+
}, [
|
|
1829
|
+
n("div", hn, "边框 - " + b(h[p]), 1),
|
|
1830
|
+
n("div", mn, [
|
|
1831
|
+
n("input", {
|
|
1832
|
+
type: "color",
|
|
1833
|
+
value: w(c[f.value].border[p]),
|
|
1834
|
+
onInput: (_) => I("border", p, _.target.value)
|
|
1835
|
+
}, null, 40, vn),
|
|
1836
|
+
n("input", {
|
|
1837
|
+
type: "text",
|
|
1838
|
+
value: c[f.value].border[p],
|
|
1839
|
+
onChange: (_) => I("border", p, _.target.value)
|
|
1840
|
+
}, null, 40, gn)
|
|
1841
|
+
])
|
|
1842
|
+
])), 64)),
|
|
1843
|
+
(i(), a(k, null, V(["base", "light", "lighter"], (p) => n("div", {
|
|
1844
|
+
key: "fl-" + p,
|
|
1845
|
+
class: "xp-theme-customizer__item"
|
|
1846
|
+
}, [
|
|
1847
|
+
n("div", xn, "填充 - " + b(h[p]), 1),
|
|
1848
|
+
n("div", _n, [
|
|
1849
|
+
n("input", {
|
|
1850
|
+
type: "color",
|
|
1851
|
+
value: w(c[f.value].fill[p]),
|
|
1852
|
+
onInput: (_) => I("fill", p, _.target.value)
|
|
1853
|
+
}, null, 40, yn),
|
|
1854
|
+
n("input", {
|
|
1855
|
+
type: "text",
|
|
1856
|
+
value: c[f.value].fill[p],
|
|
1857
|
+
onChange: (_) => I("fill", p, _.target.value)
|
|
1858
|
+
}, null, 40, kn)
|
|
1859
|
+
])
|
|
1860
|
+
])), 64))
|
|
1861
|
+
])
|
|
1862
|
+
]),
|
|
1863
|
+
g[8] || (g[8] = n("section", { class: "xp-theme-customizer__section" }, [
|
|
1864
|
+
n("h3", { class: "xp-theme-customizer__h" }, "实时预览"),
|
|
1865
|
+
n("div", { class: "xp-theme-customizer__preview" }, [
|
|
1866
|
+
n("div", { class: "xp-preview-row" }, [
|
|
1867
|
+
n("button", { class: "xp-preview-btn xp-preview-btn--primary" }, "Primary"),
|
|
1868
|
+
n("button", { class: "xp-preview-btn xp-preview-btn--success" }, "Success"),
|
|
1869
|
+
n("button", { class: "xp-preview-btn xp-preview-btn--warning" }, "Warning"),
|
|
1870
|
+
n("button", { class: "xp-preview-btn xp-preview-btn--danger" }, "Danger")
|
|
1871
|
+
]),
|
|
1872
|
+
n("div", { class: "xp-preview-text xp-preview-text--primary" }, "主标题文本"),
|
|
1873
|
+
n("div", { class: "xp-preview-text" }, "正文内容样例 Regular text"),
|
|
1874
|
+
n("div", { class: "xp-preview-text xp-preview-text--secondary" }, "次要提示")
|
|
1875
|
+
])
|
|
1876
|
+
], -1))
|
|
1877
|
+
]),
|
|
1878
|
+
n("footer", { class: "xp-theme-customizer__footer" }, [
|
|
1879
|
+
n("button", {
|
|
1880
|
+
class: "xp-theme-customizer__action",
|
|
1881
|
+
onClick: te
|
|
1882
|
+
}, "恢复默认"),
|
|
1883
|
+
n("button", {
|
|
1884
|
+
class: "xp-theme-customizer__action xp-theme-customizer__action--secondary",
|
|
1885
|
+
onClick: _e
|
|
1886
|
+
}, "导入 JSON"),
|
|
1887
|
+
n("button", {
|
|
1888
|
+
class: "xp-theme-customizer__action xp-theme-customizer__action--primary",
|
|
1889
|
+
onClick: ge
|
|
1890
|
+
}, "导出 JSON"),
|
|
1891
|
+
n("button", {
|
|
1892
|
+
class: "xp-theme-customizer__action xp-theme-customizer__action--primary",
|
|
1893
|
+
onClick: xe
|
|
1894
|
+
}, "导出 CSS")
|
|
1895
|
+
]),
|
|
1896
|
+
n("input", {
|
|
1897
|
+
ref_key: "importFileInput",
|
|
1898
|
+
ref: r,
|
|
1899
|
+
type: "file",
|
|
1900
|
+
accept: "application/json,.json,.txt",
|
|
1901
|
+
class: "xp-theme-customizer__hidden",
|
|
1902
|
+
onChange: ye
|
|
1903
|
+
}, null, 544)
|
|
1904
|
+
], 8, Xo)) : x("", !0)
|
|
1905
|
+
]),
|
|
1906
|
+
_: 1
|
|
1907
|
+
})
|
|
1908
|
+
], 64));
|
|
1909
|
+
}
|
|
1910
|
+
}, X = S([]);
|
|
1911
|
+
let wn = 0;
|
|
1912
|
+
function Nn() {
|
|
1913
|
+
function e(o, t = "info", s = 2600) {
|
|
1914
|
+
const l = ++wn;
|
|
1915
|
+
X.value.push({ id: l, message: o, type: t }), setTimeout(() => {
|
|
1916
|
+
const u = X.value.findIndex((d) => d.id === l);
|
|
1917
|
+
u >= 0 && X.value.splice(u, 1);
|
|
1918
|
+
}, s);
|
|
1919
|
+
}
|
|
1263
1920
|
return {
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
resetThemeConfig: zt,
|
|
1271
|
-
getDefaultThemeConfig: T,
|
|
1272
|
-
buildCssString: ae,
|
|
1273
|
-
buildCssVars: Ot
|
|
1921
|
+
toasts: X,
|
|
1922
|
+
toast: e,
|
|
1923
|
+
success: (o) => e(o, "success", 2200),
|
|
1924
|
+
error: (o) => e(o, "error", 3600),
|
|
1925
|
+
info: (o) => e(o, "info"),
|
|
1926
|
+
warn: (o) => e(o, "warn", 2800)
|
|
1274
1927
|
};
|
|
1275
1928
|
}
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1929
|
+
const $n = {
|
|
1930
|
+
class: "xp-toast-wrap",
|
|
1931
|
+
"aria-live": "polite"
|
|
1932
|
+
}, Cn = { class: "xp-toast__msg" }, Mn = {
|
|
1933
|
+
__name: "Toast",
|
|
1934
|
+
setup(e) {
|
|
1935
|
+
return (o, t) => (i(), R(J, { to: "body" }, [
|
|
1936
|
+
n("div", $n, [
|
|
1937
|
+
E($e, { name: "xp-toast" }, {
|
|
1938
|
+
default: j(() => [
|
|
1939
|
+
(i(!0), a(k, null, V(ce(X), (s) => (i(), a("div", {
|
|
1940
|
+
key: s.id,
|
|
1941
|
+
class: B(["xp-toast", `xp-toast--${s.type}`])
|
|
1942
|
+
}, [
|
|
1943
|
+
t[0] || (t[0] = n("span", {
|
|
1944
|
+
class: "xp-toast__dot",
|
|
1945
|
+
"aria-hidden": "true"
|
|
1946
|
+
}, null, -1)),
|
|
1947
|
+
n("span", Cn, b(s.message), 1)
|
|
1948
|
+
], 2))), 128))
|
|
1949
|
+
]),
|
|
1950
|
+
_: 1
|
|
1951
|
+
})
|
|
1952
|
+
])
|
|
1953
|
+
]));
|
|
1954
|
+
}
|
|
1955
|
+
}, Sn = /* @__PURE__ */ C(Mn, [["__scopeId", "data-v-b564201c"]]), Bn = { class: "xp-tooltip__content" }, zn = {
|
|
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 o = e, t = S(!1), s = S({}), l = S(null), u = S(null);
|
|
1979
|
+
let d = null;
|
|
1980
|
+
const v = () => {
|
|
1981
|
+
ue(() => {
|
|
1982
|
+
if (!l.value || !u.value) return;
|
|
1983
|
+
const c = l.value.getBoundingClientRect(), m = u.value.getBoundingClientRect();
|
|
1984
|
+
let w = 0, $ = 0;
|
|
1985
|
+
switch (o.placement) {
|
|
1986
|
+
case "top":
|
|
1987
|
+
w = c.top - m.height - 8, $ = c.left + c.width / 2 - m.width / 2;
|
|
1988
|
+
break;
|
|
1989
|
+
case "bottom":
|
|
1990
|
+
w = c.bottom + 8, $ = c.left + c.width / 2 - m.width / 2;
|
|
1991
|
+
break;
|
|
1992
|
+
case "left":
|
|
1993
|
+
w = c.top + c.height / 2 - m.height / 2, $ = c.left - m.width - 8;
|
|
1994
|
+
break;
|
|
1995
|
+
case "right":
|
|
1996
|
+
w = c.top + c.height / 2 - m.height / 2, $ = c.right + 8;
|
|
1997
|
+
break;
|
|
1998
|
+
}
|
|
1999
|
+
s.value = {
|
|
2000
|
+
top: `${w + window.scrollY}px`,
|
|
2001
|
+
left: `${$ + window.scrollX}px`
|
|
2002
|
+
};
|
|
2003
|
+
});
|
|
2004
|
+
}, h = () => {
|
|
2005
|
+
o.disabled || (clearTimeout(d), d = setTimeout(() => {
|
|
2006
|
+
t.value = !0, v();
|
|
2007
|
+
}, 100));
|
|
2008
|
+
}, f = () => {
|
|
2009
|
+
clearTimeout(d), d = setTimeout(() => {
|
|
2010
|
+
t.value = !1;
|
|
2011
|
+
}, 150);
|
|
2012
|
+
}, r = () => {
|
|
2013
|
+
o.trigger !== "click" || o.disabled || (t.value = !t.value, t.value && v());
|
|
2014
|
+
};
|
|
2015
|
+
return Q(() => {
|
|
2016
|
+
clearTimeout(d);
|
|
2017
|
+
}), (c, m) => (i(), a("div", {
|
|
2018
|
+
class: "xp-tooltip",
|
|
2019
|
+
ref_key: "tooltipRef",
|
|
2020
|
+
ref: l
|
|
2021
|
+
}, [
|
|
2022
|
+
n("div", {
|
|
2023
|
+
class: "xp-tooltip__trigger",
|
|
2024
|
+
onMouseenter: h,
|
|
2025
|
+
onMouseleave: f,
|
|
2026
|
+
onClick: r
|
|
2027
|
+
}, [
|
|
2028
|
+
y(c.$slots, "default", {}, void 0, !0)
|
|
2029
|
+
], 32),
|
|
2030
|
+
(i(), R(J, { to: "body" }, [
|
|
2031
|
+
E(A, { name: "xp-tooltip-fade" }, {
|
|
2032
|
+
default: j(() => [
|
|
2033
|
+
t.value ? (i(), a("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
|
+
n("div", Bn, [
|
|
2041
|
+
y(c.$slots, "content", {}, () => [
|
|
2042
|
+
H(b(e.content), 1)
|
|
2043
|
+
], !0)
|
|
2044
|
+
]),
|
|
2045
|
+
m[0] || (m[0] = n("div", { class: "xp-tooltip__arrow" }, null, -1))
|
|
2046
|
+
], 6)) : x("", !0)
|
|
2047
|
+
]),
|
|
2048
|
+
_: 3
|
|
2049
|
+
})
|
|
2050
|
+
]))
|
|
2051
|
+
], 512));
|
|
2052
|
+
}
|
|
2053
|
+
}, In = /* @__PURE__ */ C(zn, [["__scopeId", "data-v-6d9af40b"]]), ve = {
|
|
2054
|
+
XpAlert: Ie,
|
|
2055
|
+
XpAvatar: Ae,
|
|
2056
|
+
XpBadge: Fe,
|
|
2057
|
+
XpButton: K,
|
|
2058
|
+
XpCard: qe,
|
|
2059
|
+
XpCheckbox: et,
|
|
2060
|
+
XpContextMenu: it,
|
|
2061
|
+
XpDialog: pt,
|
|
2062
|
+
XpDropdown: gt,
|
|
2063
|
+
XpEmpty: wt,
|
|
2064
|
+
XpFileIcon: Mt,
|
|
2065
|
+
XpIcon: Gt,
|
|
2066
|
+
XpInput: Qt,
|
|
2067
|
+
XpProgress: oo,
|
|
2068
|
+
XpRadio: ro,
|
|
2069
|
+
XpRate: ho,
|
|
2070
|
+
XpSwitch: xo,
|
|
2071
|
+
XpTabPane: ko,
|
|
2072
|
+
XpTabs: So,
|
|
2073
|
+
XpTag: zo,
|
|
2074
|
+
XpThemeCustomizer: bn,
|
|
2075
|
+
XpToast: Sn,
|
|
2076
|
+
XpTooltip: In
|
|
2077
|
+
}, Tn = (e) => {
|
|
2078
|
+
Object.entries(ve).forEach(([o, t]) => {
|
|
2079
|
+
e.component(o, t);
|
|
1297
2080
|
});
|
|
1298
|
-
},
|
|
1299
|
-
install:
|
|
1300
|
-
...
|
|
2081
|
+
}, Fn = {
|
|
2082
|
+
install: Tn,
|
|
2083
|
+
...ve
|
|
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
|
+
W as DEFAULT_TOKENS,
|
|
2088
|
+
Ie as XpAlert,
|
|
2089
|
+
Ae as XpAvatar,
|
|
2090
|
+
Fe as XpBadge,
|
|
2091
|
+
K as XpButton,
|
|
2092
|
+
qe as XpCard,
|
|
2093
|
+
et as XpCheckbox,
|
|
2094
|
+
it as XpContextMenu,
|
|
2095
|
+
pt as XpDialog,
|
|
2096
|
+
gt as XpDropdown,
|
|
2097
|
+
wt as XpEmpty,
|
|
2098
|
+
Mt as XpFileIcon,
|
|
2099
|
+
Gt as XpIcon,
|
|
2100
|
+
Qt as XpInput,
|
|
2101
|
+
oo as XpProgress,
|
|
2102
|
+
ro as XpRadio,
|
|
2103
|
+
ho as XpRate,
|
|
2104
|
+
xo as XpSwitch,
|
|
2105
|
+
ko as XpTabPane,
|
|
2106
|
+
So as XpTabs,
|
|
2107
|
+
zo as XpTag,
|
|
2108
|
+
bn as XpThemeCustomizer,
|
|
2109
|
+
Sn as XpToast,
|
|
2110
|
+
In as XpTooltip,
|
|
2111
|
+
P as applyThemeConfig,
|
|
2112
|
+
he as buildCssString,
|
|
2113
|
+
Eo as buildCssVars,
|
|
2114
|
+
q as darken,
|
|
2115
|
+
Fn as default,
|
|
2116
|
+
En as deriveDark,
|
|
2117
|
+
jn as deriveLight,
|
|
2118
|
+
F as getDefaultThemeConfig,
|
|
2119
|
+
Ro as initTheme,
|
|
2120
|
+
Tn as install,
|
|
2121
|
+
Dn as isDark,
|
|
2122
|
+
G as lighten,
|
|
2123
|
+
pe as mix,
|
|
2124
|
+
Y as parseColor,
|
|
2125
|
+
Fo as resetThemeConfig,
|
|
2126
|
+
L as setTheme,
|
|
2127
|
+
jo as toHex,
|
|
2128
|
+
X as toasts,
|
|
2129
|
+
No as toggleTheme,
|
|
2130
|
+
Oo as useTheme,
|
|
2131
|
+
Nn as useToast,
|
|
2132
|
+
An as withAlpha
|
|
1342
2133
|
};
|