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