vx-vue 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +45 -38
- package/dist/style.css +1 -1
- package/dist/vxvue.es.js +508 -441
- package/dist/vxvue.umd.js +1 -1
- package/package.json +31 -31
package/dist/vxvue.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getCurrentScope as
|
|
1
|
+
import { getCurrentScope as xe, onScopeDispose as ye, unref as A, watch as j, useAttrs as q, ref as g, computed as S, onUpdated as we, openBlock as u, createElementBlock as c, normalizeClass as w, createElementVNode as i, mergeProps as Y, withKeys as H, withModifiers as P, createCommentVNode as C, Fragment as D, renderList as B, renderSlot as M, toDisplayString as _, createVNode as E, Transition as ee, withCtx as K, createTextVNode as F, nextTick as te, toValue as se, withDirectives as oe, vModelText as ke, createBlock as R, onMounted as re, pushScopeId as $e, popScopeId as _e, resolveDynamicComponent as ue, resolveComponent as Ce, vShow as Se } from "vue";
|
|
2
2
|
function Me(e) {
|
|
3
|
-
return
|
|
3
|
+
return xe() ? (ye(e), !0) : !1;
|
|
4
4
|
}
|
|
5
5
|
function ie(e) {
|
|
6
|
-
return typeof e == "function" ? e() :
|
|
6
|
+
return typeof e == "function" ? e() : A(e);
|
|
7
7
|
}
|
|
8
8
|
const ce = typeof window < "u" && typeof document < "u", De = Object.prototype.toString, Ve = (e) => De.call(e) === "[object Object]", Q = () => {
|
|
9
9
|
}, Pe = /* @__PURE__ */ Ae();
|
|
@@ -12,113 +12,113 @@ function Ae() {
|
|
|
12
12
|
return ce && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
13
13
|
}
|
|
14
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
|
|
15
|
+
function Ie(e, o, l, s) {
|
|
16
16
|
let t = e < 12 ? "AM" : "PM";
|
|
17
|
-
return s && (t = t.split("").reduce((
|
|
17
|
+
return s && (t = t.split("").reduce((r, n) => r += `${n}.`, "")), l ? t.toLowerCase() : t;
|
|
18
18
|
}
|
|
19
|
-
function ae(e,
|
|
19
|
+
function ae(e, o, l = {}) {
|
|
20
20
|
var s;
|
|
21
|
-
const t = e.getFullYear(),
|
|
21
|
+
const t = e.getFullYear(), r = e.getMonth(), n = e.getDate(), a = e.getHours(), d = e.getMinutes(), v = e.getSeconds(), h = e.getMilliseconds(), m = e.getDay(), f = (s = l.customMeridiem) != null ? s : Ie, p = {
|
|
22
22
|
YY: () => String(t).slice(-2),
|
|
23
23
|
YYYY: () => t,
|
|
24
|
-
M: () =>
|
|
25
|
-
MM: () => `${
|
|
24
|
+
M: () => r + 1,
|
|
25
|
+
MM: () => `${r + 1}`.padStart(2, "0"),
|
|
26
26
|
MMM: () => e.toLocaleDateString(l.locales, { month: "short" }),
|
|
27
27
|
MMMM: () => e.toLocaleDateString(l.locales, { month: "long" }),
|
|
28
|
-
D: () => String(
|
|
29
|
-
DD: () => `${
|
|
28
|
+
D: () => String(n),
|
|
29
|
+
DD: () => `${n}`.padStart(2, "0"),
|
|
30
30
|
H: () => String(a),
|
|
31
31
|
HH: () => `${a}`.padStart(2, "0"),
|
|
32
32
|
h: () => `${a % 12 || 12}`.padStart(1, "0"),
|
|
33
33
|
hh: () => `${a % 12 || 12}`.padStart(2, "0"),
|
|
34
|
-
m: () => String(
|
|
35
|
-
mm: () => `${
|
|
36
|
-
s: () => String(
|
|
37
|
-
ss: () => `${
|
|
38
|
-
SSS: () => `${
|
|
34
|
+
m: () => String(d),
|
|
35
|
+
mm: () => `${d}`.padStart(2, "0"),
|
|
36
|
+
s: () => String(v),
|
|
37
|
+
ss: () => `${v}`.padStart(2, "0"),
|
|
38
|
+
SSS: () => `${h}`.padStart(3, "0"),
|
|
39
39
|
d: () => m,
|
|
40
40
|
dd: () => e.toLocaleDateString(l.locales, { weekday: "narrow" }),
|
|
41
41
|
ddd: () => e.toLocaleDateString(l.locales, { weekday: "short" }),
|
|
42
42
|
dddd: () => e.toLocaleDateString(l.locales, { weekday: "long" }),
|
|
43
|
-
A: () => f(a,
|
|
44
|
-
AA: () => f(a,
|
|
45
|
-
a: () => f(a,
|
|
46
|
-
aa: () => f(a,
|
|
43
|
+
A: () => f(a, d),
|
|
44
|
+
AA: () => f(a, d, !1, !0),
|
|
45
|
+
a: () => f(a, d, !0),
|
|
46
|
+
aa: () => f(a, d, !0, !0)
|
|
47
47
|
};
|
|
48
|
-
return
|
|
48
|
+
return o.replace(Be, ($, N) => {
|
|
49
49
|
var L, z;
|
|
50
|
-
return (z =
|
|
50
|
+
return (z = N ?? ((L = p[$]) == null ? void 0 : L.call(p))) != null ? z : $;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
function W(e) {
|
|
54
|
-
var
|
|
54
|
+
var o;
|
|
55
55
|
const l = ie(e);
|
|
56
|
-
return (
|
|
56
|
+
return (o = l == null ? void 0 : l.$el) != null ? o : l;
|
|
57
57
|
}
|
|
58
58
|
const de = ce ? window : void 0;
|
|
59
59
|
function J(...e) {
|
|
60
|
-
let
|
|
61
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([l, s, t] = e,
|
|
60
|
+
let o, l, s, t;
|
|
61
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([l, s, t] = e, o = de) : [o, l, s, t] = e, !o)
|
|
62
62
|
return Q;
|
|
63
63
|
Array.isArray(l) || (l = [l]), Array.isArray(s) || (s = [s]);
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
}, a = (
|
|
67
|
-
() => [W(
|
|
68
|
-
([
|
|
69
|
-
if (
|
|
64
|
+
const r = [], n = () => {
|
|
65
|
+
r.forEach((h) => h()), r.length = 0;
|
|
66
|
+
}, a = (h, m, f, p) => (h.addEventListener(m, f, p), () => h.removeEventListener(m, f, p)), d = j(
|
|
67
|
+
() => [W(o), ie(t)],
|
|
68
|
+
([h, m]) => {
|
|
69
|
+
if (n(), !h)
|
|
70
70
|
return;
|
|
71
71
|
const f = Ve(m) ? { ...m } : m;
|
|
72
|
-
|
|
73
|
-
...l.flatMap((
|
|
72
|
+
r.push(
|
|
73
|
+
...l.flatMap((p) => s.map(($) => a(h, p, $, f)))
|
|
74
74
|
);
|
|
75
75
|
},
|
|
76
76
|
{ immediate: !0, flush: "post" }
|
|
77
|
-
),
|
|
78
|
-
|
|
77
|
+
), v = () => {
|
|
78
|
+
d(), n();
|
|
79
79
|
};
|
|
80
|
-
return Me(
|
|
80
|
+
return Me(v), v;
|
|
81
81
|
}
|
|
82
82
|
let ne = !1;
|
|
83
|
-
function le(e,
|
|
84
|
-
const { window: s = de, ignore: t = [], capture:
|
|
83
|
+
function le(e, o, l = {}) {
|
|
84
|
+
const { window: s = de, ignore: t = [], capture: r = !0, detectIframe: n = !1 } = l;
|
|
85
85
|
if (!s)
|
|
86
86
|
return;
|
|
87
87
|
Pe && !ne && (ne = !0, Array.from(s.document.body.children).forEach((f) => f.addEventListener("click", Q)), s.document.documentElement.addEventListener("click", Q));
|
|
88
88
|
let a = !0;
|
|
89
|
-
const
|
|
90
|
-
if (typeof
|
|
91
|
-
return Array.from(s.document.querySelectorAll(
|
|
89
|
+
const d = (f) => t.some((p) => {
|
|
90
|
+
if (typeof p == "string")
|
|
91
|
+
return Array.from(s.document.querySelectorAll(p)).some(($) => $ === f.target || f.composedPath().includes($));
|
|
92
92
|
{
|
|
93
|
-
const
|
|
94
|
-
return
|
|
93
|
+
const $ = W(p);
|
|
94
|
+
return $ && (f.target === $ || f.composedPath().includes($));
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
96
|
+
}), h = [
|
|
97
97
|
J(s, "click", (f) => {
|
|
98
|
-
const
|
|
99
|
-
if (!(!
|
|
100
|
-
if (f.detail === 0 && (a = !
|
|
98
|
+
const p = W(e);
|
|
99
|
+
if (!(!p || p === f.target || f.composedPath().includes(p))) {
|
|
100
|
+
if (f.detail === 0 && (a = !d(f)), !a) {
|
|
101
101
|
a = !0;
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
o(f);
|
|
105
105
|
}
|
|
106
|
-
}, { passive: !0, capture:
|
|
106
|
+
}, { passive: !0, capture: r }),
|
|
107
107
|
J(s, "pointerdown", (f) => {
|
|
108
|
-
const
|
|
109
|
-
|
|
108
|
+
const p = W(e);
|
|
109
|
+
p && (a = !f.composedPath().includes(p) && !d(f));
|
|
110
110
|
}, { passive: !0 }),
|
|
111
|
-
|
|
111
|
+
n && J(s, "blur", (f) => {
|
|
112
112
|
setTimeout(() => {
|
|
113
|
-
var
|
|
114
|
-
const
|
|
115
|
-
((
|
|
113
|
+
var p;
|
|
114
|
+
const $ = W(e);
|
|
115
|
+
((p = s.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !($ != null && $.contains(s.document.activeElement)) && o(f);
|
|
116
116
|
}, 0);
|
|
117
117
|
})
|
|
118
118
|
].filter(Boolean);
|
|
119
|
-
return () =>
|
|
119
|
+
return () => h.forEach((f) => f());
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const Fe = ["value", "onKeydown"], Le = { class: "absolute right-0 pr-3 flex items-center inset-y-0 text-vxvue-700" }, Te = {
|
|
122
122
|
key: 0,
|
|
123
123
|
class: "animate-spin w-5 h-5",
|
|
124
124
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -138,7 +138,7 @@ const Le = ["value", "onKeydown"], Ie = { class: "absolute right-0 pr-3 flex ite
|
|
|
138
138
|
}, null, -1), Ye = [
|
|
139
139
|
Oe,
|
|
140
140
|
je
|
|
141
|
-
],
|
|
141
|
+
], fl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
142
142
|
__name: "autocomplete",
|
|
143
143
|
props: {
|
|
144
144
|
modelValue: { type: String, default: "" },
|
|
@@ -151,17 +151,17 @@ const Le = ["value", "onKeydown"], Ie = { class: "absolute right-0 pr-3 flex ite
|
|
|
151
151
|
getResultValue: { type: Function, default: (e) => e }
|
|
152
152
|
},
|
|
153
153
|
emits: ["update:modelValue", "blur", "submit"],
|
|
154
|
-
setup(e, { emit:
|
|
155
|
-
const l = e, s = q(),
|
|
154
|
+
setup(e, { emit: o }) {
|
|
155
|
+
const l = e, s = q(), r = (() => {
|
|
156
156
|
let b = 0;
|
|
157
|
-
return (
|
|
158
|
-
})()((s.id || "autocomplete") + "-"),
|
|
159
|
-
() =>
|
|
160
|
-
id: (s.id || "autocomplete") + "-item-" +
|
|
161
|
-
class: ["autocomplete-item", l.resultItemClass, { "bg-vxvue-700 text-white": a.value ===
|
|
162
|
-
"data-result-index":
|
|
157
|
+
return (x) => (x || "") + ++b;
|
|
158
|
+
})()((s.id || "autocomplete") + "-"), n = g([]), a = g(-1), d = g(0), v = g(!1), h = g(!1), m = g("top-0 translate-y-12"), f = g(!0), p = g(null), $ = g(null), N = g(null), L = S(
|
|
159
|
+
() => n.value.map((b, x) => ({
|
|
160
|
+
id: (s.id || "autocomplete") + "-item-" + x,
|
|
161
|
+
class: ["autocomplete-item", l.resultItemClass, { "bg-vxvue-700 text-white": a.value === x }],
|
|
162
|
+
"data-result-index": x,
|
|
163
163
|
role: "option",
|
|
164
|
-
...a.value ===
|
|
164
|
+
...a.value === x ? { "aria-selected": "true" } : {}
|
|
165
165
|
}))
|
|
166
166
|
), z = S(() => ({
|
|
167
167
|
role: "combobox",
|
|
@@ -171,96 +171,96 @@ const Le = ["value", "onKeydown"], Ie = { class: "absolute right-0 pr-3 flex ite
|
|
|
171
171
|
spellcheck: "false",
|
|
172
172
|
"aria-autocomplete": "list",
|
|
173
173
|
"aria-haspopup": "listbox",
|
|
174
|
-
"aria-owns":
|
|
175
|
-
"aria-expanded":
|
|
174
|
+
"aria-owns": r,
|
|
175
|
+
"aria-expanded": v.value ? "true" : "false",
|
|
176
176
|
"aria-activedescendant": a.value > -1 ? L.value[a.value].id : "",
|
|
177
177
|
...s
|
|
178
178
|
})), y = S(() => ({
|
|
179
|
-
id:
|
|
179
|
+
id: r,
|
|
180
180
|
class: ["autocomplete-list absolute min-w-full transform z-10", l.resultListClass, m.value],
|
|
181
181
|
role: "listbox"
|
|
182
|
-
})),
|
|
183
|
-
a.value = -1,
|
|
184
|
-
},
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
182
|
+
})), V = () => {
|
|
183
|
+
a.value = -1, n.value = [], v.value = !1, f.value = !0;
|
|
184
|
+
}, k = (b) => {
|
|
185
|
+
const x = l.search(b);
|
|
186
|
+
if (x instanceof Promise) {
|
|
187
|
+
const O = ++d.value;
|
|
188
|
+
h.value = !0, x.then((I) => {
|
|
189
|
+
O === d.value && (n.value = I, h.value = !1, n.value.length ? (a.value = l.autoSelect ? 0 : -1, v.value = !0) : V());
|
|
190
190
|
});
|
|
191
191
|
} else
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
const b =
|
|
195
|
-
return b &&
|
|
192
|
+
n.value = x, n.value.length === 0 ? V() : (a.value = l.autoSelect ? 0 : -1, v.value = !0);
|
|
193
|
+
}, T = () => {
|
|
194
|
+
const b = n.value[a.value];
|
|
195
|
+
return b && o("update:modelValue", l.getResultValue(b)), V(), b;
|
|
196
196
|
}, X = (b) => {
|
|
197
|
-
|
|
198
|
-
}, G = (b) =>
|
|
199
|
-
|
|
197
|
+
o("update:modelValue", b), k(b);
|
|
198
|
+
}, G = (b) => k(b.target.value), U = () => {
|
|
199
|
+
V(), o("blur");
|
|
200
200
|
}, Z = () => {
|
|
201
|
-
const b =
|
|
201
|
+
const b = n.value.length;
|
|
202
202
|
a.value = ((a.value - 1) % b + b) % b;
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
a.value = ((a.value + 1) %
|
|
203
|
+
}, he = (b) => {
|
|
204
|
+
v.value || G(b);
|
|
205
|
+
const x = n.value.length;
|
|
206
|
+
a.value = ((a.value + 1) % x + x) % x;
|
|
207
207
|
}, me = () => {
|
|
208
|
-
|
|
209
|
-
}, ge = () =>
|
|
210
|
-
const
|
|
211
|
-
|
|
208
|
+
V(), o("update:modelValue", "");
|
|
209
|
+
}, ge = () => o("submit", T()), be = (b) => {
|
|
210
|
+
const x = b.target.closest("[data-result-index]");
|
|
211
|
+
x && (a.value = parseInt(x.dataset.resultIndex, 10), o("submit", T()));
|
|
212
212
|
};
|
|
213
|
-
return le(
|
|
214
|
-
if (
|
|
215
|
-
const b =
|
|
216
|
-
f.value &&
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
let
|
|
220
|
-
|
|
213
|
+
return le(N, V), we(() => {
|
|
214
|
+
if (p.value) {
|
|
215
|
+
const b = $.value.getBoundingClientRect(), x = p.value.getBoundingClientRect();
|
|
216
|
+
f.value && n.value.length && (f.value = !1, m.value = b.bottom + x.height > window.innerHeight && window.innerHeight - b.bottom < b.top && window.pageYOffset + b.top - x.height > 0 ? "bottom-0 -translate-y-12" : "top-0 translate-y-12");
|
|
217
|
+
const O = p.value.querySelector('[data-result-index="' + a.value + '"]');
|
|
218
|
+
if (O) {
|
|
219
|
+
let I = O.getBoundingClientRect();
|
|
220
|
+
I.top < x.top ? p.value.scrollTop -= x.top - I.top : I.bottom > x.bottom && (p.value.scrollTop += I.bottom - x.bottom);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
}), (b,
|
|
224
|
-
class:
|
|
223
|
+
}), (b, x) => (u(), c("div", {
|
|
224
|
+
class: w(["relative inline-block", b.$attrs.class]),
|
|
225
225
|
ref_key: "container",
|
|
226
|
-
ref:
|
|
226
|
+
ref: N
|
|
227
227
|
}, [
|
|
228
|
-
i("input",
|
|
228
|
+
i("input", Y({
|
|
229
229
|
ref_key: "input",
|
|
230
|
-
ref:
|
|
230
|
+
ref: $,
|
|
231
231
|
class: "form-input w-full block focus:border-vxvue pr-10",
|
|
232
232
|
value: e.modelValue
|
|
233
233
|
}, z.value, {
|
|
234
|
-
onInput:
|
|
234
|
+
onInput: x[0] || (x[0] = (O) => X(O.target.value)),
|
|
235
235
|
onKeydown: [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
236
|
+
H(ge, ["enter"]),
|
|
237
|
+
H(me, ["esc"]),
|
|
238
|
+
H(T, ["tab"]),
|
|
239
|
+
H(P(Z, ["prevent"]), ["up"]),
|
|
240
|
+
H(P(he, ["prevent"]), ["down"])
|
|
241
241
|
],
|
|
242
242
|
onFocus: G,
|
|
243
|
-
onBlur:
|
|
244
|
-
}), null, 16,
|
|
245
|
-
i("span",
|
|
246
|
-
|
|
243
|
+
onBlur: U
|
|
244
|
+
}), null, 16, Fe),
|
|
245
|
+
i("span", Le, [
|
|
246
|
+
h.value ? (u(), c("svg", Te, Ye)) : C("", !0)
|
|
247
247
|
]),
|
|
248
|
-
|
|
248
|
+
n.value.length ? (u(), c("ul", Y({
|
|
249
249
|
key: 0,
|
|
250
250
|
ref_key: "resultList",
|
|
251
|
-
ref:
|
|
251
|
+
ref: p
|
|
252
252
|
}, y.value, {
|
|
253
253
|
onClick: be,
|
|
254
|
-
onMousedown:
|
|
254
|
+
onMousedown: x[1] || (x[1] = P(() => {
|
|
255
255
|
}, ["prevent"]))
|
|
256
256
|
}), [
|
|
257
|
-
(u(!0),
|
|
258
|
-
result:
|
|
259
|
-
props: L.value[
|
|
257
|
+
(u(!0), c(D, null, B(n.value, (O, I) => M(b.$slots, "result", {
|
|
258
|
+
result: O,
|
|
259
|
+
props: L.value[I]
|
|
260
260
|
}, () => [
|
|
261
|
-
(u(),
|
|
262
|
-
key: L.value[
|
|
263
|
-
}, L.value[
|
|
261
|
+
(u(), c("li", Y({
|
|
262
|
+
key: L.value[I].id
|
|
263
|
+
}, L.value[I]), _(e.getResultValue(O)), 17))
|
|
264
264
|
])), 256))
|
|
265
265
|
], 16)) : C("", !0)
|
|
266
266
|
], 2));
|
|
@@ -272,16 +272,16 @@ const Le = ["value", "onKeydown"], Ie = { class: "absolute right-0 pr-3 flex ite
|
|
|
272
272
|
}, Ne = {
|
|
273
273
|
key: 0,
|
|
274
274
|
class: "overflow-y-auto fixed inset-0 z-50"
|
|
275
|
-
}, ze = { class: "flex justify-center items-center min-h-screen text-center sm:block sm:p-0" }, Re = { key: 0 },
|
|
275
|
+
}, ze = { class: "flex justify-center items-center min-h-screen text-center sm:block sm:p-0" }, Re = { key: 0 }, Ue = /* @__PURE__ */ i("span", {
|
|
276
276
|
class: "hidden sm:inline-block sm:h-screen sm:align-middle",
|
|
277
277
|
"aria-hidden": "true"
|
|
278
|
-
}, "", -1),
|
|
278
|
+
}, "", -1), He = { 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"], pl = {
|
|
279
279
|
__name: "confirm",
|
|
280
280
|
props: {
|
|
281
281
|
buttons: {
|
|
282
282
|
type: [Object, Array],
|
|
283
283
|
default: { label: "Ok" },
|
|
284
|
-
validator: (e) => Array.isArray(e) && e.length <= 2 && e.filter((
|
|
284
|
+
validator: (e) => Array.isArray(e) && e.length <= 2 && e.filter((o) => o.label !== "undefined" && o.value !== "undefined").length === e.length || e.label !== void 0 && e.value !== void 0
|
|
285
285
|
},
|
|
286
286
|
headerClass: {
|
|
287
287
|
type: String,
|
|
@@ -292,51 +292,51 @@ const Le = ["value", "onKeydown"], Ie = { class: "absolute right-0 pr-3 flex ite
|
|
|
292
292
|
default: "button"
|
|
293
293
|
}
|
|
294
294
|
},
|
|
295
|
-
setup(e, { expose:
|
|
296
|
-
const l = e, s = g(""), t = g(""),
|
|
297
|
-
let
|
|
298
|
-
const
|
|
299
|
-
return
|
|
300
|
-
|
|
301
|
-
})) }), (m, f) => (u(),
|
|
302
|
-
|
|
303
|
-
|
|
295
|
+
setup(e, { expose: o }) {
|
|
296
|
+
const l = e, s = g(""), t = g(""), r = g(!1);
|
|
297
|
+
let n = null, a = null;
|
|
298
|
+
const d = S(() => Array.isArray(l.buttons) ? l.buttons : [l.buttons]), v = g(null);
|
|
299
|
+
return o({ open: (m, f) => (s.value = m, t.value = f, r.value = !0, te(() => v.value.firstElementChild.focus()), new Promise((p, $) => {
|
|
300
|
+
n = p, a = $;
|
|
301
|
+
})) }), (m, f) => (u(), c(D, null, [
|
|
302
|
+
r.value ? (u(), c("div", Ee)) : C("", !0),
|
|
303
|
+
E(ee, { name: "appear" }, {
|
|
304
304
|
default: K(() => [
|
|
305
|
-
|
|
305
|
+
r.value ? (u(), c("div", Ne, [
|
|
306
306
|
i("div", ze, [
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
i("div",
|
|
310
|
-
s.value ? (u(),
|
|
307
|
+
r.value ? (u(), c("div", Re, [
|
|
308
|
+
Ue,
|
|
309
|
+
i("div", He, [
|
|
310
|
+
s.value ? (u(), c("h3", {
|
|
311
311
|
key: 0,
|
|
312
|
-
class:
|
|
312
|
+
class: w(["py-4 pt-4 text-lg font-medium text-center sm:py-6", e.headerClass])
|
|
313
313
|
}, [
|
|
314
|
-
|
|
315
|
-
|
|
314
|
+
M(m.$slots, "title", { title: s.value }, () => [
|
|
315
|
+
F(_(s.value), 1)
|
|
316
316
|
])
|
|
317
317
|
], 2)) : C("", !0),
|
|
318
318
|
i("div", We, [
|
|
319
319
|
i("div", qe, [
|
|
320
320
|
i("div", Ke, [
|
|
321
|
-
|
|
321
|
+
M(m.$slots, "icon")
|
|
322
322
|
]),
|
|
323
323
|
i("p", Ge, [
|
|
324
|
-
|
|
325
|
-
|
|
324
|
+
M(m.$slots, "default", { message: t.value }, () => [
|
|
325
|
+
F(_(t.value), 1)
|
|
326
326
|
])
|
|
327
327
|
])
|
|
328
328
|
]),
|
|
329
329
|
i("div", {
|
|
330
330
|
class: "flex justify-center mt-5 space-x-2 sm:mt-6",
|
|
331
331
|
ref_key: "buttonsContainer",
|
|
332
|
-
ref:
|
|
332
|
+
ref: v
|
|
333
333
|
}, [
|
|
334
|
-
(u(!0),
|
|
335
|
-
class:
|
|
336
|
-
onClick:
|
|
337
|
-
|
|
334
|
+
(u(!0), c(D, null, B(d.value, (p, $) => (u(), c("button", {
|
|
335
|
+
class: w([e.buttonClass, p.class]),
|
|
336
|
+
onClick: P((N) => {
|
|
337
|
+
r.value = !1, $ === 0 ? A(n)() : A(a)();
|
|
338
338
|
}, ["prevent"])
|
|
339
|
-
}, _(
|
|
339
|
+
}, _(p.label), 11, Xe))), 256))
|
|
340
340
|
], 512)
|
|
341
341
|
])
|
|
342
342
|
])
|
|
@@ -349,31 +349,31 @@ const Le = ["value", "onKeydown"], Ie = { class: "absolute right-0 pr-3 flex ite
|
|
|
349
349
|
], 64));
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
function Ze(e,
|
|
353
|
-
const l = g(!1), s = se(
|
|
354
|
-
let t,
|
|
352
|
+
function Ze(e, o) {
|
|
353
|
+
const l = g(!1), s = se(o);
|
|
354
|
+
let t, r = s.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = [];
|
|
355
355
|
if ((t = s.match(/\bd\b/gi)) && t.length === 1)
|
|
356
|
-
|
|
356
|
+
r = r.replace("d", "(\\d{1,2})");
|
|
357
357
|
else if ((t = s.match(/\bdd\b/gi)) && t.length === 1)
|
|
358
|
-
|
|
358
|
+
r = r.replace("dd", "(\\d{2})");
|
|
359
359
|
else
|
|
360
360
|
return { date: l };
|
|
361
|
-
if (
|
|
362
|
-
|
|
361
|
+
if (n.push({ srcPos: s.toLowerCase().indexOf("d"), destPos: 2 }), (t = s.match(/\bm\b/gi)) && t.length === 1)
|
|
362
|
+
r = r.replace("m", "(\\d{1,2})");
|
|
363
363
|
else if ((t = s.match(/\bmm\b/gi)) && t.length === 1)
|
|
364
|
-
|
|
364
|
+
r = r.replace("mm", "(\\d{2})");
|
|
365
365
|
else
|
|
366
366
|
return { date: l };
|
|
367
|
-
if (
|
|
368
|
-
|
|
367
|
+
if (n.push({ srcPos: s.toLowerCase().indexOf("m"), destPos: 1 }), (t = s.match(/\byyyy\b/gi)) && t.length === 1)
|
|
368
|
+
r = r.replace("yyyy", "(\\d{4})");
|
|
369
369
|
else
|
|
370
370
|
return { date: l };
|
|
371
|
-
if (
|
|
371
|
+
if (n.push({ srcPos: s.toLowerCase().indexOf("y"), destPos: 0 }), !(t = se(e).match(r)))
|
|
372
372
|
return { date: l };
|
|
373
|
-
t.shift(),
|
|
374
|
-
let a = [],
|
|
375
|
-
for (;
|
|
376
|
-
|
|
373
|
+
t.shift(), n.sort((h, m) => h.srcPos < m.srcPos ? -1 : 1);
|
|
374
|
+
let a = [], d, v;
|
|
375
|
+
for (; d = t.shift(); )
|
|
376
|
+
v = n.shift(), a[v.destPos] = d;
|
|
377
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
378
|
}
|
|
379
379
|
const Je = { key: 0 }, Qe = { class: "text-vxvue-700" }, et = /* @__PURE__ */ i("svg", {
|
|
@@ -414,49 +414,49 @@ const Je = { key: 0 }, Qe = { class: "text-vxvue-700" }, et = /* @__PURE__ */ i(
|
|
|
414
414
|
modelValue: Date
|
|
415
415
|
},
|
|
416
416
|
emits: ["update:modelValue", "toggle-datepicker"],
|
|
417
|
-
setup(e, { emit:
|
|
418
|
-
const l = e, s = g(""), t = S(() => l.modelValue ? ae(l.modelValue, l.outputFormat) : ""),
|
|
419
|
-
let
|
|
420
|
-
return delete
|
|
417
|
+
setup(e, { emit: o }) {
|
|
418
|
+
const l = e, s = g(""), t = S(() => l.modelValue ? ae(l.modelValue, l.outputFormat) : ""), r = S(() => {
|
|
419
|
+
let n = Object.assign({}, q());
|
|
420
|
+
return delete n.class, n;
|
|
421
421
|
});
|
|
422
|
-
return
|
|
423
|
-
class:
|
|
422
|
+
return j(() => l.modelValue, (n) => s.value = n ? ae(n, l.outputFormat) : ""), (n, a) => (u(), c("div", {
|
|
423
|
+
class: w(["inline-block relative", n.$attrs.class])
|
|
424
424
|
}, [
|
|
425
|
-
t.value ? (u(),
|
|
425
|
+
t.value ? (u(), c("div", Je, [
|
|
426
426
|
i("div", {
|
|
427
|
-
class:
|
|
427
|
+
class: w(["block flex items-center w-full form-input bg-vxvue-50", { "pr-10": e.showButton }])
|
|
428
428
|
}, [
|
|
429
429
|
i("span", Qe, _(t.value), 1),
|
|
430
430
|
i("button", {
|
|
431
|
-
onClick: a[0] || (a[0] = (
|
|
431
|
+
onClick: a[0] || (a[0] = (d) => o("update:modelValue", null)),
|
|
432
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
433
|
}, tt)
|
|
434
434
|
], 2)
|
|
435
|
-
])) : oe((u(),
|
|
435
|
+
])) : oe((u(), c("input", Y({
|
|
436
436
|
key: 1,
|
|
437
437
|
type: "text",
|
|
438
438
|
class: ["block w-full form-input focus:border-vxvue peer", { "pr-10": e.showButton }],
|
|
439
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
440
|
-
onBlur: a[2] || (a[2] = (
|
|
441
|
-
var
|
|
442
|
-
return
|
|
439
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => s.value = d),
|
|
440
|
+
onBlur: a[2] || (a[2] = (d) => {
|
|
441
|
+
var v;
|
|
442
|
+
return o("update:modelValue", ((v = A(Ze)(s.value, l.inputFormat).date) == null ? void 0 : v.value) || null);
|
|
443
443
|
}),
|
|
444
|
-
onInput: a[3] || (a[3] =
|
|
444
|
+
onInput: a[3] || (a[3] = P(() => {
|
|
445
445
|
}, ["prevent"]))
|
|
446
|
-
},
|
|
446
|
+
}, r.value), null, 16)), [
|
|
447
447
|
[ke, s.value]
|
|
448
448
|
]),
|
|
449
|
-
e.showButton ? (u(),
|
|
449
|
+
e.showButton ? (u(), c("button", {
|
|
450
450
|
key: 2,
|
|
451
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] =
|
|
452
|
+
onClick: a[4] || (a[4] = P((d) => o("toggle-datepicker"), ["stop"]))
|
|
453
453
|
}, st)) : C("", !0),
|
|
454
|
-
|
|
454
|
+
M(n.$slots, "default")
|
|
455
455
|
], 2));
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
|
-
function ve(e,
|
|
459
|
-
return u(),
|
|
458
|
+
function ve(e, o) {
|
|
459
|
+
return u(), c("svg", {
|
|
460
460
|
xmlns: "http://www.w3.org/2000/svg",
|
|
461
461
|
viewBox: "0 0 24 24",
|
|
462
462
|
fill: "currentColor",
|
|
@@ -469,8 +469,8 @@ function ve(e, n) {
|
|
|
469
469
|
})
|
|
470
470
|
]);
|
|
471
471
|
}
|
|
472
|
-
function fe(e,
|
|
473
|
-
return u(),
|
|
472
|
+
function fe(e, o) {
|
|
473
|
+
return u(), c("svg", {
|
|
474
474
|
xmlns: "http://www.w3.org/2000/svg",
|
|
475
475
|
viewBox: "0 0 24 24",
|
|
476
476
|
fill: "currentColor",
|
|
@@ -483,8 +483,8 @@ function fe(e, n) {
|
|
|
483
483
|
})
|
|
484
484
|
]);
|
|
485
485
|
}
|
|
486
|
-
function nt(e,
|
|
487
|
-
return u(),
|
|
486
|
+
function nt(e, o) {
|
|
487
|
+
return u(), c("svg", {
|
|
488
488
|
xmlns: "http://www.w3.org/2000/svg",
|
|
489
489
|
viewBox: "0 0 24 24",
|
|
490
490
|
fill: "currentColor",
|
|
@@ -497,8 +497,8 @@ function nt(e, n) {
|
|
|
497
497
|
})
|
|
498
498
|
]);
|
|
499
499
|
}
|
|
500
|
-
function ot(e,
|
|
501
|
-
return u(),
|
|
500
|
+
function ot(e, o) {
|
|
501
|
+
return u(), c("svg", {
|
|
502
502
|
xmlns: "http://www.w3.org/2000/svg",
|
|
503
503
|
viewBox: "0 0 24 24",
|
|
504
504
|
fill: "currentColor",
|
|
@@ -511,8 +511,8 @@ function ot(e, n) {
|
|
|
511
511
|
})
|
|
512
512
|
]);
|
|
513
513
|
}
|
|
514
|
-
function rt(e,
|
|
515
|
-
return u(),
|
|
514
|
+
function rt(e, o) {
|
|
515
|
+
return u(), c("svg", {
|
|
516
516
|
xmlns: "http://www.w3.org/2000/svg",
|
|
517
517
|
viewBox: "0 0 24 24",
|
|
518
518
|
fill: "currentColor",
|
|
@@ -525,7 +525,7 @@ function rt(e, n) {
|
|
|
525
525
|
})
|
|
526
526
|
]);
|
|
527
527
|
}
|
|
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"],
|
|
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"], hl = {
|
|
529
529
|
__name: "datepicker",
|
|
530
530
|
props: {
|
|
531
531
|
modelValue: [Date, Boolean],
|
|
@@ -537,98 +537,98 @@ const ut = { class: "flex flex-row items-center py-2 px-3 text-white bg-vxvue-70
|
|
|
537
537
|
hasInput: { type: Boolean, default: !0 }
|
|
538
538
|
},
|
|
539
539
|
emits: ["update:modelValue", "month-change"],
|
|
540
|
-
setup(e, { emit:
|
|
540
|
+
setup(e, { emit: o }) {
|
|
541
541
|
const l = e, s = (() => {
|
|
542
542
|
let y = /* @__PURE__ */ new Date();
|
|
543
543
|
return new Date(y.getFullYear(), y.getMonth(), y.getDate());
|
|
544
|
-
})(), t = g(new Date(s.getFullYear(), s.getMonth(), 1)),
|
|
545
|
-
const y = [],
|
|
546
|
-
for (let
|
|
547
|
-
y.push(new Date(
|
|
544
|
+
})(), t = g(new Date(s.getFullYear(), s.getMonth(), 1)), r = g(null), n = g(!l.hasInput), a = g("left-0"), d = g("top-0"), v = g(null), h = g(null), m = S(() => l.hasInput ? { class: ["absolute", n.value ? "block" : "hidden"] } : {}), f = S(() => {
|
|
545
|
+
const y = [], V = t.value.getFullYear(), k = t.value.getMonth(), T = new Date(V, k + 1, 0), X = new Date(V, k, 0).getDay() + 1 - l.startOfWeekIndex, G = (6 + l.startOfWeekIndex - T.getDay()) % 7;
|
|
546
|
+
for (let U = -X, Z = T.getDate() + G; U < Z; ++U)
|
|
547
|
+
y.push(new Date(V, k, U + 1));
|
|
548
548
|
return y;
|
|
549
|
-
}),
|
|
550
|
-
|
|
551
|
-
y ? (
|
|
552
|
-
}, { immediate: !0 }),
|
|
549
|
+
}), p = S(() => l.startOfWeekIndex ? l.dayNames.slice(1).concat(l.dayNames[0]) : l.dayNames.slice());
|
|
550
|
+
j(() => l.modelValue, (y) => {
|
|
551
|
+
y ? (r.value = new Date(y.getFullYear(), y.getMonth(), y.getDate()), t.value = new Date(r.value.getTime())) : (r.value = null, t.value = new Date(s.getTime())), t.value.setDate(1);
|
|
552
|
+
}, { immediate: !0 }), j(n, (y) => {
|
|
553
553
|
y && l.hasInput && te(() => {
|
|
554
|
-
const
|
|
555
|
-
a.value =
|
|
554
|
+
const V = v.value.$el.getBoundingClientRect(), k = h.value.getBoundingClientRect();
|
|
555
|
+
a.value = V.left + k.width > window.innerWidth ? "right-0" : "left-0", d.value = V.bottom + k.height > window.innerHeight ? "bottom-0 -translate-y-12" : "top-0 translate-y-12";
|
|
556
556
|
});
|
|
557
|
-
}), le(
|
|
558
|
-
const
|
|
559
|
-
t.value = new Date(t.value.getFullYear(), t.value.getMonth() - 1, 1),
|
|
560
|
-
},
|
|
561
|
-
t.value = new Date(t.value.getFullYear(), t.value.getMonth() + 1, 1),
|
|
557
|
+
}), le(h, () => n.value = !1);
|
|
558
|
+
const $ = () => {
|
|
559
|
+
t.value = new Date(t.value.getFullYear(), t.value.getMonth() - 1, 1), o("month-change", t.value);
|
|
560
|
+
}, N = () => {
|
|
561
|
+
t.value = new Date(t.value.getFullYear(), t.value.getMonth() + 1, 1), o("month-change", t.value);
|
|
562
562
|
}, L = (y) => {
|
|
563
|
-
|
|
563
|
+
r.value = y, o("update:modelValue", y), n.value = !l.hasInput;
|
|
564
564
|
}, z = (y) => {
|
|
565
|
-
|
|
565
|
+
r.value = y, o("update:modelValue", y);
|
|
566
566
|
};
|
|
567
|
-
return (y,
|
|
568
|
-
class:
|
|
567
|
+
return (y, V) => (u(), c("div", {
|
|
568
|
+
class: w(["relative", y.$attrs.class])
|
|
569
569
|
}, [
|
|
570
|
-
e.hasInput ? (u(), R(at,
|
|
570
|
+
e.hasInput ? (u(), R(at, Y({
|
|
571
571
|
key: 0,
|
|
572
|
-
modelValue:
|
|
573
|
-
onToggleDatepicker:
|
|
572
|
+
modelValue: r.value,
|
|
573
|
+
onToggleDatepicker: V[0] || (V[0] = (k) => n.value = !0),
|
|
574
574
|
"onUpdate:modelValue": z
|
|
575
575
|
}, y.$attrs, {
|
|
576
576
|
ref_key: "input",
|
|
577
|
-
ref:
|
|
577
|
+
ref: v,
|
|
578
578
|
class: "w-full",
|
|
579
579
|
locale: e.locale
|
|
580
580
|
}), {
|
|
581
581
|
default: K(() => [
|
|
582
|
-
|
|
582
|
+
M(y.$slots, "default")
|
|
583
583
|
]),
|
|
584
584
|
_: 3
|
|
585
585
|
}, 16, ["modelValue", "locale"])) : C("", !0),
|
|
586
|
-
i("div",
|
|
586
|
+
i("div", Y({ class: "z-10 bg-white shadow-md" }, m.value, {
|
|
587
587
|
ref_key: "calendar",
|
|
588
|
-
ref:
|
|
589
|
-
class: [a.value,
|
|
588
|
+
ref: h,
|
|
589
|
+
class: [a.value, d.value]
|
|
590
590
|
}), [
|
|
591
591
|
i("div", ut, [
|
|
592
592
|
i("button", {
|
|
593
|
-
onClick:
|
|
593
|
+
onClick: P($, ["stop"]),
|
|
594
594
|
class: "flex-shrink-0 text-vxvue-100 hover:text-vxvue-50"
|
|
595
595
|
}, [
|
|
596
|
-
|
|
596
|
+
E(A(ve), { class: "w-6 h-6" })
|
|
597
597
|
], 8, it),
|
|
598
598
|
i("div", ct, _(t.value.toLocaleString(e.locale, { month: "long" })) + " " + _(t.value.getFullYear()), 1),
|
|
599
599
|
i("button", {
|
|
600
|
-
onClick:
|
|
600
|
+
onClick: P(N, ["stop"]),
|
|
601
601
|
class: "flex-shrink-0 text-vxvue-100 hover:text-vxvue-50"
|
|
602
602
|
}, [
|
|
603
|
-
|
|
603
|
+
E(A(fe), { class: "w-6 h-6" })
|
|
604
604
|
], 8, dt)
|
|
605
605
|
]),
|
|
606
606
|
i("div", vt, [
|
|
607
|
-
(u(!0),
|
|
607
|
+
(u(!0), c(D, null, B(p.value, (k, T) => (u(), c("div", {
|
|
608
608
|
class: "py-2 text-center bg-gray-200",
|
|
609
|
-
key:
|
|
610
|
-
}, _(
|
|
611
|
-
(u(!0),
|
|
612
|
-
class:
|
|
609
|
+
key: T
|
|
610
|
+
}, _(k), 1))), 128)),
|
|
611
|
+
(u(!0), c(D, null, B(f.value, (k) => (u(), c("div", {
|
|
612
|
+
class: w(["text-center", k.getMonth() - t.value.getMonth() === 0 ? "text-vxvue-700" : "text-gray-400"])
|
|
613
613
|
}, [
|
|
614
614
|
i("button", {
|
|
615
|
-
class:
|
|
615
|
+
class: w([
|
|
616
616
|
{
|
|
617
|
-
"bg-vxvue-700 text-white":
|
|
618
|
-
"bg-gray-200":
|
|
619
|
-
"text-red-400": e.validFrom && e.validFrom >
|
|
617
|
+
"bg-vxvue-700 text-white": r.value && k.getTime() === r.value.getTime(),
|
|
618
|
+
"bg-gray-200": k.getTime() === A(s).getTime(),
|
|
619
|
+
"text-red-400": e.validFrom && e.validFrom > k || e.validUntil && e.validUntil < k
|
|
620
620
|
},
|
|
621
621
|
"py-2 px-3 rounded-sm"
|
|
622
622
|
]),
|
|
623
|
-
disabled: e.validFrom && e.validFrom >
|
|
624
|
-
onClick:
|
|
625
|
-
}, _(
|
|
623
|
+
disabled: e.validFrom && e.validFrom > k || e.validUntil && e.validUntil < k,
|
|
624
|
+
onClick: P((T) => e.validFrom && e.validFrom > k || e.validUntil && e.validUntil < k ? null : L(k), ["stop"])
|
|
625
|
+
}, _(k.getDate()), 11, ft)
|
|
626
626
|
], 2))), 256))
|
|
627
627
|
])
|
|
628
628
|
], 16)
|
|
629
629
|
], 2));
|
|
630
630
|
}
|
|
631
|
-
},
|
|
631
|
+
}, pt = ["for"], ht = ["id", "multiple", "accept"], ml = {
|
|
632
632
|
__name: "form-file-button",
|
|
633
633
|
props: {
|
|
634
634
|
modelValue: { type: Array },
|
|
@@ -638,22 +638,22 @@ const ut = { class: "flex flex-row items-center py-2 px-3 text-white bg-vxvue-70
|
|
|
638
638
|
id: { type: String, default: "form-file-button-" + Math.ceil(Math.random() * 1e3) }
|
|
639
639
|
},
|
|
640
640
|
emits: ["update:modelValue", "form-data"],
|
|
641
|
-
setup(e, { emit:
|
|
642
|
-
const l = e, s = (
|
|
643
|
-
const
|
|
644
|
-
for (let a of
|
|
645
|
-
|
|
646
|
-
return
|
|
647
|
-
}, t = (
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
650
|
-
const a = [...
|
|
651
|
-
|
|
641
|
+
setup(e, { emit: o }) {
|
|
642
|
+
const l = e, s = (r) => {
|
|
643
|
+
const n = new FormData();
|
|
644
|
+
for (let a of r)
|
|
645
|
+
n.append(l.name, a, a.name);
|
|
646
|
+
return n;
|
|
647
|
+
}, t = (r) => {
|
|
648
|
+
const n = r.target.files || r.dataTransfer.files;
|
|
649
|
+
if (n) {
|
|
650
|
+
const a = [...n];
|
|
651
|
+
o("update:modelValue", a), o("form-data", s(a));
|
|
652
652
|
}
|
|
653
653
|
};
|
|
654
|
-
return (
|
|
655
|
-
|
|
656
|
-
|
|
654
|
+
return (r, n) => (u(), c("label", { for: e.id }, [
|
|
655
|
+
M(r.$slots, "default", {}, () => [
|
|
656
|
+
F("Upload")
|
|
657
657
|
]),
|
|
658
658
|
i("input", {
|
|
659
659
|
type: "file",
|
|
@@ -662,73 +662,73 @@ const ut = { class: "flex flex-row items-center py-2 px-3 text-white bg-vxvue-70
|
|
|
662
662
|
accept: e.accept,
|
|
663
663
|
onChange: t,
|
|
664
664
|
class: "hidden"
|
|
665
|
-
}, null, 40,
|
|
666
|
-
], 8,
|
|
665
|
+
}, null, 40, ht)
|
|
666
|
+
], 8, pt));
|
|
667
667
|
}
|
|
668
668
|
}, mt = ["value"], gt = {
|
|
669
669
|
key: 0,
|
|
670
670
|
disabled: "",
|
|
671
671
|
value: ""
|
|
672
|
-
}, bt = ["value", "selected"],
|
|
672
|
+
}, bt = ["value", "selected"], xt = {
|
|
673
673
|
__name: "form-select",
|
|
674
674
|
props: { options: Array, modelValue: [String, Number], disabledLabel: String },
|
|
675
675
|
emits: ["update:modelValue"],
|
|
676
|
-
setup(e, { emit:
|
|
677
|
-
return (l, s) => (u(),
|
|
676
|
+
setup(e, { emit: o }) {
|
|
677
|
+
return (l, s) => (u(), c("select", Y(l.$attrs, {
|
|
678
678
|
value: e.modelValue,
|
|
679
679
|
class: "form-select",
|
|
680
|
-
onChange: s[0] || (s[0] = (t) =>
|
|
680
|
+
onChange: s[0] || (s[0] = (t) => o("update:modelValue", t.target.value))
|
|
681
681
|
}), [
|
|
682
|
-
e.disabledLabel ? (u(),
|
|
683
|
-
(u(!0),
|
|
682
|
+
e.disabledLabel ? (u(), c("option", gt, _(e.disabledLabel), 1)) : C("", !0),
|
|
683
|
+
(u(!0), c(D, null, B(e.options, (t) => (u(), c("option", {
|
|
684
684
|
value: t.key !== void 0 ? t.key : t.label || t,
|
|
685
685
|
selected: (t.key !== void 0 ? t.key : t.label || t) === e.modelValue
|
|
686
686
|
}, _(t.label || t), 9, bt))), 256))
|
|
687
687
|
], 16, mt));
|
|
688
688
|
}
|
|
689
|
-
},
|
|
689
|
+
}, yt = ["aria-checked"], wt = ["checked"], gl = {
|
|
690
690
|
__name: "form-switch",
|
|
691
691
|
props: ["modelValue"],
|
|
692
692
|
emits: ["update:modelValue"],
|
|
693
|
-
setup(e, { emit:
|
|
694
|
-
const l = e, s = S(() => l.modelValue ? "bg-vxvue" : "bg-slate-200"), t = S(() => l.modelValue ? "translate-x-5" : "translate-x-0"),
|
|
695
|
-
let
|
|
696
|
-
return delete
|
|
693
|
+
setup(e, { emit: o }) {
|
|
694
|
+
const l = e, s = S(() => l.modelValue ? "bg-vxvue" : "bg-slate-200"), t = S(() => l.modelValue ? "translate-x-5" : "translate-x-0"), r = S(() => {
|
|
695
|
+
let n = Object.assign({}, q());
|
|
696
|
+
return delete n.class, n;
|
|
697
697
|
});
|
|
698
|
-
return (
|
|
698
|
+
return (n, a) => (u(), c(D, null, [
|
|
699
699
|
i("label", {
|
|
700
|
-
class:
|
|
700
|
+
class: w(n.$attrs.class)
|
|
701
701
|
}, [
|
|
702
702
|
i("span", {
|
|
703
|
-
class:
|
|
703
|
+
class: w([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
704
|
role: "switch",
|
|
705
705
|
"aria-checked": !!e.modelValue
|
|
706
706
|
}, [
|
|
707
707
|
i("span", {
|
|
708
708
|
"aria-hidden": "true",
|
|
709
|
-
class:
|
|
709
|
+
class: w([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
710
|
}, null, 2),
|
|
711
|
-
i("input",
|
|
711
|
+
i("input", Y({
|
|
712
712
|
class: "hidden",
|
|
713
713
|
value: "1",
|
|
714
714
|
type: "checkbox",
|
|
715
|
-
onChange: a[0] || (a[0] = (
|
|
716
|
-
},
|
|
717
|
-
], 10,
|
|
715
|
+
onChange: a[0] || (a[0] = (d) => o("update:modelValue", d.target.checked))
|
|
716
|
+
}, r.value, { checked: e.modelValue }), null, 16, wt)
|
|
717
|
+
], 10, yt)
|
|
718
718
|
], 2),
|
|
719
|
-
|
|
719
|
+
M(n.$slots, "default")
|
|
720
720
|
], 64));
|
|
721
721
|
}
|
|
722
722
|
};
|
|
723
|
-
const
|
|
723
|
+
const pe = (e, o) => {
|
|
724
724
|
const l = e.__vccOpts || e;
|
|
725
|
-
for (const [s, t] of
|
|
725
|
+
for (const [s, t] of o)
|
|
726
726
|
l[s] = t;
|
|
727
727
|
return l;
|
|
728
|
-
},
|
|
728
|
+
}, kt = (e) => ($e("data-v-1be10676"), e = e(), _e(), e), $t = {
|
|
729
729
|
"aria-live": "assertive",
|
|
730
730
|
class: "flex fixed inset-0 z-50 items-start py-6 px-4 pointer-events-none sm:p-6"
|
|
731
|
-
},
|
|
731
|
+
}, _t = { class: "flex flex-col items-center space-y-4 w-full" }, Ct = { class: "p-4" }, St = { class: "flex items-start" }, Mt = { class: "flex-shrink-0" }, Dt = { class: "flex-1 pt-0.5 ml-3 w-0" }, Vt = { class: "font-bold" }, Pt = { class: "mt-1" }, At = { class: "flex flex-shrink-0 ml-4" }, Bt = /* @__PURE__ */ kt(() => /* @__PURE__ */ i("span", { class: "sr-only" }, "Close", -1)), It = /* @__PURE__ */ Object.assign({
|
|
732
732
|
inheritAttrs: !1
|
|
733
733
|
}, {
|
|
734
734
|
__name: "message-toast",
|
|
@@ -739,44 +739,44 @@ const he = (e, n) => {
|
|
|
739
739
|
active: { type: Boolean, default: !1 }
|
|
740
740
|
},
|
|
741
741
|
emits: ["timeout", "close"],
|
|
742
|
-
setup(e, { emit:
|
|
743
|
-
const l = e, s = g(null), t = S(() => typeof l.message == "string" ? [l.message] : l.message),
|
|
742
|
+
setup(e, { emit: o }) {
|
|
743
|
+
const l = e, s = g(null), t = S(() => typeof l.message == "string" ? [l.message] : l.message), r = () => {
|
|
744
744
|
window.clearTimeout(s.value), l.active && l.timeout && (s.value = window.setTimeout(() => {
|
|
745
|
-
|
|
745
|
+
o("timeout");
|
|
746
746
|
}, l.timeout));
|
|
747
747
|
};
|
|
748
|
-
return
|
|
749
|
-
i("div",
|
|
750
|
-
|
|
748
|
+
return j(() => l.active, r), re(r), (n, a) => (u(), c("div", $t, [
|
|
749
|
+
i("div", _t, [
|
|
750
|
+
E(ee, { name: "messagetoast-fade" }, {
|
|
751
751
|
default: K(() => [
|
|
752
|
-
e.active ? (u(),
|
|
752
|
+
e.active ? (u(), c("div", {
|
|
753
753
|
key: 0,
|
|
754
|
-
class:
|
|
754
|
+
class: w(["overflow-hidden w-full max-w-sm rounded-md ring-1 ring-black ring-opacity-5 shadow-lg pointer-events-auto", n.$attrs.class])
|
|
755
755
|
}, [
|
|
756
|
-
i("div",
|
|
757
|
-
i("div",
|
|
758
|
-
i("div", St, [
|
|
759
|
-
D(r.$slots, "icon", {}, void 0, !0)
|
|
760
|
-
]),
|
|
756
|
+
i("div", Ct, [
|
|
757
|
+
i("div", St, [
|
|
761
758
|
i("div", Mt, [
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
759
|
+
M(n.$slots, "icon", {}, void 0, !0)
|
|
760
|
+
]),
|
|
761
|
+
i("div", Dt, [
|
|
762
|
+
i("p", Vt, [
|
|
763
|
+
M(n.$slots, "title", {}, () => [
|
|
764
|
+
F(_(e.title), 1)
|
|
765
765
|
], !0)
|
|
766
766
|
]),
|
|
767
|
-
(u(!0),
|
|
768
|
-
|
|
769
|
-
|
|
767
|
+
(u(!0), c(D, null, B(t.value, (d) => (u(), c("p", Pt, [
|
|
768
|
+
M(n.$slots, "default", {}, () => [
|
|
769
|
+
F(_(d), 1)
|
|
770
770
|
], !0)
|
|
771
771
|
]))), 256))
|
|
772
772
|
]),
|
|
773
|
-
i("div",
|
|
773
|
+
i("div", At, [
|
|
774
774
|
i("button", {
|
|
775
|
-
onClick: a[0] || (a[0] = (
|
|
775
|
+
onClick: a[0] || (a[0] = (d) => o("close")),
|
|
776
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"
|
|
777
777
|
}, [
|
|
778
|
-
|
|
779
|
-
|
|
778
|
+
Bt,
|
|
779
|
+
E(A(rt), { class: "w-5 h-5" })
|
|
780
780
|
])
|
|
781
781
|
])
|
|
782
782
|
])
|
|
@@ -788,14 +788,14 @@ const he = (e, n) => {
|
|
|
788
788
|
])
|
|
789
789
|
]));
|
|
790
790
|
}
|
|
791
|
-
}),
|
|
791
|
+
}), bl = /* @__PURE__ */ pe(It, [["__scopeId", "data-v-1be10676"]]), Ft = {
|
|
792
792
|
key: 0,
|
|
793
793
|
class: "fixed inset-0 z-[9998] bg-white/50 backdrop-blur-sm",
|
|
794
794
|
"aria-hidden": "true"
|
|
795
795
|
}, Lt = {
|
|
796
796
|
key: 0,
|
|
797
797
|
class: "fixed inset-0 z-[9999]"
|
|
798
|
-
},
|
|
798
|
+
}, Tt = { class: "flex justify-center items-center h-screen" }, xl = {
|
|
799
799
|
__name: "modal",
|
|
800
800
|
props: {
|
|
801
801
|
show: Boolean,
|
|
@@ -804,28 +804,28 @@ const he = (e, n) => {
|
|
|
804
804
|
contentClass: { type: String, default: "" }
|
|
805
805
|
},
|
|
806
806
|
emits: ["clicked-outside"],
|
|
807
|
-
setup(e, { emit:
|
|
807
|
+
setup(e, { emit: o }) {
|
|
808
808
|
const l = g(null);
|
|
809
|
-
return le(l, () =>
|
|
810
|
-
e.show ? (u(),
|
|
811
|
-
|
|
809
|
+
return le(l, () => o("clicked-outside")), (s, t) => (u(), c(D, null, [
|
|
810
|
+
e.show ? (u(), c("div", Ft)) : C("", !0),
|
|
811
|
+
E(ee, { name: "appear" }, {
|
|
812
812
|
default: K(() => [
|
|
813
|
-
e.show ? (u(),
|
|
814
|
-
i("div",
|
|
813
|
+
e.show ? (u(), c("div", Lt, [
|
|
814
|
+
i("div", Tt, [
|
|
815
815
|
i("div", {
|
|
816
|
-
class:
|
|
816
|
+
class: w(["overflow-hidden relative max-w-full bg-white rounded ring-1 ring-black ring-opacity-10 shadow-xl transition-all transform xl:max-w-screen-xl", e.containerClass]),
|
|
817
817
|
ref_key: "container",
|
|
818
818
|
ref: l
|
|
819
819
|
}, [
|
|
820
820
|
i("div", {
|
|
821
|
-
class:
|
|
821
|
+
class: w(e.headerClass)
|
|
822
822
|
}, [
|
|
823
|
-
|
|
823
|
+
M(s.$slots, "title")
|
|
824
824
|
], 2),
|
|
825
825
|
i("div", {
|
|
826
|
-
class:
|
|
826
|
+
class: w(["overflow-y-auto h-full pb-4 mt-16", e.contentClass])
|
|
827
827
|
}, [
|
|
828
|
-
|
|
828
|
+
M(s.$slots, "default")
|
|
829
829
|
], 2)
|
|
830
830
|
], 2)
|
|
831
831
|
])
|
|
@@ -835,7 +835,7 @@ const he = (e, n) => {
|
|
|
835
835
|
})
|
|
836
836
|
], 64));
|
|
837
837
|
}
|
|
838
|
-
},
|
|
838
|
+
}, Ot = { class: "flex justify-between items-center px-4 sm:px-0" }, jt = { class: "flex flex-1 -mt-px w-0" }, Yt = ["onClick"], Et = { class: "hidden md:flex md:-mt-px" }, Nt = { class: "flex flex-1 justify-end -mt-px w-0" }, zt = ["onClick"], yl = {
|
|
839
839
|
__name: "pagination",
|
|
840
840
|
props: {
|
|
841
841
|
page: { type: Number, default: 1 },
|
|
@@ -860,69 +860,69 @@ const he = (e, n) => {
|
|
|
860
860
|
}
|
|
861
861
|
},
|
|
862
862
|
emits: ["update:page"],
|
|
863
|
-
setup(e, { emit:
|
|
864
|
-
const l = e, s = g(Math.ceil(l.total / l.perPage)), t = g(null),
|
|
865
|
-
let
|
|
863
|
+
setup(e, { emit: o }) {
|
|
864
|
+
const l = e, s = g(Math.ceil(l.total / l.perPage)), t = g(null), r = S(() => l.markerPosition === "above" ? "border-t-2 pt-4" : "border-b-2 pb-4"), n = S(() => {
|
|
865
|
+
let v = [1];
|
|
866
866
|
if (l.showAllPages || s.value <= 7) {
|
|
867
|
-
for (let
|
|
868
|
-
|
|
869
|
-
return
|
|
867
|
+
for (let h = 2; h <= s.value; ++h)
|
|
868
|
+
v.push(h);
|
|
869
|
+
return v;
|
|
870
870
|
}
|
|
871
|
-
return t.value >= s.value ?
|
|
871
|
+
return t.value >= s.value ? v.push("dots", t.value - 2, t.value - 1) : t.value - 1 && t.value - 1 > 1 && (t.value > 1 && v.push("dots"), v.push(t.value - 1)), t.value > 1 && v.push(t.value), t.value + 1 < s.value && (v.push(t.value + 1), t.value <= 1 && v.push(t.value + 2), t.value + 2 < s.value && v.push("dots")), t.value < s.value && v.push(s.value), v;
|
|
872
872
|
}), a = () => {
|
|
873
|
-
t.value > 1 &&
|
|
874
|
-
},
|
|
875
|
-
t.value < s.value &&
|
|
873
|
+
t.value > 1 && o("update:page", t.value - 1);
|
|
874
|
+
}, d = () => {
|
|
875
|
+
t.value < s.value && o("update:page", t.value + 1);
|
|
876
876
|
};
|
|
877
|
-
return
|
|
878
|
-
s.value = Math.ceil(l.total / l.perPage),
|
|
879
|
-
}),
|
|
880
|
-
s.value = Math.ceil(l.total / l.perPage), t.value > s.value &&
|
|
881
|
-
}), (
|
|
882
|
-
i("div",
|
|
883
|
-
e.showNavButtons ? (u(),
|
|
877
|
+
return j(() => l.page, (v) => t.value = Math.min(Math.max(v, 1), s.value), { immediate: !0 }), j(() => l.perPage, (v) => {
|
|
878
|
+
s.value = Math.ceil(l.total / l.perPage), o("update:page", 1);
|
|
879
|
+
}), j(() => l.total, (v) => {
|
|
880
|
+
s.value = Math.ceil(l.total / l.perPage), t.value > s.value && o("update:page", 1);
|
|
881
|
+
}), (v, h) => (u(), c("nav", Ot, [
|
|
882
|
+
i("div", jt, [
|
|
883
|
+
e.showNavButtons ? (u(), c("a", {
|
|
884
884
|
key: 0,
|
|
885
|
-
onClick:
|
|
885
|
+
onClick: P(a, ["prevent"]),
|
|
886
886
|
href: "#",
|
|
887
|
-
class:
|
|
887
|
+
class: w(["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 }, r.value]])
|
|
888
888
|
}, [
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
], 10,
|
|
889
|
+
E(A(ve), { class: "w-5 h-5" }),
|
|
890
|
+
F(" " + _(e.prevText), 1)
|
|
891
|
+
], 10, Yt)) : C("", !0)
|
|
892
892
|
]),
|
|
893
|
-
i("div",
|
|
894
|
-
(u(!0),
|
|
895
|
-
onClick:
|
|
893
|
+
i("div", Et, [
|
|
894
|
+
(u(!0), c(D, null, B(n.value, (m, f) => (u(), R(ue(m !== "dots" ? "a" : "span"), {
|
|
895
|
+
onClick: P((p) => m !== "dots" ? o("update:page", m) : null, ["prevent"]),
|
|
896
896
|
key: f,
|
|
897
897
|
href: m !== "dots" ? "#" : null,
|
|
898
|
-
class:
|
|
898
|
+
class: w(["inline-flex items-center px-4 text-sm font-medium", [{
|
|
899
899
|
"border-vxvue-500 text-vxvue-700": m === t.value,
|
|
900
900
|
"border-transparent text-gray-500": m !== t.value,
|
|
901
901
|
"hover:text-gray-700 hover:border-gray-300": m !== "dots"
|
|
902
|
-
},
|
|
902
|
+
}, r.value]])
|
|
903
903
|
}, {
|
|
904
904
|
default: K(() => [
|
|
905
|
-
|
|
905
|
+
F(_(m !== "dots" ? m : "..."), 1)
|
|
906
906
|
]),
|
|
907
907
|
_: 2
|
|
908
908
|
}, 1032, ["onClick", "href", "class"]))), 128))
|
|
909
909
|
]),
|
|
910
|
-
i("div",
|
|
911
|
-
e.showNavButtons ? (u(),
|
|
910
|
+
i("div", Nt, [
|
|
911
|
+
e.showNavButtons ? (u(), c("a", {
|
|
912
912
|
key: 0,
|
|
913
|
-
onClick:
|
|
913
|
+
onClick: P(d, ["prevent"]),
|
|
914
914
|
href: "#",
|
|
915
|
-
class:
|
|
915
|
+
class: w(["inline-flex items-center pl-1 text-sm font-medium text-gray-500 border-transparent hover:text-gray-700 hover:border-gray-300", [r.value, { "cursor-default pointer-events-none": t.value >= s.value }]])
|
|
916
916
|
}, [
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
], 10,
|
|
917
|
+
F(_(e.nextText) + " ", 1),
|
|
918
|
+
E(A(fe), { class: "w-5 h-5" })
|
|
919
|
+
], 10, zt)) : C("", !0)
|
|
920
920
|
])
|
|
921
921
|
]));
|
|
922
922
|
}
|
|
923
923
|
};
|
|
924
|
-
function
|
|
925
|
-
return u(),
|
|
924
|
+
function Rt(e, o) {
|
|
925
|
+
return u(), c("svg", {
|
|
926
926
|
xmlns: "http://www.w3.org/2000/svg",
|
|
927
927
|
fill: "none",
|
|
928
928
|
viewBox: "0 0 24 24",
|
|
@@ -937,8 +937,8 @@ function zt(e, n) {
|
|
|
937
937
|
})
|
|
938
938
|
]);
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
return u(),
|
|
940
|
+
function Ut(e, o) {
|
|
941
|
+
return u(), c("svg", {
|
|
942
942
|
xmlns: "http://www.w3.org/2000/svg",
|
|
943
943
|
fill: "none",
|
|
944
944
|
viewBox: "0 0 24 24",
|
|
@@ -958,83 +958,83 @@ function Rt(e, n) {
|
|
|
958
958
|
})
|
|
959
959
|
]);
|
|
960
960
|
}
|
|
961
|
-
const Ht = ["value", "type"],
|
|
961
|
+
const Ht = ["value", "type"], wl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
962
962
|
__name: "password-input",
|
|
963
963
|
props: ["modelValue"],
|
|
964
964
|
emits: ["update:modelValue"],
|
|
965
|
-
setup(e, { emit:
|
|
965
|
+
setup(e, { emit: o }) {
|
|
966
966
|
const l = g(!1), s = S(() => {
|
|
967
967
|
let t = Object.assign({}, q());
|
|
968
968
|
return delete t.class, t;
|
|
969
969
|
});
|
|
970
|
-
return (t,
|
|
971
|
-
class:
|
|
970
|
+
return (t, r) => (u(), c("div", {
|
|
971
|
+
class: w("inline-block relative " + q().class)
|
|
972
972
|
}, [
|
|
973
|
-
i("input",
|
|
973
|
+
i("input", Y({
|
|
974
974
|
value: e.modelValue,
|
|
975
975
|
type: l.value ? "text" : "password",
|
|
976
|
-
onInput:
|
|
976
|
+
onInput: r[0] || (r[0] = (n) => o("update:modelValue", n.target.value))
|
|
977
977
|
}, s.value, { class: "block pr-10 w-full form-input peer" }), null, 16, Ht),
|
|
978
978
|
i("button", {
|
|
979
|
-
onClick:
|
|
979
|
+
onClick: r[1] || (r[1] = P((n) => l.value = !l.value, ["stop"])),
|
|
980
980
|
class: "flex absolute inset-y-0 right-0 items-center pr-3 text-brand-700 hover:text-brand"
|
|
981
981
|
}, [
|
|
982
|
-
l.value ? (u(), R(
|
|
982
|
+
l.value ? (u(), R(A(Rt), {
|
|
983
983
|
key: 0,
|
|
984
984
|
class: "w-5 h-5"
|
|
985
|
-
})) : (u(), R(
|
|
985
|
+
})) : (u(), R(A(Ut), {
|
|
986
986
|
key: 1,
|
|
987
987
|
class: "w-5 h-5"
|
|
988
988
|
}))
|
|
989
989
|
]),
|
|
990
|
-
|
|
990
|
+
M(t.$slots, "default")
|
|
991
991
|
], 2));
|
|
992
992
|
}
|
|
993
|
-
}),
|
|
993
|
+
}), Wt = { class: "flex items-center pb-1" }, qt = ["id", "checked"], Kt = ["for"], Gt = { key: 1 }, Xt = ["href"], Zt = {
|
|
994
994
|
key: 0,
|
|
995
995
|
class: "ml-6"
|
|
996
|
-
},
|
|
996
|
+
}, kl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
997
997
|
__name: "simple-tree",
|
|
998
998
|
props: { branch: { type: Object, default: {} } },
|
|
999
999
|
emits: ["branch-selected", "expand"],
|
|
1000
|
-
setup(e, { emit:
|
|
1000
|
+
setup(e, { emit: o }) {
|
|
1001
1001
|
const l = e, s = g(!1);
|
|
1002
1002
|
return re(() => {
|
|
1003
|
-
l.branch.current &&
|
|
1004
|
-
}), (t,
|
|
1005
|
-
const
|
|
1006
|
-
return u(),
|
|
1007
|
-
class:
|
|
1003
|
+
l.branch.current && o("expand", !0);
|
|
1004
|
+
}), (t, r) => {
|
|
1005
|
+
const n = Ce("simple-tree", !0);
|
|
1006
|
+
return u(), c("div", {
|
|
1007
|
+
class: w([!e.branch.branches || !e.branch.branches.length ? "terminates" : "", t.$attrs.class])
|
|
1008
1008
|
}, [
|
|
1009
|
-
i("div",
|
|
1010
|
-
e.branch.branches && e.branch.branches.length ? (u(),
|
|
1009
|
+
i("div", Wt, [
|
|
1010
|
+
e.branch.branches && e.branch.branches.length ? (u(), c(D, { key: 0 }, [
|
|
1011
1011
|
i("input", {
|
|
1012
1012
|
type: "checkbox",
|
|
1013
1013
|
id: "branch-" + e.branch.id,
|
|
1014
|
-
onClick:
|
|
1014
|
+
onClick: r[0] || (r[0] = (a) => s.value = !s.value),
|
|
1015
1015
|
checked: s.value,
|
|
1016
1016
|
class: "hidden"
|
|
1017
|
-
}, null, 8,
|
|
1017
|
+
}, null, 8, qt),
|
|
1018
1018
|
i("label", {
|
|
1019
1019
|
for: "branch-" + e.branch.id,
|
|
1020
1020
|
class: "mr-2"
|
|
1021
1021
|
}, [
|
|
1022
|
-
(u(), R(ue(s.value ?
|
|
1023
|
-
], 8,
|
|
1022
|
+
(u(), R(ue(s.value ? A(nt) : A(ot)), { class: "w-4 h-4 border" }))
|
|
1023
|
+
], 8, Kt)
|
|
1024
1024
|
], 64)) : C("", !0),
|
|
1025
|
-
e.branch.current ? (u(),
|
|
1025
|
+
e.branch.current ? (u(), c("strong", Gt, _(e.branch.label), 1)) : (u(), c("a", {
|
|
1026
1026
|
key: 2,
|
|
1027
1027
|
href: e.branch.path,
|
|
1028
|
-
onClick:
|
|
1029
|
-
}, _(e.branch.label), 9,
|
|
1028
|
+
onClick: r[1] || (r[1] = P((a) => o("branch-selected", e.branch), ["prevent"]))
|
|
1029
|
+
}, _(e.branch.label), 9, Xt))
|
|
1030
1030
|
]),
|
|
1031
|
-
e.branch.branches && e.branch.branches.length ? oe((u(),
|
|
1032
|
-
(u(!0),
|
|
1031
|
+
e.branch.branches && e.branch.branches.length ? oe((u(), c("ul", Zt, [
|
|
1032
|
+
(u(!0), c(D, null, B(e.branch.branches, (a) => (u(), R(n, {
|
|
1033
1033
|
branch: a,
|
|
1034
1034
|
key: a.id,
|
|
1035
|
-
onBranchSelected:
|
|
1036
|
-
onExpand:
|
|
1037
|
-
s.value =
|
|
1035
|
+
onBranchSelected: r[2] || (r[2] = (d) => o("branch-selected", d)),
|
|
1036
|
+
onExpand: r[3] || (r[3] = (d) => {
|
|
1037
|
+
s.value = d, o("expand", d);
|
|
1038
1038
|
})
|
|
1039
1039
|
}, null, 8, ["branch"]))), 128))
|
|
1040
1040
|
], 512)), [
|
|
@@ -1044,28 +1044,28 @@ const Ht = ["value", "type"], ml = /* @__PURE__ */ Object.assign({ inheritAttrs:
|
|
|
1044
1044
|
};
|
|
1045
1045
|
}
|
|
1046
1046
|
});
|
|
1047
|
-
const
|
|
1047
|
+
const Jt = { class: "overflow-hidden rounded ring-1 ring-opacity-10 shadow ring-slate-500" }, Qt = { class: "min-w-full divide-y divide-y-slate-900" }, el = { class: "text-white bg-slate-700" }, tl = ["onClick"], ll = { class: "flex items-center" }, sl = {
|
|
1048
1048
|
key: 0,
|
|
1049
1049
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1050
1050
|
class: "flex-shrink-0 ml-2 w-4 h-4",
|
|
1051
1051
|
fill: "none",
|
|
1052
1052
|
viewBox: "0 0 24 24",
|
|
1053
1053
|
stroke: "currentColor"
|
|
1054
|
-
},
|
|
1054
|
+
}, al = ["d"], nl = {
|
|
1055
1055
|
key: 1,
|
|
1056
1056
|
"stroke-linecap": "round",
|
|
1057
1057
|
"stroke-linejoin": "round",
|
|
1058
1058
|
"stroke-width": "2",
|
|
1059
1059
|
d: "M8 9l4-4 4 4m0 6l-4 4-4-4"
|
|
1060
|
-
},
|
|
1060
|
+
}, ol = {
|
|
1061
1061
|
__name: "sortable",
|
|
1062
1062
|
props: {
|
|
1063
1063
|
columns: {
|
|
1064
1064
|
type: Array,
|
|
1065
1065
|
required: !0,
|
|
1066
1066
|
validator: (e) => {
|
|
1067
|
-
for (const
|
|
1068
|
-
if (
|
|
1067
|
+
for (const o of e)
|
|
1068
|
+
if (o.label === void 0 || o.prop === void 0)
|
|
1069
1069
|
return !1;
|
|
1070
1070
|
return !0;
|
|
1071
1071
|
}
|
|
@@ -1078,57 +1078,57 @@ const Zt = { class: "overflow-hidden rounded ring-1 ring-opacity-10 shadow ring-
|
|
|
1078
1078
|
keyProperty: { type: String, default: "key" }
|
|
1079
1079
|
},
|
|
1080
1080
|
emits: ["before-sort", "after-sort"],
|
|
1081
|
-
setup(e, { emit:
|
|
1082
|
-
const l = e, s = g(l.sortProp), t = g(l.sortDirection),
|
|
1081
|
+
setup(e, { emit: o }) {
|
|
1082
|
+
const l = e, s = g(l.sortProp), t = g(l.sortDirection), r = S(() => {
|
|
1083
1083
|
let a = l.rows.slice();
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
1086
|
-
}),
|
|
1087
|
-
|
|
1084
|
+
const d = l.columns.find(({ prop: v }) => v === s.value);
|
|
1085
|
+
return d && (t.value === "asc" && d.sortAscFunction ? a.sort(d.sortAscFunction) : t.value === "desc" && d.sortDescFunction ? a.sort(d.sortDescFunction) : a.sort((v, h) => v[s.value] < h[s.value] ? t.value === "asc" ? -1 : 1 : v[s.value] > h[s.value] ? t.value === "asc" ? 1 : -1 : 0)), a.slice(l.offset || 0, (l.offset || 0) + (l.count || a.length));
|
|
1086
|
+
}), n = (a) => {
|
|
1087
|
+
o("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"), te(() => o("after-sort", { prop: s.value, dir: t.value }));
|
|
1088
1088
|
};
|
|
1089
|
-
return (a,
|
|
1090
|
-
i("table",
|
|
1091
|
-
i("thead",
|
|
1089
|
+
return (a, d) => (u(), c("div", Jt, [
|
|
1090
|
+
i("table", Qt, [
|
|
1091
|
+
i("thead", el, [
|
|
1092
1092
|
i("tr", null, [
|
|
1093
|
-
(u(!0),
|
|
1093
|
+
(u(!0), c(D, null, B(e.columns, (v) => (u(), c("th", {
|
|
1094
1094
|
scope: "col",
|
|
1095
|
-
class:
|
|
1096
|
-
{ "cursor-pointer":
|
|
1097
|
-
|
|
1095
|
+
class: w(["py-3 px-6 text-left", [
|
|
1096
|
+
{ "cursor-pointer": v.sortable, active: s.value === v.prop },
|
|
1097
|
+
v.cssClass
|
|
1098
1098
|
]]),
|
|
1099
|
-
onClick: (
|
|
1099
|
+
onClick: (h) => v.sortable ? n(v.prop) : null
|
|
1100
1100
|
}, [
|
|
1101
|
-
|
|
1102
|
-
column:
|
|
1101
|
+
M(a.$slots, v.prop + "-header", {
|
|
1102
|
+
column: v,
|
|
1103
1103
|
sortDir: t.value,
|
|
1104
1104
|
sortProp: s.value
|
|
1105
1105
|
}, () => [
|
|
1106
|
-
i("div",
|
|
1107
|
-
i("span", null, _(
|
|
1108
|
-
|
|
1109
|
-
s.value ===
|
|
1106
|
+
i("div", ll, [
|
|
1107
|
+
i("span", null, _(v.label), 1),
|
|
1108
|
+
v.sortable ? (u(), c("svg", sl, [
|
|
1109
|
+
s.value === v.prop ? (u(), c("path", {
|
|
1110
1110
|
key: 0,
|
|
1111
1111
|
"stroke-linecap": "round",
|
|
1112
1112
|
"stroke-linejoin": "round",
|
|
1113
1113
|
"stroke-width": "2",
|
|
1114
1114
|
d: t.value === "asc" ? "M19 9l-7 7-7-7" : "M5 15l7-7 7 7"
|
|
1115
|
-
}, null, 8,
|
|
1115
|
+
}, null, 8, al)) : (u(), c("path", nl))
|
|
1116
1116
|
])) : C("", !0)
|
|
1117
1117
|
])
|
|
1118
1118
|
], !0)
|
|
1119
|
-
], 10,
|
|
1119
|
+
], 10, tl))), 256))
|
|
1120
1120
|
])
|
|
1121
1121
|
]),
|
|
1122
1122
|
i("tbody", null, [
|
|
1123
|
-
(u(!0),
|
|
1124
|
-
key:
|
|
1125
|
-
class:
|
|
1123
|
+
(u(!0), c(D, null, B(r.value, (v) => (u(), c("tr", {
|
|
1124
|
+
key: v[e.keyProperty],
|
|
1125
|
+
class: w(v.cssClass)
|
|
1126
1126
|
}, [
|
|
1127
|
-
(u(!0),
|
|
1128
|
-
class:
|
|
1127
|
+
(u(!0), c(D, null, B(e.columns, (h) => (u(), c("td", {
|
|
1128
|
+
class: w(["py-3 px-6 whitespace-nowrap", { active: s.value === h.prop }])
|
|
1129
1129
|
}, [
|
|
1130
|
-
|
|
1131
|
-
|
|
1130
|
+
M(a.$slots, h.prop, { row: v }, () => [
|
|
1131
|
+
F(_(v[h.prop]), 1)
|
|
1132
1132
|
], !0)
|
|
1133
1133
|
], 2))), 256))
|
|
1134
1134
|
], 2))), 128))
|
|
@@ -1136,19 +1136,86 @@ const Zt = { class: "overflow-hidden rounded ring-1 ring-opacity-10 shadow ring-
|
|
|
1136
1136
|
])
|
|
1137
1137
|
]));
|
|
1138
1138
|
}
|
|
1139
|
-
},
|
|
1139
|
+
}, $l = /* @__PURE__ */ pe(ol, [["__scopeId", "data-v-f0e4e642"]]), rl = { class: "sm:hidden" }, ul = { class: "hidden sm:block" }, il = { class: "border-b border-gray-200" }, cl = {
|
|
1140
|
+
class: "flex -mb-px space-x-8",
|
|
1141
|
+
"aria-label": "Tabs"
|
|
1142
|
+
}, dl = ["onClick", "aria-current"], _l = {
|
|
1143
|
+
__name: "tabs",
|
|
1144
|
+
props: {
|
|
1145
|
+
items: { type: Array, default: [] },
|
|
1146
|
+
activeIndex: { type: Number, default: 0 }
|
|
1147
|
+
},
|
|
1148
|
+
emits: ["update:active-index"],
|
|
1149
|
+
setup(e, { emit: o }) {
|
|
1150
|
+
const l = e, s = g(l.items[l.activeIndex] || {}), t = S(() => {
|
|
1151
|
+
let n = [];
|
|
1152
|
+
return l.items.forEach((a, d) => {
|
|
1153
|
+
a.disabled || n.push({ label: a.name, key: d });
|
|
1154
|
+
}), n;
|
|
1155
|
+
});
|
|
1156
|
+
j(() => l.activeIndex, (n) => {
|
|
1157
|
+
s.value = l.items[n] || {};
|
|
1158
|
+
});
|
|
1159
|
+
const r = (n) => {
|
|
1160
|
+
n.disabled || (s.value = n, o("update:active-index", l.items.indexOf(n)));
|
|
1161
|
+
};
|
|
1162
|
+
return (n, a) => (u(), c(D, null, [
|
|
1163
|
+
i("div", rl, [
|
|
1164
|
+
E(xt, {
|
|
1165
|
+
options: t.value,
|
|
1166
|
+
"model-value": e.activeIndex,
|
|
1167
|
+
"onUpdate:modelValue": a[0] || (a[0] = (d) => o("update:activeIndex", d)),
|
|
1168
|
+
class: "w-full"
|
|
1169
|
+
}, null, 8, ["options", "model-value"])
|
|
1170
|
+
]),
|
|
1171
|
+
i("div", ul, [
|
|
1172
|
+
i("div", il, [
|
|
1173
|
+
i("nav", cl, [
|
|
1174
|
+
(u(!0), c(D, null, B(e.items, (d) => (u(), c("a", {
|
|
1175
|
+
key: d.name,
|
|
1176
|
+
href: "#",
|
|
1177
|
+
onClick: P((v) => r(d), ["prevent"]),
|
|
1178
|
+
class: w([
|
|
1179
|
+
s.value === d ? "border-vxvue-500 text-vxvue-600" : "border-transparent text-gray-900 hover:text-gray-700 hover:border-gray-300",
|
|
1180
|
+
d.disabled ? "cursor-not-allowed text-gray-400 hover:border-transparent" : "",
|
|
1181
|
+
"group inline-flex items-center py-4 px-1 border-b-4 font-medium"
|
|
1182
|
+
]),
|
|
1183
|
+
"aria-current": s.value === d ? "page" : void 0
|
|
1184
|
+
}, [
|
|
1185
|
+
M(n.$slots, "icon", { tab: d }),
|
|
1186
|
+
i("span", null, [
|
|
1187
|
+
M(n.$slots, "default", { tab: d }, () => [
|
|
1188
|
+
F(_(d.name), 1)
|
|
1189
|
+
])
|
|
1190
|
+
]),
|
|
1191
|
+
d.badge ? (u(), c("span", {
|
|
1192
|
+
key: 0,
|
|
1193
|
+
class: w([
|
|
1194
|
+
s.value === d ? "bg-vxvue-50 text-vxvue-700" : "bg-gray-200 text-gray-900",
|
|
1195
|
+
d.disabled ? "bg-gray-100 text-gray-400" : "",
|
|
1196
|
+
"hidden ml-3 py-0.5 px-2.5 rounded-full text-xs font-medium md:inline-block"
|
|
1197
|
+
])
|
|
1198
|
+
}, _(d.badge), 3)) : C("", !0)
|
|
1199
|
+
], 10, dl))), 128))
|
|
1200
|
+
])
|
|
1201
|
+
])
|
|
1202
|
+
])
|
|
1203
|
+
], 64));
|
|
1204
|
+
}
|
|
1205
|
+
};
|
|
1140
1206
|
export {
|
|
1141
|
-
|
|
1142
|
-
|
|
1207
|
+
fl as Autocomplete,
|
|
1208
|
+
pl as Confirm,
|
|
1143
1209
|
at as DateInput,
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1210
|
+
hl as Datepicker,
|
|
1211
|
+
ml as FormFileButton,
|
|
1212
|
+
xt as FormSelect,
|
|
1213
|
+
gl as FormSwitch,
|
|
1214
|
+
bl as MessageToast,
|
|
1215
|
+
xl as Modal,
|
|
1216
|
+
yl as Pagination,
|
|
1217
|
+
wl as PasswordInput,
|
|
1218
|
+
kl as SimpleTree,
|
|
1219
|
+
$l as Sortable,
|
|
1220
|
+
_l as Tabs
|
|
1154
1221
|
};
|