vx-vue 0.1.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +36 -33
- package/dist/style.css +1 -1
- package/dist/vxvue.es.js +900 -367
- package/dist/vxvue.umd.js +1 -1
- package/package.json +28 -26
package/dist/vxvue.es.js
CHANGED
|
@@ -1,111 +1,287 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
-
fill: "none",
|
|
6
|
-
viewBox: "0 0 24 24",
|
|
7
|
-
"stroke-width": "1.5",
|
|
8
|
-
stroke: "currentColor",
|
|
9
|
-
"aria-hidden": "true"
|
|
10
|
-
}, [
|
|
11
|
-
n("path", {
|
|
12
|
-
"stroke-linecap": "round",
|
|
13
|
-
"stroke-linejoin": "round",
|
|
14
|
-
d: "M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"
|
|
15
|
-
})
|
|
16
|
-
]);
|
|
1
|
+
import { getCurrentScope as we, onScopeDispose as xe, unref as M, watch as E, useAttrs as q, ref as g, computed as C, onUpdated as ye, openBlock as u, createElementBlock as d, normalizeClass as _, createElementVNode as c, mergeProps as O, withKeys as U, withModifiers as V, createCommentVNode as D, Fragment as P, renderList as B, renderSlot as A, toDisplayString as $, createVNode as N, Transition as ae, withCtx as G, createTextVNode as j, nextTick as ee, toValue as te, withDirectives as ne, vModelText as ke, createBlock as R, onMounted as oe, pushScopeId as $e, popScopeId as _e, resolveDynamicComponent as re, resolveComponent as Ce, vShow as Se } from "vue";
|
|
2
|
+
function De(e) {
|
|
3
|
+
return we() ? (xe(e), !0) : !1;
|
|
17
4
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
5
|
+
function ue(e) {
|
|
6
|
+
return typeof e == "function" ? e() : M(e);
|
|
7
|
+
}
|
|
8
|
+
const ie = typeof window < "u" && typeof document < "u", Me = Object.prototype.toString, Ve = (e) => Me.call(e) === "[object Object]", Q = () => {
|
|
9
|
+
}, Pe = /* @__PURE__ */ Ae();
|
|
10
|
+
function Ae() {
|
|
11
|
+
var e;
|
|
12
|
+
return ie && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
13
|
+
}
|
|
14
|
+
const Be = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
|
|
15
|
+
function Fe(e, n, l, s) {
|
|
16
|
+
let t = e < 12 ? "AM" : "PM";
|
|
17
|
+
return s && (t = t.split("").reduce((o, r) => o += `${r}.`, "")), l ? t.toLowerCase() : t;
|
|
18
|
+
}
|
|
19
|
+
function le(e, n, l = {}) {
|
|
20
|
+
var s;
|
|
21
|
+
const t = e.getFullYear(), o = e.getMonth(), r = e.getDate(), a = e.getHours(), v = e.getMinutes(), i = e.getSeconds(), h = e.getMilliseconds(), m = e.getDay(), f = (s = l.customMeridiem) != null ? s : Fe, p = {
|
|
22
|
+
YY: () => String(t).slice(-2),
|
|
23
|
+
YYYY: () => t,
|
|
24
|
+
M: () => o + 1,
|
|
25
|
+
MM: () => `${o + 1}`.padStart(2, "0"),
|
|
26
|
+
MMM: () => e.toLocaleDateString(l.locales, { month: "short" }),
|
|
27
|
+
MMMM: () => e.toLocaleDateString(l.locales, { month: "long" }),
|
|
28
|
+
D: () => String(r),
|
|
29
|
+
DD: () => `${r}`.padStart(2, "0"),
|
|
30
|
+
H: () => String(a),
|
|
31
|
+
HH: () => `${a}`.padStart(2, "0"),
|
|
32
|
+
h: () => `${a % 12 || 12}`.padStart(1, "0"),
|
|
33
|
+
hh: () => `${a % 12 || 12}`.padStart(2, "0"),
|
|
34
|
+
m: () => String(v),
|
|
35
|
+
mm: () => `${v}`.padStart(2, "0"),
|
|
36
|
+
s: () => String(i),
|
|
37
|
+
ss: () => `${i}`.padStart(2, "0"),
|
|
38
|
+
SSS: () => `${h}`.padStart(3, "0"),
|
|
39
|
+
d: () => m,
|
|
40
|
+
dd: () => e.toLocaleDateString(l.locales, { weekday: "narrow" }),
|
|
41
|
+
ddd: () => e.toLocaleDateString(l.locales, { weekday: "short" }),
|
|
42
|
+
dddd: () => e.toLocaleDateString(l.locales, { weekday: "long" }),
|
|
43
|
+
A: () => f(a, v),
|
|
44
|
+
AA: () => f(a, v, !1, !0),
|
|
45
|
+
a: () => f(a, v, !0),
|
|
46
|
+
aa: () => f(a, v, !0, !0)
|
|
47
|
+
};
|
|
48
|
+
return n.replace(Be, (k, Y) => {
|
|
49
|
+
var L, z;
|
|
50
|
+
return (z = Y ?? ((L = p[k]) == null ? void 0 : L.call(p))) != null ? z : k;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function W(e) {
|
|
54
|
+
var n;
|
|
55
|
+
const l = ue(e);
|
|
56
|
+
return (n = l == null ? void 0 : l.$el) != null ? n : l;
|
|
57
|
+
}
|
|
58
|
+
const ce = ie ? window : void 0;
|
|
59
|
+
function J(...e) {
|
|
60
|
+
let n, l, s, t;
|
|
61
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([l, s, t] = e, n = ce) : [n, l, s, t] = e, !n)
|
|
62
|
+
return Q;
|
|
63
|
+
Array.isArray(l) || (l = [l]), Array.isArray(s) || (s = [s]);
|
|
64
|
+
const o = [], r = () => {
|
|
65
|
+
o.forEach((h) => h()), o.length = 0;
|
|
66
|
+
}, a = (h, m, f, p) => (h.addEventListener(m, f, p), () => h.removeEventListener(m, f, p)), v = E(
|
|
67
|
+
() => [W(n), ue(t)],
|
|
68
|
+
([h, m]) => {
|
|
69
|
+
if (r(), !h)
|
|
70
|
+
return;
|
|
71
|
+
const f = Ve(m) ? { ...m } : m;
|
|
72
|
+
o.push(
|
|
73
|
+
...l.flatMap((p) => s.map((k) => a(h, p, k, f)))
|
|
74
|
+
);
|
|
75
|
+
},
|
|
76
|
+
{ immediate: !0, flush: "post" }
|
|
77
|
+
), i = () => {
|
|
78
|
+
v(), r();
|
|
79
|
+
};
|
|
80
|
+
return De(i), i;
|
|
81
|
+
}
|
|
82
|
+
let se = !1;
|
|
83
|
+
function de(e, n, l = {}) {
|
|
84
|
+
const { window: s = ce, ignore: t = [], capture: o = !0, detectIframe: r = !1 } = l;
|
|
85
|
+
if (!s)
|
|
86
|
+
return;
|
|
87
|
+
Pe && !se && (se = !0, Array.from(s.document.body.children).forEach((f) => f.addEventListener("click", Q)), s.document.documentElement.addEventListener("click", Q));
|
|
88
|
+
let a = !0;
|
|
89
|
+
const v = (f) => t.some((p) => {
|
|
90
|
+
if (typeof p == "string")
|
|
91
|
+
return Array.from(s.document.querySelectorAll(p)).some((k) => k === f.target || f.composedPath().includes(k));
|
|
92
|
+
{
|
|
93
|
+
const k = W(p);
|
|
94
|
+
return k && (f.target === k || f.composedPath().includes(k));
|
|
95
|
+
}
|
|
96
|
+
}), h = [
|
|
97
|
+
J(s, "click", (f) => {
|
|
98
|
+
const p = W(e);
|
|
99
|
+
if (!(!p || p === f.target || f.composedPath().includes(p))) {
|
|
100
|
+
if (f.detail === 0 && (a = !v(f)), !a) {
|
|
101
|
+
a = !0;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
n(f);
|
|
105
|
+
}
|
|
106
|
+
}, { passive: !0, capture: o }),
|
|
107
|
+
J(s, "pointerdown", (f) => {
|
|
108
|
+
const p = W(e);
|
|
109
|
+
p && (a = !f.composedPath().includes(p) && !v(f));
|
|
110
|
+
}, { passive: !0 }),
|
|
111
|
+
r && J(s, "blur", (f) => {
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
var p;
|
|
114
|
+
const k = W(e);
|
|
115
|
+
((p = s.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(k != null && k.contains(s.document.activeElement)) && n(f);
|
|
116
|
+
}, 0);
|
|
36
117
|
})
|
|
37
|
-
]);
|
|
118
|
+
].filter(Boolean);
|
|
119
|
+
return () => h.forEach((f) => f());
|
|
38
120
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
121
|
+
const Le = ["value", "onKeydown"], Ie = { class: "absolute right-0 pr-3 flex items-center inset-y-0 text-vxvue-700" }, Te = {
|
|
122
|
+
key: 0,
|
|
123
|
+
class: "animate-spin w-5 h-5",
|
|
124
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
125
|
+
fill: "none",
|
|
126
|
+
viewBox: "0 0 24 24"
|
|
127
|
+
}, Oe = /* @__PURE__ */ c("circle", {
|
|
128
|
+
class: "opacity-25",
|
|
129
|
+
cx: "12",
|
|
130
|
+
cy: "12",
|
|
131
|
+
r: "10",
|
|
132
|
+
stroke: "currentColor",
|
|
133
|
+
"stroke-width": "4"
|
|
134
|
+
}, null, -1), je = /* @__PURE__ */ c("path", {
|
|
135
|
+
class: "opacity-75",
|
|
136
|
+
fill: "currentColor",
|
|
137
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
138
|
+
}, null, -1), Ye = [
|
|
139
|
+
Oe,
|
|
140
|
+
je
|
|
141
|
+
], al = {
|
|
142
|
+
__name: "autocomplete",
|
|
143
|
+
props: {
|
|
144
|
+
modelValue: { type: String, default: "" },
|
|
145
|
+
search: { type: Function, required: !0 },
|
|
146
|
+
baseClass: { type: String, default: "vxvue-autocomplete" },
|
|
147
|
+
resultListClass: { type: String, default: "result-list" },
|
|
148
|
+
resultItemClass: { type: String, default: "result-list-item" },
|
|
149
|
+
inputClass: { type: String, default: "autocomplete-input" },
|
|
150
|
+
autoSelect: { type: Boolean, default: !1 },
|
|
151
|
+
getResultValue: { type: Function, default: (e) => e }
|
|
152
|
+
},
|
|
153
|
+
emits: ["update:modelValue", "blur", "submit"],
|
|
154
|
+
setup(e, { emit: n }) {
|
|
155
|
+
const l = e, s = q(), o = (() => {
|
|
156
|
+
let b = 0;
|
|
157
|
+
return (w) => (w || "") + ++b;
|
|
158
|
+
})()((s.id || "autocomplete") + "-"), r = g([]), a = g(-1), v = g(0), i = g(!1), h = g(!1), m = g("top-0 translate-y-12"), f = g(!0), p = g(null), k = g(null), Y = g(null), L = C(
|
|
159
|
+
() => r.value.map((b, w) => ({
|
|
160
|
+
id: (s.id || "autocomplete") + "-item-" + w,
|
|
161
|
+
class: ["autocomplete-item", l.resultItemClass, { "bg-vxvue-700 text-white": a.value === w }],
|
|
162
|
+
"data-result-index": w,
|
|
163
|
+
role: "option",
|
|
164
|
+
...a.value === w ? { "aria-selected": "true" } : {}
|
|
165
|
+
}))
|
|
166
|
+
), z = C(() => ({
|
|
167
|
+
role: "combobox",
|
|
168
|
+
autocomplete: "off",
|
|
169
|
+
autocapitalize: "off",
|
|
170
|
+
autocorrect: "off",
|
|
171
|
+
spellcheck: "false",
|
|
172
|
+
"aria-autocomplete": "list",
|
|
173
|
+
"aria-haspopup": "listbox",
|
|
174
|
+
"aria-owns": o,
|
|
175
|
+
"aria-expanded": i.value ? "true" : "false",
|
|
176
|
+
"aria-activedescendant": a.value > -1 ? L.value[a.value].id : "",
|
|
177
|
+
...s
|
|
178
|
+
})), x = C(() => ({
|
|
179
|
+
id: o,
|
|
180
|
+
class: ["autocomplete-list absolute min-w-full transform z-10", l.resultListClass, m.value],
|
|
181
|
+
role: "listbox"
|
|
182
|
+
})), S = () => {
|
|
183
|
+
a.value = -1, r.value = [], i.value = !1, f.value = !0;
|
|
184
|
+
}, y = (b) => {
|
|
185
|
+
const w = l.search(b);
|
|
186
|
+
if (w instanceof Promise) {
|
|
187
|
+
const T = ++v.value;
|
|
188
|
+
h.value = !0, w.then((F) => {
|
|
189
|
+
T === v.value && (r.value = F, h.value = !1, r.value.length ? (a.value = l.autoSelect ? 0 : -1, i.value = !0) : S());
|
|
190
|
+
});
|
|
191
|
+
} else
|
|
192
|
+
r.value = w, r.value.length === 0 ? S() : (a.value = l.autoSelect ? 0 : -1, i.value = !0);
|
|
193
|
+
}, I = () => {
|
|
194
|
+
const b = r.value[a.value];
|
|
195
|
+
return b && n("update:modelValue", l.getResultValue(b)), S(), b;
|
|
196
|
+
}, X = (b) => {
|
|
197
|
+
n("update:modelValue", b), y(b);
|
|
198
|
+
}, K = (b) => y(b.target.value), H = () => {
|
|
199
|
+
S(), n("blur");
|
|
200
|
+
}, Z = () => {
|
|
201
|
+
const b = r.value.length;
|
|
202
|
+
a.value = ((a.value - 1) % b + b) % b;
|
|
203
|
+
}, he = (b) => {
|
|
204
|
+
i.value || K(b);
|
|
205
|
+
const w = r.value.length;
|
|
206
|
+
a.value = ((a.value + 1) % w + w) % w;
|
|
207
|
+
}, me = () => {
|
|
208
|
+
S(), n("update:modelValue", "");
|
|
209
|
+
}, ge = () => n("submit", I()), be = (b) => {
|
|
210
|
+
const w = b.target.closest("[data-result-index]");
|
|
211
|
+
w && (a.value = parseInt(w.dataset.resultIndex, 10), n("submit", I()));
|
|
212
|
+
};
|
|
213
|
+
return de(Y, S), ye(() => {
|
|
214
|
+
if (p.value) {
|
|
215
|
+
const b = k.value.getBoundingClientRect(), w = p.value.getBoundingClientRect();
|
|
216
|
+
f.value && r.value.length && (f.value = !1, m.value = b.bottom + w.height > window.innerHeight && window.innerHeight - b.bottom < b.top && window.pageYOffset + b.top - w.height > 0 ? "bottom-0 -translate-y-12" : "top-0 translate-y-12");
|
|
217
|
+
const T = p.value.querySelector('[data-result-index="' + a.value + '"]');
|
|
218
|
+
if (T) {
|
|
219
|
+
let F = T.getBoundingClientRect();
|
|
220
|
+
F.top < w.top ? p.value.scrollTop -= w.top - F.top : F.bottom > w.bottom && (p.value.scrollTop += F.bottom - w.bottom);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}), (b, w) => (u(), d("div", {
|
|
224
|
+
class: _(["relative inline-block", b.$attrs.class]),
|
|
225
|
+
ref_key: "container",
|
|
226
|
+
ref: Y
|
|
50
227
|
}, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
228
|
+
c("input", O({
|
|
229
|
+
ref_key: "input",
|
|
230
|
+
ref: k,
|
|
231
|
+
class: "form-input w-full block focus:border-vxvue pr-10",
|
|
232
|
+
value: e.modelValue
|
|
233
|
+
}, z.value, {
|
|
234
|
+
onInput: w[0] || (w[0] = (T) => X(T.target.value)),
|
|
235
|
+
onKeydown: [
|
|
236
|
+
U(ge, ["enter"]),
|
|
237
|
+
U(me, ["esc"]),
|
|
238
|
+
U(I, ["tab"]),
|
|
239
|
+
U(V(Z, ["prevent"]), ["up"]),
|
|
240
|
+
U(V(he, ["prevent"]), ["down"])
|
|
241
|
+
],
|
|
242
|
+
onFocus: K,
|
|
243
|
+
onBlur: H
|
|
244
|
+
}), null, 16, Le),
|
|
245
|
+
c("span", Ie, [
|
|
246
|
+
h.value ? (u(), d("svg", Te, Ye)) : D("", !0)
|
|
67
247
|
]),
|
|
68
|
-
|
|
248
|
+
r.value.length ? (u(), d("ul", O({
|
|
249
|
+
key: 0,
|
|
250
|
+
ref_key: "resultList",
|
|
251
|
+
ref: p
|
|
252
|
+
}, x.value, {
|
|
253
|
+
onClick: be,
|
|
254
|
+
onMousedown: w[1] || (w[1] = V(() => {
|
|
255
|
+
}, ["prevent"]))
|
|
256
|
+
}), [
|
|
257
|
+
(u(!0), d(P, null, B(r.value, (T, F) => A(b.$slots, "result", {
|
|
258
|
+
result: T,
|
|
259
|
+
props: L.value[F]
|
|
260
|
+
}, () => [
|
|
261
|
+
(u(), d("li", O({
|
|
262
|
+
key: L.value[F].id
|
|
263
|
+
}, L.value[F]), $(e.getResultValue(T)), 17))
|
|
264
|
+
])), 256))
|
|
265
|
+
], 16)) : D("", !0)
|
|
69
266
|
], 2));
|
|
70
267
|
}
|
|
71
|
-
}
|
|
72
|
-
key: 0,
|
|
73
|
-
disabled: "",
|
|
74
|
-
value: ""
|
|
75
|
-
}, U = ["value", "selected"], G = {
|
|
76
|
-
__name: "form-select",
|
|
77
|
-
props: { options: Array, modelValue: [String, Number], disabledLabel: String },
|
|
78
|
-
emits: ["update:modelValue"],
|
|
79
|
-
setup(t, { emit: i }) {
|
|
80
|
-
return (s, l) => (a(), o("select", N(s.$attrs, {
|
|
81
|
-
value: t.modelValue,
|
|
82
|
-
class: "form-select",
|
|
83
|
-
onChange: l[0] || (l[0] = (e) => i("update:modelValue", e.target.value))
|
|
84
|
-
}), [
|
|
85
|
-
t.disabledLabel ? (a(), o("option", R, h(t.disabledLabel), 1)) : y("", !0),
|
|
86
|
-
(a(!0), o(b, null, k(t.options, (e) => (a(), o("option", {
|
|
87
|
-
value: e.key !== void 0 ? e.key : e.label || e,
|
|
88
|
-
selected: (e.key !== void 0 ? e.key : e.label || e) === t.modelValue
|
|
89
|
-
}, h(e.label || e), 9, U))), 256))
|
|
90
|
-
], 16, q));
|
|
91
|
-
}
|
|
92
|
-
}, H = {
|
|
268
|
+
}, Ee = {
|
|
93
269
|
key: 0,
|
|
94
270
|
class: "fixed inset-0 z-50 bg-black bg-opacity-50 backdrop-blur-sm",
|
|
95
271
|
"aria-hidden": "true"
|
|
96
|
-
},
|
|
272
|
+
}, Ne = {
|
|
97
273
|
key: 0,
|
|
98
274
|
class: "overflow-y-auto fixed inset-0 z-50"
|
|
99
|
-
},
|
|
275
|
+
}, ze = { class: "flex justify-center items-end px-4 pt-4 pb-20 min-h-screen text-center sm:block sm:p-0" }, Re = { key: 0 }, He = /* @__PURE__ */ c("span", {
|
|
100
276
|
class: "hidden sm:inline-block sm:h-screen sm:align-middle",
|
|
101
277
|
"aria-hidden": "true"
|
|
102
|
-
}, "", -1),
|
|
278
|
+
}, "", -1), Ue = { class: "inline-block overflow-hidden text-left align-bottom bg-white rounded shadow-xl transition-all transform sm:my-8 sm:w-full sm:max-w-sm sm:align-middle lg:max-w-lg" }, We = { class: "px-4 pb-4 mt-4 sm:px-6 sm:pb-6 sm:mt-5" }, qe = { class: "flex flex-row items-center" }, Ke = { class: "flex-shrink-0" }, Ge = { class: "flex-grow text-center" }, Xe = ["onClick"], nl = {
|
|
103
279
|
__name: "confirm",
|
|
104
280
|
props: {
|
|
105
281
|
buttons: {
|
|
106
282
|
type: [Object, Array],
|
|
107
283
|
default: { label: "Ok" },
|
|
108
|
-
validator: (
|
|
284
|
+
validator: (e) => Array.isArray(e) && e.length <= 2 && e.filter((n) => n.label !== "undefined" && n.value !== "undefined").length === e.length || e.label !== void 0 && e.value !== void 0
|
|
109
285
|
},
|
|
110
286
|
headerClass: {
|
|
111
287
|
type: String,
|
|
@@ -116,142 +292,443 @@ const E = ["value", "type"], Ee = /* @__PURE__ */ Object.assign({ inheritAttrs:
|
|
|
116
292
|
default: "button"
|
|
117
293
|
}
|
|
118
294
|
},
|
|
119
|
-
setup(
|
|
120
|
-
const
|
|
121
|
-
let
|
|
122
|
-
const
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
})) }), (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
default:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
295
|
+
setup(e, { expose: n }) {
|
|
296
|
+
const l = e, s = g(""), t = g(""), o = g(!1);
|
|
297
|
+
let r = null, a = null;
|
|
298
|
+
const v = C(() => Array.isArray(l.buttons) ? l.buttons : [l.buttons]), i = g(null);
|
|
299
|
+
return n({ open: (m, f) => (s.value = m, t.value = f, o.value = !0, ee(() => i.value.firstElementChild.focus()), new Promise((p, k) => {
|
|
300
|
+
r = p, a = k;
|
|
301
|
+
})) }), (m, f) => (u(), d(P, null, [
|
|
302
|
+
o.value ? (u(), d("div", Ee)) : D("", !0),
|
|
303
|
+
N(ae, { name: "appear" }, {
|
|
304
|
+
default: G(() => [
|
|
305
|
+
o.value ? (u(), d("div", Ne, [
|
|
306
|
+
c("div", ze, [
|
|
307
|
+
o.value ? (u(), d("div", Re, [
|
|
308
|
+
He,
|
|
309
|
+
c("div", Ue, [
|
|
310
|
+
s.value ? (u(), d("h3", {
|
|
135
311
|
key: 0,
|
|
136
|
-
class:
|
|
312
|
+
class: _(["py-4 pt-4 text-lg font-medium text-center sm:py-6", e.headerClass])
|
|
137
313
|
}, [
|
|
138
|
-
|
|
139
|
-
|
|
314
|
+
A(m.$slots, "title", { title: s.value }, () => [
|
|
315
|
+
j($(s.value), 1)
|
|
140
316
|
])
|
|
141
|
-
], 2)) :
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
317
|
+
], 2)) : D("", !0),
|
|
318
|
+
c("div", We, [
|
|
319
|
+
c("div", qe, [
|
|
320
|
+
c("div", Ke, [
|
|
321
|
+
A(m.$slots, "icon")
|
|
146
322
|
]),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
323
|
+
c("p", Ge, [
|
|
324
|
+
A(m.$slots, "default", { message: t.value }, () => [
|
|
325
|
+
j($(t.value), 1)
|
|
150
326
|
])
|
|
151
327
|
])
|
|
152
328
|
]),
|
|
153
|
-
|
|
329
|
+
c("div", {
|
|
154
330
|
class: "flex justify-center mt-5 space-x-2 sm:mt-6",
|
|
155
331
|
ref_key: "buttonsContainer",
|
|
156
|
-
ref:
|
|
332
|
+
ref: i
|
|
157
333
|
}, [
|
|
158
|
-
(
|
|
159
|
-
class:
|
|
160
|
-
onClick:
|
|
161
|
-
|
|
334
|
+
(u(!0), d(P, null, B(v.value, (p, k) => (u(), d("button", {
|
|
335
|
+
class: _([e.buttonClass, p.class]),
|
|
336
|
+
onClick: V((Y) => {
|
|
337
|
+
o.value = !1, k === 0 ? M(r)() : M(a)();
|
|
162
338
|
}, ["prevent"])
|
|
163
|
-
},
|
|
339
|
+
}, $(p.label), 11, Xe))), 256))
|
|
164
340
|
], 512)
|
|
165
341
|
])
|
|
166
342
|
])
|
|
167
|
-
])) :
|
|
343
|
+
])) : D("", !0)
|
|
168
344
|
])
|
|
169
|
-
])) :
|
|
345
|
+
])) : D("", !0)
|
|
170
346
|
]),
|
|
171
347
|
_: 3
|
|
172
348
|
})
|
|
173
349
|
], 64));
|
|
174
350
|
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
351
|
+
};
|
|
352
|
+
function Ze(e, n) {
|
|
353
|
+
const l = g(!1), s = te(n);
|
|
354
|
+
let t, o = s.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = [];
|
|
355
|
+
if ((t = s.match(/\bd\b/gi)) && t.length === 1)
|
|
356
|
+
o = o.replace("d", "(\\d{1,2})");
|
|
357
|
+
else if ((t = s.match(/\bdd\b/gi)) && t.length === 1)
|
|
358
|
+
o = o.replace("dd", "(\\d{2})");
|
|
359
|
+
else
|
|
360
|
+
return { date: l };
|
|
361
|
+
if (r.push({ srcPos: s.toLowerCase().indexOf("d"), destPos: 2 }), (t = s.match(/\bm\b/gi)) && t.length === 1)
|
|
362
|
+
o = o.replace("m", "(\\d{1,2})");
|
|
363
|
+
else if ((t = s.match(/\bmm\b/gi)) && t.length === 1)
|
|
364
|
+
o = o.replace("mm", "(\\d{2})");
|
|
365
|
+
else
|
|
366
|
+
return { date: l };
|
|
367
|
+
if (r.push({ srcPos: s.toLowerCase().indexOf("m"), destPos: 1 }), (t = s.match(/\byyyy\b/gi)) && t.length === 1)
|
|
368
|
+
o = o.replace("yyyy", "(\\d{4})");
|
|
369
|
+
else
|
|
370
|
+
return { date: l };
|
|
371
|
+
if (r.push({ srcPos: s.toLowerCase().indexOf("y"), destPos: 0 }), !(t = te(e).match(o)))
|
|
372
|
+
return { date: l };
|
|
373
|
+
t.shift(), r.sort((h, m) => h.srcPos < m.srcPos ? -1 : 1);
|
|
374
|
+
let a = [], v, i;
|
|
375
|
+
for (; v = t.shift(); )
|
|
376
|
+
i = r.shift(), a[i.destPos] = v;
|
|
377
|
+
return a = Date.parse(a.join("-")), a && (a = new Date(a), l.value = new Date(a.getFullYear(), a.getMonth(), a.getDate(), 0, 0, 0)), { date: l };
|
|
378
|
+
}
|
|
379
|
+
const Je = { key: 0 }, Qe = { class: "text-vxvue-700" }, et = /* @__PURE__ */ c("svg", {
|
|
380
|
+
class: "w-2 h-2",
|
|
381
|
+
stroke: "currentColor",
|
|
382
|
+
fill: "none",
|
|
383
|
+
viewBox: "0 0 8 8"
|
|
384
|
+
}, [
|
|
385
|
+
/* @__PURE__ */ c("path", {
|
|
386
|
+
"stroke-linecap": "round",
|
|
387
|
+
"stroke-width": "1.5",
|
|
388
|
+
d: "M1 1l6 6m0-6L1 7"
|
|
389
|
+
})
|
|
390
|
+
], -1), tt = [
|
|
391
|
+
et
|
|
392
|
+
], lt = /* @__PURE__ */ c("svg", {
|
|
393
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
394
|
+
class: "w-6 h-6",
|
|
395
|
+
fill: "none",
|
|
396
|
+
viewBox: "0 0 24 24",
|
|
397
|
+
stroke: "currentColor"
|
|
398
|
+
}, [
|
|
399
|
+
/* @__PURE__ */ c("path", {
|
|
400
|
+
"stroke-linecap": "round",
|
|
401
|
+
"stroke-linejoin": "round",
|
|
402
|
+
"stroke-width": "2",
|
|
403
|
+
d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
|
|
404
|
+
})
|
|
405
|
+
], -1), st = [
|
|
406
|
+
lt
|
|
407
|
+
], at = {
|
|
408
|
+
__name: "date-input",
|
|
409
|
+
props: {
|
|
410
|
+
outputFormat: { type: String, default: "YYYY-MM-DD" },
|
|
411
|
+
inputFormat: { type: String, default: "YYYY-MM-DD" },
|
|
412
|
+
showButton: { type: Boolean, default: !0 },
|
|
413
|
+
locale: { type: String, default: "default" },
|
|
414
|
+
modelValue: Date
|
|
415
|
+
},
|
|
416
|
+
emits: ["update:modelValue", "toggle-datepicker"],
|
|
417
|
+
setup(e, { emit: n }) {
|
|
418
|
+
const l = e, s = g(""), t = C(() => l.modelValue ? le(l.modelValue, l.outputFormat) : ""), o = C(() => {
|
|
419
|
+
let r = Object.assign({}, q());
|
|
420
|
+
return delete r.class, r;
|
|
183
421
|
});
|
|
184
|
-
return (
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
class:
|
|
190
|
-
role: "switch",
|
|
191
|
-
"aria-checked": !!t.modelValue
|
|
422
|
+
return E(() => l.modelValue, (r) => s.value = r ? le(r, l.outputFormat) : ""), (r, a) => (u(), d("div", {
|
|
423
|
+
class: _(["inline-block relative", r.$attrs.class])
|
|
424
|
+
}, [
|
|
425
|
+
t.value ? (u(), d("div", Je, [
|
|
426
|
+
c("div", {
|
|
427
|
+
class: _(["block flex items-center w-full form-input bg-vxvue-50", { "pr-10": e.showButton }])
|
|
192
428
|
}, [
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
]
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
429
|
+
c("span", Qe, $(t.value), 1),
|
|
430
|
+
c("button", {
|
|
431
|
+
onClick: a[0] || (a[0] = (v) => n("update:modelValue", null)),
|
|
432
|
+
class: "inline-flex flex-shrink-0 justify-center items-center ml-2 w-4 h-4 rounded-full focus:text-white focus:outline-none text-vxvue hover:bg-vxvue-100 hover:text-vue-700 focus:bg-vxvue-700"
|
|
433
|
+
}, tt)
|
|
434
|
+
], 2)
|
|
435
|
+
])) : ne((u(), d("input", O({
|
|
436
|
+
key: 1,
|
|
437
|
+
type: "text",
|
|
438
|
+
class: ["block w-full form-input focus:border-vxvue peer", { "pr-10": e.showButton }],
|
|
439
|
+
"onUpdate:modelValue": a[1] || (a[1] = (v) => s.value = v),
|
|
440
|
+
onBlur: a[2] || (a[2] = (v) => {
|
|
441
|
+
var i;
|
|
442
|
+
return n("update:modelValue", ((i = M(Ze)(s.value, l.inputFormat).date) == null ? void 0 : i.value) || null);
|
|
443
|
+
}),
|
|
444
|
+
onInput: a[3] || (a[3] = V(() => {
|
|
445
|
+
}, ["prevent"]))
|
|
446
|
+
}, o.value), null, 16)), [
|
|
447
|
+
[ke, s.value]
|
|
448
|
+
]),
|
|
449
|
+
e.showButton ? (u(), d("button", {
|
|
450
|
+
key: 2,
|
|
451
|
+
class: "flex absolute inset-y-0 right-0 items-center px-2 text-vxvue-700 hover:text-vxvue",
|
|
452
|
+
onClick: a[4] || (a[4] = V((v) => n("toggle-datepicker"), ["stop"]))
|
|
453
|
+
}, st)) : D("", !0),
|
|
454
|
+
A(r.$slots, "default")
|
|
455
|
+
], 2));
|
|
207
456
|
}
|
|
208
457
|
};
|
|
209
|
-
function
|
|
210
|
-
return
|
|
458
|
+
function ve(e, n) {
|
|
459
|
+
return u(), d("svg", {
|
|
211
460
|
xmlns: "http://www.w3.org/2000/svg",
|
|
212
461
|
viewBox: "0 0 24 24",
|
|
213
462
|
fill: "currentColor",
|
|
214
463
|
"aria-hidden": "true"
|
|
215
464
|
}, [
|
|
216
|
-
|
|
465
|
+
c("path", {
|
|
217
466
|
"fill-rule": "evenodd",
|
|
218
467
|
d: "M7.72 12.53a.75.75 0 010-1.06l7.5-7.5a.75.75 0 111.06 1.06L9.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5z",
|
|
219
468
|
"clip-rule": "evenodd"
|
|
220
469
|
})
|
|
221
470
|
]);
|
|
222
471
|
}
|
|
223
|
-
function
|
|
224
|
-
return
|
|
472
|
+
function fe(e, n) {
|
|
473
|
+
return u(), d("svg", {
|
|
225
474
|
xmlns: "http://www.w3.org/2000/svg",
|
|
226
475
|
viewBox: "0 0 24 24",
|
|
227
476
|
fill: "currentColor",
|
|
228
477
|
"aria-hidden": "true"
|
|
229
478
|
}, [
|
|
230
|
-
|
|
479
|
+
c("path", {
|
|
231
480
|
"fill-rule": "evenodd",
|
|
232
481
|
d: "M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",
|
|
233
482
|
"clip-rule": "evenodd"
|
|
234
483
|
})
|
|
235
484
|
]);
|
|
236
485
|
}
|
|
237
|
-
function
|
|
238
|
-
return
|
|
486
|
+
function nt(e, n) {
|
|
487
|
+
return u(), d("svg", {
|
|
488
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
489
|
+
viewBox: "0 0 24 24",
|
|
490
|
+
fill: "currentColor",
|
|
491
|
+
"aria-hidden": "true"
|
|
492
|
+
}, [
|
|
493
|
+
c("path", {
|
|
494
|
+
"fill-rule": "evenodd",
|
|
495
|
+
d: "M3.75 12a.75.75 0 01.75-.75h15a.75.75 0 010 1.5h-15a.75.75 0 01-.75-.75z",
|
|
496
|
+
"clip-rule": "evenodd"
|
|
497
|
+
})
|
|
498
|
+
]);
|
|
499
|
+
}
|
|
500
|
+
function ot(e, n) {
|
|
501
|
+
return u(), d("svg", {
|
|
239
502
|
xmlns: "http://www.w3.org/2000/svg",
|
|
240
503
|
viewBox: "0 0 24 24",
|
|
241
504
|
fill: "currentColor",
|
|
242
505
|
"aria-hidden": "true"
|
|
243
506
|
}, [
|
|
244
|
-
|
|
507
|
+
c("path", {
|
|
508
|
+
"fill-rule": "evenodd",
|
|
509
|
+
d: "M12 3.75a.75.75 0 01.75.75v6.75h6.75a.75.75 0 010 1.5h-6.75v6.75a.75.75 0 01-1.5 0v-6.75H4.5a.75.75 0 010-1.5h6.75V4.5a.75.75 0 01.75-.75z",
|
|
510
|
+
"clip-rule": "evenodd"
|
|
511
|
+
})
|
|
512
|
+
]);
|
|
513
|
+
}
|
|
514
|
+
function rt(e, n) {
|
|
515
|
+
return u(), d("svg", {
|
|
516
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
517
|
+
viewBox: "0 0 24 24",
|
|
518
|
+
fill: "currentColor",
|
|
519
|
+
"aria-hidden": "true"
|
|
520
|
+
}, [
|
|
521
|
+
c("path", {
|
|
245
522
|
"fill-rule": "evenodd",
|
|
246
523
|
d: "M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z",
|
|
247
524
|
"clip-rule": "evenodd"
|
|
248
525
|
})
|
|
249
526
|
]);
|
|
250
527
|
}
|
|
251
|
-
const
|
|
528
|
+
const ut = { class: "flex flex-row items-center py-2 px-3 text-white bg-vxvue-700" }, it = ["onClick"], ct = { class: "flex-grow text-center" }, dt = ["onClick"], vt = { class: "grid grid-cols-7 gap-0.5 p-0.5" }, ft = ["disabled", "onClick"], ol = {
|
|
529
|
+
__name: "datepicker",
|
|
530
|
+
props: {
|
|
531
|
+
modelValue: [Date, Boolean],
|
|
532
|
+
validFrom: Date,
|
|
533
|
+
validUntil: Date,
|
|
534
|
+
dayNames: { type: Array, default: () => "S M T W T F S".split(" ") },
|
|
535
|
+
locale: { type: String, default: "default" },
|
|
536
|
+
startOfWeekIndex: { type: Number, default: 0, validator: (e) => e === 0 || e === 1 },
|
|
537
|
+
hasInput: { type: Boolean, default: !0 }
|
|
538
|
+
},
|
|
539
|
+
emits: ["update:modelValue", "month-change"],
|
|
540
|
+
setup(e, { emit: n }) {
|
|
541
|
+
const l = e, s = (() => {
|
|
542
|
+
let x = /* @__PURE__ */ new Date();
|
|
543
|
+
return new Date(x.getFullYear(), x.getMonth(), x.getDate());
|
|
544
|
+
})(), t = g(new Date(s.getFullYear(), s.getMonth(), 1)), o = g(null), r = g(!l.hasInput), a = g("left-0"), v = g("top-0"), i = g(null), h = g(null), m = C(() => l.hasInput ? { class: ["absolute", r.value ? "block" : "hidden"] } : {}), f = C(() => {
|
|
545
|
+
const x = [], S = t.value.getFullYear(), y = t.value.getMonth(), I = new Date(S, y + 1, 0), X = new Date(S, y, 0).getDay() + 1 - l.startOfWeekIndex, K = (6 + l.startOfWeekIndex - I.getDay()) % 7;
|
|
546
|
+
for (let H = -X, Z = I.getDate() + K; H < Z; ++H)
|
|
547
|
+
x.push(new Date(S, y, H + 1));
|
|
548
|
+
return x;
|
|
549
|
+
}), p = C(() => l.startOfWeekIndex ? l.dayNames.slice(1).concat(l.dayNames[0]) : l.dayNames.slice());
|
|
550
|
+
E(() => l.modelValue, (x) => {
|
|
551
|
+
x ? (o.value = new Date(x.getFullYear(), x.getMonth(), x.getDate()), t.value = new Date(o.value.getTime())) : (o.value = null, t.value = new Date(s.getTime())), t.value.setDate(1);
|
|
552
|
+
}, { immediate: !0 }), E(r, (x) => {
|
|
553
|
+
x && l.hasInput && ee(() => {
|
|
554
|
+
const S = i.value.$el.getBoundingClientRect(), y = h.value.getBoundingClientRect();
|
|
555
|
+
a.value = S.left + y.width > window.innerWidth ? "right-0" : "left-0", v.value = S.bottom + y.height > window.innerHeight ? "bottom-0 -translate-y-12" : "top-0 translate-y-12";
|
|
556
|
+
});
|
|
557
|
+
}), de(h, () => r.value = !1);
|
|
558
|
+
const k = () => {
|
|
559
|
+
t.value = new Date(t.value.getFullYear(), t.value.getMonth() - 1, 1), n("month-change", t.value);
|
|
560
|
+
}, Y = () => {
|
|
561
|
+
t.value = new Date(t.value.getFullYear(), t.value.getMonth() + 1, 1), n("month-change", t.value);
|
|
562
|
+
}, L = (x) => {
|
|
563
|
+
o.value = x, n("update:modelValue", x), r.value = !l.hasInput;
|
|
564
|
+
}, z = (x) => {
|
|
565
|
+
o.value = x, n("update:modelValue", x);
|
|
566
|
+
};
|
|
567
|
+
return (x, S) => (u(), d("div", {
|
|
568
|
+
class: _(["relative", x.$attrs.class])
|
|
569
|
+
}, [
|
|
570
|
+
e.hasInput ? (u(), R(at, O({
|
|
571
|
+
key: 0,
|
|
572
|
+
modelValue: o.value,
|
|
573
|
+
onToggleDatepicker: S[0] || (S[0] = (y) => r.value = !0),
|
|
574
|
+
"onUpdate:modelValue": z
|
|
575
|
+
}, x.$attrs, {
|
|
576
|
+
ref_key: "input",
|
|
577
|
+
ref: i,
|
|
578
|
+
class: "w-full",
|
|
579
|
+
locale: e.locale
|
|
580
|
+
}), {
|
|
581
|
+
default: G(() => [
|
|
582
|
+
A(x.$slots, "default")
|
|
583
|
+
]),
|
|
584
|
+
_: 3
|
|
585
|
+
}, 16, ["modelValue", "locale"])) : D("", !0),
|
|
586
|
+
c("div", O({ class: "z-10 bg-white shadow-md" }, m.value, {
|
|
587
|
+
ref_key: "calendar",
|
|
588
|
+
ref: h,
|
|
589
|
+
class: [a.value, v.value]
|
|
590
|
+
}), [
|
|
591
|
+
c("div", ut, [
|
|
592
|
+
c("button", {
|
|
593
|
+
onClick: V(k, ["stop"]),
|
|
594
|
+
class: "flex-shrink-0 text-vxvue-100 hover:text-vxvue-50"
|
|
595
|
+
}, [
|
|
596
|
+
N(M(ve), { class: "w-6 h-6" })
|
|
597
|
+
], 8, it),
|
|
598
|
+
c("div", ct, $(t.value.toLocaleString(e.locale, { month: "long" })) + " " + $(t.value.getFullYear()), 1),
|
|
599
|
+
c("button", {
|
|
600
|
+
onClick: V(Y, ["stop"]),
|
|
601
|
+
class: "flex-shrink-0 text-vxvue-100 hover:text-vxvue-50"
|
|
602
|
+
}, [
|
|
603
|
+
N(M(fe), { class: "w-6 h-6" })
|
|
604
|
+
], 8, dt)
|
|
605
|
+
]),
|
|
606
|
+
c("div", vt, [
|
|
607
|
+
(u(!0), d(P, null, B(p.value, (y, I) => (u(), d("div", {
|
|
608
|
+
class: "py-2 text-center bg-gray-200",
|
|
609
|
+
key: I
|
|
610
|
+
}, $(y), 1))), 128)),
|
|
611
|
+
(u(!0), d(P, null, B(f.value, (y) => (u(), d("div", {
|
|
612
|
+
class: _(["text-center", y.getMonth() - t.value.getMonth() === 0 ? "text-vxvue-700" : "text-gray-400"])
|
|
613
|
+
}, [
|
|
614
|
+
c("button", {
|
|
615
|
+
class: _([
|
|
616
|
+
{
|
|
617
|
+
"bg-vxvue-700 text-white": o.value && y.getTime() === o.value.getTime(),
|
|
618
|
+
"bg-gray-200": y.getTime() === M(s).getTime(),
|
|
619
|
+
"text-red-400": e.validFrom && e.validFrom > y || e.validUntil && e.validUntil < y
|
|
620
|
+
},
|
|
621
|
+
"py-2 px-3 rounded-sm"
|
|
622
|
+
]),
|
|
623
|
+
disabled: e.validFrom && e.validFrom > y || e.validUntil && e.validUntil < y,
|
|
624
|
+
onClick: V((I) => e.validFrom && e.validFrom > y || e.validUntil && e.validUntil < y ? null : L(y), ["stop"])
|
|
625
|
+
}, $(y.getDate()), 11, ft)
|
|
626
|
+
], 2))), 256))
|
|
627
|
+
])
|
|
628
|
+
], 16)
|
|
629
|
+
], 2));
|
|
630
|
+
}
|
|
631
|
+
}, pt = ["for"], ht = ["id", "multiple", "accept"], rl = {
|
|
632
|
+
__name: "form-file-button",
|
|
633
|
+
props: {
|
|
634
|
+
modelValue: { type: Array },
|
|
635
|
+
accept: { type: String, default: "*" },
|
|
636
|
+
multiple: { type: Boolean, default: !1 },
|
|
637
|
+
name: { type: String, default: "file" },
|
|
638
|
+
id: { type: String, default: "form-file-button-" + Math.ceil(Math.random() * 1e3) }
|
|
639
|
+
},
|
|
640
|
+
emits: ["update:modelValue", "form-data"],
|
|
641
|
+
setup(e, { emit: n }) {
|
|
642
|
+
const l = e, s = (o) => {
|
|
643
|
+
const r = new FormData();
|
|
644
|
+
for (let a of o)
|
|
645
|
+
r.append(l.name, a, a.name);
|
|
646
|
+
return r;
|
|
647
|
+
}, t = (o) => {
|
|
648
|
+
const r = o.target.files || o.dataTransfer.files;
|
|
649
|
+
if (r) {
|
|
650
|
+
const a = [...r];
|
|
651
|
+
n("update:modelValue", a), n("form-data", s(a));
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
return (o, r) => (u(), d("label", { for: e.id }, [
|
|
655
|
+
A(o.$slots, "default", {}, () => [
|
|
656
|
+
j("Upload")
|
|
657
|
+
]),
|
|
658
|
+
c("input", {
|
|
659
|
+
type: "file",
|
|
660
|
+
id: e.id,
|
|
661
|
+
multiple: e.multiple,
|
|
662
|
+
accept: e.accept,
|
|
663
|
+
onChange: t,
|
|
664
|
+
class: "hidden"
|
|
665
|
+
}, null, 40, ht)
|
|
666
|
+
], 8, pt));
|
|
667
|
+
}
|
|
668
|
+
}, mt = ["value"], gt = {
|
|
669
|
+
key: 0,
|
|
670
|
+
disabled: "",
|
|
671
|
+
value: ""
|
|
672
|
+
}, bt = ["value", "selected"], ul = {
|
|
673
|
+
__name: "form-select",
|
|
674
|
+
props: { options: Array, modelValue: [String, Number], disabledLabel: String },
|
|
675
|
+
emits: ["update:modelValue"],
|
|
676
|
+
setup(e, { emit: n }) {
|
|
677
|
+
return (l, s) => (u(), d("select", O(l.$attrs, {
|
|
678
|
+
value: e.modelValue,
|
|
679
|
+
class: "form-select",
|
|
680
|
+
onChange: s[0] || (s[0] = (t) => n("update:modelValue", t.target.value))
|
|
681
|
+
}), [
|
|
682
|
+
e.disabledLabel ? (u(), d("option", gt, $(e.disabledLabel), 1)) : D("", !0),
|
|
683
|
+
(u(!0), d(P, null, B(e.options, (t) => (u(), d("option", {
|
|
684
|
+
value: t.key !== void 0 ? t.key : t.label || t,
|
|
685
|
+
selected: (t.key !== void 0 ? t.key : t.label || t) === e.modelValue
|
|
686
|
+
}, $(t.label || t), 9, bt))), 256))
|
|
687
|
+
], 16, mt));
|
|
688
|
+
}
|
|
689
|
+
}, wt = ["aria-checked"], xt = ["checked"], il = {
|
|
690
|
+
__name: "form-switch",
|
|
691
|
+
props: ["modelValue"],
|
|
692
|
+
emits: ["update:modelValue"],
|
|
693
|
+
setup(e, { emit: n }) {
|
|
694
|
+
const l = e, s = C(() => l.modelValue ? "bg-vxvue" : "bg-slate-200"), t = C(() => l.modelValue ? "translate-x-5" : "translate-x-0"), o = C(() => {
|
|
695
|
+
let r = Object.assign({}, q());
|
|
696
|
+
return delete r.class, r;
|
|
697
|
+
});
|
|
698
|
+
return (r, a) => (u(), d(P, null, [
|
|
699
|
+
c("label", {
|
|
700
|
+
class: _(r.$attrs.class)
|
|
701
|
+
}, [
|
|
702
|
+
c("span", {
|
|
703
|
+
class: _([s.value, "inline-flex relative flex-shrink-0 w-11 h-6 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out cursor-pointer focus:ring-2 focus:ring-offset-2 focus:outline-none focus:ring-vxvue"]),
|
|
704
|
+
role: "switch",
|
|
705
|
+
"aria-checked": !!e.modelValue
|
|
706
|
+
}, [
|
|
707
|
+
c("span", {
|
|
708
|
+
"aria-hidden": "true",
|
|
709
|
+
class: _([t.value, "inline-block w-5 h-5 bg-white rounded-full ring-0 shadow transition duration-200 ease-in-out transform pointer-events-none"])
|
|
710
|
+
}, null, 2),
|
|
711
|
+
c("input", O({
|
|
712
|
+
class: "hidden",
|
|
713
|
+
value: "1",
|
|
714
|
+
type: "checkbox",
|
|
715
|
+
onChange: a[0] || (a[0] = (v) => n("update:modelValue", v.target.checked))
|
|
716
|
+
}, o.value, { checked: e.modelValue }), null, 16, xt)
|
|
717
|
+
], 10, wt)
|
|
718
|
+
], 2),
|
|
719
|
+
A(r.$slots, "default")
|
|
720
|
+
], 64));
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
const pe = (e, n) => {
|
|
724
|
+
const l = e.__vccOpts || e;
|
|
725
|
+
for (const [s, t] of n)
|
|
726
|
+
l[s] = t;
|
|
727
|
+
return l;
|
|
728
|
+
}, yt = (e) => ($e("data-v-1be10676"), e = e(), _e(), e), kt = {
|
|
252
729
|
"aria-live": "assertive",
|
|
253
730
|
class: "flex fixed inset-0 z-50 items-start py-6 px-4 pointer-events-none sm:p-6"
|
|
254
|
-
},
|
|
731
|
+
}, $t = { class: "flex flex-col items-center space-y-4 w-full" }, _t = { class: "p-4" }, Ct = { class: "flex items-start" }, St = { class: "flex-shrink-0" }, Dt = { class: "flex-1 pt-0.5 ml-3 w-0" }, Mt = { class: "font-bold" }, Vt = { class: "mt-1" }, Pt = { class: "flex flex-shrink-0 ml-4" }, At = /* @__PURE__ */ yt(() => /* @__PURE__ */ c("span", { class: "sr-only" }, "Close", -1)), Bt = /* @__PURE__ */ Object.assign({
|
|
255
732
|
inheritAttrs: !1
|
|
256
733
|
}, {
|
|
257
734
|
__name: "message-toast",
|
|
@@ -262,56 +739,56 @@ const ie = {
|
|
|
262
739
|
active: { type: Boolean, default: !1 }
|
|
263
740
|
},
|
|
264
741
|
emits: ["timeout", "close"],
|
|
265
|
-
setup(
|
|
266
|
-
const
|
|
267
|
-
window.clearTimeout(
|
|
268
|
-
|
|
269
|
-
},
|
|
742
|
+
setup(e, { emit: n }) {
|
|
743
|
+
const l = e, s = g(null), t = C(() => typeof l.message == "string" ? [l.message] : l.message), o = () => {
|
|
744
|
+
window.clearTimeout(s.value), l.active && l.timeout && (s.value = window.setTimeout(() => {
|
|
745
|
+
n("timeout");
|
|
746
|
+
}, l.timeout));
|
|
270
747
|
};
|
|
271
|
-
return
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
default:
|
|
275
|
-
|
|
748
|
+
return E(() => l.active, o), oe(o), (r, a) => (u(), d("div", kt, [
|
|
749
|
+
c("div", $t, [
|
|
750
|
+
N(ae, { name: "messagetoast-fade" }, {
|
|
751
|
+
default: G(() => [
|
|
752
|
+
e.active ? (u(), d("div", {
|
|
276
753
|
key: 0,
|
|
277
|
-
class:
|
|
754
|
+
class: _(["overflow-hidden w-full max-w-sm rounded-md ring-1 ring-black ring-opacity-5 shadow-lg pointer-events-auto", r.$attrs.class])
|
|
278
755
|
}, [
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
756
|
+
c("div", _t, [
|
|
757
|
+
c("div", Ct, [
|
|
758
|
+
c("div", St, [
|
|
759
|
+
A(r.$slots, "icon", {}, void 0, !0)
|
|
283
760
|
]),
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
])
|
|
761
|
+
c("div", Dt, [
|
|
762
|
+
c("p", Mt, [
|
|
763
|
+
A(r.$slots, "title", {}, () => [
|
|
764
|
+
j($(e.title), 1)
|
|
765
|
+
], !0)
|
|
289
766
|
]),
|
|
290
|
-
(
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
])
|
|
767
|
+
(u(!0), d(P, null, B(t.value, (v) => (u(), d("p", Vt, [
|
|
768
|
+
A(r.$slots, "default", {}, () => [
|
|
769
|
+
j($(v), 1)
|
|
770
|
+
], !0)
|
|
294
771
|
]))), 256))
|
|
295
772
|
]),
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
onClick:
|
|
773
|
+
c("div", Pt, [
|
|
774
|
+
c("button", {
|
|
775
|
+
onClick: a[0] || (a[0] = (v) => n("close")),
|
|
299
776
|
class: "inline-flex text-white bg-black bg-opacity-20 rounded-sm focus:ring-2 focus:outline-none hover:text-stone-200 focus:ring-stone-200"
|
|
300
777
|
}, [
|
|
301
|
-
|
|
302
|
-
|
|
778
|
+
At,
|
|
779
|
+
N(M(rt), { class: "w-5 h-5" })
|
|
303
780
|
])
|
|
304
781
|
])
|
|
305
782
|
])
|
|
306
783
|
])
|
|
307
|
-
], 2)) :
|
|
784
|
+
], 2)) : D("", !0)
|
|
308
785
|
]),
|
|
309
786
|
_: 3
|
|
310
787
|
})
|
|
311
788
|
])
|
|
312
789
|
]));
|
|
313
790
|
}
|
|
314
|
-
}),
|
|
791
|
+
}), cl = /* @__PURE__ */ pe(Bt, [["__scopeId", "data-v-1be10676"]]), Ft = { class: "flex justify-between items-center px-4 sm:px-0" }, Lt = { class: "flex flex-1 -mt-px w-0" }, It = ["onClick"], Tt = { class: "hidden md:flex md:-mt-px" }, Ot = { class: "flex flex-1 justify-end -mt-px w-0" }, jt = ["onClick"], dl = {
|
|
315
792
|
__name: "pagination",
|
|
316
793
|
props: {
|
|
317
794
|
page: { type: Number, default: 1 },
|
|
@@ -319,8 +796,8 @@ const ie = {
|
|
|
319
796
|
perPage: {
|
|
320
797
|
type: Number,
|
|
321
798
|
default: 20,
|
|
322
|
-
validator(
|
|
323
|
-
return
|
|
799
|
+
validator(e) {
|
|
800
|
+
return e >= 1;
|
|
324
801
|
}
|
|
325
802
|
},
|
|
326
803
|
showNavButtons: { type: Boolean, default: !0 },
|
|
@@ -330,100 +807,218 @@ const ie = {
|
|
|
330
807
|
markerPosition: {
|
|
331
808
|
type: String,
|
|
332
809
|
default: "above",
|
|
333
|
-
validator(
|
|
334
|
-
return ["above", "below"].indexOf(
|
|
810
|
+
validator(e) {
|
|
811
|
+
return ["above", "below"].indexOf(e) !== -1;
|
|
335
812
|
}
|
|
336
813
|
}
|
|
337
814
|
},
|
|
338
815
|
emits: ["update:page"],
|
|
339
|
-
setup(
|
|
340
|
-
const
|
|
341
|
-
let
|
|
342
|
-
if (
|
|
343
|
-
for (let
|
|
344
|
-
|
|
345
|
-
return
|
|
816
|
+
setup(e, { emit: n }) {
|
|
817
|
+
const l = e, s = g(Math.ceil(l.total / l.perPage)), t = g(null), o = C(() => l.markerPosition === "above" ? "border-t-2 pt-4" : "border-b-2 pb-4"), r = C(() => {
|
|
818
|
+
let i = [1];
|
|
819
|
+
if (l.showAllPages || s.value <= 7) {
|
|
820
|
+
for (let h = 2; h <= s.value; ++h)
|
|
821
|
+
i.push(h);
|
|
822
|
+
return i;
|
|
346
823
|
}
|
|
347
|
-
return
|
|
348
|
-
}),
|
|
349
|
-
|
|
350
|
-
},
|
|
351
|
-
|
|
824
|
+
return t.value >= s.value ? i.push("dots", t.value - 2, t.value - 1) : t.value - 1 && t.value - 1 > 1 && (t.value > 1 && i.push("dots"), i.push(t.value - 1)), t.value > 1 && i.push(t.value), t.value + 1 < s.value && (i.push(t.value + 1), t.value <= 1 && i.push(t.value + 2), t.value + 2 < this.maxPage && i.push("dots")), t.value < this.maxPage && i.push(this.maxPage), i;
|
|
825
|
+
}), a = () => {
|
|
826
|
+
t.value > 1 && n("update:page", t.value - 1);
|
|
827
|
+
}, v = () => {
|
|
828
|
+
t.value < s.value && n("update:page", t.value + 1);
|
|
352
829
|
};
|
|
353
|
-
return
|
|
354
|
-
|
|
355
|
-
}),
|
|
356
|
-
|
|
357
|
-
}), (
|
|
358
|
-
|
|
359
|
-
|
|
830
|
+
return E(() => l.page, (i) => t.value = Math.min(Math.max(i, 1), s.value), { immediate: !0 }), E(() => l.perPage, (i) => {
|
|
831
|
+
s.value = Math.ceil(l.total / l.perPage), n("update:page", 1);
|
|
832
|
+
}), E(() => l.total, (i) => {
|
|
833
|
+
s.value = Math.ceil(l.total / l.perPage), t.value > s.value && n("update:page", 1);
|
|
834
|
+
}), (i, h) => (u(), d("nav", Ft, [
|
|
835
|
+
c("div", Lt, [
|
|
836
|
+
e.showNavButtons ? (u(), d("a", {
|
|
360
837
|
key: 0,
|
|
361
|
-
onClick:
|
|
838
|
+
onClick: V(a, ["prevent"]),
|
|
362
839
|
href: "#",
|
|
363
|
-
class:
|
|
840
|
+
class: _(["inline-flex items-center pr-1 text-sm font-medium text-gray-500 border-transparent hover:text-gray-700 hover:border-gray-300", [{ "cursor-default pointer-events-none": t.value <= 1 }, o.value]])
|
|
364
841
|
}, [
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
], 10,
|
|
842
|
+
N(M(ve), { class: "w-5 h-5" }),
|
|
843
|
+
j(" " + $(e.prevText), 1)
|
|
844
|
+
], 10, It)) : D("", !0)
|
|
368
845
|
]),
|
|
369
|
-
|
|
370
|
-
(
|
|
371
|
-
onClick:
|
|
372
|
-
key:
|
|
373
|
-
href:
|
|
374
|
-
class:
|
|
375
|
-
"border-vxvue-500 text-vxvue-700":
|
|
376
|
-
"border-transparent text-gray-500":
|
|
377
|
-
"hover:text-gray-700 hover:border-gray-300":
|
|
378
|
-
},
|
|
846
|
+
c("div", Tt, [
|
|
847
|
+
(u(!0), d(P, null, B(r.value, (m, f) => (u(), R(re(m !== "dots" ? "a" : "span"), {
|
|
848
|
+
onClick: V((p) => m !== "dots" ? n("update:page", m) : null, ["prevent"]),
|
|
849
|
+
key: f,
|
|
850
|
+
href: m !== "dots" ? "#" : null,
|
|
851
|
+
class: _(["inline-flex items-center px-4 text-sm font-medium", [{
|
|
852
|
+
"border-vxvue-500 text-vxvue-700": m === t.value,
|
|
853
|
+
"border-transparent text-gray-500": m !== t.value,
|
|
854
|
+
"hover:text-gray-700 hover:border-gray-300": m !== "dots"
|
|
855
|
+
}, o.value]])
|
|
379
856
|
}, {
|
|
380
|
-
default:
|
|
381
|
-
|
|
857
|
+
default: G(() => [
|
|
858
|
+
j($(m !== "dots" ? m : "..."), 1)
|
|
382
859
|
]),
|
|
383
860
|
_: 2
|
|
384
861
|
}, 1032, ["onClick", "href", "class"]))), 128))
|
|
385
862
|
]),
|
|
386
|
-
|
|
387
|
-
|
|
863
|
+
c("div", Ot, [
|
|
864
|
+
e.showNavButtons ? (u(), d("a", {
|
|
388
865
|
key: 0,
|
|
389
|
-
onClick:
|
|
866
|
+
onClick: V(v, ["prevent"]),
|
|
390
867
|
href: "#",
|
|
391
|
-
class:
|
|
868
|
+
class: _(["inline-flex items-center pl-1 text-sm font-medium text-gray-500 border-transparent hover:text-gray-700 hover:border-gray-300", [o.value, { "cursor-default pointer-events-none": t.value >= s.value }]])
|
|
392
869
|
}, [
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
], 10,
|
|
870
|
+
j($(e.nextText) + " ", 1),
|
|
871
|
+
N(M(fe), { class: "w-5 h-5" })
|
|
872
|
+
], 10, jt)) : D("", !0)
|
|
396
873
|
])
|
|
397
874
|
]));
|
|
398
875
|
}
|
|
399
876
|
};
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
877
|
+
function Yt(e, n) {
|
|
878
|
+
return u(), d("svg", {
|
|
879
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
880
|
+
fill: "none",
|
|
881
|
+
viewBox: "0 0 24 24",
|
|
882
|
+
"stroke-width": "1.5",
|
|
883
|
+
stroke: "currentColor",
|
|
884
|
+
"aria-hidden": "true"
|
|
885
|
+
}, [
|
|
886
|
+
c("path", {
|
|
887
|
+
"stroke-linecap": "round",
|
|
888
|
+
"stroke-linejoin": "round",
|
|
889
|
+
d: "M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"
|
|
890
|
+
})
|
|
891
|
+
]);
|
|
892
|
+
}
|
|
893
|
+
function Et(e, n) {
|
|
894
|
+
return u(), d("svg", {
|
|
895
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
896
|
+
fill: "none",
|
|
897
|
+
viewBox: "0 0 24 24",
|
|
898
|
+
"stroke-width": "1.5",
|
|
899
|
+
stroke: "currentColor",
|
|
900
|
+
"aria-hidden": "true"
|
|
901
|
+
}, [
|
|
902
|
+
c("path", {
|
|
903
|
+
"stroke-linecap": "round",
|
|
904
|
+
"stroke-linejoin": "round",
|
|
905
|
+
d: "M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"
|
|
906
|
+
}),
|
|
907
|
+
c("path", {
|
|
908
|
+
"stroke-linecap": "round",
|
|
909
|
+
"stroke-linejoin": "round",
|
|
910
|
+
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
911
|
+
})
|
|
912
|
+
]);
|
|
913
|
+
}
|
|
914
|
+
const Nt = ["value", "type"], vl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
915
|
+
__name: "password-input",
|
|
916
|
+
props: ["modelValue"],
|
|
917
|
+
emits: ["update:modelValue"],
|
|
918
|
+
setup(e, { emit: n }) {
|
|
919
|
+
const l = g(!1), s = C(() => {
|
|
920
|
+
let t = Object.assign({}, q());
|
|
921
|
+
return delete t.class, t;
|
|
922
|
+
});
|
|
923
|
+
return (t, o) => (u(), d("div", {
|
|
924
|
+
class: _("inline-block relative " + q().class)
|
|
925
|
+
}, [
|
|
926
|
+
c("input", O({
|
|
927
|
+
value: e.modelValue,
|
|
928
|
+
type: l.value ? "text" : "password",
|
|
929
|
+
onInput: o[0] || (o[0] = (r) => n("update:modelValue", r.target.value))
|
|
930
|
+
}, s.value, { class: "block pr-10 w-full form-input peer" }), null, 16, Nt),
|
|
931
|
+
c("button", {
|
|
932
|
+
onClick: o[1] || (o[1] = V((r) => l.value = !l.value, ["stop"])),
|
|
933
|
+
class: "flex absolute inset-y-0 right-0 items-center pr-3 text-brand-700 hover:text-brand"
|
|
934
|
+
}, [
|
|
935
|
+
l.value ? (u(), R(M(Yt), {
|
|
936
|
+
key: 0,
|
|
937
|
+
class: "w-5 h-5"
|
|
938
|
+
})) : (u(), R(M(Et), {
|
|
939
|
+
key: 1,
|
|
940
|
+
class: "w-5 h-5"
|
|
941
|
+
}))
|
|
942
|
+
]),
|
|
943
|
+
A(t.$slots, "default")
|
|
944
|
+
], 2));
|
|
945
|
+
}
|
|
946
|
+
}), zt = { class: "flex items-center pb-1" }, Rt = ["id", "checked"], Ht = ["for"], Ut = { key: 1 }, Wt = ["href"], qt = {
|
|
947
|
+
key: 0,
|
|
948
|
+
class: "ml-6"
|
|
949
|
+
}, fl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
950
|
+
__name: "simple-tree",
|
|
951
|
+
props: { branch: { type: Object, default: {} } },
|
|
952
|
+
emits: ["branch-selected", "expand"],
|
|
953
|
+
setup(e, { emit: n }) {
|
|
954
|
+
const l = e, s = g(!1);
|
|
955
|
+
return oe(() => {
|
|
956
|
+
l.branch.current && n("expand", !0);
|
|
957
|
+
}), (t, o) => {
|
|
958
|
+
const r = Ce("simple-tree", !0);
|
|
959
|
+
return u(), d("div", {
|
|
960
|
+
class: _([!e.branch.branches || !e.branch.branches.length ? "terminates" : "", t.$attrs.class])
|
|
961
|
+
}, [
|
|
962
|
+
c("div", zt, [
|
|
963
|
+
e.branch.branches && e.branch.branches.length ? (u(), d(P, { key: 0 }, [
|
|
964
|
+
c("input", {
|
|
965
|
+
type: "checkbox",
|
|
966
|
+
id: "branch-" + e.branch.id,
|
|
967
|
+
onClick: o[0] || (o[0] = (a) => s.value = !s.value),
|
|
968
|
+
checked: s.value,
|
|
969
|
+
class: "hidden"
|
|
970
|
+
}, null, 8, Rt),
|
|
971
|
+
c("label", {
|
|
972
|
+
for: "branch-" + e.branch.id,
|
|
973
|
+
class: "mr-2"
|
|
974
|
+
}, [
|
|
975
|
+
(u(), R(re(s.value ? M(nt) : M(ot)), { class: "w-4 h-4 border" }))
|
|
976
|
+
], 8, Ht)
|
|
977
|
+
], 64)) : D("", !0),
|
|
978
|
+
e.branch.current ? (u(), d("strong", Ut, $(e.branch.label), 1)) : (u(), d("a", {
|
|
979
|
+
key: 2,
|
|
980
|
+
href: e.branch.path,
|
|
981
|
+
onClick: o[1] || (o[1] = V((a) => n("branch-selected", e.branch), ["prevent"]))
|
|
982
|
+
}, $(e.branch.label), 9, Wt))
|
|
983
|
+
]),
|
|
984
|
+
e.branch.branches && e.branch.branches.length ? ne((u(), d("ul", qt, [
|
|
985
|
+
(u(!0), d(P, null, B(e.branch.branches, (a) => (u(), R(r, {
|
|
986
|
+
branch: a,
|
|
987
|
+
key: a.id,
|
|
988
|
+
onBranchSelected: o[2] || (o[2] = (v) => n("branch-selected", v)),
|
|
989
|
+
onExpand: o[3] || (o[3] = (v) => {
|
|
990
|
+
s.value = v, n("expand", v);
|
|
991
|
+
})
|
|
992
|
+
}, null, 8, ["branch"]))), 128))
|
|
993
|
+
], 512)), [
|
|
994
|
+
[Se, s.value]
|
|
995
|
+
]) : D("", !0)
|
|
996
|
+
], 2);
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
const Kt = { class: "overflow-hidden rounded ring-1 ring-opacity-10 shadow ring-slate-500" }, Gt = { class: "min-w-full divide-y divide-y-slate-900" }, Xt = { class: "text-white bg-slate-700" }, Zt = ["onClick"], Jt = { class: "flex items-center" }, Qt = {
|
|
406
1001
|
key: 0,
|
|
407
1002
|
xmlns: "http://www.w3.org/2000/svg",
|
|
408
1003
|
class: "flex-shrink-0 ml-2 w-4 h-4",
|
|
409
1004
|
fill: "none",
|
|
410
1005
|
viewBox: "0 0 24 24",
|
|
411
1006
|
stroke: "currentColor"
|
|
412
|
-
},
|
|
1007
|
+
}, el = ["d"], tl = {
|
|
413
1008
|
key: 1,
|
|
414
1009
|
"stroke-linecap": "round",
|
|
415
1010
|
"stroke-linejoin": "round",
|
|
416
1011
|
"stroke-width": "2",
|
|
417
1012
|
d: "M8 9l4-4 4 4m0 6l-4 4-4-4"
|
|
418
|
-
},
|
|
1013
|
+
}, ll = {
|
|
419
1014
|
__name: "sortable",
|
|
420
1015
|
props: {
|
|
421
1016
|
columns: {
|
|
422
1017
|
type: Array,
|
|
423
1018
|
required: !0,
|
|
424
|
-
validator: (
|
|
425
|
-
for (const
|
|
426
|
-
if (
|
|
1019
|
+
validator: (e) => {
|
|
1020
|
+
for (const n of e)
|
|
1021
|
+
if (n.label === void 0 || n.prop === void 0)
|
|
427
1022
|
return !1;
|
|
428
1023
|
return !0;
|
|
429
1024
|
}
|
|
@@ -432,61 +1027,61 @@ const $e = (t, i) => {
|
|
|
432
1027
|
offset: { type: Number, default: null },
|
|
433
1028
|
count: { type: Number, default: null },
|
|
434
1029
|
sortProp: { type: String },
|
|
435
|
-
sortDirection: { type: String, validator: (
|
|
1030
|
+
sortDirection: { type: String, validator: (e) => !e || ["asc", "desc"].indexOf(e) !== -1 },
|
|
436
1031
|
keyProperty: { type: String, default: "key" }
|
|
437
1032
|
},
|
|
438
1033
|
emits: ["before-sort", "after-sort"],
|
|
439
|
-
setup(
|
|
440
|
-
const
|
|
441
|
-
let
|
|
442
|
-
const
|
|
443
|
-
return
|
|
444
|
-
}),
|
|
445
|
-
|
|
1034
|
+
setup(e, { emit: n }) {
|
|
1035
|
+
const l = e, s = g(l.sortProp), t = g(l.sortDirection), o = C(() => {
|
|
1036
|
+
let a = l.rows.slice();
|
|
1037
|
+
const v = l.columns.find(({ prop: i }) => i === s.value);
|
|
1038
|
+
return v && (t.value === "asc" && v.sortAscFunction ? a.sort(v.sortAscFunction) : t.value === "desc" && v.sortDescFunction ? a.sort(v.sortDescFunction) : a.sort((i, h) => i[s.value] < h[s.value] ? t.value === "asc" ? -1 : 1 : i[s.value] > h[s.value] ? t.value === "asc" ? 1 : -1 : 0)), a.slice(l.offset || 0, (l.offset || 0) + (l.count || a.length));
|
|
1039
|
+
}), r = (a) => {
|
|
1040
|
+
n("before-sort", { prop: s.value, dir: t.value }), s.value === a ? t.value = t.value === "asc" ? "desc" : "asc" : (s.value = a, t.value = t.value || "asc"), ee(() => n("after-sort", { prop: s.value, dir: t.value }));
|
|
446
1041
|
};
|
|
447
|
-
return (
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
(
|
|
1042
|
+
return (a, v) => (u(), d("div", Kt, [
|
|
1043
|
+
c("table", Gt, [
|
|
1044
|
+
c("thead", Xt, [
|
|
1045
|
+
c("tr", null, [
|
|
1046
|
+
(u(!0), d(P, null, B(e.columns, (i) => (u(), d("th", {
|
|
452
1047
|
scope: "col",
|
|
453
|
-
class:
|
|
454
|
-
{ "cursor-pointer":
|
|
455
|
-
|
|
1048
|
+
class: _(["py-3 px-6 text-left", [
|
|
1049
|
+
{ "cursor-pointer": i.sortable, active: s.value === i.prop },
|
|
1050
|
+
i.cssClass
|
|
456
1051
|
]]),
|
|
457
|
-
onClick: (
|
|
1052
|
+
onClick: (h) => i.sortable ? r(i.prop) : null
|
|
458
1053
|
}, [
|
|
459
|
-
|
|
460
|
-
column:
|
|
461
|
-
sortDir:
|
|
462
|
-
sortProp:
|
|
1054
|
+
A(a.$slots, i.prop + "-header", {
|
|
1055
|
+
column: i,
|
|
1056
|
+
sortDir: t.value,
|
|
1057
|
+
sortProp: s.value
|
|
463
1058
|
}, () => [
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
1059
|
+
c("div", Jt, [
|
|
1060
|
+
c("span", null, $(i.label), 1),
|
|
1061
|
+
i.sortable ? (u(), d("svg", Qt, [
|
|
1062
|
+
s.value === i.prop ? (u(), d("path", {
|
|
468
1063
|
key: 0,
|
|
469
1064
|
"stroke-linecap": "round",
|
|
470
1065
|
"stroke-linejoin": "round",
|
|
471
1066
|
"stroke-width": "2",
|
|
472
|
-
d:
|
|
473
|
-
}, null, 8,
|
|
474
|
-
])) :
|
|
1067
|
+
d: t.value === "asc" ? "M19 9l-7 7-7-7" : "M5 15l7-7 7 7"
|
|
1068
|
+
}, null, 8, el)) : (u(), d("path", tl))
|
|
1069
|
+
])) : D("", !0)
|
|
475
1070
|
])
|
|
476
1071
|
], !0)
|
|
477
|
-
], 10,
|
|
1072
|
+
], 10, Zt))), 256))
|
|
478
1073
|
])
|
|
479
1074
|
]),
|
|
480
|
-
|
|
481
|
-
(
|
|
482
|
-
key:
|
|
483
|
-
class:
|
|
1075
|
+
c("tbody", null, [
|
|
1076
|
+
(u(!0), d(P, null, B(o.value, (i) => (u(), d("tr", {
|
|
1077
|
+
key: i[e.keyProperty],
|
|
1078
|
+
class: _(i.cssClass)
|
|
484
1079
|
}, [
|
|
485
|
-
(
|
|
486
|
-
class:
|
|
1080
|
+
(u(!0), d(P, null, B(e.columns, (h) => (u(), d("td", {
|
|
1081
|
+
class: _(["py-3 px-6 whitespace-nowrap", { active: s.value === h.prop }])
|
|
487
1082
|
}, [
|
|
488
|
-
|
|
489
|
-
|
|
1083
|
+
A(a.$slots, h.prop, { row: i }, () => [
|
|
1084
|
+
j($(i[h.prop]), 1)
|
|
490
1085
|
], !0)
|
|
491
1086
|
], 2))), 256))
|
|
492
1087
|
], 2))), 128))
|
|
@@ -494,80 +1089,18 @@ const $e = (t, i) => {
|
|
|
494
1089
|
])
|
|
495
1090
|
]));
|
|
496
1091
|
}
|
|
497
|
-
},
|
|
498
|
-
class: "flex -mb-px space-x-8",
|
|
499
|
-
"aria-label": "Tabs"
|
|
500
|
-
}, De = ["onClick", "aria-current"], Je = {
|
|
501
|
-
__name: "tabs",
|
|
502
|
-
props: {
|
|
503
|
-
items: { type: Array, default: [] },
|
|
504
|
-
activeIndex: { type: Number, default: 0 }
|
|
505
|
-
},
|
|
506
|
-
emits: ["update:active-index"],
|
|
507
|
-
setup(t, { emit: i }) {
|
|
508
|
-
const s = t, l = g(s.items[s.activeIndex] || {}), e = _(() => {
|
|
509
|
-
let u = [];
|
|
510
|
-
return s.items.forEach((c, d) => {
|
|
511
|
-
c.disabled || u.push({ label: c.name, key: d });
|
|
512
|
-
}), u;
|
|
513
|
-
});
|
|
514
|
-
V(() => s.activeIndex, (u) => {
|
|
515
|
-
l.value = s.items[u] || {};
|
|
516
|
-
});
|
|
517
|
-
const v = (u) => {
|
|
518
|
-
u.disabled || (l.value = u, i("update:active-index", s.items.indexOf(u)));
|
|
519
|
-
};
|
|
520
|
-
return (u, c) => (a(), o(b, null, [
|
|
521
|
-
n("div", je, [
|
|
522
|
-
P(G, {
|
|
523
|
-
options: e.value,
|
|
524
|
-
"model-value": t.activeIndex,
|
|
525
|
-
"onUpdate:modelValue": c[0] || (c[0] = (d) => i("update:activeIndex", d)),
|
|
526
|
-
class: "w-full"
|
|
527
|
-
}, null, 8, ["options", "model-value"])
|
|
528
|
-
]),
|
|
529
|
-
n("div", Le, [
|
|
530
|
-
n("div", Oe, [
|
|
531
|
-
n("nav", ze, [
|
|
532
|
-
(a(!0), o(b, null, k(t.items, (d) => (a(), o("a", {
|
|
533
|
-
key: d.name,
|
|
534
|
-
href: "#",
|
|
535
|
-
onClick: C((r) => v(d), ["prevent"]),
|
|
536
|
-
class: f([
|
|
537
|
-
l.value === d ? "border-vxvue-500 text-vxvue-600" : "border-transparent text-gray-900 hover:text-gray-700 hover:border-gray-300",
|
|
538
|
-
d.disabled ? "cursor-not-allowed text-gray-400 hover:border-transparent" : "",
|
|
539
|
-
"group inline-flex items-center py-4 px-1 border-b-4 font-medium"
|
|
540
|
-
]),
|
|
541
|
-
"aria-current": l.value === d ? "page" : void 0
|
|
542
|
-
}, [
|
|
543
|
-
x(u.$slots, "icon", { tab: d }),
|
|
544
|
-
n("span", null, [
|
|
545
|
-
x(u.$slots, "default", { tab: d }, () => [
|
|
546
|
-
w(h(d.name), 1)
|
|
547
|
-
])
|
|
548
|
-
]),
|
|
549
|
-
d.badge ? (a(), o("span", {
|
|
550
|
-
key: 0,
|
|
551
|
-
class: f([
|
|
552
|
-
l.value === d ? "bg-vxvue-50 text-vxvue-700" : "bg-gray-200 text-gray-900",
|
|
553
|
-
d.disabled ? "bg-gray-100 text-gray-400" : "",
|
|
554
|
-
"hidden ml-3 py-0.5 px-2.5 rounded-full text-xs font-medium md:inline-block"
|
|
555
|
-
])
|
|
556
|
-
}, h(d.badge), 3)) : y("", !0)
|
|
557
|
-
], 10, De))), 128))
|
|
558
|
-
])
|
|
559
|
-
])
|
|
560
|
-
])
|
|
561
|
-
], 64));
|
|
562
|
-
}
|
|
563
|
-
};
|
|
1092
|
+
}, pl = /* @__PURE__ */ pe(ll, [["__scopeId", "data-v-f0e4e642"]]);
|
|
564
1093
|
export {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
1094
|
+
al as Autocomplete,
|
|
1095
|
+
nl as Confirm,
|
|
1096
|
+
at as DateInput,
|
|
1097
|
+
ol as Datepicker,
|
|
1098
|
+
rl as FormFileButton,
|
|
1099
|
+
ul as FormSelect,
|
|
1100
|
+
il as FormSwitch,
|
|
1101
|
+
cl as MessageToast,
|
|
1102
|
+
dl as Pagination,
|
|
1103
|
+
vl as PasswordInput,
|
|
1104
|
+
fl as SimpleTree,
|
|
1105
|
+
pl as Sortable
|
|
573
1106
|
};
|