@codemonster-ru/vueforge 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{LICENSE.md → LICENSE} +1 -1
- package/README.md +18 -4
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.ts.mjs +646 -761
- package/dist/index.ts.umd.js +3 -3
- package/dist/package/components/button.vue.d.ts +2 -2
- package/dist/package/components/link.vue.d.ts +2 -2
- package/dist/package/themes/default/base.d.ts +1 -0
- package/dist/package/themes/default/components/button.d.ts +2 -0
- package/dist/package/themes/default/components/checkbox.d.ts +1 -0
- package/dist/package/themes/default/components/input.d.ts +2 -0
- package/dist/package/themes/default/components/menu.d.ts +4 -0
- package/dist/package/themes/default/components/select.d.ts +10 -0
- package/dist/package/themes/default/components/switch.d.ts +2 -0
- package/dist/package/themes/default/index.d.ts +23 -22
- package/package.json +13 -2
- package/dist/package/components/container.vue.d.ts +0 -17
- package/dist/package/components/content.vue.d.ts +0 -17
- package/dist/package/components/demo.vue.d.ts +0 -17
- package/dist/package/components/footer.vue.d.ts +0 -17
- package/dist/package/components/header.vue.d.ts +0 -17
- package/dist/package/components/logo.vue.d.ts +0 -24
- package/dist/package/layouts/defaultLayout.vue.d.ts +0 -19
- package/dist/package/layouts/leftSidebarLayout.vue.d.ts +0 -17
- package/dist/package/themes/default/components/container.d.ts +0 -4
- package/dist/package/themes/default/components/content.d.ts +0 -2
- package/dist/package/themes/default/components/demo.d.ts +0 -2
- package/dist/package/themes/default/components/footer.d.ts +0 -9
- package/dist/package/themes/default/components/header.d.ts +0 -9
- package/dist/package/themes/default/components/logo.d.ts +0 -2
package/dist/index.ts.mjs
CHANGED
|
@@ -1,72 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { CmIcon as
|
|
4
|
-
const
|
|
5
|
-
const r = t.__vccOpts || t;
|
|
6
|
-
for (const [o, n] of e)
|
|
7
|
-
r[o] = n;
|
|
8
|
-
return r;
|
|
9
|
-
}, Ee = {}, Ae = { class: "vf-header" };
|
|
10
|
-
function Pe(t, e) {
|
|
11
|
-
return p(), b("header", Ae, [
|
|
12
|
-
g(t.$slots, "default")
|
|
13
|
-
]);
|
|
14
|
-
}
|
|
15
|
-
const De = /* @__PURE__ */ U(Ee, [["render", Pe]]), Oe = {}, Ne = { class: "vf-content" };
|
|
16
|
-
function Ie(t, e) {
|
|
17
|
-
return p(), b("div", Ne, [
|
|
18
|
-
g(t.$slots, "default")
|
|
19
|
-
]);
|
|
20
|
-
}
|
|
21
|
-
const je = /* @__PURE__ */ U(Oe, [["render", Ie]]), Xe = {}, Ye = { class: "vf-footer" };
|
|
22
|
-
function Ke(t, e) {
|
|
23
|
-
return p(), b("footer", Ye, [
|
|
24
|
-
g(t.$slots, "default")
|
|
25
|
-
]);
|
|
26
|
-
}
|
|
27
|
-
const qe = /* @__PURE__ */ U(Xe, [["render", Ke]]), Ue = { class: "vf-layout" }, No = /* @__PURE__ */ E({
|
|
28
|
-
__name: "defaultLayout",
|
|
29
|
-
setup(t) {
|
|
30
|
-
return (e, r) => (p(), b("div", Ue, [
|
|
31
|
-
Z(De, null, {
|
|
32
|
-
default: L(() => [
|
|
33
|
-
g(e.$slots, "header")
|
|
34
|
-
]),
|
|
35
|
-
_: 3
|
|
36
|
-
}),
|
|
37
|
-
Z(je, null, {
|
|
38
|
-
default: L(() => [
|
|
39
|
-
g(e.$slots, "content")
|
|
40
|
-
]),
|
|
41
|
-
_: 3
|
|
42
|
-
}),
|
|
43
|
-
Z(qe, null, {
|
|
44
|
-
default: L(() => [
|
|
45
|
-
g(e.$slots, "footer")
|
|
46
|
-
]),
|
|
47
|
-
_: 3
|
|
48
|
-
})
|
|
49
|
-
]));
|
|
50
|
-
}
|
|
51
|
-
}), Ge = {}, Ze = { class: "vf-left-sidebar-flexbox" }, Je = { class: "vf-left-sidebar" }, Qe = { class: "vf-main-content" };
|
|
52
|
-
function et(t, e) {
|
|
53
|
-
const r = de("router-view");
|
|
54
|
-
return p(), b("div", Ze, [
|
|
55
|
-
$("div", Je, [
|
|
56
|
-
g(t.$slots, "leftSidebar")
|
|
57
|
-
]),
|
|
58
|
-
$("div", Qe, [
|
|
59
|
-
Z(r)
|
|
60
|
-
])
|
|
61
|
-
]);
|
|
62
|
-
}
|
|
63
|
-
const Io = /* @__PURE__ */ U(Ge, [["render", et]]), tt = {}, ot = { class: "vf-demo" };
|
|
64
|
-
function rt(t, e) {
|
|
65
|
-
return p(), b("div", ot, [
|
|
66
|
-
g(t.$slots, "default")
|
|
67
|
-
]);
|
|
68
|
-
}
|
|
69
|
-
const jo = /* @__PURE__ */ U(tt, [["render", rt]]), nt = ["href", "aria-disabled", "tabindex"], ue = /* @__PURE__ */ E({
|
|
1
|
+
import { defineComponent as X, ref as N, computed as w, watch as le, resolveComponent as be, openBlock as g, createElementBlock as h, normalizeClass as C, renderSlot as k, Fragment as oe, createTextVNode as J, toDisplayString as M, createBlock as W, withCtx as I, createCommentVNode as _, createElementVNode as B, renderList as ge, withKeys as K, withModifiers as G, unref as U, createVNode as he, nextTick as de, onMounted as Re, onBeforeUnmount as Se, Teleport as Le, withDirectives as me, vShow as ye, reactive as Ve, createSlots as ze } from "vue";
|
|
2
|
+
import { useRoute as We, useRouter as Me } from "vue-router";
|
|
3
|
+
import { CmIcon as Z } from "@codemonster-ru/vueiconify";
|
|
4
|
+
const He = ["href", "aria-disabled", "tabindex"], ke = /* @__PURE__ */ X({
|
|
70
5
|
__name: "link",
|
|
71
6
|
props: {
|
|
72
7
|
to: { default: void 0 },
|
|
@@ -80,132 +15,96 @@ const jo = /* @__PURE__ */ U(tt, [["render", rt]]), nt = ["href", "aria-disabled
|
|
|
80
15
|
},
|
|
81
16
|
emits: ["click", "active", "update:active", "onActive"],
|
|
82
17
|
setup(t, { emit: e }) {
|
|
83
|
-
const r = e, o = t, n =
|
|
18
|
+
const r = e, o = t, n = We(), c = Me(), s = N(null), i = w(() => o.href ?? o.url), l = w(() => o.as ? o.as === "router-link" && !o.to ? "a" : o.as : o.type === "router-link" || o.type === "a" ? o.type === "router-link" && !o.to ? "a" : o.type : o.to ? "router-link" : "a"), u = w(() => o.to), d = w(() => o.to ? c.resolve(o.to) : null), a = w(() => {
|
|
84
19
|
if (l.value !== "router-link")
|
|
85
20
|
return !1;
|
|
86
|
-
const
|
|
87
|
-
return
|
|
88
|
-
}),
|
|
21
|
+
const p = d.value;
|
|
22
|
+
return p ? p.name ? n.matched.some(({ name: y }) => y === p.name) : p.fullPath ? n.fullPath === p.fullPath : n.path === p.path : !1;
|
|
23
|
+
}), v = w(() => o.active === void 0 ? a.value : o.active), f = (p) => {
|
|
89
24
|
if (!o.disabled) {
|
|
90
|
-
r("click",
|
|
25
|
+
r("click", p);
|
|
91
26
|
return;
|
|
92
27
|
}
|
|
93
|
-
|
|
28
|
+
p.preventDefault(), p.stopPropagation();
|
|
94
29
|
};
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
}), (
|
|
98
|
-
const
|
|
99
|
-
return l.value === "a" ? (
|
|
30
|
+
return le(a, (p) => {
|
|
31
|
+
p && (r("active"), r("onActive")), r("update:active", p);
|
|
32
|
+
}), (p, y) => {
|
|
33
|
+
const m = be("router-link");
|
|
34
|
+
return l.value === "a" ? (g(), h("a", {
|
|
100
35
|
key: 0,
|
|
101
|
-
href:
|
|
102
|
-
class:
|
|
103
|
-
"aria-disabled":
|
|
104
|
-
tabindex:
|
|
105
|
-
onClick:
|
|
36
|
+
href: i.value,
|
|
37
|
+
class: C(["vf-link", { "vf-link_active": v.value, "vf-link_disabled": p.disabled }]),
|
|
38
|
+
"aria-disabled": p.disabled,
|
|
39
|
+
tabindex: p.disabled ? -1 : void 0,
|
|
40
|
+
onClick: f
|
|
106
41
|
}, [
|
|
107
|
-
|
|
108
|
-
|
|
42
|
+
p.$slots.default ? k(p.$slots, "default", { key: 0 }) : (g(), h(oe, { key: 1 }, [
|
|
43
|
+
J(M(p.label), 1)
|
|
109
44
|
], 64))
|
|
110
|
-
], 10,
|
|
45
|
+
], 10, He)) : (g(), W(m, {
|
|
111
46
|
key: 1,
|
|
112
47
|
ref_key: "link",
|
|
113
|
-
ref:
|
|
114
|
-
to:
|
|
115
|
-
class:
|
|
116
|
-
"aria-disabled":
|
|
117
|
-
tabindex:
|
|
48
|
+
ref: s,
|
|
49
|
+
to: u.value,
|
|
50
|
+
class: C(["vf-link", { "vf-link_active": v.value }]),
|
|
51
|
+
"aria-disabled": p.disabled,
|
|
52
|
+
tabindex: p.disabled ? -1 : void 0,
|
|
118
53
|
"active-class": "vf-link_partially-active",
|
|
119
54
|
"exact-active-class": "vf-link_active",
|
|
120
|
-
onClick:
|
|
55
|
+
onClick: f
|
|
121
56
|
}, {
|
|
122
|
-
default:
|
|
123
|
-
|
|
124
|
-
|
|
57
|
+
default: I(() => [
|
|
58
|
+
p.$slots.default ? k(p.$slots, "default", { key: 0 }) : (g(), h(oe, { key: 1 }, [
|
|
59
|
+
J(M(p.label), 1)
|
|
125
60
|
], 64))
|
|
126
61
|
]),
|
|
127
62
|
_: 3
|
|
128
63
|
}, 8, ["to", "class", "aria-disabled", "tabindex"]));
|
|
129
64
|
};
|
|
130
65
|
}
|
|
131
|
-
}),
|
|
66
|
+
}), Oe = (t, e) => {
|
|
67
|
+
const r = t.__vccOpts || t;
|
|
68
|
+
for (const [o, n] of e)
|
|
69
|
+
r[o] = n;
|
|
70
|
+
return r;
|
|
71
|
+
}, Ee = {}, Pe = { class: "vf-card" }, Ae = {
|
|
132
72
|
key: 0,
|
|
133
73
|
class: "vf-card__default"
|
|
134
|
-
},
|
|
74
|
+
}, De = {
|
|
135
75
|
key: 1,
|
|
136
76
|
class: "vf-card__header"
|
|
137
|
-
},
|
|
77
|
+
}, Ne = {
|
|
138
78
|
key: 2,
|
|
139
79
|
class: "vf-card__body"
|
|
140
|
-
},
|
|
80
|
+
}, Ie = {
|
|
141
81
|
key: 3,
|
|
142
82
|
class: "vf-card__footer"
|
|
143
83
|
};
|
|
144
|
-
function
|
|
145
|
-
return
|
|
146
|
-
t.$slots.default ? (
|
|
147
|
-
|
|
148
|
-
])) :
|
|
149
|
-
t.$slots.header ? (
|
|
150
|
-
|
|
151
|
-
])) :
|
|
152
|
-
t.$slots.body ? (
|
|
153
|
-
|
|
154
|
-
])) :
|
|
155
|
-
t.$slots.footer ? (
|
|
156
|
-
|
|
157
|
-
])) :
|
|
84
|
+
function je(t, e) {
|
|
85
|
+
return g(), h("div", Pe, [
|
|
86
|
+
t.$slots.default ? (g(), h("div", Ae, [
|
|
87
|
+
k(t.$slots, "default")
|
|
88
|
+
])) : _("", !0),
|
|
89
|
+
t.$slots.header ? (g(), h("div", De, [
|
|
90
|
+
k(t.$slots, "header")
|
|
91
|
+
])) : _("", !0),
|
|
92
|
+
t.$slots.body ? (g(), h("div", Ne, [
|
|
93
|
+
k(t.$slots, "body")
|
|
94
|
+
])) : _("", !0),
|
|
95
|
+
t.$slots.footer ? (g(), h("div", Ie, [
|
|
96
|
+
k(t.$slots, "footer")
|
|
97
|
+
])) : _("", !0)
|
|
158
98
|
]);
|
|
159
99
|
}
|
|
160
|
-
const
|
|
161
|
-
__name: "logo",
|
|
162
|
-
props: {
|
|
163
|
-
to: { default: void 0 },
|
|
164
|
-
href: { default: void 0 },
|
|
165
|
-
url: { default: void 0 },
|
|
166
|
-
src: {},
|
|
167
|
-
alt: { default: void 0 },
|
|
168
|
-
as: { default: void 0 },
|
|
169
|
-
type: { default: void 0 },
|
|
170
|
-
dark: { type: Boolean },
|
|
171
|
-
width: { default: void 0 },
|
|
172
|
-
height: { default: void 0 }
|
|
173
|
-
},
|
|
174
|
-
setup(t) {
|
|
175
|
-
const e = t, r = C(() => e.as ? e.as : e.type === "router-link" || e.type === "a" ? e.type : e.to ? "router-link" : e.href || e.url ? "a" : ""), o = C(() => Array.isArray(e.src) ? e.dark ? e.src[1] : e.src[0] : e.src);
|
|
176
|
-
return (n, d) => (p(), b("div", vt, [
|
|
177
|
-
r.value ? (p(), V(ue, {
|
|
178
|
-
key: 0,
|
|
179
|
-
as: r.value,
|
|
180
|
-
to: n.to,
|
|
181
|
-
href: n.href ?? n.url
|
|
182
|
-
}, {
|
|
183
|
-
default: L(() => [
|
|
184
|
-
$("img", {
|
|
185
|
-
src: o.value,
|
|
186
|
-
width: n.width,
|
|
187
|
-
height: n.height,
|
|
188
|
-
alt: n.alt
|
|
189
|
-
}, null, 8, pt)
|
|
190
|
-
]),
|
|
191
|
-
_: 1
|
|
192
|
-
}, 8, ["as", "to", "href"])) : (p(), b("img", {
|
|
193
|
-
key: 1,
|
|
194
|
-
src: o.value,
|
|
195
|
-
width: n.width,
|
|
196
|
-
height: n.height,
|
|
197
|
-
alt: n.alt
|
|
198
|
-
}, null, 8, ht))
|
|
199
|
-
]));
|
|
200
|
-
}
|
|
201
|
-
}), bt = {
|
|
100
|
+
const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
202
101
|
class: "vf-menu__list",
|
|
203
102
|
role: "menu"
|
|
204
|
-
},
|
|
103
|
+
}, Ke = {
|
|
205
104
|
key: 1,
|
|
206
105
|
class: "vf-menu__separator",
|
|
207
106
|
role: "separator"
|
|
208
|
-
},
|
|
107
|
+
}, Ge = ["aria-expanded", "onClick", "onKeydown"], io = /* @__PURE__ */ X({
|
|
209
108
|
name: "VfMenu",
|
|
210
109
|
__name: "menu",
|
|
211
110
|
props: {
|
|
@@ -214,87 +113,87 @@ const ft = /* @__PURE__ */ U(lt, [["render", ut]]), vt = { class: "vf-logo" }, p
|
|
|
214
113
|
},
|
|
215
114
|
emits: ["active", "onActive"],
|
|
216
115
|
setup(t, { emit: e }) {
|
|
217
|
-
const r = e, o = t, n =
|
|
218
|
-
...
|
|
219
|
-
items:
|
|
220
|
-
})), l = (
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}),
|
|
224
|
-
},
|
|
225
|
-
var
|
|
116
|
+
const r = e, o = t, n = N([]), c = (d, a) => `${d.label ?? d.to ?? d.href ?? d.url ?? "item"}_${a.toString()}`, s = (d) => d.to ? "router-link" : "a", i = (d) => d.map((a) => ({
|
|
117
|
+
...a,
|
|
118
|
+
items: a.items ? i(a.items) : void 0
|
|
119
|
+
})), l = (d) => {
|
|
120
|
+
d.items && d.items.length ? (n.value.map((a) => {
|
|
121
|
+
a !== d && (a.subMenuVisible = !1);
|
|
122
|
+
}), d.subMenuVisible = !d.subMenuVisible) : Object.prototype.hasOwnProperty.call(d, "command") && typeof d.command == "function" && d.command();
|
|
123
|
+
}, u = (d) => {
|
|
124
|
+
var a;
|
|
226
125
|
for (const v in n.value) {
|
|
227
|
-
const
|
|
228
|
-
Object.prototype.hasOwnProperty.call(
|
|
126
|
+
const f = n.value[v];
|
|
127
|
+
Object.prototype.hasOwnProperty.call(f, "items") && ((a = f.items) != null && a.some((p) => p === d) ? (f.active = !0, f.subMenuVisible = !0) : (f.active = !1, f.subMenuVisible = !1));
|
|
229
128
|
}
|
|
230
|
-
r("active",
|
|
129
|
+
r("active", d), r("onActive", d);
|
|
231
130
|
};
|
|
232
|
-
return
|
|
131
|
+
return le(
|
|
233
132
|
() => o.items,
|
|
234
|
-
(
|
|
235
|
-
n.value =
|
|
133
|
+
(d) => {
|
|
134
|
+
n.value = i(d);
|
|
236
135
|
},
|
|
237
136
|
{ deep: !0, immediate: !0 }
|
|
238
|
-
), (
|
|
239
|
-
const v =
|
|
240
|
-
return
|
|
241
|
-
class:
|
|
137
|
+
), (d, a) => {
|
|
138
|
+
const v = be("VfMenu");
|
|
139
|
+
return g(), h("div", {
|
|
140
|
+
class: C(["vf-menu", `vf-menu_${d.orientation}`])
|
|
242
141
|
}, [
|
|
243
|
-
|
|
244
|
-
(
|
|
245
|
-
key:
|
|
142
|
+
B("ul", Ye, [
|
|
143
|
+
(g(!0), h(oe, null, ge(n.value, (f, p) => (g(), h("li", {
|
|
144
|
+
key: c(f, p),
|
|
246
145
|
class: "vf-menu__item",
|
|
247
146
|
role: "none"
|
|
248
147
|
}, [
|
|
249
|
-
|
|
148
|
+
d.$slots[c(f, p)] ? k(d.$slots, c(f, p), {
|
|
250
149
|
key: 0,
|
|
251
|
-
item: { ...
|
|
252
|
-
}) :
|
|
253
|
-
|
|
254
|
-
class:
|
|
150
|
+
item: { ...f, class: "vf-menu__link" }
|
|
151
|
+
}) : f.separator ? (g(), h("hr", Ke)) : f.items && f.items.length ? (g(), h(oe, { key: 2 }, [
|
|
152
|
+
B("div", {
|
|
153
|
+
class: C(["vf-menu__parent", { "vf-menu__parent_active": f.active }]),
|
|
255
154
|
role: "menuitem",
|
|
256
155
|
tabindex: "0",
|
|
257
|
-
"aria-expanded":
|
|
258
|
-
onClick: (
|
|
156
|
+
"aria-expanded": f.subMenuVisible ? "true" : "false",
|
|
157
|
+
onClick: (y) => l(f),
|
|
259
158
|
onKeydown: [
|
|
260
|
-
K(
|
|
261
|
-
K(
|
|
159
|
+
K(G((y) => l(f), ["prevent"]), ["enter"]),
|
|
160
|
+
K(G((y) => l(f), ["prevent"]), ["space"])
|
|
262
161
|
]
|
|
263
162
|
}, [
|
|
264
|
-
|
|
163
|
+
f.icon ? (g(), W(U(Z), {
|
|
265
164
|
key: 0,
|
|
266
|
-
icon:
|
|
165
|
+
icon: f.icon,
|
|
267
166
|
class: "vf-menu__icon"
|
|
268
|
-
}, null, 8, ["icon"])) :
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
], 42,
|
|
272
|
-
|
|
167
|
+
}, null, 8, ["icon"])) : _("", !0),
|
|
168
|
+
J(" " + M(f.label) + " ", 1),
|
|
169
|
+
he(U(Z), { icon: "chevronDown" })
|
|
170
|
+
], 42, Ge),
|
|
171
|
+
f.items ? (g(), W(v, {
|
|
273
172
|
key: 0,
|
|
274
|
-
items:
|
|
275
|
-
class:
|
|
276
|
-
onOnActive:
|
|
277
|
-
}, null, 8, ["items", "class"])) :
|
|
278
|
-
], 64)) : (
|
|
173
|
+
items: f.items,
|
|
174
|
+
class: C(["vf-menu__submenu", { "vf-menu__submenu_visible": f.subMenuVisible }]),
|
|
175
|
+
onOnActive: u
|
|
176
|
+
}, null, 8, ["items", "class"])) : _("", !0)
|
|
177
|
+
], 64)) : (g(), W(ke, {
|
|
279
178
|
key: 3,
|
|
280
|
-
to:
|
|
281
|
-
href:
|
|
282
|
-
as:
|
|
179
|
+
to: f.to,
|
|
180
|
+
href: f.href ?? f.url,
|
|
181
|
+
as: s(f),
|
|
283
182
|
class: "vf-menu__link",
|
|
284
|
-
active:
|
|
285
|
-
disabled:
|
|
183
|
+
active: f.active,
|
|
184
|
+
disabled: f.disabled,
|
|
286
185
|
role: "menuitem",
|
|
287
|
-
"aria-disabled":
|
|
288
|
-
onClick: (
|
|
289
|
-
onActive: (
|
|
186
|
+
"aria-disabled": f.disabled ? "true" : "false",
|
|
187
|
+
onClick: (y) => l(f),
|
|
188
|
+
onActive: (y) => u(f)
|
|
290
189
|
}, {
|
|
291
|
-
default:
|
|
292
|
-
|
|
190
|
+
default: I(() => [
|
|
191
|
+
f.icon ? (g(), W(U(Z), {
|
|
293
192
|
key: 0,
|
|
294
|
-
icon:
|
|
193
|
+
icon: f.icon,
|
|
295
194
|
class: "vf-menu__icon"
|
|
296
|
-
}, null, 8, ["icon"])) :
|
|
297
|
-
|
|
195
|
+
}, null, 8, ["icon"])) : _("", !0),
|
|
196
|
+
J(" " + M(f.label), 1)
|
|
298
197
|
]),
|
|
299
198
|
_: 2
|
|
300
199
|
}, 1032, ["to", "href", "as", "active", "disabled", "aria-disabled", "onClick", "onActive"]))
|
|
@@ -303,7 +202,7 @@ const ft = /* @__PURE__ */ U(lt, [["render", ut]]), vt = { class: "vf-logo" }, p
|
|
|
303
202
|
], 2);
|
|
304
203
|
};
|
|
305
204
|
}
|
|
306
|
-
}),
|
|
205
|
+
}), qe = ["type", "disabled"], co = /* @__PURE__ */ X({
|
|
307
206
|
__name: "button",
|
|
308
207
|
props: {
|
|
309
208
|
to: { default: void 0 },
|
|
@@ -322,70 +221,70 @@ const ft = /* @__PURE__ */ U(lt, [["render", ut]]), vt = { class: "vf-logo" }, p
|
|
|
322
221
|
disabled: { type: Boolean, default: !1 }
|
|
323
222
|
},
|
|
324
223
|
setup(t) {
|
|
325
|
-
const e = t, r = ["button", "submit", "reset"], o = (
|
|
326
|
-
let
|
|
327
|
-
return ["top", "bottom"].includes(e.iconPos) &&
|
|
328
|
-
}), l =
|
|
329
|
-
return (
|
|
224
|
+
const e = t, r = ["button", "submit", "reset"], o = (d) => !!d && r.includes(d), n = w(() => e.as ? e.as === "button" : !(e.to || e.href || e.url || e.type && !o(e.type))), c = w(() => o(e.type) ? e.type : "button"), s = w(() => e.as === "link" ? e.to ? "router-link" : "a" : e.type && !o(e.type) ? e.type === "router-link" && e.to ? "router-link" : "a" : e.to ? "router-link" : "a"), i = w(() => {
|
|
225
|
+
let d = ["vf-button", `vf-button_${e.severity}`];
|
|
226
|
+
return ["top", "bottom"].includes(e.iconPos) && d.push("vf-button_vertical"), e.variant === "text" && d.push("vf-button_text"), e.variant === "outlined" && d.push("vf-button_outlined"), ["small", "large"].indexOf(e.size) > -1 && d.push(`vf-button_${e.size}`), (e.loading || e.disabled) && d.push("vf-button_disabled"), e.rounded && d.push("vf-button_rounded"), d;
|
|
227
|
+
}), l = w(() => ["vf-button__icon", `vf-button__icon_${e.iconPos}`]), u = w(() => ["vf-button__label"]);
|
|
228
|
+
return (d, a) => n.value ? (g(), h("button", {
|
|
330
229
|
key: 0,
|
|
331
|
-
type:
|
|
332
|
-
class:
|
|
230
|
+
type: c.value,
|
|
231
|
+
class: C(i.value),
|
|
333
232
|
disabled: e.loading || e.disabled
|
|
334
233
|
}, [
|
|
335
|
-
e.icon && !e.loading ? (
|
|
234
|
+
e.icon && !e.loading ? (g(), W(U(Z), {
|
|
336
235
|
key: 0,
|
|
337
236
|
icon: e.icon,
|
|
338
|
-
class:
|
|
339
|
-
}, null, 8, ["icon", "class"])) :
|
|
340
|
-
e.loading ? (
|
|
237
|
+
class: C(l.value)
|
|
238
|
+
}, null, 8, ["icon", "class"])) : _("", !0),
|
|
239
|
+
e.loading ? (g(), W(U(Z), {
|
|
341
240
|
key: 1,
|
|
342
241
|
icon: "circleNotch",
|
|
343
|
-
class:
|
|
242
|
+
class: C(l.value),
|
|
344
243
|
spin: ""
|
|
345
|
-
}, null, 8, ["class"])) :
|
|
346
|
-
|
|
244
|
+
}, null, 8, ["class"])) : _("", !0),
|
|
245
|
+
d.$slots.default ? (g(), h("span", {
|
|
347
246
|
key: 2,
|
|
348
|
-
class:
|
|
247
|
+
class: C(u.value)
|
|
349
248
|
}, [
|
|
350
|
-
|
|
351
|
-
], 2)) :
|
|
249
|
+
k(d.$slots, "default")
|
|
250
|
+
], 2)) : d.label ? (g(), h("span", {
|
|
352
251
|
key: 3,
|
|
353
|
-
class:
|
|
354
|
-
},
|
|
355
|
-
], 10,
|
|
252
|
+
class: C(u.value)
|
|
253
|
+
}, M(d.label), 3)) : _("", !0)
|
|
254
|
+
], 10, qe)) : (g(), W(ke, {
|
|
356
255
|
key: 1,
|
|
357
256
|
to: e.to,
|
|
358
257
|
href: e.href ?? e.url,
|
|
359
|
-
as:
|
|
360
|
-
class:
|
|
258
|
+
as: s.value,
|
|
259
|
+
class: C(i.value),
|
|
361
260
|
disabled: e.loading || e.disabled
|
|
362
261
|
}, {
|
|
363
|
-
default:
|
|
364
|
-
e.icon ? (
|
|
262
|
+
default: I(() => [
|
|
263
|
+
e.icon ? (g(), W(U(Z), {
|
|
365
264
|
key: 0,
|
|
366
265
|
icon: e.icon,
|
|
367
|
-
class:
|
|
368
|
-
}, null, 8, ["icon", "class"])) :
|
|
369
|
-
|
|
266
|
+
class: C(l.value)
|
|
267
|
+
}, null, 8, ["icon", "class"])) : _("", !0),
|
|
268
|
+
d.$slots.default ? (g(), h("span", {
|
|
370
269
|
key: 1,
|
|
371
|
-
class:
|
|
270
|
+
class: C(u.value)
|
|
372
271
|
}, [
|
|
373
|
-
|
|
374
|
-
], 2)) :
|
|
272
|
+
k(d.$slots, "default")
|
|
273
|
+
], 2)) : d.label ? (g(), h("span", {
|
|
375
274
|
key: 2,
|
|
376
|
-
class:
|
|
377
|
-
},
|
|
275
|
+
class: C(u.value)
|
|
276
|
+
}, M(d.label), 3)) : _("", !0)
|
|
378
277
|
]),
|
|
379
278
|
_: 3
|
|
380
279
|
}, 8, ["to", "href", "as", "class", "disabled"]));
|
|
381
280
|
}
|
|
382
|
-
}),
|
|
281
|
+
}), Ue = {
|
|
383
282
|
key: 0,
|
|
384
283
|
class: "vf-input__prefix"
|
|
385
|
-
},
|
|
284
|
+
}, Ze = ["type", "value", "placeholder", "disabled", "readonly"], Je = {
|
|
386
285
|
key: 1,
|
|
387
286
|
class: "vf-input__suffix"
|
|
388
|
-
},
|
|
287
|
+
}, uo = /* @__PURE__ */ X({
|
|
389
288
|
__name: "input",
|
|
390
289
|
props: {
|
|
391
290
|
modelValue: { default: "" },
|
|
@@ -398,37 +297,37 @@ const ft = /* @__PURE__ */ U(lt, [["render", ut]]), vt = { class: "vf-logo" }, p
|
|
|
398
297
|
},
|
|
399
298
|
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
400
299
|
setup(t, { emit: e }) {
|
|
401
|
-
const r = e, o = t, n =
|
|
402
|
-
const
|
|
403
|
-
return o.size !== "normal" &&
|
|
404
|
-
}),
|
|
405
|
-
const
|
|
406
|
-
r("update:modelValue",
|
|
407
|
-
},
|
|
408
|
-
return (
|
|
409
|
-
class:
|
|
300
|
+
const r = e, o = t, n = w(() => {
|
|
301
|
+
const u = ["vf-input", `vf-input_${o.variant}`];
|
|
302
|
+
return o.size !== "normal" && u.push(`vf-input_${o.size}`), o.disabled && u.push("vf-input_disabled"), u;
|
|
303
|
+
}), c = (u) => {
|
|
304
|
+
const d = u.target;
|
|
305
|
+
r("update:modelValue", d.value), r("input", u);
|
|
306
|
+
}, s = (u) => r("change", u), i = (u) => r("focus", u), l = (u) => r("blur", u);
|
|
307
|
+
return (u, d) => (g(), h("div", {
|
|
308
|
+
class: C(n.value)
|
|
410
309
|
}, [
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
])) :
|
|
414
|
-
|
|
310
|
+
u.$slots.prefix ? (g(), h("span", Ue, [
|
|
311
|
+
k(u.$slots, "prefix")
|
|
312
|
+
])) : _("", !0),
|
|
313
|
+
B("input", {
|
|
415
314
|
class: "vf-input__control",
|
|
416
|
-
type:
|
|
417
|
-
value:
|
|
418
|
-
placeholder:
|
|
419
|
-
disabled:
|
|
420
|
-
readonly:
|
|
421
|
-
onInput:
|
|
422
|
-
onChange:
|
|
423
|
-
onFocus:
|
|
315
|
+
type: u.type,
|
|
316
|
+
value: u.modelValue,
|
|
317
|
+
placeholder: u.placeholder,
|
|
318
|
+
disabled: u.disabled,
|
|
319
|
+
readonly: u.readonly,
|
|
320
|
+
onInput: c,
|
|
321
|
+
onChange: s,
|
|
322
|
+
onFocus: i,
|
|
424
323
|
onBlur: l
|
|
425
|
-
}, null, 40,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
])) :
|
|
324
|
+
}, null, 40, Ze),
|
|
325
|
+
u.$slots.suffix ? (g(), h("span", Je, [
|
|
326
|
+
k(u.$slots, "suffix")
|
|
327
|
+
])) : _("", !0)
|
|
429
328
|
], 2));
|
|
430
329
|
}
|
|
431
|
-
}),
|
|
330
|
+
}), ue = [
|
|
432
331
|
"top",
|
|
433
332
|
"top-start",
|
|
434
333
|
"top-end",
|
|
@@ -441,7 +340,7 @@ const ft = /* @__PURE__ */ U(lt, [["render", ut]]), vt = { class: "vf-logo" }, p
|
|
|
441
340
|
"left",
|
|
442
341
|
"left-start",
|
|
443
342
|
"left-end"
|
|
444
|
-
],
|
|
343
|
+
], P = (t) => {
|
|
445
344
|
if (t == null || !(t instanceof HTMLElement))
|
|
446
345
|
return null;
|
|
447
346
|
if (typeof window < "u") {
|
|
@@ -449,18 +348,18 @@ const ft = /* @__PURE__ */ U(lt, [["render", ut]]), vt = { class: "vf-logo" }, p
|
|
|
449
348
|
if (/(auto|scroll|overlay)/.test(r))
|
|
450
349
|
return t;
|
|
451
350
|
}
|
|
452
|
-
return t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth ? t :
|
|
351
|
+
return t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth ? t : P(t.parentNode);
|
|
453
352
|
};
|
|
454
|
-
function
|
|
353
|
+
function Qe(t) {
|
|
455
354
|
return typeof window > "u" ? !1 : window.getComputedStyle(t).position === "fixed";
|
|
456
355
|
}
|
|
457
|
-
const
|
|
458
|
-
const o = t.getBoundingClientRect(), n = e ? e.offsetParent : null,
|
|
459
|
-
if (n && !
|
|
460
|
-
const
|
|
356
|
+
const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y = (t, e) => et(t, e) === "fixed", R = (t, e, r = {}) => {
|
|
357
|
+
const o = t.getBoundingClientRect(), n = e ? e.offsetParent : null, c = e ? Y(r, e) : !1;
|
|
358
|
+
if (n && !c) {
|
|
359
|
+
const s = n.getBoundingClientRect(), i = n.scrollLeft, l = n.scrollTop;
|
|
461
360
|
return {
|
|
462
|
-
left: o.left -
|
|
463
|
-
top: o.top -
|
|
361
|
+
left: o.left - s.left + i,
|
|
362
|
+
top: o.top - s.top + l,
|
|
464
363
|
width: o.width,
|
|
465
364
|
height: o.height
|
|
466
365
|
};
|
|
@@ -471,81 +370,81 @@ const $t = (t, e) => t.strategy ? t.strategy : wt(e) ? "fixed" : "absolute", Y =
|
|
|
471
370
|
width: o.width,
|
|
472
371
|
height: o.height
|
|
473
372
|
};
|
|
474
|
-
},
|
|
373
|
+
}, j = (t, e) => {
|
|
475
374
|
var r;
|
|
476
375
|
return (r = t.middleware) == null ? void 0 : r.find((o) => o.name === e);
|
|
477
|
-
}, Ce = (t, e) => !!
|
|
478
|
-
const e =
|
|
376
|
+
}, Ce = (t, e) => !!j(t, e), tt = (t) => {
|
|
377
|
+
const e = P(t);
|
|
479
378
|
let r = "";
|
|
480
379
|
return e !== null && ((e.dataset.scrollTop === void 0 || e.scrollTop === +e.dataset.scrollTop) && (e.dataset.scrollTop = "0"), (e.dataset.scrollLeft === void 0 || e.scrollLeft === +e.dataset.scrollLeft) && (e.dataset.scrollLeft = "0"), e.scrollTop > +e.dataset.scrollTop ? r = "bottom" : e.scrollTop < +e.dataset.scrollTop ? r = "top" : e.scrollLeft > +e.dataset.scrollLeft ? r = "right" : e.scrollLeft < +e.dataset.scrollLeft && (r = "left"), e.dataset.scrollTop = e.scrollTop <= 0 ? "0" : e.scrollTop.toString(), e.dataset.scrollLeft = e.scrollLeft <= 0 ? "0" : e.scrollLeft.toString()), r;
|
|
481
|
-
},
|
|
380
|
+
}, ot = (t) => t.scrollLeft + t.clientWidth, rt = (t) => t.scrollTop + t.clientHeight, L = (t, e, r = null, o = {}, n) => {
|
|
482
381
|
if (r === null && typeof window < "u" && Y(o, e))
|
|
483
382
|
return t;
|
|
484
|
-
let
|
|
383
|
+
let c = 0;
|
|
485
384
|
if (r === null) {
|
|
486
|
-
const
|
|
487
|
-
|
|
385
|
+
const s = P(e);
|
|
386
|
+
c = s ? s.scrollTop : 0;
|
|
488
387
|
}
|
|
489
|
-
return t -
|
|
490
|
-
},
|
|
491
|
-
let
|
|
388
|
+
return t - c;
|
|
389
|
+
}, V = (t, e, r = null, o = {}, n) => {
|
|
390
|
+
let c;
|
|
492
391
|
if (r === null && typeof window < "u" && Y(o, e))
|
|
493
|
-
|
|
392
|
+
c = window.innerWidth;
|
|
494
393
|
else if (r === null) {
|
|
495
|
-
const
|
|
496
|
-
|
|
394
|
+
const s = P(e);
|
|
395
|
+
c = s ? ot(s) : 0;
|
|
497
396
|
} else
|
|
498
|
-
|
|
499
|
-
return -(t + e.clientWidth -
|
|
500
|
-
},
|
|
501
|
-
let
|
|
397
|
+
c = r.getBoundingClientRect().width;
|
|
398
|
+
return -(t + e.clientWidth - c);
|
|
399
|
+
}, O = (t, e, r = null, o = {}, n) => {
|
|
400
|
+
let c;
|
|
502
401
|
if (r === null && typeof window < "u" && Y(o, e))
|
|
503
|
-
|
|
402
|
+
c = window.innerHeight;
|
|
504
403
|
else if (r === null) {
|
|
505
|
-
const
|
|
506
|
-
|
|
404
|
+
const s = P(e);
|
|
405
|
+
c = s ? rt(s) : 0;
|
|
507
406
|
} else
|
|
508
|
-
|
|
509
|
-
return -(t + e.clientHeight -
|
|
510
|
-
},
|
|
407
|
+
c = r.getBoundingClientRect().height;
|
|
408
|
+
return -(t + e.clientHeight - c);
|
|
409
|
+
}, z = (t, e, r = null, o = {}, n) => {
|
|
511
410
|
if (r === null && typeof window < "u" && Y(o, e))
|
|
512
411
|
return t;
|
|
513
|
-
let
|
|
412
|
+
let c = 0;
|
|
514
413
|
if (r === null) {
|
|
515
|
-
const
|
|
516
|
-
|
|
414
|
+
const s = P(e);
|
|
415
|
+
c = s ? s.scrollLeft : 0;
|
|
517
416
|
}
|
|
518
|
-
return t -
|
|
519
|
-
},
|
|
417
|
+
return t - c;
|
|
418
|
+
}, fe = ({
|
|
520
419
|
options: t,
|
|
521
420
|
primaryX: e,
|
|
522
421
|
primaryY: r,
|
|
523
422
|
floating: o,
|
|
524
423
|
placement: n,
|
|
525
|
-
reference:
|
|
526
|
-
scrollDirection:
|
|
424
|
+
reference: c,
|
|
425
|
+
scrollDirection: s
|
|
527
426
|
}) => {
|
|
528
|
-
const
|
|
427
|
+
const i = ae(c, o, n, t), l = j(t, "offset");
|
|
529
428
|
if (l) {
|
|
530
|
-
const
|
|
531
|
-
x:
|
|
532
|
-
y:
|
|
429
|
+
const u = l.fn({
|
|
430
|
+
x: i.x,
|
|
431
|
+
y: i.y,
|
|
533
432
|
options: t,
|
|
534
433
|
primaryX: e,
|
|
535
434
|
primaryY: r,
|
|
536
435
|
floating: o,
|
|
537
436
|
placement: n,
|
|
538
|
-
reference:
|
|
539
|
-
scrollDirection:
|
|
437
|
+
reference: c,
|
|
438
|
+
scrollDirection: s
|
|
540
439
|
});
|
|
541
|
-
|
|
440
|
+
i.x = u.x, i.y = u.y;
|
|
542
441
|
}
|
|
543
|
-
return
|
|
544
|
-
x:
|
|
545
|
-
y:
|
|
442
|
+
return _t(i, o, c, t) ? {
|
|
443
|
+
x: i.x,
|
|
444
|
+
y: i.y,
|
|
546
445
|
placement: n
|
|
547
446
|
} : !1;
|
|
548
|
-
},
|
|
447
|
+
}, nt = (t) => ({
|
|
549
448
|
name: "flip",
|
|
550
449
|
params: t,
|
|
551
450
|
fn: ({
|
|
@@ -553,116 +452,116 @@ const $t = (t, e) => t.strategy ? t.strategy : wt(e) ? "fixed" : "absolute", Y =
|
|
|
553
452
|
y: r,
|
|
554
453
|
options: o,
|
|
555
454
|
primaryX: n,
|
|
556
|
-
primaryY:
|
|
557
|
-
floating:
|
|
558
|
-
placement:
|
|
455
|
+
primaryY: c,
|
|
456
|
+
floating: s,
|
|
457
|
+
placement: i,
|
|
559
458
|
reference: l,
|
|
560
|
-
scrollDirection:
|
|
459
|
+
scrollDirection: u
|
|
561
460
|
}) => {
|
|
562
|
-
var
|
|
563
|
-
const
|
|
461
|
+
var d;
|
|
462
|
+
const a = {
|
|
564
463
|
x: e,
|
|
565
464
|
y: r,
|
|
566
|
-
placement:
|
|
465
|
+
placement: i
|
|
567
466
|
}, v = {
|
|
568
467
|
...o,
|
|
569
|
-
middleware: (
|
|
570
|
-
},
|
|
571
|
-
let
|
|
572
|
-
const
|
|
573
|
-
if (
|
|
468
|
+
middleware: (d = o.middleware) == null ? void 0 : d.filter((x) => x.name !== "shift")
|
|
469
|
+
}, f = (t == null ? void 0 : t.placements) ?? ue, p = !(t != null && t.placements), y = p ? ue : f;
|
|
470
|
+
let m = !1;
|
|
471
|
+
const Q = (x) => {
|
|
472
|
+
if (m)
|
|
574
473
|
return;
|
|
575
|
-
const
|
|
474
|
+
const $ = fe({
|
|
576
475
|
options: v,
|
|
577
476
|
primaryX: n,
|
|
578
|
-
primaryY:
|
|
579
|
-
floating:
|
|
477
|
+
primaryY: c,
|
|
478
|
+
floating: s,
|
|
580
479
|
placement: x,
|
|
581
480
|
reference: l,
|
|
582
|
-
scrollDirection:
|
|
481
|
+
scrollDirection: u
|
|
583
482
|
});
|
|
584
|
-
|
|
585
|
-
},
|
|
586
|
-
if (!
|
|
587
|
-
const x =
|
|
588
|
-
(
|
|
589
|
-
const
|
|
483
|
+
$ && (a.x = $.x, a.y = $.y, a.placement = $.placement, m = !0);
|
|
484
|
+
}, ee = $t(l, s, v);
|
|
485
|
+
if (!p && f.includes(i) && Q(i), m || y.forEach(Q), !m) {
|
|
486
|
+
const x = f.reduce(
|
|
487
|
+
($, H) => {
|
|
488
|
+
const A = fe({
|
|
590
489
|
options: v,
|
|
591
490
|
primaryX: n,
|
|
592
|
-
primaryY:
|
|
593
|
-
floating:
|
|
594
|
-
placement:
|
|
491
|
+
primaryY: c,
|
|
492
|
+
floating: s,
|
|
493
|
+
placement: H,
|
|
595
494
|
reference: l,
|
|
596
|
-
scrollDirection:
|
|
495
|
+
scrollDirection: u
|
|
597
496
|
});
|
|
598
|
-
if (!
|
|
599
|
-
return
|
|
600
|
-
const S =
|
|
601
|
-
return
|
|
497
|
+
if (!A)
|
|
498
|
+
return $;
|
|
499
|
+
const S = te(H), D = ee[S];
|
|
500
|
+
return !$ || D > $.space ? { result: A, space: D } : $;
|
|
602
501
|
},
|
|
603
502
|
null
|
|
604
503
|
);
|
|
605
|
-
x && (
|
|
504
|
+
x && (a.x = x.result.x, a.y = x.result.y, a.placement = x.result.placement, m = !0);
|
|
606
505
|
}
|
|
607
|
-
if (!
|
|
608
|
-
const x =
|
|
609
|
-
let
|
|
610
|
-
|
|
611
|
-
const
|
|
612
|
-
F >
|
|
506
|
+
if (!m && f.length > 0) {
|
|
507
|
+
const x = te(i);
|
|
508
|
+
let $ = x, H = ee[x];
|
|
509
|
+
f.forEach((q) => {
|
|
510
|
+
const b = te(q), F = ee[b];
|
|
511
|
+
F > H && (H = F, $ = b);
|
|
613
512
|
});
|
|
614
|
-
const
|
|
615
|
-
if (
|
|
616
|
-
const
|
|
513
|
+
const A = Ft($, i, f), S = ae(l, s, A, v), D = j(v, "offset");
|
|
514
|
+
if (D) {
|
|
515
|
+
const q = D.fn({
|
|
617
516
|
x: S.x,
|
|
618
517
|
y: S.y,
|
|
619
518
|
options: v,
|
|
620
519
|
primaryX: n,
|
|
621
|
-
primaryY:
|
|
622
|
-
floating:
|
|
623
|
-
placement:
|
|
520
|
+
primaryY: c,
|
|
521
|
+
floating: s,
|
|
522
|
+
placement: A,
|
|
624
523
|
reference: l,
|
|
625
|
-
scrollDirection:
|
|
524
|
+
scrollDirection: u
|
|
626
525
|
});
|
|
627
|
-
S.x =
|
|
526
|
+
S.x = q.x, S.y = q.y;
|
|
628
527
|
}
|
|
629
|
-
|
|
528
|
+
a.x = S.x, a.y = S.y, a.placement = S.placement;
|
|
630
529
|
}
|
|
631
|
-
return
|
|
530
|
+
return a;
|
|
632
531
|
}
|
|
633
|
-
}),
|
|
634
|
-
var
|
|
532
|
+
}), lt = (t, e, r, o, n) => {
|
|
533
|
+
var c, s, i;
|
|
635
534
|
let l = 0;
|
|
636
535
|
o.startsWith("right") ? l = -2 : o.startsWith("left") && (l = t);
|
|
637
|
-
const
|
|
638
|
-
if (
|
|
639
|
-
const
|
|
640
|
-
o.startsWith("right") ? l -=
|
|
536
|
+
const u = j(e, "arrow"), d = j(e, "shift");
|
|
537
|
+
if (u) {
|
|
538
|
+
const a = ((c = u.params) == null ? void 0 : c.arrow).getBoundingClientRect();
|
|
539
|
+
o.startsWith("right") ? l -= a.width / 2 : o.startsWith("left") && (l += a.width / 2);
|
|
641
540
|
}
|
|
642
|
-
if (Ce(e, "shift") &&
|
|
643
|
-
let
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
v =
|
|
541
|
+
if (Ce(e, "shift") && u) {
|
|
542
|
+
let a = null, v = 0;
|
|
543
|
+
d && (a = (s = d.params) == null ? void 0 : s.parent);
|
|
544
|
+
const f = (i = u.params) == null ? void 0 : i.arrow;
|
|
545
|
+
v = f.getBoundingClientRect().width / 2, v += it(f), v -= t, o.startsWith("right") ? V(r - l, n, a, e) <= t ? V(r, n, a, e) > 0 ? l = t - V(r, n, a, e) : l = t : z(r - l - v, n, a, e) <= t && (z(r - l - v, n, a, e) >= 0 ? (l = -2 - (z(r - l - v, n, a, e) + t), a && (l = -2)) : l = -2) : o.startsWith("left") ? V(r - l + v, n, a, e) <= t ? (l = t + V(r - v, n, a, e), l <= t && (l = t)) : z(r - l, n, a, e) <= t && (l = -2 + z(r, n, a, e), l <= -2 && (l = -2)) : V(r - l, n, a, e) <= t ? V(r - l, n, a, e) <= t && V(r, n, a, e) > 0 ? l = t - V(r, n, a, e) : l = t : z(r - l, n, a, e) <= t && (z(r - l, n, a, e) <= t && z(r, n, a, e) > 0 ? l = -(t - z(r, n, a, e)) : l = -2);
|
|
647
546
|
}
|
|
648
547
|
return l;
|
|
649
|
-
},
|
|
650
|
-
var
|
|
548
|
+
}, at = (t, e, r, o, n) => {
|
|
549
|
+
var c, s, i;
|
|
651
550
|
let l = 0;
|
|
652
551
|
o.startsWith("top") ? l = t : o.startsWith("bottom") && (l = -2);
|
|
653
|
-
const
|
|
654
|
-
if (
|
|
655
|
-
const
|
|
656
|
-
o.startsWith("top") ? l +=
|
|
552
|
+
const u = j(e, "arrow"), d = j(e, "shift");
|
|
553
|
+
if (u) {
|
|
554
|
+
const a = ((c = u.params) == null ? void 0 : c.arrow).getBoundingClientRect();
|
|
555
|
+
o.startsWith("top") ? l += a.height / 2 : o.startsWith("bottom") && (l -= a.height / 2);
|
|
657
556
|
}
|
|
658
|
-
if (Ce(e, "shift") &&
|
|
659
|
-
let
|
|
660
|
-
|
|
661
|
-
const
|
|
662
|
-
v =
|
|
557
|
+
if (Ce(e, "shift") && u) {
|
|
558
|
+
let a = null, v = 0;
|
|
559
|
+
d && (a = (s = d.params) == null ? void 0 : s.parent);
|
|
560
|
+
const f = (i = u.params) == null ? void 0 : i.arrow;
|
|
561
|
+
v = f.getBoundingClientRect().height / 2, v += ct(f), v -= t, o.startsWith("top") ? L(r - l, n, a, e) <= t ? L(r, n, a, e) >= 0 ? l = -(t - L(r, n, a, e)) : l = -2 : O(r - l + v, n, a, e) <= t && (l = t + O(r - v, n, a, e), l <= t && (l = t)) : o.startsWith("bottom") ? L(r - l - v, n, a, e) <= t ? L(r - l - v, n, a, e) >= 0 ? (l = -2 - (L(r - l - v, n, a, e) + t), a && (l = -2)) : l = -2 : O(r - l, n, a, e) <= t && (O(r, n, a, e) >= 0 ? l = t - O(r, n, a, e) : l = t) : L(r - l, n, a, e) <= t ? L(r - l, n, a, e) >= 0 ? l = -(t - L(r - l, n, a, e)) : l = -2 : O(r - l, n, a, e) <= t && (O(r - l, n, a, e) >= 0 ? l = t - O(r - l, n, a, e) : l = t);
|
|
663
562
|
}
|
|
664
563
|
return l;
|
|
665
|
-
},
|
|
564
|
+
}, st = (t) => ({
|
|
666
565
|
name: "offset",
|
|
667
566
|
params: { value: t },
|
|
668
567
|
fn: ({
|
|
@@ -670,139 +569,139 @@ const $t = (t, e) => t.strategy ? t.strategy : wt(e) ? "fixed" : "absolute", Y =
|
|
|
670
569
|
y: r,
|
|
671
570
|
options: o,
|
|
672
571
|
primaryX: n,
|
|
673
|
-
primaryY:
|
|
674
|
-
floating:
|
|
675
|
-
placement:
|
|
572
|
+
primaryY: c,
|
|
573
|
+
floating: s,
|
|
574
|
+
placement: i
|
|
676
575
|
}) => ({
|
|
677
|
-
x: e -
|
|
678
|
-
y: r -
|
|
679
|
-
placement:
|
|
576
|
+
x: e - lt(t, o, n, i, s),
|
|
577
|
+
y: r - at(t, o, c, i, s),
|
|
578
|
+
placement: i
|
|
680
579
|
})
|
|
681
|
-
}),
|
|
682
|
-
const r =
|
|
580
|
+
}), it = (t) => t.getBoundingClientRect().width !== t.clientWidth ? (t.getBoundingClientRect().width - t.clientWidth) / 2 : 0, ct = (t) => t.getBoundingClientRect().height !== t.clientHeight ? (t.getBoundingClientRect().height - t.clientHeight) / 2 : 0, dt = (t, e) => {
|
|
581
|
+
const r = P(t), o = [];
|
|
683
582
|
if (r !== null) {
|
|
684
583
|
const n = () => e();
|
|
685
584
|
r.addEventListener("scroll", n, !1), o.push(() => r.removeEventListener("scroll", n, !1));
|
|
686
585
|
}
|
|
687
586
|
if (typeof window < "u") {
|
|
688
|
-
const n = () => e(),
|
|
689
|
-
window.addEventListener("scroll", n, !1), window.addEventListener("resize",
|
|
587
|
+
const n = () => e(), c = () => e();
|
|
588
|
+
window.addEventListener("scroll", n, !1), window.addEventListener("resize", c, !1), o.push(() => window.removeEventListener("scroll", n, !1)), o.push(() => window.removeEventListener("resize", c, !1));
|
|
690
589
|
}
|
|
691
590
|
if (typeof ResizeObserver < "u" && t instanceof HTMLElement) {
|
|
692
591
|
const n = new ResizeObserver(() => e());
|
|
693
592
|
n.observe(t), o.push(() => n.disconnect());
|
|
694
593
|
}
|
|
695
594
|
return () => o.forEach((n) => n());
|
|
696
|
-
},
|
|
595
|
+
}, ut = (t, e, r = {}) => {
|
|
697
596
|
const o = R(t, e, r);
|
|
698
597
|
return {
|
|
699
598
|
x: o.left - e.getBoundingClientRect().width / 2 + o.width / 2,
|
|
700
599
|
y: o.top - e.getBoundingClientRect().height,
|
|
701
600
|
placement: "top"
|
|
702
601
|
};
|
|
703
|
-
},
|
|
602
|
+
}, ft = (t, e, r = {}) => {
|
|
704
603
|
const o = R(t, e, r);
|
|
705
604
|
return {
|
|
706
605
|
x: o.left,
|
|
707
606
|
y: o.top - e.getBoundingClientRect().height,
|
|
708
607
|
placement: "top-start"
|
|
709
608
|
};
|
|
710
|
-
},
|
|
609
|
+
}, vt = (t, e, r = {}) => {
|
|
711
610
|
const o = R(t, e, r);
|
|
712
611
|
return {
|
|
713
612
|
x: o.left - e.getBoundingClientRect().width + o.width,
|
|
714
613
|
y: o.top - e.getBoundingClientRect().height,
|
|
715
614
|
placement: "top-end"
|
|
716
615
|
};
|
|
717
|
-
},
|
|
616
|
+
}, pt = (t, e, r = {}) => {
|
|
718
617
|
const o = R(t, e, r);
|
|
719
618
|
return {
|
|
720
619
|
x: o.left + o.width,
|
|
721
620
|
y: o.top - e.getBoundingClientRect().height / 2 + o.height / 2,
|
|
722
621
|
placement: "right"
|
|
723
622
|
};
|
|
724
|
-
},
|
|
623
|
+
}, bt = (t, e, r = {}) => {
|
|
725
624
|
const o = R(t, e, r);
|
|
726
625
|
return {
|
|
727
626
|
x: o.left + o.width,
|
|
728
627
|
y: o.top,
|
|
729
628
|
placement: "right-start"
|
|
730
629
|
};
|
|
731
|
-
},
|
|
630
|
+
}, gt = (t, e, r = {}) => {
|
|
732
631
|
const o = R(t, e, r);
|
|
733
632
|
return {
|
|
734
633
|
x: o.left + o.width,
|
|
735
634
|
y: o.top + o.height - e.getBoundingClientRect().height,
|
|
736
635
|
placement: "right-end"
|
|
737
636
|
};
|
|
738
|
-
},
|
|
637
|
+
}, ht = (t, e, r = {}) => {
|
|
739
638
|
const o = R(t, e, r);
|
|
740
639
|
return {
|
|
741
640
|
x: o.left + o.width / 2 - e.getBoundingClientRect().width / 2,
|
|
742
641
|
y: o.top + o.height,
|
|
743
642
|
placement: "bottom"
|
|
744
643
|
};
|
|
745
|
-
},
|
|
644
|
+
}, mt = (t, e, r = {}) => {
|
|
746
645
|
const o = R(t, e, r);
|
|
747
646
|
return {
|
|
748
647
|
x: o.left,
|
|
749
648
|
y: o.top + o.height,
|
|
750
649
|
placement: "bottom-start"
|
|
751
650
|
};
|
|
752
|
-
},
|
|
651
|
+
}, yt = (t, e, r = {}) => {
|
|
753
652
|
const o = R(t, e, r);
|
|
754
653
|
return {
|
|
755
654
|
x: o.left - e.getBoundingClientRect().width + o.width,
|
|
756
655
|
y: o.top + o.height,
|
|
757
656
|
placement: "bottom-end"
|
|
758
657
|
};
|
|
759
|
-
},
|
|
658
|
+
}, kt = (t, e, r = {}) => {
|
|
760
659
|
const o = R(t, e, r);
|
|
761
660
|
return {
|
|
762
661
|
x: o.left - e.getBoundingClientRect().width,
|
|
763
662
|
y: o.top + o.height / 2 - e.getBoundingClientRect().height / 2,
|
|
764
663
|
placement: "left"
|
|
765
664
|
};
|
|
766
|
-
},
|
|
665
|
+
}, Ct = (t, e, r = {}) => {
|
|
767
666
|
const o = R(t, e, r);
|
|
768
667
|
return {
|
|
769
668
|
x: o.left - e.getBoundingClientRect().width,
|
|
770
669
|
y: o.top,
|
|
771
670
|
placement: "left-start"
|
|
772
671
|
};
|
|
773
|
-
},
|
|
672
|
+
}, wt = (t, e, r = {}) => {
|
|
774
673
|
const o = R(t, e, r);
|
|
775
674
|
return {
|
|
776
675
|
x: o.left - e.getBoundingClientRect().width,
|
|
777
676
|
y: o.top + o.height - e.getBoundingClientRect().height,
|
|
778
677
|
placement: "left-end"
|
|
779
678
|
};
|
|
780
|
-
},
|
|
679
|
+
}, ae = (t, e, r, o = {}) => {
|
|
781
680
|
switch (r) {
|
|
782
681
|
case "top":
|
|
783
|
-
return
|
|
682
|
+
return ut(t, e, o);
|
|
784
683
|
case "top-start":
|
|
785
|
-
return
|
|
684
|
+
return ft(t, e, o);
|
|
786
685
|
case "top-end":
|
|
787
|
-
return
|
|
686
|
+
return vt(t, e, o);
|
|
788
687
|
case "right":
|
|
789
|
-
return
|
|
688
|
+
return pt(t, e, o);
|
|
790
689
|
case "right-start":
|
|
791
|
-
return
|
|
690
|
+
return bt(t, e, o);
|
|
792
691
|
case "right-end":
|
|
793
|
-
return
|
|
692
|
+
return gt(t, e, o);
|
|
794
693
|
case "bottom":
|
|
795
|
-
return
|
|
694
|
+
return ht(t, e, o);
|
|
796
695
|
case "bottom-start":
|
|
797
|
-
return
|
|
696
|
+
return mt(t, e, o);
|
|
798
697
|
case "bottom-end":
|
|
799
|
-
return
|
|
698
|
+
return yt(t, e, o);
|
|
800
699
|
case "left":
|
|
801
|
-
return
|
|
700
|
+
return kt(t, e, o);
|
|
802
701
|
case "left-start":
|
|
803
|
-
return
|
|
702
|
+
return Ct(t, e, o);
|
|
804
703
|
case "left-end":
|
|
805
|
-
return
|
|
704
|
+
return wt(t, e, o);
|
|
806
705
|
default:
|
|
807
706
|
return {
|
|
808
707
|
x: 0,
|
|
@@ -810,25 +709,25 @@ const $t = (t, e) => t.strategy ? t.strategy : wt(e) ? "fixed" : "absolute", Y =
|
|
|
810
709
|
placement: ""
|
|
811
710
|
};
|
|
812
711
|
}
|
|
813
|
-
},
|
|
712
|
+
}, _t = (t, e, r, o = {}) => {
|
|
814
713
|
if (Y(o, e)) {
|
|
815
714
|
if (typeof window > "u")
|
|
816
715
|
return !0;
|
|
817
|
-
const
|
|
818
|
-
return
|
|
716
|
+
const a = t.x, v = t.y, f = a + e.clientWidth, p = v + e.clientHeight;
|
|
717
|
+
return a >= 0 && v >= 0 && f <= window.innerWidth && p <= window.innerHeight;
|
|
819
718
|
}
|
|
820
|
-
if (
|
|
821
|
-
return
|
|
719
|
+
if (P(r) !== null)
|
|
720
|
+
return L(t.y, e, null, o) > 0 && V(t.x, e, null, o) > 0 && O(t.y, e, null, o) > 0 && z(t.x, e, null, o) > 0;
|
|
822
721
|
if (typeof window > "u")
|
|
823
722
|
return !0;
|
|
824
|
-
const n = window.innerWidth,
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
return v >= 0 &&
|
|
723
|
+
const n = window.innerWidth, c = window.innerHeight, s = (r instanceof HTMLElement ? r.offsetParent : null) || e.offsetParent;
|
|
724
|
+
if (s) {
|
|
725
|
+
const a = s.getBoundingClientRect(), v = a.left + t.x, f = a.top + t.y, p = v + e.clientWidth, y = f + e.clientHeight;
|
|
726
|
+
return v >= 0 && f >= 0 && p <= n && y <= c;
|
|
828
727
|
}
|
|
829
|
-
const
|
|
830
|
-
return
|
|
831
|
-
},
|
|
728
|
+
const i = t.x, l = t.y, u = i + e.clientWidth, d = l + e.clientHeight;
|
|
729
|
+
return i >= 0 && l >= 0 && u <= n && d <= c;
|
|
730
|
+
}, te = (t) => t.startsWith("right") ? "right" : t.startsWith("left") ? "left" : t.startsWith("top") ? "top" : "bottom", Ft = (t, e, r) => te(e) === t && r.includes(e) ? e : r.find((o) => te(o) === t) ?? r[0], $t = (t, e, r = {}) => {
|
|
832
731
|
if (typeof window > "u")
|
|
833
732
|
return {
|
|
834
733
|
top: 0,
|
|
@@ -836,51 +735,51 @@ const $t = (t, e) => t.strategy ? t.strategy : wt(e) ? "fixed" : "absolute", Y =
|
|
|
836
735
|
bottom: 0,
|
|
837
736
|
left: 0
|
|
838
737
|
};
|
|
839
|
-
const o = Y(r, e) ? null :
|
|
738
|
+
const o = Y(r, e) ? null : P(t), n = t.getBoundingClientRect(), c = o ? o.getBoundingClientRect() : {
|
|
840
739
|
top: 0,
|
|
841
740
|
left: 0,
|
|
842
741
|
right: window.innerWidth,
|
|
843
742
|
bottom: window.innerHeight
|
|
844
743
|
};
|
|
845
744
|
return {
|
|
846
|
-
top: n.top -
|
|
847
|
-
right:
|
|
848
|
-
bottom:
|
|
849
|
-
left: n.left -
|
|
745
|
+
top: n.top - c.top,
|
|
746
|
+
right: c.right - n.right,
|
|
747
|
+
bottom: c.bottom - n.bottom,
|
|
748
|
+
left: n.left - c.left
|
|
850
749
|
};
|
|
851
|
-
},
|
|
852
|
-
var n,
|
|
853
|
-
const
|
|
750
|
+
}, Bt = (t, e, r = {}) => new Promise((o) => {
|
|
751
|
+
var n, c;
|
|
752
|
+
const s = r.placement ? r.placement : "bottom", i = {
|
|
854
753
|
x: 0,
|
|
855
754
|
y: 0,
|
|
856
|
-
placement:
|
|
755
|
+
placement: s,
|
|
857
756
|
middlewareData: {}
|
|
858
|
-
}, l =
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
(n = r.middleware) == null || n.forEach((
|
|
862
|
-
const
|
|
863
|
-
x:
|
|
864
|
-
y:
|
|
757
|
+
}, l = ae(t, e, s, r);
|
|
758
|
+
i.x = l.x, i.y = l.y, i.placement = l.placement;
|
|
759
|
+
const u = i.x, d = i.y, a = tt(t);
|
|
760
|
+
(n = r.middleware) == null || n.forEach((y) => {
|
|
761
|
+
const m = y.fn({
|
|
762
|
+
x: i.x,
|
|
763
|
+
y: i.y,
|
|
865
764
|
options: r,
|
|
866
|
-
primaryX:
|
|
867
|
-
primaryY:
|
|
765
|
+
primaryX: u,
|
|
766
|
+
primaryY: d,
|
|
868
767
|
floating: e,
|
|
869
|
-
placement:
|
|
768
|
+
placement: i.placement,
|
|
870
769
|
reference: t,
|
|
871
|
-
scrollDirection:
|
|
770
|
+
scrollDirection: a
|
|
872
771
|
});
|
|
873
|
-
|
|
772
|
+
i.x = m.x, i.y = m.y, i.placement = m.placement, y.name === "arrow" && (m.baseX = m.x, m.baseY = m.y, m.x = m.arrowX ?? m.x, m.y = m.arrowY ?? m.y), i.middlewareData[y.name] = m;
|
|
874
773
|
});
|
|
875
|
-
const v =
|
|
876
|
-
if (Number.isFinite(
|
|
774
|
+
const v = ae(t, e, i.placement, r), f = j(r, "offset"), p = f ? (c = f.params) == null ? void 0 : c.value : 0;
|
|
775
|
+
if (Number.isFinite(i.x) || (i.x = v.x), !Number.isFinite(i.y))
|
|
877
776
|
if (Y(r, e)) {
|
|
878
|
-
const
|
|
879
|
-
|
|
777
|
+
const y = t.getBoundingClientRect(), m = e.getBoundingClientRect().height;
|
|
778
|
+
i.placement.startsWith("top") ? i.y = y.top - m - p : i.placement.startsWith("bottom") ? i.y = y.bottom + p : i.y = v.y;
|
|
880
779
|
} else
|
|
881
|
-
|
|
882
|
-
o(
|
|
883
|
-
}),
|
|
780
|
+
i.y = v.y;
|
|
781
|
+
o(i);
|
|
782
|
+
}), xt = ["disabled", "aria-expanded", "onKeydown"], Tt = ["data-placement"], Rt = ["disabled", "aria-selected", "onClick"], fo = /* @__PURE__ */ X({
|
|
884
783
|
__name: "select",
|
|
885
784
|
props: {
|
|
886
785
|
modelValue: { default: void 0 },
|
|
@@ -894,136 +793,136 @@ const $t = (t, e) => t.strategy ? t.strategy : wt(e) ? "fixed" : "absolute", Y =
|
|
|
894
793
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
895
794
|
setup(t, { emit: e }) {
|
|
896
795
|
let r = 0;
|
|
897
|
-
const o = e, n = t,
|
|
796
|
+
const o = e, n = t, c = N(null), s = N(null), i = N(null), l = N(!1), u = N("bottom"), d = N("bottom"), a = `vf-select-panel-${++r}`;
|
|
898
797
|
let v = null;
|
|
899
|
-
const
|
|
900
|
-
label:
|
|
901
|
-
value:
|
|
902
|
-
disabled:
|
|
903
|
-
}))),
|
|
904
|
-
var
|
|
905
|
-
return ((
|
|
906
|
-
}),
|
|
907
|
-
const
|
|
908
|
-
return n.size !== "normal" &&
|
|
909
|
-
}),
|
|
910
|
-
|
|
911
|
-
}, x = (
|
|
912
|
-
l.value = !1,
|
|
913
|
-
},
|
|
914
|
-
n.disabled || (l.value = !l.value, l.value && (
|
|
798
|
+
const f = w(() => n.options.map((b) => ({
|
|
799
|
+
label: b[n.optionLabel],
|
|
800
|
+
value: b[n.optionValue],
|
|
801
|
+
disabled: b.disabled
|
|
802
|
+
}))), p = w(() => f.value.find((b) => b.value === n.modelValue)), y = w(() => {
|
|
803
|
+
var b;
|
|
804
|
+
return ((b = p.value) == null ? void 0 : b.label) ?? "";
|
|
805
|
+
}), m = w(() => {
|
|
806
|
+
const b = ["vf-select", l.value ? "vf-select_open" : ""];
|
|
807
|
+
return n.size !== "normal" && b.push(`vf-select_${n.size}`), n.disabled && b.push("vf-select_disabled"), b.filter(Boolean);
|
|
808
|
+
}), Q = (b) => b.value === n.modelValue, ee = (b) => {
|
|
809
|
+
b.disabled || (o("update:modelValue", b.value), o("change", b.value), H());
|
|
810
|
+
}, x = (b) => o("focus", b), $ = (b) => o("blur", b), H = () => {
|
|
811
|
+
l.value = !1, u.value = "bottom", d.value = "bottom";
|
|
812
|
+
}, A = () => {
|
|
813
|
+
n.disabled || (l.value = !l.value, l.value && (u.value = "bottom", d.value = "bottom"));
|
|
915
814
|
}, S = async () => {
|
|
916
|
-
var
|
|
917
|
-
l.value || (l.value = !0, await
|
|
918
|
-
},
|
|
815
|
+
var b, F;
|
|
816
|
+
l.value || (l.value = !0, await de()), (F = (b = i.value) == null ? void 0 : b.querySelector(".vf-select__option:not(.is-disabled)")) == null || F.focus();
|
|
817
|
+
}, D = (b) => {
|
|
919
818
|
var T;
|
|
920
|
-
if (!l.value || !
|
|
819
|
+
if (!l.value || !c.value)
|
|
921
820
|
return;
|
|
922
|
-
const F =
|
|
923
|
-
|
|
924
|
-
},
|
|
925
|
-
if (!
|
|
821
|
+
const F = b.target;
|
|
822
|
+
c.value.contains(F) || (T = i.value) != null && T.contains(F) || H();
|
|
823
|
+
}, q = () => {
|
|
824
|
+
if (!s.value || !i.value)
|
|
926
825
|
return;
|
|
927
|
-
const
|
|
826
|
+
const b = s.value, F = i.value, T = async () => {
|
|
928
827
|
const {
|
|
929
|
-
x:
|
|
930
|
-
y:
|
|
931
|
-
placement:
|
|
932
|
-
} = await
|
|
933
|
-
placement:
|
|
828
|
+
x: Be,
|
|
829
|
+
y: xe,
|
|
830
|
+
placement: Te
|
|
831
|
+
} = await Bt(b, F, {
|
|
832
|
+
placement: u.value,
|
|
934
833
|
strategy: "fixed",
|
|
935
|
-
middleware: [
|
|
834
|
+
middleware: [st(2), nt({ placements: ["bottom", "top"] })]
|
|
936
835
|
});
|
|
937
|
-
|
|
938
|
-
},
|
|
836
|
+
d.value = Te ?? u.value, F.style.minWidth = `${b.getBoundingClientRect().width}px`, F.style.left = `${Be}px`, F.style.top = `${xe}px`;
|
|
837
|
+
}, re = async () => {
|
|
939
838
|
await T();
|
|
940
|
-
},
|
|
941
|
-
|
|
942
|
-
}),
|
|
943
|
-
|
|
839
|
+
}, $e = dt(b, () => {
|
|
840
|
+
re();
|
|
841
|
+
}), ne = () => {
|
|
842
|
+
re();
|
|
944
843
|
};
|
|
945
|
-
document.addEventListener("scroll",
|
|
946
|
-
update:
|
|
844
|
+
document.addEventListener("scroll", ne, !0), window.addEventListener("resize", ne, !1), v = {
|
|
845
|
+
update: re,
|
|
947
846
|
destroy: () => {
|
|
948
|
-
|
|
847
|
+
$e(), document.removeEventListener("scroll", ne, !0), window.removeEventListener("resize", ne, !1);
|
|
949
848
|
}
|
|
950
849
|
}, v.update();
|
|
951
850
|
};
|
|
952
|
-
return
|
|
953
|
-
if (!
|
|
851
|
+
return le(l, async (b) => {
|
|
852
|
+
if (!b) {
|
|
954
853
|
v && (v.destroy(), v = null);
|
|
955
854
|
return;
|
|
956
855
|
}
|
|
957
|
-
await
|
|
958
|
-
}),
|
|
856
|
+
await de(), v || q(), v == null || v.update();
|
|
857
|
+
}), le(
|
|
959
858
|
() => n.options,
|
|
960
859
|
() => {
|
|
961
860
|
v == null || v.update();
|
|
962
861
|
},
|
|
963
862
|
{ deep: !0 }
|
|
964
863
|
), Re(() => {
|
|
965
|
-
document.addEventListener("click",
|
|
864
|
+
document.addEventListener("click", D);
|
|
966
865
|
}), Se(() => {
|
|
967
|
-
document.removeEventListener("click",
|
|
968
|
-
}), (
|
|
866
|
+
document.removeEventListener("click", D), v == null || v.destroy(), v = null;
|
|
867
|
+
}), (b, F) => (g(), h("div", {
|
|
969
868
|
ref_key: "root",
|
|
970
|
-
ref:
|
|
971
|
-
class:
|
|
869
|
+
ref: c,
|
|
870
|
+
class: C(m.value)
|
|
972
871
|
}, [
|
|
973
|
-
|
|
872
|
+
B("button", {
|
|
974
873
|
ref_key: "trigger",
|
|
975
|
-
ref:
|
|
874
|
+
ref: s,
|
|
976
875
|
class: "vf-select__control",
|
|
977
876
|
type: "button",
|
|
978
|
-
disabled:
|
|
877
|
+
disabled: b.disabled,
|
|
979
878
|
"aria-expanded": l.value,
|
|
980
|
-
"aria-controls":
|
|
879
|
+
"aria-controls": a,
|
|
981
880
|
"aria-haspopup": "listbox",
|
|
982
|
-
onClick:
|
|
881
|
+
onClick: A,
|
|
983
882
|
onKeydown: [
|
|
984
|
-
K(
|
|
985
|
-
K(
|
|
986
|
-
K(
|
|
883
|
+
K(G(S, ["prevent"]), ["down"]),
|
|
884
|
+
K(G(A, ["prevent"]), ["enter"]),
|
|
885
|
+
K(G(H, ["prevent"]), ["esc"])
|
|
987
886
|
],
|
|
988
887
|
onFocus: x,
|
|
989
|
-
onBlur:
|
|
888
|
+
onBlur: $
|
|
990
889
|
}, [
|
|
991
|
-
|
|
992
|
-
class:
|
|
993
|
-
},
|
|
994
|
-
F[0] || (F[0] =
|
|
890
|
+
B("span", {
|
|
891
|
+
class: C(["vf-select__label", { "vf-select__label_placeholder": !y.value }])
|
|
892
|
+
}, M(y.value || b.placeholder), 3),
|
|
893
|
+
F[0] || (F[0] = B("span", {
|
|
995
894
|
class: "vf-select__chevron",
|
|
996
895
|
"aria-hidden": "true"
|
|
997
896
|
}, "▾", -1))
|
|
998
|
-
], 40,
|
|
999
|
-
(
|
|
1000
|
-
|
|
1001
|
-
id:
|
|
897
|
+
], 40, xt),
|
|
898
|
+
(g(), W(Le, { to: "body" }, [
|
|
899
|
+
me(B("div", {
|
|
900
|
+
id: a,
|
|
1002
901
|
ref_key: "panel",
|
|
1003
|
-
ref:
|
|
902
|
+
ref: i,
|
|
1004
903
|
class: "vf-select__panel",
|
|
1005
904
|
role: "listbox",
|
|
1006
|
-
"data-placement":
|
|
905
|
+
"data-placement": d.value
|
|
1007
906
|
}, [
|
|
1008
|
-
(
|
|
907
|
+
(g(!0), h(oe, null, ge(f.value, (T) => (g(), h("button", {
|
|
1009
908
|
key: T.value,
|
|
1010
|
-
class:
|
|
909
|
+
class: C(["vf-select__option", { "is-active": Q(T), "is-disabled": T.disabled }]),
|
|
1011
910
|
type: "button",
|
|
1012
911
|
role: "option",
|
|
1013
912
|
disabled: T.disabled,
|
|
1014
|
-
"aria-selected":
|
|
1015
|
-
onClick: (
|
|
1016
|
-
},
|
|
1017
|
-
], 8,
|
|
1018
|
-
[
|
|
913
|
+
"aria-selected": Q(T),
|
|
914
|
+
onClick: (re) => ee(T)
|
|
915
|
+
}, M(T.label), 11, Rt))), 128))
|
|
916
|
+
], 8, Tt), [
|
|
917
|
+
[ye, l.value]
|
|
1019
918
|
])
|
|
1020
919
|
]))
|
|
1021
920
|
], 2));
|
|
1022
921
|
}
|
|
1023
|
-
}),
|
|
922
|
+
}), St = ["checked", "disabled"], Lt = {
|
|
1024
923
|
key: 0,
|
|
1025
924
|
class: "vf-checkbox__label"
|
|
1026
|
-
},
|
|
925
|
+
}, vo = /* @__PURE__ */ X({
|
|
1027
926
|
__name: "checkbox",
|
|
1028
927
|
props: {
|
|
1029
928
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1032,35 +931,35 @@ const $t = (t, e) => t.strategy ? t.strategy : wt(e) ? "fixed" : "absolute", Y =
|
|
|
1032
931
|
},
|
|
1033
932
|
emits: ["update:modelValue", "change"],
|
|
1034
933
|
setup(t, { emit: e }) {
|
|
1035
|
-
const r = e, o = t, n =
|
|
1036
|
-
const
|
|
1037
|
-
return o.disabled &&
|
|
1038
|
-
}),
|
|
1039
|
-
const
|
|
1040
|
-
r("update:modelValue",
|
|
934
|
+
const r = e, o = t, n = w(() => {
|
|
935
|
+
const s = ["vf-checkbox"];
|
|
936
|
+
return o.disabled && s.push("vf-checkbox_disabled"), s;
|
|
937
|
+
}), c = (s) => {
|
|
938
|
+
const i = s.target;
|
|
939
|
+
r("update:modelValue", i.checked), r("change", s);
|
|
1041
940
|
};
|
|
1042
|
-
return (
|
|
1043
|
-
class:
|
|
941
|
+
return (s, i) => (g(), h("label", {
|
|
942
|
+
class: C(n.value)
|
|
1044
943
|
}, [
|
|
1045
|
-
|
|
944
|
+
B("input", {
|
|
1046
945
|
class: "vf-checkbox__control",
|
|
1047
946
|
type: "checkbox",
|
|
1048
|
-
checked:
|
|
1049
|
-
disabled:
|
|
1050
|
-
onChange:
|
|
1051
|
-
}, null, 40,
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
947
|
+
checked: s.modelValue,
|
|
948
|
+
disabled: s.disabled,
|
|
949
|
+
onChange: c
|
|
950
|
+
}, null, 40, St),
|
|
951
|
+
i[0] || (i[0] = B("span", { class: "vf-checkbox__box" }, null, -1)),
|
|
952
|
+
s.label || s.$slots.default ? (g(), h("span", Lt, [
|
|
953
|
+
k(s.$slots, "default", {}, () => [
|
|
954
|
+
J(M(s.label), 1)
|
|
1056
955
|
])
|
|
1057
|
-
])) :
|
|
956
|
+
])) : _("", !0)
|
|
1058
957
|
], 2));
|
|
1059
958
|
}
|
|
1060
|
-
}),
|
|
959
|
+
}), Vt = ["checked", "disabled"], zt = {
|
|
1061
960
|
key: 0,
|
|
1062
961
|
class: "vf-switch__label"
|
|
1063
|
-
},
|
|
962
|
+
}, po = /* @__PURE__ */ X({
|
|
1064
963
|
__name: "switch",
|
|
1065
964
|
props: {
|
|
1066
965
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1069,114 +968,108 @@ const $t = (t, e) => t.strategy ? t.strategy : wt(e) ? "fixed" : "absolute", Y =
|
|
|
1069
968
|
},
|
|
1070
969
|
emits: ["update:modelValue", "change"],
|
|
1071
970
|
setup(t, { emit: e }) {
|
|
1072
|
-
const r = e, o = t, n =
|
|
1073
|
-
const
|
|
1074
|
-
return o.disabled &&
|
|
1075
|
-
}),
|
|
1076
|
-
const
|
|
1077
|
-
r("update:modelValue",
|
|
971
|
+
const r = e, o = t, n = w(() => {
|
|
972
|
+
const s = ["vf-switch"];
|
|
973
|
+
return o.disabled && s.push("vf-switch_disabled"), s;
|
|
974
|
+
}), c = (s) => {
|
|
975
|
+
const i = s.target;
|
|
976
|
+
r("update:modelValue", i.checked), r("change", s);
|
|
1078
977
|
};
|
|
1079
|
-
return (
|
|
1080
|
-
class:
|
|
978
|
+
return (s, i) => (g(), h("label", {
|
|
979
|
+
class: C(n.value)
|
|
1081
980
|
}, [
|
|
1082
|
-
|
|
981
|
+
B("input", {
|
|
1083
982
|
class: "vf-switch__control",
|
|
1084
983
|
type: "checkbox",
|
|
1085
|
-
checked:
|
|
1086
|
-
disabled:
|
|
1087
|
-
onChange:
|
|
1088
|
-
}, null, 40,
|
|
1089
|
-
|
|
1090
|
-
|
|
984
|
+
checked: s.modelValue,
|
|
985
|
+
disabled: s.disabled,
|
|
986
|
+
onChange: c
|
|
987
|
+
}, null, 40, Vt),
|
|
988
|
+
i[0] || (i[0] = B("span", { class: "vf-switch__track" }, [
|
|
989
|
+
B("span", { class: "vf-switch__thumb" })
|
|
1091
990
|
], -1)),
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
991
|
+
s.label || s.$slots.default ? (g(), h("span", zt, [
|
|
992
|
+
k(s.$slots, "default", {}, () => [
|
|
993
|
+
J(M(s.label), 1)
|
|
1095
994
|
])
|
|
1096
|
-
])) :
|
|
995
|
+
])) : _("", !0)
|
|
1097
996
|
], 2));
|
|
1098
997
|
}
|
|
1099
|
-
}),
|
|
998
|
+
}), Wt = { class: "vf-popover" }, Mt = ["aria-expanded", "onKeydown"], bo = /* @__PURE__ */ X({
|
|
1100
999
|
__name: "popover",
|
|
1101
1000
|
emits: ["click", "onClick"],
|
|
1102
1001
|
setup(t, { expose: e, emit: r }) {
|
|
1103
|
-
const o = r, n =
|
|
1104
|
-
let
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1002
|
+
const o = r, n = Ve({ visible: !1 });
|
|
1003
|
+
let c = 0;
|
|
1004
|
+
const s = `vf-popover-panel-${++c}`, i = () => n.visible = !0, l = () => n.visible = !1, u = () => n.visible = !n.visible, d = () => {
|
|
1005
|
+
u(), o("click"), o("onClick");
|
|
1107
1006
|
};
|
|
1108
|
-
return e({ show:
|
|
1109
|
-
|
|
1007
|
+
return e({ show: i, hide: l, toggle: u }), (a, v) => (g(), h("div", Wt, [
|
|
1008
|
+
B("div", {
|
|
1110
1009
|
class: "vf-popover__button",
|
|
1111
1010
|
role: "button",
|
|
1112
1011
|
tabindex: "0",
|
|
1113
1012
|
"aria-haspopup": "dialog",
|
|
1114
1013
|
"aria-expanded": n.visible,
|
|
1115
|
-
"aria-controls":
|
|
1116
|
-
onClick:
|
|
1014
|
+
"aria-controls": s,
|
|
1015
|
+
onClick: d,
|
|
1117
1016
|
onKeydown: [
|
|
1118
|
-
K(
|
|
1119
|
-
K(
|
|
1017
|
+
K(G(d, ["prevent"]), ["enter"]),
|
|
1018
|
+
K(G(d, ["prevent"]), ["space"])
|
|
1120
1019
|
]
|
|
1121
1020
|
}, [
|
|
1122
|
-
|
|
1123
|
-
], 40,
|
|
1124
|
-
|
|
1125
|
-
id:
|
|
1021
|
+
k(a.$slots, "button")
|
|
1022
|
+
], 40, Mt),
|
|
1023
|
+
me(he(Xe, {
|
|
1024
|
+
id: s,
|
|
1126
1025
|
class: "vf-popover__wrapper"
|
|
1127
|
-
},
|
|
1128
|
-
default:
|
|
1129
|
-
v[0] || (v[0] =
|
|
1026
|
+
}, ze({
|
|
1027
|
+
default: I(() => [
|
|
1028
|
+
v[0] || (v[0] = B("div", { class: "vf-popover__arrow" }, null, -1))
|
|
1130
1029
|
]),
|
|
1131
1030
|
_: 2
|
|
1132
1031
|
}, [
|
|
1133
|
-
|
|
1032
|
+
a.$slots.default ? {
|
|
1134
1033
|
name: "default",
|
|
1135
|
-
fn:
|
|
1136
|
-
|
|
1034
|
+
fn: I(() => [
|
|
1035
|
+
k(a.$slots, "default")
|
|
1137
1036
|
]),
|
|
1138
1037
|
key: "0"
|
|
1139
1038
|
} : void 0,
|
|
1140
|
-
|
|
1039
|
+
a.$slots.header || a.$slots.popoverHeader ? {
|
|
1141
1040
|
name: "header",
|
|
1142
|
-
fn:
|
|
1143
|
-
|
|
1144
|
-
|
|
1041
|
+
fn: I(() => [
|
|
1042
|
+
k(a.$slots, "header"),
|
|
1043
|
+
a.$slots.header ? _("", !0) : k(a.$slots, "popoverHeader", { key: 0 })
|
|
1145
1044
|
]),
|
|
1146
1045
|
key: "1"
|
|
1147
1046
|
} : void 0,
|
|
1148
|
-
|
|
1047
|
+
a.$slots.body || a.$slots.popoverBody ? {
|
|
1149
1048
|
name: "body",
|
|
1150
|
-
fn:
|
|
1151
|
-
|
|
1152
|
-
|
|
1049
|
+
fn: I(() => [
|
|
1050
|
+
k(a.$slots, "body"),
|
|
1051
|
+
a.$slots.body ? _("", !0) : k(a.$slots, "popoverBody", { key: 0 })
|
|
1153
1052
|
]),
|
|
1154
1053
|
key: "2"
|
|
1155
1054
|
} : void 0,
|
|
1156
|
-
|
|
1055
|
+
a.$slots.footer || a.$slots.popoverFooter ? {
|
|
1157
1056
|
name: "footer",
|
|
1158
|
-
fn:
|
|
1159
|
-
|
|
1160
|
-
|
|
1057
|
+
fn: I(() => [
|
|
1058
|
+
k(a.$slots, "footer"),
|
|
1059
|
+
a.$slots.footer ? _("", !0) : k(a.$slots, "popoverFooter", { key: 0 })
|
|
1161
1060
|
]),
|
|
1162
1061
|
key: "3"
|
|
1163
1062
|
} : void 0
|
|
1164
1063
|
]), 1536), [
|
|
1165
|
-
[
|
|
1064
|
+
[ye, n.visible]
|
|
1166
1065
|
])
|
|
1167
1066
|
]));
|
|
1168
1067
|
}
|
|
1169
|
-
}),
|
|
1170
|
-
function io(t, e) {
|
|
1171
|
-
return p(), b("div", ao, [
|
|
1172
|
-
g(t.$slots, "default")
|
|
1173
|
-
]);
|
|
1174
|
-
}
|
|
1175
|
-
const Qo = /* @__PURE__ */ U(so, [["render", io]]), co = ["dark", "light", "theme", "preset", "colors", "components", "colorScheme"], uo = (t) => {
|
|
1068
|
+
}), Ht = ["dark", "light", "theme", "preset", "colors", "components", "colorScheme"], Ot = (t) => {
|
|
1176
1069
|
const e = t.replace(/([A-Z])/g, "-$1");
|
|
1177
1070
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1178
|
-
},
|
|
1179
|
-
if (!
|
|
1071
|
+
}, Et = (t) => t.filter((e) => !Ht.includes(e)).map((e) => Ot(e)).join("-").toLowerCase(), Pt = (t) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t), ie = (t) => {
|
|
1072
|
+
if (!Pt(t))
|
|
1180
1073
|
return null;
|
|
1181
1074
|
if (t.length === 4) {
|
|
1182
1075
|
const e = t[1], r = t[2], o = t[3];
|
|
@@ -1184,46 +1077,46 @@ const Qo = /* @__PURE__ */ U(so, [["render", io]]), co = ["dark", "light", "them
|
|
|
1184
1077
|
}
|
|
1185
1078
|
return t.toLowerCase();
|
|
1186
1079
|
}, we = (t) => {
|
|
1187
|
-
const e =
|
|
1080
|
+
const e = ie(t);
|
|
1188
1081
|
if (!e)
|
|
1189
1082
|
return [0, 0, 0];
|
|
1190
|
-
const r = parseInt(e.slice(1), 16), o = r >> 16 & 255, n = r >> 8 & 255,
|
|
1191
|
-
return [o, n,
|
|
1192
|
-
},
|
|
1083
|
+
const r = parseInt(e.slice(1), 16), o = r >> 16 & 255, n = r >> 8 & 255, c = r & 255;
|
|
1084
|
+
return [o, n, c];
|
|
1085
|
+
}, ve = (t) => {
|
|
1193
1086
|
const [e, r, o] = we(t);
|
|
1194
1087
|
return `${e}, ${r}, ${o}`;
|
|
1195
|
-
},
|
|
1196
|
-
const o = t / 255, n = e / 255,
|
|
1197
|
-
let
|
|
1198
|
-
const
|
|
1088
|
+
}, At = (t, e, r) => {
|
|
1089
|
+
const o = t / 255, n = e / 255, c = r / 255, s = Math.max(o, n, c), i = Math.min(o, n, c), l = s - i;
|
|
1090
|
+
let u = 0, d = 0;
|
|
1091
|
+
const a = (s + i) / 2;
|
|
1199
1092
|
if (l !== 0) {
|
|
1200
|
-
switch (
|
|
1093
|
+
switch (d = l / (1 - Math.abs(2 * a - 1)), s) {
|
|
1201
1094
|
case o:
|
|
1202
|
-
|
|
1095
|
+
u = (n - c) / l % 6;
|
|
1203
1096
|
break;
|
|
1204
1097
|
case n:
|
|
1205
|
-
|
|
1098
|
+
u = (c - o) / l + 2;
|
|
1206
1099
|
break;
|
|
1207
|
-
case
|
|
1208
|
-
|
|
1100
|
+
case c:
|
|
1101
|
+
u = (o - n) / l + 4;
|
|
1209
1102
|
break;
|
|
1210
1103
|
}
|
|
1211
|
-
|
|
1104
|
+
u *= 60, u < 0 && (u += 360);
|
|
1212
1105
|
}
|
|
1213
|
-
return [
|
|
1214
|
-
},
|
|
1215
|
-
const o = e / 100, n = r / 100,
|
|
1216
|
-
let l = 0,
|
|
1217
|
-
t >= 0 && t < 60 ? (l =
|
|
1218
|
-
const
|
|
1219
|
-
return [
|
|
1220
|
-
},
|
|
1221
|
-
const r =
|
|
1106
|
+
return [u, d * 100, a * 100];
|
|
1107
|
+
}, Dt = (t, e, r) => {
|
|
1108
|
+
const o = e / 100, n = r / 100, c = (1 - Math.abs(2 * n - 1)) * o, s = c * (1 - Math.abs(t / 60 % 2 - 1)), i = n - c / 2;
|
|
1109
|
+
let l = 0, u = 0, d = 0;
|
|
1110
|
+
t >= 0 && t < 60 ? (l = c, u = s, d = 0) : t >= 60 && t < 120 ? (l = s, u = c, d = 0) : t >= 120 && t < 180 ? (l = 0, u = c, d = s) : t >= 180 && t < 240 ? (l = 0, u = s, d = c) : t >= 240 && t < 300 ? (l = s, u = 0, d = c) : (l = c, u = 0, d = s);
|
|
1111
|
+
const a = Math.round((l + i) * 255), v = Math.round((u + i) * 255), f = Math.round((d + i) * 255);
|
|
1112
|
+
return [a, v, f];
|
|
1113
|
+
}, Nt = (t, e, r) => `#${[t, e, r].map((o) => o.toString(16).padStart(2, "0")).join("")}`, It = (t, e, r) => Math.min(r, Math.max(e, t)), jt = (t, e) => {
|
|
1114
|
+
const r = ie(t);
|
|
1222
1115
|
if (!r)
|
|
1223
1116
|
return t;
|
|
1224
|
-
const [o, n,
|
|
1225
|
-
return
|
|
1226
|
-
},
|
|
1117
|
+
const [o, n, c] = we(r), [s, i, l] = At(o, n, c), d = (e - 5) * 7, a = It(l + d, 0, 100), [v, f, p] = Dt(s, i, a);
|
|
1118
|
+
return Nt(v, f, p);
|
|
1119
|
+
}, Xt = (t) => {
|
|
1227
1120
|
if (typeof document > "u")
|
|
1228
1121
|
return null;
|
|
1229
1122
|
const e = document.getElementById(t);
|
|
@@ -1231,19 +1124,19 @@ const Qo = /* @__PURE__ */ U(so, [["render", io]]), co = ["dark", "light", "them
|
|
|
1231
1124
|
return e;
|
|
1232
1125
|
const r = document.createElement("style");
|
|
1233
1126
|
return r.id = t, document.head.appendChild(r), r;
|
|
1234
|
-
},
|
|
1127
|
+
}, se = (t) => !!t && typeof t == "object" && !Array.isArray(t), ce = (t, e) => {
|
|
1235
1128
|
if (!e)
|
|
1236
1129
|
return { ...t };
|
|
1237
1130
|
const r = { ...t };
|
|
1238
1131
|
for (const o in e) {
|
|
1239
|
-
const n = e[o],
|
|
1240
|
-
|
|
1132
|
+
const n = e[o], c = t[o];
|
|
1133
|
+
se(c) && se(n) ? r[o] = ce(c, n) : r[o] = n;
|
|
1241
1134
|
}
|
|
1242
1135
|
return r;
|
|
1243
|
-
},
|
|
1136
|
+
}, _e = (t) => {
|
|
1244
1137
|
if (!t)
|
|
1245
1138
|
return null;
|
|
1246
|
-
if (
|
|
1139
|
+
if (se(t) && "preset" in t) {
|
|
1247
1140
|
const e = t;
|
|
1248
1141
|
return {
|
|
1249
1142
|
preset: e.preset ?? {},
|
|
@@ -1253,65 +1146,65 @@ const Qo = /* @__PURE__ */ U(so, [["render", io]]), co = ["dark", "light", "them
|
|
|
1253
1146
|
};
|
|
1254
1147
|
}
|
|
1255
1148
|
return { preset: t };
|
|
1256
|
-
},
|
|
1257
|
-
const e = [], r = [], o = (n,
|
|
1149
|
+
}, Yt = (t) => {
|
|
1150
|
+
const e = [], r = [], o = (n, c) => {
|
|
1258
1151
|
if (!(!n || typeof n != "object"))
|
|
1259
|
-
for (const
|
|
1260
|
-
const
|
|
1261
|
-
if (
|
|
1262
|
-
o(
|
|
1152
|
+
for (const s in n) {
|
|
1153
|
+
const i = n[s], l = c.concat([s]);
|
|
1154
|
+
if (i && typeof i == "object") {
|
|
1155
|
+
o(i, l);
|
|
1263
1156
|
continue;
|
|
1264
1157
|
}
|
|
1265
|
-
if (typeof
|
|
1158
|
+
if (typeof i != "string")
|
|
1266
1159
|
continue;
|
|
1267
|
-
const
|
|
1268
|
-
if (
|
|
1269
|
-
const v =
|
|
1160
|
+
const d = l.includes("colorScheme") && l.includes("dark") ? r : e, a = Et(l);
|
|
1161
|
+
if (d.push(`--vf-${a}: ${i}`), l.includes("colors")) {
|
|
1162
|
+
const v = ie(i);
|
|
1270
1163
|
if (!v)
|
|
1271
1164
|
continue;
|
|
1272
|
-
if (
|
|
1273
|
-
for (let
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1165
|
+
if (d.push(`--vf-${a}-rgb: ${ve(v)}`), s !== "white")
|
|
1166
|
+
for (let f = 1; f < 10; ++f) {
|
|
1167
|
+
const p = jt(v, f);
|
|
1168
|
+
d.push(`--vf-${a}-${f}00: ${p}`), d.push(`--vf-${a}-${f}00-rgb: ${ve(p)}`);
|
|
1276
1169
|
}
|
|
1277
1170
|
}
|
|
1278
1171
|
}
|
|
1279
1172
|
};
|
|
1280
1173
|
return o(t, []), { baseVars: e, darkVars: r };
|
|
1281
|
-
},
|
|
1282
|
-
const { baseVars: o, darkVars: n } =
|
|
1283
|
-
if (!
|
|
1174
|
+
}, Kt = (t, e, r) => {
|
|
1175
|
+
const { baseVars: o, darkVars: n } = Yt(t), c = Xt("vueforge-theme");
|
|
1176
|
+
if (!c)
|
|
1284
1177
|
return;
|
|
1285
|
-
const
|
|
1286
|
-
o.length &&
|
|
1178
|
+
const s = [];
|
|
1179
|
+
o.length && s.push(`${e} { ${o.join(";")} }`), n.length && s.push(`${r} { ${n.join(";")} }`), c.textContent = s.join(`
|
|
1287
1180
|
`);
|
|
1288
1181
|
};
|
|
1289
|
-
let
|
|
1290
|
-
const
|
|
1182
|
+
let E = null;
|
|
1183
|
+
const Gt = (t) => ({
|
|
1291
1184
|
selector: t.selector ?? ":root",
|
|
1292
1185
|
darkSelector: t.darkSelector ?? ":root[data-theme=dark]"
|
|
1293
1186
|
}), Fe = (t) => {
|
|
1294
|
-
const e =
|
|
1187
|
+
const e = _e(t);
|
|
1295
1188
|
if (!e)
|
|
1296
1189
|
return;
|
|
1297
|
-
const r =
|
|
1298
|
-
|
|
1299
|
-
},
|
|
1300
|
-
if (!
|
|
1190
|
+
const r = ce(e.preset, e.overrides), { selector: o, darkSelector: n } = Gt(e);
|
|
1191
|
+
E = { ...e }, Kt(r, o, n);
|
|
1192
|
+
}, go = (t) => {
|
|
1193
|
+
if (!E)
|
|
1301
1194
|
return;
|
|
1302
|
-
const e = t.overrides === void 0 ?
|
|
1303
|
-
preset: t.preset ??
|
|
1195
|
+
const e = t.overrides === void 0 ? E.overrides : ce(E.overrides ?? {}, t.overrides ?? {}), r = {
|
|
1196
|
+
preset: t.preset ?? E.preset,
|
|
1304
1197
|
overrides: e,
|
|
1305
|
-
selector: t.selector ??
|
|
1306
|
-
darkSelector: t.darkSelector ??
|
|
1198
|
+
selector: t.selector ?? E.selector,
|
|
1199
|
+
darkSelector: t.darkSelector ?? E.darkSelector
|
|
1307
1200
|
};
|
|
1308
1201
|
Fe(r);
|
|
1309
|
-
},
|
|
1202
|
+
}, ho = () => E ? { ...E } : null, mo = {
|
|
1310
1203
|
install(t, e = {}) {
|
|
1311
|
-
const r =
|
|
1204
|
+
const r = _e(e.theme);
|
|
1312
1205
|
r && Fe(r);
|
|
1313
1206
|
}
|
|
1314
|
-
},
|
|
1207
|
+
}, pe = {
|
|
1315
1208
|
colors: {
|
|
1316
1209
|
white: "#ffffff",
|
|
1317
1210
|
green: "#0cbc87",
|
|
@@ -1322,6 +1215,7 @@ const Co = (t) => ({
|
|
|
1322
1215
|
purple: "#6f42c1",
|
|
1323
1216
|
gray: "#adb5bd"
|
|
1324
1217
|
},
|
|
1218
|
+
borderWidth: "1px",
|
|
1325
1219
|
colorScheme: {
|
|
1326
1220
|
light: {
|
|
1327
1221
|
bgColor: "#ffffff",
|
|
@@ -1342,10 +1236,12 @@ const Co = (t) => ({
|
|
|
1342
1236
|
dividerColor: "#2e2e32"
|
|
1343
1237
|
}
|
|
1344
1238
|
}
|
|
1345
|
-
},
|
|
1239
|
+
}, qt = {
|
|
1240
|
+
fontSize: "1rem",
|
|
1346
1241
|
padding: "6px 10px",
|
|
1347
1242
|
borderRadius: "6px",
|
|
1348
1243
|
roundedBorderRadius: "2rem",
|
|
1244
|
+
iconGap: "6px",
|
|
1349
1245
|
small: {
|
|
1350
1246
|
fontSize: "0.875rem",
|
|
1351
1247
|
padding: "4px 8px"
|
|
@@ -1482,27 +1378,13 @@ const Co = (t) => ({
|
|
|
1482
1378
|
}
|
|
1483
1379
|
}
|
|
1484
1380
|
}
|
|
1485
|
-
},
|
|
1381
|
+
}, Ut = {
|
|
1486
1382
|
padding: "12px",
|
|
1487
1383
|
borderColor: "var(--vf-border-color)",
|
|
1488
1384
|
borderRadius: "6px"
|
|
1489
|
-
},
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
color: "var(--vf-secondary-text-color)",
|
|
1493
|
-
padding: "12px",
|
|
1494
|
-
marginTop: "24px",
|
|
1495
|
-
borderTop: "1px solid var(--vf-footer-border-color)",
|
|
1496
|
-
borderColor: "var(--vf-border-color)",
|
|
1497
|
-
backgroundColor: "var(--vf-bg-color)"
|
|
1498
|
-
}, Ro = {
|
|
1499
|
-
height: "55px",
|
|
1500
|
-
padding: "0",
|
|
1501
|
-
borderColor: "var(--vf-border-color)",
|
|
1502
|
-
borderBottom: "1px solid var(--vf-header-border-color)",
|
|
1503
|
-
marginBottom: "24px",
|
|
1504
|
-
backgroundColor: "var(--vf-bg-color)"
|
|
1505
|
-
}, So = {
|
|
1385
|
+
}, Zt = {}, Jt = {
|
|
1386
|
+
gap: "0.5rem",
|
|
1387
|
+
fontSize: "1rem",
|
|
1506
1388
|
padding: "0.5rem 0.75rem",
|
|
1507
1389
|
borderRadius: "6px",
|
|
1508
1390
|
borderColor: "var(--vf-border-color)",
|
|
@@ -1520,10 +1402,14 @@ const Co = (t) => ({
|
|
|
1520
1402
|
padding: "0.625rem 0.875rem",
|
|
1521
1403
|
fontSize: "1.125rem"
|
|
1522
1404
|
}
|
|
1523
|
-
},
|
|
1405
|
+
}, Qt = {
|
|
1524
1406
|
hoverColor: "var(--vf-blue)",
|
|
1525
1407
|
activeColor: "var(--vf-blue)"
|
|
1526
|
-
},
|
|
1408
|
+
}, eo = {
|
|
1409
|
+
iconGap: "6px",
|
|
1410
|
+
submenuOffset: "12px",
|
|
1411
|
+
separatorThickness: "1px",
|
|
1412
|
+
separatorHeight: "1rem",
|
|
1527
1413
|
separatorColor: "var(--vf-border-color)",
|
|
1528
1414
|
link: {
|
|
1529
1415
|
hoverColor: "var(--vf-blue)",
|
|
@@ -1539,9 +1425,13 @@ const Co = (t) => ({
|
|
|
1539
1425
|
marginBottom: "0.5rem",
|
|
1540
1426
|
marginLeft: "0.5rem"
|
|
1541
1427
|
}
|
|
1542
|
-
},
|
|
1428
|
+
}, to = {
|
|
1543
1429
|
backgroundColor: "var(--vf-bg-color)"
|
|
1544
|
-
},
|
|
1430
|
+
}, oo = {
|
|
1431
|
+
minWidth: "12rem",
|
|
1432
|
+
fontSize: "1rem",
|
|
1433
|
+
controlGap: "0.75rem",
|
|
1434
|
+
chevronSize: "0.9em",
|
|
1545
1435
|
padding: "0.5rem 0.75rem",
|
|
1546
1436
|
borderRadius: "6px",
|
|
1547
1437
|
borderColor: "var(--vf-border-color)",
|
|
@@ -1552,7 +1442,13 @@ const Co = (t) => ({
|
|
|
1552
1442
|
disabledOpacity: "0.6",
|
|
1553
1443
|
panelBackgroundColor: "var(--vf-bg-color)",
|
|
1554
1444
|
panelBorderColor: "var(--vf-border-color)",
|
|
1445
|
+
panelPadding: "0.35rem",
|
|
1446
|
+
panelMaxHeight: "16rem",
|
|
1447
|
+
panelRadiusOffset: "2px",
|
|
1555
1448
|
panelShadow: "0 10px 30px rgba(0, 0, 0, 0.12)",
|
|
1449
|
+
focusRingShadow: "0 0 0 3px rgba(var(--vf-blue-600-rgb), 0.12)",
|
|
1450
|
+
optionPadding: "0.5rem 0.6rem",
|
|
1451
|
+
optionBorderRadius: "6px",
|
|
1556
1452
|
optionHoverBackgroundColor: "rgba(var(--vf-blue-600-rgb), 0.08)",
|
|
1557
1453
|
optionActiveBackgroundColor: "rgba(var(--vf-blue-600-rgb), 0.14)",
|
|
1558
1454
|
optionActiveTextColor: "var(--vf-text-color)",
|
|
@@ -1564,10 +1460,11 @@ const Co = (t) => ({
|
|
|
1564
1460
|
padding: "0.625rem 0.875rem",
|
|
1565
1461
|
fontSize: "1.125rem"
|
|
1566
1462
|
}
|
|
1567
|
-
},
|
|
1463
|
+
}, ro = {
|
|
1568
1464
|
size: "1rem",
|
|
1569
1465
|
gap: "0.5rem",
|
|
1570
1466
|
borderRadius: "4px",
|
|
1467
|
+
checkBorderRadius: "2px",
|
|
1571
1468
|
borderColor: "var(--vf-border-color)",
|
|
1572
1469
|
backgroundColor: "var(--vf-bg-color)",
|
|
1573
1470
|
checkedBackgroundColor: "var(--vf-blue)",
|
|
@@ -1575,59 +1472,47 @@ const Co = (t) => ({
|
|
|
1575
1472
|
checkColor: "#ffffff",
|
|
1576
1473
|
textColor: "var(--vf-text-color)",
|
|
1577
1474
|
disabledOpacity: "0.6"
|
|
1578
|
-
},
|
|
1475
|
+
}, no = {
|
|
1579
1476
|
width: "2.25rem",
|
|
1580
1477
|
height: "1.25rem",
|
|
1581
1478
|
thumbSize: "1rem",
|
|
1582
1479
|
gap: "0.5rem",
|
|
1480
|
+
thumbOffset: "2px",
|
|
1481
|
+
thumbTranslateOffset: "4px",
|
|
1583
1482
|
backgroundColor: "var(--vf-border-color)",
|
|
1584
1483
|
checkedBackgroundColor: "var(--vf-blue)",
|
|
1585
1484
|
thumbColor: "#ffffff",
|
|
1586
1485
|
textColor: "var(--vf-text-color)",
|
|
1587
1486
|
disabledOpacity: "0.6"
|
|
1588
|
-
},
|
|
1589
|
-
...
|
|
1487
|
+
}, yo = {
|
|
1488
|
+
...pe,
|
|
1590
1489
|
components: {
|
|
1591
|
-
base:
|
|
1592
|
-
button:
|
|
1593
|
-
card:
|
|
1594
|
-
codeBlock:
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
logo: zo,
|
|
1603
|
-
menu: Wo,
|
|
1604
|
-
popover: Mo,
|
|
1605
|
-
select: Ho,
|
|
1606
|
-
checkbox: Eo,
|
|
1607
|
-
switch: Ao
|
|
1490
|
+
base: pe,
|
|
1491
|
+
button: qt,
|
|
1492
|
+
card: Ut,
|
|
1493
|
+
codeBlock: Zt,
|
|
1494
|
+
input: Jt,
|
|
1495
|
+
link: Qt,
|
|
1496
|
+
menu: eo,
|
|
1497
|
+
popover: to,
|
|
1498
|
+
select: oo,
|
|
1499
|
+
checkbox: ro,
|
|
1500
|
+
switch: no
|
|
1608
1501
|
}
|
|
1609
1502
|
};
|
|
1610
1503
|
export {
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
ue as Link,
|
|
1624
|
-
Xo as Logo,
|
|
1625
|
-
Yo as Menu,
|
|
1626
|
-
Jo as Popover,
|
|
1627
|
-
Uo as Select,
|
|
1628
|
-
Zo as Switch,
|
|
1629
|
-
or as VueForge,
|
|
1630
|
-
tr as getTheme,
|
|
1504
|
+
co as Button,
|
|
1505
|
+
Xe as Card,
|
|
1506
|
+
vo as Checkbox,
|
|
1507
|
+
yo as DefaultTheme,
|
|
1508
|
+
uo as Input,
|
|
1509
|
+
ke as Link,
|
|
1510
|
+
io as Menu,
|
|
1511
|
+
bo as Popover,
|
|
1512
|
+
fo as Select,
|
|
1513
|
+
po as Switch,
|
|
1514
|
+
mo as VueForge,
|
|
1515
|
+
ho as getTheme,
|
|
1631
1516
|
Fe as setTheme,
|
|
1632
|
-
|
|
1517
|
+
go as updateTheme
|
|
1633
1518
|
};
|