@codemonster-ru/vueforge-core 1.3.3 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -7
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/switch/VfSwitch.vue.d.ts +3 -0
- package/dist/components/switch/VfSwitch.vue.d.ts.map +1 -1
- package/dist/components/theme-switch/VfThemeSwitch.vue.d.ts +31 -0
- package/dist/components/theme-switch/VfThemeSwitch.vue.d.ts.map +1 -0
- package/dist/components/theme-switch/index.d.ts +2 -0
- package/dist/components/theme-switch/index.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.d.ts.map +1 -1
- package/dist/providers/VfThemeProvider.vue.d.ts +2 -4
- package/dist/providers/VfThemeProvider.vue.d.ts.map +1 -1
- package/dist/providers/vueForgeConfig.d.ts +7 -1
- package/dist/providers/vueForgeConfig.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/theme.d.ts +3 -0
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/vueforge-core.js +879 -827
- package/package.json +1 -1
package/dist/vueforge-core.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { resolveThemeConfig as Le, applyThemeConfig as Se, resolveTheme as ze, DEFAULT_STORAGE_KEY as Me, DEFAULT_ATTRIBUTE as Pe, isThemeMode as Ne, vfMotionDurationsMs as
|
|
2
|
-
import { createThemePreset as
|
|
1
|
+
import { resolveThemeConfig as Le, applyThemeConfig as Se, resolveTheme as ze, DEFAULT_STORAGE_KEY as Me, DEFAULT_ATTRIBUTE as Pe, isThemeMode as Ne, vfMotionDurationsMs as Y } from "@codemonster-ru/vueforge-theme";
|
|
2
|
+
import { createThemePreset as Xn } from "@codemonster-ru/vueforge-theme";
|
|
3
3
|
import { defaultThemePreset as Fe } from "./theme-api.js";
|
|
4
|
-
import { defineComponent as L,
|
|
5
|
-
import { d as
|
|
6
|
-
import { t as
|
|
7
|
-
import { VueIconify as
|
|
4
|
+
import { defineComponent as L, inject as we, computed as s, ref as D, watch as ee, onMounted as ce, onBeforeUnmount as te, provide as Re, renderSlot as B, toValue as K, nextTick as oe, openBlock as d, createElementBlock as _, createElementVNode as T, unref as p, toDisplayString as N, normalizeClass as P, createVNode as j, Transition as ne, withCtx as G, createCommentVNode as O, useAttrs as R, mergeProps as H, createTextVNode as ae, normalizeStyle as W, useSlots as Te, createBlock as q, Teleport as le, resolveDynamicComponent as re, normalizeProps as Ve, guardReactiveProps as Ce, resolveComponent as He, Fragment as ue, renderList as de } from "vue";
|
|
5
|
+
import { d as xe } from "./useScrollLock-FYdn9vRp.js";
|
|
6
|
+
import { t as Qn, a as Jn, u as Zn, b as ea, c as ta, v as na } from "./useScrollLock-FYdn9vRp.js";
|
|
7
|
+
import { VueIconify as Z, icons as U } from "@codemonster-ru/vueiconify";
|
|
8
8
|
import { autoUpdate as Ke, computePosition as je, offset as ve, flip as pe, shift as me, arrow as he } from "@codemonster-ru/floater.js";
|
|
9
9
|
const Be = Symbol("VueForgeConfig");
|
|
10
10
|
function qe(t = {}) {
|
|
@@ -13,84 +13,93 @@ function qe(t = {}) {
|
|
|
13
13
|
preset: t.preset ?? Fe
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Ue(t, n) {
|
|
17
17
|
return Se(t, n);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function We() {
|
|
20
20
|
return {
|
|
21
21
|
install(n, e = {}) {
|
|
22
22
|
const i = qe(e.theme);
|
|
23
|
-
n.provide(Be, {
|
|
23
|
+
n.provide(Be, {
|
|
24
|
+
theme: i,
|
|
25
|
+
themeMode: {
|
|
26
|
+
defaultTheme: e.defaultTheme,
|
|
27
|
+
storageKey: e.themeStorageKey,
|
|
28
|
+
attribute: e.themeAttribute
|
|
29
|
+
}
|
|
30
|
+
}), typeof document < "u" && Ue(i);
|
|
24
31
|
}
|
|
25
32
|
};
|
|
26
33
|
}
|
|
27
|
-
const
|
|
34
|
+
const Tn = We(), Ee = Symbol("VfThemeContext"), Vn = /* @__PURE__ */ L({
|
|
28
35
|
__name: "VfThemeProvider",
|
|
29
36
|
props: {
|
|
30
|
-
defaultTheme: {
|
|
37
|
+
defaultTheme: {},
|
|
31
38
|
storageKey: {},
|
|
32
39
|
attribute: {}
|
|
33
40
|
},
|
|
34
41
|
setup(t) {
|
|
35
|
-
const n = t, e =
|
|
36
|
-
() =>
|
|
37
|
-
),
|
|
38
|
-
() =>
|
|
42
|
+
const n = t, e = we(Be, null), i = s(
|
|
43
|
+
() => n.defaultTheme ?? (e == null ? void 0 : e.themeMode.defaultTheme) ?? "system"
|
|
44
|
+
), l = D(i.value), r = D("light"), u = D(null), v = s(
|
|
45
|
+
() => ze(l.value, r.value)
|
|
46
|
+
), y = s(
|
|
47
|
+
() => n.storageKey ?? (e == null ? void 0 : e.themeMode.storageKey) ?? (e == null ? void 0 : e.theme.options.storageKey) ?? Me
|
|
39
48
|
), g = s(
|
|
40
|
-
() => n.attribute ?? (
|
|
41
|
-
),
|
|
42
|
-
let
|
|
43
|
-
function
|
|
49
|
+
() => n.attribute ?? (e == null ? void 0 : e.themeMode.attribute) ?? (e == null ? void 0 : e.theme.options.attribute) ?? Pe
|
|
50
|
+
), m = D(!1);
|
|
51
|
+
let C = null;
|
|
52
|
+
function x() {
|
|
44
53
|
if (typeof window > "u")
|
|
45
54
|
return;
|
|
46
|
-
const
|
|
47
|
-
Ne(
|
|
55
|
+
const f = window.localStorage.getItem(y.value);
|
|
56
|
+
Ne(f) && (l.value = f);
|
|
48
57
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
58
|
+
function w() {
|
|
59
|
+
C !== null && (window.clearTimeout(C), C = null);
|
|
51
60
|
}
|
|
52
|
-
function
|
|
61
|
+
function S(f, a = {}) {
|
|
53
62
|
if (typeof document > "u")
|
|
54
63
|
return;
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
const h = document.documentElement;
|
|
65
|
+
a.animate && (w(), h.classList.add("vf-theme-transitioning")), h.setAttribute(g.value, f), a.animate && (C = window.setTimeout(() => {
|
|
66
|
+
h.classList.remove("vf-theme-transitioning"), C = null;
|
|
58
67
|
}, 320));
|
|
59
68
|
}
|
|
60
|
-
function I(
|
|
61
|
-
var
|
|
62
|
-
if (
|
|
63
|
-
|
|
69
|
+
function I(f) {
|
|
70
|
+
var a;
|
|
71
|
+
if (f) {
|
|
72
|
+
r.value = f.matches ? "dark" : "light";
|
|
64
73
|
return;
|
|
65
74
|
}
|
|
66
|
-
|
|
75
|
+
r.value = (a = u.value) != null && a.matches ? "dark" : "light";
|
|
67
76
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
77
|
+
function z(f) {
|
|
78
|
+
l.value = f;
|
|
70
79
|
}
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
|
|
80
|
+
function $() {
|
|
81
|
+
const f = v.value === "dark" ? "light" : "dark";
|
|
82
|
+
l.value = f;
|
|
74
83
|
}
|
|
75
|
-
return
|
|
76
|
-
typeof window > "u" || window.localStorage.setItem(
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
(
|
|
80
|
-
|
|
84
|
+
return ee(l, (f) => {
|
|
85
|
+
typeof window > "u" || window.localStorage.setItem(y.value, f);
|
|
86
|
+
}), ee(
|
|
87
|
+
v,
|
|
88
|
+
(f) => {
|
|
89
|
+
S(f, { animate: m.value });
|
|
81
90
|
},
|
|
82
91
|
{ immediate: !0 }
|
|
83
|
-
),
|
|
84
|
-
|
|
85
|
-
}),
|
|
86
|
-
var
|
|
87
|
-
(
|
|
92
|
+
), ce(() => {
|
|
93
|
+
l.value = i.value, x(), u.value = window.matchMedia("(prefers-color-scheme: dark)"), I(), u.value.addEventListener("change", I), m.value = !0;
|
|
94
|
+
}), te(() => {
|
|
95
|
+
var f;
|
|
96
|
+
(f = u.value) == null || f.removeEventListener("change", I), w();
|
|
88
97
|
}), Re(Ee, {
|
|
89
|
-
mode:
|
|
90
|
-
resolvedTheme:
|
|
91
|
-
setTheme:
|
|
92
|
-
toggleTheme:
|
|
93
|
-
}), (
|
|
98
|
+
mode: l,
|
|
99
|
+
resolvedTheme: v,
|
|
100
|
+
setTheme: z,
|
|
101
|
+
toggleTheme: $
|
|
102
|
+
}), (f, a) => B(f.$slots, "default");
|
|
94
103
|
}
|
|
95
104
|
});
|
|
96
105
|
function Oe(t, n, e = {}) {
|
|
@@ -100,22 +109,22 @@ function Oe(t, n, e = {}) {
|
|
|
100
109
|
const u = r.target;
|
|
101
110
|
if (!(u instanceof Node))
|
|
102
111
|
return;
|
|
103
|
-
const
|
|
104
|
-
(
|
|
112
|
+
const v = Array.isArray(t) ? t.map((y) => y.value).filter((y) => y instanceof HTMLElement) : [t.value].filter(
|
|
113
|
+
(y) => y instanceof HTMLElement
|
|
105
114
|
);
|
|
106
|
-
|
|
115
|
+
v.length === 0 || v.some((y) => y.contains(u)) || n(r);
|
|
107
116
|
};
|
|
108
|
-
|
|
117
|
+
ce(() => {
|
|
109
118
|
document.addEventListener(i, l);
|
|
110
|
-
}),
|
|
119
|
+
}), te(() => {
|
|
111
120
|
document.removeEventListener(i, l);
|
|
112
121
|
});
|
|
113
122
|
}
|
|
114
123
|
function se(t = {}) {
|
|
115
|
-
const n = s(() => K(t.open) !== void 0), e =
|
|
124
|
+
const n = s(() => K(t.open) !== void 0), e = D(t.defaultOpen ?? !1), i = s(
|
|
116
125
|
() => n.value ? !!K(t.open) : e.value
|
|
117
126
|
);
|
|
118
|
-
|
|
127
|
+
ee(
|
|
119
128
|
() => K(t.open),
|
|
120
129
|
(r) => {
|
|
121
130
|
r !== void 0 && (e.value = r);
|
|
@@ -137,23 +146,23 @@ function fe(t, n = {}) {
|
|
|
137
146
|
const e = n.event ?? "keydown", i = (l) => {
|
|
138
147
|
K(n.enabled) === !1 || l.key !== "Escape" || t(l);
|
|
139
148
|
};
|
|
140
|
-
|
|
149
|
+
ce(() => {
|
|
141
150
|
document.addEventListener(e, i);
|
|
142
|
-
}),
|
|
151
|
+
}), te(() => {
|
|
143
152
|
document.removeEventListener(e, i);
|
|
144
153
|
});
|
|
145
154
|
}
|
|
146
155
|
function ye(t, n, e = {}) {
|
|
147
|
-
const i =
|
|
148
|
-
let
|
|
149
|
-
const
|
|
156
|
+
const i = D(0), l = D(0), r = D(K(e.placement) ?? "bottom"), u = D({}), v = D(null);
|
|
157
|
+
let y = 0;
|
|
158
|
+
const g = s(() => ({
|
|
150
159
|
left: `${i.value}px`,
|
|
151
160
|
top: `${l.value}px`
|
|
152
161
|
}));
|
|
153
|
-
async function
|
|
162
|
+
async function m() {
|
|
154
163
|
if (!t.value || !n.value)
|
|
155
164
|
return;
|
|
156
|
-
const
|
|
165
|
+
const x = await je(
|
|
157
166
|
t.value,
|
|
158
167
|
n.value,
|
|
159
168
|
{
|
|
@@ -162,32 +171,32 @@ function ye(t, n, e = {}) {
|
|
|
162
171
|
strategy: K(e.strategy)
|
|
163
172
|
}
|
|
164
173
|
);
|
|
165
|
-
i.value =
|
|
174
|
+
i.value = x.x, l.value = x.y, r.value = x.placement, u.value = x.middlewareData ?? {};
|
|
166
175
|
}
|
|
167
|
-
function
|
|
168
|
-
var
|
|
169
|
-
(
|
|
176
|
+
function C() {
|
|
177
|
+
var x;
|
|
178
|
+
(x = v.value) == null || x.call(v), v.value = null;
|
|
170
179
|
}
|
|
171
|
-
return
|
|
180
|
+
return ee(
|
|
172
181
|
[() => K(e.enabled) !== !1, t, n],
|
|
173
|
-
async ([
|
|
174
|
-
|
|
175
|
-
const w =
|
|
176
|
-
|
|
177
|
-
|
|
182
|
+
async ([x]) => {
|
|
183
|
+
y += 1;
|
|
184
|
+
const w = y;
|
|
185
|
+
C(), !(!x || !t.value || !n.value) && (await oe(), !(w !== y || K(e.enabled) === !1 || !t.value || !n.value) && (await m(), !(w !== y || K(e.enabled) === !1 || !t.value || !n.value) && (v.value = Ke(t.value, () => {
|
|
186
|
+
m();
|
|
178
187
|
}))));
|
|
179
188
|
},
|
|
180
189
|
{ immediate: !0 }
|
|
181
|
-
),
|
|
182
|
-
|
|
190
|
+
), te(() => {
|
|
191
|
+
C();
|
|
183
192
|
}), {
|
|
184
193
|
x: i,
|
|
185
194
|
y: l,
|
|
186
195
|
placement: r,
|
|
187
196
|
middlewareData: u,
|
|
188
|
-
styles:
|
|
189
|
-
update:
|
|
190
|
-
cleanup:
|
|
197
|
+
styles: g,
|
|
198
|
+
update: m,
|
|
199
|
+
cleanup: C
|
|
191
200
|
};
|
|
192
201
|
}
|
|
193
202
|
const Ye = [
|
|
@@ -205,7 +214,7 @@ function Xe(t) {
|
|
|
205
214
|
(n) => !n.hasAttribute("hidden") && n.getAttribute("aria-hidden") !== "true"
|
|
206
215
|
);
|
|
207
216
|
}
|
|
208
|
-
function
|
|
217
|
+
function Ae(t, n = {}) {
|
|
209
218
|
const e = (i) => {
|
|
210
219
|
if (i.key !== "Tab" || K(n.enabled) === !1)
|
|
211
220
|
return;
|
|
@@ -217,25 +226,25 @@ function De(t, n = {}) {
|
|
|
217
226
|
i.preventDefault(), l.focus();
|
|
218
227
|
return;
|
|
219
228
|
}
|
|
220
|
-
const u = r[0],
|
|
229
|
+
const u = r[0], v = r[r.length - 1], y = document.activeElement;
|
|
221
230
|
if (i.shiftKey) {
|
|
222
|
-
(
|
|
231
|
+
(y === u || y === l) && (i.preventDefault(), v.focus());
|
|
223
232
|
return;
|
|
224
233
|
}
|
|
225
|
-
|
|
234
|
+
y === v && (i.preventDefault(), u.focus());
|
|
226
235
|
};
|
|
227
|
-
|
|
236
|
+
ce(() => {
|
|
228
237
|
document.addEventListener("keydown", e);
|
|
229
|
-
}),
|
|
238
|
+
}), te(() => {
|
|
230
239
|
document.removeEventListener("keydown", e);
|
|
231
240
|
});
|
|
232
241
|
}
|
|
233
242
|
let Ge = 0;
|
|
234
|
-
function
|
|
243
|
+
function Q(t = {}) {
|
|
235
244
|
const n = `${t.prefix ?? "vf"}-${++Ge}`;
|
|
236
245
|
return s(() => K(t.providedId) ?? n);
|
|
237
246
|
}
|
|
238
|
-
function
|
|
247
|
+
function Qe() {
|
|
239
248
|
const t = we(Ee);
|
|
240
249
|
if (!t)
|
|
241
250
|
throw new Error("useTheme must be used inside VfThemeProvider.");
|
|
@@ -246,7 +255,7 @@ function kn() {
|
|
|
246
255
|
toggleTheme: t.toggleTheme
|
|
247
256
|
};
|
|
248
257
|
}
|
|
249
|
-
const
|
|
258
|
+
const Je = { class: "vf-accordion" }, Ze = ["id", "aria-controls", "aria-expanded", "disabled"], et = ["id", "aria-labelledby"], tt = { class: "vf-accordion__content-inner" }, Cn = /* @__PURE__ */ L({
|
|
250
259
|
__name: "VfAccordion",
|
|
251
260
|
props: {
|
|
252
261
|
open: { type: Boolean, default: void 0 },
|
|
@@ -256,113 +265,113 @@ const Qe = { class: "vf-accordion" }, Je = ["id", "aria-controls", "aria-expande
|
|
|
256
265
|
},
|
|
257
266
|
emits: ["update:open", "openChange"],
|
|
258
267
|
setup(t, { emit: n }) {
|
|
259
|
-
const e = t, i = n, l =
|
|
268
|
+
const e = t, i = n, l = Q({ prefix: "vf-accordion-trigger" }), r = Q({ prefix: "vf-accordion-content" }), u = se({
|
|
260
269
|
defaultOpen: e.defaultOpen,
|
|
261
270
|
open: s(() => e.open),
|
|
262
|
-
onOpenChange: (
|
|
263
|
-
i("update:open",
|
|
271
|
+
onOpenChange: (f) => {
|
|
272
|
+
i("update:open", f), i("openChange", f);
|
|
264
273
|
}
|
|
265
|
-
}),
|
|
274
|
+
}), v = u.isOpen, y = [
|
|
266
275
|
"height var(--vf-motion-duration-normal) var(--vf-motion-ease-standard)",
|
|
267
276
|
"opacity var(--vf-motion-duration-normal) var(--vf-motion-ease-standard)"
|
|
268
277
|
].join(", ");
|
|
269
|
-
function
|
|
270
|
-
const
|
|
271
|
-
return (
|
|
278
|
+
function g(f) {
|
|
279
|
+
const a = f.firstElementChild;
|
|
280
|
+
return (a == null ? void 0 : a.offsetHeight) ?? f.scrollHeight;
|
|
272
281
|
}
|
|
273
|
-
function
|
|
282
|
+
function m() {
|
|
274
283
|
e.disabled || u.toggle();
|
|
275
284
|
}
|
|
276
|
-
function
|
|
277
|
-
(
|
|
285
|
+
function C(f) {
|
|
286
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), m());
|
|
278
287
|
}
|
|
279
|
-
function
|
|
280
|
-
const
|
|
281
|
-
|
|
288
|
+
function x(f) {
|
|
289
|
+
const a = f;
|
|
290
|
+
a.style.height = "0px", a.style.opacity = "0", a.style.overflow = "hidden";
|
|
282
291
|
}
|
|
283
|
-
function w(
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}), window.setTimeout(
|
|
292
|
+
function w(f, a) {
|
|
293
|
+
const h = f;
|
|
294
|
+
h.style.transition = y, requestAnimationFrame(() => {
|
|
295
|
+
h.style.height = `${g(h)}px`, h.style.opacity = "1";
|
|
296
|
+
}), window.setTimeout(a, Y.normal);
|
|
288
297
|
}
|
|
289
|
-
function
|
|
290
|
-
const
|
|
291
|
-
|
|
298
|
+
function S(f) {
|
|
299
|
+
const a = f;
|
|
300
|
+
a.style.height = "", a.style.opacity = "", a.style.overflow = "", a.style.transition = "";
|
|
292
301
|
}
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
|
|
302
|
+
function I(f) {
|
|
303
|
+
const a = f;
|
|
304
|
+
a.style.height = `${g(a)}px`, a.style.opacity = "1", a.style.overflow = "hidden";
|
|
296
305
|
}
|
|
297
|
-
function z(
|
|
298
|
-
const
|
|
299
|
-
|
|
306
|
+
function z(f, a) {
|
|
307
|
+
const h = f;
|
|
308
|
+
h.style.transition = y, h.offsetHeight, h.style.height = "0px", h.style.opacity = "0", window.setTimeout(a, Y.normal);
|
|
300
309
|
}
|
|
301
|
-
function
|
|
302
|
-
const
|
|
303
|
-
|
|
310
|
+
function $(f) {
|
|
311
|
+
const a = f;
|
|
312
|
+
a.style.height = "", a.style.opacity = "", a.style.overflow = "", a.style.transition = "";
|
|
304
313
|
}
|
|
305
|
-
return (
|
|
314
|
+
return (f, a) => (d(), _("section", Je, [
|
|
306
315
|
T("button", {
|
|
307
|
-
id:
|
|
308
|
-
"aria-controls":
|
|
309
|
-
"aria-expanded":
|
|
316
|
+
id: p(l),
|
|
317
|
+
"aria-controls": p(r),
|
|
318
|
+
"aria-expanded": p(v),
|
|
310
319
|
disabled: t.disabled,
|
|
311
320
|
class: "vf-accordion__trigger",
|
|
312
321
|
type: "button",
|
|
313
|
-
onClick:
|
|
314
|
-
onKeydown:
|
|
322
|
+
onClick: m,
|
|
323
|
+
onKeydown: C
|
|
315
324
|
}, [
|
|
316
|
-
B(
|
|
317
|
-
T("span", null,
|
|
325
|
+
B(f.$slots, "trigger", { open: p(v) }, () => [
|
|
326
|
+
T("span", null, N(t.title), 1)
|
|
318
327
|
]),
|
|
319
328
|
T("span", {
|
|
320
329
|
"aria-hidden": "true",
|
|
321
|
-
class: P(["vf-accordion__icon",
|
|
330
|
+
class: P(["vf-accordion__icon", p(v) && "vf-accordion__icon--open"])
|
|
322
331
|
}, [
|
|
323
|
-
j(
|
|
324
|
-
icon:
|
|
332
|
+
j(p(Z), {
|
|
333
|
+
icon: p(U).chevronDown,
|
|
325
334
|
size: "0.875rem"
|
|
326
335
|
}, null, 8, ["icon"])
|
|
327
336
|
], 2)
|
|
328
|
-
], 40,
|
|
337
|
+
], 40, Ze),
|
|
329
338
|
j(ne, {
|
|
330
339
|
css: !1,
|
|
331
|
-
onBeforeEnter:
|
|
340
|
+
onBeforeEnter: x,
|
|
332
341
|
onEnter: w,
|
|
333
|
-
onAfterEnter:
|
|
334
|
-
onBeforeLeave:
|
|
342
|
+
onAfterEnter: S,
|
|
343
|
+
onBeforeLeave: I,
|
|
335
344
|
onLeave: z,
|
|
336
|
-
onAfterLeave:
|
|
345
|
+
onAfterLeave: $
|
|
337
346
|
}, {
|
|
338
|
-
default:
|
|
339
|
-
|
|
347
|
+
default: G(() => [
|
|
348
|
+
p(v) ? (d(), _("div", {
|
|
340
349
|
key: 0,
|
|
341
|
-
id:
|
|
342
|
-
"aria-labelledby":
|
|
350
|
+
id: p(r),
|
|
351
|
+
"aria-labelledby": p(l),
|
|
343
352
|
class: "vf-accordion__content",
|
|
344
353
|
role: "region"
|
|
345
354
|
}, [
|
|
346
|
-
T("div",
|
|
347
|
-
B(
|
|
355
|
+
T("div", tt, [
|
|
356
|
+
B(f.$slots, "default", { open: p(v) })
|
|
348
357
|
])
|
|
349
|
-
], 8,
|
|
358
|
+
], 8, et)) : O("", !0)
|
|
350
359
|
]),
|
|
351
360
|
_: 3
|
|
352
361
|
})
|
|
353
362
|
]));
|
|
354
363
|
}
|
|
355
364
|
});
|
|
356
|
-
function
|
|
365
|
+
function F(...t) {
|
|
357
366
|
return t.filter(Boolean).join(" ");
|
|
358
367
|
}
|
|
359
|
-
const
|
|
368
|
+
const nt = {
|
|
360
369
|
class: "vf-alert__icon",
|
|
361
370
|
"aria-hidden": "true"
|
|
362
|
-
},
|
|
371
|
+
}, at = { class: "vf-alert__content" }, ot = {
|
|
363
372
|
key: 0,
|
|
364
373
|
class: "vf-alert__title"
|
|
365
|
-
},
|
|
374
|
+
}, lt = { class: "vf-alert__body" }, xn = /* @__PURE__ */ L({
|
|
366
375
|
inheritAttrs: !1,
|
|
367
376
|
__name: "VfAlert",
|
|
368
377
|
props: {
|
|
@@ -371,31 +380,31 @@ const tt = {
|
|
|
371
380
|
},
|
|
372
381
|
setup(t) {
|
|
373
382
|
const n = t, e = R(), i = s(
|
|
374
|
-
() =>
|
|
375
|
-
), l = s(() => n.tone === "success" ?
|
|
376
|
-
return (r, u) => (
|
|
383
|
+
() => F("vf-alert", n.tone !== "primary" && `vf-alert--${n.tone}`)
|
|
384
|
+
), l = s(() => n.tone === "success" ? U.checkCircle : n.tone === "info" ? U.info : n.tone === "warn" ? U.warning : n.tone === "help" ? U.questionCircle : n.tone === "danger" ? U.warning : n.tone === "contrast" ? U.info : U.info);
|
|
385
|
+
return (r, u) => (d(), _("section", H({
|
|
377
386
|
class: i.value,
|
|
378
387
|
role: "alert"
|
|
379
|
-
},
|
|
380
|
-
T("div",
|
|
381
|
-
j(
|
|
388
|
+
}, p(e)), [
|
|
389
|
+
T("div", nt, [
|
|
390
|
+
j(p(Z), {
|
|
382
391
|
icon: l.value,
|
|
383
392
|
size: "2rem"
|
|
384
393
|
}, null, 8, ["icon"])
|
|
385
394
|
]),
|
|
386
|
-
T("div",
|
|
387
|
-
n.title || r.$slots.title ? (
|
|
395
|
+
T("div", at, [
|
|
396
|
+
n.title || r.$slots.title ? (d(), _("p", ot, [
|
|
388
397
|
B(r.$slots, "title", {}, () => [
|
|
389
|
-
|
|
398
|
+
ae(N(n.title), 1)
|
|
390
399
|
])
|
|
391
400
|
])) : O("", !0),
|
|
392
|
-
T("div",
|
|
401
|
+
T("div", lt, [
|
|
393
402
|
B(r.$slots, "default")
|
|
394
403
|
])
|
|
395
404
|
])
|
|
396
405
|
], 16));
|
|
397
406
|
}
|
|
398
|
-
}),
|
|
407
|
+
}), Bn = /* @__PURE__ */ L({
|
|
399
408
|
inheritAttrs: !1,
|
|
400
409
|
__name: "VfBadge",
|
|
401
410
|
props: {
|
|
@@ -403,13 +412,13 @@ const tt = {
|
|
|
403
412
|
},
|
|
404
413
|
setup(t) {
|
|
405
414
|
const n = t, e = R(), i = s(
|
|
406
|
-
() =>
|
|
415
|
+
() => F("vf-badge", n.tone !== "neutral" && `vf-badge--${n.tone}`)
|
|
407
416
|
);
|
|
408
|
-
return (l, r) => (
|
|
417
|
+
return (l, r) => (d(), _("span", H({ class: i.value }, p(e)), [
|
|
409
418
|
B(l.$slots, "default")
|
|
410
419
|
], 16));
|
|
411
420
|
}
|
|
412
|
-
}),
|
|
421
|
+
}), st = ["type"], En = /* @__PURE__ */ L({
|
|
413
422
|
inheritAttrs: !1,
|
|
414
423
|
__name: "VfButton",
|
|
415
424
|
props: {
|
|
@@ -420,24 +429,24 @@ const tt = {
|
|
|
420
429
|
},
|
|
421
430
|
setup(t) {
|
|
422
431
|
const n = t, e = R(), i = s(
|
|
423
|
-
() =>
|
|
432
|
+
() => F(
|
|
424
433
|
"vf-button",
|
|
425
434
|
`vf-button--${n.variant}`,
|
|
426
435
|
n.size !== "md" && `vf-button--${n.size}`,
|
|
427
436
|
n.block && "vf-button--block"
|
|
428
437
|
)
|
|
429
438
|
);
|
|
430
|
-
return (l, r) => (
|
|
439
|
+
return (l, r) => (d(), _("button", H({
|
|
431
440
|
class: i.value,
|
|
432
441
|
type: n.type
|
|
433
|
-
},
|
|
442
|
+
}, p(e)), [
|
|
434
443
|
B(l.$slots, "default")
|
|
435
|
-
], 16,
|
|
444
|
+
], 16, st));
|
|
436
445
|
}
|
|
437
|
-
}),
|
|
446
|
+
}), it = { key: 0 }, rt = { class: "vf-card__title" }, ut = {
|
|
438
447
|
key: 1,
|
|
439
448
|
class: "vf-card__body"
|
|
440
|
-
},
|
|
449
|
+
}, dt = { key: 2 }, On = /* @__PURE__ */ L({
|
|
441
450
|
inheritAttrs: !1,
|
|
442
451
|
__name: "VfCard",
|
|
443
452
|
props: {
|
|
@@ -446,26 +455,26 @@ const tt = {
|
|
|
446
455
|
},
|
|
447
456
|
setup(t) {
|
|
448
457
|
const n = t, e = R(), i = s(
|
|
449
|
-
() =>
|
|
458
|
+
() => F("vf-card", n.compact && "vf-card--compact")
|
|
450
459
|
);
|
|
451
|
-
return (l, r) => (
|
|
452
|
-
n.title || l.$slots.header ? (
|
|
460
|
+
return (l, r) => (d(), _("section", H({ class: i.value }, p(e)), [
|
|
461
|
+
n.title || l.$slots.header ? (d(), _("header", it, [
|
|
453
462
|
B(l.$slots, "header", {}, () => [
|
|
454
|
-
T("h3",
|
|
463
|
+
T("h3", rt, N(n.title), 1)
|
|
455
464
|
])
|
|
456
465
|
])) : O("", !0),
|
|
457
|
-
l.$slots.default ? (
|
|
466
|
+
l.$slots.default ? (d(), _("div", ut, [
|
|
458
467
|
B(l.$slots, "default")
|
|
459
468
|
])) : O("", !0),
|
|
460
|
-
l.$slots.footer ? (
|
|
469
|
+
l.$slots.footer ? (d(), _("footer", dt, [
|
|
461
470
|
B(l.$slots, "footer")
|
|
462
471
|
])) : O("", !0)
|
|
463
472
|
], 16));
|
|
464
473
|
}
|
|
465
|
-
}), ct = ["checked", "disabled", "aria-invalid"],
|
|
474
|
+
}), ct = ["checked", "disabled", "aria-invalid"], ft = {
|
|
466
475
|
key: 0,
|
|
467
476
|
class: "vf-checkbox__content"
|
|
468
|
-
},
|
|
477
|
+
}, An = /* @__PURE__ */ L({
|
|
469
478
|
inheritAttrs: !1,
|
|
470
479
|
__name: "VfCheckbox",
|
|
471
480
|
props: {
|
|
@@ -478,7 +487,7 @@ const tt = {
|
|
|
478
487
|
emits: ["update:modelValue", "change"],
|
|
479
488
|
setup(t, { emit: n }) {
|
|
480
489
|
const e = t, i = n, l = R(), r = s(
|
|
481
|
-
() =>
|
|
490
|
+
() => F(
|
|
482
491
|
"vf-checkbox",
|
|
483
492
|
`vf-checkbox--${e.size}`,
|
|
484
493
|
e.modelValue && "vf-checkbox--checked",
|
|
@@ -486,16 +495,16 @@ const tt = {
|
|
|
486
495
|
e.disabled && "vf-checkbox--disabled",
|
|
487
496
|
l.class
|
|
488
497
|
)
|
|
489
|
-
), u = s(() => l.style),
|
|
498
|
+
), u = s(() => l.style), v = s(
|
|
490
499
|
() => Object.fromEntries(
|
|
491
|
-
Object.entries(l).filter(([
|
|
500
|
+
Object.entries(l).filter(([g]) => g !== "class" && g !== "style")
|
|
492
501
|
)
|
|
493
502
|
);
|
|
494
|
-
function g
|
|
495
|
-
const
|
|
496
|
-
i("update:modelValue",
|
|
503
|
+
function y(g) {
|
|
504
|
+
const m = g.target.checked;
|
|
505
|
+
i("update:modelValue", m), i("change", m);
|
|
497
506
|
}
|
|
498
|
-
return (
|
|
507
|
+
return (g, m) => (d(), _("label", {
|
|
499
508
|
class: P(r.value),
|
|
500
509
|
style: W(u.value)
|
|
501
510
|
}, [
|
|
@@ -505,21 +514,21 @@ const tt = {
|
|
|
505
514
|
checked: e.modelValue,
|
|
506
515
|
disabled: e.disabled,
|
|
507
516
|
"aria-invalid": e.invalid || void 0
|
|
508
|
-
},
|
|
509
|
-
|
|
517
|
+
}, v.value, { onChange: y }), null, 16, ct),
|
|
518
|
+
m[0] || (m[0] = T("span", {
|
|
510
519
|
class: "vf-checkbox__control",
|
|
511
520
|
"aria-hidden": "true"
|
|
512
521
|
}, [
|
|
513
522
|
T("span", { class: "vf-checkbox__mark" })
|
|
514
523
|
], -1)),
|
|
515
|
-
t.label ||
|
|
516
|
-
B(
|
|
517
|
-
|
|
524
|
+
t.label || g.$slots.default ? (d(), _("span", ft, [
|
|
525
|
+
B(g.$slots, "default", {}, () => [
|
|
526
|
+
ae(N(t.label), 1)
|
|
518
527
|
])
|
|
519
528
|
])) : O("", !0)
|
|
520
529
|
], 6));
|
|
521
530
|
}
|
|
522
|
-
}),
|
|
531
|
+
}), vt = ["type"], De = /* @__PURE__ */ L({
|
|
523
532
|
inheritAttrs: !1,
|
|
524
533
|
__name: "VfIconButton",
|
|
525
534
|
props: {
|
|
@@ -530,33 +539,33 @@ const tt = {
|
|
|
530
539
|
},
|
|
531
540
|
setup(t) {
|
|
532
541
|
const n = t, e = R(), i = s(
|
|
533
|
-
() =>
|
|
542
|
+
() => F(
|
|
534
543
|
"vf-icon-button",
|
|
535
544
|
n.variant !== "ghost" && `vf-icon-button--${n.variant}`,
|
|
536
545
|
n.size !== "md" && `vf-icon-button--${n.size}`
|
|
537
546
|
)
|
|
538
547
|
), l = s(() => n.size === "sm" ? "0.875rem" : n.size === "lg" ? "1.125rem" : "1rem");
|
|
539
|
-
return (r, u) => (
|
|
548
|
+
return (r, u) => (d(), _("button", H({
|
|
540
549
|
class: i.value,
|
|
541
550
|
type: n.type
|
|
542
|
-
},
|
|
543
|
-
j(
|
|
551
|
+
}, p(e)), [
|
|
552
|
+
j(p(Z), {
|
|
544
553
|
icon: n.icon,
|
|
545
554
|
size: l.value,
|
|
546
555
|
"aria-hidden": "true"
|
|
547
556
|
}, null, 8, ["icon", "size"])
|
|
548
|
-
], 16,
|
|
557
|
+
], 16, vt));
|
|
549
558
|
}
|
|
550
|
-
}),
|
|
559
|
+
}), pt = ["aria-labelledby"], mt = {
|
|
551
560
|
key: 0,
|
|
552
561
|
class: "vf-drawer__header"
|
|
553
|
-
},
|
|
562
|
+
}, ht = ["id"], yt = { class: "vf-drawer__actions" }, _t = {
|
|
554
563
|
key: 1,
|
|
555
564
|
class: "vf-drawer__body"
|
|
556
|
-
},
|
|
565
|
+
}, gt = {
|
|
557
566
|
key: 2,
|
|
558
567
|
class: "vf-drawer__footer"
|
|
559
|
-
},
|
|
568
|
+
}, Dn = /* @__PURE__ */ L({
|
|
560
569
|
inheritAttrs: !1,
|
|
561
570
|
__name: "VfDrawer",
|
|
562
571
|
props: {
|
|
@@ -576,166 +585,166 @@ const tt = {
|
|
|
576
585
|
},
|
|
577
586
|
emits: ["update:open", "openChange"],
|
|
578
587
|
setup(t, { emit: n }) {
|
|
579
|
-
const e = t, i = n, l = R(), r =
|
|
588
|
+
const e = t, i = n, l = R(), r = D(null), u = D(null), v = Te(), y = Q({ prefix: "vf-drawer-title" }), g = se({
|
|
580
589
|
defaultOpen: e.defaultOpen,
|
|
581
590
|
open: s(() => e.open),
|
|
582
|
-
onOpenChange: (
|
|
583
|
-
i("update:open",
|
|
591
|
+
onOpenChange: (V) => {
|
|
592
|
+
i("update:open", V), i("openChange", V);
|
|
584
593
|
}
|
|
585
|
-
}),
|
|
586
|
-
enter:
|
|
587
|
-
leave:
|
|
594
|
+
}), m = g.isOpen, C = {
|
|
595
|
+
enter: Y.normal,
|
|
596
|
+
leave: Y.normal
|
|
588
597
|
};
|
|
589
|
-
function V
|
|
590
|
-
return typeof
|
|
598
|
+
function x(V) {
|
|
599
|
+
return typeof V == "number" ? `${V}px` : V;
|
|
591
600
|
}
|
|
592
601
|
const w = s(() => {
|
|
593
|
-
const
|
|
594
|
-
return k != null && (
|
|
595
|
-
}),
|
|
596
|
-
() =>
|
|
602
|
+
const V = {}, k = x(e.offsetTop), J = x(e.bodyPadding);
|
|
603
|
+
return k != null && (V["--vf-drawer-offset-top"] = k), J != null && (V["--vf-drawer-body-padding"] = J), V;
|
|
604
|
+
}), S = s(
|
|
605
|
+
() => F(
|
|
597
606
|
"vf-drawer",
|
|
598
607
|
`vf-drawer--${e.placement}`,
|
|
599
608
|
e.offsetTop != null && "vf-drawer--offset-top"
|
|
600
609
|
)
|
|
601
|
-
),
|
|
610
|
+
), I = s(() => [
|
|
602
611
|
w.value,
|
|
603
612
|
l.style
|
|
604
613
|
]), z = s(() => Object.fromEntries(
|
|
605
|
-
Object.entries(l).filter(([
|
|
606
|
-
)),
|
|
614
|
+
Object.entries(l).filter(([V]) => V !== "class" && V !== "style")
|
|
615
|
+
)), $ = s(
|
|
607
616
|
() => e.disableTeleport || e.teleportTo === !1 || e.teleportTo === null
|
|
608
|
-
),
|
|
609
|
-
() =>
|
|
617
|
+
), f = s(() => e.scrollLockTarget === !1 ? null : e.scrollLockTarget), a = s(() => typeof e.teleportTo == "string" || typeof HTMLElement < "u" && e.teleportTo instanceof HTMLElement ? e.teleportTo : "body"), h = s(
|
|
618
|
+
() => F(
|
|
610
619
|
"vf-drawer__content",
|
|
611
620
|
`vf-drawer__content--${e.placement}`,
|
|
612
621
|
`vf-drawer__content--${e.size}`
|
|
613
622
|
)
|
|
614
|
-
),
|
|
615
|
-
() => e.title ||
|
|
623
|
+
), c = s(() => !!v.header), o = s(
|
|
624
|
+
() => e.title || c.value ? y.value : void 0
|
|
616
625
|
);
|
|
617
|
-
function
|
|
618
|
-
|
|
626
|
+
function E() {
|
|
627
|
+
g.close();
|
|
619
628
|
}
|
|
620
|
-
function
|
|
621
|
-
e.closeOnOverlayClick &&
|
|
629
|
+
function A() {
|
|
630
|
+
e.closeOnOverlayClick && E();
|
|
622
631
|
}
|
|
623
632
|
function M() {
|
|
624
|
-
const
|
|
625
|
-
if (!
|
|
633
|
+
const V = r.value;
|
|
634
|
+
if (!V)
|
|
626
635
|
return;
|
|
627
|
-
const k =
|
|
636
|
+
const k = V.querySelector(
|
|
628
637
|
"[autofocus], [data-autofocus]"
|
|
629
638
|
);
|
|
630
639
|
if (k) {
|
|
631
640
|
k.focus();
|
|
632
641
|
return;
|
|
633
642
|
}
|
|
634
|
-
|
|
643
|
+
V.focus();
|
|
635
644
|
}
|
|
636
645
|
return fe(
|
|
637
|
-
(
|
|
638
|
-
!e.closeOnEscape || !
|
|
646
|
+
(V) => {
|
|
647
|
+
!e.closeOnEscape || !m.value || (V.preventDefault(), E());
|
|
639
648
|
},
|
|
640
649
|
{
|
|
641
|
-
enabled:
|
|
650
|
+
enabled: m
|
|
642
651
|
}
|
|
643
|
-
),
|
|
644
|
-
enabled:
|
|
645
|
-
}),
|
|
646
|
-
target:
|
|
647
|
-
}),
|
|
648
|
-
|
|
649
|
-
async (
|
|
652
|
+
), Ae(r, {
|
|
653
|
+
enabled: m
|
|
654
|
+
}), xe(m, {
|
|
655
|
+
target: f
|
|
656
|
+
}), ee(
|
|
657
|
+
m,
|
|
658
|
+
async (V) => {
|
|
650
659
|
var k;
|
|
651
660
|
if (!(typeof document > "u")) {
|
|
652
|
-
if (
|
|
653
|
-
u.value = document.activeElement instanceof HTMLElement ? document.activeElement : null, await
|
|
661
|
+
if (V) {
|
|
662
|
+
u.value = document.activeElement instanceof HTMLElement ? document.activeElement : null, await oe(), M();
|
|
654
663
|
return;
|
|
655
664
|
}
|
|
656
665
|
(k = u.value) == null || k.focus();
|
|
657
666
|
}
|
|
658
667
|
},
|
|
659
668
|
{ immediate: !0 }
|
|
660
|
-
),
|
|
661
|
-
var
|
|
662
|
-
|
|
663
|
-
}), (
|
|
664
|
-
to:
|
|
665
|
-
disabled:
|
|
669
|
+
), te(() => {
|
|
670
|
+
var V;
|
|
671
|
+
m.value && ((V = u.value) == null || V.focus());
|
|
672
|
+
}), (V, k) => (d(), q(le, {
|
|
673
|
+
to: a.value,
|
|
674
|
+
disabled: $.value
|
|
666
675
|
}, [
|
|
667
676
|
j(ne, {
|
|
668
677
|
name: "vf-drawer-transition",
|
|
669
678
|
appear: "",
|
|
670
|
-
duration:
|
|
679
|
+
duration: C
|
|
671
680
|
}, {
|
|
672
|
-
default:
|
|
673
|
-
|
|
681
|
+
default: G(() => [
|
|
682
|
+
p(m) ? (d(), _("div", H({
|
|
674
683
|
key: 0,
|
|
675
|
-
class: [
|
|
676
|
-
style:
|
|
684
|
+
class: [S.value, p(l).class],
|
|
685
|
+
style: I.value
|
|
677
686
|
}, z.value), [
|
|
678
687
|
T("div", {
|
|
679
688
|
class: "vf-drawer__overlay",
|
|
680
689
|
"aria-hidden": "true",
|
|
681
|
-
onClick:
|
|
690
|
+
onClick: A
|
|
682
691
|
}),
|
|
683
692
|
T("section", {
|
|
684
693
|
ref_key: "contentRef",
|
|
685
694
|
ref: r,
|
|
686
|
-
class: P(
|
|
687
|
-
"aria-labelledby":
|
|
695
|
+
class: P(h.value),
|
|
696
|
+
"aria-labelledby": o.value,
|
|
688
697
|
"aria-modal": "true",
|
|
689
698
|
role: "dialog",
|
|
690
699
|
tabindex: "-1"
|
|
691
700
|
}, [
|
|
692
|
-
t.title ||
|
|
701
|
+
t.title || V.$slots.header ? (d(), _("header", mt, [
|
|
693
702
|
T("div", null, [
|
|
694
|
-
B(
|
|
695
|
-
t.title ? (
|
|
703
|
+
B(V.$slots, "header", {}, () => [
|
|
704
|
+
t.title ? (d(), _("h2", {
|
|
696
705
|
key: 0,
|
|
697
|
-
id:
|
|
706
|
+
id: p(y),
|
|
698
707
|
class: "vf-drawer__title"
|
|
699
|
-
},
|
|
708
|
+
}, N(t.title), 9, ht)) : O("", !0)
|
|
700
709
|
])
|
|
701
710
|
]),
|
|
702
|
-
T("div",
|
|
703
|
-
B(
|
|
704
|
-
e.closable ? (
|
|
711
|
+
T("div", yt, [
|
|
712
|
+
B(V.$slots, "actions", { close: E }),
|
|
713
|
+
e.closable ? (d(), q(De, {
|
|
705
714
|
key: 0,
|
|
706
|
-
icon:
|
|
715
|
+
icon: p(U).xmark,
|
|
707
716
|
"aria-label": "Close drawer",
|
|
708
717
|
size: "sm",
|
|
709
|
-
onClick:
|
|
718
|
+
onClick: E
|
|
710
719
|
}, null, 8, ["icon"])) : O("", !0)
|
|
711
720
|
])
|
|
712
721
|
])) : O("", !0),
|
|
713
|
-
|
|
714
|
-
B(
|
|
722
|
+
V.$slots.default ? (d(), _("div", _t, [
|
|
723
|
+
B(V.$slots, "default", { close: E })
|
|
715
724
|
])) : O("", !0),
|
|
716
|
-
|
|
717
|
-
B(
|
|
725
|
+
V.$slots.footer ? (d(), _("footer", gt, [
|
|
726
|
+
B(V.$slots, "footer", { close: E })
|
|
718
727
|
])) : O("", !0)
|
|
719
|
-
], 10,
|
|
728
|
+
], 10, pt)
|
|
720
729
|
], 16)) : O("", !0)
|
|
721
730
|
]),
|
|
722
731
|
_: 3
|
|
723
732
|
})
|
|
724
733
|
], 8, ["to", "disabled"]));
|
|
725
734
|
}
|
|
726
|
-
}),
|
|
735
|
+
}), bt = {
|
|
727
736
|
key: 0,
|
|
728
737
|
class: "vf-dialog"
|
|
729
|
-
},
|
|
738
|
+
}, $t = ["aria-describedby", "aria-labelledby"], kt = {
|
|
730
739
|
key: 0,
|
|
731
740
|
class: "vf-dialog__header"
|
|
732
|
-
},
|
|
741
|
+
}, wt = ["id"], Tt = ["id"], Vt = { class: "vf-dialog__actions" }, Ct = {
|
|
733
742
|
key: 1,
|
|
734
743
|
class: "vf-dialog__body"
|
|
735
744
|
}, xt = {
|
|
736
745
|
key: 2,
|
|
737
746
|
class: "vf-dialog__footer"
|
|
738
|
-
},
|
|
747
|
+
}, In = /* @__PURE__ */ L({
|
|
739
748
|
__name: "VfDialog",
|
|
740
749
|
props: {
|
|
741
750
|
open: { type: Boolean, default: void 0 },
|
|
@@ -751,139 +760,139 @@ const tt = {
|
|
|
751
760
|
},
|
|
752
761
|
emits: ["update:open", "openChange"],
|
|
753
762
|
setup(t, { emit: n }) {
|
|
754
|
-
const e = t, i = n, l =
|
|
763
|
+
const e = t, i = n, l = D(null), r = D(null), u = Te(), v = Q({ prefix: "vf-dialog-title" }), y = Q({ prefix: "vf-dialog-description" }), g = se({
|
|
755
764
|
defaultOpen: e.defaultOpen,
|
|
756
765
|
open: s(() => e.open),
|
|
757
|
-
onOpenChange: (
|
|
758
|
-
i("update:open",
|
|
766
|
+
onOpenChange: (o) => {
|
|
767
|
+
i("update:open", o), i("openChange", o);
|
|
759
768
|
}
|
|
760
|
-
}),
|
|
761
|
-
enter:
|
|
762
|
-
leave:
|
|
763
|
-
},
|
|
769
|
+
}), m = g.isOpen, C = {
|
|
770
|
+
enter: Y.fast,
|
|
771
|
+
leave: Y.fast
|
|
772
|
+
}, x = s(
|
|
764
773
|
() => e.disableTeleport || e.teleportTo === !1 || e.teleportTo === null
|
|
765
|
-
), w = s(() => typeof e.teleportTo == "string" || typeof HTMLElement < "u" && e.teleportTo instanceof HTMLElement ? e.teleportTo : "body"),
|
|
766
|
-
() =>
|
|
774
|
+
), w = s(() => typeof e.teleportTo == "string" || typeof HTMLElement < "u" && e.teleportTo instanceof HTMLElement ? e.teleportTo : "body"), S = s(
|
|
775
|
+
() => F(
|
|
767
776
|
"vf-dialog__content",
|
|
768
777
|
e.size !== "md" && `vf-dialog__content--${e.size}`
|
|
769
778
|
)
|
|
770
|
-
),
|
|
771
|
-
() => e.title ||
|
|
772
|
-
),
|
|
773
|
-
() => e.description || z.value ?
|
|
779
|
+
), I = s(() => !!u.header), z = s(() => !!u.description), $ = s(
|
|
780
|
+
() => e.title || I.value ? v.value : void 0
|
|
781
|
+
), f = s(
|
|
782
|
+
() => e.description || z.value ? y.value : void 0
|
|
774
783
|
);
|
|
775
|
-
function
|
|
776
|
-
|
|
784
|
+
function a() {
|
|
785
|
+
g.close();
|
|
777
786
|
}
|
|
778
|
-
function
|
|
779
|
-
e.closeOnOverlayClick &&
|
|
787
|
+
function h() {
|
|
788
|
+
e.closeOnOverlayClick && a();
|
|
780
789
|
}
|
|
781
|
-
function
|
|
782
|
-
const
|
|
783
|
-
if (!
|
|
790
|
+
function c() {
|
|
791
|
+
const o = l.value;
|
|
792
|
+
if (!o)
|
|
784
793
|
return;
|
|
785
|
-
const
|
|
794
|
+
const E = o.querySelector(
|
|
786
795
|
"[autofocus], [data-autofocus]"
|
|
787
796
|
);
|
|
788
|
-
if (
|
|
789
|
-
|
|
797
|
+
if (E) {
|
|
798
|
+
E.focus();
|
|
790
799
|
return;
|
|
791
800
|
}
|
|
792
|
-
|
|
801
|
+
o.focus();
|
|
793
802
|
}
|
|
794
803
|
return fe(
|
|
795
|
-
(
|
|
796
|
-
!e.closeOnEscape || !
|
|
804
|
+
(o) => {
|
|
805
|
+
!e.closeOnEscape || !m.value || (o.preventDefault(), a());
|
|
797
806
|
},
|
|
798
807
|
{
|
|
799
|
-
enabled:
|
|
808
|
+
enabled: m
|
|
800
809
|
}
|
|
801
|
-
),
|
|
802
|
-
enabled:
|
|
803
|
-
}),
|
|
804
|
-
|
|
805
|
-
async (
|
|
806
|
-
var
|
|
810
|
+
), Ae(l, {
|
|
811
|
+
enabled: m
|
|
812
|
+
}), xe(m), ee(
|
|
813
|
+
m,
|
|
814
|
+
async (o) => {
|
|
815
|
+
var E;
|
|
807
816
|
if (!(typeof document > "u")) {
|
|
808
|
-
if (
|
|
809
|
-
r.value = document.activeElement instanceof HTMLElement ? document.activeElement : null, await
|
|
817
|
+
if (o) {
|
|
818
|
+
r.value = document.activeElement instanceof HTMLElement ? document.activeElement : null, await oe(), c();
|
|
810
819
|
return;
|
|
811
820
|
}
|
|
812
|
-
(
|
|
821
|
+
(E = r.value) == null || E.focus();
|
|
813
822
|
}
|
|
814
823
|
},
|
|
815
824
|
{ immediate: !0 }
|
|
816
|
-
),
|
|
817
|
-
var
|
|
818
|
-
|
|
819
|
-
}), (
|
|
825
|
+
), te(() => {
|
|
826
|
+
var o;
|
|
827
|
+
m.value && ((o = r.value) == null || o.focus());
|
|
828
|
+
}), (o, E) => (d(), q(le, {
|
|
820
829
|
to: w.value,
|
|
821
|
-
disabled:
|
|
830
|
+
disabled: x.value
|
|
822
831
|
}, [
|
|
823
832
|
j(ne, {
|
|
824
833
|
name: "vf-dialog-transition",
|
|
825
834
|
appear: "",
|
|
826
|
-
duration:
|
|
835
|
+
duration: C
|
|
827
836
|
}, {
|
|
828
|
-
default:
|
|
829
|
-
|
|
837
|
+
default: G(() => [
|
|
838
|
+
p(m) ? (d(), _("div", bt, [
|
|
830
839
|
T("div", {
|
|
831
840
|
class: "vf-dialog__overlay",
|
|
832
841
|
"aria-hidden": "true",
|
|
833
|
-
onClick:
|
|
842
|
+
onClick: h
|
|
834
843
|
}),
|
|
835
844
|
T("section", {
|
|
836
845
|
ref_key: "contentRef",
|
|
837
846
|
ref: l,
|
|
838
|
-
class: P(
|
|
839
|
-
"aria-describedby":
|
|
840
|
-
"aria-labelledby":
|
|
847
|
+
class: P(S.value),
|
|
848
|
+
"aria-describedby": f.value,
|
|
849
|
+
"aria-labelledby": $.value,
|
|
841
850
|
"aria-modal": "true",
|
|
842
851
|
role: "dialog",
|
|
843
852
|
tabindex: "-1"
|
|
844
853
|
}, [
|
|
845
|
-
t.title || t.description ||
|
|
854
|
+
t.title || t.description || o.$slots.header || o.$slots.description ? (d(), _("header", kt, [
|
|
846
855
|
T("div", null, [
|
|
847
|
-
B(
|
|
848
|
-
t.title ? (
|
|
856
|
+
B(o.$slots, "header", {}, () => [
|
|
857
|
+
t.title ? (d(), _("h2", {
|
|
849
858
|
key: 0,
|
|
850
|
-
id:
|
|
859
|
+
id: p(v),
|
|
851
860
|
class: "vf-dialog__title"
|
|
852
|
-
},
|
|
861
|
+
}, N(t.title), 9, wt)) : O("", !0)
|
|
853
862
|
]),
|
|
854
|
-
B(
|
|
855
|
-
t.description ? (
|
|
863
|
+
B(o.$slots, "description", {}, () => [
|
|
864
|
+
t.description ? (d(), _("p", {
|
|
856
865
|
key: 0,
|
|
857
|
-
id:
|
|
866
|
+
id: p(y),
|
|
858
867
|
class: "vf-dialog__description"
|
|
859
|
-
},
|
|
868
|
+
}, N(t.description), 9, Tt)) : O("", !0)
|
|
860
869
|
])
|
|
861
870
|
]),
|
|
862
|
-
T("div",
|
|
863
|
-
B(
|
|
864
|
-
e.closable ? (
|
|
871
|
+
T("div", Vt, [
|
|
872
|
+
B(o.$slots, "actions", { close: a }),
|
|
873
|
+
e.closable ? (d(), q(De, {
|
|
865
874
|
key: 0,
|
|
866
|
-
icon:
|
|
875
|
+
icon: p(U).xmark,
|
|
867
876
|
"aria-label": "Close dialog",
|
|
868
877
|
size: "sm",
|
|
869
|
-
onClick:
|
|
878
|
+
onClick: a
|
|
870
879
|
}, null, 8, ["icon"])) : O("", !0)
|
|
871
880
|
])
|
|
872
881
|
])) : O("", !0),
|
|
873
|
-
|
|
874
|
-
B(
|
|
882
|
+
o.$slots.default ? (d(), _("div", Ct, [
|
|
883
|
+
B(o.$slots, "default", { close: a })
|
|
875
884
|
])) : O("", !0),
|
|
876
|
-
|
|
877
|
-
B(
|
|
885
|
+
o.$slots.footer ? (d(), _("footer", xt, [
|
|
886
|
+
B(o.$slots, "footer", { close: a })
|
|
878
887
|
])) : O("", !0)
|
|
879
|
-
], 10,
|
|
888
|
+
], 10, $t)
|
|
880
889
|
])) : O("", !0)
|
|
881
890
|
]),
|
|
882
891
|
_: 3
|
|
883
892
|
})
|
|
884
893
|
], 8, ["to", "disabled"]));
|
|
885
894
|
}
|
|
886
|
-
}),
|
|
895
|
+
}), Bt = ["aria-orientation", "role"], Ln = /* @__PURE__ */ L({
|
|
887
896
|
inheritAttrs: !1,
|
|
888
897
|
__name: "VfDivider",
|
|
889
898
|
props: {
|
|
@@ -891,15 +900,15 @@ const tt = {
|
|
|
891
900
|
},
|
|
892
901
|
setup(t) {
|
|
893
902
|
const n = t, e = R(), i = s(() => n.orientation === "vertical"), l = s(
|
|
894
|
-
() =>
|
|
903
|
+
() => F("vf-divider", `vf-divider--${n.orientation}`)
|
|
895
904
|
);
|
|
896
|
-
return (r, u) => (
|
|
905
|
+
return (r, u) => (d(), _("div", H({
|
|
897
906
|
class: l.value,
|
|
898
907
|
"aria-orientation": n.orientation,
|
|
899
908
|
role: i.value ? "separator" : void 0
|
|
900
|
-
},
|
|
909
|
+
}, p(e)), null, 16, Bt));
|
|
901
910
|
}
|
|
902
|
-
}),
|
|
911
|
+
}), Et = { class: "vf-dropdown" }, Ot = ["id", "aria-controls", "aria-expanded"], At = ["id", "aria-labelledby"], Sn = /* @__PURE__ */ L({
|
|
903
912
|
__name: "VfDropdown",
|
|
904
913
|
props: {
|
|
905
914
|
open: { type: Boolean, default: void 0 },
|
|
@@ -911,96 +920,96 @@ const tt = {
|
|
|
911
920
|
},
|
|
912
921
|
emits: ["update:open", "openChange"],
|
|
913
922
|
setup(t, { emit: n }) {
|
|
914
|
-
const e = t, i = n, l =
|
|
915
|
-
enter:
|
|
916
|
-
leave:
|
|
917
|
-
},
|
|
923
|
+
const e = t, i = n, l = D(null), r = D(null), u = D(null), v = Q({ prefix: "vf-dropdown-menu" }), y = Q({ prefix: "vf-dropdown-trigger" }), g = {
|
|
924
|
+
enter: Y.fast,
|
|
925
|
+
leave: Y.fast
|
|
926
|
+
}, m = s(
|
|
918
927
|
() => e.disableTeleport || e.teleportTo === !1 || e.teleportTo === null
|
|
919
|
-
),
|
|
928
|
+
), C = s(() => typeof e.teleportTo == "string" || typeof HTMLElement < "u" && e.teleportTo instanceof HTMLElement ? e.teleportTo : "body"), x = se({
|
|
920
929
|
defaultOpen: e.defaultOpen,
|
|
921
930
|
open: s(() => e.open),
|
|
922
|
-
onOpenChange: (
|
|
923
|
-
i("update:open",
|
|
931
|
+
onOpenChange: (b) => {
|
|
932
|
+
i("update:open", b), i("openChange", b);
|
|
924
933
|
}
|
|
925
|
-
}), w =
|
|
934
|
+
}), w = x.isOpen, S = s(() => [
|
|
926
935
|
"vf-dropdown__menu",
|
|
927
|
-
|
|
928
|
-
]),
|
|
929
|
-
const
|
|
936
|
+
a.value.startsWith("top") && "vf-dropdown__menu--top"
|
|
937
|
+
]), I = s(() => {
|
|
938
|
+
const b = h.value.arrow;
|
|
930
939
|
return {
|
|
931
|
-
x: (
|
|
932
|
-
y: (
|
|
940
|
+
x: (b == null ? void 0 : b.x) !== void 0 && (b == null ? void 0 : b.baseX) !== void 0 ? b.x - b.baseX : 0,
|
|
941
|
+
y: (b == null ? void 0 : b.y) !== void 0 && (b == null ? void 0 : b.baseY) !== void 0 ? b.y - b.baseY : 0
|
|
933
942
|
};
|
|
934
943
|
}), z = s(() => ({
|
|
935
|
-
left: `${
|
|
936
|
-
top: `${
|
|
937
|
-
})),
|
|
944
|
+
left: `${I.value.x}px`,
|
|
945
|
+
top: `${I.value.y}px`
|
|
946
|
+
})), $ = s(() => [
|
|
938
947
|
"vf-dropdown__arrow",
|
|
939
|
-
|
|
940
|
-
]),
|
|
948
|
+
a.value.startsWith("top") ? "vf-dropdown__arrow--top" : "vf-dropdown__arrow--bottom"
|
|
949
|
+
]), f = s(
|
|
941
950
|
() => e.placement === "bottom-end" ? ["bottom-end", "top-end"] : ["bottom-start", "top-start"]
|
|
942
951
|
), {
|
|
943
|
-
placement:
|
|
944
|
-
middlewareData:
|
|
945
|
-
styles:
|
|
952
|
+
placement: a,
|
|
953
|
+
middlewareData: h,
|
|
954
|
+
styles: c
|
|
946
955
|
} = ye(l, r, {
|
|
947
956
|
enabled: w,
|
|
948
957
|
placement: s(() => e.placement),
|
|
949
958
|
middleware: s(
|
|
950
959
|
() => [
|
|
951
960
|
ve(10),
|
|
952
|
-
pe({ placements:
|
|
961
|
+
pe({ placements: f.value }),
|
|
953
962
|
me(),
|
|
954
963
|
u.value ? he(u.value) : void 0
|
|
955
|
-
].filter((
|
|
964
|
+
].filter((b) => b !== void 0)
|
|
956
965
|
),
|
|
957
966
|
strategy: "fixed"
|
|
958
967
|
});
|
|
959
|
-
function
|
|
960
|
-
var
|
|
968
|
+
function o() {
|
|
969
|
+
var b;
|
|
961
970
|
return Array.from(
|
|
962
|
-
((
|
|
971
|
+
((b = r.value) == null ? void 0 : b.querySelectorAll('[role="menuitem"]')) ?? []
|
|
963
972
|
);
|
|
964
973
|
}
|
|
965
|
-
async function
|
|
966
|
-
var
|
|
967
|
-
await
|
|
974
|
+
async function E() {
|
|
975
|
+
var b;
|
|
976
|
+
await oe(), (b = o()[0]) == null || b.focus();
|
|
968
977
|
}
|
|
969
|
-
function
|
|
970
|
-
|
|
978
|
+
function A(b = {}) {
|
|
979
|
+
x.open(), b.focusFirstItem && E();
|
|
971
980
|
}
|
|
972
981
|
function M() {
|
|
973
|
-
var
|
|
974
|
-
|
|
982
|
+
var b;
|
|
983
|
+
x.close(), (b = l.value) == null || b.focus();
|
|
975
984
|
}
|
|
976
|
-
function
|
|
985
|
+
function V() {
|
|
977
986
|
if (w.value) {
|
|
978
987
|
M();
|
|
979
988
|
return;
|
|
980
989
|
}
|
|
981
|
-
|
|
990
|
+
A();
|
|
982
991
|
}
|
|
983
|
-
function k(
|
|
984
|
-
(
|
|
992
|
+
function k(b) {
|
|
993
|
+
(b.key === "ArrowDown" || b.key === "Enter" || b.key === " ") && (b.preventDefault(), A({ focusFirstItem: !0 }));
|
|
985
994
|
}
|
|
986
|
-
function J(
|
|
995
|
+
function J(b) {
|
|
987
996
|
var ge, be, $e, ke;
|
|
988
|
-
const
|
|
997
|
+
const X = o(), _e = X.findIndex(
|
|
989
998
|
(Ie) => Ie === document.activeElement
|
|
990
999
|
);
|
|
991
|
-
if (
|
|
992
|
-
|
|
1000
|
+
if (b.key === "ArrowDown") {
|
|
1001
|
+
b.preventDefault(), (ge = X[(_e + 1 + X.length) % X.length]) == null || ge.focus();
|
|
993
1002
|
return;
|
|
994
1003
|
}
|
|
995
|
-
if (
|
|
996
|
-
|
|
1004
|
+
if (b.key === "ArrowUp") {
|
|
1005
|
+
b.preventDefault(), (be = X[(_e - 1 + X.length) % X.length]) == null || be.focus();
|
|
997
1006
|
return;
|
|
998
1007
|
}
|
|
999
|
-
if (
|
|
1000
|
-
|
|
1008
|
+
if (b.key === "Home") {
|
|
1009
|
+
b.preventDefault(), ($e = X[0]) == null || $e.focus();
|
|
1001
1010
|
return;
|
|
1002
1011
|
}
|
|
1003
|
-
|
|
1012
|
+
b.key === "End" && (b.preventDefault(), (ke = X[X.length - 1]) == null || ke.focus());
|
|
1004
1013
|
}
|
|
1005
1014
|
function ie() {
|
|
1006
1015
|
e.closeOnSelect && M();
|
|
@@ -1015,48 +1024,48 @@ const tt = {
|
|
|
1015
1024
|
event: "click"
|
|
1016
1025
|
}
|
|
1017
1026
|
), fe(
|
|
1018
|
-
(
|
|
1019
|
-
w.value && (
|
|
1027
|
+
(b) => {
|
|
1028
|
+
w.value && (b.preventDefault(), M());
|
|
1020
1029
|
},
|
|
1021
1030
|
{
|
|
1022
1031
|
enabled: w
|
|
1023
1032
|
}
|
|
1024
|
-
), (
|
|
1033
|
+
), (b, X) => (d(), _("div", Et, [
|
|
1025
1034
|
T("div", {
|
|
1026
|
-
id:
|
|
1035
|
+
id: p(y),
|
|
1027
1036
|
ref_key: "triggerRef",
|
|
1028
1037
|
ref: l,
|
|
1029
1038
|
class: "vf-dropdown__trigger",
|
|
1030
|
-
"aria-controls":
|
|
1031
|
-
"aria-expanded":
|
|
1039
|
+
"aria-controls": p(v),
|
|
1040
|
+
"aria-expanded": p(w),
|
|
1032
1041
|
"aria-haspopup": "menu",
|
|
1033
1042
|
tabindex: "0",
|
|
1034
|
-
onClick:
|
|
1043
|
+
onClick: V,
|
|
1035
1044
|
onKeydown: k
|
|
1036
1045
|
}, [
|
|
1037
|
-
B(
|
|
1038
|
-
open:
|
|
1039
|
-
toggle:
|
|
1046
|
+
B(b.$slots, "trigger", {
|
|
1047
|
+
open: p(w),
|
|
1048
|
+
toggle: V
|
|
1040
1049
|
})
|
|
1041
|
-
], 40,
|
|
1042
|
-
(
|
|
1043
|
-
to:
|
|
1044
|
-
disabled:
|
|
1050
|
+
], 40, Ot),
|
|
1051
|
+
(d(), q(le, {
|
|
1052
|
+
to: C.value,
|
|
1053
|
+
disabled: m.value
|
|
1045
1054
|
}, [
|
|
1046
1055
|
j(ne, {
|
|
1047
1056
|
name: "vf-floating-transition",
|
|
1048
1057
|
appear: "",
|
|
1049
|
-
duration:
|
|
1058
|
+
duration: g
|
|
1050
1059
|
}, {
|
|
1051
|
-
default:
|
|
1052
|
-
|
|
1060
|
+
default: G(() => [
|
|
1061
|
+
p(w) ? (d(), _("div", {
|
|
1053
1062
|
key: 0,
|
|
1054
|
-
id:
|
|
1063
|
+
id: p(v),
|
|
1055
1064
|
ref_key: "menuRef",
|
|
1056
1065
|
ref: r,
|
|
1057
|
-
class: P(
|
|
1058
|
-
style: W(
|
|
1059
|
-
"aria-labelledby":
|
|
1066
|
+
class: P(S.value),
|
|
1067
|
+
style: W(p(c)),
|
|
1068
|
+
"aria-labelledby": p(y),
|
|
1060
1069
|
role: "menu",
|
|
1061
1070
|
onClick: ie,
|
|
1062
1071
|
onKeydown: J
|
|
@@ -1064,22 +1073,22 @@ const tt = {
|
|
|
1064
1073
|
T("span", {
|
|
1065
1074
|
ref_key: "arrowRef",
|
|
1066
1075
|
ref: u,
|
|
1067
|
-
class: P(
|
|
1076
|
+
class: P($.value),
|
|
1068
1077
|
style: W(z.value),
|
|
1069
1078
|
"aria-hidden": "true"
|
|
1070
1079
|
}, null, 6),
|
|
1071
|
-
B(
|
|
1080
|
+
B(b.$slots, "default", {
|
|
1072
1081
|
close: M,
|
|
1073
|
-
open:
|
|
1082
|
+
open: p(w)
|
|
1074
1083
|
})
|
|
1075
|
-
], 46,
|
|
1084
|
+
], 46, At)) : O("", !0)
|
|
1076
1085
|
]),
|
|
1077
1086
|
_: 3
|
|
1078
1087
|
})
|
|
1079
1088
|
], 8, ["to", "disabled"]))
|
|
1080
1089
|
]));
|
|
1081
1090
|
}
|
|
1082
|
-
}), Dt = ["value", "aria-invalid"],
|
|
1091
|
+
}), Dt = ["value", "aria-invalid"], zn = /* @__PURE__ */ L({
|
|
1083
1092
|
inheritAttrs: !1,
|
|
1084
1093
|
__name: "VfInput",
|
|
1085
1094
|
props: {
|
|
@@ -1090,22 +1099,22 @@ const tt = {
|
|
|
1090
1099
|
emits: ["update:modelValue"],
|
|
1091
1100
|
setup(t, { emit: n }) {
|
|
1092
1101
|
const e = t, i = n, l = R(), r = s(
|
|
1093
|
-
() =>
|
|
1102
|
+
() => F(
|
|
1094
1103
|
"vf-input",
|
|
1095
1104
|
e.size !== "md" && `vf-input--${e.size}`,
|
|
1096
1105
|
e.invalid && "vf-input--invalid"
|
|
1097
1106
|
)
|
|
1098
1107
|
);
|
|
1099
|
-
function u(
|
|
1100
|
-
i("update:modelValue",
|
|
1108
|
+
function u(v) {
|
|
1109
|
+
i("update:modelValue", v.target.value);
|
|
1101
1110
|
}
|
|
1102
|
-
return (
|
|
1111
|
+
return (v, y) => (d(), _("input", H({
|
|
1103
1112
|
class: r.value,
|
|
1104
1113
|
value: e.modelValue,
|
|
1105
1114
|
"aria-invalid": e.invalid || void 0
|
|
1106
|
-
},
|
|
1115
|
+
}, p(l), { onInput: u }), null, 16, Dt));
|
|
1107
1116
|
}
|
|
1108
|
-
}),
|
|
1117
|
+
}), Mn = /* @__PURE__ */ L({
|
|
1109
1118
|
inheritAttrs: !1,
|
|
1110
1119
|
__name: "VfLink",
|
|
1111
1120
|
props: {
|
|
@@ -1119,12 +1128,12 @@ const tt = {
|
|
|
1119
1128
|
},
|
|
1120
1129
|
setup(t) {
|
|
1121
1130
|
const n = t, e = R(), i = s(() => n.to !== void 0), l = s(() => i.value ? n.component ?? re("RouterLink") : "a"), r = s(() => n.rel ? n.rel : n.target === "_blank" ? "noopener noreferrer" : void 0), u = s(
|
|
1122
|
-
() =>
|
|
1131
|
+
() => F(
|
|
1123
1132
|
"vf-link",
|
|
1124
1133
|
n.underline && "vf-link--underline",
|
|
1125
1134
|
n.tone === "muted" && "vf-link--muted"
|
|
1126
1135
|
)
|
|
1127
|
-
),
|
|
1136
|
+
), v = s(() => i.value ? {
|
|
1128
1137
|
to: n.to,
|
|
1129
1138
|
target: n.target,
|
|
1130
1139
|
rel: r.value
|
|
@@ -1132,34 +1141,34 @@ const tt = {
|
|
|
1132
1141
|
href: n.href,
|
|
1133
1142
|
target: n.target,
|
|
1134
1143
|
rel: r.value
|
|
1135
|
-
}),
|
|
1144
|
+
}), y = s(() => ({
|
|
1136
1145
|
...e,
|
|
1137
|
-
...
|
|
1146
|
+
...v.value,
|
|
1138
1147
|
class: u.value
|
|
1139
1148
|
}));
|
|
1140
|
-
return (
|
|
1141
|
-
default:
|
|
1142
|
-
B(
|
|
1149
|
+
return (g, m) => (d(), q(re(l.value), Ve(Ce(y.value)), {
|
|
1150
|
+
default: G(() => [
|
|
1151
|
+
B(g.$slots, "default")
|
|
1143
1152
|
]),
|
|
1144
1153
|
_: 3
|
|
1145
1154
|
}, 16));
|
|
1146
1155
|
}
|
|
1147
|
-
}),
|
|
1156
|
+
}), It = { class: "vf-nav-menu__node" }, Lt = { class: "vf-nav-menu__item-content" }, St = { class: "vf-nav-menu__group-label" }, zt = ["aria-expanded", "disabled"], Mt = { class: "vf-nav-menu__item-content" }, Pt = {
|
|
1148
1157
|
key: 0,
|
|
1149
1158
|
class: "vf-nav-menu__leading-icon",
|
|
1150
1159
|
"aria-hidden": "true"
|
|
1151
|
-
},
|
|
1160
|
+
}, Nt = { class: "vf-nav-menu__label" }, Ft = { class: "vf-nav-menu__item-content" }, Rt = {
|
|
1152
1161
|
key: 0,
|
|
1153
1162
|
class: "vf-nav-menu__leading-icon",
|
|
1154
1163
|
"aria-hidden": "true"
|
|
1155
|
-
},
|
|
1164
|
+
}, Ht = { class: "vf-nav-menu__label" }, Kt = ["aria-current", "disabled"], jt = { class: "vf-nav-menu__item-content" }, qt = {
|
|
1156
1165
|
key: 0,
|
|
1157
1166
|
class: "vf-nav-menu__leading-icon",
|
|
1158
1167
|
"aria-hidden": "true"
|
|
1159
|
-
},
|
|
1168
|
+
}, Ut = { class: "vf-nav-menu__label" }, Wt = {
|
|
1160
1169
|
key: 4,
|
|
1161
1170
|
class: "vf-nav-menu__list vf-nav-menu__list--nested"
|
|
1162
|
-
},
|
|
1171
|
+
}, Yt = { class: "vf-nav-menu__list vf-nav-menu__list--nested" }, Xt = /* @__PURE__ */ L({
|
|
1163
1172
|
name: "VfNavMenuItemNode",
|
|
1164
1173
|
__name: "VfNavMenuItemNode",
|
|
1165
1174
|
props: {
|
|
@@ -1172,78 +1181,78 @@ const tt = {
|
|
|
1172
1181
|
emits: ["toggle", "select"],
|
|
1173
1182
|
setup(t, { emit: n }) {
|
|
1174
1183
|
const e = t, i = n, l = s(() => {
|
|
1175
|
-
var
|
|
1176
|
-
return !!((
|
|
1184
|
+
var c;
|
|
1185
|
+
return !!((c = e.item.children) != null && c.length);
|
|
1177
1186
|
}), r = s(() => e.item.kind === "group"), u = s(
|
|
1178
1187
|
() => e.expandedValues.includes(e.item.value)
|
|
1179
|
-
),
|
|
1188
|
+
), v = s(() => e.activeValue === e.item.value), y = s(
|
|
1180
1189
|
() => e.item.href !== void 0 || e.item.to !== void 0
|
|
1181
|
-
),
|
|
1190
|
+
), g = s(() => e.item.to !== void 0 ? re("RouterLink") : "a"), m = s(() => e.item.rel ? e.item.rel : e.item.target === "_blank" ? "noopener noreferrer" : void 0), C = s(() => e.item.to !== void 0 ? {
|
|
1182
1191
|
to: e.item.to,
|
|
1183
1192
|
target: e.item.target,
|
|
1184
|
-
rel:
|
|
1193
|
+
rel: m.value
|
|
1185
1194
|
} : {
|
|
1186
1195
|
href: e.item.href,
|
|
1187
1196
|
target: e.item.target,
|
|
1188
|
-
rel:
|
|
1197
|
+
rel: m.value
|
|
1189
1198
|
});
|
|
1190
|
-
function
|
|
1199
|
+
function x() {
|
|
1191
1200
|
e.item.disabled || i("toggle", {
|
|
1192
1201
|
value: e.item.value,
|
|
1193
1202
|
parentPath: e.parentPath
|
|
1194
1203
|
});
|
|
1195
1204
|
}
|
|
1196
|
-
function w(
|
|
1205
|
+
function w(c) {
|
|
1197
1206
|
if (e.item.disabled) {
|
|
1198
|
-
|
|
1207
|
+
c == null || c.preventDefault();
|
|
1199
1208
|
return;
|
|
1200
1209
|
}
|
|
1201
1210
|
i("select", e.item);
|
|
1202
1211
|
}
|
|
1203
|
-
function
|
|
1204
|
-
const
|
|
1205
|
-
return
|
|
1212
|
+
function S(c) {
|
|
1213
|
+
const o = c;
|
|
1214
|
+
return o.style.transition = "height var(--vf-motion-duration-normal) var(--vf-motion-ease-standard), opacity var(--vf-motion-duration-normal) var(--vf-motion-ease-standard)", o;
|
|
1206
1215
|
}
|
|
1207
|
-
function
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1216
|
+
function I(c) {
|
|
1217
|
+
const o = S(c);
|
|
1218
|
+
o.style.overflow = "hidden", o.style.height = "0", o.style.opacity = "0";
|
|
1210
1219
|
}
|
|
1211
|
-
function z(
|
|
1212
|
-
const
|
|
1220
|
+
function z(c) {
|
|
1221
|
+
const o = S(c);
|
|
1213
1222
|
requestAnimationFrame(() => {
|
|
1214
|
-
|
|
1223
|
+
o.style.height = `${o.scrollHeight}px`, o.style.opacity = "1";
|
|
1215
1224
|
});
|
|
1216
1225
|
}
|
|
1217
|
-
function
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1226
|
+
function $(c) {
|
|
1227
|
+
const o = c;
|
|
1228
|
+
o.style.transition = "", o.style.overflow = "", o.style.height = "", o.style.opacity = "";
|
|
1220
1229
|
}
|
|
1221
|
-
function
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1230
|
+
function f(c) {
|
|
1231
|
+
const o = S(c);
|
|
1232
|
+
o.style.overflow = "hidden", o.style.height = `${o.scrollHeight}px`, o.style.opacity = "1";
|
|
1224
1233
|
}
|
|
1225
|
-
function
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1228
|
-
|
|
1234
|
+
function a(c) {
|
|
1235
|
+
const o = c;
|
|
1236
|
+
o.offsetHeight, requestAnimationFrame(() => {
|
|
1237
|
+
o.style.height = "0", o.style.opacity = "0";
|
|
1229
1238
|
});
|
|
1230
1239
|
}
|
|
1231
|
-
function
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1240
|
+
function h(c) {
|
|
1241
|
+
const o = c;
|
|
1242
|
+
o.style.transition = "", o.style.overflow = "", o.style.height = "", o.style.opacity = "";
|
|
1234
1243
|
}
|
|
1235
|
-
return (
|
|
1236
|
-
const
|
|
1237
|
-
return
|
|
1238
|
-
r.value ? (
|
|
1244
|
+
return (c, o) => {
|
|
1245
|
+
const E = He("VfNavMenuItemNode", !0);
|
|
1246
|
+
return d(), _("li", It, [
|
|
1247
|
+
r.value ? (d(), _("div", {
|
|
1239
1248
|
key: 0,
|
|
1240
1249
|
class: P(["vf-nav-menu__group", `vf-nav-menu__group--level-${t.level}`]),
|
|
1241
1250
|
style: W({ "--vf-nav-menu-level": String(t.level) })
|
|
1242
1251
|
}, [
|
|
1243
|
-
T("span",
|
|
1244
|
-
T("span",
|
|
1252
|
+
T("span", Lt, [
|
|
1253
|
+
T("span", St, N(t.item.label), 1)
|
|
1245
1254
|
])
|
|
1246
|
-
], 6)) : l.value ? (
|
|
1255
|
+
], 6)) : l.value ? (d(), _("button", {
|
|
1247
1256
|
key: 1,
|
|
1248
1257
|
class: P([
|
|
1249
1258
|
"vf-nav-menu__item",
|
|
@@ -1254,109 +1263,109 @@ const tt = {
|
|
|
1254
1263
|
"aria-expanded": u.value,
|
|
1255
1264
|
disabled: t.item.disabled,
|
|
1256
1265
|
type: "button",
|
|
1257
|
-
onClick:
|
|
1266
|
+
onClick: x
|
|
1258
1267
|
}, [
|
|
1259
|
-
T("span",
|
|
1260
|
-
t.item.leadingIcon ? (
|
|
1261
|
-
j(
|
|
1268
|
+
T("span", Mt, [
|
|
1269
|
+
t.item.leadingIcon ? (d(), _("span", Pt, [
|
|
1270
|
+
j(p(Z), {
|
|
1262
1271
|
icon: t.item.leadingIcon,
|
|
1263
1272
|
size: "1rem"
|
|
1264
1273
|
}, null, 8, ["icon"])
|
|
1265
1274
|
])) : O("", !0),
|
|
1266
|
-
T("span",
|
|
1275
|
+
T("span", Nt, N(t.item.label), 1)
|
|
1267
1276
|
]),
|
|
1268
1277
|
T("span", {
|
|
1269
1278
|
class: P(["vf-nav-menu__icon", u.value && "vf-nav-menu__icon--open"]),
|
|
1270
1279
|
"aria-hidden": "true"
|
|
1271
1280
|
}, [
|
|
1272
|
-
j(
|
|
1273
|
-
icon:
|
|
1281
|
+
j(p(Z), {
|
|
1282
|
+
icon: p(U).chevronDown,
|
|
1274
1283
|
size: "0.875rem"
|
|
1275
1284
|
}, null, 8, ["icon"])
|
|
1276
1285
|
], 2)
|
|
1277
|
-
], 14,
|
|
1286
|
+
], 14, zt)) : y.value ? (d(), q(re(g.value), H({ key: 2 }, C.value, {
|
|
1278
1287
|
class: [
|
|
1279
1288
|
"vf-nav-menu__item",
|
|
1280
|
-
|
|
1289
|
+
v.value && "vf-nav-menu__item--active",
|
|
1281
1290
|
t.item.disabled && "vf-nav-menu__item--disabled"
|
|
1282
1291
|
],
|
|
1283
1292
|
style: { "--vf-nav-menu-level": String(t.level) },
|
|
1284
|
-
"aria-current":
|
|
1293
|
+
"aria-current": v.value ? "page" : void 0,
|
|
1285
1294
|
onClick: w
|
|
1286
1295
|
}), {
|
|
1287
|
-
default:
|
|
1288
|
-
T("span",
|
|
1289
|
-
t.item.leadingIcon ? (
|
|
1290
|
-
j(
|
|
1296
|
+
default: G(() => [
|
|
1297
|
+
T("span", Ft, [
|
|
1298
|
+
t.item.leadingIcon ? (d(), _("span", Rt, [
|
|
1299
|
+
j(p(Z), {
|
|
1291
1300
|
icon: t.item.leadingIcon,
|
|
1292
1301
|
size: "1rem"
|
|
1293
1302
|
}, null, 8, ["icon"])
|
|
1294
1303
|
])) : O("", !0),
|
|
1295
|
-
T("span",
|
|
1304
|
+
T("span", Ht, N(t.item.label), 1)
|
|
1296
1305
|
])
|
|
1297
1306
|
]),
|
|
1298
1307
|
_: 1
|
|
1299
|
-
}, 16, ["class", "style", "aria-current"])) : (
|
|
1308
|
+
}, 16, ["class", "style", "aria-current"])) : (d(), _("button", {
|
|
1300
1309
|
key: 3,
|
|
1301
1310
|
class: P([
|
|
1302
1311
|
"vf-nav-menu__item",
|
|
1303
|
-
|
|
1312
|
+
v.value && "vf-nav-menu__item--active",
|
|
1304
1313
|
t.item.disabled && "vf-nav-menu__item--disabled"
|
|
1305
1314
|
]),
|
|
1306
1315
|
style: W({ "--vf-nav-menu-level": String(t.level) }),
|
|
1307
|
-
"aria-current":
|
|
1316
|
+
"aria-current": v.value ? "page" : void 0,
|
|
1308
1317
|
disabled: t.item.disabled,
|
|
1309
1318
|
type: "button",
|
|
1310
|
-
onClick:
|
|
1319
|
+
onClick: o[0] || (o[0] = (A) => w())
|
|
1311
1320
|
}, [
|
|
1312
|
-
T("span",
|
|
1313
|
-
t.item.leadingIcon ? (
|
|
1314
|
-
j(
|
|
1321
|
+
T("span", jt, [
|
|
1322
|
+
t.item.leadingIcon ? (d(), _("span", qt, [
|
|
1323
|
+
j(p(Z), {
|
|
1315
1324
|
icon: t.item.leadingIcon,
|
|
1316
1325
|
size: "1rem"
|
|
1317
1326
|
}, null, 8, ["icon"])
|
|
1318
1327
|
])) : O("", !0),
|
|
1319
|
-
T("span",
|
|
1328
|
+
T("span", Ut, N(t.item.label), 1)
|
|
1320
1329
|
])
|
|
1321
|
-
], 14,
|
|
1322
|
-
l.value && r.value ? (
|
|
1323
|
-
(
|
|
1324
|
-
key:
|
|
1325
|
-
item:
|
|
1330
|
+
], 14, Kt)),
|
|
1331
|
+
l.value && r.value ? (d(), _("ul", Wt, [
|
|
1332
|
+
(d(!0), _(ue, null, de(t.item.children, (A) => (d(), q(E, {
|
|
1333
|
+
key: A.value,
|
|
1334
|
+
item: A,
|
|
1326
1335
|
level: t.level + 1,
|
|
1327
1336
|
"parent-path": [...t.parentPath, t.item.value],
|
|
1328
1337
|
"active-value": t.activeValue,
|
|
1329
1338
|
"expanded-values": t.expandedValues,
|
|
1330
|
-
onToggle:
|
|
1331
|
-
onSelect:
|
|
1339
|
+
onToggle: o[1] || (o[1] = (M) => i("toggle", M)),
|
|
1340
|
+
onSelect: o[2] || (o[2] = (M) => i("select", M))
|
|
1332
1341
|
}, null, 8, ["item", "level", "parent-path", "active-value", "expanded-values"]))), 128))
|
|
1333
|
-
])) : l.value ? (
|
|
1342
|
+
])) : l.value ? (d(), q(ne, {
|
|
1334
1343
|
key: 5,
|
|
1335
|
-
onBeforeEnter:
|
|
1344
|
+
onBeforeEnter: I,
|
|
1336
1345
|
onEnter: z,
|
|
1337
|
-
onAfterEnter:
|
|
1338
|
-
onBeforeLeave:
|
|
1339
|
-
onLeave:
|
|
1340
|
-
onAfterLeave:
|
|
1346
|
+
onAfterEnter: $,
|
|
1347
|
+
onBeforeLeave: f,
|
|
1348
|
+
onLeave: a,
|
|
1349
|
+
onAfterLeave: h
|
|
1341
1350
|
}, {
|
|
1342
|
-
default:
|
|
1343
|
-
u.value ? (
|
|
1351
|
+
default: G(() => [
|
|
1352
|
+
u.value ? (d(), _("div", {
|
|
1344
1353
|
key: 0,
|
|
1345
1354
|
class: P([
|
|
1346
1355
|
"vf-nav-menu__collapse",
|
|
1347
1356
|
`vf-nav-menu__collapse--level-${t.level}`
|
|
1348
1357
|
])
|
|
1349
1358
|
}, [
|
|
1350
|
-
T("ul",
|
|
1351
|
-
(
|
|
1352
|
-
key:
|
|
1353
|
-
item:
|
|
1359
|
+
T("ul", Yt, [
|
|
1360
|
+
(d(!0), _(ue, null, de(t.item.children, (A) => (d(), q(E, {
|
|
1361
|
+
key: A.value,
|
|
1362
|
+
item: A,
|
|
1354
1363
|
level: t.level + 1,
|
|
1355
1364
|
"parent-path": [...t.parentPath, t.item.value],
|
|
1356
1365
|
"active-value": t.activeValue,
|
|
1357
1366
|
"expanded-values": t.expandedValues,
|
|
1358
|
-
onToggle:
|
|
1359
|
-
onSelect:
|
|
1367
|
+
onToggle: o[3] || (o[3] = (M) => i("toggle", M)),
|
|
1368
|
+
onSelect: o[4] || (o[4] = (M) => i("select", M))
|
|
1360
1369
|
}, null, 8, ["item", "level", "parent-path", "active-value", "expanded-values"]))), 128))
|
|
1361
1370
|
])
|
|
1362
1371
|
], 2)) : O("", !0)
|
|
@@ -1366,7 +1375,7 @@ const tt = {
|
|
|
1366
1375
|
]);
|
|
1367
1376
|
};
|
|
1368
1377
|
}
|
|
1369
|
-
}),
|
|
1378
|
+
}), Gt = ["aria-label"], Qt = { class: "vf-nav-menu__list" }, Pn = /* @__PURE__ */ L({
|
|
1370
1379
|
__name: "VfNavMenu",
|
|
1371
1380
|
props: {
|
|
1372
1381
|
items: {},
|
|
@@ -1377,114 +1386,114 @@ const tt = {
|
|
|
1377
1386
|
},
|
|
1378
1387
|
emits: ["update:modelValue", "change", "select"],
|
|
1379
1388
|
setup(t, { emit: n }) {
|
|
1380
|
-
const e = t, i = n, l =
|
|
1381
|
-
function
|
|
1382
|
-
return
|
|
1383
|
-
(
|
|
1384
|
-
var
|
|
1385
|
-
return
|
|
1389
|
+
const e = t, i = n, l = D(e.defaultValue), r = s(() => e.modelValue ?? l.value), u = D([]);
|
|
1390
|
+
function v(a, h) {
|
|
1391
|
+
return a.some(
|
|
1392
|
+
(c) => {
|
|
1393
|
+
var o;
|
|
1394
|
+
return h(c) || ((o = c.children) != null && o.length ? v(c.children, h) : !1);
|
|
1386
1395
|
}
|
|
1387
1396
|
);
|
|
1388
1397
|
}
|
|
1389
|
-
const
|
|
1390
|
-
() =>
|
|
1391
|
-
),
|
|
1392
|
-
() =>
|
|
1393
|
-
),
|
|
1394
|
-
function
|
|
1395
|
-
var
|
|
1396
|
-
return
|
|
1398
|
+
const y = s(
|
|
1399
|
+
() => v(e.items, (a) => a.kind === "group")
|
|
1400
|
+
), g = s(
|
|
1401
|
+
() => v(e.items, (a) => !!a.leadingIcon)
|
|
1402
|
+
), m = s(() => !y.value && !g.value);
|
|
1403
|
+
function C(a) {
|
|
1404
|
+
var h;
|
|
1405
|
+
return a.kind !== "group" && !!((h = a.children) != null && h.length);
|
|
1397
1406
|
}
|
|
1398
|
-
function
|
|
1399
|
-
var
|
|
1400
|
-
if (!
|
|
1407
|
+
function x(a, h, c = []) {
|
|
1408
|
+
var o;
|
|
1409
|
+
if (!h)
|
|
1401
1410
|
return [];
|
|
1402
|
-
for (const
|
|
1403
|
-
if (
|
|
1404
|
-
return
|
|
1405
|
-
if ((
|
|
1406
|
-
const
|
|
1407
|
-
...
|
|
1408
|
-
|
|
1411
|
+
for (const E of a) {
|
|
1412
|
+
if (E.value === h)
|
|
1413
|
+
return c;
|
|
1414
|
+
if ((o = E.children) != null && o.length) {
|
|
1415
|
+
const A = x(E.children, h, [
|
|
1416
|
+
...c,
|
|
1417
|
+
E.value
|
|
1409
1418
|
]);
|
|
1410
|
-
if (
|
|
1411
|
-
return
|
|
1419
|
+
if (A.length)
|
|
1420
|
+
return A;
|
|
1412
1421
|
}
|
|
1413
1422
|
}
|
|
1414
1423
|
return [];
|
|
1415
1424
|
}
|
|
1416
1425
|
function w() {
|
|
1417
|
-
const
|
|
1426
|
+
const a = x(e.items, r.value);
|
|
1418
1427
|
u.value = Array.from(
|
|
1419
|
-
/* @__PURE__ */ new Set([...u.value, ...
|
|
1428
|
+
/* @__PURE__ */ new Set([...u.value, ...a])
|
|
1420
1429
|
);
|
|
1421
1430
|
}
|
|
1422
|
-
function
|
|
1423
|
-
var
|
|
1424
|
-
if (!
|
|
1425
|
-
return
|
|
1426
|
-
const [
|
|
1427
|
-
return (
|
|
1428
|
-
}
|
|
1429
|
-
function
|
|
1430
|
-
return
|
|
1431
|
-
var
|
|
1432
|
-
const
|
|
1433
|
-
return
|
|
1431
|
+
function S(a, h) {
|
|
1432
|
+
var A;
|
|
1433
|
+
if (!h.length)
|
|
1434
|
+
return a;
|
|
1435
|
+
const [c, ...o] = h, E = a.find((M) => M.value === c);
|
|
1436
|
+
return (A = E == null ? void 0 : E.children) != null && A.length ? S(E.children, o) : [];
|
|
1437
|
+
}
|
|
1438
|
+
function I(a) {
|
|
1439
|
+
return a.flatMap((h) => {
|
|
1440
|
+
var o;
|
|
1441
|
+
const c = (o = h.children) != null && o.length ? I(h.children) : [];
|
|
1442
|
+
return C(h) ? [h.value, ...c] : c;
|
|
1434
1443
|
});
|
|
1435
1444
|
}
|
|
1436
|
-
function z(
|
|
1437
|
-
e.modelValue === void 0 && (l.value =
|
|
1445
|
+
function z(a) {
|
|
1446
|
+
e.modelValue === void 0 && (l.value = a), i("update:modelValue", a), i("change", a);
|
|
1438
1447
|
}
|
|
1439
|
-
function
|
|
1440
|
-
z(
|
|
1448
|
+
function $(a) {
|
|
1449
|
+
z(a.value), u.value = Array.from(
|
|
1441
1450
|
/* @__PURE__ */ new Set([
|
|
1442
1451
|
...u.value,
|
|
1443
|
-
...
|
|
1452
|
+
...x(e.items, a.value)
|
|
1444
1453
|
])
|
|
1445
|
-
), i("select",
|
|
1454
|
+
), i("select", a);
|
|
1446
1455
|
}
|
|
1447
|
-
function
|
|
1448
|
-
const { value:
|
|
1449
|
-
if (u.value.includes(
|
|
1456
|
+
function f(a) {
|
|
1457
|
+
const { value: h, parentPath: c } = a;
|
|
1458
|
+
if (u.value.includes(h)) {
|
|
1450
1459
|
u.value = u.value.filter(
|
|
1451
|
-
(
|
|
1460
|
+
(o) => o !== h
|
|
1452
1461
|
);
|
|
1453
1462
|
return;
|
|
1454
1463
|
}
|
|
1455
1464
|
if (e.expandMode === "single") {
|
|
1456
|
-
const
|
|
1465
|
+
const E = S(e.items, c).filter((A) => A.value !== h && C(A)).flatMap((A) => I([A]));
|
|
1457
1466
|
u.value = u.value.filter(
|
|
1458
|
-
(
|
|
1467
|
+
(A) => !E.includes(A)
|
|
1459
1468
|
);
|
|
1460
1469
|
}
|
|
1461
|
-
u.value = [...u.value,
|
|
1470
|
+
u.value = [...u.value, h];
|
|
1462
1471
|
}
|
|
1463
|
-
return
|
|
1472
|
+
return ee(
|
|
1464
1473
|
() => [e.items, r.value],
|
|
1465
1474
|
() => {
|
|
1466
1475
|
w();
|
|
1467
1476
|
},
|
|
1468
1477
|
{ immediate: !0, deep: !0 }
|
|
1469
|
-
), (
|
|
1470
|
-
class: P(["vf-nav-menu",
|
|
1478
|
+
), (a, h) => (d(), _("nav", {
|
|
1479
|
+
class: P(["vf-nav-menu", m.value && "vf-nav-menu--simple"]),
|
|
1471
1480
|
"aria-label": t.ariaLabel
|
|
1472
1481
|
}, [
|
|
1473
|
-
T("ul",
|
|
1474
|
-
(
|
|
1475
|
-
key:
|
|
1476
|
-
item:
|
|
1482
|
+
T("ul", Qt, [
|
|
1483
|
+
(d(!0), _(ue, null, de(t.items, (c) => (d(), q(Xt, {
|
|
1484
|
+
key: c.value,
|
|
1485
|
+
item: c,
|
|
1477
1486
|
level: 0,
|
|
1478
1487
|
"parent-path": [],
|
|
1479
1488
|
"active-value": r.value,
|
|
1480
1489
|
"expanded-values": u.value,
|
|
1481
|
-
onToggle:
|
|
1482
|
-
onSelect:
|
|
1490
|
+
onToggle: f,
|
|
1491
|
+
onSelect: $
|
|
1483
1492
|
}, null, 8, ["item", "active-value", "expanded-values"]))), 128))
|
|
1484
1493
|
])
|
|
1485
|
-
], 10,
|
|
1494
|
+
], 10, Gt));
|
|
1486
1495
|
}
|
|
1487
|
-
}),
|
|
1496
|
+
}), Jt = { key: 0 }, Zt = { class: "vf-panel__title" }, Nn = /* @__PURE__ */ L({
|
|
1488
1497
|
inheritAttrs: !1,
|
|
1489
1498
|
__name: "VfPanel",
|
|
1490
1499
|
props: {
|
|
@@ -1493,18 +1502,18 @@ const tt = {
|
|
|
1493
1502
|
},
|
|
1494
1503
|
setup(t) {
|
|
1495
1504
|
const n = t, e = R(), i = s(
|
|
1496
|
-
() =>
|
|
1505
|
+
() => F("vf-panel", n.subtle && "vf-panel--subtle")
|
|
1497
1506
|
);
|
|
1498
|
-
return (l, r) => (
|
|
1499
|
-
n.title || l.$slots.header ? (
|
|
1507
|
+
return (l, r) => (d(), _("section", H({ class: i.value }, p(e)), [
|
|
1508
|
+
n.title || l.$slots.header ? (d(), _("header", Jt, [
|
|
1500
1509
|
B(l.$slots, "header", {}, () => [
|
|
1501
|
-
T("h3",
|
|
1510
|
+
T("h3", Zt, N(n.title), 1)
|
|
1502
1511
|
])
|
|
1503
1512
|
])) : O("", !0),
|
|
1504
1513
|
B(l.$slots, "default")
|
|
1505
1514
|
], 16));
|
|
1506
1515
|
}
|
|
1507
|
-
}),
|
|
1516
|
+
}), en = { class: "vf-popover" }, tn = ["id", "aria-controls", "aria-expanded"], nn = ["id", "aria-labelledby"], Fn = /* @__PURE__ */ L({
|
|
1508
1517
|
__name: "VfPopover",
|
|
1509
1518
|
props: {
|
|
1510
1519
|
open: { type: Boolean, default: void 0 },
|
|
@@ -1517,54 +1526,54 @@ const tt = {
|
|
|
1517
1526
|
},
|
|
1518
1527
|
emits: ["update:open", "openChange"],
|
|
1519
1528
|
setup(t, { emit: n }) {
|
|
1520
|
-
const e = t, i = n, l =
|
|
1521
|
-
enter:
|
|
1522
|
-
leave:
|
|
1523
|
-
},
|
|
1529
|
+
const e = t, i = n, l = D(null), r = D(null), u = D(null), v = Q({ prefix: "vf-popover-content" }), y = Q({ prefix: "vf-popover-trigger" }), g = {
|
|
1530
|
+
enter: Y.fast,
|
|
1531
|
+
leave: Y.fast
|
|
1532
|
+
}, m = s(
|
|
1524
1533
|
() => e.disableTeleport || e.teleportTo === !1 || e.teleportTo === null
|
|
1525
|
-
),
|
|
1534
|
+
), C = s(() => typeof e.teleportTo == "string" || typeof HTMLElement < "u" && e.teleportTo instanceof HTMLElement ? e.teleportTo : "body"), x = se({
|
|
1526
1535
|
defaultOpen: e.defaultOpen,
|
|
1527
1536
|
open: s(() => e.open),
|
|
1528
1537
|
onOpenChange: (k) => {
|
|
1529
1538
|
i("update:open", k), i("openChange", k);
|
|
1530
1539
|
}
|
|
1531
|
-
}), w =
|
|
1540
|
+
}), w = x.isOpen, S = s(
|
|
1532
1541
|
() => e.placement === "bottom-end" ? ["bottom-end", "top-end"] : ["bottom-start", "top-start"]
|
|
1533
1542
|
), {
|
|
1534
|
-
placement:
|
|
1543
|
+
placement: I,
|
|
1535
1544
|
middlewareData: z,
|
|
1536
|
-
styles:
|
|
1545
|
+
styles: $
|
|
1537
1546
|
} = ye(l, r, {
|
|
1538
1547
|
enabled: w,
|
|
1539
1548
|
placement: s(() => e.placement),
|
|
1540
1549
|
middleware: s(
|
|
1541
1550
|
() => [
|
|
1542
1551
|
ve(10),
|
|
1543
|
-
pe({ placements:
|
|
1552
|
+
pe({ placements: S.value }),
|
|
1544
1553
|
me(),
|
|
1545
1554
|
u.value ? he(u.value) : void 0
|
|
1546
1555
|
].filter((k) => k !== void 0)
|
|
1547
1556
|
),
|
|
1548
1557
|
strategy: "fixed"
|
|
1549
|
-
}),
|
|
1558
|
+
}), f = s(() => [
|
|
1550
1559
|
"vf-popover__content",
|
|
1551
|
-
|
|
1552
|
-
]),
|
|
1560
|
+
I.value.startsWith("top") && "vf-popover__content--top"
|
|
1561
|
+
]), a = s(() => {
|
|
1553
1562
|
const k = z.value.arrow;
|
|
1554
1563
|
return {
|
|
1555
1564
|
x: (k == null ? void 0 : k.x) !== void 0 && (k == null ? void 0 : k.baseX) !== void 0 ? k.x - k.baseX : 0,
|
|
1556
1565
|
y: (k == null ? void 0 : k.y) !== void 0 && (k == null ? void 0 : k.baseY) !== void 0 ? k.y - k.baseY : 0
|
|
1557
1566
|
};
|
|
1558
|
-
}),
|
|
1559
|
-
left: `${
|
|
1560
|
-
top: `${
|
|
1561
|
-
})),
|
|
1567
|
+
}), h = s(() => ({
|
|
1568
|
+
left: `${a.value.x}px`,
|
|
1569
|
+
top: `${a.value.y}px`
|
|
1570
|
+
})), c = s(() => [
|
|
1562
1571
|
"vf-popover__arrow",
|
|
1563
|
-
|
|
1572
|
+
I.value.startsWith("top") ? "vf-popover__arrow--top" : "vf-popover__arrow--bottom"
|
|
1564
1573
|
]);
|
|
1565
|
-
async function
|
|
1574
|
+
async function o() {
|
|
1566
1575
|
var J, ie;
|
|
1567
|
-
await
|
|
1576
|
+
await oe();
|
|
1568
1577
|
const k = (J = r.value) == null ? void 0 : J.querySelector(
|
|
1569
1578
|
"[autofocus], [data-autofocus]"
|
|
1570
1579
|
);
|
|
@@ -1574,27 +1583,27 @@ const tt = {
|
|
|
1574
1583
|
}
|
|
1575
1584
|
(ie = r.value) == null || ie.focus();
|
|
1576
1585
|
}
|
|
1577
|
-
function
|
|
1578
|
-
|
|
1586
|
+
function E() {
|
|
1587
|
+
x.open(), o();
|
|
1579
1588
|
}
|
|
1580
|
-
function
|
|
1589
|
+
function A() {
|
|
1581
1590
|
var k;
|
|
1582
|
-
|
|
1591
|
+
x.close(), (k = l.value) == null || k.focus();
|
|
1583
1592
|
}
|
|
1584
1593
|
function M() {
|
|
1585
1594
|
if (w.value) {
|
|
1586
|
-
|
|
1595
|
+
A();
|
|
1587
1596
|
return;
|
|
1588
1597
|
}
|
|
1589
|
-
|
|
1598
|
+
E();
|
|
1590
1599
|
}
|
|
1591
|
-
function
|
|
1592
|
-
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), M()), k.key === "ArrowDown" && (k.preventDefault(),
|
|
1600
|
+
function V(k) {
|
|
1601
|
+
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), M()), k.key === "ArrowDown" && (k.preventDefault(), E());
|
|
1593
1602
|
}
|
|
1594
1603
|
return Oe(
|
|
1595
1604
|
[l, r],
|
|
1596
1605
|
() => {
|
|
1597
|
-
w.value && e.closeOnOutsideClick &&
|
|
1606
|
+
w.value && e.closeOnOutsideClick && A();
|
|
1598
1607
|
},
|
|
1599
1608
|
{
|
|
1600
1609
|
enabled: w,
|
|
@@ -1602,72 +1611,72 @@ const tt = {
|
|
|
1602
1611
|
}
|
|
1603
1612
|
), fe(
|
|
1604
1613
|
(k) => {
|
|
1605
|
-
!w.value || !e.closeOnEscape || (k.preventDefault(),
|
|
1614
|
+
!w.value || !e.closeOnEscape || (k.preventDefault(), A());
|
|
1606
1615
|
},
|
|
1607
1616
|
{
|
|
1608
1617
|
enabled: w
|
|
1609
1618
|
}
|
|
1610
|
-
), (k, J) => (
|
|
1619
|
+
), (k, J) => (d(), _("div", en, [
|
|
1611
1620
|
T("div", {
|
|
1612
|
-
id:
|
|
1621
|
+
id: p(y),
|
|
1613
1622
|
ref_key: "triggerRef",
|
|
1614
1623
|
ref: l,
|
|
1615
1624
|
class: "vf-popover__trigger",
|
|
1616
|
-
"aria-controls":
|
|
1617
|
-
"aria-expanded":
|
|
1625
|
+
"aria-controls": p(v),
|
|
1626
|
+
"aria-expanded": p(w),
|
|
1618
1627
|
"aria-haspopup": "dialog",
|
|
1619
1628
|
tabindex: "0",
|
|
1620
1629
|
onClick: M,
|
|
1621
|
-
onKeydown:
|
|
1630
|
+
onKeydown: V
|
|
1622
1631
|
}, [
|
|
1623
1632
|
B(k.$slots, "trigger", {
|
|
1624
|
-
open:
|
|
1633
|
+
open: p(w),
|
|
1625
1634
|
toggle: M
|
|
1626
1635
|
})
|
|
1627
|
-
], 40,
|
|
1628
|
-
(
|
|
1629
|
-
to:
|
|
1630
|
-
disabled:
|
|
1636
|
+
], 40, tn),
|
|
1637
|
+
(d(), q(le, {
|
|
1638
|
+
to: C.value,
|
|
1639
|
+
disabled: m.value
|
|
1631
1640
|
}, [
|
|
1632
1641
|
j(ne, {
|
|
1633
1642
|
name: "vf-floating-transition",
|
|
1634
1643
|
appear: "",
|
|
1635
|
-
duration:
|
|
1644
|
+
duration: g
|
|
1636
1645
|
}, {
|
|
1637
|
-
default:
|
|
1638
|
-
|
|
1646
|
+
default: G(() => [
|
|
1647
|
+
p(w) ? (d(), _("section", {
|
|
1639
1648
|
key: 0,
|
|
1640
|
-
id:
|
|
1649
|
+
id: p(v),
|
|
1641
1650
|
ref_key: "contentRef",
|
|
1642
1651
|
ref: r,
|
|
1643
|
-
class: P(
|
|
1644
|
-
style: W(
|
|
1645
|
-
"aria-labelledby":
|
|
1652
|
+
class: P(f.value),
|
|
1653
|
+
style: W(p($)),
|
|
1654
|
+
"aria-labelledby": p(y),
|
|
1646
1655
|
role: "dialog",
|
|
1647
1656
|
tabindex: "-1"
|
|
1648
1657
|
}, [
|
|
1649
1658
|
T("span", {
|
|
1650
1659
|
ref_key: "arrowRef",
|
|
1651
1660
|
ref: u,
|
|
1652
|
-
class: P(
|
|
1653
|
-
style: W(
|
|
1661
|
+
class: P(c.value),
|
|
1662
|
+
style: W(h.value),
|
|
1654
1663
|
"aria-hidden": "true"
|
|
1655
1664
|
}, null, 6),
|
|
1656
1665
|
B(k.$slots, "default", {
|
|
1657
|
-
open:
|
|
1658
|
-
close:
|
|
1666
|
+
open: p(w),
|
|
1667
|
+
close: A
|
|
1659
1668
|
})
|
|
1660
|
-
], 14,
|
|
1669
|
+
], 14, nn)) : O("", !0)
|
|
1661
1670
|
]),
|
|
1662
1671
|
_: 3
|
|
1663
1672
|
})
|
|
1664
1673
|
], 8, ["to", "disabled"]))
|
|
1665
1674
|
]));
|
|
1666
1675
|
}
|
|
1667
|
-
}),
|
|
1676
|
+
}), an = ["checked", "disabled", "value", "aria-invalid"], on = {
|
|
1668
1677
|
key: 0,
|
|
1669
1678
|
class: "vf-radio__content"
|
|
1670
|
-
},
|
|
1679
|
+
}, Rn = /* @__PURE__ */ L({
|
|
1671
1680
|
inheritAttrs: !1,
|
|
1672
1681
|
__name: "VfRadio",
|
|
1673
1682
|
props: {
|
|
@@ -1681,7 +1690,7 @@ const tt = {
|
|
|
1681
1690
|
emits: ["update:modelValue", "change"],
|
|
1682
1691
|
setup(t, { emit: n }) {
|
|
1683
1692
|
const e = t, i = n, l = R(), r = s(() => e.modelValue === e.value), u = s(
|
|
1684
|
-
() =>
|
|
1693
|
+
() => F(
|
|
1685
1694
|
"vf-radio",
|
|
1686
1695
|
`vf-radio--${e.size}`,
|
|
1687
1696
|
r.value && "vf-radio--checked",
|
|
@@ -1689,17 +1698,17 @@ const tt = {
|
|
|
1689
1698
|
e.disabled && "vf-radio--disabled",
|
|
1690
1699
|
l.class
|
|
1691
1700
|
)
|
|
1692
|
-
),
|
|
1701
|
+
), v = s(() => l.style), y = s(
|
|
1693
1702
|
() => Object.fromEntries(
|
|
1694
|
-
Object.entries(l).filter(([
|
|
1703
|
+
Object.entries(l).filter(([m]) => m !== "class" && m !== "style")
|
|
1695
1704
|
)
|
|
1696
1705
|
);
|
|
1697
|
-
function
|
|
1698
|
-
|
|
1706
|
+
function g(m) {
|
|
1707
|
+
m.target.checked && (i("update:modelValue", e.value), i("change", e.value));
|
|
1699
1708
|
}
|
|
1700
|
-
return (
|
|
1709
|
+
return (m, C) => (d(), _("label", {
|
|
1701
1710
|
class: P(u.value),
|
|
1702
|
-
style: W(
|
|
1711
|
+
style: W(v.value)
|
|
1703
1712
|
}, [
|
|
1704
1713
|
T("input", H({
|
|
1705
1714
|
class: "vf-radio__input",
|
|
@@ -1708,24 +1717,27 @@ const tt = {
|
|
|
1708
1717
|
disabled: e.disabled,
|
|
1709
1718
|
value: e.value,
|
|
1710
1719
|
"aria-invalid": e.invalid || void 0
|
|
1711
|
-
},
|
|
1712
|
-
|
|
1720
|
+
}, y.value, { onChange: g }), null, 16, an),
|
|
1721
|
+
C[0] || (C[0] = T("span", {
|
|
1713
1722
|
class: "vf-radio__control",
|
|
1714
1723
|
"aria-hidden": "true"
|
|
1715
1724
|
}, [
|
|
1716
1725
|
T("span", { class: "vf-radio__dot" })
|
|
1717
1726
|
], -1)),
|
|
1718
|
-
t.label ||
|
|
1719
|
-
B(
|
|
1720
|
-
|
|
1727
|
+
t.label || m.$slots.default ? (d(), _("span", on, [
|
|
1728
|
+
B(m.$slots, "default", {}, () => [
|
|
1729
|
+
ae(N(t.label), 1)
|
|
1721
1730
|
])
|
|
1722
1731
|
])) : O("", !0)
|
|
1723
1732
|
], 6));
|
|
1724
1733
|
}
|
|
1725
|
-
}),
|
|
1734
|
+
}), ln = ["checked", "disabled"], sn = {
|
|
1735
|
+
class: "vf-switch__control",
|
|
1736
|
+
"aria-hidden": "true"
|
|
1737
|
+
}, rn = { class: "vf-switch__thumb" }, un = {
|
|
1726
1738
|
key: 0,
|
|
1727
1739
|
class: "vf-switch__content"
|
|
1728
|
-
},
|
|
1740
|
+
}, dn = /* @__PURE__ */ L({
|
|
1729
1741
|
inheritAttrs: !1,
|
|
1730
1742
|
__name: "VfSwitch",
|
|
1731
1743
|
props: {
|
|
@@ -1737,23 +1749,23 @@ const tt = {
|
|
|
1737
1749
|
emits: ["update:modelValue", "change"],
|
|
1738
1750
|
setup(t, { emit: n }) {
|
|
1739
1751
|
const e = t, i = n, l = R(), r = s(
|
|
1740
|
-
() =>
|
|
1752
|
+
() => F(
|
|
1741
1753
|
"vf-switch",
|
|
1742
1754
|
`vf-switch--${e.size}`,
|
|
1743
1755
|
e.modelValue && "vf-switch--checked",
|
|
1744
1756
|
e.disabled && "vf-switch--disabled",
|
|
1745
1757
|
l.class
|
|
1746
1758
|
)
|
|
1747
|
-
), u = s(() => l.style),
|
|
1759
|
+
), u = s(() => l.style), v = s(
|
|
1748
1760
|
() => Object.fromEntries(
|
|
1749
|
-
Object.entries(l).filter(([
|
|
1761
|
+
Object.entries(l).filter(([g]) => g !== "class" && g !== "style")
|
|
1750
1762
|
)
|
|
1751
1763
|
);
|
|
1752
|
-
function g
|
|
1753
|
-
const
|
|
1754
|
-
i("update:modelValue",
|
|
1764
|
+
function y(g) {
|
|
1765
|
+
const m = g.target.checked;
|
|
1766
|
+
i("update:modelValue", m), i("change", m);
|
|
1755
1767
|
}
|
|
1756
|
-
return (
|
|
1768
|
+
return (g, m) => (d(), _("label", {
|
|
1757
1769
|
class: P(r.value),
|
|
1758
1770
|
style: W(u.value)
|
|
1759
1771
|
}, [
|
|
@@ -1763,21 +1775,60 @@ const tt = {
|
|
|
1763
1775
|
role: "switch",
|
|
1764
1776
|
checked: e.modelValue,
|
|
1765
1777
|
disabled: e.disabled
|
|
1766
|
-
},
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1778
|
+
}, v.value, { onChange: y }), null, 16, ln),
|
|
1779
|
+
T("span", sn, [
|
|
1780
|
+
T("span", rn, [
|
|
1781
|
+
B(g.$slots, "thumb", {
|
|
1782
|
+
checked: e.modelValue
|
|
1783
|
+
})
|
|
1784
|
+
])
|
|
1785
|
+
]),
|
|
1786
|
+
t.label || g.$slots.default ? (d(), _("span", un, [
|
|
1787
|
+
B(g.$slots, "default", {}, () => [
|
|
1788
|
+
ae(N(t.label), 1)
|
|
1776
1789
|
])
|
|
1777
1790
|
])) : O("", !0)
|
|
1778
1791
|
], 6));
|
|
1779
1792
|
}
|
|
1780
|
-
}),
|
|
1793
|
+
}), Hn = /* @__PURE__ */ L({
|
|
1794
|
+
inheritAttrs: !1,
|
|
1795
|
+
__name: "VfThemeSwitch",
|
|
1796
|
+
props: {
|
|
1797
|
+
size: { default: "md" },
|
|
1798
|
+
disabled: { type: Boolean, default: !1 },
|
|
1799
|
+
label: { default: void 0 }
|
|
1800
|
+
},
|
|
1801
|
+
setup(t) {
|
|
1802
|
+
const n = t, e = R(), { resolvedTheme: i, setTheme: l } = Qe(), r = s({
|
|
1803
|
+
get: () => i.value === "dark",
|
|
1804
|
+
set: (u) => {
|
|
1805
|
+
l(u ? "dark" : "light");
|
|
1806
|
+
}
|
|
1807
|
+
});
|
|
1808
|
+
return (u, v) => (d(), q(dn, H(p(e), {
|
|
1809
|
+
modelValue: r.value,
|
|
1810
|
+
"onUpdate:modelValue": v[0] || (v[0] = (y) => r.value = y),
|
|
1811
|
+
size: n.size,
|
|
1812
|
+
disabled: n.disabled,
|
|
1813
|
+
label: n.label
|
|
1814
|
+
}), {
|
|
1815
|
+
thumb: G(({ checked: y }) => [
|
|
1816
|
+
B(u.$slots, "thumb", { checked: y }, () => [
|
|
1817
|
+
j(p(Z), {
|
|
1818
|
+
icon: y ? p(U).moon : p(U).sun,
|
|
1819
|
+
size: "0.5rem"
|
|
1820
|
+
}, null, 8, ["icon"])
|
|
1821
|
+
])
|
|
1822
|
+
]),
|
|
1823
|
+
default: G(() => [
|
|
1824
|
+
u.$slots.default || n.label ? B(u.$slots, "default", { key: 0 }, () => [
|
|
1825
|
+
ae(N(n.label), 1)
|
|
1826
|
+
]) : O("", !0)
|
|
1827
|
+
]),
|
|
1828
|
+
_: 3
|
|
1829
|
+
}, 16, ["modelValue", "size", "disabled", "label"]));
|
|
1830
|
+
}
|
|
1831
|
+
}), Kn = /* @__PURE__ */ L({
|
|
1781
1832
|
inheritAttrs: !1,
|
|
1782
1833
|
__name: "VfTag",
|
|
1783
1834
|
props: {
|
|
@@ -1785,17 +1836,17 @@ const tt = {
|
|
|
1785
1836
|
},
|
|
1786
1837
|
setup(t) {
|
|
1787
1838
|
const n = t, e = R(), i = s(
|
|
1788
|
-
() =>
|
|
1839
|
+
() => F("vf-tag", n.tone !== "neutral" && `vf-tag--${n.tone}`)
|
|
1789
1840
|
);
|
|
1790
|
-
return (l, r) => (
|
|
1841
|
+
return (l, r) => (d(), _("span", H({ class: i.value }, p(e)), [
|
|
1791
1842
|
B(l.$slots, "default")
|
|
1792
1843
|
], 16));
|
|
1793
1844
|
}
|
|
1794
|
-
}),
|
|
1845
|
+
}), cn = { class: "vf-tabs" }, fn = {
|
|
1795
1846
|
class: "vf-tabs__list",
|
|
1796
1847
|
role: "tablist",
|
|
1797
1848
|
"aria-orientation": "horizontal"
|
|
1798
|
-
},
|
|
1849
|
+
}, vn = ["id", "aria-controls", "aria-selected", "disabled", "tabindex", "onClick", "onKeydown"], pn = ["id", "aria-labelledby"], jn = /* @__PURE__ */ L({
|
|
1799
1850
|
__name: "VfTabs",
|
|
1800
1851
|
props: {
|
|
1801
1852
|
items: {},
|
|
@@ -1804,106 +1855,106 @@ const tt = {
|
|
|
1804
1855
|
},
|
|
1805
1856
|
emits: ["update:modelValue", "change"],
|
|
1806
1857
|
setup(t, { emit: n }) {
|
|
1807
|
-
const e = t, i = n, l =
|
|
1858
|
+
const e = t, i = n, l = Q({ prefix: "vf-tabs" }), r = D([]), u = s(
|
|
1808
1859
|
() => {
|
|
1809
|
-
var
|
|
1810
|
-
return (
|
|
1860
|
+
var $;
|
|
1861
|
+
return ($ = e.items.find((f) => !f.disabled)) == null ? void 0 : $.value;
|
|
1811
1862
|
}
|
|
1812
|
-
),
|
|
1813
|
-
() => e.modelValue ??
|
|
1863
|
+
), v = D(e.defaultValue ?? u.value), y = s(() => e.modelValue !== void 0), g = s(
|
|
1864
|
+
() => e.modelValue ?? v.value ?? u.value
|
|
1814
1865
|
);
|
|
1815
|
-
|
|
1866
|
+
ee(
|
|
1816
1867
|
() => e.items,
|
|
1817
|
-
(
|
|
1818
|
-
|
|
1819
|
-
(
|
|
1820
|
-
) && u.value &&
|
|
1868
|
+
($) => {
|
|
1869
|
+
!$.some(
|
|
1870
|
+
(a) => a.value === g.value && !a.disabled
|
|
1871
|
+
) && u.value && m(u.value);
|
|
1821
1872
|
},
|
|
1822
1873
|
{ deep: !0 }
|
|
1823
1874
|
);
|
|
1824
|
-
function
|
|
1825
|
-
|
|
1875
|
+
function m($) {
|
|
1876
|
+
y.value || (v.value = $), i("update:modelValue", $), i("change", $);
|
|
1826
1877
|
}
|
|
1827
|
-
function
|
|
1828
|
-
|
|
1878
|
+
function C($) {
|
|
1879
|
+
$.disabled || m($.value);
|
|
1829
1880
|
}
|
|
1830
|
-
function
|
|
1831
|
-
return e.items.filter((
|
|
1881
|
+
function x() {
|
|
1882
|
+
return e.items.filter(($) => !$.disabled);
|
|
1832
1883
|
}
|
|
1833
|
-
function w(
|
|
1834
|
-
var
|
|
1835
|
-
const
|
|
1836
|
-
(
|
|
1884
|
+
function w($) {
|
|
1885
|
+
var a;
|
|
1886
|
+
const f = e.items.findIndex((h) => h.value === $);
|
|
1887
|
+
(a = r.value[f]) == null || a.focus();
|
|
1837
1888
|
}
|
|
1838
|
-
function
|
|
1839
|
-
const
|
|
1840
|
-
(
|
|
1889
|
+
function S($, f) {
|
|
1890
|
+
const a = x(), h = a.findIndex(
|
|
1891
|
+
(c) => c.value === f.value
|
|
1841
1892
|
);
|
|
1842
|
-
if (
|
|
1843
|
-
if (
|
|
1844
|
-
|
|
1845
|
-
const
|
|
1846
|
-
|
|
1893
|
+
if (h !== -1) {
|
|
1894
|
+
if ($.key === "ArrowRight" || $.key === "ArrowDown") {
|
|
1895
|
+
$.preventDefault();
|
|
1896
|
+
const c = a[(h + 1) % a.length];
|
|
1897
|
+
C(c), w(c.value);
|
|
1847
1898
|
return;
|
|
1848
1899
|
}
|
|
1849
|
-
if (
|
|
1850
|
-
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1900
|
+
if ($.key === "ArrowLeft" || $.key === "ArrowUp") {
|
|
1901
|
+
$.preventDefault();
|
|
1902
|
+
const c = a[(h - 1 + a.length) % a.length];
|
|
1903
|
+
C(c), w(c.value);
|
|
1853
1904
|
return;
|
|
1854
1905
|
}
|
|
1855
|
-
if (
|
|
1856
|
-
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1906
|
+
if ($.key === "Home") {
|
|
1907
|
+
$.preventDefault();
|
|
1908
|
+
const c = a[0];
|
|
1909
|
+
C(c), w(c.value);
|
|
1859
1910
|
return;
|
|
1860
1911
|
}
|
|
1861
|
-
if (
|
|
1862
|
-
|
|
1863
|
-
const
|
|
1864
|
-
|
|
1912
|
+
if ($.key === "End") {
|
|
1913
|
+
$.preventDefault();
|
|
1914
|
+
const c = a[a.length - 1];
|
|
1915
|
+
C(c), w(c.value);
|
|
1865
1916
|
}
|
|
1866
1917
|
}
|
|
1867
1918
|
}
|
|
1868
|
-
function
|
|
1869
|
-
return `${l.value}-tab-${
|
|
1919
|
+
function I($) {
|
|
1920
|
+
return `${l.value}-tab-${$}`;
|
|
1870
1921
|
}
|
|
1871
|
-
function z(
|
|
1872
|
-
return `${l.value}-panel-${
|
|
1922
|
+
function z($) {
|
|
1923
|
+
return `${l.value}-panel-${$}`;
|
|
1873
1924
|
}
|
|
1874
|
-
return (
|
|
1875
|
-
T("div",
|
|
1876
|
-
(
|
|
1877
|
-
id:
|
|
1878
|
-
key:
|
|
1925
|
+
return ($, f) => (d(), _("div", cn, [
|
|
1926
|
+
T("div", fn, [
|
|
1927
|
+
(d(!0), _(ue, null, de(t.items, (a, h) => (d(), _("button", {
|
|
1928
|
+
id: I(a.value),
|
|
1929
|
+
key: a.value,
|
|
1879
1930
|
ref_for: !0,
|
|
1880
|
-
ref: (
|
|
1881
|
-
r.value[
|
|
1931
|
+
ref: (c) => {
|
|
1932
|
+
r.value[h] = c;
|
|
1882
1933
|
},
|
|
1883
|
-
"aria-controls": z(
|
|
1884
|
-
"aria-selected":
|
|
1885
|
-
disabled:
|
|
1886
|
-
tabindex:
|
|
1934
|
+
"aria-controls": z(a.value),
|
|
1935
|
+
"aria-selected": g.value === a.value,
|
|
1936
|
+
disabled: a.disabled,
|
|
1937
|
+
tabindex: g.value === a.value ? 0 : -1,
|
|
1887
1938
|
class: "vf-tabs__tab",
|
|
1888
1939
|
role: "tab",
|
|
1889
1940
|
type: "button",
|
|
1890
|
-
onClick: (
|
|
1891
|
-
onKeydown: (
|
|
1892
|
-
},
|
|
1941
|
+
onClick: (c) => C(a),
|
|
1942
|
+
onKeydown: (c) => S(c, a)
|
|
1943
|
+
}, N(a.label), 41, vn))), 128))
|
|
1893
1944
|
]),
|
|
1894
|
-
|
|
1945
|
+
g.value ? (d(), _("div", {
|
|
1895
1946
|
key: 0,
|
|
1896
|
-
id: z(
|
|
1897
|
-
"aria-labelledby":
|
|
1947
|
+
id: z(g.value),
|
|
1948
|
+
"aria-labelledby": I(g.value),
|
|
1898
1949
|
class: "vf-tabs__panel",
|
|
1899
1950
|
role: "tabpanel",
|
|
1900
1951
|
tabindex: "0"
|
|
1901
1952
|
}, [
|
|
1902
|
-
B(
|
|
1903
|
-
], 8,
|
|
1953
|
+
B($.$slots, "panel", Ve(Ce({ activeValue: g.value })))
|
|
1954
|
+
], 8, pn)) : O("", !0)
|
|
1904
1955
|
]));
|
|
1905
1956
|
}
|
|
1906
|
-
}),
|
|
1957
|
+
}), mn = ["value", "aria-invalid"], qn = /* @__PURE__ */ L({
|
|
1907
1958
|
inheritAttrs: !1,
|
|
1908
1959
|
__name: "VfTextarea",
|
|
1909
1960
|
props: {
|
|
@@ -1914,22 +1965,22 @@ const tt = {
|
|
|
1914
1965
|
emits: ["update:modelValue"],
|
|
1915
1966
|
setup(t, { emit: n }) {
|
|
1916
1967
|
const e = t, i = n, l = R(), r = s(
|
|
1917
|
-
() =>
|
|
1968
|
+
() => F(
|
|
1918
1969
|
"vf-textarea",
|
|
1919
1970
|
e.size !== "md" && `vf-textarea--${e.size}`,
|
|
1920
1971
|
e.invalid && "vf-textarea--invalid"
|
|
1921
1972
|
)
|
|
1922
1973
|
);
|
|
1923
|
-
function u(
|
|
1924
|
-
i("update:modelValue",
|
|
1974
|
+
function u(v) {
|
|
1975
|
+
i("update:modelValue", v.target.value);
|
|
1925
1976
|
}
|
|
1926
|
-
return (
|
|
1977
|
+
return (v, y) => (d(), _("textarea", H({
|
|
1927
1978
|
class: r.value,
|
|
1928
1979
|
value: e.modelValue,
|
|
1929
1980
|
"aria-invalid": e.invalid || void 0
|
|
1930
|
-
},
|
|
1981
|
+
}, p(l), { onInput: u }), null, 16, mn));
|
|
1931
1982
|
}
|
|
1932
|
-
}),
|
|
1983
|
+
}), hn = ["aria-describedby"], yn = ["id"], Un = /* @__PURE__ */ L({
|
|
1933
1984
|
__name: "VfTooltip",
|
|
1934
1985
|
props: {
|
|
1935
1986
|
text: { default: void 0 },
|
|
@@ -1939,16 +1990,16 @@ const tt = {
|
|
|
1939
1990
|
disableTeleport: { type: Boolean, default: !1 }
|
|
1940
1991
|
},
|
|
1941
1992
|
setup(t) {
|
|
1942
|
-
const n = t, e =
|
|
1943
|
-
enter:
|
|
1944
|
-
leave:
|
|
1945
|
-
},
|
|
1993
|
+
const n = t, e = D(!1), i = Q({ prefix: "vf-tooltip" }), l = D(null), r = D(null), u = D(null), v = D(null), y = {
|
|
1994
|
+
enter: Y.fast,
|
|
1995
|
+
leave: Y.fast
|
|
1996
|
+
}, g = s(
|
|
1946
1997
|
() => n.disableTeleport || n.teleportTo === !1 || n.teleportTo === null
|
|
1947
|
-
),
|
|
1948
|
-
placement:
|
|
1949
|
-
middlewareData:
|
|
1998
|
+
), m = s(() => typeof n.teleportTo == "string" || typeof HTMLElement < "u" && n.teleportTo instanceof HTMLElement ? n.teleportTo : "body"), {
|
|
1999
|
+
placement: C,
|
|
2000
|
+
middlewareData: x,
|
|
1950
2001
|
styles: w,
|
|
1951
|
-
cleanup:
|
|
2002
|
+
cleanup: S
|
|
1952
2003
|
} = ye(r, u, {
|
|
1953
2004
|
enabled: e,
|
|
1954
2005
|
placement: s(() => n.placement),
|
|
@@ -1957,82 +2008,82 @@ const tt = {
|
|
|
1957
2008
|
ve(10),
|
|
1958
2009
|
pe({ placements: ["top", "bottom"] }),
|
|
1959
2010
|
me(),
|
|
1960
|
-
|
|
1961
|
-
].filter((
|
|
2011
|
+
v.value ? he(v.value) : void 0
|
|
2012
|
+
].filter((o) => o !== void 0)
|
|
1962
2013
|
),
|
|
1963
2014
|
strategy: "fixed"
|
|
1964
|
-
}),
|
|
2015
|
+
}), I = s(() => [
|
|
1965
2016
|
"vf-tooltip__content",
|
|
1966
|
-
|
|
1967
|
-
|
|
2017
|
+
C.value.startsWith("bottom") && "vf-tooltip__content--bottom",
|
|
2018
|
+
C.value.startsWith("top") && "vf-tooltip__content--top"
|
|
1968
2019
|
]), z = s(() => {
|
|
1969
|
-
const
|
|
2020
|
+
const o = x.value.arrow;
|
|
1970
2021
|
return {
|
|
1971
|
-
x: (
|
|
1972
|
-
y: (
|
|
2022
|
+
x: (o == null ? void 0 : o.x) !== void 0 && (o == null ? void 0 : o.baseX) !== void 0 ? o.x - o.baseX : 0,
|
|
2023
|
+
y: (o == null ? void 0 : o.y) !== void 0 && (o == null ? void 0 : o.baseY) !== void 0 ? o.y - o.baseY : 0
|
|
1973
2024
|
};
|
|
1974
|
-
}),
|
|
2025
|
+
}), $ = s(() => ["vf-tooltip__arrow"]), f = s(() => ({
|
|
1975
2026
|
left: `${z.value.x}px`,
|
|
1976
2027
|
top: `${z.value.y}px`
|
|
1977
2028
|
}));
|
|
1978
|
-
function
|
|
2029
|
+
function a() {
|
|
1979
2030
|
l.value !== null && (window.clearTimeout(l.value), l.value = null);
|
|
1980
2031
|
}
|
|
1981
|
-
function
|
|
1982
|
-
|
|
2032
|
+
function h() {
|
|
2033
|
+
a(), l.value = window.setTimeout(() => {
|
|
1983
2034
|
e.value = !0;
|
|
1984
2035
|
}, n.openDelay);
|
|
1985
2036
|
}
|
|
1986
|
-
function
|
|
1987
|
-
|
|
2037
|
+
function c() {
|
|
2038
|
+
a(), e.value = !1;
|
|
1988
2039
|
}
|
|
1989
|
-
return
|
|
1990
|
-
|
|
1991
|
-
}), (
|
|
2040
|
+
return te(() => {
|
|
2041
|
+
a(), S();
|
|
2042
|
+
}), (o, E) => (d(), _("span", {
|
|
1992
2043
|
class: "vf-tooltip",
|
|
1993
|
-
onMouseenter:
|
|
1994
|
-
onMouseleave:
|
|
1995
|
-
onFocusin:
|
|
1996
|
-
onFocusout:
|
|
2044
|
+
onMouseenter: h,
|
|
2045
|
+
onMouseleave: c,
|
|
2046
|
+
onFocusin: h,
|
|
2047
|
+
onFocusout: c
|
|
1997
2048
|
}, [
|
|
1998
2049
|
T("span", {
|
|
1999
2050
|
ref_key: "triggerRef",
|
|
2000
2051
|
ref: r,
|
|
2001
2052
|
class: "vf-tooltip__trigger",
|
|
2002
|
-
"aria-describedby": e.value ?
|
|
2053
|
+
"aria-describedby": e.value ? p(i) : void 0
|
|
2003
2054
|
}, [
|
|
2004
|
-
B(
|
|
2005
|
-
], 8,
|
|
2006
|
-
(
|
|
2007
|
-
to:
|
|
2008
|
-
disabled:
|
|
2055
|
+
B(o.$slots, "default")
|
|
2056
|
+
], 8, hn),
|
|
2057
|
+
(d(), q(le, {
|
|
2058
|
+
to: m.value,
|
|
2059
|
+
disabled: g.value
|
|
2009
2060
|
}, [
|
|
2010
2061
|
j(ne, {
|
|
2011
2062
|
name: "vf-floating-transition",
|
|
2012
2063
|
appear: "",
|
|
2013
|
-
duration:
|
|
2064
|
+
duration: y
|
|
2014
2065
|
}, {
|
|
2015
|
-
default:
|
|
2016
|
-
e.value && (t.text ||
|
|
2066
|
+
default: G(() => [
|
|
2067
|
+
e.value && (t.text || o.$slots.content) ? (d(), _("span", {
|
|
2017
2068
|
key: 0,
|
|
2018
|
-
id:
|
|
2069
|
+
id: p(i),
|
|
2019
2070
|
ref_key: "contentRef",
|
|
2020
2071
|
ref: u,
|
|
2021
|
-
class: P(
|
|
2022
|
-
style: W(
|
|
2072
|
+
class: P(I.value),
|
|
2073
|
+
style: W(p(w)),
|
|
2023
2074
|
role: "tooltip"
|
|
2024
2075
|
}, [
|
|
2025
|
-
B(
|
|
2026
|
-
|
|
2076
|
+
B(o.$slots, "content", {}, () => [
|
|
2077
|
+
ae(N(t.text), 1)
|
|
2027
2078
|
]),
|
|
2028
2079
|
T("span", {
|
|
2029
2080
|
ref_key: "arrowRef",
|
|
2030
|
-
ref:
|
|
2031
|
-
class: P(
|
|
2032
|
-
style: W(
|
|
2081
|
+
ref: v,
|
|
2082
|
+
class: P($.value),
|
|
2083
|
+
style: W(f.value),
|
|
2033
2084
|
"aria-hidden": "true"
|
|
2034
2085
|
}, null, 6)
|
|
2035
|
-
], 14,
|
|
2086
|
+
], 14, yn)) : O("", !0)
|
|
2036
2087
|
]),
|
|
2037
2088
|
_: 3
|
|
2038
2089
|
})
|
|
@@ -2041,46 +2092,47 @@ const tt = {
|
|
|
2041
2092
|
}
|
|
2042
2093
|
});
|
|
2043
2094
|
export {
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2095
|
+
Cn as VfAccordion,
|
|
2096
|
+
xn as VfAlert,
|
|
2097
|
+
Bn as VfBadge,
|
|
2098
|
+
En as VfButton,
|
|
2099
|
+
On as VfCard,
|
|
2100
|
+
An as VfCheckbox,
|
|
2101
|
+
In as VfDialog,
|
|
2102
|
+
Ln as VfDivider,
|
|
2103
|
+
Dn as VfDrawer,
|
|
2104
|
+
Sn as VfDropdown,
|
|
2105
|
+
De as VfIconButton,
|
|
2106
|
+
zn as VfInput,
|
|
2107
|
+
Mn as VfLink,
|
|
2108
|
+
Pn as VfNavMenu,
|
|
2109
|
+
Nn as VfPanel,
|
|
2110
|
+
Fn as VfPopover,
|
|
2111
|
+
Rn as VfRadio,
|
|
2112
|
+
dn as VfSwitch,
|
|
2113
|
+
jn as VfTabs,
|
|
2114
|
+
Kn as VfTag,
|
|
2115
|
+
qn as VfTextarea,
|
|
2116
|
+
Vn as VfThemeProvider,
|
|
2117
|
+
Hn as VfThemeSwitch,
|
|
2118
|
+
Un as VfTooltip,
|
|
2119
|
+
Tn as VueForgeCore,
|
|
2120
|
+
Xn as createThemePreset,
|
|
2121
|
+
We as createVueForgeCore,
|
|
2122
|
+
Tn as default,
|
|
2071
2123
|
Fe as defaultThemePreset,
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2124
|
+
Qn as toMaxWidthQuery,
|
|
2125
|
+
Jn as toMinWidthQuery,
|
|
2126
|
+
Zn as useBreakpoint,
|
|
2127
|
+
ea as useBreakpointValue,
|
|
2128
|
+
ta as useBreakpoints,
|
|
2077
2129
|
Oe as useClickOutside,
|
|
2078
2130
|
se as useDisclosure,
|
|
2079
2131
|
fe as useEscapeKey,
|
|
2080
2132
|
ye as useFloating,
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2133
|
+
Ae as useFocusTrap,
|
|
2134
|
+
Q as useId,
|
|
2135
|
+
xe as useScrollLock,
|
|
2136
|
+
Qe as useTheme,
|
|
2137
|
+
na as vfBreakpoints
|
|
2086
2138
|
};
|