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