vx-vue 1.2.1 → 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/README.md +25 -28
- package/dist/style.css +1 -1
- package/dist/vxvue.es.js +700 -656
- package/dist/vxvue.umd.js +1 -1
- package/package.json +17 -18
package/dist/vxvue.es.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { useSlots as Se, ref as $, computed 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
|
-
let
|
|
10
|
-
|
|
9
|
+
let x = [].concat(t.activeIndex), y = x.findIndex((b) => b === f);
|
|
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,
|
|
27
|
-
var
|
|
28
|
-
return
|
|
29
|
-
key:
|
|
26
|
+
return Ce(() => l.value = []), (f, x) => (d(!0), m(I, null, Y(s.value, (y, b) => {
|
|
27
|
+
var L;
|
|
28
|
+
return d(), U(de(y), {
|
|
29
|
+
key: b,
|
|
30
30
|
ref_for: !0,
|
|
31
31
|
ref: c,
|
|
32
|
-
show: Array.isArray(e.activeIndex) ? (
|
|
33
|
-
onSelect: (
|
|
34
|
-
onKeydown: (
|
|
35
|
-
onKeyup: (
|
|
32
|
+
show: Array.isArray(e.activeIndex) ? (L = e.activeIndex) == null ? void 0 : L.includes(b) : e.activeIndex === b,
|
|
33
|
+
onSelect: (p) => o(b),
|
|
34
|
+
onKeydown: (p) => r(b),
|
|
35
|
+
onKeyup: (p) => i(b)
|
|
36
36
|
}, null, 40, ["show", "onSelect", "onKeydown", "onKeyup"]);
|
|
37
37
|
}), 128));
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function Pe(e, u) {
|
|
41
|
+
return d(), m("svg", {
|
|
42
42
|
xmlns: "http://www.w3.org/2000/svg",
|
|
43
43
|
viewBox: "0 0 24 24",
|
|
44
44
|
fill: "currentColor",
|
|
@@ -52,8 +52,8 @@ function Le(e, d) {
|
|
|
52
52
|
})
|
|
53
53
|
]);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
55
|
+
function ze(e, u) {
|
|
56
|
+
return d(), m("svg", {
|
|
57
57
|
xmlns: "http://www.w3.org/2000/svg",
|
|
58
58
|
viewBox: "0 0 24 24",
|
|
59
59
|
fill: "currentColor",
|
|
@@ -67,8 +67,8 @@ function Ie(e, d) {
|
|
|
67
67
|
})
|
|
68
68
|
]);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
70
|
+
function ie(e, u) {
|
|
71
|
+
return d(), m("svg", {
|
|
72
72
|
xmlns: "http://www.w3.org/2000/svg",
|
|
73
73
|
viewBox: "0 0 24 24",
|
|
74
74
|
fill: "currentColor",
|
|
@@ -82,8 +82,8 @@ function ue(e, d) {
|
|
|
82
82
|
})
|
|
83
83
|
]);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function re(e, u) {
|
|
86
|
+
return d(), m("svg", {
|
|
87
87
|
xmlns: "http://www.w3.org/2000/svg",
|
|
88
88
|
viewBox: "0 0 24 24",
|
|
89
89
|
fill: "currentColor",
|
|
@@ -97,8 +97,8 @@ function oe(e, d) {
|
|
|
97
97
|
})
|
|
98
98
|
]);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
100
|
+
function Ne(e, u) {
|
|
101
|
+
return d(), m("svg", {
|
|
102
102
|
xmlns: "http://www.w3.org/2000/svg",
|
|
103
103
|
viewBox: "0 0 24 24",
|
|
104
104
|
fill: "currentColor",
|
|
@@ -112,8 +112,8 @@ function Oe(e, d) {
|
|
|
112
112
|
})
|
|
113
113
|
]);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
115
|
+
function Ee(e, u) {
|
|
116
|
+
return d(), m("svg", {
|
|
117
117
|
xmlns: "http://www.w3.org/2000/svg",
|
|
118
118
|
viewBox: "0 0 24 24",
|
|
119
119
|
fill: "currentColor",
|
|
@@ -127,8 +127,8 @@ function ze(e, d) {
|
|
|
127
127
|
})
|
|
128
128
|
]);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
return
|
|
130
|
+
function Ie(e, u) {
|
|
131
|
+
return d(), m("svg", {
|
|
132
132
|
xmlns: "http://www.w3.org/2000/svg",
|
|
133
133
|
viewBox: "0 0 24 24",
|
|
134
134
|
fill: "currentColor",
|
|
@@ -142,8 +142,8 @@ function Fe(e, d) {
|
|
|
142
142
|
})
|
|
143
143
|
]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
return
|
|
145
|
+
function Oe(e, u) {
|
|
146
|
+
return d(), m("svg", {
|
|
147
147
|
xmlns: "http://www.w3.org/2000/svg",
|
|
148
148
|
viewBox: "0 0 24 24",
|
|
149
149
|
fill: "currentColor",
|
|
@@ -157,8 +157,8 @@ function Ne(e, d) {
|
|
|
157
157
|
})
|
|
158
158
|
]);
|
|
159
159
|
}
|
|
160
|
-
function he(e,
|
|
161
|
-
return
|
|
160
|
+
function he(e, u) {
|
|
161
|
+
return d(), m("svg", {
|
|
162
162
|
xmlns: "http://www.w3.org/2000/svg",
|
|
163
163
|
viewBox: "0 0 24 24",
|
|
164
164
|
fill: "currentColor",
|
|
@@ -172,18 +172,18 @@ function he(e, d) {
|
|
|
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,27 +198,27 @@ 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] = (
|
|
202
|
-
onKeydown:
|
|
201
|
+
onClick: f[0] || (f[0] = (x) => n("select")),
|
|
202
|
+
onKeydown: o
|
|
203
203
|
}, [
|
|
204
|
-
e.disabled ? (
|
|
204
|
+
e.disabled ? (d(), U(A(he), {
|
|
205
205
|
key: 0,
|
|
206
206
|
class: "size-5"
|
|
207
|
-
})) : (
|
|
207
|
+
})) : (d(), U(A(re), {
|
|
208
208
|
key: 1,
|
|
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
|
-
|
|
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
|
-
|
|
221
|
+
B(i.$slots, "default")
|
|
222
222
|
])
|
|
223
223
|
], 10, je)
|
|
224
224
|
]));
|
|
@@ -227,12 +227,12 @@ const Ee = ["id", "disabled", "aria-expanded", "aria-controls"], je = ["id", "ar
|
|
|
227
227
|
__name: "spinner",
|
|
228
228
|
props: { radius: { type: Number, default: 10 }, strokeWidth: { type: Number, default: 4 } },
|
|
229
229
|
setup(e) {
|
|
230
|
-
const
|
|
231
|
-
return (l, c) => (
|
|
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
|
+
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", {
|
|
@@ -255,40 +255,43 @@ const Ee = ["id", "disabled", "aria-expanded", "aria-controls"], je = ["id", "ar
|
|
|
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
|
-
const
|
|
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) || ((
|
|
263
|
+
const We = Object.prototype.toString, Ue = (e) => We.call(e) === "[object Object]", te = () => {
|
|
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
|
-
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}|SSS/g;
|
|
273
|
-
function Ge(e,
|
|
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, 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
|
+
var p;
|
|
285
|
+
return (p = L.split(" ")[1]) != null ? p : "";
|
|
286
|
+
}, b = {
|
|
284
287
|
Yo: () => ee(a),
|
|
285
288
|
YY: () => String(a).slice(-2),
|
|
286
289
|
YYYY: () => a,
|
|
287
290
|
M: () => l + 1,
|
|
288
291
|
Mo: () => ee(l + 1),
|
|
289
292
|
MM: () => `${l + 1}`.padStart(2, "0"),
|
|
290
|
-
MMM: () => e.toLocaleDateString(
|
|
291
|
-
MMMM: () => e.toLocaleDateString(
|
|
293
|
+
MMM: () => e.toLocaleDateString(O(t.locales), { month: "short" }),
|
|
294
|
+
MMMM: () => e.toLocaleDateString(O(t.locales), { month: "long" }),
|
|
292
295
|
D: () => String(c),
|
|
293
296
|
Do: () => ee(c),
|
|
294
297
|
DD: () => `${c}`.padStart(2, "0"),
|
|
@@ -298,31 +301,35 @@ function ge(e, d, t = {}) {
|
|
|
298
301
|
h: () => `${s % 12 || 12}`.padStart(1, "0"),
|
|
299
302
|
ho: () => ee(s % 12 || 12),
|
|
300
303
|
hh: () => `${s % 12 || 12}`.padStart(2, "0"),
|
|
301
|
-
m: () => String(
|
|
302
|
-
mo: () => ee(
|
|
303
|
-
mm: () => `${
|
|
304
|
+
m: () => String(o),
|
|
305
|
+
mo: () => ee(o),
|
|
306
|
+
mm: () => `${o}`.padStart(2, "0"),
|
|
304
307
|
s: () => String(r),
|
|
305
308
|
so: () => ee(r),
|
|
306
309
|
ss: () => `${r}`.padStart(2, "0"),
|
|
307
|
-
SSS: () => `${
|
|
310
|
+
SSS: () => `${i}`.padStart(3, "0"),
|
|
308
311
|
d: () => f,
|
|
309
|
-
dd: () => e.toLocaleDateString(
|
|
310
|
-
ddd: () => e.toLocaleDateString(
|
|
311
|
-
dddd: () => e.toLocaleDateString(
|
|
312
|
-
A: () =>
|
|
313
|
-
AA: () =>
|
|
314
|
-
a: () =>
|
|
315
|
-
aa: () =>
|
|
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" }))
|
|
316
323
|
};
|
|
317
|
-
return
|
|
318
|
-
var
|
|
319
|
-
return (
|
|
324
|
+
return u.replace(Xe, (L, p) => {
|
|
325
|
+
var k, D;
|
|
326
|
+
return (D = p ?? ((k = b[L]) == null ? void 0 : k.call(b))) != null ? D : L;
|
|
320
327
|
});
|
|
321
328
|
}
|
|
322
|
-
function Je(e,
|
|
329
|
+
function Je(e, u, t) {
|
|
323
330
|
return X(
|
|
324
331
|
e,
|
|
325
|
-
|
|
332
|
+
u,
|
|
326
333
|
{
|
|
327
334
|
...t,
|
|
328
335
|
immediate: !0
|
|
@@ -330,36 +337,36 @@ function Je(e, d, t) {
|
|
|
330
337
|
);
|
|
331
338
|
}
|
|
332
339
|
const $e = ke ? window : void 0;
|
|
333
|
-
function
|
|
334
|
-
var
|
|
335
|
-
const t =
|
|
336
|
-
return (
|
|
340
|
+
function oe(e) {
|
|
341
|
+
var u;
|
|
342
|
+
const t = O(e);
|
|
343
|
+
return (u = t == null ? void 0 : t.$el) != null ? u : t;
|
|
337
344
|
}
|
|
338
|
-
function
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
const s = ce(
|
|
343
|
-
return s.every((
|
|
345
|
+
function ne(...e) {
|
|
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;
|
|
344
351
|
}), l = Je(
|
|
345
352
|
() => {
|
|
346
|
-
var s,
|
|
353
|
+
var s, o;
|
|
347
354
|
return [
|
|
348
|
-
(
|
|
349
|
-
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])),
|
|
350
357
|
ce(A(a.value ? e[2] : e[1])),
|
|
351
358
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
352
|
-
|
|
359
|
+
O(a.value ? e[3] : e[2])
|
|
353
360
|
];
|
|
354
361
|
},
|
|
355
|
-
([s,
|
|
356
|
-
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))
|
|
357
364
|
return;
|
|
358
|
-
const f = Ue(
|
|
359
|
-
|
|
365
|
+
const f = Ue(i) ? { ...i } : i;
|
|
366
|
+
u.push(
|
|
360
367
|
...s.flatMap(
|
|
361
|
-
(
|
|
362
|
-
(
|
|
368
|
+
(x) => o.flatMap(
|
|
369
|
+
(y) => r.map((b) => n(x, y, b, f))
|
|
363
370
|
)
|
|
364
371
|
)
|
|
365
372
|
);
|
|
@@ -368,65 +375,73 @@ function se(...e) {
|
|
|
368
375
|
), c = () => {
|
|
369
376
|
l(), t();
|
|
370
377
|
};
|
|
371
|
-
return
|
|
378
|
+
return Ze(t), c;
|
|
372
379
|
}
|
|
373
380
|
let be = !1;
|
|
374
|
-
function pe(e,
|
|
375
|
-
const { window:
|
|
376
|
-
if (!
|
|
377
|
-
return
|
|
378
|
-
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
|
+
return s ? { stop: te, cancel: te, trigger: te } : te;
|
|
385
|
+
if (qe && !be) {
|
|
379
386
|
be = !0;
|
|
380
|
-
const
|
|
381
|
-
Array.from(
|
|
387
|
+
const p = { passive: !0 };
|
|
388
|
+
Array.from(n.document.body.children).forEach((k) => ne(k, "click", te, p)), ne(n.document.documentElement, "click", te, p);
|
|
382
389
|
}
|
|
383
|
-
let
|
|
384
|
-
const
|
|
385
|
-
if (typeof
|
|
386
|
-
return Array.from(
|
|
390
|
+
let o = !0;
|
|
391
|
+
const r = (p) => O(a).some((k) => {
|
|
392
|
+
if (typeof k == "string")
|
|
393
|
+
return Array.from(n.document.querySelectorAll(k)).some((D) => D === p.target || p.composedPath().includes(D));
|
|
387
394
|
{
|
|
388
|
-
const
|
|
389
|
-
return
|
|
395
|
+
const D = oe(k);
|
|
396
|
+
return D && (p.target === D || p.composedPath().includes(D));
|
|
390
397
|
}
|
|
391
398
|
});
|
|
392
|
-
function
|
|
393
|
-
const
|
|
394
|
-
return
|
|
399
|
+
function i(p) {
|
|
400
|
+
const k = O(p);
|
|
401
|
+
return k && k.$.subTree.shapeFlag === 16;
|
|
395
402
|
}
|
|
396
|
-
function
|
|
397
|
-
const
|
|
398
|
-
return
|
|
403
|
+
function f(p, k) {
|
|
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));
|
|
399
406
|
}
|
|
400
|
-
const
|
|
401
|
-
const
|
|
402
|
-
if (
|
|
403
|
-
if (
|
|
404
|
-
|
|
407
|
+
const x = (p) => {
|
|
408
|
+
const k = oe(e);
|
|
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;
|
|
405
412
|
return;
|
|
406
413
|
}
|
|
407
|
-
|
|
414
|
+
u(p);
|
|
408
415
|
}
|
|
409
416
|
};
|
|
410
|
-
let
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}, 0),
|
|
417
|
+
let y = !1;
|
|
418
|
+
const b = [
|
|
419
|
+
ne(n, "click", (p) => {
|
|
420
|
+
y || (y = !0, setTimeout(() => {
|
|
421
|
+
y = !1;
|
|
422
|
+
}, 0), x(p));
|
|
416
423
|
}, { passive: !0, capture: l }),
|
|
417
|
-
|
|
418
|
-
const
|
|
419
|
-
|
|
424
|
+
ne(n, "pointerdown", (p) => {
|
|
425
|
+
const k = oe(e);
|
|
426
|
+
o = !r(p) && !!(k && !p.composedPath().includes(k));
|
|
420
427
|
}, { passive: !0 }),
|
|
421
|
-
c &&
|
|
428
|
+
c && ne(n, "blur", (p) => {
|
|
422
429
|
setTimeout(() => {
|
|
423
|
-
var
|
|
424
|
-
const
|
|
425
|
-
((
|
|
430
|
+
var k;
|
|
431
|
+
const D = oe(e);
|
|
432
|
+
((k = n.document.activeElement) == null ? void 0 : k.tagName) === "IFRAME" && !(D != null && D.contains(n.document.activeElement)) && u(p);
|
|
426
433
|
}, 0);
|
|
427
434
|
}, { passive: !0 })
|
|
428
|
-
].filter(Boolean);
|
|
429
|
-
return
|
|
435
|
+
].filter(Boolean), L = () => b.forEach((p) => p());
|
|
436
|
+
return s ? {
|
|
437
|
+
stop: L,
|
|
438
|
+
cancel: () => {
|
|
439
|
+
o = !1;
|
|
440
|
+
},
|
|
441
|
+
trigger: (p) => {
|
|
442
|
+
o = !0, x(p), o = !1;
|
|
443
|
+
}
|
|
444
|
+
} : L;
|
|
430
445
|
}
|
|
431
446
|
const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-0 items-center pr-3 text-vxvue-700" }, tt = ["data-result-index"], kl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
432
447
|
__name: "autocomplete",
|
|
@@ -439,18 +454,18 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
439
454
|
autoSelect: Boolean
|
|
440
455
|
},
|
|
441
456
|
emits: ["update:modelValue", "blur-sm", "submit"],
|
|
442
|
-
setup(e, { emit:
|
|
443
|
-
const t =
|
|
444
|
-
let
|
|
445
|
-
return (
|
|
446
|
-
})())((a.id || "autocomplete") + "-"), s = $([]),
|
|
447
|
-
() => s.value.map((
|
|
448
|
-
id: (a.id || "autocomplete") + "-item-" +
|
|
449
|
-
class: [
|
|
457
|
+
setup(e, { emit: u }) {
|
|
458
|
+
const t = u, n = e, a = K(), c = (/* @__PURE__ */ (() => {
|
|
459
|
+
let V = 0;
|
|
460
|
+
return (T) => (T || "") + ++V;
|
|
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
|
+
() => s.value.map((V, T) => ({
|
|
463
|
+
id: (a.id || "autocomplete") + "-item-" + T,
|
|
464
|
+
class: [n.resultItemClass, { "bg-vxvue-700 text-white": o.value === T }],
|
|
450
465
|
role: "option",
|
|
451
|
-
...
|
|
466
|
+
...o.value === T ? { "aria-selected": "true" } : {}
|
|
452
467
|
}))
|
|
453
|
-
),
|
|
468
|
+
), D = z(() => ({
|
|
454
469
|
role: "combobox",
|
|
455
470
|
autocomplete: "off",
|
|
456
471
|
autocapitalize: "off",
|
|
@@ -459,103 +474,103 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
459
474
|
"aria-autocomplete": "list",
|
|
460
475
|
"aria-haspopup": "listbox",
|
|
461
476
|
"aria-owns": c,
|
|
462
|
-
"aria-expanded":
|
|
463
|
-
"aria-activedescendant":
|
|
477
|
+
"aria-expanded": i.value ? "true" : "false",
|
|
478
|
+
"aria-activedescendant": o.value > -1 ? k.value[o.value].id : "",
|
|
464
479
|
...a
|
|
465
|
-
})), Z =
|
|
480
|
+
})), Z = z(() => ({
|
|
466
481
|
id: c,
|
|
467
|
-
class: ["absolute min-w-full transform z-10",
|
|
482
|
+
class: ["absolute min-w-full transform z-10", n.resultListClass, x.value],
|
|
468
483
|
role: "listbox"
|
|
469
|
-
})),
|
|
470
|
-
|
|
471
|
-
}, S = (
|
|
472
|
-
const
|
|
473
|
-
if (
|
|
484
|
+
})), H = () => {
|
|
485
|
+
o.value = -1, s.value = [], i.value = !1, y.value = !0;
|
|
486
|
+
}, S = (V) => {
|
|
487
|
+
const T = n.search(V);
|
|
488
|
+
if (T instanceof Promise) {
|
|
474
489
|
const G = ++r.value;
|
|
475
|
-
f.value = !0,
|
|
476
|
-
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());
|
|
477
492
|
});
|
|
478
493
|
} else
|
|
479
|
-
s.value =
|
|
480
|
-
},
|
|
481
|
-
const
|
|
482
|
-
return
|
|
483
|
-
},
|
|
484
|
-
t("update:modelValue",
|
|
485
|
-
}, h = (
|
|
486
|
-
|
|
487
|
-
},
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
},
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
},
|
|
497
|
-
const
|
|
498
|
-
|
|
494
|
+
s.value = T, s.value.length === 0 ? H() : (o.value = n.autoSelect ? 0 : -1, i.value = !0);
|
|
495
|
+
}, M = () => {
|
|
496
|
+
const V = s.value[o.value];
|
|
497
|
+
return V && t("update:modelValue", n.getResultValue(V)), H(), V;
|
|
498
|
+
}, F = (V) => {
|
|
499
|
+
t("update:modelValue", V), S(V);
|
|
500
|
+
}, h = (V) => S(V.target.value), g = () => {
|
|
501
|
+
H(), t("blur-sm");
|
|
502
|
+
}, w = () => {
|
|
503
|
+
const V = s.value.length;
|
|
504
|
+
o.value = ((o.value - 1) % V + V) % V;
|
|
505
|
+
}, E = (V) => {
|
|
506
|
+
i.value || h(V);
|
|
507
|
+
const T = s.value.length;
|
|
508
|
+
o.value = ((o.value + 1) % T + T) % T;
|
|
509
|
+
}, W = () => {
|
|
510
|
+
H(), t("update:modelValue", "");
|
|
511
|
+
}, ae = () => t("submit", M()), Q = (V) => {
|
|
512
|
+
const T = V.target.closest("[data-result-index]");
|
|
513
|
+
T && (o.value = parseInt(T.dataset.resultIndex, 10), t("submit", M()));
|
|
499
514
|
};
|
|
500
|
-
return pe(
|
|
501
|
-
if (
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const G =
|
|
515
|
+
return pe(p, H), De(() => {
|
|
516
|
+
if (b.value) {
|
|
517
|
+
const V = L.value.getBoundingClientRect(), T = b.value.getBoundingClientRect();
|
|
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="' + o.value + '"]');
|
|
505
520
|
if (G) {
|
|
506
|
-
let
|
|
507
|
-
|
|
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);
|
|
508
523
|
}
|
|
509
524
|
}
|
|
510
|
-
}), (
|
|
525
|
+
}), (V, T) => (d(), m("div", {
|
|
511
526
|
ref_key: "container",
|
|
512
|
-
ref:
|
|
513
|
-
class: C(["inline-block relative",
|
|
527
|
+
ref: p,
|
|
528
|
+
class: C(["inline-block relative", V.$attrs.class])
|
|
514
529
|
}, [
|
|
515
530
|
v("input", R({
|
|
516
531
|
ref_key: "input",
|
|
517
|
-
ref:
|
|
532
|
+
ref: L,
|
|
518
533
|
class: "block pr-10 w-full form-input focus:border-vxvue",
|
|
519
534
|
value: e.modelValue
|
|
520
|
-
},
|
|
521
|
-
onInput:
|
|
535
|
+
}, D.value, {
|
|
536
|
+
onInput: T[0] || (T[0] = (G) => F(G.target.value)),
|
|
522
537
|
onKeydown: [
|
|
523
|
-
ae
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
538
|
+
se(ae, ["enter"]),
|
|
539
|
+
se(W, ["esc"]),
|
|
540
|
+
se(M, ["tab"]),
|
|
541
|
+
se(j(w, ["prevent"]), ["up"]),
|
|
542
|
+
se(j(E, ["prevent"]), ["down"])
|
|
528
543
|
],
|
|
529
544
|
onFocus: h,
|
|
530
|
-
onBlur:
|
|
545
|
+
onBlur: g
|
|
531
546
|
}), null, 16, Qe),
|
|
532
547
|
v("span", et, [
|
|
533
|
-
f.value ? (
|
|
548
|
+
f.value ? (d(), U(we, {
|
|
534
549
|
key: 0,
|
|
535
550
|
class: "size-5"
|
|
536
|
-
})) :
|
|
551
|
+
})) : N("", !0)
|
|
537
552
|
]),
|
|
538
|
-
s.value.length ? (
|
|
553
|
+
s.value.length ? (d(), m("div", R({
|
|
539
554
|
key: 0,
|
|
540
555
|
ref_key: "resultList",
|
|
541
|
-
ref:
|
|
556
|
+
ref: b
|
|
542
557
|
}, Z.value, {
|
|
543
558
|
onClick: Q,
|
|
544
|
-
onMousedown:
|
|
559
|
+
onMousedown: T[1] || (T[1] = j(() => {
|
|
545
560
|
}, ["prevent"]))
|
|
546
561
|
}), [
|
|
547
|
-
(
|
|
548
|
-
|
|
562
|
+
(d(!0), m(I, null, Y(s.value, (G, q) => (d(), m("div", { "data-result-index": q }, [
|
|
563
|
+
B(V.$slots, "result", {
|
|
549
564
|
result: G,
|
|
550
|
-
props:
|
|
565
|
+
props: k.value[q]
|
|
551
566
|
}, () => [
|
|
552
|
-
(
|
|
553
|
-
key:
|
|
567
|
+
(d(), m("div", R({
|
|
568
|
+
key: k.value[q].id,
|
|
554
569
|
ref_for: !0
|
|
555
|
-
},
|
|
570
|
+
}, k.value[q]), P(e.getResultValue(G)), 17))
|
|
556
571
|
])
|
|
557
572
|
], 8, tt))), 256))
|
|
558
|
-
], 16)) :
|
|
573
|
+
], 16)) : N("", !0)
|
|
559
574
|
], 2));
|
|
560
575
|
}
|
|
561
576
|
}), lt = {
|
|
@@ -571,7 +586,7 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
571
586
|
buttons: {
|
|
572
587
|
type: [Object, Array],
|
|
573
588
|
default: () => ({ label: "Ok" }),
|
|
574
|
-
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
|
|
575
590
|
},
|
|
576
591
|
headerClass: {
|
|
577
592
|
type: String,
|
|
@@ -582,42 +597,42 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
582
597
|
default: "button"
|
|
583
598
|
}
|
|
584
599
|
},
|
|
585
|
-
setup(e, { expose:
|
|
586
|
-
const t = e,
|
|
600
|
+
setup(e, { expose: u }) {
|
|
601
|
+
const t = e, n = $(""), a = $(""), l = $(!1);
|
|
587
602
|
let c = null, s = null;
|
|
588
|
-
const
|
|
589
|
-
l.value = !1,
|
|
603
|
+
const o = z(() => Array.isArray(t.buttons) ? t.buttons : [t.buttons]), r = $(null), i = (x, y) => {
|
|
604
|
+
l.value = !1, x.value !== void 0 ? x.value ? c() : s() : y ? s() : c();
|
|
590
605
|
};
|
|
591
|
-
return
|
|
592
|
-
c =
|
|
593
|
-
})) }), (
|
|
594
|
-
l.value ? (
|
|
595
|
-
|
|
596
|
-
default:
|
|
597
|
-
l.value ? (
|
|
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
|
+
c = b, s = L;
|
|
608
|
+
})) }), (x, y) => (d(), m(I, null, [
|
|
609
|
+
l.value ? (d(), m("div", lt)) : N("", !0),
|
|
610
|
+
_(ve, { name: "appear" }, {
|
|
611
|
+
default: le(() => [
|
|
612
|
+
l.value ? (d(), m("div", at, [
|
|
598
613
|
v("div", st, [
|
|
599
|
-
l.value ? (
|
|
600
|
-
|
|
614
|
+
l.value ? (d(), m("div", nt, [
|
|
615
|
+
y[0] || (y[0] = v("span", {
|
|
601
616
|
class: "hidden sm:inline-block sm:h-screen sm:align-middle",
|
|
602
617
|
"aria-hidden": "true"
|
|
603
618
|
}, "", -1)),
|
|
604
619
|
v("div", ot, [
|
|
605
|
-
|
|
620
|
+
n.value || x.$slots.title ? (d(), m("h3", {
|
|
606
621
|
key: 0,
|
|
607
622
|
class: C(["py-4 pt-4 text-lg font-medium text-center sm:py-6", e.headerClass])
|
|
608
623
|
}, [
|
|
609
|
-
|
|
610
|
-
J(
|
|
624
|
+
B(x.$slots, "title", {}, () => [
|
|
625
|
+
J(P(n.value), 1)
|
|
611
626
|
])
|
|
612
|
-
], 2)) :
|
|
627
|
+
], 2)) : N("", !0),
|
|
613
628
|
v("div", rt, [
|
|
614
629
|
v("div", ut, [
|
|
615
630
|
v("div", it, [
|
|
616
|
-
|
|
631
|
+
B(x.$slots, "icon")
|
|
617
632
|
]),
|
|
618
633
|
v("p", dt, [
|
|
619
|
-
|
|
620
|
-
J(
|
|
634
|
+
B(x.$slots, "default", {}, () => [
|
|
635
|
+
J(P(a.value), 1)
|
|
621
636
|
])
|
|
622
637
|
])
|
|
623
638
|
]),
|
|
@@ -626,48 +641,48 @@ const Qe = ["value", "onKeydown"], et = { class: "flex absolute inset-y-0 right-
|
|
|
626
641
|
ref: r,
|
|
627
642
|
class: "flex justify-center mt-5 space-x-2 sm:mt-6"
|
|
628
643
|
}, [
|
|
629
|
-
(
|
|
630
|
-
key:
|
|
631
|
-
class: C([e.buttonClass,
|
|
632
|
-
onClick:
|
|
633
|
-
},
|
|
644
|
+
(d(!0), m(I, null, Y(o.value, (b, L) => (d(), m("button", {
|
|
645
|
+
key: b.label,
|
|
646
|
+
class: C([e.buttonClass, b.class]),
|
|
647
|
+
onClick: j((p) => i(b, L), ["prevent"])
|
|
648
|
+
}, P(b.label), 11, ct))), 128))
|
|
634
649
|
], 512)
|
|
635
650
|
])
|
|
636
651
|
])
|
|
637
|
-
])) :
|
|
652
|
+
])) : N("", !0)
|
|
638
653
|
])
|
|
639
|
-
])) :
|
|
654
|
+
])) : N("", !0)
|
|
640
655
|
]),
|
|
641
656
|
_: 3
|
|
642
657
|
})
|
|
643
658
|
], 64));
|
|
644
659
|
}
|
|
645
660
|
};
|
|
646
|
-
function vt(e,
|
|
647
|
-
const t = $(!1),
|
|
648
|
-
let a, l =
|
|
649
|
-
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)
|
|
650
665
|
l = l.replace("d", "(\\d{1,2})");
|
|
651
|
-
else if ((a =
|
|
666
|
+
else if ((a = n.match(/\bdd\b/gi)) && a.length === 1)
|
|
652
667
|
l = l.replace("dd", "(\\d{2})");
|
|
653
668
|
else
|
|
654
669
|
return { date: t };
|
|
655
|
-
if (c.push({ srcPos:
|
|
670
|
+
if (c.push({ srcPos: n.toLowerCase().indexOf("d"), destPos: 2 }), (a = n.match(/\bm\b/gi)) && a.length === 1)
|
|
656
671
|
l = l.replace("m", "(\\d{1,2})");
|
|
657
|
-
else if ((a =
|
|
672
|
+
else if ((a = n.match(/\bmm\b/gi)) && a.length === 1)
|
|
658
673
|
l = l.replace("mm", "(\\d{2})");
|
|
659
674
|
else
|
|
660
675
|
return { date: t };
|
|
661
|
-
if (c.push({ srcPos:
|
|
676
|
+
if (c.push({ srcPos: n.toLowerCase().indexOf("m"), destPos: 1 }), (a = n.match(/\byyyy\b/gi)) && a.length === 1)
|
|
662
677
|
l = l.replace("yyyy", "(\\d{4})");
|
|
663
678
|
else
|
|
664
679
|
return { date: t };
|
|
665
|
-
if (c.push({ srcPos:
|
|
680
|
+
if (c.push({ srcPos: n.toLowerCase().indexOf("y"), destPos: 0 }), !(a = O(e).match(l)))
|
|
666
681
|
return { date: t };
|
|
667
|
-
a.shift(), c.sort((
|
|
668
|
-
let s = [],
|
|
669
|
-
for (;
|
|
670
|
-
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;
|
|
671
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 };
|
|
672
687
|
}
|
|
673
688
|
const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
@@ -679,59 +694,59 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
679
694
|
modelValue: Date
|
|
680
695
|
},
|
|
681
696
|
emits: ["update:modelValue", "toggle-datepicker"],
|
|
682
|
-
setup(e, { emit:
|
|
683
|
-
const t =
|
|
684
|
-
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());
|
|
685
700
|
return delete s.class, s;
|
|
686
701
|
});
|
|
687
|
-
return X(() =>
|
|
702
|
+
return X(() => n.modelValue, (s) => a.value = s ? ge(s, n.outputFormat) : ""), (s, o) => (d(), m("div", {
|
|
688
703
|
class: C(["inline-block relative", s.$attrs.class])
|
|
689
704
|
}, [
|
|
690
|
-
l.value ? (
|
|
705
|
+
l.value ? (d(), m("div", mt, [
|
|
691
706
|
v("div", {
|
|
692
707
|
class: C(["block flex items-center w-full form-input bg-vxvue-50", { "pr-10": e.showToggle }])
|
|
693
708
|
}, [
|
|
694
|
-
v("span", ft,
|
|
695
|
-
c.value.disabled ?
|
|
709
|
+
v("span", ft, P(l.value), 1),
|
|
710
|
+
c.value.disabled ? N("", !0) : (d(), m("button", {
|
|
696
711
|
key: 0,
|
|
697
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",
|
|
698
|
-
onClick:
|
|
713
|
+
onClick: o[0] || (o[0] = (r) => t("update:modelValue", null))
|
|
699
714
|
}, [
|
|
700
|
-
|
|
715
|
+
_(A(he), { class: "size-4" })
|
|
701
716
|
]))
|
|
702
717
|
], 2)
|
|
703
|
-
])) : xe((
|
|
718
|
+
])) : xe((d(), m("input", R({
|
|
704
719
|
key: 1,
|
|
705
|
-
"onUpdate:modelValue":
|
|
720
|
+
"onUpdate:modelValue": o[1] || (o[1] = (r) => a.value = r),
|
|
706
721
|
type: "text",
|
|
707
722
|
class: ["block w-full form-input peer focus:border-vxvue", { "pr-10": e.showToggle }]
|
|
708
723
|
}, c.value, {
|
|
709
|
-
onBlur:
|
|
710
|
-
var
|
|
711
|
-
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);
|
|
712
727
|
}),
|
|
713
|
-
onInput:
|
|
728
|
+
onInput: o[3] || (o[3] = j(() => {
|
|
714
729
|
}, ["prevent"]))
|
|
715
730
|
}), null, 16)), [
|
|
716
731
|
[Ae, a.value]
|
|
717
732
|
]),
|
|
718
|
-
e.showToggle ? (
|
|
733
|
+
e.showToggle ? (d(), m("button", {
|
|
719
734
|
key: 2,
|
|
720
735
|
ref: "toggleButton",
|
|
721
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"]),
|
|
722
737
|
disabled: c.value.disabled,
|
|
723
738
|
"aria-label": "datepicker-toggle",
|
|
724
|
-
onClick:
|
|
739
|
+
onClick: o[4] || (o[4] = j((r) => t("toggle-datepicker"), ["stop"]))
|
|
725
740
|
}, [
|
|
726
|
-
|
|
727
|
-
], 10, ht)) :
|
|
728
|
-
|
|
741
|
+
_(A(Pe), { class: "size-6" })
|
|
742
|
+
], 10, ht)) : N("", !0),
|
|
743
|
+
B(s.$slots, "default")
|
|
729
744
|
], 2));
|
|
730
745
|
}
|
|
731
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 }, {
|
|
732
747
|
__name: "datepicker",
|
|
733
748
|
props: {
|
|
734
|
-
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 },
|
|
735
750
|
shownMonth: Date,
|
|
736
751
|
maxNumberOfValues: { type: Number, default: 1 },
|
|
737
752
|
validFrom: Date,
|
|
@@ -743,23 +758,23 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
743
758
|
hasInput: { type: Boolean, default: !0 }
|
|
744
759
|
},
|
|
745
760
|
emits: ["update:modelValue", "month-change", "year-change"],
|
|
746
|
-
setup(e, { emit:
|
|
747
|
-
const t = e,
|
|
761
|
+
setup(e, { emit: u }) {
|
|
762
|
+
const t = e, n = u, a = (() => {
|
|
748
763
|
const h = /* @__PURE__ */ new Date();
|
|
749
764
|
return new Date(h.getFullYear(), h.getMonth(), h.getDate());
|
|
750
|
-
})(), l = $(null), c = $([]), s = $(!1),
|
|
751
|
-
const h = [],
|
|
752
|
-
for (let Q = -
|
|
753
|
-
h.push(new Date(
|
|
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
|
+
h.push(new Date(g, w, Q + 1));
|
|
754
769
|
return h;
|
|
755
|
-
}),
|
|
770
|
+
}), k = z(() => t.startOfWeekIndex ? t.dayNames.slice(1).concat(t.dayNames[0]) : t.dayNames);
|
|
756
771
|
X(() => t.modelValue, (h) => {
|
|
757
772
|
if (h)
|
|
758
773
|
if (Array.isArray(h)) {
|
|
759
|
-
const
|
|
760
|
-
h.forEach((
|
|
761
|
-
|
|
762
|
-
}), (
|
|
774
|
+
const g = [], w = c.value;
|
|
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));
|
|
763
778
|
} else
|
|
764
779
|
c.value = [new Date(h.getFullYear(), h.getMonth(), h.getDate())], l.value = new Date(h.getFullYear(), h.getMonth(), 1);
|
|
765
780
|
else
|
|
@@ -767,147 +782,147 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
767
782
|
}, { immediate: !0 }), X(() => t.shownMonth, (h) => {
|
|
768
783
|
l.value = new Date((h || a).getTime()), l.value.setDate(1);
|
|
769
784
|
}, { immediate: !0 }), X(s, (h) => {
|
|
770
|
-
h &&
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
horiz:
|
|
774
|
-
vert:
|
|
785
|
+
h && b.value && me(() => {
|
|
786
|
+
const g = f.value.$el.getBoundingClientRect(), w = x.value.getBoundingClientRect();
|
|
787
|
+
i.value = {
|
|
788
|
+
horiz: g.right - w.width < 0 ? "left-0" : "right-0",
|
|
789
|
+
vert: g.bottom + w.height > window.innerHeight ? "bottom-0 -translate-y-12" : "top-0 translate-y-12"
|
|
775
790
|
};
|
|
776
791
|
});
|
|
777
|
-
}), pe(
|
|
778
|
-
s.value = !1,
|
|
779
|
-
}, { ignore: [
|
|
780
|
-
const
|
|
781
|
-
l.value = new Date(l.value.getFullYear(), h, 1),
|
|
792
|
+
}), pe(x, () => {
|
|
793
|
+
s.value = !1, o.value = "days";
|
|
794
|
+
}, { ignore: [y] });
|
|
795
|
+
const D = (h) => {
|
|
796
|
+
l.value = new Date(l.value.getFullYear(), h, 1), n("month-change", l.value);
|
|
782
797
|
}, Z = (h) => {
|
|
783
|
-
l.value = new Date(h, l.value.getMonth(), 1),
|
|
784
|
-
},
|
|
798
|
+
l.value = new Date(h, l.value.getMonth(), 1), n("year-change", l.value);
|
|
799
|
+
}, H = (h) => n("update:modelValue", h), S = (h) => {
|
|
785
800
|
if (s.value = !1, t.maxNumberOfValues === 1)
|
|
786
|
-
|
|
801
|
+
n("update:modelValue", h);
|
|
787
802
|
else {
|
|
788
|
-
const
|
|
789
|
-
let
|
|
790
|
-
|
|
803
|
+
const g = c.value;
|
|
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);
|
|
791
806
|
}
|
|
792
|
-
},
|
|
793
|
-
const
|
|
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);
|
|
794
809
|
return {
|
|
795
|
-
"cursor-not-allowed":
|
|
796
|
-
"text-vxvue-700": !
|
|
797
|
-
"text-error":
|
|
798
|
-
"text-gray-400":
|
|
799
|
-
"bg-vxvue-alt-300 font-bold":
|
|
800
|
-
"bg-vxvue-700 text-white":
|
|
801
|
-
"hover:ring-2 hover:ring-vxvue": !
|
|
802
|
-
"bg-vxvue-100/50": Q && !
|
|
810
|
+
"cursor-not-allowed": W || ae,
|
|
811
|
+
"text-vxvue-700": !W && !g && !E && !w,
|
|
812
|
+
"text-error": W && !g,
|
|
813
|
+
"text-gray-400": g && !E && !w,
|
|
814
|
+
"bg-vxvue-alt-300 font-bold": E && !w,
|
|
815
|
+
"bg-vxvue-700 text-white": w,
|
|
816
|
+
"hover:ring-2 hover:ring-vxvue": !W,
|
|
817
|
+
"bg-vxvue-100/50": Q && !E && !w
|
|
803
818
|
};
|
|
804
819
|
};
|
|
805
820
|
return fe(() => {
|
|
806
821
|
var h;
|
|
807
|
-
return
|
|
808
|
-
}), (h,
|
|
822
|
+
return y.value = (h = f.value) == null ? void 0 : h.$refs.toggleButton;
|
|
823
|
+
}), (h, g) => (d(), m("div", {
|
|
809
824
|
class: C(["relative", h.$attrs.class])
|
|
810
825
|
}, [
|
|
811
|
-
|
|
826
|
+
b.value ? (d(), U(pt, R({ key: 0 }, h.$attrs, {
|
|
812
827
|
ref_key: "input",
|
|
813
828
|
ref: f,
|
|
814
829
|
"model-value": c.value[0],
|
|
815
830
|
"show-toggle": !0,
|
|
816
831
|
class: "w-full",
|
|
817
|
-
onToggleDatepicker:
|
|
818
|
-
"onUpdate:modelValue":
|
|
832
|
+
onToggleDatepicker: g[0] || (g[0] = (w) => s.value = !s.value),
|
|
833
|
+
"onUpdate:modelValue": H
|
|
819
834
|
}), {
|
|
820
|
-
default:
|
|
821
|
-
|
|
835
|
+
default: le(() => [
|
|
836
|
+
B(h.$slots, "default")
|
|
822
837
|
]),
|
|
823
838
|
_: 3
|
|
824
|
-
}, 16, ["model-value"])) :
|
|
825
|
-
v("div", R(
|
|
839
|
+
}, 16, ["model-value"])) : N("", !0),
|
|
840
|
+
v("div", R(L.value, {
|
|
826
841
|
ref_key: "calendar",
|
|
827
|
-
ref:
|
|
828
|
-
class: ["overflow-hidden z-10 bg-white rounded-sm shadow-md min-w-72 sm:min-w-80", [
|
|
842
|
+
ref: x,
|
|
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]]
|
|
829
844
|
}), [
|
|
830
|
-
|
|
845
|
+
o.value === "days" ? (d(), m(I, { key: 0 }, [
|
|
831
846
|
v("div", gt, [
|
|
832
847
|
v("div", bt, [
|
|
833
848
|
v("button", {
|
|
834
849
|
class: "shrink-0 text-vxvue-100 hover:text-vxvue-50",
|
|
835
|
-
onClick:
|
|
850
|
+
onClick: g[1] || (g[1] = j((w) => D(l.value.getMonth() - 1), ["stop"]))
|
|
836
851
|
}, [
|
|
837
|
-
|
|
852
|
+
_(A(ie), { class: "size-6" })
|
|
838
853
|
]),
|
|
839
|
-
v("span", null,
|
|
854
|
+
v("span", null, P(l.value.toLocaleString(e.locale, { month: "long" })), 1),
|
|
840
855
|
v("button", {
|
|
841
856
|
class: "shrink-0 text-vxvue-100 hover:text-vxvue-50",
|
|
842
|
-
onClick:
|
|
857
|
+
onClick: g[2] || (g[2] = j((w) => D(l.value.getMonth() + 1), ["stop"]))
|
|
843
858
|
}, [
|
|
844
|
-
|
|
859
|
+
_(A(re), { class: "size-6" })
|
|
845
860
|
])
|
|
846
861
|
]),
|
|
847
862
|
v("div", xt, [
|
|
848
863
|
v("button", {
|
|
849
864
|
class: "shrink-0 text-vxvue-100 hover:text-vxvue-50",
|
|
850
|
-
onClick:
|
|
865
|
+
onClick: g[3] || (g[3] = j((w) => Z(l.value.getFullYear() - 1), ["stop"]))
|
|
851
866
|
}, [
|
|
852
|
-
|
|
867
|
+
_(A(ie), { class: "size-6" })
|
|
853
868
|
]),
|
|
854
869
|
v("button", {
|
|
855
870
|
class: "text-vxvue-100 hover:text-vxvue-50",
|
|
856
|
-
onClick:
|
|
857
|
-
|
|
871
|
+
onClick: g[4] || (g[4] = (w) => {
|
|
872
|
+
o.value = "years", r.value = l.value.getFullYear();
|
|
858
873
|
})
|
|
859
|
-
},
|
|
874
|
+
}, P(l.value.getFullYear()), 1),
|
|
860
875
|
v("button", {
|
|
861
876
|
class: "shrink-0 text-vxvue-100 hover:text-vxvue-50",
|
|
862
|
-
onClick:
|
|
877
|
+
onClick: g[5] || (g[5] = j((w) => Z(l.value.getFullYear() + 1), ["stop"]))
|
|
863
878
|
}, [
|
|
864
|
-
|
|
879
|
+
_(A(re), { class: "size-6" })
|
|
865
880
|
])
|
|
866
881
|
])
|
|
867
882
|
]),
|
|
868
883
|
v("div", yt, [
|
|
869
|
-
(
|
|
870
|
-
key:
|
|
884
|
+
(d(!0), m(I, null, Y(k.value, (w, E) => (d(), m("div", {
|
|
885
|
+
key: E,
|
|
871
886
|
class: "py-2 text-center bg-gray-200"
|
|
872
|
-
},
|
|
873
|
-
(
|
|
874
|
-
key:
|
|
875
|
-
class: C(["py-2 rounded-xs block text-center",
|
|
876
|
-
disabled: e.validFrom && e.validFrom >
|
|
877
|
-
onClick:
|
|
878
|
-
},
|
|
887
|
+
}, P(w), 1))), 128)),
|
|
888
|
+
(d(!0), m(I, null, Y(p.value, (w) => (d(), m("button", {
|
|
889
|
+
key: w,
|
|
890
|
+
class: C(["py-2 rounded-xs block text-center", F(w)]),
|
|
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((E) => S(w), ["stop"])
|
|
893
|
+
}, P(w.getDate()), 11, wt))), 128))
|
|
879
894
|
])
|
|
880
|
-
], 64)) :
|
|
881
|
-
|
|
895
|
+
], 64)) : N("", !0),
|
|
896
|
+
o.value === "years" ? (d(), m(I, { key: 1 }, [
|
|
882
897
|
v("div", kt, [
|
|
883
898
|
v("button", {
|
|
884
899
|
class: "shrink-0 text-vxvue-100 hover:text-vxvue-50",
|
|
885
|
-
onClick:
|
|
900
|
+
onClick: g[6] || (g[6] = j((w) => r.value -= 10, ["stop"]))
|
|
886
901
|
}, [
|
|
887
|
-
|
|
902
|
+
_(A(ie), { class: "size-6" })
|
|
888
903
|
]),
|
|
889
|
-
v("span", null,
|
|
904
|
+
v("span", null, P(r.value) + " - " + P(r.value + 9), 1),
|
|
890
905
|
v("button", {
|
|
891
906
|
class: "shrink-0 text-vxvue-100 hover:text-vxvue-50",
|
|
892
|
-
onClick:
|
|
907
|
+
onClick: g[7] || (g[7] = j((w) => r.value += 10, ["stop"]))
|
|
893
908
|
}, [
|
|
894
|
-
|
|
909
|
+
_(A(re), { class: "size-6" })
|
|
895
910
|
])
|
|
896
911
|
]),
|
|
897
912
|
v("div", $t, [
|
|
898
|
-
(
|
|
899
|
-
key:
|
|
913
|
+
(d(), m(I, null, Y(10, (w) => v("div", {
|
|
914
|
+
key: w,
|
|
900
915
|
class: "text-center hover:ring-2 text-vxvue-700 hover:ring-vxvue"
|
|
901
916
|
}, [
|
|
902
917
|
v("button", {
|
|
903
918
|
class: "py-2 px-3",
|
|
904
|
-
onClick:
|
|
905
|
-
Z(r.value +
|
|
919
|
+
onClick: j((E) => {
|
|
920
|
+
Z(r.value + w - 1), o.value = "days";
|
|
906
921
|
}, ["stop"])
|
|
907
|
-
},
|
|
922
|
+
}, P(r.value + w - 1), 9, St)
|
|
908
923
|
])), 64))
|
|
909
924
|
])
|
|
910
|
-
], 64)) :
|
|
925
|
+
], 64)) : N("", !0)
|
|
911
926
|
], 16)
|
|
912
927
|
], 2));
|
|
913
928
|
}
|
|
@@ -921,21 +936,21 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
921
936
|
id: { type: String, default: "form-file-button-" + Math.ceil(Math.random() * 1e3) }
|
|
922
937
|
},
|
|
923
938
|
emits: ["update:modelValue", "form-data"],
|
|
924
|
-
setup(e, { emit:
|
|
925
|
-
const t =
|
|
939
|
+
setup(e, { emit: u }) {
|
|
940
|
+
const t = u, n = e, a = (c) => {
|
|
926
941
|
const s = new FormData();
|
|
927
|
-
for (let
|
|
928
|
-
s.append(
|
|
942
|
+
for (let o of c)
|
|
943
|
+
s.append(n.name, o, o.name);
|
|
929
944
|
return s;
|
|
930
945
|
}, l = (c) => {
|
|
931
946
|
const s = c.target.files || c.dataTransfer.files;
|
|
932
947
|
if (s) {
|
|
933
|
-
const
|
|
934
|
-
t("update:modelValue",
|
|
948
|
+
const o = [...s];
|
|
949
|
+
t("update:modelValue", o), t("form-data", a(o));
|
|
935
950
|
}
|
|
936
951
|
};
|
|
937
|
-
return (c, s) => (
|
|
938
|
-
|
|
952
|
+
return (c, s) => (d(), m("label", { for: e.id }, [
|
|
953
|
+
B(c.$slots, "default", {}, () => [
|
|
939
954
|
s[0] || (s[0] = J("Upload"))
|
|
940
955
|
]),
|
|
941
956
|
v("input", {
|
|
@@ -952,7 +967,7 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
952
967
|
key: 0,
|
|
953
968
|
disabled: "",
|
|
954
969
|
value: ""
|
|
955
|
-
}, At = ["selected", "value"],
|
|
970
|
+
}, At = ["selected", "value"], Lt = {
|
|
956
971
|
__name: "form-select",
|
|
957
972
|
props: {
|
|
958
973
|
options: { type: Array, default: () => [] },
|
|
@@ -960,31 +975,31 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
960
975
|
disabledLabel: { type: String, default: "" }
|
|
961
976
|
},
|
|
962
977
|
emits: ["update:modelValue"],
|
|
963
|
-
setup(e, { emit:
|
|
964
|
-
const t =
|
|
965
|
-
return (
|
|
978
|
+
setup(e, { emit: u }) {
|
|
979
|
+
const t = u;
|
|
980
|
+
return (n, a) => (d(), m("select", R(n.$attrs, {
|
|
966
981
|
value: e.modelValue,
|
|
967
982
|
class: "form-select",
|
|
968
983
|
onChange: a[0] || (a[0] = (l) => t("update:modelValue", l.target.value))
|
|
969
984
|
}), [
|
|
970
|
-
e.disabledLabel ? (
|
|
971
|
-
(
|
|
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", {
|
|
972
987
|
key: l.key !== void 0 ? l.key : l.label || l,
|
|
973
988
|
selected: (l.key !== void 0 ? l.key : l.label || l) === e.modelValue,
|
|
974
989
|
value: l.key !== void 0 ? l.key : l.label || l
|
|
975
|
-
},
|
|
990
|
+
}, P(l.label || l), 9, At))), 128))
|
|
976
991
|
], 16, Vt));
|
|
977
992
|
}
|
|
978
|
-
},
|
|
993
|
+
}, Tt = ["aria-checked", "aria-label"], Bt = ["d"], Pt = ["checked"], Ml = {
|
|
979
994
|
__name: "form-switch",
|
|
980
995
|
props: { modelValue: Boolean },
|
|
981
996
|
emits: ["update:modelValue"],
|
|
982
|
-
setup(e, { emit:
|
|
983
|
-
const t =
|
|
984
|
-
let l = Object.assign({},
|
|
997
|
+
setup(e, { emit: u }) {
|
|
998
|
+
const t = u, n = z(() => {
|
|
999
|
+
let l = Object.assign({}, K());
|
|
985
1000
|
return delete l.class, l;
|
|
986
|
-
}), a =
|
|
987
|
-
return (l, c) => (
|
|
1001
|
+
}), a = z(() => K().disabled || K().disabled === "");
|
|
1002
|
+
return (l, c) => (d(), m("label", {
|
|
988
1003
|
class: C(l.$attrs.class),
|
|
989
1004
|
tabindex: "0"
|
|
990
1005
|
}, [
|
|
@@ -1005,8 +1020,8 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1005
1020
|
a.value ? "bg-slate-100" : "bg-white"
|
|
1006
1021
|
])
|
|
1007
1022
|
}, [
|
|
1008
|
-
|
|
1009
|
-
(
|
|
1023
|
+
B(l.$slots, "handle", {}, () => [
|
|
1024
|
+
(d(), m("svg", {
|
|
1010
1025
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1011
1026
|
fill: "none",
|
|
1012
1027
|
viewBox: "0 0 24 24",
|
|
@@ -1018,25 +1033,25 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1018
1033
|
"stroke-linecap": "round",
|
|
1019
1034
|
"stroke-linejoin": "round",
|
|
1020
1035
|
d: e.modelValue ? "M12 18 V6" : "m18.5 12 c0 3.5 -3 6.5 -6.5 6.5 -3.5 0 -6.5 -3 -6.5 -6.5 0 -3.5 3 -6.5 6.5 -6.5 3.5 0 6.5 3 6.5 6.5z"
|
|
1021
|
-
}, null, 8,
|
|
1036
|
+
}, null, 8, Bt)
|
|
1022
1037
|
], 2))
|
|
1023
1038
|
])
|
|
1024
1039
|
], 2),
|
|
1025
|
-
v("input", R(
|
|
1040
|
+
v("input", R(n.value, {
|
|
1026
1041
|
checked: e.modelValue,
|
|
1027
1042
|
class: "hidden",
|
|
1028
1043
|
value: "1",
|
|
1029
1044
|
type: "checkbox",
|
|
1030
1045
|
onChange: c[0] || (c[0] = (s) => t("update:modelValue", s.target.checked))
|
|
1031
|
-
}), null, 16,
|
|
1032
|
-
], 10,
|
|
1033
|
-
|
|
1046
|
+
}), null, 16, Pt)
|
|
1047
|
+
], 10, Tt),
|
|
1048
|
+
B(l.$slots, "default")
|
|
1034
1049
|
], 2));
|
|
1035
1050
|
}
|
|
1036
|
-
},
|
|
1051
|
+
}, zt = {
|
|
1037
1052
|
"aria-live": "assertive",
|
|
1038
1053
|
class: "flex fixed inset-0 z-50 items-start py-6 px-4 pointer-events-none sm:p-6"
|
|
1039
|
-
},
|
|
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({
|
|
1040
1055
|
inheritAttrs: !1
|
|
1041
1056
|
}, {
|
|
1042
1057
|
__name: "message-toast",
|
|
@@ -1049,47 +1064,47 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1049
1064
|
showTimeoutProgress: { type: Boolean, default: !1 }
|
|
1050
1065
|
},
|
|
1051
1066
|
emits: ["timeout", "close"],
|
|
1052
|
-
setup(e, { emit:
|
|
1053
|
-
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);
|
|
1054
1069
|
let c = null;
|
|
1055
1070
|
const s = () => {
|
|
1056
1071
|
window.clearTimeout(c), l.value = 100, t.active && t.timeout && (c = window.setTimeout(() => {
|
|
1057
|
-
|
|
1072
|
+
n("timeout");
|
|
1058
1073
|
}, t.timeout), window.setTimeout(() => l.value = 0, 0));
|
|
1059
1074
|
};
|
|
1060
|
-
return X(() => t.active, s), fe(s), (
|
|
1061
|
-
v("div",
|
|
1062
|
-
|
|
1063
|
-
default:
|
|
1064
|
-
e.active ? (
|
|
1075
|
+
return X(() => t.active, s), fe(s), (o, r) => (d(), m("div", zt, [
|
|
1076
|
+
v("div", Nt, [
|
|
1077
|
+
_(ve, { name: e.transition }, {
|
|
1078
|
+
default: le(() => [
|
|
1079
|
+
e.active ? (d(), m("div", {
|
|
1065
1080
|
key: 0,
|
|
1066
|
-
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])
|
|
1067
1082
|
}, [
|
|
1068
|
-
v("div",
|
|
1069
|
-
v("div",
|
|
1070
|
-
v("div",
|
|
1071
|
-
|
|
1083
|
+
v("div", Et, [
|
|
1084
|
+
v("div", It, [
|
|
1085
|
+
v("div", Ot, [
|
|
1086
|
+
B(o.$slots, "icon")
|
|
1072
1087
|
]),
|
|
1073
|
-
v("div",
|
|
1074
|
-
|
|
1075
|
-
v("div", jt,
|
|
1088
|
+
v("div", Ft, [
|
|
1089
|
+
B(o.$slots, "title", {}, () => [
|
|
1090
|
+
v("div", jt, P(e.title), 1)
|
|
1076
1091
|
]),
|
|
1077
|
-
|
|
1078
|
-
(
|
|
1092
|
+
B(o.$slots, "default", {}, () => [
|
|
1093
|
+
(d(!0), m(I, null, Y(a.value, (i) => (d(), m("p", Yt, P(i), 1))), 256))
|
|
1079
1094
|
])
|
|
1080
1095
|
]),
|
|
1081
1096
|
v("div", _t, [
|
|
1082
1097
|
v("button", {
|
|
1083
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",
|
|
1084
|
-
onClick: r[0] || (r[0] = (
|
|
1099
|
+
onClick: r[0] || (r[0] = (i) => n("close"))
|
|
1085
1100
|
}, [
|
|
1086
1101
|
r[1] || (r[1] = v("span", { class: "sr-only" }, "Close", -1)),
|
|
1087
|
-
|
|
1102
|
+
_(A(he), { class: "size-5" })
|
|
1088
1103
|
])
|
|
1089
1104
|
])
|
|
1090
1105
|
])
|
|
1091
1106
|
]),
|
|
1092
|
-
e.showTimeoutProgress && e.timeout ? (
|
|
1107
|
+
e.showTimeoutProgress && e.timeout ? (d(), m("div", {
|
|
1093
1108
|
key: 0,
|
|
1094
1109
|
class: "h-1 transition-all ease-linear bg-vxvue-alt",
|
|
1095
1110
|
style: ye({
|
|
@@ -1099,8 +1114,8 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1099
1114
|
role: "progressbar",
|
|
1100
1115
|
"aria-hidden": "false",
|
|
1101
1116
|
"aria-label": "notification timer"
|
|
1102
|
-
}, null, 4)) :
|
|
1103
|
-
], 2)) :
|
|
1117
|
+
}, null, 4)) : N("", !0)
|
|
1118
|
+
], 2)) : N("", !0)
|
|
1104
1119
|
]),
|
|
1105
1120
|
_: 3
|
|
1106
1121
|
}, 8, ["name"])
|
|
@@ -1114,7 +1129,7 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1114
1129
|
}, Ht = {
|
|
1115
1130
|
key: 0,
|
|
1116
1131
|
class: "fixed inset-0 z-9999"
|
|
1117
|
-
},
|
|
1132
|
+
}, Zt = { class: "flex justify-center items-center h-screen" }, Dl = {
|
|
1118
1133
|
__name: "modal",
|
|
1119
1134
|
props: {
|
|
1120
1135
|
show: Boolean,
|
|
@@ -1123,38 +1138,38 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1123
1138
|
contentClass: { type: String, default: "" }
|
|
1124
1139
|
},
|
|
1125
1140
|
emits: ["clicked-outside"],
|
|
1126
|
-
setup(e, { emit:
|
|
1127
|
-
const t =
|
|
1128
|
-
return pe(
|
|
1129
|
-
e.show ? (
|
|
1130
|
-
|
|
1131
|
-
default:
|
|
1132
|
-
e.show ? (
|
|
1133
|
-
v("div",
|
|
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
|
+
_(ve, { name: "appear" }, {
|
|
1146
|
+
default: le(() => [
|
|
1147
|
+
e.show ? (d(), m("div", Ht, [
|
|
1148
|
+
v("div", Zt, [
|
|
1134
1149
|
v("div", {
|
|
1135
1150
|
ref_key: "container",
|
|
1136
|
-
ref:
|
|
1151
|
+
ref: n,
|
|
1137
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])
|
|
1138
1153
|
}, [
|
|
1139
1154
|
v("div", {
|
|
1140
1155
|
class: C(e.headerClass)
|
|
1141
1156
|
}, [
|
|
1142
|
-
|
|
1157
|
+
B(a.$slots, "title")
|
|
1143
1158
|
], 2),
|
|
1144
1159
|
v("div", {
|
|
1145
1160
|
class: C(["overflow-y-auto h-full pb-4 mt-16", e.contentClass])
|
|
1146
1161
|
}, [
|
|
1147
|
-
|
|
1162
|
+
B(a.$slots, "default")
|
|
1148
1163
|
], 2)
|
|
1149
1164
|
], 2)
|
|
1150
1165
|
])
|
|
1151
|
-
])) :
|
|
1166
|
+
])) : N("", !0)
|
|
1152
1167
|
]),
|
|
1153
1168
|
_: 3
|
|
1154
1169
|
})
|
|
1155
1170
|
], 64));
|
|
1156
1171
|
}
|
|
1157
|
-
},
|
|
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 = {
|
|
1158
1173
|
__name: "pagination",
|
|
1159
1174
|
props: {
|
|
1160
1175
|
page: { type: Number, default: 1 },
|
|
@@ -1167,58 +1182,58 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1167
1182
|
markerPosition: { type: String, default: "above", validator: (e) => ["above", "below"].includes(e) }
|
|
1168
1183
|
},
|
|
1169
1184
|
emits: ["update:page"],
|
|
1170
|
-
setup(e, { emit:
|
|
1171
|
-
const t =
|
|
1172
|
-
let
|
|
1173
|
-
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) {
|
|
1174
1189
|
for (let f = 2; f <= a.value; ++f)
|
|
1175
|
-
|
|
1176
|
-
return
|
|
1190
|
+
i.push(f);
|
|
1191
|
+
return i;
|
|
1177
1192
|
}
|
|
1178
|
-
return l.value >= a.value ?
|
|
1179
|
-
}),
|
|
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 = () => {
|
|
1180
1195
|
l.value > 1 && t("update:page", l.value - 1);
|
|
1181
1196
|
}, r = () => {
|
|
1182
1197
|
l.value < a.value && t("update:page", l.value + 1);
|
|
1183
1198
|
};
|
|
1184
|
-
return X(() =>
|
|
1185
|
-
a.value = Math.ceil(
|
|
1186
|
-
}), X(() =>
|
|
1187
|
-
a.value = Math.ceil(
|
|
1188
|
-
}), (
|
|
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, [
|
|
1189
1204
|
v("div", Ut, [
|
|
1190
|
-
e.showNavButtons ? (
|
|
1205
|
+
e.showNavButtons ? (d(), m("button", {
|
|
1191
1206
|
key: 0,
|
|
1192
1207
|
disabled: l.value <= 1,
|
|
1193
1208
|
class: C([
|
|
1194
1209
|
l.value <= 1 ? "pointer-events-none text-gray-500" : "text-vxvue-700",
|
|
1195
1210
|
"inline-flex items-center pr-1 text-sm border-transparent hover:text-vxvue"
|
|
1196
1211
|
]),
|
|
1197
|
-
onClick:
|
|
1212
|
+
onClick: o
|
|
1198
1213
|
}, [
|
|
1199
|
-
|
|
1200
|
-
J(" " +
|
|
1201
|
-
], 10,
|
|
1214
|
+
_(A(ie), { class: "size-5" }),
|
|
1215
|
+
J(" " + P(e.prevText), 1)
|
|
1216
|
+
], 10, qt)) : N("", !0)
|
|
1202
1217
|
]),
|
|
1203
|
-
v("div",
|
|
1204
|
-
(
|
|
1205
|
-
key:
|
|
1218
|
+
v("div", Kt, [
|
|
1219
|
+
(d(!0), m(I, null, Y(s.value, (x, y) => (d(), U(de(e.page !== "dots" ? "button" : "span"), {
|
|
1220
|
+
key: y,
|
|
1206
1221
|
class: C([
|
|
1207
|
-
{ "pointer-events-none":
|
|
1208
|
-
|
|
1222
|
+
{ "pointer-events-none": x === "dots" },
|
|
1223
|
+
x === l.value ? "border-vxvue text-vxvue font-bold" : "border-transparent text-gray-500 hover:border-gray-300",
|
|
1209
1224
|
c.value,
|
|
1210
1225
|
"inline-flex items-center px-4 text-sm"
|
|
1211
1226
|
]),
|
|
1212
|
-
onClick: (
|
|
1227
|
+
onClick: (b) => x !== "dots" ? t("update:page", x) : null
|
|
1213
1228
|
}, {
|
|
1214
|
-
default:
|
|
1215
|
-
J(
|
|
1229
|
+
default: le(() => [
|
|
1230
|
+
J(P(x !== "dots" ? x : "…"), 1)
|
|
1216
1231
|
]),
|
|
1217
1232
|
_: 2
|
|
1218
1233
|
}, 1032, ["class", "onClick"]))), 128))
|
|
1219
1234
|
]),
|
|
1220
1235
|
v("div", Xt, [
|
|
1221
|
-
e.showNavButtons ? (
|
|
1236
|
+
e.showNavButtons ? (d(), m("button", {
|
|
1222
1237
|
key: 0,
|
|
1223
1238
|
disabled: l.value >= a.value,
|
|
1224
1239
|
class: C([
|
|
@@ -1227,15 +1242,15 @@ const mt = { key: 0 }, ft = { class: "text-vxvue-700" }, ht = ["disabled"], pt =
|
|
|
1227
1242
|
]),
|
|
1228
1243
|
onClick: r
|
|
1229
1244
|
}, [
|
|
1230
|
-
J(
|
|
1231
|
-
|
|
1232
|
-
], 10, Gt)) :
|
|
1245
|
+
J(P(e.nextText) + " ", 1),
|
|
1246
|
+
_(A(re), { class: "size-5" })
|
|
1247
|
+
], 10, Gt)) : N("", !0)
|
|
1233
1248
|
])
|
|
1234
1249
|
]));
|
|
1235
1250
|
}
|
|
1236
1251
|
};
|
|
1237
|
-
function Jt(e,
|
|
1238
|
-
return
|
|
1252
|
+
function Jt(e, u) {
|
|
1253
|
+
return d(), m("svg", {
|
|
1239
1254
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1240
1255
|
fill: "none",
|
|
1241
1256
|
viewBox: "0 0 24 24",
|
|
@@ -1251,8 +1266,8 @@ function Jt(e, d) {
|
|
|
1251
1266
|
})
|
|
1252
1267
|
]);
|
|
1253
1268
|
}
|
|
1254
|
-
function Qt(e,
|
|
1255
|
-
return
|
|
1269
|
+
function Qt(e, u) {
|
|
1270
|
+
return d(), m("svg", {
|
|
1256
1271
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1257
1272
|
fill: "none",
|
|
1258
1273
|
viewBox: "0 0 24 24",
|
|
@@ -1273,21 +1288,21 @@ function Qt(e, d) {
|
|
|
1273
1288
|
})
|
|
1274
1289
|
]);
|
|
1275
1290
|
}
|
|
1276
|
-
const el = ["value", "type"], tl = ["disabled"],
|
|
1291
|
+
const el = ["value", "type"], tl = ["disabled"], Ll = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1277
1292
|
__name: "password-input",
|
|
1278
1293
|
props: { modelValue: { type: String, default: "" } },
|
|
1279
1294
|
emits: ["update:modelValue"],
|
|
1280
|
-
setup(e, { emit:
|
|
1281
|
-
const t =
|
|
1282
|
-
let l = Object.assign({},
|
|
1295
|
+
setup(e, { emit: u }) {
|
|
1296
|
+
const t = u, n = $(!1), a = z(() => {
|
|
1297
|
+
let l = Object.assign({}, K());
|
|
1283
1298
|
return delete l.class, l;
|
|
1284
1299
|
});
|
|
1285
|
-
return (l, c) => (
|
|
1286
|
-
class: C("inline-block relative " +
|
|
1300
|
+
return (l, c) => (d(), m("div", {
|
|
1301
|
+
class: C("inline-block relative " + K().class)
|
|
1287
1302
|
}, [
|
|
1288
1303
|
v("input", R({
|
|
1289
1304
|
value: e.modelValue,
|
|
1290
|
-
type:
|
|
1305
|
+
type: n.value ? "text" : "password"
|
|
1291
1306
|
}, a.value, {
|
|
1292
1307
|
class: "block pr-12 w-full form-input peer",
|
|
1293
1308
|
onInput: c[0] || (c[0] = (s) => t("update:modelValue", s.target.value))
|
|
@@ -1295,13 +1310,13 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1295
1310
|
v("button", {
|
|
1296
1311
|
class: "flex absolute inset-y-0 right-0 items-center px-3 text-brand-700 hover:text-brand",
|
|
1297
1312
|
"aria-label": "show-password-toggle",
|
|
1298
|
-
disabled:
|
|
1299
|
-
onClick: c[1] || (c[1] =
|
|
1313
|
+
disabled: K().disabled ?? !1,
|
|
1314
|
+
onClick: c[1] || (c[1] = j((s) => n.value = !n.value, ["stop"]))
|
|
1300
1315
|
}, [
|
|
1301
|
-
|
|
1316
|
+
n.value ? (d(), U(A(Jt), {
|
|
1302
1317
|
key: 0,
|
|
1303
1318
|
class: "size-5"
|
|
1304
|
-
})) : (
|
|
1319
|
+
})) : (d(), U(A(Qt), {
|
|
1305
1320
|
key: 1,
|
|
1306
1321
|
class: "size-5"
|
|
1307
1322
|
}))
|
|
@@ -1311,111 +1326,111 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1311
1326
|
}), ll = { class: "flex items-center pb-1" }, al = {
|
|
1312
1327
|
key: 0,
|
|
1313
1328
|
class: "ml-6"
|
|
1314
|
-
},
|
|
1329
|
+
}, Tl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1315
1330
|
__name: "simple-tree",
|
|
1316
1331
|
props: {
|
|
1317
1332
|
branch: { type: Object, default: () => ({}) },
|
|
1318
1333
|
modelValue: { type: Object, default: null }
|
|
1319
1334
|
},
|
|
1320
1335
|
emits: ["update:modelValue", "expand"],
|
|
1321
|
-
setup(e, { emit:
|
|
1322
|
-
const t = e,
|
|
1336
|
+
setup(e, { emit: u }) {
|
|
1337
|
+
const t = e, n = u, a = $(!1);
|
|
1323
1338
|
return fe(() => {
|
|
1324
|
-
t.branch === t.modelValue &&
|
|
1339
|
+
t.branch === t.modelValue && n("expand", !0);
|
|
1325
1340
|
}), (l, c) => {
|
|
1326
|
-
const s =
|
|
1327
|
-
return
|
|
1341
|
+
const s = Le("simple-tree", !0);
|
|
1342
|
+
return d(), m("div", {
|
|
1328
1343
|
class: C([!e.branch.branches || !e.branch.branches.length ? "terminates" : "", l.$attrs.class])
|
|
1329
1344
|
}, [
|
|
1330
1345
|
v("div", ll, [
|
|
1331
|
-
e.branch.branches && e.branch.branches.length ? (
|
|
1346
|
+
e.branch.branches && e.branch.branches.length ? (d(), m("button", {
|
|
1332
1347
|
key: 0,
|
|
1333
1348
|
class: "mr-2",
|
|
1334
|
-
onClick: c[0] || (c[0] = (
|
|
1349
|
+
onClick: c[0] || (c[0] = (o) => a.value = !a.value)
|
|
1335
1350
|
}, [
|
|
1336
|
-
|
|
1351
|
+
B(l.$slots, "toggle", {
|
|
1337
1352
|
branch: e.branch,
|
|
1338
1353
|
expanded: a.value
|
|
1339
1354
|
}, () => [
|
|
1340
|
-
(
|
|
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" }))
|
|
1341
1356
|
])
|
|
1342
|
-
])) :
|
|
1343
|
-
e.branch === e.modelValue ?
|
|
1357
|
+
])) : N("", !0),
|
|
1358
|
+
e.branch === e.modelValue ? B(l.$slots, "label-selected", {
|
|
1344
1359
|
key: 1,
|
|
1345
1360
|
branch: e.branch
|
|
1346
1361
|
}, () => [
|
|
1347
|
-
v("strong", null,
|
|
1348
|
-
]) : (
|
|
1362
|
+
v("strong", null, P(e.branch.label), 1)
|
|
1363
|
+
]) : (d(), m("button", {
|
|
1349
1364
|
key: 2,
|
|
1350
|
-
onClick: c[1] || (c[1] = (
|
|
1365
|
+
onClick: c[1] || (c[1] = (o) => n("update:modelValue", e.branch))
|
|
1351
1366
|
}, [
|
|
1352
|
-
|
|
1353
|
-
J(
|
|
1367
|
+
B(l.$slots, "label", { branch: e.branch }, () => [
|
|
1368
|
+
J(P(e.branch.label), 1)
|
|
1354
1369
|
])
|
|
1355
1370
|
]))
|
|
1356
1371
|
]),
|
|
1357
|
-
e.branch.branches && e.branch.branches.length ? xe((
|
|
1358
|
-
(
|
|
1359
|
-
key:
|
|
1360
|
-
branch:
|
|
1372
|
+
e.branch.branches && e.branch.branches.length ? xe((d(), m("div", al, [
|
|
1373
|
+
(d(!0), m(I, null, Y(e.branch.branches, (o) => (d(), U(s, {
|
|
1374
|
+
key: o.id || o.key || null,
|
|
1375
|
+
branch: o,
|
|
1361
1376
|
"model-value": e.modelValue,
|
|
1362
|
-
"onUpdate:modelValue": c[2] || (c[2] = (r) =>
|
|
1377
|
+
"onUpdate:modelValue": c[2] || (c[2] = (r) => n("update:modelValue", r)),
|
|
1363
1378
|
onExpand: c[3] || (c[3] = (r) => {
|
|
1364
|
-
a.value = r,
|
|
1379
|
+
a.value = r, n("expand", r);
|
|
1365
1380
|
})
|
|
1366
|
-
},
|
|
1367
|
-
|
|
1368
|
-
name:
|
|
1369
|
-
fn:
|
|
1370
|
-
|
|
1381
|
+
}, Te({ _: 2 }, [
|
|
1382
|
+
Y(l.$slots, (r, i) => ({
|
|
1383
|
+
name: i,
|
|
1384
|
+
fn: le((f) => [
|
|
1385
|
+
B(l.$slots, i, R({ ref_for: !0 }, f))
|
|
1371
1386
|
])
|
|
1372
1387
|
}))
|
|
1373
1388
|
]), 1032, ["branch", "model-value"]))), 128))
|
|
1374
1389
|
], 512)), [
|
|
1375
|
-
[
|
|
1376
|
-
]) :
|
|
1390
|
+
[Be, a.value]
|
|
1391
|
+
]) : N("", !0)
|
|
1377
1392
|
], 2);
|
|
1378
1393
|
};
|
|
1379
1394
|
}
|
|
1380
|
-
}),
|
|
1395
|
+
}), Bl = {
|
|
1381
1396
|
__name: "sizable",
|
|
1382
1397
|
props: { vertical: Boolean },
|
|
1383
1398
|
emits: ["dragStart", "dragStop"],
|
|
1384
|
-
setup(e, { emit:
|
|
1385
|
-
const t = e,
|
|
1386
|
-
let c = !1, s = {},
|
|
1387
|
-
const f = (
|
|
1388
|
-
var
|
|
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
|
+
const f = (b) => {
|
|
1403
|
+
var L;
|
|
1389
1404
|
if (c) {
|
|
1390
|
-
|
|
1391
|
-
const { pageX:
|
|
1392
|
-
t.vertical ? a.value.style.height = Math.min(r.height -
|
|
1405
|
+
b.preventDefault();
|
|
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 - 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";
|
|
1393
1408
|
}
|
|
1394
|
-
},
|
|
1395
|
-
var
|
|
1396
|
-
|
|
1397
|
-
const { pageX:
|
|
1398
|
-
s = { x:
|
|
1399
|
-
},
|
|
1400
|
-
c && (c = !1,
|
|
1409
|
+
}, x = (b) => {
|
|
1410
|
+
var k;
|
|
1411
|
+
b.preventDefault(), b.currentTarget.focus(), c = !0;
|
|
1412
|
+
const { pageX: L, pageY: p } = ((k = b.touches) == null ? void 0 : k[0]) ?? b;
|
|
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
|
+
}, 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(() => n("dragStop"), 0));
|
|
1401
1416
|
};
|
|
1402
|
-
return (
|
|
1417
|
+
return (b, L) => (d(), m("div", {
|
|
1403
1418
|
ref_key: "box",
|
|
1404
1419
|
ref: a,
|
|
1405
1420
|
class: "relative"
|
|
1406
1421
|
}, [
|
|
1407
|
-
|
|
1422
|
+
B(b.$slots, "default"),
|
|
1408
1423
|
v("div", R({
|
|
1409
1424
|
ref_key: "handle",
|
|
1410
1425
|
ref: l,
|
|
1411
1426
|
class: ["absolute flex", t.vertical ? "inset-x-0 top-full justify-center py-1 cursor-ns-resize" : "inset-y-0 left-full items-center px-1 cursor-ew-resize"]
|
|
1412
|
-
},
|
|
1413
|
-
touchstart:
|
|
1414
|
-
mousedown:
|
|
1415
|
-
touchend:
|
|
1416
|
-
mouseup:
|
|
1427
|
+
}, ue({
|
|
1428
|
+
touchstart: x,
|
|
1429
|
+
mousedown: x,
|
|
1430
|
+
touchend: y,
|
|
1431
|
+
mouseup: y
|
|
1417
1432
|
}, !0)), [
|
|
1418
|
-
|
|
1433
|
+
B(b.$slots, "handle", {}, () => [
|
|
1419
1434
|
v("div", {
|
|
1420
1435
|
class: C(["rounded-full bg-vxvue", t.vertical ? "h-1.5 w-8" : "h-8 w-1.5"])
|
|
1421
1436
|
}, null, 2)
|
|
@@ -1423,7 +1438,7 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1423
1438
|
], 16)
|
|
1424
1439
|
], 512));
|
|
1425
1440
|
}
|
|
1426
|
-
}, sl = ["aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext"], nl = ["id"], ol = ["id", "aria-label"],
|
|
1441
|
+
}, sl = ["aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext"], nl = ["id"], ol = ["id", "aria-label"], Pl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1427
1442
|
__name: "slider",
|
|
1428
1443
|
props: {
|
|
1429
1444
|
min: { type: Number, default: 0 },
|
|
@@ -1431,74 +1446,74 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1431
1446
|
vertical: Boolean,
|
|
1432
1447
|
disabled: Boolean,
|
|
1433
1448
|
modelValue: { type: [Number, Array], default: null, validator(e) {
|
|
1434
|
-
return typeof e == "number" || e.every((
|
|
1449
|
+
return typeof e == "number" || e.every((u) => typeof u == "number");
|
|
1435
1450
|
} }
|
|
1436
1451
|
},
|
|
1437
1452
|
emits: ["update:modelValue", "dragStart", "dragStop"],
|
|
1438
|
-
setup(e, { emit:
|
|
1439
|
-
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 };
|
|
1440
1455
|
let s = !1;
|
|
1441
|
-
const
|
|
1442
|
-
const S = t.max,
|
|
1443
|
-
return t.modelValue instanceof Array ? t.modelValue.map((
|
|
1444
|
-
}), f =
|
|
1456
|
+
const o = $(null), r = $(0), i = z(() => {
|
|
1457
|
+
const S = t.max, M = t.min;
|
|
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
|
+
}), f = z(() => {
|
|
1445
1460
|
if (t.modelValue instanceof Array) {
|
|
1446
|
-
const S = Math.min(...
|
|
1447
|
-
return t.vertical ? { bottom: S, height:
|
|
1461
|
+
const S = Math.min(...i.value) + "%", M = Math.max(...i.value) - Math.min(...i.value) + "%";
|
|
1462
|
+
return t.vertical ? { bottom: S, height: M } : { left: S, width: M };
|
|
1448
1463
|
}
|
|
1449
|
-
return t.vertical ? { bottom: 0, height:
|
|
1450
|
-
}),
|
|
1464
|
+
return t.vertical ? { bottom: 0, height: i.value + "%" } : { width: i.value + "%" };
|
|
1465
|
+
}), x = $({
|
|
1451
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"),
|
|
1452
1467
|
tabindex: 0
|
|
1453
|
-
}),
|
|
1454
|
-
let
|
|
1455
|
-
if (
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1468
|
+
}), y = (S) => {
|
|
1469
|
+
let M = parseFloat(S.toFixed(10));
|
|
1470
|
+
if (M = Math.min(t.max, Math.max(t.min, M)), t.modelValue instanceof Array) {
|
|
1471
|
+
let F = [...t.modelValue];
|
|
1472
|
+
F[r.value] = M, n("update:modelValue", F);
|
|
1458
1473
|
} else
|
|
1459
|
-
|
|
1460
|
-
},
|
|
1461
|
-
const { pageX:
|
|
1462
|
-
|
|
1463
|
-
},
|
|
1464
|
-
const { clientLeft: S, clientTop:
|
|
1465
|
-
l.x =
|
|
1466
|
-
},
|
|
1467
|
-
s && (S.preventDefault(),
|
|
1468
|
-
},
|
|
1469
|
-
S.preventDefault(), S.currentTarget.focus(),
|
|
1470
|
-
},
|
|
1471
|
-
s && (s = !1, S.type === "mouseup" ? (document.removeEventListener("mousemove",
|
|
1474
|
+
n("update:modelValue", M);
|
|
1475
|
+
}, b = (S) => {
|
|
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
|
+
y(Math.floor((t.max - t.min) * h + t.min));
|
|
1478
|
+
}, L = () => {
|
|
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
|
+
}, p = (S) => {
|
|
1482
|
+
s && (S.preventDefault(), b(S));
|
|
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)), n("dragStart");
|
|
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(() => n("dragStop"), 0));
|
|
1472
1487
|
}, Z = (S) => {
|
|
1473
1488
|
S.keyCode >= 33 && S.keyCode <= 40 && S.preventDefault();
|
|
1474
|
-
const
|
|
1489
|
+
const M = t.modelValue[r.value] ?? t.modelValue;
|
|
1475
1490
|
switch (S.keyCode) {
|
|
1476
1491
|
case 37:
|
|
1477
1492
|
case 40:
|
|
1478
|
-
|
|
1493
|
+
y(M - 1);
|
|
1479
1494
|
break;
|
|
1480
1495
|
case 39:
|
|
1481
1496
|
case 38:
|
|
1482
|
-
|
|
1497
|
+
y(M + 1);
|
|
1483
1498
|
break;
|
|
1484
1499
|
case 33:
|
|
1485
|
-
|
|
1500
|
+
y(M + (t.max - t.min) / 10);
|
|
1486
1501
|
break;
|
|
1487
1502
|
case 34:
|
|
1488
|
-
|
|
1503
|
+
y(M - (t.max - t.min) / 10);
|
|
1489
1504
|
break;
|
|
1490
1505
|
case 36:
|
|
1491
|
-
|
|
1506
|
+
y(t.min);
|
|
1492
1507
|
break;
|
|
1493
1508
|
case 35:
|
|
1494
|
-
|
|
1509
|
+
y(t.max);
|
|
1495
1510
|
}
|
|
1496
|
-
},
|
|
1497
|
-
|
|
1511
|
+
}, H = (S) => {
|
|
1512
|
+
L(), b(S);
|
|
1498
1513
|
};
|
|
1499
|
-
return (S,
|
|
1514
|
+
return (S, M) => (d(), m("div", R({
|
|
1500
1515
|
ref_key: "track",
|
|
1501
|
-
ref:
|
|
1516
|
+
ref: o,
|
|
1502
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"],
|
|
1503
1518
|
role: "slider",
|
|
1504
1519
|
"aria-label": "slider-thumb",
|
|
@@ -1506,58 +1521,58 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1506
1521
|
"aria-valuemax": t.max,
|
|
1507
1522
|
"aria-valuenow": e.modelValue[0] ?? e.modelValue,
|
|
1508
1523
|
"aria-valuetext": e.modelValue
|
|
1509
|
-
},
|
|
1510
|
-
click:
|
|
1524
|
+
}, ue(e.disabled ? {} : {
|
|
1525
|
+
click: H
|
|
1511
1526
|
}, !0)), [
|
|
1512
|
-
e.disabled ?
|
|
1527
|
+
e.disabled ? N("", !0) : (d(), m("div", {
|
|
1513
1528
|
key: 0,
|
|
1514
1529
|
class: C(["absolute bg-vxvue", e.vertical ? "w-full rounded-t-full rounded-b-full" : "h-full rounded-r-full rounded-l-full"]),
|
|
1515
1530
|
style: ye(f.value)
|
|
1516
1531
|
}, null, 6)),
|
|
1517
|
-
e.modelValue.length ? (
|
|
1532
|
+
e.modelValue.length ? (d(!0), m(I, { key: 2 }, Y(e.modelValue, (F, h) => (d(), m("button", R({
|
|
1518
1533
|
id: h ? null : A(a).id,
|
|
1519
|
-
style: e.vertical ? { bottom:
|
|
1534
|
+
style: e.vertical ? { bottom: i.value[h] + "%" } : { left: i.value[h] + "%" },
|
|
1520
1535
|
"aria-label": "slider-thumb-" + (h + 1),
|
|
1521
1536
|
ref_for: !0
|
|
1522
|
-
},
|
|
1537
|
+
}, x.value, ue(e.disabled ? {} : {
|
|
1523
1538
|
focus: () => r.value = h,
|
|
1524
1539
|
keydown: Z,
|
|
1525
|
-
touchstart: (
|
|
1526
|
-
r.value = h,
|
|
1540
|
+
touchstart: (g) => {
|
|
1541
|
+
r.value = h, k(g);
|
|
1527
1542
|
},
|
|
1528
|
-
mousedown: (
|
|
1529
|
-
r.value = h,
|
|
1543
|
+
mousedown: (g) => {
|
|
1544
|
+
r.value = h, k(g);
|
|
1530
1545
|
},
|
|
1531
|
-
touchend:
|
|
1532
|
-
mouseup:
|
|
1533
|
-
}, !0)), null, 16, ol))), 256)) : (
|
|
1546
|
+
touchend: D,
|
|
1547
|
+
mouseup: D
|
|
1548
|
+
}, !0)), null, 16, ol))), 256)) : (d(), m("button", R({
|
|
1534
1549
|
key: 1,
|
|
1535
1550
|
id: A(a).id,
|
|
1536
|
-
style: e.vertical ? { bottom:
|
|
1551
|
+
style: e.vertical ? { bottom: i.value + "%" } : { left: i.value + "%" },
|
|
1537
1552
|
"aria-label": "slider-thumb"
|
|
1538
|
-
},
|
|
1553
|
+
}, x.value, ue(e.disabled ? {} : {
|
|
1539
1554
|
focus: () => r.value = 0,
|
|
1540
1555
|
keydown: Z,
|
|
1541
|
-
touchstart: (
|
|
1542
|
-
r.value = 0,
|
|
1556
|
+
touchstart: (F) => {
|
|
1557
|
+
r.value = 0, k(F);
|
|
1543
1558
|
},
|
|
1544
|
-
mousedown: (
|
|
1545
|
-
r.value = 0,
|
|
1559
|
+
mousedown: (F) => {
|
|
1560
|
+
r.value = 0, k(F);
|
|
1546
1561
|
},
|
|
1547
|
-
touchend:
|
|
1548
|
-
mouseup:
|
|
1562
|
+
touchend: D,
|
|
1563
|
+
mouseup: D
|
|
1549
1564
|
}, !0)), null, 16, nl))
|
|
1550
1565
|
], 16, sl));
|
|
1551
1566
|
}
|
|
1552
|
-
}), rl = ["data-active", "onClick"], ul = { class: "flex items-center space-x-1" }, il = ["data-active"],
|
|
1567
|
+
}), rl = ["data-active", "onClick"], ul = { class: "flex items-center space-x-1" }, il = ["data-active"], zl = {
|
|
1553
1568
|
__name: "sortable",
|
|
1554
1569
|
props: {
|
|
1555
1570
|
columns: {
|
|
1556
1571
|
type: Array,
|
|
1557
1572
|
required: !0,
|
|
1558
1573
|
validator: (e) => {
|
|
1559
|
-
for (const
|
|
1560
|
-
if (
|
|
1574
|
+
for (const u of e)
|
|
1575
|
+
if (u.label === void 0 || u.prop === void 0)
|
|
1561
1576
|
return !1;
|
|
1562
1577
|
return !0;
|
|
1563
1578
|
}
|
|
@@ -1572,43 +1587,43 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1572
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" }
|
|
1573
1588
|
},
|
|
1574
1589
|
emits: ["before-sort", "after-sort"],
|
|
1575
|
-
setup(e, { emit:
|
|
1576
|
-
const t = e,
|
|
1577
|
-
let
|
|
1578
|
-
const r = t.columns.find(({ prop:
|
|
1579
|
-
return r && (l.value === "asc" && r.sortAscFunction ?
|
|
1580
|
-
}), s = (
|
|
1581
|
-
|
|
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 }));
|
|
1582
1597
|
};
|
|
1583
|
-
return (
|
|
1584
|
-
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")
|
|
1585
1600
|
}, [
|
|
1586
1601
|
v("thead", {
|
|
1587
1602
|
class: C(e.headerClass)
|
|
1588
1603
|
}, [
|
|
1589
1604
|
v("tr", null, [
|
|
1590
|
-
(
|
|
1591
|
-
key:
|
|
1605
|
+
(d(!0), m(I, null, Y(e.columns, (i) => (d(), m("th", {
|
|
1606
|
+
key: i.prop,
|
|
1592
1607
|
scope: "col",
|
|
1593
|
-
"data-active": a.value ===
|
|
1608
|
+
"data-active": a.value === i.prop ? "active" : null,
|
|
1594
1609
|
class: C([
|
|
1595
1610
|
"py-3 px-6 text-left",
|
|
1596
|
-
{ "cursor-pointer":
|
|
1597
|
-
|
|
1611
|
+
{ "cursor-pointer": i.sortable },
|
|
1612
|
+
i.cssClass
|
|
1598
1613
|
]),
|
|
1599
|
-
onClick: (f) =>
|
|
1614
|
+
onClick: (f) => i.sortable ? s(i.prop) : null
|
|
1600
1615
|
}, [
|
|
1601
|
-
|
|
1602
|
-
column:
|
|
1616
|
+
B(o.$slots, i.prop + "-header", {
|
|
1617
|
+
column: i,
|
|
1603
1618
|
sortDir: l.value,
|
|
1604
1619
|
sortProp: a.value
|
|
1605
1620
|
}, () => [
|
|
1606
1621
|
v("div", ul, [
|
|
1607
|
-
v("span", null,
|
|
1608
|
-
|
|
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)), {
|
|
1609
1624
|
key: 0,
|
|
1610
1625
|
class: "size-4"
|
|
1611
|
-
})) :
|
|
1626
|
+
})) : N("", !0)
|
|
1612
1627
|
])
|
|
1613
1628
|
])
|
|
1614
1629
|
], 10, rl))), 128))
|
|
@@ -1617,27 +1632,27 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1617
1632
|
v("tbody", {
|
|
1618
1633
|
class: C(e.bodyClass)
|
|
1619
1634
|
}, [
|
|
1620
|
-
(
|
|
1621
|
-
key:
|
|
1622
|
-
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)
|
|
1623
1638
|
}, [
|
|
1624
|
-
(
|
|
1639
|
+
(d(!0), m(I, null, Y(e.columns, (f) => (d(), m("td", {
|
|
1625
1640
|
key: f.prop,
|
|
1626
1641
|
"data-active": a.value === f.prop ? "active" : null,
|
|
1627
1642
|
class: "overflow-hidden py-3 px-6 whitespace-nowrap text-ellipsis"
|
|
1628
1643
|
}, [
|
|
1629
|
-
|
|
1630
|
-
J(
|
|
1644
|
+
B(o.$slots, f.prop, { row: i }, () => [
|
|
1645
|
+
J(P(i[f.prop]), 1)
|
|
1631
1646
|
])
|
|
1632
1647
|
], 8, il))), 128))
|
|
1633
1648
|
], 2))), 128))
|
|
1634
1649
|
], 2)
|
|
1635
1650
|
], 2));
|
|
1636
1651
|
}
|
|
1637
|
-
}, dl = (e,
|
|
1652
|
+
}, dl = (e, u) => {
|
|
1638
1653
|
const t = e.__vccOpts || e;
|
|
1639
|
-
for (const [
|
|
1640
|
-
t[
|
|
1654
|
+
for (const [n, a] of u)
|
|
1655
|
+
t[n] = a;
|
|
1641
1656
|
return t;
|
|
1642
1657
|
}, cl = { class: "flex items-center space-x-2" }, vl = ["disabled"], ml = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1643
1658
|
__name: "submit-button",
|
|
@@ -1647,59 +1662,59 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1647
1662
|
theme: { type: String, default: null }
|
|
1648
1663
|
},
|
|
1649
1664
|
emits: ["submit"],
|
|
1650
|
-
setup(e, { emit:
|
|
1651
|
-
const t =
|
|
1652
|
-
return (
|
|
1665
|
+
setup(e, { emit: u }) {
|
|
1666
|
+
const t = u;
|
|
1667
|
+
return (n, a) => (d(), m("div", cl, [
|
|
1653
1668
|
v("button", {
|
|
1654
|
-
class: C([
|
|
1655
|
-
disabled:
|
|
1669
|
+
class: C([n.$attrs.class, e.theme]),
|
|
1670
|
+
disabled: n.$attrs.disabled || e.busy,
|
|
1656
1671
|
type: "button",
|
|
1657
1672
|
onClick: a[0] || (a[0] = (l) => t("submit"))
|
|
1658
1673
|
}, [
|
|
1659
|
-
|
|
1674
|
+
B(n.$slots, "default", {}, void 0, !0)
|
|
1660
1675
|
], 10, vl),
|
|
1661
|
-
e.busy ? (
|
|
1676
|
+
e.busy ? (d(), U(we, {
|
|
1662
1677
|
key: 0,
|
|
1663
1678
|
class: C(e.spinnerClass || ["size-5", { error: "text-error", success: "text-success", default: "text-vxvue" }[e.theme || "default"]])
|
|
1664
|
-
}, null, 8, ["class"])) :
|
|
1679
|
+
}, null, 8, ["class"])) : N("", !0)
|
|
1665
1680
|
]));
|
|
1666
1681
|
}
|
|
1667
|
-
}),
|
|
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 = {
|
|
1668
1683
|
class: "flex -mb-px space-x-8",
|
|
1669
1684
|
"aria-label": "Tabs"
|
|
1670
|
-
}, bl = ["aria-current", "onClick"],
|
|
1685
|
+
}, bl = ["aria-current", "onClick"], El = {
|
|
1671
1686
|
__name: "tabs",
|
|
1672
1687
|
props: {
|
|
1673
1688
|
items: { type: Array, default: () => [] },
|
|
1674
1689
|
activeIndex: { type: Number, default: 0 }
|
|
1675
1690
|
},
|
|
1676
1691
|
emits: ["update:activeIndex"],
|
|
1677
|
-
setup(e, { emit:
|
|
1678
|
-
const t = e,
|
|
1692
|
+
setup(e, { emit: u }) {
|
|
1693
|
+
const t = e, n = u, a = $(t.items[t.activeIndex] || {}), l = z(() => {
|
|
1679
1694
|
let s = [];
|
|
1680
|
-
return t.items.forEach((
|
|
1681
|
-
|
|
1695
|
+
return t.items.forEach((o, r) => {
|
|
1696
|
+
o.disabled || s.push({ label: o.name, key: r });
|
|
1682
1697
|
}), s;
|
|
1683
1698
|
});
|
|
1684
1699
|
X(() => t.activeIndex, (s) => {
|
|
1685
1700
|
a.value = t.items[s] || {};
|
|
1686
1701
|
});
|
|
1687
1702
|
const c = (s) => {
|
|
1688
|
-
s.disabled || (a.value = s,
|
|
1703
|
+
s.disabled || (a.value = s, n("update:activeIndex", t.items.indexOf(s)));
|
|
1689
1704
|
};
|
|
1690
|
-
return (s,
|
|
1705
|
+
return (s, o) => (d(), m(I, null, [
|
|
1691
1706
|
v("div", fl, [
|
|
1692
|
-
|
|
1707
|
+
_(Lt, {
|
|
1693
1708
|
options: l.value,
|
|
1694
1709
|
"model-value": e.activeIndex,
|
|
1695
1710
|
class: "w-full",
|
|
1696
|
-
"onUpdate:modelValue":
|
|
1711
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => n("update:activeIndex", r))
|
|
1697
1712
|
}, null, 8, ["options", "model-value"])
|
|
1698
1713
|
]),
|
|
1699
1714
|
v("div", hl, [
|
|
1700
1715
|
v("div", pl, [
|
|
1701
1716
|
v("nav", gl, [
|
|
1702
|
-
(
|
|
1717
|
+
(d(!0), m(I, null, Y(e.items, (r) => (d(), m("a", {
|
|
1703
1718
|
key: r.name,
|
|
1704
1719
|
href: "#",
|
|
1705
1720
|
class: C([
|
|
@@ -1711,16 +1726,16 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1711
1726
|
}
|
|
1712
1727
|
]),
|
|
1713
1728
|
"aria-current": a.value === r ? "page" : void 0,
|
|
1714
|
-
onClick:
|
|
1729
|
+
onClick: j((i) => c(r), ["prevent"])
|
|
1715
1730
|
}, [
|
|
1716
|
-
|
|
1731
|
+
B(s.$slots, "icon", { tab: r }),
|
|
1717
1732
|
v("span", null, [
|
|
1718
|
-
|
|
1719
|
-
J(
|
|
1733
|
+
B(s.$slots, "default", { tab: r }, () => [
|
|
1734
|
+
J(P(r.name), 1)
|
|
1720
1735
|
])
|
|
1721
1736
|
]),
|
|
1722
|
-
|
|
1723
|
-
r.badge ? (
|
|
1737
|
+
B(s.$slots, "badge", { tab: r }, () => [
|
|
1738
|
+
r.badge ? (d(), m("span", {
|
|
1724
1739
|
key: 0,
|
|
1725
1740
|
class: C([
|
|
1726
1741
|
"hidden ml-3 py-0.5 px-2.5 rounded-full text-xs font-medium md:inline-block text-current",
|
|
@@ -1730,7 +1745,7 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1730
1745
|
"bg-gray-200": a.value !== r && !r.disabled
|
|
1731
1746
|
}
|
|
1732
1747
|
])
|
|
1733
|
-
},
|
|
1748
|
+
}, P(r.badge), 3)) : N("", !0)
|
|
1734
1749
|
])
|
|
1735
1750
|
], 10, bl))), 128))
|
|
1736
1751
|
])
|
|
@@ -1738,6 +1753,33 @@ const el = ["value", "type"], tl = ["disabled"], Bl = /* @__PURE__ */ Object.ass
|
|
|
1738
1753
|
])
|
|
1739
1754
|
], 64));
|
|
1740
1755
|
}
|
|
1756
|
+
}, Il = {
|
|
1757
|
+
mounted: (e) => e.focus()
|
|
1758
|
+
}, Ol = {
|
|
1759
|
+
mounted: (e, u) => {
|
|
1760
|
+
var l, c;
|
|
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");
|
|
1769
|
+
const a = document.createElement("label");
|
|
1770
|
+
a.classList.add(
|
|
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(" "),
|
|
1774
|
+
e.nodeName === "TEXTAREA" ? "peer-placeholder-shown:top-4" : "peer-placeholder-shown:top-1/2"
|
|
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)
|
|
1741
1783
|
};
|
|
1742
1784
|
export {
|
|
1743
1785
|
yl as Accordion,
|
|
@@ -1747,17 +1789,19 @@ export {
|
|
|
1747
1789
|
pt as DateInput,
|
|
1748
1790
|
Sl as Datepicker,
|
|
1749
1791
|
Cl as FormFileButton,
|
|
1750
|
-
|
|
1792
|
+
Lt as FormSelect,
|
|
1751
1793
|
Ml as FormSwitch,
|
|
1752
1794
|
Vl as MessageToast,
|
|
1753
1795
|
Dl as Modal,
|
|
1754
1796
|
Al as Pagination,
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1797
|
+
Ll as PasswordInput,
|
|
1798
|
+
Tl as SimpleTree,
|
|
1799
|
+
Bl as Sizable,
|
|
1800
|
+
Pl as Slider,
|
|
1801
|
+
zl as Sortable,
|
|
1760
1802
|
we as Spinner,
|
|
1761
|
-
|
|
1762
|
-
|
|
1803
|
+
Nl as SubmitButton,
|
|
1804
|
+
El as Tabs,
|
|
1805
|
+
Ol as VFloatingLabel,
|
|
1806
|
+
Il as VFocus
|
|
1763
1807
|
};
|