@vanduo-oss/vue 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/components/VdAccordion.vue.d.ts +29 -0
- package/dist/components/VdAlert.vue.d.ts +27 -0
- package/dist/components/VdAvatar.vue.d.ts +23 -0
- package/dist/components/VdBadge.vue.d.ts +21 -0
- package/dist/components/VdButton.vue.d.ts +32 -0
- package/dist/components/VdButtonGroup.vue.d.ts +23 -0
- package/dist/components/VdCard.vue.d.ts +24 -0
- package/dist/components/VdCheckboxGroup.vue.d.ts +24 -0
- package/dist/components/VdChip.vue.d.ts +36 -0
- package/dist/components/VdCodeSnippet.vue.d.ts +11 -0
- package/dist/components/VdCollection.vue.d.ts +23 -0
- package/dist/components/VdCustomSelect.vue.d.ts +23 -0
- package/dist/components/VdFlow.vue.d.ts +28 -0
- package/dist/components/VdIcon.vue.d.ts +11 -0
- package/dist/components/VdInput.vue.d.ts +43 -0
- package/dist/components/VdModal.vue.d.ts +33 -0
- package/dist/components/VdOffcanvas.vue.d.ts +33 -0
- package/dist/components/VdPagination.vue.d.ts +29 -0
- package/dist/components/VdPreloader.vue.d.ts +17 -0
- package/dist/components/VdProgress.vue.d.ts +14 -0
- package/dist/components/VdRadioGroup.vue.d.ts +24 -0
- package/dist/components/VdRating.vue.d.ts +21 -0
- package/dist/components/VdSelect.vue.d.ts +27 -0
- package/dist/components/VdSidenav.vue.d.ts +35 -0
- package/dist/components/VdSkeleton.vue.d.ts +16 -0
- package/dist/components/VdSpinner.vue.d.ts +11 -0
- package/dist/components/VdTable.vue.d.ts +22 -0
- package/dist/components/VdTabs.vue.d.ts +25 -0
- package/dist/components/VdToast.vue.d.ts +11 -0
- package/dist/components/VdToastContainer.vue.d.ts +3 -0
- package/dist/components/VdTooltip.vue.d.ts +20 -0
- package/dist/components/VdTransfer.vue.d.ts +27 -0
- package/dist/components/VdTree.vue.d.ts +26 -0
- package/dist/components/VdTreeNode.vue.d.ts +22 -0
- package/dist/components/primitives/VdBox.vue.d.ts +22 -0
- package/dist/components/primitives/VdCenter.vue.d.ts +25 -0
- package/dist/components/primitives/VdCover.vue.d.ts +25 -0
- package/dist/components/primitives/VdFrame.vue.d.ts +20 -0
- package/dist/components/primitives/VdInline.vue.d.ts +20 -0
- package/dist/components/primitives/VdStack.vue.d.ts +22 -0
- package/dist/components/primitives/VdSwitcher.vue.d.ts +24 -0
- package/dist/composables/useAffix.d.ts +2 -0
- package/dist/composables/useDatepicker.d.ts +2 -0
- package/dist/composables/useDraggable.d.ts +9 -0
- package/dist/composables/useDropdown.d.ts +20 -0
- package/dist/composables/useExpandingCards.d.ts +10 -0
- package/dist/composables/useFlow.d.ts +13 -0
- package/dist/composables/useFocusTrap.d.ts +6 -0
- package/dist/composables/useGlass.d.ts +8 -0
- package/dist/composables/useImageBox.d.ts +9 -0
- package/dist/composables/useKeyboardNav.d.ts +10 -0
- package/dist/composables/useMorph.d.ts +10 -0
- package/dist/composables/useMorphBadges.d.ts +9 -0
- package/dist/composables/useNavbarGlassScroll.d.ts +7 -0
- package/dist/composables/useParallax.d.ts +9 -0
- package/dist/composables/usePopover.d.ts +9 -0
- package/dist/composables/useRipple.d.ts +9 -0
- package/dist/composables/useScrollspy.d.ts +7 -0
- package/dist/composables/useSearch.d.ts +13 -0
- package/dist/composables/useSidenav.d.ts +14 -0
- package/dist/composables/useSpotlight.d.ts +9 -0
- package/dist/composables/useStepper.d.ts +19 -0
- package/dist/composables/useSuggest.d.ts +2 -0
- package/dist/composables/useTabs.d.ts +7 -0
- package/dist/composables/useTheme.d.ts +36 -0
- package/dist/composables/useTimeline.d.ts +9 -0
- package/dist/composables/useTimepicker.d.ts +2 -0
- package/dist/composables/useToast.d.ts +127 -0
- package/dist/composables/useTooltips.d.ts +11 -0
- package/dist/composables/useValidate.d.ts +9 -0
- package/dist/composables/useWaypoint.d.ts +18 -0
- package/dist/config/themeDefaults.d.ts +10 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.js +3254 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +8 -0
- package/dist/utils/sanitizeHtml.d.ts +19 -0
- package/dist/vanduo-vue.css +2 -0
- package/package.json +66 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3254 @@
|
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createStaticVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, nextTick as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, onUnmounted as g, openBlock as _, reactive as v, ref as y, renderList as b, renderSlot as x, resolveComponent as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, vModelText as E, vShow as D, watch as O, withCtx as k, withDirectives as A, withModifiers as j } from "vue";
|
|
2
|
+
import { defineStore as M } from "pinia";
|
|
3
|
+
import { DEFAULTS as ee, FONT_OPTIONS as N, NEUTRAL_COLORS as P, PALETTE_OPTIONS as te, PRIMARY_COLORS as ne, RADIUS_OPTIONS as re, THEME_MODES as F } from "@vanduo-oss/core";
|
|
4
|
+
//#region src/plugin.ts
|
|
5
|
+
var I = null;
|
|
6
|
+
function ie() {
|
|
7
|
+
return typeof window > "u" ? Promise.resolve() : (I ||= import("@vanduo-oss/framework/iife"), I);
|
|
8
|
+
}
|
|
9
|
+
var ae = { install(e) {
|
|
10
|
+
ie();
|
|
11
|
+
} }, oe = { class: "vd-accordion" }, se = [
|
|
12
|
+
"aria-expanded",
|
|
13
|
+
"aria-controls",
|
|
14
|
+
"onClick"
|
|
15
|
+
], ce = {
|
|
16
|
+
class: "vd-accordion-icon",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}, le = ["id"], ue = /* @__PURE__ */ u({
|
|
19
|
+
__name: "VdAccordion",
|
|
20
|
+
props: {
|
|
21
|
+
items: {},
|
|
22
|
+
modelValue: {},
|
|
23
|
+
exclusive: { type: Boolean }
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:modelValue"],
|
|
26
|
+
setup(t, { emit: n }) {
|
|
27
|
+
let r = t, i = n, s = (e) => r.exclusive ? r.modelValue === e : Array.isArray(r.modelValue) && r.modelValue.includes(e), l = (e) => {
|
|
28
|
+
if (r.exclusive) {
|
|
29
|
+
i("update:modelValue", r.modelValue === e ? "" : e);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
let t = Array.isArray(r.modelValue) ? [...r.modelValue] : [], n = t.indexOf(e);
|
|
33
|
+
n >= 0 ? t.splice(n, 1) : t.push(e), i("update:modelValue", t);
|
|
34
|
+
};
|
|
35
|
+
return (n, r) => (_(), a("ul", oe, [(_(!0), a(e, null, b(t.items, (e) => (_(), a("li", {
|
|
36
|
+
key: e.id,
|
|
37
|
+
class: f(["vd-accordion-item", s(e.id) ? "is-open" : null])
|
|
38
|
+
}, [o("button", {
|
|
39
|
+
type: "button",
|
|
40
|
+
class: "vd-accordion-header",
|
|
41
|
+
"aria-expanded": s(e.id),
|
|
42
|
+
"aria-controls": `vd-accordion-panel-${e.id}`,
|
|
43
|
+
onClick: (t) => l(e.id)
|
|
44
|
+
}, [o("span", null, w(e.title), 1), o("span", ce, w(s(e.id) ? "−" : "+"), 1)], 8, se), A(o("div", {
|
|
45
|
+
id: `vd-accordion-panel-${e.id}`,
|
|
46
|
+
class: "vd-accordion-panel",
|
|
47
|
+
role: "region"
|
|
48
|
+
}, [x(n.$slots, e.id, { item: e }, () => [c(w(e.content), 1)])], 8, le), [[D, s(e.id)]])], 2))), 128))]));
|
|
49
|
+
}
|
|
50
|
+
}), L = /* @__PURE__ */ u({
|
|
51
|
+
__name: "VdIcon",
|
|
52
|
+
props: {
|
|
53
|
+
name: {},
|
|
54
|
+
filled: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
57
|
+
},
|
|
58
|
+
size: { default: "md" }
|
|
59
|
+
},
|
|
60
|
+
setup(e) {
|
|
61
|
+
let t = e, n = () => {
|
|
62
|
+
switch (t.size) {
|
|
63
|
+
case "sm": return "vd-text-base";
|
|
64
|
+
case "lg": return "vd-text-2xl";
|
|
65
|
+
default: return "vd-text-xl";
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return (e, r) => (_(), a("i", {
|
|
69
|
+
class: f([
|
|
70
|
+
t.filled ? "ph-fill" : "ph",
|
|
71
|
+
`ph-${t.name}`,
|
|
72
|
+
n()
|
|
73
|
+
]),
|
|
74
|
+
"aria-hidden": "true"
|
|
75
|
+
}, null, 2));
|
|
76
|
+
}
|
|
77
|
+
}), de = { class: "vd-alert-body" }, fe = {
|
|
78
|
+
key: 0,
|
|
79
|
+
class: "vd-alert-title"
|
|
80
|
+
}, pe = { class: "vd-alert-content" }, me = /* @__PURE__ */ u({
|
|
81
|
+
__name: "VdAlert",
|
|
82
|
+
props: {
|
|
83
|
+
variant: { default: "info" },
|
|
84
|
+
dismissible: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: !1
|
|
87
|
+
},
|
|
88
|
+
title: { default: "" }
|
|
89
|
+
},
|
|
90
|
+
emits: ["dismiss"],
|
|
91
|
+
setup(e, { emit: t }) {
|
|
92
|
+
let n = e, r = t, s = () => {
|
|
93
|
+
r("dismiss");
|
|
94
|
+
}, c = () => {
|
|
95
|
+
switch (n.variant) {
|
|
96
|
+
case "success": return "check-circle";
|
|
97
|
+
case "warning": return "warning";
|
|
98
|
+
case "danger": return "x-circle";
|
|
99
|
+
default: return "info";
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
return (t, n) => (_(), a("div", {
|
|
103
|
+
class: f(["vd-alert", `vd-alert-${e.variant}`]),
|
|
104
|
+
role: "alert"
|
|
105
|
+
}, [
|
|
106
|
+
l(L, {
|
|
107
|
+
name: c(),
|
|
108
|
+
class: "vd-alert-icon"
|
|
109
|
+
}, null, 8, ["name"]),
|
|
110
|
+
o("div", de, [e.title ? (_(), a("p", fe, w(e.title), 1)) : i("", !0), o("div", pe, [x(t.$slots, "default")])]),
|
|
111
|
+
e.dismissible ? (_(), a("button", {
|
|
112
|
+
key: 0,
|
|
113
|
+
type: "button",
|
|
114
|
+
class: "vd-alert-dismiss",
|
|
115
|
+
"aria-label": "Dismiss",
|
|
116
|
+
onClick: s
|
|
117
|
+
}, [l(L, { name: "x" })])) : i("", !0)
|
|
118
|
+
], 2));
|
|
119
|
+
}
|
|
120
|
+
}), he = ["aria-label"], ge = ["src", "alt"], _e = {
|
|
121
|
+
key: 1,
|
|
122
|
+
class: "vd-avatar-initials"
|
|
123
|
+
}, ve = {
|
|
124
|
+
key: 2,
|
|
125
|
+
class: "vd-avatar-initials",
|
|
126
|
+
"aria-hidden": "true"
|
|
127
|
+
}, ye = ["aria-label"], be = /* @__PURE__ */ u({
|
|
128
|
+
__name: "VdAvatar",
|
|
129
|
+
props: {
|
|
130
|
+
src: { default: "" },
|
|
131
|
+
alt: { default: "" },
|
|
132
|
+
initials: { default: "" },
|
|
133
|
+
size: { default: "md" },
|
|
134
|
+
variant: { default: "primary" },
|
|
135
|
+
shape: { default: "circle" },
|
|
136
|
+
status: { default: void 0 }
|
|
137
|
+
},
|
|
138
|
+
setup(e) {
|
|
139
|
+
return (t, n) => (_(), a("div", {
|
|
140
|
+
class: f(["vd-avatar", [
|
|
141
|
+
`vd-avatar-${e.size}`,
|
|
142
|
+
`vd-avatar-${e.variant}`,
|
|
143
|
+
`vd-avatar-${e.shape}`
|
|
144
|
+
]]),
|
|
145
|
+
"aria-label": e.alt || e.initials || "Avatar"
|
|
146
|
+
}, [e.src ? (_(), a("img", {
|
|
147
|
+
key: 0,
|
|
148
|
+
src: e.src,
|
|
149
|
+
alt: e.alt,
|
|
150
|
+
class: "vd-avatar-img"
|
|
151
|
+
}, null, 8, ge)) : e.initials ? (_(), a("span", _e, w(e.initials), 1)) : (_(), a("span", ve, " ? ")), e.status ? (_(), a("span", {
|
|
152
|
+
key: 3,
|
|
153
|
+
class: f(["vd-avatar-status", `vd-avatar-status-${e.status}`]),
|
|
154
|
+
"aria-label": `Status: ${e.status}`
|
|
155
|
+
}, null, 10, ye)) : i("", !0)], 10, he));
|
|
156
|
+
}
|
|
157
|
+
}), xe = /* @__PURE__ */ u({
|
|
158
|
+
__name: "VdBadge",
|
|
159
|
+
props: {
|
|
160
|
+
variant: { default: "default" },
|
|
161
|
+
pill: {
|
|
162
|
+
type: Boolean,
|
|
163
|
+
default: !1
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
setup(e) {
|
|
167
|
+
return (t, n) => (_(), a("span", { class: f(["vd-badge", [e.variant === "default" ? null : `vd-badge-${e.variant}`, e.pill ? "vd-badge-pill" : null]]) }, [x(t.$slots, "default")], 2));
|
|
168
|
+
}
|
|
169
|
+
}), Se = ["type", "disabled"], Ce = {
|
|
170
|
+
key: 0,
|
|
171
|
+
class: "vd-btn-spinner",
|
|
172
|
+
"aria-hidden": "true"
|
|
173
|
+
}, we = /* @__PURE__ */ u({
|
|
174
|
+
__name: "VdButton",
|
|
175
|
+
props: {
|
|
176
|
+
variant: { default: "primary" },
|
|
177
|
+
size: { default: "md" },
|
|
178
|
+
loading: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
default: !1
|
|
181
|
+
},
|
|
182
|
+
disabled: {
|
|
183
|
+
type: Boolean,
|
|
184
|
+
default: !1
|
|
185
|
+
},
|
|
186
|
+
type: { default: "button" }
|
|
187
|
+
},
|
|
188
|
+
emits: ["click"],
|
|
189
|
+
setup(e, { emit: t }) {
|
|
190
|
+
let n = e, r = t, o = (e) => {
|
|
191
|
+
if (n.disabled || n.loading) {
|
|
192
|
+
e.preventDefault();
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
r("click", e);
|
|
196
|
+
};
|
|
197
|
+
return (t, n) => (_(), a("button", {
|
|
198
|
+
type: e.type,
|
|
199
|
+
disabled: e.disabled || e.loading,
|
|
200
|
+
class: f([
|
|
201
|
+
"vd-btn",
|
|
202
|
+
`vd-btn-${e.variant}`,
|
|
203
|
+
e.size === "md" ? null : `vd-btn-${e.size}`,
|
|
204
|
+
e.loading ? "is-loading" : null
|
|
205
|
+
]),
|
|
206
|
+
onClick: o
|
|
207
|
+
}, [e.loading ? (_(), a("span", Ce)) : i("", !0), x(t.$slots, "default")], 10, Se));
|
|
208
|
+
}
|
|
209
|
+
}), Te = /* @__PURE__ */ u({
|
|
210
|
+
__name: "VdButtonGroup",
|
|
211
|
+
props: {
|
|
212
|
+
size: { default: "md" },
|
|
213
|
+
vertical: {
|
|
214
|
+
type: Boolean,
|
|
215
|
+
default: !1
|
|
216
|
+
},
|
|
217
|
+
fullWidth: {
|
|
218
|
+
type: Boolean,
|
|
219
|
+
default: !1
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
setup(e) {
|
|
223
|
+
return (t, n) => (_(), a("div", {
|
|
224
|
+
class: f(["vd-btn-group", [`vd-btn-group-${e.size}`, {
|
|
225
|
+
"vd-btn-group-vertical": e.vertical,
|
|
226
|
+
"vd-btn-group-full": e.fullWidth
|
|
227
|
+
}]]),
|
|
228
|
+
role: "group"
|
|
229
|
+
}, [x(t.$slots, "default")], 2));
|
|
230
|
+
}
|
|
231
|
+
}), Ee = {
|
|
232
|
+
key: 0,
|
|
233
|
+
class: "vd-card-header"
|
|
234
|
+
}, De = { class: "vd-card-body" }, Oe = {
|
|
235
|
+
key: 1,
|
|
236
|
+
class: "vd-card-footer"
|
|
237
|
+
}, ke = /* @__PURE__ */ u({
|
|
238
|
+
__name: "VdCard",
|
|
239
|
+
props: {
|
|
240
|
+
elevated: {
|
|
241
|
+
type: Boolean,
|
|
242
|
+
default: !1
|
|
243
|
+
},
|
|
244
|
+
interactive: {
|
|
245
|
+
type: Boolean,
|
|
246
|
+
default: !1
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
setup(e) {
|
|
250
|
+
return (t, n) => (_(), a("section", { class: f(["vd-card", [e.elevated ? "vd-card-elevated" : null, e.interactive ? "vd-card-interactive" : null]]) }, [
|
|
251
|
+
t.$slots.header ? (_(), a("header", Ee, [x(t.$slots, "header")])) : i("", !0),
|
|
252
|
+
o("div", De, [x(t.$slots, "default")]),
|
|
253
|
+
t.$slots.footer ? (_(), a("footer", Oe, [x(t.$slots, "footer")])) : i("", !0)
|
|
254
|
+
], 2));
|
|
255
|
+
}
|
|
256
|
+
}), Ae = [
|
|
257
|
+
"id",
|
|
258
|
+
"name",
|
|
259
|
+
"value",
|
|
260
|
+
"checked",
|
|
261
|
+
"disabled",
|
|
262
|
+
"onChange"
|
|
263
|
+
], je = ["for"], Me = /* @__PURE__ */ u({
|
|
264
|
+
__name: "VdCheckboxGroup",
|
|
265
|
+
props: {
|
|
266
|
+
options: {},
|
|
267
|
+
modelValue: {},
|
|
268
|
+
name: {},
|
|
269
|
+
inline: {
|
|
270
|
+
type: Boolean,
|
|
271
|
+
default: !1
|
|
272
|
+
},
|
|
273
|
+
size: { default: "md" },
|
|
274
|
+
disabled: {
|
|
275
|
+
type: Boolean,
|
|
276
|
+
default: !1
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
emits: ["update:modelValue"],
|
|
280
|
+
setup(t, { emit: n }) {
|
|
281
|
+
let r = n, i = (e, t) => e.includes(t), s = (e, t) => {
|
|
282
|
+
let n = [...e], r = n.indexOf(t);
|
|
283
|
+
return r === -1 ? n.push(t) : n.splice(r, 1), n;
|
|
284
|
+
}, c = (e, t) => {
|
|
285
|
+
r("update:modelValue", s(e.modelValue, t));
|
|
286
|
+
};
|
|
287
|
+
return (n, r) => (_(), a("div", {
|
|
288
|
+
class: f(["vd-form-check-group", { "vd-form-check-group-inline": t.inline }]),
|
|
289
|
+
role: "group"
|
|
290
|
+
}, [(_(!0), a(e, null, b(t.options, (e) => (_(), a("div", {
|
|
291
|
+
key: e.value,
|
|
292
|
+
class: f(["vd-form-check", [`vd-form-check-${t.size}`, { "vd-form-check-inline": t.inline }]])
|
|
293
|
+
}, [o("input", {
|
|
294
|
+
id: `${t.name}-${e.value}`,
|
|
295
|
+
type: "checkbox",
|
|
296
|
+
name: t.name,
|
|
297
|
+
value: e.value,
|
|
298
|
+
checked: i(t.modelValue, e.value),
|
|
299
|
+
disabled: t.disabled || e.disabled,
|
|
300
|
+
class: "vd-form-check-input",
|
|
301
|
+
onChange: (t) => c(n.$props, e.value)
|
|
302
|
+
}, null, 40, Ae), o("label", {
|
|
303
|
+
for: `${t.name}-${e.value}`,
|
|
304
|
+
class: "vd-form-check-label"
|
|
305
|
+
}, w(e.label), 9, je)], 2))), 128))], 2));
|
|
306
|
+
}
|
|
307
|
+
}), Ne = ["src"], Pe = /* @__PURE__ */ u({
|
|
308
|
+
__name: "VdChip",
|
|
309
|
+
props: {
|
|
310
|
+
variant: { default: "primary" },
|
|
311
|
+
size: { default: "md" },
|
|
312
|
+
outline: {
|
|
313
|
+
type: Boolean,
|
|
314
|
+
default: !1
|
|
315
|
+
},
|
|
316
|
+
dismissible: {
|
|
317
|
+
type: Boolean,
|
|
318
|
+
default: !1
|
|
319
|
+
},
|
|
320
|
+
avatar: { default: "" },
|
|
321
|
+
clickable: {
|
|
322
|
+
type: Boolean,
|
|
323
|
+
default: !1
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
emits: ["dismiss", "click"],
|
|
327
|
+
setup(e, { emit: t }) {
|
|
328
|
+
let n = t, r = (e) => {
|
|
329
|
+
e.stopPropagation(), n("dismiss");
|
|
330
|
+
};
|
|
331
|
+
return (t, o) => (_(), a("span", {
|
|
332
|
+
class: f(["vd-chip", [
|
|
333
|
+
`vd-chip-${e.variant}`,
|
|
334
|
+
`vd-chip-${e.size}`,
|
|
335
|
+
{
|
|
336
|
+
"vd-chip-outline": e.outline,
|
|
337
|
+
"vd-chip-dismissible": e.dismissible,
|
|
338
|
+
"vd-chip-clickable": e.clickable
|
|
339
|
+
}
|
|
340
|
+
]]),
|
|
341
|
+
role: "status",
|
|
342
|
+
onClick: o[0] ||= (t) => e.clickable && n("click", t)
|
|
343
|
+
}, [
|
|
344
|
+
e.avatar ? (_(), a("img", {
|
|
345
|
+
key: 0,
|
|
346
|
+
src: e.avatar,
|
|
347
|
+
class: "vd-chip-avatar",
|
|
348
|
+
alt: ""
|
|
349
|
+
}, null, 8, Ne)) : i("", !0),
|
|
350
|
+
x(t.$slots, "default"),
|
|
351
|
+
e.dismissible ? (_(), a("button", {
|
|
352
|
+
key: 1,
|
|
353
|
+
type: "button",
|
|
354
|
+
class: "vd-chip-close",
|
|
355
|
+
"aria-label": "Dismiss",
|
|
356
|
+
onClick: r
|
|
357
|
+
}, " × ")) : i("", !0)
|
|
358
|
+
], 2));
|
|
359
|
+
}
|
|
360
|
+
}), Fe = { class: "vd-code-snippet" }, Ie = ["data-language"], Le = ["aria-label"], Re = /* @__PURE__ */ u({
|
|
361
|
+
__name: "VdCodeSnippet",
|
|
362
|
+
props: {
|
|
363
|
+
code: {},
|
|
364
|
+
language: { default: "html" },
|
|
365
|
+
copyable: {
|
|
366
|
+
type: Boolean,
|
|
367
|
+
default: !0
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
setup(e) {
|
|
371
|
+
let t = y(!1), n = async (e) => {
|
|
372
|
+
if (!(typeof navigator > "u" || !navigator.clipboard)) try {
|
|
373
|
+
await navigator.clipboard.writeText(e), t.value = !0, setTimeout(() => {
|
|
374
|
+
t.value = !1;
|
|
375
|
+
}, 1500);
|
|
376
|
+
} catch {}
|
|
377
|
+
};
|
|
378
|
+
return (r, s) => (_(), a("figure", Fe, [o("pre", {
|
|
379
|
+
class: f(["vd-code-snippet-pre", `language-${e.language}`]),
|
|
380
|
+
"data-language": e.language
|
|
381
|
+
}, [o("code", null, w(e.code), 1)], 10, Ie), e.copyable ? (_(), a("button", {
|
|
382
|
+
key: 0,
|
|
383
|
+
type: "button",
|
|
384
|
+
class: "vd-btn vd-btn-ghost vd-btn-sm vd-code-snippet-copy",
|
|
385
|
+
"aria-label": t.value ? "Copied" : "Copy code",
|
|
386
|
+
onClick: s[0] ||= (t) => n(e.code)
|
|
387
|
+
}, [l(L, { name: t.value ? "check" : "copy" }, null, 8, ["name"]), o("span", null, w(t.value ? "Copied" : "Copy"), 1)], 8, Le)) : i("", !0)]));
|
|
388
|
+
}
|
|
389
|
+
}), ze = {
|
|
390
|
+
key: 0,
|
|
391
|
+
class: "vd-collection-header"
|
|
392
|
+
}, Be = { class: "vd-collection-title" }, Ve = { class: "vd-collection-list" }, He = {
|
|
393
|
+
key: 0,
|
|
394
|
+
class: "vd-collection-avatar"
|
|
395
|
+
}, Ue = ["src", "alt"], We = { class: "vd-collection-content" }, Ge = { class: "vd-collection-text" }, Ke = { class: "vd-collection-title" }, qe = {
|
|
396
|
+
key: 0,
|
|
397
|
+
class: "vd-collection-text-secondary"
|
|
398
|
+
}, Je = {
|
|
399
|
+
key: 1,
|
|
400
|
+
class: "vd-collection-action"
|
|
401
|
+
}, Ye = /* @__PURE__ */ u({
|
|
402
|
+
__name: "VdCollection",
|
|
403
|
+
props: {
|
|
404
|
+
items: {},
|
|
405
|
+
header: { default: "" },
|
|
406
|
+
hoverable: {
|
|
407
|
+
type: Boolean,
|
|
408
|
+
default: !1
|
|
409
|
+
},
|
|
410
|
+
bordered: {
|
|
411
|
+
type: Boolean,
|
|
412
|
+
default: !1
|
|
413
|
+
},
|
|
414
|
+
size: { default: "md" }
|
|
415
|
+
},
|
|
416
|
+
setup(t) {
|
|
417
|
+
return (n, r) => (_(), a("div", { class: f(["vd-collection", [`vd-collection-${t.size}`, {
|
|
418
|
+
"vd-collection-hoverable": t.hoverable,
|
|
419
|
+
"vd-collection-bordered": t.bordered
|
|
420
|
+
}]]) }, [t.header ? (_(), a("div", ze, [o("h3", Be, w(t.header), 1)])) : i("", !0), o("ul", Ve, [(_(!0), a(e, null, b(t.items, (e) => (_(), a("li", {
|
|
421
|
+
key: e.id,
|
|
422
|
+
class: "vd-collection-item"
|
|
423
|
+
}, [
|
|
424
|
+
e.avatar ? (_(), a("div", He, [o("img", {
|
|
425
|
+
src: e.avatar,
|
|
426
|
+
alt: e.subtitle || e.title
|
|
427
|
+
}, null, 8, Ue)])) : i("", !0),
|
|
428
|
+
o("div", We, [o("div", Ge, [o("strong", Ke, w(e.title), 1), e.subtitle ? (_(), a("span", qe, w(e.subtitle), 1)) : i("", !0)])]),
|
|
429
|
+
e.action ? (_(), a("div", Je, w(e.action), 1)) : i("", !0)
|
|
430
|
+
]))), 128))])], 2));
|
|
431
|
+
}
|
|
432
|
+
}), Xe = [
|
|
433
|
+
"id",
|
|
434
|
+
"name",
|
|
435
|
+
"value"
|
|
436
|
+
], Ze = ["value", "disabled"], Qe = ["aria-expanded", "aria-labelledby"], $e = [
|
|
437
|
+
"data-value",
|
|
438
|
+
"aria-selected",
|
|
439
|
+
"aria-disabled",
|
|
440
|
+
"onClick",
|
|
441
|
+
"onMouseenter"
|
|
442
|
+
], et = /* @__PURE__ */ u({
|
|
443
|
+
__name: "VdCustomSelect",
|
|
444
|
+
props: {
|
|
445
|
+
modelValue: {},
|
|
446
|
+
options: {},
|
|
447
|
+
id: { default: "" },
|
|
448
|
+
name: { default: "" },
|
|
449
|
+
placeholder: { default: "Select..." }
|
|
450
|
+
},
|
|
451
|
+
emits: ["update:modelValue"],
|
|
452
|
+
setup(t, { emit: r }) {
|
|
453
|
+
let i = t, s = r, c = y(!1), l = y(-1), u = y(null), d = n(() => i.id || i.name || "custom-select"), p = n(() => i.options.flatMap((e, t) => e.disabled ? [] : [t])), g = n(() => {
|
|
454
|
+
let e = i.options.find((e) => e.value === i.modelValue);
|
|
455
|
+
return e ? e.label : i.placeholder;
|
|
456
|
+
}), v = () => {
|
|
457
|
+
c.value = !0;
|
|
458
|
+
let e = i.options.findIndex((e) => e.value === i.modelValue);
|
|
459
|
+
l.value = e >= 0 && !i.options[e]?.disabled ? e : p.value[0] ?? -1;
|
|
460
|
+
}, x = () => {
|
|
461
|
+
c.value = !1;
|
|
462
|
+
}, S = () => {
|
|
463
|
+
c.value ? x() : v();
|
|
464
|
+
}, C = (e) => {
|
|
465
|
+
e.disabled || (s("update:modelValue", e.value), x());
|
|
466
|
+
}, T = (e) => {
|
|
467
|
+
let t = p.value;
|
|
468
|
+
if (t.length === 0) return;
|
|
469
|
+
let n = t.indexOf(l.value);
|
|
470
|
+
l.value = t[n < 0 ? 0 : (n + e + t.length) % t.length] ?? -1;
|
|
471
|
+
}, E = "", D = null, O = (e) => {
|
|
472
|
+
switch (e.key) {
|
|
473
|
+
case "Enter":
|
|
474
|
+
case " ":
|
|
475
|
+
if (e.preventDefault(), c.value && l.value >= 0) {
|
|
476
|
+
let e = i.options[l.value];
|
|
477
|
+
e && C(e);
|
|
478
|
+
} else v();
|
|
479
|
+
break;
|
|
480
|
+
case "Escape":
|
|
481
|
+
c.value && (e.preventDefault(), x());
|
|
482
|
+
break;
|
|
483
|
+
case "ArrowDown":
|
|
484
|
+
e.preventDefault(), c.value ? T(1) : v();
|
|
485
|
+
break;
|
|
486
|
+
case "ArrowUp":
|
|
487
|
+
e.preventDefault(), c.value && T(-1);
|
|
488
|
+
break;
|
|
489
|
+
case "Home":
|
|
490
|
+
c.value && (e.preventDefault(), l.value = p.value[0] ?? -1);
|
|
491
|
+
break;
|
|
492
|
+
case "End":
|
|
493
|
+
if (c.value) {
|
|
494
|
+
e.preventDefault();
|
|
495
|
+
let t = p.value;
|
|
496
|
+
l.value = t[t.length - 1] ?? -1;
|
|
497
|
+
}
|
|
498
|
+
break;
|
|
499
|
+
default: if (c.value && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
500
|
+
D != null && window.clearTimeout(D), E += e.key.toLowerCase();
|
|
501
|
+
let t = i.options.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(E));
|
|
502
|
+
t >= 0 && (l.value = t), D = window.setTimeout(() => {
|
|
503
|
+
E = "";
|
|
504
|
+
}, 500);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}, k = (e) => {
|
|
508
|
+
c.value && u.value && !u.value.contains(e.target) && x();
|
|
509
|
+
};
|
|
510
|
+
return h(() => document.addEventListener("click", k)), m(() => {
|
|
511
|
+
document.removeEventListener("click", k), D != null && window.clearTimeout(D);
|
|
512
|
+
}), (n, r) => (_(), a("div", {
|
|
513
|
+
ref_key: "wrapper",
|
|
514
|
+
ref: u,
|
|
515
|
+
class: "custom-select-wrapper"
|
|
516
|
+
}, [
|
|
517
|
+
o("select", {
|
|
518
|
+
id: t.id || void 0,
|
|
519
|
+
name: t.name || void 0,
|
|
520
|
+
value: t.modelValue,
|
|
521
|
+
tabindex: "-1",
|
|
522
|
+
"aria-hidden": "true"
|
|
523
|
+
}, [(_(!0), a(e, null, b(t.options, (e) => (_(), a("option", {
|
|
524
|
+
key: e.value,
|
|
525
|
+
value: e.value,
|
|
526
|
+
disabled: e.disabled
|
|
527
|
+
}, w(e.label), 9, Ze))), 128))], 8, Xe),
|
|
528
|
+
o("button", {
|
|
529
|
+
type: "button",
|
|
530
|
+
class: "custom-select-button",
|
|
531
|
+
"aria-haspopup": "listbox",
|
|
532
|
+
"aria-expanded": c.value ? "true" : "false",
|
|
533
|
+
"aria-labelledby": d.value,
|
|
534
|
+
onClick: j(S, ["stop"]),
|
|
535
|
+
onKeydown: O
|
|
536
|
+
}, w(g.value), 41, Qe),
|
|
537
|
+
o("div", {
|
|
538
|
+
class: f(["custom-select-dropdown", { "is-open": c.value }]),
|
|
539
|
+
role: "listbox"
|
|
540
|
+
}, [(_(!0), a(e, null, b(t.options, (e, n) => (_(), a("div", {
|
|
541
|
+
key: e.value,
|
|
542
|
+
class: f(["custom-select-option", {
|
|
543
|
+
"is-selected": e.value === t.modelValue,
|
|
544
|
+
"is-disabled": e.disabled,
|
|
545
|
+
"is-active": n === l.value
|
|
546
|
+
}]),
|
|
547
|
+
role: "option",
|
|
548
|
+
"data-value": e.value,
|
|
549
|
+
"aria-selected": e.value === t.modelValue ? "true" : "false",
|
|
550
|
+
"aria-disabled": e.disabled ? "true" : void 0,
|
|
551
|
+
onClick: (t) => C(e),
|
|
552
|
+
onMouseenter: (e) => l.value = n
|
|
553
|
+
}, w(e.label), 43, $e))), 128))], 2)
|
|
554
|
+
], 512));
|
|
555
|
+
}
|
|
556
|
+
}), tt = {
|
|
557
|
+
class: "vd-flow",
|
|
558
|
+
role: "region",
|
|
559
|
+
"aria-roledescription": "carousel"
|
|
560
|
+
}, nt = ["aria-hidden"], rt = {
|
|
561
|
+
key: 0,
|
|
562
|
+
class: "vd-flow-controls"
|
|
563
|
+
}, it = ["disabled"], at = { class: "vd-flow-position" }, ot = ["disabled"], st = /* @__PURE__ */ u({
|
|
564
|
+
__name: "VdFlow",
|
|
565
|
+
props: {
|
|
566
|
+
modelValue: {},
|
|
567
|
+
total: {}
|
|
568
|
+
},
|
|
569
|
+
emits: ["update:modelValue"],
|
|
570
|
+
setup(t, { expose: r, emit: s }) {
|
|
571
|
+
let c = t, l = s, u = y(c.modelValue), d = (e) => {
|
|
572
|
+
let t = Math.max(0, Math.min(c.total - 1, e));
|
|
573
|
+
t !== u.value && (u.value = t, l("update:modelValue", t));
|
|
574
|
+
}, f = () => d(u.value - 1), m = () => d(u.value + 1);
|
|
575
|
+
r({
|
|
576
|
+
go: d,
|
|
577
|
+
prev: f,
|
|
578
|
+
next: m,
|
|
579
|
+
index: u
|
|
580
|
+
});
|
|
581
|
+
let h = n(() => Array.from({ length: c.total }, (e, t) => t));
|
|
582
|
+
return (n, r) => (_(), a("div", tt, [o("div", {
|
|
583
|
+
class: "vd-flow-track",
|
|
584
|
+
style: p({ transform: `translateX(-${u.value * 100}%)` })
|
|
585
|
+
}, [(_(!0), a(e, null, b(h.value, (e) => (_(), a("div", {
|
|
586
|
+
key: e,
|
|
587
|
+
class: "vd-flow-slide",
|
|
588
|
+
"aria-hidden": e !== u.value
|
|
589
|
+
}, [x(n.$slots, `slide-${e}`, { index: e })], 8, nt))), 128))], 4), t.total > 1 ? (_(), a("div", rt, [
|
|
590
|
+
o("button", {
|
|
591
|
+
type: "button",
|
|
592
|
+
class: "vd-btn vd-btn-ghost vd-btn-icon",
|
|
593
|
+
"aria-label": "Previous slide",
|
|
594
|
+
disabled: u.value === 0,
|
|
595
|
+
onClick: f
|
|
596
|
+
}, " ‹ ", 8, it),
|
|
597
|
+
o("span", at, w(u.value + 1) + " / " + w(t.total), 1),
|
|
598
|
+
o("button", {
|
|
599
|
+
type: "button",
|
|
600
|
+
class: "vd-btn vd-btn-ghost vd-btn-icon",
|
|
601
|
+
"aria-label": "Next slide",
|
|
602
|
+
disabled: u.value === t.total - 1,
|
|
603
|
+
onClick: m
|
|
604
|
+
}, " › ", 8, ot)
|
|
605
|
+
])) : i("", !0)]));
|
|
606
|
+
}
|
|
607
|
+
}), ct = [
|
|
608
|
+
"id",
|
|
609
|
+
"type",
|
|
610
|
+
"name",
|
|
611
|
+
"value",
|
|
612
|
+
"placeholder",
|
|
613
|
+
"disabled",
|
|
614
|
+
"readonly",
|
|
615
|
+
"required",
|
|
616
|
+
"minlength",
|
|
617
|
+
"maxlength",
|
|
618
|
+
"pattern",
|
|
619
|
+
"autocomplete"
|
|
620
|
+
], lt = /* @__PURE__ */ u({
|
|
621
|
+
__name: "VdInput",
|
|
622
|
+
props: {
|
|
623
|
+
modelValue: {},
|
|
624
|
+
type: { default: "text" },
|
|
625
|
+
placeholder: { default: "" },
|
|
626
|
+
size: { default: "md" },
|
|
627
|
+
variant: { default: "default" },
|
|
628
|
+
disabled: {
|
|
629
|
+
type: Boolean,
|
|
630
|
+
default: !1
|
|
631
|
+
},
|
|
632
|
+
readonly: {
|
|
633
|
+
type: Boolean,
|
|
634
|
+
default: !1
|
|
635
|
+
},
|
|
636
|
+
required: {
|
|
637
|
+
type: Boolean,
|
|
638
|
+
default: !1
|
|
639
|
+
},
|
|
640
|
+
name: { default: "" },
|
|
641
|
+
id: { default: "" },
|
|
642
|
+
minlength: { default: void 0 },
|
|
643
|
+
maxlength: { default: void 0 },
|
|
644
|
+
pattern: { default: "" },
|
|
645
|
+
autocomplete: { default: "" }
|
|
646
|
+
},
|
|
647
|
+
emits: [
|
|
648
|
+
"update:modelValue",
|
|
649
|
+
"blur",
|
|
650
|
+
"focus"
|
|
651
|
+
],
|
|
652
|
+
setup(e, { emit: t }) {
|
|
653
|
+
let n = e, r = t, i = (e) => {
|
|
654
|
+
let t = e.target;
|
|
655
|
+
r("update:modelValue", t.value);
|
|
656
|
+
};
|
|
657
|
+
return n.minlength, n.maxlength, (t, n) => (_(), a("input", {
|
|
658
|
+
id: e.id || e.name,
|
|
659
|
+
type: e.type,
|
|
660
|
+
name: e.name,
|
|
661
|
+
value: e.modelValue,
|
|
662
|
+
placeholder: e.placeholder,
|
|
663
|
+
disabled: e.disabled,
|
|
664
|
+
readonly: e.readonly,
|
|
665
|
+
required: e.required,
|
|
666
|
+
minlength: e.minlength,
|
|
667
|
+
maxlength: e.maxlength,
|
|
668
|
+
pattern: e.pattern,
|
|
669
|
+
autocomplete: e.autocomplete,
|
|
670
|
+
class: f(["vd-input", [`vd-input-${e.size}`, e.variant === "default" ? null : `vd-input-${e.variant}`]]),
|
|
671
|
+
onInput: i,
|
|
672
|
+
onBlur: n[0] ||= (e) => r("blur", e),
|
|
673
|
+
onFocus: n[1] ||= (e) => r("focus", e)
|
|
674
|
+
}, null, 42, ct));
|
|
675
|
+
}
|
|
676
|
+
}), ut = ["aria-label"], dt = {
|
|
677
|
+
key: 0,
|
|
678
|
+
class: "vd-modal-header"
|
|
679
|
+
}, ft = {
|
|
680
|
+
key: 0,
|
|
681
|
+
class: "vd-modal-title"
|
|
682
|
+
}, pt = { class: "vd-modal-body" }, mt = {
|
|
683
|
+
key: 1,
|
|
684
|
+
class: "vd-modal-footer"
|
|
685
|
+
}, ht = /* @__PURE__ */ u({
|
|
686
|
+
__name: "VdModal",
|
|
687
|
+
props: {
|
|
688
|
+
open: { type: Boolean },
|
|
689
|
+
title: { default: "" },
|
|
690
|
+
size: { default: "md" },
|
|
691
|
+
closeOnBackdrop: {
|
|
692
|
+
type: Boolean,
|
|
693
|
+
default: !0
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
emits: ["update:open", "close"],
|
|
697
|
+
setup(e, { emit: s }) {
|
|
698
|
+
let c = e, u = s, p = y(null), m = n(() => `vd-modal-panel-${c.size}`), h = () => {
|
|
699
|
+
u("update:open", !1), u("close");
|
|
700
|
+
}, g = () => {
|
|
701
|
+
c.closeOnBackdrop && h();
|
|
702
|
+
}, v = (e) => {
|
|
703
|
+
c.open && e.key === "Escape" && (e.preventDefault(), h());
|
|
704
|
+
};
|
|
705
|
+
return O(() => c.open, async (e) => {
|
|
706
|
+
typeof window > "u" || (e ? (window.addEventListener("keydown", v), await d(), p.value?.focus()) : window.removeEventListener("keydown", v));
|
|
707
|
+
}, { immediate: !0 }), (n, s) => (_(), r(t, { to: "body" }, [e.open ? (_(), a("div", {
|
|
708
|
+
key: 0,
|
|
709
|
+
class: "vd-modal vd-modal-open",
|
|
710
|
+
role: "dialog",
|
|
711
|
+
"aria-modal": "true",
|
|
712
|
+
"aria-label": e.title || "Dialog",
|
|
713
|
+
"data-vd-modal": ""
|
|
714
|
+
}, [o("div", {
|
|
715
|
+
class: "vd-modal-backdrop",
|
|
716
|
+
onClick: g
|
|
717
|
+
}), o("div", {
|
|
718
|
+
ref_key: "panel",
|
|
719
|
+
ref: p,
|
|
720
|
+
class: f(["vd-modal-panel", m.value]),
|
|
721
|
+
tabindex: "-1"
|
|
722
|
+
}, [
|
|
723
|
+
e.title || n.$slots.header ? (_(), a("header", dt, [
|
|
724
|
+
e.title ? (_(), a("h2", ft, w(e.title), 1)) : i("", !0),
|
|
725
|
+
x(n.$slots, "header"),
|
|
726
|
+
o("button", {
|
|
727
|
+
type: "button",
|
|
728
|
+
class: "vd-btn vd-btn-ghost vd-btn-icon",
|
|
729
|
+
"aria-label": "Close",
|
|
730
|
+
onClick: h
|
|
731
|
+
}, [l(L, { name: "x" })])
|
|
732
|
+
])) : i("", !0),
|
|
733
|
+
o("div", pt, [x(n.$slots, "default")]),
|
|
734
|
+
n.$slots.footer ? (_(), a("footer", mt, [x(n.$slots, "footer")])) : i("", !0)
|
|
735
|
+
], 2)], 8, ut)) : i("", !0)]));
|
|
736
|
+
}
|
|
737
|
+
}), gt = ["aria-label"], _t = {
|
|
738
|
+
key: 0,
|
|
739
|
+
class: "vd-sidenav-header"
|
|
740
|
+
}, vt = {
|
|
741
|
+
key: 0,
|
|
742
|
+
class: "vd-sidenav-title"
|
|
743
|
+
}, yt = { class: "vd-sidenav-body" }, bt = /* @__PURE__ */ u({
|
|
744
|
+
__name: "VdOffcanvas",
|
|
745
|
+
props: {
|
|
746
|
+
modelValue: { type: Boolean },
|
|
747
|
+
placement: { default: "right" },
|
|
748
|
+
title: { default: "" },
|
|
749
|
+
closeOnBackdrop: {
|
|
750
|
+
type: Boolean,
|
|
751
|
+
default: !0
|
|
752
|
+
},
|
|
753
|
+
closeOnEsc: {
|
|
754
|
+
type: Boolean,
|
|
755
|
+
default: !0
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
emits: ["update:modelValue", "close"],
|
|
759
|
+
setup(e, { emit: n }) {
|
|
760
|
+
let s = e, c = n, l = () => {
|
|
761
|
+
c("update:modelValue", !1), c("close");
|
|
762
|
+
}, u = () => {
|
|
763
|
+
s.closeOnBackdrop && l();
|
|
764
|
+
}, d = (e) => {
|
|
765
|
+
s.modelValue && e.key === "Escape" && s.closeOnEsc && (e.preventDefault(), l());
|
|
766
|
+
};
|
|
767
|
+
return h(() => {
|
|
768
|
+
typeof window > "u" || window.addEventListener("keydown", d);
|
|
769
|
+
}), m(() => {
|
|
770
|
+
typeof window > "u" || window.removeEventListener("keydown", d);
|
|
771
|
+
}), O(() => s.modelValue, (e) => {
|
|
772
|
+
typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "");
|
|
773
|
+
}), (n, s) => (_(), r(t, { to: "body" }, [e.modelValue ? (_(), a("div", {
|
|
774
|
+
key: 0,
|
|
775
|
+
class: "vd-sidenav-overlay is-visible",
|
|
776
|
+
onClick: u
|
|
777
|
+
})) : i("", !0), e.modelValue ? (_(), a("aside", {
|
|
778
|
+
key: 1,
|
|
779
|
+
class: f(["vd-offcanvas", [`vd-offcanvas-${e.placement}`, "is-open"]]),
|
|
780
|
+
"aria-label": e.title || "Off-canvas panel"
|
|
781
|
+
}, [e.title || n.$slots.header ? (_(), a("header", _t, [
|
|
782
|
+
e.title ? (_(), a("h3", vt, w(e.title), 1)) : i("", !0),
|
|
783
|
+
x(n.$slots, "header"),
|
|
784
|
+
o("button", {
|
|
785
|
+
type: "button",
|
|
786
|
+
class: "vd-sidenav-close",
|
|
787
|
+
"aria-label": "Close",
|
|
788
|
+
onClick: l
|
|
789
|
+
}, " × ")
|
|
790
|
+
])) : i("", !0), o("div", yt, [x(n.$slots, "default")])], 10, gt)) : i("", !0)]));
|
|
791
|
+
}
|
|
792
|
+
}), xt = {
|
|
793
|
+
key: 0,
|
|
794
|
+
class: "vd-pagination-item"
|
|
795
|
+
}, St = ["data-page"], Ct = [
|
|
796
|
+
"aria-label",
|
|
797
|
+
"aria-current",
|
|
798
|
+
"onClick"
|
|
799
|
+
], wt = /* @__PURE__ */ u({
|
|
800
|
+
__name: "VdPagination",
|
|
801
|
+
props: {
|
|
802
|
+
modelValue: {},
|
|
803
|
+
total: {},
|
|
804
|
+
maxVisible: { default: 7 },
|
|
805
|
+
size: { default: "md" },
|
|
806
|
+
align: { default: "left" },
|
|
807
|
+
disabled: {
|
|
808
|
+
type: Boolean,
|
|
809
|
+
default: !1
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
emits: ["update:modelValue"],
|
|
813
|
+
setup(t, { emit: r }) {
|
|
814
|
+
let i = t, s = r, c = y(null), l = (e, t, n) => {
|
|
815
|
+
let r = [], i = Math.floor(n / 2);
|
|
816
|
+
if (t <= n) {
|
|
817
|
+
for (let e = 1; e <= t; e++) r.push(e);
|
|
818
|
+
return r;
|
|
819
|
+
}
|
|
820
|
+
r.push(1);
|
|
821
|
+
let a = Math.max(2, e - i), o = Math.min(t - 1, e + i);
|
|
822
|
+
e <= i + 1 && (o = Math.min(t - 1, n - 1)), e >= t - i && (a = Math.max(2, t - n + 2)), a > 2 && r.push("ellipsis");
|
|
823
|
+
for (let e = a; e <= o; e++) r.push(e);
|
|
824
|
+
return o < t - 1 && r.push("ellipsis"), t > 1 && r.push(t), r;
|
|
825
|
+
}, u = n(() => l(i.modelValue, i.total, i.maxVisible)), d = (e) => {
|
|
826
|
+
i.disabled || e < 1 || e > i.total || e === i.modelValue || (s("update:modelValue", e), c.value?.dispatchEvent(new CustomEvent("pagination:change", {
|
|
827
|
+
bubbles: !0,
|
|
828
|
+
detail: {
|
|
829
|
+
page: e,
|
|
830
|
+
totalPages: i.total
|
|
831
|
+
}
|
|
832
|
+
})));
|
|
833
|
+
};
|
|
834
|
+
return (n, r) => (_(), a("nav", {
|
|
835
|
+
ref_key: "root",
|
|
836
|
+
ref: c,
|
|
837
|
+
"aria-label": "Pagination"
|
|
838
|
+
}, [o("ul", { class: f(["vd-pagination", [`vd-pagination-${t.size}`, `vd-pagination-${t.align}`]]) }, [
|
|
839
|
+
o("li", { class: f(["vd-pagination-item vd-pagination-prev", { disabled: t.disabled || t.modelValue <= 1 }]) }, [o("a", {
|
|
840
|
+
class: "vd-pagination-link",
|
|
841
|
+
href: "#",
|
|
842
|
+
"aria-label": "Previous",
|
|
843
|
+
onClick: r[0] ||= j((e) => d(t.modelValue - 1), ["prevent"])
|
|
844
|
+
}, "Previous")], 2),
|
|
845
|
+
(_(!0), a(e, null, b(u.value, (n, i) => (_(), a(e, { key: i }, [n === "ellipsis" ? (_(), a("li", xt, [...r[2] ||= [o("span", {
|
|
846
|
+
class: "vd-pagination-ellipsis",
|
|
847
|
+
"aria-hidden": "true"
|
|
848
|
+
}, "…", -1)]])) : (_(), a("li", {
|
|
849
|
+
key: 1,
|
|
850
|
+
class: f(["vd-pagination-item", { active: n === t.modelValue }]),
|
|
851
|
+
"data-page": n
|
|
852
|
+
}, [o("a", {
|
|
853
|
+
class: "vd-pagination-link",
|
|
854
|
+
href: "#",
|
|
855
|
+
"aria-label": `Page ${n}`,
|
|
856
|
+
"aria-current": n === t.modelValue ? "page" : void 0,
|
|
857
|
+
onClick: j((e) => d(n), ["prevent"])
|
|
858
|
+
}, w(n), 9, Ct)], 10, St))], 64))), 128)),
|
|
859
|
+
o("li", { class: f(["vd-pagination-item vd-pagination-next", { disabled: t.disabled || t.modelValue >= t.total }]) }, [o("a", {
|
|
860
|
+
class: "vd-pagination-link",
|
|
861
|
+
href: "#",
|
|
862
|
+
"aria-label": "Next",
|
|
863
|
+
onClick: r[1] ||= j((e) => d(t.modelValue + 1), ["prevent"])
|
|
864
|
+
}, "Next")], 2)
|
|
865
|
+
], 2)], 512));
|
|
866
|
+
}
|
|
867
|
+
}), Tt = {
|
|
868
|
+
key: 0,
|
|
869
|
+
class: "vd-preloader-text"
|
|
870
|
+
}, Et = /* @__PURE__ */ u({
|
|
871
|
+
__name: "VdPreloader",
|
|
872
|
+
props: {
|
|
873
|
+
variant: { default: "primary" },
|
|
874
|
+
size: { default: "md" },
|
|
875
|
+
theme: { default: "light" },
|
|
876
|
+
text: { default: "" }
|
|
877
|
+
},
|
|
878
|
+
setup(e) {
|
|
879
|
+
return (t, n) => (_(), a("div", {
|
|
880
|
+
class: f(["vd-preloader-container", [`vd-preloader-${e.theme}`]]),
|
|
881
|
+
role: "status",
|
|
882
|
+
"aria-live": "polite"
|
|
883
|
+
}, [o("div", { class: f(["vd-preloader", [`vd-preloader-${e.variant}`, `vd-preloader-${e.size}`]]) }, [...n[0] ||= [o("div", { class: "vd-preloader-spinner" }, null, -1)]], 2), e.text ? (_(), a("span", Tt, w(e.text), 1)) : i("", !0)], 2));
|
|
884
|
+
}
|
|
885
|
+
}), Dt = [
|
|
886
|
+
"aria-valuemax",
|
|
887
|
+
"aria-valuenow",
|
|
888
|
+
"aria-label"
|
|
889
|
+
], Ot = { class: "vd-progress-track" }, kt = {
|
|
890
|
+
key: 0,
|
|
891
|
+
class: "vd-progress-label vd-text-sm vd-muted"
|
|
892
|
+
}, At = /* @__PURE__ */ u({
|
|
893
|
+
__name: "VdProgress",
|
|
894
|
+
props: {
|
|
895
|
+
value: { default: 0 },
|
|
896
|
+
max: { default: 100 },
|
|
897
|
+
indeterminate: {
|
|
898
|
+
type: Boolean,
|
|
899
|
+
default: !1
|
|
900
|
+
},
|
|
901
|
+
label: { default: "" }
|
|
902
|
+
},
|
|
903
|
+
setup(e) {
|
|
904
|
+
let t = e, n = () => {
|
|
905
|
+
if (t.indeterminate) return 0;
|
|
906
|
+
let e = t.max || 100;
|
|
907
|
+
return Math.max(0, Math.min(100, t.value / e * 100));
|
|
908
|
+
};
|
|
909
|
+
return (t, r) => (_(), a("div", {
|
|
910
|
+
class: f(["vd-progress", [e.indeterminate ? "is-indeterminate" : null]]),
|
|
911
|
+
role: "progressbar",
|
|
912
|
+
"aria-valuemin": 0,
|
|
913
|
+
"aria-valuemax": e.max,
|
|
914
|
+
"aria-valuenow": e.indeterminate ? void 0 : e.value,
|
|
915
|
+
"aria-label": e.label || "Progress"
|
|
916
|
+
}, [o("div", Ot, [o("div", {
|
|
917
|
+
class: "vd-progress-fill",
|
|
918
|
+
style: p(e.indeterminate ? void 0 : { width: `${n()}%` })
|
|
919
|
+
}, null, 4)]), !e.indeterminate && e.label ? (_(), a("span", kt, w(e.label) + " — " + w(Math.round(n())) + "% ", 1)) : i("", !0)], 10, Dt));
|
|
920
|
+
}
|
|
921
|
+
}), jt = [
|
|
922
|
+
"id",
|
|
923
|
+
"name",
|
|
924
|
+
"value",
|
|
925
|
+
"checked",
|
|
926
|
+
"disabled",
|
|
927
|
+
"onChange"
|
|
928
|
+
], Mt = ["for"], Nt = /* @__PURE__ */ u({
|
|
929
|
+
__name: "VdRadioGroup",
|
|
930
|
+
props: {
|
|
931
|
+
options: {},
|
|
932
|
+
modelValue: {},
|
|
933
|
+
name: {},
|
|
934
|
+
inline: {
|
|
935
|
+
type: Boolean,
|
|
936
|
+
default: !1
|
|
937
|
+
},
|
|
938
|
+
size: { default: "md" },
|
|
939
|
+
disabled: {
|
|
940
|
+
type: Boolean,
|
|
941
|
+
default: !1
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
emits: ["update:modelValue"],
|
|
945
|
+
setup(t, { emit: n }) {
|
|
946
|
+
let r = n;
|
|
947
|
+
return (n, i) => (_(), a("div", {
|
|
948
|
+
class: f(["vd-form-radio-group", { "vd-form-radio-group-inline": t.inline }]),
|
|
949
|
+
role: "radiogroup"
|
|
950
|
+
}, [(_(!0), a(e, null, b(t.options, (e) => (_(), a("div", {
|
|
951
|
+
key: e.value,
|
|
952
|
+
class: f(["vd-form-radio", [`vd-form-radio-${t.size}`, { "vd-form-radio-inline": t.inline }]])
|
|
953
|
+
}, [o("input", {
|
|
954
|
+
id: `${t.name}-${e.value}`,
|
|
955
|
+
type: "radio",
|
|
956
|
+
name: t.name,
|
|
957
|
+
value: e.value,
|
|
958
|
+
checked: t.modelValue === e.value,
|
|
959
|
+
disabled: t.disabled || e.disabled,
|
|
960
|
+
class: "vd-form-radio-input",
|
|
961
|
+
onChange: (t) => r("update:modelValue", e.value)
|
|
962
|
+
}, null, 40, jt), o("label", {
|
|
963
|
+
for: `${t.name}-${e.value}`,
|
|
964
|
+
class: "vd-form-radio-label"
|
|
965
|
+
}, w(e.label), 9, Mt)], 2))), 128))], 2));
|
|
966
|
+
}
|
|
967
|
+
}), Pt = [
|
|
968
|
+
"aria-checked",
|
|
969
|
+
"aria-label",
|
|
970
|
+
"tabindex",
|
|
971
|
+
"onMouseenter",
|
|
972
|
+
"onClick"
|
|
973
|
+
], Ft = { class: "vd-rating-value" }, It = /* @__PURE__ */ u({
|
|
974
|
+
__name: "VdRating",
|
|
975
|
+
props: {
|
|
976
|
+
modelValue: {},
|
|
977
|
+
max: { default: 5 },
|
|
978
|
+
size: { default: void 0 },
|
|
979
|
+
readonly: {
|
|
980
|
+
type: Boolean,
|
|
981
|
+
default: !1
|
|
982
|
+
},
|
|
983
|
+
name: { default: "" }
|
|
984
|
+
},
|
|
985
|
+
emits: ["update:modelValue", "change"],
|
|
986
|
+
setup(t, { emit: r }) {
|
|
987
|
+
let i = t, s = r, c = y(i.modelValue), l = y(-1);
|
|
988
|
+
O(() => i.modelValue, (e) => {
|
|
989
|
+
c.value = e;
|
|
990
|
+
});
|
|
991
|
+
let u = n(() => Array.from({ length: i.max }, (e, t) => t + 1)), d = (e) => ({
|
|
992
|
+
"is-active": e <= Math.floor(c.value),
|
|
993
|
+
"is-half": e > Math.floor(c.value) && e - .5 <= c.value,
|
|
994
|
+
"is-hovered": l.value >= 0 && e <= l.value
|
|
995
|
+
}), p = (e) => {
|
|
996
|
+
i.readonly || (c.value = e, s("update:modelValue", e), s("change", e));
|
|
997
|
+
}, m = (e) => {
|
|
998
|
+
i.readonly || ((e.key === "ArrowRight" || e.key === "ArrowUp") && c.value < i.max ? (e.preventDefault(), p(c.value + 1)) : (e.key === "ArrowLeft" || e.key === "ArrowDown") && c.value > 1 && (e.preventDefault(), p(c.value - 1)));
|
|
999
|
+
};
|
|
1000
|
+
return (n, r) => (_(), a("div", {
|
|
1001
|
+
class: f(["vd-rating", [t.size ? `vd-rating-${t.size}` : null, { "vd-rating-readonly": t.readonly }]]),
|
|
1002
|
+
role: "radiogroup",
|
|
1003
|
+
"aria-label": "Rating",
|
|
1004
|
+
onKeydown: m,
|
|
1005
|
+
onMouseleave: r[0] ||= (e) => l.value = -1
|
|
1006
|
+
}, [(_(!0), a(e, null, b(u.value, (e) => (_(), a("button", {
|
|
1007
|
+
key: e,
|
|
1008
|
+
type: "button",
|
|
1009
|
+
class: f(["vd-rating-star", d(e)]),
|
|
1010
|
+
role: "radio",
|
|
1011
|
+
"aria-checked": e <= c.value ? "true" : "false",
|
|
1012
|
+
"aria-label": `${e} star${e > 1 ? "s" : ""}`,
|
|
1013
|
+
tabindex: t.readonly ? -1 : 0,
|
|
1014
|
+
onMouseenter: (n) => t.readonly ? null : l.value = e,
|
|
1015
|
+
onClick: (t) => p(e)
|
|
1016
|
+
}, null, 42, Pt))), 128)), o("span", Ft, w(c.value > 0 ? c.value : ""), 1)], 34));
|
|
1017
|
+
}
|
|
1018
|
+
}), Lt = [
|
|
1019
|
+
"id",
|
|
1020
|
+
"name",
|
|
1021
|
+
"value",
|
|
1022
|
+
"disabled",
|
|
1023
|
+
"required"
|
|
1024
|
+
], Rt = {
|
|
1025
|
+
key: 0,
|
|
1026
|
+
value: "",
|
|
1027
|
+
disabled: ""
|
|
1028
|
+
}, zt = ["value", "disabled"], Bt = { class: "vd-visually-hidden" }, Vt = /* @__PURE__ */ u({
|
|
1029
|
+
__name: "VdSelect",
|
|
1030
|
+
props: {
|
|
1031
|
+
modelValue: {},
|
|
1032
|
+
options: {},
|
|
1033
|
+
name: { default: "" },
|
|
1034
|
+
id: { default: "" },
|
|
1035
|
+
placeholder: { default: "" },
|
|
1036
|
+
disabled: {
|
|
1037
|
+
type: Boolean,
|
|
1038
|
+
default: !1
|
|
1039
|
+
},
|
|
1040
|
+
required: {
|
|
1041
|
+
type: Boolean,
|
|
1042
|
+
default: !1
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
emits: ["update:modelValue"],
|
|
1046
|
+
setup(t, { emit: r }) {
|
|
1047
|
+
let s = t, c = r, l = y(s.modelValue);
|
|
1048
|
+
O(() => s.modelValue, (e) => {
|
|
1049
|
+
l.value = e;
|
|
1050
|
+
});
|
|
1051
|
+
let u = n(() => s.options.find((e) => e.value === l.value)?.label ?? "");
|
|
1052
|
+
return (n, r) => (_(), a(e, null, [o("select", {
|
|
1053
|
+
id: t.id || t.name,
|
|
1054
|
+
name: t.name,
|
|
1055
|
+
value: l.value,
|
|
1056
|
+
disabled: t.disabled,
|
|
1057
|
+
required: t.required,
|
|
1058
|
+
class: "vd-input",
|
|
1059
|
+
onChange: r[0] ||= (e) => {
|
|
1060
|
+
let t = e.target.value;
|
|
1061
|
+
l.value = t, c("update:modelValue", t);
|
|
1062
|
+
}
|
|
1063
|
+
}, [t.placeholder ? (_(), a("option", Rt, w(t.placeholder), 1)) : i("", !0), (_(!0), a(e, null, b(t.options, (e) => (_(), a("option", {
|
|
1064
|
+
key: e.value,
|
|
1065
|
+
value: e.value,
|
|
1066
|
+
disabled: e.disabled
|
|
1067
|
+
}, w(e.label), 9, zt))), 128))], 40, Lt), o("span", Bt, w(u.value), 1)], 64));
|
|
1068
|
+
}
|
|
1069
|
+
}), Ht = ["aria-label"], Ut = {
|
|
1070
|
+
key: 0,
|
|
1071
|
+
class: "vd-sidenav-header"
|
|
1072
|
+
}, Wt = {
|
|
1073
|
+
key: 0,
|
|
1074
|
+
class: "vd-sidenav-title"
|
|
1075
|
+
}, Gt = { class: "vd-sidenav-body" }, Kt = {
|
|
1076
|
+
key: 1,
|
|
1077
|
+
class: "vd-sidenav-footer"
|
|
1078
|
+
}, qt = /* @__PURE__ */ u({
|
|
1079
|
+
__name: "VdSidenav",
|
|
1080
|
+
props: {
|
|
1081
|
+
modelValue: { type: Boolean },
|
|
1082
|
+
placement: { default: "left" },
|
|
1083
|
+
title: { default: "" },
|
|
1084
|
+
closeOnBackdrop: {
|
|
1085
|
+
type: Boolean,
|
|
1086
|
+
default: !0
|
|
1087
|
+
},
|
|
1088
|
+
closeOnEsc: {
|
|
1089
|
+
type: Boolean,
|
|
1090
|
+
default: !0
|
|
1091
|
+
}
|
|
1092
|
+
},
|
|
1093
|
+
emits: ["update:modelValue", "close"],
|
|
1094
|
+
setup(e, { emit: n }) {
|
|
1095
|
+
let s = e, c = n, l = () => {
|
|
1096
|
+
c("update:modelValue", !1), c("close");
|
|
1097
|
+
}, u = () => {
|
|
1098
|
+
s.closeOnBackdrop && l();
|
|
1099
|
+
}, d = (e) => {
|
|
1100
|
+
s.modelValue && e.key === "Escape" && s.closeOnEsc && (e.preventDefault(), l());
|
|
1101
|
+
};
|
|
1102
|
+
return h(() => {
|
|
1103
|
+
typeof window > "u" || window.addEventListener("keydown", d);
|
|
1104
|
+
}), m(() => {
|
|
1105
|
+
typeof window > "u" || window.removeEventListener("keydown", d);
|
|
1106
|
+
}), O(() => s.modelValue, (e) => {
|
|
1107
|
+
typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "");
|
|
1108
|
+
}), (n, s) => (_(), r(t, { to: "body" }, [e.modelValue ? (_(), a("div", {
|
|
1109
|
+
key: 0,
|
|
1110
|
+
class: "vd-sidenav-overlay is-visible",
|
|
1111
|
+
onClick: u
|
|
1112
|
+
})) : i("", !0), e.modelValue ? (_(), a("aside", {
|
|
1113
|
+
key: 1,
|
|
1114
|
+
class: f(["vd-sidenav", [`vd-sidenav-${e.placement}`, "is-open"]]),
|
|
1115
|
+
"aria-label": e.title || "Side navigation"
|
|
1116
|
+
}, [
|
|
1117
|
+
e.title || n.$slots.header ? (_(), a("header", Ut, [
|
|
1118
|
+
e.title ? (_(), a("h3", Wt, w(e.title), 1)) : i("", !0),
|
|
1119
|
+
x(n.$slots, "header"),
|
|
1120
|
+
o("button", {
|
|
1121
|
+
type: "button",
|
|
1122
|
+
class: "vd-sidenav-close",
|
|
1123
|
+
"aria-label": "Close",
|
|
1124
|
+
onClick: l
|
|
1125
|
+
}, " × ")
|
|
1126
|
+
])) : i("", !0),
|
|
1127
|
+
o("div", Gt, [x(n.$slots, "default")]),
|
|
1128
|
+
n.$slots.footer ? (_(), a("footer", Kt, [x(n.$slots, "footer")])) : i("", !0)
|
|
1129
|
+
], 10, Ht)) : i("", !0)]));
|
|
1130
|
+
}
|
|
1131
|
+
}), Jt = {
|
|
1132
|
+
key: 3,
|
|
1133
|
+
class: "vd-skeleton-lines"
|
|
1134
|
+
}, Yt = /* @__PURE__ */ u({
|
|
1135
|
+
__name: "VdSkeleton",
|
|
1136
|
+
props: {
|
|
1137
|
+
shape: { default: "text" },
|
|
1138
|
+
size: { default: "md" },
|
|
1139
|
+
width: { default: "" },
|
|
1140
|
+
lines: { default: 1 }
|
|
1141
|
+
},
|
|
1142
|
+
setup(t) {
|
|
1143
|
+
return (n, r) => t.shape === "card" ? (_(), a("div", {
|
|
1144
|
+
key: 0,
|
|
1145
|
+
class: f(["vd-skeleton-card", `vd-skeleton-card-${t.size}`])
|
|
1146
|
+
}, [...r[0] ||= [s("<div class=\"vd-skeleton vd-skeleton-card-header\"></div><div class=\"vd-skeleton-card-body\"><div class=\"vd-skeleton vd-skeleton-text\"></div><div class=\"vd-skeleton vd-skeleton-text\"></div><div class=\"vd-skeleton vd-skeleton-text vd-skeleton-text-short\"></div></div>", 2)]], 2)) : t.shape === "button" ? (_(), a("div", {
|
|
1147
|
+
key: 1,
|
|
1148
|
+
class: f(["vd-skeleton vd-skeleton-button", `vd-skeleton-button-${t.size}`])
|
|
1149
|
+
}, null, 2)) : t.shape === "circle" ? (_(), a("div", {
|
|
1150
|
+
key: 2,
|
|
1151
|
+
class: f(["vd-skeleton vd-skeleton-circle", `vd-skeleton-circle-${t.size}`])
|
|
1152
|
+
}, null, 2)) : t.lines > 1 ? (_(), a("div", Jt, [(_(!0), a(e, null, b(t.lines, (e) => (_(), a("div", {
|
|
1153
|
+
key: e,
|
|
1154
|
+
class: f(["vd-skeleton vd-skeleton-text", e === t.lines ? "vd-skeleton-text-short" : ""])
|
|
1155
|
+
}, null, 2))), 128))])) : (_(), a("div", {
|
|
1156
|
+
key: 4,
|
|
1157
|
+
class: f(["vd-skeleton vd-skeleton-text", `vd-skeleton-text-${t.size}`]),
|
|
1158
|
+
style: p(t.width ? `width: ${t.width}` : "")
|
|
1159
|
+
}, null, 6));
|
|
1160
|
+
}
|
|
1161
|
+
}), Xt = ["aria-label"], Zt = /* @__PURE__ */ u({
|
|
1162
|
+
__name: "VdSpinner",
|
|
1163
|
+
props: {
|
|
1164
|
+
size: { default: "md" },
|
|
1165
|
+
label: { default: "" }
|
|
1166
|
+
},
|
|
1167
|
+
setup(e) {
|
|
1168
|
+
return (t, n) => (_(), a("span", {
|
|
1169
|
+
class: f(["vd-spinner", `vd-spinner-${e.size}`]),
|
|
1170
|
+
role: "status",
|
|
1171
|
+
"aria-label": e.label || "Loading"
|
|
1172
|
+
}, [l(L, { name: "circle-notch" })], 10, Xt));
|
|
1173
|
+
}
|
|
1174
|
+
}), Qt = { class: "vd-table-responsive" }, $t = {
|
|
1175
|
+
key: 0,
|
|
1176
|
+
class: "vd-table-caption"
|
|
1177
|
+
}, en = { class: "vd-table-header" }, tn = /* @__PURE__ */ u({
|
|
1178
|
+
__name: "VdTable",
|
|
1179
|
+
props: {
|
|
1180
|
+
columns: {},
|
|
1181
|
+
rows: {},
|
|
1182
|
+
striped: {
|
|
1183
|
+
type: Boolean,
|
|
1184
|
+
default: !1
|
|
1185
|
+
},
|
|
1186
|
+
bordered: {
|
|
1187
|
+
type: Boolean,
|
|
1188
|
+
default: !1
|
|
1189
|
+
},
|
|
1190
|
+
hover: {
|
|
1191
|
+
type: Boolean,
|
|
1192
|
+
default: !1
|
|
1193
|
+
},
|
|
1194
|
+
caption: { default: "" }
|
|
1195
|
+
},
|
|
1196
|
+
setup(t) {
|
|
1197
|
+
return (n, r) => (_(), a("div", Qt, [o("table", { class: f(["vd-table", {
|
|
1198
|
+
"vd-table-striped": t.striped,
|
|
1199
|
+
"vd-table-bordered": t.bordered,
|
|
1200
|
+
"vd-table-hover": t.hover
|
|
1201
|
+
}]) }, [
|
|
1202
|
+
t.caption ? (_(), a("caption", $t, w(t.caption), 1)) : i("", !0),
|
|
1203
|
+
o("thead", en, [o("tr", null, [(_(!0), a(e, null, b(t.columns, (e) => (_(), a("th", {
|
|
1204
|
+
key: e.key,
|
|
1205
|
+
scope: "col"
|
|
1206
|
+
}, w(e.label), 1))), 128))])]),
|
|
1207
|
+
o("tbody", null, [(_(!0), a(e, null, b(t.rows, (n, r) => (_(), a("tr", { key: r }, [(_(!0), a(e, null, b(t.columns, (e) => (_(), a("td", { key: e.key }, w(n[e.key]), 1))), 128))]))), 128))])
|
|
1208
|
+
], 2)]));
|
|
1209
|
+
}
|
|
1210
|
+
}), nn = {
|
|
1211
|
+
class: "vd-tabs",
|
|
1212
|
+
role: "tablist"
|
|
1213
|
+
}, rn = {
|
|
1214
|
+
class: "vd-tab-list",
|
|
1215
|
+
role: "presentation"
|
|
1216
|
+
}, an = ["aria-selected", "onClick"], on = { class: "vd-tab-panels" }, sn = /* @__PURE__ */ u({
|
|
1217
|
+
__name: "VdTabs",
|
|
1218
|
+
props: {
|
|
1219
|
+
tabs: {},
|
|
1220
|
+
modelValue: {}
|
|
1221
|
+
},
|
|
1222
|
+
emits: ["update:modelValue"],
|
|
1223
|
+
setup(t, { emit: n }) {
|
|
1224
|
+
let r = t, i = n, s = (e) => {
|
|
1225
|
+
e !== r.modelValue && i("update:modelValue", e);
|
|
1226
|
+
};
|
|
1227
|
+
return (n, r) => (_(), a("div", nn, [o("div", rn, [(_(!0), a(e, null, b(t.tabs, (e) => (_(), a("button", {
|
|
1228
|
+
key: e.id,
|
|
1229
|
+
type: "button",
|
|
1230
|
+
role: "tab",
|
|
1231
|
+
"aria-selected": e.id === t.modelValue,
|
|
1232
|
+
class: f(["vd-tab", e.id === t.modelValue ? "is-active" : null]),
|
|
1233
|
+
onClick: (t) => s(e.id)
|
|
1234
|
+
}, w(e.label), 11, an))), 128))]), o("div", on, [x(n.$slots, "default")])]));
|
|
1235
|
+
}
|
|
1236
|
+
}), cn = ["innerHTML"], ln = { class: "vd-toast-content" }, un = {
|
|
1237
|
+
key: 0,
|
|
1238
|
+
class: "vd-toast-title"
|
|
1239
|
+
}, dn = { class: "vd-toast-message" }, fn = /* @__PURE__ */ u({
|
|
1240
|
+
__name: "VdToast",
|
|
1241
|
+
props: { toast: {} },
|
|
1242
|
+
emits: ["dismiss"],
|
|
1243
|
+
setup(e, { emit: t }) {
|
|
1244
|
+
let n = e, r = t, s = {
|
|
1245
|
+
success: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"></path><polyline points=\"22 4 12 14.01 9 11.01\"></polyline></svg>",
|
|
1246
|
+
error: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>",
|
|
1247
|
+
warning: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"></path><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line></svg>",
|
|
1248
|
+
info: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"></line></svg>"
|
|
1249
|
+
}, c = y(!1), l = y(!1), u = y(!1), d = null, g = null, v = 0, b = n.toast.duration, x = () => {
|
|
1250
|
+
d != null && (window.clearTimeout(d), d = null);
|
|
1251
|
+
}, S = () => {
|
|
1252
|
+
u.value = !1, n.toast.duration > 0 && typeof window < "u" && (v = Date.now(), d = window.setTimeout(T, b));
|
|
1253
|
+
}, C = () => {
|
|
1254
|
+
d != null && (window.clearTimeout(d), d = null, b -= Date.now() - v, u.value = !0);
|
|
1255
|
+
}, T = () => {
|
|
1256
|
+
l.value || (x(), c.value = !1, l.value = !0, g = window.setTimeout(() => r("dismiss", n.toast.id), 400));
|
|
1257
|
+
}, E = () => {
|
|
1258
|
+
l.value && r("dismiss", n.toast.id);
|
|
1259
|
+
};
|
|
1260
|
+
return h(() => {
|
|
1261
|
+
requestAnimationFrame(() => {
|
|
1262
|
+
c.value = !0, S();
|
|
1263
|
+
});
|
|
1264
|
+
}), m(() => {
|
|
1265
|
+
x(), g != null && window.clearTimeout(g);
|
|
1266
|
+
}), (t, n) => (_(), a("div", {
|
|
1267
|
+
class: f([
|
|
1268
|
+
"vd-toast",
|
|
1269
|
+
e.toast.type ? `vd-toast-${e.toast.type}` : null,
|
|
1270
|
+
e.toast.solid ? "vd-toast-solid" : null,
|
|
1271
|
+
e.toast.showProgress && e.toast.duration > 0 ? "vd-toast-with-progress" : null,
|
|
1272
|
+
{
|
|
1273
|
+
"is-visible": c.value,
|
|
1274
|
+
"is-exiting": l.value
|
|
1275
|
+
}
|
|
1276
|
+
]),
|
|
1277
|
+
role: "status",
|
|
1278
|
+
"aria-live": "polite",
|
|
1279
|
+
onMouseenter: C,
|
|
1280
|
+
onMouseleave: S,
|
|
1281
|
+
onTransitionend: E
|
|
1282
|
+
}, [
|
|
1283
|
+
e.toast.type ? (_(), a("span", {
|
|
1284
|
+
key: 0,
|
|
1285
|
+
class: "vd-toast-icon",
|
|
1286
|
+
innerHTML: s[e.toast.type]
|
|
1287
|
+
}, null, 8, cn)) : i("", !0),
|
|
1288
|
+
o("div", ln, [e.toast.title ? (_(), a("div", un, w(e.toast.title), 1)) : i("", !0), o("div", dn, w(e.toast.message), 1)]),
|
|
1289
|
+
e.toast.dismissible ? (_(), a("button", {
|
|
1290
|
+
key: 1,
|
|
1291
|
+
type: "button",
|
|
1292
|
+
class: "vd-toast-close",
|
|
1293
|
+
"aria-label": "Close",
|
|
1294
|
+
onClick: T
|
|
1295
|
+
})) : i("", !0),
|
|
1296
|
+
e.toast.showProgress && e.toast.duration > 0 ? (_(), a("div", {
|
|
1297
|
+
key: 2,
|
|
1298
|
+
class: "vd-toast-progress",
|
|
1299
|
+
style: p({
|
|
1300
|
+
animationDuration: `${e.toast.duration}ms`,
|
|
1301
|
+
animationPlayState: u.value ? "paused" : "running"
|
|
1302
|
+
})
|
|
1303
|
+
}, null, 4)) : i("", !0)
|
|
1304
|
+
], 34));
|
|
1305
|
+
}
|
|
1306
|
+
}), R = {
|
|
1307
|
+
duration: 5e3,
|
|
1308
|
+
position: "top-right",
|
|
1309
|
+
dismissible: !0,
|
|
1310
|
+
showProgress: !0,
|
|
1311
|
+
solid: !1
|
|
1312
|
+
}, pn = 0, mn = () => (pn += 1, `toast-${Date.now().toString(36)}-${pn}`), z = M("toast", () => {
|
|
1313
|
+
let e = y([]), t = (t, n, r) => {
|
|
1314
|
+
let i;
|
|
1315
|
+
i = typeof t == "string" ? n && typeof n == "object" ? {
|
|
1316
|
+
...n,
|
|
1317
|
+
message: t
|
|
1318
|
+
} : {
|
|
1319
|
+
message: t,
|
|
1320
|
+
type: n,
|
|
1321
|
+
duration: r
|
|
1322
|
+
} : { ...t };
|
|
1323
|
+
let a = mn(), o = {
|
|
1324
|
+
id: a,
|
|
1325
|
+
message: i.message ?? "",
|
|
1326
|
+
title: i.title,
|
|
1327
|
+
type: i.type,
|
|
1328
|
+
duration: i.duration ?? R.duration,
|
|
1329
|
+
position: i.position ?? R.position,
|
|
1330
|
+
dismissible: i.dismissible ?? R.dismissible,
|
|
1331
|
+
showProgress: i.showProgress ?? R.showProgress,
|
|
1332
|
+
solid: i.solid ?? R.solid
|
|
1333
|
+
};
|
|
1334
|
+
return e.value.push(o), a;
|
|
1335
|
+
};
|
|
1336
|
+
return {
|
|
1337
|
+
queue: e,
|
|
1338
|
+
show: t,
|
|
1339
|
+
dismiss: (t) => {
|
|
1340
|
+
e.value = e.value.filter((e) => e.id !== t);
|
|
1341
|
+
},
|
|
1342
|
+
success: (e, n = {}) => t({
|
|
1343
|
+
...n,
|
|
1344
|
+
message: e,
|
|
1345
|
+
type: "success"
|
|
1346
|
+
}),
|
|
1347
|
+
error: (e, n = {}) => t({
|
|
1348
|
+
...n,
|
|
1349
|
+
message: e,
|
|
1350
|
+
type: "error"
|
|
1351
|
+
}),
|
|
1352
|
+
warning: (e, n = {}) => t({
|
|
1353
|
+
...n,
|
|
1354
|
+
message: e,
|
|
1355
|
+
type: "warning"
|
|
1356
|
+
}),
|
|
1357
|
+
info: (e, n = {}) => t({
|
|
1358
|
+
...n,
|
|
1359
|
+
message: e,
|
|
1360
|
+
type: "info"
|
|
1361
|
+
})
|
|
1362
|
+
};
|
|
1363
|
+
}), hn = () => {
|
|
1364
|
+
let e = z();
|
|
1365
|
+
return {
|
|
1366
|
+
show: e.show,
|
|
1367
|
+
dismiss: e.dismiss,
|
|
1368
|
+
success: e.success,
|
|
1369
|
+
error: e.error,
|
|
1370
|
+
warning: e.warning,
|
|
1371
|
+
info: e.info,
|
|
1372
|
+
queue: e.queue
|
|
1373
|
+
};
|
|
1374
|
+
}, gn = /* @__PURE__ */ u({
|
|
1375
|
+
__name: "VdToastContainer",
|
|
1376
|
+
setup(i) {
|
|
1377
|
+
let o = z(), s = [
|
|
1378
|
+
"top-right",
|
|
1379
|
+
"top-left",
|
|
1380
|
+
"top-center",
|
|
1381
|
+
"bottom-right",
|
|
1382
|
+
"bottom-left",
|
|
1383
|
+
"bottom-center"
|
|
1384
|
+
], c = n(() => s.map((e) => ({
|
|
1385
|
+
position: e,
|
|
1386
|
+
toasts: o.queue.filter((t) => t.position === e)
|
|
1387
|
+
})).filter((e) => e.toasts.length > 0));
|
|
1388
|
+
return (n, i) => (_(), r(t, { to: "body" }, [(_(!0), a(e, null, b(c.value, (t) => (_(), a("div", {
|
|
1389
|
+
key: t.position,
|
|
1390
|
+
class: f(["vd-toast-container", `vd-toast-container-${t.position}`]),
|
|
1391
|
+
role: "status",
|
|
1392
|
+
"aria-live": "polite",
|
|
1393
|
+
"aria-atomic": "false"
|
|
1394
|
+
}, [(_(!0), a(e, null, b(t.toasts, (e) => (_(), r(fn, {
|
|
1395
|
+
key: e.id,
|
|
1396
|
+
toast: e,
|
|
1397
|
+
onDismiss: T(o).dismiss
|
|
1398
|
+
}, null, 8, ["toast", "onDismiss"]))), 128))], 2))), 128))]));
|
|
1399
|
+
}
|
|
1400
|
+
}), _n = ["data-tooltip-position", "data-tooltip"], vn = /* @__PURE__ */ u({
|
|
1401
|
+
__name: "VdTooltip",
|
|
1402
|
+
props: {
|
|
1403
|
+
text: {},
|
|
1404
|
+
position: { default: "top" }
|
|
1405
|
+
},
|
|
1406
|
+
setup(e) {
|
|
1407
|
+
return (t, n) => (_(), a("span", {
|
|
1408
|
+
class: "vd-tooltip",
|
|
1409
|
+
"data-tooltip-position": e.position,
|
|
1410
|
+
"data-tooltip": e.text
|
|
1411
|
+
}, [x(t.$slots, "default")], 8, _n));
|
|
1412
|
+
}
|
|
1413
|
+
}), yn = { class: "vd-transfer-panel" }, bn = { class: "vd-transfer-header" }, xn = {
|
|
1414
|
+
class: "vd-transfer-count",
|
|
1415
|
+
"aria-live": "polite"
|
|
1416
|
+
}, Sn = { class: "vd-transfer-search" }, Cn = {
|
|
1417
|
+
class: "vd-transfer-list",
|
|
1418
|
+
role: "listbox",
|
|
1419
|
+
"aria-multiselectable": "true"
|
|
1420
|
+
}, wn = ["aria-selected", "onClick"], Tn = ["checked", "aria-label"], En = { class: "vd-transfer-actions" }, Dn = ["disabled"], On = ["disabled"], kn = { class: "vd-transfer-panel" }, An = { class: "vd-transfer-header" }, jn = {
|
|
1421
|
+
class: "vd-transfer-count",
|
|
1422
|
+
"aria-live": "polite"
|
|
1423
|
+
}, Mn = { class: "vd-transfer-search" }, Nn = {
|
|
1424
|
+
class: "vd-transfer-list",
|
|
1425
|
+
role: "listbox",
|
|
1426
|
+
"aria-multiselectable": "true"
|
|
1427
|
+
}, Pn = ["aria-selected", "onClick"], Fn = ["checked", "aria-label"], In = /* @__PURE__ */ u({
|
|
1428
|
+
__name: "VdTransfer",
|
|
1429
|
+
props: { items: {} },
|
|
1430
|
+
setup(t, { expose: r }) {
|
|
1431
|
+
let i = t, s = y(null), c = y(i.items.map((e) => ({ ...e }))), l = y([]), u = y(/* @__PURE__ */ new Set()), d = y(/* @__PURE__ */ new Set()), p = y(""), m = y(""), h = (e, t) => {
|
|
1432
|
+
if (!t) return e;
|
|
1433
|
+
let n = t.toLowerCase();
|
|
1434
|
+
return e.filter((e) => e.label.toLowerCase().includes(n));
|
|
1435
|
+
}, g = n(() => h(c.value, p.value)), v = n(() => h(l.value, m.value)), x = (e, t) => {
|
|
1436
|
+
let n = e === "source" ? u : d, r = new Set(n.value);
|
|
1437
|
+
r.has(t) ? r.delete(t) : r.add(t), n.value = r;
|
|
1438
|
+
}, S = () => {
|
|
1439
|
+
s.value?.dispatchEvent(new CustomEvent("transfer:change", {
|
|
1440
|
+
bubbles: !0,
|
|
1441
|
+
detail: {
|
|
1442
|
+
selected: l.value.map((e) => e.id),
|
|
1443
|
+
available: c.value.map((e) => e.id)
|
|
1444
|
+
}
|
|
1445
|
+
}));
|
|
1446
|
+
}, C = () => {
|
|
1447
|
+
if (u.value.size === 0) return;
|
|
1448
|
+
let e = c.value.filter((e) => u.value.has(e.id));
|
|
1449
|
+
c.value = c.value.filter((e) => !u.value.has(e.id)), l.value = [...l.value, ...e], u.value = /* @__PURE__ */ new Set(), S();
|
|
1450
|
+
}, T = () => {
|
|
1451
|
+
if (d.value.size === 0) return;
|
|
1452
|
+
let e = l.value.filter((e) => d.value.has(e.id));
|
|
1453
|
+
l.value = l.value.filter((e) => !d.value.has(e.id)), c.value = [...c.value, ...e], d.value = /* @__PURE__ */ new Set(), S();
|
|
1454
|
+
};
|
|
1455
|
+
return r({ getSelected: () => l.value.map((e) => e.id) }), (t, n) => (_(), a("div", {
|
|
1456
|
+
ref_key: "root",
|
|
1457
|
+
ref: s,
|
|
1458
|
+
class: "vd-transfer"
|
|
1459
|
+
}, [
|
|
1460
|
+
o("div", yn, [
|
|
1461
|
+
o("div", bn, [n[2] ||= o("span", null, "Source", -1), o("span", xn, w(u.value.size) + "/" + w(c.value.length), 1)]),
|
|
1462
|
+
o("div", Sn, [A(o("input", {
|
|
1463
|
+
"onUpdate:modelValue": n[0] ||= (e) => p.value = e,
|
|
1464
|
+
type: "text",
|
|
1465
|
+
placeholder: "Search...",
|
|
1466
|
+
"aria-label": "Search source"
|
|
1467
|
+
}, null, 512), [[E, p.value]])]),
|
|
1468
|
+
o("ul", Cn, [(_(!0), a(e, null, b(g.value, (e) => (_(), a("li", {
|
|
1469
|
+
key: e.id,
|
|
1470
|
+
class: f(["vd-transfer-item", { "is-selected": u.value.has(e.id) }]),
|
|
1471
|
+
role: "option",
|
|
1472
|
+
"aria-selected": u.value.has(e.id),
|
|
1473
|
+
onClick: (t) => x("source", e.id)
|
|
1474
|
+
}, [o("input", {
|
|
1475
|
+
type: "checkbox",
|
|
1476
|
+
checked: u.value.has(e.id),
|
|
1477
|
+
"aria-label": e.label,
|
|
1478
|
+
tabindex: "-1"
|
|
1479
|
+
}, null, 8, Tn), o("span", null, w(e.label), 1)], 10, wn))), 128))])
|
|
1480
|
+
]),
|
|
1481
|
+
o("div", En, [o("button", {
|
|
1482
|
+
type: "button",
|
|
1483
|
+
class: "vd-transfer-btn",
|
|
1484
|
+
"aria-label": "Move to target",
|
|
1485
|
+
disabled: u.value.size === 0,
|
|
1486
|
+
onClick: C
|
|
1487
|
+
}, " › ", 8, Dn), o("button", {
|
|
1488
|
+
type: "button",
|
|
1489
|
+
class: "vd-transfer-btn",
|
|
1490
|
+
"aria-label": "Move to source",
|
|
1491
|
+
disabled: d.value.size === 0,
|
|
1492
|
+
onClick: T
|
|
1493
|
+
}, " ‹ ", 8, On)]),
|
|
1494
|
+
o("div", kn, [
|
|
1495
|
+
o("div", An, [n[3] ||= o("span", null, "Target", -1), o("span", jn, w(d.value.size) + "/" + w(l.value.length), 1)]),
|
|
1496
|
+
o("div", Mn, [A(o("input", {
|
|
1497
|
+
"onUpdate:modelValue": n[1] ||= (e) => m.value = e,
|
|
1498
|
+
type: "text",
|
|
1499
|
+
placeholder: "Search...",
|
|
1500
|
+
"aria-label": "Search target"
|
|
1501
|
+
}, null, 512), [[E, m.value]])]),
|
|
1502
|
+
o("ul", Nn, [(_(!0), a(e, null, b(v.value, (e) => (_(), a("li", {
|
|
1503
|
+
key: e.id,
|
|
1504
|
+
class: f(["vd-transfer-item", { "is-selected": d.value.has(e.id) }]),
|
|
1505
|
+
role: "option",
|
|
1506
|
+
"aria-selected": d.value.has(e.id),
|
|
1507
|
+
onClick: (t) => x("target", e.id)
|
|
1508
|
+
}, [o("input", {
|
|
1509
|
+
type: "checkbox",
|
|
1510
|
+
checked: d.value.has(e.id),
|
|
1511
|
+
"aria-label": e.label,
|
|
1512
|
+
tabindex: "-1"
|
|
1513
|
+
}, null, 8, Fn), o("span", null, w(e.label), 1)], 10, Pn))), 128))])
|
|
1514
|
+
])
|
|
1515
|
+
], 512));
|
|
1516
|
+
}
|
|
1517
|
+
}), Ln = ["aria-expanded"], Rn = { class: "vd-tree-node-content" }, zn = {
|
|
1518
|
+
key: 1,
|
|
1519
|
+
class: "vd-tree-toggle-placeholder"
|
|
1520
|
+
}, Bn = ["checked", "aria-label"], Vn = {
|
|
1521
|
+
class: "vd-tree-label",
|
|
1522
|
+
tabindex: "-1"
|
|
1523
|
+
}, Hn = {
|
|
1524
|
+
key: 0,
|
|
1525
|
+
class: "vd-tree-children",
|
|
1526
|
+
role: "group"
|
|
1527
|
+
}, Un = /* @__PURE__ */ u({
|
|
1528
|
+
__name: "VdTreeNode",
|
|
1529
|
+
props: {
|
|
1530
|
+
node: {},
|
|
1531
|
+
checkbox: { type: Boolean }
|
|
1532
|
+
},
|
|
1533
|
+
emits: ["toggle", "check"],
|
|
1534
|
+
setup(t, { emit: s }) {
|
|
1535
|
+
let c = t, l = s, u = n(() => !!c.node.children && c.node.children.length > 0), d = () => {
|
|
1536
|
+
c.node.open = !c.node.open, l("toggle", c.node);
|
|
1537
|
+
}, p = (e) => {
|
|
1538
|
+
l("check", c.node, e.target.checked);
|
|
1539
|
+
};
|
|
1540
|
+
return (n, s) => {
|
|
1541
|
+
let c = S("VdTreeNode", !0);
|
|
1542
|
+
return _(), a("li", {
|
|
1543
|
+
class: f(["vd-tree-node", { "is-open": t.node.open }]),
|
|
1544
|
+
role: "treeitem",
|
|
1545
|
+
"aria-expanded": u.value ? t.node.open ? "true" : "false" : void 0
|
|
1546
|
+
}, [o("div", Rn, [
|
|
1547
|
+
u.value ? (_(), a("button", {
|
|
1548
|
+
key: 0,
|
|
1549
|
+
type: "button",
|
|
1550
|
+
class: "vd-tree-toggle",
|
|
1551
|
+
"aria-label": "Toggle",
|
|
1552
|
+
onClick: j(d, ["stop"])
|
|
1553
|
+
})) : (_(), a("span", zn)),
|
|
1554
|
+
t.checkbox ? (_(), a("input", {
|
|
1555
|
+
key: 2,
|
|
1556
|
+
type: "checkbox",
|
|
1557
|
+
class: "vd-tree-checkbox",
|
|
1558
|
+
checked: t.node.checked,
|
|
1559
|
+
"aria-label": t.node.label,
|
|
1560
|
+
onChange: j(p, ["stop"]),
|
|
1561
|
+
onClick: s[0] ||= j(() => {}, ["stop"])
|
|
1562
|
+
}, null, 40, Bn)) : i("", !0),
|
|
1563
|
+
t.node.icon ? (_(), a("span", {
|
|
1564
|
+
key: 3,
|
|
1565
|
+
class: f(["vd-tree-icon", t.node.icon])
|
|
1566
|
+
}, null, 2)) : i("", !0),
|
|
1567
|
+
o("span", Vn, w(t.node.label), 1)
|
|
1568
|
+
]), u.value ? (_(), a("ul", Hn, [(_(!0), a(e, null, b(t.node.children, (e, n) => (_(), r(c, {
|
|
1569
|
+
key: e.id ?? n,
|
|
1570
|
+
node: e,
|
|
1571
|
+
checkbox: t.checkbox,
|
|
1572
|
+
onToggle: s[1] ||= (e) => l("toggle", e),
|
|
1573
|
+
onCheck: s[2] ||= (e, t) => l("check", e, t)
|
|
1574
|
+
}, null, 8, ["node", "checkbox"]))), 128))])) : i("", !0)], 10, Ln);
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
}), Wn = /* @__PURE__ */ u({
|
|
1578
|
+
__name: "VdTree",
|
|
1579
|
+
props: {
|
|
1580
|
+
nodes: {},
|
|
1581
|
+
checkbox: { type: Boolean },
|
|
1582
|
+
cascade: { type: Boolean }
|
|
1583
|
+
},
|
|
1584
|
+
setup(t, { expose: n }) {
|
|
1585
|
+
let i = t, o = y(null), s = (e) => e.map((e) => ({
|
|
1586
|
+
...e,
|
|
1587
|
+
children: e.children ? s(e.children) : void 0
|
|
1588
|
+
})), c = v(s(i.nodes)), l = (e, t) => {
|
|
1589
|
+
e.forEach((e) => {
|
|
1590
|
+
e.checked = t, e.children && l(e.children, t);
|
|
1591
|
+
});
|
|
1592
|
+
}, u = (e, t = []) => (e.forEach((e) => {
|
|
1593
|
+
e.checked && t.push(e.id ?? e.label ?? ""), e.children && u(e.children, t);
|
|
1594
|
+
}), t), d = (e, t) => {
|
|
1595
|
+
e.checked = t, (i.cascade ?? !0) && e.children && l(e.children, t), o.value?.dispatchEvent(new CustomEvent("tree:check", {
|
|
1596
|
+
bubbles: !0,
|
|
1597
|
+
detail: {
|
|
1598
|
+
checked: u(c),
|
|
1599
|
+
node: e.id
|
|
1600
|
+
}
|
|
1601
|
+
}));
|
|
1602
|
+
}, f = (e) => {
|
|
1603
|
+
o.value?.dispatchEvent(new CustomEvent("tree:toggle", {
|
|
1604
|
+
bubbles: !0,
|
|
1605
|
+
detail: {
|
|
1606
|
+
id: e.id,
|
|
1607
|
+
open: !!e.open
|
|
1608
|
+
}
|
|
1609
|
+
}));
|
|
1610
|
+
}, p = (e) => {
|
|
1611
|
+
let t = o.value, n = document.activeElement;
|
|
1612
|
+
if (!t || !n || !t.contains(n)) return;
|
|
1613
|
+
let r = Array.from(t.querySelectorAll(".vd-tree-node-content")), i = n.closest(".vd-tree-node-content"), a = i ? r.indexOf(i) : -1;
|
|
1614
|
+
if (a === -1) return;
|
|
1615
|
+
let s = (e) => {
|
|
1616
|
+
r[e]?.querySelector(".vd-tree-toggle, .vd-tree-label")?.focus();
|
|
1617
|
+
};
|
|
1618
|
+
switch (e.key) {
|
|
1619
|
+
case "ArrowDown":
|
|
1620
|
+
e.preventDefault(), a < r.length - 1 && s(a + 1);
|
|
1621
|
+
break;
|
|
1622
|
+
case "ArrowUp":
|
|
1623
|
+
e.preventDefault(), a > 0 && s(a - 1);
|
|
1624
|
+
break;
|
|
1625
|
+
case "ArrowRight": {
|
|
1626
|
+
e.preventDefault();
|
|
1627
|
+
let t = i?.closest(".vd-tree-node"), n = i?.querySelector(".vd-tree-toggle");
|
|
1628
|
+
n && !t?.classList.contains("is-open") && n.click();
|
|
1629
|
+
break;
|
|
1630
|
+
}
|
|
1631
|
+
case "ArrowLeft": {
|
|
1632
|
+
e.preventDefault();
|
|
1633
|
+
let t = i?.closest(".vd-tree-node"), n = i?.querySelector(".vd-tree-toggle");
|
|
1634
|
+
n && t?.classList.contains("is-open") && n.click();
|
|
1635
|
+
break;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
};
|
|
1639
|
+
return n({ getChecked: () => u(c) }), (n, i) => (_(), a("div", {
|
|
1640
|
+
ref_key: "root",
|
|
1641
|
+
ref: o,
|
|
1642
|
+
class: "vd-tree",
|
|
1643
|
+
role: "tree",
|
|
1644
|
+
onKeydown: p
|
|
1645
|
+
}, [(_(!0), a(e, null, b(c, (e, n) => (_(), r(Un, {
|
|
1646
|
+
key: e.id ?? n,
|
|
1647
|
+
node: e,
|
|
1648
|
+
checkbox: !!t.checkbox,
|
|
1649
|
+
onToggle: f,
|
|
1650
|
+
onCheck: d
|
|
1651
|
+
}, null, 8, ["node", "checkbox"]))), 128))], 544));
|
|
1652
|
+
}
|
|
1653
|
+
}), Gn = /* @__PURE__ */ u({
|
|
1654
|
+
__name: "VdBox",
|
|
1655
|
+
props: {
|
|
1656
|
+
as: { default: "div" },
|
|
1657
|
+
pad: { default: "fib-8" }
|
|
1658
|
+
},
|
|
1659
|
+
setup(e) {
|
|
1660
|
+
return (t, n) => (_(), r(C(e.as), {
|
|
1661
|
+
class: "vd-box",
|
|
1662
|
+
"data-pad": e.pad
|
|
1663
|
+
}, {
|
|
1664
|
+
default: k(() => [x(t.$slots, "default")]),
|
|
1665
|
+
_: 3
|
|
1666
|
+
}, 8, ["data-pad"]));
|
|
1667
|
+
}
|
|
1668
|
+
}), Kn = /* @__PURE__ */ u({
|
|
1669
|
+
__name: "VdCenter",
|
|
1670
|
+
props: {
|
|
1671
|
+
as: { default: "div" },
|
|
1672
|
+
max: { default: "fib-610" },
|
|
1673
|
+
axis: {}
|
|
1674
|
+
},
|
|
1675
|
+
setup(e) {
|
|
1676
|
+
return (t, n) => (_(), r(C(e.as), {
|
|
1677
|
+
class: "vd-center",
|
|
1678
|
+
"data-max": e.max,
|
|
1679
|
+
"data-axis": e.axis
|
|
1680
|
+
}, {
|
|
1681
|
+
default: k(() => [x(t.$slots, "default")]),
|
|
1682
|
+
_: 3
|
|
1683
|
+
}, 8, ["data-max", "data-axis"]));
|
|
1684
|
+
}
|
|
1685
|
+
}), qn = /* @__PURE__ */ u({
|
|
1686
|
+
__name: "VdCover",
|
|
1687
|
+
props: {
|
|
1688
|
+
as: { default: "div" },
|
|
1689
|
+
min: { default: "fib-610" },
|
|
1690
|
+
gap: {}
|
|
1691
|
+
},
|
|
1692
|
+
setup(e) {
|
|
1693
|
+
return (t, n) => (_(), r(C(e.as), {
|
|
1694
|
+
class: "vd-cover",
|
|
1695
|
+
"data-min": e.min,
|
|
1696
|
+
"data-gap": e.gap
|
|
1697
|
+
}, {
|
|
1698
|
+
default: k(() => [x(t.$slots, "default")]),
|
|
1699
|
+
_: 3
|
|
1700
|
+
}, 8, ["data-min", "data-gap"]));
|
|
1701
|
+
}
|
|
1702
|
+
}), Jn = ["data-ratio"], Yn = /* @__PURE__ */ u({
|
|
1703
|
+
__name: "VdFrame",
|
|
1704
|
+
props: { ratio: { default: "golden" } },
|
|
1705
|
+
setup(e) {
|
|
1706
|
+
return (t, n) => (_(), a("div", {
|
|
1707
|
+
class: "vd-frame",
|
|
1708
|
+
"data-ratio": e.ratio
|
|
1709
|
+
}, [x(t.$slots, "default")], 8, Jn));
|
|
1710
|
+
}
|
|
1711
|
+
}), Xn = ["data-gap"], Zn = /* @__PURE__ */ u({
|
|
1712
|
+
__name: "VdInline",
|
|
1713
|
+
props: { gap: { default: "fib-5" } },
|
|
1714
|
+
setup(e) {
|
|
1715
|
+
return (t, n) => (_(), a("div", {
|
|
1716
|
+
class: "vd-inline",
|
|
1717
|
+
"data-gap": e.gap
|
|
1718
|
+
}, [x(t.$slots, "default")], 8, Xn));
|
|
1719
|
+
}
|
|
1720
|
+
}), Qn = /* @__PURE__ */ u({
|
|
1721
|
+
__name: "VdStack",
|
|
1722
|
+
props: {
|
|
1723
|
+
gap: { default: "fib-8" },
|
|
1724
|
+
as: { default: "div" }
|
|
1725
|
+
},
|
|
1726
|
+
setup(e) {
|
|
1727
|
+
return (t, n) => (_(), r(C(e.as), {
|
|
1728
|
+
class: "vd-stack",
|
|
1729
|
+
"data-gap": e.gap
|
|
1730
|
+
}, {
|
|
1731
|
+
default: k(() => [x(t.$slots, "default")]),
|
|
1732
|
+
_: 3
|
|
1733
|
+
}, 8, ["data-gap"]));
|
|
1734
|
+
}
|
|
1735
|
+
}), $n = ["data-threshold", "data-gap"], er = /* @__PURE__ */ u({
|
|
1736
|
+
__name: "VdSwitcher",
|
|
1737
|
+
props: {
|
|
1738
|
+
threshold: { default: "fib-610" },
|
|
1739
|
+
gap: { default: "fib-5" }
|
|
1740
|
+
},
|
|
1741
|
+
setup(e) {
|
|
1742
|
+
return (t, n) => (_(), a("div", {
|
|
1743
|
+
class: "vd-switcher",
|
|
1744
|
+
"data-threshold": e.threshold,
|
|
1745
|
+
"data-gap": e.gap
|
|
1746
|
+
}, [x(t.$slots, "default")], 8, $n));
|
|
1747
|
+
}
|
|
1748
|
+
});
|
|
1749
|
+
//#endregion
|
|
1750
|
+
//#region src/composables/useAffix.ts
|
|
1751
|
+
function tr(e) {
|
|
1752
|
+
if (!e || e === document.body) return !1;
|
|
1753
|
+
let t = window.getComputedStyle(e), n = /(auto|scroll|overlay)/.test(t.overflowY) && e.scrollHeight > e.clientHeight, r = /(auto|scroll|overlay)/.test(t.overflowX) && e.scrollWidth > e.clientWidth;
|
|
1754
|
+
return n || r;
|
|
1755
|
+
}
|
|
1756
|
+
function nr(e) {
|
|
1757
|
+
let t = e.parentElement;
|
|
1758
|
+
for (; t && t !== document.body && t !== document.documentElement;) {
|
|
1759
|
+
if (tr(t)) return t;
|
|
1760
|
+
t = t.parentElement;
|
|
1761
|
+
}
|
|
1762
|
+
return null;
|
|
1763
|
+
}
|
|
1764
|
+
function rr(e) {
|
|
1765
|
+
let t = [];
|
|
1766
|
+
h(() => {
|
|
1767
|
+
if (typeof window > "u") return;
|
|
1768
|
+
let n = e.value;
|
|
1769
|
+
n && n.querySelectorAll(".vd-affix, .vd-sticky, [data-vd-affix]").forEach((e) => {
|
|
1770
|
+
let n = parseInt(e.getAttribute("data-vd-affix-offset") || "0", 10), r = Number.isNaN(n) ? 0 : n, i = nr(e), a = !1, o = document.createElement("div");
|
|
1771
|
+
o.style.cssText = "display:block;height:1px;margin-bottom:-1px;visibility:hidden;pointer-events:none;", e.parentNode?.insertBefore(o, e), e.style.setProperty("--vd-affix-top-offset", r + "px");
|
|
1772
|
+
let s = () => {
|
|
1773
|
+
a || (a = !0, e.classList.add("is-stuck"), e.dispatchEvent(new CustomEvent("affix:stuck", {
|
|
1774
|
+
bubbles: !0,
|
|
1775
|
+
detail: {
|
|
1776
|
+
offset: r,
|
|
1777
|
+
root: i || window
|
|
1778
|
+
}
|
|
1779
|
+
})));
|
|
1780
|
+
}, c = () => {
|
|
1781
|
+
a && (a = !1, e.classList.remove("is-stuck"), e.dispatchEvent(new CustomEvent("affix:unstuck", {
|
|
1782
|
+
bubbles: !0,
|
|
1783
|
+
detail: {
|
|
1784
|
+
offset: r,
|
|
1785
|
+
root: i || window
|
|
1786
|
+
}
|
|
1787
|
+
})));
|
|
1788
|
+
}, l = new IntersectionObserver((e) => {
|
|
1789
|
+
e.forEach((e) => {
|
|
1790
|
+
e.isIntersecting ? c() : s();
|
|
1791
|
+
});
|
|
1792
|
+
}, {
|
|
1793
|
+
root: i,
|
|
1794
|
+
rootMargin: "-" + r + "px 0px 0px 0px",
|
|
1795
|
+
threshold: 0
|
|
1796
|
+
});
|
|
1797
|
+
l.observe(o), t.push(() => l.disconnect(), () => {
|
|
1798
|
+
o.parentNode && o.parentNode.removeChild(o);
|
|
1799
|
+
}, () => {
|
|
1800
|
+
e.classList.remove("is-stuck"), e.style.removeProperty("--vd-affix-top-offset");
|
|
1801
|
+
});
|
|
1802
|
+
});
|
|
1803
|
+
}), g(() => {
|
|
1804
|
+
t.forEach((e) => e()), t.length = 0;
|
|
1805
|
+
});
|
|
1806
|
+
}
|
|
1807
|
+
//#endregion
|
|
1808
|
+
//#region src/composables/useDatepicker.ts
|
|
1809
|
+
var ir = [
|
|
1810
|
+
"Su",
|
|
1811
|
+
"Mo",
|
|
1812
|
+
"Tu",
|
|
1813
|
+
"We",
|
|
1814
|
+
"Th",
|
|
1815
|
+
"Fr",
|
|
1816
|
+
"Sa"
|
|
1817
|
+
], B = [
|
|
1818
|
+
"January",
|
|
1819
|
+
"February",
|
|
1820
|
+
"March",
|
|
1821
|
+
"April",
|
|
1822
|
+
"May",
|
|
1823
|
+
"June",
|
|
1824
|
+
"July",
|
|
1825
|
+
"August",
|
|
1826
|
+
"September",
|
|
1827
|
+
"October",
|
|
1828
|
+
"November",
|
|
1829
|
+
"December"
|
|
1830
|
+
], ar = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1831
|
+
function or(e) {
|
|
1832
|
+
let t = "^", n = [], r = 0;
|
|
1833
|
+
for (; r < e.length;) {
|
|
1834
|
+
let i = e.slice(r);
|
|
1835
|
+
i.toLowerCase().startsWith("yyyy") ? (t += "(\\d{4})", n.push("y"), r += 4) : i.toLowerCase().startsWith("mm") ? (t += "(\\d{2})", n.push("m"), r += 2) : i.toLowerCase().startsWith("dd") ? (t += "(\\d{2})", n.push("d"), r += 2) : (t += ar(e[r]), r++);
|
|
1836
|
+
}
|
|
1837
|
+
return t += "$", {
|
|
1838
|
+
regex: new RegExp(t),
|
|
1839
|
+
order: n
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
function sr(e, t) {
|
|
1843
|
+
if (!e || !t) return null;
|
|
1844
|
+
let { regex: n, order: r } = or(t), i = e.trim().match(n);
|
|
1845
|
+
if (!i) return null;
|
|
1846
|
+
let a, o, s, c = 1;
|
|
1847
|
+
for (let e of r) {
|
|
1848
|
+
let t = parseInt(i[c++], 10);
|
|
1849
|
+
if (Number.isNaN(t)) return null;
|
|
1850
|
+
e === "y" ? a = t : e === "m" ? o = t - 1 : e === "d" && (s = t);
|
|
1851
|
+
}
|
|
1852
|
+
if (a === void 0 || o === void 0 || s === void 0) return null;
|
|
1853
|
+
let l = new Date(a, o, s);
|
|
1854
|
+
return l.getFullYear() !== a || l.getMonth() !== o || l.getDate() !== s ? null : l;
|
|
1855
|
+
}
|
|
1856
|
+
function cr(e, t) {
|
|
1857
|
+
let n = String(e.getFullYear()), r = String(e.getMonth() + 1).padStart(2, "0"), i = String(e.getDate()).padStart(2, "0"), a = "", o = 0;
|
|
1858
|
+
for (; o < t.length;) {
|
|
1859
|
+
let e = t.slice(o);
|
|
1860
|
+
e.toLowerCase().startsWith("yyyy") ? (a += n, o += 4) : e.toLowerCase().startsWith("mm") ? (a += r, o += 2) : e.toLowerCase().startsWith("dd") ? (a += i, o += 2) : (a += t[o], o++);
|
|
1861
|
+
}
|
|
1862
|
+
return a;
|
|
1863
|
+
}
|
|
1864
|
+
var V = (e) => e.getFullYear() + "-" + String(e.getMonth() + 1).padStart(2, "0") + "-" + String(e.getDate()).padStart(2, "0");
|
|
1865
|
+
function H(e, t) {
|
|
1866
|
+
let n = new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
1867
|
+
return n.setDate(n.getDate() + t), n;
|
|
1868
|
+
}
|
|
1869
|
+
var U = (e, t) => new Date(e.getFullYear(), e.getMonth() + t, e.getDate());
|
|
1870
|
+
function W(e) {
|
|
1871
|
+
if (!e || typeof e != "string") return null;
|
|
1872
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());
|
|
1873
|
+
if (!t) return null;
|
|
1874
|
+
let n = +t[1], r = t[2] - 1, i = +t[3], a = new Date(n, r, i);
|
|
1875
|
+
return a.getFullYear() !== n || a.getMonth() !== r || a.getDate() !== i ? null : a;
|
|
1876
|
+
}
|
|
1877
|
+
function lr(e) {
|
|
1878
|
+
let t = new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
1879
|
+
return t.setDate(t.getDate() - t.getDay()), t;
|
|
1880
|
+
}
|
|
1881
|
+
function ur(e) {
|
|
1882
|
+
let t = new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
1883
|
+
return t.setDate(t.getDate() + (6 - t.getDay())), t;
|
|
1884
|
+
}
|
|
1885
|
+
function dr(e, t, n = 4) {
|
|
1886
|
+
let r = e.getBoundingClientRect();
|
|
1887
|
+
t.style.minWidth = Math.max(r.width, 0) + "px";
|
|
1888
|
+
let i = r.bottom + n, a = r.left;
|
|
1889
|
+
t.style.top = i + "px", t.style.left = a + "px";
|
|
1890
|
+
let o = t.getBoundingClientRect();
|
|
1891
|
+
o.bottom > window.innerHeight - 8 && r.top - o.height > 8 && (i = r.top - o.height - n, t.style.top = i + "px");
|
|
1892
|
+
let s = t.getBoundingClientRect();
|
|
1893
|
+
a = r.left, a + s.width > window.innerWidth - 8 && (a = window.innerWidth - s.width - 8), t.style.left = Math.max(8, a) + "px";
|
|
1894
|
+
}
|
|
1895
|
+
function fr(e) {
|
|
1896
|
+
let t = [];
|
|
1897
|
+
h(() => {
|
|
1898
|
+
if (typeof window > "u") return;
|
|
1899
|
+
let n = e.value;
|
|
1900
|
+
n && n.querySelectorAll("[data-vd-datepicker]").forEach((e) => pr(e, t));
|
|
1901
|
+
}), g(() => {
|
|
1902
|
+
t.forEach((e) => e()), t.length = 0;
|
|
1903
|
+
});
|
|
1904
|
+
}
|
|
1905
|
+
function pr(e, t) {
|
|
1906
|
+
let n = e.getAttribute("data-vd-datepicker-format") || "YYYY-MM-DD", r = W(e.getAttribute("data-vd-datepicker-min")), i = W(e.getAttribute("data-vd-datepicker-max")), a = /* @__PURE__ */ new Date(), o = a.getFullYear(), s = a.getMonth(), c = null, l = "days", u = null, d = !1, f = 0, p = (e) => {
|
|
1907
|
+
let t = new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime();
|
|
1908
|
+
return !!(r && t < r.getTime() || i && t > i.getTime());
|
|
1909
|
+
}, m = (e, t) => {
|
|
1910
|
+
if (!r && !i) return {
|
|
1911
|
+
y: e,
|
|
1912
|
+
m: t
|
|
1913
|
+
};
|
|
1914
|
+
let n = new Date(e, t, 1), a = new Date(e, t + 1, 0);
|
|
1915
|
+
return r && a.getTime() < r.getTime() ? {
|
|
1916
|
+
y: r.getFullYear(),
|
|
1917
|
+
m: r.getMonth()
|
|
1918
|
+
} : i && n.getTime() > i.getTime() ? {
|
|
1919
|
+
y: i.getFullYear(),
|
|
1920
|
+
m: i.getMonth()
|
|
1921
|
+
} : {
|
|
1922
|
+
y: e,
|
|
1923
|
+
m: t
|
|
1924
|
+
};
|
|
1925
|
+
}, h = (e, t) => {
|
|
1926
|
+
let n = new Date(e, t + 1, 0).getDate();
|
|
1927
|
+
for (let r = 1; r <= n; r++) {
|
|
1928
|
+
let n = new Date(e, t, r);
|
|
1929
|
+
if (!p(n)) return n;
|
|
1930
|
+
}
|
|
1931
|
+
return new Date(e, t, 1);
|
|
1932
|
+
};
|
|
1933
|
+
if (e.value) {
|
|
1934
|
+
let t = e.value.trim(), r = sr(t, n);
|
|
1935
|
+
if (!r) {
|
|
1936
|
+
let e = new Date(t);
|
|
1937
|
+
isNaN(e.getTime()) || (r = e);
|
|
1938
|
+
}
|
|
1939
|
+
r && (c = r, o = r.getFullYear(), s = r.getMonth());
|
|
1940
|
+
}
|
|
1941
|
+
let g = m(o, s);
|
|
1942
|
+
o = g.y, s = g.m;
|
|
1943
|
+
let _ = document.createElement("div");
|
|
1944
|
+
_.className = "vd-datepicker-popup", _.setAttribute("role", "dialog"), _.setAttribute("aria-label", "Choose date"), _.tabIndex = -1;
|
|
1945
|
+
let v = e.closest(".vd-suggest-wrapper");
|
|
1946
|
+
v || (v = document.createElement("div"), v.className = "vd-suggest-wrapper", v.style.position = "relative", v.style.display = "inline-block", e.parentNode?.insertBefore(v, e), v.appendChild(e)), document.body.appendChild(_);
|
|
1947
|
+
let y = (e, t) => !!e && !!t && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), b = (t) => {
|
|
1948
|
+
c = t, o = t.getFullYear(), s = t.getMonth(), e.value = cr(t, n), d = !0, A(), e.dispatchEvent(new CustomEvent("datepicker:select", {
|
|
1949
|
+
bubbles: !0,
|
|
1950
|
+
detail: {
|
|
1951
|
+
date: t,
|
|
1952
|
+
formatted: e.value
|
|
1953
|
+
}
|
|
1954
|
+
})), e.dispatchEvent(new Event("change", { bubbles: !0 })), e.focus();
|
|
1955
|
+
}, x = () => {
|
|
1956
|
+
if (l !== "days" || !u) return;
|
|
1957
|
+
let e = _.querySelector("[data-vd-date=\"" + V(u) + "\"]");
|
|
1958
|
+
e && !e.classList.contains("is-outside") && e.getAttribute("aria-disabled") !== "true" && e.focus();
|
|
1959
|
+
}, S = (e, t, n) => {
|
|
1960
|
+
let r = new Date(e.getFullYear(), e.getMonth(), e.getDate()), i = t > 0 ? 1 : -1;
|
|
1961
|
+
for (let e = 0; e < n; e++) {
|
|
1962
|
+
if (!p(r)) return r;
|
|
1963
|
+
r = H(r, i);
|
|
1964
|
+
}
|
|
1965
|
+
return e;
|
|
1966
|
+
}, C = (e, t, n) => {
|
|
1967
|
+
let r = document.createElement("button");
|
|
1968
|
+
return r.type = "button", r.className = "vd-datepicker-day", r.textContent = String(e), r.setAttribute("role", "gridcell"), t ? (r.classList.add("is-outside"), r.tabIndex = -1, r.setAttribute("aria-disabled", "true"), r) : (r.setAttribute("data-vd-date", V(n)), y(n, a) && r.classList.add("is-today"), y(n, c) && r.classList.add("is-selected"), p(n) ? (r.classList.add("is-disabled"), r.setAttribute("aria-disabled", "true"), r.tabIndex = -1, r) : (r.tabIndex = u && y(n, u) ? 0 : -1, r.addEventListener("click", () => {
|
|
1969
|
+
u = new Date(n.getFullYear(), n.getMonth(), n.getDate()), b(n);
|
|
1970
|
+
}), r));
|
|
1971
|
+
}, w = () => {
|
|
1972
|
+
_.innerHTML = "";
|
|
1973
|
+
let e = document.createElement("div");
|
|
1974
|
+
e.className = "vd-datepicker-header";
|
|
1975
|
+
let t = document.createElement("button");
|
|
1976
|
+
t.type = "button", t.className = "vd-datepicker-prev", t.innerHTML = "‹", t.setAttribute("aria-label", "Previous");
|
|
1977
|
+
let n = document.createElement("button");
|
|
1978
|
+
n.type = "button", n.className = "vd-datepicker-next", n.innerHTML = "›", n.setAttribute("aria-label", "Next");
|
|
1979
|
+
let r = document.createElement("span");
|
|
1980
|
+
if (r.className = "vd-datepicker-title", l === "days") r.textContent = B[s] + " " + o, r.addEventListener("click", () => {
|
|
1981
|
+
l = "months", w();
|
|
1982
|
+
}), t.addEventListener("click", () => {
|
|
1983
|
+
s--, s < 0 && (s = 11, o--), w();
|
|
1984
|
+
}), n.addEventListener("click", () => {
|
|
1985
|
+
s++, s > 11 && (s = 0, o++), w();
|
|
1986
|
+
});
|
|
1987
|
+
else if (l === "months") r.textContent = String(o), r.addEventListener("click", () => {
|
|
1988
|
+
l = "years", w();
|
|
1989
|
+
}), t.addEventListener("click", () => {
|
|
1990
|
+
o--, w();
|
|
1991
|
+
}), n.addEventListener("click", () => {
|
|
1992
|
+
o++, w();
|
|
1993
|
+
});
|
|
1994
|
+
else {
|
|
1995
|
+
let e = Math.floor(o / 10) * 10;
|
|
1996
|
+
r.textContent = e + " - " + (e + 9), t.addEventListener("click", () => {
|
|
1997
|
+
o -= 10, w();
|
|
1998
|
+
}), n.addEventListener("click", () => {
|
|
1999
|
+
o += 10, w();
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
if (e.appendChild(t), e.appendChild(r), e.appendChild(n), _.appendChild(e), l === "days") {
|
|
2003
|
+
let e = document.createElement("div");
|
|
2004
|
+
e.className = "vd-datepicker-grid", e.setAttribute("role", "grid"), e.setAttribute("aria-label", "Calendar");
|
|
2005
|
+
let t = document.createElement("div");
|
|
2006
|
+
t.className = "vd-datepicker-weekdays", t.setAttribute("role", "row"), ir.forEach((e) => {
|
|
2007
|
+
let n = document.createElement("span");
|
|
2008
|
+
n.setAttribute("role", "columnheader"), n.setAttribute("aria-label", e), n.textContent = e, t.appendChild(n);
|
|
2009
|
+
}), e.appendChild(t);
|
|
2010
|
+
let n = new Date(o, s, 1).getDay(), r = new Date(o, s + 1, 0).getDate(), i = new Date(o, s, 0).getDate(), a = [];
|
|
2011
|
+
for (let e = n - 1; e >= 0; e--) {
|
|
2012
|
+
let t = i - e, n = s === 0 ? 11 : s - 1, r = s === 0 ? o - 1 : o;
|
|
2013
|
+
a.push({
|
|
2014
|
+
day: t,
|
|
2015
|
+
outside: !0,
|
|
2016
|
+
date: new Date(r, n, t)
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
for (let e = 1; e <= r; e++) a.push({
|
|
2020
|
+
day: e,
|
|
2021
|
+
outside: !1,
|
|
2022
|
+
date: new Date(o, s, e)
|
|
2023
|
+
});
|
|
2024
|
+
let c = n + r, l = c % 7 == 0 ? 0 : 7 - c % 7;
|
|
2025
|
+
for (let e = 1; e <= l; e++) a.push({
|
|
2026
|
+
day: e,
|
|
2027
|
+
outside: !0,
|
|
2028
|
+
date: new Date(o, s + 1, e)
|
|
2029
|
+
});
|
|
2030
|
+
for (let t = 0; t < a.length; t += 7) {
|
|
2031
|
+
let n = document.createElement("div");
|
|
2032
|
+
n.className = "vd-datepicker-row", n.setAttribute("role", "row");
|
|
2033
|
+
for (let e = 0; e < 7; e++) {
|
|
2034
|
+
let r = a[t + e];
|
|
2035
|
+
n.appendChild(C(r.day, r.outside, r.date));
|
|
2036
|
+
}
|
|
2037
|
+
e.appendChild(n);
|
|
2038
|
+
}
|
|
2039
|
+
_.appendChild(e);
|
|
2040
|
+
} else if (l === "months") {
|
|
2041
|
+
let e = document.createElement("div");
|
|
2042
|
+
e.className = "vd-datepicker-months", B.forEach((t, n) => {
|
|
2043
|
+
let r = document.createElement("button");
|
|
2044
|
+
r.type = "button", r.className = "vd-datepicker-month-btn", r.textContent = t.slice(0, 3), c && c.getFullYear() === o && c.getMonth() === n && r.classList.add("is-selected"), r.addEventListener("click", () => {
|
|
2045
|
+
s = n, l = "days", w();
|
|
2046
|
+
}), e.appendChild(r);
|
|
2047
|
+
}), _.appendChild(e);
|
|
2048
|
+
} else {
|
|
2049
|
+
let e = document.createElement("div");
|
|
2050
|
+
e.className = "vd-datepicker-years";
|
|
2051
|
+
let t = Math.floor(o / 10) * 10;
|
|
2052
|
+
for (let n = t - 1; n <= t + 10; n++) {
|
|
2053
|
+
let r = document.createElement("button");
|
|
2054
|
+
r.type = "button", r.className = "vd-datepicker-year-btn", r.textContent = String(n), c && c.getFullYear() === n && r.classList.add("is-selected"), (n < t || n > t + 9) && (r.style.opacity = "0.4"), r.addEventListener("click", () => {
|
|
2055
|
+
o = n, l = "months", w();
|
|
2056
|
+
}), e.appendChild(r);
|
|
2057
|
+
}
|
|
2058
|
+
_.appendChild(e);
|
|
2059
|
+
}
|
|
2060
|
+
_.classList.contains("is-open") && requestAnimationFrame(E);
|
|
2061
|
+
}, T = (t) => {
|
|
2062
|
+
if (!_.classList.contains("is-open") || l !== "days") return;
|
|
2063
|
+
let n = _.querySelector(".vd-datepicker-grid");
|
|
2064
|
+
if (!n || !n.contains(t.target)) return;
|
|
2065
|
+
let r = t.key;
|
|
2066
|
+
if (![
|
|
2067
|
+
"ArrowLeft",
|
|
2068
|
+
"ArrowRight",
|
|
2069
|
+
"ArrowUp",
|
|
2070
|
+
"ArrowDown",
|
|
2071
|
+
"Home",
|
|
2072
|
+
"End",
|
|
2073
|
+
"PageUp",
|
|
2074
|
+
"PageDown",
|
|
2075
|
+
"Enter",
|
|
2076
|
+
" ",
|
|
2077
|
+
"Escape"
|
|
2078
|
+
].includes(r)) return;
|
|
2079
|
+
if (r === "Escape") {
|
|
2080
|
+
t.preventDefault(), t.stopPropagation(), d = !0, A(), e.focus();
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
if (u ||= h(o, s), r === "Enter" || r === " ") {
|
|
2084
|
+
t.preventDefault(), u && !p(u) && b(new Date(u.getFullYear(), u.getMonth(), u.getDate()));
|
|
2085
|
+
return;
|
|
2086
|
+
}
|
|
2087
|
+
t.preventDefault();
|
|
2088
|
+
let i = new Date(u.getFullYear(), u.getMonth(), u.getDate()), a = 1;
|
|
2089
|
+
if (r === "ArrowLeft" ? (i = H(i, -1), a = -1) : r === "ArrowRight" ? (i = H(i, 1), a = 1) : r === "ArrowUp" ? (i = H(i, -7), a = -1) : r === "ArrowDown" ? (i = H(i, 7), a = 1) : r === "Home" ? (i = lr(i), a = 1) : r === "End" ? (i = ur(i), a = -1) : r === "PageUp" ? (i = U(i, -1), a = -1) : r === "PageDown" && (i = U(i, 1), a = 1), i = S(i, a, 400), i.getMonth() !== s || i.getFullYear() !== o) {
|
|
2090
|
+
o = i.getFullYear(), s = i.getMonth();
|
|
2091
|
+
let e = m(o, s);
|
|
2092
|
+
o = e.y, s = e.m;
|
|
2093
|
+
}
|
|
2094
|
+
u = i, w(), requestAnimationFrame(x);
|
|
2095
|
+
}, E = () => {
|
|
2096
|
+
_.classList.contains("is-open") && dr(e, _);
|
|
2097
|
+
}, D = () => E(), O = () => {
|
|
2098
|
+
f = Date.now() + 100;
|
|
2099
|
+
}, k = () => {
|
|
2100
|
+
O(), l = "days", c && (o = c.getFullYear(), s = c.getMonth());
|
|
2101
|
+
let t = m(o, s);
|
|
2102
|
+
o = t.y, s = t.m, u = c ? new Date(c.getFullYear(), c.getMonth(), c.getDate()) : h(o, s), w(), _.classList.add("is-open"), e.setAttribute("aria-expanded", "true"), requestAnimationFrame(() => {
|
|
2103
|
+
E(), x();
|
|
2104
|
+
});
|
|
2105
|
+
}, A = () => {
|
|
2106
|
+
_.classList.remove("is-open"), e.setAttribute("aria-expanded", "false"), l = "days";
|
|
2107
|
+
}, j = () => {
|
|
2108
|
+
if (d) {
|
|
2109
|
+
d = !1;
|
|
2110
|
+
return;
|
|
2111
|
+
}
|
|
2112
|
+
k();
|
|
2113
|
+
}, M = () => {
|
|
2114
|
+
_.classList.contains("is-open") || k();
|
|
2115
|
+
}, ee = (t) => {
|
|
2116
|
+
if (!t || !(t instanceof Node)) return !1;
|
|
2117
|
+
if (t === e || e.contains(t) || _.contains(t)) return !0;
|
|
2118
|
+
let n = e.id;
|
|
2119
|
+
if (n) {
|
|
2120
|
+
let e = document.querySelector("label[for=\"" + n.replace(/"/g, "\\\"") + "\"]");
|
|
2121
|
+
if (e && (t === e || e.contains(t))) return !0;
|
|
2122
|
+
}
|
|
2123
|
+
return !1;
|
|
2124
|
+
}, N = (e) => {
|
|
2125
|
+
Date.now() < f || ee(e.target) || A();
|
|
2126
|
+
}, P = (t) => {
|
|
2127
|
+
t.key === "Escape" && _.classList.contains("is-open") && (d = !0, A(), e.focus());
|
|
2128
|
+
};
|
|
2129
|
+
e.addEventListener("focus", j), e.addEventListener("click", M), document.addEventListener("click", N, !0), document.addEventListener("keydown", P), _.addEventListener("keydown", T), window.addEventListener("resize", D), window.addEventListener("scroll", D, !0), e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", "false"), e.setAttribute("autocomplete", "off"), t.push(() => e.removeEventListener("focus", j), () => e.removeEventListener("click", M), () => document.removeEventListener("click", N, !0), () => document.removeEventListener("keydown", P), () => _.removeEventListener("keydown", T), () => window.removeEventListener("resize", D), () => window.removeEventListener("scroll", D, !0), () => _.remove());
|
|
2130
|
+
}
|
|
2131
|
+
//#endregion
|
|
2132
|
+
//#region src/composables/useDraggable.ts
|
|
2133
|
+
function mr(e) {
|
|
2134
|
+
let t = !1;
|
|
2135
|
+
h(() => {
|
|
2136
|
+
let n = e.value;
|
|
2137
|
+
if (!n || typeof window > "u") return;
|
|
2138
|
+
let r = window;
|
|
2139
|
+
t = !0, r.VanduoDraggable && typeof r.VanduoDraggable.init == "function" ? r.VanduoDraggable.init(n) : r.Vanduo && typeof r.Vanduo.init == "function" && r.Vanduo.init(n);
|
|
2140
|
+
}), g(() => {
|
|
2141
|
+
if (typeof window > "u" || !t) return;
|
|
2142
|
+
let e = window;
|
|
2143
|
+
e.VanduoDraggable && typeof e.VanduoDraggable.destroyAll == "function" && e.VanduoDraggable.destroyAll(), t = !1;
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
//#endregion
|
|
2147
|
+
//#region src/composables/useDropdown.ts
|
|
2148
|
+
function hr(e) {
|
|
2149
|
+
let t = () => {
|
|
2150
|
+
let t = e.value;
|
|
2151
|
+
if (!t || typeof window > "u") return;
|
|
2152
|
+
let n = t, r = window;
|
|
2153
|
+
r.VanduoDropdown && typeof r.VanduoDropdown.init == "function" ? r.VanduoDropdown.init(n) : r.Vanduo && typeof r.Vanduo.init == "function" && r.Vanduo.init(n);
|
|
2154
|
+
}, n = () => {
|
|
2155
|
+
if (typeof window > "u") return;
|
|
2156
|
+
let e = window;
|
|
2157
|
+
e.VanduoDropdown && typeof e.VanduoDropdown.destroyAll == "function" && e.VanduoDropdown.destroyAll();
|
|
2158
|
+
};
|
|
2159
|
+
h(() => {
|
|
2160
|
+
t();
|
|
2161
|
+
}), g(() => {
|
|
2162
|
+
n();
|
|
2163
|
+
});
|
|
2164
|
+
}
|
|
2165
|
+
//#endregion
|
|
2166
|
+
//#region src/composables/useExpandingCards.ts
|
|
2167
|
+
function gr(e) {
|
|
2168
|
+
let t = !1;
|
|
2169
|
+
h(() => {
|
|
2170
|
+
let n = e.value;
|
|
2171
|
+
if (!n || typeof window > "u") return;
|
|
2172
|
+
let r = window;
|
|
2173
|
+
t = !0, r.VanduoExpandingCards && typeof r.VanduoExpandingCards.init == "function" ? r.VanduoExpandingCards.init(n) : r.Vanduo && typeof r.Vanduo.init == "function" && r.Vanduo.init(n);
|
|
2174
|
+
}), g(() => {
|
|
2175
|
+
if (typeof window > "u" || !t) return;
|
|
2176
|
+
let e = window;
|
|
2177
|
+
e.VanduoExpandingCards && typeof e.VanduoExpandingCards.destroyAll == "function" && e.VanduoExpandingCards.destroyAll(), t = !1;
|
|
2178
|
+
});
|
|
2179
|
+
}
|
|
2180
|
+
//#endregion
|
|
2181
|
+
//#region src/composables/useFlow.ts
|
|
2182
|
+
function _r(e) {
|
|
2183
|
+
let t = [], n = (e) => {
|
|
2184
|
+
let n = e.querySelector(".vd-flow-track");
|
|
2185
|
+
if (!n) return;
|
|
2186
|
+
let r = Array.from(n.querySelectorAll(".vd-flow-slide"));
|
|
2187
|
+
if (r.length === 0) return;
|
|
2188
|
+
let i = e.classList.contains("vd-flow-fade"), a = e.hasAttribute("data-vd-autoplay"), o = parseInt(e.getAttribute("data-vd-interval") ?? "", 10) || 5e3, s = e.getAttribute("data-vd-loop") !== "false", c = {
|
|
2189
|
+
current: 0,
|
|
2190
|
+
total: r.length
|
|
2191
|
+
}, l = null, u = !1, d = 0, f = 0;
|
|
2192
|
+
r.forEach((e, t) => {
|
|
2193
|
+
e.setAttribute("role", "group"), e.setAttribute("aria-roledescription", "slide"), e.setAttribute("aria-label", `Slide ${t + 1} of ${r.length}`), t === 0 && e.classList.add("is-active");
|
|
2194
|
+
}), e.setAttribute("role", "region"), e.setAttribute("aria-roledescription", "carousel"), e.getAttribute("aria-label") || e.setAttribute("aria-label", "Carousel");
|
|
2195
|
+
let p = document.createElement("div");
|
|
2196
|
+
p.setAttribute("aria-live", "polite"), p.setAttribute("aria-atomic", "true"), p.className = "sr-only", p.style.cssText = "position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);", e.appendChild(p);
|
|
2197
|
+
let m = Array.from(e.querySelectorAll(".vd-flow-indicators button, .vd-flow-indicator"));
|
|
2198
|
+
m.forEach((e, t) => {
|
|
2199
|
+
e.classList.add("vd-flow-indicator"), e.setAttribute("role", "tab"), e.setAttribute("aria-selected", t === 0 ? "true" : "false"), e.getAttribute("aria-label") || e.setAttribute("aria-label", `Go to slide ${t + 1}`);
|
|
2200
|
+
});
|
|
2201
|
+
let h = (t, a = !0) => {
|
|
2202
|
+
let o = s ? (t % c.total + c.total) % c.total : Math.max(0, Math.min(t, c.total - 1)), l = c.current;
|
|
2203
|
+
c.current = o, i ? r.forEach((e, t) => e.classList.toggle("is-active", t === o)) : n.style.transform = `translateX(-${o * 100}%)`, m.forEach((e, t) => {
|
|
2204
|
+
e.classList.toggle("is-active", t === o), e.setAttribute("aria-selected", t === o ? "true" : "false"), e.setAttribute("aria-current", t === o ? "true" : "false");
|
|
2205
|
+
}), r.forEach((e, t) => {
|
|
2206
|
+
e.setAttribute("aria-hidden", t === o ? "false" : "true");
|
|
2207
|
+
}), a && (p.textContent = `Slide ${o + 1} of ${c.total}`), e.dispatchEvent(new CustomEvent("flow:change", { detail: {
|
|
2208
|
+
current: o,
|
|
2209
|
+
previous: l,
|
|
2210
|
+
total: c.total
|
|
2211
|
+
} }));
|
|
2212
|
+
}, g = () => h(c.current + 1), _ = () => h(c.current - 1), v = e.querySelector(".vd-flow-prev"), y = e.querySelector(".vd-flow-next");
|
|
2213
|
+
v && (v.addEventListener("click", _), t.push(() => v.removeEventListener("click", _))), y && (y.addEventListener("click", g), t.push(() => y.removeEventListener("click", g))), m.forEach((e, n) => {
|
|
2214
|
+
let r = () => h(n);
|
|
2215
|
+
e.addEventListener("click", r), t.push(() => e.removeEventListener("click", r));
|
|
2216
|
+
});
|
|
2217
|
+
let b = (e) => {
|
|
2218
|
+
e.key === "ArrowLeft" && (_(), e.preventDefault()), e.key === "ArrowRight" && (g(), e.preventDefault());
|
|
2219
|
+
};
|
|
2220
|
+
e.setAttribute("tabindex", "0"), e.addEventListener("keydown", b), t.push(() => e.removeEventListener("keydown", b));
|
|
2221
|
+
let x = (t) => {
|
|
2222
|
+
u = !0, d = t.clientX || t.touches && t.touches[0]?.clientX || 0, f = d, e.classList.add("is-dragging");
|
|
2223
|
+
}, S = (e) => {
|
|
2224
|
+
u && (f = e.clientX || e.touches && e.touches[0]?.clientX || 0);
|
|
2225
|
+
}, C = () => {
|
|
2226
|
+
if (!u) return;
|
|
2227
|
+
u = !1, e.classList.remove("is-dragging");
|
|
2228
|
+
let t = d - f;
|
|
2229
|
+
Math.abs(t) > 50 && (t > 0 ? g() : _());
|
|
2230
|
+
};
|
|
2231
|
+
e.addEventListener("mousedown", x), e.addEventListener("mousemove", S), e.addEventListener("mouseup", C), e.addEventListener("mouseleave", C), e.addEventListener("touchstart", x, { passive: !0 }), e.addEventListener("touchmove", S, { passive: !0 }), e.addEventListener("touchend", C), t.push(() => e.removeEventListener("mousedown", x), () => e.removeEventListener("mousemove", S), () => e.removeEventListener("mouseup", C), () => e.removeEventListener("mouseleave", C), () => e.removeEventListener("touchstart", x), () => e.removeEventListener("touchmove", S), () => e.removeEventListener("touchend", C));
|
|
2232
|
+
let w = () => {
|
|
2233
|
+
T(), l = window.setInterval(g, o);
|
|
2234
|
+
}, T = () => {
|
|
2235
|
+
l != null && (window.clearInterval(l), l = null);
|
|
2236
|
+
};
|
|
2237
|
+
a && (w(), e.addEventListener("mouseenter", T), e.addEventListener("mouseleave", w), e.addEventListener("focusin", T), e.addEventListener("focusout", w), t.push(() => e.removeEventListener("mouseenter", T), () => e.removeEventListener("mouseleave", w), () => e.removeEventListener("focusin", T), () => e.removeEventListener("focusout", w), () => T())), h(0, !1);
|
|
2238
|
+
};
|
|
2239
|
+
h(() => {
|
|
2240
|
+
let t = e.value;
|
|
2241
|
+
t && t.querySelectorAll(".vd-flow, .vd-carousel").forEach(n);
|
|
2242
|
+
}), g(() => {
|
|
2243
|
+
t.forEach((e) => e()), t.length = 0;
|
|
2244
|
+
});
|
|
2245
|
+
}
|
|
2246
|
+
//#endregion
|
|
2247
|
+
//#region src/composables/useFocusTrap.ts
|
|
2248
|
+
var G = [
|
|
2249
|
+
"a[href]",
|
|
2250
|
+
"button:not([disabled])",
|
|
2251
|
+
"input:not([disabled])",
|
|
2252
|
+
"select:not([disabled])",
|
|
2253
|
+
"textarea:not([disabled])",
|
|
2254
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
2255
|
+
].join(","), vr = (e) => {
|
|
2256
|
+
let t = y(!1), n = (n) => {
|
|
2257
|
+
if (!t.value || n.key !== "Tab" || !e.value) return;
|
|
2258
|
+
let r = Array.from(e.value.querySelectorAll(G)).filter((e) => !e.hasAttribute("disabled") && e.tabIndex !== -1);
|
|
2259
|
+
if (r.length === 0) {
|
|
2260
|
+
n.preventDefault();
|
|
2261
|
+
return;
|
|
2262
|
+
}
|
|
2263
|
+
let i = r[0], a = r[r.length - 1], o = document.activeElement;
|
|
2264
|
+
n.shiftKey && o === i ? (n.preventDefault(), a.focus()) : !n.shiftKey && o === a && (n.preventDefault(), i.focus());
|
|
2265
|
+
};
|
|
2266
|
+
return h(() => {
|
|
2267
|
+
typeof window < "u" && window.addEventListener("keydown", n);
|
|
2268
|
+
}), g(() => {
|
|
2269
|
+
typeof window < "u" && window.removeEventListener("keydown", n);
|
|
2270
|
+
}), {
|
|
2271
|
+
active: t,
|
|
2272
|
+
activate: () => {
|
|
2273
|
+
t.value = !0, e.value && e.value.querySelector(G)?.focus();
|
|
2274
|
+
},
|
|
2275
|
+
deactivate: () => {
|
|
2276
|
+
t.value = !1;
|
|
2277
|
+
}
|
|
2278
|
+
};
|
|
2279
|
+
};
|
|
2280
|
+
//#endregion
|
|
2281
|
+
//#region src/composables/useGlass.ts
|
|
2282
|
+
function yr(e) {
|
|
2283
|
+
let t = [];
|
|
2284
|
+
h(() => {
|
|
2285
|
+
let n = e.value;
|
|
2286
|
+
!n || typeof IntersectionObserver > "u" || n.querySelectorAll("[data-glass-scroll]").forEach((e) => {
|
|
2287
|
+
let n = e.dataset.glassSentinel, r = n ? document.querySelector(n) : null;
|
|
2288
|
+
if (r ||= e.previousElementSibling, !r) {
|
|
2289
|
+
e.classList.add("is-glass-active");
|
|
2290
|
+
return;
|
|
2291
|
+
}
|
|
2292
|
+
let i = new IntersectionObserver((t) => {
|
|
2293
|
+
t.forEach((t) => {
|
|
2294
|
+
e.classList.toggle("is-glass-active", !t.isIntersecting);
|
|
2295
|
+
});
|
|
2296
|
+
}, {
|
|
2297
|
+
threshold: 0,
|
|
2298
|
+
rootMargin: "0px"
|
|
2299
|
+
});
|
|
2300
|
+
i.observe(r), t.push(i);
|
|
2301
|
+
});
|
|
2302
|
+
}), g(() => {
|
|
2303
|
+
t.forEach((e) => e.disconnect()), t.length = 0;
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
//#endregion
|
|
2307
|
+
//#region src/composables/useImageBox.ts
|
|
2308
|
+
function br(e) {
|
|
2309
|
+
let t = !1;
|
|
2310
|
+
h(() => {
|
|
2311
|
+
let n = e.value;
|
|
2312
|
+
if (!n || typeof window > "u") return;
|
|
2313
|
+
let r = window;
|
|
2314
|
+
t = !0, r.VanduoImageBox && typeof r.VanduoImageBox.init == "function" ? r.VanduoImageBox.init(n) : r.Vanduo && typeof r.Vanduo.init == "function" && r.Vanduo.init(n);
|
|
2315
|
+
}), g(() => {
|
|
2316
|
+
if (typeof window > "u" || !t) return;
|
|
2317
|
+
let e = window;
|
|
2318
|
+
e.VanduoImageBox && typeof e.VanduoImageBox.destroyAll == "function" && e.VanduoImageBox.destroyAll(), t = !1;
|
|
2319
|
+
});
|
|
2320
|
+
}
|
|
2321
|
+
//#endregion
|
|
2322
|
+
//#region src/composables/useKeyboardNav.ts
|
|
2323
|
+
var xr = (e, t) => {
|
|
2324
|
+
let n = y(0), r = 0, i = () => e.value ? Array.from(e.value.querySelectorAll(t.itemSelector)) : [], a = (e) => {
|
|
2325
|
+
let t = i()[e];
|
|
2326
|
+
t && (t.focus(), n.value = e);
|
|
2327
|
+
};
|
|
2328
|
+
return typeof window < "u" && e.value && e.value.addEventListener("keydown", (e) => {
|
|
2329
|
+
let r = i();
|
|
2330
|
+
if (r.length === 0) return;
|
|
2331
|
+
let o = r.length - 1, s = n.value;
|
|
2332
|
+
switch (e.key) {
|
|
2333
|
+
case "ArrowDown":
|
|
2334
|
+
case "ArrowRight":
|
|
2335
|
+
s = Math.min(o, n.value + 1);
|
|
2336
|
+
break;
|
|
2337
|
+
case "ArrowUp":
|
|
2338
|
+
case "ArrowLeft":
|
|
2339
|
+
s = Math.max(0, n.value - 1);
|
|
2340
|
+
break;
|
|
2341
|
+
case "Home":
|
|
2342
|
+
s = 0;
|
|
2343
|
+
break;
|
|
2344
|
+
case "End":
|
|
2345
|
+
s = o;
|
|
2346
|
+
break;
|
|
2347
|
+
case "Enter":
|
|
2348
|
+
t.onSelect?.(n.value);
|
|
2349
|
+
return;
|
|
2350
|
+
case "Escape":
|
|
2351
|
+
t.onEscape?.();
|
|
2352
|
+
return;
|
|
2353
|
+
default: return;
|
|
2354
|
+
}
|
|
2355
|
+
e.preventDefault(), a(s);
|
|
2356
|
+
}), {
|
|
2357
|
+
activeIndex: n,
|
|
2358
|
+
setItems: (e) => {
|
|
2359
|
+
r = e, n.value >= r && (n.value = Math.max(0, r - 1));
|
|
2360
|
+
}
|
|
2361
|
+
};
|
|
2362
|
+
}, Sr = 750;
|
|
2363
|
+
function Cr(e) {
|
|
2364
|
+
let t = [], n = (e) => {
|
|
2365
|
+
if (!e.querySelector(".vd-morph-wave")) {
|
|
2366
|
+
let t = document.createElement("span");
|
|
2367
|
+
t.className = "vd-morph-wave", t.setAttribute("aria-hidden", "true"), e.insertBefore(t, e.firstChild);
|
|
2368
|
+
}
|
|
2369
|
+
if (!e.querySelector(".vd-morph-shine")) {
|
|
2370
|
+
let t = document.createElement("span");
|
|
2371
|
+
t.className = "vd-morph-shine", t.setAttribute("aria-hidden", "true");
|
|
2372
|
+
let n = e.querySelector(".vd-morph-wave");
|
|
2373
|
+
n?.nextSibling ? e.insertBefore(t, n.nextSibling) : e.insertBefore(t, e.firstChild);
|
|
2374
|
+
}
|
|
2375
|
+
}, r = (e, t, n) => {
|
|
2376
|
+
let r = e.querySelector(".vd-morph-wave");
|
|
2377
|
+
if (r) {
|
|
2378
|
+
let n = e.getBoundingClientRect(), i = n.left + n.width / 2, a = n.top + n.height / 2, o = t && t.clientX || i, s = t && t.clientY || a;
|
|
2379
|
+
r.style.left = `${o - n.left}px`, r.style.top = `${s - n.top}px`;
|
|
2380
|
+
}
|
|
2381
|
+
e.classList.add("is-morphing");
|
|
2382
|
+
let i = Sr, a = getComputedStyle(e).getPropertyValue("--vd-morph-duration");
|
|
2383
|
+
if (a) {
|
|
2384
|
+
let e = parseFloat(a);
|
|
2385
|
+
isNaN(e) || (i = e * (a.includes("ms") ? 1 : 1e3));
|
|
2386
|
+
}
|
|
2387
|
+
window.setTimeout(() => {
|
|
2388
|
+
e.classList.remove("is-morphing");
|
|
2389
|
+
let t = e.querySelector(".vd-morph-current"), r = e.querySelector(".vd-morph-next");
|
|
2390
|
+
t && r && (t.classList.replace("vd-morph-current", "vd-morph-next"), r.classList.replace("vd-morph-next", "vd-morph-current")), n();
|
|
2391
|
+
}, i);
|
|
2392
|
+
};
|
|
2393
|
+
h(() => {
|
|
2394
|
+
let i = e.value;
|
|
2395
|
+
i && i.querySelectorAll(".vd-morph, [data-vd-morph]").forEach((e) => {
|
|
2396
|
+
if (e.getAttribute("data-vd-morph") === "manual") return;
|
|
2397
|
+
n(e);
|
|
2398
|
+
let i = !1, a = (t) => {
|
|
2399
|
+
i || (i = !0, r(e, t, () => i = !1));
|
|
2400
|
+
};
|
|
2401
|
+
e.addEventListener("click", a), t.push(() => e.removeEventListener("click", a));
|
|
2402
|
+
});
|
|
2403
|
+
}), g(() => {
|
|
2404
|
+
t.forEach((e) => e()), t.length = 0;
|
|
2405
|
+
});
|
|
2406
|
+
}
|
|
2407
|
+
//#endregion
|
|
2408
|
+
//#region src/composables/useMorphBadges.ts
|
|
2409
|
+
function wr(e) {
|
|
2410
|
+
let t = [], n = (e, t, n) => {
|
|
2411
|
+
if (!e) return;
|
|
2412
|
+
let r = String(t || "").replace(/[^a-z0-9-\s]/gi, "").trim();
|
|
2413
|
+
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
2414
|
+
if (r) {
|
|
2415
|
+
let t = document.createElement("i");
|
|
2416
|
+
t.className = `ph ${r}`, t.style.marginRight = "0.35rem", e.appendChild(t);
|
|
2417
|
+
}
|
|
2418
|
+
e.appendChild(document.createTextNode(n == null ? "" : String(n)));
|
|
2419
|
+
};
|
|
2420
|
+
h(() => {
|
|
2421
|
+
let r = e.value;
|
|
2422
|
+
r && r.querySelectorAll("[data-vd-morph=\"manual\"][data-morph-states]").forEach((e) => {
|
|
2423
|
+
let r = JSON.parse(e.getAttribute("data-morph-states") || "[]"), i = JSON.parse(e.getAttribute("data-morph-classes") || "[]"), a = JSON.parse(e.getAttribute("data-morph-icons") || "[]"), o = 0, s = !1, c = 750, l = getComputedStyle(e).getPropertyValue("--vd-morph-duration").trim();
|
|
2424
|
+
if (l) {
|
|
2425
|
+
let e = parseFloat(l);
|
|
2426
|
+
isNaN(e) || (c = e * (l.includes("ms") ? 1 : 1e3));
|
|
2427
|
+
}
|
|
2428
|
+
let u = (t) => {
|
|
2429
|
+
if (s || r.length === 0) return;
|
|
2430
|
+
s = !0;
|
|
2431
|
+
let l = (o + 1) % r.length, u = (l + 1) % r.length, d = e.querySelector(".vd-morph-next");
|
|
2432
|
+
d && n(d, a[l] ?? "", r[l] ?? "");
|
|
2433
|
+
let f = e.querySelector(".vd-morph-wave");
|
|
2434
|
+
if (f) {
|
|
2435
|
+
let n = e.getBoundingClientRect();
|
|
2436
|
+
f.style.left = `${(t.clientX || n.left + n.width / 2) - n.left}px`, f.style.top = `${(t.clientY || n.top + n.height / 2) - n.top}px`;
|
|
2437
|
+
}
|
|
2438
|
+
e.classList.add("is-morphing"), window.setTimeout(() => {
|
|
2439
|
+
e.classList.remove("is-morphing"), i.forEach((t) => e.classList.remove(t)), i[l] && e.classList.add(i[l]);
|
|
2440
|
+
let t = e.querySelector(".vd-morph-current"), c = e.querySelector(".vd-morph-next");
|
|
2441
|
+
t && n(t, a[l] ?? "", r[l] ?? ""), c && n(c, a[u] ?? "", r[u] ?? ""), o = l, s = !1;
|
|
2442
|
+
}, c);
|
|
2443
|
+
};
|
|
2444
|
+
e.addEventListener("click", u), t.push(() => e.removeEventListener("click", u));
|
|
2445
|
+
});
|
|
2446
|
+
}), g(() => {
|
|
2447
|
+
t.forEach((e) => e()), t.length = 0;
|
|
2448
|
+
});
|
|
2449
|
+
}
|
|
2450
|
+
//#endregion
|
|
2451
|
+
//#region src/composables/useNavbarGlassScroll.ts
|
|
2452
|
+
function Tr(e) {
|
|
2453
|
+
let t = y(!1), n = null;
|
|
2454
|
+
return h(() => {
|
|
2455
|
+
let r = e.value;
|
|
2456
|
+
if (!r) return;
|
|
2457
|
+
let i = r.classList.contains("vd-navbar-glass"), a = r.classList.contains("vd-navbar-transparent");
|
|
2458
|
+
if (!i && !a) return;
|
|
2459
|
+
let o = () => {
|
|
2460
|
+
let e = parseInt(r.dataset.scrollThreshold ?? "", 10);
|
|
2461
|
+
return Number.isNaN(e) ? r.offsetHeight || 60 : e;
|
|
2462
|
+
};
|
|
2463
|
+
n = () => {
|
|
2464
|
+
t.value = window.scrollY > o();
|
|
2465
|
+
}, n(), window.addEventListener("scroll", n, { passive: !0 });
|
|
2466
|
+
}), g(() => {
|
|
2467
|
+
n &&= (window.removeEventListener("scroll", n), null);
|
|
2468
|
+
}), t;
|
|
2469
|
+
}
|
|
2470
|
+
//#endregion
|
|
2471
|
+
//#region src/composables/useParallax.ts
|
|
2472
|
+
function Er(e) {
|
|
2473
|
+
let t = /* @__PURE__ */ new Map(), n = !1, r = null, i = (e) => e.classList.contains("vd-parallax-slow") ? .5 : e.classList.contains("vd-parallax-fast") ? 1.5 : 1, a = (e) => {
|
|
2474
|
+
let n = t.get(e);
|
|
2475
|
+
if (!n) return;
|
|
2476
|
+
let r = e.getBoundingClientRect(), i = window.innerHeight, a = (Math.max(0, Math.min(1, (i - r.top) / (i + r.height))) - .5) * n.speed * 100;
|
|
2477
|
+
n.layers.forEach((e) => {
|
|
2478
|
+
let t = e.dataset.parallaxSpeed ?? e.dataset.speed, r = a * (t ? parseFloat(t) : 1);
|
|
2479
|
+
e.style.transform = n.direction === "horizontal" ? `translateX(${r}px)` : `translateY(${r}px)`;
|
|
2480
|
+
});
|
|
2481
|
+
}, o = () => t.forEach((e, t) => a(t)), s = () => {
|
|
2482
|
+
n ||= (window.requestAnimationFrame(() => {
|
|
2483
|
+
o(), n = !1;
|
|
2484
|
+
}), !0);
|
|
2485
|
+
};
|
|
2486
|
+
h(() => {
|
|
2487
|
+
if (typeof window > "u" || window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return;
|
|
2488
|
+
let n = e.value;
|
|
2489
|
+
n && (n.querySelectorAll(".vd-parallax").forEach((e) => {
|
|
2490
|
+
let n = Array.from(e.querySelectorAll(".vd-parallax-layer, .vd-parallax-bg")), r = e.classList.contains("vd-parallax-horizontal") ? "horizontal" : "vertical";
|
|
2491
|
+
t.set(e, {
|
|
2492
|
+
layers: n,
|
|
2493
|
+
speed: i(e),
|
|
2494
|
+
direction: r
|
|
2495
|
+
}), a(e);
|
|
2496
|
+
}), r = () => s(), window.addEventListener("scroll", r, { passive: !0 }), s());
|
|
2497
|
+
}), g(() => {
|
|
2498
|
+
r && window.removeEventListener("scroll", r), r = null, t.forEach((e) => {
|
|
2499
|
+
e.layers.forEach((e) => e.style.transform = "");
|
|
2500
|
+
}), t.clear();
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
//#endregion
|
|
2504
|
+
//#region src/composables/usePopover.ts
|
|
2505
|
+
function Dr(e) {
|
|
2506
|
+
let t = !1;
|
|
2507
|
+
h(() => {
|
|
2508
|
+
let n = e.value;
|
|
2509
|
+
if (!n || typeof window > "u") return;
|
|
2510
|
+
let r = window;
|
|
2511
|
+
t = !0, r.VanduoBubble && typeof r.VanduoBubble.init == "function" ? r.VanduoBubble.init(n) : r.Vanduo && typeof r.Vanduo.init == "function" && r.Vanduo.init(n);
|
|
2512
|
+
}), g(() => {
|
|
2513
|
+
if (typeof window > "u" || !t) return;
|
|
2514
|
+
let e = window;
|
|
2515
|
+
e.VanduoBubble && typeof e.VanduoBubble.destroyAll == "function" && e.VanduoBubble.destroyAll(), t = !1;
|
|
2516
|
+
});
|
|
2517
|
+
}
|
|
2518
|
+
//#endregion
|
|
2519
|
+
//#region src/composables/useRipple.ts
|
|
2520
|
+
function Or(e) {
|
|
2521
|
+
h(() => {
|
|
2522
|
+
let t = e.value;
|
|
2523
|
+
if (!t || typeof window > "u") return;
|
|
2524
|
+
let n = window;
|
|
2525
|
+
n.VanduoRipple && typeof n.VanduoRipple.init == "function" ? n.VanduoRipple.init(t) : n.Vanduo && typeof n.Vanduo.init == "function" && n.Vanduo.init(t);
|
|
2526
|
+
}), g(() => {
|
|
2527
|
+
if (typeof window > "u") return;
|
|
2528
|
+
let e = window;
|
|
2529
|
+
e.VanduoRipple && typeof e.VanduoRipple.destroyAll == "function" && e.VanduoRipple.destroyAll();
|
|
2530
|
+
});
|
|
2531
|
+
}
|
|
2532
|
+
//#endregion
|
|
2533
|
+
//#region src/composables/useScrollspy.ts
|
|
2534
|
+
var kr = (e, t = {}) => {
|
|
2535
|
+
let n = y(e[0] ?? null), r = t.offset ?? 96, i = null;
|
|
2536
|
+
return h(() => {
|
|
2537
|
+
if (typeof window > "u" || !("IntersectionObserver" in window)) return;
|
|
2538
|
+
let a = /* @__PURE__ */ new Set();
|
|
2539
|
+
i = new IntersectionObserver((t) => {
|
|
2540
|
+
for (let e of t) e.isIntersecting ? a.add(e.target.id) : a.delete(e.target.id);
|
|
2541
|
+
let r = e.find((e) => a.has(e));
|
|
2542
|
+
r && (n.value = r);
|
|
2543
|
+
}, {
|
|
2544
|
+
rootMargin: t.rootMargin ?? `-${r}px 0px -60% 0px`,
|
|
2545
|
+
threshold: 0
|
|
2546
|
+
});
|
|
2547
|
+
for (let t of e) {
|
|
2548
|
+
let e = document.getElementById(t);
|
|
2549
|
+
e && i.observe(e);
|
|
2550
|
+
}
|
|
2551
|
+
}), g(() => {
|
|
2552
|
+
i?.disconnect(), i = null;
|
|
2553
|
+
}), { activeId: n };
|
|
2554
|
+
};
|
|
2555
|
+
//#endregion
|
|
2556
|
+
//#region src/composables/useSearch.ts
|
|
2557
|
+
function Ar(e) {
|
|
2558
|
+
h(() => {
|
|
2559
|
+
if (typeof window > "u") return;
|
|
2560
|
+
let e = window;
|
|
2561
|
+
e.VanduoSearch && e.VanduoSearch.list();
|
|
2562
|
+
}), g(() => {});
|
|
2563
|
+
}
|
|
2564
|
+
//#endregion
|
|
2565
|
+
//#region src/composables/useSidenav.ts
|
|
2566
|
+
function jr(e) {
|
|
2567
|
+
let t = [], n = [], r = (e, t) => {
|
|
2568
|
+
!e.classList.contains("vd-sidenav-fixed") && !e.classList.contains("vd-offcanvas-fixed") && t.classList.add("is-visible"), e.classList.add("is-open"), e.setAttribute("aria-hidden", "false"), document.body.classList.add("body-sidenav-open"), e.dispatchEvent(new CustomEvent("sidenav:open", { bubbles: !0 }));
|
|
2569
|
+
}, i = (e, t) => {
|
|
2570
|
+
t.classList.remove("is-visible"), e.classList.remove("is-open"), e.setAttribute("aria-hidden", "true"), document.body.classList.remove("body-sidenav-open"), e.dispatchEvent(new CustomEvent("sidenav:close", { bubbles: !0 }));
|
|
2571
|
+
}, a = (e, t) => {
|
|
2572
|
+
e.classList.contains("is-open") ? i(e, t) : r(e, t);
|
|
2573
|
+
};
|
|
2574
|
+
h(() => {
|
|
2575
|
+
let r = e.value;
|
|
2576
|
+
if (!r) return;
|
|
2577
|
+
let o = /* @__PURE__ */ new Map();
|
|
2578
|
+
r.querySelectorAll(".vd-sidenav, .vd-offcanvas").forEach((e) => {
|
|
2579
|
+
let r = e.getAttribute("data-vd-position");
|
|
2580
|
+
if (r) {
|
|
2581
|
+
let t = e.classList.contains("vd-offcanvas") ? "vd-offcanvas" : "vd-sidenav";
|
|
2582
|
+
e.classList.add(`${t}-${r}`);
|
|
2583
|
+
}
|
|
2584
|
+
let a = document.createElement("div");
|
|
2585
|
+
a.className = "vd-sidenav-overlay", document.body.appendChild(a), n.push(a), o.set(e, a), e.setAttribute("role", "navigation"), e.setAttribute("aria-hidden", "true");
|
|
2586
|
+
let s = e.querySelector(".vd-sidenav-close, .vd-offcanvas-close");
|
|
2587
|
+
if (s) {
|
|
2588
|
+
let n = () => i(e, a);
|
|
2589
|
+
s.addEventListener("click", n), t.push(() => s.removeEventListener("click", n));
|
|
2590
|
+
}
|
|
2591
|
+
let c = () => {
|
|
2592
|
+
e.dataset.backdrop !== "static" && i(e, a);
|
|
2593
|
+
};
|
|
2594
|
+
a.addEventListener("click", c), t.push(() => a.removeEventListener("click", c));
|
|
2595
|
+
let l = (t) => {
|
|
2596
|
+
t.key === "Escape" && e.classList.contains("is-open") && e.dataset.keyboard !== "false" && i(e, a);
|
|
2597
|
+
};
|
|
2598
|
+
document.addEventListener("keydown", l), t.push(() => document.removeEventListener("keydown", l));
|
|
2599
|
+
}), r.querySelectorAll("[data-sidenav-toggle]").forEach((e) => {
|
|
2600
|
+
let n = (t) => {
|
|
2601
|
+
t.preventDefault();
|
|
2602
|
+
let n = e.dataset.sidenavToggle;
|
|
2603
|
+
if (!n) return;
|
|
2604
|
+
let r = document.querySelector(n), i = r ? o.get(r) : void 0;
|
|
2605
|
+
r && i && a(r, i);
|
|
2606
|
+
};
|
|
2607
|
+
e.addEventListener("click", n), t.push(() => e.removeEventListener("click", n));
|
|
2608
|
+
});
|
|
2609
|
+
}), g(() => {
|
|
2610
|
+
t.forEach((e) => e()), t.length = 0, n.forEach((e) => e.remove()), n.length = 0, document.body.classList.remove("body-sidenav-open");
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
//#endregion
|
|
2614
|
+
//#region src/composables/useSpotlight.ts
|
|
2615
|
+
function Mr(e) {
|
|
2616
|
+
let t = !1;
|
|
2617
|
+
h(() => {
|
|
2618
|
+
let n = e.value;
|
|
2619
|
+
if (!n || typeof window > "u") return;
|
|
2620
|
+
let r = window;
|
|
2621
|
+
t = !0, r.VanduoSpotlight && typeof r.VanduoSpotlight.init == "function" ? r.VanduoSpotlight.init(n) : r.Vanduo && typeof r.Vanduo.init == "function" && r.Vanduo.init(n);
|
|
2622
|
+
}), g(() => {
|
|
2623
|
+
if (typeof window > "u" || !t) return;
|
|
2624
|
+
let e = window;
|
|
2625
|
+
e.VanduoSpotlight && typeof e.VanduoSpotlight.destroyAll == "function" && e.VanduoSpotlight.destroyAll(), t = !1;
|
|
2626
|
+
});
|
|
2627
|
+
}
|
|
2628
|
+
//#endregion
|
|
2629
|
+
//#region src/composables/useStepper.ts
|
|
2630
|
+
function Nr(e) {
|
|
2631
|
+
let t = /* @__PURE__ */ new Map(), n = [];
|
|
2632
|
+
return h(() => {
|
|
2633
|
+
let r = e.value;
|
|
2634
|
+
r && r.querySelectorAll(".vd-stepper").forEach((e) => {
|
|
2635
|
+
let r = Array.from(e.querySelectorAll(".vd-stepper-item")), i = e.classList.contains("vd-stepper-clickable"), a = r.findIndex((e) => e.classList.contains("is-active"));
|
|
2636
|
+
a === -1 && (a = 0);
|
|
2637
|
+
let o = (t) => {
|
|
2638
|
+
if (t < 0 || t >= r.length) return;
|
|
2639
|
+
let n = a;
|
|
2640
|
+
a = t, r.forEach((e, n) => {
|
|
2641
|
+
e.classList.remove("is-active", "is-completed"), e.removeAttribute("aria-current"), n < t ? e.classList.add("is-completed") : n === t && (e.classList.add("is-active"), e.setAttribute("aria-current", "step"));
|
|
2642
|
+
}), e.dispatchEvent(new CustomEvent("stepper:change", {
|
|
2643
|
+
detail: {
|
|
2644
|
+
current: t,
|
|
2645
|
+
previous: n,
|
|
2646
|
+
total: r.length
|
|
2647
|
+
},
|
|
2648
|
+
bubbles: !0
|
|
2649
|
+
}));
|
|
2650
|
+
};
|
|
2651
|
+
i && r.forEach((e, t) => {
|
|
2652
|
+
let r = () => o(t);
|
|
2653
|
+
e.addEventListener("click", r);
|
|
2654
|
+
let i = (e) => {
|
|
2655
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), o(t));
|
|
2656
|
+
};
|
|
2657
|
+
e.addEventListener("keydown", i), n.push(() => e.removeEventListener("click", r)), n.push(() => e.removeEventListener("keydown", i));
|
|
2658
|
+
}), o(a), t.set(e, {
|
|
2659
|
+
setStep: o,
|
|
2660
|
+
next: () => o(a + 1),
|
|
2661
|
+
prev: () => o(a - 1)
|
|
2662
|
+
});
|
|
2663
|
+
});
|
|
2664
|
+
}), g(() => {
|
|
2665
|
+
n.forEach((e) => e()), n.length = 0, t.clear();
|
|
2666
|
+
}), {
|
|
2667
|
+
next: (e) => {
|
|
2668
|
+
e && t.get(e)?.next();
|
|
2669
|
+
},
|
|
2670
|
+
prev: (e) => {
|
|
2671
|
+
e && t.get(e)?.prev();
|
|
2672
|
+
},
|
|
2673
|
+
setStep: (e, n) => {
|
|
2674
|
+
e && t.get(e)?.setStep(n);
|
|
2675
|
+
}
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
//#endregion
|
|
2679
|
+
//#region src/composables/useSuggest.ts
|
|
2680
|
+
function Pr(e, t) {
|
|
2681
|
+
try {
|
|
2682
|
+
let n = new URL(e, window.location.href);
|
|
2683
|
+
return n.origin === window.location.origin ? !0 : t.includes(n.origin);
|
|
2684
|
+
} catch {
|
|
2685
|
+
return !1;
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
var K = (e) => typeof e == "object" && (e.label || e.text) || String(e);
|
|
2689
|
+
function Fr(e) {
|
|
2690
|
+
let t = [];
|
|
2691
|
+
h(() => {
|
|
2692
|
+
if (typeof window > "u") return;
|
|
2693
|
+
let n = e.value;
|
|
2694
|
+
n && n.querySelectorAll("[data-vd-suggest], [data-vd-autocomplete]").forEach((e) => {
|
|
2695
|
+
let n = parseInt(e.getAttribute("data-vd-suggest-min-chars") || "1", 10), r = e.getAttribute("data-vd-suggest-url") || "", i = (e.getAttribute("data-vd-suggest-allowlist") || "").split(",").map((e) => e.trim()).filter(Boolean), a = e.getAttribute("data-vd-suggest") || e.getAttribute("data-vd-autocomplete") || "", o = [];
|
|
2696
|
+
try {
|
|
2697
|
+
o = JSON.parse(a);
|
|
2698
|
+
} catch {
|
|
2699
|
+
o = a.split(",").map((e) => e.trim()).filter(Boolean);
|
|
2700
|
+
}
|
|
2701
|
+
let s = e.closest(".vd-suggest-wrapper, .vd-autocomplete-wrapper");
|
|
2702
|
+
s || (s = document.createElement("div"), s.className = "vd-suggest-wrapper", e.parentNode?.insertBefore(s, e), s.appendChild(e));
|
|
2703
|
+
let c = document.createElement("ul");
|
|
2704
|
+
c.className = "vd-suggest-list", c.setAttribute("role", "listbox");
|
|
2705
|
+
let l = "vd-suggest-" + Math.random().toString(36).slice(2, 9);
|
|
2706
|
+
c.id = l, s.appendChild(c), e.setAttribute("role", "combobox"), e.setAttribute("aria-autocomplete", "list"), e.setAttribute("aria-expanded", "false"), e.setAttribute("aria-controls", l), e.setAttribute("autocomplete", "off");
|
|
2707
|
+
let u = -1, d = [], f = null, p = (e, t) => {
|
|
2708
|
+
if (c.innerHTML = "", d = e, u = -1, e.length === 0) {
|
|
2709
|
+
let e = document.createElement("li");
|
|
2710
|
+
e.className = "vd-suggest-empty", e.textContent = "No results", c.appendChild(e);
|
|
2711
|
+
return;
|
|
2712
|
+
}
|
|
2713
|
+
e.forEach((e, n) => {
|
|
2714
|
+
let r = document.createElement("li");
|
|
2715
|
+
r.className = "vd-suggest-item", r.setAttribute("role", "option"), r.id = l + "-item-" + n;
|
|
2716
|
+
let i = K(e);
|
|
2717
|
+
if (t) {
|
|
2718
|
+
let e = i.toLowerCase(), n = t.toLowerCase(), a = 0, o = e.indexOf(n, a);
|
|
2719
|
+
for (; o !== -1;) {
|
|
2720
|
+
o > a && r.appendChild(document.createTextNode(i.slice(a, o)));
|
|
2721
|
+
let s = document.createElement("span");
|
|
2722
|
+
s.className = "vd-suggest-match", s.textContent = i.slice(o, o + t.length), r.appendChild(s), a = o + t.length, o = e.indexOf(n, a);
|
|
2723
|
+
}
|
|
2724
|
+
a < i.length && r.appendChild(document.createTextNode(i.slice(a)));
|
|
2725
|
+
} else r.textContent = i;
|
|
2726
|
+
r.addEventListener("click", () => g(n)), c.appendChild(r);
|
|
2727
|
+
});
|
|
2728
|
+
}, m = () => {
|
|
2729
|
+
c.classList.add("is-open"), e.setAttribute("aria-expanded", "true");
|
|
2730
|
+
}, h = () => {
|
|
2731
|
+
c.classList.remove("is-open"), e.setAttribute("aria-expanded", "false"), u = -1, e.removeAttribute("aria-activedescendant");
|
|
2732
|
+
}, g = (t) => {
|
|
2733
|
+
let n = d[t], r = typeof n == "object" && (n.value || n.label) || String(n);
|
|
2734
|
+
e.value = r, h(), e.dispatchEvent(new CustomEvent("suggest:select", {
|
|
2735
|
+
bubbles: !0,
|
|
2736
|
+
detail: {
|
|
2737
|
+
value: r,
|
|
2738
|
+
item: n,
|
|
2739
|
+
index: t
|
|
2740
|
+
}
|
|
2741
|
+
}));
|
|
2742
|
+
}, _ = (t) => {
|
|
2743
|
+
let n = c.querySelectorAll(".vd-suggest-item");
|
|
2744
|
+
n.forEach((e) => e.classList.remove("is-highlighted")), t >= 0 && t < n.length && (u = t, n[t].classList.add("is-highlighted"), e.setAttribute("aria-activedescendant", n[t].id), n[t].scrollIntoView({ block: "nearest" }));
|
|
2745
|
+
}, v = async (e) => {
|
|
2746
|
+
if (e.length < n) {
|
|
2747
|
+
h();
|
|
2748
|
+
return;
|
|
2749
|
+
}
|
|
2750
|
+
let t;
|
|
2751
|
+
if (r) try {
|
|
2752
|
+
if (!Pr(r, i)) t = [];
|
|
2753
|
+
else {
|
|
2754
|
+
let n = r.includes("?") ? "&" : "?";
|
|
2755
|
+
t = await (await window.fetch(r + n + "q=" + encodeURIComponent(e))).json();
|
|
2756
|
+
}
|
|
2757
|
+
} catch {
|
|
2758
|
+
t = [];
|
|
2759
|
+
}
|
|
2760
|
+
else {
|
|
2761
|
+
let n = e.toLowerCase();
|
|
2762
|
+
t = o.filter((e) => K(e).toLowerCase().includes(n));
|
|
2763
|
+
}
|
|
2764
|
+
p(t, e), m();
|
|
2765
|
+
}, y = () => {
|
|
2766
|
+
f && clearTimeout(f), f = setTimeout(() => void v(e.value), 200);
|
|
2767
|
+
}, b = (t) => {
|
|
2768
|
+
if (!c.classList.contains("is-open")) {
|
|
2769
|
+
t.key === "ArrowDown" && (v(e.value), t.preventDefault());
|
|
2770
|
+
return;
|
|
2771
|
+
}
|
|
2772
|
+
let n = d.length;
|
|
2773
|
+
switch (t.key) {
|
|
2774
|
+
case "ArrowDown":
|
|
2775
|
+
t.preventDefault(), _(u < n - 1 ? u + 1 : 0);
|
|
2776
|
+
break;
|
|
2777
|
+
case "ArrowUp":
|
|
2778
|
+
t.preventDefault(), _(u > 0 ? u - 1 : n - 1);
|
|
2779
|
+
break;
|
|
2780
|
+
case "Enter":
|
|
2781
|
+
t.preventDefault(), u >= 0 && g(u);
|
|
2782
|
+
break;
|
|
2783
|
+
case "Escape":
|
|
2784
|
+
h();
|
|
2785
|
+
break;
|
|
2786
|
+
}
|
|
2787
|
+
}, x = () => {
|
|
2788
|
+
setTimeout(h, 200);
|
|
2789
|
+
}, S = () => {
|
|
2790
|
+
e.value.length >= n && v(e.value);
|
|
2791
|
+
};
|
|
2792
|
+
e.addEventListener("input", y), e.addEventListener("keydown", b), e.addEventListener("blur", x), e.addEventListener("focus", S), t.push(() => e.removeEventListener("input", y), () => e.removeEventListener("keydown", b), () => e.removeEventListener("blur", x), () => e.removeEventListener("focus", S), () => {
|
|
2793
|
+
f && clearTimeout(f);
|
|
2794
|
+
}, () => {
|
|
2795
|
+
c.parentNode && c.parentNode.removeChild(c);
|
|
2796
|
+
});
|
|
2797
|
+
});
|
|
2798
|
+
}), g(() => {
|
|
2799
|
+
t.forEach((e) => e()), t.length = 0;
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2802
|
+
//#endregion
|
|
2803
|
+
//#region src/composables/useTabs.ts
|
|
2804
|
+
function Ir(e) {
|
|
2805
|
+
let t = [];
|
|
2806
|
+
h(() => {
|
|
2807
|
+
let n = e.value;
|
|
2808
|
+
n && n.querySelectorAll(".vd-tabs").forEach((e) => {
|
|
2809
|
+
e.querySelectorAll(".vd-tab-link[data-tab-target]").forEach((n) => {
|
|
2810
|
+
let r = () => {
|
|
2811
|
+
if (n.classList.contains("disabled")) return;
|
|
2812
|
+
let t = n.getAttribute("data-tab-target");
|
|
2813
|
+
t && (e.querySelectorAll(".vd-tab-link").forEach((e) => {
|
|
2814
|
+
e.classList.remove("is-active"), e.setAttribute("aria-selected", "false");
|
|
2815
|
+
}), e.querySelectorAll(".vd-tab-pane").forEach((e) => e.classList.remove("is-active")), n.classList.add("is-active"), n.setAttribute("aria-selected", "true"), e.querySelector(`#${CSS.escape(t)}`)?.classList.add("is-active"));
|
|
2816
|
+
};
|
|
2817
|
+
n.addEventListener("click", r), t.push(() => n.removeEventListener("click", r));
|
|
2818
|
+
});
|
|
2819
|
+
});
|
|
2820
|
+
}), g(() => {
|
|
2821
|
+
t.forEach((e) => e()), t.length = 0;
|
|
2822
|
+
});
|
|
2823
|
+
}
|
|
2824
|
+
//#endregion
|
|
2825
|
+
//#region src/composables/useTheme.ts
|
|
2826
|
+
var q = {
|
|
2827
|
+
...ee,
|
|
2828
|
+
PRIMARY_DARK: "blue"
|
|
2829
|
+
}, Lr = te.map((e) => e.key), Rr = (e) => Lr.includes(e), J = {
|
|
2830
|
+
PALETTE: "vanduo-palette",
|
|
2831
|
+
PRIMARY: "vanduo-primary-color",
|
|
2832
|
+
NEUTRAL: "vanduo-neutral-color",
|
|
2833
|
+
RADIUS: "vanduo-radius",
|
|
2834
|
+
FONT: "vanduo-font-preference",
|
|
2835
|
+
THEME: "vanduo-theme-preference"
|
|
2836
|
+
}, Y = () => typeof window < "u", zr = () => {
|
|
2837
|
+
if (!Y() || typeof window.matchMedia != "function") return !1;
|
|
2838
|
+
let e = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2839
|
+
return !!e && e.matches;
|
|
2840
|
+
}, X = (e) => e === "system" ? zr() ? q.PRIMARY_DARK : q.PRIMARY_LIGHT : e === "dark" ? q.PRIMARY_DARK : q.PRIMARY_LIGHT, Z = (e, t) => {
|
|
2841
|
+
if (!Y()) return t;
|
|
2842
|
+
try {
|
|
2843
|
+
return window.localStorage.getItem(e) ?? t;
|
|
2844
|
+
} catch {
|
|
2845
|
+
return t;
|
|
2846
|
+
}
|
|
2847
|
+
}, Q = (e, t) => {
|
|
2848
|
+
if (Y()) try {
|
|
2849
|
+
window.localStorage.setItem(e, t);
|
|
2850
|
+
} catch {}
|
|
2851
|
+
}, Br = () => ({
|
|
2852
|
+
palette: q.PALETTE,
|
|
2853
|
+
theme: q.THEME,
|
|
2854
|
+
primary: X(q.THEME),
|
|
2855
|
+
neutral: q.NEUTRAL,
|
|
2856
|
+
radius: q.RADIUS,
|
|
2857
|
+
font: q.FONT
|
|
2858
|
+
}), Vr = () => {
|
|
2859
|
+
let e = Z(J.THEME, q.THEME), t = Z(J.RADIUS, q.RADIUS), n = Z(J.PALETTE, q.PALETTE);
|
|
2860
|
+
return {
|
|
2861
|
+
palette: Rr(n) ? n : q.PALETTE,
|
|
2862
|
+
theme: F.includes(e) ? e : q.THEME,
|
|
2863
|
+
primary: Z(J.PRIMARY, X(e)),
|
|
2864
|
+
neutral: Z(J.NEUTRAL, q.NEUTRAL),
|
|
2865
|
+
radius: re.includes(t) ? t : q.RADIUS,
|
|
2866
|
+
font: Z(J.FONT, q.FONT)
|
|
2867
|
+
};
|
|
2868
|
+
}, Hr = (e) => e === q.PRIMARY_LIGHT || e === q.PRIMARY_DARK, Ur = (e) => {
|
|
2869
|
+
if (!Y()) return;
|
|
2870
|
+
let t = document.documentElement;
|
|
2871
|
+
Hr(e.primary) && (e.primary = X(e.theme)), t.setAttribute("data-palette", e.palette), t.setAttribute("data-primary", e.primary), t.setAttribute("data-neutral", e.neutral), t.setAttribute("data-radius", e.radius), t.style.setProperty("--vd-radius-scale", e.radius), e.font === "system" ? t.removeAttribute("data-font") : t.setAttribute("data-font", e.font), e.theme === "system" ? t.removeAttribute("data-theme") : t.setAttribute("data-theme", e.theme);
|
|
2872
|
+
}, Wr = (e) => {
|
|
2873
|
+
Q(J.PALETTE, e.palette), Q(J.THEME, e.theme), Q(J.PRIMARY, e.primary), Q(J.NEUTRAL, e.neutral), Q(J.RADIUS, e.radius), Q(J.FONT, e.font);
|
|
2874
|
+
};
|
|
2875
|
+
//#endregion
|
|
2876
|
+
//#region src/composables/useTimeline.ts
|
|
2877
|
+
function Gr(e) {
|
|
2878
|
+
let t = !1;
|
|
2879
|
+
h(() => {
|
|
2880
|
+
let n = e.value;
|
|
2881
|
+
if (!n || typeof window > "u") return;
|
|
2882
|
+
let r = window;
|
|
2883
|
+
t = !0, r.VanduoTimeline && typeof r.VanduoTimeline.init == "function" ? r.VanduoTimeline.init(n) : r.Vanduo && typeof r.Vanduo.init == "function" && r.Vanduo.init(n);
|
|
2884
|
+
}), g(() => {
|
|
2885
|
+
if (typeof window > "u" || !t) return;
|
|
2886
|
+
let e = window;
|
|
2887
|
+
e.VanduoTimeline && typeof e.VanduoTimeline.destroyAll == "function" && e.VanduoTimeline.destroyAll(), t = !1;
|
|
2888
|
+
});
|
|
2889
|
+
}
|
|
2890
|
+
//#endregion
|
|
2891
|
+
//#region src/composables/useTimepicker.ts
|
|
2892
|
+
function Kr(e, t, n = 4) {
|
|
2893
|
+
let r = e.getBoundingClientRect();
|
|
2894
|
+
t.style.minWidth = Math.max(r.width, 0) + "px";
|
|
2895
|
+
let i = r.bottom + n, a = r.left;
|
|
2896
|
+
t.style.top = i + "px", t.style.left = a + "px";
|
|
2897
|
+
let o = t.getBoundingClientRect();
|
|
2898
|
+
o.bottom > window.innerHeight - 8 && r.top - o.height > 8 && (i = r.top - o.height - n, t.style.top = i + "px");
|
|
2899
|
+
let s = t.getBoundingClientRect();
|
|
2900
|
+
a = r.left, a + s.width > window.innerWidth - 8 && (a = window.innerWidth - s.width - 8), t.style.left = Math.max(8, a) + "px";
|
|
2901
|
+
}
|
|
2902
|
+
function qr(e) {
|
|
2903
|
+
let t = [];
|
|
2904
|
+
h(() => {
|
|
2905
|
+
if (typeof window > "u") return;
|
|
2906
|
+
let n = e.value;
|
|
2907
|
+
n && n.querySelectorAll("[data-vd-timepicker]").forEach((e) => {
|
|
2908
|
+
let n = e.getAttribute("data-vd-timepicker-format") === "24h", r = parseInt(e.getAttribute("data-vd-timepicker-step") || "30", 10), i = document.createElement("div");
|
|
2909
|
+
i.className = "vd-timepicker-popup", i.setAttribute("role", "listbox"), document.body.appendChild(i);
|
|
2910
|
+
let a = [];
|
|
2911
|
+
for (let e = 0; e < 24; e++) for (let t = 0; t < 60; t += r) {
|
|
2912
|
+
let r = String(e).padStart(2, "0"), i = String(t).padStart(2, "0");
|
|
2913
|
+
if (n) a.push({
|
|
2914
|
+
display: r + ":" + i,
|
|
2915
|
+
value: r + ":" + i
|
|
2916
|
+
});
|
|
2917
|
+
else {
|
|
2918
|
+
let t = e < 12 ? "AM" : "PM", n = e === 0 ? 12 : e > 12 ? e - 12 : e;
|
|
2919
|
+
a.push({
|
|
2920
|
+
display: n + ":" + i + " " + t,
|
|
2921
|
+
value: r + ":" + i
|
|
2922
|
+
});
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
let o = () => {
|
|
2926
|
+
i.innerHTML = "", a.forEach((t) => {
|
|
2927
|
+
let n = document.createElement("div");
|
|
2928
|
+
n.className = "vd-timepicker-item", n.setAttribute("role", "option"), n.textContent = t.display, (e.value === t.value || e.value === t.display) && (n.classList.add("is-selected"), n.setAttribute("aria-selected", "true")), n.addEventListener("click", () => {
|
|
2929
|
+
e.value = t.display, i.querySelectorAll(".vd-timepicker-item").forEach((e) => {
|
|
2930
|
+
e.classList.remove("is-selected"), e.removeAttribute("aria-selected");
|
|
2931
|
+
}), n.classList.add("is-selected"), n.setAttribute("aria-selected", "true"), l();
|
|
2932
|
+
let [r, a] = t.value.split(":");
|
|
2933
|
+
e.dispatchEvent(new CustomEvent("timepicker:select", {
|
|
2934
|
+
bubbles: !0,
|
|
2935
|
+
detail: {
|
|
2936
|
+
time: t.display,
|
|
2937
|
+
hours: parseInt(r, 10),
|
|
2938
|
+
minutes: parseInt(a, 10)
|
|
2939
|
+
}
|
|
2940
|
+
})), e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2941
|
+
}), i.appendChild(n);
|
|
2942
|
+
});
|
|
2943
|
+
}, s = () => {
|
|
2944
|
+
i.classList.contains("is-open") && Kr(e, i);
|
|
2945
|
+
}, c = () => {
|
|
2946
|
+
o(), i.classList.add("is-open"), e.setAttribute("aria-expanded", "true"), requestAnimationFrame(() => {
|
|
2947
|
+
s();
|
|
2948
|
+
let e = i.querySelector(".is-selected");
|
|
2949
|
+
e && e.scrollIntoView({ block: "center" });
|
|
2950
|
+
});
|
|
2951
|
+
}, l = () => {
|
|
2952
|
+
i.classList.remove("is-open"), e.setAttribute("aria-expanded", "false");
|
|
2953
|
+
}, u = () => c(), d = (t) => {
|
|
2954
|
+
let n = t.target;
|
|
2955
|
+
!e.contains(n) && !i.contains(n) && l();
|
|
2956
|
+
}, f = (e) => {
|
|
2957
|
+
e.key === "Escape" && l();
|
|
2958
|
+
}, p = () => s();
|
|
2959
|
+
e.addEventListener("focus", u), document.addEventListener("click", d, !0), document.addEventListener("keydown", f), window.addEventListener("resize", p), window.addEventListener("scroll", p, !0), e.setAttribute("aria-haspopup", "listbox"), e.setAttribute("aria-expanded", "false"), e.setAttribute("autocomplete", "off"), e.readOnly = !0, t.push(() => e.removeEventListener("focus", u), () => document.removeEventListener("click", d, !0), () => document.removeEventListener("keydown", f), () => window.removeEventListener("resize", p), () => window.removeEventListener("scroll", p, !0), () => i.remove());
|
|
2960
|
+
});
|
|
2961
|
+
}), g(() => {
|
|
2962
|
+
t.forEach((e) => e()), t.length = 0;
|
|
2963
|
+
});
|
|
2964
|
+
}
|
|
2965
|
+
//#endregion
|
|
2966
|
+
//#region src/utils/sanitizeHtml.ts
|
|
2967
|
+
var Jr = [
|
|
2968
|
+
"B",
|
|
2969
|
+
"STRONG",
|
|
2970
|
+
"I",
|
|
2971
|
+
"EM",
|
|
2972
|
+
"BR",
|
|
2973
|
+
"A",
|
|
2974
|
+
"SPAN",
|
|
2975
|
+
"U",
|
|
2976
|
+
"DIV",
|
|
2977
|
+
"P",
|
|
2978
|
+
"KBD",
|
|
2979
|
+
"CODE",
|
|
2980
|
+
"SMALL",
|
|
2981
|
+
"MARK"
|
|
2982
|
+
], Yr = [
|
|
2983
|
+
"SVG",
|
|
2984
|
+
"PATH",
|
|
2985
|
+
"LINE",
|
|
2986
|
+
"CIRCLE",
|
|
2987
|
+
"POLYLINE",
|
|
2988
|
+
"RECT",
|
|
2989
|
+
"G"
|
|
2990
|
+
], Xr = /* @__PURE__ */ new Set([
|
|
2991
|
+
"xmlns",
|
|
2992
|
+
"width",
|
|
2993
|
+
"height",
|
|
2994
|
+
"viewBox",
|
|
2995
|
+
"fill",
|
|
2996
|
+
"stroke",
|
|
2997
|
+
"stroke-width",
|
|
2998
|
+
"stroke-linecap",
|
|
2999
|
+
"stroke-linejoin",
|
|
3000
|
+
"d",
|
|
3001
|
+
"cx",
|
|
3002
|
+
"cy",
|
|
3003
|
+
"r",
|
|
3004
|
+
"x1",
|
|
3005
|
+
"y1",
|
|
3006
|
+
"x2",
|
|
3007
|
+
"y2",
|
|
3008
|
+
"points",
|
|
3009
|
+
"transform",
|
|
3010
|
+
"class"
|
|
3011
|
+
]);
|
|
3012
|
+
function Zr(e) {
|
|
3013
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3014
|
+
}
|
|
3015
|
+
function $(e, t = {}) {
|
|
3016
|
+
if (!e) return "";
|
|
3017
|
+
if (typeof DOMParser > "u") return Zr(e);
|
|
3018
|
+
let n = t.allowSvg === !0, r = t.allowStyle === !0, i = n ? Jr.concat(Yr) : Jr, a;
|
|
3019
|
+
try {
|
|
3020
|
+
a = new DOMParser().parseFromString(e, "text/html");
|
|
3021
|
+
} catch {
|
|
3022
|
+
return Zr(e);
|
|
3023
|
+
}
|
|
3024
|
+
let o = (e) => {
|
|
3025
|
+
Array.from(e.childNodes).forEach((t) => {
|
|
3026
|
+
if (t.nodeType === Node.TEXT_NODE) return;
|
|
3027
|
+
let a = t;
|
|
3028
|
+
if (!i.includes(a.nodeName)) {
|
|
3029
|
+
e.replaceChild(document.createTextNode(a.textContent ?? ""), t);
|
|
3030
|
+
return;
|
|
3031
|
+
}
|
|
3032
|
+
if (a.nodeName === "A") {
|
|
3033
|
+
let e = a.getAttribute("href") ?? "";
|
|
3034
|
+
try {
|
|
3035
|
+
let t = new URL(e, location.href);
|
|
3036
|
+
[
|
|
3037
|
+
"http:",
|
|
3038
|
+
"https:",
|
|
3039
|
+
"mailto:"
|
|
3040
|
+
].includes(t.protocol) || a.removeAttribute("href");
|
|
3041
|
+
} catch {
|
|
3042
|
+
a.removeAttribute("href");
|
|
3043
|
+
}
|
|
3044
|
+
a.removeAttribute("target"), a.removeAttribute("rel");
|
|
3045
|
+
} else if (n && (a.nodeName === "SVG" || a.closest?.("svg"))) Array.from(a.attributes).forEach((e) => {
|
|
3046
|
+
Xr.has(e.name) || a.removeAttribute(e.name);
|
|
3047
|
+
});
|
|
3048
|
+
else {
|
|
3049
|
+
let e = /* @__PURE__ */ new Set(["class"]);
|
|
3050
|
+
r && e.add("style"), Array.from(a.attributes).forEach((t) => {
|
|
3051
|
+
e.has(t.name) || a.removeAttribute(t.name);
|
|
3052
|
+
});
|
|
3053
|
+
}
|
|
3054
|
+
o(a);
|
|
3055
|
+
});
|
|
3056
|
+
};
|
|
3057
|
+
return o(a.body), a.body.innerHTML;
|
|
3058
|
+
}
|
|
3059
|
+
//#endregion
|
|
3060
|
+
//#region src/composables/useTooltips.ts
|
|
3061
|
+
function Qr(e) {
|
|
3062
|
+
let t = null, n = [], r = () => {
|
|
3063
|
+
t &&= (t.remove(), null);
|
|
3064
|
+
}, i = (e, t, n) => {
|
|
3065
|
+
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a, o;
|
|
3066
|
+
switch (n) {
|
|
3067
|
+
case "bottom":
|
|
3068
|
+
a = r.bottom + 8, o = r.left + r.width / 2 - i.width / 2;
|
|
3069
|
+
break;
|
|
3070
|
+
case "left":
|
|
3071
|
+
a = r.top + r.height / 2 - i.height / 2, o = r.left - i.width - 8;
|
|
3072
|
+
break;
|
|
3073
|
+
case "right":
|
|
3074
|
+
a = r.top + r.height / 2 - i.height / 2, o = r.right + 8;
|
|
3075
|
+
break;
|
|
3076
|
+
default: a = r.top - i.height - 8, o = r.left + r.width / 2 - i.width / 2;
|
|
3077
|
+
}
|
|
3078
|
+
t.style.top = `${Math.max(4, a)}px`, t.style.left = `${Math.max(4, o)}px`;
|
|
3079
|
+
}, a = (e) => {
|
|
3080
|
+
r();
|
|
3081
|
+
let n = e.getAttribute("data-tooltip"), a = e.getAttribute("data-tooltip-html");
|
|
3082
|
+
if (!n && !a) return;
|
|
3083
|
+
let o = e.getAttribute("data-tooltip-placement") ?? "top", s = e.getAttribute("data-tooltip-variant"), c = e.getAttribute("data-tooltip-size"), l = document.createElement("div");
|
|
3084
|
+
l.className = "vd-tooltip vd-tooltip-" + o + (s ? " vd-tooltip-" + s : "") + (c ? " vd-tooltip-" + c : "") + (a ? " vd-tooltip-html" : ""), l.setAttribute("data-placement", o), l.style.position = "fixed", a ? l.innerHTML = $(a, { allowStyle: !1 }) : l.textContent = n, document.body.appendChild(l), i(e, l, o), requestAnimationFrame(() => l.classList.add("is-visible")), t = l;
|
|
3085
|
+
};
|
|
3086
|
+
h(() => {
|
|
3087
|
+
let t = e.value;
|
|
3088
|
+
t && t.querySelectorAll("[data-tooltip],[data-tooltip-html]").forEach((e) => {
|
|
3089
|
+
let t = () => a(e), i = () => r();
|
|
3090
|
+
e.addEventListener("mouseenter", t), e.addEventListener("mouseleave", i), e.addEventListener("focus", t), e.addEventListener("blur", i), n.push(() => {
|
|
3091
|
+
e.removeEventListener("mouseenter", t), e.removeEventListener("mouseleave", i), e.removeEventListener("focus", t), e.removeEventListener("blur", i);
|
|
3092
|
+
});
|
|
3093
|
+
});
|
|
3094
|
+
}), g(() => {
|
|
3095
|
+
r(), n.forEach((e) => e()), n.length = 0;
|
|
3096
|
+
});
|
|
3097
|
+
}
|
|
3098
|
+
//#endregion
|
|
3099
|
+
//#region src/composables/useValidate.ts
|
|
3100
|
+
var $r = {
|
|
3101
|
+
required: (e) => e.trim().length > 0,
|
|
3102
|
+
email: (e) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),
|
|
3103
|
+
url: (e) => {
|
|
3104
|
+
try {
|
|
3105
|
+
return new URL(e), !0;
|
|
3106
|
+
} catch {
|
|
3107
|
+
return !1;
|
|
3108
|
+
}
|
|
3109
|
+
},
|
|
3110
|
+
number: (e) => !isNaN(parseFloat(e)) && isFinite(Number(e)),
|
|
3111
|
+
min: (e, t) => e.length >= parseInt(t, 10),
|
|
3112
|
+
max: (e, t) => e.length <= parseInt(t, 10),
|
|
3113
|
+
minVal: (e, t) => parseFloat(e) >= parseFloat(t),
|
|
3114
|
+
maxVal: (e, t) => parseFloat(e) <= parseFloat(t),
|
|
3115
|
+
pattern: (e, t) => {
|
|
3116
|
+
try {
|
|
3117
|
+
return t.length > 100 ? !1 : new RegExp(t).test(e);
|
|
3118
|
+
} catch {
|
|
3119
|
+
return !1;
|
|
3120
|
+
}
|
|
3121
|
+
},
|
|
3122
|
+
match: (e, t) => {
|
|
3123
|
+
try {
|
|
3124
|
+
let n = typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t, r = document.getElementById(t) ?? document.querySelector(`[name="${n}"]`);
|
|
3125
|
+
return r ? e === r.value : !1;
|
|
3126
|
+
} catch {
|
|
3127
|
+
return !1;
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
}, ei = {
|
|
3131
|
+
required: "This field is required",
|
|
3132
|
+
email: "Please enter a valid email address",
|
|
3133
|
+
url: "Please enter a valid URL",
|
|
3134
|
+
number: "Please enter a valid number",
|
|
3135
|
+
min: "Minimum {0} characters required",
|
|
3136
|
+
max: "Maximum {0} characters allowed",
|
|
3137
|
+
minVal: "Value must be at least {0}",
|
|
3138
|
+
maxVal: "Value must be at most {0}",
|
|
3139
|
+
pattern: "Invalid format",
|
|
3140
|
+
match: "Fields do not match"
|
|
3141
|
+
}, ti = 0;
|
|
3142
|
+
function ni(e, t) {
|
|
3143
|
+
let n = e.closest(".vd-form-group") ?? e.parentElement;
|
|
3144
|
+
if (!n) return;
|
|
3145
|
+
let r = n.querySelector(".vd-validate-error");
|
|
3146
|
+
e.classList.remove("is-valid", "is-invalid"), t.length > 0 ? (e.classList.add("is-invalid"), e.setAttribute("aria-invalid", "true"), r || (r = document.createElement("div"), r.className = "vd-validate-error", ti += 1, r.id = `vd-err-${ti}`, r.setAttribute("role", "alert"), n.appendChild(r)), r.textContent = t[0] ?? "", r.style.display = "", e.setAttribute("aria-describedby", r.id)) : e.value.trim() ? (e.classList.add("is-valid"), e.removeAttribute("aria-invalid"), r && (r.style.display = "none")) : (e.removeAttribute("aria-invalid"), r && (r.style.display = "none"));
|
|
3147
|
+
}
|
|
3148
|
+
function ri(e) {
|
|
3149
|
+
let t = [], n = (e) => {
|
|
3150
|
+
let t = (e.getAttribute("data-vd-rules") ?? "").split("|").map((e) => e.trim()).filter(Boolean), n = e.value, r = [];
|
|
3151
|
+
for (let i of t) {
|
|
3152
|
+
let [t, ...a] = i.split(":"), o = a.join(":"), s = t ? $r[t] : void 0;
|
|
3153
|
+
if (s && !s(n, o)) {
|
|
3154
|
+
let n = (t ? e.getAttribute(`data-vd-msg-${t}`) : null) ?? (t ? ei[t] : void 0) ?? "Invalid";
|
|
3155
|
+
o && (n = n.replace("{0}", o)), r.push(n);
|
|
3156
|
+
break;
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
return ni(e, r), r.length === 0;
|
|
3160
|
+
}, r = (e) => {
|
|
3161
|
+
let r = e.getAttribute("data-vd-validate-mode") ?? "blur", i = Array.from(e.querySelectorAll("[data-vd-rules]")), a = () => {
|
|
3162
|
+
let e = !0;
|
|
3163
|
+
return i.forEach((t) => {
|
|
3164
|
+
n(t) || (e = !1);
|
|
3165
|
+
}), e;
|
|
3166
|
+
};
|
|
3167
|
+
i.forEach((e) => {
|
|
3168
|
+
let i = e.getAttribute("data-vd-validate-mode") ?? r;
|
|
3169
|
+
if (i === "input" || i === "blur") {
|
|
3170
|
+
let r = i === "input" ? "input" : "blur", a = () => n(e);
|
|
3171
|
+
if (e.addEventListener(r, a), t.push(() => e.removeEventListener(r, a)), i === "blur") {
|
|
3172
|
+
let r = () => {
|
|
3173
|
+
(e.classList.contains("is-invalid") || e.classList.contains("is-valid")) && n(e);
|
|
3174
|
+
};
|
|
3175
|
+
e.addEventListener("input", r), t.push(() => e.removeEventListener("input", r));
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
});
|
|
3179
|
+
let o = (t) => {
|
|
3180
|
+
let n = a();
|
|
3181
|
+
n || (t.preventDefault(), t.stopPropagation(), e.querySelector(".is-invalid")?.focus()), e.dispatchEvent(new CustomEvent("validate:submit", {
|
|
3182
|
+
detail: { valid: n },
|
|
3183
|
+
bubbles: !0
|
|
3184
|
+
}));
|
|
3185
|
+
};
|
|
3186
|
+
e.addEventListener("submit", o), t.push(() => e.removeEventListener("submit", o));
|
|
3187
|
+
};
|
|
3188
|
+
h(() => {
|
|
3189
|
+
let t = e.value;
|
|
3190
|
+
t && t.querySelectorAll("[data-vd-validate], .vd-validate").forEach(r);
|
|
3191
|
+
}), g(() => {
|
|
3192
|
+
t.forEach((e) => e()), t.length = 0;
|
|
3193
|
+
});
|
|
3194
|
+
}
|
|
3195
|
+
//#endregion
|
|
3196
|
+
//#region src/composables/useWaypoint.ts
|
|
3197
|
+
function ii(e) {
|
|
3198
|
+
let t = [];
|
|
3199
|
+
h(() => {
|
|
3200
|
+
if (typeof window > "u") return;
|
|
3201
|
+
let n = e.value;
|
|
3202
|
+
n && n.querySelectorAll("[data-vd-waypoint-nav], [data-vd-scrollspy-nav]").forEach((e) => {
|
|
3203
|
+
let n = Array.from(e.querySelectorAll("a[href^=\"#\"]"));
|
|
3204
|
+
if (n.length === 0) return;
|
|
3205
|
+
let r = parseInt(e.getAttribute("data-vd-waypoint-offset") || "80", 10), i = e.getAttribute("data-vd-waypoint-nav") || e.getAttribute("data-vd-scrollspy-nav") || "", a = null;
|
|
3206
|
+
i && i !== "window" && (a = document.querySelector(i));
|
|
3207
|
+
let o = [];
|
|
3208
|
+
if (n.forEach((e) => {
|
|
3209
|
+
let t = (e.getAttribute("href") || "").slice(1), n = t ? document.getElementById(t) : null;
|
|
3210
|
+
n && (n.setAttribute("data-vd-waypoint-section", ""), o.push({
|
|
3211
|
+
id: t,
|
|
3212
|
+
link: e,
|
|
3213
|
+
section: n
|
|
3214
|
+
}));
|
|
3215
|
+
}), o.length === 0) return;
|
|
3216
|
+
let s = /* @__PURE__ */ new Set(), c = (t) => {
|
|
3217
|
+
n.forEach((e) => {
|
|
3218
|
+
e.classList.remove("is-active"), e.removeAttribute("aria-current");
|
|
3219
|
+
});
|
|
3220
|
+
let r = n.find((e) => e.getAttribute("href") === "#" + t);
|
|
3221
|
+
r && (r.classList.add("is-active"), r.setAttribute("aria-current", "true"), e.dispatchEvent(new CustomEvent("waypoint:change", { detail: {
|
|
3222
|
+
activeId: t,
|
|
3223
|
+
link: r
|
|
3224
|
+
} })));
|
|
3225
|
+
}, l = new IntersectionObserver((e) => {
|
|
3226
|
+
e.forEach((e) => {
|
|
3227
|
+
e.isIntersecting ? s.add(e.target.id) : s.delete(e.target.id);
|
|
3228
|
+
});
|
|
3229
|
+
for (let e of o) if (s.has(e.id)) {
|
|
3230
|
+
c(e.id);
|
|
3231
|
+
return;
|
|
3232
|
+
}
|
|
3233
|
+
}, {
|
|
3234
|
+
root: a,
|
|
3235
|
+
rootMargin: "-" + r + "px 0px -40% 0px",
|
|
3236
|
+
threshold: 0
|
|
3237
|
+
});
|
|
3238
|
+
o.forEach((e) => l.observe(e.section)), n.forEach((e) => {
|
|
3239
|
+
let n = (t) => {
|
|
3240
|
+
t.preventDefault();
|
|
3241
|
+
let n = (e.getAttribute("href") || "").slice(1), r = n ? document.getElementById(n) : null;
|
|
3242
|
+
r && (r.scrollIntoView({ behavior: "smooth" }), c(n));
|
|
3243
|
+
};
|
|
3244
|
+
e.addEventListener("click", n), t.push(() => e.removeEventListener("click", n));
|
|
3245
|
+
}), t.push(() => l.disconnect());
|
|
3246
|
+
});
|
|
3247
|
+
}), g(() => {
|
|
3248
|
+
t.forEach((e) => e()), t.length = 0;
|
|
3249
|
+
});
|
|
3250
|
+
}
|
|
3251
|
+
//#endregion
|
|
3252
|
+
export { q as DEFAULTS, N as FONT_OPTIONS, P as NEUTRAL_COLORS, te as PALETTE_OPTIONS, ne as PRIMARY_COLORS, re as RADIUS_OPTIONS, F as THEME_MODES, ae as VanduoVue, ue as VdAccordion, me as VdAlert, be as VdAvatar, xe as VdBadge, Gn as VdBox, we as VdButton, Te as VdButtonGroup, ke as VdCard, Kn as VdCenter, Me as VdCheckboxGroup, Pe as VdChip, Re as VdCodeSnippet, Ye as VdCollection, qn as VdCover, et as VdCustomSelect, st as VdFlow, Yn as VdFrame, L as VdIcon, Zn as VdInline, lt as VdInput, ht as VdModal, bt as VdOffcanvas, wt as VdPagination, Et as VdPreloader, At as VdProgress, Nt as VdRadioGroup, It as VdRating, Vt as VdSelect, qt as VdSidenav, Yt as VdSkeleton, Zt as VdSpinner, Qn as VdStack, er as VdSwitcher, tn as VdTable, sn as VdTabs, fn as VdToast, gn as VdToastContainer, vn as VdTooltip, In as VdTransfer, Wn as VdTree, Un as VdTreeNode, Ur as applyPreference, Br as defaultPreference, X as defaultPrimary, Hr as isDefaultPrimary, Vr as loadPreference, ie as loadVanduoRuntime, Wr as persistPreference, $ as sanitizeHtml, rr as useAffix, fr as useDatepicker, mr as useDraggable, hr as useDropdown, gr as useExpandingCards, _r as useFlow, vr as useFocusTrap, yr as useGlass, br as useImageBox, xr as useKeyboardNav, Cr as useMorph, wr as useMorphBadges, Tr as useNavbarGlassScroll, Er as useParallax, Dr as usePopover, Or as useRipple, kr as useScrollspy, Ar as useSearch, jr as useSidenav, Mr as useSpotlight, Nr as useStepper, Fr as useSuggest, Ir as useTabs, Gr as useTimeline, qr as useTimepicker, hn as useToast, z as useToastStore, Qr as useTooltips, ri as useValidate, ii as useWaypoint };
|
|
3253
|
+
|
|
3254
|
+
//# sourceMappingURL=index.js.map
|