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