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