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