@codemonster-ru/vueforge 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.ts.mjs +379 -348
- package/dist/index.ts.umd.js +3 -3
- package/dist/package/config/__tests__/theme-core.test.d.ts +1 -0
- package/dist/package/config/index.d.ts +3 -15
- package/dist/package/config/theme-core.d.ts +187 -0
- package/dist/package/config/theme-runtime.d.ts +10 -0
- package/dist/package/themes/default/base.d.ts +12 -0
- package/dist/package/themes/default/index.d.ts +24 -0
- package/package.json +5 -3
package/dist/index.ts.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as K, ref as X, computed as w, watch as le, resolveComponent as be, openBlock as b, createElementBlock as m, normalizeClass as C, renderSlot as k, Fragment as oe, createTextVNode as ee, toDisplayString as H, createBlock as M, withCtx as Y, createCommentVNode as _, createElementVNode as B, renderList as he, withKeys as q, withModifiers as U, unref as J, createVNode as me, nextTick as ue, onMounted as Te, onBeforeUnmount as Re, Teleport as Se, withDirectives as ye, vShow as ke, reactive as Ve, createSlots as Le } from "vue";
|
|
2
2
|
import { useRoute as We, useRouter as Me } from "vue-router";
|
|
3
|
-
import { CmIcon as
|
|
4
|
-
const He = ["href", "aria-disabled", "tabindex"],
|
|
3
|
+
import { CmIcon as Q } from "@codemonster-ru/vueiconify";
|
|
4
|
+
const He = ["href", "aria-disabled", "tabindex"], Ce = /* @__PURE__ */ K({
|
|
5
5
|
__name: "link",
|
|
6
6
|
props: {
|
|
7
7
|
to: { default: void 0 },
|
|
@@ -15,12 +15,12 @@ const He = ["href", "aria-disabled", "tabindex"], ke = /* @__PURE__ */ X({
|
|
|
15
15
|
},
|
|
16
16
|
emits: ["click", "active", "update:active", "onActive"],
|
|
17
17
|
setup(t, { emit: e }) {
|
|
18
|
-
const r = e, o = t, n = We(), c = Me(), s =
|
|
18
|
+
const r = e, o = t, n = We(), c = Me(), s = X(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(() => {
|
|
19
19
|
if (l.value !== "router-link")
|
|
20
20
|
return !1;
|
|
21
21
|
const p = d.value;
|
|
22
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
|
-
}),
|
|
23
|
+
}), f = w(() => o.active === void 0 ? a.value : o.active), v = (p) => {
|
|
24
24
|
if (!o.disabled) {
|
|
25
25
|
r("click", p);
|
|
26
26
|
return;
|
|
@@ -30,33 +30,33 @@ const He = ["href", "aria-disabled", "tabindex"], ke = /* @__PURE__ */ X({
|
|
|
30
30
|
return le(a, (p) => {
|
|
31
31
|
p && (r("active"), r("onActive")), r("update:active", p);
|
|
32
32
|
}), (p, y) => {
|
|
33
|
-
const
|
|
34
|
-
return l.value === "a" ? (b(),
|
|
33
|
+
const h = be("router-link");
|
|
34
|
+
return l.value === "a" ? (b(), m("a", {
|
|
35
35
|
key: 0,
|
|
36
36
|
href: i.value,
|
|
37
|
-
class: C(["vf-link", { "vf-link_active":
|
|
37
|
+
class: C(["vf-link", { "vf-link_active": f.value, "vf-link_disabled": p.disabled }]),
|
|
38
38
|
"aria-disabled": p.disabled,
|
|
39
39
|
tabindex: p.disabled ? -1 : void 0,
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: v
|
|
41
41
|
}, [
|
|
42
|
-
p.$slots.default ? k(p.$slots, "default", { key: 0 }) : (b(),
|
|
43
|
-
|
|
42
|
+
p.$slots.default ? k(p.$slots, "default", { key: 0 }) : (b(), m(oe, { key: 1 }, [
|
|
43
|
+
ee(H(p.label), 1)
|
|
44
44
|
], 64))
|
|
45
|
-
], 10, He)) : (b(),
|
|
45
|
+
], 10, He)) : (b(), M(h, {
|
|
46
46
|
key: 1,
|
|
47
47
|
ref_key: "link",
|
|
48
48
|
ref: s,
|
|
49
49
|
to: u.value,
|
|
50
|
-
class: C(["vf-link", { "vf-link_active":
|
|
50
|
+
class: C(["vf-link", { "vf-link_active": f.value }]),
|
|
51
51
|
"aria-disabled": p.disabled,
|
|
52
52
|
tabindex: p.disabled ? -1 : void 0,
|
|
53
53
|
"active-class": "vf-link_partially-active",
|
|
54
54
|
"exact-active-class": "vf-link_active",
|
|
55
|
-
onClick:
|
|
55
|
+
onClick: v
|
|
56
56
|
}, {
|
|
57
|
-
default:
|
|
58
|
-
p.$slots.default ? k(p.$slots, "default", { key: 0 }) : (b(),
|
|
59
|
-
|
|
57
|
+
default: Y(() => [
|
|
58
|
+
p.$slots.default ? k(p.$slots, "default", { key: 0 }) : (b(), m(oe, { key: 1 }, [
|
|
59
|
+
ee(H(p.label), 1)
|
|
60
60
|
], 64))
|
|
61
61
|
]),
|
|
62
62
|
_: 3
|
|
@@ -74,37 +74,37 @@ const He = ["href", "aria-disabled", "tabindex"], ke = /* @__PURE__ */ X({
|
|
|
74
74
|
}, De = {
|
|
75
75
|
key: 1,
|
|
76
76
|
class: "vf-card__header"
|
|
77
|
-
},
|
|
77
|
+
}, je = {
|
|
78
78
|
key: 2,
|
|
79
79
|
class: "vf-card__body"
|
|
80
|
-
},
|
|
80
|
+
}, Ne = {
|
|
81
81
|
key: 3,
|
|
82
82
|
class: "vf-card__footer"
|
|
83
83
|
};
|
|
84
|
-
function
|
|
85
|
-
return b(),
|
|
86
|
-
t.$slots.default ? (b(),
|
|
84
|
+
function Xe(t, e) {
|
|
85
|
+
return b(), m("div", Pe, [
|
|
86
|
+
t.$slots.default ? (b(), m("div", Ae, [
|
|
87
87
|
k(t.$slots, "default")
|
|
88
88
|
])) : _("", !0),
|
|
89
|
-
t.$slots.header ? (b(),
|
|
89
|
+
t.$slots.header ? (b(), m("div", De, [
|
|
90
90
|
k(t.$slots, "header")
|
|
91
91
|
])) : _("", !0),
|
|
92
|
-
t.$slots.body ? (b(),
|
|
92
|
+
t.$slots.body ? (b(), m("div", je, [
|
|
93
93
|
k(t.$slots, "body")
|
|
94
94
|
])) : _("", !0),
|
|
95
|
-
t.$slots.footer ? (b(),
|
|
95
|
+
t.$slots.footer ? (b(), m("div", Ne, [
|
|
96
96
|
k(t.$slots, "footer")
|
|
97
97
|
])) : _("", !0)
|
|
98
98
|
]);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const Ye = /* @__PURE__ */ Oe(Ee, [["render", Xe]]), Ie = {
|
|
101
101
|
class: "vf-menu__list",
|
|
102
102
|
role: "menu"
|
|
103
103
|
}, Ke = {
|
|
104
104
|
key: 1,
|
|
105
105
|
class: "vf-menu__separator",
|
|
106
106
|
role: "separator"
|
|
107
|
-
}, Ge = ["aria-expanded", "onClick", "onKeydown"],
|
|
107
|
+
}, Ge = ["aria-expanded", "onClick", "onKeydown"], co = /* @__PURE__ */ K({
|
|
108
108
|
name: "VfMenu",
|
|
109
109
|
__name: "menu",
|
|
110
110
|
props: {
|
|
@@ -113,7 +113,7 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
113
113
|
},
|
|
114
114
|
emits: ["active", "onActive"],
|
|
115
115
|
setup(t, { emit: e }) {
|
|
116
|
-
const r = e, o = t, n =
|
|
116
|
+
const r = e, o = t, n = X([]), 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
117
|
...a,
|
|
118
118
|
items: a.items ? i(a.items) : void 0
|
|
119
119
|
})), l = (d) => {
|
|
@@ -122,9 +122,9 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
122
122
|
}), d.subMenuVisible = !d.subMenuVisible) : Object.prototype.hasOwnProperty.call(d, "command") && typeof d.command == "function" && d.command();
|
|
123
123
|
}, u = (d) => {
|
|
124
124
|
var a;
|
|
125
|
-
for (const
|
|
126
|
-
const
|
|
127
|
-
Object.prototype.hasOwnProperty.call(
|
|
125
|
+
for (const f in n.value) {
|
|
126
|
+
const v = n.value[f];
|
|
127
|
+
Object.prototype.hasOwnProperty.call(v, "items") && ((a = v.items) != null && a.some((p) => p === d) ? (v.active = !0, v.subMenuVisible = !0) : (v.active = !1, v.subMenuVisible = !1));
|
|
128
128
|
}
|
|
129
129
|
r("active", d), r("onActive", d);
|
|
130
130
|
};
|
|
@@ -135,65 +135,65 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
135
135
|
},
|
|
136
136
|
{ deep: !0, immediate: !0 }
|
|
137
137
|
), (d, a) => {
|
|
138
|
-
const
|
|
139
|
-
return b(),
|
|
138
|
+
const f = be("VfMenu");
|
|
139
|
+
return b(), m("div", {
|
|
140
140
|
class: C(["vf-menu", `vf-menu_${d.orientation}`])
|
|
141
141
|
}, [
|
|
142
|
-
B("ul",
|
|
143
|
-
(b(!0),
|
|
144
|
-
key: c(
|
|
142
|
+
B("ul", Ie, [
|
|
143
|
+
(b(!0), m(oe, null, he(n.value, (v, p) => (b(), m("li", {
|
|
144
|
+
key: c(v, p),
|
|
145
145
|
class: "vf-menu__item",
|
|
146
146
|
role: "none"
|
|
147
147
|
}, [
|
|
148
|
-
d.$slots[c(
|
|
148
|
+
d.$slots[c(v, p)] ? k(d.$slots, c(v, p), {
|
|
149
149
|
key: 0,
|
|
150
|
-
item: { ...
|
|
151
|
-
}) :
|
|
150
|
+
item: { ...v, class: "vf-menu__link" }
|
|
151
|
+
}) : v.separator ? (b(), m("hr", Ke)) : v.items && v.items.length ? (b(), m(oe, { key: 2 }, [
|
|
152
152
|
B("div", {
|
|
153
|
-
class: C(["vf-menu__parent", { "vf-menu__parent_active":
|
|
153
|
+
class: C(["vf-menu__parent", { "vf-menu__parent_active": v.active }]),
|
|
154
154
|
role: "menuitem",
|
|
155
155
|
tabindex: "0",
|
|
156
|
-
"aria-expanded":
|
|
157
|
-
onClick: (y) => l(
|
|
156
|
+
"aria-expanded": v.subMenuVisible ? "true" : "false",
|
|
157
|
+
onClick: (y) => l(v),
|
|
158
158
|
onKeydown: [
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
q(U((y) => l(v), ["prevent"]), ["enter"]),
|
|
160
|
+
q(U((y) => l(v), ["prevent"]), ["space"])
|
|
161
161
|
]
|
|
162
162
|
}, [
|
|
163
|
-
|
|
163
|
+
v.icon ? (b(), M(J(Q), {
|
|
164
164
|
key: 0,
|
|
165
|
-
icon:
|
|
165
|
+
icon: v.icon,
|
|
166
166
|
class: "vf-menu__icon"
|
|
167
167
|
}, null, 8, ["icon"])) : _("", !0),
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
ee(" " + H(v.label) + " ", 1),
|
|
169
|
+
me(J(Q), { icon: "chevronDown" })
|
|
170
170
|
], 42, Ge),
|
|
171
|
-
|
|
171
|
+
v.items ? (b(), M(f, {
|
|
172
172
|
key: 0,
|
|
173
|
-
items:
|
|
174
|
-
class: C(["vf-menu__submenu", { "vf-menu__submenu_visible":
|
|
173
|
+
items: v.items,
|
|
174
|
+
class: C(["vf-menu__submenu", { "vf-menu__submenu_visible": v.subMenuVisible }]),
|
|
175
175
|
onOnActive: u
|
|
176
176
|
}, null, 8, ["items", "class"])) : _("", !0)
|
|
177
|
-
], 64)) : (b(),
|
|
177
|
+
], 64)) : (b(), M(Ce, {
|
|
178
178
|
key: 3,
|
|
179
|
-
to:
|
|
180
|
-
href:
|
|
181
|
-
as: s(
|
|
179
|
+
to: v.to,
|
|
180
|
+
href: v.href ?? v.url,
|
|
181
|
+
as: s(v),
|
|
182
182
|
class: "vf-menu__link",
|
|
183
|
-
active:
|
|
184
|
-
disabled:
|
|
183
|
+
active: v.active,
|
|
184
|
+
disabled: v.disabled,
|
|
185
185
|
role: "menuitem",
|
|
186
|
-
"aria-disabled":
|
|
187
|
-
onClick: (y) => l(
|
|
188
|
-
onActive: (y) => u(
|
|
186
|
+
"aria-disabled": v.disabled ? "true" : "false",
|
|
187
|
+
onClick: (y) => l(v),
|
|
188
|
+
onActive: (y) => u(v)
|
|
189
189
|
}, {
|
|
190
|
-
default:
|
|
191
|
-
|
|
190
|
+
default: Y(() => [
|
|
191
|
+
v.icon ? (b(), M(J(Q), {
|
|
192
192
|
key: 0,
|
|
193
|
-
icon:
|
|
193
|
+
icon: v.icon,
|
|
194
194
|
class: "vf-menu__icon"
|
|
195
195
|
}, null, 8, ["icon"])) : _("", !0),
|
|
196
|
-
|
|
196
|
+
ee(" " + H(v.label), 1)
|
|
197
197
|
]),
|
|
198
198
|
_: 2
|
|
199
199
|
}, 1032, ["to", "href", "as", "active", "disabled", "aria-disabled", "onClick", "onActive"]))
|
|
@@ -202,7 +202,7 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
202
202
|
], 2);
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
}), qe = ["type", "disabled"],
|
|
205
|
+
}), qe = ["type", "disabled"], uo = /* @__PURE__ */ K({
|
|
206
206
|
__name: "button",
|
|
207
207
|
props: {
|
|
208
208
|
to: { default: void 0 },
|
|
@@ -225,33 +225,33 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
225
225
|
let d = ["vf-button", `vf-button_${e.severity}`];
|
|
226
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
227
|
}), l = w(() => ["vf-button__icon", `vf-button__icon_${e.iconPos}`]), u = w(() => ["vf-button__label"]);
|
|
228
|
-
return (d, a) => n.value ? (b(),
|
|
228
|
+
return (d, a) => n.value ? (b(), m("button", {
|
|
229
229
|
key: 0,
|
|
230
230
|
type: c.value,
|
|
231
231
|
class: C(i.value),
|
|
232
232
|
disabled: e.loading || e.disabled
|
|
233
233
|
}, [
|
|
234
|
-
e.icon && !e.loading ? (b(),
|
|
234
|
+
e.icon && !e.loading ? (b(), M(J(Q), {
|
|
235
235
|
key: 0,
|
|
236
236
|
icon: e.icon,
|
|
237
237
|
class: C(l.value)
|
|
238
238
|
}, null, 8, ["icon", "class"])) : _("", !0),
|
|
239
|
-
e.loading ? (b(),
|
|
239
|
+
e.loading ? (b(), M(J(Q), {
|
|
240
240
|
key: 1,
|
|
241
241
|
icon: "circleNotch",
|
|
242
242
|
class: C(l.value),
|
|
243
243
|
spin: ""
|
|
244
244
|
}, null, 8, ["class"])) : _("", !0),
|
|
245
|
-
d.$slots.default ? (b(),
|
|
245
|
+
d.$slots.default ? (b(), m("span", {
|
|
246
246
|
key: 2,
|
|
247
247
|
class: C(u.value)
|
|
248
248
|
}, [
|
|
249
249
|
k(d.$slots, "default")
|
|
250
|
-
], 2)) : d.label ? (b(),
|
|
250
|
+
], 2)) : d.label ? (b(), m("span", {
|
|
251
251
|
key: 3,
|
|
252
252
|
class: C(u.value)
|
|
253
|
-
},
|
|
254
|
-
], 10, qe)) : (b(),
|
|
253
|
+
}, H(d.label), 3)) : _("", !0)
|
|
254
|
+
], 10, qe)) : (b(), M(Ce, {
|
|
255
255
|
key: 1,
|
|
256
256
|
to: e.to,
|
|
257
257
|
href: e.href ?? e.url,
|
|
@@ -259,21 +259,21 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
259
259
|
class: C(i.value),
|
|
260
260
|
disabled: e.loading || e.disabled
|
|
261
261
|
}, {
|
|
262
|
-
default:
|
|
263
|
-
e.icon ? (b(),
|
|
262
|
+
default: Y(() => [
|
|
263
|
+
e.icon ? (b(), M(J(Q), {
|
|
264
264
|
key: 0,
|
|
265
265
|
icon: e.icon,
|
|
266
266
|
class: C(l.value)
|
|
267
267
|
}, null, 8, ["icon", "class"])) : _("", !0),
|
|
268
|
-
d.$slots.default ? (b(),
|
|
268
|
+
d.$slots.default ? (b(), m("span", {
|
|
269
269
|
key: 1,
|
|
270
270
|
class: C(u.value)
|
|
271
271
|
}, [
|
|
272
272
|
k(d.$slots, "default")
|
|
273
|
-
], 2)) : d.label ? (b(),
|
|
273
|
+
], 2)) : d.label ? (b(), m("span", {
|
|
274
274
|
key: 2,
|
|
275
275
|
class: C(u.value)
|
|
276
|
-
},
|
|
276
|
+
}, H(d.label), 3)) : _("", !0)
|
|
277
277
|
]),
|
|
278
278
|
_: 3
|
|
279
279
|
}, 8, ["to", "href", "as", "class", "disabled"]));
|
|
@@ -284,7 +284,7 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
284
284
|
}, Ze = ["type", "value", "placeholder", "disabled", "readonly"], Je = {
|
|
285
285
|
key: 1,
|
|
286
286
|
class: "vf-input__suffix"
|
|
287
|
-
},
|
|
287
|
+
}, fo = /* @__PURE__ */ K({
|
|
288
288
|
__name: "input",
|
|
289
289
|
props: {
|
|
290
290
|
modelValue: { default: "" },
|
|
@@ -304,10 +304,10 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
304
304
|
const d = u.target;
|
|
305
305
|
r("update:modelValue", d.value), r("input", u);
|
|
306
306
|
}, s = (u) => r("change", u), i = (u) => r("focus", u), l = (u) => r("blur", u);
|
|
307
|
-
return (u, d) => (b(),
|
|
307
|
+
return (u, d) => (b(), m("div", {
|
|
308
308
|
class: C(n.value)
|
|
309
309
|
}, [
|
|
310
|
-
u.$slots.prefix ? (b(),
|
|
310
|
+
u.$slots.prefix ? (b(), m("span", Ue, [
|
|
311
311
|
k(u.$slots, "prefix")
|
|
312
312
|
])) : _("", !0),
|
|
313
313
|
B("input", {
|
|
@@ -322,12 +322,12 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
322
322
|
onFocus: i,
|
|
323
323
|
onBlur: l
|
|
324
324
|
}, null, 40, Ze),
|
|
325
|
-
u.$slots.suffix ? (b(),
|
|
325
|
+
u.$slots.suffix ? (b(), m("span", Je, [
|
|
326
326
|
k(u.$slots, "suffix")
|
|
327
327
|
])) : _("", !0)
|
|
328
328
|
], 2));
|
|
329
329
|
}
|
|
330
|
-
}),
|
|
330
|
+
}), fe = [
|
|
331
331
|
"top",
|
|
332
332
|
"top-start",
|
|
333
333
|
"top-end",
|
|
@@ -340,7 +340,7 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
340
340
|
"left",
|
|
341
341
|
"left-start",
|
|
342
342
|
"left-end"
|
|
343
|
-
],
|
|
343
|
+
], A = (t) => {
|
|
344
344
|
if (t == null || !(t instanceof HTMLElement))
|
|
345
345
|
return null;
|
|
346
346
|
if (typeof window < "u") {
|
|
@@ -348,13 +348,13 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
348
348
|
if (/(auto|scroll|overlay)/.test(r))
|
|
349
349
|
return t;
|
|
350
350
|
}
|
|
351
|
-
return t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth ? t :
|
|
351
|
+
return t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth ? t : A(t.parentNode);
|
|
352
352
|
};
|
|
353
353
|
function Qe(t) {
|
|
354
354
|
return typeof window > "u" ? !1 : window.getComputedStyle(t).position === "fixed";
|
|
355
355
|
}
|
|
356
|
-
const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute",
|
|
357
|
-
const o = t.getBoundingClientRect(), n = e ? e.offsetParent : null, c = e ?
|
|
356
|
+
const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", G = (t, e) => et(t, e) === "fixed", T = (t, e, r = {}) => {
|
|
357
|
+
const o = t.getBoundingClientRect(), n = e ? e.offsetParent : null, c = e ? G(r, e) : !1;
|
|
358
358
|
if (n && !c) {
|
|
359
359
|
const s = n.getBoundingClientRect(), i = n.scrollLeft, l = n.scrollTop;
|
|
360
360
|
return {
|
|
@@ -370,52 +370,52 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
370
370
|
width: o.width,
|
|
371
371
|
height: o.height
|
|
372
372
|
};
|
|
373
|
-
},
|
|
373
|
+
}, I = (t, e) => {
|
|
374
374
|
var r;
|
|
375
375
|
return (r = t.middleware) == null ? void 0 : r.find((o) => o.name === e);
|
|
376
|
-
},
|
|
377
|
-
const e =
|
|
376
|
+
}, we = (t, e) => !!I(t, e), tt = (t) => {
|
|
377
|
+
const e = A(t);
|
|
378
378
|
let r = "";
|
|
379
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;
|
|
380
|
-
}, ot = (t) => t.scrollLeft + t.clientWidth, rt = (t) => t.scrollTop + t.clientHeight,
|
|
381
|
-
if (r === null && typeof window < "u" &&
|
|
380
|
+
}, ot = (t) => t.scrollLeft + t.clientWidth, rt = (t) => t.scrollTop + t.clientHeight, V = (t, e, r = null, o = {}, n) => {
|
|
381
|
+
if (r === null && typeof window < "u" && G(o, e))
|
|
382
382
|
return t;
|
|
383
383
|
let c = 0;
|
|
384
384
|
if (r === null) {
|
|
385
|
-
const s =
|
|
385
|
+
const s = A(e);
|
|
386
386
|
c = s ? s.scrollTop : 0;
|
|
387
387
|
}
|
|
388
388
|
return t - c;
|
|
389
|
-
},
|
|
389
|
+
}, L = (t, e, r = null, o = {}, n) => {
|
|
390
390
|
let c;
|
|
391
|
-
if (r === null && typeof window < "u" &&
|
|
391
|
+
if (r === null && typeof window < "u" && G(o, e))
|
|
392
392
|
c = window.innerWidth;
|
|
393
393
|
else if (r === null) {
|
|
394
|
-
const s =
|
|
394
|
+
const s = A(e);
|
|
395
395
|
c = s ? ot(s) : 0;
|
|
396
396
|
} else
|
|
397
397
|
c = r.getBoundingClientRect().width;
|
|
398
398
|
return -(t + e.clientWidth - c);
|
|
399
|
-
},
|
|
399
|
+
}, E = (t, e, r = null, o = {}, n) => {
|
|
400
400
|
let c;
|
|
401
|
-
if (r === null && typeof window < "u" &&
|
|
401
|
+
if (r === null && typeof window < "u" && G(o, e))
|
|
402
402
|
c = window.innerHeight;
|
|
403
403
|
else if (r === null) {
|
|
404
|
-
const s =
|
|
404
|
+
const s = A(e);
|
|
405
405
|
c = s ? rt(s) : 0;
|
|
406
406
|
} else
|
|
407
407
|
c = r.getBoundingClientRect().height;
|
|
408
408
|
return -(t + e.clientHeight - c);
|
|
409
|
-
},
|
|
410
|
-
if (r === null && typeof window < "u" &&
|
|
409
|
+
}, W = (t, e, r = null, o = {}, n) => {
|
|
410
|
+
if (r === null && typeof window < "u" && G(o, e))
|
|
411
411
|
return t;
|
|
412
412
|
let c = 0;
|
|
413
413
|
if (r === null) {
|
|
414
|
-
const s =
|
|
414
|
+
const s = A(e);
|
|
415
415
|
c = s ? s.scrollLeft : 0;
|
|
416
416
|
}
|
|
417
417
|
return t - c;
|
|
418
|
-
},
|
|
418
|
+
}, ve = ({
|
|
419
419
|
options: t,
|
|
420
420
|
primaryX: e,
|
|
421
421
|
primaryY: r,
|
|
@@ -424,7 +424,7 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
424
424
|
reference: c,
|
|
425
425
|
scrollDirection: s
|
|
426
426
|
}) => {
|
|
427
|
-
const i = ae(c, o, n, t), l =
|
|
427
|
+
const i = ae(c, o, n, t), l = I(t, "offset");
|
|
428
428
|
if (l) {
|
|
429
429
|
const u = l.fn({
|
|
430
430
|
x: i.x,
|
|
@@ -463,16 +463,16 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
463
463
|
x: e,
|
|
464
464
|
y: r,
|
|
465
465
|
placement: i
|
|
466
|
-
},
|
|
466
|
+
}, f = {
|
|
467
467
|
...o,
|
|
468
468
|
middleware: (d = o.middleware) == null ? void 0 : d.filter((x) => x.name !== "shift")
|
|
469
|
-
},
|
|
470
|
-
let
|
|
471
|
-
const
|
|
472
|
-
if (
|
|
469
|
+
}, v = (t == null ? void 0 : t.placements) ?? fe, p = !(t != null && t.placements), y = p ? fe : v;
|
|
470
|
+
let h = !1;
|
|
471
|
+
const R = (x) => {
|
|
472
|
+
if (h)
|
|
473
473
|
return;
|
|
474
|
-
const
|
|
475
|
-
options:
|
|
474
|
+
const F = ve({
|
|
475
|
+
options: f,
|
|
476
476
|
primaryX: n,
|
|
477
477
|
primaryY: c,
|
|
478
478
|
floating: s,
|
|
@@ -480,50 +480,50 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
480
480
|
reference: l,
|
|
481
481
|
scrollDirection: u
|
|
482
482
|
});
|
|
483
|
-
|
|
484
|
-
},
|
|
485
|
-
if (!p &&
|
|
486
|
-
const x =
|
|
487
|
-
(
|
|
488
|
-
const
|
|
489
|
-
options:
|
|
483
|
+
F && (a.x = F.x, a.y = F.y, a.placement = F.placement, h = !0);
|
|
484
|
+
}, D = Ft(l, s, f);
|
|
485
|
+
if (!p && v.includes(i) && R(i), h || y.forEach(R), !h) {
|
|
486
|
+
const x = v.reduce(
|
|
487
|
+
(F, O) => {
|
|
488
|
+
const j = ve({
|
|
489
|
+
options: f,
|
|
490
490
|
primaryX: n,
|
|
491
491
|
primaryY: c,
|
|
492
492
|
floating: s,
|
|
493
|
-
placement:
|
|
493
|
+
placement: O,
|
|
494
494
|
reference: l,
|
|
495
495
|
scrollDirection: u
|
|
496
496
|
});
|
|
497
|
-
if (!
|
|
498
|
-
return
|
|
499
|
-
const S = te(
|
|
500
|
-
return
|
|
497
|
+
if (!j)
|
|
498
|
+
return F;
|
|
499
|
+
const S = te(O), N = D[S];
|
|
500
|
+
return !F || N > F.space ? { result: j, space: N } : F;
|
|
501
501
|
},
|
|
502
502
|
null
|
|
503
503
|
);
|
|
504
|
-
x && (a.x = x.result.x, a.y = x.result.y, a.placement = x.result.placement,
|
|
504
|
+
x && (a.x = x.result.x, a.y = x.result.y, a.placement = x.result.placement, h = !0);
|
|
505
505
|
}
|
|
506
|
-
if (!
|
|
506
|
+
if (!h && v.length > 0) {
|
|
507
507
|
const x = te(i);
|
|
508
|
-
let
|
|
509
|
-
|
|
510
|
-
const g = te(
|
|
511
|
-
|
|
508
|
+
let F = x, O = D[x];
|
|
509
|
+
v.forEach((Z) => {
|
|
510
|
+
const g = te(Z), $ = D[g];
|
|
511
|
+
$ > O && (O = $, F = g);
|
|
512
512
|
});
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
513
|
+
const j = $t(F, i, v), S = ae(l, s, j, f), N = I(f, "offset");
|
|
514
|
+
if (N) {
|
|
515
|
+
const Z = N.fn({
|
|
516
516
|
x: S.x,
|
|
517
517
|
y: S.y,
|
|
518
|
-
options:
|
|
518
|
+
options: f,
|
|
519
519
|
primaryX: n,
|
|
520
520
|
primaryY: c,
|
|
521
521
|
floating: s,
|
|
522
|
-
placement:
|
|
522
|
+
placement: j,
|
|
523
523
|
reference: l,
|
|
524
524
|
scrollDirection: u
|
|
525
525
|
});
|
|
526
|
-
S.x =
|
|
526
|
+
S.x = Z.x, S.y = Z.y;
|
|
527
527
|
}
|
|
528
528
|
a.x = S.x, a.y = S.y, a.placement = S.placement;
|
|
529
529
|
}
|
|
@@ -533,32 +533,32 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
533
533
|
var c, s, i;
|
|
534
534
|
let l = 0;
|
|
535
535
|
o.startsWith("right") ? l = -2 : o.startsWith("left") && (l = t);
|
|
536
|
-
const u =
|
|
536
|
+
const u = I(e, "arrow"), d = I(e, "shift");
|
|
537
537
|
if (u) {
|
|
538
538
|
const a = ((c = u.params) == null ? void 0 : c.arrow).getBoundingClientRect();
|
|
539
539
|
o.startsWith("right") ? l -= a.width / 2 : o.startsWith("left") && (l += a.width / 2);
|
|
540
540
|
}
|
|
541
|
-
if (
|
|
542
|
-
let a = null,
|
|
541
|
+
if (we(e, "shift") && u) {
|
|
542
|
+
let a = null, f = 0;
|
|
543
543
|
d && (a = (s = d.params) == null ? void 0 : s.parent);
|
|
544
|
-
const
|
|
545
|
-
|
|
544
|
+
const v = (i = u.params) == null ? void 0 : i.arrow;
|
|
545
|
+
f = v.getBoundingClientRect().width / 2, f += it(v), f -= t, o.startsWith("right") ? L(r - l, n, a, e) <= t ? L(r, n, a, e) > 0 ? l = t - L(r, n, a, e) : l = t : W(r - l - f, n, a, e) <= t && (W(r - l - f, n, a, e) >= 0 ? (l = -2 - (W(r - l - f, n, a, e) + t), a && (l = -2)) : l = -2) : o.startsWith("left") ? L(r - l + f, n, a, e) <= t ? (l = t + L(r - f, n, a, e), l <= t && (l = t)) : W(r - l, n, a, e) <= t && (l = -2 + W(r, n, a, e), l <= -2 && (l = -2)) : L(r - l, n, a, e) <= t ? L(r - l, n, a, e) <= t && L(r, n, a, e) > 0 ? l = t - L(r, n, a, e) : l = t : W(r - l, n, a, e) <= t && (W(r - l, n, a, e) <= t && W(r, n, a, e) > 0 ? l = -(t - W(r, n, a, e)) : l = -2);
|
|
546
546
|
}
|
|
547
547
|
return l;
|
|
548
548
|
}, at = (t, e, r, o, n) => {
|
|
549
549
|
var c, s, i;
|
|
550
550
|
let l = 0;
|
|
551
551
|
o.startsWith("top") ? l = t : o.startsWith("bottom") && (l = -2);
|
|
552
|
-
const u =
|
|
552
|
+
const u = I(e, "arrow"), d = I(e, "shift");
|
|
553
553
|
if (u) {
|
|
554
554
|
const a = ((c = u.params) == null ? void 0 : c.arrow).getBoundingClientRect();
|
|
555
555
|
o.startsWith("top") ? l += a.height / 2 : o.startsWith("bottom") && (l -= a.height / 2);
|
|
556
556
|
}
|
|
557
|
-
if (
|
|
558
|
-
let a = null,
|
|
557
|
+
if (we(e, "shift") && u) {
|
|
558
|
+
let a = null, f = 0;
|
|
559
559
|
d && (a = (s = d.params) == null ? void 0 : s.parent);
|
|
560
|
-
const
|
|
561
|
-
|
|
560
|
+
const v = (i = u.params) == null ? void 0 : i.arrow;
|
|
561
|
+
f = v.getBoundingClientRect().height / 2, f += dt(v), f -= t, o.startsWith("top") ? V(r - l, n, a, e) <= t ? V(r, n, a, e) >= 0 ? l = -(t - V(r, n, a, e)) : l = -2 : E(r - l + f, n, a, e) <= t && (l = t + E(r - f, n, a, e), l <= t && (l = t)) : o.startsWith("bottom") ? V(r - l - f, n, a, e) <= t ? V(r - l - f, n, a, e) >= 0 ? (l = -2 - (V(r - l - f, n, a, e) + t), a && (l = -2)) : l = -2 : E(r - l, n, a, e) <= t && (E(r, n, a, e) >= 0 ? l = t - E(r, n, a, e) : l = t) : V(r - l, n, a, e) <= t ? V(r - l, n, a, e) >= 0 ? l = -(t - V(r - l, n, a, e)) : l = -2 : E(r - l, n, a, e) <= t && (E(r - l, n, a, e) >= 0 ? l = t - E(r - l, n, a, e) : l = t);
|
|
562
562
|
}
|
|
563
563
|
return l;
|
|
564
564
|
}, st = (t) => ({
|
|
@@ -577,8 +577,8 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
577
577
|
y: r - at(t, o, c, i, s),
|
|
578
578
|
placement: i
|
|
579
579
|
})
|
|
580
|
-
}), it = (t) => t.getBoundingClientRect().width !== t.clientWidth ? (t.getBoundingClientRect().width - t.clientWidth) / 2 : 0,
|
|
581
|
-
const r =
|
|
580
|
+
}), it = (t) => t.getBoundingClientRect().width !== t.clientWidth ? (t.getBoundingClientRect().width - t.clientWidth) / 2 : 0, dt = (t) => t.getBoundingClientRect().height !== t.clientHeight ? (t.getBoundingClientRect().height - t.clientHeight) / 2 : 0, ct = (t, e) => {
|
|
581
|
+
const r = A(t), o = [];
|
|
582
582
|
if (r !== null) {
|
|
583
583
|
const n = () => e();
|
|
584
584
|
r.addEventListener("scroll", n, !1), o.push(() => r.removeEventListener("scroll", n, !1));
|
|
@@ -710,24 +710,24 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
712
|
}, _t = (t, e, r, o = {}) => {
|
|
713
|
-
if (
|
|
713
|
+
if (G(o, e)) {
|
|
714
714
|
if (typeof window > "u")
|
|
715
715
|
return !0;
|
|
716
|
-
const a = t.x,
|
|
717
|
-
return a >= 0 &&
|
|
716
|
+
const a = t.x, f = t.y, v = a + e.clientWidth, p = f + e.clientHeight;
|
|
717
|
+
return a >= 0 && f >= 0 && v <= window.innerWidth && p <= window.innerHeight;
|
|
718
718
|
}
|
|
719
|
-
if (
|
|
720
|
-
return
|
|
719
|
+
if (A(r) !== null)
|
|
720
|
+
return V(t.y, e, null, o) > 0 && L(t.x, e, null, o) > 0 && E(t.y, e, null, o) > 0 && W(t.x, e, null, o) > 0;
|
|
721
721
|
if (typeof window > "u")
|
|
722
722
|
return !0;
|
|
723
723
|
const n = window.innerWidth, c = window.innerHeight, s = (r instanceof HTMLElement ? r.offsetParent : null) || e.offsetParent;
|
|
724
724
|
if (s) {
|
|
725
|
-
const a = s.getBoundingClientRect(),
|
|
726
|
-
return
|
|
725
|
+
const a = s.getBoundingClientRect(), f = a.left + t.x, v = a.top + t.y, p = f + e.clientWidth, y = v + e.clientHeight;
|
|
726
|
+
return f >= 0 && v >= 0 && p <= n && y <= c;
|
|
727
727
|
}
|
|
728
728
|
const i = t.x, l = t.y, u = i + e.clientWidth, d = l + e.clientHeight;
|
|
729
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",
|
|
730
|
+
}, te = (t) => t.startsWith("right") ? "right" : t.startsWith("left") ? "left" : t.startsWith("top") ? "top" : "bottom", $t = (t, e, r) => te(e) === t && r.includes(e) ? e : r.find((o) => te(o) === t) ?? r[0], Ft = (t, e, r = {}) => {
|
|
731
731
|
if (typeof window > "u")
|
|
732
732
|
return {
|
|
733
733
|
top: 0,
|
|
@@ -735,7 +735,7 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
735
735
|
bottom: 0,
|
|
736
736
|
left: 0
|
|
737
737
|
};
|
|
738
|
-
const o =
|
|
738
|
+
const o = G(r, e) ? null : A(t), n = t.getBoundingClientRect(), c = o ? o.getBoundingClientRect() : {
|
|
739
739
|
top: 0,
|
|
740
740
|
left: 0,
|
|
741
741
|
right: window.innerWidth,
|
|
@@ -758,7 +758,7 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
758
758
|
i.x = l.x, i.y = l.y, i.placement = l.placement;
|
|
759
759
|
const u = i.x, d = i.y, a = tt(t);
|
|
760
760
|
(n = r.middleware) == null || n.forEach((y) => {
|
|
761
|
-
const
|
|
761
|
+
const h = y.fn({
|
|
762
762
|
x: i.x,
|
|
763
763
|
y: i.y,
|
|
764
764
|
options: r,
|
|
@@ -769,17 +769,17 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
769
769
|
reference: t,
|
|
770
770
|
scrollDirection: a
|
|
771
771
|
});
|
|
772
|
-
i.x =
|
|
772
|
+
i.x = h.x, i.y = h.y, i.placement = h.placement, y.name === "arrow" && (h.baseX = h.x, h.baseY = h.y, h.x = h.arrowX ?? h.x, h.y = h.arrowY ?? h.y), i.middlewareData[y.name] = h;
|
|
773
773
|
});
|
|
774
|
-
const
|
|
775
|
-
if (Number.isFinite(i.x) || (i.x =
|
|
776
|
-
if (
|
|
777
|
-
const y = t.getBoundingClientRect(),
|
|
778
|
-
i.placement.startsWith("top") ? i.y = y.top -
|
|
774
|
+
const f = ae(t, e, i.placement, r), v = I(r, "offset"), p = v ? (c = v.params) == null ? void 0 : c.value : 0;
|
|
775
|
+
if (Number.isFinite(i.x) || (i.x = f.x), !Number.isFinite(i.y))
|
|
776
|
+
if (G(r, e)) {
|
|
777
|
+
const y = t.getBoundingClientRect(), h = e.getBoundingClientRect().height;
|
|
778
|
+
i.placement.startsWith("top") ? i.y = y.top - h - p : i.placement.startsWith("bottom") ? i.y = y.bottom + p : i.y = f.y;
|
|
779
779
|
} else
|
|
780
|
-
i.y =
|
|
780
|
+
i.y = f.y;
|
|
781
781
|
o(i);
|
|
782
|
-
}), xt = ["disabled", "aria-expanded", "onKeydown"],
|
|
782
|
+
}), xt = ["disabled", "aria-expanded", "onKeydown"], zt = ["data-placement"], Tt = ["disabled", "aria-selected", "onClick"], vo = /* @__PURE__ */ K({
|
|
783
783
|
__name: "select",
|
|
784
784
|
props: {
|
|
785
785
|
modelValue: { default: void 0 },
|
|
@@ -793,81 +793,81 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
793
793
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
794
794
|
setup(t, { emit: e }) {
|
|
795
795
|
let r = 0;
|
|
796
|
-
const o = e, n = t, c =
|
|
797
|
-
let
|
|
798
|
-
const
|
|
796
|
+
const o = e, n = t, c = X(null), s = X(null), i = X(null), l = X(!1), u = X("bottom"), d = X("bottom"), a = `vf-select-panel-${++r}`;
|
|
797
|
+
let f = null;
|
|
798
|
+
const v = w(() => n.options.map((g) => ({
|
|
799
799
|
label: g[n.optionLabel],
|
|
800
800
|
value: g[n.optionValue],
|
|
801
801
|
disabled: g.disabled
|
|
802
|
-
}))), p = w(() =>
|
|
802
|
+
}))), p = w(() => v.value.find((g) => g.value === n.modelValue)), y = w(() => {
|
|
803
803
|
var g;
|
|
804
804
|
return ((g = p.value) == null ? void 0 : g.label) ?? "";
|
|
805
|
-
}),
|
|
805
|
+
}), h = w(() => {
|
|
806
806
|
const g = ["vf-select", l.value ? "vf-select_open" : ""];
|
|
807
807
|
return n.size !== "normal" && g.push(`vf-select_${n.size}`), n.disabled && g.push("vf-select_disabled"), g.filter(Boolean);
|
|
808
|
-
}),
|
|
809
|
-
g.disabled || (o("update:modelValue", g.value), o("change", g.value),
|
|
810
|
-
}, x = (g) => o("focus", g),
|
|
808
|
+
}), R = (g) => g.value === n.modelValue, D = (g) => {
|
|
809
|
+
g.disabled || (o("update:modelValue", g.value), o("change", g.value), O());
|
|
810
|
+
}, x = (g) => o("focus", g), F = (g) => o("blur", g), O = () => {
|
|
811
811
|
l.value = !1, u.value = "bottom", d.value = "bottom";
|
|
812
|
-
},
|
|
812
|
+
}, j = () => {
|
|
813
813
|
n.disabled || (l.value = !l.value, l.value && (u.value = "bottom", d.value = "bottom"));
|
|
814
814
|
}, S = async () => {
|
|
815
|
-
var g,
|
|
816
|
-
l.value || (l.value = !0, await
|
|
817
|
-
},
|
|
818
|
-
var
|
|
815
|
+
var g, $;
|
|
816
|
+
l.value || (l.value = !0, await ue()), ($ = (g = i.value) == null ? void 0 : g.querySelector(".vf-select__option:not(.is-disabled)")) == null || $.focus();
|
|
817
|
+
}, N = (g) => {
|
|
818
|
+
var z;
|
|
819
819
|
if (!l.value || !c.value)
|
|
820
820
|
return;
|
|
821
|
-
const
|
|
822
|
-
c.value.contains(
|
|
823
|
-
},
|
|
821
|
+
const $ = g.target;
|
|
822
|
+
c.value.contains($) || (z = i.value) != null && z.contains($) || O();
|
|
823
|
+
}, Z = () => {
|
|
824
824
|
if (!s.value || !i.value)
|
|
825
825
|
return;
|
|
826
|
-
const g = s.value,
|
|
826
|
+
const g = s.value, $ = i.value, z = async () => {
|
|
827
827
|
const {
|
|
828
828
|
x: Be,
|
|
829
829
|
y: xe,
|
|
830
|
-
placement:
|
|
831
|
-
} = await Bt(g,
|
|
830
|
+
placement: ze
|
|
831
|
+
} = await Bt(g, $, {
|
|
832
832
|
placement: u.value,
|
|
833
833
|
strategy: "fixed",
|
|
834
834
|
middleware: [st(2), nt({ placements: ["bottom", "top"] })]
|
|
835
835
|
});
|
|
836
|
-
d.value =
|
|
836
|
+
d.value = ze ?? u.value, $.style.minWidth = `${g.getBoundingClientRect().width}px`, $.style.left = `${Be}px`, $.style.top = `${xe}px`;
|
|
837
837
|
}, re = async () => {
|
|
838
|
-
await
|
|
839
|
-
},
|
|
838
|
+
await z();
|
|
839
|
+
}, Fe = ct(g, () => {
|
|
840
840
|
re();
|
|
841
841
|
}), ne = () => {
|
|
842
842
|
re();
|
|
843
843
|
};
|
|
844
|
-
document.addEventListener("scroll", ne, !0), window.addEventListener("resize", ne, !1),
|
|
844
|
+
document.addEventListener("scroll", ne, !0), window.addEventListener("resize", ne, !1), f = {
|
|
845
845
|
update: re,
|
|
846
846
|
destroy: () => {
|
|
847
|
-
|
|
847
|
+
Fe(), document.removeEventListener("scroll", ne, !0), window.removeEventListener("resize", ne, !1);
|
|
848
848
|
}
|
|
849
|
-
},
|
|
849
|
+
}, f.update();
|
|
850
850
|
};
|
|
851
851
|
return le(l, async (g) => {
|
|
852
852
|
if (!g) {
|
|
853
|
-
|
|
853
|
+
f && (f.destroy(), f = null);
|
|
854
854
|
return;
|
|
855
855
|
}
|
|
856
|
-
await
|
|
856
|
+
await ue(), f || Z(), f == null || f.update();
|
|
857
857
|
}), le(
|
|
858
858
|
() => n.options,
|
|
859
859
|
() => {
|
|
860
|
-
|
|
860
|
+
f == null || f.update();
|
|
861
861
|
},
|
|
862
862
|
{ deep: !0 }
|
|
863
863
|
), Te(() => {
|
|
864
|
-
document.addEventListener("click",
|
|
865
|
-
}),
|
|
866
|
-
document.removeEventListener("click",
|
|
867
|
-
}), (g,
|
|
864
|
+
document.addEventListener("click", N);
|
|
865
|
+
}), Re(() => {
|
|
866
|
+
document.removeEventListener("click", N), f == null || f.destroy(), f = null;
|
|
867
|
+
}), (g, $) => (b(), m("div", {
|
|
868
868
|
ref_key: "root",
|
|
869
869
|
ref: c,
|
|
870
|
-
class: C(
|
|
870
|
+
class: C(h.value)
|
|
871
871
|
}, [
|
|
872
872
|
B("button", {
|
|
873
873
|
ref_key: "trigger",
|
|
@@ -878,25 +878,25 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
878
878
|
"aria-expanded": l.value,
|
|
879
879
|
"aria-controls": a,
|
|
880
880
|
"aria-haspopup": "listbox",
|
|
881
|
-
onClick:
|
|
881
|
+
onClick: j,
|
|
882
882
|
onKeydown: [
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
883
|
+
q(U(S, ["prevent"]), ["down"]),
|
|
884
|
+
q(U(j, ["prevent"]), ["enter"]),
|
|
885
|
+
q(U(O, ["prevent"]), ["esc"])
|
|
886
886
|
],
|
|
887
887
|
onFocus: x,
|
|
888
|
-
onBlur:
|
|
888
|
+
onBlur: F
|
|
889
889
|
}, [
|
|
890
890
|
B("span", {
|
|
891
891
|
class: C(["vf-select__label", { "vf-select__label_placeholder": !y.value }])
|
|
892
|
-
},
|
|
893
|
-
|
|
892
|
+
}, H(y.value || g.placeholder), 3),
|
|
893
|
+
$[0] || ($[0] = B("span", {
|
|
894
894
|
class: "vf-select__chevron",
|
|
895
895
|
"aria-hidden": "true"
|
|
896
896
|
}, "▾", -1))
|
|
897
897
|
], 40, xt),
|
|
898
|
-
(b(),
|
|
899
|
-
|
|
898
|
+
(b(), M(Se, { to: "body" }, [
|
|
899
|
+
ye(B("div", {
|
|
900
900
|
id: a,
|
|
901
901
|
ref_key: "panel",
|
|
902
902
|
ref: i,
|
|
@@ -904,25 +904,25 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
904
904
|
role: "listbox",
|
|
905
905
|
"data-placement": d.value
|
|
906
906
|
}, [
|
|
907
|
-
(b(!0),
|
|
908
|
-
key:
|
|
909
|
-
class: C(["vf-select__option", { "is-active":
|
|
907
|
+
(b(!0), m(oe, null, he(v.value, (z) => (b(), m("button", {
|
|
908
|
+
key: z.value,
|
|
909
|
+
class: C(["vf-select__option", { "is-active": R(z), "is-disabled": z.disabled }]),
|
|
910
910
|
type: "button",
|
|
911
911
|
role: "option",
|
|
912
|
-
disabled:
|
|
913
|
-
"aria-selected":
|
|
914
|
-
onClick: (re) =>
|
|
915
|
-
},
|
|
916
|
-
], 8,
|
|
917
|
-
[
|
|
912
|
+
disabled: z.disabled,
|
|
913
|
+
"aria-selected": R(z),
|
|
914
|
+
onClick: (re) => D(z)
|
|
915
|
+
}, H(z.label), 11, Tt))), 128))
|
|
916
|
+
], 8, zt), [
|
|
917
|
+
[ke, l.value]
|
|
918
918
|
])
|
|
919
919
|
]))
|
|
920
920
|
], 2));
|
|
921
921
|
}
|
|
922
|
-
}),
|
|
922
|
+
}), Rt = ["checked", "disabled"], St = {
|
|
923
923
|
key: 0,
|
|
924
924
|
class: "vf-checkbox__label"
|
|
925
|
-
},
|
|
925
|
+
}, po = /* @__PURE__ */ K({
|
|
926
926
|
__name: "checkbox",
|
|
927
927
|
props: {
|
|
928
928
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -938,7 +938,7 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
938
938
|
const i = s.target;
|
|
939
939
|
r("update:modelValue", i.checked), r("change", s);
|
|
940
940
|
};
|
|
941
|
-
return (s, i) => (b(),
|
|
941
|
+
return (s, i) => (b(), m("label", {
|
|
942
942
|
class: C(n.value)
|
|
943
943
|
}, [
|
|
944
944
|
B("input", {
|
|
@@ -947,19 +947,19 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
947
947
|
checked: s.modelValue,
|
|
948
948
|
disabled: s.disabled,
|
|
949
949
|
onChange: c
|
|
950
|
-
}, null, 40,
|
|
950
|
+
}, null, 40, Rt),
|
|
951
951
|
i[0] || (i[0] = B("span", { class: "vf-checkbox__box" }, null, -1)),
|
|
952
|
-
s.label || s.$slots.default ? (b(),
|
|
952
|
+
s.label || s.$slots.default ? (b(), m("span", St, [
|
|
953
953
|
k(s.$slots, "default", {}, () => [
|
|
954
|
-
|
|
954
|
+
ee(H(s.label), 1)
|
|
955
955
|
])
|
|
956
956
|
])) : _("", !0)
|
|
957
957
|
], 2));
|
|
958
958
|
}
|
|
959
|
-
}), Vt = ["checked", "disabled"],
|
|
959
|
+
}), Vt = ["checked", "disabled"], Lt = {
|
|
960
960
|
key: 0,
|
|
961
961
|
class: "vf-switch__label"
|
|
962
|
-
},
|
|
962
|
+
}, go = /* @__PURE__ */ K({
|
|
963
963
|
__name: "switch",
|
|
964
964
|
props: {
|
|
965
965
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -975,7 +975,7 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
975
975
|
const i = s.target;
|
|
976
976
|
r("update:modelValue", i.checked), r("change", s);
|
|
977
977
|
};
|
|
978
|
-
return (s, i) => (b(),
|
|
978
|
+
return (s, i) => (b(), m("label", {
|
|
979
979
|
class: C(n.value)
|
|
980
980
|
}, [
|
|
981
981
|
B("input", {
|
|
@@ -988,14 +988,14 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
988
988
|
i[0] || (i[0] = B("span", { class: "vf-switch__track" }, [
|
|
989
989
|
B("span", { class: "vf-switch__thumb" })
|
|
990
990
|
], -1)),
|
|
991
|
-
s.label || s.$slots.default ? (b(),
|
|
991
|
+
s.label || s.$slots.default ? (b(), m("span", Lt, [
|
|
992
992
|
k(s.$slots, "default", {}, () => [
|
|
993
|
-
|
|
993
|
+
ee(H(s.label), 1)
|
|
994
994
|
])
|
|
995
995
|
])) : _("", !0)
|
|
996
996
|
], 2));
|
|
997
997
|
}
|
|
998
|
-
}), Wt = { class: "vf-popover" }, Mt = ["aria-expanded", "onKeydown"],
|
|
998
|
+
}), Wt = { class: "vf-popover" }, Mt = ["aria-expanded", "onKeydown"], bo = /* @__PURE__ */ K({
|
|
999
999
|
__name: "popover",
|
|
1000
1000
|
emits: ["click", "onClick"],
|
|
1001
1001
|
setup(t, { expose: e, emit: r }) {
|
|
@@ -1004,7 +1004,7 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
1004
1004
|
const s = `vf-popover-panel-${++c}`, i = () => n.visible = !0, l = () => n.visible = !1, u = () => n.visible = !n.visible, d = () => {
|
|
1005
1005
|
u(), o("click"), o("onClick");
|
|
1006
1006
|
};
|
|
1007
|
-
return e({ show: i, hide: l, toggle: u }), (a,
|
|
1007
|
+
return e({ show: i, hide: l, toggle: u }), (a, f) => (b(), m("div", Wt, [
|
|
1008
1008
|
B("div", {
|
|
1009
1009
|
class: "vf-popover__button",
|
|
1010
1010
|
role: "button",
|
|
@@ -1014,31 +1014,31 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
1014
1014
|
"aria-controls": s,
|
|
1015
1015
|
onClick: d,
|
|
1016
1016
|
onKeydown: [
|
|
1017
|
-
|
|
1018
|
-
|
|
1017
|
+
q(U(d, ["prevent"]), ["enter"]),
|
|
1018
|
+
q(U(d, ["prevent"]), ["space"])
|
|
1019
1019
|
]
|
|
1020
1020
|
}, [
|
|
1021
1021
|
k(a.$slots, "button")
|
|
1022
1022
|
], 40, Mt),
|
|
1023
|
-
me(
|
|
1023
|
+
ye(me(Ye, {
|
|
1024
1024
|
id: s,
|
|
1025
1025
|
class: "vf-popover__wrapper"
|
|
1026
|
-
},
|
|
1027
|
-
default:
|
|
1028
|
-
|
|
1026
|
+
}, Le({
|
|
1027
|
+
default: Y(() => [
|
|
1028
|
+
f[0] || (f[0] = B("div", { class: "vf-popover__arrow" }, null, -1))
|
|
1029
1029
|
]),
|
|
1030
1030
|
_: 2
|
|
1031
1031
|
}, [
|
|
1032
1032
|
a.$slots.default ? {
|
|
1033
1033
|
name: "default",
|
|
1034
|
-
fn:
|
|
1034
|
+
fn: Y(() => [
|
|
1035
1035
|
k(a.$slots, "default")
|
|
1036
1036
|
]),
|
|
1037
1037
|
key: "0"
|
|
1038
1038
|
} : void 0,
|
|
1039
1039
|
a.$slots.header || a.$slots.popoverHeader ? {
|
|
1040
1040
|
name: "header",
|
|
1041
|
-
fn:
|
|
1041
|
+
fn: Y(() => [
|
|
1042
1042
|
k(a.$slots, "header"),
|
|
1043
1043
|
a.$slots.header ? _("", !0) : k(a.$slots, "popoverHeader", { key: 0 })
|
|
1044
1044
|
]),
|
|
@@ -1046,7 +1046,7 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
1046
1046
|
} : void 0,
|
|
1047
1047
|
a.$slots.body || a.$slots.popoverBody ? {
|
|
1048
1048
|
name: "body",
|
|
1049
|
-
fn:
|
|
1049
|
+
fn: Y(() => [
|
|
1050
1050
|
k(a.$slots, "body"),
|
|
1051
1051
|
a.$slots.body ? _("", !0) : k(a.$slots, "popoverBody", { key: 0 })
|
|
1052
1052
|
]),
|
|
@@ -1054,21 +1054,21 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
1054
1054
|
} : void 0,
|
|
1055
1055
|
a.$slots.footer || a.$slots.popoverFooter ? {
|
|
1056
1056
|
name: "footer",
|
|
1057
|
-
fn:
|
|
1057
|
+
fn: Y(() => [
|
|
1058
1058
|
k(a.$slots, "footer"),
|
|
1059
1059
|
a.$slots.footer ? _("", !0) : k(a.$slots, "popoverFooter", { key: 0 })
|
|
1060
1060
|
]),
|
|
1061
1061
|
key: "3"
|
|
1062
1062
|
} : void 0
|
|
1063
1063
|
]), 1536), [
|
|
1064
|
-
[
|
|
1064
|
+
[ke, n.visible]
|
|
1065
1065
|
])
|
|
1066
1066
|
]));
|
|
1067
1067
|
}
|
|
1068
1068
|
}), Ht = ["dark", "light", "theme", "preset", "colors", "components", "colorScheme"], Ot = (t) => {
|
|
1069
1069
|
const e = t.replace(/([A-Z])/g, "-$1");
|
|
1070
1070
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
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),
|
|
1071
|
+
}, Et = (t) => t.filter((e) => !Ht.includes(e)).map((e) => Ot(e)).join("-").toLowerCase(), ie = (t) => t.join("."), Pt = (t) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t), de = (t) => {
|
|
1072
1072
|
if (!Pt(t))
|
|
1073
1073
|
return null;
|
|
1074
1074
|
if (t.length === 4) {
|
|
@@ -1076,14 +1076,14 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
1076
1076
|
return `#${e}${e}${r}${r}${o}${o}`;
|
|
1077
1077
|
}
|
|
1078
1078
|
return t.toLowerCase();
|
|
1079
|
-
},
|
|
1080
|
-
const e =
|
|
1079
|
+
}, _e = (t) => {
|
|
1080
|
+
const e = de(t);
|
|
1081
1081
|
if (!e)
|
|
1082
1082
|
return [0, 0, 0];
|
|
1083
1083
|
const r = parseInt(e.slice(1), 16), o = r >> 16 & 255, n = r >> 8 & 255, c = r & 255;
|
|
1084
1084
|
return [o, n, c];
|
|
1085
|
-
},
|
|
1086
|
-
const [e, r, o] =
|
|
1085
|
+
}, pe = (t) => {
|
|
1086
|
+
const [e, r, o] = _e(t);
|
|
1087
1087
|
return `${e}, ${r}, ${o}`;
|
|
1088
1088
|
}, At = (t, e, r) => {
|
|
1089
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;
|
|
@@ -1108,22 +1108,14 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
1108
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
1109
|
let l = 0, u = 0, d = 0;
|
|
1110
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),
|
|
1112
|
-
return [a,
|
|
1113
|
-
},
|
|
1114
|
-
const r =
|
|
1111
|
+
const a = Math.round((l + i) * 255), f = Math.round((u + i) * 255), v = Math.round((d + i) * 255);
|
|
1112
|
+
return [a, f, v];
|
|
1113
|
+
}, jt = (t, e, r) => `#${[t, e, r].map((o) => o.toString(16).padStart(2, "0")).join("")}`, Nt = (t, e, r) => Math.min(r, Math.max(e, t)), Xt = (t, e) => {
|
|
1114
|
+
const r = de(t);
|
|
1115
1115
|
if (!r)
|
|
1116
1116
|
return t;
|
|
1117
|
-
const [o, n, c] =
|
|
1118
|
-
return
|
|
1119
|
-
}, Xt = (t) => {
|
|
1120
|
-
if (typeof document > "u")
|
|
1121
|
-
return null;
|
|
1122
|
-
const e = document.getElementById(t);
|
|
1123
|
-
if (e && e.tagName.toLowerCase() === "style")
|
|
1124
|
-
return e;
|
|
1125
|
-
const r = document.createElement("style");
|
|
1126
|
-
return r.id = t, document.head.appendChild(r), r;
|
|
1117
|
+
const [o, n, c] = _e(r), [s, i, l] = At(o, n, c), d = (e - 5) * 7, a = Nt(l + d, 0, 100), [f, v, p] = Dt(s, i, a);
|
|
1118
|
+
return jt(f, v, p);
|
|
1127
1119
|
}, se = (t) => !!t && typeof t == "object" && !Array.isArray(t), ce = (t, e) => {
|
|
1128
1120
|
if (!e)
|
|
1129
1121
|
return { ...t };
|
|
@@ -1133,7 +1125,7 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
1133
1125
|
se(c) && se(n) ? r[o] = ce(c, n) : r[o] = n;
|
|
1134
1126
|
}
|
|
1135
1127
|
return r;
|
|
1136
|
-
},
|
|
1128
|
+
}, Yt = (t) => {
|
|
1137
1129
|
if (!t)
|
|
1138
1130
|
return null;
|
|
1139
1131
|
if (se(t) && "preset" in t) {
|
|
@@ -1142,69 +1134,96 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
1142
1134
|
preset: e.preset ?? {},
|
|
1143
1135
|
overrides: e.overrides,
|
|
1144
1136
|
selector: e.selector,
|
|
1145
|
-
darkSelector: e.darkSelector
|
|
1137
|
+
darkSelector: e.darkSelector,
|
|
1138
|
+
strict: e.strict
|
|
1146
1139
|
};
|
|
1147
1140
|
}
|
|
1148
1141
|
return { preset: t };
|
|
1149
|
-
},
|
|
1150
|
-
const e = [], r = [], o =
|
|
1151
|
-
if (!(!
|
|
1152
|
-
for (const
|
|
1153
|
-
const
|
|
1154
|
-
if (
|
|
1155
|
-
|
|
1142
|
+
}, It = (t) => {
|
|
1143
|
+
const e = [], r = [], o = [], n = [], c = (l) => o.push(l), s = (l) => n.push(l), i = (l, u) => {
|
|
1144
|
+
if (!(!l || typeof l != "object"))
|
|
1145
|
+
for (const d in l) {
|
|
1146
|
+
const a = l[d], f = u.concat([d]);
|
|
1147
|
+
if (se(a)) {
|
|
1148
|
+
i(a, f);
|
|
1149
|
+
continue;
|
|
1150
|
+
}
|
|
1151
|
+
if (a && typeof a == "object") {
|
|
1152
|
+
s(`Theme value "${ie(f)}" is not a plain object or string and will be ignored.`);
|
|
1156
1153
|
continue;
|
|
1157
1154
|
}
|
|
1158
|
-
if (typeof
|
|
1155
|
+
if (typeof a != "string") {
|
|
1156
|
+
s(`Theme value "${ie(f)}" is not a string and will be ignored.`);
|
|
1159
1157
|
continue;
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1158
|
+
}
|
|
1159
|
+
const p = f.includes("colorScheme") && f.includes("dark") ? r : e, y = Et(f);
|
|
1160
|
+
if (p.push(`--vf-${y}: ${a}`), f.includes("colors")) {
|
|
1161
|
+
const h = de(a);
|
|
1162
|
+
if (!h) {
|
|
1163
|
+
c(
|
|
1164
|
+
`Theme color "${ie(f)}" is not hex. Shade variables will not be generated for it.`
|
|
1165
|
+
);
|
|
1164
1166
|
continue;
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1167
|
+
}
|
|
1168
|
+
if (p.push(`--vf-${y}-rgb: ${pe(h)}`), d !== "white")
|
|
1169
|
+
for (let R = 1; R < 10; ++R) {
|
|
1170
|
+
const D = Xt(h, R);
|
|
1171
|
+
p.push(`--vf-${y}-${R}00: ${D}`), p.push(`--vf-${y}-${R}00-rgb: ${pe(D)}`);
|
|
1169
1172
|
}
|
|
1170
1173
|
}
|
|
1171
1174
|
}
|
|
1172
1175
|
};
|
|
1173
|
-
return
|
|
1174
|
-
}, Kt = (t
|
|
1175
|
-
|
|
1176
|
-
|
|
1176
|
+
return i(t, []), { baseVars: e, darkVars: r, warnings: o, errors: n };
|
|
1177
|
+
}, Kt = (t) => {
|
|
1178
|
+
if (typeof document > "u")
|
|
1179
|
+
return null;
|
|
1180
|
+
const e = document.getElementById(t);
|
|
1181
|
+
if (e && e.tagName.toLowerCase() === "style")
|
|
1182
|
+
return e;
|
|
1183
|
+
const r = document.createElement("style");
|
|
1184
|
+
return r.id = t, document.head.appendChild(r), r;
|
|
1185
|
+
}, Gt = (t) => ({
|
|
1186
|
+
selector: t.selector ?? ":root",
|
|
1187
|
+
darkSelector: t.darkSelector ?? ":root[data-theme=dark]"
|
|
1188
|
+
}), qt = (t, e, r, o) => {
|
|
1189
|
+
const { baseVars: n, darkVars: c, warnings: s, errors: i } = It(t), l = Kt("vueforge-theme");
|
|
1190
|
+
if (!l)
|
|
1177
1191
|
return;
|
|
1178
|
-
|
|
1179
|
-
|
|
1192
|
+
if (i.length) {
|
|
1193
|
+
if (o)
|
|
1194
|
+
throw new Error(`[VueForge] ${i.join(" ")}`);
|
|
1195
|
+
for (const d of i)
|
|
1196
|
+
console.warn(`[VueForge] ${d}`);
|
|
1197
|
+
}
|
|
1198
|
+
if (s.length)
|
|
1199
|
+
for (const d of s)
|
|
1200
|
+
console.warn(`[VueForge] ${d}`);
|
|
1201
|
+
const u = [];
|
|
1202
|
+
n.length && u.push(`${e} { ${n.join(";")} }`), c.length && u.push(`${r} { ${c.join(";")} }`), l.textContent = u.join(`
|
|
1180
1203
|
`);
|
|
1181
1204
|
};
|
|
1182
|
-
let
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1185
|
-
darkSelector: t.darkSelector ?? ":root[data-theme=dark]"
|
|
1186
|
-
}), Fe = (t) => {
|
|
1187
|
-
const e = _e(t);
|
|
1205
|
+
let P = null;
|
|
1206
|
+
const $e = (t) => {
|
|
1207
|
+
const e = Yt(t);
|
|
1188
1208
|
if (!e)
|
|
1189
1209
|
return;
|
|
1190
1210
|
const r = ce(e.preset, e.overrides), { selector: o, darkSelector: n } = Gt(e);
|
|
1191
|
-
|
|
1192
|
-
},
|
|
1193
|
-
if (!
|
|
1211
|
+
P = { ...e }, qt(r, o, n, e.strict);
|
|
1212
|
+
}, ho = (t) => {
|
|
1213
|
+
if (!P)
|
|
1194
1214
|
return;
|
|
1195
|
-
const e = t.overrides === void 0 ?
|
|
1196
|
-
preset: t.preset ??
|
|
1215
|
+
const e = t.overrides === void 0 ? P.overrides : ce(P.overrides ?? {}, t.overrides ?? {}), r = {
|
|
1216
|
+
preset: t.preset ?? P.preset,
|
|
1197
1217
|
overrides: e,
|
|
1198
|
-
selector: t.selector ??
|
|
1199
|
-
darkSelector: t.darkSelector ??
|
|
1218
|
+
selector: t.selector ?? P.selector,
|
|
1219
|
+
darkSelector: t.darkSelector ?? P.darkSelector
|
|
1200
1220
|
};
|
|
1201
|
-
|
|
1202
|
-
},
|
|
1221
|
+
$e(r);
|
|
1222
|
+
}, mo = () => P ? { ...P } : null, yo = {
|
|
1203
1223
|
install(t, e = {}) {
|
|
1204
|
-
|
|
1205
|
-
r && Fe(r);
|
|
1224
|
+
e.theme && $e(e.theme);
|
|
1206
1225
|
}
|
|
1207
|
-
},
|
|
1226
|
+
}, ge = {
|
|
1208
1227
|
colors: {
|
|
1209
1228
|
white: "#ffffff",
|
|
1210
1229
|
green: "#0cbc87",
|
|
@@ -1234,6 +1253,18 @@ const Gt = (t) => ({
|
|
|
1234
1253
|
disabledOpacity: "0.6",
|
|
1235
1254
|
focusRingShadow: "0 0 0 3px rgba(var(--vf-blue-600-rgb), 0.12)"
|
|
1236
1255
|
},
|
|
1256
|
+
sizes: {
|
|
1257
|
+
sm: {
|
|
1258
|
+
fontSize: "0.875rem",
|
|
1259
|
+
paddingY: "0.2rem",
|
|
1260
|
+
paddingX: "0.5rem"
|
|
1261
|
+
},
|
|
1262
|
+
lg: {
|
|
1263
|
+
fontSize: "1.125rem",
|
|
1264
|
+
paddingY: "0.5rem",
|
|
1265
|
+
paddingX: "1rem"
|
|
1266
|
+
}
|
|
1267
|
+
},
|
|
1237
1268
|
colorScheme: {
|
|
1238
1269
|
light: {
|
|
1239
1270
|
bgColor: "#ffffff",
|
|
@@ -1254,19 +1285,19 @@ const Gt = (t) => ({
|
|
|
1254
1285
|
dividerColor: "#2e2e32"
|
|
1255
1286
|
}
|
|
1256
1287
|
}
|
|
1257
|
-
},
|
|
1288
|
+
}, Ut = {
|
|
1258
1289
|
fontSize: "var(--vf-typography-font-size)",
|
|
1259
1290
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
1260
1291
|
borderRadius: "var(--vf-radii-md)",
|
|
1261
1292
|
roundedBorderRadius: "2rem",
|
|
1262
1293
|
iconGap: "6px",
|
|
1263
1294
|
small: {
|
|
1264
|
-
fontSize: "
|
|
1265
|
-
padding: "
|
|
1295
|
+
fontSize: "var(--vf-sizes-sm-font-size)",
|
|
1296
|
+
padding: "var(--vf-sizes-sm-padding-y) var(--vf-sizes-sm-padding-x)"
|
|
1266
1297
|
},
|
|
1267
1298
|
large: {
|
|
1268
|
-
fontSize: "
|
|
1269
|
-
padding: "
|
|
1299
|
+
fontSize: "var(--vf-sizes-lg-font-size)",
|
|
1300
|
+
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)"
|
|
1270
1301
|
},
|
|
1271
1302
|
colorScheme: {
|
|
1272
1303
|
light: {
|
|
@@ -1396,11 +1427,11 @@ const Gt = (t) => ({
|
|
|
1396
1427
|
}
|
|
1397
1428
|
}
|
|
1398
1429
|
}
|
|
1399
|
-
},
|
|
1430
|
+
}, Zt = {
|
|
1400
1431
|
padding: "12px",
|
|
1401
1432
|
borderColor: "var(--vf-border-color)",
|
|
1402
1433
|
borderRadius: "var(--vf-radii-md)"
|
|
1403
|
-
},
|
|
1434
|
+
}, Jt = {}, Qt = {
|
|
1404
1435
|
gap: "0.5rem",
|
|
1405
1436
|
fontSize: "var(--vf-typography-font-size)",
|
|
1406
1437
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
@@ -1414,17 +1445,17 @@ const Gt = (t) => ({
|
|
|
1414
1445
|
hoverBorderColor: "var(--vf-blue-500)",
|
|
1415
1446
|
disabledOpacity: "var(--vf-states-disabled-opacity)",
|
|
1416
1447
|
small: {
|
|
1417
|
-
padding: "
|
|
1418
|
-
fontSize: "
|
|
1448
|
+
padding: "var(--vf-sizes-sm-padding-y) var(--vf-sizes-sm-padding-x)",
|
|
1449
|
+
fontSize: "var(--vf-sizes-sm-font-size)"
|
|
1419
1450
|
},
|
|
1420
1451
|
large: {
|
|
1421
|
-
padding: "
|
|
1422
|
-
fontSize: "
|
|
1452
|
+
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
1453
|
+
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
1423
1454
|
}
|
|
1424
|
-
},
|
|
1455
|
+
}, eo = {
|
|
1425
1456
|
hoverColor: "var(--vf-blue)",
|
|
1426
1457
|
activeColor: "var(--vf-blue)"
|
|
1427
|
-
},
|
|
1458
|
+
}, to = {
|
|
1428
1459
|
iconGap: "6px",
|
|
1429
1460
|
submenuOffset: "12px",
|
|
1430
1461
|
separatorThickness: "1px",
|
|
@@ -1444,9 +1475,9 @@ const Gt = (t) => ({
|
|
|
1444
1475
|
marginBottom: "0.5rem",
|
|
1445
1476
|
marginLeft: "0.5rem"
|
|
1446
1477
|
}
|
|
1447
|
-
}, to = {
|
|
1448
|
-
backgroundColor: "var(--vf-bg-color)"
|
|
1449
1478
|
}, oo = {
|
|
1479
|
+
backgroundColor: "var(--vf-bg-color)"
|
|
1480
|
+
}, ro = {
|
|
1450
1481
|
minWidth: "12rem",
|
|
1451
1482
|
fontSize: "var(--vf-typography-font-size)",
|
|
1452
1483
|
controlGap: "0.75rem",
|
|
@@ -1472,14 +1503,14 @@ const Gt = (t) => ({
|
|
|
1472
1503
|
optionActiveBackgroundColor: "rgba(var(--vf-blue-600-rgb), 0.14)",
|
|
1473
1504
|
optionActiveTextColor: "var(--vf-text-color)",
|
|
1474
1505
|
small: {
|
|
1475
|
-
padding: "
|
|
1476
|
-
fontSize: "
|
|
1506
|
+
padding: "var(--vf-sizes-sm-padding-y) var(--vf-sizes-sm-padding-x)",
|
|
1507
|
+
fontSize: "var(--vf-sizes-sm-font-size)"
|
|
1477
1508
|
},
|
|
1478
1509
|
large: {
|
|
1479
|
-
padding: "
|
|
1480
|
-
fontSize: "
|
|
1510
|
+
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
1511
|
+
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
1481
1512
|
}
|
|
1482
|
-
},
|
|
1513
|
+
}, no = {
|
|
1483
1514
|
size: "1rem",
|
|
1484
1515
|
gap: "0.5rem",
|
|
1485
1516
|
borderRadius: "var(--vf-radii-sm)",
|
|
@@ -1491,7 +1522,7 @@ const Gt = (t) => ({
|
|
|
1491
1522
|
checkColor: "#ffffff",
|
|
1492
1523
|
textColor: "var(--vf-text-color)",
|
|
1493
1524
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
1494
|
-
},
|
|
1525
|
+
}, lo = {
|
|
1495
1526
|
width: "2.25rem",
|
|
1496
1527
|
height: "1.25rem",
|
|
1497
1528
|
thumbSize: "1rem",
|
|
@@ -1503,35 +1534,35 @@ const Gt = (t) => ({
|
|
|
1503
1534
|
thumbColor: "#ffffff",
|
|
1504
1535
|
textColor: "var(--vf-text-color)",
|
|
1505
1536
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
1506
|
-
},
|
|
1507
|
-
...
|
|
1537
|
+
}, ko = {
|
|
1538
|
+
...ge,
|
|
1508
1539
|
components: {
|
|
1509
|
-
base:
|
|
1510
|
-
button:
|
|
1511
|
-
card:
|
|
1512
|
-
codeBlock:
|
|
1513
|
-
input:
|
|
1514
|
-
link:
|
|
1515
|
-
menu:
|
|
1516
|
-
popover:
|
|
1517
|
-
select:
|
|
1518
|
-
checkbox:
|
|
1519
|
-
switch:
|
|
1540
|
+
base: ge,
|
|
1541
|
+
button: Ut,
|
|
1542
|
+
card: Zt,
|
|
1543
|
+
codeBlock: Jt,
|
|
1544
|
+
input: Qt,
|
|
1545
|
+
link: eo,
|
|
1546
|
+
menu: to,
|
|
1547
|
+
popover: oo,
|
|
1548
|
+
select: ro,
|
|
1549
|
+
checkbox: no,
|
|
1550
|
+
switch: lo
|
|
1520
1551
|
}
|
|
1521
1552
|
};
|
|
1522
1553
|
export {
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1554
|
+
uo as Button,
|
|
1555
|
+
Ye as Card,
|
|
1556
|
+
po as Checkbox,
|
|
1557
|
+
ko as DefaultTheme,
|
|
1558
|
+
fo as Input,
|
|
1559
|
+
Ce as Link,
|
|
1560
|
+
co as Menu,
|
|
1561
|
+
bo as Popover,
|
|
1562
|
+
vo as Select,
|
|
1563
|
+
go as Switch,
|
|
1564
|
+
yo as VueForge,
|
|
1565
|
+
mo as getTheme,
|
|
1566
|
+
$e as setTheme,
|
|
1567
|
+
ho as updateTheme
|
|
1537
1568
|
};
|