@cghbcf/xp-ui 1.2.0 → 1.3.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 +422 -1
- package/dist/cghbcf-xp-ui.cjs.js +8 -5
- package/dist/cghbcf-xp-ui.es.js +1784 -859
- 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
|
|
1
|
+
import { ref as V, openBlock as a, createBlock as O, Transition as J, withCtx as F, createElementBlock as i, normalizeClass as z, createElementVNode as l, toDisplayString as S, renderSlot as I, createTextVNode as Q, createCommentVNode as w, computed as B, normalizeStyle as L, onUnmounted as ze, Teleport as ne, createVNode as W, withModifiers as U, Fragment as M, renderList as X, watch as be, onMounted as fe, onBeforeUnmount as ie, nextTick as ye, provide as ke, resolveComponent as ce, inject as he, withDirectives as Fe, vShow as Le, useSlots as He, getCurrentInstance as Pe, reactive as We, unref as Ie, TransitionGroup as qe } from "vue";
|
|
2
|
+
const E = (e, n) => {
|
|
3
3
|
const t = e.__vccOpts || e;
|
|
4
|
-
for (const [s,
|
|
5
|
-
t[s] =
|
|
4
|
+
for (const [s, o] of n)
|
|
5
|
+
t[s] = o;
|
|
6
6
|
return t;
|
|
7
|
-
},
|
|
7
|
+
}, Je = { class: "xp-alert__icon" }, Ue = { class: "xp-alert__content" }, Ke = { class: "xp-alert__title" }, Ge = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "xp-alert__description"
|
|
10
|
-
},
|
|
10
|
+
}, Ye = {
|
|
11
11
|
__name: "Alert",
|
|
12
12
|
props: {
|
|
13
13
|
title: {
|
|
@@ -34,54 +34,54 @@ const C = (e, o) => {
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
emits: ["close"],
|
|
37
|
-
setup(e, { emit:
|
|
38
|
-
const t =
|
|
37
|
+
setup(e, { emit: n }) {
|
|
38
|
+
const t = n, s = V(!0), o = {
|
|
39
39
|
success: "✓",
|
|
40
40
|
warning: "!",
|
|
41
41
|
danger: "×",
|
|
42
42
|
info: "i"
|
|
43
|
-
},
|
|
43
|
+
}, r = () => {
|
|
44
44
|
s.value = !1, t("close");
|
|
45
45
|
};
|
|
46
|
-
return (
|
|
47
|
-
default:
|
|
48
|
-
s.value ? (
|
|
46
|
+
return (u, _) => (a(), O(J, { name: "xp-alert-fade" }, {
|
|
47
|
+
default: F(() => [
|
|
48
|
+
s.value ? (a(), i("div", {
|
|
49
49
|
key: 0,
|
|
50
|
-
class:
|
|
50
|
+
class: z(["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
|
+
l("span", Je, S(o[e.type]), 1),
|
|
58
|
+
l("div", Ue, [
|
|
59
|
+
l("span", Ke, [
|
|
60
|
+
I(u.$slots, "default", {}, () => [
|
|
61
|
+
Q(S(e.title), 1)
|
|
62
62
|
], !0)
|
|
63
63
|
]),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
])) :
|
|
64
|
+
u.$slots.default ? (a(), i("p", Ge, [
|
|
65
|
+
I(u.$slots, "default", {}, void 0, !0)
|
|
66
|
+
])) : w("", !0)
|
|
67
67
|
]),
|
|
68
|
-
e.closable ? (
|
|
68
|
+
e.closable ? (a(), i("i", {
|
|
69
69
|
key: 0,
|
|
70
70
|
class: "xp-alert__close-btn",
|
|
71
|
-
onClick:
|
|
72
|
-
}, "×")) :
|
|
73
|
-
], 2)) :
|
|
71
|
+
onClick: r
|
|
72
|
+
}, "×")) : w("", !0)
|
|
73
|
+
], 2)) : w("", !0)
|
|
74
74
|
]),
|
|
75
75
|
_: 3
|
|
76
76
|
}));
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, Ze = /* @__PURE__ */ E(Ye, [["__scopeId", "data-v-91d792bd"]]), Qe = ["src", "alt"], et = {
|
|
79
79
|
key: 1,
|
|
80
80
|
class: "xp-avatar__slot"
|
|
81
|
-
},
|
|
81
|
+
}, tt = {
|
|
82
82
|
key: 2,
|
|
83
83
|
class: "xp-avatar__text"
|
|
84
|
-
},
|
|
84
|
+
}, nt = {
|
|
85
85
|
__name: "Avatar",
|
|
86
86
|
props: {
|
|
87
87
|
src: {
|
|
@@ -105,35 +105,57 @@ const C = (e, o) => {
|
|
|
105
105
|
icon: {
|
|
106
106
|
type: String,
|
|
107
107
|
default: ""
|
|
108
|
+
},
|
|
109
|
+
/** 无图片时,依据 alt 自动分配一组柔和主题色(默认关闭,保持向后兼容) */
|
|
110
|
+
colorful: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: !1
|
|
108
113
|
}
|
|
109
114
|
},
|
|
110
115
|
emits: ["error"],
|
|
111
|
-
setup(e, { emit:
|
|
112
|
-
const t = e, s =
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
setup(e, { emit: n }) {
|
|
117
|
+
const t = e, s = n, o = V(!1), r = ["primary", "success", "warning", "danger"];
|
|
118
|
+
function u(c) {
|
|
119
|
+
let d = 0;
|
|
120
|
+
for (let p = 0; p < c.length; p++)
|
|
121
|
+
d = d * 31 + c.charCodeAt(p) >>> 0;
|
|
122
|
+
return d;
|
|
123
|
+
}
|
|
124
|
+
const _ = B(() => {
|
|
125
|
+
if (t.src) return { backgroundColor: "transparent", color: void 0 };
|
|
126
|
+
if (t.colorful) {
|
|
127
|
+
const c = r[u(t.alt || "A") % r.length];
|
|
128
|
+
return {
|
|
129
|
+
backgroundColor: `color-mix(in srgb, var(--xp-color-${c}) 16%, transparent)`,
|
|
130
|
+
color: `var(--xp-color-${c})`
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
backgroundColor: "var(--xp-color-primary-bg)",
|
|
135
|
+
color: "var(--xp-color-primary)"
|
|
136
|
+
};
|
|
137
|
+
}), x = () => {
|
|
138
|
+
o.value = !0, s("error");
|
|
117
139
|
};
|
|
118
|
-
return (
|
|
119
|
-
class:
|
|
140
|
+
return (c, d) => (a(), i("span", {
|
|
141
|
+
class: z(["xp-avatar", [
|
|
120
142
|
`xp-avatar--${e.shape}`,
|
|
121
143
|
`xp-avatar--${e.size}`,
|
|
122
144
|
{ "xp-avatar--fit": e.src }
|
|
123
145
|
]]),
|
|
124
|
-
style:
|
|
146
|
+
style: L(_.value)
|
|
125
147
|
}, [
|
|
126
|
-
e.src && !
|
|
148
|
+
e.src && !o.value ? (a(), i("img", {
|
|
127
149
|
key: 0,
|
|
128
150
|
src: e.src,
|
|
129
151
|
alt: e.alt,
|
|
130
|
-
onError:
|
|
131
|
-
}, null, 40,
|
|
132
|
-
|
|
133
|
-
])) : (
|
|
152
|
+
onError: x
|
|
153
|
+
}, null, 40, Qe)) : c.$slots.default ? (a(), i("span", et, [
|
|
154
|
+
I(c.$slots, "default", {}, void 0, !0)
|
|
155
|
+
])) : (a(), i("span", tt, S(e.alt || "A"), 1))
|
|
134
156
|
], 6));
|
|
135
157
|
}
|
|
136
|
-
},
|
|
158
|
+
}, lt = /* @__PURE__ */ E(nt, [["__scopeId", "data-v-0dca9296"]]), st = { key: 0 }, ot = {
|
|
137
159
|
__name: "Badge",
|
|
138
160
|
props: {
|
|
139
161
|
value: {
|
|
@@ -159,26 +181,26 @@ const C = (e, o) => {
|
|
|
159
181
|
}
|
|
160
182
|
},
|
|
161
183
|
setup(e) {
|
|
162
|
-
const
|
|
163
|
-
return (
|
|
164
|
-
class:
|
|
184
|
+
const n = e, t = B(() => typeof n.value == "number" && n.value > n.max ? `${n.max}+` : n.value), s = B(() => n.value !== 0 && n.value !== "" && n.value !== null && n.value !== void 0);
|
|
185
|
+
return (o, r) => (a(), i("div", {
|
|
186
|
+
class: z(["xp-badge", { "xp-badge--dot": e.isDot, "xp-badge--hidden": e.hidden }])
|
|
165
187
|
}, [
|
|
166
|
-
|
|
167
|
-
!e.hidden && (e.isDot || s.value) ? (
|
|
188
|
+
I(o.$slots, "default", {}, void 0, !0),
|
|
189
|
+
!e.hidden && (e.isDot || s.value) ? (a(), i("sup", {
|
|
168
190
|
key: 0,
|
|
169
|
-
class:
|
|
191
|
+
class: z(["xp-badge__content", [
|
|
170
192
|
`xp-badge__content--${e.type}`,
|
|
171
193
|
{ "xp-badge__content--dot": e.isDot }
|
|
172
194
|
]])
|
|
173
195
|
}, [
|
|
174
|
-
e.isDot ?
|
|
175
|
-
], 2)) :
|
|
196
|
+
e.isDot ? w("", !0) : (a(), i("span", st, S(t.value), 1))
|
|
197
|
+
], 2)) : w("", !0)
|
|
176
198
|
], 2));
|
|
177
199
|
}
|
|
178
|
-
},
|
|
200
|
+
}, at = /* @__PURE__ */ E(ot, [["__scopeId", "data-v-207db6dd"]]), it = ["disabled"], rt = {
|
|
179
201
|
key: 0,
|
|
180
202
|
class: "xp-button__loading"
|
|
181
|
-
},
|
|
203
|
+
}, dt = { class: "xp-button__text" }, ut = {
|
|
182
204
|
__name: "Button",
|
|
183
205
|
props: {
|
|
184
206
|
type: {
|
|
@@ -209,12 +231,12 @@ const C = (e, o) => {
|
|
|
209
231
|
}
|
|
210
232
|
},
|
|
211
233
|
emits: ["click"],
|
|
212
|
-
setup(e, { emit:
|
|
213
|
-
const t = e, s =
|
|
214
|
-
!t.disabled && !t.loading && s("click",
|
|
234
|
+
setup(e, { emit: n }) {
|
|
235
|
+
const t = e, s = n, o = (r) => {
|
|
236
|
+
!t.disabled && !t.loading && s("click", r);
|
|
215
237
|
};
|
|
216
|
-
return (
|
|
217
|
-
class:
|
|
238
|
+
return (r, u) => (a(), i("button", {
|
|
239
|
+
class: z(["xp-button", [
|
|
218
240
|
`xp-button--${e.type}`,
|
|
219
241
|
`xp-button--${e.size}`,
|
|
220
242
|
{
|
|
@@ -225,24 +247,24 @@ const C = (e, o) => {
|
|
|
225
247
|
}
|
|
226
248
|
]]),
|
|
227
249
|
disabled: e.disabled || e.loading,
|
|
228
|
-
onClick:
|
|
250
|
+
onClick: o
|
|
229
251
|
}, [
|
|
230
|
-
e.loading ? (
|
|
231
|
-
|
|
232
|
-
|
|
252
|
+
e.loading ? (a(), i("span", rt)) : w("", !0),
|
|
253
|
+
l("span", dt, [
|
|
254
|
+
I(r.$slots, "default", {}, void 0, !0)
|
|
233
255
|
])
|
|
234
|
-
], 10,
|
|
256
|
+
], 10, it));
|
|
235
257
|
}
|
|
236
|
-
},
|
|
258
|
+
}, ge = /* @__PURE__ */ E(ut, [["__scopeId", "data-v-bee0ae1e"]]), ct = {
|
|
237
259
|
key: 0,
|
|
238
260
|
class: "xp-card__header"
|
|
239
|
-
},
|
|
261
|
+
}, pt = { class: "xp-card__title" }, ft = {
|
|
240
262
|
key: 0,
|
|
241
263
|
class: "xp-card__extra"
|
|
242
|
-
},
|
|
264
|
+
}, ht = { class: "xp-card__body" }, mt = {
|
|
243
265
|
key: 1,
|
|
244
266
|
class: "xp-card__footer"
|
|
245
|
-
},
|
|
267
|
+
}, vt = {
|
|
246
268
|
__name: "Card",
|
|
247
269
|
props: {
|
|
248
270
|
title: {
|
|
@@ -264,8 +286,8 @@ const C = (e, o) => {
|
|
|
264
286
|
}
|
|
265
287
|
},
|
|
266
288
|
setup(e) {
|
|
267
|
-
return (
|
|
268
|
-
class:
|
|
289
|
+
return (n, t) => (a(), i("div", {
|
|
290
|
+
class: z(["xp-card", [
|
|
269
291
|
`xp-card--${e.shadow}`,
|
|
270
292
|
{
|
|
271
293
|
"xp-card--bordered": e.bordered,
|
|
@@ -273,23 +295,23 @@ const C = (e, o) => {
|
|
|
273
295
|
}
|
|
274
296
|
]])
|
|
275
297
|
}, [
|
|
276
|
-
e.title ||
|
|
277
|
-
|
|
278
|
-
|
|
298
|
+
e.title || n.$slots.header ? (a(), i("div", ct, [
|
|
299
|
+
I(n.$slots, "header", {}, () => [
|
|
300
|
+
l("h3", pt, S(e.title), 1)
|
|
279
301
|
], !0),
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
])) :
|
|
283
|
-
])) :
|
|
284
|
-
|
|
285
|
-
|
|
302
|
+
n.$slots.extra ? (a(), i("div", ft, [
|
|
303
|
+
I(n.$slots, "extra", {}, void 0, !0)
|
|
304
|
+
])) : w("", !0)
|
|
305
|
+
])) : w("", !0),
|
|
306
|
+
l("div", ht, [
|
|
307
|
+
I(n.$slots, "default", {}, void 0, !0)
|
|
286
308
|
]),
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
])) :
|
|
309
|
+
n.$slots.footer ? (a(), i("div", mt, [
|
|
310
|
+
I(n.$slots, "footer", {}, void 0, !0)
|
|
311
|
+
])) : w("", !0)
|
|
290
312
|
], 2));
|
|
291
313
|
}
|
|
292
|
-
},
|
|
314
|
+
}, gt = /* @__PURE__ */ E(vt, [["__scopeId", "data-v-7cf22e01"]]), xt = { class: "xp-checkbox__input" }, _t = ["checked", "disabled", ".indeterminate"], bt = { class: "xp-checkbox__label" }, yt = {
|
|
293
315
|
__name: "Checkbox",
|
|
294
316
|
props: {
|
|
295
317
|
modelValue: {
|
|
@@ -306,14 +328,14 @@ const C = (e, o) => {
|
|
|
306
328
|
}
|
|
307
329
|
},
|
|
308
330
|
emits: ["update:modelValue", "change"],
|
|
309
|
-
setup(e, { emit:
|
|
310
|
-
const t = e, s =
|
|
331
|
+
setup(e, { emit: n }) {
|
|
332
|
+
const t = e, s = n, o = (r) => {
|
|
311
333
|
if (t.disabled) return;
|
|
312
|
-
const
|
|
313
|
-
s("update:modelValue",
|
|
334
|
+
const u = r.target.checked;
|
|
335
|
+
s("update:modelValue", u), s("change", u);
|
|
314
336
|
};
|
|
315
|
-
return (
|
|
316
|
-
class:
|
|
337
|
+
return (r, u) => (a(), i("label", {
|
|
338
|
+
class: z(["xp-checkbox", [
|
|
317
339
|
{
|
|
318
340
|
"xp-checkbox--checked": e.modelValue,
|
|
319
341
|
"xp-checkbox--disabled": e.disabled,
|
|
@@ -321,30 +343,30 @@ const C = (e, o) => {
|
|
|
321
343
|
}
|
|
322
344
|
]])
|
|
323
345
|
}, [
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
346
|
+
l("span", xt, [
|
|
347
|
+
u[0] || (u[0] = l("span", { class: "xp-checkbox__inner" }, null, -1)),
|
|
348
|
+
l("input", {
|
|
327
349
|
type: "checkbox",
|
|
328
350
|
class: "xp-checkbox__original",
|
|
329
351
|
checked: e.modelValue,
|
|
330
352
|
disabled: e.disabled,
|
|
331
|
-
onChange:
|
|
353
|
+
onChange: o,
|
|
332
354
|
".indeterminate": e.indeterminate
|
|
333
|
-
}, null, 40,
|
|
355
|
+
}, null, 40, _t)
|
|
334
356
|
]),
|
|
335
|
-
|
|
336
|
-
|
|
357
|
+
l("span", bt, [
|
|
358
|
+
I(r.$slots, "default", {}, void 0, !0)
|
|
337
359
|
])
|
|
338
360
|
], 2));
|
|
339
361
|
}
|
|
340
|
-
},
|
|
362
|
+
}, xe = /* @__PURE__ */ E(yt, [["__scopeId", "data-v-7c078f46"]]), kt = {
|
|
341
363
|
key: 0,
|
|
342
364
|
class: "xp-menu__divider"
|
|
343
|
-
},
|
|
365
|
+
}, wt = ["disabled", "onClick"], $t = {
|
|
344
366
|
key: 0,
|
|
345
367
|
class: "xp-menu__icon",
|
|
346
368
|
"aria-hidden": "true"
|
|
347
|
-
},
|
|
369
|
+
}, Ct = { class: "xp-menu__label" }, St = {
|
|
348
370
|
__name: "ContextMenu",
|
|
349
371
|
props: {
|
|
350
372
|
visible: { type: Boolean, default: !1 },
|
|
@@ -357,65 +379,65 @@ const C = (e, o) => {
|
|
|
357
379
|
items: { type: Array, default: () => [] }
|
|
358
380
|
},
|
|
359
381
|
emits: ["close", "select", "command"],
|
|
360
|
-
setup(e, { emit:
|
|
361
|
-
const t = e, s =
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
const
|
|
365
|
-
let
|
|
366
|
-
return
|
|
382
|
+
setup(e, { emit: n }) {
|
|
383
|
+
const t = e, s = n;
|
|
384
|
+
V(null);
|
|
385
|
+
const o = B(() => {
|
|
386
|
+
const c = Math.min(t.items.filter((v) => !v.divider).length, 12) * 32 + 12;
|
|
387
|
+
let d = t.x, p = t.y;
|
|
388
|
+
return d + 220 > window.innerWidth - 8 && (d = Math.max(8, window.innerWidth - 220 - 8)), p + c > window.innerHeight - 8 && (p = Math.max(8, window.innerHeight - c - 8)), { left: `${d}px`, top: `${p}px` };
|
|
367
389
|
});
|
|
368
|
-
function
|
|
390
|
+
function r() {
|
|
369
391
|
s("close");
|
|
370
392
|
}
|
|
371
|
-
function
|
|
372
|
-
|
|
393
|
+
function u(x) {
|
|
394
|
+
x.disabled || (s("close"), s("select", x), s("command", x.command), x.onClick && x.onClick());
|
|
373
395
|
}
|
|
374
|
-
function
|
|
375
|
-
|
|
396
|
+
function _(x) {
|
|
397
|
+
x.key === "Escape" && t.visible && s("close");
|
|
376
398
|
}
|
|
377
|
-
return
|
|
378
|
-
|
|
379
|
-
default:
|
|
380
|
-
e.visible ? (
|
|
399
|
+
return ze(() => window.removeEventListener("keydown", _)), (x, c) => (a(), O(ne, { to: "body" }, [
|
|
400
|
+
W(J, { name: "xp-menu" }, {
|
|
401
|
+
default: F(() => [
|
|
402
|
+
e.visible ? (a(), i("div", {
|
|
381
403
|
key: 0,
|
|
382
404
|
class: "xp-menu-mask",
|
|
383
|
-
onMousedown:
|
|
384
|
-
onContextmenu:
|
|
405
|
+
onMousedown: r,
|
|
406
|
+
onContextmenu: c[2] || (c[2] = U(() => {
|
|
385
407
|
}, ["prevent"]))
|
|
386
408
|
}, [
|
|
387
|
-
|
|
409
|
+
l("div", {
|
|
388
410
|
class: "xp-menu",
|
|
389
|
-
style:
|
|
411
|
+
style: L(o.value),
|
|
390
412
|
role: "menu",
|
|
391
|
-
onMousedown:
|
|
413
|
+
onMousedown: c[0] || (c[0] = U(() => {
|
|
392
414
|
}, ["stop"])),
|
|
393
|
-
onMouseup:
|
|
415
|
+
onMouseup: c[1] || (c[1] = U(() => {
|
|
394
416
|
}, ["stop"]))
|
|
395
417
|
}, [
|
|
396
|
-
(
|
|
397
|
-
|
|
418
|
+
(a(!0), i(M, null, X(e.items, (d, p) => (a(), i(M, { key: p }, [
|
|
419
|
+
d.divider ? (a(), i("div", kt)) : (a(), i("button", {
|
|
398
420
|
key: 1,
|
|
399
|
-
class:
|
|
421
|
+
class: z(["xp-menu__item", { "xp-menu__item--danger": d.danger, "xp-menu__item--disabled": d.disabled }]),
|
|
400
422
|
role: "menuitem",
|
|
401
|
-
disabled:
|
|
402
|
-
onClick: (
|
|
423
|
+
disabled: d.disabled,
|
|
424
|
+
onClick: (v) => u(d)
|
|
403
425
|
}, [
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
], 10,
|
|
426
|
+
d.icon ? (a(), i("span", $t, S(d.icon), 1)) : w("", !0),
|
|
427
|
+
l("span", Ct, S(d.label), 1)
|
|
428
|
+
], 10, wt))
|
|
407
429
|
], 64))), 128))
|
|
408
430
|
], 36)
|
|
409
|
-
], 32)) :
|
|
431
|
+
], 32)) : w("", !0)
|
|
410
432
|
]),
|
|
411
433
|
_: 1
|
|
412
434
|
})
|
|
413
435
|
]));
|
|
414
436
|
}
|
|
415
|
-
},
|
|
437
|
+
}, Mt = /* @__PURE__ */ E(St, [["__scopeId", "data-v-7477a575"]]), Bt = { class: "xp-dialog__header" }, zt = { class: "xp-dialog__title" }, It = { class: "xp-dialog__body" }, Tt = {
|
|
416
438
|
key: 0,
|
|
417
439
|
class: "xp-dialog__footer"
|
|
418
|
-
},
|
|
440
|
+
}, Vt = {
|
|
419
441
|
__name: "Dialog",
|
|
420
442
|
props: {
|
|
421
443
|
visible: {
|
|
@@ -448,86 +470,86 @@ const C = (e, o) => {
|
|
|
448
470
|
}
|
|
449
471
|
},
|
|
450
472
|
emits: ["confirm", "cancel", "update:visible", "close"],
|
|
451
|
-
setup(e, { emit:
|
|
452
|
-
const t = e, s =
|
|
473
|
+
setup(e, { emit: n }) {
|
|
474
|
+
const t = e, s = n, o = () => {
|
|
453
475
|
s("update:visible", !1), s("close");
|
|
476
|
+
}, r = () => {
|
|
477
|
+
t.closeOnClickModal && o();
|
|
454
478
|
}, u = () => {
|
|
455
|
-
|
|
456
|
-
},
|
|
457
|
-
s("
|
|
458
|
-
}, v = () => {
|
|
459
|
-
s("cancel"), l();
|
|
479
|
+
s("confirm"), o();
|
|
480
|
+
}, _ = () => {
|
|
481
|
+
s("cancel"), o();
|
|
460
482
|
};
|
|
461
|
-
function
|
|
462
|
-
|
|
483
|
+
function x(c) {
|
|
484
|
+
c.key === "Escape" && t.visible && o();
|
|
463
485
|
}
|
|
464
|
-
return
|
|
486
|
+
return be(
|
|
465
487
|
() => t.visible,
|
|
466
|
-
(
|
|
467
|
-
|
|
488
|
+
(c) => {
|
|
489
|
+
c ? window.addEventListener("keydown", x) : window.removeEventListener("keydown", x);
|
|
468
490
|
}
|
|
469
|
-
),
|
|
470
|
-
|
|
471
|
-
default:
|
|
472
|
-
e.visible ? (
|
|
491
|
+
), ze(() => window.removeEventListener("keydown", x)), (c, d) => (a(), O(ne, { to: "body" }, [
|
|
492
|
+
W(J, { name: "xp-dialog-fade" }, {
|
|
493
|
+
default: F(() => [
|
|
494
|
+
e.visible ? (a(), i("div", {
|
|
473
495
|
key: 0,
|
|
474
496
|
class: "xp-dialog__wrapper",
|
|
475
|
-
onClick:
|
|
497
|
+
onClick: U(r, ["self"])
|
|
476
498
|
}, [
|
|
477
|
-
|
|
478
|
-
|
|
499
|
+
d[0] || (d[0] = l("div", { class: "xp-dialog__mask" }, null, -1)),
|
|
500
|
+
W(J, {
|
|
479
501
|
name: "xp-dialog-slide",
|
|
480
502
|
appear: ""
|
|
481
503
|
}, {
|
|
482
|
-
default:
|
|
483
|
-
e.visible ? (
|
|
504
|
+
default: F(() => [
|
|
505
|
+
e.visible ? (a(), i("div", {
|
|
484
506
|
key: 0,
|
|
485
507
|
class: "xp-dialog",
|
|
486
|
-
style:
|
|
508
|
+
style: L({ width: e.width })
|
|
487
509
|
}, [
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
510
|
+
l("div", Bt, [
|
|
511
|
+
l("h3", zt, S(e.title), 1),
|
|
512
|
+
l("button", {
|
|
491
513
|
class: "xp-dialog__close",
|
|
492
|
-
onClick:
|
|
514
|
+
onClick: o
|
|
493
515
|
}, "×")
|
|
494
516
|
]),
|
|
495
|
-
|
|
496
|
-
|
|
517
|
+
l("div", It, [
|
|
518
|
+
I(c.$slots, "default", {}, void 0, !0)
|
|
497
519
|
]),
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
default:
|
|
502
|
-
|
|
520
|
+
c.$slots.footer || e.showDefaultFooter ? (a(), i("div", Tt, [
|
|
521
|
+
I(c.$slots, "footer", {}, () => [
|
|
522
|
+
W(ge, { onClick: _ }, {
|
|
523
|
+
default: F(() => [
|
|
524
|
+
Q(S(e.cancelButtonText), 1)
|
|
503
525
|
]),
|
|
504
526
|
_: 1
|
|
505
527
|
}),
|
|
506
|
-
|
|
528
|
+
W(ge, {
|
|
507
529
|
type: "primary",
|
|
508
|
-
onClick:
|
|
530
|
+
onClick: u
|
|
509
531
|
}, {
|
|
510
|
-
default:
|
|
511
|
-
|
|
532
|
+
default: F(() => [
|
|
533
|
+
Q(S(e.confirmButtonText), 1)
|
|
512
534
|
]),
|
|
513
535
|
_: 1
|
|
514
536
|
})
|
|
515
537
|
], !0)
|
|
516
|
-
])) :
|
|
517
|
-
], 4)) :
|
|
538
|
+
])) : w("", !0)
|
|
539
|
+
], 4)) : w("", !0)
|
|
518
540
|
]),
|
|
519
541
|
_: 3
|
|
520
542
|
})
|
|
521
|
-
])) :
|
|
543
|
+
])) : w("", !0)
|
|
522
544
|
]),
|
|
523
545
|
_: 3
|
|
524
546
|
})
|
|
525
547
|
]));
|
|
526
548
|
}
|
|
527
|
-
},
|
|
549
|
+
}, jt = /* @__PURE__ */ E(Vt, [["__scopeId", "data-v-9769570e"]]), At = ["onClick"], Et = { key: 0 }, Nt = {
|
|
528
550
|
key: 1,
|
|
529
551
|
class: "xp-dropdown__divider"
|
|
530
|
-
},
|
|
552
|
+
}, Rt = {
|
|
531
553
|
__name: "Dropdown",
|
|
532
554
|
props: {
|
|
533
555
|
items: {
|
|
@@ -540,136 +562,136 @@ const C = (e, o) => {
|
|
|
540
562
|
}
|
|
541
563
|
},
|
|
542
564
|
emits: ["select", "command", "open", "close"],
|
|
543
|
-
setup(e, { emit:
|
|
544
|
-
const t = e, s =
|
|
545
|
-
|
|
546
|
-
if (!
|
|
547
|
-
const
|
|
548
|
-
let $ =
|
|
549
|
-
|
|
565
|
+
setup(e, { emit: n }) {
|
|
566
|
+
const t = e, s = n, o = V(!1), r = V({}), u = V(null), _ = V(null), x = () => {
|
|
567
|
+
ye(() => {
|
|
568
|
+
if (!u.value || !_.value) return;
|
|
569
|
+
const v = u.value.getBoundingClientRect(), C = _.value.getBoundingClientRect();
|
|
570
|
+
let $ = v.bottom + 6, j = v.left;
|
|
571
|
+
j + C.width > window.innerWidth - 10 && (j = window.innerWidth - C.width - 10), $ + C.height > window.innerHeight - 10 && ($ = v.top - C.height - 6), r.value = {
|
|
550
572
|
top: `${$ + window.scrollY}px`,
|
|
551
|
-
left: `${
|
|
573
|
+
left: `${j + window.scrollX}px`
|
|
552
574
|
};
|
|
553
575
|
});
|
|
554
|
-
},
|
|
555
|
-
t.disabled || (
|
|
556
|
-
},
|
|
557
|
-
|
|
558
|
-
},
|
|
559
|
-
var
|
|
560
|
-
|
|
576
|
+
}, c = () => {
|
|
577
|
+
t.disabled || (o.value = !o.value, o.value ? (x(), s("open")) : s("close"));
|
|
578
|
+
}, d = (v) => {
|
|
579
|
+
v.disabled || v.divider || (s("select", v), v.command !== void 0 && s("command", v.command, v), o.value = !1, s("close"));
|
|
580
|
+
}, p = (v) => {
|
|
581
|
+
var C;
|
|
582
|
+
o.value && u.value && !u.value.contains(v.target) && !((C = _.value) != null && C.contains(v.target)) && (o.value = !1, s("close"));
|
|
561
583
|
};
|
|
562
|
-
return
|
|
563
|
-
document.addEventListener("click",
|
|
564
|
-
}),
|
|
565
|
-
document.removeEventListener("click",
|
|
566
|
-
}), (
|
|
584
|
+
return fe(() => {
|
|
585
|
+
document.addEventListener("click", p);
|
|
586
|
+
}), ie(() => {
|
|
587
|
+
document.removeEventListener("click", p);
|
|
588
|
+
}), (v, C) => (a(), i("div", {
|
|
567
589
|
class: "xp-dropdown",
|
|
568
590
|
ref_key: "dropdownRef",
|
|
569
|
-
ref:
|
|
591
|
+
ref: u
|
|
570
592
|
}, [
|
|
571
|
-
|
|
593
|
+
l("div", {
|
|
572
594
|
class: "xp-dropdown__trigger",
|
|
573
|
-
onClick:
|
|
595
|
+
onClick: c
|
|
574
596
|
}, [
|
|
575
|
-
|
|
597
|
+
I(v.$slots, "default", {}, void 0, !0)
|
|
576
598
|
]),
|
|
577
|
-
(
|
|
578
|
-
|
|
579
|
-
default:
|
|
580
|
-
|
|
599
|
+
(a(), O(ne, { to: "body" }, [
|
|
600
|
+
W(J, { name: "xp-dropdown-fade" }, {
|
|
601
|
+
default: F(() => [
|
|
602
|
+
o.value ? (a(), i("div", {
|
|
581
603
|
key: 0,
|
|
582
604
|
class: "xp-dropdown__menu",
|
|
583
|
-
style:
|
|
605
|
+
style: L(r.value),
|
|
584
606
|
ref_key: "menuRef",
|
|
585
|
-
ref:
|
|
607
|
+
ref: _
|
|
586
608
|
}, [
|
|
587
|
-
(
|
|
588
|
-
key:
|
|
589
|
-
class:
|
|
590
|
-
onClick: (
|
|
609
|
+
(a(!0), i(M, null, X(e.items, ($, j) => (a(), i("div", {
|
|
610
|
+
key: j,
|
|
611
|
+
class: z(["xp-dropdown__item", { "xp-dropdown__item--disabled": $.disabled, "xp-dropdown__item--divider": $.divider }]),
|
|
612
|
+
onClick: (y) => d($)
|
|
591
613
|
}, [
|
|
592
|
-
$.divider ?
|
|
593
|
-
$.divider ? (
|
|
594
|
-
], 10,
|
|
595
|
-
], 4)) :
|
|
614
|
+
$.divider ? w("", !0) : (a(), i("span", Et, S($.label), 1)),
|
|
615
|
+
$.divider ? (a(), i("span", Nt)) : w("", !0)
|
|
616
|
+
], 10, At))), 128))
|
|
617
|
+
], 4)) : w("", !0)
|
|
596
618
|
]),
|
|
597
619
|
_: 1
|
|
598
620
|
})
|
|
599
621
|
]))
|
|
600
622
|
], 512));
|
|
601
623
|
}
|
|
602
|
-
},
|
|
624
|
+
}, Xt = /* @__PURE__ */ E(Rt, [["__scopeId", "data-v-7f40eb7f"]]), Dt = { class: "xp-empty" }, Ot = { class: "xp-empty__title" }, Ft = {
|
|
603
625
|
key: 0,
|
|
604
626
|
class: "xp-empty__hint"
|
|
605
|
-
},
|
|
627
|
+
}, Lt = {
|
|
606
628
|
key: 1,
|
|
607
629
|
class: "xp-empty__action"
|
|
608
|
-
},
|
|
630
|
+
}, Ht = {
|
|
609
631
|
__name: "Empty",
|
|
610
632
|
props: {
|
|
611
633
|
title: { type: String, default: "暂无内容" },
|
|
612
634
|
hint: { type: String, default: "" }
|
|
613
635
|
},
|
|
614
636
|
setup(e) {
|
|
615
|
-
return (
|
|
616
|
-
|
|
617
|
-
t[0] || (t[0] =
|
|
637
|
+
return (n, t) => (a(), i("div", Dt, [
|
|
638
|
+
I(n.$slots, "icon", {}, () => [
|
|
639
|
+
t[0] || (t[0] = l("div", {
|
|
618
640
|
class: "xp-empty__icon",
|
|
619
641
|
"aria-hidden": "true"
|
|
620
642
|
}, [
|
|
621
|
-
|
|
643
|
+
l("svg", {
|
|
622
644
|
width: "46",
|
|
623
645
|
height: "46",
|
|
624
646
|
viewBox: "0 0 24 24",
|
|
625
647
|
fill: "none"
|
|
626
648
|
}, [
|
|
627
|
-
|
|
649
|
+
l("path", {
|
|
628
650
|
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: "
|
|
651
|
+
stroke: "currentColor",
|
|
630
652
|
"stroke-width": "1.5",
|
|
631
653
|
"stroke-linejoin": "round"
|
|
632
654
|
})
|
|
633
655
|
])
|
|
634
656
|
], -1))
|
|
635
657
|
], !0),
|
|
636
|
-
|
|
637
|
-
e.hint ? (
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
])) :
|
|
658
|
+
l("p", Ot, S(e.title), 1),
|
|
659
|
+
e.hint ? (a(), i("p", Ft, S(e.hint), 1)) : w("", !0),
|
|
660
|
+
n.$slots.default ? (a(), i("div", Lt, [
|
|
661
|
+
I(n.$slots, "default", {}, void 0, !0)
|
|
662
|
+
])) : w("", !0)
|
|
641
663
|
]));
|
|
642
664
|
}
|
|
643
|
-
},
|
|
665
|
+
}, Te = /* @__PURE__ */ E(Ht, [["__scopeId", "data-v-dd1a0f29"]]), Pt = ["width", "height"], Wt = {
|
|
644
666
|
__name: "FileIcon",
|
|
645
667
|
props: {
|
|
646
668
|
type: { type: String, default: "file" },
|
|
647
669
|
size: { type: Number, default: 20 }
|
|
648
670
|
},
|
|
649
671
|
setup(e) {
|
|
650
|
-
return (
|
|
672
|
+
return (n, t) => (a(), i("span", {
|
|
651
673
|
class: "xp-file-icon",
|
|
652
|
-
style:
|
|
674
|
+
style: L({ width: e.size + "px", height: e.size + "px" }),
|
|
653
675
|
"aria-hidden": "true"
|
|
654
676
|
}, [
|
|
655
|
-
(
|
|
677
|
+
(a(), i("svg", {
|
|
656
678
|
width: e.size,
|
|
657
679
|
height: e.size,
|
|
658
680
|
viewBox: "0 0 24 24",
|
|
659
681
|
fill: "none"
|
|
660
682
|
}, [
|
|
661
|
-
e.type === "folder" ? (
|
|
662
|
-
t[0] || (t[0] =
|
|
683
|
+
e.type === "folder" ? (a(), i(M, { key: 0 }, [
|
|
684
|
+
t[0] || (t[0] = l("path", {
|
|
663
685
|
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
686
|
fill: "#E8B64E",
|
|
665
687
|
"fill-opacity": "0.9"
|
|
666
688
|
}, null, -1)),
|
|
667
|
-
t[1] || (t[1] =
|
|
689
|
+
t[1] || (t[1] = l("path", {
|
|
668
690
|
d: "M3 8.5h18v9A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5z",
|
|
669
691
|
fill: "#F3CE78"
|
|
670
692
|
}, null, -1))
|
|
671
|
-
], 64)) : e.type === "image" ? (
|
|
672
|
-
t[2] || (t[2] =
|
|
693
|
+
], 64)) : e.type === "image" ? (a(), i(M, { key: 1 }, [
|
|
694
|
+
t[2] || (t[2] = l("rect", {
|
|
673
695
|
x: "3",
|
|
674
696
|
y: "4",
|
|
675
697
|
width: "18",
|
|
@@ -680,13 +702,13 @@ const C = (e, o) => {
|
|
|
680
702
|
stroke: "#3D8EAD",
|
|
681
703
|
"stroke-width": "1.4"
|
|
682
704
|
}, null, -1)),
|
|
683
|
-
t[3] || (t[3] =
|
|
705
|
+
t[3] || (t[3] = l("circle", {
|
|
684
706
|
cx: "9",
|
|
685
707
|
cy: "10",
|
|
686
708
|
r: "1.8",
|
|
687
709
|
fill: "#3D8EAD"
|
|
688
710
|
}, null, -1)),
|
|
689
|
-
t[4] || (t[4] =
|
|
711
|
+
t[4] || (t[4] = l("path", {
|
|
690
712
|
d: "M4.4 17.4l4.6-4.4 3 2.8 3.2-3.2 4.4 4.2",
|
|
691
713
|
stroke: "#3D8EAD",
|
|
692
714
|
"stroke-width": "1.4",
|
|
@@ -694,8 +716,8 @@ const C = (e, o) => {
|
|
|
694
716
|
"stroke-linejoin": "round",
|
|
695
717
|
fill: "none"
|
|
696
718
|
}, null, -1))
|
|
697
|
-
], 64)) : e.type === "video" ? (
|
|
698
|
-
t[5] || (t[5] =
|
|
719
|
+
], 64)) : e.type === "video" ? (a(), i(M, { key: 2 }, [
|
|
720
|
+
t[5] || (t[5] = l("rect", {
|
|
699
721
|
x: "3",
|
|
700
722
|
y: "5",
|
|
701
723
|
width: "13",
|
|
@@ -706,12 +728,12 @@ const C = (e, o) => {
|
|
|
706
728
|
stroke: "#8A48C4",
|
|
707
729
|
"stroke-width": "1.4"
|
|
708
730
|
}, null, -1)),
|
|
709
|
-
t[6] || (t[6] =
|
|
731
|
+
t[6] || (t[6] = l("path", {
|
|
710
732
|
d: "M16 10.5l5-3v9l-5-3z",
|
|
711
733
|
fill: "#8A48C4"
|
|
712
734
|
}, null, -1))
|
|
713
|
-
], 64)) : e.type === "audio" ? (
|
|
714
|
-
t[7] || (t[7] =
|
|
735
|
+
], 64)) : e.type === "audio" ? (a(), i(M, { key: 3 }, [
|
|
736
|
+
t[7] || (t[7] = l("path", {
|
|
715
737
|
d: "M9 18V6l10-2v11",
|
|
716
738
|
stroke: "#C2569B",
|
|
717
739
|
"stroke-width": "1.6",
|
|
@@ -719,20 +741,20 @@ const C = (e, o) => {
|
|
|
719
741
|
"stroke-linejoin": "round",
|
|
720
742
|
fill: "none"
|
|
721
743
|
}, null, -1)),
|
|
722
|
-
t[8] || (t[8] =
|
|
744
|
+
t[8] || (t[8] = l("circle", {
|
|
723
745
|
cx: "6.6",
|
|
724
746
|
cy: "18",
|
|
725
747
|
r: "2.4",
|
|
726
748
|
fill: "#C2569B"
|
|
727
749
|
}, null, -1)),
|
|
728
|
-
t[9] || (t[9] =
|
|
750
|
+
t[9] || (t[9] = l("circle", {
|
|
729
751
|
cx: "16.6",
|
|
730
752
|
cy: "15",
|
|
731
753
|
r: "2.4",
|
|
732
754
|
fill: "#C2569B"
|
|
733
755
|
}, null, -1))
|
|
734
|
-
], 64)) : e.type === "pdf" ? (
|
|
735
|
-
t[10] || (t[10] =
|
|
756
|
+
], 64)) : e.type === "pdf" ? (a(), i(M, { key: 4 }, [
|
|
757
|
+
t[10] || (t[10] = l("rect", {
|
|
736
758
|
x: "4",
|
|
737
759
|
y: "3",
|
|
738
760
|
width: "16",
|
|
@@ -743,7 +765,7 @@ const C = (e, o) => {
|
|
|
743
765
|
stroke: "#C24842",
|
|
744
766
|
"stroke-width": "1.4"
|
|
745
767
|
}, null, -1)),
|
|
746
|
-
t[11] || (t[11] =
|
|
768
|
+
t[11] || (t[11] = l("text", {
|
|
747
769
|
x: "12",
|
|
748
770
|
y: "16.2",
|
|
749
771
|
"text-anchor": "middle",
|
|
@@ -752,8 +774,8 @@ const C = (e, o) => {
|
|
|
752
774
|
fill: "#C24842",
|
|
753
775
|
"font-family": "Arial, sans-serif"
|
|
754
776
|
}, "PDF", -1))
|
|
755
|
-
], 64)) : e.type === "doc" ? (
|
|
756
|
-
t[12] || (t[12] =
|
|
777
|
+
], 64)) : e.type === "doc" ? (a(), i(M, { key: 5 }, [
|
|
778
|
+
t[12] || (t[12] = l("path", {
|
|
757
779
|
d: "M5 3.5h9l5 5v12h-14z",
|
|
758
780
|
fill: "#3B7FD6",
|
|
759
781
|
"fill-opacity": "0.14",
|
|
@@ -761,27 +783,27 @@ const C = (e, o) => {
|
|
|
761
783
|
"stroke-width": "1.4",
|
|
762
784
|
"stroke-linejoin": "round"
|
|
763
785
|
}, null, -1)),
|
|
764
|
-
t[13] || (t[13] =
|
|
786
|
+
t[13] || (t[13] = l("path", {
|
|
765
787
|
d: "M14 3.5v5h5",
|
|
766
788
|
fill: "none",
|
|
767
789
|
stroke: "#2F6DC0",
|
|
768
790
|
"stroke-width": "1.4",
|
|
769
791
|
"stroke-linejoin": "round"
|
|
770
792
|
}, null, -1)),
|
|
771
|
-
t[14] || (t[14] =
|
|
793
|
+
t[14] || (t[14] = l("path", {
|
|
772
794
|
d: "M7.5 12v5M7.5 14.5h3",
|
|
773
795
|
stroke: "#2F6DC0",
|
|
774
796
|
"stroke-width": "1.4",
|
|
775
797
|
"stroke-linecap": "round"
|
|
776
798
|
}, null, -1)),
|
|
777
|
-
t[15] || (t[15] =
|
|
799
|
+
t[15] || (t[15] = l("path", {
|
|
778
800
|
d: "M13.5 12h3M13.5 14.5h3M13.5 17h2",
|
|
779
801
|
stroke: "#2F6DC0",
|
|
780
802
|
"stroke-width": "1.4",
|
|
781
803
|
"stroke-linecap": "round"
|
|
782
804
|
}, null, -1))
|
|
783
|
-
], 64)) : e.type === "sheet" ? (
|
|
784
|
-
t[16] || (t[16] =
|
|
805
|
+
], 64)) : e.type === "sheet" ? (a(), i(M, { key: 6 }, [
|
|
806
|
+
t[16] || (t[16] = l("rect", {
|
|
785
807
|
x: "4",
|
|
786
808
|
y: "3.5",
|
|
787
809
|
width: "16",
|
|
@@ -792,14 +814,14 @@ const C = (e, o) => {
|
|
|
792
814
|
stroke: "#33854F",
|
|
793
815
|
"stroke-width": "1.4"
|
|
794
816
|
}, null, -1)),
|
|
795
|
-
t[17] || (t[17] =
|
|
817
|
+
t[17] || (t[17] = l("path", {
|
|
796
818
|
d: "M4 9h16M4 14h16M10 9v11.5M14.5 9v11.5",
|
|
797
819
|
stroke: "#33854F",
|
|
798
820
|
"stroke-width": "1.2",
|
|
799
821
|
"stroke-linecap": "round"
|
|
800
822
|
}, null, -1))
|
|
801
|
-
], 64)) : e.type === "slide" ? (
|
|
802
|
-
t[18] || (t[18] =
|
|
823
|
+
], 64)) : e.type === "slide" ? (a(), i(M, { key: 7 }, [
|
|
824
|
+
t[18] || (t[18] = l("rect", {
|
|
803
825
|
x: "3",
|
|
804
826
|
y: "5",
|
|
805
827
|
width: "18",
|
|
@@ -810,19 +832,19 @@ const C = (e, o) => {
|
|
|
810
832
|
stroke: "#CC8420",
|
|
811
833
|
"stroke-width": "1.4"
|
|
812
834
|
}, null, -1)),
|
|
813
|
-
t[19] || (t[19] =
|
|
835
|
+
t[19] || (t[19] = l("path", {
|
|
814
836
|
d: "M12 17v3M9.5 20h5",
|
|
815
837
|
stroke: "#CC8420",
|
|
816
838
|
"stroke-width": "1.4",
|
|
817
839
|
"stroke-linecap": "round"
|
|
818
840
|
}, null, -1)),
|
|
819
|
-
t[20] || (t[20] =
|
|
841
|
+
t[20] || (t[20] = l("circle", {
|
|
820
842
|
cx: "9",
|
|
821
843
|
cy: "10.4",
|
|
822
844
|
r: "1.3",
|
|
823
845
|
fill: "#CC8420"
|
|
824
846
|
}, null, -1)),
|
|
825
|
-
t[21] || (t[21] =
|
|
847
|
+
t[21] || (t[21] = l("path", {
|
|
826
848
|
d: "M6 14.4l2.8-2.8 2 1.8L14 9.6l4 4.4",
|
|
827
849
|
stroke: "#CC8420",
|
|
828
850
|
"stroke-width": "1.4",
|
|
@@ -830,8 +852,8 @@ const C = (e, o) => {
|
|
|
830
852
|
"stroke-linejoin": "round",
|
|
831
853
|
fill: "none"
|
|
832
854
|
}, null, -1))
|
|
833
|
-
], 64)) : e.type === "archive" ? (
|
|
834
|
-
t[22] || (t[22] =
|
|
855
|
+
], 64)) : e.type === "archive" ? (a(), i(M, { key: 8 }, [
|
|
856
|
+
t[22] || (t[22] = l("rect", {
|
|
835
857
|
x: "4",
|
|
836
858
|
y: "3.5",
|
|
837
859
|
width: "16",
|
|
@@ -842,13 +864,13 @@ const C = (e, o) => {
|
|
|
842
864
|
stroke: "#8F6539",
|
|
843
865
|
"stroke-width": "1.4"
|
|
844
866
|
}, null, -1)),
|
|
845
|
-
t[23] || (t[23] =
|
|
867
|
+
t[23] || (t[23] = l("path", {
|
|
846
868
|
d: "M9.5 4v16M14.5 4v16M4 12h16",
|
|
847
869
|
stroke: "#8F6539",
|
|
848
870
|
"stroke-width": "1.3"
|
|
849
871
|
}, null, -1))
|
|
850
|
-
], 64)) : e.type === "code" ? (
|
|
851
|
-
t[24] || (t[24] =
|
|
872
|
+
], 64)) : e.type === "code" ? (a(), i(M, { key: 9 }, [
|
|
873
|
+
t[24] || (t[24] = l("path", {
|
|
852
874
|
d: "M8.5 8l-4.5 4 4.5 4M15.5 8l4.5 4-4.5 4",
|
|
853
875
|
stroke: "#6B62E0",
|
|
854
876
|
"stroke-width": "1.7",
|
|
@@ -856,28 +878,28 @@ const C = (e, o) => {
|
|
|
856
878
|
"stroke-linejoin": "round",
|
|
857
879
|
fill: "none"
|
|
858
880
|
}, null, -1)),
|
|
859
|
-
t[25] || (t[25] =
|
|
881
|
+
t[25] || (t[25] = l("path", {
|
|
860
882
|
d: "M13.6 5.8l-3.2 12.4",
|
|
861
883
|
stroke: "#6B62E0",
|
|
862
884
|
"stroke-width": "1.5",
|
|
863
885
|
"stroke-linecap": "round"
|
|
864
886
|
}, null, -1))
|
|
865
|
-
], 64)) : e.type === "text" ? (
|
|
866
|
-
t[26] || (t[26] =
|
|
887
|
+
], 64)) : e.type === "text" ? (a(), i(M, { key: 10 }, [
|
|
888
|
+
t[26] || (t[26] = l("path", {
|
|
867
889
|
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
890
|
fill: "#7D8894",
|
|
869
891
|
"fill-opacity": "0.12",
|
|
870
892
|
stroke: "#5F6B78",
|
|
871
893
|
"stroke-width": "1.4"
|
|
872
894
|
}, null, -1)),
|
|
873
|
-
t[27] || (t[27] =
|
|
895
|
+
t[27] || (t[27] = l("path", {
|
|
874
896
|
d: "M7.5 8.5h9M7.5 12h6.5",
|
|
875
897
|
stroke: "#5F6B78",
|
|
876
898
|
"stroke-width": "1.5",
|
|
877
899
|
"stroke-linecap": "round"
|
|
878
900
|
}, null, -1))
|
|
879
|
-
], 64)) : (
|
|
880
|
-
t[28] || (t[28] =
|
|
901
|
+
], 64)) : (a(), i(M, { key: 11 }, [
|
|
902
|
+
t[28] || (t[28] = l("path", {
|
|
881
903
|
d: "M6 3.5h8l5 5v12h-13z",
|
|
882
904
|
fill: "#A2AAB4",
|
|
883
905
|
"fill-opacity": "0.16",
|
|
@@ -885,27 +907,30 @@ const C = (e, o) => {
|
|
|
885
907
|
"stroke-width": "1.4",
|
|
886
908
|
"stroke-linejoin": "round"
|
|
887
909
|
}, null, -1)),
|
|
888
|
-
t[29] || (t[29] =
|
|
910
|
+
t[29] || (t[29] = l("path", {
|
|
889
911
|
d: "M14 3.5v5h5",
|
|
890
912
|
fill: "none",
|
|
891
913
|
stroke: "#7C8590",
|
|
892
914
|
"stroke-width": "1.4",
|
|
893
915
|
"stroke-linejoin": "round"
|
|
894
916
|
}, null, -1)),
|
|
895
|
-
t[30] || (t[30] =
|
|
917
|
+
t[30] || (t[30] = l("path", {
|
|
896
918
|
d: "M8 12.5h8M8 15.5h8M8 18.5h5",
|
|
897
919
|
stroke: "#7C8590",
|
|
898
920
|
"stroke-width": "1.3",
|
|
899
921
|
"stroke-linecap": "round"
|
|
900
922
|
}, null, -1))
|
|
901
923
|
], 64))
|
|
902
|
-
], 8,
|
|
924
|
+
], 8, Pt))
|
|
903
925
|
], 4));
|
|
904
926
|
}
|
|
905
|
-
},
|
|
927
|
+
}, qt = /* @__PURE__ */ E(Wt, [["__scopeId", "data-v-c598c294"]]), Jt = '<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>', Ut = '<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>', Kt = '<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>', Gt = '<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>', Yt = '<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>', Zt = '<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>', Qt = '<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>', en = '<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>', tn = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none">
|
|
928
|
+
<circle cx="12" cy="12" r="8.5" stroke="currentColor" stroke-width="1.8" />
|
|
929
|
+
<path d="M3.5 12h17M12 3.5c2.5 2 3.8 5 3.8 8.5s-1.3 6.5-3.8 8.5c-2.5-2-3.8-5-3.8-8.5s1.3-6.5 3.8-8.5z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" />
|
|
930
|
+
</svg>`, nn = '<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>', ln = '<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>', sn = '<?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>', on = '<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>', an = '<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>', rn = '<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>', dn = '<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>', un = '<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>', cn = '<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>', pn = '<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>', fn = ["viewBox", "innerHTML"], hn = {
|
|
906
931
|
key: 2,
|
|
907
932
|
class: "xp-icon__fallback"
|
|
908
|
-
},
|
|
933
|
+
}, mn = {
|
|
909
934
|
__name: "Icon",
|
|
910
935
|
props: {
|
|
911
936
|
name: {
|
|
@@ -930,44 +955,44 @@ const C = (e, o) => {
|
|
|
930
955
|
}
|
|
931
956
|
},
|
|
932
957
|
setup(e) {
|
|
933
|
-
const
|
|
958
|
+
const n = ["small", "medium", "large"], t = e, s = /* @__PURE__ */ Object.assign({ "./icons/arrow-right.svg": Jt, "./icons/back.svg": Ut, "./icons/chevron-down.svg": Kt, "./icons/chevron-up.svg": Gt, "./icons/close.svg": Yt, "./icons/folder-add.svg": Zt, "./icons/folder.svg": Qt, "./icons/forward.svg": en, "./icons/globe.svg": tn, "./icons/grid.svg": nn, "./icons/home.svg": ln, "./icons/jiantou.svg": sn, "./icons/list.svg": on, "./icons/refresh.svg": an, "./icons/settings.svg": rn, "./icons/star-fill.svg": dn, "./icons/star.svg": un, "./icons/up.svg": cn, "./icons/upload.svg": pn }), o = (d) => d && d.replace(/\bfill\s*=\s*["'](?!none["'])[^"']+["']/gi, 'fill="currentColor"').replace(/\bstroke\s*=\s*["'](?!none["'])[^"']+["']/gi, 'stroke="currentColor"'), r = B(() => {
|
|
934
959
|
if (!t.name) return null;
|
|
935
|
-
const
|
|
936
|
-
if (!
|
|
937
|
-
const
|
|
960
|
+
const d = `./icons/${t.name}.svg`, p = s[d];
|
|
961
|
+
if (!p) return null;
|
|
962
|
+
const v = p.match(/<svg[^>]*>([\s\S]*)<\/svg>/i), C = o(v ? v[1] : p), $ = p.match(/viewBox\s*=\s*["']([^"']+)["']/i);
|
|
938
963
|
return {
|
|
939
|
-
inner:
|
|
964
|
+
inner: C,
|
|
940
965
|
viewBox: $ ? $[1] : "0 0 24 24"
|
|
941
966
|
};
|
|
942
|
-
}),
|
|
943
|
-
if (
|
|
944
|
-
const
|
|
945
|
-
return typeof
|
|
946
|
-
}),
|
|
947
|
-
const
|
|
948
|
-
return
|
|
949
|
-
}),
|
|
950
|
-
const
|
|
951
|
-
return t.color && (
|
|
967
|
+
}), u = B(() => n.includes(String(t.size))), _ = B(() => {
|
|
968
|
+
if (u.value) return null;
|
|
969
|
+
const d = t.size;
|
|
970
|
+
return typeof d == "number" ? `${d}px` : typeof d == "string" && d.trim() ? /^\d+(\.\d+)?$/.test(d.trim()) ? `${d}px` : d.trim() : null;
|
|
971
|
+
}), x = B(() => {
|
|
972
|
+
const d = [];
|
|
973
|
+
return u.value && d.push(`xp-icon--${t.size}`), t.spin && d.push("xp-icon--spin"), d;
|
|
974
|
+
}), c = B(() => {
|
|
975
|
+
const d = {};
|
|
976
|
+
return t.color && (d.color = t.color), t.rotate && (d.transform = `rotate(${t.rotate}deg)`), _.value && (d.width = _.value, d.height = _.value, d.fontSize = _.value), d;
|
|
952
977
|
});
|
|
953
|
-
return (
|
|
954
|
-
class:
|
|
955
|
-
style:
|
|
978
|
+
return (d, p) => (a(), i("i", {
|
|
979
|
+
class: z(["xp-icon", x.value]),
|
|
980
|
+
style: L(c.value)
|
|
956
981
|
}, [
|
|
957
|
-
|
|
982
|
+
d.$slots.default ? I(d.$slots, "default", { key: 0 }, void 0, !0) : r.value ? (a(), i("svg", {
|
|
958
983
|
key: 1,
|
|
959
|
-
viewBox:
|
|
960
|
-
innerHTML:
|
|
961
|
-
}, null, 8,
|
|
984
|
+
viewBox: r.value.viewBox,
|
|
985
|
+
innerHTML: r.value.inner
|
|
986
|
+
}, null, 8, fn)) : (a(), i("span", hn, "?"))
|
|
962
987
|
], 6));
|
|
963
988
|
}
|
|
964
|
-
},
|
|
989
|
+
}, vn = /* @__PURE__ */ E(mn, [["__scopeId", "data-v-9ed9f36d"]]), gn = {
|
|
965
990
|
key: 0,
|
|
966
991
|
class: "xp-input__prefix"
|
|
967
|
-
},
|
|
992
|
+
}, xn = ["id", "type", "value", "placeholder", "disabled", "maxlength"], _n = {
|
|
968
993
|
key: 2,
|
|
969
994
|
class: "xp-input__suffix"
|
|
970
|
-
},
|
|
995
|
+
}, bn = {
|
|
971
996
|
__name: "Input",
|
|
972
997
|
props: {
|
|
973
998
|
modelValue: {
|
|
@@ -1007,37 +1032,37 @@ const C = (e, o) => {
|
|
|
1007
1032
|
}
|
|
1008
1033
|
},
|
|
1009
1034
|
emits: ["update:modelValue", "focus", "blur", "clear"],
|
|
1010
|
-
setup(e, { expose:
|
|
1011
|
-
const s = t,
|
|
1012
|
-
s("update:modelValue",
|
|
1013
|
-
},
|
|
1014
|
-
|
|
1015
|
-
},
|
|
1016
|
-
|
|
1017
|
-
},
|
|
1018
|
-
s("update:modelValue", ""), s("clear"),
|
|
1035
|
+
setup(e, { expose: n, emit: t }) {
|
|
1036
|
+
const s = t, o = V(null), r = V(!1), u = (d) => {
|
|
1037
|
+
s("update:modelValue", d.target.value);
|
|
1038
|
+
}, _ = (d) => {
|
|
1039
|
+
r.value = !0, s("focus", d);
|
|
1040
|
+
}, x = (d) => {
|
|
1041
|
+
r.value = !1, s("blur", d);
|
|
1042
|
+
}, c = () => {
|
|
1043
|
+
s("update:modelValue", ""), s("clear"), o.value && o.value.focus();
|
|
1019
1044
|
};
|
|
1020
|
-
return
|
|
1021
|
-
focus: () =>
|
|
1022
|
-
select: () =>
|
|
1023
|
-
blur: () =>
|
|
1024
|
-
}), (
|
|
1025
|
-
class:
|
|
1045
|
+
return n({
|
|
1046
|
+
focus: () => o.value && o.value.focus(),
|
|
1047
|
+
select: () => o.value && o.value.select(),
|
|
1048
|
+
blur: () => o.value && o.value.blur()
|
|
1049
|
+
}), (d, p) => (a(), i("div", {
|
|
1050
|
+
class: z(["xp-input", [
|
|
1026
1051
|
`xp-input--${e.size}`,
|
|
1027
1052
|
{
|
|
1028
1053
|
"xp-input--disabled": e.disabled,
|
|
1029
|
-
"xp-input--prefix":
|
|
1030
|
-
"xp-input--suffix":
|
|
1031
|
-
"xp-input--focus":
|
|
1054
|
+
"xp-input--prefix": d.$slots.prefix,
|
|
1055
|
+
"xp-input--suffix": d.$slots.suffix || e.showClear,
|
|
1056
|
+
"xp-input--focus": r.value
|
|
1032
1057
|
}
|
|
1033
1058
|
]])
|
|
1034
1059
|
}, [
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
])) :
|
|
1038
|
-
|
|
1060
|
+
d.$slots.prefix ? (a(), i("span", gn, [
|
|
1061
|
+
I(d.$slots, "prefix", {}, void 0, !0)
|
|
1062
|
+
])) : w("", !0),
|
|
1063
|
+
l("input", {
|
|
1039
1064
|
ref_key: "inputRef",
|
|
1040
|
-
ref:
|
|
1065
|
+
ref: o,
|
|
1041
1066
|
class: "xp-input__inner",
|
|
1042
1067
|
id: e.id || void 0,
|
|
1043
1068
|
type: e.type,
|
|
@@ -1045,24 +1070,580 @@ const C = (e, o) => {
|
|
|
1045
1070
|
placeholder: e.placeholder,
|
|
1046
1071
|
disabled: e.disabled,
|
|
1047
1072
|
maxlength: e.maxlength,
|
|
1048
|
-
onInput:
|
|
1049
|
-
onFocus:
|
|
1050
|
-
onBlur:
|
|
1051
|
-
}, null, 40,
|
|
1052
|
-
e.showClear && e.modelValue && !e.disabled ? (
|
|
1073
|
+
onInput: u,
|
|
1074
|
+
onFocus: _,
|
|
1075
|
+
onBlur: x
|
|
1076
|
+
}, null, 40, xn),
|
|
1077
|
+
e.showClear && e.modelValue && !e.disabled ? (a(), i("span", {
|
|
1053
1078
|
key: 1,
|
|
1054
1079
|
class: "xp-input__clear",
|
|
1055
|
-
onClick:
|
|
1056
|
-
}, "×")) :
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
])) :
|
|
1080
|
+
onClick: c
|
|
1081
|
+
}, "×")) : w("", !0),
|
|
1082
|
+
d.$slots.suffix && !e.showClear ? (a(), i("span", _n, [
|
|
1083
|
+
I(d.$slots, "suffix", {}, void 0, !0)
|
|
1084
|
+
])) : w("", !0)
|
|
1060
1085
|
], 2));
|
|
1061
1086
|
}
|
|
1062
|
-
},
|
|
1087
|
+
}, yn = /* @__PURE__ */ E(bn, [["__scopeId", "data-v-c63d4925"]]), kn = ["innerHTML"], wn = { class: "xp-menu__label" }, $n = ["innerHTML"], Cn = { class: "xp-menu__label" }, Ce = ".", Sn = {
|
|
1088
|
+
__name: "Menu",
|
|
1089
|
+
props: {
|
|
1090
|
+
// 当前激活菜单项(叶子节点)的完整 index,可用 v-model 双向绑定
|
|
1091
|
+
modelValue: {
|
|
1092
|
+
type: [String, Number],
|
|
1093
|
+
default: ""
|
|
1094
|
+
},
|
|
1095
|
+
// 菜单排列方向
|
|
1096
|
+
mode: {
|
|
1097
|
+
type: String,
|
|
1098
|
+
default: "vertical",
|
|
1099
|
+
validator: (e) => ["vertical", "horizontal"].includes(e)
|
|
1100
|
+
},
|
|
1101
|
+
// 数据驱动模式下的菜单树,节点结构:
|
|
1102
|
+
// { index, label, icon?, children?, disabled? },children 可无限嵌套
|
|
1103
|
+
items: {
|
|
1104
|
+
type: Array,
|
|
1105
|
+
default: () => []
|
|
1106
|
+
},
|
|
1107
|
+
// 折叠模式(仅 vertical 生效):仅展示图标,悬停弹出子菜单面板
|
|
1108
|
+
collapse: {
|
|
1109
|
+
type: Boolean,
|
|
1110
|
+
default: !1
|
|
1111
|
+
},
|
|
1112
|
+
// 手风琴模式:同一分支下只展开一个子菜单
|
|
1113
|
+
uniqueOpen: {
|
|
1114
|
+
type: Boolean,
|
|
1115
|
+
default: !0
|
|
1116
|
+
},
|
|
1117
|
+
disabled: {
|
|
1118
|
+
type: Boolean,
|
|
1119
|
+
default: !1
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1122
|
+
emits: ["update:modelValue", "select", "open", "close"],
|
|
1123
|
+
setup(e, { emit: n }) {
|
|
1124
|
+
const t = e, s = n, o = V(null), r = B(() => t.mode === "vertical"), u = (y, D) => (y || []).map((H) => {
|
|
1125
|
+
const q = D ? `${D}${Ce}${H.index}` : String(H.index ?? ""), R = Array.isArray(H.children) && H.children.length ? u(H.children, q) : void 0;
|
|
1126
|
+
return { ...H, _idx: q, children: R };
|
|
1127
|
+
}), _ = B(() => u(t.items, "")), x = (y) => Array.isArray(y.children) && y.children.length > 0, c = B(() => String(t.modelValue ?? "")), d = V([]), p = (y) => d.value.includes(y), v = (y) => {
|
|
1128
|
+
d.value = d.value.filter((D) => D !== y), s("close", y);
|
|
1129
|
+
}, C = (y) => {
|
|
1130
|
+
d.value.includes(y) || d.value.push(y), s("open", y);
|
|
1131
|
+
}, $ = (y) => {
|
|
1132
|
+
if (!t.disabled) {
|
|
1133
|
+
if (p(y)) {
|
|
1134
|
+
v(y);
|
|
1135
|
+
return;
|
|
1136
|
+
}
|
|
1137
|
+
t.uniqueOpen && (d.value = d.value.filter((D) => y.startsWith(`${D}${Ce}`))), C(y);
|
|
1138
|
+
}
|
|
1139
|
+
}, j = (y, D) => {
|
|
1140
|
+
t.disabled || (s("select", y, D), String(t.modelValue) !== String(y) && s("update:modelValue", y));
|
|
1141
|
+
};
|
|
1142
|
+
return ke("xp-menu", {
|
|
1143
|
+
mode: t.mode,
|
|
1144
|
+
isVertical: r,
|
|
1145
|
+
collapse: t.collapse,
|
|
1146
|
+
uniqueOpen: t.uniqueOpen,
|
|
1147
|
+
activeIndex: c,
|
|
1148
|
+
menuRef: o,
|
|
1149
|
+
isSubMenuOpen: p,
|
|
1150
|
+
toggleSubMenu: $,
|
|
1151
|
+
openSubMenu: C,
|
|
1152
|
+
closeSubMenu: v,
|
|
1153
|
+
selectMenuItem: j
|
|
1154
|
+
}), (y, D) => {
|
|
1155
|
+
const H = ce("XpSubMenu"), q = ce("XpMenuItem");
|
|
1156
|
+
return a(), i("ul", {
|
|
1157
|
+
class: z(["xp-menu", [`xp-menu--${e.mode}`, { "xp-menu--collapse": r.value && e.collapse }]]),
|
|
1158
|
+
role: "menubar",
|
|
1159
|
+
ref_key: "menuRef",
|
|
1160
|
+
ref: o
|
|
1161
|
+
}, [
|
|
1162
|
+
_.value.length ? (a(!0), i(M, { key: 0 }, X(_.value, (R) => (a(), i(M, {
|
|
1163
|
+
key: R._idx
|
|
1164
|
+
}, [
|
|
1165
|
+
x(R) ? (a(), O(H, {
|
|
1166
|
+
key: 0,
|
|
1167
|
+
index: R._idx,
|
|
1168
|
+
label: R.label,
|
|
1169
|
+
icon: R.icon,
|
|
1170
|
+
items: R.children,
|
|
1171
|
+
disabled: R.disabled
|
|
1172
|
+
}, {
|
|
1173
|
+
title: F(() => [
|
|
1174
|
+
R.icon ? (a(), i("span", {
|
|
1175
|
+
key: 0,
|
|
1176
|
+
class: "xp-menu__icon",
|
|
1177
|
+
innerHTML: R.icon
|
|
1178
|
+
}, null, 8, kn)) : w("", !0),
|
|
1179
|
+
l("span", wn, S(R.label), 1)
|
|
1180
|
+
]),
|
|
1181
|
+
_: 2
|
|
1182
|
+
}, 1032, ["index", "label", "icon", "items", "disabled"])) : (a(), O(q, {
|
|
1183
|
+
key: 1,
|
|
1184
|
+
index: R._idx,
|
|
1185
|
+
item: R,
|
|
1186
|
+
disabled: R.disabled
|
|
1187
|
+
}, {
|
|
1188
|
+
default: F(() => [
|
|
1189
|
+
R.icon ? (a(), i("span", {
|
|
1190
|
+
key: 0,
|
|
1191
|
+
class: "xp-menu__icon",
|
|
1192
|
+
innerHTML: R.icon
|
|
1193
|
+
}, null, 8, $n)) : w("", !0),
|
|
1194
|
+
l("span", Cn, S(R.label), 1)
|
|
1195
|
+
]),
|
|
1196
|
+
_: 2
|
|
1197
|
+
}, 1032, ["index", "item", "disabled"]))
|
|
1198
|
+
], 64))), 128)) : I(y.$slots, "default", { key: 1 }, void 0, !0)
|
|
1199
|
+
], 2);
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
}, Mn = /* @__PURE__ */ E(Sn, [["__scopeId", "data-v-dc164e3e"]]), Bn = { class: "xp-menu-group" }, zn = { class: "xp-menu-group__title" }, In = { class: "xp-menu-group__items" }, Tn = {
|
|
1203
|
+
__name: "MenuGroup",
|
|
1204
|
+
props: {
|
|
1205
|
+
// 分组标题文案
|
|
1206
|
+
title: {
|
|
1207
|
+
type: String,
|
|
1208
|
+
default: ""
|
|
1209
|
+
}
|
|
1210
|
+
},
|
|
1211
|
+
setup(e) {
|
|
1212
|
+
return (n, t) => (a(), i("li", Bn, [
|
|
1213
|
+
l("div", zn, S(e.title), 1),
|
|
1214
|
+
l("ul", In, [
|
|
1215
|
+
I(n.$slots, "default", {}, void 0, !0)
|
|
1216
|
+
])
|
|
1217
|
+
]));
|
|
1218
|
+
}
|
|
1219
|
+
}, Vn = /* @__PURE__ */ E(Tn, [["__scopeId", "data-v-3c5dace0"]]), jn = ["tabindex"], An = {
|
|
1220
|
+
__name: "MenuItem",
|
|
1221
|
+
props: {
|
|
1222
|
+
// 菜单项的完整路径 index(叶子节点)
|
|
1223
|
+
index: {
|
|
1224
|
+
type: [String, Number],
|
|
1225
|
+
required: !0
|
|
1226
|
+
},
|
|
1227
|
+
disabled: {
|
|
1228
|
+
type: Boolean,
|
|
1229
|
+
default: !1
|
|
1230
|
+
},
|
|
1231
|
+
// 数据驱动模式下对应的原始节点(经 select 事件透传,便于外部读取 path 等扩展字段)
|
|
1232
|
+
item: {
|
|
1233
|
+
type: Object,
|
|
1234
|
+
default: null
|
|
1235
|
+
}
|
|
1236
|
+
},
|
|
1237
|
+
setup(e) {
|
|
1238
|
+
const n = e, t = he("xp-menu", null), s = B(
|
|
1239
|
+
() => !!t && String(t.activeIndex.value) === String(n.index)
|
|
1240
|
+
), o = () => {
|
|
1241
|
+
n.disabled || !t || t.selectMenuItem(String(n.index), n.item);
|
|
1242
|
+
};
|
|
1243
|
+
return (r, u) => (a(), i("li", {
|
|
1244
|
+
class: z(["xp-menu-item", { "xp-menu-item--active": s.value, "xp-menu-item--disabled": e.disabled }]),
|
|
1245
|
+
role: "menuitem",
|
|
1246
|
+
tabindex: e.disabled ? -1 : 0,
|
|
1247
|
+
onClick: o
|
|
1248
|
+
}, [
|
|
1249
|
+
I(r.$slots, "default")
|
|
1250
|
+
], 10, jn));
|
|
1251
|
+
}
|
|
1252
|
+
}, En = ["tabindex"], Nn = ["innerHTML"], Rn = { class: "xp-menu__label" }, Xn = {
|
|
1253
|
+
class: "xp-sub-menu__panel",
|
|
1254
|
+
role: "menu"
|
|
1255
|
+
}, Dn = ["innerHTML"], On = { class: "xp-menu__label" }, Fn = ".", Ln = {
|
|
1256
|
+
__name: "SubMenu",
|
|
1257
|
+
props: {
|
|
1258
|
+
// 子菜单的完整路径 index(由外层组装,或由 XpMenu 归一化数据树生成)
|
|
1259
|
+
index: {
|
|
1260
|
+
type: [String, Number],
|
|
1261
|
+
required: !0
|
|
1262
|
+
},
|
|
1263
|
+
// 数据驱动模式下的标题文案与图标(内联 SVG 字符串)
|
|
1264
|
+
label: {
|
|
1265
|
+
type: String,
|
|
1266
|
+
default: ""
|
|
1267
|
+
},
|
|
1268
|
+
icon: {
|
|
1269
|
+
type: String,
|
|
1270
|
+
default: ""
|
|
1271
|
+
},
|
|
1272
|
+
// 数据驱动模式下子节点的坐标菜单树
|
|
1273
|
+
items: {
|
|
1274
|
+
type: Array,
|
|
1275
|
+
default: () => []
|
|
1276
|
+
},
|
|
1277
|
+
disabled: {
|
|
1278
|
+
type: Boolean,
|
|
1279
|
+
default: !1
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1282
|
+
setup(e) {
|
|
1283
|
+
const n = e, t = he("xp-menu", null), s = (v) => Array.isArray(v.children) && v.children.length > 0, o = B(() => String(n.index)), r = B(
|
|
1284
|
+
() => !!t && (t.mode === "horizontal" || !!t.collapse)
|
|
1285
|
+
), u = V(!1), _ = B(
|
|
1286
|
+
() => !!t && (t.activeIndex.value === o.value || t.activeIndex.value.startsWith(`${o.value}${Fn}`))
|
|
1287
|
+
), x = B(
|
|
1288
|
+
() => r.value ? u.value : _.value || !!(t != null && t.isSubMenuOpen(o.value))
|
|
1289
|
+
), c = () => {
|
|
1290
|
+
r.value && !n.disabled && (u.value = !0);
|
|
1291
|
+
}, d = () => {
|
|
1292
|
+
r.value && (u.value = !1);
|
|
1293
|
+
}, p = () => {
|
|
1294
|
+
n.disabled || !t || (r.value ? u.value = !u.value : t.toggleSubMenu(o.value));
|
|
1295
|
+
};
|
|
1296
|
+
return (v, C) => {
|
|
1297
|
+
const $ = ce("XpSubMenu"), j = ce("XpMenuItem");
|
|
1298
|
+
return a(), i("li", {
|
|
1299
|
+
class: z(["xp-sub-menu", {
|
|
1300
|
+
"is-opened": x.value,
|
|
1301
|
+
"is-active": _.value,
|
|
1302
|
+
"is-disabled": e.disabled,
|
|
1303
|
+
"is-popup-open": u.value
|
|
1304
|
+
}]),
|
|
1305
|
+
role: "menuitem",
|
|
1306
|
+
onMouseleave: d
|
|
1307
|
+
}, [
|
|
1308
|
+
l("div", {
|
|
1309
|
+
class: "xp-sub-menu__title",
|
|
1310
|
+
role: "menuitem",
|
|
1311
|
+
tabindex: e.disabled ? -1 : 0,
|
|
1312
|
+
onClick: p,
|
|
1313
|
+
onMouseenter: c
|
|
1314
|
+
}, [
|
|
1315
|
+
I(v.$slots, "title", {}, () => [
|
|
1316
|
+
e.icon ? (a(), i("span", {
|
|
1317
|
+
key: 0,
|
|
1318
|
+
class: "xp-menu__icon",
|
|
1319
|
+
innerHTML: e.icon
|
|
1320
|
+
}, null, 8, Nn)) : w("", !0),
|
|
1321
|
+
l("span", Rn, S(e.label), 1)
|
|
1322
|
+
]),
|
|
1323
|
+
C[0] || (C[0] = l("span", {
|
|
1324
|
+
class: "xp-sub-menu__arrow",
|
|
1325
|
+
"aria-hidden": "true"
|
|
1326
|
+
}, [
|
|
1327
|
+
l("svg", {
|
|
1328
|
+
width: "12",
|
|
1329
|
+
height: "12",
|
|
1330
|
+
viewBox: "0 0 24 24",
|
|
1331
|
+
fill: "none"
|
|
1332
|
+
}, [
|
|
1333
|
+
l("path", {
|
|
1334
|
+
d: "M6 9l6 6 6-6",
|
|
1335
|
+
stroke: "currentColor",
|
|
1336
|
+
"stroke-width": "2",
|
|
1337
|
+
"stroke-linecap": "round",
|
|
1338
|
+
"stroke-linejoin": "round"
|
|
1339
|
+
})
|
|
1340
|
+
])
|
|
1341
|
+
], -1))
|
|
1342
|
+
], 40, En),
|
|
1343
|
+
Fe(l("ul", Xn, [
|
|
1344
|
+
e.items.length ? (a(!0), i(M, { key: 1 }, X(e.items, (y) => (a(), i(M, {
|
|
1345
|
+
key: y._idx
|
|
1346
|
+
}, [
|
|
1347
|
+
s(y) ? (a(), O($, {
|
|
1348
|
+
key: 0,
|
|
1349
|
+
index: y._idx,
|
|
1350
|
+
label: y.label,
|
|
1351
|
+
icon: y.icon,
|
|
1352
|
+
items: y.children,
|
|
1353
|
+
disabled: y.disabled
|
|
1354
|
+
}, null, 8, ["index", "label", "icon", "items", "disabled"])) : (a(), O(j, {
|
|
1355
|
+
key: 1,
|
|
1356
|
+
index: y._idx,
|
|
1357
|
+
item: y,
|
|
1358
|
+
disabled: y.disabled
|
|
1359
|
+
}, {
|
|
1360
|
+
default: F(() => [
|
|
1361
|
+
y.icon ? (a(), i("span", {
|
|
1362
|
+
key: 0,
|
|
1363
|
+
class: "xp-menu__icon",
|
|
1364
|
+
innerHTML: y.icon
|
|
1365
|
+
}, null, 8, Dn)) : w("", !0),
|
|
1366
|
+
l("span", On, S(y.label), 1)
|
|
1367
|
+
]),
|
|
1368
|
+
_: 2
|
|
1369
|
+
}, 1032, ["index", "item", "disabled"]))
|
|
1370
|
+
], 64))), 128)) : I(v.$slots, "default", { key: 0 })
|
|
1371
|
+
], 512), [
|
|
1372
|
+
[Le, x.value]
|
|
1373
|
+
])
|
|
1374
|
+
], 34);
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
}, Hn = ["aria-expanded", "aria-disabled", "tabindex"], Pn = ["aria-selected", "onClick", "onMouseenter"], Wn = { class: "xp-select__option-label" }, qn = {
|
|
1378
|
+
key: 0,
|
|
1379
|
+
class: "xp-select__check",
|
|
1380
|
+
width: "14",
|
|
1381
|
+
height: "14",
|
|
1382
|
+
viewBox: "0 0 24 24",
|
|
1383
|
+
fill: "none",
|
|
1384
|
+
"aria-hidden": "true"
|
|
1385
|
+
}, Jn = {
|
|
1386
|
+
key: 0,
|
|
1387
|
+
class: "xp-select__empty"
|
|
1388
|
+
}, Un = {
|
|
1389
|
+
__name: "Select",
|
|
1390
|
+
props: {
|
|
1391
|
+
/** 当前选中值,支持 v-model */
|
|
1392
|
+
modelValue: { type: [String, Number, Boolean], default: "" },
|
|
1393
|
+
/** 选项:{ label, value, disabled } 或纯值 */
|
|
1394
|
+
options: { type: Array, default: () => [] },
|
|
1395
|
+
/** 未选中时的占位文案 */
|
|
1396
|
+
placeholder: { type: String, default: "请选择" },
|
|
1397
|
+
/** 尺寸 */
|
|
1398
|
+
size: {
|
|
1399
|
+
type: String,
|
|
1400
|
+
default: "medium",
|
|
1401
|
+
validator: (e) => ["small", "medium", "large"].includes(e)
|
|
1402
|
+
},
|
|
1403
|
+
/** 禁用 */
|
|
1404
|
+
disabled: { type: Boolean, default: !1 },
|
|
1405
|
+
/** 是否可清空 */
|
|
1406
|
+
clearable: { type: Boolean, default: !1 }
|
|
1407
|
+
},
|
|
1408
|
+
emits: ["update:modelValue", "change", "clear", "visible-change"],
|
|
1409
|
+
setup(e, { emit: n }) {
|
|
1410
|
+
const t = e, s = n, o = V(!1), r = V(-1), u = V({}), _ = V(null), x = V(null), c = B(
|
|
1411
|
+
() => t.options.map(
|
|
1412
|
+
(g) => g !== null && typeof g == "object" ? { label: String(g.label ?? g.value ?? ""), value: g.value, disabled: !!g.disabled } : { label: String(g), value: g, disabled: !1 }
|
|
1413
|
+
)
|
|
1414
|
+
), d = B(() => t.modelValue !== "" && t.modelValue !== null && t.modelValue !== void 0), p = B(() => c.value.find((g) => g.value === t.modelValue)), v = B(() => {
|
|
1415
|
+
var g;
|
|
1416
|
+
return ((g = p.value) == null ? void 0 : g.label) ?? t.placeholder;
|
|
1417
|
+
}), C = (g) => g.value === t.modelValue, $ = () => {
|
|
1418
|
+
ye(() => {
|
|
1419
|
+
if (!_.value || !x.value) return;
|
|
1420
|
+
const g = _.value.getBoundingClientRect(), b = x.value.getBoundingClientRect().height;
|
|
1421
|
+
let m = g.bottom + 6;
|
|
1422
|
+
m + b > window.innerHeight - 10 && (m = Math.max(10, g.top - b - 6)), u.value = {
|
|
1423
|
+
width: `${g.width}px`,
|
|
1424
|
+
top: `${m + window.scrollY}px`,
|
|
1425
|
+
left: `${g.left + window.scrollX}px`
|
|
1426
|
+
};
|
|
1427
|
+
});
|
|
1428
|
+
}, j = () => {
|
|
1429
|
+
if (t.disabled) return;
|
|
1430
|
+
o.value = !0;
|
|
1431
|
+
const g = c.value.findIndex((b) => C(b));
|
|
1432
|
+
r.value = g, $(), s("visible-change", !0);
|
|
1433
|
+
}, y = () => {
|
|
1434
|
+
o.value = !1, s("visible-change", !1);
|
|
1435
|
+
}, D = () => o.value ? y() : j(), H = (g) => {
|
|
1436
|
+
g.disabled || (s("update:modelValue", g.value), s("change", g.value), y());
|
|
1437
|
+
}, q = () => {
|
|
1438
|
+
s("update:modelValue", ""), s("change", ""), s("clear");
|
|
1439
|
+
}, R = (g) => {
|
|
1440
|
+
if (t.disabled) return;
|
|
1441
|
+
const b = c.value.length - 1;
|
|
1442
|
+
switch (g.key) {
|
|
1443
|
+
case "Enter":
|
|
1444
|
+
case " ":
|
|
1445
|
+
g.preventDefault(), o.value ? r.value >= 0 && H(c.value[r.value]) : j();
|
|
1446
|
+
break;
|
|
1447
|
+
case "ArrowDown":
|
|
1448
|
+
g.preventDefault(), o.value ? b >= 0 && (r.value = Math.min(r.value + 1, b)) : j();
|
|
1449
|
+
break;
|
|
1450
|
+
case "ArrowUp":
|
|
1451
|
+
g.preventDefault(), o.value && b >= 0 && (r.value = Math.max(r.value - 1, 0));
|
|
1452
|
+
break;
|
|
1453
|
+
case "Escape":
|
|
1454
|
+
o.value && (g.preventDefault(), y());
|
|
1455
|
+
break;
|
|
1456
|
+
}
|
|
1457
|
+
}, K = (g) => {
|
|
1458
|
+
var b, m;
|
|
1459
|
+
o.value && ((b = _.value) != null && b.contains(g.target) || (m = x.value) != null && m.contains(g.target) || y());
|
|
1460
|
+
};
|
|
1461
|
+
return be(
|
|
1462
|
+
() => t.disabled,
|
|
1463
|
+
(g) => {
|
|
1464
|
+
g && o.value && y();
|
|
1465
|
+
}
|
|
1466
|
+
), fe(() => {
|
|
1467
|
+
document.addEventListener("click", K);
|
|
1468
|
+
}), ie(() => {
|
|
1469
|
+
document.removeEventListener("click", K);
|
|
1470
|
+
}), (g, b) => (a(), i("div", {
|
|
1471
|
+
class: z(["xp-select", [`xp-select--${e.size}`, { "xp-select--disabled": e.disabled }]]),
|
|
1472
|
+
ref_key: "selectRef",
|
|
1473
|
+
ref: _
|
|
1474
|
+
}, [
|
|
1475
|
+
l("div", {
|
|
1476
|
+
class: z(["xp-select__trigger", { "is-open": o.value }]),
|
|
1477
|
+
role: "combobox",
|
|
1478
|
+
"aria-expanded": o.value,
|
|
1479
|
+
"aria-disabled": e.disabled,
|
|
1480
|
+
tabindex: e.disabled ? -1 : 0,
|
|
1481
|
+
onClick: D,
|
|
1482
|
+
onKeydown: R
|
|
1483
|
+
}, [
|
|
1484
|
+
l("span", {
|
|
1485
|
+
class: z(["xp-select__value", { "is-placeholder": !d.value }])
|
|
1486
|
+
}, S(v.value), 3),
|
|
1487
|
+
e.clearable && d.value && !e.disabled ? (a(), i("span", {
|
|
1488
|
+
key: 0,
|
|
1489
|
+
class: "xp-select__clear",
|
|
1490
|
+
"aria-label": "清空",
|
|
1491
|
+
onClick: U(q, ["stop"])
|
|
1492
|
+
}, [...b[0] || (b[0] = [
|
|
1493
|
+
l("svg", {
|
|
1494
|
+
width: "12",
|
|
1495
|
+
height: "12",
|
|
1496
|
+
viewBox: "0 0 24 24",
|
|
1497
|
+
fill: "none",
|
|
1498
|
+
"aria-hidden": "true"
|
|
1499
|
+
}, [
|
|
1500
|
+
l("path", {
|
|
1501
|
+
d: "M6 6l12 12M18 6L6 18",
|
|
1502
|
+
stroke: "currentColor",
|
|
1503
|
+
"stroke-width": "2.2",
|
|
1504
|
+
"stroke-linecap": "round"
|
|
1505
|
+
})
|
|
1506
|
+
], -1)
|
|
1507
|
+
])])) : (a(), i("span", {
|
|
1508
|
+
key: 1,
|
|
1509
|
+
class: z(["xp-select__arrow", { "is-open": o.value }]),
|
|
1510
|
+
"aria-hidden": "true"
|
|
1511
|
+
}, [...b[1] || (b[1] = [
|
|
1512
|
+
l("svg", {
|
|
1513
|
+
width: "12",
|
|
1514
|
+
height: "12",
|
|
1515
|
+
viewBox: "0 0 24 24",
|
|
1516
|
+
fill: "none",
|
|
1517
|
+
"aria-hidden": "true"
|
|
1518
|
+
}, [
|
|
1519
|
+
l("path", {
|
|
1520
|
+
d: "M6 9l6 6 6-6",
|
|
1521
|
+
stroke: "currentColor",
|
|
1522
|
+
"stroke-width": "2",
|
|
1523
|
+
"stroke-linecap": "round",
|
|
1524
|
+
"stroke-linejoin": "round"
|
|
1525
|
+
})
|
|
1526
|
+
], -1)
|
|
1527
|
+
])], 2))
|
|
1528
|
+
], 42, Hn),
|
|
1529
|
+
(a(), O(ne, { to: "body" }, [
|
|
1530
|
+
W(J, { name: "xp-select-fade" }, {
|
|
1531
|
+
default: F(() => [
|
|
1532
|
+
o.value ? (a(), i("div", {
|
|
1533
|
+
key: 0,
|
|
1534
|
+
class: "xp-select__panel",
|
|
1535
|
+
style: L(u.value),
|
|
1536
|
+
ref_key: "panelRef",
|
|
1537
|
+
ref: x,
|
|
1538
|
+
role: "listbox"
|
|
1539
|
+
}, [
|
|
1540
|
+
(a(!0), i(M, null, X(c.value, (m, T) => (a(), i("div", {
|
|
1541
|
+
key: m.value,
|
|
1542
|
+
class: z(["xp-select__option", {
|
|
1543
|
+
"is-selected": C(m),
|
|
1544
|
+
"is-disabled": m.disabled,
|
|
1545
|
+
"is-active": T === r.value
|
|
1546
|
+
}]),
|
|
1547
|
+
role: "option",
|
|
1548
|
+
"aria-selected": C(m),
|
|
1549
|
+
onClick: (Y) => H(m),
|
|
1550
|
+
onMouseenter: (Y) => r.value = T
|
|
1551
|
+
}, [
|
|
1552
|
+
l("span", Wn, S(m.label), 1),
|
|
1553
|
+
C(m) ? (a(), i("svg", qn, [...b[2] || (b[2] = [
|
|
1554
|
+
l("path", {
|
|
1555
|
+
d: "M5 12.5l4.5 4.5L19 7",
|
|
1556
|
+
stroke: "currentColor",
|
|
1557
|
+
"stroke-width": "2.2",
|
|
1558
|
+
"stroke-linecap": "round",
|
|
1559
|
+
"stroke-linejoin": "round"
|
|
1560
|
+
}, null, -1)
|
|
1561
|
+
])])) : w("", !0)
|
|
1562
|
+
], 42, Pn))), 128)),
|
|
1563
|
+
c.value.length === 0 ? (a(), i("div", Jn, "暂无选项")) : w("", !0)
|
|
1564
|
+
], 4)) : w("", !0)
|
|
1565
|
+
]),
|
|
1566
|
+
_: 1
|
|
1567
|
+
})
|
|
1568
|
+
]))
|
|
1569
|
+
], 2));
|
|
1570
|
+
}
|
|
1571
|
+
}, Ve = /* @__PURE__ */ E(Un, [["__scopeId", "data-v-e7f9bc35"]]), Kn = {
|
|
1572
|
+
key: 0,
|
|
1573
|
+
class: "xp-pagination"
|
|
1574
|
+
}, Gn = { class: "xp-pagination__total" }, Yn = { class: "xp-pagination__right" }, Zn = { class: "xp-pagination__btns" }, Qn = ["disabled"], el = ["disabled", "onClick"], tl = ["disabled"], nl = {
|
|
1575
|
+
__name: "Pagination",
|
|
1576
|
+
props: {
|
|
1577
|
+
/** 数据总条数(为 0 时不渲染分页条) */
|
|
1578
|
+
total: { type: Number, default: 0 },
|
|
1579
|
+
/** 当前页码,从 1 开始,支持 v-model:page */
|
|
1580
|
+
page: { type: Number, default: 1 },
|
|
1581
|
+
/** 每页条数,支持 v-model:page-size */
|
|
1582
|
+
pageSize: { type: Number, default: 10 },
|
|
1583
|
+
/** 可选的每页条数列表;为空时不渲染条数选择器 */
|
|
1584
|
+
pageSizes: { type: Array, default: () => [] }
|
|
1585
|
+
},
|
|
1586
|
+
emits: ["update:page", "update:pageSize", "change", "size-change"],
|
|
1587
|
+
setup(e, { emit: n }) {
|
|
1588
|
+
const t = e, s = n, o = B(() => Math.max(1, Math.ceil(t.total / t.pageSize))), r = B(
|
|
1589
|
+
() => t.pageSizes.map((c) => ({ label: `${c} 条/页`, value: c }))
|
|
1590
|
+
), u = B(() => {
|
|
1591
|
+
const c = o.value, d = t.page, p = [];
|
|
1592
|
+
for (let $ = 1; $ <= c; $++)
|
|
1593
|
+
($ === 1 || $ === c || Math.abs($ - d) <= 2) && p.push($);
|
|
1594
|
+
const v = [];
|
|
1595
|
+
let C = 0;
|
|
1596
|
+
for (const $ of p)
|
|
1597
|
+
$ - C > 1 && v.push("..."), v.push($), C = $;
|
|
1598
|
+
return v;
|
|
1599
|
+
});
|
|
1600
|
+
function _(c) {
|
|
1601
|
+
typeof c != "number" || c < 1 || c > o.value || c === t.page || (s("update:page", c), s("change", c));
|
|
1602
|
+
}
|
|
1603
|
+
function x(c) {
|
|
1604
|
+
s("update:pageSize", c), s("size-change", c);
|
|
1605
|
+
}
|
|
1606
|
+
return (c, d) => e.total > 0 ? (a(), i("div", Kn, [
|
|
1607
|
+
l("span", Gn, "共 " + S(e.total) + " 条", 1),
|
|
1608
|
+
l("div", Yn, [
|
|
1609
|
+
e.pageSizes.length > 0 ? (a(), O(Ve, {
|
|
1610
|
+
key: 0,
|
|
1611
|
+
class: "xp-pagination__sizes",
|
|
1612
|
+
"model-value": e.pageSize,
|
|
1613
|
+
options: r.value,
|
|
1614
|
+
size: "small",
|
|
1615
|
+
onChange: x
|
|
1616
|
+
}, null, 8, ["model-value", "options"])) : w("", !0),
|
|
1617
|
+
l("div", Zn, [
|
|
1618
|
+
l("button", {
|
|
1619
|
+
type: "button",
|
|
1620
|
+
class: "xp-pagination__btn xp-pagination__btn--nav",
|
|
1621
|
+
disabled: e.page <= 1,
|
|
1622
|
+
"aria-label": "上一页",
|
|
1623
|
+
onClick: d[0] || (d[0] = (p) => _(e.page - 1))
|
|
1624
|
+
}, " 上一页 ", 8, Qn),
|
|
1625
|
+
(a(!0), i(M, null, X(u.value, (p, v) => (a(), i("button", {
|
|
1626
|
+
key: `${p}-${v}`,
|
|
1627
|
+
type: "button",
|
|
1628
|
+
class: z(["xp-pagination__btn", { "is-active": p === e.page }]),
|
|
1629
|
+
disabled: p === "...",
|
|
1630
|
+
onClick: (C) => _(p)
|
|
1631
|
+
}, S(p), 11, el))), 128)),
|
|
1632
|
+
l("button", {
|
|
1633
|
+
type: "button",
|
|
1634
|
+
class: "xp-pagination__btn xp-pagination__btn--nav",
|
|
1635
|
+
disabled: e.page >= o.value,
|
|
1636
|
+
"aria-label": "下一页",
|
|
1637
|
+
onClick: d[1] || (d[1] = (p) => _(e.page + 1))
|
|
1638
|
+
}, " 下一页 ", 8, tl)
|
|
1639
|
+
])
|
|
1640
|
+
])
|
|
1641
|
+
])) : w("", !0);
|
|
1642
|
+
}
|
|
1643
|
+
}, ll = /* @__PURE__ */ E(nl, [["__scopeId", "data-v-401d0dbd"]]), sl = {
|
|
1063
1644
|
key: 0,
|
|
1064
1645
|
class: "xp-progress__text"
|
|
1065
|
-
},
|
|
1646
|
+
}, ol = {
|
|
1066
1647
|
__name: "Progress",
|
|
1067
1648
|
props: {
|
|
1068
1649
|
percentage: {
|
|
@@ -1095,29 +1676,29 @@ const C = (e, o) => {
|
|
|
1095
1676
|
}
|
|
1096
1677
|
},
|
|
1097
1678
|
setup(e) {
|
|
1098
|
-
const
|
|
1099
|
-
() =>
|
|
1100
|
-
), s =
|
|
1101
|
-
return (
|
|
1102
|
-
class:
|
|
1679
|
+
const n = e, t = B(
|
|
1680
|
+
() => n.type === "line" ? { height: `${n.strokeWidth}px` } : {}
|
|
1681
|
+
), s = B(() => 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)");
|
|
1682
|
+
return (o, r) => (a(), i("div", {
|
|
1683
|
+
class: z(["xp-progress", [`xp-progress--${e.type}`]])
|
|
1103
1684
|
}, [
|
|
1104
|
-
|
|
1685
|
+
l("div", {
|
|
1105
1686
|
class: "xp-progress__bar",
|
|
1106
|
-
style:
|
|
1687
|
+
style: L(t.value)
|
|
1107
1688
|
}, [
|
|
1108
|
-
|
|
1689
|
+
l("div", {
|
|
1109
1690
|
class: "xp-progress__inner",
|
|
1110
|
-
style:
|
|
1691
|
+
style: L({ width: `${e.percentage}%`, backgroundColor: s.value })
|
|
1111
1692
|
}, null, 4)
|
|
1112
1693
|
], 4),
|
|
1113
|
-
e.showText ? (
|
|
1114
|
-
|
|
1115
|
-
|
|
1694
|
+
e.showText ? (a(), i("span", sl, [
|
|
1695
|
+
I(o.$slots, "default", {}, () => [
|
|
1696
|
+
Q(S(e.percentage) + "%", 1)
|
|
1116
1697
|
], !0)
|
|
1117
|
-
])) :
|
|
1698
|
+
])) : w("", !0)
|
|
1118
1699
|
], 2));
|
|
1119
1700
|
}
|
|
1120
|
-
},
|
|
1701
|
+
}, al = /* @__PURE__ */ E(ol, [["__scopeId", "data-v-244dca2c"]]), il = { class: "xp-radio__input" }, rl = ["checked", "disabled"], dl = { class: "xp-radio__label" }, ul = {
|
|
1121
1702
|
__name: "Radio",
|
|
1122
1703
|
props: {
|
|
1123
1704
|
modelValue: {
|
|
@@ -1134,37 +1715,37 @@ const C = (e, o) => {
|
|
|
1134
1715
|
}
|
|
1135
1716
|
},
|
|
1136
1717
|
emits: ["update:modelValue", "change"],
|
|
1137
|
-
setup(e, { emit:
|
|
1138
|
-
const t = e, s =
|
|
1718
|
+
setup(e, { emit: n }) {
|
|
1719
|
+
const t = e, s = n, o = () => {
|
|
1139
1720
|
t.disabled || (s("update:modelValue", t.value), s("change", t.value));
|
|
1140
1721
|
};
|
|
1141
|
-
return (
|
|
1142
|
-
class:
|
|
1722
|
+
return (r, u) => (a(), i("label", {
|
|
1723
|
+
class: z(["xp-radio", [
|
|
1143
1724
|
{
|
|
1144
1725
|
"xp-radio--checked": e.modelValue === e.value,
|
|
1145
1726
|
"xp-radio--disabled": e.disabled
|
|
1146
1727
|
}
|
|
1147
1728
|
]])
|
|
1148
1729
|
}, [
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1730
|
+
l("span", il, [
|
|
1731
|
+
u[0] || (u[0] = l("span", { class: "xp-radio__inner" }, null, -1)),
|
|
1732
|
+
l("input", {
|
|
1152
1733
|
type: "radio",
|
|
1153
1734
|
class: "xp-radio__original",
|
|
1154
1735
|
checked: e.modelValue === e.value,
|
|
1155
1736
|
disabled: e.disabled,
|
|
1156
|
-
onChange:
|
|
1157
|
-
}, null, 40,
|
|
1737
|
+
onChange: o
|
|
1738
|
+
}, null, 40, rl)
|
|
1158
1739
|
]),
|
|
1159
|
-
|
|
1160
|
-
|
|
1740
|
+
l("span", dl, [
|
|
1741
|
+
I(r.$slots, "default", {}, void 0, !0)
|
|
1161
1742
|
])
|
|
1162
1743
|
], 2));
|
|
1163
1744
|
}
|
|
1164
|
-
},
|
|
1745
|
+
}, cl = /* @__PURE__ */ E(ul, [["__scopeId", "data-v-02a0d80d"]]), pl = { class: "xp-rate" }, fl = ["onClick", "onMouseenter"], hl = { class: "xp-rate__star" }, ml = {
|
|
1165
1746
|
key: 0,
|
|
1166
1747
|
class: "xp-rate__text"
|
|
1167
|
-
},
|
|
1748
|
+
}, vl = {
|
|
1168
1749
|
__name: "Rate",
|
|
1169
1750
|
props: {
|
|
1170
1751
|
modelValue: {
|
|
@@ -1189,39 +1770,39 @@ const C = (e, o) => {
|
|
|
1189
1770
|
}
|
|
1190
1771
|
},
|
|
1191
1772
|
emits: ["update:modelValue", "change"],
|
|
1192
|
-
setup(e, { emit:
|
|
1193
|
-
const t = e, s =
|
|
1194
|
-
const
|
|
1195
|
-
return
|
|
1196
|
-
},
|
|
1197
|
-
t.disabled || (s("update:modelValue",
|
|
1773
|
+
setup(e, { emit: n }) {
|
|
1774
|
+
const t = e, s = n, o = V(0), r = B(() => o.value || t.modelValue), u = (x) => {
|
|
1775
|
+
const c = r.value - x + 1;
|
|
1776
|
+
return c >= 1 ? 100 : c > 0 ? c * 100 : 0;
|
|
1777
|
+
}, _ = (x) => {
|
|
1778
|
+
t.disabled || (s("update:modelValue", x), s("change", x));
|
|
1198
1779
|
};
|
|
1199
|
-
return (
|
|
1200
|
-
(
|
|
1201
|
-
key:
|
|
1202
|
-
class:
|
|
1780
|
+
return (x, c) => (a(), i("div", pl, [
|
|
1781
|
+
(a(!0), i(M, null, X(e.max, (d) => (a(), i("span", {
|
|
1782
|
+
key: d,
|
|
1783
|
+
class: z(["xp-rate__item", {
|
|
1203
1784
|
"xp-rate__item--disabled": e.disabled
|
|
1204
1785
|
}]),
|
|
1205
|
-
style:
|
|
1206
|
-
onClick: (
|
|
1207
|
-
onMouseenter: (
|
|
1208
|
-
onMouseleave:
|
|
1786
|
+
style: L({ cursor: e.disabled ? "default" : "pointer" }),
|
|
1787
|
+
onClick: (p) => _(d),
|
|
1788
|
+
onMouseenter: (p) => o.value = d,
|
|
1789
|
+
onMouseleave: c[0] || (c[0] = (p) => o.value = 0)
|
|
1209
1790
|
}, [
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1791
|
+
l("span", hl, [
|
|
1792
|
+
c[1] || (c[1] = l("span", { class: "xp-rate__star-outer" }, "★", -1)),
|
|
1793
|
+
l("span", {
|
|
1213
1794
|
class: "xp-rate__star-inner",
|
|
1214
|
-
style:
|
|
1795
|
+
style: L({ width: u(d) + "%", color: e.color })
|
|
1215
1796
|
}, " ★ ", 4)
|
|
1216
1797
|
])
|
|
1217
|
-
], 46,
|
|
1218
|
-
e.showText && !e.disabled ? (
|
|
1798
|
+
], 46, fl))), 128)),
|
|
1799
|
+
e.showText && !e.disabled ? (a(), i("span", ml, S(e.modelValue) + " / " + S(e.max), 1)) : w("", !0)
|
|
1219
1800
|
]));
|
|
1220
1801
|
}
|
|
1221
|
-
},
|
|
1802
|
+
}, gl = /* @__PURE__ */ E(vl, [["__scopeId", "data-v-214323a3"]]), xl = ["aria-checked", "tabindex"], _l = {
|
|
1222
1803
|
key: 0,
|
|
1223
1804
|
class: "xp-switch__label"
|
|
1224
|
-
},
|
|
1805
|
+
}, bl = {
|
|
1225
1806
|
__name: "Switch",
|
|
1226
1807
|
props: {
|
|
1227
1808
|
modelValue: {
|
|
@@ -1239,14 +1820,16 @@ const C = (e, o) => {
|
|
|
1239
1820
|
}
|
|
1240
1821
|
},
|
|
1241
1822
|
emits: ["update:modelValue", "change"],
|
|
1242
|
-
setup(e, { emit:
|
|
1243
|
-
const t = e, s =
|
|
1823
|
+
setup(e, { emit: n }) {
|
|
1824
|
+
const t = e, s = n, o = () => {
|
|
1244
1825
|
if (t.disabled) return;
|
|
1245
1826
|
const u = !t.modelValue;
|
|
1246
1827
|
s("update:modelValue", u), s("change", u);
|
|
1828
|
+
}, r = (u) => {
|
|
1829
|
+
u.key !== "Enter" && u.key !== " " || (u.preventDefault(), o());
|
|
1247
1830
|
};
|
|
1248
|
-
return (u,
|
|
1249
|
-
class:
|
|
1831
|
+
return (u, _) => (a(), i("div", {
|
|
1832
|
+
class: z(["xp-switch", [
|
|
1250
1833
|
`xp-switch--${e.size}`,
|
|
1251
1834
|
{
|
|
1252
1835
|
"xp-switch--checked": e.modelValue,
|
|
@@ -1255,20 +1838,346 @@ const C = (e, o) => {
|
|
|
1255
1838
|
]]),
|
|
1256
1839
|
role: "switch",
|
|
1257
1840
|
"aria-checked": e.modelValue,
|
|
1258
|
-
|
|
1841
|
+
tabindex: e.disabled ? -1 : 0,
|
|
1842
|
+
onClick: o,
|
|
1843
|
+
onKeydown: r
|
|
1259
1844
|
}, [
|
|
1260
|
-
|
|
1261
|
-
|
|
1845
|
+
_[0] || (_[0] = l("span", { class: "xp-switch__core" }, [
|
|
1846
|
+
l("span", { class: "xp-switch__action" })
|
|
1262
1847
|
], -1)),
|
|
1263
|
-
u.$slots.default ? (
|
|
1264
|
-
|
|
1265
|
-
])) :
|
|
1266
|
-
],
|
|
1848
|
+
u.$slots.default ? (a(), i("span", _l, [
|
|
1849
|
+
I(u.$slots, "default", {}, void 0, !0)
|
|
1850
|
+
])) : w("", !0)
|
|
1851
|
+
], 42, xl));
|
|
1267
1852
|
}
|
|
1268
|
-
},
|
|
1853
|
+
}, yl = /* @__PURE__ */ E(bl, [["__scopeId", "data-v-936844f2"]]), kl = { class: "xp-table__wrap" }, wl = { class: "xp-table__columns" }, $l = { class: "xp-table__inner" }, Cl = { key: 0 }, Sl = ["onClick"], Ml = {
|
|
1854
|
+
key: 2,
|
|
1855
|
+
class: "xp-table__cell-inner"
|
|
1856
|
+
}, Bl = { class: "xp-table__label" }, zl = { key: 1 }, Il = ["onClick"], Tl = {
|
|
1857
|
+
key: 0,
|
|
1858
|
+
class: "xp-table__empty"
|
|
1859
|
+
}, Vl = {
|
|
1860
|
+
key: 0,
|
|
1861
|
+
class: "xp-table__loading"
|
|
1862
|
+
}, jl = {
|
|
1863
|
+
__name: "Table",
|
|
1864
|
+
props: {
|
|
1865
|
+
/** 表格数据源 */
|
|
1866
|
+
data: { type: Array, default: () => [] },
|
|
1867
|
+
/** 加载中状态:为真时显示加载遮罩 */
|
|
1868
|
+
loading: { type: Boolean, default: !1 },
|
|
1869
|
+
/** 空状态标题 */
|
|
1870
|
+
emptyTitle: { type: String, default: "暂无数据" },
|
|
1871
|
+
/** 空状态提示文案 */
|
|
1872
|
+
emptyHint: { type: String, default: "" },
|
|
1873
|
+
/** 行唯一标识字段名,用于 :key;缺省字段时回退到行索引 */
|
|
1874
|
+
rowKey: { type: String, default: "id" },
|
|
1875
|
+
/** 斑马纹:奇偶行交替背景色 */
|
|
1876
|
+
stripe: { type: Boolean, default: !1 },
|
|
1877
|
+
/** 边框模式:单元格带纵向边框并整体加外框 */
|
|
1878
|
+
border: { type: Boolean, default: !1 }
|
|
1879
|
+
},
|
|
1880
|
+
emits: [
|
|
1881
|
+
/** 排序变化:(column, prop, order),order 为 ascending / descending / null */
|
|
1882
|
+
"sort-change",
|
|
1883
|
+
/** 勾选集合变化:(rows) 当前选中的行数组 */
|
|
1884
|
+
"selection-change",
|
|
1885
|
+
/** 单个行勾选状态变化:(row, selected) */
|
|
1886
|
+
"select",
|
|
1887
|
+
/** 点击行:(row, index) */
|
|
1888
|
+
"row-click"
|
|
1889
|
+
],
|
|
1890
|
+
setup(e, { expose: n, emit: t }) {
|
|
1891
|
+
const s = e, o = t, r = V([]);
|
|
1892
|
+
ke("xpTable", { addColumn: (f) => {
|
|
1893
|
+
r.value.push(f);
|
|
1894
|
+
}, removeColumn: (f) => {
|
|
1895
|
+
const h = r.value.findIndex((k) => k.id === f);
|
|
1896
|
+
h >= 0 && r.value.splice(h, 1);
|
|
1897
|
+
} });
|
|
1898
|
+
function x(f, h, k) {
|
|
1899
|
+
if (f.formatter) return String(f.formatter(h, f, h[f.prop], k));
|
|
1900
|
+
const N = h && h[f.prop];
|
|
1901
|
+
return N == null ? "" : String(N);
|
|
1902
|
+
}
|
|
1903
|
+
function c(f, h) {
|
|
1904
|
+
return (f && f[s.rowKey]) ?? h;
|
|
1905
|
+
}
|
|
1906
|
+
const d = {
|
|
1907
|
+
name: "XpRenderCell",
|
|
1908
|
+
props: {
|
|
1909
|
+
slotFn: { type: Function, default: null },
|
|
1910
|
+
ctx: { type: Object, default: () => ({}) },
|
|
1911
|
+
fallback: { type: [String, Number], default: "" }
|
|
1912
|
+
},
|
|
1913
|
+
render() {
|
|
1914
|
+
return this.slotFn ? this.slotFn(this.ctx) : this.fallback;
|
|
1915
|
+
}
|
|
1916
|
+
}, p = V({ prop: "", order: null }), v = B(() => {
|
|
1917
|
+
const { prop: f, order: h } = p.value;
|
|
1918
|
+
if (!f || !h) return s.data;
|
|
1919
|
+
const k = r.value.find((P) => P.prop === f);
|
|
1920
|
+
if (!k || k.sortable !== !0) return s.data;
|
|
1921
|
+
const N = h === "ascending" ? 1 : -1, A = s.data.map((P, Z) => ({ row: P, i: Z }));
|
|
1922
|
+
return A.sort((P, Z) => {
|
|
1923
|
+
const me = P.row[f], ve = Z.row[f];
|
|
1924
|
+
return me === ve ? P.i - Z.i : me == null ? -N : ve == null ? N : (me > ve ? 1 : -1) * N;
|
|
1925
|
+
}), A.map((P) => P.row);
|
|
1926
|
+
});
|
|
1927
|
+
function C(f) {
|
|
1928
|
+
if (!f.sortable) return;
|
|
1929
|
+
let h;
|
|
1930
|
+
p.value.prop !== f.prop ? h = "ascending" : h = { null: "ascending", ascending: "descending", descending: null }[p.value.order], p.value = { prop: f.prop, order: h }, o("sort-change", { column: f, prop: f.prop, order: h });
|
|
1931
|
+
}
|
|
1932
|
+
function $(f) {
|
|
1933
|
+
const h = p.value.prop === f.prop;
|
|
1934
|
+
return {
|
|
1935
|
+
"is-ascending": h && p.value.order === "ascending",
|
|
1936
|
+
"is-descending": h && p.value.order === "descending"
|
|
1937
|
+
};
|
|
1938
|
+
}
|
|
1939
|
+
const j = V(/* @__PURE__ */ new Set()), y = (f, h) => j.value.has(c(f, h)), D = B(
|
|
1940
|
+
() => s.data.length > 0 && s.data.every((f, h) => y(f, h))
|
|
1941
|
+
), H = B(
|
|
1942
|
+
() => s.data.some((f, h) => y(f, h)) && !D.value
|
|
1943
|
+
);
|
|
1944
|
+
function q() {
|
|
1945
|
+
const f = j.value;
|
|
1946
|
+
return s.data.filter((h, k) => f.has(c(h, k)));
|
|
1947
|
+
}
|
|
1948
|
+
function R(f) {
|
|
1949
|
+
const h = new Set(j.value);
|
|
1950
|
+
for (const [k, N] of s.data.entries()) {
|
|
1951
|
+
const A = c(N, k);
|
|
1952
|
+
f ? h.add(A) : h.delete(A);
|
|
1953
|
+
}
|
|
1954
|
+
j.value = h, o("selection-change", q());
|
|
1955
|
+
}
|
|
1956
|
+
function K(f, h, k) {
|
|
1957
|
+
const N = c(f, k), A = new Set(j.value);
|
|
1958
|
+
h ? A.add(N) : A.delete(N), j.value = A, o("select", f, h), o("selection-change", q());
|
|
1959
|
+
}
|
|
1960
|
+
n({
|
|
1961
|
+
/** 清空所有勾选 */
|
|
1962
|
+
clearSelection() {
|
|
1963
|
+
j.value = /* @__PURE__ */ new Set(), o("selection-change", q());
|
|
1964
|
+
},
|
|
1965
|
+
/** 切换指定行勾选状态;selected 缺省时反转当前状态 */
|
|
1966
|
+
toggleRowSelection(f, h) {
|
|
1967
|
+
const k = s.data.findIndex((N) => N === f);
|
|
1968
|
+
k !== -1 && K(f, h ?? !y(f, k), k);
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1971
|
+
function g(f) {
|
|
1972
|
+
const h = f.width;
|
|
1973
|
+
if (h == null || h === "") return 0;
|
|
1974
|
+
const k = typeof h == "number" ? h : parseFloat(h);
|
|
1975
|
+
return Number.isFinite(k) ? k : 0;
|
|
1976
|
+
}
|
|
1977
|
+
function b(f) {
|
|
1978
|
+
return typeof f == "number" || /^\d+$/.test(String(f)) ? `${f}px` : f;
|
|
1979
|
+
}
|
|
1980
|
+
const m = B(() => {
|
|
1981
|
+
const f = {}, h = {};
|
|
1982
|
+
let k = 0;
|
|
1983
|
+
for (const A of r.value)
|
|
1984
|
+
A.fixed === "left" && (f[A.id] = k, k += g(A));
|
|
1985
|
+
let N = 0;
|
|
1986
|
+
for (let A = r.value.length - 1; A >= 0; A--) {
|
|
1987
|
+
const P = r.value[A];
|
|
1988
|
+
P.fixed === "right" && (h[P.id] = N, N += g(P));
|
|
1989
|
+
}
|
|
1990
|
+
return { left: f, right: h };
|
|
1991
|
+
});
|
|
1992
|
+
function T(f) {
|
|
1993
|
+
const h = {};
|
|
1994
|
+
return f.width !== "" && (h.width = b(f.width)), f.minWidth !== "" && (h.minWidth = b(f.minWidth)), f.fixed === "left" && (h.left = `${m.value.left[f.id] || 0}px`), f.fixed === "right" && (h.right = `${m.value.right[f.id] || 0}px`), h;
|
|
1995
|
+
}
|
|
1996
|
+
function Y(f, h) {
|
|
1997
|
+
if (f.fixed !== "left") return !1;
|
|
1998
|
+
const k = r.value[h + 1];
|
|
1999
|
+
return !k || k.fixed !== "left";
|
|
2000
|
+
}
|
|
2001
|
+
function G(f, h) {
|
|
2002
|
+
if (f.fixed !== "right") return !1;
|
|
2003
|
+
const k = r.value[h - 1];
|
|
2004
|
+
return !k || k.fixed !== "right";
|
|
2005
|
+
}
|
|
2006
|
+
function $e(f, h, { header: k }) {
|
|
2007
|
+
return {
|
|
2008
|
+
"xp-table__cell": !0,
|
|
2009
|
+
"xp-table__cell--selection": f.type === "selection",
|
|
2010
|
+
"is-center": f.align === "center",
|
|
2011
|
+
"is-right": f.align === "right",
|
|
2012
|
+
"xp-table__cell--fixed-left": f.fixed === "left",
|
|
2013
|
+
"xp-table__cell--fixed-right": f.fixed === "right",
|
|
2014
|
+
"is-last-fixed-left": k ? Y(f, h) : !1,
|
|
2015
|
+
"is-first-fixed-right": k ? G(f, h) : !1,
|
|
2016
|
+
[f.className]: !!f.className
|
|
2017
|
+
};
|
|
2018
|
+
}
|
|
2019
|
+
function Xe(f, h) {
|
|
2020
|
+
return {
|
|
2021
|
+
...$e(f, h, { header: !0 }),
|
|
2022
|
+
"xp-table__cell--sortable": !!f.sortable
|
|
2023
|
+
};
|
|
2024
|
+
}
|
|
2025
|
+
function De(f, h) {
|
|
2026
|
+
return $e(f, h, { header: !1 });
|
|
2027
|
+
}
|
|
2028
|
+
function Oe(f, h) {
|
|
2029
|
+
o("row-click", f, h);
|
|
2030
|
+
}
|
|
2031
|
+
return (f, h) => (a(), i("div", {
|
|
2032
|
+
class: z(["xp-table", { "xp-table--stripe": e.stripe, "xp-table--border": e.border }])
|
|
2033
|
+
}, [
|
|
2034
|
+
l("div", kl, [
|
|
2035
|
+
l("div", wl, [
|
|
2036
|
+
I(f.$slots, "default", {}, void 0, !0)
|
|
2037
|
+
]),
|
|
2038
|
+
l("table", $l, [
|
|
2039
|
+
r.value.length > 0 ? (a(), i("thead", Cl, [
|
|
2040
|
+
l("tr", null, [
|
|
2041
|
+
(a(!0), i(M, null, X(r.value, (k, N) => (a(), i("th", {
|
|
2042
|
+
key: k.id,
|
|
2043
|
+
class: z(Xe(k, N)),
|
|
2044
|
+
style: L(T(k)),
|
|
2045
|
+
onClick: (A) => C(k)
|
|
2046
|
+
}, [
|
|
2047
|
+
k.type === "selection" ? (a(), O(xe, {
|
|
2048
|
+
key: 0,
|
|
2049
|
+
class: "xp-table__checkbox",
|
|
2050
|
+
"model-value": D.value,
|
|
2051
|
+
indeterminate: H.value,
|
|
2052
|
+
onClick: h[0] || (h[0] = U(() => {
|
|
2053
|
+
}, ["stop"])),
|
|
2054
|
+
onChange: R
|
|
2055
|
+
}, null, 8, ["model-value", "indeterminate"])) : k.slots.header ? (a(), O(d, {
|
|
2056
|
+
key: 1,
|
|
2057
|
+
"slot-fn": k.slots.header,
|
|
2058
|
+
ctx: { column: k }
|
|
2059
|
+
}, null, 8, ["slot-fn", "ctx"])) : (a(), i("span", Ml, [
|
|
2060
|
+
l("span", Bl, S(k.label), 1),
|
|
2061
|
+
k.sortable ? (a(), i("span", {
|
|
2062
|
+
key: 0,
|
|
2063
|
+
class: z(["xp-table__sort", $(k)]),
|
|
2064
|
+
"aria-hidden": "true"
|
|
2065
|
+
}, [...h[2] || (h[2] = [
|
|
2066
|
+
l("span", { class: "xp-table__sort-asc" }, null, -1),
|
|
2067
|
+
l("span", { class: "xp-table__sort-desc" }, null, -1)
|
|
2068
|
+
])], 2)) : w("", !0)
|
|
2069
|
+
]))
|
|
2070
|
+
], 14, Sl))), 128))
|
|
2071
|
+
])
|
|
2072
|
+
])) : w("", !0),
|
|
2073
|
+
v.value.length > 0 ? (a(), i("tbody", zl, [
|
|
2074
|
+
(a(!0), i(M, null, X(v.value, (k, N) => (a(), i("tr", {
|
|
2075
|
+
key: c(k, N),
|
|
2076
|
+
onClick: (A) => Oe(k, N)
|
|
2077
|
+
}, [
|
|
2078
|
+
(a(!0), i(M, null, X(r.value, (A, P) => (a(), i("td", {
|
|
2079
|
+
key: A.id,
|
|
2080
|
+
class: z(De(A, P)),
|
|
2081
|
+
style: L(T(A))
|
|
2082
|
+
}, [
|
|
2083
|
+
A.type === "selection" ? (a(), O(xe, {
|
|
2084
|
+
key: 0,
|
|
2085
|
+
class: "xp-table__checkbox",
|
|
2086
|
+
"model-value": y(k, N),
|
|
2087
|
+
onClick: h[1] || (h[1] = U(() => {
|
|
2088
|
+
}, ["stop"])),
|
|
2089
|
+
onChange: (Z) => K(k, Z, N)
|
|
2090
|
+
}, null, 8, ["model-value", "onChange"])) : A.slots.default ? (a(), O(d, {
|
|
2091
|
+
key: 1,
|
|
2092
|
+
"slot-fn": A.slots.default,
|
|
2093
|
+
ctx: { row: k, index: N },
|
|
2094
|
+
fallback: x(A, k, N)
|
|
2095
|
+
}, null, 8, ["slot-fn", "ctx", "fallback"])) : (a(), i(M, { key: 2 }, [
|
|
2096
|
+
Q(S(x(A, k, N)), 1)
|
|
2097
|
+
], 64))
|
|
2098
|
+
], 6))), 128))
|
|
2099
|
+
], 8, Il))), 128))
|
|
2100
|
+
])) : w("", !0)
|
|
2101
|
+
]),
|
|
2102
|
+
!e.loading && (r.value.length === 0 || e.data.length === 0) ? (a(), i("div", Tl, [
|
|
2103
|
+
I(f.$slots, "empty", {}, () => [
|
|
2104
|
+
W(Te, {
|
|
2105
|
+
title: e.emptyTitle,
|
|
2106
|
+
hint: e.emptyHint
|
|
2107
|
+
}, null, 8, ["title", "hint"])
|
|
2108
|
+
], !0)
|
|
2109
|
+
])) : w("", !0),
|
|
2110
|
+
W(J, { name: "xp-fade" }, {
|
|
2111
|
+
default: F(() => [
|
|
2112
|
+
e.loading ? (a(), i("div", Vl, [...h[3] || (h[3] = [
|
|
2113
|
+
l("span", { class: "xp-table__spinner" }, null, -1),
|
|
2114
|
+
l("span", null, "加载中…", -1)
|
|
2115
|
+
])])) : w("", !0)
|
|
2116
|
+
]),
|
|
2117
|
+
_: 1
|
|
2118
|
+
})
|
|
2119
|
+
])
|
|
2120
|
+
], 2));
|
|
2121
|
+
}
|
|
2122
|
+
}, Al = /* @__PURE__ */ E(jl, [["__scopeId", "data-v-589f6c9c"]]), El = {
|
|
2123
|
+
__name: "TableColumn",
|
|
2124
|
+
props: {
|
|
2125
|
+
/** 对应数据行的字段名,自动渲染 row[prop] */
|
|
2126
|
+
prop: { type: String, default: "" },
|
|
2127
|
+
/** 表头文案 */
|
|
2128
|
+
label: { type: String, default: "" },
|
|
2129
|
+
/** 列类型:default 普通列,selection 多选列 */
|
|
2130
|
+
type: {
|
|
2131
|
+
type: String,
|
|
2132
|
+
default: "default",
|
|
2133
|
+
validator: (e) => ["default", "selection"].includes(e)
|
|
2134
|
+
},
|
|
2135
|
+
/** 列宽(number 为 px,string 原样传入),固定列必须显式指定 */
|
|
2136
|
+
width: { type: [Number, String], default: "" },
|
|
2137
|
+
/** 最小列宽 */
|
|
2138
|
+
minWidth: { type: [Number, String], default: "" },
|
|
2139
|
+
/** 单元格对齐方式 */
|
|
2140
|
+
align: {
|
|
2141
|
+
type: String,
|
|
2142
|
+
default: "left",
|
|
2143
|
+
validator: (e) => ["left", "center", "right"].includes(e)
|
|
2144
|
+
},
|
|
2145
|
+
/** 是否可排序:true 内置升/降序;'custom' 仅触发 sort-change 由外部处理 */
|
|
2146
|
+
sortable: {
|
|
2147
|
+
type: [Boolean, String],
|
|
2148
|
+
default: !1,
|
|
2149
|
+
validator: (e) => e === !0 || e === "custom" || e === !1
|
|
2150
|
+
},
|
|
2151
|
+
/** 固定列位置:'left' / 'right',需配合 width 使用 */
|
|
2152
|
+
fixed: {
|
|
2153
|
+
type: String,
|
|
2154
|
+
default: "",
|
|
2155
|
+
validator: (e) => ["", "left", "right"].includes(e)
|
|
2156
|
+
},
|
|
2157
|
+
/** 单元格格式化函数:(row, column, cellValue, index) => any */
|
|
2158
|
+
formatter: { type: Function, default: null },
|
|
2159
|
+
/** 自定义列 class,同时作用于表头与单元格 */
|
|
2160
|
+
className: { type: String, default: "" }
|
|
2161
|
+
},
|
|
2162
|
+
setup(e) {
|
|
2163
|
+
const n = e, t = he("xpTable", null), s = He(), o = Pe();
|
|
2164
|
+
return fe(() => {
|
|
2165
|
+
!t || typeof t.addColumn != "function" || t.addColumn({
|
|
2166
|
+
id: o.uid,
|
|
2167
|
+
...n,
|
|
2168
|
+
slots: {
|
|
2169
|
+
default: s.default ? (r) => s.default(r) : null,
|
|
2170
|
+
header: s.header ? (r) => s.header(r) : null
|
|
2171
|
+
}
|
|
2172
|
+
});
|
|
2173
|
+
}), ie(() => {
|
|
2174
|
+
!t || typeof t.removeColumn != "function" || t.removeColumn(o.uid);
|
|
2175
|
+
}), (r, u) => null;
|
|
2176
|
+
}
|
|
2177
|
+
}, Nl = {
|
|
1269
2178
|
key: 0,
|
|
1270
2179
|
class: "xp-tab-pane"
|
|
1271
|
-
},
|
|
2180
|
+
}, Rl = {
|
|
1272
2181
|
__name: "TabPane",
|
|
1273
2182
|
props: {
|
|
1274
2183
|
name: {
|
|
@@ -1285,19 +2194,19 @@ const C = (e, o) => {
|
|
|
1285
2194
|
}
|
|
1286
2195
|
},
|
|
1287
2196
|
setup(e) {
|
|
1288
|
-
const
|
|
1289
|
-
return
|
|
1290
|
-
t && t.addTab && t.addTab({ name:
|
|
1291
|
-
}),
|
|
1292
|
-
t && t.removeTab && t.removeTab(
|
|
1293
|
-
}), (
|
|
1294
|
-
|
|
1295
|
-
])) :
|
|
2197
|
+
const n = e, t = he("xpTabs", null), s = B(() => t ? t.currentValue.value === n.name : !0);
|
|
2198
|
+
return fe(() => {
|
|
2199
|
+
t && t.addTab && t.addTab({ name: n.name, title: n.title, disabled: n.disabled });
|
|
2200
|
+
}), ie(() => {
|
|
2201
|
+
t && t.removeTab && t.removeTab(n.name);
|
|
2202
|
+
}), (o, r) => s.value ? (a(), i("div", Nl, [
|
|
2203
|
+
I(o.$slots, "default", {}, void 0, !0)
|
|
2204
|
+
])) : w("", !0);
|
|
1296
2205
|
}
|
|
1297
|
-
},
|
|
2206
|
+
}, Xl = /* @__PURE__ */ E(Rl, [["__scopeId", "data-v-6fe7943a"]]), Dl = { class: "xp-tabs" }, Ol = {
|
|
1298
2207
|
class: "xp-tabs__nav",
|
|
1299
2208
|
role: "tablist"
|
|
1300
|
-
},
|
|
2209
|
+
}, Fl = ["onClick"], Ll = { class: "xp-tabs__content" }, Hl = {
|
|
1301
2210
|
__name: "Tabs",
|
|
1302
2211
|
props: {
|
|
1303
2212
|
modelValue: {
|
|
@@ -1306,48 +2215,48 @@ const C = (e, o) => {
|
|
|
1306
2215
|
}
|
|
1307
2216
|
},
|
|
1308
2217
|
emits: ["update:modelValue", "change"],
|
|
1309
|
-
setup(e, { emit:
|
|
1310
|
-
const t = e, s =
|
|
1311
|
-
var
|
|
1312
|
-
return t.modelValue !== null && t.modelValue !== void 0 && t.modelValue !== "" ? t.modelValue : ((
|
|
1313
|
-
}),
|
|
1314
|
-
const
|
|
2218
|
+
setup(e, { emit: n }) {
|
|
2219
|
+
const t = e, s = n, o = V([]), r = B(() => {
|
|
2220
|
+
var d;
|
|
2221
|
+
return t.modelValue !== null && t.modelValue !== void 0 && t.modelValue !== "" ? t.modelValue : ((d = o.value[0]) == null ? void 0 : d.name) ?? null;
|
|
2222
|
+
}), u = B(() => {
|
|
2223
|
+
const d = o.value.findIndex((v) => v.name === r.value);
|
|
1315
2224
|
return {
|
|
1316
|
-
transform: `translateX(${(
|
|
1317
|
-
width: `${
|
|
2225
|
+
transform: `translateX(${(d >= 0 ? d : 0) * 100}%)`,
|
|
2226
|
+
width: `${o.value.length ? 100 / o.value.length : 0}%`
|
|
1318
2227
|
};
|
|
1319
|
-
}),
|
|
1320
|
-
|
|
2228
|
+
}), _ = (d) => {
|
|
2229
|
+
d.disabled || (s("update:modelValue", d.name), s("change", d.name));
|
|
1321
2230
|
};
|
|
1322
|
-
return
|
|
1323
|
-
|
|
1324
|
-
}, removeTab: (
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1327
|
-
}, currentValue:
|
|
1328
|
-
|
|
1329
|
-
(
|
|
1330
|
-
key:
|
|
1331
|
-
class:
|
|
2231
|
+
return ke("xpTabs", { addTab: (d) => {
|
|
2232
|
+
o.value.find((p) => p.name === d.name) || o.value.push(d);
|
|
2233
|
+
}, removeTab: (d) => {
|
|
2234
|
+
const p = o.value.findIndex((v) => v.name === d);
|
|
2235
|
+
p >= 0 && o.value.splice(p, 1);
|
|
2236
|
+
}, currentValue: r }), (d, p) => (a(), i("div", Dl, [
|
|
2237
|
+
l("div", Ol, [
|
|
2238
|
+
(a(!0), i(M, null, X(o.value, (v, C) => (a(), i("div", {
|
|
2239
|
+
key: v.name || C,
|
|
2240
|
+
class: z(["xp-tabs__item", [
|
|
1332
2241
|
{
|
|
1333
|
-
"xp-tabs__item--active":
|
|
1334
|
-
"xp-tabs__item--disabled":
|
|
2242
|
+
"xp-tabs__item--active": r.value === v.name,
|
|
2243
|
+
"xp-tabs__item--disabled": v.disabled
|
|
1335
2244
|
}
|
|
1336
2245
|
]]),
|
|
1337
2246
|
role: "tab",
|
|
1338
|
-
onClick: ($) => v
|
|
1339
|
-
},
|
|
1340
|
-
|
|
2247
|
+
onClick: ($) => _(v)
|
|
2248
|
+
}, S(v.title), 11, Fl))), 128)),
|
|
2249
|
+
l("div", {
|
|
1341
2250
|
class: "xp-tabs__active-bar",
|
|
1342
|
-
style:
|
|
2251
|
+
style: L(u.value)
|
|
1343
2252
|
}, null, 4)
|
|
1344
2253
|
]),
|
|
1345
|
-
|
|
1346
|
-
|
|
2254
|
+
l("div", Ll, [
|
|
2255
|
+
I(d.$slots, "default", {}, void 0, !0)
|
|
1347
2256
|
])
|
|
1348
2257
|
]));
|
|
1349
2258
|
}
|
|
1350
|
-
},
|
|
2259
|
+
}, Pl = /* @__PURE__ */ E(Hl, [["__scopeId", "data-v-3e658dba"]]), Wl = {
|
|
1351
2260
|
__name: "Tag",
|
|
1352
2261
|
props: {
|
|
1353
2262
|
type: {
|
|
@@ -1378,18 +2287,18 @@ const C = (e, o) => {
|
|
|
1378
2287
|
}
|
|
1379
2288
|
},
|
|
1380
2289
|
emits: ["click", "close"],
|
|
1381
|
-
setup(e, { emit:
|
|
1382
|
-
const t = e, s =
|
|
2290
|
+
setup(e, { emit: n }) {
|
|
2291
|
+
const t = e, s = n, o = B(() => t.color ? t.color.startsWith("#") || t.color.startsWith("rgb") ? {
|
|
1383
2292
|
backgroundColor: t.color,
|
|
1384
2293
|
borderColor: t.color,
|
|
1385
2294
|
color: "#fff"
|
|
1386
|
-
} : {} : {}),
|
|
1387
|
-
s("click",
|
|
1388
|
-
},
|
|
1389
|
-
s("close",
|
|
2295
|
+
} : {} : {}), r = (_) => {
|
|
2296
|
+
s("click", _);
|
|
2297
|
+
}, u = (_) => {
|
|
2298
|
+
s("close", _);
|
|
1390
2299
|
};
|
|
1391
|
-
return (
|
|
1392
|
-
class:
|
|
2300
|
+
return (_, x) => (a(), i("span", {
|
|
2301
|
+
class: z(["xp-tag", [
|
|
1393
2302
|
`xp-tag--${e.type}`,
|
|
1394
2303
|
`xp-tag--${e.size}`,
|
|
1395
2304
|
{
|
|
@@ -1398,28 +2307,28 @@ const C = (e, o) => {
|
|
|
1398
2307
|
"xp-tag--closable": e.closable
|
|
1399
2308
|
}
|
|
1400
2309
|
]]),
|
|
1401
|
-
style:
|
|
1402
|
-
onClick:
|
|
2310
|
+
style: L(o.value),
|
|
2311
|
+
onClick: r
|
|
1403
2312
|
}, [
|
|
1404
|
-
|
|
1405
|
-
e.closable ? (
|
|
2313
|
+
I(_.$slots, "default", {}, void 0, !0),
|
|
2314
|
+
e.closable ? (a(), i("span", {
|
|
1406
2315
|
key: 0,
|
|
1407
2316
|
class: "xp-tag__close",
|
|
1408
|
-
onClick:
|
|
1409
|
-
}, "×")) :
|
|
2317
|
+
onClick: U(u, ["stop"])
|
|
2318
|
+
}, "×")) : w("", !0)
|
|
1410
2319
|
], 6));
|
|
1411
2320
|
}
|
|
1412
|
-
},
|
|
1413
|
-
function
|
|
2321
|
+
}, ql = /* @__PURE__ */ E(Wl, [["__scopeId", "data-v-855e2fd7"]]), Jl = /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, Ul = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*([\d.]+))?\s*\)$/;
|
|
2322
|
+
function pe(e) {
|
|
1414
2323
|
if (typeof e != "string") return null;
|
|
1415
|
-
const
|
|
2324
|
+
const n = e.trim(), t = n.match(Jl);
|
|
1416
2325
|
if (t) {
|
|
1417
|
-
let
|
|
1418
|
-
|
|
1419
|
-
const
|
|
1420
|
-
return { r
|
|
2326
|
+
let o = t[1];
|
|
2327
|
+
o.length === 3 && (o = o.split("").map((x) => x + x).join(""));
|
|
2328
|
+
const r = parseInt(o.slice(0, 2), 16), u = parseInt(o.slice(2, 4), 16), _ = parseInt(o.slice(4, 6), 16);
|
|
2329
|
+
return { r, g: u, b: _, a: 1 };
|
|
1421
2330
|
}
|
|
1422
|
-
const s =
|
|
2331
|
+
const s = n.match(Ul);
|
|
1423
2332
|
return s ? {
|
|
1424
2333
|
r: parseInt(s[1], 10),
|
|
1425
2334
|
g: parseInt(s[2], 10),
|
|
@@ -1427,52 +2336,52 @@ function Y(e) {
|
|
|
1427
2336
|
a: s[4] ? parseFloat(s[4]) : 1
|
|
1428
2337
|
} : null;
|
|
1429
2338
|
}
|
|
1430
|
-
function
|
|
2339
|
+
function Kl(e) {
|
|
1431
2340
|
return Math.max(0, Math.min(255, Math.round(e)));
|
|
1432
2341
|
}
|
|
1433
|
-
function
|
|
1434
|
-
const s = (
|
|
1435
|
-
return "#" + s(e) + s(
|
|
2342
|
+
function Gl(e, n, t) {
|
|
2343
|
+
const s = (o) => Kl(o).toString(16).padStart(2, "0");
|
|
2344
|
+
return "#" + s(e) + s(n) + s(t);
|
|
1436
2345
|
}
|
|
1437
|
-
function
|
|
1438
|
-
const s =
|
|
1439
|
-
if (!s || !
|
|
1440
|
-
const
|
|
1441
|
-
return
|
|
2346
|
+
function je(e, n, t = 0.5) {
|
|
2347
|
+
const s = pe(e), o = pe(n);
|
|
2348
|
+
if (!s || !o) return "#000000";
|
|
2349
|
+
const r = Math.max(0, Math.min(1, t)), u = s.r * (1 - r) + o.r * r, _ = s.g * (1 - r) + o.g * r, x = s.b * (1 - r) + o.b * r;
|
|
2350
|
+
return Gl(u, _, x);
|
|
1442
2351
|
}
|
|
1443
|
-
function
|
|
1444
|
-
return
|
|
2352
|
+
function de(e, n) {
|
|
2353
|
+
return je(e, "#ffffff", n);
|
|
1445
2354
|
}
|
|
1446
|
-
function
|
|
1447
|
-
return
|
|
2355
|
+
function ue(e, n) {
|
|
2356
|
+
return je(e, "#000000", n);
|
|
1448
2357
|
}
|
|
1449
|
-
function
|
|
1450
|
-
return
|
|
2358
|
+
function Gs(e) {
|
|
2359
|
+
return de(e, 0.3);
|
|
1451
2360
|
}
|
|
1452
|
-
function
|
|
1453
|
-
return
|
|
2361
|
+
function Ys(e) {
|
|
2362
|
+
return ue(e, 0.2);
|
|
1454
2363
|
}
|
|
1455
|
-
function
|
|
1456
|
-
const t =
|
|
2364
|
+
function Zs(e, n) {
|
|
2365
|
+
const t = pe(e);
|
|
1457
2366
|
if (!t) return e;
|
|
1458
|
-
const s = Math.max(0, Math.min(1,
|
|
2367
|
+
const s = Math.max(0, Math.min(1, n));
|
|
1459
2368
|
return `rgba(${t.r}, ${t.g}, ${t.b}, ${s})`;
|
|
1460
2369
|
}
|
|
1461
|
-
function
|
|
1462
|
-
const
|
|
1463
|
-
return
|
|
2370
|
+
function Qs(e) {
|
|
2371
|
+
const n = pe(e);
|
|
2372
|
+
return n ? (n.r * 299 + n.g * 587 + n.b * 114) / 1e3 < 128 : !1;
|
|
1464
2373
|
}
|
|
1465
|
-
function
|
|
1466
|
-
const t =
|
|
1467
|
-
return { base: e, light: t, dark: s, bg:
|
|
2374
|
+
function Ae(e, n) {
|
|
2375
|
+
const t = de(e, 0.3), s = ue(e, 0.2), o = n === "dark" ? ue(e, 0.85) : de(e, 0.9), r = n === "dark" ? ue(e, 0.7) : de(e, 0.7);
|
|
2376
|
+
return { base: e, light: t, dark: s, bg: o, border: r };
|
|
1468
2377
|
}
|
|
1469
|
-
const
|
|
2378
|
+
const ee = {
|
|
1470
2379
|
primary: "#409eff",
|
|
1471
2380
|
success: "#67c23a",
|
|
1472
2381
|
warning: "#e6a23c",
|
|
1473
2382
|
danger: "#f56c6c",
|
|
1474
2383
|
info: "#909399"
|
|
1475
|
-
},
|
|
2384
|
+
}, ae = {
|
|
1476
2385
|
light: {
|
|
1477
2386
|
text: { primary: "#303133", regular: "#606266", secondary: "#909399", placeholder: "#c0c4cc" },
|
|
1478
2387
|
border: { base: "#dcdfe6", light: "#ebeef5", lighter: "#f2f6fc" },
|
|
@@ -1498,83 +2407,83 @@ const N = {
|
|
|
1498
2407
|
}
|
|
1499
2408
|
}
|
|
1500
2409
|
};
|
|
1501
|
-
function
|
|
2410
|
+
function te() {
|
|
1502
2411
|
return {
|
|
1503
|
-
primary: { ...
|
|
1504
|
-
light:
|
|
1505
|
-
dark:
|
|
2412
|
+
primary: { ...ee },
|
|
2413
|
+
light: Se(ae.light),
|
|
2414
|
+
dark: Se(ae.dark)
|
|
1506
2415
|
};
|
|
1507
2416
|
}
|
|
1508
|
-
function
|
|
2417
|
+
function Se(e) {
|
|
1509
2418
|
return JSON.parse(JSON.stringify(e));
|
|
1510
2419
|
}
|
|
1511
|
-
function
|
|
2420
|
+
function Me(e, n) {
|
|
1512
2421
|
const t = ["primary", "success", "warning", "danger", "info"], s = [];
|
|
1513
|
-
for (const
|
|
1514
|
-
const
|
|
1515
|
-
s.push(` --xp-color-${
|
|
2422
|
+
for (const o of t) {
|
|
2423
|
+
const r = e[o] || ee[o], u = Ae(r, n);
|
|
2424
|
+
s.push(` --xp-color-${o}: ${r};`), s.push(` --xp-color-${o}-light: ${u.light};`), s.push(` --xp-color-${o}-dark: ${u.dark};`), s.push(` --xp-color-${o}-bg: ${u.bg};`), s.push(` --xp-color-${o}-border: ${u.border};`);
|
|
1516
2425
|
}
|
|
1517
2426
|
return s.join(`
|
|
1518
2427
|
`);
|
|
1519
2428
|
}
|
|
1520
|
-
function
|
|
1521
|
-
const
|
|
1522
|
-
for (const t of Object.keys(e.text))
|
|
1523
|
-
|
|
2429
|
+
function Be(e) {
|
|
2430
|
+
const n = [];
|
|
2431
|
+
for (const t of Object.keys(e.text)) n.push(` --xp-text-color-${t}: ${e.text[t]};`);
|
|
2432
|
+
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
2433
|
for (const t of Object.keys(e.bg)) {
|
|
1525
2434
|
const s = t === "base" ? "" : `-${t}`;
|
|
1526
|
-
|
|
2435
|
+
n.push(` --xp-bg-color${s}: ${e.bg[t]};`);
|
|
1527
2436
|
}
|
|
1528
2437
|
for (const t of Object.keys(e.fill)) {
|
|
1529
2438
|
const s = t === "base" ? "" : `-${t}`;
|
|
1530
|
-
|
|
2439
|
+
n.push(` --xp-fill-color${s}: ${e.fill[t]};`);
|
|
1531
2440
|
}
|
|
1532
|
-
for (const t of Object.keys(e.shadow))
|
|
1533
|
-
return
|
|
2441
|
+
for (const t of Object.keys(e.shadow)) n.push(` --xp-shadow-${t}: ${e.shadow[t]};`);
|
|
2442
|
+
return n.join(`
|
|
1534
2443
|
`);
|
|
1535
2444
|
}
|
|
1536
|
-
function
|
|
1537
|
-
const t = {}, s = e.primary ||
|
|
1538
|
-
for (const
|
|
1539
|
-
const
|
|
1540
|
-
t[`--xp-color-${
|
|
2445
|
+
function Yl(e, n) {
|
|
2446
|
+
const t = {}, s = e.primary || ee, o = ["primary", "success", "warning", "danger", "info"];
|
|
2447
|
+
for (const u of o) {
|
|
2448
|
+
const _ = s[u] || ee[u], x = Ae(_, n);
|
|
2449
|
+
t[`--xp-color-${u}`] = _, t[`--xp-color-${u}-light`] = x.light, t[`--xp-color-${u}-dark`] = x.dark, t[`--xp-color-${u}-bg`] = x.bg, t[`--xp-color-${u}-border`] = x.border;
|
|
1541
2450
|
}
|
|
1542
|
-
const
|
|
1543
|
-
for (const
|
|
1544
|
-
t["--xp-border-color"] =
|
|
1545
|
-
for (const
|
|
1546
|
-
for (const
|
|
1547
|
-
for (const
|
|
2451
|
+
const r = e[n] || ae[n];
|
|
2452
|
+
for (const u of Object.keys(r.text)) t[`--xp-text-color-${u}`] = r.text[u];
|
|
2453
|
+
t["--xp-border-color"] = r.border.base, t["--xp-border-color-light"] = r.border.light, t["--xp-border-color-lighter"] = r.border.lighter;
|
|
2454
|
+
for (const u of Object.keys(r.bg)) t[`--xp-bg-color${u === "base" ? "" : "-" + u}`] = r.bg[u];
|
|
2455
|
+
for (const u of Object.keys(r.fill)) t[`--xp-fill-color${u === "base" ? "" : "-" + u}`] = r.fill[u];
|
|
2456
|
+
for (const u of Object.keys(r.shadow)) t[`--xp-shadow-${u}`] = r.shadow[u];
|
|
1548
2457
|
return t;
|
|
1549
2458
|
}
|
|
1550
|
-
function
|
|
2459
|
+
function Ee(e) {
|
|
1551
2460
|
return [
|
|
1552
2461
|
':root, [data-theme="light"] {',
|
|
1553
|
-
|
|
1554
|
-
|
|
2462
|
+
Me(e.primary || ee, "light"),
|
|
2463
|
+
Be(e.light || ae.light),
|
|
1555
2464
|
"}",
|
|
1556
2465
|
"",
|
|
1557
2466
|
'[data-theme="dark"] {',
|
|
1558
|
-
|
|
1559
|
-
|
|
2467
|
+
Me(e.primary || ee, "dark"),
|
|
2468
|
+
Be(e.dark || ae.dark),
|
|
1560
2469
|
"}"
|
|
1561
2470
|
].join(`
|
|
1562
2471
|
`);
|
|
1563
2472
|
}
|
|
1564
|
-
let
|
|
1565
|
-
function
|
|
2473
|
+
let re = null;
|
|
2474
|
+
function Zl() {
|
|
1566
2475
|
if (typeof document > "u") return null;
|
|
1567
|
-
if (
|
|
2476
|
+
if (re && document.contains(re)) return re;
|
|
1568
2477
|
let e = document.querySelector("style[data-xp-ui-theme]");
|
|
1569
|
-
return e || (e = document.createElement("style"), e.setAttribute("data-xp-ui-theme", "true"), document.head.appendChild(e)),
|
|
2478
|
+
return e || (e = document.createElement("style"), e.setAttribute("data-xp-ui-theme", "true"), document.head.appendChild(e)), re = e, e;
|
|
1570
2479
|
}
|
|
1571
|
-
function
|
|
1572
|
-
const
|
|
1573
|
-
|
|
2480
|
+
function Ql(e) {
|
|
2481
|
+
const n = Zl();
|
|
2482
|
+
n && (n.textContent = Ee(e));
|
|
1574
2483
|
}
|
|
1575
|
-
const
|
|
1576
|
-
function
|
|
1577
|
-
if (["light", "dark"].includes(e) && (
|
|
2484
|
+
const we = V("light"), Ne = V(te());
|
|
2485
|
+
function se(e) {
|
|
2486
|
+
if (["light", "dark"].includes(e) && (we.value = e, typeof document < "u")) {
|
|
1578
2487
|
document.documentElement.setAttribute("data-theme", e);
|
|
1579
2488
|
try {
|
|
1580
2489
|
localStorage.setItem("xp-ui-theme", e);
|
|
@@ -1582,65 +2491,65 @@ function L(e) {
|
|
|
1582
2491
|
}
|
|
1583
2492
|
}
|
|
1584
2493
|
}
|
|
1585
|
-
function
|
|
1586
|
-
|
|
2494
|
+
function es() {
|
|
2495
|
+
se(we.value === "light" ? "dark" : "light");
|
|
1587
2496
|
}
|
|
1588
|
-
function
|
|
2497
|
+
function oe(e) {
|
|
1589
2498
|
if (!e) return;
|
|
1590
|
-
const
|
|
1591
|
-
e.primary && (
|
|
2499
|
+
const n = te();
|
|
2500
|
+
e.primary && (n.primary = { ...n.primary, ...e.primary }), e.light && (n.light = _e(n.light, e.light)), e.dark && (n.dark = _e(n.dark, e.dark)), Ne.value = n, Ql(n);
|
|
1592
2501
|
try {
|
|
1593
|
-
localStorage.setItem("xp-ui-theme-config", JSON.stringify(
|
|
2502
|
+
localStorage.setItem("xp-ui-theme-config", JSON.stringify(n));
|
|
1594
2503
|
} catch {
|
|
1595
2504
|
}
|
|
1596
2505
|
}
|
|
1597
|
-
function
|
|
1598
|
-
|
|
2506
|
+
function ts() {
|
|
2507
|
+
oe(te());
|
|
1599
2508
|
}
|
|
1600
|
-
function
|
|
2509
|
+
function ns() {
|
|
1601
2510
|
if (typeof document > "u") return;
|
|
1602
2511
|
let e = null;
|
|
1603
2512
|
try {
|
|
1604
2513
|
e = localStorage.getItem("xp-ui-theme");
|
|
1605
2514
|
} catch {
|
|
1606
2515
|
}
|
|
1607
|
-
e === "light" || e === "dark" ?
|
|
1608
|
-
let
|
|
2516
|
+
e === "light" || e === "dark" ? se(e) : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? se("dark") : se("light");
|
|
2517
|
+
let n = null;
|
|
1609
2518
|
try {
|
|
1610
|
-
|
|
2519
|
+
n = localStorage.getItem("xp-ui-theme-config");
|
|
1611
2520
|
} catch {
|
|
1612
2521
|
}
|
|
1613
|
-
if (
|
|
2522
|
+
if (n)
|
|
1614
2523
|
try {
|
|
1615
|
-
|
|
2524
|
+
oe(JSON.parse(n));
|
|
1616
2525
|
} catch {
|
|
1617
|
-
|
|
2526
|
+
oe(te());
|
|
1618
2527
|
}
|
|
1619
2528
|
else
|
|
1620
|
-
|
|
2529
|
+
oe(te());
|
|
1621
2530
|
}
|
|
1622
|
-
function
|
|
1623
|
-
if (!
|
|
2531
|
+
function _e(e, n) {
|
|
2532
|
+
if (!n || typeof n != "object") return e;
|
|
1624
2533
|
const t = Array.isArray(e) ? [...e] : { ...e };
|
|
1625
|
-
for (const s of Object.keys(
|
|
1626
|
-
|
|
2534
|
+
for (const s of Object.keys(n))
|
|
2535
|
+
n[s] && typeof n[s] == "object" && !Array.isArray(n[s]) ? t[s] = _e(e[s] || {}, n[s]) : t[s] = n[s];
|
|
1627
2536
|
return t;
|
|
1628
2537
|
}
|
|
1629
|
-
function
|
|
2538
|
+
function ls() {
|
|
1630
2539
|
return {
|
|
1631
|
-
theme:
|
|
1632
|
-
themeConfig:
|
|
1633
|
-
setTheme:
|
|
1634
|
-
toggleTheme:
|
|
1635
|
-
initTheme:
|
|
1636
|
-
applyThemeConfig:
|
|
1637
|
-
resetThemeConfig:
|
|
1638
|
-
getDefaultThemeConfig:
|
|
1639
|
-
buildCssString:
|
|
1640
|
-
buildCssVars:
|
|
2540
|
+
theme: we,
|
|
2541
|
+
themeConfig: Ne,
|
|
2542
|
+
setTheme: se,
|
|
2543
|
+
toggleTheme: es,
|
|
2544
|
+
initTheme: ns,
|
|
2545
|
+
applyThemeConfig: oe,
|
|
2546
|
+
resetThemeConfig: ts,
|
|
2547
|
+
getDefaultThemeConfig: te,
|
|
2548
|
+
buildCssString: Ee,
|
|
2549
|
+
buildCssVars: Yl
|
|
1641
2550
|
};
|
|
1642
2551
|
}
|
|
1643
|
-
const
|
|
2552
|
+
const ss = ["data-theme"], os = { class: "xp-theme-customizer__header" }, as = { class: "xp-theme-customizer__body" }, is = { class: "xp-theme-customizer__section" }, rs = { class: "xp-theme-customizer__modes" }, ds = ["onClick"], us = { class: "xp-theme-customizer__section" }, cs = { class: "xp-theme-customizer__grid" }, ps = { class: "xp-theme-customizer__label" }, fs = { class: "xp-theme-customizer__input" }, hs = ["value", "onInput"], ms = ["value", "onChange"], vs = { class: "xp-theme-customizer__section" }, gs = { class: "xp-theme-customizer__grid" }, xs = { class: "xp-theme-customizer__label" }, _s = { class: "xp-theme-customizer__input" }, bs = ["value", "onInput"], ys = ["value", "onChange"], ks = { class: "xp-theme-customizer__section" }, ws = { class: "xp-theme-customizer__grid" }, $s = { class: "xp-theme-customizer__label" }, Cs = { class: "xp-theme-customizer__input" }, Ss = ["value", "onInput"], Ms = ["value", "onChange"], Bs = { class: "xp-theme-customizer__section" }, zs = { class: "xp-theme-customizer__grid" }, Is = { class: "xp-theme-customizer__label" }, Ts = { class: "xp-theme-customizer__input" }, Vs = ["value", "onInput"], js = ["value", "onChange"], As = { class: "xp-theme-customizer__label" }, Es = { class: "xp-theme-customizer__input" }, Ns = ["value", "onInput"], Rs = ["value", "onChange"], Xs = {
|
|
1644
2553
|
__name: "ThemeCustomizer",
|
|
1645
2554
|
props: {
|
|
1646
2555
|
modelValue: {
|
|
@@ -1649,8 +2558,8 @@ const Xo = ["data-theme"], Lo = { class: "xp-theme-customizer__header" }, Po = {
|
|
|
1649
2558
|
}
|
|
1650
2559
|
},
|
|
1651
2560
|
emits: ["update:modelValue"],
|
|
1652
|
-
setup(e, { emit:
|
|
1653
|
-
const { theme: t, applyThemeConfig: s, resetThemeConfig:
|
|
2561
|
+
setup(e, { emit: n }) {
|
|
2562
|
+
const { theme: t, applyThemeConfig: s, resetThemeConfig: o, getDefaultThemeConfig: r, buildCssString: u, themeConfig: _ } = ls(), x = {
|
|
1654
2563
|
primary: "主色",
|
|
1655
2564
|
success: "成功",
|
|
1656
2565
|
warning: "警告",
|
|
@@ -1664,287 +2573,287 @@ const Xo = ["data-theme"], Lo = { class: "xp-theme-customizer__header" }, Po = {
|
|
|
1664
2573
|
soft: "柔和",
|
|
1665
2574
|
light: "亮",
|
|
1666
2575
|
lighter: "更亮"
|
|
1667
|
-
},
|
|
1668
|
-
|
|
1669
|
-
function
|
|
1670
|
-
return JSON.parse(JSON.stringify(
|
|
2576
|
+
}, c = V("light"), d = V(null), p = We(v(_.value));
|
|
2577
|
+
be(_, (g) => Object.assign(p, v(g)), { deep: !0 });
|
|
2578
|
+
function v(g) {
|
|
2579
|
+
return JSON.parse(JSON.stringify(g));
|
|
1671
2580
|
}
|
|
1672
|
-
function
|
|
1673
|
-
if (!
|
|
1674
|
-
if (/^#([0-9a-f]{6})$/i.test(
|
|
1675
|
-
const
|
|
1676
|
-
return
|
|
2581
|
+
function C(g) {
|
|
2582
|
+
if (!g) return "#ffffff";
|
|
2583
|
+
if (/^#([0-9a-f]{6})$/i.test(g)) return g.toLowerCase();
|
|
2584
|
+
const b = g.match(/rgba?\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})/);
|
|
2585
|
+
return b ? "#" + [b[1], b[2], b[3]].map((m) => Number(m).toString(16).padStart(2, "0")).join("") : "#ffffff";
|
|
1677
2586
|
}
|
|
1678
|
-
function $(
|
|
1679
|
-
|
|
2587
|
+
function $(g, b) {
|
|
2588
|
+
p.primary[g] = b, s(p);
|
|
1680
2589
|
}
|
|
1681
|
-
function
|
|
1682
|
-
c
|
|
2590
|
+
function j(g, b, m) {
|
|
2591
|
+
p[c.value][g][b] = m, s(p);
|
|
1683
2592
|
}
|
|
1684
|
-
function
|
|
1685
|
-
|
|
2593
|
+
function y() {
|
|
2594
|
+
o();
|
|
1686
2595
|
}
|
|
1687
|
-
function
|
|
1688
|
-
|
|
2596
|
+
function D() {
|
|
2597
|
+
K("xp-ui-theme.json", JSON.stringify(p, null, 2), "application/json");
|
|
1689
2598
|
}
|
|
1690
|
-
function
|
|
1691
|
-
|
|
2599
|
+
function H() {
|
|
2600
|
+
K("xp-ui-theme.css", u(p), "text/css");
|
|
1692
2601
|
}
|
|
1693
|
-
function
|
|
1694
|
-
|
|
2602
|
+
function q() {
|
|
2603
|
+
d.value && d.value.click();
|
|
1695
2604
|
}
|
|
1696
|
-
function
|
|
1697
|
-
const
|
|
1698
|
-
if (!
|
|
1699
|
-
const
|
|
1700
|
-
|
|
2605
|
+
function R(g) {
|
|
2606
|
+
const b = g.target.files && g.target.files[0];
|
|
2607
|
+
if (!b) return;
|
|
2608
|
+
const m = new FileReader();
|
|
2609
|
+
m.onload = () => {
|
|
1701
2610
|
try {
|
|
1702
|
-
const
|
|
1703
|
-
s(
|
|
1704
|
-
} catch (
|
|
2611
|
+
const T = JSON.parse(m.result);
|
|
2612
|
+
s(T);
|
|
2613
|
+
} catch (T) {
|
|
1705
2614
|
alert(`主题配置解析失败:
|
|
1706
|
-
` +
|
|
2615
|
+
` + T.message);
|
|
1707
2616
|
} finally {
|
|
1708
|
-
|
|
2617
|
+
g.target.value = "";
|
|
1709
2618
|
}
|
|
1710
|
-
},
|
|
2619
|
+
}, m.readAsText(b);
|
|
1711
2620
|
}
|
|
1712
|
-
function
|
|
1713
|
-
const
|
|
1714
|
-
|
|
2621
|
+
function K(g, b, m) {
|
|
2622
|
+
const T = new Blob([b], { type: m + ";charset=utf-8" }), Y = URL.createObjectURL(T), G = document.createElement("a");
|
|
2623
|
+
G.href = Y, G.download = g, document.body.appendChild(G), G.click(), G.remove(), setTimeout(() => URL.revokeObjectURL(Y), 0);
|
|
1715
2624
|
}
|
|
1716
|
-
return (
|
|
1717
|
-
|
|
1718
|
-
default:
|
|
1719
|
-
e.modelValue ? (
|
|
2625
|
+
return (g, b) => (a(), i(M, null, [
|
|
2626
|
+
W(J, { name: "xp-fade" }, {
|
|
2627
|
+
default: F(() => [
|
|
2628
|
+
e.modelValue ? (a(), i("div", {
|
|
1720
2629
|
key: 0,
|
|
1721
2630
|
class: "xp-theme-customizer-backdrop",
|
|
1722
|
-
onClick:
|
|
1723
|
-
})) :
|
|
2631
|
+
onClick: b[0] || (b[0] = U((m) => g.$emit("update:modelValue", !1), ["self"]))
|
|
2632
|
+
})) : w("", !0)
|
|
1724
2633
|
]),
|
|
1725
2634
|
_: 1
|
|
1726
2635
|
}),
|
|
1727
|
-
|
|
1728
|
-
default:
|
|
1729
|
-
e.modelValue ? (
|
|
2636
|
+
W(J, { name: "xp-slide" }, {
|
|
2637
|
+
default: F(() => [
|
|
2638
|
+
e.modelValue ? (a(), i("aside", {
|
|
1730
2639
|
key: 0,
|
|
1731
2640
|
class: "xp-theme-customizer",
|
|
1732
|
-
"data-theme":
|
|
2641
|
+
"data-theme": Ie(t)
|
|
1733
2642
|
}, [
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
2643
|
+
l("header", os, [
|
|
2644
|
+
b[2] || (b[2] = l("div", { class: "xp-theme-customizer__title" }, "🎨 主题定制", -1)),
|
|
2645
|
+
l("button", {
|
|
1737
2646
|
class: "xp-theme-customizer__close",
|
|
1738
|
-
onClick:
|
|
2647
|
+
onClick: b[1] || (b[1] = (m) => g.$emit("update:modelValue", !1)),
|
|
1739
2648
|
"aria-label": "关闭"
|
|
1740
2649
|
}, "✕")
|
|
1741
2650
|
]),
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
(
|
|
1747
|
-
key:
|
|
1748
|
-
class:
|
|
1749
|
-
onClick: (
|
|
1750
|
-
},
|
|
2651
|
+
l("div", as, [
|
|
2652
|
+
l("section", is, [
|
|
2653
|
+
b[3] || (b[3] = l("p", { class: "xp-theme-customizer__desc" }, " 修改下方颜色即可改变整个示例/库的外观。导出后可直接放进你自己的项目中应用。 ", -1)),
|
|
2654
|
+
l("div", rs, [
|
|
2655
|
+
(a(), i(M, null, X(["light", "dark"], (m) => l("button", {
|
|
2656
|
+
key: m,
|
|
2657
|
+
class: z(["xp-theme-customizer__mode-btn", { "is-active": c.value === m }]),
|
|
2658
|
+
onClick: (T) => c.value = m
|
|
2659
|
+
}, S(m === "light" ? "浅色" : "暗黑"), 11, ds)), 64))
|
|
1751
2660
|
])
|
|
1752
2661
|
]),
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
(
|
|
1757
|
-
key:
|
|
2662
|
+
l("section", us, [
|
|
2663
|
+
b[4] || (b[4] = l("h3", { class: "xp-theme-customizer__h" }, "主色", -1)),
|
|
2664
|
+
l("div", cs, [
|
|
2665
|
+
(a(), i(M, null, X(["primary", "success", "warning", "danger", "info"], (m) => l("div", {
|
|
2666
|
+
key: m,
|
|
1758
2667
|
class: "xp-theme-customizer__item"
|
|
1759
2668
|
}, [
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
2669
|
+
l("div", ps, S(x[m]), 1),
|
|
2670
|
+
l("div", fs, [
|
|
2671
|
+
l("input", {
|
|
1763
2672
|
type: "color",
|
|
1764
|
-
value:
|
|
1765
|
-
onInput: (
|
|
1766
|
-
}, null, 40,
|
|
1767
|
-
|
|
2673
|
+
value: p.primary[m],
|
|
2674
|
+
onInput: (T) => $(m, T.target.value)
|
|
2675
|
+
}, null, 40, hs),
|
|
2676
|
+
l("input", {
|
|
1768
2677
|
type: "text",
|
|
1769
|
-
value:
|
|
1770
|
-
onChange: (
|
|
1771
|
-
}, null, 40,
|
|
2678
|
+
value: p.primary[m],
|
|
2679
|
+
onChange: (T) => $(m, T.target.value)
|
|
2680
|
+
}, null, 40, ms)
|
|
1772
2681
|
])
|
|
1773
2682
|
])), 64))
|
|
1774
2683
|
])
|
|
1775
2684
|
]),
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
(
|
|
1780
|
-
key: "t-" +
|
|
2685
|
+
l("section", vs, [
|
|
2686
|
+
b[5] || (b[5] = l("h3", { class: "xp-theme-customizer__h" }, "文本", -1)),
|
|
2687
|
+
l("div", gs, [
|
|
2688
|
+
(a(), i(M, null, X(["primary", "regular", "secondary", "placeholder"], (m) => l("div", {
|
|
2689
|
+
key: "t-" + m,
|
|
1781
2690
|
class: "xp-theme-customizer__item"
|
|
1782
2691
|
}, [
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
2692
|
+
l("div", xs, S(x[m]), 1),
|
|
2693
|
+
l("div", _s, [
|
|
2694
|
+
l("input", {
|
|
1786
2695
|
type: "color",
|
|
1787
|
-
value:
|
|
1788
|
-
onInput: (
|
|
1789
|
-
}, null, 40,
|
|
1790
|
-
|
|
2696
|
+
value: C(p[c.value].text[m]),
|
|
2697
|
+
onInput: (T) => j("text", m, T.target.value)
|
|
2698
|
+
}, null, 40, bs),
|
|
2699
|
+
l("input", {
|
|
1791
2700
|
type: "text",
|
|
1792
|
-
value: c
|
|
1793
|
-
onChange: (
|
|
1794
|
-
}, null, 40,
|
|
2701
|
+
value: p[c.value].text[m],
|
|
2702
|
+
onChange: (T) => j("text", m, T.target.value)
|
|
2703
|
+
}, null, 40, ys)
|
|
1795
2704
|
])
|
|
1796
2705
|
])), 64))
|
|
1797
2706
|
])
|
|
1798
2707
|
]),
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
(
|
|
1803
|
-
key: "bg-" +
|
|
2708
|
+
l("section", ks, [
|
|
2709
|
+
b[6] || (b[6] = l("h3", { class: "xp-theme-customizer__h" }, "背景", -1)),
|
|
2710
|
+
l("div", ws, [
|
|
2711
|
+
(a(), i(M, null, X(["base", "page", "soft"], (m) => l("div", {
|
|
2712
|
+
key: "bg-" + m,
|
|
1804
2713
|
class: "xp-theme-customizer__item"
|
|
1805
2714
|
}, [
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
2715
|
+
l("div", $s, S(x[m]), 1),
|
|
2716
|
+
l("div", Cs, [
|
|
2717
|
+
l("input", {
|
|
1809
2718
|
type: "color",
|
|
1810
|
-
value:
|
|
1811
|
-
onInput: (
|
|
1812
|
-
}, null, 40,
|
|
1813
|
-
|
|
2719
|
+
value: C(p[c.value].bg[m]),
|
|
2720
|
+
onInput: (T) => j("bg", m, T.target.value)
|
|
2721
|
+
}, null, 40, Ss),
|
|
2722
|
+
l("input", {
|
|
1814
2723
|
type: "text",
|
|
1815
|
-
value: c
|
|
1816
|
-
onChange: (
|
|
1817
|
-
}, null, 40,
|
|
2724
|
+
value: p[c.value].bg[m],
|
|
2725
|
+
onChange: (T) => j("bg", m, T.target.value)
|
|
2726
|
+
}, null, 40, Ms)
|
|
1818
2727
|
])
|
|
1819
2728
|
])), 64))
|
|
1820
2729
|
])
|
|
1821
2730
|
]),
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
(
|
|
1826
|
-
key: "bd-" +
|
|
2731
|
+
l("section", Bs, [
|
|
2732
|
+
b[7] || (b[7] = l("h3", { class: "xp-theme-customizer__h" }, "边框 / 填充", -1)),
|
|
2733
|
+
l("div", zs, [
|
|
2734
|
+
(a(), i(M, null, X(["base", "light", "lighter"], (m) => l("div", {
|
|
2735
|
+
key: "bd-" + m,
|
|
1827
2736
|
class: "xp-theme-customizer__item"
|
|
1828
2737
|
}, [
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
2738
|
+
l("div", Is, "边框 - " + S(x[m]), 1),
|
|
2739
|
+
l("div", Ts, [
|
|
2740
|
+
l("input", {
|
|
1832
2741
|
type: "color",
|
|
1833
|
-
value:
|
|
1834
|
-
onInput: (
|
|
1835
|
-
}, null, 40,
|
|
1836
|
-
|
|
2742
|
+
value: C(p[c.value].border[m]),
|
|
2743
|
+
onInput: (T) => j("border", m, T.target.value)
|
|
2744
|
+
}, null, 40, Vs),
|
|
2745
|
+
l("input", {
|
|
1837
2746
|
type: "text",
|
|
1838
|
-
value: c
|
|
1839
|
-
onChange: (
|
|
1840
|
-
}, null, 40,
|
|
2747
|
+
value: p[c.value].border[m],
|
|
2748
|
+
onChange: (T) => j("border", m, T.target.value)
|
|
2749
|
+
}, null, 40, js)
|
|
1841
2750
|
])
|
|
1842
2751
|
])), 64)),
|
|
1843
|
-
(
|
|
1844
|
-
key: "fl-" +
|
|
2752
|
+
(a(), i(M, null, X(["base", "light", "lighter"], (m) => l("div", {
|
|
2753
|
+
key: "fl-" + m,
|
|
1845
2754
|
class: "xp-theme-customizer__item"
|
|
1846
2755
|
}, [
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
2756
|
+
l("div", As, "填充 - " + S(x[m]), 1),
|
|
2757
|
+
l("div", Es, [
|
|
2758
|
+
l("input", {
|
|
1850
2759
|
type: "color",
|
|
1851
|
-
value:
|
|
1852
|
-
onInput: (
|
|
1853
|
-
}, null, 40,
|
|
1854
|
-
|
|
2760
|
+
value: C(p[c.value].fill[m]),
|
|
2761
|
+
onInput: (T) => j("fill", m, T.target.value)
|
|
2762
|
+
}, null, 40, Ns),
|
|
2763
|
+
l("input", {
|
|
1855
2764
|
type: "text",
|
|
1856
|
-
value: c
|
|
1857
|
-
onChange: (
|
|
1858
|
-
}, null, 40,
|
|
2765
|
+
value: p[c.value].fill[m],
|
|
2766
|
+
onChange: (T) => j("fill", m, T.target.value)
|
|
2767
|
+
}, null, 40, Rs)
|
|
1859
2768
|
])
|
|
1860
2769
|
])), 64))
|
|
1861
2770
|
])
|
|
1862
2771
|
]),
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
2772
|
+
b[8] || (b[8] = l("section", { class: "xp-theme-customizer__section" }, [
|
|
2773
|
+
l("h3", { class: "xp-theme-customizer__h" }, "实时预览"),
|
|
2774
|
+
l("div", { class: "xp-theme-customizer__preview" }, [
|
|
2775
|
+
l("div", { class: "xp-preview-row" }, [
|
|
2776
|
+
l("button", { class: "xp-preview-btn xp-preview-btn--primary" }, "Primary"),
|
|
2777
|
+
l("button", { class: "xp-preview-btn xp-preview-btn--success" }, "Success"),
|
|
2778
|
+
l("button", { class: "xp-preview-btn xp-preview-btn--warning" }, "Warning"),
|
|
2779
|
+
l("button", { class: "xp-preview-btn xp-preview-btn--danger" }, "Danger")
|
|
1871
2780
|
]),
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
2781
|
+
l("div", { class: "xp-preview-text xp-preview-text--primary" }, "主标题文本"),
|
|
2782
|
+
l("div", { class: "xp-preview-text" }, "正文内容样例 Regular text"),
|
|
2783
|
+
l("div", { class: "xp-preview-text xp-preview-text--secondary" }, "次要提示")
|
|
1875
2784
|
])
|
|
1876
2785
|
], -1))
|
|
1877
2786
|
]),
|
|
1878
|
-
|
|
1879
|
-
|
|
2787
|
+
l("footer", { class: "xp-theme-customizer__footer" }, [
|
|
2788
|
+
l("button", {
|
|
1880
2789
|
class: "xp-theme-customizer__action",
|
|
1881
|
-
onClick:
|
|
2790
|
+
onClick: y
|
|
1882
2791
|
}, "恢复默认"),
|
|
1883
|
-
|
|
2792
|
+
l("button", {
|
|
1884
2793
|
class: "xp-theme-customizer__action xp-theme-customizer__action--secondary",
|
|
1885
|
-
onClick:
|
|
2794
|
+
onClick: q
|
|
1886
2795
|
}, "导入 JSON"),
|
|
1887
|
-
|
|
2796
|
+
l("button", {
|
|
1888
2797
|
class: "xp-theme-customizer__action xp-theme-customizer__action--primary",
|
|
1889
|
-
onClick:
|
|
2798
|
+
onClick: D
|
|
1890
2799
|
}, "导出 JSON"),
|
|
1891
|
-
|
|
2800
|
+
l("button", {
|
|
1892
2801
|
class: "xp-theme-customizer__action xp-theme-customizer__action--primary",
|
|
1893
|
-
onClick:
|
|
2802
|
+
onClick: H
|
|
1894
2803
|
}, "导出 CSS")
|
|
1895
2804
|
]),
|
|
1896
|
-
|
|
2805
|
+
l("input", {
|
|
1897
2806
|
ref_key: "importFileInput",
|
|
1898
|
-
ref:
|
|
2807
|
+
ref: d,
|
|
1899
2808
|
type: "file",
|
|
1900
2809
|
accept: "application/json,.json,.txt",
|
|
1901
2810
|
class: "xp-theme-customizer__hidden",
|
|
1902
|
-
onChange:
|
|
2811
|
+
onChange: R
|
|
1903
2812
|
}, null, 544)
|
|
1904
|
-
], 8,
|
|
2813
|
+
], 8, ss)) : w("", !0)
|
|
1905
2814
|
]),
|
|
1906
2815
|
_: 1
|
|
1907
2816
|
})
|
|
1908
2817
|
], 64));
|
|
1909
2818
|
}
|
|
1910
|
-
},
|
|
1911
|
-
let
|
|
1912
|
-
function
|
|
1913
|
-
function e(
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1916
|
-
const
|
|
1917
|
-
|
|
2819
|
+
}, le = V([]);
|
|
2820
|
+
let Ds = 0;
|
|
2821
|
+
function eo() {
|
|
2822
|
+
function e(n, t = "info", s = 2600) {
|
|
2823
|
+
const o = ++Ds;
|
|
2824
|
+
le.value.push({ id: o, message: n, type: t }), setTimeout(() => {
|
|
2825
|
+
const r = le.value.findIndex((u) => u.id === o);
|
|
2826
|
+
r >= 0 && le.value.splice(r, 1);
|
|
1918
2827
|
}, s);
|
|
1919
2828
|
}
|
|
1920
2829
|
return {
|
|
1921
|
-
toasts:
|
|
2830
|
+
toasts: le,
|
|
1922
2831
|
toast: e,
|
|
1923
|
-
success: (
|
|
1924
|
-
error: (
|
|
1925
|
-
info: (
|
|
1926
|
-
warn: (
|
|
2832
|
+
success: (n) => e(n, "success", 2200),
|
|
2833
|
+
error: (n) => e(n, "error", 3600),
|
|
2834
|
+
info: (n) => e(n, "info"),
|
|
2835
|
+
warn: (n) => e(n, "warn", 2800)
|
|
1927
2836
|
};
|
|
1928
2837
|
}
|
|
1929
|
-
const
|
|
2838
|
+
const Os = {
|
|
1930
2839
|
class: "xp-toast-wrap",
|
|
1931
2840
|
"aria-live": "polite"
|
|
1932
|
-
},
|
|
2841
|
+
}, Fs = { class: "xp-toast__msg" }, Ls = {
|
|
1933
2842
|
__name: "Toast",
|
|
1934
2843
|
setup(e) {
|
|
1935
|
-
return (
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
default:
|
|
1939
|
-
(
|
|
2844
|
+
return (n, t) => (a(), O(ne, { to: "body" }, [
|
|
2845
|
+
l("div", Os, [
|
|
2846
|
+
W(qe, { name: "xp-toast" }, {
|
|
2847
|
+
default: F(() => [
|
|
2848
|
+
(a(!0), i(M, null, X(Ie(le), (s) => (a(), i("div", {
|
|
1940
2849
|
key: s.id,
|
|
1941
|
-
class:
|
|
2850
|
+
class: z(["xp-toast", `xp-toast--${s.type}`])
|
|
1942
2851
|
}, [
|
|
1943
|
-
t[0] || (t[0] =
|
|
2852
|
+
t[0] || (t[0] = l("span", {
|
|
1944
2853
|
class: "xp-toast__dot",
|
|
1945
2854
|
"aria-hidden": "true"
|
|
1946
2855
|
}, null, -1)),
|
|
1947
|
-
|
|
2856
|
+
l("span", Fs, S(s.message), 1)
|
|
1948
2857
|
], 2))), 128))
|
|
1949
2858
|
]),
|
|
1950
2859
|
_: 1
|
|
@@ -1952,7 +2861,7 @@ const $n = {
|
|
|
1952
2861
|
])
|
|
1953
2862
|
]));
|
|
1954
2863
|
}
|
|
1955
|
-
},
|
|
2864
|
+
}, Hs = /* @__PURE__ */ E(Ls, [["__scopeId", "data-v-b564201c"]]), Ps = { class: "xp-tooltip__content" }, Ws = {
|
|
1956
2865
|
__name: "Tooltip",
|
|
1957
2866
|
props: {
|
|
1958
2867
|
content: {
|
|
@@ -1975,159 +2884,175 @@ const $n = {
|
|
|
1975
2884
|
}
|
|
1976
2885
|
},
|
|
1977
2886
|
setup(e) {
|
|
1978
|
-
const
|
|
1979
|
-
let
|
|
1980
|
-
const
|
|
1981
|
-
|
|
1982
|
-
if (!
|
|
1983
|
-
const
|
|
1984
|
-
let
|
|
1985
|
-
switch (
|
|
2887
|
+
const n = e, t = V(!1), s = V({}), o = V(null), r = V(null);
|
|
2888
|
+
let u = null;
|
|
2889
|
+
const _ = () => {
|
|
2890
|
+
ye(() => {
|
|
2891
|
+
if (!o.value || !r.value) return;
|
|
2892
|
+
const p = o.value.getBoundingClientRect(), v = r.value.getBoundingClientRect();
|
|
2893
|
+
let C = 0, $ = 0;
|
|
2894
|
+
switch (n.placement) {
|
|
1986
2895
|
case "top":
|
|
1987
|
-
|
|
2896
|
+
C = p.top - v.height - 8, $ = p.left + p.width / 2 - v.width / 2;
|
|
1988
2897
|
break;
|
|
1989
2898
|
case "bottom":
|
|
1990
|
-
|
|
2899
|
+
C = p.bottom + 8, $ = p.left + p.width / 2 - v.width / 2;
|
|
1991
2900
|
break;
|
|
1992
2901
|
case "left":
|
|
1993
|
-
|
|
2902
|
+
C = p.top + p.height / 2 - v.height / 2, $ = p.left - v.width - 8;
|
|
1994
2903
|
break;
|
|
1995
2904
|
case "right":
|
|
1996
|
-
|
|
2905
|
+
C = p.top + p.height / 2 - v.height / 2, $ = p.right + 8;
|
|
1997
2906
|
break;
|
|
1998
2907
|
}
|
|
1999
2908
|
s.value = {
|
|
2000
|
-
top: `${
|
|
2909
|
+
top: `${C + window.scrollY}px`,
|
|
2001
2910
|
left: `${$ + window.scrollX}px`
|
|
2002
2911
|
};
|
|
2003
2912
|
});
|
|
2004
|
-
},
|
|
2005
|
-
|
|
2006
|
-
t.value = !0,
|
|
2913
|
+
}, x = () => {
|
|
2914
|
+
n.disabled || (clearTimeout(u), u = setTimeout(() => {
|
|
2915
|
+
t.value = !0, _();
|
|
2007
2916
|
}, 100));
|
|
2008
|
-
},
|
|
2009
|
-
clearTimeout(
|
|
2917
|
+
}, c = () => {
|
|
2918
|
+
clearTimeout(u), u = setTimeout(() => {
|
|
2010
2919
|
t.value = !1;
|
|
2011
2920
|
}, 150);
|
|
2012
|
-
},
|
|
2013
|
-
|
|
2921
|
+
}, d = () => {
|
|
2922
|
+
n.trigger !== "click" || n.disabled || (t.value = !t.value, t.value && _());
|
|
2014
2923
|
};
|
|
2015
|
-
return
|
|
2016
|
-
clearTimeout(
|
|
2017
|
-
}), (
|
|
2924
|
+
return ie(() => {
|
|
2925
|
+
clearTimeout(u);
|
|
2926
|
+
}), (p, v) => (a(), i("div", {
|
|
2018
2927
|
class: "xp-tooltip",
|
|
2019
2928
|
ref_key: "tooltipRef",
|
|
2020
|
-
ref:
|
|
2929
|
+
ref: o
|
|
2021
2930
|
}, [
|
|
2022
|
-
|
|
2931
|
+
l("div", {
|
|
2023
2932
|
class: "xp-tooltip__trigger",
|
|
2024
|
-
onMouseenter:
|
|
2025
|
-
onMouseleave:
|
|
2026
|
-
onClick:
|
|
2933
|
+
onMouseenter: x,
|
|
2934
|
+
onMouseleave: c,
|
|
2935
|
+
onClick: d
|
|
2027
2936
|
}, [
|
|
2028
|
-
|
|
2937
|
+
I(p.$slots, "default", {}, void 0, !0)
|
|
2029
2938
|
], 32),
|
|
2030
|
-
(
|
|
2031
|
-
|
|
2032
|
-
default:
|
|
2033
|
-
t.value ? (
|
|
2939
|
+
(a(), O(ne, { to: "body" }, [
|
|
2940
|
+
W(J, { name: "xp-tooltip-fade" }, {
|
|
2941
|
+
default: F(() => [
|
|
2942
|
+
t.value ? (a(), i("div", {
|
|
2034
2943
|
key: 0,
|
|
2035
|
-
class:
|
|
2036
|
-
style:
|
|
2944
|
+
class: z(["xp-tooltip__popper", [`xp-tooltip__popper--${e.placement}`]]),
|
|
2945
|
+
style: L(s.value),
|
|
2037
2946
|
ref_key: "popperRef",
|
|
2038
|
-
ref:
|
|
2947
|
+
ref: r
|
|
2039
2948
|
}, [
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2949
|
+
l("div", Ps, [
|
|
2950
|
+
I(p.$slots, "content", {}, () => [
|
|
2951
|
+
Q(S(e.content), 1)
|
|
2043
2952
|
], !0)
|
|
2044
2953
|
]),
|
|
2045
|
-
|
|
2046
|
-
], 6)) :
|
|
2954
|
+
v[0] || (v[0] = l("div", { class: "xp-tooltip__arrow" }, null, -1))
|
|
2955
|
+
], 6)) : w("", !0)
|
|
2047
2956
|
]),
|
|
2048
2957
|
_: 3
|
|
2049
2958
|
})
|
|
2050
2959
|
]))
|
|
2051
2960
|
], 512));
|
|
2052
2961
|
}
|
|
2053
|
-
},
|
|
2054
|
-
XpAlert:
|
|
2055
|
-
XpAvatar:
|
|
2056
|
-
XpBadge:
|
|
2057
|
-
XpButton:
|
|
2058
|
-
XpCard:
|
|
2059
|
-
XpCheckbox:
|
|
2060
|
-
XpContextMenu:
|
|
2061
|
-
XpDialog:
|
|
2062
|
-
XpDropdown:
|
|
2063
|
-
XpEmpty:
|
|
2064
|
-
XpFileIcon:
|
|
2065
|
-
XpIcon:
|
|
2066
|
-
XpInput:
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2962
|
+
}, qs = /* @__PURE__ */ E(Ws, [["__scopeId", "data-v-6d9af40b"]]), Re = {
|
|
2963
|
+
XpAlert: Ze,
|
|
2964
|
+
XpAvatar: lt,
|
|
2965
|
+
XpBadge: at,
|
|
2966
|
+
XpButton: ge,
|
|
2967
|
+
XpCard: gt,
|
|
2968
|
+
XpCheckbox: xe,
|
|
2969
|
+
XpContextMenu: Mt,
|
|
2970
|
+
XpDialog: jt,
|
|
2971
|
+
XpDropdown: Xt,
|
|
2972
|
+
XpEmpty: Te,
|
|
2973
|
+
XpFileIcon: qt,
|
|
2974
|
+
XpIcon: vn,
|
|
2975
|
+
XpInput: yn,
|
|
2976
|
+
XpMenu: Mn,
|
|
2977
|
+
XpMenuGroup: Vn,
|
|
2978
|
+
XpMenuItem: An,
|
|
2979
|
+
XpSubMenu: Ln,
|
|
2980
|
+
XpPagination: ll,
|
|
2981
|
+
XpProgress: al,
|
|
2982
|
+
XpRadio: cl,
|
|
2983
|
+
XpRate: gl,
|
|
2984
|
+
XpSelect: Ve,
|
|
2985
|
+
XpSwitch: yl,
|
|
2986
|
+
XpTable: Al,
|
|
2987
|
+
XpTableColumn: El,
|
|
2988
|
+
XpTabPane: Xl,
|
|
2989
|
+
XpTabs: Pl,
|
|
2990
|
+
XpTag: ql,
|
|
2991
|
+
XpThemeCustomizer: Xs,
|
|
2992
|
+
XpToast: Hs,
|
|
2993
|
+
XpTooltip: qs
|
|
2994
|
+
}, Js = (e) => {
|
|
2995
|
+
Object.entries(Re).forEach(([n, t]) => {
|
|
2996
|
+
e.component(n, t);
|
|
2080
2997
|
});
|
|
2081
|
-
},
|
|
2082
|
-
install:
|
|
2083
|
-
...
|
|
2998
|
+
}, to = {
|
|
2999
|
+
install: Js,
|
|
3000
|
+
...Re
|
|
2084
3001
|
};
|
|
2085
3002
|
export {
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
3003
|
+
ee as DEFAULT_PRIMARY,
|
|
3004
|
+
ae as DEFAULT_TOKENS,
|
|
3005
|
+
Ze as XpAlert,
|
|
3006
|
+
lt as XpAvatar,
|
|
3007
|
+
at as XpBadge,
|
|
3008
|
+
ge as XpButton,
|
|
3009
|
+
gt as XpCard,
|
|
3010
|
+
xe as XpCheckbox,
|
|
3011
|
+
Mt as XpContextMenu,
|
|
3012
|
+
jt as XpDialog,
|
|
3013
|
+
Xt as XpDropdown,
|
|
3014
|
+
Te as XpEmpty,
|
|
3015
|
+
qt as XpFileIcon,
|
|
3016
|
+
vn as XpIcon,
|
|
3017
|
+
yn as XpInput,
|
|
3018
|
+
Mn as XpMenu,
|
|
3019
|
+
Vn as XpMenuGroup,
|
|
3020
|
+
An as XpMenuItem,
|
|
3021
|
+
ll as XpPagination,
|
|
3022
|
+
al as XpProgress,
|
|
3023
|
+
cl as XpRadio,
|
|
3024
|
+
gl as XpRate,
|
|
3025
|
+
Ve as XpSelect,
|
|
3026
|
+
Ln as XpSubMenu,
|
|
3027
|
+
yl as XpSwitch,
|
|
3028
|
+
Xl as XpTabPane,
|
|
3029
|
+
Al as XpTable,
|
|
3030
|
+
El as XpTableColumn,
|
|
3031
|
+
Pl as XpTabs,
|
|
3032
|
+
ql as XpTag,
|
|
3033
|
+
Xs as XpThemeCustomizer,
|
|
3034
|
+
Hs as XpToast,
|
|
3035
|
+
qs as XpTooltip,
|
|
3036
|
+
oe as applyThemeConfig,
|
|
3037
|
+
Ee as buildCssString,
|
|
3038
|
+
Yl as buildCssVars,
|
|
3039
|
+
ue as darken,
|
|
3040
|
+
to as default,
|
|
3041
|
+
Ys as deriveDark,
|
|
3042
|
+
Gs as deriveLight,
|
|
3043
|
+
te as getDefaultThemeConfig,
|
|
3044
|
+
ns as initTheme,
|
|
3045
|
+
Js as install,
|
|
3046
|
+
Qs as isDark,
|
|
3047
|
+
de as lighten,
|
|
3048
|
+
je as mix,
|
|
3049
|
+
pe as parseColor,
|
|
3050
|
+
ts as resetThemeConfig,
|
|
3051
|
+
se as setTheme,
|
|
3052
|
+
Gl as toHex,
|
|
3053
|
+
le as toasts,
|
|
3054
|
+
es as toggleTheme,
|
|
3055
|
+
ls as useTheme,
|
|
3056
|
+
eo as useToast,
|
|
3057
|
+
Zs as withAlpha
|
|
2133
3058
|
};
|