vx-vue 1.1.0 → 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 +63 -63
- package/dist/style.css +1 -1
- package/dist/vxvue.es.js +579 -586
- package/dist/vxvue.umd.js +1 -1
- package/package.json +43 -43
package/dist/vxvue.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useSlots 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
|
-
setup(e, { emit:
|
|
7
|
-
const t = e, s =
|
|
6
|
+
setup(e, { emit: d }) {
|
|
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);
|
|
@@ -23,21 +23,21 @@ const xl = {
|
|
|
23
23
|
}
|
|
24
24
|
r(f);
|
|
25
25
|
};
|
|
26
|
-
return Ve(() => l.value = []), (f, x) => (u(!0), m(O, null,
|
|
27
|
-
var
|
|
28
|
-
return u(),
|
|
29
|
-
key:
|
|
30
|
-
show: Array.isArray(e.activeIndex) ? (
|
|
31
|
-
onSelect: (I) => o(
|
|
32
|
-
onKeydown: (I) => i(
|
|
33
|
-
onKeyup: (I) => r(
|
|
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,
|
|
40
|
+
function Ie(e, d) {
|
|
41
41
|
return u(), m("svg", {
|
|
42
42
|
xmlns: "http://www.w3.org/2000/svg",
|
|
43
43
|
viewBox: "0 0 24 24",
|
|
@@ -45,14 +45,29 @@ function Ie(e, c) {
|
|
|
45
45
|
"aria-hidden": "true",
|
|
46
46
|
"data-slot": "icon"
|
|
47
47
|
}, [
|
|
48
|
-
|
|
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
|
+
}
|
|
55
|
+
function Oe(e, d) {
|
|
56
|
+
return u(), m("svg", {
|
|
57
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
58
|
+
viewBox: "0 0 24 24",
|
|
59
|
+
fill: "currentColor",
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
"data-slot": "icon"
|
|
62
|
+
}, [
|
|
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"
|
|
52
67
|
})
|
|
53
68
|
]);
|
|
54
69
|
}
|
|
55
|
-
function re(e,
|
|
70
|
+
function re(e, d) {
|
|
56
71
|
return u(), m("svg", {
|
|
57
72
|
xmlns: "http://www.w3.org/2000/svg",
|
|
58
73
|
viewBox: "0 0 24 24",
|
|
@@ -60,14 +75,14 @@ function re(e, c) {
|
|
|
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"
|
|
67
82
|
})
|
|
68
83
|
]);
|
|
69
84
|
}
|
|
70
|
-
function ne(e,
|
|
85
|
+
function ne(e, d) {
|
|
71
86
|
return u(), m("svg", {
|
|
72
87
|
xmlns: "http://www.w3.org/2000/svg",
|
|
73
88
|
viewBox: "0 0 24 24",
|
|
@@ -75,14 +90,14 @@ function ne(e, c) {
|
|
|
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 Oe(e, c) {
|
|
|
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, c) {
|
|
|
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, c) {
|
|
|
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, c) {
|
|
|
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 ye(e, c) {
|
|
|
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"], Ye = { class: "overflow-hidden rounded-b" },
|
|
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
|
-
setup(e, { expose:
|
|
165
|
-
const s = t, a = e, l =
|
|
179
|
+
setup(e, { expose: d, emit: t }) {
|
|
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
|
|
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
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
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
|
-
|
|
215
|
+
v("div", {
|
|
201
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))]"]),
|
|
202
|
-
"aria-labelledby": "ap-control-" +
|
|
203
|
-
id: "ap-" +
|
|
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
|
-
const
|
|
216
|
-
return (l,
|
|
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);
|
|
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
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
|
|
254
|
-
var e,
|
|
255
|
-
return ke && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((
|
|
266
|
+
const Ue = Object.prototype.toString, Ke = (e) => Ue.call(e) === "[object Object]", ue = () => {
|
|
267
|
+
}, qe = /* @__PURE__ */ Xe();
|
|
268
|
+
function Xe() {
|
|
269
|
+
var e, d;
|
|
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
|
-
const
|
|
264
|
-
return e + (
|
|
278
|
+
const d = ["th", "st", "nd", "rd"], t = e % 100;
|
|
279
|
+
return e + (d[(t - 20) % 10] || d[t] || d[0]);
|
|
265
280
|
}
|
|
266
|
-
function pe(e,
|
|
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 pe(e, c, 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"),
|
|
@@ -299,62 +314,62 @@ function pe(e, c, t = {}) {
|
|
|
299
314
|
a: () => x(n, o, !0),
|
|
300
315
|
aa: () => x(n, o, !0, !0)
|
|
301
316
|
};
|
|
302
|
-
return
|
|
317
|
+
return d.replace(Ge, (g, S) => {
|
|
303
318
|
var I, z;
|
|
304
|
-
return (z =
|
|
319
|
+
return (z = S ?? ((I = h[g]) == null ? void 0 : I.call(h))) != null ? z : g;
|
|
305
320
|
});
|
|
306
321
|
}
|
|
307
322
|
const $e = ke ? window : void 0;
|
|
308
323
|
function se(e) {
|
|
309
|
-
var
|
|
324
|
+
var d;
|
|
310
325
|
const t = J(e);
|
|
311
|
-
return (
|
|
326
|
+
return (d = t == null ? void 0 : t.$el) != null ? d : t;
|
|
312
327
|
}
|
|
313
328
|
function de(...e) {
|
|
314
|
-
let
|
|
315
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([t, s, a] = e,
|
|
329
|
+
let d, t, s, a;
|
|
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
|
-
() => [se(
|
|
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
346
|
), i = () => {
|
|
332
|
-
o(),
|
|
347
|
+
o(), c();
|
|
333
348
|
};
|
|
334
|
-
return
|
|
349
|
+
return Ze(i), i;
|
|
335
350
|
}
|
|
336
|
-
let
|
|
337
|
-
function
|
|
338
|
-
const { window: s = $e, ignore: a = [], capture: l = !0, detectIframe:
|
|
351
|
+
let be = !1;
|
|
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
365
|
}), i = (h) => {
|
|
351
|
-
const
|
|
352
|
-
if (!(!
|
|
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;
|
|
356
371
|
}
|
|
357
|
-
|
|
372
|
+
d(h);
|
|
358
373
|
}
|
|
359
374
|
};
|
|
360
375
|
let r = !1;
|
|
@@ -365,20 +380,20 @@ function fe(e, c, t = {}) {
|
|
|
365
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: "" },
|
|
@@ -389,16 +404,16 @@ const Je = ["value", "onKeydown"], Qe = { class: "flex absolute inset-y-0 right-
|
|
|
389
404
|
autoSelect: Boolean
|
|
390
405
|
},
|
|
391
406
|
emits: ["update:modelValue", "blur", "submit"],
|
|
392
|
-
setup(e, { emit:
|
|
393
|
-
const t =
|
|
407
|
+
setup(e, { emit: d }) {
|
|
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), i = w(0), r = w(!1), f = w(!1), x = w("top-0 translate-y-12"), h = w(!0),
|
|
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",
|
|
@@ -408,120 +423,120 @@ 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 (
|
|
437
|
+
const D = s.search(V);
|
|
438
|
+
if (D instanceof Promise) {
|
|
424
439
|
const q = ++i.value;
|
|
425
|
-
f.value = !0,
|
|
426
|
-
q === i.value && (n.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 =
|
|
430
|
-
},
|
|
444
|
+
n.value = D, n.value.length === 0 ? Z() : (o.value = s.autoSelect ? 0 : -1, r.value = !0);
|
|
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
|
-
|
|
446
|
-
}, le = () => t("submit",
|
|
447
|
-
const
|
|
448
|
-
|
|
460
|
+
Z(), t("update:modelValue", "");
|
|
461
|
+
}, le = () => t("submit", C()), Q = (V) => {
|
|
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,
|
|
475
|
+
}), (V, D) => (u(), m("div", {
|
|
461
476
|
class: $(["inline-block relative", V.$attrs.class]),
|
|
462
477
|
ref_key: "container",
|
|
463
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
485
|
}, Y.value, {
|
|
471
|
-
onInput:
|
|
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
|
-
ae(
|
|
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(O, null,
|
|
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: {
|
|
522
537
|
type: [Object, Array],
|
|
523
538
|
default: { label: "Ok" },
|
|
524
|
-
validator: (e) => Array.isArray(e) && e.length <= 2 && e.filter((
|
|
539
|
+
validator: (e) => Array.isArray(e) && e.length <= 2 && e.filter((d) => d.label !== "undefined" && d.value !== "undefined").length === e.length || e.label !== void 0 && e.value !== void 0
|
|
525
540
|
},
|
|
526
541
|
headerClass: {
|
|
527
542
|
type: String,
|
|
@@ -532,94 +547,94 @@ const Je = ["value", "onKeydown"], Qe = { class: "flex absolute inset-y-0 right-
|
|
|
532
547
|
default: "button"
|
|
533
548
|
}
|
|
534
549
|
},
|
|
535
|
-
setup(e, { expose:
|
|
550
|
+
setup(e, { expose: d }) {
|
|
536
551
|
const t = e, s = w(""), a = w(""), l = w(!1);
|
|
537
|
-
let
|
|
552
|
+
let c = null, n = null;
|
|
538
553
|
const o = L(() => Array.isArray(t.buttons) ? t.buttons : [t.buttons]), i = w(null), r = (x, h) => {
|
|
539
|
-
l.value = !1, x.value !== void 0 ? x.value ?
|
|
554
|
+
l.value = !1, x.value !== void 0 ? x.value ? c() : n() : h ? n() : c();
|
|
540
555
|
};
|
|
541
|
-
return
|
|
542
|
-
|
|
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;
|
|
543
558
|
})) }), (x, h) => (u(), m(O, null, [
|
|
544
|
-
l.value ? (u(), m("div",
|
|
545
|
-
|
|
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
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
592
|
ref: i
|
|
578
593
|
}, [
|
|
579
|
-
(u(!0), m(O, null,
|
|
580
|
-
class: $([e.buttonClass,
|
|
581
|
-
onClick: N((I) => r(
|
|
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(),
|
|
631
|
+
a.shift(), c.sort((r, f) => r.srcPos < f.srcPos ? -1 : 1);
|
|
617
632
|
let n = [], o, i;
|
|
618
633
|
for (; o = a.shift(); )
|
|
619
|
-
i =
|
|
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" },
|
|
@@ -628,80 +643,58 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
628
643
|
modelValue: Date
|
|
629
644
|
},
|
|
630
645
|
emits: ["update:modelValue", "toggle-datepicker"],
|
|
631
|
-
setup(e, { emit:
|
|
632
|
-
const t =
|
|
633
|
-
let n = Object.assign({},
|
|
646
|
+
setup(e, { emit: d }) {
|
|
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
651
|
return K(() => s.modelValue, (n) => a.value = n ? pe(n, s.outputFormat) : ""), (n, o) => (u(), m("div", {
|
|
637
652
|
class: $(["inline-block relative", n.$attrs.class])
|
|
638
653
|
}, [
|
|
639
|
-
l.value ? (u(), m("div",
|
|
640
|
-
|
|
654
|
+
l.value ? (u(), m("div", mt, [
|
|
655
|
+
v("div", {
|
|
641
656
|
class: $(["block flex items-center w-full form-input bg-vxvue-50", { "pr-10": e.showToggle }])
|
|
642
657
|
}, [
|
|
643
|
-
|
|
644
|
-
|
|
658
|
+
v("span", ft, B(l.value), 1),
|
|
659
|
+
c.value.disabled ? P("", !0) : (u(), m("button", {
|
|
660
|
+
key: 0,
|
|
645
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
|
-
d("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
671
|
"onUpdate:modelValue": o[1] || (o[1] = (i) => a.value = i),
|
|
667
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
|
-
|
|
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,
|
|
680
685
|
onClick: o[4] || (o[4] = N((i) => t("toggle-datepicker"), ["stop"])),
|
|
681
|
-
ref: "toggleButton"
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
viewBox: "0 0 24 24",
|
|
688
|
-
stroke: "currentColor"
|
|
689
|
-
}, [
|
|
690
|
-
d("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")
|
|
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
|
-
modelValue: { type: [Date, Array], default: null, validator: (e,
|
|
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 },
|
|
705
698
|
shownMonth: Date,
|
|
706
699
|
maxNumberOfValues: { type: Number, default: 1 },
|
|
707
700
|
validFrom: Date,
|
|
@@ -713,173 +706,173 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
713
706
|
hasInput: { type: Boolean, default: !0 }
|
|
714
707
|
},
|
|
715
708
|
emits: ["update:modelValue", "month-change", "year-change"],
|
|
716
|
-
setup(e, { emit:
|
|
717
|
-
const t = e, s =
|
|
718
|
-
const
|
|
719
|
-
return new Date(
|
|
720
|
-
})(), l = w(null),
|
|
721
|
-
const
|
|
722
|
-
for (let Q = -R, V =
|
|
723
|
-
|
|
724
|
-
return
|
|
709
|
+
setup(e, { emit: d }) {
|
|
710
|
+
const t = e, s = d, a = (() => {
|
|
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 Y = (
|
|
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
|
-
},
|
|
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: $(["relative",
|
|
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
795
|
o.value === "days" ? (u(), m(O, { key: 0 }, [
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
796
|
+
v("div", pt, [
|
|
797
|
+
v("div", bt, [
|
|
798
|
+
v("button", {
|
|
806
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
|
-
|
|
804
|
+
v("span", null, B(l.value.toLocaleString(e.locale, { month: "long" })), 1),
|
|
805
|
+
v("button", {
|
|
813
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
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(O, null,
|
|
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(O, null,
|
|
838
|
+
(u(!0), m(O, null, _(I.value, (y) => (u(), m("button", {
|
|
846
839
|
class: $(["py-2 rounded-sm block text-center", F(y)]),
|
|
847
|
-
disabled: e.validFrom && e.validFrom > y || e.validUntil && e.validUntil < y || e.maxNumberOfValues > 1 &&
|
|
848
|
-
onClick: N((
|
|
849
|
-
}, B(y.getDate()), 11,
|
|
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)) :
|
|
844
|
+
], 64)) : P("", !0),
|
|
852
845
|
o.value === "years" ? (u(), m(O, { key: 1 }, [
|
|
853
|
-
|
|
854
|
-
|
|
846
|
+
v("div", kt, [
|
|
847
|
+
v("button", {
|
|
855
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
|
-
|
|
853
|
+
v("span", null, B(i.value) + " - " + B(i.value + 9), 1),
|
|
854
|
+
v("button", {
|
|
862
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(O, null,
|
|
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((
|
|
865
|
+
onClick: N((T) => {
|
|
873
866
|
G(i.value + y - 1), o.value = "days";
|
|
874
867
|
}, ["stop"])
|
|
875
|
-
}, B(i.value + y - 1), 9,
|
|
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 },
|
|
@@ -889,69 +882,69 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
889
882
|
id: { type: String, default: "form-file-button-" + Math.ceil(Math.random() * 1e3) }
|
|
890
883
|
},
|
|
891
884
|
emits: ["update:modelValue", "form-data"],
|
|
892
|
-
setup(e, { emit:
|
|
893
|
-
const t =
|
|
885
|
+
setup(e, { emit: d }) {
|
|
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"],
|
|
927
|
-
setup(e, { emit:
|
|
928
|
-
const t =
|
|
920
|
+
setup(e, { emit: d }) {
|
|
921
|
+
const t = d;
|
|
929
922
|
return (s, a) => (u(), m("select", j(s.$attrs, {
|
|
930
923
|
value: e.modelValue,
|
|
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(O, null,
|
|
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
|
-
setup(e, { emit:
|
|
946
|
-
const t =
|
|
947
|
-
let l = Object.assign({},
|
|
938
|
+
setup(e, { emit: d }) {
|
|
939
|
+
const t = d, s = L(() => {
|
|
940
|
+
let l = Object.assign({}, U());
|
|
948
941
|
return delete l.class, l;
|
|
949
|
-
}), a = L(() =>
|
|
950
|
-
return (l,
|
|
942
|
+
}), a = L(() => U().disabled || U().disabled === "");
|
|
943
|
+
return (l, c) => (u(), m("label", {
|
|
951
944
|
class: $(l.$attrs.class),
|
|
952
945
|
tabindex: "0"
|
|
953
946
|
}, [
|
|
954
|
-
|
|
947
|
+
v("span", {
|
|
955
948
|
role: "switch",
|
|
956
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",
|
|
@@ -960,7 +953,7 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
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
958
|
class: $([
|
|
966
959
|
"block relative size-5 rounded-full ring-0 shadow transition duration-200 ease-in-out transform pointer-events-none",
|
|
@@ -968,7 +961,7 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
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",
|
|
@@ -977,34 +970,34 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
977
970
|
stroke: "currentColor",
|
|
978
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
|
-
for (const [s, a] of
|
|
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",
|
|
@@ -1016,42 +1009,42 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
1016
1009
|
showTimeoutProgress: { type: Boolean, default: !1 }
|
|
1017
1010
|
},
|
|
1018
1011
|
emits: ["timeout", "close"],
|
|
1019
|
-
setup(e, { emit:
|
|
1020
|
-
const t = e, s =
|
|
1021
|
-
let
|
|
1012
|
+
setup(e, { emit: d }) {
|
|
1013
|
+
const t = e, s = d, a = L(() => typeof t.message == "string" ? [t.message] : t.message), l = w(0);
|
|
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, i) => (u(), m("div",
|
|
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
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(O, null,
|
|
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
|
-
|
|
1041
|
+
v("div", Rt, [
|
|
1042
|
+
v("button", {
|
|
1050
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
|
-
i[1] || (i[1] =
|
|
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
|
])
|
|
@@ -1059,29 +1052,29 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
1059
1052
|
e.showTimeoutProgress && e.timeout ? (u(), m("div", {
|
|
1060
1053
|
key: 0,
|
|
1061
1054
|
class: "h-1 transition-all ease-linear bg-vxvue-alt",
|
|
1062
|
-
style:
|
|
1055
|
+
style: ye({
|
|
1063
1056
|
width: l.value + "%",
|
|
1064
1057
|
"transition-duration": e.timeout + "ms"
|
|
1065
1058
|
}),
|
|
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,
|
|
@@ -1090,38 +1083,38 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
1090
1083
|
contentClass: { type: String, default: "" }
|
|
1091
1084
|
},
|
|
1092
1085
|
emits: ["clicked-outside"],
|
|
1093
|
-
setup(e, { emit:
|
|
1094
|
-
const t =
|
|
1095
|
-
return
|
|
1096
|
-
e.show ? (u(), m("div",
|
|
1097
|
-
|
|
1086
|
+
setup(e, { emit: d }) {
|
|
1087
|
+
const t = d, s = w(null);
|
|
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
|
-
|
|
1092
|
+
e.show ? (u(), m("div", Zt, [
|
|
1093
|
+
v("div", Ut, [
|
|
1094
|
+
v("div", {
|
|
1102
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
|
-
|
|
1099
|
+
v("div", {
|
|
1107
1100
|
class: $(e.headerClass)
|
|
1108
1101
|
}, [
|
|
1109
|
-
|
|
1102
|
+
A(a.$slots, "title")
|
|
1110
1103
|
], 2),
|
|
1111
|
-
|
|
1104
|
+
v("div", {
|
|
1112
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 },
|
|
@@ -1134,8 +1127,8 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
1134
1127
|
markerPosition: { type: String, default: "above", validator: (e) => ["above", "below"].includes(e) }
|
|
1135
1128
|
},
|
|
1136
1129
|
emits: ["update:page"],
|
|
1137
|
-
setup(e, { emit:
|
|
1138
|
-
const t =
|
|
1130
|
+
setup(e, { emit: d }) {
|
|
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(() => {
|
|
1139
1132
|
let r = [1];
|
|
1140
1133
|
if (s.showAllPages || a.value <= 7) {
|
|
1141
1134
|
for (let f = 2; f <= a.value; ++f)
|
|
@@ -1152,8 +1145,8 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
1152
1145
|
a.value = Math.ceil(s.total / s.perPage), t("update:page", 1);
|
|
1153
1146
|
}), K(() => s.total, (r) => {
|
|
1154
1147
|
a.value = Math.ceil(s.total / s.perPage), l.value > a.value && t("update:page", a.value);
|
|
1155
|
-
}), (r, f) => (u(), m("nav",
|
|
1156
|
-
|
|
1148
|
+
}), (r, f) => (u(), m("nav", Kt, [
|
|
1149
|
+
v("div", qt, [
|
|
1157
1150
|
e.showNavButtons ? (u(), m("button", {
|
|
1158
1151
|
key: 0,
|
|
1159
1152
|
onClick: o,
|
|
@@ -1163,18 +1156,18 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
1163
1156
|
"inline-flex items-center pr-1 text-sm border-transparent hover:text-vxvue"
|
|
1164
1157
|
])
|
|
1165
1158
|
}, [
|
|
1166
|
-
|
|
1159
|
+
E(M(re), { class: "size-5" }),
|
|
1167
1160
|
X(" " + B(e.prevText), 1)
|
|
1168
|
-
], 10,
|
|
1161
|
+
], 10, Xt)) : P("", !0)
|
|
1169
1162
|
]),
|
|
1170
|
-
|
|
1171
|
-
(u(!0), m(O, null,
|
|
1172
|
-
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,
|
|
1173
1166
|
key: h,
|
|
1174
1167
|
class: $([
|
|
1175
1168
|
{ "pointer-events-none": x === "dots" },
|
|
1176
1169
|
x === l.value ? "border-vxvue text-vxvue font-bold" : "border-transparent text-gray-500 hover:border-gray-300",
|
|
1177
|
-
|
|
1170
|
+
c.value,
|
|
1178
1171
|
"inline-flex items-center px-4 text-sm"
|
|
1179
1172
|
])
|
|
1180
1173
|
}, {
|
|
@@ -1184,7 +1177,7 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
1184
1177
|
_: 2
|
|
1185
1178
|
}, 1032, ["onClick", "class"]))), 128))
|
|
1186
1179
|
]),
|
|
1187
|
-
|
|
1180
|
+
v("div", Jt, [
|
|
1188
1181
|
e.showNavButtons ? (u(), m("button", {
|
|
1189
1182
|
key: 0,
|
|
1190
1183
|
onClick: i,
|
|
@@ -1195,13 +1188,13 @@ const vt = { key: 0 }, mt = { class: "text-vxvue-700" }, ft = /* @__PURE__ */ Ob
|
|
|
1195
1188
|
])
|
|
1196
1189
|
}, [
|
|
1197
1190
|
X(B(e.nextText) + " ", 1),
|
|
1198
|
-
|
|
1199
|
-
], 10,
|
|
1191
|
+
E(M(ne), { class: "size-5" })
|
|
1192
|
+
], 10, Qt)) : P("", !0)
|
|
1200
1193
|
])
|
|
1201
1194
|
]));
|
|
1202
1195
|
}
|
|
1203
1196
|
};
|
|
1204
|
-
function
|
|
1197
|
+
function el(e, d) {
|
|
1205
1198
|
return u(), m("svg", {
|
|
1206
1199
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1207
1200
|
fill: "none",
|
|
@@ -1211,14 +1204,14 @@ function Jt(e, c) {
|
|
|
1211
1204
|
"aria-hidden": "true",
|
|
1212
1205
|
"data-slot": "icon"
|
|
1213
1206
|
}, [
|
|
1214
|
-
|
|
1207
|
+
v("path", {
|
|
1215
1208
|
"stroke-linecap": "round",
|
|
1216
1209
|
"stroke-linejoin": "round",
|
|
1217
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"
|
|
1218
1211
|
})
|
|
1219
1212
|
]);
|
|
1220
1213
|
}
|
|
1221
|
-
function
|
|
1214
|
+
function tl(e, d) {
|
|
1222
1215
|
return u(), m("svg", {
|
|
1223
1216
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1224
1217
|
fill: "none",
|
|
@@ -1228,149 +1221,149 @@ function Qt(e, c) {
|
|
|
1228
1221
|
"aria-hidden": "true",
|
|
1229
1222
|
"data-slot": "icon"
|
|
1230
1223
|
}, [
|
|
1231
|
-
|
|
1224
|
+
v("path", {
|
|
1232
1225
|
"stroke-linecap": "round",
|
|
1233
1226
|
"stroke-linejoin": "round",
|
|
1234
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"
|
|
1235
1228
|
}),
|
|
1236
|
-
|
|
1229
|
+
v("path", {
|
|
1237
1230
|
"stroke-linecap": "round",
|
|
1238
1231
|
"stroke-linejoin": "round",
|
|
1239
1232
|
d: "M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
|
|
1240
1233
|
})
|
|
1241
1234
|
]);
|
|
1242
1235
|
}
|
|
1243
|
-
const
|
|
1236
|
+
const ll = ["value", "type"], al = ["disabled"], Ll = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1244
1237
|
__name: "password-input",
|
|
1245
1238
|
props: ["modelValue"],
|
|
1246
1239
|
emits: ["update:modelValue"],
|
|
1247
|
-
setup(e, { emit:
|
|
1248
|
-
const t =
|
|
1249
|
-
let l = Object.assign({},
|
|
1240
|
+
setup(e, { emit: d }) {
|
|
1241
|
+
const t = d, s = w(!1), a = L(() => {
|
|
1242
|
+
let l = Object.assign({}, U());
|
|
1250
1243
|
return delete l.class, l;
|
|
1251
1244
|
});
|
|
1252
|
-
return (l,
|
|
1253
|
-
class: $("inline-block relative " +
|
|
1245
|
+
return (l, c) => (u(), m("div", {
|
|
1246
|
+
class: $("inline-block relative " + U().class)
|
|
1254
1247
|
}, [
|
|
1255
|
-
|
|
1248
|
+
v("input", j({
|
|
1256
1249
|
value: e.modelValue,
|
|
1257
1250
|
type: s.value ? "text" : "password",
|
|
1258
|
-
onInput:
|
|
1259
|
-
}, a.value, { class: "block pr-12 w-full form-input peer" }), null, 16,
|
|
1260
|
-
|
|
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", {
|
|
1261
1254
|
class: "flex absolute inset-y-0 right-0 items-center px-3 text-brand-700 hover:text-brand",
|
|
1262
1255
|
"aria-label": "show-password-toggle",
|
|
1263
|
-
disabled:
|
|
1264
|
-
onClick:
|
|
1256
|
+
disabled: U().disabled ?? !1,
|
|
1257
|
+
onClick: c[1] || (c[1] = N((n) => s.value = !s.value, ["stop"]))
|
|
1265
1258
|
}, [
|
|
1266
|
-
s.value ? (u(),
|
|
1259
|
+
s.value ? (u(), H(M(el), {
|
|
1267
1260
|
key: 0,
|
|
1268
1261
|
class: "size-5"
|
|
1269
|
-
})) : (u(),
|
|
1262
|
+
})) : (u(), H(M(tl), {
|
|
1270
1263
|
key: 1,
|
|
1271
1264
|
class: "size-5"
|
|
1272
1265
|
}))
|
|
1273
|
-
], 8,
|
|
1266
|
+
], 8, al)
|
|
1274
1267
|
], 2));
|
|
1275
1268
|
}
|
|
1276
|
-
}),
|
|
1269
|
+
}), sl = { class: "flex items-center pb-1" }, nl = {
|
|
1277
1270
|
key: 0,
|
|
1278
1271
|
class: "ml-6"
|
|
1279
|
-
},
|
|
1272
|
+
}, Pl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1280
1273
|
__name: "simple-tree",
|
|
1281
1274
|
props: {
|
|
1282
1275
|
branch: { type: Object, default: {} },
|
|
1283
1276
|
modelValue: { type: Object, default: null }
|
|
1284
1277
|
},
|
|
1285
1278
|
emits: ["update:modelValue", "expand"],
|
|
1286
|
-
setup(e, { emit:
|
|
1287
|
-
const t = e, s =
|
|
1279
|
+
setup(e, { emit: d }) {
|
|
1280
|
+
const t = e, s = d, a = w(!1);
|
|
1288
1281
|
return me(() => {
|
|
1289
1282
|
t.branch === t.modelValue && s("expand", !0);
|
|
1290
|
-
}), (l,
|
|
1283
|
+
}), (l, c) => {
|
|
1291
1284
|
const n = Le("simple-tree", !0);
|
|
1292
1285
|
return u(), m("div", {
|
|
1293
1286
|
class: $([!e.branch.branches || !e.branch.branches.length ? "terminates" : "", l.$attrs.class])
|
|
1294
1287
|
}, [
|
|
1295
|
-
|
|
1288
|
+
v("div", sl, [
|
|
1296
1289
|
e.branch.branches && e.branch.branches.length ? (u(), m("button", {
|
|
1297
1290
|
key: 0,
|
|
1298
|
-
onClick:
|
|
1291
|
+
onClick: c[0] || (c[0] = (o) => a.value = !a.value),
|
|
1299
1292
|
class: "mr-2"
|
|
1300
1293
|
}, [
|
|
1301
|
-
|
|
1294
|
+
A(l.$slots, "toggle", {
|
|
1302
1295
|
branch: e.branch,
|
|
1303
1296
|
expanded: a.value
|
|
1304
1297
|
}, () => [
|
|
1305
|
-
(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" }))
|
|
1306
1299
|
])
|
|
1307
|
-
])) :
|
|
1308
|
-
e.branch === e.modelValue ?
|
|
1300
|
+
])) : P("", !0),
|
|
1301
|
+
e.branch === e.modelValue ? A(l.$slots, "label-selected", {
|
|
1309
1302
|
key: 1,
|
|
1310
1303
|
branch: e.branch
|
|
1311
1304
|
}, () => [
|
|
1312
|
-
|
|
1305
|
+
v("strong", null, B(e.branch.label), 1)
|
|
1313
1306
|
]) : (u(), m("button", {
|
|
1314
1307
|
key: 2,
|
|
1315
|
-
onClick:
|
|
1308
|
+
onClick: c[1] || (c[1] = (o) => s("update:modelValue", e.branch))
|
|
1316
1309
|
}, [
|
|
1317
|
-
|
|
1310
|
+
A(l.$slots, "label", { branch: e.branch }, () => [
|
|
1318
1311
|
X(B(e.branch.label), 1)
|
|
1319
1312
|
])
|
|
1320
1313
|
]))
|
|
1321
1314
|
]),
|
|
1322
|
-
e.branch.branches && e.branch.branches.length ?
|
|
1323
|
-
(u(!0), m(O, null,
|
|
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, {
|
|
1324
1317
|
key: o.id || o.key || null,
|
|
1325
1318
|
branch: o,
|
|
1326
1319
|
"model-value": e.modelValue,
|
|
1327
|
-
"onUpdate:modelValue":
|
|
1328
|
-
onExpand:
|
|
1320
|
+
"onUpdate:modelValue": c[2] || (c[2] = (i) => s("update:modelValue", i)),
|
|
1321
|
+
onExpand: c[3] || (c[3] = (i) => {
|
|
1329
1322
|
a.value = i, s("expand", i);
|
|
1330
1323
|
})
|
|
1331
1324
|
}, Pe({ _: 2 }, [
|
|
1332
|
-
|
|
1325
|
+
_(l.$slots, (i, r) => ({
|
|
1333
1326
|
name: r,
|
|
1334
1327
|
fn: te((f) => [
|
|
1335
|
-
|
|
1328
|
+
A(l.$slots, r, j({ ref_for: !0 }, f))
|
|
1336
1329
|
])
|
|
1337
1330
|
}))
|
|
1338
1331
|
]), 1032, ["branch", "model-value"]))), 128))
|
|
1339
1332
|
], 512)), [
|
|
1340
1333
|
[Te, a.value]
|
|
1341
|
-
]) :
|
|
1334
|
+
]) : P("", !0)
|
|
1342
1335
|
], 2);
|
|
1343
1336
|
};
|
|
1344
1337
|
}
|
|
1345
|
-
}),
|
|
1338
|
+
}), Tl = {
|
|
1346
1339
|
__name: "sizable",
|
|
1347
1340
|
props: { vertical: Boolean },
|
|
1348
1341
|
emits: ["dragStart", "dragStop"],
|
|
1349
|
-
setup(e, { emit:
|
|
1350
|
-
const t = e, s =
|
|
1351
|
-
let
|
|
1352
|
-
const f = (
|
|
1353
|
-
var
|
|
1354
|
-
if (
|
|
1355
|
-
|
|
1356
|
-
const { pageX: I, pageY: z } = ((
|
|
1342
|
+
setup(e, { emit: d }) {
|
|
1343
|
+
const t = e, s = d, a = w(null), l = w(null);
|
|
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;
|
|
1357
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";
|
|
1358
1351
|
}
|
|
1359
|
-
}, x = (
|
|
1352
|
+
}, x = (g) => {
|
|
1360
1353
|
var z;
|
|
1361
|
-
|
|
1362
|
-
const { pageX:
|
|
1363
|
-
n = { x:
|
|
1364
|
-
}, h = (
|
|
1365
|
-
|
|
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));
|
|
1366
1359
|
};
|
|
1367
|
-
return (
|
|
1360
|
+
return (g, S) => (u(), m("div", {
|
|
1368
1361
|
class: "relative",
|
|
1369
1362
|
ref_key: "box",
|
|
1370
1363
|
ref: a
|
|
1371
1364
|
}, [
|
|
1372
|
-
|
|
1373
|
-
|
|
1365
|
+
A(g.$slots, "default"),
|
|
1366
|
+
v("div", j({
|
|
1374
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"]
|
|
1375
1368
|
}, oe({
|
|
1376
1369
|
touchstart: x,
|
|
@@ -1381,15 +1374,15 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1381
1374
|
ref_key: "handle",
|
|
1382
1375
|
ref: l
|
|
1383
1376
|
}), [
|
|
1384
|
-
|
|
1385
|
-
|
|
1377
|
+
A(g.$slots, "handle", {}, () => [
|
|
1378
|
+
v("div", {
|
|
1386
1379
|
class: $(["rounded-full bg-vxvue", t.vertical ? "h-1.5 w-8" : "h-8 w-1.5"])
|
|
1387
1380
|
}, null, 2)
|
|
1388
1381
|
])
|
|
1389
1382
|
], 16)
|
|
1390
1383
|
], 512));
|
|
1391
1384
|
}
|
|
1392
|
-
},
|
|
1385
|
+
}, ol = ["aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext"], rl = ["id"], ul = ["id", "aria-label"], Il = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1393
1386
|
__name: "slider",
|
|
1394
1387
|
props: {
|
|
1395
1388
|
min: { type: Number, default: 0 },
|
|
@@ -1397,61 +1390,61 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1397
1390
|
vertical: Boolean,
|
|
1398
1391
|
disabled: Boolean,
|
|
1399
1392
|
modelValue: { type: [Number, Array], validator(e) {
|
|
1400
|
-
return typeof e == "number" || e.every((
|
|
1393
|
+
return typeof e == "number" || e.every((d) => typeof d == "number");
|
|
1401
1394
|
} }
|
|
1402
1395
|
},
|
|
1403
1396
|
emits: ["update:modelValue", "dragStart", "dragStop"],
|
|
1404
|
-
setup(e, { emit:
|
|
1405
|
-
const t = e, s =
|
|
1397
|
+
setup(e, { emit: d }) {
|
|
1398
|
+
const t = e, s = d, a = U(), l = { x: null, y: null }, c = { w: null, h: null };
|
|
1406
1399
|
let n = !1;
|
|
1407
1400
|
const o = w(null), i = w(0), r = L(() => {
|
|
1408
|
-
const k = t.max,
|
|
1409
|
-
return t.modelValue instanceof Array ? t.modelValue.map((F) => (Math.max(Math.min(F, k),
|
|
1401
|
+
const k = t.max, C = t.min;
|
|
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);
|
|
1410
1403
|
}), f = L(() => {
|
|
1411
1404
|
if (t.modelValue instanceof Array) {
|
|
1412
|
-
const k = Math.min(...r.value) + "%",
|
|
1413
|
-
return t.vertical ? { bottom: k, height:
|
|
1405
|
+
const k = Math.min(...r.value) + "%", C = Math.max(...r.value) - Math.min(...r.value) + "%";
|
|
1406
|
+
return t.vertical ? { bottom: k, height: C } : { left: k, width: C };
|
|
1414
1407
|
}
|
|
1415
1408
|
return t.vertical ? { bottom: 0, height: r.value + "%" } : { width: r.value + "%" };
|
|
1416
1409
|
}), x = w({
|
|
1417
1410
|
class: (t.vertical ? "left-0 -translate-x-1.5 translate-y-2.5" : "top-0 -translate-x-2.5 -translate-y-1.5") + " touch-none absolute size-5 rounded-full border-2 bg-white transition-colors duration-200 " + (t.disabled ? "" : " focus:ring-4 focus:outline-none border-vxvue cursor-grab hover:bg-vxvue focus:ring-vxvue/50"),
|
|
1418
1411
|
tabindex: 0
|
|
1419
1412
|
}), h = (k) => {
|
|
1420
|
-
let
|
|
1421
|
-
if (
|
|
1413
|
+
let C = parseFloat(k.toFixed(10));
|
|
1414
|
+
if (C = Math.min(t.max, Math.max(t.min, C)), t.modelValue instanceof Array) {
|
|
1422
1415
|
let F = [...t.modelValue];
|
|
1423
|
-
F[i.value] =
|
|
1416
|
+
F[i.value] = C, s("update:modelValue", F);
|
|
1424
1417
|
} else
|
|
1425
|
-
s("update:modelValue",
|
|
1426
|
-
},
|
|
1427
|
-
const { pageX:
|
|
1428
|
-
h(Math.floor((t.max - t.min) *
|
|
1429
|
-
},
|
|
1430
|
-
const { clientLeft: k, clientTop:
|
|
1431
|
-
l.x = b.left + F - k, l.y = b.bottom +
|
|
1418
|
+
s("update:modelValue", C);
|
|
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;
|
|
1432
1425
|
}, I = (k) => {
|
|
1433
|
-
n && (k.preventDefault(),
|
|
1426
|
+
n && (k.preventDefault(), g(k));
|
|
1434
1427
|
}, z = (k) => {
|
|
1435
|
-
k.preventDefault(), k.currentTarget.focus(),
|
|
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");
|
|
1436
1429
|
}, Y = (k) => {
|
|
1437
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));
|
|
1438
1431
|
}, G = (k) => {
|
|
1439
1432
|
k.keyCode >= 33 && k.keyCode <= 40 && k.preventDefault();
|
|
1440
|
-
const
|
|
1433
|
+
const C = t.modelValue[i.value] ?? t.modelValue;
|
|
1441
1434
|
switch (k.keyCode) {
|
|
1442
1435
|
case 37:
|
|
1443
1436
|
case 40:
|
|
1444
|
-
h(
|
|
1437
|
+
h(C - 1);
|
|
1445
1438
|
break;
|
|
1446
1439
|
case 39:
|
|
1447
1440
|
case 38:
|
|
1448
|
-
h(
|
|
1441
|
+
h(C + 1);
|
|
1449
1442
|
break;
|
|
1450
1443
|
case 33:
|
|
1451
|
-
h(
|
|
1444
|
+
h(C + (t.max - t.min) / 10);
|
|
1452
1445
|
break;
|
|
1453
1446
|
case 34:
|
|
1454
|
-
h(
|
|
1447
|
+
h(C - (t.max - t.min) / 10);
|
|
1455
1448
|
break;
|
|
1456
1449
|
case 36:
|
|
1457
1450
|
h(t.min);
|
|
@@ -1459,10 +1452,10 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1459
1452
|
case 35:
|
|
1460
1453
|
h(t.max);
|
|
1461
1454
|
}
|
|
1462
|
-
},
|
|
1463
|
-
|
|
1455
|
+
}, Z = (k) => {
|
|
1456
|
+
S(), g(k);
|
|
1464
1457
|
};
|
|
1465
|
-
return (k,
|
|
1458
|
+
return (k, C) => (u(), m("div", j({
|
|
1466
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"],
|
|
1467
1460
|
ref_key: "track",
|
|
1468
1461
|
ref: o,
|
|
@@ -1473,31 +1466,31 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1473
1466
|
"aria-valuenow": e.modelValue[0] ?? e.modelValue,
|
|
1474
1467
|
"aria-valuetext": e.modelValue
|
|
1475
1468
|
}, oe(e.disabled ? {} : {
|
|
1476
|
-
click:
|
|
1469
|
+
click: Z
|
|
1477
1470
|
}, !0)), [
|
|
1478
|
-
e.disabled ?
|
|
1471
|
+
e.disabled ? P("", !0) : (u(), m("div", {
|
|
1479
1472
|
key: 0,
|
|
1480
1473
|
class: $(["absolute bg-vxvue", e.vertical ? "w-full rounded-t-full rounded-b-full" : "h-full rounded-r-full rounded-l-full"]),
|
|
1481
|
-
style:
|
|
1474
|
+
style: ye(f.value)
|
|
1482
1475
|
}, null, 6)),
|
|
1483
|
-
e.modelValue.length ? (u(!0), m(O, { key: 2 },
|
|
1484
|
-
id:
|
|
1485
|
-
style: e.vertical ? { bottom: r.value[
|
|
1486
|
-
"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)
|
|
1487
1480
|
}, oe(e.disabled ? {} : {
|
|
1488
|
-
focus: () => i.value =
|
|
1481
|
+
focus: () => i.value = p,
|
|
1489
1482
|
keydown: G,
|
|
1490
1483
|
touchstart: (b) => {
|
|
1491
|
-
i.value =
|
|
1484
|
+
i.value = p, z(b);
|
|
1492
1485
|
},
|
|
1493
1486
|
mousedown: (b) => {
|
|
1494
|
-
i.value =
|
|
1487
|
+
i.value = p, z(b);
|
|
1495
1488
|
},
|
|
1496
1489
|
touchend: Y,
|
|
1497
1490
|
mouseup: Y
|
|
1498
|
-
}, !0), { ref_for: !0 }, x.value), null, 16,
|
|
1491
|
+
}, !0), { ref_for: !0 }, x.value), null, 16, ul))), 256)) : (u(), m("button", j({
|
|
1499
1492
|
key: 1,
|
|
1500
|
-
id:
|
|
1493
|
+
id: M(a).id,
|
|
1501
1494
|
style: e.vertical ? { bottom: r.value + "%" } : { left: r.value + "%" },
|
|
1502
1495
|
"aria-label": "slider-thumb"
|
|
1503
1496
|
}, oe(e.disabled ? {} : {
|
|
@@ -1511,18 +1504,18 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1511
1504
|
},
|
|
1512
1505
|
touchend: Y,
|
|
1513
1506
|
mouseup: Y
|
|
1514
|
-
}, !0), x.value), null, 16,
|
|
1515
|
-
], 16,
|
|
1507
|
+
}, !0), x.value), null, 16, rl))
|
|
1508
|
+
], 16, ol));
|
|
1516
1509
|
}
|
|
1517
|
-
}),
|
|
1510
|
+
}), il = ["data-active", "onClick"], dl = { class: "flex items-center space-x-1" }, cl = ["data-active"], Ol = {
|
|
1518
1511
|
__name: "sortable",
|
|
1519
1512
|
props: {
|
|
1520
1513
|
columns: {
|
|
1521
1514
|
type: Array,
|
|
1522
1515
|
required: !0,
|
|
1523
1516
|
validator: (e) => {
|
|
1524
|
-
for (const
|
|
1525
|
-
if (
|
|
1517
|
+
for (const d of e)
|
|
1518
|
+
if (d.label === void 0 || d.prop === void 0)
|
|
1526
1519
|
return !1;
|
|
1527
1520
|
return !0;
|
|
1528
1521
|
}
|
|
@@ -1537,8 +1530,8 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1537
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" }
|
|
1538
1531
|
},
|
|
1539
1532
|
emits: ["before-sort", "after-sort"],
|
|
1540
|
-
setup(e, { emit:
|
|
1541
|
-
const t = e, s =
|
|
1533
|
+
setup(e, { emit: d }) {
|
|
1534
|
+
const t = e, s = d, a = w(t.sortProp), l = w(t.sortDirection), c = L(() => {
|
|
1542
1535
|
let o = t.rows.slice();
|
|
1543
1536
|
const i = t.columns.find(({ prop: r }) => r === a.value);
|
|
1544
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));
|
|
@@ -1548,11 +1541,11 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1548
1541
|
return (o, i) => (u(), m("table", {
|
|
1549
1542
|
class: $(o.$attrs.class || "w-full divide-y divide-y-slate-900 table-fixed")
|
|
1550
1543
|
}, [
|
|
1551
|
-
|
|
1544
|
+
v("thead", {
|
|
1552
1545
|
class: $(e.headerClass)
|
|
1553
1546
|
}, [
|
|
1554
|
-
|
|
1555
|
-
(u(!0), m(O, null,
|
|
1547
|
+
v("tr", null, [
|
|
1548
|
+
(u(!0), m(O, null, _(e.columns, (r) => (u(), m("th", {
|
|
1556
1549
|
scope: "col",
|
|
1557
1550
|
"data-active": a.value === r.prop ? "active" : null,
|
|
1558
1551
|
class: $([
|
|
@@ -1562,74 +1555,74 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1562
1555
|
]),
|
|
1563
1556
|
onClick: (f) => r.sortable ? n(r.prop) : null
|
|
1564
1557
|
}, [
|
|
1565
|
-
|
|
1558
|
+
A(o.$slots, r.prop + "-header", {
|
|
1566
1559
|
column: r,
|
|
1567
1560
|
sortDir: l.value,
|
|
1568
1561
|
sortProp: a.value
|
|
1569
1562
|
}, () => [
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
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)), {
|
|
1573
1566
|
key: 0,
|
|
1574
1567
|
class: "size-4"
|
|
1575
|
-
})) :
|
|
1568
|
+
})) : P("", !0)
|
|
1576
1569
|
])
|
|
1577
1570
|
])
|
|
1578
|
-
], 10,
|
|
1571
|
+
], 10, il))), 256))
|
|
1579
1572
|
])
|
|
1580
1573
|
], 2),
|
|
1581
|
-
|
|
1574
|
+
v("tbody", {
|
|
1582
1575
|
class: $(e.bodyClass)
|
|
1583
1576
|
}, [
|
|
1584
|
-
(u(!0), m(O, null,
|
|
1577
|
+
(u(!0), m(O, null, _(c.value, (r) => (u(), m("tr", {
|
|
1585
1578
|
key: r[e.keyProperty],
|
|
1586
1579
|
class: $(r.cssClass)
|
|
1587
1580
|
}, [
|
|
1588
|
-
(u(!0), m(O, null,
|
|
1581
|
+
(u(!0), m(O, null, _(e.columns, (f) => (u(), m("td", {
|
|
1589
1582
|
class: "overflow-hidden py-3 px-6 whitespace-nowrap text-ellipsis",
|
|
1590
1583
|
"data-active": a.value === f.prop ? "active" : null
|
|
1591
1584
|
}, [
|
|
1592
|
-
|
|
1585
|
+
A(o.$slots, f.prop, { row: r }, () => [
|
|
1593
1586
|
X(B(r[f.prop]), 1)
|
|
1594
1587
|
])
|
|
1595
|
-
], 8,
|
|
1588
|
+
], 8, cl))), 256))
|
|
1596
1589
|
], 2))), 128))
|
|
1597
1590
|
], 2)
|
|
1598
1591
|
], 2));
|
|
1599
1592
|
}
|
|
1600
|
-
},
|
|
1593
|
+
}, vl = { class: "flex items-center space-x-2" }, ml = ["disabled"], fl = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1601
1594
|
__name: "submit-button",
|
|
1602
1595
|
props: { busy: Boolean, spinnerClass: String, theme: String },
|
|
1603
1596
|
emits: ["submit"],
|
|
1604
|
-
setup(e, { emit:
|
|
1605
|
-
const t =
|
|
1606
|
-
return (s, a) => (u(), m("div",
|
|
1607
|
-
|
|
1597
|
+
setup(e, { emit: d }) {
|
|
1598
|
+
const t = d;
|
|
1599
|
+
return (s, a) => (u(), m("div", vl, [
|
|
1600
|
+
v("button", {
|
|
1608
1601
|
class: $([s.$attrs.class, e.theme]),
|
|
1609
1602
|
disabled: s.$attrs.disabled || e.busy,
|
|
1610
1603
|
type: "button",
|
|
1611
1604
|
onClick: a[0] || (a[0] = (l) => t("submit"))
|
|
1612
1605
|
}, [
|
|
1613
|
-
|
|
1614
|
-
], 10,
|
|
1615
|
-
e.busy ? (u(),
|
|
1606
|
+
A(s.$slots, "default", {}, void 0, !0)
|
|
1607
|
+
], 10, ml),
|
|
1608
|
+
e.busy ? (u(), H(we, {
|
|
1616
1609
|
key: 0,
|
|
1617
1610
|
class: $(e.spinnerClass || ["size-5", { error: "text-error", success: "text-success", default: "text-vxvue" }[e.theme || "default"]])
|
|
1618
|
-
}, null, 8, ["class"])) :
|
|
1611
|
+
}, null, 8, ["class"])) : P("", !0)
|
|
1619
1612
|
]));
|
|
1620
1613
|
}
|
|
1621
|
-
}),
|
|
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 = {
|
|
1622
1615
|
class: "flex -mb-px space-x-8",
|
|
1623
1616
|
"aria-label": "Tabs"
|
|
1624
|
-
},
|
|
1617
|
+
}, xl = ["onClick", "aria-current"], Fl = {
|
|
1625
1618
|
__name: "tabs",
|
|
1626
1619
|
props: {
|
|
1627
1620
|
items: { type: Array, default: [] },
|
|
1628
1621
|
activeIndex: { type: Number, default: 0 }
|
|
1629
1622
|
},
|
|
1630
1623
|
emits: ["update:active-index"],
|
|
1631
|
-
setup(e, { emit:
|
|
1632
|
-
const t = e, s =
|
|
1624
|
+
setup(e, { emit: d }) {
|
|
1625
|
+
const t = e, s = d, a = w(t.items[t.activeIndex] || {}), l = L(() => {
|
|
1633
1626
|
let n = [];
|
|
1634
1627
|
return t.items.forEach((o, i) => {
|
|
1635
1628
|
o.disabled || n.push({ label: o.name, key: i });
|
|
@@ -1638,25 +1631,25 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1638
1631
|
K(() => t.activeIndex, (n) => {
|
|
1639
1632
|
a.value = t.items[n] || {};
|
|
1640
1633
|
});
|
|
1641
|
-
const
|
|
1634
|
+
const c = (n) => {
|
|
1642
1635
|
n.disabled || (a.value = n, s("update:active-index", t.items.indexOf(n)));
|
|
1643
1636
|
};
|
|
1644
1637
|
return (n, o) => (u(), m(O, null, [
|
|
1645
|
-
|
|
1646
|
-
|
|
1638
|
+
v("div", hl, [
|
|
1639
|
+
E(Lt, {
|
|
1647
1640
|
options: l.value,
|
|
1648
1641
|
"model-value": e.activeIndex,
|
|
1649
1642
|
"onUpdate:modelValue": o[0] || (o[0] = (i) => s("update:activeIndex", i)),
|
|
1650
1643
|
class: "w-full"
|
|
1651
1644
|
}, null, 8, ["options", "model-value"])
|
|
1652
1645
|
]),
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
(u(!0), m(O, null,
|
|
1646
|
+
v("div", gl, [
|
|
1647
|
+
v("div", pl, [
|
|
1648
|
+
v("nav", bl, [
|
|
1649
|
+
(u(!0), m(O, null, _(e.items, (i) => (u(), m("a", {
|
|
1657
1650
|
key: i.name,
|
|
1658
1651
|
href: "#",
|
|
1659
|
-
onClick: N((r) =>
|
|
1652
|
+
onClick: N((r) => c(i), ["prevent"]),
|
|
1660
1653
|
class: $([
|
|
1661
1654
|
"group inline-flex items-center py-4 px-1 border-b-4 font-medium !no-underline border-transparent",
|
|
1662
1655
|
{
|
|
@@ -1667,13 +1660,13 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1667
1660
|
]),
|
|
1668
1661
|
"aria-current": a.value === i ? "page" : void 0
|
|
1669
1662
|
}, [
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1663
|
+
A(n.$slots, "icon", { tab: i }),
|
|
1664
|
+
v("span", null, [
|
|
1665
|
+
A(n.$slots, "default", { tab: i }, () => [
|
|
1673
1666
|
X(B(i.name), 1)
|
|
1674
1667
|
])
|
|
1675
1668
|
]),
|
|
1676
|
-
|
|
1669
|
+
A(n.$slots, "badge", { tab: i }, () => [
|
|
1677
1670
|
i.badge ? (u(), m("span", {
|
|
1678
1671
|
key: 0,
|
|
1679
1672
|
class: $([
|
|
@@ -1684,9 +1677,9 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1684
1677
|
"bg-gray-200": a.value !== i && !i.disabled
|
|
1685
1678
|
}
|
|
1686
1679
|
])
|
|
1687
|
-
}, B(i.badge), 3)) :
|
|
1680
|
+
}, B(i.badge), 3)) : P("", !0)
|
|
1688
1681
|
])
|
|
1689
|
-
], 10,
|
|
1682
|
+
], 10, xl))), 128))
|
|
1690
1683
|
])
|
|
1691
1684
|
])
|
|
1692
1685
|
])
|
|
@@ -1694,24 +1687,24 @@ const el = ["value", "type"], tl = ["disabled"], Al = /* @__PURE__ */ Object.ass
|
|
|
1694
1687
|
}
|
|
1695
1688
|
};
|
|
1696
1689
|
export {
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
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,
|
|
1706
|
+
Ol as Sortable,
|
|
1714
1707
|
we as Spinner,
|
|
1715
|
-
|
|
1716
|
-
|
|
1708
|
+
zl as SubmitButton,
|
|
1709
|
+
Fl as Tabs
|
|
1717
1710
|
};
|