vx-vue 0.3.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/dist/style.css +1 -1
- package/dist/vxvue.es.js +653 -467
- package/dist/vxvue.umd.js +1 -1
- package/package.json +2 -1
package/dist/vxvue.es.js
CHANGED
|
@@ -1,21 +1,287 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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;
|
|
4
|
+
}
|
|
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);
|
|
117
|
+
})
|
|
118
|
+
].filter(Boolean);
|
|
119
|
+
return () => h.forEach((f) => f());
|
|
120
|
+
}
|
|
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
|
|
227
|
+
}, [
|
|
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)
|
|
247
|
+
]),
|
|
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)
|
|
266
|
+
], 2));
|
|
267
|
+
}
|
|
268
|
+
}, Ee = {
|
|
3
269
|
key: 0,
|
|
4
270
|
class: "fixed inset-0 z-50 bg-black bg-opacity-50 backdrop-blur-sm",
|
|
5
271
|
"aria-hidden": "true"
|
|
6
|
-
},
|
|
272
|
+
}, Ne = {
|
|
7
273
|
key: 0,
|
|
8
274
|
class: "overflow-y-auto fixed inset-0 z-50"
|
|
9
|
-
},
|
|
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", {
|
|
10
276
|
class: "hidden sm:inline-block sm:h-screen sm:align-middle",
|
|
11
277
|
"aria-hidden": "true"
|
|
12
|
-
}, "", -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 = {
|
|
13
279
|
__name: "confirm",
|
|
14
280
|
props: {
|
|
15
281
|
buttons: {
|
|
16
282
|
type: [Object, Array],
|
|
17
283
|
default: { label: "Ok" },
|
|
18
|
-
validator: (e) => Array.isArray(e) && e.length <= 2 && e.filter((
|
|
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
|
|
19
285
|
},
|
|
20
286
|
headerClass: {
|
|
21
287
|
type: String,
|
|
@@ -26,238 +292,119 @@ const he = {
|
|
|
26
292
|
default: "button"
|
|
27
293
|
}
|
|
28
294
|
},
|
|
29
|
-
setup(e, { expose:
|
|
30
|
-
const l = e, s =
|
|
31
|
-
let
|
|
32
|
-
const v =
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
})) }), (m,
|
|
36
|
-
o.value ? (
|
|
37
|
-
|
|
38
|
-
default:
|
|
39
|
-
o.value ? (
|
|
40
|
-
|
|
41
|
-
o.value ? (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
s.value ? (
|
|
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", {
|
|
45
311
|
key: 0,
|
|
46
|
-
class:
|
|
312
|
+
class: _(["py-4 pt-4 text-lg font-medium text-center sm:py-6", e.headerClass])
|
|
47
313
|
}, [
|
|
48
|
-
|
|
49
|
-
|
|
314
|
+
A(m.$slots, "title", { title: s.value }, () => [
|
|
315
|
+
j($(s.value), 1)
|
|
50
316
|
])
|
|
51
|
-
], 2)) :
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
317
|
+
], 2)) : D("", !0),
|
|
318
|
+
c("div", We, [
|
|
319
|
+
c("div", qe, [
|
|
320
|
+
c("div", Ke, [
|
|
321
|
+
A(m.$slots, "icon")
|
|
56
322
|
]),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
323
|
+
c("p", Ge, [
|
|
324
|
+
A(m.$slots, "default", { message: t.value }, () => [
|
|
325
|
+
j($(t.value), 1)
|
|
60
326
|
])
|
|
61
327
|
])
|
|
62
328
|
]),
|
|
63
|
-
|
|
329
|
+
c("div", {
|
|
64
330
|
class: "flex justify-center mt-5 space-x-2 sm:mt-6",
|
|
65
331
|
ref_key: "buttonsContainer",
|
|
66
332
|
ref: i
|
|
67
333
|
}, [
|
|
68
|
-
(
|
|
69
|
-
class:
|
|
70
|
-
onClick:
|
|
71
|
-
o.value = !1,
|
|
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)();
|
|
72
338
|
}, ["prevent"])
|
|
73
|
-
},
|
|
339
|
+
}, $(p.label), 11, Xe))), 256))
|
|
74
340
|
], 512)
|
|
75
341
|
])
|
|
76
342
|
])
|
|
77
|
-
])) :
|
|
343
|
+
])) : D("", !0)
|
|
78
344
|
])
|
|
79
|
-
])) :
|
|
345
|
+
])) : D("", !0)
|
|
80
346
|
]),
|
|
81
347
|
_: 3
|
|
82
348
|
})
|
|
83
349
|
], 64));
|
|
84
350
|
}
|
|
85
351
|
};
|
|
86
|
-
function
|
|
87
|
-
const l =
|
|
88
|
-
let t, o = s.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&"),
|
|
352
|
+
function Ze(e, n) {
|
|
353
|
+
const l = g(!1), s = te(n);
|
|
354
|
+
let t, o = s.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = [];
|
|
89
355
|
if ((t = s.match(/\bd\b/gi)) && t.length === 1)
|
|
90
356
|
o = o.replace("d", "(\\d{1,2})");
|
|
91
357
|
else if ((t = s.match(/\bdd\b/gi)) && t.length === 1)
|
|
92
358
|
o = o.replace("dd", "(\\d{2})");
|
|
93
359
|
else
|
|
94
360
|
return { date: l };
|
|
95
|
-
if (
|
|
361
|
+
if (r.push({ srcPos: s.toLowerCase().indexOf("d"), destPos: 2 }), (t = s.match(/\bm\b/gi)) && t.length === 1)
|
|
96
362
|
o = o.replace("m", "(\\d{1,2})");
|
|
97
363
|
else if ((t = s.match(/\bmm\b/gi)) && t.length === 1)
|
|
98
364
|
o = o.replace("mm", "(\\d{2})");
|
|
99
365
|
else
|
|
100
366
|
return { date: l };
|
|
101
|
-
if (
|
|
367
|
+
if (r.push({ srcPos: s.toLowerCase().indexOf("m"), destPos: 1 }), (t = s.match(/\byyyy\b/gi)) && t.length === 1)
|
|
102
368
|
o = o.replace("yyyy", "(\\d{4})");
|
|
103
369
|
else
|
|
104
370
|
return { date: l };
|
|
105
|
-
if (
|
|
371
|
+
if (r.push({ srcPos: s.toLowerCase().indexOf("y"), destPos: 0 }), !(t = te(e).match(o)))
|
|
106
372
|
return { date: l };
|
|
107
|
-
t.shift(),
|
|
108
|
-
let
|
|
373
|
+
t.shift(), r.sort((h, m) => h.srcPos < m.srcPos ? -1 : 1);
|
|
374
|
+
let a = [], v, i;
|
|
109
375
|
for (; v = t.shift(); )
|
|
110
|
-
i =
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
function Ce(e) {
|
|
114
|
-
return ue() ? (ie(e), !0) : !1;
|
|
115
|
-
}
|
|
116
|
-
function ee(e) {
|
|
117
|
-
return typeof e == "function" ? e() : _(e);
|
|
118
|
-
}
|
|
119
|
-
const te = typeof window < "u" && typeof document < "u", De = Object.prototype.toString, Se = (e) => De.call(e) === "[object Object]", W = () => {
|
|
120
|
-
}, Me = /* @__PURE__ */ Ve();
|
|
121
|
-
function Ve() {
|
|
122
|
-
var e;
|
|
123
|
-
return te && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
124
|
-
}
|
|
125
|
-
const Pe = /\[([^\]]+)]|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;
|
|
126
|
-
function Ae(e, a, l, s) {
|
|
127
|
-
let t = e < 12 ? "AM" : "PM";
|
|
128
|
-
return s && (t = t.split("").reduce((o, c) => o += `${c}.`, "")), l ? t.toLowerCase() : t;
|
|
129
|
-
}
|
|
130
|
-
function G(e, a, l = {}) {
|
|
131
|
-
var s;
|
|
132
|
-
const t = e.getFullYear(), o = e.getMonth(), c = e.getDate(), n = e.getHours(), v = e.getMinutes(), i = e.getSeconds(), f = e.getMilliseconds(), m = e.getDay(), h = (s = l.customMeridiem) != null ? s : Ae, p = {
|
|
133
|
-
YY: () => String(t).slice(-2),
|
|
134
|
-
YYYY: () => t,
|
|
135
|
-
M: () => o + 1,
|
|
136
|
-
MM: () => `${o + 1}`.padStart(2, "0"),
|
|
137
|
-
MMM: () => e.toLocaleDateString(l.locales, { month: "short" }),
|
|
138
|
-
MMMM: () => e.toLocaleDateString(l.locales, { month: "long" }),
|
|
139
|
-
D: () => String(c),
|
|
140
|
-
DD: () => `${c}`.padStart(2, "0"),
|
|
141
|
-
H: () => String(n),
|
|
142
|
-
HH: () => `${n}`.padStart(2, "0"),
|
|
143
|
-
h: () => `${n % 12 || 12}`.padStart(1, "0"),
|
|
144
|
-
hh: () => `${n % 12 || 12}`.padStart(2, "0"),
|
|
145
|
-
m: () => String(v),
|
|
146
|
-
mm: () => `${v}`.padStart(2, "0"),
|
|
147
|
-
s: () => String(i),
|
|
148
|
-
ss: () => `${i}`.padStart(2, "0"),
|
|
149
|
-
SSS: () => `${f}`.padStart(3, "0"),
|
|
150
|
-
d: () => m,
|
|
151
|
-
dd: () => e.toLocaleDateString(l.locales, { weekday: "narrow" }),
|
|
152
|
-
ddd: () => e.toLocaleDateString(l.locales, { weekday: "short" }),
|
|
153
|
-
dddd: () => e.toLocaleDateString(l.locales, { weekday: "long" }),
|
|
154
|
-
A: () => h(n, v),
|
|
155
|
-
AA: () => h(n, v, !1, !0),
|
|
156
|
-
a: () => h(n, v, !0),
|
|
157
|
-
aa: () => h(n, v, !0, !0)
|
|
158
|
-
};
|
|
159
|
-
return a.replace(Pe, (b, T) => {
|
|
160
|
-
var I, N;
|
|
161
|
-
return (N = T ?? ((I = p[b]) == null ? void 0 : I.call(p))) != null ? N : b;
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
function Y(e) {
|
|
165
|
-
var a;
|
|
166
|
-
const l = ee(e);
|
|
167
|
-
return (a = l == null ? void 0 : l.$el) != null ? a : l;
|
|
168
|
-
}
|
|
169
|
-
const le = te ? window : void 0;
|
|
170
|
-
function U(...e) {
|
|
171
|
-
let a, l, s, t;
|
|
172
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([l, s, t] = e, a = le) : [a, l, s, t] = e, !a)
|
|
173
|
-
return W;
|
|
174
|
-
Array.isArray(l) || (l = [l]), Array.isArray(s) || (s = [s]);
|
|
175
|
-
const o = [], c = () => {
|
|
176
|
-
o.forEach((f) => f()), o.length = 0;
|
|
177
|
-
}, n = (f, m, h, p) => (f.addEventListener(m, h, p), () => f.removeEventListener(m, h, p)), v = B(
|
|
178
|
-
() => [Y(a), ee(t)],
|
|
179
|
-
([f, m]) => {
|
|
180
|
-
if (c(), !f)
|
|
181
|
-
return;
|
|
182
|
-
const h = Se(m) ? { ...m } : m;
|
|
183
|
-
o.push(
|
|
184
|
-
...l.flatMap((p) => s.map((b) => n(f, p, b, h)))
|
|
185
|
-
);
|
|
186
|
-
},
|
|
187
|
-
{ immediate: !0, flush: "post" }
|
|
188
|
-
), i = () => {
|
|
189
|
-
v(), c();
|
|
190
|
-
};
|
|
191
|
-
return Ce(i), i;
|
|
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 };
|
|
192
378
|
}
|
|
193
|
-
|
|
194
|
-
function Be(e, a, l = {}) {
|
|
195
|
-
const { window: s = le, ignore: t = [], capture: o = !0, detectIframe: c = !1 } = l;
|
|
196
|
-
if (!s)
|
|
197
|
-
return;
|
|
198
|
-
Me && !X && (X = !0, Array.from(s.document.body.children).forEach((h) => h.addEventListener("click", W)), s.document.documentElement.addEventListener("click", W));
|
|
199
|
-
let n = !0;
|
|
200
|
-
const v = (h) => t.some((p) => {
|
|
201
|
-
if (typeof p == "string")
|
|
202
|
-
return Array.from(s.document.querySelectorAll(p)).some((b) => b === h.target || h.composedPath().includes(b));
|
|
203
|
-
{
|
|
204
|
-
const b = Y(p);
|
|
205
|
-
return b && (h.target === b || h.composedPath().includes(b));
|
|
206
|
-
}
|
|
207
|
-
}), f = [
|
|
208
|
-
U(s, "click", (h) => {
|
|
209
|
-
const p = Y(e);
|
|
210
|
-
if (!(!p || p === h.target || h.composedPath().includes(p))) {
|
|
211
|
-
if (h.detail === 0 && (n = !v(h)), !n) {
|
|
212
|
-
n = !0;
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
a(h);
|
|
216
|
-
}
|
|
217
|
-
}, { passive: !0, capture: o }),
|
|
218
|
-
U(s, "pointerdown", (h) => {
|
|
219
|
-
const p = Y(e);
|
|
220
|
-
p && (n = !h.composedPath().includes(p) && !v(h));
|
|
221
|
-
}, { passive: !0 }),
|
|
222
|
-
c && U(s, "blur", (h) => {
|
|
223
|
-
setTimeout(() => {
|
|
224
|
-
var p;
|
|
225
|
-
const b = Y(e);
|
|
226
|
-
((p = s.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(b != null && b.contains(s.document.activeElement)) && a(h);
|
|
227
|
-
}, 0);
|
|
228
|
-
})
|
|
229
|
-
].filter(Boolean);
|
|
230
|
-
return () => f.forEach((h) => h());
|
|
231
|
-
}
|
|
232
|
-
const Fe = { key: 0 }, Le = { class: "text-vxvue-700" }, Oe = /* @__PURE__ */ u("svg", {
|
|
379
|
+
const Je = { key: 0 }, Qe = { class: "text-vxvue-700" }, et = /* @__PURE__ */ c("svg", {
|
|
233
380
|
class: "w-2 h-2",
|
|
234
381
|
stroke: "currentColor",
|
|
235
382
|
fill: "none",
|
|
236
383
|
viewBox: "0 0 8 8"
|
|
237
384
|
}, [
|
|
238
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ c("path", {
|
|
239
386
|
"stroke-linecap": "round",
|
|
240
387
|
"stroke-width": "1.5",
|
|
241
388
|
d: "M1 1l6 6m0-6L1 7"
|
|
242
389
|
})
|
|
243
|
-
], -1),
|
|
244
|
-
|
|
245
|
-
],
|
|
390
|
+
], -1), tt = [
|
|
391
|
+
et
|
|
392
|
+
], lt = /* @__PURE__ */ c("svg", {
|
|
246
393
|
xmlns: "http://www.w3.org/2000/svg",
|
|
247
394
|
class: "w-6 h-6",
|
|
248
395
|
fill: "none",
|
|
249
396
|
viewBox: "0 0 24 24",
|
|
250
397
|
stroke: "currentColor"
|
|
251
398
|
}, [
|
|
252
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ c("path", {
|
|
253
400
|
"stroke-linecap": "round",
|
|
254
401
|
"stroke-linejoin": "round",
|
|
255
402
|
"stroke-width": "2",
|
|
256
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"
|
|
257
404
|
})
|
|
258
|
-
], -1),
|
|
259
|
-
|
|
260
|
-
],
|
|
405
|
+
], -1), st = [
|
|
406
|
+
lt
|
|
407
|
+
], at = {
|
|
261
408
|
__name: "date-input",
|
|
262
409
|
props: {
|
|
263
410
|
outputFormat: { type: String, default: "YYYY-MM-DD" },
|
|
@@ -267,118 +414,118 @@ const Fe = { key: 0 }, Le = { class: "text-vxvue-700" }, Oe = /* @__PURE__ */ u(
|
|
|
267
414
|
modelValue: Date
|
|
268
415
|
},
|
|
269
416
|
emits: ["update:modelValue", "toggle-datepicker"],
|
|
270
|
-
setup(e, { emit:
|
|
271
|
-
const l = e, s =
|
|
272
|
-
let
|
|
273
|
-
return delete
|
|
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;
|
|
274
421
|
});
|
|
275
|
-
return
|
|
276
|
-
class:
|
|
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])
|
|
277
424
|
}, [
|
|
278
|
-
t.value ? (
|
|
279
|
-
|
|
280
|
-
class:
|
|
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 }])
|
|
281
428
|
}, [
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
onClick:
|
|
429
|
+
c("span", Qe, $(t.value), 1),
|
|
430
|
+
c("button", {
|
|
431
|
+
onClick: a[0] || (a[0] = (v) => n("update:modelValue", null)),
|
|
285
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"
|
|
286
|
-
},
|
|
433
|
+
}, tt)
|
|
287
434
|
], 2)
|
|
288
|
-
])) :
|
|
435
|
+
])) : ne((u(), d("input", O({
|
|
289
436
|
key: 1,
|
|
290
437
|
type: "text",
|
|
291
438
|
class: ["block w-full form-input focus:border-vxvue peer", { "pr-10": e.showButton }],
|
|
292
|
-
"onUpdate:modelValue":
|
|
293
|
-
onBlur:
|
|
439
|
+
"onUpdate:modelValue": a[1] || (a[1] = (v) => s.value = v),
|
|
440
|
+
onBlur: a[2] || (a[2] = (v) => {
|
|
294
441
|
var i;
|
|
295
|
-
return
|
|
442
|
+
return n("update:modelValue", ((i = M(Ze)(s.value, l.inputFormat).date) == null ? void 0 : i.value) || null);
|
|
296
443
|
}),
|
|
297
|
-
onInput:
|
|
444
|
+
onInput: a[3] || (a[3] = V(() => {
|
|
298
445
|
}, ["prevent"]))
|
|
299
446
|
}, o.value), null, 16)), [
|
|
300
|
-
[
|
|
447
|
+
[ke, s.value]
|
|
301
448
|
]),
|
|
302
|
-
e.showButton ? (
|
|
449
|
+
e.showButton ? (u(), d("button", {
|
|
303
450
|
key: 2,
|
|
304
451
|
class: "flex absolute inset-y-0 right-0 items-center px-2 text-vxvue-700 hover:text-vxvue",
|
|
305
|
-
onClick:
|
|
306
|
-
},
|
|
307
|
-
|
|
452
|
+
onClick: a[4] || (a[4] = V((v) => n("toggle-datepicker"), ["stop"]))
|
|
453
|
+
}, st)) : D("", !0),
|
|
454
|
+
A(r.$slots, "default")
|
|
308
455
|
], 2));
|
|
309
456
|
}
|
|
310
457
|
};
|
|
311
|
-
function
|
|
312
|
-
return
|
|
458
|
+
function ve(e, n) {
|
|
459
|
+
return u(), d("svg", {
|
|
313
460
|
xmlns: "http://www.w3.org/2000/svg",
|
|
314
461
|
viewBox: "0 0 24 24",
|
|
315
462
|
fill: "currentColor",
|
|
316
463
|
"aria-hidden": "true"
|
|
317
464
|
}, [
|
|
318
|
-
|
|
465
|
+
c("path", {
|
|
319
466
|
"fill-rule": "evenodd",
|
|
320
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",
|
|
321
468
|
"clip-rule": "evenodd"
|
|
322
469
|
})
|
|
323
470
|
]);
|
|
324
471
|
}
|
|
325
|
-
function
|
|
326
|
-
return
|
|
472
|
+
function fe(e, n) {
|
|
473
|
+
return u(), d("svg", {
|
|
327
474
|
xmlns: "http://www.w3.org/2000/svg",
|
|
328
475
|
viewBox: "0 0 24 24",
|
|
329
476
|
fill: "currentColor",
|
|
330
477
|
"aria-hidden": "true"
|
|
331
478
|
}, [
|
|
332
|
-
|
|
479
|
+
c("path", {
|
|
333
480
|
"fill-rule": "evenodd",
|
|
334
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",
|
|
335
482
|
"clip-rule": "evenodd"
|
|
336
483
|
})
|
|
337
484
|
]);
|
|
338
485
|
}
|
|
339
|
-
function
|
|
340
|
-
return
|
|
486
|
+
function nt(e, n) {
|
|
487
|
+
return u(), d("svg", {
|
|
341
488
|
xmlns: "http://www.w3.org/2000/svg",
|
|
342
489
|
viewBox: "0 0 24 24",
|
|
343
490
|
fill: "currentColor",
|
|
344
491
|
"aria-hidden": "true"
|
|
345
492
|
}, [
|
|
346
|
-
|
|
493
|
+
c("path", {
|
|
347
494
|
"fill-rule": "evenodd",
|
|
348
495
|
d: "M3.75 12a.75.75 0 01.75-.75h15a.75.75 0 010 1.5h-15a.75.75 0 01-.75-.75z",
|
|
349
496
|
"clip-rule": "evenodd"
|
|
350
497
|
})
|
|
351
498
|
]);
|
|
352
499
|
}
|
|
353
|
-
function
|
|
354
|
-
return
|
|
500
|
+
function ot(e, n) {
|
|
501
|
+
return u(), d("svg", {
|
|
355
502
|
xmlns: "http://www.w3.org/2000/svg",
|
|
356
503
|
viewBox: "0 0 24 24",
|
|
357
504
|
fill: "currentColor",
|
|
358
505
|
"aria-hidden": "true"
|
|
359
506
|
}, [
|
|
360
|
-
|
|
507
|
+
c("path", {
|
|
361
508
|
"fill-rule": "evenodd",
|
|
362
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",
|
|
363
510
|
"clip-rule": "evenodd"
|
|
364
511
|
})
|
|
365
512
|
]);
|
|
366
513
|
}
|
|
367
|
-
function
|
|
368
|
-
return
|
|
514
|
+
function rt(e, n) {
|
|
515
|
+
return u(), d("svg", {
|
|
369
516
|
xmlns: "http://www.w3.org/2000/svg",
|
|
370
517
|
viewBox: "0 0 24 24",
|
|
371
518
|
fill: "currentColor",
|
|
372
519
|
"aria-hidden": "true"
|
|
373
520
|
}, [
|
|
374
|
-
|
|
521
|
+
c("path", {
|
|
375
522
|
"fill-rule": "evenodd",
|
|
376
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",
|
|
377
524
|
"clip-rule": "evenodd"
|
|
378
525
|
})
|
|
379
526
|
]);
|
|
380
527
|
}
|
|
381
|
-
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 = {
|
|
382
529
|
__name: "datepicker",
|
|
383
530
|
props: {
|
|
384
531
|
modelValue: [Date, Boolean],
|
|
@@ -390,156 +537,198 @@ const He = { class: "flex flex-row items-center py-2 px-3 text-white bg-vxvue-70
|
|
|
390
537
|
hasInput: { type: Boolean, default: !0 }
|
|
391
538
|
},
|
|
392
539
|
emits: ["update:modelValue", "month-change"],
|
|
393
|
-
setup(e, { emit:
|
|
540
|
+
setup(e, { emit: n }) {
|
|
394
541
|
const l = e, s = (() => {
|
|
395
|
-
let
|
|
396
|
-
return new Date(
|
|
397
|
-
})(), t =
|
|
398
|
-
const
|
|
399
|
-
for (let H = -
|
|
400
|
-
|
|
401
|
-
return
|
|
402
|
-
}), p =
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}, { immediate: !0 }),
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
|
|
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";
|
|
409
556
|
});
|
|
410
|
-
}),
|
|
411
|
-
const
|
|
412
|
-
t.value = new Date(t.value.getFullYear(), t.value.getMonth() - 1, 1),
|
|
413
|
-
},
|
|
414
|
-
t.value = new Date(t.value.getFullYear(), t.value.getMonth() + 1, 1),
|
|
415
|
-
},
|
|
416
|
-
o.value =
|
|
417
|
-
},
|
|
418
|
-
o.value =
|
|
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);
|
|
419
566
|
};
|
|
420
|
-
return (
|
|
421
|
-
class:
|
|
567
|
+
return (x, S) => (u(), d("div", {
|
|
568
|
+
class: _(["relative", x.$attrs.class])
|
|
422
569
|
}, [
|
|
423
|
-
e.hasInput ? (
|
|
570
|
+
e.hasInput ? (u(), R(at, O({
|
|
424
571
|
key: 0,
|
|
425
572
|
modelValue: o.value,
|
|
426
|
-
onToggleDatepicker:
|
|
427
|
-
"onUpdate:modelValue":
|
|
428
|
-
},
|
|
573
|
+
onToggleDatepicker: S[0] || (S[0] = (y) => r.value = !0),
|
|
574
|
+
"onUpdate:modelValue": z
|
|
575
|
+
}, x.$attrs, {
|
|
429
576
|
ref_key: "input",
|
|
430
577
|
ref: i,
|
|
431
578
|
class: "w-full",
|
|
432
579
|
locale: e.locale
|
|
433
580
|
}), {
|
|
434
|
-
default:
|
|
435
|
-
|
|
581
|
+
default: G(() => [
|
|
582
|
+
A(x.$slots, "default")
|
|
436
583
|
]),
|
|
437
584
|
_: 3
|
|
438
|
-
}, 16, ["modelValue", "locale"])) :
|
|
439
|
-
|
|
585
|
+
}, 16, ["modelValue", "locale"])) : D("", !0),
|
|
586
|
+
c("div", O({ class: "z-10 bg-white shadow-md" }, m.value, {
|
|
440
587
|
ref_key: "calendar",
|
|
441
|
-
ref:
|
|
442
|
-
class: [
|
|
588
|
+
ref: h,
|
|
589
|
+
class: [a.value, v.value]
|
|
443
590
|
}), [
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
onClick:
|
|
591
|
+
c("div", ut, [
|
|
592
|
+
c("button", {
|
|
593
|
+
onClick: V(k, ["stop"]),
|
|
447
594
|
class: "flex-shrink-0 text-vxvue-100 hover:text-vxvue-50"
|
|
448
595
|
}, [
|
|
449
|
-
|
|
450
|
-
], 8,
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
onClick:
|
|
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"]),
|
|
454
601
|
class: "flex-shrink-0 text-vxvue-100 hover:text-vxvue-50"
|
|
455
602
|
}, [
|
|
456
|
-
|
|
457
|
-
], 8,
|
|
603
|
+
N(M(fe), { class: "w-6 h-6" })
|
|
604
|
+
], 8, dt)
|
|
458
605
|
]),
|
|
459
|
-
|
|
460
|
-
(
|
|
606
|
+
c("div", vt, [
|
|
607
|
+
(u(!0), d(P, null, B(p.value, (y, I) => (u(), d("div", {
|
|
461
608
|
class: "py-2 text-center bg-gray-200",
|
|
462
|
-
key:
|
|
463
|
-
}, y
|
|
464
|
-
(
|
|
465
|
-
class:
|
|
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"])
|
|
466
613
|
}, [
|
|
467
|
-
|
|
468
|
-
class:
|
|
614
|
+
c("button", {
|
|
615
|
+
class: _([
|
|
469
616
|
{
|
|
470
|
-
"bg-vxvue-700 text-white": o.value &&
|
|
471
|
-
"bg-gray-200":
|
|
472
|
-
"text-red-400": e.validFrom && e.validFrom >
|
|
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
|
|
473
620
|
},
|
|
474
621
|
"py-2 px-3 rounded-sm"
|
|
475
622
|
]),
|
|
476
|
-
disabled: e.validFrom && e.validFrom >
|
|
477
|
-
onClick:
|
|
478
|
-
}, y
|
|
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)
|
|
479
626
|
], 2))), 256))
|
|
480
627
|
])
|
|
481
628
|
], 16)
|
|
482
629
|
], 2));
|
|
483
630
|
}
|
|
484
|
-
},
|
|
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 = {
|
|
485
669
|
key: 0,
|
|
486
670
|
disabled: "",
|
|
487
671
|
value: ""
|
|
488
|
-
},
|
|
672
|
+
}, bt = ["value", "selected"], ul = {
|
|
489
673
|
__name: "form-select",
|
|
490
674
|
props: { options: Array, modelValue: [String, Number], disabledLabel: String },
|
|
491
675
|
emits: ["update:modelValue"],
|
|
492
|
-
setup(e, { emit:
|
|
493
|
-
return (l, s) => (
|
|
676
|
+
setup(e, { emit: n }) {
|
|
677
|
+
return (l, s) => (u(), d("select", O(l.$attrs, {
|
|
494
678
|
value: e.modelValue,
|
|
495
679
|
class: "form-select",
|
|
496
|
-
onChange: s[0] || (s[0] = (t) =>
|
|
680
|
+
onChange: s[0] || (s[0] = (t) => n("update:modelValue", t.target.value))
|
|
497
681
|
}), [
|
|
498
|
-
e.disabledLabel ? (
|
|
499
|
-
(
|
|
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", {
|
|
500
684
|
value: t.key !== void 0 ? t.key : t.label || t,
|
|
501
685
|
selected: (t.key !== void 0 ? t.key : t.label || t) === e.modelValue
|
|
502
|
-
},
|
|
503
|
-
], 16,
|
|
686
|
+
}, $(t.label || t), 9, bt))), 256))
|
|
687
|
+
], 16, mt));
|
|
504
688
|
}
|
|
505
|
-
},
|
|
689
|
+
}, wt = ["aria-checked"], xt = ["checked"], il = {
|
|
506
690
|
__name: "form-switch",
|
|
507
691
|
props: ["modelValue"],
|
|
508
692
|
emits: ["update:modelValue"],
|
|
509
|
-
setup(e, { emit:
|
|
510
|
-
const l = e, s =
|
|
511
|
-
let
|
|
512
|
-
return delete
|
|
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;
|
|
513
697
|
});
|
|
514
|
-
return (
|
|
515
|
-
|
|
516
|
-
class:
|
|
698
|
+
return (r, a) => (u(), d(P, null, [
|
|
699
|
+
c("label", {
|
|
700
|
+
class: _(r.$attrs.class)
|
|
517
701
|
}, [
|
|
518
|
-
|
|
519
|
-
class:
|
|
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"]),
|
|
520
704
|
role: "switch",
|
|
521
705
|
"aria-checked": !!e.modelValue
|
|
522
706
|
}, [
|
|
523
|
-
|
|
707
|
+
c("span", {
|
|
524
708
|
"aria-hidden": "true",
|
|
525
|
-
class:
|
|
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"])
|
|
526
710
|
}, null, 2),
|
|
527
|
-
|
|
711
|
+
c("input", O({
|
|
528
712
|
class: "hidden",
|
|
529
713
|
value: "1",
|
|
530
714
|
type: "checkbox",
|
|
531
|
-
onChange:
|
|
532
|
-
}, o.value, { checked: e.modelValue }), null, 16,
|
|
533
|
-
], 10,
|
|
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)
|
|
534
718
|
], 2),
|
|
535
|
-
|
|
719
|
+
A(r.$slots, "default")
|
|
536
720
|
], 64));
|
|
537
721
|
}
|
|
538
722
|
};
|
|
539
|
-
const
|
|
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 = {
|
|
540
729
|
"aria-live": "assertive",
|
|
541
730
|
class: "flex fixed inset-0 z-50 items-start py-6 px-4 pointer-events-none sm:p-6"
|
|
542
|
-
},
|
|
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({
|
|
543
732
|
inheritAttrs: !1
|
|
544
733
|
}, {
|
|
545
734
|
__name: "message-toast",
|
|
@@ -550,56 +739,56 @@ const et = {
|
|
|
550
739
|
active: { type: Boolean, default: !1 }
|
|
551
740
|
},
|
|
552
741
|
emits: ["timeout", "close"],
|
|
553
|
-
setup(e, { emit:
|
|
554
|
-
const l = e, s =
|
|
742
|
+
setup(e, { emit: n }) {
|
|
743
|
+
const l = e, s = g(null), t = C(() => typeof l.message == "string" ? [l.message] : l.message), o = () => {
|
|
555
744
|
window.clearTimeout(s.value), l.active && l.timeout && (s.value = window.setTimeout(() => {
|
|
556
|
-
|
|
745
|
+
n("timeout");
|
|
557
746
|
}, l.timeout));
|
|
558
747
|
};
|
|
559
|
-
return
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
default:
|
|
563
|
-
e.active ? (
|
|
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", {
|
|
564
753
|
key: 0,
|
|
565
|
-
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])
|
|
566
755
|
}, [
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
756
|
+
c("div", _t, [
|
|
757
|
+
c("div", Ct, [
|
|
758
|
+
c("div", St, [
|
|
759
|
+
A(r.$slots, "icon", {}, void 0, !0)
|
|
571
760
|
]),
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
])
|
|
761
|
+
c("div", Dt, [
|
|
762
|
+
c("p", Mt, [
|
|
763
|
+
A(r.$slots, "title", {}, () => [
|
|
764
|
+
j($(e.title), 1)
|
|
765
|
+
], !0)
|
|
577
766
|
]),
|
|
578
|
-
(
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
])
|
|
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)
|
|
582
771
|
]))), 256))
|
|
583
772
|
]),
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
onClick:
|
|
773
|
+
c("div", Pt, [
|
|
774
|
+
c("button", {
|
|
775
|
+
onClick: a[0] || (a[0] = (v) => n("close")),
|
|
587
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"
|
|
588
777
|
}, [
|
|
589
|
-
|
|
590
|
-
|
|
778
|
+
At,
|
|
779
|
+
N(M(rt), { class: "w-5 h-5" })
|
|
591
780
|
])
|
|
592
781
|
])
|
|
593
782
|
])
|
|
594
783
|
])
|
|
595
|
-
], 2)) :
|
|
784
|
+
], 2)) : D("", !0)
|
|
596
785
|
]),
|
|
597
786
|
_: 3
|
|
598
787
|
})
|
|
599
788
|
])
|
|
600
789
|
]));
|
|
601
790
|
}
|
|
602
|
-
}),
|
|
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 = {
|
|
603
792
|
__name: "pagination",
|
|
604
793
|
props: {
|
|
605
794
|
page: { type: Number, default: 1 },
|
|
@@ -624,69 +813,69 @@ const et = {
|
|
|
624
813
|
}
|
|
625
814
|
},
|
|
626
815
|
emits: ["update:page"],
|
|
627
|
-
setup(e, { emit:
|
|
628
|
-
const l = e, s =
|
|
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(() => {
|
|
629
818
|
let i = [1];
|
|
630
819
|
if (l.showAllPages || s.value <= 7) {
|
|
631
|
-
for (let
|
|
632
|
-
i.push(
|
|
820
|
+
for (let h = 2; h <= s.value; ++h)
|
|
821
|
+
i.push(h);
|
|
633
822
|
return i;
|
|
634
823
|
}
|
|
635
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;
|
|
636
|
-
}),
|
|
637
|
-
t.value > 1 &&
|
|
825
|
+
}), a = () => {
|
|
826
|
+
t.value > 1 && n("update:page", t.value - 1);
|
|
638
827
|
}, v = () => {
|
|
639
|
-
t.value < s.value &&
|
|
828
|
+
t.value < s.value && n("update:page", t.value + 1);
|
|
640
829
|
};
|
|
641
|
-
return
|
|
642
|
-
s.value = Math.ceil(l.total / l.perPage),
|
|
643
|
-
}),
|
|
644
|
-
s.value = Math.ceil(l.total / l.perPage), t.value > s.value &&
|
|
645
|
-
}), (i,
|
|
646
|
-
|
|
647
|
-
e.showNavButtons ? (
|
|
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", {
|
|
648
837
|
key: 0,
|
|
649
|
-
onClick:
|
|
838
|
+
onClick: V(a, ["prevent"]),
|
|
650
839
|
href: "#",
|
|
651
|
-
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]])
|
|
652
841
|
}, [
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
], 10,
|
|
842
|
+
N(M(ve), { class: "w-5 h-5" }),
|
|
843
|
+
j(" " + $(e.prevText), 1)
|
|
844
|
+
], 10, It)) : D("", !0)
|
|
656
845
|
]),
|
|
657
|
-
|
|
658
|
-
(
|
|
659
|
-
onClick:
|
|
660
|
-
key:
|
|
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,
|
|
661
850
|
href: m !== "dots" ? "#" : null,
|
|
662
|
-
class:
|
|
851
|
+
class: _(["inline-flex items-center px-4 text-sm font-medium", [{
|
|
663
852
|
"border-vxvue-500 text-vxvue-700": m === t.value,
|
|
664
853
|
"border-transparent text-gray-500": m !== t.value,
|
|
665
854
|
"hover:text-gray-700 hover:border-gray-300": m !== "dots"
|
|
666
855
|
}, o.value]])
|
|
667
856
|
}, {
|
|
668
|
-
default:
|
|
669
|
-
|
|
857
|
+
default: G(() => [
|
|
858
|
+
j($(m !== "dots" ? m : "..."), 1)
|
|
670
859
|
]),
|
|
671
860
|
_: 2
|
|
672
861
|
}, 1032, ["onClick", "href", "class"]))), 128))
|
|
673
862
|
]),
|
|
674
|
-
|
|
675
|
-
e.showNavButtons ? (
|
|
863
|
+
c("div", Ot, [
|
|
864
|
+
e.showNavButtons ? (u(), d("a", {
|
|
676
865
|
key: 0,
|
|
677
|
-
onClick:
|
|
866
|
+
onClick: V(v, ["prevent"]),
|
|
678
867
|
href: "#",
|
|
679
|
-
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 }]])
|
|
680
869
|
}, [
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
], 10,
|
|
870
|
+
j($(e.nextText) + " ", 1),
|
|
871
|
+
N(M(fe), { class: "w-5 h-5" })
|
|
872
|
+
], 10, jt)) : D("", !0)
|
|
684
873
|
])
|
|
685
874
|
]));
|
|
686
875
|
}
|
|
687
876
|
};
|
|
688
|
-
function
|
|
689
|
-
return
|
|
877
|
+
function Yt(e, n) {
|
|
878
|
+
return u(), d("svg", {
|
|
690
879
|
xmlns: "http://www.w3.org/2000/svg",
|
|
691
880
|
fill: "none",
|
|
692
881
|
viewBox: "0 0 24 24",
|
|
@@ -694,15 +883,15 @@ function pt(e, a) {
|
|
|
694
883
|
stroke: "currentColor",
|
|
695
884
|
"aria-hidden": "true"
|
|
696
885
|
}, [
|
|
697
|
-
|
|
886
|
+
c("path", {
|
|
698
887
|
"stroke-linecap": "round",
|
|
699
888
|
"stroke-linejoin": "round",
|
|
700
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"
|
|
701
890
|
})
|
|
702
891
|
]);
|
|
703
892
|
}
|
|
704
|
-
function
|
|
705
|
-
return
|
|
893
|
+
function Et(e, n) {
|
|
894
|
+
return u(), d("svg", {
|
|
706
895
|
xmlns: "http://www.w3.org/2000/svg",
|
|
707
896
|
fill: "none",
|
|
708
897
|
viewBox: "0 0 24 24",
|
|
@@ -710,131 +899,126 @@ function gt(e, a) {
|
|
|
710
899
|
stroke: "currentColor",
|
|
711
900
|
"aria-hidden": "true"
|
|
712
901
|
}, [
|
|
713
|
-
|
|
902
|
+
c("path", {
|
|
714
903
|
"stroke-linecap": "round",
|
|
715
904
|
"stroke-linejoin": "round",
|
|
716
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"
|
|
717
906
|
}),
|
|
718
|
-
|
|
907
|
+
c("path", {
|
|
719
908
|
"stroke-linecap": "round",
|
|
720
909
|
"stroke-linejoin": "round",
|
|
721
910
|
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
722
911
|
})
|
|
723
912
|
]);
|
|
724
913
|
}
|
|
725
|
-
const
|
|
914
|
+
const Nt = ["value", "type"], vl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
726
915
|
__name: "password-input",
|
|
727
916
|
props: ["modelValue"],
|
|
728
917
|
emits: ["update:modelValue"],
|
|
729
|
-
setup(e, { emit:
|
|
730
|
-
const l =
|
|
731
|
-
let t = Object.assign({},
|
|
918
|
+
setup(e, { emit: n }) {
|
|
919
|
+
const l = g(!1), s = C(() => {
|
|
920
|
+
let t = Object.assign({}, q());
|
|
732
921
|
return delete t.class, t;
|
|
733
922
|
});
|
|
734
|
-
return (t, o) => (
|
|
735
|
-
class:
|
|
923
|
+
return (t, o) => (u(), d("div", {
|
|
924
|
+
class: _("inline-block relative " + q().class)
|
|
736
925
|
}, [
|
|
737
|
-
|
|
926
|
+
c("input", O({
|
|
738
927
|
value: e.modelValue,
|
|
739
928
|
type: l.value ? "text" : "password",
|
|
740
|
-
onInput: o[0] || (o[0] = (
|
|
741
|
-
}, s.value, { class: "block pr-10 w-full form-input peer" }), null, 16,
|
|
742
|
-
|
|
743
|
-
onClick: o[1] || (o[1] =
|
|
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"])),
|
|
744
933
|
class: "flex absolute inset-y-0 right-0 items-center pr-3 text-brand-700 hover:text-brand"
|
|
745
934
|
}, [
|
|
746
|
-
l.value ? (
|
|
935
|
+
l.value ? (u(), R(M(Yt), {
|
|
747
936
|
key: 0,
|
|
748
937
|
class: "w-5 h-5"
|
|
749
|
-
})) : (
|
|
938
|
+
})) : (u(), R(M(Et), {
|
|
750
939
|
key: 1,
|
|
751
940
|
class: "w-5 h-5"
|
|
752
941
|
}))
|
|
753
942
|
]),
|
|
754
|
-
|
|
943
|
+
A(t.$slots, "default")
|
|
755
944
|
], 2));
|
|
756
945
|
}
|
|
757
|
-
}),
|
|
946
|
+
}), zt = { class: "flex items-center pb-1" }, Rt = ["id", "checked"], Ht = ["for"], Ut = { key: 1 }, Wt = ["href"], qt = {
|
|
758
947
|
key: 0,
|
|
759
948
|
class: "ml-6"
|
|
760
|
-
},
|
|
949
|
+
}, fl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
761
950
|
__name: "simple-tree",
|
|
762
951
|
props: { branch: { type: Object, default: {} } },
|
|
763
952
|
emits: ["branch-selected", "expand"],
|
|
764
|
-
setup(e, { emit:
|
|
765
|
-
const l = e, s =
|
|
766
|
-
return
|
|
767
|
-
l.branch.current &&
|
|
953
|
+
setup(e, { emit: n }) {
|
|
954
|
+
const l = e, s = g(!1);
|
|
955
|
+
return oe(() => {
|
|
956
|
+
l.branch.current && n("expand", !0);
|
|
768
957
|
}), (t, o) => {
|
|
769
|
-
const
|
|
770
|
-
return
|
|
771
|
-
class:
|
|
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])
|
|
772
961
|
}, [
|
|
773
|
-
|
|
774
|
-
e.branch.branches && e.branch.branches.length ? (
|
|
775
|
-
|
|
962
|
+
c("div", zt, [
|
|
963
|
+
e.branch.branches && e.branch.branches.length ? (u(), d(P, { key: 0 }, [
|
|
964
|
+
c("input", {
|
|
776
965
|
type: "checkbox",
|
|
777
966
|
id: "branch-" + e.branch.id,
|
|
778
|
-
onClick: o[0] || (o[0] = (
|
|
967
|
+
onClick: o[0] || (o[0] = (a) => s.value = !s.value),
|
|
779
968
|
checked: s.value,
|
|
780
969
|
class: "hidden"
|
|
781
|
-
}, null, 8,
|
|
782
|
-
|
|
970
|
+
}, null, 8, Rt),
|
|
971
|
+
c("label", {
|
|
783
972
|
for: "branch-" + e.branch.id,
|
|
784
973
|
class: "mr-2"
|
|
785
974
|
}, [
|
|
786
|
-
(
|
|
787
|
-
], 8,
|
|
788
|
-
], 64)) :
|
|
789
|
-
e.branch.current ? (
|
|
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", {
|
|
790
979
|
key: 2,
|
|
791
980
|
href: e.branch.path,
|
|
792
|
-
onClick: o[1] || (o[1] =
|
|
793
|
-
},
|
|
981
|
+
onClick: o[1] || (o[1] = V((a) => n("branch-selected", e.branch), ["prevent"]))
|
|
982
|
+
}, $(e.branch.label), 9, Wt))
|
|
794
983
|
]),
|
|
795
|
-
e.branch.branches && e.branch.branches.length ?
|
|
796
|
-
(
|
|
797
|
-
branch:
|
|
798
|
-
key:
|
|
799
|
-
onBranchSelected: o[2] || (o[2] = (v) =>
|
|
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)),
|
|
800
989
|
onExpand: o[3] || (o[3] = (v) => {
|
|
801
|
-
s.value = v,
|
|
990
|
+
s.value = v, n("expand", v);
|
|
802
991
|
})
|
|
803
992
|
}, null, 8, ["branch"]))), 128))
|
|
804
993
|
], 512)), [
|
|
805
|
-
[
|
|
806
|
-
]) :
|
|
994
|
+
[Se, s.value]
|
|
995
|
+
]) : D("", !0)
|
|
807
996
|
], 2);
|
|
808
997
|
};
|
|
809
998
|
}
|
|
810
999
|
});
|
|
811
|
-
const
|
|
812
|
-
const l = e.__vccOpts || e;
|
|
813
|
-
for (const [s, t] of a)
|
|
814
|
-
l[s] = t;
|
|
815
|
-
return l;
|
|
816
|
-
}, Dt = { class: "overflow-hidden rounded ring-1 ring-opacity-10 shadow ring-slate-500" }, St = { class: "min-w-full divide-y divide-y-slate-900" }, Mt = { class: "text-white bg-slate-700" }, Vt = ["onClick"], Pt = { class: "flex items-center" }, At = {
|
|
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 = {
|
|
817
1001
|
key: 0,
|
|
818
1002
|
xmlns: "http://www.w3.org/2000/svg",
|
|
819
1003
|
class: "flex-shrink-0 ml-2 w-4 h-4",
|
|
820
1004
|
fill: "none",
|
|
821
1005
|
viewBox: "0 0 24 24",
|
|
822
1006
|
stroke: "currentColor"
|
|
823
|
-
},
|
|
1007
|
+
}, el = ["d"], tl = {
|
|
824
1008
|
key: 1,
|
|
825
1009
|
"stroke-linecap": "round",
|
|
826
1010
|
"stroke-linejoin": "round",
|
|
827
1011
|
"stroke-width": "2",
|
|
828
1012
|
d: "M8 9l4-4 4 4m0 6l-4 4-4-4"
|
|
829
|
-
},
|
|
1013
|
+
}, ll = {
|
|
830
1014
|
__name: "sortable",
|
|
831
1015
|
props: {
|
|
832
1016
|
columns: {
|
|
833
1017
|
type: Array,
|
|
834
1018
|
required: !0,
|
|
835
1019
|
validator: (e) => {
|
|
836
|
-
for (const
|
|
837
|
-
if (
|
|
1020
|
+
for (const n of e)
|
|
1021
|
+
if (n.label === void 0 || n.prop === void 0)
|
|
838
1022
|
return !1;
|
|
839
1023
|
return !0;
|
|
840
1024
|
}
|
|
@@ -847,57 +1031,57 @@ const Ct = (e, a) => {
|
|
|
847
1031
|
keyProperty: { type: String, default: "key" }
|
|
848
1032
|
},
|
|
849
1033
|
emits: ["before-sort", "after-sort"],
|
|
850
|
-
setup(e, { emit:
|
|
851
|
-
const l = e, s =
|
|
852
|
-
let
|
|
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();
|
|
853
1037
|
const v = l.columns.find(({ prop: i }) => i === s.value);
|
|
854
|
-
return v && (t.value === "asc" && v.sortAscFunction ?
|
|
855
|
-
}),
|
|
856
|
-
|
|
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 }));
|
|
857
1041
|
};
|
|
858
|
-
return (
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
(
|
|
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", {
|
|
863
1047
|
scope: "col",
|
|
864
|
-
class:
|
|
1048
|
+
class: _(["py-3 px-6 text-left", [
|
|
865
1049
|
{ "cursor-pointer": i.sortable, active: s.value === i.prop },
|
|
866
1050
|
i.cssClass
|
|
867
1051
|
]]),
|
|
868
|
-
onClick: (
|
|
1052
|
+
onClick: (h) => i.sortable ? r(i.prop) : null
|
|
869
1053
|
}, [
|
|
870
|
-
|
|
1054
|
+
A(a.$slots, i.prop + "-header", {
|
|
871
1055
|
column: i,
|
|
872
1056
|
sortDir: t.value,
|
|
873
1057
|
sortProp: s.value
|
|
874
1058
|
}, () => [
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
i.sortable ? (
|
|
878
|
-
s.value === i.prop ? (
|
|
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", {
|
|
879
1063
|
key: 0,
|
|
880
1064
|
"stroke-linecap": "round",
|
|
881
1065
|
"stroke-linejoin": "round",
|
|
882
1066
|
"stroke-width": "2",
|
|
883
1067
|
d: t.value === "asc" ? "M19 9l-7 7-7-7" : "M5 15l7-7 7 7"
|
|
884
|
-
}, null, 8,
|
|
885
|
-
])) :
|
|
1068
|
+
}, null, 8, el)) : (u(), d("path", tl))
|
|
1069
|
+
])) : D("", !0)
|
|
886
1070
|
])
|
|
887
1071
|
], !0)
|
|
888
|
-
], 10,
|
|
1072
|
+
], 10, Zt))), 256))
|
|
889
1073
|
])
|
|
890
1074
|
]),
|
|
891
|
-
|
|
892
|
-
(
|
|
1075
|
+
c("tbody", null, [
|
|
1076
|
+
(u(!0), d(P, null, B(o.value, (i) => (u(), d("tr", {
|
|
893
1077
|
key: i[e.keyProperty],
|
|
894
|
-
class:
|
|
1078
|
+
class: _(i.cssClass)
|
|
895
1079
|
}, [
|
|
896
|
-
(
|
|
897
|
-
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 }])
|
|
898
1082
|
}, [
|
|
899
|
-
|
|
900
|
-
|
|
1083
|
+
A(a.$slots, h.prop, { row: i }, () => [
|
|
1084
|
+
j($(i[h.prop]), 1)
|
|
901
1085
|
], !0)
|
|
902
1086
|
], 2))), 256))
|
|
903
1087
|
], 2))), 128))
|
|
@@ -905,16 +1089,18 @@ const Ct = (e, a) => {
|
|
|
905
1089
|
])
|
|
906
1090
|
]));
|
|
907
1091
|
}
|
|
908
|
-
},
|
|
1092
|
+
}, pl = /* @__PURE__ */ pe(ll, [["__scopeId", "data-v-f0e4e642"]]);
|
|
909
1093
|
export {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
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
|
|
920
1106
|
};
|