@codemonster-ru/vueforge-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/components/accordion/VfAccordion.vue.d.ts +40 -0
- package/dist/components/accordion/VfAccordion.vue.d.ts.map +1 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/alert/VfAlert.vue.d.ts +27 -0
- package/dist/components/alert/VfAlert.vue.d.ts.map +1 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/badge/VfBadge.vue.d.ts +24 -0
- package/dist/components/badge/VfBadge.vue.d.ts.map +1 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/button/VfButton.vue.d.ts +30 -0
- package/dist/components/button/VfButton.vue.d.ts.map +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/card/VfCard.vue.d.ts +27 -0
- package/dist/components/card/VfCard.vue.d.ts.map +1 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/dialog/VfDialog.vue.d.ts +59 -0
- package/dist/components/dialog/VfDialog.vue.d.ts.map +1 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.d.ts.map +1 -0
- package/dist/components/divider/VfDivider.vue.d.ts +9 -0
- package/dist/components/divider/VfDivider.vue.d.ts.map +1 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.d.ts.map +1 -0
- package/dist/components/dropdown/VfDropdown.vue.d.ts +53 -0
- package/dist/components/dropdown/VfDropdown.vue.d.ts.map +1 -0
- package/dist/components/dropdown/index.d.ts +2 -0
- package/dist/components/dropdown/index.d.ts.map +1 -0
- package/dist/components/icon-button/VfIconButton.vue.d.ts +15 -0
- package/dist/components/icon-button/VfIconButton.vue.d.ts.map +1 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +18 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/input/VfInput.vue.d.ts +17 -0
- package/dist/components/input/VfInput.vue.d.ts.map +1 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/link/VfLink.vue.d.ts +32 -0
- package/dist/components/link/VfLink.vue.d.ts.map +1 -0
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/link/index.d.ts.map +1 -0
- package/dist/components/panel/VfPanel.vue.d.ts +26 -0
- package/dist/components/panel/VfPanel.vue.d.ts.map +1 -0
- package/dist/components/panel/index.d.ts +2 -0
- package/dist/components/panel/index.d.ts.map +1 -0
- package/dist/components/popover/VfPopover.vue.d.ts +55 -0
- package/dist/components/popover/VfPopover.vue.d.ts.map +1 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.d.ts.map +1 -0
- package/dist/components/tabs/VfTabs.vue.d.ts +35 -0
- package/dist/components/tabs/VfTabs.vue.d.ts.map +1 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.d.ts.map +1 -0
- package/dist/components/tag/VfTag.vue.d.ts +24 -0
- package/dist/components/tag/VfTag.vue.d.ts.map +1 -0
- package/dist/components/tag/index.d.ts +2 -0
- package/dist/components/tag/index.d.ts.map +1 -0
- package/dist/components/textarea/VfTextarea.vue.d.ts +17 -0
- package/dist/components/textarea/VfTextarea.vue.d.ts.map +1 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/components/tooltip/VfTooltip.vue.d.ts +37 -0
- package/dist/components/tooltip/VfTooltip.vue.d.ts.map +1 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/composables/index.d.ts +8 -0
- package/dist/composables/index.d.ts.map +1 -0
- package/dist/composables/useClickOutside.d.ts +8 -0
- package/dist/composables/useClickOutside.d.ts.map +1 -0
- package/dist/composables/useDisclosure.d.ts +15 -0
- package/dist/composables/useDisclosure.d.ts.map +1 -0
- package/dist/composables/useEscapeKey.d.ts +8 -0
- package/dist/composables/useEscapeKey.d.ts.map +1 -0
- package/dist/composables/useFloating.d.ts +25 -0
- package/dist/composables/useFloating.d.ts.map +1 -0
- package/dist/composables/useFocusTrap.d.ts +7 -0
- package/dist/composables/useFocusTrap.d.ts.map +1 -0
- package/dist/composables/useId.d.ts +8 -0
- package/dist/composables/useId.d.ts.map +1 -0
- package/dist/composables/useTheme.d.ts +7 -0
- package/dist/composables/useTheme.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/providers/VfThemeProvider.vue.d.ts +21 -0
- package/dist/providers/VfThemeProvider.vue.d.ts.map +1 -0
- package/dist/providers/themeContext.d.ts +3 -0
- package/dist/providers/themeContext.d.ts.map +1 -0
- package/dist/providers/vueForgeConfig.d.ts +7 -0
- package/dist/providers/vueForgeConfig.d.ts.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/theme/default-preset.d.ts +3 -0
- package/dist/theme/default-preset.d.ts.map +1 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/utils.d.ts +11 -0
- package/dist/theme/utils.d.ts.map +1 -0
- package/dist/types/components.d.ts +15 -0
- package/dist/types/components.d.ts.map +1 -0
- package/dist/types/theme.d.ts +149 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/utils/classes.d.ts +2 -0
- package/dist/utils/classes.d.ts.map +1 -0
- package/dist/utils/theme.d.ts +6 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/vueforge-core.js +1364 -0
- package/package.json +61 -0
|
@@ -0,0 +1,1364 @@
|
|
|
1
|
+
import { defineComponent as C, ref as x, inject as ge, computed as s, watch as W, onMounted as q, onBeforeUnmount as G, provide as Te, renderSlot as k, toValue as P, nextTick as Q, openBlock as m, createElementBlock as h, createElementVNode as S, unref as c, toDisplayString as R, normalizeClass as K, createVNode as ee, createCommentVNode as E, useAttrs as F, mergeProps as M, createTextVNode as he, useSlots as Se, createBlock as Y, Teleport as Z, normalizeStyle as j, Fragment as Ve, renderList as Ce, normalizeProps as Ee, guardReactiveProps as Oe } from "vue";
|
|
2
|
+
import { VueIconify as te, icons as N } from "@codemonster-ru/vueiconify";
|
|
3
|
+
import { autoUpdate as Be, computePosition as Ie, offset as oe, flip as ne, shift as ae, arrow as re } from "@codemonster-ru/floater.js";
|
|
4
|
+
const ye = Symbol("VueForgeConfig"), De = {
|
|
5
|
+
name: "vueforge-default",
|
|
6
|
+
tokens: {
|
|
7
|
+
colorBg: "#fcfcfd",
|
|
8
|
+
colorSurface: "#ffffff",
|
|
9
|
+
colorSurfaceMuted: "#f5f7fb",
|
|
10
|
+
colorText: "#172033",
|
|
11
|
+
colorMuted: "#69738a",
|
|
12
|
+
colorBorder: "#d8e0ef",
|
|
13
|
+
colorPrimary: "#0b63f6",
|
|
14
|
+
colorPrimaryContrast: "#ffffff",
|
|
15
|
+
colorPrimarySoft: "color-mix(in srgb, var(--vf-color-primary) 12%, var(--vf-color-surface))",
|
|
16
|
+
colorPrimaryBorderSoft: "color-mix(in srgb, var(--vf-color-primary) 22%, var(--vf-color-border))",
|
|
17
|
+
colorFocusRing: "color-mix(in srgb, var(--vf-color-primary) 52%, var(--vf-color-surface))",
|
|
18
|
+
colorSuccess: "#16a34a",
|
|
19
|
+
colorDanger: "#dc2626",
|
|
20
|
+
colorSuccessSoft: "color-mix(in srgb, var(--vf-color-success) 12%, var(--vf-color-surface))",
|
|
21
|
+
colorDangerSoft: "color-mix(in srgb, var(--vf-color-danger) 12%, var(--vf-color-surface))",
|
|
22
|
+
colorSuccessBorderSoft: "color-mix(in srgb, var(--vf-color-success) 24%, var(--vf-color-border))",
|
|
23
|
+
colorDangerBorderSoft: "color-mix(in srgb, var(--vf-color-danger) 24%, var(--vf-color-border))",
|
|
24
|
+
radius: "0.75rem",
|
|
25
|
+
radiusControl: "calc(var(--vf-radius) - 0.125rem)",
|
|
26
|
+
radiusControlTight: "calc(var(--vf-radius) - 0.25rem)",
|
|
27
|
+
radiusSurface: "var(--vf-radius)",
|
|
28
|
+
radiusOverlay: "calc(var(--vf-radius) + 0.125rem)",
|
|
29
|
+
controlHeightSm: "1.75rem",
|
|
30
|
+
controlHeightMd: "2.25rem",
|
|
31
|
+
controlHeightLg: "2.5rem",
|
|
32
|
+
controlFontSizeSm: "0.875rem",
|
|
33
|
+
controlFontSizeMd: "0.9375rem",
|
|
34
|
+
controlFontSizeLg: "1rem",
|
|
35
|
+
buttonPaddingSm: "0.25rem 0.55rem",
|
|
36
|
+
buttonPaddingMd: "0.375rem 0.75rem",
|
|
37
|
+
buttonPaddingLg: "0.5rem 0.875rem",
|
|
38
|
+
buttonGap: "0.5rem",
|
|
39
|
+
fieldPaddingSm: "0.25rem 0.55rem",
|
|
40
|
+
fieldPaddingMd: "0.375rem 0.65rem",
|
|
41
|
+
fieldPaddingLg: "0.5rem 0.75rem",
|
|
42
|
+
textareaMinHeightSm: "4.5rem",
|
|
43
|
+
textareaMinHeightMd: "6rem",
|
|
44
|
+
textareaMinHeightLg: "7rem",
|
|
45
|
+
overlayPadding: "0.875rem",
|
|
46
|
+
overlayGap: "0.75rem",
|
|
47
|
+
overlayViewportPadding: "1rem",
|
|
48
|
+
menuPadding: "0.4rem",
|
|
49
|
+
menuGap: "0.2rem",
|
|
50
|
+
menuMinWidth: "12rem",
|
|
51
|
+
surfacePadding: "0.95rem",
|
|
52
|
+
surfaceGap: "0.625rem",
|
|
53
|
+
surfacePaddingCompact: "0.7rem",
|
|
54
|
+
surfaceGapCompact: "0.5rem",
|
|
55
|
+
sectionPadding: "0.75rem 0.9rem",
|
|
56
|
+
sectionGap: "0.75rem",
|
|
57
|
+
tabsGap: "0.875rem",
|
|
58
|
+
tabsListGap: "0.375rem",
|
|
59
|
+
tabsListPadding: "0.25rem",
|
|
60
|
+
tabsTabPaddingInline: "0.8rem",
|
|
61
|
+
tabsPanelPaddingTop: "0.75rem",
|
|
62
|
+
badgeHeight: "1.625rem",
|
|
63
|
+
badgePadding: "0.2rem 0.55rem",
|
|
64
|
+
badgeGap: "0.375rem",
|
|
65
|
+
badgeRadius: "999px",
|
|
66
|
+
badgeFontSize: "0.8125rem",
|
|
67
|
+
badgeLineHeight: "1.2",
|
|
68
|
+
tagHeight: "1.75rem",
|
|
69
|
+
tagPadding: "0.25rem 0.6rem",
|
|
70
|
+
tagFontSize: "0.8125rem",
|
|
71
|
+
tagLineHeight: "1.2",
|
|
72
|
+
tooltipPadding: "0.45rem 0.65rem",
|
|
73
|
+
tooltipMaxWidth: "16rem",
|
|
74
|
+
tooltipFontSize: "0.8125rem",
|
|
75
|
+
tooltipLineHeight: "1.4",
|
|
76
|
+
dialogWidthSm: "28rem",
|
|
77
|
+
dialogWidthMd: "36rem",
|
|
78
|
+
dialogWidthLg: "48rem",
|
|
79
|
+
dialogMaxHeight: "min(85vh, 48rem)",
|
|
80
|
+
dialogTitleFontSize: "1.125rem",
|
|
81
|
+
dialogHeaderGap: "0.75rem",
|
|
82
|
+
dialogActionsGap: "0.5rem",
|
|
83
|
+
popoverWidth: "min(100vw - 2rem, 22rem)",
|
|
84
|
+
floatingArrowSize: "0.625rem",
|
|
85
|
+
overlayBackdrop: "rgba(15, 23, 42, 0.56)",
|
|
86
|
+
overlayBackdropBlur: "6px",
|
|
87
|
+
alertPrimarySoft: "color-mix(in srgb, var(--vf-color-primary) 8%, var(--vf-color-surface))",
|
|
88
|
+
alertPrimaryBorderSoft: "color-mix(in srgb, var(--vf-color-primary) 22%, var(--vf-color-border))",
|
|
89
|
+
alertContentGap: "0.25rem",
|
|
90
|
+
alertTitleFontSize: "0.9375rem",
|
|
91
|
+
cardTitleFontSize: "1rem",
|
|
92
|
+
panelTitleFontSize: "0.9375rem",
|
|
93
|
+
textLineHeight: "1.5",
|
|
94
|
+
headingLineHeight: "1.3",
|
|
95
|
+
tabsLineHeight: "1.2",
|
|
96
|
+
spacing: "1rem",
|
|
97
|
+
shadow: "none"
|
|
98
|
+
},
|
|
99
|
+
dark: {
|
|
100
|
+
colorBg: "#0f172a",
|
|
101
|
+
colorSurface: "#162033",
|
|
102
|
+
colorSurfaceMuted: "#1b2840",
|
|
103
|
+
colorText: "#eff4ff",
|
|
104
|
+
colorMuted: "#9fb0cf",
|
|
105
|
+
colorBorder: "#2d405f",
|
|
106
|
+
colorPrimary: "#6ea8fe",
|
|
107
|
+
colorPrimaryContrast: "#081120",
|
|
108
|
+
colorPrimarySoft: "color-mix(in srgb, var(--vf-color-primary) 12%, var(--vf-color-surface))",
|
|
109
|
+
colorPrimaryBorderSoft: "color-mix(in srgb, var(--vf-color-primary) 22%, var(--vf-color-border))",
|
|
110
|
+
colorFocusRing: "color-mix(in srgb, var(--vf-color-primary) 52%, var(--vf-color-surface))",
|
|
111
|
+
colorSuccess: "#4ade80",
|
|
112
|
+
colorDanger: "#f87171",
|
|
113
|
+
colorSuccessSoft: "color-mix(in srgb, var(--vf-color-success) 12%, var(--vf-color-surface))",
|
|
114
|
+
colorDangerSoft: "color-mix(in srgb, var(--vf-color-danger) 12%, var(--vf-color-surface))",
|
|
115
|
+
colorSuccessBorderSoft: "color-mix(in srgb, var(--vf-color-success) 24%, var(--vf-color-border))",
|
|
116
|
+
colorDangerBorderSoft: "color-mix(in srgb, var(--vf-color-danger) 24%, var(--vf-color-border))",
|
|
117
|
+
shadow: "none"
|
|
118
|
+
}
|
|
119
|
+
}, _e = "vf-theme", be = "data-vf-theme";
|
|
120
|
+
function Pe(e) {
|
|
121
|
+
return e === "light" || e === "dark" || e === "system";
|
|
122
|
+
}
|
|
123
|
+
function Ae(e, o) {
|
|
124
|
+
return e === "system" ? o : e;
|
|
125
|
+
}
|
|
126
|
+
const $e = "vf", ze = "vf-theme-preset", Le = ":root";
|
|
127
|
+
function Fe(e) {
|
|
128
|
+
return e.replace(/[A-Z]/g, (o) => `-${o.toLowerCase()}`);
|
|
129
|
+
}
|
|
130
|
+
function ve(...e) {
|
|
131
|
+
return Object.assign({}, ...e);
|
|
132
|
+
}
|
|
133
|
+
function Ft(e) {
|
|
134
|
+
return e;
|
|
135
|
+
}
|
|
136
|
+
function Me(e = {}) {
|
|
137
|
+
const o = e.prefix ?? $e, t = e.rootSelector ?? Le, a = e.attribute ?? be;
|
|
138
|
+
return {
|
|
139
|
+
prefix: o,
|
|
140
|
+
rootSelector: t,
|
|
141
|
+
darkModeSelector: e.darkModeSelector ?? `${t}[${a}='dark']`,
|
|
142
|
+
attribute: a,
|
|
143
|
+
storageKey: e.storageKey ?? _e,
|
|
144
|
+
styleId: e.styleId ?? ze
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function He(e = {}) {
|
|
148
|
+
const o = e.preset ?? De, t = e.extend, a = ve(o.tokens, t, e.light), n = ve(o.tokens, o.dark, t, e.dark);
|
|
149
|
+
return {
|
|
150
|
+
name: o.name,
|
|
151
|
+
light: a,
|
|
152
|
+
dark: n
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function Re(e = {}) {
|
|
156
|
+
return {
|
|
157
|
+
preset: He(e),
|
|
158
|
+
options: Me(e.options)
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function pe(e, o = $e) {
|
|
162
|
+
return Object.fromEntries(
|
|
163
|
+
Object.entries(e).map(([t, a]) => [`--${o}-${Fe(t)}`, a])
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function me(e) {
|
|
167
|
+
return Object.entries(e).map(([o, t]) => ` ${o}: ${t};`).join(`
|
|
168
|
+
`);
|
|
169
|
+
}
|
|
170
|
+
function Ke(e) {
|
|
171
|
+
const { preset: o, options: t } = e, a = me(pe(o.light, t.prefix)), n = me(pe(o.dark, t.prefix));
|
|
172
|
+
return [
|
|
173
|
+
`${t.rootSelector} {
|
|
174
|
+
${a}
|
|
175
|
+
}`,
|
|
176
|
+
`${t.darkModeSelector} {
|
|
177
|
+
${n}
|
|
178
|
+
}`
|
|
179
|
+
].join(`
|
|
180
|
+
|
|
181
|
+
`);
|
|
182
|
+
}
|
|
183
|
+
function Ge(e, o = document) {
|
|
184
|
+
const t = e.options.styleId, a = o.getElementById(t) ?? Object.assign(o.createElement("style"), { id: t });
|
|
185
|
+
return a.textContent = Ke(e), a.parentNode || o.head.appendChild(a), a;
|
|
186
|
+
}
|
|
187
|
+
function We() {
|
|
188
|
+
return {
|
|
189
|
+
install(o, t = {}) {
|
|
190
|
+
const a = Re(t.theme);
|
|
191
|
+
o.provide(ye, { theme: a }), typeof document < "u" && Ge(a);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
const Mt = We(), we = Symbol("VfThemeContext"), Ht = /* @__PURE__ */ C({
|
|
196
|
+
__name: "VfThemeProvider",
|
|
197
|
+
props: {
|
|
198
|
+
defaultTheme: { default: "system" },
|
|
199
|
+
storageKey: {},
|
|
200
|
+
attribute: {}
|
|
201
|
+
},
|
|
202
|
+
setup(e) {
|
|
203
|
+
const o = e, t = x(o.defaultTheme), a = x("light"), n = x(null), r = ge(ye, null), u = s(() => Ae(t.value, a.value)), v = s(
|
|
204
|
+
() => o.storageKey ?? (r == null ? void 0 : r.theme.options.storageKey) ?? _e
|
|
205
|
+
), g = s(
|
|
206
|
+
() => o.attribute ?? (r == null ? void 0 : r.theme.options.attribute) ?? be
|
|
207
|
+
);
|
|
208
|
+
function w() {
|
|
209
|
+
if (typeof window > "u")
|
|
210
|
+
return;
|
|
211
|
+
const _ = window.localStorage.getItem(v.value);
|
|
212
|
+
Pe(_) && (t.value = _);
|
|
213
|
+
}
|
|
214
|
+
function f(_) {
|
|
215
|
+
typeof document > "u" || document.documentElement.setAttribute(g.value, _);
|
|
216
|
+
}
|
|
217
|
+
function $(_) {
|
|
218
|
+
var I;
|
|
219
|
+
if (_) {
|
|
220
|
+
a.value = _.matches ? "dark" : "light";
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
a.value = (I = n.value) != null && I.matches ? "dark" : "light";
|
|
224
|
+
}
|
|
225
|
+
function T(_) {
|
|
226
|
+
t.value = _;
|
|
227
|
+
}
|
|
228
|
+
function V() {
|
|
229
|
+
const _ = u.value === "dark" ? "light" : "dark";
|
|
230
|
+
t.value = _;
|
|
231
|
+
}
|
|
232
|
+
return W(t, (_) => {
|
|
233
|
+
typeof window > "u" || window.localStorage.setItem(v.value, _);
|
|
234
|
+
}), W(
|
|
235
|
+
u,
|
|
236
|
+
(_) => {
|
|
237
|
+
f(_);
|
|
238
|
+
},
|
|
239
|
+
{ immediate: !0 }
|
|
240
|
+
), q(() => {
|
|
241
|
+
w(), n.value = window.matchMedia("(prefers-color-scheme: dark)"), $(), n.value.addEventListener("change", $);
|
|
242
|
+
}), G(() => {
|
|
243
|
+
var _;
|
|
244
|
+
(_ = n.value) == null || _.removeEventListener("change", $);
|
|
245
|
+
}), Te(we, {
|
|
246
|
+
mode: t,
|
|
247
|
+
resolvedTheme: u,
|
|
248
|
+
setTheme: T,
|
|
249
|
+
toggleTheme: V
|
|
250
|
+
}), (_, I) => k(_.$slots, "default");
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
function ke(e, o, t = {}) {
|
|
254
|
+
const a = t.event ?? "pointerdown", n = (r) => {
|
|
255
|
+
if (P(t.enabled) === !1)
|
|
256
|
+
return;
|
|
257
|
+
const u = r.target;
|
|
258
|
+
if (!(u instanceof Node))
|
|
259
|
+
return;
|
|
260
|
+
const v = Array.isArray(e) ? e.map((g) => g.value).filter((g) => g instanceof HTMLElement) : [e.value].filter((g) => g instanceof HTMLElement);
|
|
261
|
+
v.length === 0 || v.some((g) => g.contains(u)) || o(r);
|
|
262
|
+
};
|
|
263
|
+
q(() => {
|
|
264
|
+
document.addEventListener(a, n);
|
|
265
|
+
}), G(() => {
|
|
266
|
+
document.removeEventListener(a, n);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function J(e = {}) {
|
|
270
|
+
const o = s(() => P(e.open) !== void 0), t = x(e.defaultOpen ?? !1), a = s(() => o.value ? !!P(e.open) : t.value);
|
|
271
|
+
W(
|
|
272
|
+
() => P(e.open),
|
|
273
|
+
(r) => {
|
|
274
|
+
r !== void 0 && (t.value = r);
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
function n(r) {
|
|
278
|
+
var u;
|
|
279
|
+
o.value || (t.value = r), (u = e.onOpenChange) == null || u.call(e, r);
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
isOpen: a,
|
|
283
|
+
open: () => n(!0),
|
|
284
|
+
close: () => n(!1),
|
|
285
|
+
toggle: () => n(!a.value),
|
|
286
|
+
setOpen: n
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
function le(e, o = {}) {
|
|
290
|
+
const t = o.event ?? "keydown", a = (n) => {
|
|
291
|
+
P(o.enabled) === !1 || n.key !== "Escape" || e(n);
|
|
292
|
+
};
|
|
293
|
+
q(() => {
|
|
294
|
+
document.addEventListener(t, a);
|
|
295
|
+
}), G(() => {
|
|
296
|
+
document.removeEventListener(t, a);
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
function se(e, o, t = {}) {
|
|
300
|
+
const a = x(0), n = x(0), r = x(P(t.placement) ?? "bottom"), u = x({}), v = x(null);
|
|
301
|
+
let g = 0;
|
|
302
|
+
const w = s(() => ({
|
|
303
|
+
left: `${a.value}px`,
|
|
304
|
+
top: `${n.value}px`
|
|
305
|
+
}));
|
|
306
|
+
async function f() {
|
|
307
|
+
if (!e.value || !o.value)
|
|
308
|
+
return;
|
|
309
|
+
const T = await Ie(e.value, o.value, {
|
|
310
|
+
placement: P(t.placement) ?? r.value,
|
|
311
|
+
middleware: P(t.middleware),
|
|
312
|
+
strategy: P(t.strategy)
|
|
313
|
+
});
|
|
314
|
+
a.value = T.x, n.value = T.y, r.value = T.placement, u.value = T.middlewareData ?? {};
|
|
315
|
+
}
|
|
316
|
+
function $() {
|
|
317
|
+
var T;
|
|
318
|
+
(T = v.value) == null || T.call(v), v.value = null;
|
|
319
|
+
}
|
|
320
|
+
return W(
|
|
321
|
+
[() => P(t.enabled) !== !1, e, o],
|
|
322
|
+
async ([T]) => {
|
|
323
|
+
g += 1;
|
|
324
|
+
const V = g;
|
|
325
|
+
$(), !(!T || !e.value || !o.value) && (await Q(), !(V !== g || P(t.enabled) === !1 || !e.value || !o.value) && (await f(), !(V !== g || P(t.enabled) === !1 || !e.value || !o.value) && (v.value = Be(e.value, () => {
|
|
326
|
+
f();
|
|
327
|
+
}))));
|
|
328
|
+
},
|
|
329
|
+
{ immediate: !0 }
|
|
330
|
+
), G(() => {
|
|
331
|
+
$();
|
|
332
|
+
}), {
|
|
333
|
+
x: a,
|
|
334
|
+
y: n,
|
|
335
|
+
placement: r,
|
|
336
|
+
middlewareData: u,
|
|
337
|
+
styles: w,
|
|
338
|
+
update: f,
|
|
339
|
+
cleanup: $
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
const je = [
|
|
343
|
+
"a[href]",
|
|
344
|
+
"button:not([disabled])",
|
|
345
|
+
"input:not([disabled])",
|
|
346
|
+
"select:not([disabled])",
|
|
347
|
+
"textarea:not([disabled])",
|
|
348
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
349
|
+
].join(", ");
|
|
350
|
+
function Ue(e) {
|
|
351
|
+
return Array.from(e.querySelectorAll(je)).filter(
|
|
352
|
+
(o) => !o.hasAttribute("hidden") && o.getAttribute("aria-hidden") !== "true"
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
function Ne(e, o = {}) {
|
|
356
|
+
const t = (a) => {
|
|
357
|
+
if (a.key !== "Tab" || P(o.enabled) === !1)
|
|
358
|
+
return;
|
|
359
|
+
const n = e.value;
|
|
360
|
+
if (!n)
|
|
361
|
+
return;
|
|
362
|
+
const r = Ue(n);
|
|
363
|
+
if (r.length === 0) {
|
|
364
|
+
a.preventDefault(), n.focus();
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const u = r[0], v = r[r.length - 1], g = document.activeElement;
|
|
368
|
+
if (a.shiftKey) {
|
|
369
|
+
(g === u || g === n) && (a.preventDefault(), v.focus());
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
g === v && (a.preventDefault(), u.focus());
|
|
373
|
+
};
|
|
374
|
+
q(() => {
|
|
375
|
+
document.addEventListener("keydown", t);
|
|
376
|
+
}), G(() => {
|
|
377
|
+
document.removeEventListener("keydown", t);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
let Ye = 0;
|
|
381
|
+
function H(e = {}) {
|
|
382
|
+
const o = `${e.prefix ?? "vf"}-${++Ye}`;
|
|
383
|
+
return s(() => P(e.providedId) ?? o);
|
|
384
|
+
}
|
|
385
|
+
function Rt() {
|
|
386
|
+
const e = ge(we);
|
|
387
|
+
if (!e)
|
|
388
|
+
throw new Error("useTheme must be used inside VfThemeProvider.");
|
|
389
|
+
return {
|
|
390
|
+
theme: e.mode,
|
|
391
|
+
resolvedTheme: e.resolvedTheme,
|
|
392
|
+
setTheme: e.setTheme,
|
|
393
|
+
toggleTheme: e.toggleTheme
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
const Xe = { class: "vf-accordion" }, qe = ["id", "aria-controls", "aria-expanded", "disabled"], Qe = ["id", "aria-labelledby"], Kt = /* @__PURE__ */ C({
|
|
397
|
+
__name: "VfAccordion",
|
|
398
|
+
props: {
|
|
399
|
+
open: { type: Boolean, default: void 0 },
|
|
400
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
401
|
+
title: { default: void 0 },
|
|
402
|
+
disabled: { type: Boolean, default: !1 }
|
|
403
|
+
},
|
|
404
|
+
emits: ["update:open", "openChange"],
|
|
405
|
+
setup(e, { emit: o }) {
|
|
406
|
+
const t = e, a = o, n = H({ prefix: "vf-accordion-trigger" }), r = H({ prefix: "vf-accordion-content" }), u = J({
|
|
407
|
+
defaultOpen: t.defaultOpen,
|
|
408
|
+
open: s(() => t.open),
|
|
409
|
+
onOpenChange: (f) => {
|
|
410
|
+
a("update:open", f), a("openChange", f);
|
|
411
|
+
}
|
|
412
|
+
}), v = u.isOpen;
|
|
413
|
+
function g() {
|
|
414
|
+
t.disabled || u.toggle();
|
|
415
|
+
}
|
|
416
|
+
function w(f) {
|
|
417
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), g());
|
|
418
|
+
}
|
|
419
|
+
return (f, $) => (m(), h("section", Xe, [
|
|
420
|
+
S("button", {
|
|
421
|
+
id: c(n),
|
|
422
|
+
"aria-controls": c(r),
|
|
423
|
+
"aria-expanded": c(v),
|
|
424
|
+
disabled: e.disabled,
|
|
425
|
+
class: "vf-accordion__trigger",
|
|
426
|
+
type: "button",
|
|
427
|
+
onClick: g,
|
|
428
|
+
onKeydown: w
|
|
429
|
+
}, [
|
|
430
|
+
k(f.$slots, "trigger", { open: c(v) }, () => [
|
|
431
|
+
S("span", null, R(e.title), 1)
|
|
432
|
+
]),
|
|
433
|
+
S("span", {
|
|
434
|
+
"aria-hidden": "true",
|
|
435
|
+
class: K(["vf-accordion__icon", c(v) && "vf-accordion__icon--open"])
|
|
436
|
+
}, [
|
|
437
|
+
ee(c(te), {
|
|
438
|
+
icon: c(N).chevronDown,
|
|
439
|
+
size: "0.875rem"
|
|
440
|
+
}, null, 8, ["icon"])
|
|
441
|
+
], 2)
|
|
442
|
+
], 40, qe),
|
|
443
|
+
c(v) ? (m(), h("div", {
|
|
444
|
+
key: 0,
|
|
445
|
+
id: c(r),
|
|
446
|
+
"aria-labelledby": c(n),
|
|
447
|
+
class: "vf-accordion__content",
|
|
448
|
+
role: "region"
|
|
449
|
+
}, [
|
|
450
|
+
k(f.$slots, "default", { open: c(v) })
|
|
451
|
+
], 8, Qe)) : E("", !0)
|
|
452
|
+
]));
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
function A(...e) {
|
|
456
|
+
return e.filter(Boolean).join(" ");
|
|
457
|
+
}
|
|
458
|
+
const Ze = {
|
|
459
|
+
class: "vf-alert__icon",
|
|
460
|
+
"aria-hidden": "true"
|
|
461
|
+
}, Je = { class: "vf-alert__content" }, et = {
|
|
462
|
+
key: 0,
|
|
463
|
+
class: "vf-alert__title"
|
|
464
|
+
}, tt = { class: "vf-alert__body" }, Gt = /* @__PURE__ */ C({
|
|
465
|
+
inheritAttrs: !1,
|
|
466
|
+
__name: "VfAlert",
|
|
467
|
+
props: {
|
|
468
|
+
tone: { default: "primary" },
|
|
469
|
+
title: { default: void 0 }
|
|
470
|
+
},
|
|
471
|
+
setup(e) {
|
|
472
|
+
const o = e, t = F(), a = s(
|
|
473
|
+
() => A("vf-alert", o.tone !== "primary" && `vf-alert--${o.tone}`)
|
|
474
|
+
), n = s(() => o.tone === "success" ? N.checkCircle : o.tone === "danger" ? N.warning : N.info);
|
|
475
|
+
return (r, u) => (m(), h("section", M({
|
|
476
|
+
class: a.value,
|
|
477
|
+
role: "alert"
|
|
478
|
+
}, c(t)), [
|
|
479
|
+
S("div", Ze, [
|
|
480
|
+
ee(c(te), {
|
|
481
|
+
icon: n.value,
|
|
482
|
+
size: "2rem"
|
|
483
|
+
}, null, 8, ["icon"])
|
|
484
|
+
]),
|
|
485
|
+
S("div", Je, [
|
|
486
|
+
o.title || r.$slots.title ? (m(), h("p", et, [
|
|
487
|
+
k(r.$slots, "title", {}, () => [
|
|
488
|
+
he(R(o.title), 1)
|
|
489
|
+
])
|
|
490
|
+
])) : E("", !0),
|
|
491
|
+
S("div", tt, [
|
|
492
|
+
k(r.$slots, "default")
|
|
493
|
+
])
|
|
494
|
+
])
|
|
495
|
+
], 16));
|
|
496
|
+
}
|
|
497
|
+
}), Wt = /* @__PURE__ */ C({
|
|
498
|
+
inheritAttrs: !1,
|
|
499
|
+
__name: "VfBadge",
|
|
500
|
+
props: {
|
|
501
|
+
tone: { default: "neutral" }
|
|
502
|
+
},
|
|
503
|
+
setup(e) {
|
|
504
|
+
const o = e, t = F(), a = s(
|
|
505
|
+
() => A("vf-badge", o.tone !== "neutral" && `vf-badge--${o.tone}`)
|
|
506
|
+
);
|
|
507
|
+
return (n, r) => (m(), h("span", M({ class: a.value }, c(t)), [
|
|
508
|
+
k(n.$slots, "default")
|
|
509
|
+
], 16));
|
|
510
|
+
}
|
|
511
|
+
}), ot = ["type"], jt = /* @__PURE__ */ C({
|
|
512
|
+
inheritAttrs: !1,
|
|
513
|
+
__name: "VfButton",
|
|
514
|
+
props: {
|
|
515
|
+
variant: { default: "primary" },
|
|
516
|
+
size: { default: "md" },
|
|
517
|
+
block: { type: Boolean, default: !1 },
|
|
518
|
+
type: { default: "button" }
|
|
519
|
+
},
|
|
520
|
+
setup(e) {
|
|
521
|
+
const o = e, t = F(), a = s(
|
|
522
|
+
() => A(
|
|
523
|
+
"vf-button",
|
|
524
|
+
o.variant !== "primary" && `vf-button--${o.variant}`,
|
|
525
|
+
o.size !== "md" && `vf-button--${o.size}`,
|
|
526
|
+
o.block && "vf-button--block"
|
|
527
|
+
)
|
|
528
|
+
);
|
|
529
|
+
return (n, r) => (m(), h("button", M({
|
|
530
|
+
class: a.value,
|
|
531
|
+
type: o.type
|
|
532
|
+
}, c(t)), [
|
|
533
|
+
k(n.$slots, "default")
|
|
534
|
+
], 16, ot));
|
|
535
|
+
}
|
|
536
|
+
}), nt = { key: 0 }, at = { class: "vf-card__title" }, rt = {
|
|
537
|
+
key: 1,
|
|
538
|
+
class: "vf-card__body"
|
|
539
|
+
}, lt = { key: 2 }, Ut = /* @__PURE__ */ C({
|
|
540
|
+
inheritAttrs: !1,
|
|
541
|
+
__name: "VfCard",
|
|
542
|
+
props: {
|
|
543
|
+
title: { default: void 0 },
|
|
544
|
+
compact: { type: Boolean, default: !1 }
|
|
545
|
+
},
|
|
546
|
+
setup(e) {
|
|
547
|
+
const o = e, t = F(), a = s(() => A("vf-card", o.compact && "vf-card--compact"));
|
|
548
|
+
return (n, r) => (m(), h("section", M({ class: a.value }, c(t)), [
|
|
549
|
+
o.title || n.$slots.header ? (m(), h("header", nt, [
|
|
550
|
+
k(n.$slots, "header", {}, () => [
|
|
551
|
+
S("h3", at, R(o.title), 1)
|
|
552
|
+
])
|
|
553
|
+
])) : E("", !0),
|
|
554
|
+
n.$slots.default ? (m(), h("div", rt, [
|
|
555
|
+
k(n.$slots, "default")
|
|
556
|
+
])) : E("", !0),
|
|
557
|
+
n.$slots.footer ? (m(), h("footer", lt, [
|
|
558
|
+
k(n.$slots, "footer")
|
|
559
|
+
])) : E("", !0)
|
|
560
|
+
], 16));
|
|
561
|
+
}
|
|
562
|
+
}), st = ["type"], it = /* @__PURE__ */ C({
|
|
563
|
+
inheritAttrs: !1,
|
|
564
|
+
__name: "VfIconButton",
|
|
565
|
+
props: {
|
|
566
|
+
icon: {},
|
|
567
|
+
variant: { default: "ghost" },
|
|
568
|
+
size: { default: "md" },
|
|
569
|
+
type: { default: "button" }
|
|
570
|
+
},
|
|
571
|
+
setup(e) {
|
|
572
|
+
const o = e, t = F(), a = s(
|
|
573
|
+
() => A(
|
|
574
|
+
"vf-icon-button",
|
|
575
|
+
o.variant !== "ghost" && `vf-icon-button--${o.variant}`,
|
|
576
|
+
o.size !== "md" && `vf-icon-button--${o.size}`
|
|
577
|
+
)
|
|
578
|
+
), n = s(() => o.size === "sm" ? "0.875rem" : o.size === "lg" ? "1.125rem" : "1rem");
|
|
579
|
+
return (r, u) => (m(), h("button", M({
|
|
580
|
+
class: a.value,
|
|
581
|
+
type: o.type
|
|
582
|
+
}, c(t)), [
|
|
583
|
+
ee(c(te), {
|
|
584
|
+
icon: o.icon,
|
|
585
|
+
size: n.value,
|
|
586
|
+
"aria-hidden": "true"
|
|
587
|
+
}, null, 8, ["icon", "size"])
|
|
588
|
+
], 16, st));
|
|
589
|
+
}
|
|
590
|
+
}), ct = {
|
|
591
|
+
key: 0,
|
|
592
|
+
class: "vf-dialog"
|
|
593
|
+
}, ut = ["aria-describedby", "aria-labelledby"], dt = {
|
|
594
|
+
key: 0,
|
|
595
|
+
class: "vf-dialog__header"
|
|
596
|
+
}, ft = ["id"], vt = ["id"], pt = { class: "vf-dialog__actions" }, mt = {
|
|
597
|
+
key: 1,
|
|
598
|
+
class: "vf-dialog__body"
|
|
599
|
+
}, gt = {
|
|
600
|
+
key: 2,
|
|
601
|
+
class: "vf-dialog__footer"
|
|
602
|
+
}, Nt = /* @__PURE__ */ C({
|
|
603
|
+
__name: "VfDialog",
|
|
604
|
+
props: {
|
|
605
|
+
open: { type: Boolean, default: void 0 },
|
|
606
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
607
|
+
title: { default: void 0 },
|
|
608
|
+
description: { default: void 0 },
|
|
609
|
+
size: { default: "md" },
|
|
610
|
+
closeOnOverlayClick: { type: Boolean, default: !0 },
|
|
611
|
+
closeOnEscape: { type: Boolean, default: !0 },
|
|
612
|
+
closable: { type: Boolean, default: !0 }
|
|
613
|
+
},
|
|
614
|
+
emits: ["update:open", "openChange"],
|
|
615
|
+
setup(e, { emit: o }) {
|
|
616
|
+
const t = e, a = o, n = x(null), r = x(null), u = x(null), v = Se(), g = H({ prefix: "vf-dialog-title" }), w = H({ prefix: "vf-dialog-description" }), f = J({
|
|
617
|
+
defaultOpen: t.defaultOpen,
|
|
618
|
+
open: s(() => t.open),
|
|
619
|
+
onOpenChange: (y) => {
|
|
620
|
+
a("update:open", y), a("openChange", y);
|
|
621
|
+
}
|
|
622
|
+
}), $ = f.isOpen, T = s(
|
|
623
|
+
() => A("vf-dialog__content", t.size !== "md" && `vf-dialog__content--${t.size}`)
|
|
624
|
+
), V = s(() => !!v.header), _ = s(() => !!v.description), I = s(
|
|
625
|
+
() => t.title || V.value ? g.value : void 0
|
|
626
|
+
), D = s(
|
|
627
|
+
() => t.description || _.value ? w.value : void 0
|
|
628
|
+
);
|
|
629
|
+
function d() {
|
|
630
|
+
f.close();
|
|
631
|
+
}
|
|
632
|
+
function O() {
|
|
633
|
+
t.closeOnOverlayClick && d();
|
|
634
|
+
}
|
|
635
|
+
function l() {
|
|
636
|
+
const y = n.value;
|
|
637
|
+
if (!y)
|
|
638
|
+
return;
|
|
639
|
+
const z = y.querySelector("[autofocus], [data-autofocus]");
|
|
640
|
+
if (z) {
|
|
641
|
+
z.focus();
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
y.focus();
|
|
645
|
+
}
|
|
646
|
+
function B() {
|
|
647
|
+
typeof document > "u" || (u.value === null && (u.value = document.body.style.overflow), document.body.style.overflow = "hidden");
|
|
648
|
+
}
|
|
649
|
+
function b() {
|
|
650
|
+
typeof document > "u" || (document.body.style.overflow = u.value ?? "", u.value = null);
|
|
651
|
+
}
|
|
652
|
+
return le(
|
|
653
|
+
(y) => {
|
|
654
|
+
!t.closeOnEscape || !$.value || (y.preventDefault(), d());
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
enabled: $
|
|
658
|
+
}
|
|
659
|
+
), Ne(n, {
|
|
660
|
+
enabled: $
|
|
661
|
+
}), W(
|
|
662
|
+
$,
|
|
663
|
+
async (y) => {
|
|
664
|
+
var z;
|
|
665
|
+
if (!(typeof document > "u")) {
|
|
666
|
+
if (y) {
|
|
667
|
+
r.value = document.activeElement instanceof HTMLElement ? document.activeElement : null, B(), await Q(), l();
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
b(), (z = r.value) == null || z.focus();
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
{ immediate: !0 }
|
|
674
|
+
), G(() => {
|
|
675
|
+
var y;
|
|
676
|
+
$.value && (b(), (y = r.value) == null || y.focus());
|
|
677
|
+
}), (y, z) => (m(), Y(Z, { to: "body" }, [
|
|
678
|
+
c($) ? (m(), h("div", ct, [
|
|
679
|
+
S("div", {
|
|
680
|
+
class: "vf-dialog__overlay",
|
|
681
|
+
"aria-hidden": "true",
|
|
682
|
+
onClick: O
|
|
683
|
+
}),
|
|
684
|
+
S("section", {
|
|
685
|
+
ref_key: "contentRef",
|
|
686
|
+
ref: n,
|
|
687
|
+
class: K(T.value),
|
|
688
|
+
"aria-describedby": D.value,
|
|
689
|
+
"aria-labelledby": I.value,
|
|
690
|
+
"aria-modal": "true",
|
|
691
|
+
role: "dialog",
|
|
692
|
+
tabindex: "-1"
|
|
693
|
+
}, [
|
|
694
|
+
e.title || e.description || y.$slots.header || y.$slots.description ? (m(), h("header", dt, [
|
|
695
|
+
S("div", null, [
|
|
696
|
+
k(y.$slots, "header", {}, () => [
|
|
697
|
+
e.title ? (m(), h("h2", {
|
|
698
|
+
key: 0,
|
|
699
|
+
id: c(g),
|
|
700
|
+
class: "vf-dialog__title"
|
|
701
|
+
}, R(e.title), 9, ft)) : E("", !0)
|
|
702
|
+
]),
|
|
703
|
+
k(y.$slots, "description", {}, () => [
|
|
704
|
+
e.description ? (m(), h("p", {
|
|
705
|
+
key: 0,
|
|
706
|
+
id: c(w),
|
|
707
|
+
class: "vf-dialog__description"
|
|
708
|
+
}, R(e.description), 9, vt)) : E("", !0)
|
|
709
|
+
])
|
|
710
|
+
]),
|
|
711
|
+
S("div", pt, [
|
|
712
|
+
k(y.$slots, "actions", { close: d }),
|
|
713
|
+
t.closable ? (m(), Y(it, {
|
|
714
|
+
key: 0,
|
|
715
|
+
icon: c(N).xmark,
|
|
716
|
+
"aria-label": "Close dialog",
|
|
717
|
+
size: "sm",
|
|
718
|
+
onClick: d
|
|
719
|
+
}, null, 8, ["icon"])) : E("", !0)
|
|
720
|
+
])
|
|
721
|
+
])) : E("", !0),
|
|
722
|
+
y.$slots.default ? (m(), h("div", mt, [
|
|
723
|
+
k(y.$slots, "default", { close: d })
|
|
724
|
+
])) : E("", !0),
|
|
725
|
+
y.$slots.footer ? (m(), h("footer", gt, [
|
|
726
|
+
k(y.$slots, "footer", { close: d })
|
|
727
|
+
])) : E("", !0)
|
|
728
|
+
], 10, ut)
|
|
729
|
+
])) : E("", !0)
|
|
730
|
+
]));
|
|
731
|
+
}
|
|
732
|
+
}), ht = ["aria-orientation", "role"], Yt = /* @__PURE__ */ C({
|
|
733
|
+
inheritAttrs: !1,
|
|
734
|
+
__name: "VfDivider",
|
|
735
|
+
props: {
|
|
736
|
+
orientation: { default: "horizontal" }
|
|
737
|
+
},
|
|
738
|
+
setup(e) {
|
|
739
|
+
const o = e, t = F(), a = s(() => o.orientation === "vertical"), n = s(() => A("vf-divider", `vf-divider--${o.orientation}`));
|
|
740
|
+
return (r, u) => (m(), h("div", M({
|
|
741
|
+
class: n.value,
|
|
742
|
+
"aria-orientation": o.orientation,
|
|
743
|
+
role: a.value ? "separator" : void 0
|
|
744
|
+
}, c(t)), null, 16, ht));
|
|
745
|
+
}
|
|
746
|
+
}), yt = { class: "vf-dropdown" }, _t = ["id", "aria-controls", "aria-expanded"], bt = ["id", "aria-labelledby"], Xt = /* @__PURE__ */ C({
|
|
747
|
+
__name: "VfDropdown",
|
|
748
|
+
props: {
|
|
749
|
+
open: { type: Boolean, default: void 0 },
|
|
750
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
751
|
+
placement: { default: "bottom-start" },
|
|
752
|
+
closeOnSelect: { type: Boolean, default: !0 }
|
|
753
|
+
},
|
|
754
|
+
emits: ["update:open", "openChange"],
|
|
755
|
+
setup(e, { emit: o }) {
|
|
756
|
+
const t = e, a = o, n = x(null), r = x(null), u = x(null), v = H({ prefix: "vf-dropdown-menu" }), g = H({ prefix: "vf-dropdown-trigger" }), w = J({
|
|
757
|
+
defaultOpen: t.defaultOpen,
|
|
758
|
+
open: s(() => t.open),
|
|
759
|
+
onOpenChange: (i) => {
|
|
760
|
+
a("update:open", i), a("openChange", i);
|
|
761
|
+
}
|
|
762
|
+
}), f = w.isOpen, $ = s(() => [
|
|
763
|
+
"vf-dropdown__menu",
|
|
764
|
+
D.value.startsWith("top") && "vf-dropdown__menu--top"
|
|
765
|
+
]), T = s(() => {
|
|
766
|
+
const i = d.value.arrow;
|
|
767
|
+
return {
|
|
768
|
+
x: (i == null ? void 0 : i.x) !== void 0 && (i == null ? void 0 : i.baseX) !== void 0 ? i.x - i.baseX : 0,
|
|
769
|
+
y: (i == null ? void 0 : i.y) !== void 0 && (i == null ? void 0 : i.baseY) !== void 0 ? i.y - i.baseY : 0
|
|
770
|
+
};
|
|
771
|
+
}), V = s(() => ({
|
|
772
|
+
left: `${T.value.x}px`,
|
|
773
|
+
top: `${T.value.y}px`
|
|
774
|
+
})), _ = s(() => [
|
|
775
|
+
"vf-dropdown__arrow",
|
|
776
|
+
D.value.startsWith("top") ? "vf-dropdown__arrow--top" : "vf-dropdown__arrow--bottom"
|
|
777
|
+
]), I = s(
|
|
778
|
+
() => t.placement === "bottom-end" ? ["bottom-end", "top-end"] : ["bottom-start", "top-start"]
|
|
779
|
+
), { placement: D, middlewareData: d, styles: O } = se(n, r, {
|
|
780
|
+
enabled: f,
|
|
781
|
+
placement: s(() => t.placement),
|
|
782
|
+
middleware: s(
|
|
783
|
+
() => [oe(10), ne({ placements: I.value }), ae(), u.value ? re(u.value) : void 0].filter(
|
|
784
|
+
(i) => i !== void 0
|
|
785
|
+
)
|
|
786
|
+
),
|
|
787
|
+
strategy: "fixed"
|
|
788
|
+
});
|
|
789
|
+
function l() {
|
|
790
|
+
var i;
|
|
791
|
+
return Array.from(((i = r.value) == null ? void 0 : i.querySelectorAll('[role="menuitem"]')) ?? []);
|
|
792
|
+
}
|
|
793
|
+
async function B() {
|
|
794
|
+
var i;
|
|
795
|
+
await Q(), (i = l()[0]) == null || i.focus();
|
|
796
|
+
}
|
|
797
|
+
function b(i = {}) {
|
|
798
|
+
w.open(), i.focusFirstItem && B();
|
|
799
|
+
}
|
|
800
|
+
function y() {
|
|
801
|
+
var i;
|
|
802
|
+
w.close(), (i = n.value) == null || i.focus();
|
|
803
|
+
}
|
|
804
|
+
function z() {
|
|
805
|
+
if (f.value) {
|
|
806
|
+
y();
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
b();
|
|
810
|
+
}
|
|
811
|
+
function p(i) {
|
|
812
|
+
(i.key === "ArrowDown" || i.key === "Enter" || i.key === " ") && (i.preventDefault(), b({ focusFirstItem: !0 }));
|
|
813
|
+
}
|
|
814
|
+
function U(i) {
|
|
815
|
+
var ce, ue, de, fe;
|
|
816
|
+
const L = l(), ie = L.findIndex((xe) => xe === document.activeElement);
|
|
817
|
+
if (i.key === "ArrowDown") {
|
|
818
|
+
i.preventDefault(), (ce = L[(ie + 1 + L.length) % L.length]) == null || ce.focus();
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
if (i.key === "ArrowUp") {
|
|
822
|
+
i.preventDefault(), (ue = L[(ie - 1 + L.length) % L.length]) == null || ue.focus();
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
if (i.key === "Home") {
|
|
826
|
+
i.preventDefault(), (de = L[0]) == null || de.focus();
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
i.key === "End" && (i.preventDefault(), (fe = L[L.length - 1]) == null || fe.focus());
|
|
830
|
+
}
|
|
831
|
+
function X() {
|
|
832
|
+
t.closeOnSelect && y();
|
|
833
|
+
}
|
|
834
|
+
return ke(
|
|
835
|
+
[n, r],
|
|
836
|
+
() => {
|
|
837
|
+
f.value && y();
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
enabled: f,
|
|
841
|
+
event: "click"
|
|
842
|
+
}
|
|
843
|
+
), le(
|
|
844
|
+
(i) => {
|
|
845
|
+
f.value && (i.preventDefault(), y());
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
enabled: f
|
|
849
|
+
}
|
|
850
|
+
), (i, L) => (m(), h("div", yt, [
|
|
851
|
+
S("div", {
|
|
852
|
+
id: c(g),
|
|
853
|
+
ref_key: "triggerRef",
|
|
854
|
+
ref: n,
|
|
855
|
+
class: "vf-dropdown__trigger",
|
|
856
|
+
"aria-controls": c(v),
|
|
857
|
+
"aria-expanded": c(f),
|
|
858
|
+
"aria-haspopup": "menu",
|
|
859
|
+
tabindex: "0",
|
|
860
|
+
onClick: z,
|
|
861
|
+
onKeydown: p
|
|
862
|
+
}, [
|
|
863
|
+
k(i.$slots, "trigger", {
|
|
864
|
+
open: c(f),
|
|
865
|
+
toggle: z
|
|
866
|
+
})
|
|
867
|
+
], 40, _t),
|
|
868
|
+
(m(), Y(Z, { to: "body" }, [
|
|
869
|
+
c(f) ? (m(), h("div", {
|
|
870
|
+
key: 0,
|
|
871
|
+
id: c(v),
|
|
872
|
+
ref_key: "menuRef",
|
|
873
|
+
ref: r,
|
|
874
|
+
class: K($.value),
|
|
875
|
+
style: j(c(O)),
|
|
876
|
+
"aria-labelledby": c(g),
|
|
877
|
+
role: "menu",
|
|
878
|
+
onClick: X,
|
|
879
|
+
onKeydown: U
|
|
880
|
+
}, [
|
|
881
|
+
S("span", {
|
|
882
|
+
ref_key: "arrowRef",
|
|
883
|
+
ref: u,
|
|
884
|
+
class: K(_.value),
|
|
885
|
+
style: j(V.value),
|
|
886
|
+
"aria-hidden": "true"
|
|
887
|
+
}, null, 6),
|
|
888
|
+
k(i.$slots, "default", {
|
|
889
|
+
close: y,
|
|
890
|
+
open: c(f)
|
|
891
|
+
})
|
|
892
|
+
], 46, bt)) : E("", !0)
|
|
893
|
+
]))
|
|
894
|
+
]));
|
|
895
|
+
}
|
|
896
|
+
}), $t = ["value", "aria-invalid"], qt = /* @__PURE__ */ C({
|
|
897
|
+
inheritAttrs: !1,
|
|
898
|
+
__name: "VfInput",
|
|
899
|
+
props: {
|
|
900
|
+
modelValue: { default: "" },
|
|
901
|
+
size: { default: "md" },
|
|
902
|
+
invalid: { type: Boolean, default: !1 }
|
|
903
|
+
},
|
|
904
|
+
emits: ["update:modelValue"],
|
|
905
|
+
setup(e, { emit: o }) {
|
|
906
|
+
const t = e, a = o, n = F(), r = s(
|
|
907
|
+
() => A(
|
|
908
|
+
"vf-input",
|
|
909
|
+
t.size !== "md" && `vf-input--${t.size}`,
|
|
910
|
+
t.invalid && "vf-input--invalid"
|
|
911
|
+
)
|
|
912
|
+
);
|
|
913
|
+
function u(v) {
|
|
914
|
+
a("update:modelValue", v.target.value);
|
|
915
|
+
}
|
|
916
|
+
return (v, g) => (m(), h("input", M({
|
|
917
|
+
class: r.value,
|
|
918
|
+
value: t.modelValue,
|
|
919
|
+
"aria-invalid": t.invalid || void 0
|
|
920
|
+
}, c(n), { onInput: u }), null, 16, $t));
|
|
921
|
+
}
|
|
922
|
+
}), wt = ["href", "target", "rel"], Qt = /* @__PURE__ */ C({
|
|
923
|
+
inheritAttrs: !1,
|
|
924
|
+
__name: "VfLink",
|
|
925
|
+
props: {
|
|
926
|
+
href: { default: void 0 },
|
|
927
|
+
target: { default: void 0 },
|
|
928
|
+
rel: { default: void 0 },
|
|
929
|
+
underline: { type: Boolean, default: !1 },
|
|
930
|
+
tone: { default: "default" }
|
|
931
|
+
},
|
|
932
|
+
setup(e) {
|
|
933
|
+
const o = e, t = F(), a = s(() => o.rel ? o.rel : o.target === "_blank" ? "noopener noreferrer" : void 0), n = s(
|
|
934
|
+
() => A(
|
|
935
|
+
"vf-link",
|
|
936
|
+
o.underline && "vf-link--underline",
|
|
937
|
+
o.tone === "muted" && "vf-link--muted"
|
|
938
|
+
)
|
|
939
|
+
);
|
|
940
|
+
return (r, u) => (m(), h("a", M({
|
|
941
|
+
class: n.value,
|
|
942
|
+
href: o.href,
|
|
943
|
+
target: o.target,
|
|
944
|
+
rel: a.value
|
|
945
|
+
}, c(t)), [
|
|
946
|
+
k(r.$slots, "default")
|
|
947
|
+
], 16, wt));
|
|
948
|
+
}
|
|
949
|
+
}), kt = { key: 0 }, xt = { class: "vf-panel__title" }, Zt = /* @__PURE__ */ C({
|
|
950
|
+
inheritAttrs: !1,
|
|
951
|
+
__name: "VfPanel",
|
|
952
|
+
props: {
|
|
953
|
+
title: { default: void 0 },
|
|
954
|
+
subtle: { type: Boolean, default: !1 }
|
|
955
|
+
},
|
|
956
|
+
setup(e) {
|
|
957
|
+
const o = e, t = F(), a = s(() => A("vf-panel", o.subtle && "vf-panel--subtle"));
|
|
958
|
+
return (n, r) => (m(), h("section", M({ class: a.value }, c(t)), [
|
|
959
|
+
o.title || n.$slots.header ? (m(), h("header", kt, [
|
|
960
|
+
k(n.$slots, "header", {}, () => [
|
|
961
|
+
S("h3", xt, R(o.title), 1)
|
|
962
|
+
])
|
|
963
|
+
])) : E("", !0),
|
|
964
|
+
k(n.$slots, "default")
|
|
965
|
+
], 16));
|
|
966
|
+
}
|
|
967
|
+
}), Tt = { class: "vf-popover" }, St = ["id", "aria-controls", "aria-expanded"], Vt = ["id", "aria-labelledby"], Jt = /* @__PURE__ */ C({
|
|
968
|
+
__name: "VfPopover",
|
|
969
|
+
props: {
|
|
970
|
+
open: { type: Boolean, default: void 0 },
|
|
971
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
972
|
+
placement: { default: "bottom-start" },
|
|
973
|
+
closeOnOutsideClick: { type: Boolean, default: !0 },
|
|
974
|
+
closeOnEscape: { type: Boolean, default: !0 }
|
|
975
|
+
},
|
|
976
|
+
emits: ["update:open", "openChange"],
|
|
977
|
+
setup(e, { emit: o }) {
|
|
978
|
+
const t = e, a = o, n = x(null), r = x(null), u = x(null), v = H({ prefix: "vf-popover-content" }), g = H({ prefix: "vf-popover-trigger" }), w = J({
|
|
979
|
+
defaultOpen: t.defaultOpen,
|
|
980
|
+
open: s(() => t.open),
|
|
981
|
+
onOpenChange: (p) => {
|
|
982
|
+
a("update:open", p), a("openChange", p);
|
|
983
|
+
}
|
|
984
|
+
}), f = w.isOpen, $ = s(
|
|
985
|
+
() => t.placement === "bottom-end" ? ["bottom-end", "top-end"] : ["bottom-start", "top-start"]
|
|
986
|
+
), { placement: T, middlewareData: V, styles: _ } = se(n, r, {
|
|
987
|
+
enabled: f,
|
|
988
|
+
placement: s(() => t.placement),
|
|
989
|
+
middleware: s(
|
|
990
|
+
() => [oe(10), ne({ placements: $.value }), ae(), u.value ? re(u.value) : void 0].filter(
|
|
991
|
+
(p) => p !== void 0
|
|
992
|
+
)
|
|
993
|
+
),
|
|
994
|
+
strategy: "fixed"
|
|
995
|
+
}), I = s(() => [
|
|
996
|
+
"vf-popover__content",
|
|
997
|
+
T.value.startsWith("top") && "vf-popover__content--top"
|
|
998
|
+
]), D = s(() => {
|
|
999
|
+
const p = V.value.arrow;
|
|
1000
|
+
return {
|
|
1001
|
+
x: (p == null ? void 0 : p.x) !== void 0 && (p == null ? void 0 : p.baseX) !== void 0 ? p.x - p.baseX : 0,
|
|
1002
|
+
y: (p == null ? void 0 : p.y) !== void 0 && (p == null ? void 0 : p.baseY) !== void 0 ? p.y - p.baseY : 0
|
|
1003
|
+
};
|
|
1004
|
+
}), d = s(() => ({
|
|
1005
|
+
left: `${D.value.x}px`,
|
|
1006
|
+
top: `${D.value.y}px`
|
|
1007
|
+
})), O = s(() => [
|
|
1008
|
+
"vf-popover__arrow",
|
|
1009
|
+
T.value.startsWith("top") ? "vf-popover__arrow--top" : "vf-popover__arrow--bottom"
|
|
1010
|
+
]);
|
|
1011
|
+
async function l() {
|
|
1012
|
+
var U, X;
|
|
1013
|
+
await Q();
|
|
1014
|
+
const p = (U = r.value) == null ? void 0 : U.querySelector("[autofocus], [data-autofocus]");
|
|
1015
|
+
if (p) {
|
|
1016
|
+
p.focus();
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
(X = r.value) == null || X.focus();
|
|
1020
|
+
}
|
|
1021
|
+
function B() {
|
|
1022
|
+
w.open(), l();
|
|
1023
|
+
}
|
|
1024
|
+
function b() {
|
|
1025
|
+
var p;
|
|
1026
|
+
w.close(), (p = n.value) == null || p.focus();
|
|
1027
|
+
}
|
|
1028
|
+
function y() {
|
|
1029
|
+
if (f.value) {
|
|
1030
|
+
b();
|
|
1031
|
+
return;
|
|
1032
|
+
}
|
|
1033
|
+
B();
|
|
1034
|
+
}
|
|
1035
|
+
function z(p) {
|
|
1036
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), y()), p.key === "ArrowDown" && (p.preventDefault(), B());
|
|
1037
|
+
}
|
|
1038
|
+
return ke(
|
|
1039
|
+
[n, r],
|
|
1040
|
+
() => {
|
|
1041
|
+
f.value && t.closeOnOutsideClick && b();
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
enabled: f,
|
|
1045
|
+
event: "click"
|
|
1046
|
+
}
|
|
1047
|
+
), le(
|
|
1048
|
+
(p) => {
|
|
1049
|
+
!f.value || !t.closeOnEscape || (p.preventDefault(), b());
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
enabled: f
|
|
1053
|
+
}
|
|
1054
|
+
), (p, U) => (m(), h("div", Tt, [
|
|
1055
|
+
S("div", {
|
|
1056
|
+
id: c(g),
|
|
1057
|
+
ref_key: "triggerRef",
|
|
1058
|
+
ref: n,
|
|
1059
|
+
class: "vf-popover__trigger",
|
|
1060
|
+
"aria-controls": c(v),
|
|
1061
|
+
"aria-expanded": c(f),
|
|
1062
|
+
"aria-haspopup": "dialog",
|
|
1063
|
+
tabindex: "0",
|
|
1064
|
+
onClick: y,
|
|
1065
|
+
onKeydown: z
|
|
1066
|
+
}, [
|
|
1067
|
+
k(p.$slots, "trigger", {
|
|
1068
|
+
open: c(f),
|
|
1069
|
+
toggle: y
|
|
1070
|
+
})
|
|
1071
|
+
], 40, St),
|
|
1072
|
+
(m(), Y(Z, { to: "body" }, [
|
|
1073
|
+
c(f) ? (m(), h("section", {
|
|
1074
|
+
key: 0,
|
|
1075
|
+
id: c(v),
|
|
1076
|
+
ref_key: "contentRef",
|
|
1077
|
+
ref: r,
|
|
1078
|
+
class: K(I.value),
|
|
1079
|
+
style: j(c(_)),
|
|
1080
|
+
"aria-labelledby": c(g),
|
|
1081
|
+
role: "dialog",
|
|
1082
|
+
tabindex: "-1"
|
|
1083
|
+
}, [
|
|
1084
|
+
S("span", {
|
|
1085
|
+
ref_key: "arrowRef",
|
|
1086
|
+
ref: u,
|
|
1087
|
+
class: K(O.value),
|
|
1088
|
+
style: j(d.value),
|
|
1089
|
+
"aria-hidden": "true"
|
|
1090
|
+
}, null, 6),
|
|
1091
|
+
k(p.$slots, "default", {
|
|
1092
|
+
open: c(f),
|
|
1093
|
+
close: b
|
|
1094
|
+
})
|
|
1095
|
+
], 14, Vt)) : E("", !0)
|
|
1096
|
+
]))
|
|
1097
|
+
]));
|
|
1098
|
+
}
|
|
1099
|
+
}), eo = /* @__PURE__ */ C({
|
|
1100
|
+
inheritAttrs: !1,
|
|
1101
|
+
__name: "VfTag",
|
|
1102
|
+
props: {
|
|
1103
|
+
tone: { default: "neutral" }
|
|
1104
|
+
},
|
|
1105
|
+
setup(e) {
|
|
1106
|
+
const o = e, t = F(), a = s(
|
|
1107
|
+
() => A("vf-tag", o.tone !== "neutral" && `vf-tag--${o.tone}`)
|
|
1108
|
+
);
|
|
1109
|
+
return (n, r) => (m(), h("span", M({ class: a.value }, c(t)), [
|
|
1110
|
+
k(n.$slots, "default")
|
|
1111
|
+
], 16));
|
|
1112
|
+
}
|
|
1113
|
+
}), Ct = { class: "vf-tabs" }, Et = {
|
|
1114
|
+
class: "vf-tabs__list",
|
|
1115
|
+
role: "tablist",
|
|
1116
|
+
"aria-orientation": "horizontal"
|
|
1117
|
+
}, Ot = ["id", "aria-controls", "aria-selected", "disabled", "tabindex", "onClick", "onKeydown"], Bt = ["id", "aria-labelledby"], to = /* @__PURE__ */ C({
|
|
1118
|
+
__name: "VfTabs",
|
|
1119
|
+
props: {
|
|
1120
|
+
items: {},
|
|
1121
|
+
modelValue: { default: void 0 },
|
|
1122
|
+
defaultValue: { default: void 0 }
|
|
1123
|
+
},
|
|
1124
|
+
emits: ["update:modelValue", "change"],
|
|
1125
|
+
setup(e, { emit: o }) {
|
|
1126
|
+
const t = e, a = o, n = H({ prefix: "vf-tabs" }), r = x([]), u = s(() => {
|
|
1127
|
+
var d;
|
|
1128
|
+
return (d = t.items.find((O) => !O.disabled)) == null ? void 0 : d.value;
|
|
1129
|
+
}), v = x(t.defaultValue ?? u.value), g = s(() => t.modelValue !== void 0), w = s(() => t.modelValue ?? v.value ?? u.value);
|
|
1130
|
+
W(
|
|
1131
|
+
() => t.items,
|
|
1132
|
+
(d) => {
|
|
1133
|
+
!d.some((l) => l.value === w.value && !l.disabled) && u.value && f(u.value);
|
|
1134
|
+
},
|
|
1135
|
+
{ deep: !0 }
|
|
1136
|
+
);
|
|
1137
|
+
function f(d) {
|
|
1138
|
+
g.value || (v.value = d), a("update:modelValue", d), a("change", d);
|
|
1139
|
+
}
|
|
1140
|
+
function $(d) {
|
|
1141
|
+
d.disabled || f(d.value);
|
|
1142
|
+
}
|
|
1143
|
+
function T() {
|
|
1144
|
+
return t.items.filter((d) => !d.disabled);
|
|
1145
|
+
}
|
|
1146
|
+
function V(d) {
|
|
1147
|
+
var l;
|
|
1148
|
+
const O = t.items.findIndex((B) => B.value === d);
|
|
1149
|
+
(l = r.value[O]) == null || l.focus();
|
|
1150
|
+
}
|
|
1151
|
+
function _(d, O) {
|
|
1152
|
+
const l = T(), B = l.findIndex((b) => b.value === O.value);
|
|
1153
|
+
if (B !== -1) {
|
|
1154
|
+
if (d.key === "ArrowRight" || d.key === "ArrowDown") {
|
|
1155
|
+
d.preventDefault();
|
|
1156
|
+
const b = l[(B + 1) % l.length];
|
|
1157
|
+
$(b), V(b.value);
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
if (d.key === "ArrowLeft" || d.key === "ArrowUp") {
|
|
1161
|
+
d.preventDefault();
|
|
1162
|
+
const b = l[(B - 1 + l.length) % l.length];
|
|
1163
|
+
$(b), V(b.value);
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
if (d.key === "Home") {
|
|
1167
|
+
d.preventDefault();
|
|
1168
|
+
const b = l[0];
|
|
1169
|
+
$(b), V(b.value);
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
if (d.key === "End") {
|
|
1173
|
+
d.preventDefault();
|
|
1174
|
+
const b = l[l.length - 1];
|
|
1175
|
+
$(b), V(b.value);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
function I(d) {
|
|
1180
|
+
return `${n.value}-tab-${d}`;
|
|
1181
|
+
}
|
|
1182
|
+
function D(d) {
|
|
1183
|
+
return `${n.value}-panel-${d}`;
|
|
1184
|
+
}
|
|
1185
|
+
return (d, O) => (m(), h("div", Ct, [
|
|
1186
|
+
S("div", Et, [
|
|
1187
|
+
(m(!0), h(Ve, null, Ce(e.items, (l, B) => (m(), h("button", {
|
|
1188
|
+
id: I(l.value),
|
|
1189
|
+
key: l.value,
|
|
1190
|
+
ref_for: !0,
|
|
1191
|
+
ref: (b) => {
|
|
1192
|
+
r.value[B] = b;
|
|
1193
|
+
},
|
|
1194
|
+
"aria-controls": D(l.value),
|
|
1195
|
+
"aria-selected": w.value === l.value,
|
|
1196
|
+
disabled: l.disabled,
|
|
1197
|
+
tabindex: w.value === l.value ? 0 : -1,
|
|
1198
|
+
class: "vf-tabs__tab",
|
|
1199
|
+
role: "tab",
|
|
1200
|
+
type: "button",
|
|
1201
|
+
onClick: (b) => $(l),
|
|
1202
|
+
onKeydown: (b) => _(b, l)
|
|
1203
|
+
}, R(l.label), 41, Ot))), 128))
|
|
1204
|
+
]),
|
|
1205
|
+
w.value ? (m(), h("div", {
|
|
1206
|
+
key: 0,
|
|
1207
|
+
id: D(w.value),
|
|
1208
|
+
"aria-labelledby": I(w.value),
|
|
1209
|
+
class: "vf-tabs__panel",
|
|
1210
|
+
role: "tabpanel",
|
|
1211
|
+
tabindex: "0"
|
|
1212
|
+
}, [
|
|
1213
|
+
k(d.$slots, "panel", Ee(Oe({ activeValue: w.value })))
|
|
1214
|
+
], 8, Bt)) : E("", !0)
|
|
1215
|
+
]));
|
|
1216
|
+
}
|
|
1217
|
+
}), It = ["value", "aria-invalid"], oo = /* @__PURE__ */ C({
|
|
1218
|
+
inheritAttrs: !1,
|
|
1219
|
+
__name: "VfTextarea",
|
|
1220
|
+
props: {
|
|
1221
|
+
modelValue: { default: "" },
|
|
1222
|
+
size: { default: "md" },
|
|
1223
|
+
invalid: { type: Boolean, default: !1 }
|
|
1224
|
+
},
|
|
1225
|
+
emits: ["update:modelValue"],
|
|
1226
|
+
setup(e, { emit: o }) {
|
|
1227
|
+
const t = e, a = o, n = F(), r = s(
|
|
1228
|
+
() => A(
|
|
1229
|
+
"vf-textarea",
|
|
1230
|
+
t.size !== "md" && `vf-textarea--${t.size}`,
|
|
1231
|
+
t.invalid && "vf-textarea--invalid"
|
|
1232
|
+
)
|
|
1233
|
+
);
|
|
1234
|
+
function u(v) {
|
|
1235
|
+
a("update:modelValue", v.target.value);
|
|
1236
|
+
}
|
|
1237
|
+
return (v, g) => (m(), h("textarea", M({
|
|
1238
|
+
class: r.value,
|
|
1239
|
+
value: t.modelValue,
|
|
1240
|
+
"aria-invalid": t.invalid || void 0
|
|
1241
|
+
}, c(n), { onInput: u }), null, 16, It));
|
|
1242
|
+
}
|
|
1243
|
+
}), Dt = ["aria-describedby"], Pt = ["id"], no = /* @__PURE__ */ C({
|
|
1244
|
+
__name: "VfTooltip",
|
|
1245
|
+
props: {
|
|
1246
|
+
text: { default: void 0 },
|
|
1247
|
+
placement: { default: "top" },
|
|
1248
|
+
openDelay: { default: 80 }
|
|
1249
|
+
},
|
|
1250
|
+
setup(e) {
|
|
1251
|
+
const o = e, t = x(!1), a = H({ prefix: "vf-tooltip" }), n = x(null), r = x(null), u = x(null), v = x(null), { placement: g, middlewareData: w, styles: f, cleanup: $ } = se(
|
|
1252
|
+
r,
|
|
1253
|
+
u,
|
|
1254
|
+
{
|
|
1255
|
+
enabled: t,
|
|
1256
|
+
placement: s(() => o.placement),
|
|
1257
|
+
middleware: s(
|
|
1258
|
+
() => [oe(10), ne({ placements: ["top", "bottom"] }), ae(), v.value ? re(v.value) : void 0].filter(
|
|
1259
|
+
(l) => l !== void 0
|
|
1260
|
+
)
|
|
1261
|
+
),
|
|
1262
|
+
strategy: "fixed"
|
|
1263
|
+
}
|
|
1264
|
+
), T = s(
|
|
1265
|
+
() => [
|
|
1266
|
+
"vf-tooltip__content",
|
|
1267
|
+
g.value.startsWith("bottom") && "vf-tooltip__content--bottom",
|
|
1268
|
+
g.value.startsWith("top") && "vf-tooltip__content--top"
|
|
1269
|
+
]
|
|
1270
|
+
), V = s(() => {
|
|
1271
|
+
const l = w.value.arrow;
|
|
1272
|
+
return {
|
|
1273
|
+
x: (l == null ? void 0 : l.x) !== void 0 && (l == null ? void 0 : l.baseX) !== void 0 ? l.x - l.baseX : 0,
|
|
1274
|
+
y: (l == null ? void 0 : l.y) !== void 0 && (l == null ? void 0 : l.baseY) !== void 0 ? l.y - l.baseY : 0
|
|
1275
|
+
};
|
|
1276
|
+
}), _ = s(() => ["vf-tooltip__arrow"]), I = s(() => ({
|
|
1277
|
+
left: `${V.value.x}px`,
|
|
1278
|
+
top: `${V.value.y}px`
|
|
1279
|
+
}));
|
|
1280
|
+
function D() {
|
|
1281
|
+
n.value !== null && (window.clearTimeout(n.value), n.value = null);
|
|
1282
|
+
}
|
|
1283
|
+
function d() {
|
|
1284
|
+
D(), n.value = window.setTimeout(() => {
|
|
1285
|
+
t.value = !0;
|
|
1286
|
+
}, o.openDelay);
|
|
1287
|
+
}
|
|
1288
|
+
function O() {
|
|
1289
|
+
D(), t.value = !1;
|
|
1290
|
+
}
|
|
1291
|
+
return G(() => {
|
|
1292
|
+
D(), $();
|
|
1293
|
+
}), (l, B) => (m(), h("span", {
|
|
1294
|
+
class: "vf-tooltip",
|
|
1295
|
+
onMouseenter: d,
|
|
1296
|
+
onMouseleave: O,
|
|
1297
|
+
onFocusin: d,
|
|
1298
|
+
onFocusout: O
|
|
1299
|
+
}, [
|
|
1300
|
+
S("span", {
|
|
1301
|
+
ref_key: "triggerRef",
|
|
1302
|
+
ref: r,
|
|
1303
|
+
class: "vf-tooltip__trigger",
|
|
1304
|
+
"aria-describedby": t.value ? c(a) : void 0
|
|
1305
|
+
}, [
|
|
1306
|
+
k(l.$slots, "default")
|
|
1307
|
+
], 8, Dt),
|
|
1308
|
+
(m(), Y(Z, { to: "body" }, [
|
|
1309
|
+
t.value && (e.text || l.$slots.content) ? (m(), h("span", {
|
|
1310
|
+
key: 0,
|
|
1311
|
+
id: c(a),
|
|
1312
|
+
ref_key: "contentRef",
|
|
1313
|
+
ref: u,
|
|
1314
|
+
class: K(T.value),
|
|
1315
|
+
style: j(c(f)),
|
|
1316
|
+
role: "tooltip"
|
|
1317
|
+
}, [
|
|
1318
|
+
k(l.$slots, "content", {}, () => [
|
|
1319
|
+
he(R(e.text), 1)
|
|
1320
|
+
]),
|
|
1321
|
+
S("span", {
|
|
1322
|
+
ref_key: "arrowRef",
|
|
1323
|
+
ref: v,
|
|
1324
|
+
class: K(_.value),
|
|
1325
|
+
style: j(I.value),
|
|
1326
|
+
"aria-hidden": "true"
|
|
1327
|
+
}, null, 6)
|
|
1328
|
+
], 14, Pt)) : E("", !0)
|
|
1329
|
+
]))
|
|
1330
|
+
], 32));
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
export {
|
|
1334
|
+
Kt as VfAccordion,
|
|
1335
|
+
Gt as VfAlert,
|
|
1336
|
+
Wt as VfBadge,
|
|
1337
|
+
jt as VfButton,
|
|
1338
|
+
Ut as VfCard,
|
|
1339
|
+
Nt as VfDialog,
|
|
1340
|
+
Yt as VfDivider,
|
|
1341
|
+
Xt as VfDropdown,
|
|
1342
|
+
it as VfIconButton,
|
|
1343
|
+
qt as VfInput,
|
|
1344
|
+
Qt as VfLink,
|
|
1345
|
+
Zt as VfPanel,
|
|
1346
|
+
Jt as VfPopover,
|
|
1347
|
+
to as VfTabs,
|
|
1348
|
+
eo as VfTag,
|
|
1349
|
+
oo as VfTextarea,
|
|
1350
|
+
Ht as VfThemeProvider,
|
|
1351
|
+
no as VfTooltip,
|
|
1352
|
+
Mt as VueForge,
|
|
1353
|
+
Ft as createThemePreset,
|
|
1354
|
+
We as createVueForge,
|
|
1355
|
+
Mt as default,
|
|
1356
|
+
De as defaultThemePreset,
|
|
1357
|
+
ke as useClickOutside,
|
|
1358
|
+
J as useDisclosure,
|
|
1359
|
+
le as useEscapeKey,
|
|
1360
|
+
se as useFloating,
|
|
1361
|
+
Ne as useFocusTrap,
|
|
1362
|
+
H as useId,
|
|
1363
|
+
Rt as useTheme
|
|
1364
|
+
};
|