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