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