vx-vue 1.3.0 → 1.3.1
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/dist/vxvue.es.js +430 -433
- package/dist/vxvue.umd.js +1 -1
- package/package.json +1 -1
package/dist/vxvue.es.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { useSlots as Se, ref as $, computed as z, onBeforeUpdate as Ce, createElementBlock as m, openBlock as d, Fragment as
|
|
1
|
+
import { useSlots as Se, ref as $, computed as z, onBeforeUpdate as Ce, createElementBlock as m, openBlock as d, Fragment as I, renderList as Y, createBlock as U, resolveDynamicComponent as de, createElementVNode as v, useAttrs as K, normalizeClass as C, unref as A, renderSlot as B, toValue as O, watch as X, getCurrentScope as Me, onScopeDispose as Ve, onUpdated as De, createCommentVNode as N, mergeProps as R, withKeys as se, withModifiers as j, toDisplayString as P, createVNode as _, Transition as ve, withCtx as le, createTextVNode as J, nextTick as me, withDirectives as xe, vModelText as Ae, onMounted as fe, normalizeStyle as ye, resolveComponent as Le, createSlots as Te, vShow as Be, toHandlers as ue } from "vue";
|
|
2
2
|
const yl = {
|
|
3
3
|
__name: "accordion",
|
|
4
4
|
props: { activeIndex: { type: [Number, Array], default: null } },
|
|
5
5
|
emits: ["update:activeIndex"],
|
|
6
|
-
setup(e, { emit:
|
|
7
|
-
const t = e,
|
|
6
|
+
setup(e, { emit: u }) {
|
|
7
|
+
const t = e, n = u, a = Se(), l = $([]), c = (f) => l.value.push(f), s = z(() => a.default().reduce((f, x) => ((x.type.__name || x.type.name) === "accordion-panel" && f.push(x), f), [])), o = (f) => {
|
|
8
8
|
if (Array.isArray(t.activeIndex)) {
|
|
9
9
|
let x = [].concat(t.activeIndex), y = x.findIndex((b) => b === f);
|
|
10
|
-
y === -1 ?
|
|
10
|
+
y === -1 ? n("update:activeIndex", [...x, f]) : (x.splice(y, 1), n("update:activeIndex", x));
|
|
11
11
|
} else
|
|
12
|
-
|
|
12
|
+
n("update:activeIndex", f === t.activeIndex ? -1 : f);
|
|
13
13
|
}, r = (f) => {
|
|
14
14
|
if (f = ++f % s.value.length, !l.value[f].disabled) {
|
|
15
|
-
|
|
15
|
+
o(f), l.value[f].focus();
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
r(f);
|
|
19
|
-
},
|
|
19
|
+
}, i = (f) => {
|
|
20
20
|
if (f = (f || s.value.length) - 1, !l.value[f].disabled) {
|
|
21
|
-
|
|
21
|
+
o(f), l.value[f].focus();
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
i(f);
|
|
25
25
|
};
|
|
26
|
-
return Ce(() => l.value = []), (f, x) => (d(!0), m(
|
|
26
|
+
return Ce(() => l.value = []), (f, x) => (d(!0), m(I, null, Y(s.value, (y, b) => {
|
|
27
27
|
var L;
|
|
28
28
|
return d(), U(de(y), {
|
|
29
29
|
key: b,
|
|
30
30
|
ref_for: !0,
|
|
31
31
|
ref: c,
|
|
32
32
|
show: Array.isArray(e.activeIndex) ? (L = e.activeIndex) == null ? void 0 : L.includes(b) : e.activeIndex === b,
|
|
33
|
-
onSelect: (p) =>
|
|
33
|
+
onSelect: (p) => o(b),
|
|
34
34
|
onKeydown: (p) => r(b),
|
|
35
|
-
onKeyup: (p) =>
|
|
35
|
+
onKeyup: (p) => i(b)
|
|
36
36
|
}, null, 40, ["show", "onSelect", "onKeydown", "onKeyup"]);
|
|
37
37
|
}), 128));
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
function Pe(e,
|
|
40
|
+
function Pe(e, u) {
|
|
41
41
|
return d(), m("svg", {
|
|
42
42
|
xmlns: "http://www.w3.org/2000/svg",
|
|
43
43
|
viewBox: "0 0 24 24",
|
|
@@ -52,7 +52,7 @@ function Pe(e, i) {
|
|
|
52
52
|
})
|
|
53
53
|
]);
|
|
54
54
|
}
|
|
55
|
-
function ze(e,
|
|
55
|
+
function ze(e, u) {
|
|
56
56
|
return d(), m("svg", {
|
|
57
57
|
xmlns: "http://www.w3.org/2000/svg",
|
|
58
58
|
viewBox: "0 0 24 24",
|
|
@@ -67,7 +67,7 @@ function ze(e, i) {
|
|
|
67
67
|
})
|
|
68
68
|
]);
|
|
69
69
|
}
|
|
70
|
-
function ie(e,
|
|
70
|
+
function ie(e, u) {
|
|
71
71
|
return d(), m("svg", {
|
|
72
72
|
xmlns: "http://www.w3.org/2000/svg",
|
|
73
73
|
viewBox: "0 0 24 24",
|
|
@@ -82,7 +82,7 @@ function ie(e, i) {
|
|
|
82
82
|
})
|
|
83
83
|
]);
|
|
84
84
|
}
|
|
85
|
-
function re(e,
|
|
85
|
+
function re(e, u) {
|
|
86
86
|
return d(), m("svg", {
|
|
87
87
|
xmlns: "http://www.w3.org/2000/svg",
|
|
88
88
|
viewBox: "0 0 24 24",
|
|
@@ -97,7 +97,7 @@ function re(e, i) {
|
|
|
97
97
|
})
|
|
98
98
|
]);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function Ne(e, u) {
|
|
101
101
|
return d(), m("svg", {
|
|
102
102
|
xmlns: "http://www.w3.org/2000/svg",
|
|
103
103
|
viewBox: "0 0 24 24",
|
|
@@ -112,7 +112,7 @@ function Oe(e, i) {
|
|
|
112
112
|
})
|
|
113
113
|
]);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Ee(e, u) {
|
|
116
116
|
return d(), m("svg", {
|
|
117
117
|
xmlns: "http://www.w3.org/2000/svg",
|
|
118
118
|
viewBox: "0 0 24 24",
|
|
@@ -127,7 +127,7 @@ function Ie(e, i) {
|
|
|
127
127
|
})
|
|
128
128
|
]);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Ie(e, u) {
|
|
131
131
|
return d(), m("svg", {
|
|
132
132
|
xmlns: "http://www.w3.org/2000/svg",
|
|
133
133
|
viewBox: "0 0 24 24",
|
|
@@ -142,7 +142,7 @@ function Ne(e, i) {
|
|
|
142
142
|
})
|
|
143
143
|
]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Oe(e, u) {
|
|
146
146
|
return d(), m("svg", {
|
|
147
147
|
xmlns: "http://www.w3.org/2000/svg",
|
|
148
148
|
viewBox: "0 0 24 24",
|
|
@@ -157,7 +157,7 @@ function Fe(e, i) {
|
|
|
157
157
|
})
|
|
158
158
|
]);
|
|
159
159
|
}
|
|
160
|
-
function he(e,
|
|
160
|
+
function he(e, u) {
|
|
161
161
|
return d(), m("svg", {
|
|
162
162
|
xmlns: "http://www.w3.org/2000/svg",
|
|
163
163
|
viewBox: "0 0 24 24",
|
|
@@ -172,18 +172,18 @@ function he(e, i) {
|
|
|
172
172
|
})
|
|
173
173
|
]);
|
|
174
174
|
}
|
|
175
|
-
const
|
|
175
|
+
const Fe = ["id", "disabled", "aria-expanded", "aria-controls"], je = ["id", "aria-labelledby"], Ye = { class: "overflow-hidden rounded-b" }, wl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
176
176
|
__name: "accordion-panel",
|
|
177
177
|
props: { show: Boolean, disabled: Boolean },
|
|
178
178
|
emits: ["select", "keyup", "keydown"],
|
|
179
|
-
setup(e, { expose:
|
|
180
|
-
const
|
|
179
|
+
setup(e, { expose: u, emit: t }) {
|
|
180
|
+
const n = t, a = e, l = K(), c = $(null), s = Math.random().toString(20).substring(2, 8), o = (i) => {
|
|
181
181
|
if (!a.disabled) {
|
|
182
|
-
const f = (/* @__PURE__ */ new Map([[40, "keydown"], [38, "keyup"]])).get(
|
|
183
|
-
f && (
|
|
182
|
+
const f = (/* @__PURE__ */ new Map([[40, "keydown"], [38, "keyup"]])).get(i.keyCode);
|
|
183
|
+
f && (n(f), i.preventDefault());
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
|
-
return
|
|
186
|
+
return u({ focus: () => c.value.focus(), disabled: a.disabled }), (i, f) => (d(), m("div", null, [
|
|
187
187
|
v("button", {
|
|
188
188
|
id: "ap-control-" + A(s),
|
|
189
189
|
ref_key: "btn",
|
|
@@ -198,8 +198,8 @@ const Ee = ["id", "disabled", "aria-expanded", "aria-controls"], je = ["id", "ar
|
|
|
198
198
|
"aria-expanded": e.show,
|
|
199
199
|
"aria-controls": "ap-" + A(s),
|
|
200
200
|
tabindex: "0",
|
|
201
|
-
onClick: f[0] || (f[0] = (x) =>
|
|
202
|
-
onKeydown:
|
|
201
|
+
onClick: f[0] || (f[0] = (x) => n("select")),
|
|
202
|
+
onKeydown: o
|
|
203
203
|
}, [
|
|
204
204
|
e.disabled ? (d(), U(A(he), {
|
|
205
205
|
key: 0,
|
|
@@ -209,30 +209,30 @@ const Ee = ["id", "disabled", "aria-expanded", "aria-controls"], je = ["id", "ar
|
|
|
209
209
|
class: C(["size-5 transform-gpu transition-transform duration-300", { "rotate-90": e.show }])
|
|
210
210
|
}, null, 8, ["class"])),
|
|
211
211
|
v("span", null, [
|
|
212
|
-
B(
|
|
212
|
+
B(i.$slots, "header")
|
|
213
213
|
])
|
|
214
|
-
], 42,
|
|
214
|
+
], 42, Fe),
|
|
215
215
|
v("div", {
|
|
216
216
|
id: "ap-" + A(s),
|
|
217
217
|
class: C(["grid transition-[grid-template-rows] duration-300 ease-in-out", e.show && !e.disabled ? "grid-rows-1" : "grid-rows-[repeat(1,minmax(0,0fr))]"]),
|
|
218
218
|
"aria-labelledby": "ap-control-" + A(s)
|
|
219
219
|
}, [
|
|
220
220
|
v("div", Ye, [
|
|
221
|
-
B(
|
|
221
|
+
B(i.$slots, "default")
|
|
222
222
|
])
|
|
223
223
|
], 10, je)
|
|
224
224
|
]));
|
|
225
225
|
}
|
|
226
|
-
}), _e = ["viewBox"], Re = ["cx", "cy", "r", "stroke-width"],
|
|
226
|
+
}), _e = ["viewBox"], Re = ["cx", "cy", "r", "stroke-width"], He = ["cx", "cy", "r", "stroke-width", "stroke-dasharray"], we = {
|
|
227
227
|
__name: "spinner",
|
|
228
228
|
props: { radius: { type: Number, default: 10 }, strokeWidth: { type: Number, default: 4 } },
|
|
229
229
|
setup(e) {
|
|
230
|
-
const
|
|
230
|
+
const u = e, t = z(() => u.radius + u.strokeWidth / 2), n = z(() => u.radius * 2 + u.strokeWidth), a = z(() => u.radius * Math.PI / 1.5);
|
|
231
231
|
return (l, c) => (d(), m("svg", {
|
|
232
232
|
class: "animate-spin",
|
|
233
233
|
xmlns: "http://www.w3.org/2000/svg",
|
|
234
234
|
fill: "none",
|
|
235
|
-
viewBox: "0 0 " +
|
|
235
|
+
viewBox: "0 0 " + n.value + " " + n.value,
|
|
236
236
|
role: "progressbar"
|
|
237
237
|
}, [
|
|
238
238
|
v("circle", {
|
|
@@ -251,36 +251,36 @@ const Ee = ["id", "disabled", "aria-expanded", "aria-controls"], je = ["id", "ar
|
|
|
251
251
|
"stroke-width": e.strokeWidth,
|
|
252
252
|
"stroke-dasharray": a.value + " " + e.radius * 100,
|
|
253
253
|
"stroke-linecap": "round"
|
|
254
|
-
}, null, 8,
|
|
254
|
+
}, null, 8, He)
|
|
255
255
|
], 8, _e));
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
function
|
|
258
|
+
function Ze(e) {
|
|
259
259
|
return Me() ? (Ve(e), !0) : !1;
|
|
260
260
|
}
|
|
261
261
|
const ke = typeof window < "u" && typeof document < "u";
|
|
262
262
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
263
263
|
const We = Object.prototype.toString, Ue = (e) => We.call(e) === "[object Object]", te = () => {
|
|
264
|
-
},
|
|
265
|
-
function
|
|
266
|
-
var e,
|
|
267
|
-
return ke && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((
|
|
264
|
+
}, qe = /* @__PURE__ */ Ke();
|
|
265
|
+
function Ke() {
|
|
266
|
+
var e, u;
|
|
267
|
+
return ke && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((u = window == null ? void 0 : window.navigator) == null ? void 0 : u.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
268
268
|
}
|
|
269
269
|
function ce(e) {
|
|
270
270
|
return Array.isArray(e) ? e : [e];
|
|
271
271
|
}
|
|
272
272
|
const Xe = /[YMDHhms]o|\[([^\]]+)\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|z{1,4}|SSS/g;
|
|
273
|
-
function Ge(e,
|
|
273
|
+
function Ge(e, u, t, n) {
|
|
274
274
|
let a = e < 12 ? "AM" : "PM";
|
|
275
|
-
return
|
|
275
|
+
return n && (a = a.split("").reduce((l, c) => l += `${c}.`, "")), t ? a.toLowerCase() : a;
|
|
276
276
|
}
|
|
277
277
|
function ee(e) {
|
|
278
|
-
const
|
|
279
|
-
return e + (
|
|
278
|
+
const u = ["th", "st", "nd", "rd"], t = e % 100;
|
|
279
|
+
return e + (u[(t - 20) % 10] || u[t] || u[0]);
|
|
280
280
|
}
|
|
281
|
-
function ge(e,
|
|
282
|
-
var
|
|
283
|
-
const a = e.getFullYear(), l = e.getMonth(), c = e.getDate(), s = e.getHours(),
|
|
281
|
+
function ge(e, u, t = {}) {
|
|
282
|
+
var n;
|
|
283
|
+
const a = e.getFullYear(), l = e.getMonth(), c = e.getDate(), s = e.getHours(), o = e.getMinutes(), r = e.getSeconds(), i = e.getMilliseconds(), f = e.getDay(), x = (n = t.customMeridiem) != null ? n : Ge, y = (L) => {
|
|
284
284
|
var p;
|
|
285
285
|
return (p = L.split(" ")[1]) != null ? p : "";
|
|
286
286
|
}, b = {
|
|
@@ -290,8 +290,8 @@ function ge(e, i, t = {}) {
|
|
|
290
290
|
M: () => l + 1,
|
|
291
291
|
Mo: () => ee(l + 1),
|
|
292
292
|
MM: () => `${l + 1}`.padStart(2, "0"),
|
|
293
|
-
MMM: () => e.toLocaleDateString(
|
|
294
|
-
MMMM: () => e.toLocaleDateString(
|
|
293
|
+
MMM: () => e.toLocaleDateString(O(t.locales), { month: "short" }),
|
|
294
|
+
MMMM: () => e.toLocaleDateString(O(t.locales), { month: "long" }),
|
|
295
295
|
D: () => String(c),
|
|
296
296
|
Do: () => ee(c),
|
|
297
297
|
DD: () => `${c}`.padStart(2, "0"),
|
|
@@ -301,35 +301,35 @@ function ge(e, i, t = {}) {
|
|
|
301
301
|
h: () => `${s % 12 || 12}`.padStart(1, "0"),
|
|
302
302
|
ho: () => ee(s % 12 || 12),
|
|
303
303
|
hh: () => `${s % 12 || 12}`.padStart(2, "0"),
|
|
304
|
-
m: () => String(
|
|
305
|
-
mo: () => ee(
|
|
306
|
-
mm: () => `${
|
|
304
|
+
m: () => String(o),
|
|
305
|
+
mo: () => ee(o),
|
|
306
|
+
mm: () => `${o}`.padStart(2, "0"),
|
|
307
307
|
s: () => String(r),
|
|
308
308
|
so: () => ee(r),
|
|
309
309
|
ss: () => `${r}`.padStart(2, "0"),
|
|
310
|
-
SSS: () => `${
|
|
310
|
+
SSS: () => `${i}`.padStart(3, "0"),
|
|
311
311
|
d: () => f,
|
|
312
|
-
dd: () => e.toLocaleDateString(
|
|
313
|
-
ddd: () => e.toLocaleDateString(
|
|
314
|
-
dddd: () => e.toLocaleDateString(
|
|
315
|
-
A: () => x(s,
|
|
316
|
-
AA: () => x(s,
|
|
317
|
-
a: () => x(s,
|
|
318
|
-
aa: () => x(s,
|
|
319
|
-
z: () => y(e.toLocaleDateString(
|
|
320
|
-
zz: () => y(e.toLocaleDateString(
|
|
321
|
-
zzz: () => y(e.toLocaleDateString(
|
|
322
|
-
zzzz: () => y(e.toLocaleDateString(
|
|
312
|
+
dd: () => e.toLocaleDateString(O(t.locales), { weekday: "narrow" }),
|
|
313
|
+
ddd: () => e.toLocaleDateString(O(t.locales), { weekday: "short" }),
|
|
314
|
+
dddd: () => e.toLocaleDateString(O(t.locales), { weekday: "long" }),
|
|
315
|
+
A: () => x(s, o),
|
|
316
|
+
AA: () => x(s, o, !1, !0),
|
|
317
|
+
a: () => x(s, o, !0),
|
|
318
|
+
aa: () => x(s, o, !0, !0),
|
|
319
|
+
z: () => y(e.toLocaleDateString(O(t.locales), { timeZoneName: "shortOffset" })),
|
|
320
|
+
zz: () => y(e.toLocaleDateString(O(t.locales), { timeZoneName: "shortOffset" })),
|
|
321
|
+
zzz: () => y(e.toLocaleDateString(O(t.locales), { timeZoneName: "shortOffset" })),
|
|
322
|
+
zzzz: () => y(e.toLocaleDateString(O(t.locales), { timeZoneName: "longOffset" }))
|
|
323
323
|
};
|
|
324
|
-
return
|
|
324
|
+
return u.replace(Xe, (L, p) => {
|
|
325
325
|
var k, D;
|
|
326
326
|
return (D = p ?? ((k = b[L]) == null ? void 0 : k.call(b))) != null ? D : L;
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
|
-
function Je(e,
|
|
329
|
+
function Je(e, u, t) {
|
|
330
330
|
return X(
|
|
331
331
|
e,
|
|
332
|
-
|
|
332
|
+
u,
|
|
333
333
|
{
|
|
334
334
|
...t,
|
|
335
335
|
immediate: !0
|
|
@@ -338,35 +338,35 @@ function Je(e, i, t) {
|
|
|
338
338
|
}
|
|
339
339
|
const $e = ke ? window : void 0;
|
|
340
340
|
function oe(e) {
|
|
341
|
-
var
|
|
342
|
-
const t =
|
|
343
|
-
return (
|
|
341
|
+
var u;
|
|
342
|
+
const t = O(e);
|
|
343
|
+
return (u = t == null ? void 0 : t.$el) != null ? u : t;
|
|
344
344
|
}
|
|
345
345
|
function ne(...e) {
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
},
|
|
349
|
-
const s = ce(
|
|
350
|
-
return s.every((
|
|
346
|
+
const u = [], t = () => {
|
|
347
|
+
u.forEach((s) => s()), u.length = 0;
|
|
348
|
+
}, n = (s, o, r, i) => (s.addEventListener(o, r, i), () => s.removeEventListener(o, r, i)), a = z(() => {
|
|
349
|
+
const s = ce(O(e[0])).filter((o) => o != null);
|
|
350
|
+
return s.every((o) => typeof o != "string") ? s : void 0;
|
|
351
351
|
}), l = Je(
|
|
352
352
|
() => {
|
|
353
|
-
var s,
|
|
353
|
+
var s, o;
|
|
354
354
|
return [
|
|
355
|
-
(
|
|
356
|
-
ce(
|
|
355
|
+
(o = (s = a.value) == null ? void 0 : s.map((r) => oe(r))) != null ? o : [$e].filter((r) => r != null),
|
|
356
|
+
ce(O(a.value ? e[1] : e[0])),
|
|
357
357
|
ce(A(a.value ? e[2] : e[1])),
|
|
358
358
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
359
|
-
|
|
359
|
+
O(a.value ? e[3] : e[2])
|
|
360
360
|
];
|
|
361
361
|
},
|
|
362
|
-
([s,
|
|
363
|
-
if (t(), !(s != null && s.length) || !(
|
|
362
|
+
([s, o, r, i]) => {
|
|
363
|
+
if (t(), !(s != null && s.length) || !(o != null && o.length) || !(r != null && r.length))
|
|
364
364
|
return;
|
|
365
|
-
const f = Ue(
|
|
366
|
-
|
|
365
|
+
const f = Ue(i) ? { ...i } : i;
|
|
366
|
+
u.push(
|
|
367
367
|
...s.flatMap(
|
|
368
|
-
(x) =>
|
|
369
|
-
(y) => r.map((b) =>
|
|
368
|
+
(x) => o.flatMap(
|
|
369
|
+
(y) => r.map((b) => n(x, y, b, f))
|
|
370
370
|
)
|
|
371
371
|
)
|
|
372
372
|
);
|
|
@@ -375,71 +375,71 @@ function ne(...e) {
|
|
|
375
375
|
), c = () => {
|
|
376
376
|
l(), t();
|
|
377
377
|
};
|
|
378
|
-
return
|
|
378
|
+
return Ze(t), c;
|
|
379
379
|
}
|
|
380
380
|
let be = !1;
|
|
381
|
-
function pe(e,
|
|
382
|
-
const { window:
|
|
383
|
-
if (!
|
|
381
|
+
function pe(e, u, t = {}) {
|
|
382
|
+
const { window: n = $e, ignore: a = [], capture: l = !0, detectIframe: c = !1, controls: s = !1 } = t;
|
|
383
|
+
if (!n)
|
|
384
384
|
return s ? { stop: te, cancel: te, trigger: te } : te;
|
|
385
|
-
if (
|
|
385
|
+
if (qe && !be) {
|
|
386
386
|
be = !0;
|
|
387
387
|
const p = { passive: !0 };
|
|
388
|
-
Array.from(
|
|
388
|
+
Array.from(n.document.body.children).forEach((k) => ne(k, "click", te, p)), ne(n.document.documentElement, "click", te, p);
|
|
389
389
|
}
|
|
390
|
-
let
|
|
391
|
-
const r = (p) =>
|
|
390
|
+
let o = !0;
|
|
391
|
+
const r = (p) => O(a).some((k) => {
|
|
392
392
|
if (typeof k == "string")
|
|
393
|
-
return Array.from(
|
|
393
|
+
return Array.from(n.document.querySelectorAll(k)).some((D) => D === p.target || p.composedPath().includes(D));
|
|
394
394
|
{
|
|
395
395
|
const D = oe(k);
|
|
396
396
|
return D && (p.target === D || p.composedPath().includes(D));
|
|
397
397
|
}
|
|
398
398
|
});
|
|
399
|
-
function
|
|
400
|
-
const k =
|
|
399
|
+
function i(p) {
|
|
400
|
+
const k = O(p);
|
|
401
401
|
return k && k.$.subTree.shapeFlag === 16;
|
|
402
402
|
}
|
|
403
403
|
function f(p, k) {
|
|
404
|
-
const D =
|
|
405
|
-
return
|
|
404
|
+
const D = O(p), Z = D.$.subTree && D.$.subTree.children;
|
|
405
|
+
return Z == null || !Array.isArray(Z) ? !1 : Z.some((H) => H.el === k.target || k.composedPath().includes(H.el));
|
|
406
406
|
}
|
|
407
407
|
const x = (p) => {
|
|
408
408
|
const k = oe(e);
|
|
409
|
-
if (p.target != null && !(!(k instanceof Element) &&
|
|
410
|
-
if ("detail" in p && p.detail === 0 && (
|
|
411
|
-
|
|
409
|
+
if (p.target != null && !(!(k instanceof Element) && i(e) && f(e, p)) && !(!k || k === p.target || p.composedPath().includes(k))) {
|
|
410
|
+
if ("detail" in p && p.detail === 0 && (o = !r(p)), !o) {
|
|
411
|
+
o = !0;
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
414
|
-
|
|
414
|
+
u(p);
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
417
|
let y = !1;
|
|
418
418
|
const b = [
|
|
419
|
-
ne(
|
|
419
|
+
ne(n, "click", (p) => {
|
|
420
420
|
y || (y = !0, setTimeout(() => {
|
|
421
421
|
y = !1;
|
|
422
422
|
}, 0), x(p));
|
|
423
423
|
}, { passive: !0, capture: l }),
|
|
424
|
-
ne(
|
|
424
|
+
ne(n, "pointerdown", (p) => {
|
|
425
425
|
const k = oe(e);
|
|
426
|
-
|
|
426
|
+
o = !r(p) && !!(k && !p.composedPath().includes(k));
|
|
427
427
|
}, { passive: !0 }),
|
|
428
|
-
c && ne(
|
|
428
|
+
c && ne(n, "blur", (p) => {
|
|
429
429
|
setTimeout(() => {
|
|
430
430
|
var k;
|
|
431
431
|
const D = oe(e);
|
|
432
|
-
((k =
|
|
432
|
+
((k = n.document.activeElement) == null ? void 0 : k.tagName) === "IFRAME" && !(D != null && D.contains(n.document.activeElement)) && u(p);
|
|
433
433
|
}, 0);
|
|
434
434
|
}, { passive: !0 })
|
|
435
435
|
].filter(Boolean), L = () => b.forEach((p) => p());
|
|
436
436
|
return s ? {
|
|
437
437
|
stop: L,
|
|
438
438
|
cancel: () => {
|
|
439
|
-
|
|
439
|
+
o = !1;
|
|
440
440
|
},
|
|
441
441
|
trigger: (p) => {
|
|
442
|
-
|
|
442
|
+
o = !0, x(p), o = !1;
|
|
443
443
|
}
|
|
444
444
|
} : L;
|
|
445
445
|
}
|
|
@@ -454,16 +454,16 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
454
454
|
autoSelect: Boolean
|
|
455
455
|
},
|
|
456
456
|
emits: ["update:modelValue", "blur-sm", "submit"],
|
|
457
|
-
setup(e, { emit:
|
|
458
|
-
const t =
|
|
457
|
+
setup(e, { emit: u }) {
|
|
458
|
+
const t = u, n = e, a = K(), c = (/* @__PURE__ */ (() => {
|
|
459
459
|
let V = 0;
|
|
460
460
|
return (T) => (T || "") + ++V;
|
|
461
|
-
})())((a.id || "autocomplete") + "-"), s = $([]),
|
|
461
|
+
})())((a.id || "autocomplete") + "-"), s = $([]), o = $(-1), r = $(0), i = $(!1), f = $(!1), x = $("top-0 translate-y-12"), y = $(!0), b = $(null), L = $(null), p = $(null), k = z(
|
|
462
462
|
() => s.value.map((V, T) => ({
|
|
463
463
|
id: (a.id || "autocomplete") + "-item-" + T,
|
|
464
|
-
class: [
|
|
464
|
+
class: [n.resultItemClass, { "bg-vxvue-700 text-white": o.value === T }],
|
|
465
465
|
role: "option",
|
|
466
|
-
...
|
|
466
|
+
...o.value === T ? { "aria-selected": "true" } : {}
|
|
467
467
|
}))
|
|
468
468
|
), D = z(() => ({
|
|
469
469
|
role: "combobox",
|
|
@@ -474,52 +474,52 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
474
474
|
"aria-autocomplete": "list",
|
|
475
475
|
"aria-haspopup": "listbox",
|
|
476
476
|
"aria-owns": c,
|
|
477
|
-
"aria-expanded":
|
|
478
|
-
"aria-activedescendant":
|
|
477
|
+
"aria-expanded": i.value ? "true" : "false",
|
|
478
|
+
"aria-activedescendant": o.value > -1 ? k.value[o.value].id : "",
|
|
479
479
|
...a
|
|
480
|
-
})),
|
|
480
|
+
})), Z = z(() => ({
|
|
481
481
|
id: c,
|
|
482
|
-
class: ["absolute min-w-full transform z-10",
|
|
482
|
+
class: ["absolute min-w-full transform z-10", n.resultListClass, x.value],
|
|
483
483
|
role: "listbox"
|
|
484
|
-
})),
|
|
485
|
-
|
|
484
|
+
})), H = () => {
|
|
485
|
+
o.value = -1, s.value = [], i.value = !1, y.value = !0;
|
|
486
486
|
}, S = (V) => {
|
|
487
|
-
const T =
|
|
487
|
+
const T = n.search(V);
|
|
488
488
|
if (T instanceof Promise) {
|
|
489
489
|
const G = ++r.value;
|
|
490
|
-
f.value = !0, T.then((
|
|
491
|
-
G === r.value && (s.value =
|
|
490
|
+
f.value = !0, T.then((q) => {
|
|
491
|
+
G === r.value && (s.value = q, f.value = !1, s.value.length ? (o.value = n.autoSelect ? 0 : -1, i.value = !0) : H());
|
|
492
492
|
});
|
|
493
493
|
} else
|
|
494
|
-
s.value = T, s.value.length === 0 ?
|
|
494
|
+
s.value = T, s.value.length === 0 ? H() : (o.value = n.autoSelect ? 0 : -1, i.value = !0);
|
|
495
495
|
}, M = () => {
|
|
496
|
-
const V = s.value[
|
|
497
|
-
return V && t("update:modelValue",
|
|
498
|
-
},
|
|
496
|
+
const V = s.value[o.value];
|
|
497
|
+
return V && t("update:modelValue", n.getResultValue(V)), H(), V;
|
|
498
|
+
}, F = (V) => {
|
|
499
499
|
t("update:modelValue", V), S(V);
|
|
500
500
|
}, h = (V) => S(V.target.value), g = () => {
|
|
501
|
-
|
|
501
|
+
H(), t("blur-sm");
|
|
502
502
|
}, w = () => {
|
|
503
503
|
const V = s.value.length;
|
|
504
|
-
|
|
505
|
-
},
|
|
506
|
-
|
|
504
|
+
o.value = ((o.value - 1) % V + V) % V;
|
|
505
|
+
}, E = (V) => {
|
|
506
|
+
i.value || h(V);
|
|
507
507
|
const T = s.value.length;
|
|
508
|
-
|
|
508
|
+
o.value = ((o.value + 1) % T + T) % T;
|
|
509
509
|
}, W = () => {
|
|
510
|
-
|
|
510
|
+
H(), t("update:modelValue", "");
|
|
511
511
|
}, ae = () => t("submit", M()), Q = (V) => {
|
|
512
512
|
const T = V.target.closest("[data-result-index]");
|
|
513
|
-
T && (
|
|
513
|
+
T && (o.value = parseInt(T.dataset.resultIndex, 10), t("submit", M()));
|
|
514
514
|
};
|
|
515
|
-
return pe(p,
|
|
515
|
+
return pe(p, H), De(() => {
|
|
516
516
|
if (b.value) {
|
|
517
517
|
const V = L.value.getBoundingClientRect(), T = b.value.getBoundingClientRect();
|
|
518
518
|
y.value && s.value.length && (y.value = !1, x.value = V.bottom + T.height > window.innerHeight && window.innerHeight - V.bottom < V.top && window.pageYOffset + V.top - T.height > 0 ? "bottom-0 -translate-y-12" : "top-0 translate-y-12");
|
|
519
|
-
const G = b.value.querySelector('[data-result-index="' +
|
|
519
|
+
const G = b.value.querySelector('[data-result-index="' + o.value + '"]');
|
|
520
520
|
if (G) {
|
|
521
|
-
let
|
|
522
|
-
|
|
521
|
+
let q = G.getBoundingClientRect();
|
|
522
|
+
q.top < T.top ? b.value.scrollTop -= T.top - q.top : q.bottom > T.bottom && (b.value.scrollTop += q.bottom - T.bottom);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
}), (V, T) => (d(), m("div", {
|
|
@@ -533,13 +533,13 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
533
533
|
class: "block pr-10 w-full form-input focus:border-vxvue",
|
|
534
534
|
value: e.modelValue
|
|
535
535
|
}, D.value, {
|
|
536
|
-
onInput: T[0] || (T[0] = (G) =>
|
|
536
|
+
onInput: T[0] || (T[0] = (G) => F(G.target.value)),
|
|
537
537
|
onKeydown: [
|
|
538
538
|
se(ae, ["enter"]),
|
|
539
539
|
se(W, ["esc"]),
|
|
540
540
|
se(M, ["tab"]),
|
|
541
541
|
se(j(w, ["prevent"]), ["up"]),
|
|
542
|
-
se(j(
|
|
542
|
+
se(j(E, ["prevent"]), ["down"])
|
|
543
543
|
],
|
|
544
544
|
onFocus: h,
|
|
545
545
|
onBlur: g
|
|
@@ -548,29 +548,29 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
548
548
|
f.value ? (d(), U(we, {
|
|
549
549
|
key: 0,
|
|
550
550
|
class: "size-5"
|
|
551
|
-
})) :
|
|
551
|
+
})) : N("", !0)
|
|
552
552
|
]),
|
|
553
553
|
s.value.length ? (d(), m("div", R({
|
|
554
554
|
key: 0,
|
|
555
555
|
ref_key: "resultList",
|
|
556
556
|
ref: b
|
|
557
|
-
},
|
|
557
|
+
}, Z.value, {
|
|
558
558
|
onClick: Q,
|
|
559
559
|
onMousedown: T[1] || (T[1] = j(() => {
|
|
560
560
|
}, ["prevent"]))
|
|
561
561
|
}), [
|
|
562
|
-
(d(!0), m(
|
|
562
|
+
(d(!0), m(I, null, Y(s.value, (G, q) => (d(), m("div", { "data-result-index": q }, [
|
|
563
563
|
B(V.$slots, "result", {
|
|
564
564
|
result: G,
|
|
565
|
-
props: k.value[
|
|
565
|
+
props: k.value[q]
|
|
566
566
|
}, () => [
|
|
567
567
|
(d(), m("div", R({
|
|
568
|
-
key: k.value[
|
|
568
|
+
key: k.value[q].id,
|
|
569
569
|
ref_for: !0
|
|
570
|
-
}, k.value[
|
|
570
|
+
}, k.value[q]), P(e.getResultValue(G)), 17))
|
|
571
571
|
])
|
|
572
572
|
], 8, tt))), 256))
|
|
573
|
-
], 16)) :
|
|
573
|
+
], 16)) : N("", !0)
|
|
574
574
|
], 2));
|
|
575
575
|
}
|
|
576
576
|
}), lt = {
|
|
@@ -586,7 +586,7 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
586
586
|
buttons: {
|
|
587
587
|
type: [Object, Array],
|
|
588
588
|
default: () => ({ label: "Ok" }),
|
|
589
|
-
validator: (e) => Array.isArray(e) && e.length <= 2 && e.filter((
|
|
589
|
+
validator: (e) => Array.isArray(e) && e.length <= 2 && e.filter((u) => u.label !== "undefined" && u.value !== "undefined").length === e.length || e.label !== void 0 && e.value !== void 0
|
|
590
590
|
},
|
|
591
591
|
headerClass: {
|
|
592
592
|
type: String,
|
|
@@ -597,16 +597,16 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
597
597
|
default: "button"
|
|
598
598
|
}
|
|
599
599
|
},
|
|
600
|
-
setup(e, { expose:
|
|
601
|
-
const t = e,
|
|
600
|
+
setup(e, { expose: u }) {
|
|
601
|
+
const t = e, n = $(""), a = $(""), l = $(!1);
|
|
602
602
|
let c = null, s = null;
|
|
603
|
-
const
|
|
603
|
+
const o = z(() => Array.isArray(t.buttons) ? t.buttons : [t.buttons]), r = $(null), i = (x, y) => {
|
|
604
604
|
l.value = !1, x.value !== void 0 ? x.value ? c() : s() : y ? s() : c();
|
|
605
605
|
};
|
|
606
|
-
return
|
|
606
|
+
return u({ open: (x, y) => (n.value = x, a.value = y, l.value = !0, me(() => r.value.firstElementChild.focus()), new Promise((b, L) => {
|
|
607
607
|
c = b, s = L;
|
|
608
|
-
})) }), (x, y) => (d(), m(
|
|
609
|
-
l.value ? (d(), m("div", lt)) :
|
|
608
|
+
})) }), (x, y) => (d(), m(I, null, [
|
|
609
|
+
l.value ? (d(), m("div", lt)) : N("", !0),
|
|
610
610
|
_(ve, { name: "appear" }, {
|
|
611
611
|
default: le(() => [
|
|
612
612
|
l.value ? (d(), m("div", at, [
|
|
@@ -617,14 +617,14 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
617
617
|
"aria-hidden": "true"
|
|
618
618
|
}, "", -1)),
|
|
619
619
|
v("div", ot, [
|
|
620
|
-
|
|
620
|
+
n.value || x.$slots.title ? (d(), m("h3", {
|
|
621
621
|
key: 0,
|
|
622
622
|
class: C(["py-4 pt-4 text-lg font-medium text-center sm:py-6", e.headerClass])
|
|
623
623
|
}, [
|
|
624
624
|
B(x.$slots, "title", {}, () => [
|
|
625
|
-
J(P(
|
|
625
|
+
J(P(n.value), 1)
|
|
626
626
|
])
|
|
627
|
-
], 2)) :
|
|
627
|
+
], 2)) : N("", !0),
|
|
628
628
|
v("div", rt, [
|
|
629
629
|
v("div", ut, [
|
|
630
630
|
v("div", it, [
|
|
@@ -641,48 +641,48 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
641
641
|
ref: r,
|
|
642
642
|
class: "flex justify-center mt-5 space-x-2 sm:mt-6"
|
|
643
643
|
}, [
|
|
644
|
-
(d(!0), m(
|
|
644
|
+
(d(!0), m(I, null, Y(o.value, (b, L) => (d(), m("button", {
|
|
645
645
|
key: b.label,
|
|
646
646
|
class: C([e.buttonClass, b.class]),
|
|
647
|
-
onClick: j((p) =>
|
|
647
|
+
onClick: j((p) => i(b, L), ["prevent"])
|
|
648
648
|
}, P(b.label), 11, ct))), 128))
|
|
649
649
|
], 512)
|
|
650
650
|
])
|
|
651
651
|
])
|
|
652
|
-
])) :
|
|
652
|
+
])) : N("", !0)
|
|
653
653
|
])
|
|
654
|
-
])) :
|
|
654
|
+
])) : N("", !0)
|
|
655
655
|
]),
|
|
656
656
|
_: 3
|
|
657
657
|
})
|
|
658
658
|
], 64));
|
|
659
659
|
}
|
|
660
660
|
};
|
|
661
|
-
function vt(e,
|
|
662
|
-
const t = $(!1),
|
|
663
|
-
let a, l =
|
|
664
|
-
if ((a =
|
|
661
|
+
function vt(e, u) {
|
|
662
|
+
const t = $(!1), n = O(u);
|
|
663
|
+
let a, l = n.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), c = [];
|
|
664
|
+
if ((a = n.match(/\bd\b/gi)) && a.length === 1)
|
|
665
665
|
l = l.replace("d", "(\\d{1,2})");
|
|
666
|
-
else if ((a =
|
|
666
|
+
else if ((a = n.match(/\bdd\b/gi)) && a.length === 1)
|
|
667
667
|
l = l.replace("dd", "(\\d{2})");
|
|
668
668
|
else
|
|
669
669
|
return { date: t };
|
|
670
|
-
if (c.push({ srcPos:
|
|
670
|
+
if (c.push({ srcPos: n.toLowerCase().indexOf("d"), destPos: 2 }), (a = n.match(/\bm\b/gi)) && a.length === 1)
|
|
671
671
|
l = l.replace("m", "(\\d{1,2})");
|
|
672
|
-
else if ((a =
|
|
672
|
+
else if ((a = n.match(/\bmm\b/gi)) && a.length === 1)
|
|
673
673
|
l = l.replace("mm", "(\\d{2})");
|
|
674
674
|
else
|
|
675
675
|
return { date: t };
|
|
676
|
-
if (c.push({ srcPos:
|
|
676
|
+
if (c.push({ srcPos: n.toLowerCase().indexOf("m"), destPos: 1 }), (a = n.match(/\byyyy\b/gi)) && a.length === 1)
|
|
677
677
|
l = l.replace("yyyy", "(\\d{4})");
|
|
678
678
|
else
|
|
679
679
|
return { date: t };
|
|
680
|
-
if (c.push({ srcPos:
|
|
680
|
+
if (c.push({ srcPos: n.toLowerCase().indexOf("y"), destPos: 0 }), !(a = O(e).match(l)))
|
|
681
681
|
return { date: t };
|
|
682
|
-
a.shift(), c.sort((
|
|
683
|
-
let s = [],
|
|
684
|
-
for (;
|
|
685
|
-
r = c.shift(), s[r.destPos] =
|
|
682
|
+
a.shift(), c.sort((i, f) => i.srcPos < f.srcPos ? -1 : 1);
|
|
683
|
+
let s = [], o, r;
|
|
684
|
+
for (; o = a.shift(); )
|
|
685
|
+
r = c.shift(), s[r.destPos] = o;
|
|
686
686
|
return s = Date.parse(s.join("-")), s && (s = new Date(s), t.value = new Date(s.getFullYear(), s.getMonth(), s.getDate(), 0, 0, 0)), { date: t };
|
|
687
687
|
}
|
|
688
688
|
const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
@@ -694,12 +694,12 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
694
694
|
modelValue: Date
|
|
695
695
|
},
|
|
696
696
|
emits: ["update:modelValue", "toggle-datepicker"],
|
|
697
|
-
setup(e, { emit:
|
|
698
|
-
const t =
|
|
699
|
-
let s = Object.assign({},
|
|
697
|
+
setup(e, { emit: u }) {
|
|
698
|
+
const t = u, n = e, a = $(""), l = z(() => n.modelValue ? ge(n.modelValue, n.outputFormat) : ""), c = z(() => {
|
|
699
|
+
let s = Object.assign({}, K());
|
|
700
700
|
return delete s.class, s;
|
|
701
701
|
});
|
|
702
|
-
return X(() =>
|
|
702
|
+
return X(() => n.modelValue, (s) => a.value = s ? ge(s, n.outputFormat) : ""), (s, o) => (d(), m("div", {
|
|
703
703
|
class: C(["inline-block relative", s.$attrs.class])
|
|
704
704
|
}, [
|
|
705
705
|
l.value ? (d(), m("div", mt, [
|
|
@@ -707,25 +707,25 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
707
707
|
class: C(["block flex items-center w-full form-input bg-vxvue-50", { "pr-10": e.showToggle }])
|
|
708
708
|
}, [
|
|
709
709
|
v("span", ft, P(l.value), 1),
|
|
710
|
-
c.value.disabled ?
|
|
710
|
+
c.value.disabled ? N("", !0) : (d(), m("button", {
|
|
711
711
|
key: 0,
|
|
712
712
|
class: "inline-flex shrink-0 justify-center items-center ml-2 rounded-full focus:text-white focus:outline-hidden size-4 text-vxvue hover:bg-vxvue-100 hover:text-vue-700 focus:bg-vxvue-700",
|
|
713
|
-
onClick:
|
|
713
|
+
onClick: o[0] || (o[0] = (r) => t("update:modelValue", null))
|
|
714
714
|
}, [
|
|
715
715
|
_(A(he), { class: "size-4" })
|
|
716
716
|
]))
|
|
717
717
|
], 2)
|
|
718
718
|
])) : xe((d(), m("input", R({
|
|
719
719
|
key: 1,
|
|
720
|
-
"onUpdate:modelValue":
|
|
720
|
+
"onUpdate:modelValue": o[1] || (o[1] = (r) => a.value = r),
|
|
721
721
|
type: "text",
|
|
722
722
|
class: ["block w-full form-input peer focus:border-vxvue", { "pr-10": e.showToggle }]
|
|
723
723
|
}, c.value, {
|
|
724
|
-
onBlur:
|
|
725
|
-
var
|
|
726
|
-
return t("update:modelValue", ((
|
|
724
|
+
onBlur: o[2] || (o[2] = (r) => {
|
|
725
|
+
var i;
|
|
726
|
+
return t("update:modelValue", ((i = A(vt)(a.value, n.inputFormat).date) == null ? void 0 : i.value) || null);
|
|
727
727
|
}),
|
|
728
|
-
onInput:
|
|
728
|
+
onInput: o[3] || (o[3] = j(() => {
|
|
729
729
|
}, ["prevent"]))
|
|
730
730
|
}), null, 16)), [
|
|
731
731
|
[Ae, a.value]
|
|
@@ -736,17 +736,17 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
736
736
|
class: C(["flex absolute inset-y-0 right-0 items-center px-2 text-vxvue-700", c.value.disabled ? "cursor-not-allowed" : "hover:text-vxvue"]),
|
|
737
737
|
disabled: c.value.disabled,
|
|
738
738
|
"aria-label": "datepicker-toggle",
|
|
739
|
-
onClick:
|
|
739
|
+
onClick: o[4] || (o[4] = j((r) => t("toggle-datepicker"), ["stop"]))
|
|
740
740
|
}, [
|
|
741
741
|
_(A(Pe), { class: "size-6" })
|
|
742
|
-
], 10, ht)) :
|
|
742
|
+
], 10, ht)) : N("", !0),
|
|
743
743
|
B(s.$slots, "default")
|
|
744
744
|
], 2));
|
|
745
745
|
}
|
|
746
746
|
}), gt = { class: "flex items-center py-2 px-3 text-white bg-vxvue-700" }, bt = { class: "flex justify-between w-1/2" }, xt = { class: "flex justify-between w-1/2" }, yt = { class: "grid grid-cols-7 gap-0.5 p-0.5" }, wt = ["disabled", "onClick"], kt = { class: "flex justify-between items-center py-2 px-3 text-white bg-vxvue-700" }, $t = { class: "grid grid-cols-2 gap-0.5 p-0.5" }, St = ["onClick"], Sl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
747
747
|
__name: "datepicker",
|
|
748
748
|
props: {
|
|
749
|
-
modelValue: { type: [Date, Array], default: null, validator: (e,
|
|
749
|
+
modelValue: { type: [Date, Array], default: null, validator: (e, u) => e instanceof Date && u.maxNumberOfValues === 1 || e.every((t) => t instanceof Date || t === null) && e.length <= u.maxNumberOfValues },
|
|
750
750
|
shownMonth: Date,
|
|
751
751
|
maxNumberOfValues: { type: Number, default: 1 },
|
|
752
752
|
validFrom: Date,
|
|
@@ -758,13 +758,13 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
758
758
|
hasInput: { type: Boolean, default: !0 }
|
|
759
759
|
},
|
|
760
760
|
emits: ["update:modelValue", "month-change", "year-change"],
|
|
761
|
-
setup(e, { emit:
|
|
762
|
-
const t = e,
|
|
761
|
+
setup(e, { emit: u }) {
|
|
762
|
+
const t = e, n = u, a = (() => {
|
|
763
763
|
const h = /* @__PURE__ */ new Date();
|
|
764
764
|
return new Date(h.getFullYear(), h.getMonth(), h.getDate());
|
|
765
|
-
})(), l = $(null), c = $([]), s = $(!1),
|
|
766
|
-
const h = [], g = l.value.getFullYear(), w = l.value.getMonth(),
|
|
767
|
-
for (let Q = -W, V =
|
|
765
|
+
})(), l = $(null), c = $([]), s = $(!1), o = $("days"), r = $(0), i = $({ horiz: "left-0", vert: "top-0" }), f = $(null), x = $(null), y = $(null), b = z(() => t.hasInput && t.maxNumberOfValues === 1), L = z(() => b.value ? { class: ["absolute", s.value ? "block" : "hidden"] } : {}), p = z(() => {
|
|
766
|
+
const h = [], g = l.value.getFullYear(), w = l.value.getMonth(), E = new Date(g, w + 1, 0), W = new Date(g, w, 0).getDay() + 1 - t.startOfWeekIndex, ae = (6 + t.startOfWeekIndex - E.getDay()) % 7;
|
|
767
|
+
for (let Q = -W, V = E.getDate() + ae; Q < V; ++Q)
|
|
768
768
|
h.push(new Date(g, w, Q + 1));
|
|
769
769
|
return h;
|
|
770
770
|
}), k = z(() => t.startOfWeekIndex ? t.dayNames.slice(1).concat(t.dayNames[0]) : t.dayNames);
|
|
@@ -772,9 +772,9 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
772
772
|
if (h)
|
|
773
773
|
if (Array.isArray(h)) {
|
|
774
774
|
const g = [], w = c.value;
|
|
775
|
-
h.forEach((
|
|
776
|
-
|
|
777
|
-
}), (g.length !== w.length || ![.../* @__PURE__ */ new Set([...g, ...w])].every((
|
|
775
|
+
h.forEach((E) => {
|
|
776
|
+
E && g.push(new Date(E.getFullYear(), E.getMonth(), E.getDate()));
|
|
777
|
+
}), (g.length !== w.length || ![.../* @__PURE__ */ new Set([...g, ...w])].every((E) => g.filter((W) => W.getTime() === E.getTime()).length === w.filter((W) => W.getTime() === E.getTime()).length)) && (c.value = g, l.value = new Date((g[0] || a).getTime()), l.value.setDate(1));
|
|
778
778
|
} else
|
|
779
779
|
c.value = [new Date(h.getFullYear(), h.getMonth(), h.getDate())], l.value = new Date(h.getFullYear(), h.getMonth(), 1);
|
|
780
780
|
else
|
|
@@ -784,37 +784,37 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
784
784
|
}, { immediate: !0 }), X(s, (h) => {
|
|
785
785
|
h && b.value && me(() => {
|
|
786
786
|
const g = f.value.$el.getBoundingClientRect(), w = x.value.getBoundingClientRect();
|
|
787
|
-
|
|
787
|
+
i.value = {
|
|
788
788
|
horiz: g.right - w.width < 0 ? "left-0" : "right-0",
|
|
789
789
|
vert: g.bottom + w.height > window.innerHeight ? "bottom-0 -translate-y-12" : "top-0 translate-y-12"
|
|
790
790
|
};
|
|
791
791
|
});
|
|
792
792
|
}), pe(x, () => {
|
|
793
|
-
s.value = !1,
|
|
793
|
+
s.value = !1, o.value = "days";
|
|
794
794
|
}, { ignore: [y] });
|
|
795
795
|
const D = (h) => {
|
|
796
|
-
l.value = new Date(l.value.getFullYear(), h, 1),
|
|
797
|
-
},
|
|
798
|
-
l.value = new Date(h, l.value.getMonth(), 1),
|
|
799
|
-
},
|
|
796
|
+
l.value = new Date(l.value.getFullYear(), h, 1), n("month-change", l.value);
|
|
797
|
+
}, Z = (h) => {
|
|
798
|
+
l.value = new Date(h, l.value.getMonth(), 1), n("year-change", l.value);
|
|
799
|
+
}, H = (h) => n("update:modelValue", h), S = (h) => {
|
|
800
800
|
if (s.value = !1, t.maxNumberOfValues === 1)
|
|
801
|
-
|
|
801
|
+
n("update:modelValue", h);
|
|
802
802
|
else {
|
|
803
803
|
const g = c.value;
|
|
804
|
-
let w = g.findIndex((
|
|
805
|
-
w !== -1 ? g.splice(w, 1) : g.length < t.maxNumberOfValues && g.push(h),
|
|
804
|
+
let w = g.findIndex((E) => E.getTime() === h.getTime());
|
|
805
|
+
w !== -1 ? g.splice(w, 1) : g.length < t.maxNumberOfValues && g.push(h), n("update:modelValue", g);
|
|
806
806
|
}
|
|
807
|
-
}, M = (h) => c.value.find((g) => (g == null ? void 0 : g.getTime()) === h.getTime()),
|
|
808
|
-
const g = h.getMonth() !== l.value.getMonth(), w = M(h),
|
|
807
|
+
}, M = (h) => c.value.find((g) => (g == null ? void 0 : g.getTime()) === h.getTime()), F = (h) => {
|
|
808
|
+
const g = h.getMonth() !== l.value.getMonth(), w = M(h), E = h.getTime() === a.getTime(), W = t.validFrom && t.validFrom > h || t.validUntil && t.validUntil < h, ae = !w && t.maxNumberOfValues > 1 && c.value.length === t.maxNumberOfValues, Q = t.highlightRange && h > Math.min(...c.value) && h < Math.max(...c.value);
|
|
809
809
|
return {
|
|
810
810
|
"cursor-not-allowed": W || ae,
|
|
811
|
-
"text-vxvue-700": !W && !g && !
|
|
811
|
+
"text-vxvue-700": !W && !g && !E && !w,
|
|
812
812
|
"text-error": W && !g,
|
|
813
|
-
"text-gray-400": g && !
|
|
814
|
-
"bg-vxvue-alt-300 font-bold":
|
|
813
|
+
"text-gray-400": g && !E && !w,
|
|
814
|
+
"bg-vxvue-alt-300 font-bold": E && !w,
|
|
815
815
|
"bg-vxvue-700 text-white": w,
|
|
816
816
|
"hover:ring-2 hover:ring-vxvue": !W,
|
|
817
|
-
"bg-vxvue-100/50": Q && !
|
|
817
|
+
"bg-vxvue-100/50": Q && !E && !w
|
|
818
818
|
};
|
|
819
819
|
};
|
|
820
820
|
return fe(() => {
|
|
@@ -830,19 +830,19 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
830
830
|
"show-toggle": !0,
|
|
831
831
|
class: "w-full",
|
|
832
832
|
onToggleDatepicker: g[0] || (g[0] = (w) => s.value = !s.value),
|
|
833
|
-
"onUpdate:modelValue":
|
|
833
|
+
"onUpdate:modelValue": H
|
|
834
834
|
}), {
|
|
835
835
|
default: le(() => [
|
|
836
836
|
B(h.$slots, "default")
|
|
837
837
|
]),
|
|
838
838
|
_: 3
|
|
839
|
-
}, 16, ["model-value"])) :
|
|
839
|
+
}, 16, ["model-value"])) : N("", !0),
|
|
840
840
|
v("div", R(L.value, {
|
|
841
841
|
ref_key: "calendar",
|
|
842
842
|
ref: x,
|
|
843
|
-
class: ["overflow-hidden z-10 bg-white rounded-sm shadow-md min-w-72 sm:min-w-80", [
|
|
843
|
+
class: ["overflow-hidden z-10 bg-white rounded-sm shadow-md min-w-72 sm:min-w-80", [i.value.horiz, i.value.vert]]
|
|
844
844
|
}), [
|
|
845
|
-
|
|
845
|
+
o.value === "days" ? (d(), m(I, { key: 0 }, [
|
|
846
846
|
v("div", gt, [
|
|
847
847
|
v("div", bt, [
|
|
848
848
|
v("button", {
|
|
@@ -862,38 +862,38 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
862
862
|
v("div", xt, [
|
|
863
863
|
v("button", {
|
|
864
864
|
class: "shrink-0 text-vxvue-100 hover:text-vxvue-50",
|
|
865
|
-
onClick: g[3] || (g[3] = j((w) =>
|
|
865
|
+
onClick: g[3] || (g[3] = j((w) => Z(l.value.getFullYear() - 1), ["stop"]))
|
|
866
866
|
}, [
|
|
867
867
|
_(A(ie), { class: "size-6" })
|
|
868
868
|
]),
|
|
869
869
|
v("button", {
|
|
870
870
|
class: "text-vxvue-100 hover:text-vxvue-50",
|
|
871
871
|
onClick: g[4] || (g[4] = (w) => {
|
|
872
|
-
|
|
872
|
+
o.value = "years", r.value = l.value.getFullYear();
|
|
873
873
|
})
|
|
874
874
|
}, P(l.value.getFullYear()), 1),
|
|
875
875
|
v("button", {
|
|
876
876
|
class: "shrink-0 text-vxvue-100 hover:text-vxvue-50",
|
|
877
|
-
onClick: g[5] || (g[5] = j((w) =>
|
|
877
|
+
onClick: g[5] || (g[5] = j((w) => Z(l.value.getFullYear() + 1), ["stop"]))
|
|
878
878
|
}, [
|
|
879
879
|
_(A(re), { class: "size-6" })
|
|
880
880
|
])
|
|
881
881
|
])
|
|
882
882
|
]),
|
|
883
883
|
v("div", yt, [
|
|
884
|
-
(d(!0), m(
|
|
885
|
-
key:
|
|
884
|
+
(d(!0), m(I, null, Y(k.value, (w, E) => (d(), m("div", {
|
|
885
|
+
key: E,
|
|
886
886
|
class: "py-2 text-center bg-gray-200"
|
|
887
887
|
}, P(w), 1))), 128)),
|
|
888
|
-
(d(!0), m(
|
|
888
|
+
(d(!0), m(I, null, Y(p.value, (w) => (d(), m("button", {
|
|
889
889
|
key: w,
|
|
890
|
-
class: C(["py-2 rounded-xs block text-center",
|
|
890
|
+
class: C(["py-2 rounded-xs block text-center", F(w)]),
|
|
891
891
|
disabled: e.validFrom && e.validFrom > w || e.validUntil && e.validUntil < w || e.maxNumberOfValues > 1 && c.value.length === e.maxNumberOfValues && !M(w),
|
|
892
|
-
onClick: j((
|
|
892
|
+
onClick: j((E) => S(w), ["stop"])
|
|
893
893
|
}, P(w.getDate()), 11, wt))), 128))
|
|
894
894
|
])
|
|
895
|
-
], 64)) :
|
|
896
|
-
|
|
895
|
+
], 64)) : N("", !0),
|
|
896
|
+
o.value === "years" ? (d(), m(I, { key: 1 }, [
|
|
897
897
|
v("div", kt, [
|
|
898
898
|
v("button", {
|
|
899
899
|
class: "shrink-0 text-vxvue-100 hover:text-vxvue-50",
|
|
@@ -910,19 +910,19 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
910
910
|
])
|
|
911
911
|
]),
|
|
912
912
|
v("div", $t, [
|
|
913
|
-
(d(), m(
|
|
913
|
+
(d(), m(I, null, Y(10, (w) => v("div", {
|
|
914
914
|
key: w,
|
|
915
915
|
class: "text-center hover:ring-2 text-vxvue-700 hover:ring-vxvue"
|
|
916
916
|
}, [
|
|
917
917
|
v("button", {
|
|
918
918
|
class: "py-2 px-3",
|
|
919
|
-
onClick: j((
|
|
920
|
-
|
|
919
|
+
onClick: j((E) => {
|
|
920
|
+
Z(r.value + w - 1), o.value = "days";
|
|
921
921
|
}, ["stop"])
|
|
922
922
|
}, P(r.value + w - 1), 9, St)
|
|
923
923
|
])), 64))
|
|
924
924
|
])
|
|
925
|
-
], 64)) :
|
|
925
|
+
], 64)) : N("", !0)
|
|
926
926
|
], 16)
|
|
927
927
|
], 2));
|
|
928
928
|
}
|
|
@@ -936,17 +936,17 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
936
936
|
id: { type: String, default: "form-file-button-" + Math.ceil(Math.random() * 1e3) }
|
|
937
937
|
},
|
|
938
938
|
emits: ["update:modelValue", "form-data"],
|
|
939
|
-
setup(e, { emit:
|
|
940
|
-
const t =
|
|
939
|
+
setup(e, { emit: u }) {
|
|
940
|
+
const t = u, n = e, a = (c) => {
|
|
941
941
|
const s = new FormData();
|
|
942
|
-
for (let
|
|
943
|
-
s.append(
|
|
942
|
+
for (let o of c)
|
|
943
|
+
s.append(n.name, o, o.name);
|
|
944
944
|
return s;
|
|
945
945
|
}, l = (c) => {
|
|
946
946
|
const s = c.target.files || c.dataTransfer.files;
|
|
947
947
|
if (s) {
|
|
948
|
-
const
|
|
949
|
-
t("update:modelValue",
|
|
948
|
+
const o = [...s];
|
|
949
|
+
t("update:modelValue", o), t("form-data", a(o));
|
|
950
950
|
}
|
|
951
951
|
};
|
|
952
952
|
return (c, s) => (d(), m("label", { for: e.id }, [
|
|
@@ -975,15 +975,15 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
975
975
|
disabledLabel: { type: String, default: "" }
|
|
976
976
|
},
|
|
977
977
|
emits: ["update:modelValue"],
|
|
978
|
-
setup(e, { emit:
|
|
979
|
-
const t =
|
|
980
|
-
return (
|
|
978
|
+
setup(e, { emit: u }) {
|
|
979
|
+
const t = u;
|
|
980
|
+
return (n, a) => (d(), m("select", R(n.$attrs, {
|
|
981
981
|
value: e.modelValue,
|
|
982
982
|
class: "form-select",
|
|
983
983
|
onChange: a[0] || (a[0] = (l) => t("update:modelValue", l.target.value))
|
|
984
984
|
}), [
|
|
985
|
-
e.disabledLabel ? (d(), m("option", Dt, P(e.disabledLabel), 1)) :
|
|
986
|
-
(d(!0), m(
|
|
985
|
+
e.disabledLabel ? (d(), m("option", Dt, P(e.disabledLabel), 1)) : N("", !0),
|
|
986
|
+
(d(!0), m(I, null, Y(e.options, (l) => (d(), m("option", {
|
|
987
987
|
key: l.key !== void 0 ? l.key : l.label || l,
|
|
988
988
|
selected: (l.key !== void 0 ? l.key : l.label || l) === e.modelValue,
|
|
989
989
|
value: l.key !== void 0 ? l.key : l.label || l
|
|
@@ -994,11 +994,11 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
994
994
|
__name: "form-switch",
|
|
995
995
|
props: { modelValue: Boolean },
|
|
996
996
|
emits: ["update:modelValue"],
|
|
997
|
-
setup(e, { emit:
|
|
998
|
-
const t =
|
|
999
|
-
let l = Object.assign({},
|
|
997
|
+
setup(e, { emit: u }) {
|
|
998
|
+
const t = u, n = z(() => {
|
|
999
|
+
let l = Object.assign({}, K());
|
|
1000
1000
|
return delete l.class, l;
|
|
1001
|
-
}), a = z(() =>
|
|
1001
|
+
}), a = z(() => K().disabled || K().disabled === "");
|
|
1002
1002
|
return (l, c) => (d(), m("label", {
|
|
1003
1003
|
class: C(l.$attrs.class),
|
|
1004
1004
|
tabindex: "0"
|
|
@@ -1037,7 +1037,7 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1037
1037
|
], 2))
|
|
1038
1038
|
])
|
|
1039
1039
|
], 2),
|
|
1040
|
-
v("input", R(
|
|
1040
|
+
v("input", R(n.value, {
|
|
1041
1041
|
checked: e.modelValue,
|
|
1042
1042
|
class: "hidden",
|
|
1043
1043
|
value: "1",
|
|
@@ -1051,7 +1051,7 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1051
1051
|
}, zt = {
|
|
1052
1052
|
"aria-live": "assertive",
|
|
1053
1053
|
class: "flex fixed inset-0 z-50 items-start py-6 px-4 pointer-events-none sm:p-6"
|
|
1054
|
-
},
|
|
1054
|
+
}, Nt = { class: "flex flex-col items-center space-y-4 w-full" }, Et = { class: "p-4" }, It = { class: "flex items-start" }, Ot = { class: "shrink-0" }, Ft = { class: "flex-1 pt-0.5 ml-3 w-0" }, jt = { class: "font-bold" }, Yt = { class: "mt-1" }, _t = { class: "flex shrink-0 ml-4" }, Vl = /* @__PURE__ */ Object.assign({
|
|
1055
1055
|
inheritAttrs: !1
|
|
1056
1056
|
}, {
|
|
1057
1057
|
__name: "message-toast",
|
|
@@ -1064,39 +1064,39 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1064
1064
|
showTimeoutProgress: { type: Boolean, default: !1 }
|
|
1065
1065
|
},
|
|
1066
1066
|
emits: ["timeout", "close"],
|
|
1067
|
-
setup(e, { emit:
|
|
1068
|
-
const t = e,
|
|
1067
|
+
setup(e, { emit: u }) {
|
|
1068
|
+
const t = e, n = u, a = z(() => typeof t.message == "string" ? [t.message] : t.message), l = $(0);
|
|
1069
1069
|
let c = null;
|
|
1070
1070
|
const s = () => {
|
|
1071
1071
|
window.clearTimeout(c), l.value = 100, t.active && t.timeout && (c = window.setTimeout(() => {
|
|
1072
|
-
|
|
1072
|
+
n("timeout");
|
|
1073
1073
|
}, t.timeout), window.setTimeout(() => l.value = 0, 0));
|
|
1074
1074
|
};
|
|
1075
|
-
return X(() => t.active, s), fe(s), (
|
|
1076
|
-
v("div",
|
|
1075
|
+
return X(() => t.active, s), fe(s), (o, r) => (d(), m("div", zt, [
|
|
1076
|
+
v("div", Nt, [
|
|
1077
1077
|
_(ve, { name: e.transition }, {
|
|
1078
1078
|
default: le(() => [
|
|
1079
1079
|
e.active ? (d(), m("div", {
|
|
1080
1080
|
key: 0,
|
|
1081
|
-
class: C(["overflow-hidden w-full max-w-sm rounded-md ring-1 ring-black/5 shadow-lg pointer-events-auto",
|
|
1081
|
+
class: C(["overflow-hidden w-full max-w-sm rounded-md ring-1 ring-black/5 shadow-lg pointer-events-auto", o.$attrs.class])
|
|
1082
1082
|
}, [
|
|
1083
|
-
v("div",
|
|
1084
|
-
v("div",
|
|
1085
|
-
v("div",
|
|
1086
|
-
B(
|
|
1083
|
+
v("div", Et, [
|
|
1084
|
+
v("div", It, [
|
|
1085
|
+
v("div", Ot, [
|
|
1086
|
+
B(o.$slots, "icon")
|
|
1087
1087
|
]),
|
|
1088
|
-
v("div",
|
|
1089
|
-
B(
|
|
1088
|
+
v("div", Ft, [
|
|
1089
|
+
B(o.$slots, "title", {}, () => [
|
|
1090
1090
|
v("div", jt, P(e.title), 1)
|
|
1091
1091
|
]),
|
|
1092
|
-
B(
|
|
1093
|
-
(d(!0), m(
|
|
1092
|
+
B(o.$slots, "default", {}, () => [
|
|
1093
|
+
(d(!0), m(I, null, Y(a.value, (i) => (d(), m("p", Yt, P(i), 1))), 256))
|
|
1094
1094
|
])
|
|
1095
1095
|
]),
|
|
1096
1096
|
v("div", _t, [
|
|
1097
1097
|
v("button", {
|
|
1098
1098
|
class: "inline-flex text-white bg-black/20 rounded-xs focus:ring-2 focus:outline-hidden hover:text-stone-200 focus:ring-stone-200",
|
|
1099
|
-
onClick: r[0] || (r[0] = (
|
|
1099
|
+
onClick: r[0] || (r[0] = (i) => n("close"))
|
|
1100
1100
|
}, [
|
|
1101
1101
|
r[1] || (r[1] = v("span", { class: "sr-only" }, "Close", -1)),
|
|
1102
1102
|
_(A(he), { class: "size-5" })
|
|
@@ -1114,8 +1114,8 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1114
1114
|
role: "progressbar",
|
|
1115
1115
|
"aria-hidden": "false",
|
|
1116
1116
|
"aria-label": "notification timer"
|
|
1117
|
-
}, null, 4)) :
|
|
1118
|
-
], 2)) :
|
|
1117
|
+
}, null, 4)) : N("", !0)
|
|
1118
|
+
], 2)) : N("", !0)
|
|
1119
1119
|
]),
|
|
1120
1120
|
_: 3
|
|
1121
1121
|
}, 8, ["name"])
|
|
@@ -1126,10 +1126,10 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1126
1126
|
key: 0,
|
|
1127
1127
|
class: "fixed inset-0 z-9998 bg-white/50 backdrop-blur-xs",
|
|
1128
1128
|
"aria-hidden": "true"
|
|
1129
|
-
},
|
|
1129
|
+
}, Ht = {
|
|
1130
1130
|
key: 0,
|
|
1131
1131
|
class: "fixed inset-0 z-9999"
|
|
1132
|
-
},
|
|
1132
|
+
}, Zt = { class: "flex justify-center items-center h-screen" }, Dl = {
|
|
1133
1133
|
__name: "modal",
|
|
1134
1134
|
props: {
|
|
1135
1135
|
show: Boolean,
|
|
@@ -1138,17 +1138,17 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1138
1138
|
contentClass: { type: String, default: "" }
|
|
1139
1139
|
},
|
|
1140
1140
|
emits: ["clicked-outside"],
|
|
1141
|
-
setup(e, { emit:
|
|
1142
|
-
const t =
|
|
1143
|
-
return pe(
|
|
1144
|
-
e.show ? (d(), m("div", Rt)) :
|
|
1141
|
+
setup(e, { emit: u }) {
|
|
1142
|
+
const t = u, n = $(null);
|
|
1143
|
+
return pe(n, () => t("clicked-outside")), (a, l) => (d(), m(I, null, [
|
|
1144
|
+
e.show ? (d(), m("div", Rt)) : N("", !0),
|
|
1145
1145
|
_(ve, { name: "appear" }, {
|
|
1146
1146
|
default: le(() => [
|
|
1147
|
-
e.show ? (d(), m("div",
|
|
1148
|
-
v("div",
|
|
1147
|
+
e.show ? (d(), m("div", Ht, [
|
|
1148
|
+
v("div", Zt, [
|
|
1149
1149
|
v("div", {
|
|
1150
1150
|
ref_key: "container",
|
|
1151
|
-
ref:
|
|
1151
|
+
ref: n,
|
|
1152
1152
|
class: C(["overflow-hidden relative max-w-full bg-white rounded-sm ring-1 ring-black/10 shadow-xl transition-all transform xl:max-w-(--breakpoint-xl)", e.containerClass])
|
|
1153
1153
|
}, [
|
|
1154
1154
|
v("div", {
|
|
@@ -1163,13 +1163,13 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1163
1163
|
], 2)
|
|
1164
1164
|
], 2)
|
|
1165
1165
|
])
|
|
1166
|
-
])) :
|
|
1166
|
+
])) : N("", !0)
|
|
1167
1167
|
]),
|
|
1168
1168
|
_: 3
|
|
1169
1169
|
})
|
|
1170
1170
|
], 64));
|
|
1171
1171
|
}
|
|
1172
|
-
}, Wt = { class: "flex justify-between items-center px-4 sm:px-0" }, Ut = { class: "flex flex-1 -mt-px w-0" },
|
|
1172
|
+
}, Wt = { class: "flex justify-between items-center px-4 sm:px-0" }, Ut = { class: "flex flex-1 -mt-px w-0" }, qt = ["disabled"], Kt = { class: "hidden md:flex md:-mt-px" }, Xt = { class: "flex flex-1 justify-end -mt-px w-0" }, Gt = ["disabled"], Al = {
|
|
1173
1173
|
__name: "pagination",
|
|
1174
1174
|
props: {
|
|
1175
1175
|
page: { type: Number, default: 1 },
|
|
@@ -1182,25 +1182,25 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1182
1182
|
markerPosition: { type: String, default: "above", validator: (e) => ["above", "below"].includes(e) }
|
|
1183
1183
|
},
|
|
1184
1184
|
emits: ["update:page"],
|
|
1185
|
-
setup(e, { emit:
|
|
1186
|
-
const t =
|
|
1187
|
-
let
|
|
1188
|
-
if (
|
|
1185
|
+
setup(e, { emit: u }) {
|
|
1186
|
+
const t = u, n = e, a = $(Math.ceil(n.total / n.perPage)), l = $(null), c = z(() => (n.markerPosition === "above" ? "border-t-4 -mt-[4px]" : "border-b-4 -mb-[4px]") + " py-4"), s = z(() => {
|
|
1187
|
+
let i = [1];
|
|
1188
|
+
if (n.showAllPages || a.value <= 7) {
|
|
1189
1189
|
for (let f = 2; f <= a.value; ++f)
|
|
1190
|
-
|
|
1191
|
-
return
|
|
1190
|
+
i.push(f);
|
|
1191
|
+
return i;
|
|
1192
1192
|
}
|
|
1193
|
-
return l.value >= a.value ?
|
|
1194
|
-
}),
|
|
1193
|
+
return l.value >= a.value ? i.push("dots", l.value - 2, l.value - 1) : l.value - 1 && l.value - 1 > 1 && (l.value > 1 && i.push("dots"), i.push(l.value - 1)), l.value > 1 && i.push(l.value), l.value + 1 < a.value && (i.push(l.value + 1), l.value <= 1 && i.push(l.value + 2), l.value + 2 < a.value && i.push("dots")), l.value < a.value && i.push(a.value), i;
|
|
1194
|
+
}), o = () => {
|
|
1195
1195
|
l.value > 1 && t("update:page", l.value - 1);
|
|
1196
1196
|
}, r = () => {
|
|
1197
1197
|
l.value < a.value && t("update:page", l.value + 1);
|
|
1198
1198
|
};
|
|
1199
|
-
return X(() =>
|
|
1200
|
-
a.value = Math.ceil(
|
|
1201
|
-
}), X(() =>
|
|
1202
|
-
a.value = Math.ceil(
|
|
1203
|
-
}), (
|
|
1199
|
+
return X(() => n.page, (i) => l.value = Math.min(Math.max(i, 1), a.value), { immediate: !0 }), X(() => n.perPage, (i) => {
|
|
1200
|
+
a.value = Math.ceil(n.total / n.perPage), t("update:page", 1);
|
|
1201
|
+
}), X(() => n.total, (i) => {
|
|
1202
|
+
a.value = Math.ceil(n.total / n.perPage), l.value > a.value && t("update:page", a.value);
|
|
1203
|
+
}), (i, f) => (d(), m("nav", Wt, [
|
|
1204
1204
|
v("div", Ut, [
|
|
1205
1205
|
e.showNavButtons ? (d(), m("button", {
|
|
1206
1206
|
key: 0,
|
|
@@ -1209,14 +1209,14 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1209
1209
|
l.value <= 1 ? "pointer-events-none text-gray-500" : "text-vxvue-700",
|
|
1210
1210
|
"inline-flex items-center pr-1 text-sm border-transparent hover:text-vxvue"
|
|
1211
1211
|
]),
|
|
1212
|
-
onClick:
|
|
1212
|
+
onClick: o
|
|
1213
1213
|
}, [
|
|
1214
1214
|
_(A(ie), { class: "size-5" }),
|
|
1215
1215
|
J(" " + P(e.prevText), 1)
|
|
1216
|
-
], 10,
|
|
1216
|
+
], 10, qt)) : N("", !0)
|
|
1217
1217
|
]),
|
|
1218
|
-
v("div",
|
|
1219
|
-
(d(!0), m(
|
|
1218
|
+
v("div", Kt, [
|
|
1219
|
+
(d(!0), m(I, null, Y(s.value, (x, y) => (d(), U(de(e.page !== "dots" ? "button" : "span"), {
|
|
1220
1220
|
key: y,
|
|
1221
1221
|
class: C([
|
|
1222
1222
|
{ "pointer-events-none": x === "dots" },
|
|
@@ -1244,12 +1244,12 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1244
1244
|
}, [
|
|
1245
1245
|
J(P(e.nextText) + " ", 1),
|
|
1246
1246
|
_(A(re), { class: "size-5" })
|
|
1247
|
-
], 10, Gt)) :
|
|
1247
|
+
], 10, Gt)) : N("", !0)
|
|
1248
1248
|
])
|
|
1249
1249
|
]));
|
|
1250
1250
|
}
|
|
1251
1251
|
};
|
|
1252
|
-
function Jt(e,
|
|
1252
|
+
function Jt(e, u) {
|
|
1253
1253
|
return d(), m("svg", {
|
|
1254
1254
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1255
1255
|
fill: "none",
|
|
@@ -1266,7 +1266,7 @@ function Jt(e, i) {
|
|
|
1266
1266
|
})
|
|
1267
1267
|
]);
|
|
1268
1268
|
}
|
|
1269
|
-
function Qt(e,
|
|
1269
|
+
function Qt(e, u) {
|
|
1270
1270
|
return d(), m("svg", {
|
|
1271
1271
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1272
1272
|
fill: "none",
|
|
@@ -1292,17 +1292,17 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1292
1292
|
__name: "password-input",
|
|
1293
1293
|
props: { modelValue: { type: String, default: "" } },
|
|
1294
1294
|
emits: ["update:modelValue"],
|
|
1295
|
-
setup(e, { emit:
|
|
1296
|
-
const t =
|
|
1297
|
-
let l = Object.assign({},
|
|
1295
|
+
setup(e, { emit: u }) {
|
|
1296
|
+
const t = u, n = $(!1), a = z(() => {
|
|
1297
|
+
let l = Object.assign({}, K());
|
|
1298
1298
|
return delete l.class, l;
|
|
1299
1299
|
});
|
|
1300
1300
|
return (l, c) => (d(), m("div", {
|
|
1301
|
-
class: C("inline-block relative " +
|
|
1301
|
+
class: C("inline-block relative " + K().class)
|
|
1302
1302
|
}, [
|
|
1303
1303
|
v("input", R({
|
|
1304
1304
|
value: e.modelValue,
|
|
1305
|
-
type:
|
|
1305
|
+
type: n.value ? "text" : "password"
|
|
1306
1306
|
}, a.value, {
|
|
1307
1307
|
class: "block pr-12 w-full form-input peer",
|
|
1308
1308
|
onInput: c[0] || (c[0] = (s) => t("update:modelValue", s.target.value))
|
|
@@ -1310,10 +1310,10 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1310
1310
|
v("button", {
|
|
1311
1311
|
class: "flex absolute inset-y-0 right-0 items-center px-3 text-brand-700 hover:text-brand",
|
|
1312
1312
|
"aria-label": "show-password-toggle",
|
|
1313
|
-
disabled:
|
|
1314
|
-
onClick: c[1] || (c[1] = j((s) =>
|
|
1313
|
+
disabled: K().disabled ?? !1,
|
|
1314
|
+
onClick: c[1] || (c[1] = j((s) => n.value = !n.value, ["stop"]))
|
|
1315
1315
|
}, [
|
|
1316
|
-
|
|
1316
|
+
n.value ? (d(), U(A(Jt), {
|
|
1317
1317
|
key: 0,
|
|
1318
1318
|
class: "size-5"
|
|
1319
1319
|
})) : (d(), U(A(Qt), {
|
|
@@ -1333,10 +1333,10 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1333
1333
|
modelValue: { type: Object, default: null }
|
|
1334
1334
|
},
|
|
1335
1335
|
emits: ["update:modelValue", "expand"],
|
|
1336
|
-
setup(e, { emit:
|
|
1337
|
-
const t = e,
|
|
1336
|
+
setup(e, { emit: u }) {
|
|
1337
|
+
const t = e, n = u, a = $(!1);
|
|
1338
1338
|
return fe(() => {
|
|
1339
|
-
t.branch === t.modelValue &&
|
|
1339
|
+
t.branch === t.modelValue && n("expand", !0);
|
|
1340
1340
|
}), (l, c) => {
|
|
1341
1341
|
const s = Le("simple-tree", !0);
|
|
1342
1342
|
return d(), m("div", {
|
|
@@ -1346,15 +1346,15 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1346
1346
|
e.branch.branches && e.branch.branches.length ? (d(), m("button", {
|
|
1347
1347
|
key: 0,
|
|
1348
1348
|
class: "mr-2",
|
|
1349
|
-
onClick: c[0] || (c[0] = (
|
|
1349
|
+
onClick: c[0] || (c[0] = (o) => a.value = !a.value)
|
|
1350
1350
|
}, [
|
|
1351
1351
|
B(l.$slots, "toggle", {
|
|
1352
1352
|
branch: e.branch,
|
|
1353
1353
|
expanded: a.value
|
|
1354
1354
|
}, () => [
|
|
1355
|
-
(d(), U(de(a.value ? A(
|
|
1355
|
+
(d(), U(de(a.value ? A(Ie) : A(Oe)), { class: "p-1 text-white rounded-xs size-5 bg-vxvue-700 hover:bg-vxvue" }))
|
|
1356
1356
|
])
|
|
1357
|
-
])) :
|
|
1357
|
+
])) : N("", !0),
|
|
1358
1358
|
e.branch === e.modelValue ? B(l.$slots, "label-selected", {
|
|
1359
1359
|
key: 1,
|
|
1360
1360
|
branch: e.branch
|
|
@@ -1362,7 +1362,7 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1362
1362
|
v("strong", null, P(e.branch.label), 1)
|
|
1363
1363
|
]) : (d(), m("button", {
|
|
1364
1364
|
key: 2,
|
|
1365
|
-
onClick: c[1] || (c[1] = (
|
|
1365
|
+
onClick: c[1] || (c[1] = (o) => n("update:modelValue", e.branch))
|
|
1366
1366
|
}, [
|
|
1367
1367
|
B(l.$slots, "label", { branch: e.branch }, () => [
|
|
1368
1368
|
J(P(e.branch.label), 1)
|
|
@@ -1370,25 +1370,25 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1370
1370
|
]))
|
|
1371
1371
|
]),
|
|
1372
1372
|
e.branch.branches && e.branch.branches.length ? xe((d(), m("div", al, [
|
|
1373
|
-
(d(!0), m(
|
|
1374
|
-
key:
|
|
1375
|
-
branch:
|
|
1373
|
+
(d(!0), m(I, null, Y(e.branch.branches, (o) => (d(), U(s, {
|
|
1374
|
+
key: o.id || o.key || null,
|
|
1375
|
+
branch: o,
|
|
1376
1376
|
"model-value": e.modelValue,
|
|
1377
|
-
"onUpdate:modelValue": c[2] || (c[2] = (r) =>
|
|
1377
|
+
"onUpdate:modelValue": c[2] || (c[2] = (r) => n("update:modelValue", r)),
|
|
1378
1378
|
onExpand: c[3] || (c[3] = (r) => {
|
|
1379
|
-
a.value = r,
|
|
1379
|
+
a.value = r, n("expand", r);
|
|
1380
1380
|
})
|
|
1381
1381
|
}, Te({ _: 2 }, [
|
|
1382
|
-
Y(l.$slots, (r,
|
|
1383
|
-
name:
|
|
1382
|
+
Y(l.$slots, (r, i) => ({
|
|
1383
|
+
name: i,
|
|
1384
1384
|
fn: le((f) => [
|
|
1385
|
-
B(l.$slots,
|
|
1385
|
+
B(l.$slots, i, R({ ref_for: !0 }, f))
|
|
1386
1386
|
])
|
|
1387
1387
|
}))
|
|
1388
1388
|
]), 1032, ["branch", "model-value"]))), 128))
|
|
1389
1389
|
], 512)), [
|
|
1390
1390
|
[Be, a.value]
|
|
1391
|
-
]) :
|
|
1391
|
+
]) : N("", !0)
|
|
1392
1392
|
], 2);
|
|
1393
1393
|
};
|
|
1394
1394
|
}
|
|
@@ -1396,23 +1396,23 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1396
1396
|
__name: "sizable",
|
|
1397
1397
|
props: { vertical: Boolean },
|
|
1398
1398
|
emits: ["dragStart", "dragStop"],
|
|
1399
|
-
setup(e, { emit:
|
|
1400
|
-
const t = e,
|
|
1401
|
-
let c = !1, s = {},
|
|
1399
|
+
setup(e, { emit: u }) {
|
|
1400
|
+
const t = e, n = u, a = $(null), l = $(null);
|
|
1401
|
+
let c = !1, s = {}, o = null, r = null, i = null;
|
|
1402
1402
|
const f = (b) => {
|
|
1403
1403
|
var L;
|
|
1404
1404
|
if (c) {
|
|
1405
1405
|
b.preventDefault();
|
|
1406
1406
|
const { pageX: p, pageY: k } = ((L = b.touches) == null ? void 0 : L[0]) ?? b;
|
|
1407
|
-
t.vertical ? a.value.style.height = Math.min(r.height -
|
|
1407
|
+
t.vertical ? a.value.style.height = Math.min(r.height - i.height - (o.y - r.y), Math.max(0, o.height + k - s.y)) + "px" : a.value.style.width = Math.min(r.width - i.width - (o.x - r.x), Math.max(0, o.width + p - s.x)) + "px";
|
|
1408
1408
|
}
|
|
1409
1409
|
}, x = (b) => {
|
|
1410
1410
|
var k;
|
|
1411
1411
|
b.preventDefault(), b.currentTarget.focus(), c = !0;
|
|
1412
1412
|
const { pageX: L, pageY: p } = ((k = b.touches) == null ? void 0 : k[0]) ?? b;
|
|
1413
|
-
s = { x: L, y: p },
|
|
1413
|
+
s = { x: L, y: p }, i = l.value.getBoundingClientRect(), o = a.value.getBoundingClientRect(), r = a.value.parentElement.getBoundingClientRect(), b.type === "mousedown" ? (document.addEventListener("mousemove", f), document.addEventListener("mouseup", y)) : (document.addEventListener("touchmove", f), document.addEventListener("touchend", y)), n("dragStart");
|
|
1414
1414
|
}, y = (b) => {
|
|
1415
|
-
c && (c = !1, b.type === "mouseup" ? (document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", y)) : (document.removeEventListener("touchmove", f), document.removeEventListener("touchend", y)), setTimeout(() =>
|
|
1415
|
+
c && (c = !1, b.type === "mouseup" ? (document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", y)) : (document.removeEventListener("touchmove", f), document.removeEventListener("touchend", y)), setTimeout(() => n("dragStop"), 0));
|
|
1416
1416
|
};
|
|
1417
1417
|
return (b, L) => (d(), m("div", {
|
|
1418
1418
|
ref_key: "box",
|
|
@@ -1446,45 +1446,45 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1446
1446
|
vertical: Boolean,
|
|
1447
1447
|
disabled: Boolean,
|
|
1448
1448
|
modelValue: { type: [Number, Array], default: null, validator(e) {
|
|
1449
|
-
return typeof e == "number" || e.every((
|
|
1449
|
+
return typeof e == "number" || e.every((u) => typeof u == "number");
|
|
1450
1450
|
} }
|
|
1451
1451
|
},
|
|
1452
1452
|
emits: ["update:modelValue", "dragStart", "dragStop"],
|
|
1453
|
-
setup(e, { emit:
|
|
1454
|
-
const t = e,
|
|
1453
|
+
setup(e, { emit: u }) {
|
|
1454
|
+
const t = e, n = u, a = K(), l = { x: null, y: null }, c = { w: null, h: null };
|
|
1455
1455
|
let s = !1;
|
|
1456
|
-
const
|
|
1456
|
+
const o = $(null), r = $(0), i = z(() => {
|
|
1457
1457
|
const S = t.max, M = t.min;
|
|
1458
|
-
return t.modelValue instanceof Array ? t.modelValue.map((
|
|
1458
|
+
return t.modelValue instanceof Array ? t.modelValue.map((F) => (Math.max(Math.min(F, S), M) - M) * 100 / (S - M)) : (Math.max(Math.min(t.modelValue, S), M) - M) * 100 / (S - M);
|
|
1459
1459
|
}), f = z(() => {
|
|
1460
1460
|
if (t.modelValue instanceof Array) {
|
|
1461
|
-
const S = Math.min(...
|
|
1461
|
+
const S = Math.min(...i.value) + "%", M = Math.max(...i.value) - Math.min(...i.value) + "%";
|
|
1462
1462
|
return t.vertical ? { bottom: S, height: M } : { left: S, width: M };
|
|
1463
1463
|
}
|
|
1464
|
-
return t.vertical ? { bottom: 0, height:
|
|
1464
|
+
return t.vertical ? { bottom: 0, height: i.value + "%" } : { width: i.value + "%" };
|
|
1465
1465
|
}), x = $({
|
|
1466
1466
|
class: (t.vertical ? "left-0 -translate-x-1.5 translate-y-2.5" : "top-0 -translate-x-2.5 -translate-y-1.5") + " touch-none absolute size-5 rounded-full border-2 bg-white transition-colors duration-200 " + (t.disabled ? "" : " focus:ring-4 focus:outline-hidden border-vxvue cursor-grab hover:bg-vxvue focus:ring-vxvue/50"),
|
|
1467
1467
|
tabindex: 0
|
|
1468
1468
|
}), y = (S) => {
|
|
1469
1469
|
let M = parseFloat(S.toFixed(10));
|
|
1470
1470
|
if (M = Math.min(t.max, Math.max(t.min, M)), t.modelValue instanceof Array) {
|
|
1471
|
-
let
|
|
1472
|
-
|
|
1471
|
+
let F = [...t.modelValue];
|
|
1472
|
+
F[r.value] = M, n("update:modelValue", F);
|
|
1473
1473
|
} else
|
|
1474
|
-
|
|
1474
|
+
n("update:modelValue", M);
|
|
1475
1475
|
}, b = (S) => {
|
|
1476
|
-
const { pageX: M, pageY:
|
|
1476
|
+
const { pageX: M, pageY: F } = S.touches ? S.touches[0] : S, h = t.vertical ? (-F + l.y) / c.h : (M - l.x) / c.w;
|
|
1477
1477
|
y(Math.floor((t.max - t.min) * h + t.min));
|
|
1478
1478
|
}, L = () => {
|
|
1479
|
-
const { clientLeft: S, clientTop: M, scrollLeft:
|
|
1480
|
-
l.x = g.left +
|
|
1479
|
+
const { clientLeft: S, clientTop: M, scrollLeft: F, scrollTop: h } = document.documentElement, g = o.value.getBoundingClientRect();
|
|
1480
|
+
l.x = g.left + F - S, l.y = g.bottom + h - M, c.w = o.value.offsetWidth, c.h = o.value.offsetHeight;
|
|
1481
1481
|
}, p = (S) => {
|
|
1482
1482
|
s && (S.preventDefault(), b(S));
|
|
1483
1483
|
}, k = (S) => {
|
|
1484
|
-
S.preventDefault(), S.currentTarget.focus(), L(), s = !0, S.type === "mousedown" ? (document.addEventListener("mousemove", p), document.addEventListener("mouseup", D)) : (document.addEventListener("touchmove", p), document.addEventListener("touchend", D)),
|
|
1484
|
+
S.preventDefault(), S.currentTarget.focus(), L(), s = !0, S.type === "mousedown" ? (document.addEventListener("mousemove", p), document.addEventListener("mouseup", D)) : (document.addEventListener("touchmove", p), document.addEventListener("touchend", D)), n("dragStart");
|
|
1485
1485
|
}, D = (S) => {
|
|
1486
|
-
s && (s = !1, S.type === "mouseup" ? (document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", D)) : (document.removeEventListener("touchmove", p), document.removeEventListener("touchend", D)), setTimeout(() =>
|
|
1487
|
-
},
|
|
1486
|
+
s && (s = !1, S.type === "mouseup" ? (document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", D)) : (document.removeEventListener("touchmove", p), document.removeEventListener("touchend", D)), setTimeout(() => n("dragStop"), 0));
|
|
1487
|
+
}, Z = (S) => {
|
|
1488
1488
|
S.keyCode >= 33 && S.keyCode <= 40 && S.preventDefault();
|
|
1489
1489
|
const M = t.modelValue[r.value] ?? t.modelValue;
|
|
1490
1490
|
switch (S.keyCode) {
|
|
@@ -1508,12 +1508,12 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1508
1508
|
case 35:
|
|
1509
1509
|
y(t.max);
|
|
1510
1510
|
}
|
|
1511
|
-
},
|
|
1511
|
+
}, H = (S) => {
|
|
1512
1512
|
L(), b(S);
|
|
1513
1513
|
};
|
|
1514
1514
|
return (S, M) => (d(), m("div", R({
|
|
1515
1515
|
ref_key: "track",
|
|
1516
|
-
ref:
|
|
1516
|
+
ref: o,
|
|
1517
1517
|
class: ["relative bg-slate-300", e.vertical ? "h-full w-2 rounded-t-full rounded-b-full" : "w-full h-2 rounded-r-full rounded-l-full"],
|
|
1518
1518
|
role: "slider",
|
|
1519
1519
|
"aria-label": "slider-thumb",
|
|
@@ -1522,21 +1522,21 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1522
1522
|
"aria-valuenow": e.modelValue[0] ?? e.modelValue,
|
|
1523
1523
|
"aria-valuetext": e.modelValue
|
|
1524
1524
|
}, ue(e.disabled ? {} : {
|
|
1525
|
-
click:
|
|
1525
|
+
click: H
|
|
1526
1526
|
}, !0)), [
|
|
1527
|
-
e.disabled ?
|
|
1527
|
+
e.disabled ? N("", !0) : (d(), m("div", {
|
|
1528
1528
|
key: 0,
|
|
1529
1529
|
class: C(["absolute bg-vxvue", e.vertical ? "w-full rounded-t-full rounded-b-full" : "h-full rounded-r-full rounded-l-full"]),
|
|
1530
1530
|
style: ye(f.value)
|
|
1531
1531
|
}, null, 6)),
|
|
1532
|
-
e.modelValue.length ? (d(!0), m(
|
|
1532
|
+
e.modelValue.length ? (d(!0), m(I, { key: 2 }, Y(e.modelValue, (F, h) => (d(), m("button", R({
|
|
1533
1533
|
id: h ? null : A(a).id,
|
|
1534
|
-
style: e.vertical ? { bottom:
|
|
1534
|
+
style: e.vertical ? { bottom: i.value[h] + "%" } : { left: i.value[h] + "%" },
|
|
1535
1535
|
"aria-label": "slider-thumb-" + (h + 1),
|
|
1536
1536
|
ref_for: !0
|
|
1537
1537
|
}, x.value, ue(e.disabled ? {} : {
|
|
1538
1538
|
focus: () => r.value = h,
|
|
1539
|
-
keydown:
|
|
1539
|
+
keydown: Z,
|
|
1540
1540
|
touchstart: (g) => {
|
|
1541
1541
|
r.value = h, k(g);
|
|
1542
1542
|
},
|
|
@@ -1548,16 +1548,16 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1548
1548
|
}, !0)), null, 16, ol))), 256)) : (d(), m("button", R({
|
|
1549
1549
|
key: 1,
|
|
1550
1550
|
id: A(a).id,
|
|
1551
|
-
style: e.vertical ? { bottom:
|
|
1551
|
+
style: e.vertical ? { bottom: i.value + "%" } : { left: i.value + "%" },
|
|
1552
1552
|
"aria-label": "slider-thumb"
|
|
1553
1553
|
}, x.value, ue(e.disabled ? {} : {
|
|
1554
1554
|
focus: () => r.value = 0,
|
|
1555
|
-
keydown:
|
|
1556
|
-
touchstart: (
|
|
1557
|
-
r.value = 0, k(
|
|
1555
|
+
keydown: Z,
|
|
1556
|
+
touchstart: (F) => {
|
|
1557
|
+
r.value = 0, k(F);
|
|
1558
1558
|
},
|
|
1559
|
-
mousedown: (
|
|
1560
|
-
r.value = 0, k(
|
|
1559
|
+
mousedown: (F) => {
|
|
1560
|
+
r.value = 0, k(F);
|
|
1561
1561
|
},
|
|
1562
1562
|
touchend: D,
|
|
1563
1563
|
mouseup: D
|
|
@@ -1571,8 +1571,8 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1571
1571
|
type: Array,
|
|
1572
1572
|
required: !0,
|
|
1573
1573
|
validator: (e) => {
|
|
1574
|
-
for (const
|
|
1575
|
-
if (
|
|
1574
|
+
for (const u of e)
|
|
1575
|
+
if (u.label === void 0 || u.prop === void 0)
|
|
1576
1576
|
return !1;
|
|
1577
1577
|
return !0;
|
|
1578
1578
|
}
|
|
@@ -1587,43 +1587,43 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1587
1587
|
bodyClass: { type: String, default: "[&>*:nth-child(even)]:bg-vxvue-50 [&>*:nth-child(even)_*[data-active]]:bg-vxvue-alt-100 [&>*:nth-child(odd)_*[data-active]]:bg-vxvue-alt-50" }
|
|
1588
1588
|
},
|
|
1589
1589
|
emits: ["before-sort", "after-sort"],
|
|
1590
|
-
setup(e, { emit:
|
|
1591
|
-
const t = e,
|
|
1592
|
-
let
|
|
1593
|
-
const r = t.columns.find(({ prop:
|
|
1594
|
-
return r && (l.value === "asc" && r.sortAscFunction ?
|
|
1595
|
-
}), s = (
|
|
1596
|
-
|
|
1590
|
+
setup(e, { emit: u }) {
|
|
1591
|
+
const t = e, n = u, a = $(t.sortProp), l = $(t.sortDirection), c = z(() => {
|
|
1592
|
+
let o = t.rows.slice();
|
|
1593
|
+
const r = t.columns.find(({ prop: i }) => i === a.value);
|
|
1594
|
+
return r && (l.value === "asc" && r.sortAscFunction ? o.sort(r.sortAscFunction) : l.value === "desc" && r.sortDescFunction ? o.sort(r.sortDescFunction) : o.sort((i, f) => i[a.value] < f[a.value] ? l.value === "asc" ? -1 : 1 : i[a.value] > f[a.value] ? l.value === "asc" ? 1 : -1 : 0)), o.slice(t.offset || 0, (t.offset || 0) + (t.count || o.length));
|
|
1595
|
+
}), s = (o) => {
|
|
1596
|
+
n("before-sort", { prop: a.value, dir: l.value }), a.value === o ? l.value = l.value === "asc" ? "desc" : "asc" : (a.value = o, l.value = l.value || "asc"), me(() => n("after-sort", { prop: a.value, dir: l.value }));
|
|
1597
1597
|
};
|
|
1598
|
-
return (
|
|
1599
|
-
class: C(
|
|
1598
|
+
return (o, r) => (d(), m("table", {
|
|
1599
|
+
class: C(o.$attrs.class || "w-full divide-y divide-y-slate-900 table-fixed")
|
|
1600
1600
|
}, [
|
|
1601
1601
|
v("thead", {
|
|
1602
1602
|
class: C(e.headerClass)
|
|
1603
1603
|
}, [
|
|
1604
1604
|
v("tr", null, [
|
|
1605
|
-
(d(!0), m(
|
|
1606
|
-
key:
|
|
1605
|
+
(d(!0), m(I, null, Y(e.columns, (i) => (d(), m("th", {
|
|
1606
|
+
key: i.prop,
|
|
1607
1607
|
scope: "col",
|
|
1608
|
-
"data-active": a.value ===
|
|
1608
|
+
"data-active": a.value === i.prop ? "active" : null,
|
|
1609
1609
|
class: C([
|
|
1610
1610
|
"py-3 px-6 text-left",
|
|
1611
|
-
{ "cursor-pointer":
|
|
1612
|
-
|
|
1611
|
+
{ "cursor-pointer": i.sortable },
|
|
1612
|
+
i.cssClass
|
|
1613
1613
|
]),
|
|
1614
|
-
onClick: (f) =>
|
|
1614
|
+
onClick: (f) => i.sortable ? s(i.prop) : null
|
|
1615
1615
|
}, [
|
|
1616
|
-
B(
|
|
1617
|
-
column:
|
|
1616
|
+
B(o.$slots, i.prop + "-header", {
|
|
1617
|
+
column: i,
|
|
1618
1618
|
sortDir: l.value,
|
|
1619
1619
|
sortProp: a.value
|
|
1620
1620
|
}, () => [
|
|
1621
1621
|
v("div", ul, [
|
|
1622
|
-
v("span", null, P(
|
|
1623
|
-
|
|
1622
|
+
v("span", null, P(i.label), 1),
|
|
1623
|
+
i.sortable ? (d(), U(de(a.value !== i.prop ? A(Ne) : l.value === "asc" ? A(ze) : A(Ee)), {
|
|
1624
1624
|
key: 0,
|
|
1625
1625
|
class: "size-4"
|
|
1626
|
-
})) :
|
|
1626
|
+
})) : N("", !0)
|
|
1627
1627
|
])
|
|
1628
1628
|
])
|
|
1629
1629
|
], 10, rl))), 128))
|
|
@@ -1632,27 +1632,27 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1632
1632
|
v("tbody", {
|
|
1633
1633
|
class: C(e.bodyClass)
|
|
1634
1634
|
}, [
|
|
1635
|
-
(d(!0), m(
|
|
1636
|
-
key:
|
|
1637
|
-
class: C(
|
|
1635
|
+
(d(!0), m(I, null, Y(c.value, (i) => (d(), m("tr", {
|
|
1636
|
+
key: i[e.keyProperty],
|
|
1637
|
+
class: C(i.cssClass)
|
|
1638
1638
|
}, [
|
|
1639
|
-
(d(!0), m(
|
|
1639
|
+
(d(!0), m(I, null, Y(e.columns, (f) => (d(), m("td", {
|
|
1640
1640
|
key: f.prop,
|
|
1641
1641
|
"data-active": a.value === f.prop ? "active" : null,
|
|
1642
1642
|
class: "overflow-hidden py-3 px-6 whitespace-nowrap text-ellipsis"
|
|
1643
1643
|
}, [
|
|
1644
|
-
B(
|
|
1645
|
-
J(P(
|
|
1644
|
+
B(o.$slots, f.prop, { row: i }, () => [
|
|
1645
|
+
J(P(i[f.prop]), 1)
|
|
1646
1646
|
])
|
|
1647
1647
|
], 8, il))), 128))
|
|
1648
1648
|
], 2))), 128))
|
|
1649
1649
|
], 2)
|
|
1650
1650
|
], 2));
|
|
1651
1651
|
}
|
|
1652
|
-
}, dl = (e,
|
|
1652
|
+
}, dl = (e, u) => {
|
|
1653
1653
|
const t = e.__vccOpts || e;
|
|
1654
|
-
for (const [
|
|
1655
|
-
t[
|
|
1654
|
+
for (const [n, a] of u)
|
|
1655
|
+
t[n] = a;
|
|
1656
1656
|
return t;
|
|
1657
1657
|
}, cl = { class: "flex items-center space-x-2" }, vl = ["disabled"], ml = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1658
1658
|
__name: "submit-button",
|
|
@@ -1662,59 +1662,59 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1662
1662
|
theme: { type: String, default: null }
|
|
1663
1663
|
},
|
|
1664
1664
|
emits: ["submit"],
|
|
1665
|
-
setup(e, { emit:
|
|
1666
|
-
const t =
|
|
1667
|
-
return (
|
|
1665
|
+
setup(e, { emit: u }) {
|
|
1666
|
+
const t = u;
|
|
1667
|
+
return (n, a) => (d(), m("div", cl, [
|
|
1668
1668
|
v("button", {
|
|
1669
|
-
class: C([
|
|
1670
|
-
disabled:
|
|
1669
|
+
class: C([n.$attrs.class, e.theme]),
|
|
1670
|
+
disabled: n.$attrs.disabled || e.busy,
|
|
1671
1671
|
type: "button",
|
|
1672
1672
|
onClick: a[0] || (a[0] = (l) => t("submit"))
|
|
1673
1673
|
}, [
|
|
1674
|
-
B(
|
|
1674
|
+
B(n.$slots, "default", {}, void 0, !0)
|
|
1675
1675
|
], 10, vl),
|
|
1676
1676
|
e.busy ? (d(), U(we, {
|
|
1677
1677
|
key: 0,
|
|
1678
1678
|
class: C(e.spinnerClass || ["size-5", { error: "text-error", success: "text-success", default: "text-vxvue" }[e.theme || "default"]])
|
|
1679
|
-
}, null, 8, ["class"])) :
|
|
1679
|
+
}, null, 8, ["class"])) : N("", !0)
|
|
1680
1680
|
]));
|
|
1681
1681
|
}
|
|
1682
|
-
}),
|
|
1682
|
+
}), Nl = /* @__PURE__ */ dl(ml, [["__scopeId", "data-v-9f360713"]]), fl = { class: "sm:hidden" }, hl = { class: "hidden sm:block" }, pl = { class: "border-b border-gray-200" }, gl = {
|
|
1683
1683
|
class: "flex -mb-px space-x-8",
|
|
1684
1684
|
"aria-label": "Tabs"
|
|
1685
|
-
}, bl = ["aria-current", "onClick"],
|
|
1685
|
+
}, bl = ["aria-current", "onClick"], El = {
|
|
1686
1686
|
__name: "tabs",
|
|
1687
1687
|
props: {
|
|
1688
1688
|
items: { type: Array, default: () => [] },
|
|
1689
1689
|
activeIndex: { type: Number, default: 0 }
|
|
1690
1690
|
},
|
|
1691
1691
|
emits: ["update:activeIndex"],
|
|
1692
|
-
setup(e, { emit:
|
|
1693
|
-
const t = e,
|
|
1692
|
+
setup(e, { emit: u }) {
|
|
1693
|
+
const t = e, n = u, a = $(t.items[t.activeIndex] || {}), l = z(() => {
|
|
1694
1694
|
let s = [];
|
|
1695
|
-
return t.items.forEach((
|
|
1696
|
-
|
|
1695
|
+
return t.items.forEach((o, r) => {
|
|
1696
|
+
o.disabled || s.push({ label: o.name, key: r });
|
|
1697
1697
|
}), s;
|
|
1698
1698
|
});
|
|
1699
1699
|
X(() => t.activeIndex, (s) => {
|
|
1700
1700
|
a.value = t.items[s] || {};
|
|
1701
1701
|
});
|
|
1702
1702
|
const c = (s) => {
|
|
1703
|
-
s.disabled || (a.value = s,
|
|
1703
|
+
s.disabled || (a.value = s, n("update:activeIndex", t.items.indexOf(s)));
|
|
1704
1704
|
};
|
|
1705
|
-
return (s,
|
|
1705
|
+
return (s, o) => (d(), m(I, null, [
|
|
1706
1706
|
v("div", fl, [
|
|
1707
1707
|
_(Lt, {
|
|
1708
1708
|
options: l.value,
|
|
1709
1709
|
"model-value": e.activeIndex,
|
|
1710
1710
|
class: "w-full",
|
|
1711
|
-
"onUpdate:modelValue":
|
|
1711
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => n("update:activeIndex", r))
|
|
1712
1712
|
}, null, 8, ["options", "model-value"])
|
|
1713
1713
|
]),
|
|
1714
1714
|
v("div", hl, [
|
|
1715
1715
|
v("div", pl, [
|
|
1716
1716
|
v("nav", gl, [
|
|
1717
|
-
(d(!0), m(
|
|
1717
|
+
(d(!0), m(I, null, Y(e.items, (r) => (d(), m("a", {
|
|
1718
1718
|
key: r.name,
|
|
1719
1719
|
href: "#",
|
|
1720
1720
|
class: C([
|
|
@@ -1726,7 +1726,7 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1726
1726
|
}
|
|
1727
1727
|
]),
|
|
1728
1728
|
"aria-current": a.value === r ? "page" : void 0,
|
|
1729
|
-
onClick: j((
|
|
1729
|
+
onClick: j((i) => c(r), ["prevent"])
|
|
1730
1730
|
}, [
|
|
1731
1731
|
B(s.$slots, "icon", { tab: r }),
|
|
1732
1732
|
v("span", null, [
|
|
@@ -1745,7 +1745,7 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1745
1745
|
"bg-gray-200": a.value !== r && !r.disabled
|
|
1746
1746
|
}
|
|
1747
1747
|
])
|
|
1748
|
-
}, P(r.badge), 3)) :
|
|
1748
|
+
}, P(r.badge), 3)) : N("", !0)
|
|
1749
1749
|
])
|
|
1750
1750
|
], 10, bl))), 128))
|
|
1751
1751
|
])
|
|
@@ -1753,36 +1753,33 @@ const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.ass
|
|
|
1753
1753
|
])
|
|
1754
1754
|
], 64));
|
|
1755
1755
|
}
|
|
1756
|
-
},
|
|
1756
|
+
}, Il = {
|
|
1757
1757
|
mounted: (e) => e.focus()
|
|
1758
|
-
},
|
|
1759
|
-
mounted: (e,
|
|
1758
|
+
}, Ol = {
|
|
1759
|
+
mounted: (e, u) => {
|
|
1760
1760
|
var l, c;
|
|
1761
|
-
|
|
1762
|
-
|
|
1761
|
+
if (!["INPUT", "TEXTAREA"].includes(e.nodeName)) {
|
|
1762
|
+
let s = e.querySelector('input:not([type]),input[type="text"],input[type="search"],input[type="email"],input[type="password"],input[type="url"],input[type="tel"]');
|
|
1763
|
+
s || (s = e.querySelector("textarea")), e = s;
|
|
1764
|
+
}
|
|
1765
|
+
if (!e) throw new Error("VFloatingLabel directive: No valid INPUT or TEXTAREA element found.");
|
|
1766
|
+
if (e.querySelector("label")) throw new Error("VFloatingLabel directive: LABEL element found.");
|
|
1767
|
+
const t = Math.random().toString(36).substring(2), n = document.createElement("div");
|
|
1768
|
+
n.classList.add("relative");
|
|
1763
1769
|
const a = document.createElement("label");
|
|
1764
1770
|
a.classList.add(
|
|
1765
|
-
"absolute",
|
|
1766
|
-
"
|
|
1767
|
-
"
|
|
1768
|
-
"top-2",
|
|
1769
|
-
"scale-90",
|
|
1770
|
-
"text-sm",
|
|
1771
|
-
"z-10",
|
|
1772
|
-
"origin-[0]",
|
|
1773
|
-
"bg-white",
|
|
1774
|
-
"-translate-y-4",
|
|
1775
|
-
"transform-gpu",
|
|
1776
|
-
"duration-200",
|
|
1777
|
-
"peer-focus:text-blue-600",
|
|
1778
|
-
"peer-focus:top-2",
|
|
1779
|
-
"peer-focus:scale-90",
|
|
1780
|
-
"peer-focus:-translate-y-full",
|
|
1781
|
-
"peer-placeholder-shown:scale-100",
|
|
1782
|
-
"peer-placeholder-shown:-translate-y-1/2",
|
|
1771
|
+
..."absolute px-2 left-1 top-2 scale-90 text-sm z-10 origin-[0] bg-white -translate-y-4 transform-gpu duration-200".split(" "),
|
|
1772
|
+
..."peer-focus:top-2 peer-focus:scale-90 peer-focus:-translate-y-full".split(" "),
|
|
1773
|
+
..."peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2".split(" "),
|
|
1783
1774
|
e.nodeName === "TEXTAREA" ? "peer-placeholder-shown:top-4" : "peer-placeholder-shown:top-1/2"
|
|
1784
|
-
), (l =
|
|
1785
|
-
}
|
|
1775
|
+
), (l = u.value) != null && l.invalid ? a.classList.add("text-error", "peer-focus:text-error") : a.classList.add("peer-focus:text-blue-600"), e.getAttribute("required") !== null && a.classList.add("required"), a.setAttribute("for", e.getAttribute("id") || t + "-element"), a.innerHTML = ((c = u.value) == null ? void 0 : c.label) || e.getAttribute("placeholder") || t + "-label", e.classList.add("peer"), e.setAttribute("placeholder", " "), e.setAttribute("id", e.getAttribute("id") || t + "-element"), e.parentElement.replaceChild(n, e), n.appendChild(e), n.appendChild(a);
|
|
1776
|
+
},
|
|
1777
|
+
updated: (e, u) => {
|
|
1778
|
+
var a, l;
|
|
1779
|
+
const t = e.parentNode.querySelector("label"), n = e.getAttribute("placeholder").trim();
|
|
1780
|
+
t.innerHTML = ((a = u.value) == null ? void 0 : a.label) || n || t.innerHTML, n && e.setAttribute("placeholder", " "), (l = u.value) != null && l.invalid ? (t.classList.add("text-error", "peer-focus:text-error"), t.classList.remove("peer-focus:text-blue-600")) : (t.classList.remove("text-error", "peer-focus:text-error"), t.classList.add("peer-focus:text-blue-600")), t.classList[e.getAttribute("required") !== null ? "add" : "remove"]("required");
|
|
1781
|
+
},
|
|
1782
|
+
beforeUnmount: (e) => e.parentNode.parentNode.removeChild(e.parentNode)
|
|
1786
1783
|
};
|
|
1787
1784
|
export {
|
|
1788
1785
|
yl as Accordion,
|
|
@@ -1803,8 +1800,8 @@ export {
|
|
|
1803
1800
|
Pl as Slider,
|
|
1804
1801
|
zl as Sortable,
|
|
1805
1802
|
we as Spinner,
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1803
|
+
Nl as SubmitButton,
|
|
1804
|
+
El as Tabs,
|
|
1805
|
+
Ol as VFloatingLabel,
|
|
1806
|
+
Il as VFocus
|
|
1810
1807
|
};
|