@xlui/xux-ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -10
- package/dist/index.css +1 -1
- package/dist/index.js +82 -15
- package/dist/index.mjs +1170 -992
- package/package.json +60 -57
- package/src/components/Accordion/index.vue +2 -0
- package/src/components/Button/index.vue +81 -34
- package/src/components/Tooltips/index.vue +374 -0
- package/src/composables/Alert.ts +238 -0
- package/src/index.ts +3 -0
package/dist/index.mjs
CHANGED
@@ -1,41 +1,41 @@
|
|
1
|
-
import { defineComponent as V, h as
|
2
|
-
const Fe = /^[a-z0-9]+(-[a-z0-9]+)*$/, ce = (e, o, a,
|
3
|
-
const
|
1
|
+
import { defineComponent as V, h as xe, ref as B, computed as L, createElementBlock as v, openBlock as m, normalizeClass as $, createCommentVNode as A, createElementVNode as y, Fragment as z, renderList as D, normalizeStyle as G, createVNode as R, unref as W, renderSlot as K, onMounted as se, toDisplayString as I, withModifiers as q, withCtx as Z, createBlock as fe, nextTick as N, onUnmounted as Ve, readonly as Se, withKeys as O, createTextVNode as be, Transition as pe, withDirectives as Qe, vModelText as Ze, watch as J, Teleport as Je } from "vue";
|
2
|
+
const Fe = /^[a-z0-9]+(-[a-z0-9]+)*$/, ce = (e, o, a, t = "") => {
|
3
|
+
const n = e.split(":");
|
4
4
|
if (e.slice(0, 1) === "@") {
|
5
|
-
if (
|
5
|
+
if (n.length < 2 || n.length > 3)
|
6
6
|
return null;
|
7
|
-
|
7
|
+
t = n.shift().slice(1);
|
8
8
|
}
|
9
|
-
if (
|
9
|
+
if (n.length > 3 || !n.length)
|
10
10
|
return null;
|
11
|
-
if (
|
12
|
-
const
|
11
|
+
if (n.length > 1) {
|
12
|
+
const i = n.pop(), r = n.pop(), c = {
|
13
13
|
// Allow provider without '@': "provider:prefix:name"
|
14
|
-
provider:
|
15
|
-
prefix:
|
16
|
-
name:
|
14
|
+
provider: n.length > 0 ? n[0] : t,
|
15
|
+
prefix: r,
|
16
|
+
name: i
|
17
17
|
};
|
18
|
-
return o && !
|
18
|
+
return o && !ne(c) ? null : c;
|
19
19
|
}
|
20
|
-
const l =
|
20
|
+
const l = n[0], s = l.split("-");
|
21
21
|
if (s.length > 1) {
|
22
|
-
const
|
23
|
-
provider:
|
22
|
+
const i = {
|
23
|
+
provider: t,
|
24
24
|
prefix: s.shift(),
|
25
25
|
name: s.join("-")
|
26
26
|
};
|
27
|
-
return o && !
|
27
|
+
return o && !ne(i) ? null : i;
|
28
28
|
}
|
29
|
-
if (a &&
|
30
|
-
const
|
31
|
-
provider:
|
29
|
+
if (a && t === "") {
|
30
|
+
const i = {
|
31
|
+
provider: t,
|
32
32
|
prefix: "",
|
33
33
|
name: l
|
34
34
|
};
|
35
|
-
return o && !
|
35
|
+
return o && !ne(i, a) ? null : i;
|
36
36
|
}
|
37
37
|
return null;
|
38
|
-
},
|
38
|
+
}, ne = (e, o) => e ? !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
|
39
39
|
// Check name: cannot be empty
|
40
40
|
((o && e.prefix === "" || e.prefix) && e.name) : !1, Oe = Object.freeze(
|
41
41
|
{
|
@@ -56,58 +56,58 @@ const Fe = /^[a-z0-9]+(-[a-z0-9]+)*$/, ce = (e, o, a, n = "") => {
|
|
56
56
|
body: "",
|
57
57
|
hidden: !1
|
58
58
|
});
|
59
|
-
function
|
59
|
+
function et(e, o) {
|
60
60
|
const a = {};
|
61
61
|
!e.hFlip != !o.hFlip && (a.hFlip = !0), !e.vFlip != !o.vFlip && (a.vFlip = !0);
|
62
|
-
const
|
63
|
-
return
|
62
|
+
const t = ((e.rotate || 0) + (o.rotate || 0)) % 4;
|
63
|
+
return t && (a.rotate = t), a;
|
64
64
|
}
|
65
|
-
function
|
66
|
-
const a =
|
67
|
-
for (const
|
68
|
-
|
65
|
+
function Ee(e, o) {
|
66
|
+
const a = et(e, o);
|
67
|
+
for (const t in he)
|
68
|
+
t in le ? t in e && !(t in a) && (a[t] = le[t]) : t in o ? a[t] = o[t] : t in e && (a[t] = e[t]);
|
69
69
|
return a;
|
70
70
|
}
|
71
|
-
function
|
72
|
-
const a = e.icons,
|
71
|
+
function tt(e, o) {
|
72
|
+
const a = e.icons, t = e.aliases || /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null);
|
73
73
|
function l(s) {
|
74
74
|
if (a[s])
|
75
|
-
return
|
76
|
-
if (!(s in
|
77
|
-
|
78
|
-
const
|
79
|
-
|
75
|
+
return n[s] = [];
|
76
|
+
if (!(s in n)) {
|
77
|
+
n[s] = null;
|
78
|
+
const i = t[s] && t[s].parent, r = i && l(i);
|
79
|
+
r && (n[s] = [i].concat(r));
|
80
80
|
}
|
81
|
-
return
|
81
|
+
return n[s];
|
82
82
|
}
|
83
|
-
return Object.keys(a).concat(Object.keys(
|
83
|
+
return Object.keys(a).concat(Object.keys(t)).forEach(l), n;
|
84
84
|
}
|
85
|
-
function
|
86
|
-
const
|
85
|
+
function nt(e, o, a) {
|
86
|
+
const t = e.icons, n = e.aliases || /* @__PURE__ */ Object.create(null);
|
87
87
|
let l = {};
|
88
|
-
function s(
|
89
|
-
l =
|
90
|
-
|
88
|
+
function s(i) {
|
89
|
+
l = Ee(
|
90
|
+
t[i] || n[i],
|
91
91
|
l
|
92
92
|
);
|
93
93
|
}
|
94
|
-
return s(o), a.forEach(s),
|
94
|
+
return s(o), a.forEach(s), Ee(e, l);
|
95
95
|
}
|
96
96
|
function Re(e, o) {
|
97
97
|
const a = [];
|
98
98
|
if (typeof e != "object" || typeof e.icons != "object")
|
99
99
|
return a;
|
100
|
-
e.not_found instanceof Array && e.not_found.forEach((
|
101
|
-
o(
|
100
|
+
e.not_found instanceof Array && e.not_found.forEach((n) => {
|
101
|
+
o(n, null), a.push(n);
|
102
102
|
});
|
103
|
-
const
|
104
|
-
for (const
|
105
|
-
const l = n
|
106
|
-
l && (o(
|
103
|
+
const t = tt(e);
|
104
|
+
for (const n in t) {
|
105
|
+
const l = t[n];
|
106
|
+
l && (o(n, nt(e, n, l)), a.push(n));
|
107
107
|
}
|
108
108
|
return a;
|
109
109
|
}
|
110
|
-
const
|
110
|
+
const ot = {
|
111
111
|
provider: "",
|
112
112
|
aliases: {},
|
113
113
|
not_found: {},
|
@@ -123,14 +123,14 @@ function De(e) {
|
|
123
123
|
if (typeof e != "object" || e === null)
|
124
124
|
return null;
|
125
125
|
const o = e;
|
126
|
-
if (typeof o.prefix != "string" || !e.icons || typeof e.icons != "object" || !de(e,
|
126
|
+
if (typeof o.prefix != "string" || !e.icons || typeof e.icons != "object" || !de(e, ot))
|
127
127
|
return null;
|
128
128
|
const a = o.icons;
|
129
|
-
for (const
|
130
|
-
const l = a[
|
129
|
+
for (const n in a) {
|
130
|
+
const l = a[n];
|
131
131
|
if (
|
132
132
|
// Name cannot be empty
|
133
|
-
!
|
133
|
+
!n || // Must have body
|
134
134
|
typeof l.body != "string" || // Check other props
|
135
135
|
!de(
|
136
136
|
l,
|
@@ -139,13 +139,13 @@ function De(e) {
|
|
139
139
|
)
|
140
140
|
return null;
|
141
141
|
}
|
142
|
-
const
|
143
|
-
for (const
|
144
|
-
const l = n
|
142
|
+
const t = o.aliases || /* @__PURE__ */ Object.create(null);
|
143
|
+
for (const n in t) {
|
144
|
+
const l = t[n], s = l.parent;
|
145
145
|
if (
|
146
146
|
// Name cannot be empty
|
147
|
-
!
|
148
|
-
typeof s != "string" || !a[s] && !
|
147
|
+
!n || // Parent must be set and point to existing icon
|
148
|
+
typeof s != "string" || !a[s] && !t[s] || // Check other props
|
149
149
|
!de(
|
150
150
|
l,
|
151
151
|
he
|
@@ -155,8 +155,8 @@ function De(e) {
|
|
155
155
|
}
|
156
156
|
return o;
|
157
157
|
}
|
158
|
-
const
|
159
|
-
function
|
158
|
+
const ke = /* @__PURE__ */ Object.create(null);
|
159
|
+
function at(e, o) {
|
160
160
|
return {
|
161
161
|
provider: e,
|
162
162
|
prefix: o,
|
@@ -164,16 +164,16 @@ function an(e, o) {
|
|
164
164
|
missing: /* @__PURE__ */ new Set()
|
165
165
|
};
|
166
166
|
}
|
167
|
-
function
|
168
|
-
const a =
|
169
|
-
return a[o] || (a[o] =
|
167
|
+
function U(e, o) {
|
168
|
+
const a = ke[e] || (ke[e] = /* @__PURE__ */ Object.create(null));
|
169
|
+
return a[o] || (a[o] = at(e, o));
|
170
170
|
}
|
171
|
-
function
|
172
|
-
return De(o) ? Re(o, (a,
|
173
|
-
|
171
|
+
function Ne(e, o) {
|
172
|
+
return De(o) ? Re(o, (a, t) => {
|
173
|
+
t ? e.icons[a] = t : e.missing.add(a);
|
174
174
|
}) : [];
|
175
175
|
}
|
176
|
-
function
|
176
|
+
function lt(e, o, a) {
|
177
177
|
try {
|
178
178
|
if (typeof a.body == "string")
|
179
179
|
return e.icons[o] = { ...a }, !0;
|
@@ -182,40 +182,40 @@ function ln(e, o, a) {
|
|
182
182
|
return !1;
|
183
183
|
}
|
184
184
|
let ee = !1;
|
185
|
-
function
|
185
|
+
function _e(e) {
|
186
186
|
return typeof e == "boolean" && (ee = e), ee;
|
187
187
|
}
|
188
|
-
function
|
188
|
+
function st(e) {
|
189
189
|
const o = typeof e == "string" ? ce(e, !0, ee) : e;
|
190
190
|
if (o) {
|
191
|
-
const a =
|
192
|
-
return a.icons[
|
191
|
+
const a = U(o.provider, o.prefix), t = o.name;
|
192
|
+
return a.icons[t] || (a.missing.has(t) ? null : void 0);
|
193
193
|
}
|
194
194
|
}
|
195
|
-
function
|
195
|
+
function ct(e, o) {
|
196
196
|
const a = ce(e, !0, ee);
|
197
197
|
if (!a)
|
198
198
|
return !1;
|
199
|
-
const
|
200
|
-
return o ?
|
199
|
+
const t = U(a.provider, a.prefix);
|
200
|
+
return o ? lt(t, a.name, o) : (t.missing.add(a.name), !0);
|
201
201
|
}
|
202
|
-
function
|
202
|
+
function gt(e, o) {
|
203
203
|
if (typeof e != "object")
|
204
204
|
return !1;
|
205
205
|
if (typeof o != "string" && (o = e.provider || ""), ee && !o && !e.prefix) {
|
206
|
-
let
|
206
|
+
let n = !1;
|
207
207
|
return De(e) && (e.prefix = "", Re(e, (l, s) => {
|
208
|
-
|
209
|
-
})),
|
208
|
+
ct(l, s) && (n = !0);
|
209
|
+
})), n;
|
210
210
|
}
|
211
211
|
const a = e.prefix;
|
212
|
-
if (!
|
212
|
+
if (!ne({
|
213
213
|
prefix: a,
|
214
214
|
name: "a"
|
215
215
|
}))
|
216
216
|
return !1;
|
217
|
-
const
|
218
|
-
return !!
|
217
|
+
const t = U(o, a);
|
218
|
+
return !!Ne(t, e);
|
219
219
|
}
|
220
220
|
const Ge = Object.freeze({
|
221
221
|
width: null,
|
@@ -225,7 +225,7 @@ const Ge = Object.freeze({
|
|
225
225
|
...Ge,
|
226
226
|
// Transformations
|
227
227
|
...le
|
228
|
-
}),
|
228
|
+
}), it = /(-?[0-9.]*[0-9]+[0-9.]*)/g, dt = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
229
229
|
function Pe(e, o, a) {
|
230
230
|
if (o === 1)
|
231
231
|
return e;
|
@@ -233,135 +233,135 @@ function Pe(e, o, a) {
|
|
233
233
|
return Math.ceil(e * o * a) / a;
|
234
234
|
if (typeof e != "string")
|
235
235
|
return e;
|
236
|
-
const
|
237
|
-
if (
|
236
|
+
const t = e.split(it);
|
237
|
+
if (t === null || !t.length)
|
238
238
|
return e;
|
239
|
-
const
|
240
|
-
let l =
|
239
|
+
const n = [];
|
240
|
+
let l = t.shift(), s = dt.test(l);
|
241
241
|
for (; ; ) {
|
242
242
|
if (s) {
|
243
|
-
const
|
244
|
-
isNaN(
|
243
|
+
const i = parseFloat(l);
|
244
|
+
isNaN(i) ? n.push(l) : n.push(Math.ceil(i * o * a) / a);
|
245
245
|
} else
|
246
|
-
|
247
|
-
if (l =
|
248
|
-
return
|
246
|
+
n.push(l);
|
247
|
+
if (l = t.shift(), l === void 0)
|
248
|
+
return n.join("");
|
249
249
|
s = !s;
|
250
250
|
}
|
251
251
|
}
|
252
|
-
function
|
252
|
+
function rt(e, o = "defs") {
|
253
253
|
let a = "";
|
254
|
-
const
|
255
|
-
for (;
|
256
|
-
const
|
257
|
-
if (
|
254
|
+
const t = e.indexOf("<" + o);
|
255
|
+
for (; t >= 0; ) {
|
256
|
+
const n = e.indexOf(">", t), l = e.indexOf("</" + o);
|
257
|
+
if (n === -1 || l === -1)
|
258
258
|
break;
|
259
259
|
const s = e.indexOf(">", l);
|
260
260
|
if (s === -1)
|
261
261
|
break;
|
262
|
-
a += e.slice(
|
262
|
+
a += e.slice(n + 1, l).trim(), e = e.slice(0, t).trim() + e.slice(s + 1);
|
263
263
|
}
|
264
264
|
return {
|
265
265
|
defs: a,
|
266
266
|
content: e
|
267
267
|
};
|
268
268
|
}
|
269
|
-
function
|
269
|
+
function ft(e, o) {
|
270
270
|
return e ? "<defs>" + e + "</defs>" + o : o;
|
271
271
|
}
|
272
|
-
function
|
273
|
-
const
|
274
|
-
return
|
272
|
+
function pt(e, o, a) {
|
273
|
+
const t = rt(e);
|
274
|
+
return ft(t.defs, o + t.content + a);
|
275
275
|
}
|
276
|
-
const
|
277
|
-
function
|
276
|
+
const ht = (e) => e === "unset" || e === "undefined" || e === "none";
|
277
|
+
function mt(e, o) {
|
278
278
|
const a = {
|
279
279
|
...ge,
|
280
280
|
...e
|
281
|
-
},
|
281
|
+
}, t = {
|
282
282
|
...We,
|
283
283
|
...o
|
284
|
-
},
|
284
|
+
}, n = {
|
285
285
|
left: a.left,
|
286
286
|
top: a.top,
|
287
287
|
width: a.width,
|
288
288
|
height: a.height
|
289
289
|
};
|
290
290
|
let l = a.body;
|
291
|
-
[a,
|
292
|
-
const
|
293
|
-
let C =
|
294
|
-
|
295
|
-
"translate(" + (
|
296
|
-
),
|
297
|
-
"translate(" + (0 -
|
298
|
-
),
|
291
|
+
[a, t].forEach((p) => {
|
292
|
+
const g = [], x = p.hFlip, E = p.vFlip;
|
293
|
+
let C = p.rotate;
|
294
|
+
x ? E ? C += 2 : (g.push(
|
295
|
+
"translate(" + (n.width + n.left).toString() + " " + (0 - n.top).toString() + ")"
|
296
|
+
), g.push("scale(-1 1)"), n.top = n.left = 0) : E && (g.push(
|
297
|
+
"translate(" + (0 - n.left).toString() + " " + (n.height + n.top).toString() + ")"
|
298
|
+
), g.push("scale(1 -1)"), n.top = n.left = 0);
|
299
299
|
let w;
|
300
300
|
switch (C < 0 && (C -= Math.floor(C / 4) * 4), C = C % 4, C) {
|
301
301
|
case 1:
|
302
|
-
w =
|
302
|
+
w = n.height / 2 + n.top, g.unshift(
|
303
303
|
"rotate(90 " + w.toString() + " " + w.toString() + ")"
|
304
304
|
);
|
305
305
|
break;
|
306
306
|
case 2:
|
307
|
-
|
308
|
-
"rotate(180 " + (
|
307
|
+
g.unshift(
|
308
|
+
"rotate(180 " + (n.width / 2 + n.left).toString() + " " + (n.height / 2 + n.top).toString() + ")"
|
309
309
|
);
|
310
310
|
break;
|
311
311
|
case 3:
|
312
|
-
w =
|
312
|
+
w = n.width / 2 + n.left, g.unshift(
|
313
313
|
"rotate(-90 " + w.toString() + " " + w.toString() + ")"
|
314
314
|
);
|
315
315
|
break;
|
316
316
|
}
|
317
|
-
C % 2 === 1 && (
|
317
|
+
C % 2 === 1 && (n.left !== n.top && (w = n.left, n.left = n.top, n.top = w), n.width !== n.height && (w = n.width, n.width = n.height, n.height = w)), g.length && (l = pt(
|
318
318
|
l,
|
319
|
-
'<g transform="' +
|
319
|
+
'<g transform="' + g.join(" ") + '">',
|
320
320
|
"</g>"
|
321
321
|
));
|
322
322
|
});
|
323
|
-
const s =
|
324
|
-
let
|
325
|
-
s === null ? (
|
326
|
-
const b = {}, d = (
|
327
|
-
|
323
|
+
const s = t.width, i = t.height, r = n.width, c = n.height;
|
324
|
+
let f, h;
|
325
|
+
s === null ? (h = i === null ? "1em" : i === "auto" ? c : i, f = Pe(h, r / c)) : (f = s === "auto" ? r : s, h = i === null ? Pe(f, c / r) : i === "auto" ? c : i);
|
326
|
+
const b = {}, d = (p, g) => {
|
327
|
+
ht(g) || (b[p] = g.toString());
|
328
328
|
};
|
329
|
-
d("width",
|
330
|
-
const
|
331
|
-
return b.viewBox =
|
329
|
+
d("width", f), d("height", h);
|
330
|
+
const k = [n.left, n.top, r, c];
|
331
|
+
return b.viewBox = k.join(" "), {
|
332
332
|
attributes: b,
|
333
|
-
viewBox:
|
333
|
+
viewBox: k,
|
334
334
|
body: l
|
335
335
|
};
|
336
336
|
}
|
337
|
-
const
|
338
|
-
let
|
339
|
-
function
|
337
|
+
const ut = /\sid="(\S+)"/g, vt = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
338
|
+
let bt = 0;
|
339
|
+
function wt(e, o = vt) {
|
340
340
|
const a = [];
|
341
|
-
let
|
342
|
-
for (;
|
343
|
-
a.push(
|
341
|
+
let t;
|
342
|
+
for (; t = ut.exec(e); )
|
343
|
+
a.push(t[1]);
|
344
344
|
if (!a.length)
|
345
345
|
return e;
|
346
|
-
const
|
346
|
+
const n = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
347
347
|
return a.forEach((l) => {
|
348
|
-
const s = typeof o == "function" ? o(l) : o + (
|
348
|
+
const s = typeof o == "function" ? o(l) : o + (bt++).toString(), i = l.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
349
349
|
e = e.replace(
|
350
350
|
// Allowed characters before id: [#;"]
|
351
351
|
// Allowed characters after id: [)"], .[a-z]
|
352
|
-
new RegExp('([#;"])(' +
|
353
|
-
"$1" + s +
|
352
|
+
new RegExp('([#;"])(' + i + ')([")]|\\.[a-z])', "g"),
|
353
|
+
"$1" + s + n + "$3"
|
354
354
|
);
|
355
|
-
}), e = e.replace(new RegExp(
|
355
|
+
}), e = e.replace(new RegExp(n, "g"), ""), e;
|
356
356
|
}
|
357
357
|
const me = /* @__PURE__ */ Object.create(null);
|
358
|
-
function
|
358
|
+
function yt(e, o) {
|
359
359
|
me[e] = o;
|
360
360
|
}
|
361
361
|
function ue(e) {
|
362
362
|
return me[e] || me[""];
|
363
363
|
}
|
364
|
-
function
|
364
|
+
function we(e) {
|
365
365
|
let o;
|
366
366
|
if (typeof e.resources == "string")
|
367
367
|
o = [e.resources];
|
@@ -386,23 +386,23 @@ function be(e) {
|
|
386
386
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
387
387
|
};
|
388
388
|
}
|
389
|
-
const
|
389
|
+
const ye = /* @__PURE__ */ Object.create(null), Y = [
|
390
390
|
"https://api.simplesvg.com",
|
391
391
|
"https://api.unisvg.com"
|
392
392
|
], oe = [];
|
393
|
-
for (;
|
394
|
-
|
395
|
-
|
393
|
+
for (; Y.length > 0; )
|
394
|
+
Y.length === 1 || Math.random() > 0.5 ? oe.push(Y.shift()) : oe.push(Y.pop());
|
395
|
+
ye[""] = we({
|
396
396
|
resources: ["https://api.iconify.design"].concat(oe)
|
397
397
|
});
|
398
|
-
function
|
399
|
-
const a =
|
400
|
-
return a === null ? !1 : (
|
398
|
+
function Ct(e, o) {
|
399
|
+
const a = we(o);
|
400
|
+
return a === null ? !1 : (ye[e] = a, !0);
|
401
401
|
}
|
402
|
-
function
|
403
|
-
return
|
402
|
+
function Ce(e) {
|
403
|
+
return ye[e];
|
404
404
|
}
|
405
|
-
const
|
405
|
+
const xt = () => {
|
406
406
|
let e;
|
407
407
|
try {
|
408
408
|
if (e = fetch, typeof e == "function")
|
@@ -410,89 +410,89 @@ const xn = () => {
|
|
410
410
|
} catch {
|
411
411
|
}
|
412
412
|
};
|
413
|
-
let je =
|
414
|
-
function
|
415
|
-
const a =
|
413
|
+
let je = xt();
|
414
|
+
function St(e, o) {
|
415
|
+
const a = Ce(e);
|
416
416
|
if (!a)
|
417
417
|
return 0;
|
418
|
-
let
|
418
|
+
let t;
|
419
419
|
if (!a.maxURL)
|
420
|
-
|
420
|
+
t = 0;
|
421
421
|
else {
|
422
|
-
let
|
422
|
+
let n = 0;
|
423
423
|
a.resources.forEach((s) => {
|
424
|
-
|
424
|
+
n = Math.max(n, s.length);
|
425
425
|
});
|
426
426
|
const l = o + ".json?icons=";
|
427
|
-
|
427
|
+
t = a.maxURL - n - a.path.length - l.length;
|
428
428
|
}
|
429
|
-
return
|
429
|
+
return t;
|
430
430
|
}
|
431
|
-
function
|
431
|
+
function Et(e) {
|
432
432
|
return e === 404;
|
433
433
|
}
|
434
|
-
const
|
435
|
-
const
|
434
|
+
const kt = (e, o, a) => {
|
435
|
+
const t = [], n = St(e, o), l = "icons";
|
436
436
|
let s = {
|
437
437
|
type: l,
|
438
438
|
provider: e,
|
439
439
|
prefix: o,
|
440
440
|
icons: []
|
441
|
-
},
|
442
|
-
return a.forEach((
|
443
|
-
|
441
|
+
}, i = 0;
|
442
|
+
return a.forEach((r, c) => {
|
443
|
+
i += r.length + 1, i >= n && c > 0 && (t.push(s), s = {
|
444
444
|
type: l,
|
445
445
|
provider: e,
|
446
446
|
prefix: o,
|
447
447
|
icons: []
|
448
|
-
},
|
449
|
-
}),
|
448
|
+
}, i = r.length), s.icons.push(r);
|
449
|
+
}), t.push(s), t;
|
450
450
|
};
|
451
|
-
function
|
451
|
+
function Pt(e) {
|
452
452
|
if (typeof e == "string") {
|
453
|
-
const o =
|
453
|
+
const o = Ce(e);
|
454
454
|
if (o)
|
455
455
|
return o.path;
|
456
456
|
}
|
457
457
|
return "/";
|
458
458
|
}
|
459
|
-
const
|
459
|
+
const jt = (e, o, a) => {
|
460
460
|
if (!je) {
|
461
461
|
a("abort", 424);
|
462
462
|
return;
|
463
463
|
}
|
464
|
-
let
|
464
|
+
let t = Pt(o.provider);
|
465
465
|
switch (o.type) {
|
466
466
|
case "icons": {
|
467
|
-
const l = o.prefix,
|
468
|
-
icons:
|
467
|
+
const l = o.prefix, i = o.icons.join(","), r = new URLSearchParams({
|
468
|
+
icons: i
|
469
469
|
});
|
470
|
-
|
470
|
+
t += l + ".json?" + r.toString();
|
471
471
|
break;
|
472
472
|
}
|
473
473
|
case "custom": {
|
474
474
|
const l = o.uri;
|
475
|
-
|
475
|
+
t += l.slice(0, 1) === "/" ? l.slice(1) : l;
|
476
476
|
break;
|
477
477
|
}
|
478
478
|
default:
|
479
479
|
a("abort", 400);
|
480
480
|
return;
|
481
481
|
}
|
482
|
-
let
|
483
|
-
je(e +
|
482
|
+
let n = 503;
|
483
|
+
je(e + t).then((l) => {
|
484
484
|
const s = l.status;
|
485
485
|
if (s !== 200) {
|
486
486
|
setTimeout(() => {
|
487
|
-
a(
|
487
|
+
a(Et(s) ? "abort" : "next", s);
|
488
488
|
});
|
489
489
|
return;
|
490
490
|
}
|
491
|
-
return
|
491
|
+
return n = 501, l.json();
|
492
492
|
}).then((l) => {
|
493
493
|
if (typeof l != "object" || l === null) {
|
494
494
|
setTimeout(() => {
|
495
|
-
l === 404 ? a("abort", l) : a("next",
|
495
|
+
l === 404 ? a("abort", l) : a("next", n);
|
496
496
|
});
|
497
497
|
return;
|
498
498
|
}
|
@@ -500,75 +500,75 @@ const Mn = (e, o, a) => {
|
|
500
500
|
a("success", l);
|
501
501
|
});
|
502
502
|
}).catch(() => {
|
503
|
-
a("next",
|
503
|
+
a("next", n);
|
504
504
|
});
|
505
|
-
},
|
506
|
-
prepare:
|
507
|
-
send:
|
505
|
+
}, Mt = {
|
506
|
+
prepare: kt,
|
507
|
+
send: jt
|
508
508
|
};
|
509
|
-
function
|
509
|
+
function At(e) {
|
510
510
|
const o = {
|
511
511
|
loaded: [],
|
512
512
|
missing: [],
|
513
513
|
pending: []
|
514
514
|
}, a = /* @__PURE__ */ Object.create(null);
|
515
|
-
e.sort((
|
516
|
-
let
|
515
|
+
e.sort((n, l) => n.provider !== l.provider ? n.provider.localeCompare(l.provider) : n.prefix !== l.prefix ? n.prefix.localeCompare(l.prefix) : n.name.localeCompare(l.name));
|
516
|
+
let t = {
|
517
517
|
provider: "",
|
518
518
|
prefix: "",
|
519
519
|
name: ""
|
520
520
|
};
|
521
|
-
return e.forEach((
|
522
|
-
if (
|
521
|
+
return e.forEach((n) => {
|
522
|
+
if (t.name === n.name && t.prefix === n.prefix && t.provider === n.provider)
|
523
523
|
return;
|
524
|
-
|
525
|
-
const l =
|
526
|
-
let
|
527
|
-
|
528
|
-
const
|
524
|
+
t = n;
|
525
|
+
const l = n.provider, s = n.prefix, i = n.name, r = a[l] || (a[l] = /* @__PURE__ */ Object.create(null)), c = r[s] || (r[s] = U(l, s));
|
526
|
+
let f;
|
527
|
+
i in c.icons ? f = o.loaded : s === "" || c.missing.has(i) ? f = o.missing : f = o.pending;
|
528
|
+
const h = {
|
529
529
|
provider: l,
|
530
530
|
prefix: s,
|
531
|
-
name:
|
531
|
+
name: i
|
532
532
|
};
|
533
|
-
|
533
|
+
f.push(h);
|
534
534
|
}), o;
|
535
535
|
}
|
536
536
|
function Ke(e, o) {
|
537
537
|
e.forEach((a) => {
|
538
|
-
const
|
539
|
-
|
538
|
+
const t = a.loaderCallbacks;
|
539
|
+
t && (a.loaderCallbacks = t.filter((n) => n.id !== o));
|
540
540
|
});
|
541
541
|
}
|
542
|
-
function
|
542
|
+
function It(e) {
|
543
543
|
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
544
544
|
e.pendingCallbacksFlag = !1;
|
545
545
|
const o = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
546
546
|
if (!o.length)
|
547
547
|
return;
|
548
548
|
let a = !1;
|
549
|
-
const
|
549
|
+
const t = e.provider, n = e.prefix;
|
550
550
|
o.forEach((l) => {
|
551
|
-
const s = l.icons,
|
552
|
-
s.pending = s.pending.filter((
|
553
|
-
if (
|
551
|
+
const s = l.icons, i = s.pending.length;
|
552
|
+
s.pending = s.pending.filter((r) => {
|
553
|
+
if (r.prefix !== n)
|
554
554
|
return !0;
|
555
|
-
const c =
|
555
|
+
const c = r.name;
|
556
556
|
if (e.icons[c])
|
557
557
|
s.loaded.push({
|
558
|
-
provider:
|
559
|
-
prefix:
|
558
|
+
provider: t,
|
559
|
+
prefix: n,
|
560
560
|
name: c
|
561
561
|
});
|
562
562
|
else if (e.missing.has(c))
|
563
563
|
s.missing.push({
|
564
|
-
provider:
|
565
|
-
prefix:
|
564
|
+
provider: t,
|
565
|
+
prefix: n,
|
566
566
|
name: c
|
567
567
|
});
|
568
568
|
else
|
569
569
|
return a = !0, !0;
|
570
570
|
return !1;
|
571
|
-
}), s.pending.length !==
|
571
|
+
}), s.pending.length !== i && (a || Ke([e], l.id), l.callback(
|
572
572
|
s.loaded.slice(0),
|
573
573
|
s.missing.slice(0),
|
574
574
|
s.pending.slice(0),
|
@@ -577,29 +577,29 @@ function $n(e) {
|
|
577
577
|
});
|
578
578
|
}));
|
579
579
|
}
|
580
|
-
let
|
581
|
-
function
|
582
|
-
const
|
580
|
+
let $t = 0;
|
581
|
+
function Tt(e, o, a) {
|
582
|
+
const t = $t++, n = Ke.bind(null, a, t);
|
583
583
|
if (!o.pending.length)
|
584
|
-
return
|
584
|
+
return n;
|
585
585
|
const l = {
|
586
|
-
id:
|
586
|
+
id: t,
|
587
587
|
icons: o,
|
588
588
|
callback: e,
|
589
|
-
abort:
|
589
|
+
abort: n
|
590
590
|
};
|
591
591
|
return a.forEach((s) => {
|
592
592
|
(s.loaderCallbacks || (s.loaderCallbacks = [])).push(l);
|
593
|
-
}), t;
|
594
|
-
}
|
595
|
-
function Xn(e, o = !0, a = !1) {
|
596
|
-
const n = [];
|
597
|
-
return e.forEach((t) => {
|
598
|
-
const l = typeof t == "string" ? ce(t, o, a) : t;
|
599
|
-
l && n.push(l);
|
600
593
|
}), n;
|
601
594
|
}
|
602
|
-
|
595
|
+
function Bt(e, o = !0, a = !1) {
|
596
|
+
const t = [];
|
597
|
+
return e.forEach((n) => {
|
598
|
+
const l = typeof n == "string" ? ce(n, o, a) : n;
|
599
|
+
l && t.push(l);
|
600
|
+
}), t;
|
601
|
+
}
|
602
|
+
var Lt = {
|
603
603
|
resources: [],
|
604
604
|
index: 0,
|
605
605
|
timeout: 2e3,
|
@@ -607,307 +607,307 @@ var Ln = {
|
|
607
607
|
random: !1,
|
608
608
|
dataAfterTimeout: !1
|
609
609
|
};
|
610
|
-
function
|
611
|
-
const
|
610
|
+
function Xt(e, o, a, t) {
|
611
|
+
const n = e.resources.length, l = e.random ? Math.floor(Math.random() * n) : e.index;
|
612
612
|
let s;
|
613
613
|
if (e.random) {
|
614
|
-
let
|
615
|
-
for (s = [];
|
616
|
-
const
|
617
|
-
s.push(
|
614
|
+
let j = e.resources.slice(0);
|
615
|
+
for (s = []; j.length > 1; ) {
|
616
|
+
const X = Math.floor(Math.random() * j.length);
|
617
|
+
s.push(j[X]), j = j.slice(0, X).concat(j.slice(X + 1));
|
618
618
|
}
|
619
|
-
s = s.concat(
|
619
|
+
s = s.concat(j);
|
620
620
|
} else
|
621
621
|
s = e.resources.slice(l).concat(e.resources.slice(0, l));
|
622
|
-
const
|
623
|
-
let
|
624
|
-
typeof
|
625
|
-
function
|
626
|
-
|
622
|
+
const i = Date.now();
|
623
|
+
let r = "pending", c = 0, f, h = null, b = [], d = [];
|
624
|
+
typeof t == "function" && d.push(t);
|
625
|
+
function k() {
|
626
|
+
h && (clearTimeout(h), h = null);
|
627
627
|
}
|
628
|
-
function
|
629
|
-
|
630
|
-
|
628
|
+
function p() {
|
629
|
+
r === "pending" && (r = "aborted"), k(), b.forEach((j) => {
|
630
|
+
j.status === "pending" && (j.status = "aborted");
|
631
631
|
}), b = [];
|
632
632
|
}
|
633
|
-
function
|
634
|
-
|
633
|
+
function g(j, X) {
|
634
|
+
X && (d = []), typeof j == "function" && d.push(j);
|
635
635
|
}
|
636
|
-
function
|
636
|
+
function x() {
|
637
637
|
return {
|
638
|
-
startTime:
|
638
|
+
startTime: i,
|
639
639
|
payload: o,
|
640
|
-
status:
|
640
|
+
status: r,
|
641
641
|
queriesSent: c,
|
642
642
|
queriesPending: b.length,
|
643
|
-
subscribe:
|
644
|
-
abort:
|
643
|
+
subscribe: g,
|
644
|
+
abort: p
|
645
645
|
};
|
646
646
|
}
|
647
|
-
function
|
648
|
-
|
649
|
-
|
647
|
+
function E() {
|
648
|
+
r = "failed", d.forEach((j) => {
|
649
|
+
j(void 0, f);
|
650
650
|
});
|
651
651
|
}
|
652
652
|
function C() {
|
653
|
-
b.forEach((
|
654
|
-
|
653
|
+
b.forEach((j) => {
|
654
|
+
j.status === "pending" && (j.status = "aborted");
|
655
655
|
}), b = [];
|
656
656
|
}
|
657
|
-
function w(
|
658
|
-
const
|
659
|
-
switch (b = b.filter((
|
657
|
+
function w(j, X, u) {
|
658
|
+
const P = X !== "success";
|
659
|
+
switch (b = b.filter((S) => S !== j), r) {
|
660
660
|
case "pending":
|
661
661
|
break;
|
662
662
|
case "failed":
|
663
|
-
if (
|
663
|
+
if (P || !e.dataAfterTimeout)
|
664
664
|
return;
|
665
665
|
break;
|
666
666
|
default:
|
667
667
|
return;
|
668
668
|
}
|
669
|
-
if (
|
670
|
-
|
669
|
+
if (X === "abort") {
|
670
|
+
f = u, E();
|
671
671
|
return;
|
672
672
|
}
|
673
|
-
if (
|
674
|
-
|
673
|
+
if (P) {
|
674
|
+
f = u, b.length || (s.length ? T() : E());
|
675
675
|
return;
|
676
676
|
}
|
677
|
-
if (
|
678
|
-
const
|
679
|
-
|
677
|
+
if (k(), C(), !e.random) {
|
678
|
+
const S = e.resources.indexOf(j.resource);
|
679
|
+
S !== -1 && S !== e.index && (e.index = S);
|
680
680
|
}
|
681
|
-
|
682
|
-
|
681
|
+
r = "completed", d.forEach((S) => {
|
682
|
+
S(u);
|
683
683
|
});
|
684
684
|
}
|
685
|
-
function
|
686
|
-
if (
|
685
|
+
function T() {
|
686
|
+
if (r !== "pending")
|
687
687
|
return;
|
688
|
-
|
689
|
-
const
|
690
|
-
if (
|
688
|
+
k();
|
689
|
+
const j = s.shift();
|
690
|
+
if (j === void 0) {
|
691
691
|
if (b.length) {
|
692
|
-
|
693
|
-
|
692
|
+
h = setTimeout(() => {
|
693
|
+
k(), r === "pending" && (C(), E());
|
694
694
|
}, e.timeout);
|
695
695
|
return;
|
696
696
|
}
|
697
|
-
|
697
|
+
E();
|
698
698
|
return;
|
699
699
|
}
|
700
|
-
const
|
700
|
+
const X = {
|
701
701
|
status: "pending",
|
702
|
-
resource:
|
703
|
-
callback: (
|
704
|
-
w(
|
702
|
+
resource: j,
|
703
|
+
callback: (u, P) => {
|
704
|
+
w(X, u, P);
|
705
705
|
}
|
706
706
|
};
|
707
|
-
b.push(
|
707
|
+
b.push(X), c++, h = setTimeout(T, e.rotate), a(j, o, X.callback);
|
708
708
|
}
|
709
|
-
return setTimeout(
|
709
|
+
return setTimeout(T), x;
|
710
710
|
}
|
711
711
|
function He(e) {
|
712
712
|
const o = {
|
713
|
-
...
|
713
|
+
...Lt,
|
714
714
|
...e
|
715
715
|
};
|
716
716
|
let a = [];
|
717
|
-
function
|
718
|
-
a = a.filter((
|
717
|
+
function t() {
|
718
|
+
a = a.filter((i) => i().status === "pending");
|
719
719
|
}
|
720
|
-
function
|
721
|
-
const
|
720
|
+
function n(i, r, c) {
|
721
|
+
const f = Xt(
|
722
722
|
o,
|
723
|
-
|
724
|
-
|
725
|
-
(
|
726
|
-
|
723
|
+
i,
|
724
|
+
r,
|
725
|
+
(h, b) => {
|
726
|
+
t(), c && c(h, b);
|
727
727
|
}
|
728
728
|
);
|
729
|
-
return a.push(
|
729
|
+
return a.push(f), f;
|
730
730
|
}
|
731
|
-
function l(
|
732
|
-
return a.find((
|
731
|
+
function l(i) {
|
732
|
+
return a.find((r) => i(r)) || null;
|
733
733
|
}
|
734
734
|
return {
|
735
|
-
query:
|
735
|
+
query: n,
|
736
736
|
find: l,
|
737
|
-
setIndex: (
|
738
|
-
o.index =
|
737
|
+
setIndex: (i) => {
|
738
|
+
o.index = i;
|
739
739
|
},
|
740
740
|
getIndex: () => o.index,
|
741
|
-
cleanup:
|
741
|
+
cleanup: t
|
742
742
|
};
|
743
743
|
}
|
744
|
-
function
|
744
|
+
function Me() {
|
745
745
|
}
|
746
|
-
const
|
747
|
-
function
|
748
|
-
if (!
|
749
|
-
const o =
|
746
|
+
const re = /* @__PURE__ */ Object.create(null);
|
747
|
+
function zt(e) {
|
748
|
+
if (!re[e]) {
|
749
|
+
const o = Ce(e);
|
750
750
|
if (!o)
|
751
751
|
return;
|
752
|
-
const a = He(o),
|
752
|
+
const a = He(o), t = {
|
753
753
|
config: o,
|
754
754
|
redundancy: a
|
755
755
|
};
|
756
|
-
|
756
|
+
re[e] = t;
|
757
757
|
}
|
758
|
-
return
|
758
|
+
return re[e];
|
759
759
|
}
|
760
|
-
function
|
761
|
-
let
|
760
|
+
function Vt(e, o, a) {
|
761
|
+
let t, n;
|
762
762
|
if (typeof e == "string") {
|
763
763
|
const l = ue(e);
|
764
764
|
if (!l)
|
765
|
-
return a(void 0, 424),
|
766
|
-
|
767
|
-
const s =
|
768
|
-
s && (
|
765
|
+
return a(void 0, 424), Me;
|
766
|
+
n = l.send;
|
767
|
+
const s = zt(e);
|
768
|
+
s && (t = s.redundancy);
|
769
769
|
} else {
|
770
|
-
const l =
|
770
|
+
const l = we(e);
|
771
771
|
if (l) {
|
772
|
-
|
773
|
-
const s = e.resources ? e.resources[0] : "",
|
774
|
-
|
772
|
+
t = He(l);
|
773
|
+
const s = e.resources ? e.resources[0] : "", i = ue(s);
|
774
|
+
i && (n = i.send);
|
775
775
|
}
|
776
776
|
}
|
777
|
-
return !
|
777
|
+
return !t || !n ? (a(void 0, 424), Me) : t.query(o, n, a)().abort;
|
778
778
|
}
|
779
|
-
function
|
779
|
+
function Ae() {
|
780
780
|
}
|
781
|
-
function
|
781
|
+
function Ft(e) {
|
782
782
|
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
783
|
-
e.iconsLoaderFlag = !1,
|
783
|
+
e.iconsLoaderFlag = !1, It(e);
|
784
784
|
}));
|
785
785
|
}
|
786
|
-
function
|
786
|
+
function Ot(e) {
|
787
787
|
const o = [], a = [];
|
788
|
-
return e.forEach((
|
789
|
-
(
|
788
|
+
return e.forEach((t) => {
|
789
|
+
(t.match(Fe) ? o : a).push(t);
|
790
790
|
}), {
|
791
791
|
valid: o,
|
792
792
|
invalid: a
|
793
793
|
};
|
794
794
|
}
|
795
|
-
function
|
796
|
-
function
|
797
|
-
const
|
795
|
+
function Q(e, o, a) {
|
796
|
+
function t() {
|
797
|
+
const n = e.pendingIcons;
|
798
798
|
o.forEach((l) => {
|
799
|
-
|
799
|
+
n && n.delete(l), e.icons[l] || e.missing.add(l);
|
800
800
|
});
|
801
801
|
}
|
802
802
|
if (a && typeof a == "object")
|
803
803
|
try {
|
804
|
-
if (!
|
805
|
-
|
804
|
+
if (!Ne(e, a).length) {
|
805
|
+
t();
|
806
806
|
return;
|
807
807
|
}
|
808
|
-
} catch (
|
809
|
-
console.error(
|
808
|
+
} catch (n) {
|
809
|
+
console.error(n);
|
810
810
|
}
|
811
|
-
|
811
|
+
t(), Ft(e);
|
812
812
|
}
|
813
|
-
function
|
813
|
+
function Ie(e, o) {
|
814
814
|
e instanceof Promise ? e.then((a) => {
|
815
815
|
o(a);
|
816
816
|
}).catch(() => {
|
817
817
|
o(null);
|
818
818
|
}) : o(e);
|
819
819
|
}
|
820
|
-
function
|
820
|
+
function Rt(e, o) {
|
821
821
|
e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(o).sort() : e.iconsToLoad = o, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
822
822
|
e.iconsQueueFlag = !1;
|
823
|
-
const { provider: a, prefix:
|
824
|
-
if (delete e.iconsToLoad, !
|
823
|
+
const { provider: a, prefix: t } = e, n = e.iconsToLoad;
|
824
|
+
if (delete e.iconsToLoad, !n || !n.length)
|
825
825
|
return;
|
826
826
|
const l = e.loadIcon;
|
827
|
-
if (e.loadIcons && (
|
828
|
-
|
829
|
-
e.loadIcons(
|
830
|
-
(
|
831
|
-
|
827
|
+
if (e.loadIcons && (n.length > 1 || !l)) {
|
828
|
+
Ie(
|
829
|
+
e.loadIcons(n, t, a),
|
830
|
+
(f) => {
|
831
|
+
Q(e, n, f);
|
832
832
|
}
|
833
833
|
);
|
834
834
|
return;
|
835
835
|
}
|
836
836
|
if (l) {
|
837
|
-
|
838
|
-
const
|
839
|
-
|
837
|
+
n.forEach((f) => {
|
838
|
+
const h = l(f, t, a);
|
839
|
+
Ie(h, (b) => {
|
840
840
|
const d = b ? {
|
841
|
-
prefix:
|
841
|
+
prefix: t,
|
842
842
|
icons: {
|
843
|
-
[
|
843
|
+
[f]: b
|
844
844
|
}
|
845
845
|
} : null;
|
846
|
-
|
846
|
+
Q(e, [f], d);
|
847
847
|
});
|
848
848
|
});
|
849
849
|
return;
|
850
850
|
}
|
851
|
-
const { valid: s, invalid:
|
852
|
-
if (
|
851
|
+
const { valid: s, invalid: i } = Ot(n);
|
852
|
+
if (i.length && Q(e, i, null), !s.length)
|
853
853
|
return;
|
854
|
-
const
|
855
|
-
if (!
|
856
|
-
|
854
|
+
const r = t.match(Fe) ? ue(a) : null;
|
855
|
+
if (!r) {
|
856
|
+
Q(e, s, null);
|
857
857
|
return;
|
858
858
|
}
|
859
|
-
|
860
|
-
|
861
|
-
|
859
|
+
r.prepare(a, t, s).forEach((f) => {
|
860
|
+
Vt(a, f, (h) => {
|
861
|
+
Q(e, f.icons, h);
|
862
862
|
});
|
863
863
|
});
|
864
864
|
}));
|
865
865
|
}
|
866
|
-
const
|
867
|
-
const a =
|
868
|
-
if (!
|
869
|
-
let
|
866
|
+
const Dt = (e, o) => {
|
867
|
+
const a = Bt(e, !0, _e()), t = At(a);
|
868
|
+
if (!t.pending.length) {
|
869
|
+
let r = !0;
|
870
870
|
return o && setTimeout(() => {
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
871
|
+
r && o(
|
872
|
+
t.loaded,
|
873
|
+
t.missing,
|
874
|
+
t.pending,
|
875
|
+
Ae
|
876
876
|
);
|
877
877
|
}), () => {
|
878
|
-
|
878
|
+
r = !1;
|
879
879
|
};
|
880
880
|
}
|
881
|
-
const
|
882
|
-
let s,
|
883
|
-
return
|
884
|
-
const { provider: c, prefix:
|
885
|
-
if (
|
881
|
+
const n = /* @__PURE__ */ Object.create(null), l = [];
|
882
|
+
let s, i;
|
883
|
+
return t.pending.forEach((r) => {
|
884
|
+
const { provider: c, prefix: f } = r;
|
885
|
+
if (f === i && c === s)
|
886
886
|
return;
|
887
|
-
s = c,
|
888
|
-
const
|
889
|
-
|
890
|
-
}),
|
891
|
-
const { provider: c, prefix:
|
892
|
-
d.has(
|
893
|
-
}), l.forEach((
|
894
|
-
const c =
|
895
|
-
c.length &&
|
896
|
-
}), o ?
|
887
|
+
s = c, i = f, l.push(U(c, f));
|
888
|
+
const h = n[c] || (n[c] = /* @__PURE__ */ Object.create(null));
|
889
|
+
h[f] || (h[f] = []);
|
890
|
+
}), t.pending.forEach((r) => {
|
891
|
+
const { provider: c, prefix: f, name: h } = r, b = U(c, f), d = b.pendingIcons || (b.pendingIcons = /* @__PURE__ */ new Set());
|
892
|
+
d.has(h) || (d.add(h), n[c][f].push(h));
|
893
|
+
}), l.forEach((r) => {
|
894
|
+
const c = n[r.provider][r.prefix];
|
895
|
+
c.length && Rt(r, c);
|
896
|
+
}), o ? Tt(o, t, l) : Ae;
|
897
897
|
};
|
898
|
-
function
|
898
|
+
function Nt(e, o) {
|
899
899
|
const a = {
|
900
900
|
...e
|
901
901
|
};
|
902
|
-
for (const
|
903
|
-
const
|
904
|
-
|
902
|
+
for (const t in o) {
|
903
|
+
const n = o[t], l = typeof n;
|
904
|
+
t in Ge ? (n === null || n && (l === "string" || l === "number")) && (a[t] = n) : l === typeof a[t] && (a[t] = t === "rotate" ? n % 4 : n);
|
905
905
|
}
|
906
906
|
return a;
|
907
907
|
}
|
908
|
-
const
|
909
|
-
function
|
910
|
-
o.split(
|
908
|
+
const _t = /[\s,]+/;
|
909
|
+
function Gt(e, o) {
|
910
|
+
o.split(_t).forEach((a) => {
|
911
911
|
switch (a.trim()) {
|
912
912
|
case "horizontal":
|
913
913
|
e.hFlip = !0;
|
@@ -918,89 +918,89 @@ function Wn(e, o) {
|
|
918
918
|
}
|
919
919
|
});
|
920
920
|
}
|
921
|
-
function
|
921
|
+
function Wt(e, o = 0) {
|
922
922
|
const a = e.replace(/^-?[0-9.]*/, "");
|
923
|
-
function n
|
924
|
-
for (;
|
925
|
-
|
926
|
-
return
|
923
|
+
function t(n) {
|
924
|
+
for (; n < 0; )
|
925
|
+
n += 4;
|
926
|
+
return n % 4;
|
927
927
|
}
|
928
928
|
if (a === "") {
|
929
|
-
const
|
930
|
-
return isNaN(
|
929
|
+
const n = parseInt(e);
|
930
|
+
return isNaN(n) ? 0 : t(n);
|
931
931
|
} else if (a !== e) {
|
932
|
-
let
|
932
|
+
let n = 0;
|
933
933
|
switch (a) {
|
934
934
|
case "%":
|
935
|
-
|
935
|
+
n = 25;
|
936
936
|
break;
|
937
937
|
case "deg":
|
938
|
-
|
938
|
+
n = 90;
|
939
939
|
}
|
940
|
-
if (
|
940
|
+
if (n) {
|
941
941
|
let l = parseFloat(e.slice(0, e.length - a.length));
|
942
|
-
return isNaN(l) ? 0 : (l = l /
|
942
|
+
return isNaN(l) ? 0 : (l = l / n, l % 1 === 0 ? t(l) : 0);
|
943
943
|
}
|
944
944
|
}
|
945
945
|
return o;
|
946
946
|
}
|
947
|
-
function
|
947
|
+
function Kt(e, o) {
|
948
948
|
let a = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
949
|
-
for (const
|
950
|
-
a += " " +
|
949
|
+
for (const t in o)
|
950
|
+
a += " " + t + '="' + o[t] + '"';
|
951
951
|
return '<svg xmlns="http://www.w3.org/2000/svg"' + a + ">" + e + "</svg>";
|
952
952
|
}
|
953
|
-
function
|
953
|
+
function Ht(e) {
|
954
954
|
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
955
955
|
}
|
956
|
-
function
|
957
|
-
return "data:image/svg+xml," +
|
956
|
+
function qt(e) {
|
957
|
+
return "data:image/svg+xml," + Ht(e);
|
958
958
|
}
|
959
|
-
function
|
960
|
-
return 'url("' +
|
959
|
+
function Ut(e) {
|
960
|
+
return 'url("' + qt(e) + '")';
|
961
961
|
}
|
962
|
-
const
|
962
|
+
const $e = {
|
963
963
|
...We,
|
964
964
|
inline: !1
|
965
|
-
},
|
965
|
+
}, Yt = {
|
966
966
|
xmlns: "http://www.w3.org/2000/svg",
|
967
967
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
968
968
|
"aria-hidden": !0,
|
969
969
|
role: "img"
|
970
|
-
},
|
970
|
+
}, Qt = {
|
971
971
|
display: "inline-block"
|
972
972
|
}, ve = {
|
973
973
|
backgroundColor: "currentColor"
|
974
974
|
}, qe = {
|
975
975
|
backgroundColor: "transparent"
|
976
|
-
},
|
976
|
+
}, Te = {
|
977
977
|
Image: "var(--svg)",
|
978
978
|
Repeat: "no-repeat",
|
979
979
|
Size: "100% 100%"
|
980
|
-
},
|
980
|
+
}, Be = {
|
981
981
|
webkitMask: ve,
|
982
982
|
mask: ve,
|
983
983
|
background: qe
|
984
984
|
};
|
985
|
-
for (const e in
|
986
|
-
const o =
|
987
|
-
for (const a in
|
988
|
-
o[e + a] =
|
985
|
+
for (const e in Be) {
|
986
|
+
const o = Be[e];
|
987
|
+
for (const a in Te)
|
988
|
+
o[e + a] = Te[a];
|
989
989
|
}
|
990
990
|
const ae = {};
|
991
991
|
["horizontal", "vertical"].forEach((e) => {
|
992
992
|
const o = e.slice(0, 1) + "Flip";
|
993
993
|
ae[e + "-flip"] = o, ae[e.slice(0, 1) + "-flip"] = o, ae[e + "Flip"] = o;
|
994
994
|
});
|
995
|
-
function
|
995
|
+
function Le(e) {
|
996
996
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
997
997
|
}
|
998
998
|
const Xe = (e, o) => {
|
999
|
-
const a =
|
1000
|
-
for (let
|
1001
|
-
const
|
1002
|
-
if (
|
1003
|
-
switch (
|
999
|
+
const a = Nt($e, o), t = { ...Yt }, n = o.mode || "svg", l = {}, s = o.style, i = typeof s == "object" && !(s instanceof Array) ? s : {};
|
1000
|
+
for (let p in o) {
|
1001
|
+
const g = o[p];
|
1002
|
+
if (g !== void 0)
|
1003
|
+
switch (p) {
|
1004
1004
|
case "icon":
|
1005
1005
|
case "style":
|
1006
1006
|
case "onLoad":
|
@@ -1010,63 +1010,63 @@ const Xe = (e, o) => {
|
|
1010
1010
|
case "inline":
|
1011
1011
|
case "hFlip":
|
1012
1012
|
case "vFlip":
|
1013
|
-
a[
|
1013
|
+
a[p] = g === !0 || g === "true" || g === 1;
|
1014
1014
|
break;
|
1015
1015
|
case "flip":
|
1016
|
-
typeof
|
1016
|
+
typeof g == "string" && Gt(a, g);
|
1017
1017
|
break;
|
1018
1018
|
case "color":
|
1019
|
-
l.color =
|
1019
|
+
l.color = g;
|
1020
1020
|
break;
|
1021
1021
|
case "rotate":
|
1022
|
-
typeof
|
1022
|
+
typeof g == "string" ? a[p] = Wt(g) : typeof g == "number" && (a[p] = g);
|
1023
1023
|
break;
|
1024
1024
|
case "ariaHidden":
|
1025
1025
|
case "aria-hidden":
|
1026
|
-
|
1026
|
+
g !== !0 && g !== "true" && delete t["aria-hidden"];
|
1027
1027
|
break;
|
1028
1028
|
default: {
|
1029
|
-
const
|
1030
|
-
|
1029
|
+
const x = ae[p];
|
1030
|
+
x ? (g === !0 || g === "true" || g === 1) && (a[x] = !0) : $e[p] === void 0 && (t[p] = g);
|
1031
1031
|
}
|
1032
1032
|
}
|
1033
1033
|
}
|
1034
|
-
const
|
1035
|
-
if (a.inline && (l.verticalAlign = "-0.125em"),
|
1036
|
-
|
1034
|
+
const r = mt(e, a), c = r.attributes;
|
1035
|
+
if (a.inline && (l.verticalAlign = "-0.125em"), n === "svg") {
|
1036
|
+
t.style = {
|
1037
1037
|
...l,
|
1038
|
-
...
|
1039
|
-
}, Object.assign(
|
1040
|
-
let
|
1041
|
-
return typeof
|
1038
|
+
...i
|
1039
|
+
}, Object.assign(t, c);
|
1040
|
+
let p = 0, g = o.id;
|
1041
|
+
return typeof g == "string" && (g = g.replace(/-/g, "_")), t.innerHTML = wt(r.body, g ? () => g + "ID" + p++ : "iconifyVue"), xe("svg", t);
|
1042
1042
|
}
|
1043
|
-
const { body:
|
1043
|
+
const { body: f, width: h, height: b } = e, d = n === "mask" || (n === "bg" ? !1 : f.indexOf("currentColor") !== -1), k = Kt(f, {
|
1044
1044
|
...c,
|
1045
|
-
width:
|
1045
|
+
width: h + "",
|
1046
1046
|
height: b + ""
|
1047
1047
|
});
|
1048
|
-
return
|
1048
|
+
return t.style = {
|
1049
1049
|
...l,
|
1050
|
-
"--svg":
|
1051
|
-
width:
|
1052
|
-
height:
|
1053
|
-
...
|
1050
|
+
"--svg": Ut(k),
|
1051
|
+
width: Le(c.width),
|
1052
|
+
height: Le(c.height),
|
1053
|
+
...Qt,
|
1054
1054
|
...d ? ve : qe,
|
1055
|
-
...
|
1056
|
-
},
|
1055
|
+
...i
|
1056
|
+
}, xe("span", t);
|
1057
1057
|
};
|
1058
|
-
|
1059
|
-
|
1058
|
+
_e(!0);
|
1059
|
+
yt("", Mt);
|
1060
1060
|
if (typeof document < "u" && typeof window < "u") {
|
1061
1061
|
const e = window;
|
1062
1062
|
if (e.IconifyPreload !== void 0) {
|
1063
1063
|
const o = e.IconifyPreload, a = "Invalid IconifyPreload syntax.";
|
1064
|
-
typeof o == "object" && o !== null && (o instanceof Array ? o : [o]).forEach((
|
1064
|
+
typeof o == "object" && o !== null && (o instanceof Array ? o : [o]).forEach((t) => {
|
1065
1065
|
try {
|
1066
1066
|
// Check if item is an object and not null/array
|
1067
|
-
(typeof
|
1068
|
-
typeof
|
1069
|
-
!
|
1067
|
+
(typeof t != "object" || t === null || t instanceof Array || // Check for 'icons' and 'prefix'
|
1068
|
+
typeof t.icons != "object" || typeof t.prefix != "string" || // Add icon set
|
1069
|
+
!gt(t)) && console.error(a);
|
1070
1070
|
} catch {
|
1071
1071
|
console.error(a);
|
1072
1072
|
}
|
@@ -1076,22 +1076,22 @@ if (typeof document < "u" && typeof window < "u") {
|
|
1076
1076
|
const o = e.IconifyProviders;
|
1077
1077
|
if (typeof o == "object" && o !== null)
|
1078
1078
|
for (let a in o) {
|
1079
|
-
const
|
1079
|
+
const t = "IconifyProviders[" + a + "] is invalid.";
|
1080
1080
|
try {
|
1081
|
-
const
|
1082
|
-
if (typeof
|
1081
|
+
const n = o[a];
|
1082
|
+
if (typeof n != "object" || !n || n.resources === void 0)
|
1083
1083
|
continue;
|
1084
|
-
|
1084
|
+
Ct(a, n) || console.error(t);
|
1085
1085
|
} catch {
|
1086
|
-
console.error(
|
1086
|
+
console.error(t);
|
1087
1087
|
}
|
1088
1088
|
}
|
1089
1089
|
}
|
1090
1090
|
}
|
1091
|
-
const
|
1091
|
+
const Zt = {
|
1092
1092
|
...ge,
|
1093
1093
|
body: ""
|
1094
|
-
},
|
1094
|
+
}, H = V({
|
1095
1095
|
// Do not inherit other attributes: it is handled by render()
|
1096
1096
|
inheritAttrs: !1,
|
1097
1097
|
// Set initial data
|
@@ -1123,24 +1123,24 @@ const Jn = {
|
|
1123
1123
|
return this._name = "", this.abortLoading(), {
|
1124
1124
|
data: e
|
1125
1125
|
};
|
1126
|
-
let
|
1127
|
-
if (typeof e != "string" || (
|
1126
|
+
let t;
|
1127
|
+
if (typeof e != "string" || (t = ce(e, !1, !0)) === null)
|
1128
1128
|
return this.abortLoading(), null;
|
1129
|
-
let
|
1130
|
-
if (!
|
1131
|
-
return (!this._loadingIcon || this._loadingIcon.name !== e) && (this.abortLoading(), this._name = "",
|
1129
|
+
let n = st(t);
|
1130
|
+
if (!n)
|
1131
|
+
return (!this._loadingIcon || this._loadingIcon.name !== e) && (this.abortLoading(), this._name = "", n !== null && (this._loadingIcon = {
|
1132
1132
|
name: e,
|
1133
|
-
abort:
|
1133
|
+
abort: Dt([t], () => {
|
1134
1134
|
this.counter++;
|
1135
1135
|
})
|
1136
1136
|
})), null;
|
1137
1137
|
if (this.abortLoading(), this._name !== e && (this._name = e, o && o(e)), a) {
|
1138
|
-
|
1139
|
-
const s = a(
|
1140
|
-
typeof s == "string" && (
|
1138
|
+
n = Object.assign({}, n);
|
1139
|
+
const s = a(n.body, t.name, t.prefix, t.provider);
|
1140
|
+
typeof s == "string" && (n.body = s);
|
1141
1141
|
}
|
1142
1142
|
const l = ["iconify"];
|
1143
|
-
return
|
1143
|
+
return t.prefix !== "" && l.push("iconify--" + t.prefix), t.provider !== "" && l.push("iconify--" + t.provider), { data: n, classes: l };
|
1144
1144
|
}
|
1145
1145
|
},
|
1146
1146
|
// Render icon
|
@@ -1148,7 +1148,7 @@ const Jn = {
|
|
1148
1148
|
this.counter;
|
1149
1149
|
const e = this.$attrs, o = this.iconMounted || e.ssr ? this.getIcon(e.icon, e.onLoad, e.customise) : null;
|
1150
1150
|
if (!o)
|
1151
|
-
return Xe(
|
1151
|
+
return Xe(Zt, e);
|
1152
1152
|
let a = e;
|
1153
1153
|
return o.classes && (a = {
|
1154
1154
|
...e,
|
@@ -1158,16 +1158,16 @@ const Jn = {
|
|
1158
1158
|
...o.data
|
1159
1159
|
}, a);
|
1160
1160
|
}
|
1161
|
-
}),
|
1161
|
+
}), Jt = ["disabled"], en = {
|
1162
1162
|
key: 0,
|
1163
1163
|
class: "x-btn-icon"
|
1164
|
-
},
|
1164
|
+
}, tn = {
|
1165
1165
|
key: 1,
|
1166
1166
|
class: "x-btn-loading"
|
1167
|
-
},
|
1167
|
+
}, nn = { class: "x-btn-content" }, on = {
|
1168
1168
|
key: 2,
|
1169
1169
|
class: "x-btn-icon"
|
1170
|
-
},
|
1170
|
+
}, an = /* @__PURE__ */ V({
|
1171
1171
|
__name: "index",
|
1172
1172
|
props: {
|
1173
1173
|
type: { default: "default" },
|
@@ -1178,13 +1178,13 @@ const Jn = {
|
|
1178
1178
|
loading: { type: Boolean, default: !1 },
|
1179
1179
|
block: { type: Boolean, default: !1 },
|
1180
1180
|
round: { type: Boolean, default: !1 },
|
1181
|
-
|
1181
|
+
ghost: { type: Boolean, default: !1 }
|
1182
1182
|
},
|
1183
1183
|
emits: ["click"],
|
1184
1184
|
setup(e, { emit: o }) {
|
1185
|
-
const a = e,
|
1185
|
+
const a = e, t = o, n = B(), l = B([]);
|
1186
1186
|
let s = 0;
|
1187
|
-
const
|
1187
|
+
const i = L(() => [
|
1188
1188
|
"x-btn",
|
1189
1189
|
`x-btn-${a.type}`,
|
1190
1190
|
`x-btn-${a.size}`,
|
@@ -1193,73 +1193,73 @@ const Jn = {
|
|
1193
1193
|
"x-btn-loading": a.loading,
|
1194
1194
|
"x-btn-block": a.block,
|
1195
1195
|
"x-btn-round": a.round,
|
1196
|
-
"x-btn-
|
1196
|
+
"x-btn-ghost": a.ghost
|
1197
1197
|
}
|
1198
1198
|
]);
|
1199
|
-
function
|
1200
|
-
!a.disabled && !a.loading &&
|
1199
|
+
function r(f) {
|
1200
|
+
!a.disabled && !a.loading && t("click", f);
|
1201
1201
|
}
|
1202
|
-
function c(
|
1202
|
+
function c(f) {
|
1203
1203
|
if (a.disabled || a.loading) return;
|
1204
|
-
const
|
1205
|
-
if (!
|
1206
|
-
const b =
|
1204
|
+
const h = n.value;
|
1205
|
+
if (!h) return;
|
1206
|
+
const b = h.getBoundingClientRect(), d = {
|
1207
1207
|
id: s++,
|
1208
1208
|
style: {
|
1209
|
-
left: `${
|
1210
|
-
top: `${
|
1209
|
+
left: `${f.clientX - b.left}px`,
|
1210
|
+
top: `${f.clientY - b.top}px`
|
1211
1211
|
}
|
1212
1212
|
};
|
1213
1213
|
l.value.push(d), setTimeout(() => {
|
1214
|
-
const
|
1215
|
-
|
1214
|
+
const k = l.value.findIndex((p) => p.id === d.id);
|
1215
|
+
k > -1 && l.value.splice(k, 1);
|
1216
1216
|
}, 600);
|
1217
1217
|
}
|
1218
|
-
return (
|
1219
|
-
class:
|
1218
|
+
return (f, h) => (m(), v("button", {
|
1219
|
+
class: $(i.value),
|
1220
1220
|
disabled: e.disabled || e.loading,
|
1221
|
-
onClick:
|
1221
|
+
onClick: r,
|
1222
1222
|
onMousedown: c,
|
1223
1223
|
ref_key: "buttonRef",
|
1224
|
-
ref:
|
1224
|
+
ref: n
|
1225
1225
|
}, [
|
1226
|
-
(
|
1226
|
+
(m(!0), v(z, null, D(l.value, (b) => (m(), v("span", {
|
1227
1227
|
key: b.id,
|
1228
1228
|
class: "x-btn-ripple",
|
1229
1229
|
style: G(b.style)
|
1230
1230
|
}, null, 4))), 128)),
|
1231
|
-
e.icon && !e.loading ? (
|
1232
|
-
R(W(
|
1231
|
+
e.icon && !e.loading ? (m(), v("span", en, [
|
1232
|
+
R(W(H), { icon: e.icon }, null, 8, ["icon"])
|
1233
1233
|
])) : A("", !0),
|
1234
|
-
e.loading ? (
|
1235
|
-
R(W(
|
1234
|
+
e.loading ? (m(), v("span", tn, [
|
1235
|
+
R(W(H), { icon: "eos-icons:loading" })
|
1236
1236
|
])) : A("", !0),
|
1237
|
-
y("span",
|
1238
|
-
|
1237
|
+
y("span", nn, [
|
1238
|
+
K(f.$slots, "default", {}, void 0, !0)
|
1239
1239
|
]),
|
1240
|
-
e.iconRight && !e.loading ? (
|
1241
|
-
R(W(
|
1240
|
+
e.iconRight && !e.loading ? (m(), v("span", on, [
|
1241
|
+
R(W(H), { icon: e.iconRight }, null, 8, ["icon"])
|
1242
1242
|
])) : A("", !0)
|
1243
|
-
], 42,
|
1243
|
+
], 42, Jt));
|
1244
1244
|
}
|
1245
1245
|
}), F = (e, o) => {
|
1246
1246
|
const a = e.__vccOpts || e;
|
1247
|
-
for (const [
|
1248
|
-
a[
|
1247
|
+
for (const [t, n] of o)
|
1248
|
+
a[t] = n;
|
1249
1249
|
return a;
|
1250
|
-
},
|
1250
|
+
}, ze = /* @__PURE__ */ F(an, [["__scopeId", "data-v-4ae56e67"]]), ln = { class: "x-card-container" }, sn = ["onClick"], cn = { class: "relative p-2" }, gn = ["src", "alt"], dn = {
|
1251
1251
|
key: 0,
|
1252
1252
|
class: "absolute top-3 left-3"
|
1253
|
-
},
|
1253
|
+
}, rn = { class: "label-badge" }, fn = { class: "product-info p-5 ml-5" }, pn = { class: "text-sm lg:text-base text-gray-700 leading-relaxed line-clamp-2 mb-3" }, hn = { class: "flex items-center justify-between gap-2" }, mn = { class: "text-base lg:text-lg font-bold text-[var(--x-color-primary)]" }, un = {
|
1254
1254
|
key: 0,
|
1255
1255
|
class: "bi bi-heart text-gray-500"
|
1256
|
-
},
|
1256
|
+
}, vn = {
|
1257
1257
|
key: 1,
|
1258
1258
|
class: "bi bi-heart-fill text-[#FE374F]"
|
1259
|
-
},
|
1259
|
+
}, bn = ["onClick"], wn = { class: "relative flex-shrink-0 p-2" }, yn = { class: "aspect-square bg-gray-100 rounded-lg overflow-hidden" }, Cn = ["src", "alt"], xn = {
|
1260
1260
|
key: 0,
|
1261
1261
|
class: "absolute top-3 left-3"
|
1262
|
-
},
|
1262
|
+
}, Sn = { class: "label-badge" }, En = { class: "flex-1 flex flex-col justify-between product-info p-5 ml-5" }, kn = { class: "text-sm lg:text-base text-gray-700 font-medium line-clamp-2 leading-relaxed mb-3" }, Pn = { class: "flex items-center justify-between gap-2 mt-auto" }, jn = { class: "text-base lg:text-lg font-bold text-[var(--x-color-primary)]" }, Mn = /* @__PURE__ */ V({
|
1263
1263
|
__name: "index",
|
1264
1264
|
props: {
|
1265
1265
|
layout: { default: "grid" },
|
@@ -1269,7 +1269,7 @@ const Jn = {
|
|
1269
1269
|
},
|
1270
1270
|
emits: ["productClick", "like"],
|
1271
1271
|
setup(e, { emit: o }) {
|
1272
|
-
const a = e,
|
1272
|
+
const a = e, t = o, n = [
|
1273
1273
|
{
|
1274
1274
|
id: "1",
|
1275
1275
|
name: "北欧风简约陶瓷花瓶",
|
@@ -1366,111 +1366,111 @@ const Jn = {
|
|
1366
1366
|
label: "特价",
|
1367
1367
|
isWish: !1
|
1368
1368
|
}
|
1369
|
-
], l =
|
1370
|
-
const
|
1369
|
+
], l = B([]), s = L(() => a.products && a.products.length > 0 ? a.products : l.value), i = L(() => {
|
1370
|
+
const h = Math.min(Math.max(a.columns || 4, 1), 4), b = {
|
1371
1371
|
1: "grid-cols-1",
|
1372
1372
|
2: "grid-cols-1 md:grid-cols-2",
|
1373
1373
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
1374
1374
|
4: "grid-cols-2 md:grid-cols-3 lg:grid-cols-4"
|
1375
1375
|
};
|
1376
|
-
return b[
|
1377
|
-
}),
|
1378
|
-
const
|
1376
|
+
return b[h] || b[4];
|
1377
|
+
}), r = L(() => {
|
1378
|
+
const h = Math.min(Math.max(a.columns || 4, 1), 4), b = {
|
1379
1379
|
1: "columns-1",
|
1380
1380
|
2: "columns-1 md:columns-2",
|
1381
1381
|
3: "columns-2 md:columns-2 lg:columns-3",
|
1382
1382
|
4: "columns-2 sm:columns-2 md:columns-3 lg:columns-4"
|
1383
1383
|
};
|
1384
|
-
return b[
|
1384
|
+
return b[h] || b[4];
|
1385
1385
|
});
|
1386
1386
|
se(() => {
|
1387
|
-
a.useMockData && (!a.products || a.products.length === 0) && (l.value =
|
1387
|
+
a.useMockData && (!a.products || a.products.length === 0) && (l.value = n);
|
1388
1388
|
});
|
1389
|
-
const c = (
|
1390
|
-
|
1391
|
-
},
|
1392
|
-
|
1389
|
+
const c = (h) => {
|
1390
|
+
t("productClick", h);
|
1391
|
+
}, f = (h) => {
|
1392
|
+
h.isWish = !h.isWish, t("like", h);
|
1393
1393
|
};
|
1394
|
-
return (
|
1395
|
-
e.layout === "masonry" ? (
|
1394
|
+
return (h, b) => (m(), v("div", ln, [
|
1395
|
+
e.layout === "masonry" ? (m(), v("div", {
|
1396
1396
|
key: 0,
|
1397
|
-
class:
|
1397
|
+
class: $(["masonry-layout", r.value, "gap-4 sm:gap-6"])
|
1398
1398
|
}, [
|
1399
|
-
(
|
1399
|
+
(m(!0), v(z, null, D(s.value, (d) => (m(), v("div", {
|
1400
1400
|
key: d.id + "-masonry",
|
1401
1401
|
class: "mb-4 sm:mb-6 break-inside-avoid group cursor-pointer product-card",
|
1402
|
-
onClick: (
|
1402
|
+
onClick: (k) => c(d.id)
|
1403
1403
|
}, [
|
1404
|
-
y("div",
|
1404
|
+
y("div", cn, [
|
1405
1405
|
y("img", {
|
1406
1406
|
src: d.image,
|
1407
1407
|
alt: d.name,
|
1408
1408
|
loading: "lazy",
|
1409
1409
|
class: "w-full h-auto rounded-lg bg-gray-100 object-cover transition-transform duration-300 group-hover:scale-[1.01]"
|
1410
|
-
}, null, 8,
|
1411
|
-
d.label ? (
|
1412
|
-
y("span",
|
1410
|
+
}, null, 8, gn),
|
1411
|
+
d.label ? (m(), v("div", dn, [
|
1412
|
+
y("span", rn, I(d.label), 1)
|
1413
1413
|
])) : A("", !0)
|
1414
1414
|
]),
|
1415
|
-
y("div",
|
1416
|
-
y("h3",
|
1417
|
-
y("div",
|
1418
|
-
y("span",
|
1419
|
-
R(
|
1420
|
-
onClick:
|
1415
|
+
y("div", fn, [
|
1416
|
+
y("h3", pn, I(d.name), 1),
|
1417
|
+
y("div", hn, [
|
1418
|
+
y("span", mn, I(d.price), 1),
|
1419
|
+
R(ze, {
|
1420
|
+
onClick: q((k) => f(d), ["stop"]),
|
1421
1421
|
type: "text",
|
1422
1422
|
size: "small",
|
1423
1423
|
class: "like-button !min-w-0 !p-1"
|
1424
1424
|
}, {
|
1425
1425
|
default: Z(() => [
|
1426
|
-
d.isWish ? (
|
1426
|
+
d.isWish ? (m(), v("i", vn)) : (m(), v("i", un))
|
1427
1427
|
]),
|
1428
1428
|
_: 2
|
1429
1429
|
}, 1032, ["onClick"])
|
1430
1430
|
])
|
1431
1431
|
])
|
1432
|
-
], 8,
|
1433
|
-
], 2)) : (
|
1432
|
+
], 8, sn))), 128))
|
1433
|
+
], 2)) : (m(), v("div", {
|
1434
1434
|
key: 1,
|
1435
|
-
class:
|
1435
|
+
class: $(["grid", i.value, "gap-4 lg:gap-6"])
|
1436
1436
|
}, [
|
1437
|
-
(
|
1437
|
+
(m(!0), v(z, null, D(s.value, (d) => (m(), v("div", {
|
1438
1438
|
key: d.id + "-grid",
|
1439
1439
|
class: "h-full"
|
1440
1440
|
}, [
|
1441
1441
|
y("div", {
|
1442
1442
|
class: "group cursor-pointer product-card h-full flex flex-col",
|
1443
|
-
onClick: (
|
1443
|
+
onClick: (k) => c(d.id)
|
1444
1444
|
}, [
|
1445
|
-
y("div",
|
1446
|
-
y("div",
|
1445
|
+
y("div", wn, [
|
1446
|
+
y("div", yn, [
|
1447
1447
|
y("img", {
|
1448
1448
|
src: d.image,
|
1449
1449
|
alt: d.name,
|
1450
1450
|
class: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",
|
1451
1451
|
loading: "lazy"
|
1452
|
-
}, null, 8,
|
1452
|
+
}, null, 8, Cn)
|
1453
1453
|
]),
|
1454
|
-
d.label ? (
|
1455
|
-
y("span",
|
1454
|
+
d.label ? (m(), v("div", xn, [
|
1455
|
+
y("span", Sn, I(d.label), 1)
|
1456
1456
|
])) : A("", !0)
|
1457
1457
|
]),
|
1458
|
-
y("div",
|
1459
|
-
y("h3",
|
1460
|
-
y("div",
|
1461
|
-
y("span",
|
1462
|
-
R(
|
1463
|
-
onClick:
|
1458
|
+
y("div", En, [
|
1459
|
+
y("h3", kn, I(d.name), 1),
|
1460
|
+
y("div", Pn, [
|
1461
|
+
y("span", jn, I(d.price), 1),
|
1462
|
+
R(ze, {
|
1463
|
+
onClick: q((k) => f(d), ["stop"]),
|
1464
1464
|
type: "text",
|
1465
1465
|
size: "small",
|
1466
1466
|
class: "like-button !min-w-0 !p-1"
|
1467
1467
|
}, {
|
1468
1468
|
default: Z(() => [
|
1469
|
-
d.isWish ? (
|
1469
|
+
d.isWish ? (m(), fe(W(H), {
|
1470
1470
|
key: 1,
|
1471
1471
|
icon: "bi:heart-fill",
|
1472
1472
|
class: "bi bi-heart-fill text-[#FE374F]"
|
1473
|
-
})) : (
|
1473
|
+
})) : (m(), fe(W(H), {
|
1474
1474
|
key: 0,
|
1475
1475
|
icon: "bi:heart",
|
1476
1476
|
class: "bi bi-heart text-gray-500"
|
@@ -1480,12 +1480,12 @@ const Jn = {
|
|
1480
1480
|
}, 1032, ["onClick"])
|
1481
1481
|
])
|
1482
1482
|
])
|
1483
|
-
], 8,
|
1483
|
+
], 8, bn)
|
1484
1484
|
]))), 128))
|
1485
1485
|
], 2))
|
1486
1486
|
]));
|
1487
1487
|
}
|
1488
|
-
}),
|
1488
|
+
}), Fo = /* @__PURE__ */ F(Mn, [["__scopeId", "data-v-aec5fd31"]]), An = [
|
1489
1489
|
{
|
1490
1490
|
name: "Afghanistan",
|
1491
1491
|
code: "AF",
|
@@ -3567,11 +3567,11 @@ const Jn = {
|
|
3567
3567
|
flagPng: "https://flagcdn.com/w40/zw.png",
|
3568
3568
|
phoneCode: "+263"
|
3569
3569
|
}
|
3570
|
-
],
|
3570
|
+
], In = ["tabindex"], $n = { class: "flex items-center gap-2" }, Tn = ["src", "alt"], Bn = {
|
3571
3571
|
key: 0,
|
3572
3572
|
class: "absolute z-[9999] w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg max-h-60 overflow-y-auto",
|
3573
3573
|
style: { position: "absolute" }
|
3574
|
-
},
|
3574
|
+
}, Ln = ["onClick"], Xn = ["src", "alt", "onError"], zn = /* @__PURE__ */ V({
|
3575
3575
|
__name: "index",
|
3576
3576
|
props: {
|
3577
3577
|
modelValue: { default: "" },
|
@@ -3589,84 +3589,84 @@ const Jn = {
|
|
3589
3589
|
},
|
3590
3590
|
emits: ["update:modelValue", "change", "ip-detect-start", "ip-detect-success", "ip-detect-error"],
|
3591
3591
|
setup(e, { expose: o, emit: a }) {
|
3592
|
-
const
|
3593
|
-
(
|
3594
|
-
) : null),
|
3595
|
-
const
|
3596
|
-
(C) =>
|
3597
|
-
),
|
3598
|
-
(C) => !
|
3599
|
-
),
|
3600
|
-
const
|
3601
|
-
return
|
3602
|
-
}),
|
3603
|
-
return [...
|
3592
|
+
const t = e, n = a, l = B(!1), s = B(An), i = L(() => t.modelValue ? s.value.find(
|
3593
|
+
(p) => t.returnType === "code" ? p.code === t.modelValue : p.name === t.modelValue
|
3594
|
+
) : null), r = L(() => {
|
3595
|
+
const p = s.value.filter(
|
3596
|
+
(C) => t.priorityCountries.includes(C.code)
|
3597
|
+
), g = s.value.filter(
|
3598
|
+
(C) => !t.priorityCountries.includes(C.code)
|
3599
|
+
), x = p.sort((C, w) => {
|
3600
|
+
const T = t.priorityCountries.indexOf(C.code), j = t.priorityCountries.indexOf(w.code);
|
3601
|
+
return T - j;
|
3602
|
+
}), E = g.sort((C, w) => C.name.localeCompare(w.name));
|
3603
|
+
return [...x, ...E];
|
3604
3604
|
}), c = () => {
|
3605
|
-
|
3606
|
-
},
|
3605
|
+
t.disabled || (l.value = !l.value);
|
3606
|
+
}, f = () => {
|
3607
3607
|
l.value = !1;
|
3608
|
-
},
|
3609
|
-
if (
|
3610
|
-
const
|
3611
|
-
|
3608
|
+
}, h = (p) => {
|
3609
|
+
if (p) {
|
3610
|
+
const g = t.returnType === "code" ? p.code : p.name;
|
3611
|
+
n("update:modelValue", g), n("change", g, p);
|
3612
3612
|
} else
|
3613
|
-
|
3614
|
-
|
3615
|
-
}, b = (
|
3616
|
-
const
|
3617
|
-
|
3613
|
+
n("update:modelValue", "");
|
3614
|
+
f();
|
3615
|
+
}, b = (p, g) => {
|
3616
|
+
const x = p.target;
|
3617
|
+
g && x.src === g.flagSvg ? x.src = g.flagPng : i.value && x.src === i.value.flagSvg && (x.src = i.value.flagPng);
|
3618
3618
|
}, d = async () => {
|
3619
|
-
if (!(!
|
3620
|
-
|
3619
|
+
if (!(!t.autoDetectFromIp || t.modelValue)) {
|
3620
|
+
n("ip-detect-start");
|
3621
3621
|
try {
|
3622
|
-
const
|
3623
|
-
method:
|
3622
|
+
const p = {
|
3623
|
+
method: t.ipDetectMethod,
|
3624
3624
|
headers: {
|
3625
3625
|
"Content-Type": "application/json",
|
3626
|
-
...
|
3626
|
+
...t.ipDetectHeaders
|
3627
3627
|
}
|
3628
|
-
},
|
3629
|
-
if (!
|
3630
|
-
throw new Error(`HTTP error! status: ${
|
3631
|
-
const
|
3632
|
-
let
|
3633
|
-
if (
|
3628
|
+
}, g = await fetch(t.ipDetectUrl, p);
|
3629
|
+
if (!g.ok)
|
3630
|
+
throw new Error(`HTTP error! status: ${g.status}`);
|
3631
|
+
const x = await g.json();
|
3632
|
+
let E;
|
3633
|
+
if (t.ipDetectResponseParser ? E = t.ipDetectResponseParser(x) : E = x.country || x.countryCode || x.country_code || "", E = E.toUpperCase(), !E)
|
3634
3634
|
throw new Error("Country code not found in response");
|
3635
|
-
console.log("Auto-detected country from IP:",
|
3635
|
+
console.log("Auto-detected country from IP:", E), n("ip-detect-success", E);
|
3636
3636
|
const C = s.value.find(
|
3637
|
-
(w) => w.code ===
|
3637
|
+
(w) => w.code === E
|
3638
3638
|
);
|
3639
3639
|
if (C) {
|
3640
|
-
const w =
|
3641
|
-
|
3640
|
+
const w = t.returnType === "code" ? C.code : C.name;
|
3641
|
+
n("update:modelValue", w), n("change", w, C);
|
3642
3642
|
} else
|
3643
|
-
console.warn("Detected country code not found in country list:",
|
3644
|
-
} catch (
|
3645
|
-
const
|
3646
|
-
console.warn("Failed to detect country from IP:",
|
3643
|
+
console.warn("Detected country code not found in country list:", E);
|
3644
|
+
} catch (p) {
|
3645
|
+
const g = p instanceof Error ? p : new Error(String(p));
|
3646
|
+
console.warn("Failed to detect country from IP:", g), n("ip-detect-error", g);
|
3647
3647
|
}
|
3648
3648
|
}
|
3649
|
-
},
|
3649
|
+
}, k = B();
|
3650
3650
|
return se(async () => {
|
3651
|
-
await
|
3652
|
-
const
|
3653
|
-
|
3651
|
+
await N(), t.autoDetectFromIp && !t.modelValue && await d();
|
3652
|
+
const p = (g) => {
|
3653
|
+
k.value && !k.value.contains(g.target) && f();
|
3654
3654
|
};
|
3655
|
-
document.addEventListener("click",
|
3656
|
-
document.removeEventListener("click",
|
3655
|
+
document.addEventListener("click", p), Ve(() => {
|
3656
|
+
document.removeEventListener("click", p);
|
3657
3657
|
});
|
3658
3658
|
}), o({
|
3659
3659
|
detectCountryFromIp: d,
|
3660
3660
|
allCountries: Se(s),
|
3661
|
-
sortedCountries: Se(
|
3662
|
-
}), (
|
3661
|
+
sortedCountries: Se(r)
|
3662
|
+
}), (p, g) => (m(), v("div", {
|
3663
3663
|
ref_key: "containerRef",
|
3664
|
-
ref:
|
3664
|
+
ref: k,
|
3665
3665
|
class: "country-select-container relative"
|
3666
3666
|
}, [
|
3667
3667
|
y("div", {
|
3668
3668
|
onClick: c,
|
3669
|
-
class:
|
3669
|
+
class: $([
|
3670
3670
|
"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-[#1a1a1a] focus:border-[#1a1a1a] transition-colors duration-200 cursor-pointer bg-white flex items-center justify-between",
|
3671
3671
|
e.customClass,
|
3672
3672
|
{ "opacity-60 cursor-not-allowed": e.disabled }
|
@@ -3675,27 +3675,27 @@ const Jn = {
|
|
3675
3675
|
onKeydown: [
|
3676
3676
|
O(c, ["enter"]),
|
3677
3677
|
O(c, ["space"]),
|
3678
|
-
O(
|
3678
|
+
O(f, ["escape"])
|
3679
3679
|
]
|
3680
3680
|
}, [
|
3681
|
-
y("div", $
|
3682
|
-
|
3681
|
+
y("div", $n, [
|
3682
|
+
i.value ? (m(), v("img", {
|
3683
3683
|
key: 0,
|
3684
|
-
src:
|
3685
|
-
alt:
|
3684
|
+
src: i.value.flagSvg,
|
3685
|
+
alt: i.value.name,
|
3686
3686
|
class: "w-5 h-4 object-cover rounded-sm",
|
3687
3687
|
onError: b
|
3688
|
-
}, null, 40,
|
3688
|
+
}, null, 40, Tn)) : A("", !0),
|
3689
3689
|
y("span", {
|
3690
|
-
class:
|
3691
|
-
},
|
3690
|
+
class: $({ "text-gray-500": !i.value && e.placeholder })
|
3691
|
+
}, I(i.value ? i.value.name : e.placeholder || "选择国家"), 3)
|
3692
3692
|
]),
|
3693
|
-
(
|
3694
|
-
class:
|
3693
|
+
(m(), v("svg", {
|
3694
|
+
class: $(["w-5 h-5 text-gray-400 transition-transform duration-200", { "rotate-180": l.value }]),
|
3695
3695
|
fill: "none",
|
3696
3696
|
stroke: "currentColor",
|
3697
3697
|
viewBox: "0 0 24 24"
|
3698
|
-
}, [...
|
3698
|
+
}, [...g[0] || (g[0] = [
|
3699
3699
|
y("path", {
|
3700
3700
|
"stroke-linecap": "round",
|
3701
3701
|
"stroke-linejoin": "round",
|
@@ -3703,64 +3703,64 @@ const Jn = {
|
|
3703
3703
|
d: "M19 9l-7 7-7-7"
|
3704
3704
|
}, null, -1)
|
3705
3705
|
])], 2))
|
3706
|
-
], 42,
|
3707
|
-
l.value && !e.disabled ? (
|
3708
|
-
(
|
3709
|
-
var
|
3710
|
-
return
|
3711
|
-
key:
|
3712
|
-
onClick: (C) =>
|
3713
|
-
class:
|
3706
|
+
], 42, In),
|
3707
|
+
l.value && !e.disabled ? (m(), v("div", Bn, [
|
3708
|
+
(m(!0), v(z, null, D(r.value, (x) => {
|
3709
|
+
var E;
|
3710
|
+
return m(), v("div", {
|
3711
|
+
key: x.code,
|
3712
|
+
onClick: (C) => h(x),
|
3713
|
+
class: $(["px-3 py-2 hover:bg-gray-50 cursor-pointer flex items-center gap-2 transition-colors", { "bg-gray-100": ((E = i.value) == null ? void 0 : E.code) === x.code }])
|
3714
3714
|
}, [
|
3715
3715
|
y("img", {
|
3716
|
-
src:
|
3717
|
-
alt:
|
3716
|
+
src: x.flagSvg,
|
3717
|
+
alt: x.name,
|
3718
3718
|
class: "w-5 h-4 object-cover rounded-sm flex-shrink-0",
|
3719
|
-
onError: (C) => b(C,
|
3720
|
-
}, null, 40,
|
3721
|
-
y("span", null,
|
3722
|
-
], 10,
|
3719
|
+
onError: (C) => b(C, x)
|
3720
|
+
}, null, 40, Xn),
|
3721
|
+
y("span", null, I(x.name), 1)
|
3722
|
+
], 10, Ln);
|
3723
3723
|
}), 128))
|
3724
3724
|
])) : A("", !0),
|
3725
|
-
l.value && !e.disabled ? (
|
3725
|
+
l.value && !e.disabled ? (m(), v("div", {
|
3726
3726
|
key: 1,
|
3727
3727
|
class: "fixed inset-0 z-[9998]",
|
3728
|
-
onClick:
|
3728
|
+
onClick: f
|
3729
3729
|
})) : A("", !0)
|
3730
3730
|
], 512));
|
3731
3731
|
}
|
3732
|
-
}),
|
3732
|
+
}), Oo = /* @__PURE__ */ F(zn, [["__scopeId", "data-v-08b31f1b"]]), Vn = ["tabindex", "aria-expanded", "aria-labelledby"], Fn = { class: "flex items-center gap-2 min-h-0 flex-1" }, On = {
|
3733
3733
|
key: 0,
|
3734
3734
|
class: "text-gray-500"
|
3735
|
-
},
|
3735
|
+
}, Rn = {
|
3736
3736
|
key: 1,
|
3737
3737
|
class: "flex flex-wrap gap-1"
|
3738
|
-
},
|
3738
|
+
}, Dn = {
|
3739
3739
|
key: 0,
|
3740
3740
|
class: "text-gray-900"
|
3741
|
-
},
|
3741
|
+
}, Nn = ["onClick"], _n = {
|
3742
3742
|
key: 0,
|
3743
3743
|
class: "absolute z-[9999] w-full mt-2 bg-white rounded-xl shadow-xl border border-gray-100/50 max-h-60 overflow-auto backdrop-blur-sm",
|
3744
3744
|
role: "listbox"
|
3745
|
-
},
|
3745
|
+
}, Gn = {
|
3746
3746
|
key: 0,
|
3747
3747
|
class: "p-3 border-b border-gray-50/80"
|
3748
|
-
},
|
3748
|
+
}, Wn = { class: "py-1" }, Kn = {
|
3749
3749
|
key: 0,
|
3750
3750
|
class: "px-4 py-3 text-sm text-gray-400 text-center"
|
3751
|
-
},
|
3751
|
+
}, Hn = ["onClick", "onKeydown", "aria-selected"], qn = { class: "flex items-center gap-3" }, Un = {
|
3752
3752
|
key: 0,
|
3753
3753
|
class: "flex items-center"
|
3754
|
-
},
|
3754
|
+
}, Yn = {
|
3755
3755
|
key: 0,
|
3756
3756
|
class: "bi bi-check text-[#1a1a1a] text-xs"
|
3757
|
-
},
|
3757
|
+
}, Qn = {
|
3758
3758
|
key: 1,
|
3759
3759
|
class: "flex items-center"
|
3760
|
-
},
|
3760
|
+
}, Zn = {
|
3761
3761
|
key: 0,
|
3762
3762
|
class: "w-1.5 h-1.5 bg-white rounded-full"
|
3763
|
-
},
|
3763
|
+
}, Jn = { class: "flex-1" }, eo = /* @__PURE__ */ V({
|
3764
3764
|
__name: "index",
|
3765
3765
|
props: {
|
3766
3766
|
modelValue: {},
|
@@ -3778,73 +3778,73 @@ const Jn = {
|
|
3778
3778
|
},
|
3779
3779
|
emits: ["update:modelValue", "change", "open", "close"],
|
3780
3780
|
setup(e, { expose: o, emit: a }) {
|
3781
|
-
const
|
3782
|
-
(
|
3783
|
-
)),
|
3784
|
-
(
|
3785
|
-
) : [] : []), b =
|
3786
|
-
const
|
3787
|
-
return
|
3788
|
-
},
|
3789
|
-
if (
|
3790
|
-
const
|
3791
|
-
if (
|
3792
|
-
const
|
3793
|
-
M > -1 ?
|
3781
|
+
const t = e, n = a, l = B(!1), s = B(""), i = B(), r = B(), c = L(() => !t.searchable || !s.value ? t.options : t.options.filter(
|
3782
|
+
(u) => k(u).toLowerCase().includes(s.value.toLowerCase())
|
3783
|
+
)), f = L(() => t.multiple ? null : t.options.find((u) => p(u) === t.modelValue) || null), h = L(() => t.multiple ? Array.isArray(t.modelValue) ? t.options.filter(
|
3784
|
+
(u) => t.modelValue.includes(p(u))
|
3785
|
+
) : [] : []), b = L(() => t.multiple ? h.value.length > 0 : f.value !== null), d = L(() => `select-label-${Math.random().toString(36).substr(2, 9)}`), k = (u) => typeof u == "object" ? u[t.labelKey] : u, p = (u) => typeof u == "object" ? u[t.valueKey] : u, g = (u) => {
|
3786
|
+
const P = p(u);
|
3787
|
+
return t.multiple ? Array.isArray(t.modelValue) && t.modelValue.includes(P) : t.modelValue === P;
|
3788
|
+
}, x = (u) => {
|
3789
|
+
if (u.disabled) return;
|
3790
|
+
const P = p(u);
|
3791
|
+
if (t.multiple) {
|
3792
|
+
const S = Array.isArray(t.modelValue) ? [...t.modelValue] : [], M = S.indexOf(P);
|
3793
|
+
M > -1 ? S.splice(M, 1) : S.push(P), n("update:modelValue", S), n("change", S);
|
3794
3794
|
} else
|
3795
|
-
|
3796
|
-
},
|
3797
|
-
if (!
|
3798
|
-
const
|
3799
|
-
M > -1 && (
|
3795
|
+
n("update:modelValue", P), n("change", P), T();
|
3796
|
+
}, E = (u) => {
|
3797
|
+
if (!t.multiple) return;
|
3798
|
+
const P = p(u), S = Array.isArray(t.modelValue) ? [...t.modelValue] : [], M = S.indexOf(P);
|
3799
|
+
M > -1 && (S.splice(M, 1), n("update:modelValue", S), n("change", S));
|
3800
3800
|
}, C = () => {
|
3801
|
-
|
3801
|
+
t.disabled || (l.value ? T() : w());
|
3802
3802
|
}, w = () => {
|
3803
|
-
l.value = !0,
|
3804
|
-
|
3803
|
+
l.value = !0, n("open"), N(() => {
|
3804
|
+
t.searchable && r.value && r.value.focus();
|
3805
3805
|
});
|
3806
|
-
},
|
3807
|
-
l.value = !1, s.value = "",
|
3808
|
-
},
|
3809
|
-
|
3810
|
-
},
|
3806
|
+
}, T = () => {
|
3807
|
+
l.value = !1, s.value = "", n("close");
|
3808
|
+
}, j = (u) => {
|
3809
|
+
i.value && !i.value.contains(u.target) && T();
|
3810
|
+
}, X = (u) => {
|
3811
3811
|
if (!l.value) return;
|
3812
|
-
const
|
3813
|
-
switch (
|
3812
|
+
const P = c.value, S = P.findIndex((M) => g(M));
|
3813
|
+
switch (u.key) {
|
3814
3814
|
case "ArrowDown":
|
3815
|
-
|
3815
|
+
u.preventDefault();
|
3816
3816
|
break;
|
3817
3817
|
case "ArrowUp":
|
3818
|
-
|
3818
|
+
u.preventDefault();
|
3819
3819
|
break;
|
3820
3820
|
case "Enter":
|
3821
3821
|
case " ":
|
3822
|
-
|
3822
|
+
u.preventDefault(), S >= 0 && P[S] && x(P[S]);
|
3823
3823
|
break;
|
3824
3824
|
}
|
3825
3825
|
};
|
3826
3826
|
return se(() => {
|
3827
|
-
document.addEventListener("click",
|
3827
|
+
document.addEventListener("click", j), document.addEventListener("keydown", X);
|
3828
3828
|
}), Ve(() => {
|
3829
|
-
document.removeEventListener("click",
|
3829
|
+
document.removeEventListener("click", j), document.removeEventListener("keydown", X);
|
3830
3830
|
}), o({
|
3831
3831
|
open: w,
|
3832
|
-
close:
|
3832
|
+
close: T,
|
3833
3833
|
toggle: C
|
3834
|
-
}), (
|
3834
|
+
}), (u, P) => (m(), v("div", {
|
3835
3835
|
class: "relative",
|
3836
3836
|
style: G({ width: e.width }),
|
3837
3837
|
ref_key: "selectContainer",
|
3838
|
-
ref:
|
3838
|
+
ref: i
|
3839
3839
|
}, [
|
3840
3840
|
y("div", {
|
3841
3841
|
onClick: C,
|
3842
3842
|
onKeydown: [
|
3843
3843
|
O(C, ["enter"]),
|
3844
3844
|
O(C, ["space"]),
|
3845
|
-
O(
|
3845
|
+
O(T, ["escape"])
|
3846
3846
|
],
|
3847
|
-
class:
|
3847
|
+
class: $([
|
3848
3848
|
"flex items-center justify-between w-full px-4 py-1.5 text-sm bg-white rounded-md cursor-pointer transition-all duration-200 border ",
|
3849
3849
|
"focus:outline-none focus:ring-2 focus:ring-[#1a1a1a]/50 focus:ring-offset-1",
|
3850
3850
|
{
|
@@ -3861,27 +3861,27 @@ const Jn = {
|
|
3861
3861
|
"aria-haspopup": !0,
|
3862
3862
|
"aria-labelledby": d.value
|
3863
3863
|
}, [
|
3864
|
-
y("div",
|
3865
|
-
e.placeholder && !b.value ? (
|
3866
|
-
e.multiple ? (
|
3867
|
-
key:
|
3864
|
+
y("div", Fn, [
|
3865
|
+
e.placeholder && !b.value ? (m(), v("span", On, I(e.placeholder), 1)) : (m(), v("div", Rn, [
|
3866
|
+
e.multiple ? (m(!0), v(z, { key: 1 }, D(h.value, (S) => (m(), v("span", {
|
3867
|
+
key: p(S),
|
3868
3868
|
class: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs bg-[#FFF] text-[#1a1a1a] rounded-full border border-[#1a1a1a]/50"
|
3869
3869
|
}, [
|
3870
|
-
|
3870
|
+
be(I(k(S)) + " ", 1),
|
3871
3871
|
y("button", {
|
3872
|
-
onClick:
|
3872
|
+
onClick: q((M) => E(S), ["stop"]),
|
3873
3873
|
class: "rounded-full p-0.5 transition-colors duration-150",
|
3874
3874
|
type: "button"
|
3875
|
-
}, [...
|
3875
|
+
}, [...P[1] || (P[1] = [
|
3876
3876
|
y("i", { class: "bi bi-x text-xs text-[#1a1a1a]" }, null, -1)
|
3877
|
-
])], 8,
|
3878
|
-
]))), 128)) : (
|
3879
|
-
|
3877
|
+
])], 8, Nn)
|
3878
|
+
]))), 128)) : (m(), v(z, { key: 0 }, [
|
3879
|
+
f.value ? (m(), v("span", Dn, I(k(f.value)), 1)) : A("", !0)
|
3880
3880
|
], 64))
|
3881
3881
|
]))
|
3882
3882
|
]),
|
3883
3883
|
y("i", {
|
3884
|
-
class:
|
3884
|
+
class: $([
|
3885
3885
|
"bi text-gray-400 transition-transform duration-200 text-lg",
|
3886
3886
|
{
|
3887
3887
|
"bi-chevron-down": !l.value,
|
@@ -3889,7 +3889,7 @@ const Jn = {
|
|
3889
3889
|
}
|
3890
3890
|
])
|
3891
3891
|
}, null, 2)
|
3892
|
-
], 42,
|
3892
|
+
], 42, Vn),
|
3893
3893
|
R(pe, {
|
3894
3894
|
"enter-active-class": "transition ease-out duration-200",
|
3895
3895
|
"enter-from-class": "opacity-0 scale-95",
|
@@ -3899,69 +3899,69 @@ const Jn = {
|
|
3899
3899
|
"leave-to-class": "opacity-0 scale-95"
|
3900
3900
|
}, {
|
3901
3901
|
default: Z(() => [
|
3902
|
-
l.value ? (
|
3903
|
-
e.searchable ? (
|
3902
|
+
l.value ? (m(), v("div", _n, [
|
3903
|
+
e.searchable ? (m(), v("div", Gn, [
|
3904
3904
|
Qe(y("input", {
|
3905
3905
|
ref_key: "searchInput",
|
3906
|
-
ref:
|
3907
|
-
"onUpdate:modelValue":
|
3906
|
+
ref: r,
|
3907
|
+
"onUpdate:modelValue": P[0] || (P[0] = (S) => s.value = S),
|
3908
3908
|
type: "text",
|
3909
3909
|
class: "w-full px-3 py-2 text-sm bg-gray-50/50 border border-gray-200/60 rounded-lg focus:outline-none focus:ring-1 focus:ring-[#1a1a1a]/50 focus:border-[#1a1a1a]/50 transition-all duration-200",
|
3910
3910
|
placeholder: "搜索...",
|
3911
|
-
onKeydown: O(
|
3911
|
+
onKeydown: O(T, ["escape"])
|
3912
3912
|
}, null, 544), [
|
3913
3913
|
[Ze, s.value]
|
3914
3914
|
])
|
3915
3915
|
])) : A("", !0),
|
3916
|
-
y("div",
|
3917
|
-
c.value.length === 0 ? (
|
3918
|
-
(
|
3919
|
-
key:
|
3920
|
-
onClick: (M) => S
|
3916
|
+
y("div", Wn, [
|
3917
|
+
c.value.length === 0 ? (m(), v("div", Kn, I(e.noOptionsText), 1)) : A("", !0),
|
3918
|
+
(m(!0), v(z, null, D(c.value, (S) => (m(), v("div", {
|
3919
|
+
key: p(S),
|
3920
|
+
onClick: (M) => x(S),
|
3921
3921
|
onKeydown: [
|
3922
|
-
O((M) => S
|
3923
|
-
O((M) => S
|
3922
|
+
O((M) => x(S), ["enter"]),
|
3923
|
+
O((M) => x(S), ["space"])
|
3924
3924
|
],
|
3925
|
-
class:
|
3925
|
+
class: $([
|
3926
3926
|
"px-4 py-3 text-sm cursor-pointer transition-all duration-150",
|
3927
3927
|
{
|
3928
|
-
"bg-[#f2f2f2] text-[#1a1a1a] font-medium":
|
3929
|
-
"hover:bg-[#f2f2f2] text-gray-700": !
|
3928
|
+
"bg-[#f2f2f2] text-[#1a1a1a] font-medium": g(S),
|
3929
|
+
"hover:bg-[#f2f2f2] text-gray-700": !g(S)
|
3930
3930
|
}
|
3931
3931
|
]),
|
3932
3932
|
role: "option",
|
3933
|
-
"aria-selected":
|
3933
|
+
"aria-selected": g(S),
|
3934
3934
|
tabindex: 0
|
3935
3935
|
}, [
|
3936
|
-
y("div",
|
3937
|
-
e.multiple ? (
|
3936
|
+
y("div", qn, [
|
3937
|
+
e.multiple ? (m(), v("div", Un, [
|
3938
3938
|
y("div", {
|
3939
|
-
class:
|
3939
|
+
class: $([
|
3940
3940
|
"w-4 h-4 rounded border flex items-center justify-center transition-all duration-150",
|
3941
3941
|
{
|
3942
|
-
"border-[#1a1a1a] text-white":
|
3943
|
-
"border-gray-300 bg-white": !
|
3942
|
+
"border-[#1a1a1a] text-white": g(S),
|
3943
|
+
"border-gray-300 bg-white": !g(S)
|
3944
3944
|
}
|
3945
3945
|
])
|
3946
3946
|
}, [
|
3947
|
-
|
3947
|
+
g(S) ? (m(), v("i", Yn)) : A("", !0)
|
3948
3948
|
], 2)
|
3949
|
-
])) : (
|
3949
|
+
])) : (m(), v("div", Qn, [
|
3950
3950
|
y("div", {
|
3951
|
-
class:
|
3951
|
+
class: $([
|
3952
3952
|
"w-4 h-4 rounded-full border-2 flex items-center justify-center transition-all duration-150",
|
3953
3953
|
{
|
3954
|
-
"border-[#1a1a1a] bg-[#1a1a1a]":
|
3955
|
-
"border-gray-300 bg-white": !
|
3954
|
+
"border-[#1a1a1a] bg-[#1a1a1a]": g(S),
|
3955
|
+
"border-gray-300 bg-white": !g(S)
|
3956
3956
|
}
|
3957
3957
|
])
|
3958
3958
|
}, [
|
3959
|
-
|
3959
|
+
g(S) ? (m(), v("div", Zn)) : A("", !0)
|
3960
3960
|
], 2)
|
3961
3961
|
])),
|
3962
|
-
y("span",
|
3962
|
+
y("span", Jn, I(k(S)), 1)
|
3963
3963
|
])
|
3964
|
-
], 42,
|
3964
|
+
], 42, Hn))), 128))
|
3965
3965
|
])
|
3966
3966
|
])) : A("", !0)
|
3967
3967
|
]),
|
@@ -3969,7 +3969,7 @@ const Jn = {
|
|
3969
3969
|
})
|
3970
3970
|
], 4));
|
3971
3971
|
}
|
3972
|
-
}),
|
3972
|
+
}), Ro = /* @__PURE__ */ F(eo, [["__scopeId", "data-v-1f7381d8"]]), to = ["type", "value", "placeholder", "disabled", "readonly", "required", "maxlength", "minlength", "autocomplete"], no = {
|
3973
3973
|
key: 2,
|
3974
3974
|
class: "x-input-count"
|
3975
3975
|
}, oo = /* @__PURE__ */ V({
|
@@ -3992,26 +3992,26 @@ const Jn = {
|
|
3992
3992
|
},
|
3993
3993
|
emits: ["update:modelValue", "input", "change", "blur", "focus", "clear", "keydown", "keyup"],
|
3994
3994
|
setup(e, { expose: o, emit: a }) {
|
3995
|
-
const
|
3996
|
-
const w =
|
3995
|
+
const t = e, n = a, l = B(), s = B(!1), i = L(() => !!t.label), r = L(() => {
|
3996
|
+
const w = t.modelValue;
|
3997
3997
|
return w != null && w !== "";
|
3998
|
-
}), c =
|
3999
|
-
const
|
4000
|
-
|
4001
|
-
},
|
4002
|
-
const
|
4003
|
-
|
3998
|
+
}), c = L(() => String(t.modelValue || "").length), f = (w) => {
|
3999
|
+
const j = w.target.value;
|
4000
|
+
n("update:modelValue", j), n("input", j, w);
|
4001
|
+
}, h = (w) => {
|
4002
|
+
const j = w.target.value;
|
4003
|
+
n("change", j, w);
|
4004
4004
|
}, b = (w) => {
|
4005
|
-
s.value = !1,
|
4005
|
+
s.value = !1, n("blur", w);
|
4006
4006
|
}, d = (w) => {
|
4007
|
-
s.value = !0,
|
4008
|
-
},
|
4009
|
-
|
4010
|
-
},
|
4011
|
-
|
4012
|
-
},
|
4007
|
+
s.value = !0, n("focus", w);
|
4008
|
+
}, k = (w) => {
|
4009
|
+
n("keydown", w);
|
4010
|
+
}, p = (w) => {
|
4011
|
+
n("keyup", w);
|
4012
|
+
}, g = () => {
|
4013
4013
|
var w;
|
4014
|
-
|
4014
|
+
n("update:modelValue", ""), n("clear"), (w = l.value) == null || w.focus();
|
4015
4015
|
};
|
4016
4016
|
return o({
|
4017
4017
|
focus: () => {
|
@@ -4027,7 +4027,7 @@ const Jn = {
|
|
4027
4027
|
(w = l.value) == null || w.select();
|
4028
4028
|
},
|
4029
4029
|
ref: l
|
4030
|
-
}), (w,
|
4030
|
+
}), (w, T) => (m(), v("div", {
|
4031
4031
|
class: "x-input-group",
|
4032
4032
|
style: G({ width: e.width })
|
4033
4033
|
}, [
|
@@ -4036,57 +4036,57 @@ const Jn = {
|
|
4036
4036
|
ref: l,
|
4037
4037
|
type: e.type,
|
4038
4038
|
value: e.modelValue,
|
4039
|
-
placeholder:
|
4039
|
+
placeholder: i.value ? "" : e.placeholder,
|
4040
4040
|
disabled: e.disabled,
|
4041
4041
|
readonly: e.readonly,
|
4042
4042
|
required: e.required,
|
4043
4043
|
maxlength: e.maxlength,
|
4044
4044
|
minlength: e.minlength,
|
4045
4045
|
autocomplete: e.autocomplete,
|
4046
|
-
class:
|
4046
|
+
class: $([
|
4047
4047
|
"x-input",
|
4048
4048
|
{
|
4049
4049
|
"x-input--disabled": e.disabled,
|
4050
4050
|
"x-input--error": e.error,
|
4051
4051
|
"x-input--clearable": e.clearable && e.modelValue,
|
4052
|
-
"x-input--with-label":
|
4052
|
+
"x-input--with-label": i.value
|
4053
4053
|
}
|
4054
4054
|
]),
|
4055
|
-
onInput:
|
4055
|
+
onInput: f,
|
4056
4056
|
onBlur: b,
|
4057
4057
|
onFocus: d,
|
4058
|
-
onKeydown:
|
4059
|
-
onKeyup:
|
4060
|
-
onChange:
|
4061
|
-
}, null, 42,
|
4062
|
-
e.label ? (
|
4058
|
+
onKeydown: k,
|
4059
|
+
onKeyup: p,
|
4060
|
+
onChange: h
|
4061
|
+
}, null, 42, to),
|
4062
|
+
e.label ? (m(), v("label", {
|
4063
4063
|
key: 0,
|
4064
|
-
class:
|
4064
|
+
class: $([
|
4065
4065
|
"x-input-label",
|
4066
4066
|
{
|
4067
|
-
"x-input-label--active": s.value ||
|
4067
|
+
"x-input-label--active": s.value || r.value,
|
4068
4068
|
"x-input-label--error": e.error
|
4069
4069
|
}
|
4070
4070
|
])
|
4071
|
-
},
|
4072
|
-
e.clearable && e.modelValue && !e.disabled ? (
|
4071
|
+
}, I(e.label), 3)) : A("", !0),
|
4072
|
+
e.clearable && e.modelValue && !e.disabled ? (m(), v("button", {
|
4073
4073
|
key: 1,
|
4074
4074
|
type: "button",
|
4075
4075
|
class: "x-input-clear",
|
4076
|
-
onClick:
|
4077
|
-
onMousedown:
|
4076
|
+
onClick: g,
|
4077
|
+
onMousedown: T[0] || (T[0] = q(() => {
|
4078
4078
|
}, ["prevent"]))
|
4079
4079
|
}, [
|
4080
|
-
R(W(
|
4080
|
+
R(W(H), { icon: "bi:x-circle" })
|
4081
4081
|
], 32)) : A("", !0),
|
4082
|
-
e.showWordLimit && e.maxlength ? (
|
4082
|
+
e.showWordLimit && e.maxlength ? (m(), v("div", no, I(c.value) + " / " + I(e.maxlength), 1)) : A("", !0)
|
4083
4083
|
], 4));
|
4084
4084
|
}
|
4085
|
-
}),
|
4085
|
+
}), Do = /* @__PURE__ */ F(oo, [["__scopeId", "data-v-d7d149e3"]]), ao = { class: "x-checkboxes" }, lo = ["onClick"], so = { class: "checkbox-wrapper" }, co = ["checked", "disabled", "onChange"], go = { class: "checkbox-custom" }, io = {
|
4086
4086
|
key: 0,
|
4087
4087
|
class: "check-icon",
|
4088
4088
|
viewBox: "0 0 24 24"
|
4089
|
-
},
|
4089
|
+
}, ro = { class: "option-label" }, fo = /* @__PURE__ */ V({
|
4090
4090
|
__name: "index",
|
4091
4091
|
props: {
|
4092
4092
|
options: {},
|
@@ -4099,70 +4099,70 @@ const Jn = {
|
|
4099
4099
|
},
|
4100
4100
|
emits: ["update:modelValue", "change"],
|
4101
4101
|
setup(e, { expose: o, emit: a }) {
|
4102
|
-
const
|
4103
|
-
if (
|
4104
|
-
const b =
|
4102
|
+
const t = e, n = a, l = (h) => t.modelValue && t.modelValue.includes(h), s = (h) => {
|
4103
|
+
if (t.disabled) return;
|
4104
|
+
const b = t.options.find((p) => p.value === h);
|
4105
4105
|
if (b != null && b.disabled) return;
|
4106
|
-
const d = [...
|
4107
|
-
if (
|
4108
|
-
d.splice(
|
4106
|
+
const d = [...t.modelValue], k = d.indexOf(h);
|
4107
|
+
if (k > -1)
|
4108
|
+
d.splice(k, 1);
|
4109
4109
|
else {
|
4110
|
-
if (
|
4110
|
+
if (t.maxSelections > 0 && d.length >= t.maxSelections)
|
4111
4111
|
return;
|
4112
|
-
d.push(
|
4112
|
+
d.push(h);
|
4113
4113
|
}
|
4114
|
-
|
4115
|
-
},
|
4116
|
-
!
|
4114
|
+
n("update:modelValue", d), n("change", d);
|
4115
|
+
}, i = (h) => {
|
4116
|
+
!t.disabled && !h.disabled && s(h.value);
|
4117
4117
|
};
|
4118
4118
|
return o({
|
4119
4119
|
clearAll: () => {
|
4120
|
-
|
4120
|
+
t.disabled || (n("update:modelValue", []), n("change", []));
|
4121
4121
|
},
|
4122
4122
|
selectAll: () => {
|
4123
|
-
if (
|
4124
|
-
const b =
|
4125
|
-
|
4123
|
+
if (t.disabled) return;
|
4124
|
+
const b = t.options.filter((d) => !d.disabled).map((d) => d.value);
|
4125
|
+
t.maxSelections > 0 ? (n("update:modelValue", b.slice(0, t.maxSelections)), n("change", b.slice(0, t.maxSelections))) : (n("update:modelValue", b), n("change", b));
|
4126
4126
|
},
|
4127
|
-
removeOption: (
|
4128
|
-
s(
|
4127
|
+
removeOption: (h) => {
|
4128
|
+
s(h);
|
4129
4129
|
}
|
4130
|
-
}), (
|
4130
|
+
}), (h, b) => (m(), v("div", ao, [
|
4131
4131
|
y("div", {
|
4132
|
-
class:
|
4132
|
+
class: $(["options-container", [
|
4133
4133
|
`options-container--${e.layout}`,
|
4134
4134
|
{ "options-container--disabled": e.disabled }
|
4135
4135
|
]]),
|
4136
4136
|
style: G(e.layout === "grid" ? { gridTemplateColumns: `repeat(${e.columns}, 1fr)` } : {})
|
4137
4137
|
}, [
|
4138
|
-
(
|
4138
|
+
(m(!0), v(z, null, D(e.options, (d) => (m(), v("div", {
|
4139
4139
|
key: d.value,
|
4140
|
-
class:
|
4140
|
+
class: $(["option-item", {
|
4141
4141
|
"option-selected": l(d.value),
|
4142
4142
|
"option-disabled": e.disabled || d.disabled
|
4143
4143
|
}]),
|
4144
|
-
onClick: (
|
4144
|
+
onClick: (k) => i(d)
|
4145
4145
|
}, [
|
4146
4146
|
y("div", so, [
|
4147
4147
|
y("input", {
|
4148
4148
|
type: "checkbox",
|
4149
4149
|
checked: l(d.value),
|
4150
4150
|
disabled: e.disabled || d.disabled,
|
4151
|
-
onChange:
|
4151
|
+
onChange: q((k) => s(d.value), ["stop"]),
|
4152
4152
|
class: "checkbox-input"
|
4153
4153
|
}, null, 40, co),
|
4154
4154
|
y("div", go, [
|
4155
|
-
l(d.value) ? (
|
4155
|
+
l(d.value) ? (m(), v("svg", io, [...b[0] || (b[0] = [
|
4156
4156
|
y("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }, null, -1)
|
4157
4157
|
])])) : A("", !0)
|
4158
4158
|
])
|
4159
4159
|
]),
|
4160
|
-
y("span",
|
4160
|
+
y("span", ro, I(d.label), 1)
|
4161
4161
|
], 10, lo))), 128))
|
4162
4162
|
], 6)
|
4163
4163
|
]));
|
4164
4164
|
}
|
4165
|
-
}),
|
4165
|
+
}), No = /* @__PURE__ */ F(fo, [["__scopeId", "data-v-05984fcf"]]), po = ["onClick", "disabled", "aria-expanded", "aria-controls"], ho = { class: "accordion-title" }, mo = { class: "accordion-icon" }, uo = ["id"], vo = { class: "accordion-body" }, bo = /* @__PURE__ */ V({
|
4166
4166
|
__name: "index",
|
4167
4167
|
props: {
|
4168
4168
|
items: {},
|
@@ -4173,73 +4173,73 @@ const Jn = {
|
|
4173
4173
|
},
|
4174
4174
|
emits: ["change", "item-click"],
|
4175
4175
|
setup(e, { expose: o, emit: a }) {
|
4176
|
-
const
|
4177
|
-
|
4178
|
-
const
|
4179
|
-
|
4176
|
+
const t = e, n = a, l = B(new Set(t.defaultOpen)), s = B({}), i = B({}), r = (p, g) => {
|
4177
|
+
p && (i.value[g] = p, N(() => {
|
4178
|
+
const x = p.querySelector(".accordion-body");
|
4179
|
+
x && (s.value[g] = x.scrollHeight);
|
4180
4180
|
}));
|
4181
|
-
}, c = (
|
4182
|
-
var
|
4183
|
-
if (
|
4181
|
+
}, c = (p) => {
|
4182
|
+
var x;
|
4183
|
+
if (t.disabled || (x = t.items[p]) != null && x.disabled)
|
4184
4184
|
return;
|
4185
|
-
const
|
4186
|
-
|
4187
|
-
},
|
4188
|
-
return J(() =>
|
4189
|
-
l.value = new Set(
|
4190
|
-
}, { deep: !0 }), J(() =>
|
4191
|
-
|
4192
|
-
Object.keys(
|
4193
|
-
const
|
4194
|
-
if (
|
4195
|
-
const
|
4196
|
-
|
4185
|
+
const g = l.value.has(p);
|
4186
|
+
t.allowMultiple ? g ? l.value.delete(p) : l.value.add(p) : g ? l.value.clear() : (l.value.clear(), l.value.add(p)), n("item-click", p, !g), n("change", Array.from(l.value));
|
4187
|
+
}, f = (p) => l.value.has(p);
|
4188
|
+
return J(() => t.defaultOpen, (p) => {
|
4189
|
+
l.value = new Set(p);
|
4190
|
+
}, { deep: !0 }), J(() => t.items, () => {
|
4191
|
+
N(() => {
|
4192
|
+
Object.keys(i.value).forEach((p) => {
|
4193
|
+
const g = parseInt(p), x = i.value[g];
|
4194
|
+
if (x) {
|
4195
|
+
const E = x.querySelector(".accordion-body");
|
4196
|
+
E && (s.value[g] = E.scrollHeight);
|
4197
4197
|
}
|
4198
4198
|
});
|
4199
4199
|
});
|
4200
4200
|
}, { deep: !0 }), o({
|
4201
|
-
openItem: (
|
4202
|
-
var
|
4203
|
-
!
|
4201
|
+
openItem: (p) => {
|
4202
|
+
var g;
|
4203
|
+
!t.disabled && !((g = t.items[p]) != null && g.disabled) && (l.value.has(p) || (t.allowMultiple || l.value.clear(), l.value.add(p), n("change", Array.from(l.value))));
|
4204
4204
|
},
|
4205
|
-
closeItem: (
|
4206
|
-
l.value.has(
|
4205
|
+
closeItem: (p) => {
|
4206
|
+
l.value.has(p) && (l.value.delete(p), n("change", Array.from(l.value)));
|
4207
4207
|
},
|
4208
4208
|
openAll: () => {
|
4209
|
-
|
4210
|
-
|
4211
|
-
}),
|
4209
|
+
t.allowMultiple && !t.disabled && (t.items.forEach((p, g) => {
|
4210
|
+
p.disabled || l.value.add(g);
|
4211
|
+
}), n("change", Array.from(l.value)));
|
4212
4212
|
},
|
4213
4213
|
closeAll: () => {
|
4214
|
-
l.value.clear(),
|
4214
|
+
l.value.clear(), n("change", []);
|
4215
4215
|
},
|
4216
4216
|
toggle: c
|
4217
|
-
}), (
|
4218
|
-
class:
|
4217
|
+
}), (p, g) => (m(), v("div", {
|
4218
|
+
class: $(["accordion-container", { "accordion-container--bordered": e.bordered }])
|
4219
4219
|
}, [
|
4220
|
-
(
|
4221
|
-
key:
|
4222
|
-
class:
|
4223
|
-
"is-open":
|
4224
|
-
"is-disabled": e.disabled ||
|
4220
|
+
(m(!0), v(z, null, D(e.items, (x, E) => (m(), v("div", {
|
4221
|
+
key: x.id || E,
|
4222
|
+
class: $(["accordion-item", {
|
4223
|
+
"is-open": f(E),
|
4224
|
+
"is-disabled": e.disabled || x.disabled
|
4225
4225
|
}])
|
4226
4226
|
}, [
|
4227
4227
|
y("button", {
|
4228
|
-
onClick: (C) => c(
|
4228
|
+
onClick: (C) => c(E),
|
4229
4229
|
class: "accordion-header",
|
4230
|
-
disabled: e.disabled ||
|
4231
|
-
"aria-expanded":
|
4232
|
-
"aria-controls": `accordion-content-${
|
4230
|
+
disabled: e.disabled || x.disabled,
|
4231
|
+
"aria-expanded": f(E),
|
4232
|
+
"aria-controls": `accordion-content-${E}`
|
4233
4233
|
}, [
|
4234
|
-
y("span", ho,
|
4234
|
+
y("span", ho, I(x.title), 1),
|
4235
4235
|
y("div", mo, [
|
4236
|
-
(
|
4237
|
-
class:
|
4236
|
+
(m(), v("svg", {
|
4237
|
+
class: $(["accordion-arrow", { "accordion-arrow--rotate": f(E) }]),
|
4238
4238
|
fill: "none",
|
4239
4239
|
stroke: "currentColor",
|
4240
4240
|
viewBox: "0 0 24 24",
|
4241
4241
|
strokeWidth: "2"
|
4242
|
-
}, [...
|
4242
|
+
}, [...g[0] || (g[0] = [
|
4243
4243
|
y("path", {
|
4244
4244
|
strokeLinecap: "round",
|
4245
4245
|
strokeLinejoin: "round",
|
@@ -4249,18 +4249,18 @@ const Jn = {
|
|
4249
4249
|
])
|
4250
4250
|
], 8, po),
|
4251
4251
|
y("div", {
|
4252
|
-
id: `accordion-content-${
|
4252
|
+
id: `accordion-content-${E}`,
|
4253
4253
|
class: "accordion-content",
|
4254
|
-
style: G({ maxHeight:
|
4254
|
+
style: G({ maxHeight: f(E) ? `${s.value[E]}px` : "0px" }),
|
4255
4255
|
ref_for: !0,
|
4256
|
-
ref: (C) =>
|
4256
|
+
ref: (C) => r(C, E)
|
4257
4257
|
}, [
|
4258
|
-
y("div", vo,
|
4258
|
+
y("div", vo, I(x.content), 1)
|
4259
4259
|
], 12, uo)
|
4260
4260
|
], 2))), 128))
|
4261
4261
|
], 2));
|
4262
4262
|
}
|
4263
|
-
}),
|
4263
|
+
}), _o = /* @__PURE__ */ F(bo, [["__scopeId", "data-v-c5fef037"]]), wo = { class: "thumbnail-container-wrapper relative" }, yo = ["onMouseenter", "onClick"], Co = ["src", "alt"], xo = { class: "thumbnail-index" }, So = /* @__PURE__ */ V({
|
4264
4264
|
__name: "index",
|
4265
4265
|
props: {
|
4266
4266
|
images: { default: () => [] },
|
@@ -4270,83 +4270,83 @@ const Jn = {
|
|
4270
4270
|
},
|
4271
4271
|
emits: ["update:modelValue", "change", "hover"],
|
4272
4272
|
setup(e, { expose: o, emit: a }) {
|
4273
|
-
const
|
4274
|
-
|
4275
|
-
},
|
4276
|
-
|
4277
|
-
},
|
4278
|
-
|
4279
|
-
},
|
4280
|
-
},
|
4281
|
-
l.value =
|
4282
|
-
w(
|
4283
|
-
|
4273
|
+
const t = e, n = a, l = B(t.modelValue), s = B(null), i = B([]), r = B(!1), c = B(!1), f = B(0), h = B(!1), b = B(!1), d = () => {
|
4274
|
+
T();
|
4275
|
+
}, k = (u, P) => {
|
4276
|
+
u && u instanceof HTMLElement && (i.value[P] = u);
|
4277
|
+
}, p = (u) => {
|
4278
|
+
n("hover", u);
|
4279
|
+
}, g = () => {
|
4280
|
+
}, x = (u) => {
|
4281
|
+
l.value = u, n("update:modelValue", u), n("change", u), t.autoScroll && N(() => {
|
4282
|
+
w(u), setTimeout(() => {
|
4283
|
+
T();
|
4284
4284
|
}, 300);
|
4285
4285
|
});
|
4286
|
-
},
|
4286
|
+
}, E = () => {
|
4287
4287
|
if (!s.value) return;
|
4288
|
-
const
|
4289
|
-
|
4290
|
-
left: -
|
4288
|
+
const u = s.value, P = u.clientWidth * 0.8;
|
4289
|
+
u.scrollBy({
|
4290
|
+
left: -P,
|
4291
4291
|
behavior: "smooth"
|
4292
4292
|
});
|
4293
4293
|
}, C = () => {
|
4294
4294
|
if (!s.value) return;
|
4295
|
-
const
|
4296
|
-
|
4297
|
-
left:
|
4295
|
+
const u = s.value, P = u.clientWidth * 0.8;
|
4296
|
+
u.scrollBy({
|
4297
|
+
left: P,
|
4298
4298
|
behavior: "smooth"
|
4299
4299
|
});
|
4300
|
-
}, w = (
|
4301
|
-
if (!s.value ||
|
4302
|
-
const
|
4303
|
-
if (!
|
4304
|
-
const M = 2, Ue =
|
4305
|
-
let
|
4306
|
-
|
4307
|
-
const Ye =
|
4308
|
-
|
4309
|
-
left:
|
4300
|
+
}, w = (u) => {
|
4301
|
+
if (!s.value || i.value.length === 0) return;
|
4302
|
+
const P = s.value, S = i.value[u];
|
4303
|
+
if (!S) return;
|
4304
|
+
const M = 2, Ue = S.offsetWidth + 8;
|
4305
|
+
let te = 0;
|
4306
|
+
u >= M && (te = (u - M) * Ue);
|
4307
|
+
const Ye = P.scrollWidth - P.clientWidth;
|
4308
|
+
te = Math.max(0, Math.min(te, Ye)), P.scrollTo({
|
4309
|
+
left: te,
|
4310
4310
|
behavior: "smooth"
|
4311
4311
|
});
|
4312
|
-
},
|
4312
|
+
}, T = () => {
|
4313
4313
|
if (!s.value) return;
|
4314
|
-
const
|
4315
|
-
|
4316
|
-
const M =
|
4317
|
-
|
4318
|
-
},
|
4314
|
+
const u = s.value, P = u.scrollLeft, S = u.scrollWidth - u.clientWidth;
|
4315
|
+
r.value = P > 0, c.value = P < S, S > 0 ? f.value = P / S * 100 : f.value = 0;
|
4316
|
+
const M = j();
|
4317
|
+
h.value = t.images.length > M && r.value, b.value = t.images.length > M && c.value;
|
4318
|
+
}, j = () => {
|
4319
4319
|
var ie;
|
4320
|
-
if (!s.value ||
|
4321
|
-
const
|
4322
|
-
return Math.floor(
|
4323
|
-
},
|
4324
|
-
|
4320
|
+
if (!s.value || i.value.length === 0) return 4;
|
4321
|
+
const P = s.value.clientWidth - 32, _ = (((ie = i.value[0]) == null ? void 0 : ie.offsetWidth) || 80) + 12;
|
4322
|
+
return Math.floor(P / _);
|
4323
|
+
}, X = (u) => {
|
4324
|
+
u >= 0 && u < t.images.length && x(u);
|
4325
4325
|
};
|
4326
|
-
return J(() =>
|
4327
|
-
|
4328
|
-
w(
|
4326
|
+
return J(() => t.modelValue, (u) => {
|
4327
|
+
u !== void 0 && u !== l.value && (l.value = u, t.autoScroll && N(() => {
|
4328
|
+
w(u);
|
4329
4329
|
}));
|
4330
|
-
}), J(() =>
|
4331
|
-
|
4332
|
-
|
4330
|
+
}), J(() => t.images, () => {
|
4331
|
+
N(() => {
|
4332
|
+
T();
|
4333
4333
|
});
|
4334
4334
|
}, { deep: !0 }), se(() => {
|
4335
|
-
|
4336
|
-
|
4335
|
+
N(() => {
|
4336
|
+
T();
|
4337
4337
|
});
|
4338
4338
|
}), o({
|
4339
|
-
setCurrentIndex:
|
4340
|
-
scrollLeft:
|
4339
|
+
setCurrentIndex: X,
|
4340
|
+
scrollLeft: E,
|
4341
4341
|
scrollRight: C,
|
4342
|
-
updateScrollState:
|
4343
|
-
}), (
|
4344
|
-
|
4342
|
+
updateScrollState: T
|
4343
|
+
}), (u, P) => (m(), v("div", wo, [
|
4344
|
+
h.value ? (m(), v("button", {
|
4345
4345
|
key: 0,
|
4346
|
-
onClick:
|
4346
|
+
onClick: E,
|
4347
4347
|
class: "scroll-arrow scroll-arrow-left",
|
4348
4348
|
"aria-label": "向左滚动"
|
4349
|
-
}, [...
|
4349
|
+
}, [...P[1] || (P[1] = [
|
4350
4350
|
y("svg", {
|
4351
4351
|
width: "24",
|
4352
4352
|
height: "24",
|
@@ -4364,35 +4364,35 @@ const Jn = {
|
|
4364
4364
|
onScroll: d,
|
4365
4365
|
class: "thumbnail-scroll-container"
|
4366
4366
|
}, [
|
4367
|
-
(
|
4367
|
+
(m(!0), v(z, null, D(e.images, (S, M) => (m(), v("div", {
|
4368
4368
|
key: M,
|
4369
4369
|
ref_for: !0,
|
4370
|
-
ref: (
|
4371
|
-
onMouseenter: (
|
4372
|
-
onMouseleave:
|
4373
|
-
onClick: (
|
4374
|
-
class:
|
4370
|
+
ref: (_) => k(_, M),
|
4371
|
+
onMouseenter: (_) => p(M),
|
4372
|
+
onMouseleave: P[0] || (P[0] = (_) => g()),
|
4373
|
+
onClick: (_) => x(M),
|
4374
|
+
class: $(["thumbnail-item", {
|
4375
4375
|
"thumbnail-item--active": l.value === M,
|
4376
4376
|
"thumbnail-item--inactive": l.value !== M
|
4377
4377
|
}])
|
4378
4378
|
}, [
|
4379
4379
|
y("img", {
|
4380
|
-
src:
|
4380
|
+
src: S,
|
4381
4381
|
alt: `缩略图 ${M + 1}`,
|
4382
|
-
class:
|
4382
|
+
class: $(["thumbnail-image", {
|
4383
4383
|
"thumbnail-image--active": l.value === M,
|
4384
4384
|
"thumbnail-image--inactive": l.value !== M
|
4385
4385
|
}])
|
4386
4386
|
}, null, 10, Co),
|
4387
|
-
y("div",
|
4387
|
+
y("div", xo, I(M + 1), 1)
|
4388
4388
|
], 42, yo))), 128))
|
4389
4389
|
], 544),
|
4390
|
-
b.value ? (
|
4390
|
+
b.value ? (m(), v("button", {
|
4391
4391
|
key: 1,
|
4392
4392
|
onClick: C,
|
4393
4393
|
class: "scroll-arrow scroll-arrow-right",
|
4394
4394
|
"aria-label": "向右滚动"
|
4395
|
-
}, [...
|
4395
|
+
}, [...P[2] || (P[2] = [
|
4396
4396
|
y("svg", {
|
4397
4397
|
width: "24",
|
4398
4398
|
height: "24",
|
@@ -4406,7 +4406,7 @@ const Jn = {
|
|
4406
4406
|
])])) : A("", !0)
|
4407
4407
|
]));
|
4408
4408
|
}
|
4409
|
-
}),
|
4409
|
+
}), Go = /* @__PURE__ */ F(So, [["__scopeId", "data-v-809b97a6"]]), Eo = /* @__PURE__ */ V({
|
4410
4410
|
__name: "index",
|
4411
4411
|
props: {
|
4412
4412
|
width: { default: "100%" },
|
@@ -4418,7 +4418,7 @@ const Jn = {
|
|
4418
4418
|
style: { default: () => ({}) }
|
4419
4419
|
},
|
4420
4420
|
setup(e) {
|
4421
|
-
const o = e, a =
|
4421
|
+
const o = e, a = L(() => typeof o.width == "string" ? o.width.includes("%") || o.width.includes("px") || o.width.includes("rem") ? "" : `w-${o.width}` : ""), t = L(() => typeof o.height == "string" ? o.height.includes("%") || o.height.includes("px") || o.height.includes("rem") ? "" : `h-${o.height}` : ""), n = L(() => {
|
4422
4422
|
switch (o.shape) {
|
4423
4423
|
case "circle":
|
4424
4424
|
return "rounded-full";
|
@@ -4427,26 +4427,26 @@ const Jn = {
|
|
4427
4427
|
default:
|
4428
4428
|
return "rounded";
|
4429
4429
|
}
|
4430
|
-
}), l =
|
4431
|
-
const
|
4432
|
-
return typeof o.width == "string" && (o.width.includes("%") || o.width.includes("px") || o.width.includes("rem")) ?
|
4430
|
+
}), l = L(() => o.class), s = L(() => {
|
4431
|
+
const i = { ...o.style };
|
4432
|
+
return typeof o.width == "string" && (o.width.includes("%") || o.width.includes("px") || o.width.includes("rem")) ? i.width = o.width : typeof o.width == "number" && (i.width = `${o.width}px`), typeof o.height == "string" && (o.height.includes("%") || o.height.includes("px") || o.height.includes("rem")) ? i.height = o.height : typeof o.height == "number" && (i.height = `${o.height}px`), i;
|
4433
4433
|
});
|
4434
|
-
return (
|
4434
|
+
return (i, r) => e.loading ? (m(), v("div", {
|
4435
4435
|
key: 0,
|
4436
|
-
class:
|
4436
|
+
class: $(["bg-gray-200", [
|
4437
4437
|
a.value,
|
4438
|
-
n.value,
|
4439
4438
|
t.value,
|
4439
|
+
n.value,
|
4440
4440
|
l.value,
|
4441
4441
|
{ "animate-pulse": e.animated }
|
4442
4442
|
]]),
|
4443
4443
|
style: G(s.value)
|
4444
|
-
}, null, 6)) :
|
4444
|
+
}, null, 6)) : K(i.$slots, "default", { key: 1 }, void 0, !0);
|
4445
4445
|
}
|
4446
|
-
}),
|
4446
|
+
}), Wo = /* @__PURE__ */ F(Eo, [["__scopeId", "data-v-db4a4465"]]), ko = {
|
4447
4447
|
key: 0,
|
4448
4448
|
class: "modal-header"
|
4449
|
-
},
|
4449
|
+
}, Po = { class: "modal-title" }, jo = { class: "modal-body" }, Mo = {
|
4450
4450
|
key: 1,
|
4451
4451
|
class: "modal-footer"
|
4452
4452
|
}, Ao = ["disabled"], Io = {
|
@@ -4473,22 +4473,22 @@ const Jn = {
|
|
4473
4473
|
},
|
4474
4474
|
emits: ["update:visible", "close", "cancel", "confirm", "opened", "closed"],
|
4475
4475
|
setup(e, { expose: o, emit: a }) {
|
4476
|
-
const
|
4477
|
-
|
4476
|
+
const t = e, n = a, l = () => {
|
4477
|
+
n("update:visible", !1), n("close");
|
4478
4478
|
}, s = () => {
|
4479
|
-
|
4480
|
-
},
|
4481
|
-
|
4482
|
-
},
|
4483
|
-
|
4484
|
-
}, c = (
|
4485
|
-
|
4479
|
+
n("cancel"), n("update:visible", !1);
|
4480
|
+
}, i = () => {
|
4481
|
+
n("confirm");
|
4482
|
+
}, r = () => {
|
4483
|
+
t.maskClosable && l();
|
4484
|
+
}, c = (f) => {
|
4485
|
+
f.key === "Escape" && t.escClosable && t.visible && l();
|
4486
4486
|
};
|
4487
|
-
return J(() =>
|
4488
|
-
|
4487
|
+
return J(() => t.visible, (f) => {
|
4488
|
+
f ? (document.addEventListener("keydown", c), document.body.style.overflow = "hidden", n("opened")) : (document.removeEventListener("keydown", c), document.body.style.overflow = "", n("closed"));
|
4489
4489
|
}), o({
|
4490
4490
|
close: l
|
4491
|
-
}), (
|
4491
|
+
}), (f, h) => (m(), fe(Je, { to: "body" }, [
|
4492
4492
|
R(pe, {
|
4493
4493
|
"enter-active-class": "transition-opacity duration-300",
|
4494
4494
|
"enter-from-class": "opacity-0",
|
@@ -4498,10 +4498,10 @@ const Jn = {
|
|
4498
4498
|
"leave-to-class": "opacity-0"
|
4499
4499
|
}, {
|
4500
4500
|
default: Z(() => [
|
4501
|
-
e.visible ? (
|
4501
|
+
e.visible ? (m(), v("div", {
|
4502
4502
|
key: 0,
|
4503
4503
|
class: "modal-mask",
|
4504
|
-
onClick:
|
4504
|
+
onClick: r
|
4505
4505
|
}, [
|
4506
4506
|
R(pe, {
|
4507
4507
|
"enter-active-class": "transition-all duration-300",
|
@@ -4512,26 +4512,26 @@ const Jn = {
|
|
4512
4512
|
"leave-to-class": "opacity-0 scale-95"
|
4513
4513
|
}, {
|
4514
4514
|
default: Z(() => [
|
4515
|
-
e.visible ? (
|
4515
|
+
e.visible ? (m(), v("div", {
|
4516
4516
|
key: 0,
|
4517
|
-
class:
|
4517
|
+
class: $(["modal-container", [
|
4518
4518
|
`modal-container--${e.size}`,
|
4519
4519
|
{ "modal-container--fullscreen": e.fullscreen }
|
4520
4520
|
]]),
|
4521
4521
|
style: G({ width: e.width }),
|
4522
|
-
onClick:
|
4522
|
+
onClick: h[0] || (h[0] = q(() => {
|
4523
4523
|
}, ["stop"]))
|
4524
4524
|
}, [
|
4525
|
-
e.showHeader ? (
|
4526
|
-
|
4527
|
-
y("h3",
|
4525
|
+
e.showHeader ? (m(), v("div", ko, [
|
4526
|
+
K(f.$slots, "header", {}, () => [
|
4527
|
+
y("h3", Po, I(e.title), 1)
|
4528
4528
|
], !0),
|
4529
|
-
e.showClose ? (
|
4529
|
+
e.showClose ? (m(), v("button", {
|
4530
4530
|
key: 0,
|
4531
4531
|
class: "modal-close",
|
4532
4532
|
onClick: l,
|
4533
4533
|
"aria-label": "关闭"
|
4534
|
-
}, [...
|
4534
|
+
}, [...h[1] || (h[1] = [
|
4535
4535
|
y("svg", {
|
4536
4536
|
width: "24",
|
4537
4537
|
height: "24",
|
@@ -4544,24 +4544,24 @@ const Jn = {
|
|
4544
4544
|
], -1)
|
4545
4545
|
])])) : A("", !0)
|
4546
4546
|
])) : A("", !0),
|
4547
|
-
y("div",
|
4548
|
-
|
4547
|
+
y("div", jo, [
|
4548
|
+
K(f.$slots, "default", {}, void 0, !0)
|
4549
4549
|
]),
|
4550
|
-
e.showFooter ? (
|
4551
|
-
|
4552
|
-
e.showCancel ? (
|
4550
|
+
e.showFooter ? (m(), v("div", Mo, [
|
4551
|
+
K(f.$slots, "footer", {}, () => [
|
4552
|
+
e.showCancel ? (m(), v("button", {
|
4553
4553
|
key: 0,
|
4554
4554
|
class: "modal-btn modal-btn--cancel",
|
4555
4555
|
onClick: s
|
4556
|
-
},
|
4557
|
-
e.showConfirm ? (
|
4556
|
+
}, I(e.cancelText), 1)) : A("", !0),
|
4557
|
+
e.showConfirm ? (m(), v("button", {
|
4558
4558
|
key: 1,
|
4559
4559
|
class: "modal-btn modal-btn--confirm",
|
4560
|
-
onClick:
|
4560
|
+
onClick: i,
|
4561
4561
|
disabled: e.confirmLoading
|
4562
4562
|
}, [
|
4563
|
-
e.confirmLoading ? (
|
4564
|
-
|
4563
|
+
e.confirmLoading ? (m(), v("span", Io)) : A("", !0),
|
4564
|
+
be(" " + I(e.confirmText), 1)
|
4565
4565
|
], 8, Ao)) : A("", !0)
|
4566
4566
|
], !0)
|
4567
4567
|
])) : A("", !0)
|
@@ -4575,7 +4575,42 @@ const Jn = {
|
|
4575
4575
|
})
|
4576
4576
|
]));
|
4577
4577
|
}
|
4578
|
-
}),
|
4578
|
+
}), Ko = /* @__PURE__ */ F($o, [["__scopeId", "data-v-e43c9a70"]]), To = { class: "x-tooltip-trigger" }, Bo = { class: "tooltip-label" }, Lo = { class: "tooltip-text" }, Xo = { class: "tooltip-hover-text" }, zo = /* @__PURE__ */ V({
|
4579
|
+
__name: "index",
|
4580
|
+
props: {
|
4581
|
+
content: {},
|
4582
|
+
placement: { default: "top" },
|
4583
|
+
variant: { default: "basic" },
|
4584
|
+
label: { default: "Hover" },
|
4585
|
+
hoverText: { default: "" }
|
4586
|
+
},
|
4587
|
+
setup(e) {
|
4588
|
+
return (o, a) => (m(), v("div", {
|
4589
|
+
class: $([
|
4590
|
+
e.variant === "basic" ? "x-tooltip-wrapper" : "x-tooltip-rich-wrapper",
|
4591
|
+
e.variant === "rich" && `rich-${e.placement}`
|
4592
|
+
])
|
4593
|
+
}, [
|
4594
|
+
e.variant === "basic" ? (m(), v(z, { key: 0 }, [
|
4595
|
+
y("div", To, [
|
4596
|
+
K(o.$slots, "default", {}, void 0, !0)
|
4597
|
+
]),
|
4598
|
+
y("div", {
|
4599
|
+
class: $(["x-tooltip", `tooltip-${e.placement}`])
|
4600
|
+
}, [
|
4601
|
+
be(I(e.content) + " ", 1),
|
4602
|
+
y("div", {
|
4603
|
+
class: $(["tooltip-arrow", `arrow-${e.placement}`])
|
4604
|
+
}, null, 2)
|
4605
|
+
], 2)
|
4606
|
+
], 64)) : (m(), v(z, { key: 1 }, [
|
4607
|
+
y("span", Bo, I(e.label), 1),
|
4608
|
+
y("span", Lo, I(e.content), 1),
|
4609
|
+
y("span", Xo, I(e.hoverText || e.label), 1)
|
4610
|
+
], 64))
|
4611
|
+
], 2));
|
4612
|
+
}
|
4613
|
+
}), Ho = /* @__PURE__ */ F(zo, [["__scopeId", "data-v-6d3b782b"]]), qo = () => {
|
4579
4614
|
const e = () => {
|
4580
4615
|
let c = document.getElementById("xl-message-container");
|
4581
4616
|
return c || (c = document.createElement("div"), c.id = "xl-message-container", c.style.cssText = `
|
@@ -4588,7 +4623,7 @@ const Jn = {
|
|
4588
4623
|
gap: 10px;
|
4589
4624
|
`, document.body.appendChild(c)), c;
|
4590
4625
|
}, o = (c) => {
|
4591
|
-
const
|
4626
|
+
const f = {
|
4592
4627
|
success: {
|
4593
4628
|
bgColor: "#f0fdf4",
|
4594
4629
|
borderColor: "#86efac",
|
@@ -4618,10 +4653,10 @@ const Jn = {
|
|
4618
4653
|
iconSvg: '<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>'
|
4619
4654
|
}
|
4620
4655
|
};
|
4621
|
-
return
|
4656
|
+
return f[c] || f.info;
|
4622
4657
|
}, a = (c) => {
|
4623
|
-
const
|
4624
|
-
|
4658
|
+
const f = e(), h = c.type || "info", b = c.duration !== void 0 ? c.duration : 3e3, d = o(h), k = `xl-msg-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, p = document.createElement("div");
|
4659
|
+
p.id = k, p.style.cssText = `
|
4625
4660
|
background-color: ${d.bgColor};
|
4626
4661
|
border: 1px solid ${d.borderColor};
|
4627
4662
|
color: ${d.textColor};
|
@@ -4633,7 +4668,7 @@ const Jn = {
|
|
4633
4668
|
opacity: 0;
|
4634
4669
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
4635
4670
|
pointer-events: auto;
|
4636
|
-
`,
|
4671
|
+
`, p.innerHTML = `
|
4637
4672
|
<div style="display: flex; align-items: flex-start; gap: 12px;">
|
4638
4673
|
<div style="flex-shrink: 0; color: ${d.iconColor}; margin-top: 2px;">
|
4639
4674
|
${d.iconSvg}
|
@@ -4648,30 +4683,30 @@ const Jn = {
|
|
4648
4683
|
style="flex-shrink: 0; background: none; border: none; padding: 4px; cursor: pointer; color: ${d.textColor}; opacity: 0.5; border-radius: 4px; transition: all 0.15s; display: flex; align-items: center; justify-content: center;"
|
4649
4684
|
onmouseover="this.style.opacity='1'; this.style.backgroundColor='rgba(0,0,0,0.05)';"
|
4650
4685
|
onmouseout="this.style.opacity='0.5'; this.style.backgroundColor='transparent';"
|
4651
|
-
onclick="document.getElementById('${
|
4686
|
+
onclick="document.getElementById('${k}')?.remove()"
|
4652
4687
|
>
|
4653
4688
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
4654
4689
|
<path d="M18 6L6 18M6 6l12 12"/>
|
4655
4690
|
</svg>
|
4656
4691
|
</button>
|
4657
4692
|
</div>
|
4658
|
-
`,
|
4693
|
+
`, f.appendChild(p), requestAnimationFrame(() => {
|
4659
4694
|
requestAnimationFrame(() => {
|
4660
|
-
|
4695
|
+
p.style.transform = "translateX(0)", p.style.opacity = "1";
|
4661
4696
|
});
|
4662
4697
|
}), b > 0 && setTimeout(() => {
|
4663
|
-
|
4698
|
+
t(k);
|
4664
4699
|
}, b);
|
4665
|
-
},
|
4666
|
-
const
|
4667
|
-
|
4668
|
-
|
4700
|
+
}, t = (c) => {
|
4701
|
+
const f = document.getElementById(c);
|
4702
|
+
f && (f.style.transform = "translateX(100%)", f.style.opacity = "0", setTimeout(() => {
|
4703
|
+
f.parentNode && f.parentNode.removeChild(f);
|
4669
4704
|
}, 300));
|
4670
4705
|
};
|
4671
4706
|
return {
|
4672
4707
|
show: a,
|
4673
4708
|
confirm: (c) => {
|
4674
|
-
const
|
4709
|
+
const f = c.type || "info", h = o(f), b = `xl-confirm-${Date.now()}`, d = document.createElement("div");
|
4675
4710
|
d.id = b, d.style.cssText = `
|
4676
4711
|
position: fixed;
|
4677
4712
|
inset: 0;
|
@@ -4684,7 +4719,7 @@ const Jn = {
|
|
4684
4719
|
transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
4685
4720
|
backdrop-filter: blur(4px);
|
4686
4721
|
`;
|
4687
|
-
const
|
4722
|
+
const k = `
|
4688
4723
|
<div class="xl-confirm-dialog" style="
|
4689
4724
|
background-color: white;
|
4690
4725
|
border-radius: 12px;
|
@@ -4698,8 +4733,8 @@ const Jn = {
|
|
4698
4733
|
">
|
4699
4734
|
<div style="padding: 24px;">
|
4700
4735
|
<div style="display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px;">
|
4701
|
-
<div style="flex-shrink: 0; color: ${
|
4702
|
-
${
|
4736
|
+
<div style="flex-shrink: 0; color: ${h.iconColor}; margin-top: 2px;">
|
4737
|
+
${h.iconSvg}
|
4703
4738
|
</div>
|
4704
4739
|
<div style="flex: 1;">
|
4705
4740
|
<h3 style="font-size: 18px; font-weight: 600; color: #1a1a1a; line-height: 1.5; margin: 0;">
|
@@ -4759,61 +4794,204 @@ const Jn = {
|
|
4759
4794
|
</div>
|
4760
4795
|
</div>
|
4761
4796
|
`;
|
4762
|
-
d.innerHTML =
|
4797
|
+
d.innerHTML = k, document.body.appendChild(d), requestAnimationFrame(() => {
|
4763
4798
|
d.style.opacity = "1";
|
4764
4799
|
const C = d.querySelector(".xl-confirm-dialog");
|
4765
4800
|
C && requestAnimationFrame(() => {
|
4766
4801
|
C.style.transform = "scale(1)", C.style.opacity = "1";
|
4767
4802
|
});
|
4768
4803
|
});
|
4769
|
-
const
|
4804
|
+
const p = d.querySelector(".xl-confirm-ok"), g = d.querySelector(".xl-confirm-cancel"), x = () => {
|
4770
4805
|
const C = d.querySelector(".xl-confirm-dialog");
|
4771
4806
|
C && (C.style.transform = "scale(0.95)", C.style.opacity = "0"), d.style.opacity = "0", setTimeout(() => {
|
4772
4807
|
d.parentNode && d.parentNode.removeChild(d);
|
4773
4808
|
}, 300);
|
4774
4809
|
};
|
4775
|
-
|
4810
|
+
p == null || p.addEventListener("click", () => {
|
4776
4811
|
var C;
|
4777
|
-
(C = c.onConfirm) == null || C.call(c),
|
4778
|
-
}),
|
4812
|
+
(C = c.onConfirm) == null || C.call(c), x();
|
4813
|
+
}), g == null || g.addEventListener("click", () => {
|
4779
4814
|
var C;
|
4780
|
-
(C = c.onCancel) == null || C.call(c),
|
4815
|
+
(C = c.onCancel) == null || C.call(c), x();
|
4781
4816
|
}), d.addEventListener("click", (C) => {
|
4782
4817
|
var w;
|
4783
|
-
C.target === d && ((w = c.onCancel) == null || w.call(c),
|
4818
|
+
C.target === d && ((w = c.onCancel) == null || w.call(c), x());
|
4784
4819
|
});
|
4785
|
-
const
|
4820
|
+
const E = (C) => {
|
4786
4821
|
var w;
|
4787
|
-
C.key === "Escape" && ((w = c.onCancel) == null || w.call(c),
|
4822
|
+
C.key === "Escape" && ((w = c.onCancel) == null || w.call(c), x(), document.removeEventListener("keydown", E));
|
4788
4823
|
};
|
4789
|
-
document.addEventListener("keydown",
|
4824
|
+
document.addEventListener("keydown", E);
|
4790
4825
|
},
|
4791
|
-
success: (c,
|
4792
|
-
a({ title: c, content:
|
4826
|
+
success: (c, f, h) => {
|
4827
|
+
a({ title: c, content: f, type: "success", duration: h });
|
4793
4828
|
},
|
4794
|
-
error: (c,
|
4795
|
-
a({ title: c, content:
|
4829
|
+
error: (c, f, h) => {
|
4830
|
+
a({ title: c, content: f, type: "error", duration: h });
|
4796
4831
|
},
|
4797
|
-
warning: (c,
|
4798
|
-
a({ title: c, content:
|
4832
|
+
warning: (c, f, h) => {
|
4833
|
+
a({ title: c, content: f, type: "warning", duration: h });
|
4799
4834
|
},
|
4800
|
-
info: (c,
|
4801
|
-
a({ title: c, content:
|
4835
|
+
info: (c, f, h) => {
|
4836
|
+
a({ title: c, content: f, type: "info", duration: h });
|
4802
4837
|
},
|
4803
|
-
remove:
|
4838
|
+
remove: t
|
4839
|
+
};
|
4840
|
+
}, Uo = () => {
|
4841
|
+
const e = () => {
|
4842
|
+
let r = document.getElementById("xl-alert-container");
|
4843
|
+
return r || (r = document.createElement("div"), r.id = "xl-alert-container", r.style.cssText = `
|
4844
|
+
position: fixed;
|
4845
|
+
top: 5%;
|
4846
|
+
left: 50%;
|
4847
|
+
transform: translate(-50%, -50%);
|
4848
|
+
z-index: 10000;
|
4849
|
+
display: flex;
|
4850
|
+
flex-direction: column;
|
4851
|
+
gap: 12px;
|
4852
|
+
max-width: 90%;
|
4853
|
+
width: 500px;
|
4854
|
+
`, document.body.appendChild(r)), r;
|
4855
|
+
}, o = (r) => {
|
4856
|
+
const c = {
|
4857
|
+
success: {
|
4858
|
+
bgColor: "rgb(240, 253, 244)",
|
4859
|
+
darkBgColor: "rgb(20, 83, 45)",
|
4860
|
+
borderColor: "rgb(134, 239, 172)",
|
4861
|
+
darkBorderColor: "rgb(22, 101, 52)",
|
4862
|
+
textColor: "rgb(22, 101, 52)",
|
4863
|
+
darkTextColor: "rgb(187, 247, 208)",
|
4864
|
+
iconColor: "rgb(34, 197, 94)",
|
4865
|
+
iconSvg: `<svg stroke="currentColor" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
4866
|
+
<path d="M13 16h-1v-4h1m0-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path>
|
4867
|
+
</svg>`
|
4868
|
+
},
|
4869
|
+
error: {
|
4870
|
+
bgColor: "rgb(254, 242, 242)",
|
4871
|
+
darkBgColor: "rgb(127, 29, 29)",
|
4872
|
+
borderColor: "rgb(252, 165, 165)",
|
4873
|
+
darkBorderColor: "rgb(153, 27, 27)",
|
4874
|
+
textColor: "rgb(153, 27, 27)",
|
4875
|
+
darkTextColor: "rgb(254, 202, 202)",
|
4876
|
+
iconColor: "rgb(239, 68, 68)",
|
4877
|
+
iconSvg: `<svg stroke="currentColor" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
4878
|
+
<path d="M13 16h-1v-4h1m0-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path>
|
4879
|
+
</svg>`
|
4880
|
+
},
|
4881
|
+
warning: {
|
4882
|
+
bgColor: "rgb(254, 252, 232)",
|
4883
|
+
darkBgColor: "rgb(133, 77, 14)",
|
4884
|
+
borderColor: "rgb(253, 224, 71)",
|
4885
|
+
darkBorderColor: "rgb(161, 98, 7)",
|
4886
|
+
textColor: "rgb(133, 77, 14)",
|
4887
|
+
darkTextColor: "rgb(254, 240, 138)",
|
4888
|
+
iconColor: "rgb(234, 179, 8)",
|
4889
|
+
iconSvg: `<svg stroke="currentColor" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
4890
|
+
<path d="M13 16h-1v-4h1m0-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path>
|
4891
|
+
</svg>`
|
4892
|
+
},
|
4893
|
+
info: {
|
4894
|
+
bgColor: "rgb(239, 246, 255)",
|
4895
|
+
darkBgColor: "rgb(30, 58, 138)",
|
4896
|
+
borderColor: "rgb(147, 197, 253)",
|
4897
|
+
darkBorderColor: "rgb(29, 78, 216)",
|
4898
|
+
textColor: "rgb(30, 64, 175)",
|
4899
|
+
darkTextColor: "rgb(191, 219, 254)",
|
4900
|
+
iconColor: "rgb(59, 130, 246)",
|
4901
|
+
iconSvg: `<svg stroke="currentColor" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
4902
|
+
<path d="M13 16h-1v-4h1m0-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path>
|
4903
|
+
</svg>`
|
4904
|
+
}
|
4905
|
+
};
|
4906
|
+
return c[r] || c.info;
|
4907
|
+
}, a = () => window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches, t = (r) => {
|
4908
|
+
const c = e(), f = r.type || "info", h = r.duration !== void 0 ? r.duration : 5e3, b = r.closable !== void 0 ? r.closable : !0, d = o(f), k = a(), p = `xl-alert-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, g = document.createElement("div");
|
4909
|
+
g.id = p, g.setAttribute("role", "alert"), g.style.cssText = `
|
4910
|
+
background-color: ${k ? d.darkBgColor : d.bgColor};
|
4911
|
+
border-left: 4px solid ${k ? d.darkBorderColor : d.borderColor};
|
4912
|
+
color: ${k ? d.darkTextColor : d.textColor};
|
4913
|
+
padding: 16px;
|
4914
|
+
border-radius: 12px;
|
4915
|
+
display: flex;
|
4916
|
+
align-items: center;
|
4917
|
+
transition: all 0.3s ease-in-out;
|
4918
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
4919
|
+
transform: scale(0.8);
|
4920
|
+
opacity: 0;
|
4921
|
+
position: relative;
|
4922
|
+
`;
|
4923
|
+
let x = `
|
4924
|
+
<div style="color: ${d.iconColor}; width: 20px; height: 20px; flex-shrink: 0; margin-right: 12px;">
|
4925
|
+
${d.iconSvg}
|
4926
|
+
</div>
|
4927
|
+
<div style="flex: 1;">
|
4928
|
+
${r.title ? `<p style="font-weight: 600; font-size: 14px; margin-bottom: 4px;">${r.title}</p>` : ""}
|
4929
|
+
<p style="font-size: ${r.title ? "13px" : "14px"}; font-weight: ${r.title ? "400" : "600"};">${r.content}</p>
|
4930
|
+
</div>
|
4931
|
+
`;
|
4932
|
+
b && (x += `
|
4933
|
+
<button
|
4934
|
+
class="xl-alert-close"
|
4935
|
+
style="
|
4936
|
+
background: transparent;
|
4937
|
+
border: none;
|
4938
|
+
color: ${k ? d.darkTextColor : d.textColor};
|
4939
|
+
cursor: pointer;
|
4940
|
+
padding: 4px;
|
4941
|
+
margin-left: 8px;
|
4942
|
+
display: flex;
|
4943
|
+
align-items: center;
|
4944
|
+
justify-content: center;
|
4945
|
+
opacity: 0.6;
|
4946
|
+
transition: opacity 0.2s;
|
4947
|
+
width: 20px;
|
4948
|
+
height: 20px;
|
4949
|
+
flex-shrink: 0;
|
4950
|
+
"
|
4951
|
+
onmouseover="this.style.opacity='1'"
|
4952
|
+
onmouseout="this.style.opacity='0.6'"
|
4953
|
+
>
|
4954
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
4955
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
4956
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
4957
|
+
</svg>
|
4958
|
+
</button>
|
4959
|
+
`), g.innerHTML = x;
|
4960
|
+
const E = () => {
|
4961
|
+
g.style.transform = "scale(0.8)", g.style.opacity = "0", setTimeout(() => {
|
4962
|
+
g.parentNode && c.removeChild(g), c.children.length === 0 && document.body.removeChild(c);
|
4963
|
+
}, 300);
|
4964
|
+
};
|
4965
|
+
if (b) {
|
4966
|
+
const C = g.querySelector(".xl-alert-close");
|
4967
|
+
C && C.addEventListener("click", E);
|
4968
|
+
}
|
4969
|
+
return c.appendChild(g), setTimeout(() => {
|
4970
|
+
g.style.transform = "scale(1)", g.style.opacity = "1";
|
4971
|
+
}, 10), h > 0 && setTimeout(E, h), { close: E };
|
4972
|
+
};
|
4973
|
+
return {
|
4974
|
+
show: t,
|
4975
|
+
success: (r, c) => t({ content: r, type: "success", ...c }),
|
4976
|
+
error: (r, c) => t({ content: r, type: "error", ...c }),
|
4977
|
+
warning: (r, c) => t({ content: r, type: "warning", ...c }),
|
4978
|
+
info: (r, c) => t({ content: r, type: "info", ...c })
|
4804
4979
|
};
|
4805
4980
|
};
|
4806
4981
|
export {
|
4807
|
-
|
4808
|
-
|
4809
|
-
|
4810
|
-
|
4811
|
-
|
4812
|
-
|
4813
|
-
|
4814
|
-
|
4815
|
-
|
4816
|
-
|
4817
|
-
|
4818
|
-
|
4982
|
+
_o as XAccordion,
|
4983
|
+
ze as XButton,
|
4984
|
+
Fo as XCard,
|
4985
|
+
No as XCheckboxes,
|
4986
|
+
Oo as XCountrySelect,
|
4987
|
+
Do as XInput,
|
4988
|
+
Ko as XModal,
|
4989
|
+
Ro as XSelect,
|
4990
|
+
Wo as XSkeleton,
|
4991
|
+
Go as XThumbnailContainer,
|
4992
|
+
Ho as XTooltips,
|
4993
|
+
Uo as useAlert,
|
4994
|
+
qo as useMsg,
|
4995
|
+
Uo as xlAlert,
|
4996
|
+
qo as xlMsg
|
4819
4997
|
};
|