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