@codemonster-ru/vueforge 0.7.0 → 0.9.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 +154 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.ts.mjs +828 -645
- package/dist/index.ts.umd.js +3 -3
- package/dist/package/components/__tests__/modal.test.d.ts +1 -0
- package/dist/package/components/modal.vue.d.ts +55 -0
- 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 +216 -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/components/modal.d.ts +29 -0
- package/dist/package/themes/default/index.d.ts +52 -0
- package/package.json +9 -5
package/dist/index.ts.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { CmIcon as
|
|
4
|
-
const He = ["href", "aria-disabled", "tabindex"],
|
|
1
|
+
import { defineComponent as K, ref as j, computed as _, watch as re, resolveComponent as ye, openBlock as b, createElementBlock as y, normalizeClass as $, renderSlot as C, Fragment as le, createTextVNode as oe, toDisplayString as E, createBlock as O, withCtx as Y, createCommentVNode as w, createElementVNode as B, renderList as ke, withKeys as Z, withModifiers as J, unref as Q, createVNode as Ce, nextTick as ce, onMounted as Re, onBeforeUnmount as we, Teleport as _e, withDirectives as ue, vShow as fe, reactive as Ve, createSlots as Le, useSlots as We } from "vue";
|
|
2
|
+
import { useRoute as Oe, useRouter as Ee } from "vue-router";
|
|
3
|
+
import { CmIcon as ee } from "@codemonster-ru/vueiconify";
|
|
4
|
+
const He = ["href", "aria-disabled", "tabindex"], $e = /* @__PURE__ */ K({
|
|
5
5
|
__name: "link",
|
|
6
6
|
props: {
|
|
7
7
|
to: { default: void 0 },
|
|
@@ -14,97 +14,97 @@ const He = ["href", "aria-disabled", "tabindex"], ke = /* @__PURE__ */ X({
|
|
|
14
14
|
disabled: { type: Boolean }
|
|
15
15
|
},
|
|
16
16
|
emits: ["click", "active", "update:active", "onActive"],
|
|
17
|
-
setup(
|
|
18
|
-
const r = e,
|
|
19
|
-
if (
|
|
17
|
+
setup(o, { emit: e }) {
|
|
18
|
+
const r = e, t = o, l = Oe(), c = Ee(), s = j(null), i = _(() => t.href ?? t.url), n = _(() => t.as ? t.as === "router-link" && !t.to ? "a" : t.as : t.type === "router-link" || t.type === "a" ? t.type === "router-link" && !t.to ? "a" : t.type : t.to ? "router-link" : "a"), u = _(() => t.to), d = _(() => t.to ? c.resolve(t.to) : null), a = _(() => {
|
|
19
|
+
if (n.value !== "router-link")
|
|
20
20
|
return !1;
|
|
21
21
|
const p = d.value;
|
|
22
|
-
return p ? p.name ?
|
|
23
|
-
}),
|
|
24
|
-
if (!
|
|
22
|
+
return p ? p.name ? l.matched.some(({ name: k }) => k === p.name) : p.fullPath ? l.fullPath === p.fullPath : l.path === p.path : !1;
|
|
23
|
+
}), f = _(() => t.active === void 0 ? a.value : t.active), v = (p) => {
|
|
24
|
+
if (!t.disabled) {
|
|
25
25
|
r("click", p);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
p.preventDefault(), p.stopPropagation();
|
|
29
29
|
};
|
|
30
|
-
return
|
|
30
|
+
return re(a, (p) => {
|
|
31
31
|
p && (r("active"), r("onActive")), r("update:active", p);
|
|
32
|
-
}), (p,
|
|
33
|
-
const m =
|
|
34
|
-
return
|
|
32
|
+
}), (p, k) => {
|
|
33
|
+
const m = ye("router-link");
|
|
34
|
+
return n.value === "a" ? (b(), y("a", {
|
|
35
35
|
key: 0,
|
|
36
36
|
href: i.value,
|
|
37
|
-
class:
|
|
37
|
+
class: $(["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 ?
|
|
43
|
-
|
|
42
|
+
p.$slots.default ? C(p.$slots, "default", { key: 0 }) : (b(), y(le, { key: 1 }, [
|
|
43
|
+
oe(E(p.label), 1)
|
|
44
44
|
], 64))
|
|
45
|
-
], 10, He)) : (b(),
|
|
45
|
+
], 10, He)) : (b(), O(m, {
|
|
46
46
|
key: 1,
|
|
47
47
|
ref_key: "link",
|
|
48
48
|
ref: s,
|
|
49
49
|
to: u.value,
|
|
50
|
-
class:
|
|
50
|
+
class: $(["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 ?
|
|
59
|
-
|
|
57
|
+
default: Y(() => [
|
|
58
|
+
p.$slots.default ? C(p.$slots, "default", { key: 0 }) : (b(), y(le, { key: 1 }, [
|
|
59
|
+
oe(E(p.label), 1)
|
|
60
60
|
], 64))
|
|
61
61
|
]),
|
|
62
62
|
_: 3
|
|
63
63
|
}, 8, ["to", "class", "aria-disabled", "tabindex"]));
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
}),
|
|
67
|
-
const r =
|
|
68
|
-
for (const [
|
|
69
|
-
r[
|
|
66
|
+
}), Me = (o, e) => {
|
|
67
|
+
const r = o.__vccOpts || o;
|
|
68
|
+
for (const [t, l] of e)
|
|
69
|
+
r[t] = l;
|
|
70
70
|
return r;
|
|
71
|
-
},
|
|
71
|
+
}, Pe = {}, Ae = { class: "vf-card" }, De = {
|
|
72
72
|
key: 0,
|
|
73
73
|
class: "vf-card__default"
|
|
74
|
-
},
|
|
74
|
+
}, Ie = {
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
])) :
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
])) :
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
])) :
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
])) :
|
|
84
|
+
function Ke(o, e) {
|
|
85
|
+
return b(), y("div", Ae, [
|
|
86
|
+
o.$slots.default ? (b(), y("div", De, [
|
|
87
|
+
C(o.$slots, "default")
|
|
88
|
+
])) : w("", !0),
|
|
89
|
+
o.$slots.header ? (b(), y("div", Ie, [
|
|
90
|
+
C(o.$slots, "header")
|
|
91
|
+
])) : w("", !0),
|
|
92
|
+
o.$slots.body ? (b(), y("div", je, [
|
|
93
|
+
C(o.$slots, "body")
|
|
94
|
+
])) : w("", !0),
|
|
95
|
+
o.$slots.footer ? (b(), y("div", Ne, [
|
|
96
|
+
C(o.$slots, "footer")
|
|
97
|
+
])) : w("", !0)
|
|
98
98
|
]);
|
|
99
99
|
}
|
|
100
|
-
const Xe = /* @__PURE__ */
|
|
100
|
+
const Xe = /* @__PURE__ */ Me(Pe, [["render", Ke]]), Ye = {
|
|
101
101
|
class: "vf-menu__list",
|
|
102
102
|
role: "menu"
|
|
103
|
-
},
|
|
103
|
+
}, Ge = {
|
|
104
104
|
key: 1,
|
|
105
105
|
class: "vf-menu__separator",
|
|
106
106
|
role: "separator"
|
|
107
|
-
},
|
|
107
|
+
}, qe = ["aria-expanded", "onClick", "onKeydown"], bt = /* @__PURE__ */ K({
|
|
108
108
|
name: "VfMenu",
|
|
109
109
|
__name: "menu",
|
|
110
110
|
props: {
|
|
@@ -112,88 +112,88 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
112
112
|
orientation: { default: "vertical" }
|
|
113
113
|
},
|
|
114
114
|
emits: ["active", "onActive"],
|
|
115
|
-
setup(
|
|
116
|
-
const r = e,
|
|
115
|
+
setup(o, { emit: e }) {
|
|
116
|
+
const r = e, t = o, l = j([]), 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
|
-
})),
|
|
120
|
-
d.items && d.items.length ? (
|
|
119
|
+
})), n = (d) => {
|
|
120
|
+
d.items && d.items.length ? (l.value.map((a) => {
|
|
121
121
|
a !== d && (a.subMenuVisible = !1);
|
|
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 l.value) {
|
|
126
|
+
const v = l.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
|
};
|
|
131
|
-
return
|
|
132
|
-
() =>
|
|
131
|
+
return re(
|
|
132
|
+
() => t.items,
|
|
133
133
|
(d) => {
|
|
134
|
-
|
|
134
|
+
l.value = i(d);
|
|
135
135
|
},
|
|
136
136
|
{ deep: !0, immediate: !0 }
|
|
137
137
|
), (d, a) => {
|
|
138
|
-
const
|
|
139
|
-
return b(),
|
|
140
|
-
class:
|
|
138
|
+
const f = ye("VfMenu");
|
|
139
|
+
return b(), y("div", {
|
|
140
|
+
class: $(["vf-menu", `vf-menu_${d.orientation}`])
|
|
141
141
|
}, [
|
|
142
142
|
B("ul", Ye, [
|
|
143
|
-
(b(!0),
|
|
144
|
-
key: c(
|
|
143
|
+
(b(!0), y(le, null, ke(l.value, (v, p) => (b(), y("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)] ? C(d.$slots, c(v, p), {
|
|
149
149
|
key: 0,
|
|
150
|
-
item: { ...
|
|
151
|
-
}) :
|
|
150
|
+
item: { ...v, class: "vf-menu__link" }
|
|
151
|
+
}) : v.separator ? (b(), y("hr", Ge)) : v.items && v.items.length ? (b(), y(le, { key: 2 }, [
|
|
152
152
|
B("div", {
|
|
153
|
-
class:
|
|
153
|
+
class: $(["vf-menu__parent", { "vf-menu__parent_active": v.active }]),
|
|
154
154
|
role: "menuitem",
|
|
155
155
|
tabindex: "0",
|
|
156
|
-
"aria-expanded":
|
|
157
|
-
onClick: (
|
|
156
|
+
"aria-expanded": v.subMenuVisible ? "true" : "false",
|
|
157
|
+
onClick: (k) => n(v),
|
|
158
158
|
onKeydown: [
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
Z(J((k) => n(v), ["prevent"]), ["enter"]),
|
|
160
|
+
Z(J((k) => n(v), ["prevent"]), ["space"])
|
|
161
161
|
]
|
|
162
162
|
}, [
|
|
163
|
-
|
|
163
|
+
v.icon ? (b(), O(Q(ee), {
|
|
164
164
|
key: 0,
|
|
165
|
-
icon:
|
|
165
|
+
icon: v.icon,
|
|
166
166
|
class: "vf-menu__icon"
|
|
167
|
-
}, null, 8, ["icon"])) :
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
], 42,
|
|
171
|
-
|
|
167
|
+
}, null, 8, ["icon"])) : w("", !0),
|
|
168
|
+
oe(" " + E(v.label) + " ", 1),
|
|
169
|
+
Ce(Q(ee), { icon: "chevronDown" })
|
|
170
|
+
], 42, qe),
|
|
171
|
+
v.items ? (b(), O(f, {
|
|
172
172
|
key: 0,
|
|
173
|
-
items:
|
|
174
|
-
class:
|
|
173
|
+
items: v.items,
|
|
174
|
+
class: $(["vf-menu__submenu", { "vf-menu__submenu_visible": v.subMenuVisible }]),
|
|
175
175
|
onOnActive: u
|
|
176
|
-
}, null, 8, ["items", "class"])) :
|
|
177
|
-
], 64)) : (b(),
|
|
176
|
+
}, null, 8, ["items", "class"])) : w("", !0)
|
|
177
|
+
], 64)) : (b(), O($e, {
|
|
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: (
|
|
188
|
-
onActive: (
|
|
186
|
+
"aria-disabled": v.disabled ? "true" : "false",
|
|
187
|
+
onClick: (k) => n(v),
|
|
188
|
+
onActive: (k) => u(v)
|
|
189
189
|
}, {
|
|
190
|
-
default:
|
|
191
|
-
|
|
190
|
+
default: Y(() => [
|
|
191
|
+
v.icon ? (b(), O(Q(ee), {
|
|
192
192
|
key: 0,
|
|
193
|
-
icon:
|
|
193
|
+
icon: v.icon,
|
|
194
194
|
class: "vf-menu__icon"
|
|
195
|
-
}, null, 8, ["icon"])) :
|
|
196
|
-
|
|
195
|
+
}, null, 8, ["icon"])) : w("", !0),
|
|
196
|
+
oe(" " + E(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
|
-
}),
|
|
205
|
+
}), Ue = ["type", "disabled"], ht = /* @__PURE__ */ K({
|
|
206
206
|
__name: "button",
|
|
207
207
|
props: {
|
|
208
208
|
to: { default: void 0 },
|
|
@@ -220,71 +220,71 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
220
220
|
severity: { default: "primary" },
|
|
221
221
|
disabled: { type: Boolean, default: !1 }
|
|
222
222
|
},
|
|
223
|
-
setup(
|
|
224
|
-
const e =
|
|
223
|
+
setup(o) {
|
|
224
|
+
const e = o, r = ["button", "submit", "reset"], t = (d) => !!d && r.includes(d), l = _(() => e.as ? e.as === "button" : !(e.to || e.href || e.url || e.type && !t(e.type))), c = _(() => t(e.type) ? e.type : "button"), s = _(() => e.as === "link" ? e.to ? "router-link" : "a" : e.type && !t(e.type) ? e.type === "router-link" && e.to ? "router-link" : "a" : e.to ? "router-link" : "a"), i = _(() => {
|
|
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
|
-
}),
|
|
228
|
-
return (d, a) =>
|
|
227
|
+
}), n = _(() => ["vf-button__icon", `vf-button__icon_${e.iconPos}`]), u = _(() => ["vf-button__label"]);
|
|
228
|
+
return (d, a) => l.value ? (b(), y("button", {
|
|
229
229
|
key: 0,
|
|
230
230
|
type: c.value,
|
|
231
|
-
class:
|
|
231
|
+
class: $(i.value),
|
|
232
232
|
disabled: e.loading || e.disabled
|
|
233
233
|
}, [
|
|
234
|
-
e.icon && !e.loading ? (b(),
|
|
234
|
+
e.icon && !e.loading ? (b(), O(Q(ee), {
|
|
235
235
|
key: 0,
|
|
236
236
|
icon: e.icon,
|
|
237
|
-
class:
|
|
238
|
-
}, null, 8, ["icon", "class"])) :
|
|
239
|
-
e.loading ? (b(),
|
|
237
|
+
class: $(n.value)
|
|
238
|
+
}, null, 8, ["icon", "class"])) : w("", !0),
|
|
239
|
+
e.loading ? (b(), O(Q(ee), {
|
|
240
240
|
key: 1,
|
|
241
241
|
icon: "circleNotch",
|
|
242
|
-
class:
|
|
242
|
+
class: $(n.value),
|
|
243
243
|
spin: ""
|
|
244
|
-
}, null, 8, ["class"])) :
|
|
245
|
-
d.$slots.default ? (b(),
|
|
244
|
+
}, null, 8, ["class"])) : w("", !0),
|
|
245
|
+
d.$slots.default ? (b(), y("span", {
|
|
246
246
|
key: 2,
|
|
247
|
-
class:
|
|
247
|
+
class: $(u.value)
|
|
248
248
|
}, [
|
|
249
|
-
|
|
250
|
-
], 2)) : d.label ? (b(),
|
|
249
|
+
C(d.$slots, "default")
|
|
250
|
+
], 2)) : d.label ? (b(), y("span", {
|
|
251
251
|
key: 3,
|
|
252
|
-
class:
|
|
253
|
-
},
|
|
254
|
-
], 10,
|
|
252
|
+
class: $(u.value)
|
|
253
|
+
}, E(d.label), 3)) : w("", !0)
|
|
254
|
+
], 10, Ue)) : (b(), O($e, {
|
|
255
255
|
key: 1,
|
|
256
256
|
to: e.to,
|
|
257
257
|
href: e.href ?? e.url,
|
|
258
258
|
as: s.value,
|
|
259
|
-
class:
|
|
259
|
+
class: $(i.value),
|
|
260
260
|
disabled: e.loading || e.disabled
|
|
261
261
|
}, {
|
|
262
|
-
default:
|
|
263
|
-
e.icon ? (b(),
|
|
262
|
+
default: Y(() => [
|
|
263
|
+
e.icon ? (b(), O(Q(ee), {
|
|
264
264
|
key: 0,
|
|
265
265
|
icon: e.icon,
|
|
266
|
-
class:
|
|
267
|
-
}, null, 8, ["icon", "class"])) :
|
|
268
|
-
d.$slots.default ? (b(),
|
|
266
|
+
class: $(n.value)
|
|
267
|
+
}, null, 8, ["icon", "class"])) : w("", !0),
|
|
268
|
+
d.$slots.default ? (b(), y("span", {
|
|
269
269
|
key: 1,
|
|
270
|
-
class:
|
|
270
|
+
class: $(u.value)
|
|
271
271
|
}, [
|
|
272
|
-
|
|
273
|
-
], 2)) : d.label ? (b(),
|
|
272
|
+
C(d.$slots, "default")
|
|
273
|
+
], 2)) : d.label ? (b(), y("span", {
|
|
274
274
|
key: 2,
|
|
275
|
-
class:
|
|
276
|
-
},
|
|
275
|
+
class: $(u.value)
|
|
276
|
+
}, E(d.label), 3)) : w("", !0)
|
|
277
277
|
]),
|
|
278
278
|
_: 3
|
|
279
279
|
}, 8, ["to", "href", "as", "class", "disabled"]));
|
|
280
280
|
}
|
|
281
|
-
}),
|
|
281
|
+
}), Ze = {
|
|
282
282
|
key: 0,
|
|
283
283
|
class: "vf-input__prefix"
|
|
284
|
-
},
|
|
284
|
+
}, Je = ["type", "value", "placeholder", "disabled", "readonly"], Qe = {
|
|
285
285
|
key: 1,
|
|
286
286
|
class: "vf-input__suffix"
|
|
287
|
-
},
|
|
287
|
+
}, mt = /* @__PURE__ */ K({
|
|
288
288
|
__name: "input",
|
|
289
289
|
props: {
|
|
290
290
|
modelValue: { default: "" },
|
|
@@ -296,20 +296,20 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
296
296
|
variant: { default: "filled" }
|
|
297
297
|
},
|
|
298
298
|
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
299
|
-
setup(
|
|
300
|
-
const r = e,
|
|
301
|
-
const u = ["vf-input", `vf-input_${
|
|
302
|
-
return
|
|
299
|
+
setup(o, { emit: e }) {
|
|
300
|
+
const r = e, t = o, l = _(() => {
|
|
301
|
+
const u = ["vf-input", `vf-input_${t.variant}`];
|
|
302
|
+
return t.size !== "normal" && u.push(`vf-input_${t.size}`), t.disabled && u.push("vf-input_disabled"), u;
|
|
303
303
|
}), c = (u) => {
|
|
304
304
|
const d = u.target;
|
|
305
305
|
r("update:modelValue", d.value), r("input", u);
|
|
306
|
-
}, s = (u) => r("change", u), i = (u) => r("focus", u),
|
|
307
|
-
return (u, d) => (b(),
|
|
308
|
-
class:
|
|
306
|
+
}, s = (u) => r("change", u), i = (u) => r("focus", u), n = (u) => r("blur", u);
|
|
307
|
+
return (u, d) => (b(), y("div", {
|
|
308
|
+
class: $(l.value)
|
|
309
309
|
}, [
|
|
310
|
-
u.$slots.prefix ? (b(),
|
|
311
|
-
|
|
312
|
-
])) :
|
|
310
|
+
u.$slots.prefix ? (b(), y("span", Ze, [
|
|
311
|
+
C(u.$slots, "prefix")
|
|
312
|
+
])) : w("", !0),
|
|
313
313
|
B("input", {
|
|
314
314
|
class: "vf-input__control",
|
|
315
315
|
type: u.type,
|
|
@@ -320,14 +320,14 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
320
320
|
onInput: c,
|
|
321
321
|
onChange: s,
|
|
322
322
|
onFocus: i,
|
|
323
|
-
onBlur:
|
|
324
|
-
}, null, 40,
|
|
325
|
-
u.$slots.suffix ? (b(),
|
|
326
|
-
|
|
327
|
-
])) :
|
|
323
|
+
onBlur: n
|
|
324
|
+
}, null, 40, Je),
|
|
325
|
+
u.$slots.suffix ? (b(), y("span", Qe, [
|
|
326
|
+
C(u.$slots, "suffix")
|
|
327
|
+
])) : w("", !0)
|
|
328
328
|
], 2));
|
|
329
329
|
}
|
|
330
|
-
}),
|
|
330
|
+
}), ge = [
|
|
331
331
|
"top",
|
|
332
332
|
"top-start",
|
|
333
333
|
"top-end",
|
|
@@ -340,122 +340,122 @@ const Xe = /* @__PURE__ */ Oe(Ee, [["render", je]]), Ye = {
|
|
|
340
340
|
"left",
|
|
341
341
|
"left-start",
|
|
342
342
|
"left-end"
|
|
343
|
-
],
|
|
344
|
-
if (
|
|
343
|
+
], X = (o) => {
|
|
344
|
+
if (o == null || !(o instanceof HTMLElement))
|
|
345
345
|
return null;
|
|
346
346
|
if (typeof window < "u") {
|
|
347
|
-
const e = window.getComputedStyle(
|
|
347
|
+
const e = window.getComputedStyle(o), r = `${e.overflowX}${e.overflowY}`;
|
|
348
348
|
if (/(auto|scroll|overlay)/.test(r))
|
|
349
|
-
return
|
|
349
|
+
return o;
|
|
350
350
|
}
|
|
351
|
-
return
|
|
351
|
+
return o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth ? o : X(o.parentNode);
|
|
352
352
|
};
|
|
353
|
-
function
|
|
354
|
-
return typeof window > "u" ? !1 : window.getComputedStyle(
|
|
353
|
+
function eo(o) {
|
|
354
|
+
return typeof window > "u" ? !1 : window.getComputedStyle(o).position === "fixed";
|
|
355
355
|
}
|
|
356
|
-
const
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
359
|
-
const s =
|
|
356
|
+
const oo = (o, e) => o.strategy ? o.strategy : eo(e) ? "fixed" : "absolute", q = (o, e) => oo(o, e) === "fixed", V = (o, e, r = {}) => {
|
|
357
|
+
const t = o.getBoundingClientRect(), l = e ? e.offsetParent : null, c = e ? q(r, e) : !1;
|
|
358
|
+
if (l && !c) {
|
|
359
|
+
const s = l.getBoundingClientRect(), i = l.scrollLeft, n = l.scrollTop;
|
|
360
360
|
return {
|
|
361
|
-
left:
|
|
362
|
-
top:
|
|
363
|
-
width:
|
|
364
|
-
height:
|
|
361
|
+
left: t.left - s.left + i,
|
|
362
|
+
top: t.top - s.top + n,
|
|
363
|
+
width: t.width,
|
|
364
|
+
height: t.height
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
367
|
return {
|
|
368
|
-
left:
|
|
369
|
-
top:
|
|
370
|
-
width:
|
|
371
|
-
height:
|
|
368
|
+
left: t.left,
|
|
369
|
+
top: t.top,
|
|
370
|
+
width: t.width,
|
|
371
|
+
height: t.height
|
|
372
372
|
};
|
|
373
|
-
},
|
|
373
|
+
}, G = (o, e) => {
|
|
374
374
|
var r;
|
|
375
|
-
return (r =
|
|
376
|
-
},
|
|
377
|
-
const e =
|
|
375
|
+
return (r = o.middleware) == null ? void 0 : r.find((t) => t.name === e);
|
|
376
|
+
}, Fe = (o, e) => !!G(o, e), to = (o) => {
|
|
377
|
+
const e = X(o);
|
|
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
|
-
},
|
|
381
|
-
if (r === null && typeof window < "u" &&
|
|
382
|
-
return
|
|
380
|
+
}, ro = (o) => o.scrollLeft + o.clientWidth, lo = (o) => o.scrollTop + o.clientHeight, P = (o, e, r = null, t = {}, l) => {
|
|
381
|
+
if (r === null && typeof window < "u" && q(t, e))
|
|
382
|
+
return o;
|
|
383
383
|
let c = 0;
|
|
384
384
|
if (r === null) {
|
|
385
|
-
const s =
|
|
385
|
+
const s = X(e);
|
|
386
386
|
c = s ? s.scrollTop : 0;
|
|
387
387
|
}
|
|
388
|
-
return
|
|
389
|
-
},
|
|
388
|
+
return o - c;
|
|
389
|
+
}, A = (o, e, r = null, t = {}, l) => {
|
|
390
390
|
let c;
|
|
391
|
-
if (r === null && typeof window < "u" &&
|
|
391
|
+
if (r === null && typeof window < "u" && q(t, e))
|
|
392
392
|
c = window.innerWidth;
|
|
393
393
|
else if (r === null) {
|
|
394
|
-
const s =
|
|
395
|
-
c = s ?
|
|
394
|
+
const s = X(e);
|
|
395
|
+
c = s ? ro(s) : 0;
|
|
396
396
|
} else
|
|
397
397
|
c = r.getBoundingClientRect().width;
|
|
398
|
-
return -(
|
|
399
|
-
},
|
|
398
|
+
return -(o + e.clientWidth - c);
|
|
399
|
+
}, I = (o, e, r = null, t = {}, l) => {
|
|
400
400
|
let c;
|
|
401
|
-
if (r === null && typeof window < "u" &&
|
|
401
|
+
if (r === null && typeof window < "u" && q(t, e))
|
|
402
402
|
c = window.innerHeight;
|
|
403
403
|
else if (r === null) {
|
|
404
|
-
const s =
|
|
405
|
-
c = s ?
|
|
404
|
+
const s = X(e);
|
|
405
|
+
c = s ? lo(s) : 0;
|
|
406
406
|
} else
|
|
407
407
|
c = r.getBoundingClientRect().height;
|
|
408
|
-
return -(
|
|
409
|
-
},
|
|
410
|
-
if (r === null && typeof window < "u" &&
|
|
411
|
-
return
|
|
408
|
+
return -(o + e.clientHeight - c);
|
|
409
|
+
}, D = (o, e, r = null, t = {}, l) => {
|
|
410
|
+
if (r === null && typeof window < "u" && q(t, e))
|
|
411
|
+
return o;
|
|
412
412
|
let c = 0;
|
|
413
413
|
if (r === null) {
|
|
414
|
-
const s =
|
|
414
|
+
const s = X(e);
|
|
415
415
|
c = s ? s.scrollLeft : 0;
|
|
416
416
|
}
|
|
417
|
-
return
|
|
418
|
-
},
|
|
419
|
-
options:
|
|
417
|
+
return o - c;
|
|
418
|
+
}, be = ({
|
|
419
|
+
options: o,
|
|
420
420
|
primaryX: e,
|
|
421
421
|
primaryY: r,
|
|
422
|
-
floating:
|
|
423
|
-
placement:
|
|
422
|
+
floating: t,
|
|
423
|
+
placement: l,
|
|
424
424
|
reference: c,
|
|
425
425
|
scrollDirection: s
|
|
426
426
|
}) => {
|
|
427
|
-
const i =
|
|
428
|
-
if (
|
|
429
|
-
const u =
|
|
427
|
+
const i = se(c, t, l, o), n = G(o, "offset");
|
|
428
|
+
if (n) {
|
|
429
|
+
const u = n.fn({
|
|
430
430
|
x: i.x,
|
|
431
431
|
y: i.y,
|
|
432
|
-
options:
|
|
432
|
+
options: o,
|
|
433
433
|
primaryX: e,
|
|
434
434
|
primaryY: r,
|
|
435
|
-
floating:
|
|
436
|
-
placement:
|
|
435
|
+
floating: t,
|
|
436
|
+
placement: l,
|
|
437
437
|
reference: c,
|
|
438
438
|
scrollDirection: s
|
|
439
439
|
});
|
|
440
440
|
i.x = u.x, i.y = u.y;
|
|
441
441
|
}
|
|
442
|
-
return
|
|
442
|
+
return Fo(i, t, c, o) ? {
|
|
443
443
|
x: i.x,
|
|
444
444
|
y: i.y,
|
|
445
|
-
placement:
|
|
445
|
+
placement: l
|
|
446
446
|
} : !1;
|
|
447
|
-
},
|
|
447
|
+
}, no = (o) => ({
|
|
448
448
|
name: "flip",
|
|
449
|
-
params:
|
|
449
|
+
params: o,
|
|
450
450
|
fn: ({
|
|
451
451
|
x: e,
|
|
452
452
|
y: r,
|
|
453
|
-
options:
|
|
454
|
-
primaryX:
|
|
453
|
+
options: t,
|
|
454
|
+
primaryX: l,
|
|
455
455
|
primaryY: c,
|
|
456
456
|
floating: s,
|
|
457
457
|
placement: i,
|
|
458
|
-
reference:
|
|
458
|
+
reference: n,
|
|
459
459
|
scrollDirection: u
|
|
460
460
|
}) => {
|
|
461
461
|
var d;
|
|
@@ -463,245 +463,245 @@ 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
|
-
},
|
|
467
|
-
...
|
|
468
|
-
middleware: (d =
|
|
469
|
-
},
|
|
466
|
+
}, f = {
|
|
467
|
+
...t,
|
|
468
|
+
middleware: (d = t.middleware) == null ? void 0 : d.filter((z) => z.name !== "shift")
|
|
469
|
+
}, v = (o == null ? void 0 : o.placements) ?? ge, p = !(o != null && o.placements), k = p ? ge : v;
|
|
470
470
|
let m = !1;
|
|
471
|
-
const
|
|
471
|
+
const x = (z) => {
|
|
472
472
|
if (m)
|
|
473
473
|
return;
|
|
474
|
-
const
|
|
475
|
-
options:
|
|
476
|
-
primaryX:
|
|
474
|
+
const S = be({
|
|
475
|
+
options: f,
|
|
476
|
+
primaryX: l,
|
|
477
477
|
primaryY: c,
|
|
478
478
|
floating: s,
|
|
479
|
-
placement:
|
|
480
|
-
reference:
|
|
479
|
+
placement: z,
|
|
480
|
+
reference: n,
|
|
481
481
|
scrollDirection: u
|
|
482
482
|
});
|
|
483
|
-
|
|
484
|
-
},
|
|
485
|
-
if (!p &&
|
|
486
|
-
const
|
|
487
|
-
(
|
|
488
|
-
const
|
|
489
|
-
options:
|
|
490
|
-
primaryX:
|
|
483
|
+
S && (a.x = S.x, a.y = S.y, a.placement = S.placement, m = !0);
|
|
484
|
+
}, H = xo(n, s, f);
|
|
485
|
+
if (!p && v.includes(i) && x(i), m || k.forEach(x), !m) {
|
|
486
|
+
const z = v.reduce(
|
|
487
|
+
(S, L) => {
|
|
488
|
+
const M = be({
|
|
489
|
+
options: f,
|
|
490
|
+
primaryX: l,
|
|
491
491
|
primaryY: c,
|
|
492
492
|
floating: s,
|
|
493
|
-
placement:
|
|
494
|
-
reference:
|
|
493
|
+
placement: L,
|
|
494
|
+
reference: n,
|
|
495
495
|
scrollDirection: u
|
|
496
496
|
});
|
|
497
|
-
if (!
|
|
498
|
-
return
|
|
499
|
-
const
|
|
500
|
-
return
|
|
497
|
+
if (!M)
|
|
498
|
+
return S;
|
|
499
|
+
const R = te(L), W = H[R];
|
|
500
|
+
return !S || W > S.space ? { result: M, space: W } : S;
|
|
501
501
|
},
|
|
502
502
|
null
|
|
503
503
|
);
|
|
504
|
-
|
|
504
|
+
z && (a.x = z.result.x, a.y = z.result.y, a.placement = z.result.placement, m = !0);
|
|
505
505
|
}
|
|
506
|
-
if (!m &&
|
|
507
|
-
const
|
|
508
|
-
let
|
|
509
|
-
|
|
510
|
-
const g = te(
|
|
511
|
-
F >
|
|
506
|
+
if (!m && v.length > 0) {
|
|
507
|
+
const z = te(i);
|
|
508
|
+
let S = z, L = H[z];
|
|
509
|
+
v.forEach((h) => {
|
|
510
|
+
const g = te(h), F = H[g];
|
|
511
|
+
F > L && (L = F, S = g);
|
|
512
512
|
});
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
516
|
-
x:
|
|
517
|
-
y:
|
|
518
|
-
options:
|
|
519
|
-
primaryX:
|
|
513
|
+
const M = Bo(S, i, v), R = se(n, s, M, f), W = G(f, "offset");
|
|
514
|
+
if (W) {
|
|
515
|
+
const h = W.fn({
|
|
516
|
+
x: R.x,
|
|
517
|
+
y: R.y,
|
|
518
|
+
options: f,
|
|
519
|
+
primaryX: l,
|
|
520
520
|
primaryY: c,
|
|
521
521
|
floating: s,
|
|
522
|
-
placement:
|
|
523
|
-
reference:
|
|
522
|
+
placement: M,
|
|
523
|
+
reference: n,
|
|
524
524
|
scrollDirection: u
|
|
525
525
|
});
|
|
526
|
-
|
|
526
|
+
R.x = h.x, R.y = h.y;
|
|
527
527
|
}
|
|
528
|
-
a.x =
|
|
528
|
+
a.x = R.x, a.y = R.y, a.placement = R.placement;
|
|
529
529
|
}
|
|
530
530
|
return a;
|
|
531
531
|
}
|
|
532
|
-
}),
|
|
532
|
+
}), ao = (o, e, r, t, l) => {
|
|
533
533
|
var c, s, i;
|
|
534
|
-
let
|
|
535
|
-
|
|
536
|
-
const u =
|
|
534
|
+
let n = 0;
|
|
535
|
+
t.startsWith("right") ? n = -o : t.startsWith("left") && (n = o);
|
|
536
|
+
const u = G(e, "arrow"), d = G(e, "shift");
|
|
537
537
|
if (u) {
|
|
538
538
|
const a = ((c = u.params) == null ? void 0 : c.arrow).getBoundingClientRect();
|
|
539
|
-
|
|
539
|
+
t.startsWith("right") ? n -= a.width / 2 : t.startsWith("left") && (n += a.width / 2);
|
|
540
540
|
}
|
|
541
|
-
if (
|
|
542
|
-
let a = null,
|
|
541
|
+
if (Fe(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 += co(v), f -= o, t.startsWith("right") ? A(r - n, l, a, e) <= o ? A(r, l, a, e) > 0 ? n = o - A(r, l, a, e) : n = o : D(r - n - f, l, a, e) <= o && (D(r - n - f, l, a, e) >= 0 ? (n = -o - (D(r - n - f, l, a, e) + o), a && (n = -o)) : n = -o) : t.startsWith("left") ? A(r - n + f, l, a, e) <= o ? (n = o + A(r - f, l, a, e), n <= o && (n = o)) : D(r - n, l, a, e) <= o && (n = -o + D(r, l, a, e), n <= -o && (n = -o)) : A(r - n, l, a, e) <= o ? A(r - n, l, a, e) <= o && A(r, l, a, e) > 0 ? n = o - A(r, l, a, e) : n = o : D(r - n, l, a, e) <= o && (D(r - n, l, a, e) <= o && D(r, l, a, e) > 0 ? n = -(o - D(r, l, a, e)) : n = -o);
|
|
546
546
|
}
|
|
547
|
-
return
|
|
548
|
-
},
|
|
547
|
+
return n;
|
|
548
|
+
}, so = (o, e, r, t, l) => {
|
|
549
549
|
var c, s, i;
|
|
550
|
-
let
|
|
551
|
-
|
|
552
|
-
const u =
|
|
550
|
+
let n = 0;
|
|
551
|
+
t.startsWith("top") ? n = o : t.startsWith("bottom") && (n = -o);
|
|
552
|
+
const u = G(e, "arrow"), d = G(e, "shift");
|
|
553
553
|
if (u) {
|
|
554
554
|
const a = ((c = u.params) == null ? void 0 : c.arrow).getBoundingClientRect();
|
|
555
|
-
|
|
555
|
+
t.startsWith("top") ? n += a.height / 2 : t.startsWith("bottom") && (n -= a.height / 2);
|
|
556
556
|
}
|
|
557
|
-
if (
|
|
558
|
-
let a = null,
|
|
557
|
+
if (Fe(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 += uo(v), f -= o, t.startsWith("top") ? P(r - n, l, a, e) <= o ? P(r, l, a, e) >= 0 ? n = -(o - P(r, l, a, e)) : n = -o : I(r - n + f, l, a, e) <= o && (n = o + I(r - f, l, a, e), n <= o && (n = o)) : t.startsWith("bottom") ? P(r - n - f, l, a, e) <= o ? P(r - n - f, l, a, e) >= 0 ? (n = -o - (P(r - n - f, l, a, e) + o), a && (n = -o)) : n = -o : I(r - n, l, a, e) <= o && (I(r, l, a, e) >= 0 ? n = o - I(r, l, a, e) : n = o) : P(r - n, l, a, e) <= o ? P(r - n, l, a, e) >= 0 ? n = -(o - P(r - n, l, a, e)) : n = -o : I(r - n, l, a, e) <= o && (I(r - n, l, a, e) >= 0 ? n = o - I(r - n, l, a, e) : n = o);
|
|
562
562
|
}
|
|
563
|
-
return
|
|
564
|
-
},
|
|
563
|
+
return n;
|
|
564
|
+
}, io = (o) => ({
|
|
565
565
|
name: "offset",
|
|
566
|
-
params: { value:
|
|
566
|
+
params: { value: o },
|
|
567
567
|
fn: ({
|
|
568
568
|
x: e,
|
|
569
569
|
y: r,
|
|
570
|
-
options:
|
|
571
|
-
primaryX:
|
|
570
|
+
options: t,
|
|
571
|
+
primaryX: l,
|
|
572
572
|
primaryY: c,
|
|
573
573
|
floating: s,
|
|
574
574
|
placement: i
|
|
575
575
|
}) => ({
|
|
576
|
-
x: e -
|
|
577
|
-
y: r -
|
|
576
|
+
x: e - ao(o, t, l, i, s),
|
|
577
|
+
y: r - so(o, t, c, i, s),
|
|
578
578
|
placement: i
|
|
579
579
|
})
|
|
580
|
-
}),
|
|
581
|
-
const r =
|
|
580
|
+
}), co = (o) => o.getBoundingClientRect().width !== o.clientWidth ? (o.getBoundingClientRect().width - o.clientWidth) / 2 : 0, uo = (o) => o.getBoundingClientRect().height !== o.clientHeight ? (o.getBoundingClientRect().height - o.clientHeight) / 2 : 0, fo = (o, e) => {
|
|
581
|
+
const r = X(o), t = [];
|
|
582
582
|
if (r !== null) {
|
|
583
|
-
const
|
|
584
|
-
r.addEventListener("scroll",
|
|
583
|
+
const l = () => e();
|
|
584
|
+
r.addEventListener("scroll", l, !1), t.push(() => r.removeEventListener("scroll", l, !1));
|
|
585
585
|
}
|
|
586
586
|
if (typeof window < "u") {
|
|
587
|
-
const
|
|
588
|
-
window.addEventListener("scroll",
|
|
587
|
+
const l = () => e(), c = () => e();
|
|
588
|
+
window.addEventListener("scroll", l, !1), window.addEventListener("resize", c, !1), t.push(() => window.removeEventListener("scroll", l, !1)), t.push(() => window.removeEventListener("resize", c, !1));
|
|
589
589
|
}
|
|
590
|
-
if (typeof ResizeObserver < "u" &&
|
|
591
|
-
const
|
|
592
|
-
|
|
590
|
+
if (typeof ResizeObserver < "u" && o instanceof HTMLElement) {
|
|
591
|
+
const l = new ResizeObserver(() => e());
|
|
592
|
+
l.observe(o), t.push(() => l.disconnect());
|
|
593
593
|
}
|
|
594
|
-
return () =>
|
|
595
|
-
},
|
|
596
|
-
const
|
|
594
|
+
return () => t.forEach((l) => l());
|
|
595
|
+
}, vo = (o, e, r = {}) => {
|
|
596
|
+
const t = V(o, e, r);
|
|
597
597
|
return {
|
|
598
|
-
x:
|
|
599
|
-
y:
|
|
598
|
+
x: t.left - e.getBoundingClientRect().width / 2 + t.width / 2,
|
|
599
|
+
y: t.top - e.getBoundingClientRect().height,
|
|
600
600
|
placement: "top"
|
|
601
601
|
};
|
|
602
|
-
},
|
|
603
|
-
const
|
|
602
|
+
}, po = (o, e, r = {}) => {
|
|
603
|
+
const t = V(o, e, r);
|
|
604
604
|
return {
|
|
605
|
-
x:
|
|
606
|
-
y:
|
|
605
|
+
x: t.left,
|
|
606
|
+
y: t.top - e.getBoundingClientRect().height,
|
|
607
607
|
placement: "top-start"
|
|
608
608
|
};
|
|
609
|
-
},
|
|
610
|
-
const
|
|
609
|
+
}, go = (o, e, r = {}) => {
|
|
610
|
+
const t = V(o, e, r);
|
|
611
611
|
return {
|
|
612
|
-
x:
|
|
613
|
-
y:
|
|
612
|
+
x: t.left - e.getBoundingClientRect().width + t.width,
|
|
613
|
+
y: t.top - e.getBoundingClientRect().height,
|
|
614
614
|
placement: "top-end"
|
|
615
615
|
};
|
|
616
|
-
},
|
|
617
|
-
const
|
|
616
|
+
}, bo = (o, e, r = {}) => {
|
|
617
|
+
const t = V(o, e, r);
|
|
618
618
|
return {
|
|
619
|
-
x:
|
|
620
|
-
y:
|
|
619
|
+
x: t.left + t.width,
|
|
620
|
+
y: t.top - e.getBoundingClientRect().height / 2 + t.height / 2,
|
|
621
621
|
placement: "right"
|
|
622
622
|
};
|
|
623
|
-
},
|
|
624
|
-
const
|
|
623
|
+
}, ho = (o, e, r = {}) => {
|
|
624
|
+
const t = V(o, e, r);
|
|
625
625
|
return {
|
|
626
|
-
x:
|
|
627
|
-
y:
|
|
626
|
+
x: t.left + t.width,
|
|
627
|
+
y: t.top,
|
|
628
628
|
placement: "right-start"
|
|
629
629
|
};
|
|
630
|
-
},
|
|
631
|
-
const
|
|
630
|
+
}, mo = (o, e, r = {}) => {
|
|
631
|
+
const t = V(o, e, r);
|
|
632
632
|
return {
|
|
633
|
-
x:
|
|
634
|
-
y:
|
|
633
|
+
x: t.left + t.width,
|
|
634
|
+
y: t.top + t.height - e.getBoundingClientRect().height,
|
|
635
635
|
placement: "right-end"
|
|
636
636
|
};
|
|
637
|
-
},
|
|
638
|
-
const
|
|
637
|
+
}, yo = (o, e, r = {}) => {
|
|
638
|
+
const t = V(o, e, r);
|
|
639
639
|
return {
|
|
640
|
-
x:
|
|
641
|
-
y:
|
|
640
|
+
x: t.left + t.width / 2 - e.getBoundingClientRect().width / 2,
|
|
641
|
+
y: t.top + t.height,
|
|
642
642
|
placement: "bottom"
|
|
643
643
|
};
|
|
644
|
-
},
|
|
645
|
-
const
|
|
644
|
+
}, ko = (o, e, r = {}) => {
|
|
645
|
+
const t = V(o, e, r);
|
|
646
646
|
return {
|
|
647
|
-
x:
|
|
648
|
-
y:
|
|
647
|
+
x: t.left,
|
|
648
|
+
y: t.top + t.height,
|
|
649
649
|
placement: "bottom-start"
|
|
650
650
|
};
|
|
651
|
-
},
|
|
652
|
-
const
|
|
651
|
+
}, Co = (o, e, r = {}) => {
|
|
652
|
+
const t = V(o, e, r);
|
|
653
653
|
return {
|
|
654
|
-
x:
|
|
655
|
-
y:
|
|
654
|
+
x: t.left - e.getBoundingClientRect().width + t.width,
|
|
655
|
+
y: t.top + t.height,
|
|
656
656
|
placement: "bottom-end"
|
|
657
657
|
};
|
|
658
|
-
},
|
|
659
|
-
const
|
|
658
|
+
}, wo = (o, e, r = {}) => {
|
|
659
|
+
const t = V(o, e, r);
|
|
660
660
|
return {
|
|
661
|
-
x:
|
|
662
|
-
y:
|
|
661
|
+
x: t.left - e.getBoundingClientRect().width,
|
|
662
|
+
y: t.top + t.height / 2 - e.getBoundingClientRect().height / 2,
|
|
663
663
|
placement: "left"
|
|
664
664
|
};
|
|
665
|
-
},
|
|
666
|
-
const
|
|
665
|
+
}, _o = (o, e, r = {}) => {
|
|
666
|
+
const t = V(o, e, r);
|
|
667
667
|
return {
|
|
668
|
-
x:
|
|
669
|
-
y:
|
|
668
|
+
x: t.left - e.getBoundingClientRect().width,
|
|
669
|
+
y: t.top,
|
|
670
670
|
placement: "left-start"
|
|
671
671
|
};
|
|
672
|
-
},
|
|
673
|
-
const
|
|
672
|
+
}, $o = (o, e, r = {}) => {
|
|
673
|
+
const t = V(o, e, r);
|
|
674
674
|
return {
|
|
675
|
-
x:
|
|
676
|
-
y:
|
|
675
|
+
x: t.left - e.getBoundingClientRect().width,
|
|
676
|
+
y: t.top + t.height - e.getBoundingClientRect().height,
|
|
677
677
|
placement: "left-end"
|
|
678
678
|
};
|
|
679
|
-
},
|
|
679
|
+
}, se = (o, e, r, t = {}) => {
|
|
680
680
|
switch (r) {
|
|
681
681
|
case "top":
|
|
682
|
-
return
|
|
682
|
+
return vo(o, e, t);
|
|
683
683
|
case "top-start":
|
|
684
|
-
return
|
|
684
|
+
return po(o, e, t);
|
|
685
685
|
case "top-end":
|
|
686
|
-
return
|
|
686
|
+
return go(o, e, t);
|
|
687
687
|
case "right":
|
|
688
|
-
return
|
|
688
|
+
return bo(o, e, t);
|
|
689
689
|
case "right-start":
|
|
690
|
-
return
|
|
690
|
+
return ho(o, e, t);
|
|
691
691
|
case "right-end":
|
|
692
|
-
return
|
|
692
|
+
return mo(o, e, t);
|
|
693
693
|
case "bottom":
|
|
694
|
-
return
|
|
694
|
+
return yo(o, e, t);
|
|
695
695
|
case "bottom-start":
|
|
696
|
-
return
|
|
696
|
+
return ko(o, e, t);
|
|
697
697
|
case "bottom-end":
|
|
698
|
-
return
|
|
698
|
+
return Co(o, e, t);
|
|
699
699
|
case "left":
|
|
700
|
-
return
|
|
700
|
+
return wo(o, e, t);
|
|
701
701
|
case "left-start":
|
|
702
|
-
return
|
|
702
|
+
return _o(o, e, t);
|
|
703
703
|
case "left-end":
|
|
704
|
-
return
|
|
704
|
+
return $o(o, e, t);
|
|
705
705
|
default:
|
|
706
706
|
return {
|
|
707
707
|
x: 0,
|
|
@@ -709,25 +709,25 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
709
709
|
placement: ""
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
},
|
|
713
|
-
if (
|
|
712
|
+
}, Fo = (o, e, r, t = {}) => {
|
|
713
|
+
if (q(t, e)) {
|
|
714
714
|
if (typeof window > "u")
|
|
715
715
|
return !0;
|
|
716
|
-
const a =
|
|
717
|
-
return a >= 0 &&
|
|
716
|
+
const a = o.x, f = o.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 (X(r) !== null)
|
|
720
|
+
return P(o.y, e, null, t) > 0 && A(o.x, e, null, t) > 0 && I(o.y, e, null, t) > 0 && D(o.x, e, null, t) > 0;
|
|
721
721
|
if (typeof window > "u")
|
|
722
722
|
return !0;
|
|
723
|
-
const
|
|
723
|
+
const l = 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 + o.x, v = a.top + o.y, p = f + e.clientWidth, k = v + e.clientHeight;
|
|
726
|
+
return f >= 0 && v >= 0 && p <= l && k <= c;
|
|
727
727
|
}
|
|
728
|
-
const i =
|
|
729
|
-
return i >= 0 &&
|
|
730
|
-
}, te = (
|
|
728
|
+
const i = o.x, n = o.y, u = i + e.clientWidth, d = n + e.clientHeight;
|
|
729
|
+
return i >= 0 && n >= 0 && u <= l && d <= c;
|
|
730
|
+
}, te = (o) => o.startsWith("right") ? "right" : o.startsWith("left") ? "left" : o.startsWith("top") ? "top" : "bottom", Bo = (o, e, r) => te(e) === o && r.includes(e) ? e : r.find((t) => te(t) === o) ?? r[0], xo = (o, e, r = {}) => {
|
|
731
731
|
if (typeof window > "u")
|
|
732
732
|
return {
|
|
733
733
|
top: 0,
|
|
@@ -735,30 +735,30 @@ 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
|
|
738
|
+
const t = q(r, e) ? null : X(o), l = o.getBoundingClientRect(), c = t ? t.getBoundingClientRect() : {
|
|
739
739
|
top: 0,
|
|
740
740
|
left: 0,
|
|
741
741
|
right: window.innerWidth,
|
|
742
742
|
bottom: window.innerHeight
|
|
743
743
|
};
|
|
744
744
|
return {
|
|
745
|
-
top:
|
|
746
|
-
right: c.right -
|
|
747
|
-
bottom: c.bottom -
|
|
748
|
-
left:
|
|
745
|
+
top: l.top - c.top,
|
|
746
|
+
right: c.right - l.right,
|
|
747
|
+
bottom: c.bottom - l.bottom,
|
|
748
|
+
left: l.left - c.left
|
|
749
749
|
};
|
|
750
|
-
},
|
|
751
|
-
var
|
|
750
|
+
}, zo = (o, e, r = {}) => new Promise((t) => {
|
|
751
|
+
var l, c;
|
|
752
752
|
const s = r.placement ? r.placement : "bottom", i = {
|
|
753
753
|
x: 0,
|
|
754
754
|
y: 0,
|
|
755
755
|
placement: s,
|
|
756
756
|
middlewareData: {}
|
|
757
|
-
},
|
|
758
|
-
i.x =
|
|
759
|
-
const u = i.x, d = i.y, a =
|
|
760
|
-
(
|
|
761
|
-
const m =
|
|
757
|
+
}, n = se(o, e, s, r);
|
|
758
|
+
i.x = n.x, i.y = n.y, i.placement = n.placement;
|
|
759
|
+
const u = i.x, d = i.y, a = to(o);
|
|
760
|
+
(l = r.middleware) == null || l.forEach((k) => {
|
|
761
|
+
const m = k.fn({
|
|
762
762
|
x: i.x,
|
|
763
763
|
y: i.y,
|
|
764
764
|
options: r,
|
|
@@ -766,20 +766,20 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
766
766
|
primaryY: d,
|
|
767
767
|
floating: e,
|
|
768
768
|
placement: i.placement,
|
|
769
|
-
reference:
|
|
769
|
+
reference: o,
|
|
770
770
|
scrollDirection: a
|
|
771
771
|
});
|
|
772
|
-
i.x = m.x, i.y = m.y, i.placement = m.placement,
|
|
772
|
+
i.x = m.x, i.y = m.y, i.placement = m.placement, k.name === "arrow" && (m.baseX = m.x, m.baseY = m.y, m.x = m.arrowX ?? m.x, m.y = m.arrowY ?? m.y), i.middlewareData[k.name] = m;
|
|
773
773
|
});
|
|
774
|
-
const
|
|
775
|
-
if (Number.isFinite(i.x) || (i.x =
|
|
776
|
-
if (
|
|
777
|
-
const
|
|
778
|
-
i.placement.startsWith("top") ? i.y =
|
|
774
|
+
const f = se(o, e, i.placement, r), v = G(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 (q(r, e)) {
|
|
777
|
+
const k = o.getBoundingClientRect(), m = e.getBoundingClientRect().height;
|
|
778
|
+
i.placement.startsWith("top") ? i.y = k.top - m - p : i.placement.startsWith("bottom") ? i.y = k.bottom + p : i.y = f.y;
|
|
779
779
|
} else
|
|
780
|
-
i.y =
|
|
781
|
-
|
|
782
|
-
}),
|
|
780
|
+
i.y = f.y;
|
|
781
|
+
t(i);
|
|
782
|
+
}), So = ["disabled", "aria-expanded", "onKeydown"], To = ["data-placement"], Ro = ["disabled", "aria-selected", "onClick"], yt = /* @__PURE__ */ K({
|
|
783
783
|
__name: "select",
|
|
784
784
|
props: {
|
|
785
785
|
modelValue: { default: void 0 },
|
|
@@ -791,83 +791,83 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
791
791
|
size: { default: "normal" }
|
|
792
792
|
},
|
|
793
793
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
794
|
-
setup(
|
|
794
|
+
setup(o, { emit: e }) {
|
|
795
795
|
let r = 0;
|
|
796
|
-
const
|
|
797
|
-
let
|
|
798
|
-
const
|
|
799
|
-
label: g[
|
|
800
|
-
value: g[
|
|
796
|
+
const t = e, l = o, c = j(null), s = j(null), i = j(null), n = j(!1), u = j("bottom"), d = j("bottom"), a = `vf-select-panel-${++r}`;
|
|
797
|
+
let f = null;
|
|
798
|
+
const v = _(() => l.options.map((g) => ({
|
|
799
|
+
label: g[l.optionLabel],
|
|
800
|
+
value: g[l.optionValue],
|
|
801
801
|
disabled: g.disabled
|
|
802
|
-
}))), p =
|
|
802
|
+
}))), p = _(() => v.value.find((g) => g.value === l.modelValue)), k = _(() => {
|
|
803
803
|
var g;
|
|
804
804
|
return ((g = p.value) == null ? void 0 : g.label) ?? "";
|
|
805
|
-
}), m =
|
|
806
|
-
const g = ["vf-select",
|
|
807
|
-
return
|
|
808
|
-
}),
|
|
809
|
-
g.disabled || (
|
|
810
|
-
},
|
|
811
|
-
|
|
812
|
-
},
|
|
813
|
-
|
|
814
|
-
},
|
|
805
|
+
}), m = _(() => {
|
|
806
|
+
const g = ["vf-select", n.value ? "vf-select_open" : ""];
|
|
807
|
+
return l.size !== "normal" && g.push(`vf-select_${l.size}`), l.disabled && g.push("vf-select_disabled"), g.filter(Boolean);
|
|
808
|
+
}), x = (g) => g.value === l.modelValue, H = (g) => {
|
|
809
|
+
g.disabled || (t("update:modelValue", g.value), t("change", g.value), L());
|
|
810
|
+
}, z = (g) => t("focus", g), S = (g) => t("blur", g), L = () => {
|
|
811
|
+
n.value = !1, u.value = "bottom", d.value = "bottom";
|
|
812
|
+
}, M = () => {
|
|
813
|
+
l.disabled || (n.value = !n.value, n.value && (u.value = "bottom", d.value = "bottom"));
|
|
814
|
+
}, R = async () => {
|
|
815
815
|
var g, F;
|
|
816
|
-
|
|
817
|
-
},
|
|
818
|
-
var
|
|
819
|
-
if (!
|
|
816
|
+
n.value || (n.value = !0, await ce()), (F = (g = i.value) == null ? void 0 : g.querySelector(".vf-select__option:not(.is-disabled)")) == null || F.focus();
|
|
817
|
+
}, W = (g) => {
|
|
818
|
+
var T;
|
|
819
|
+
if (!n.value || !c.value)
|
|
820
820
|
return;
|
|
821
821
|
const F = g.target;
|
|
822
|
-
c.value.contains(F) || (
|
|
823
|
-
},
|
|
822
|
+
c.value.contains(F) || (T = i.value) != null && T.contains(F) || L();
|
|
823
|
+
}, h = () => {
|
|
824
824
|
if (!s.value || !i.value)
|
|
825
825
|
return;
|
|
826
|
-
const g = s.value, F = i.value,
|
|
826
|
+
const g = s.value, F = i.value, T = async () => {
|
|
827
827
|
const {
|
|
828
|
-
x:
|
|
829
|
-
y:
|
|
830
|
-
placement:
|
|
831
|
-
} = await
|
|
828
|
+
x: ze,
|
|
829
|
+
y: Se,
|
|
830
|
+
placement: Te
|
|
831
|
+
} = await zo(g, F, {
|
|
832
832
|
placement: u.value,
|
|
833
833
|
strategy: "fixed",
|
|
834
|
-
middleware: [
|
|
834
|
+
middleware: [io(2), no({ placements: ["bottom", "top"] })]
|
|
835
835
|
});
|
|
836
|
-
d.value =
|
|
837
|
-
},
|
|
838
|
-
await
|
|
839
|
-
},
|
|
840
|
-
|
|
841
|
-
}),
|
|
842
|
-
|
|
836
|
+
d.value = Te ?? u.value, F.style.minWidth = `${g.getBoundingClientRect().width}px`, F.style.left = `${ze}px`, F.style.top = `${Se}px`;
|
|
837
|
+
}, U = async () => {
|
|
838
|
+
await T();
|
|
839
|
+
}, ne = fo(g, () => {
|
|
840
|
+
U();
|
|
841
|
+
}), ae = () => {
|
|
842
|
+
U();
|
|
843
843
|
};
|
|
844
|
-
document.addEventListener("scroll",
|
|
845
|
-
update:
|
|
844
|
+
document.addEventListener("scroll", ae, !0), window.addEventListener("resize", ae, !1), f = {
|
|
845
|
+
update: U,
|
|
846
846
|
destroy: () => {
|
|
847
|
-
|
|
847
|
+
ne(), document.removeEventListener("scroll", ae, !0), window.removeEventListener("resize", ae, !1);
|
|
848
848
|
}
|
|
849
|
-
},
|
|
849
|
+
}, f.update();
|
|
850
850
|
};
|
|
851
|
-
return
|
|
851
|
+
return re(n, async (g) => {
|
|
852
852
|
if (!g) {
|
|
853
|
-
|
|
853
|
+
f && (f.destroy(), f = null);
|
|
854
854
|
return;
|
|
855
855
|
}
|
|
856
|
-
await
|
|
857
|
-
}),
|
|
858
|
-
() =>
|
|
856
|
+
await ce(), f || h(), f == null || f.update();
|
|
857
|
+
}), re(
|
|
858
|
+
() => l.options,
|
|
859
859
|
() => {
|
|
860
|
-
|
|
860
|
+
f == null || f.update();
|
|
861
861
|
},
|
|
862
862
|
{ deep: !0 }
|
|
863
|
-
),
|
|
864
|
-
document.addEventListener("click",
|
|
865
|
-
}),
|
|
866
|
-
document.removeEventListener("click",
|
|
867
|
-
}), (g, F) => (b(),
|
|
863
|
+
), Re(() => {
|
|
864
|
+
document.addEventListener("click", W);
|
|
865
|
+
}), we(() => {
|
|
866
|
+
document.removeEventListener("click", W), f == null || f.destroy(), f = null;
|
|
867
|
+
}), (g, F) => (b(), y("div", {
|
|
868
868
|
ref_key: "root",
|
|
869
869
|
ref: c,
|
|
870
|
-
class:
|
|
870
|
+
class: $(m.value)
|
|
871
871
|
}, [
|
|
872
872
|
B("button", {
|
|
873
873
|
ref_key: "trigger",
|
|
@@ -875,28 +875,28 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
875
875
|
class: "vf-select__control",
|
|
876
876
|
type: "button",
|
|
877
877
|
disabled: g.disabled,
|
|
878
|
-
"aria-expanded":
|
|
878
|
+
"aria-expanded": n.value,
|
|
879
879
|
"aria-controls": a,
|
|
880
880
|
"aria-haspopup": "listbox",
|
|
881
|
-
onClick:
|
|
881
|
+
onClick: M,
|
|
882
882
|
onKeydown: [
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
883
|
+
Z(J(R, ["prevent"]), ["down"]),
|
|
884
|
+
Z(J(M, ["prevent"]), ["enter"]),
|
|
885
|
+
Z(J(L, ["prevent"]), ["esc"])
|
|
886
886
|
],
|
|
887
|
-
onFocus:
|
|
888
|
-
onBlur:
|
|
887
|
+
onFocus: z,
|
|
888
|
+
onBlur: S
|
|
889
889
|
}, [
|
|
890
890
|
B("span", {
|
|
891
|
-
class:
|
|
892
|
-
},
|
|
891
|
+
class: $(["vf-select__label", { "vf-select__label_placeholder": !k.value }])
|
|
892
|
+
}, E(k.value || g.placeholder), 3),
|
|
893
893
|
F[0] || (F[0] = B("span", {
|
|
894
894
|
class: "vf-select__chevron",
|
|
895
895
|
"aria-hidden": "true"
|
|
896
896
|
}, "▾", -1))
|
|
897
|
-
], 40,
|
|
898
|
-
(b(),
|
|
899
|
-
|
|
897
|
+
], 40, So),
|
|
898
|
+
(b(), O(_e, { to: "body" }, [
|
|
899
|
+
ue(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:
|
|
907
|
+
(b(!0), y(le, null, ke(v.value, (T) => (b(), y("button", {
|
|
908
|
+
key: T.value,
|
|
909
|
+
class: $(["vf-select__option", { "is-active": x(T), "is-disabled": T.disabled }]),
|
|
910
910
|
type: "button",
|
|
911
911
|
role: "option",
|
|
912
|
-
disabled:
|
|
913
|
-
"aria-selected":
|
|
914
|
-
onClick: (
|
|
915
|
-
},
|
|
916
|
-
], 8,
|
|
917
|
-
[
|
|
912
|
+
disabled: T.disabled,
|
|
913
|
+
"aria-selected": x(T),
|
|
914
|
+
onClick: (U) => H(T)
|
|
915
|
+
}, E(T.label), 11, Ro))), 128))
|
|
916
|
+
], 8, To), [
|
|
917
|
+
[fe, n.value]
|
|
918
918
|
])
|
|
919
919
|
]))
|
|
920
920
|
], 2));
|
|
921
921
|
}
|
|
922
|
-
}),
|
|
922
|
+
}), Vo = ["checked", "disabled"], Lo = {
|
|
923
923
|
key: 0,
|
|
924
924
|
class: "vf-checkbox__label"
|
|
925
|
-
},
|
|
925
|
+
}, kt = /* @__PURE__ */ K({
|
|
926
926
|
__name: "checkbox",
|
|
927
927
|
props: {
|
|
928
928
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -930,16 +930,16 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
930
930
|
disabled: { type: Boolean, default: !1 }
|
|
931
931
|
},
|
|
932
932
|
emits: ["update:modelValue", "change"],
|
|
933
|
-
setup(
|
|
934
|
-
const r = e,
|
|
933
|
+
setup(o, { emit: e }) {
|
|
934
|
+
const r = e, t = o, l = _(() => {
|
|
935
935
|
const s = ["vf-checkbox"];
|
|
936
|
-
return
|
|
936
|
+
return t.disabled && s.push("vf-checkbox_disabled"), s;
|
|
937
937
|
}), c = (s) => {
|
|
938
938
|
const i = s.target;
|
|
939
939
|
r("update:modelValue", i.checked), r("change", s);
|
|
940
940
|
};
|
|
941
|
-
return (s, i) => (b(),
|
|
942
|
-
class:
|
|
941
|
+
return (s, i) => (b(), y("label", {
|
|
942
|
+
class: $(l.value)
|
|
943
943
|
}, [
|
|
944
944
|
B("input", {
|
|
945
945
|
class: "vf-checkbox__control",
|
|
@@ -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, Vo),
|
|
951
951
|
i[0] || (i[0] = B("span", { class: "vf-checkbox__box" }, null, -1)),
|
|
952
|
-
s.label || s.$slots.default ? (b(),
|
|
953
|
-
|
|
954
|
-
|
|
952
|
+
s.label || s.$slots.default ? (b(), y("span", Lo, [
|
|
953
|
+
C(s.$slots, "default", {}, () => [
|
|
954
|
+
oe(E(s.label), 1)
|
|
955
955
|
])
|
|
956
|
-
])) :
|
|
956
|
+
])) : w("", !0)
|
|
957
957
|
], 2));
|
|
958
958
|
}
|
|
959
|
-
}),
|
|
959
|
+
}), Wo = ["checked", "disabled"], Oo = {
|
|
960
960
|
key: 0,
|
|
961
961
|
class: "vf-switch__label"
|
|
962
|
-
},
|
|
962
|
+
}, Ct = /* @__PURE__ */ K({
|
|
963
963
|
__name: "switch",
|
|
964
964
|
props: {
|
|
965
965
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -967,16 +967,16 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
967
967
|
disabled: { type: Boolean, default: !1 }
|
|
968
968
|
},
|
|
969
969
|
emits: ["update:modelValue", "change"],
|
|
970
|
-
setup(
|
|
971
|
-
const r = e,
|
|
970
|
+
setup(o, { emit: e }) {
|
|
971
|
+
const r = e, t = o, l = _(() => {
|
|
972
972
|
const s = ["vf-switch"];
|
|
973
|
-
return
|
|
973
|
+
return t.disabled && s.push("vf-switch_disabled"), s;
|
|
974
974
|
}), c = (s) => {
|
|
975
975
|
const i = s.target;
|
|
976
976
|
r("update:modelValue", i.checked), r("change", s);
|
|
977
977
|
};
|
|
978
|
-
return (s, i) => (b(),
|
|
979
|
-
class:
|
|
978
|
+
return (s, i) => (b(), y("label", {
|
|
979
|
+
class: $(l.value)
|
|
980
980
|
}, [
|
|
981
981
|
B("input", {
|
|
982
982
|
class: "vf-switch__control",
|
|
@@ -984,227 +984,369 @@ const et = (t, e) => t.strategy ? t.strategy : Qe(e) ? "fixed" : "absolute", Y =
|
|
|
984
984
|
checked: s.modelValue,
|
|
985
985
|
disabled: s.disabled,
|
|
986
986
|
onChange: c
|
|
987
|
-
}, null, 40,
|
|
987
|
+
}, null, 40, Wo),
|
|
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(),
|
|
992
|
-
|
|
993
|
-
|
|
991
|
+
s.label || s.$slots.default ? (b(), y("span", Oo, [
|
|
992
|
+
C(s.$slots, "default", {}, () => [
|
|
993
|
+
oe(E(s.label), 1)
|
|
994
994
|
])
|
|
995
|
-
])) :
|
|
995
|
+
])) : w("", !0)
|
|
996
996
|
], 2));
|
|
997
997
|
}
|
|
998
|
-
}),
|
|
998
|
+
}), Eo = { class: "vf-popover" }, Ho = ["aria-expanded", "onKeydown"], wt = /* @__PURE__ */ K({
|
|
999
999
|
__name: "popover",
|
|
1000
1000
|
emits: ["click", "onClick"],
|
|
1001
|
-
setup(
|
|
1002
|
-
const
|
|
1001
|
+
setup(o, { expose: e, emit: r }) {
|
|
1002
|
+
const t = r, l = Ve({ visible: !1 });
|
|
1003
1003
|
let c = 0;
|
|
1004
|
-
const s = `vf-popover-panel-${++c}`, i = () =>
|
|
1005
|
-
u(),
|
|
1004
|
+
const s = `vf-popover-panel-${++c}`, i = () => l.visible = !0, n = () => l.visible = !1, u = () => l.visible = !l.visible, d = () => {
|
|
1005
|
+
u(), t("click"), t("onClick");
|
|
1006
1006
|
};
|
|
1007
|
-
return e({ show: i, hide:
|
|
1007
|
+
return e({ show: i, hide: n, toggle: u }), (a, f) => (b(), y("div", Eo, [
|
|
1008
1008
|
B("div", {
|
|
1009
1009
|
class: "vf-popover__button",
|
|
1010
1010
|
role: "button",
|
|
1011
1011
|
tabindex: "0",
|
|
1012
1012
|
"aria-haspopup": "dialog",
|
|
1013
|
-
"aria-expanded":
|
|
1013
|
+
"aria-expanded": l.visible,
|
|
1014
1014
|
"aria-controls": s,
|
|
1015
1015
|
onClick: d,
|
|
1016
1016
|
onKeydown: [
|
|
1017
|
-
|
|
1018
|
-
|
|
1017
|
+
Z(J(d, ["prevent"]), ["enter"]),
|
|
1018
|
+
Z(J(d, ["prevent"]), ["space"])
|
|
1019
1019
|
]
|
|
1020
1020
|
}, [
|
|
1021
|
-
|
|
1022
|
-
], 40,
|
|
1023
|
-
|
|
1021
|
+
C(a.$slots, "button")
|
|
1022
|
+
], 40, Ho),
|
|
1023
|
+
ue(Ce(Xe, {
|
|
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:
|
|
1035
|
-
|
|
1034
|
+
fn: Y(() => [
|
|
1035
|
+
C(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:
|
|
1042
|
-
|
|
1043
|
-
a.$slots.header ?
|
|
1041
|
+
fn: Y(() => [
|
|
1042
|
+
C(a.$slots, "header"),
|
|
1043
|
+
a.$slots.header ? w("", !0) : C(a.$slots, "popoverHeader", { key: 0 })
|
|
1044
1044
|
]),
|
|
1045
1045
|
key: "1"
|
|
1046
1046
|
} : void 0,
|
|
1047
1047
|
a.$slots.body || a.$slots.popoverBody ? {
|
|
1048
1048
|
name: "body",
|
|
1049
|
-
fn:
|
|
1050
|
-
|
|
1051
|
-
a.$slots.body ?
|
|
1049
|
+
fn: Y(() => [
|
|
1050
|
+
C(a.$slots, "body"),
|
|
1051
|
+
a.$slots.body ? w("", !0) : C(a.$slots, "popoverBody", { key: 0 })
|
|
1052
1052
|
]),
|
|
1053
1053
|
key: "2"
|
|
1054
1054
|
} : void 0,
|
|
1055
1055
|
a.$slots.footer || a.$slots.popoverFooter ? {
|
|
1056
1056
|
name: "footer",
|
|
1057
|
-
fn:
|
|
1058
|
-
|
|
1059
|
-
a.$slots.footer ?
|
|
1057
|
+
fn: Y(() => [
|
|
1058
|
+
C(a.$slots, "footer"),
|
|
1059
|
+
a.$slots.footer ? w("", !0) : C(a.$slots, "popoverFooter", { key: 0 })
|
|
1060
1060
|
]),
|
|
1061
1061
|
key: "3"
|
|
1062
1062
|
} : void 0
|
|
1063
1063
|
]), 1536), [
|
|
1064
|
-
[
|
|
1064
|
+
[fe, l.visible]
|
|
1065
|
+
])
|
|
1066
|
+
]));
|
|
1067
|
+
}
|
|
1068
|
+
}), Mo = ["aria-labelledby", "aria-describedby"], Po = {
|
|
1069
|
+
key: 0,
|
|
1070
|
+
class: "vf-modal__header"
|
|
1071
|
+
}, Ao = {
|
|
1072
|
+
key: 0,
|
|
1073
|
+
class: "vf-modal__title"
|
|
1074
|
+
}, Do = {
|
|
1075
|
+
key: 3,
|
|
1076
|
+
class: "vf-modal__footer"
|
|
1077
|
+
}, _t = /* @__PURE__ */ K({
|
|
1078
|
+
__name: "modal",
|
|
1079
|
+
props: {
|
|
1080
|
+
modelValue: { type: Boolean, default: !1 },
|
|
1081
|
+
title: { default: "" },
|
|
1082
|
+
closeOnOverlay: { type: Boolean, default: !0 },
|
|
1083
|
+
closeOnEsc: { type: Boolean, default: !0 },
|
|
1084
|
+
showClose: { type: Boolean, default: !0 },
|
|
1085
|
+
lockScroll: { type: Boolean, default: !0 },
|
|
1086
|
+
size: { default: "md" }
|
|
1087
|
+
},
|
|
1088
|
+
emits: ["update:modelValue", "open", "close"],
|
|
1089
|
+
setup(o, { expose: e, emit: r }) {
|
|
1090
|
+
const t = r, l = o;
|
|
1091
|
+
let c = 0, s = 0, i = "", n = null;
|
|
1092
|
+
const u = j(null), d = We(), a = `vf-modal-title-${++c}`, f = `vf-modal-body-${c}`, v = _(() => !!l.title || !!d.header), p = _(() => !!d.body || !!d.default), k = _(() => {
|
|
1093
|
+
const h = ["vf-modal"];
|
|
1094
|
+
return l.size !== "md" && h.push(`vf-modal_${l.size}`), h;
|
|
1095
|
+
}), m = () => t("update:modelValue", !0), x = () => {
|
|
1096
|
+
t("update:modelValue", !1), t("close");
|
|
1097
|
+
}, H = () => {
|
|
1098
|
+
l.closeOnOverlay && x();
|
|
1099
|
+
}, z = (h) => {
|
|
1100
|
+
!l.modelValue || !l.closeOnEsc || h.key === "Escape" && (h.preventDefault(), x());
|
|
1101
|
+
}, S = () => u.value ? Array.from(u.value.querySelectorAll('a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])')).filter((g) => !g.hasAttribute("disabled") && !g.getAttribute("aria-hidden")) : [], L = () => {
|
|
1102
|
+
var g;
|
|
1103
|
+
const h = S();
|
|
1104
|
+
h.length ? h[0].focus() : (g = u.value) == null || g.focus();
|
|
1105
|
+
}, M = (h) => {
|
|
1106
|
+
var ne;
|
|
1107
|
+
if (h.key !== "Tab")
|
|
1108
|
+
return;
|
|
1109
|
+
const g = S();
|
|
1110
|
+
if (!g.length) {
|
|
1111
|
+
h.preventDefault(), (ne = u.value) == null || ne.focus();
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
const F = g[0], T = g[g.length - 1], U = document.activeElement;
|
|
1115
|
+
if (h.shiftKey && U === F) {
|
|
1116
|
+
h.preventDefault(), T.focus();
|
|
1117
|
+
return;
|
|
1118
|
+
}
|
|
1119
|
+
!h.shiftKey && U === T && (h.preventDefault(), F.focus());
|
|
1120
|
+
}, R = () => {
|
|
1121
|
+
!l.lockScroll || typeof document > "u" || (s === 0 && (i = document.body.style.overflow, document.body.style.overflow = "hidden"), s += 1);
|
|
1122
|
+
}, W = () => {
|
|
1123
|
+
!l.lockScroll || typeof document > "u" || (s = Math.max(0, s - 1), s === 0 && (document.body.style.overflow = i));
|
|
1124
|
+
};
|
|
1125
|
+
return re(
|
|
1126
|
+
() => l.modelValue,
|
|
1127
|
+
async (h) => {
|
|
1128
|
+
h ? (typeof document < "u" && (n = document.activeElement), R(), t("open"), await ce(), L(), typeof document < "u" && document.addEventListener("keydown", z)) : (W(), typeof document < "u" && (document.removeEventListener("keydown", z), n == null || n.focus()));
|
|
1129
|
+
},
|
|
1130
|
+
{ immediate: !0 }
|
|
1131
|
+
), we(() => {
|
|
1132
|
+
W(), typeof document < "u" && document.removeEventListener("keydown", z);
|
|
1133
|
+
}), e({ open: m, close: x }), (h, g) => (b(), O(_e, { to: "body" }, [
|
|
1134
|
+
ue(B("div", {
|
|
1135
|
+
class: $(k.value),
|
|
1136
|
+
role: "presentation"
|
|
1137
|
+
}, [
|
|
1138
|
+
B("div", {
|
|
1139
|
+
class: "vf-modal__overlay",
|
|
1140
|
+
onClick: H
|
|
1141
|
+
}),
|
|
1142
|
+
B("div", {
|
|
1143
|
+
ref_key: "panel",
|
|
1144
|
+
ref: u,
|
|
1145
|
+
class: "vf-modal__panel",
|
|
1146
|
+
role: "dialog",
|
|
1147
|
+
"aria-modal": "true",
|
|
1148
|
+
"aria-labelledby": v.value ? a : void 0,
|
|
1149
|
+
"aria-describedby": p.value ? f : void 0,
|
|
1150
|
+
tabindex: "-1",
|
|
1151
|
+
onKeydown: M
|
|
1152
|
+
}, [
|
|
1153
|
+
v.value ? (b(), y("div", Po, [
|
|
1154
|
+
B("div", {
|
|
1155
|
+
id: a,
|
|
1156
|
+
class: "vf-modal__header-content"
|
|
1157
|
+
}, [
|
|
1158
|
+
C(h.$slots, "header", {}, () => [
|
|
1159
|
+
h.title ? (b(), y("h3", Ao, E(h.title), 1)) : w("", !0)
|
|
1160
|
+
])
|
|
1161
|
+
])
|
|
1162
|
+
])) : w("", !0),
|
|
1163
|
+
h.showClose ? C(h.$slots, "close", {
|
|
1164
|
+
key: 1,
|
|
1165
|
+
close: x
|
|
1166
|
+
}, () => [
|
|
1167
|
+
B("button", {
|
|
1168
|
+
type: "button",
|
|
1169
|
+
class: "vf-modal__close",
|
|
1170
|
+
"aria-label": "Close",
|
|
1171
|
+
onClick: x
|
|
1172
|
+
}, "×")
|
|
1173
|
+
]) : w("", !0),
|
|
1174
|
+
h.$slots.body || h.$slots.default ? (b(), y("div", {
|
|
1175
|
+
key: 2,
|
|
1176
|
+
id: f,
|
|
1177
|
+
class: "vf-modal__body"
|
|
1178
|
+
}, [
|
|
1179
|
+
C(h.$slots, "body"),
|
|
1180
|
+
h.$slots.body ? w("", !0) : C(h.$slots, "default", { key: 0 })
|
|
1181
|
+
])) : w("", !0),
|
|
1182
|
+
h.$slots.footer ? (b(), y("div", Do, [
|
|
1183
|
+
C(h.$slots, "footer")
|
|
1184
|
+
])) : w("", !0)
|
|
1185
|
+
], 40, Mo)
|
|
1186
|
+
], 2), [
|
|
1187
|
+
[fe, h.modelValue]
|
|
1065
1188
|
])
|
|
1066
1189
|
]));
|
|
1067
1190
|
}
|
|
1068
|
-
}),
|
|
1069
|
-
const e =
|
|
1191
|
+
}), Io = ["dark", "light", "theme", "preset", "colors", "components", "colorScheme"], jo = (o) => {
|
|
1192
|
+
const e = o.replace(/([A-Z])/g, "-$1");
|
|
1070
1193
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1071
|
-
},
|
|
1072
|
-
if (!
|
|
1194
|
+
}, No = (o) => o.filter((e) => !Io.includes(e)).map((e) => jo(e)).join("-").toLowerCase(), de = (o) => o.join("."), Ko = (o) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(o), ve = (o) => {
|
|
1195
|
+
if (!Ko(o))
|
|
1073
1196
|
return null;
|
|
1074
|
-
if (
|
|
1075
|
-
const e =
|
|
1076
|
-
return `#${e}${e}${r}${r}${
|
|
1197
|
+
if (o.length === 4) {
|
|
1198
|
+
const e = o[1], r = o[2], t = o[3];
|
|
1199
|
+
return `#${e}${e}${r}${r}${t}${t}`;
|
|
1077
1200
|
}
|
|
1078
|
-
return
|
|
1079
|
-
},
|
|
1080
|
-
const e =
|
|
1201
|
+
return o.toLowerCase();
|
|
1202
|
+
}, Be = (o) => {
|
|
1203
|
+
const e = ve(o);
|
|
1081
1204
|
if (!e)
|
|
1082
1205
|
return [0, 0, 0];
|
|
1083
|
-
const r = parseInt(e.slice(1), 16),
|
|
1084
|
-
return [
|
|
1085
|
-
},
|
|
1086
|
-
const [e, r,
|
|
1087
|
-
return `${e}, ${r}, ${
|
|
1088
|
-
},
|
|
1089
|
-
const
|
|
1206
|
+
const r = parseInt(e.slice(1), 16), t = r >> 16 & 255, l = r >> 8 & 255, c = r & 255;
|
|
1207
|
+
return [t, l, c];
|
|
1208
|
+
}, he = (o) => {
|
|
1209
|
+
const [e, r, t] = Be(o);
|
|
1210
|
+
return `${e}, ${r}, ${t}`;
|
|
1211
|
+
}, Xo = (o, e, r) => {
|
|
1212
|
+
const t = o / 255, l = e / 255, c = r / 255, s = Math.max(t, l, c), i = Math.min(t, l, c), n = s - i;
|
|
1090
1213
|
let u = 0, d = 0;
|
|
1091
1214
|
const a = (s + i) / 2;
|
|
1092
|
-
if (
|
|
1093
|
-
switch (d =
|
|
1094
|
-
case
|
|
1095
|
-
u = (
|
|
1215
|
+
if (n !== 0) {
|
|
1216
|
+
switch (d = n / (1 - Math.abs(2 * a - 1)), s) {
|
|
1217
|
+
case t:
|
|
1218
|
+
u = (l - c) / n % 6;
|
|
1096
1219
|
break;
|
|
1097
|
-
case
|
|
1098
|
-
u = (c -
|
|
1220
|
+
case l:
|
|
1221
|
+
u = (c - t) / n + 2;
|
|
1099
1222
|
break;
|
|
1100
1223
|
case c:
|
|
1101
|
-
u = (
|
|
1224
|
+
u = (t - l) / n + 4;
|
|
1102
1225
|
break;
|
|
1103
1226
|
}
|
|
1104
1227
|
u *= 60, u < 0 && (u += 360);
|
|
1105
1228
|
}
|
|
1106
1229
|
return [u, d * 100, a * 100];
|
|
1107
|
-
},
|
|
1108
|
-
const
|
|
1109
|
-
let
|
|
1110
|
-
|
|
1111
|
-
const a = Math.round((
|
|
1112
|
-
return [a,
|
|
1113
|
-
},
|
|
1114
|
-
const r =
|
|
1230
|
+
}, Yo = (o, e, r) => {
|
|
1231
|
+
const t = e / 100, l = r / 100, c = (1 - Math.abs(2 * l - 1)) * t, s = c * (1 - Math.abs(o / 60 % 2 - 1)), i = l - c / 2;
|
|
1232
|
+
let n = 0, u = 0, d = 0;
|
|
1233
|
+
o >= 0 && o < 60 ? (n = c, u = s, d = 0) : o >= 60 && o < 120 ? (n = s, u = c, d = 0) : o >= 120 && o < 180 ? (n = 0, u = c, d = s) : o >= 180 && o < 240 ? (n = 0, u = s, d = c) : o >= 240 && o < 300 ? (n = s, u = 0, d = c) : (n = c, u = 0, d = s);
|
|
1234
|
+
const a = Math.round((n + i) * 255), f = Math.round((u + i) * 255), v = Math.round((d + i) * 255);
|
|
1235
|
+
return [a, f, v];
|
|
1236
|
+
}, Go = (o, e, r) => `#${[o, e, r].map((t) => t.toString(16).padStart(2, "0")).join("")}`, qo = (o, e, r) => Math.min(r, Math.max(e, o)), Uo = (o, e) => {
|
|
1237
|
+
const r = ve(o);
|
|
1115
1238
|
if (!r)
|
|
1116
|
-
return
|
|
1117
|
-
const [
|
|
1118
|
-
return
|
|
1119
|
-
},
|
|
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;
|
|
1127
|
-
}, se = (t) => !!t && typeof t == "object" && !Array.isArray(t), ce = (t, e) => {
|
|
1239
|
+
return o;
|
|
1240
|
+
const [t, l, c] = Be(r), [s, i, n] = Xo(t, l, c), d = (e - 5) * 7, a = qo(n + d, 0, 100), [f, v, p] = Yo(s, i, a);
|
|
1241
|
+
return Go(f, v, p);
|
|
1242
|
+
}, ie = (o) => !!o && typeof o == "object" && !Array.isArray(o), pe = (o, e) => {
|
|
1128
1243
|
if (!e)
|
|
1129
|
-
return { ...
|
|
1130
|
-
const r = { ...
|
|
1131
|
-
for (const
|
|
1132
|
-
const
|
|
1133
|
-
|
|
1244
|
+
return { ...o };
|
|
1245
|
+
const r = { ...o };
|
|
1246
|
+
for (const t in e) {
|
|
1247
|
+
const l = e[t], c = o[t];
|
|
1248
|
+
ie(c) && ie(l) ? r[t] = pe(c, l) : r[t] = l;
|
|
1134
1249
|
}
|
|
1135
1250
|
return r;
|
|
1136
|
-
},
|
|
1137
|
-
if (!
|
|
1251
|
+
}, Zo = (o) => {
|
|
1252
|
+
if (!o)
|
|
1138
1253
|
return null;
|
|
1139
|
-
if (
|
|
1140
|
-
const e =
|
|
1254
|
+
if (ie(o) && "preset" in o) {
|
|
1255
|
+
const e = o;
|
|
1141
1256
|
return {
|
|
1142
1257
|
preset: e.preset ?? {},
|
|
1143
1258
|
overrides: e.overrides,
|
|
1144
1259
|
selector: e.selector,
|
|
1145
|
-
darkSelector: e.darkSelector
|
|
1260
|
+
darkSelector: e.darkSelector,
|
|
1261
|
+
strict: e.strict
|
|
1146
1262
|
};
|
|
1147
1263
|
}
|
|
1148
|
-
return { preset:
|
|
1149
|
-
},
|
|
1150
|
-
const e = [], r = [],
|
|
1264
|
+
return { preset: o };
|
|
1265
|
+
}, Jo = (o) => {
|
|
1266
|
+
const e = [], r = [], t = [], l = [], c = (n) => t.push(n), s = (n) => l.push(n), i = (n, u) => {
|
|
1151
1267
|
if (!(!n || typeof n != "object"))
|
|
1152
|
-
for (const
|
|
1153
|
-
const
|
|
1154
|
-
if (
|
|
1155
|
-
|
|
1268
|
+
for (const d in n) {
|
|
1269
|
+
const a = n[d], f = u.concat([d]);
|
|
1270
|
+
if (ie(a)) {
|
|
1271
|
+
i(a, f);
|
|
1156
1272
|
continue;
|
|
1157
1273
|
}
|
|
1158
|
-
if (typeof
|
|
1274
|
+
if (a && typeof a == "object") {
|
|
1275
|
+
s(`Theme value "${de(f)}" is not a plain object or string and will be ignored.`);
|
|
1159
1276
|
continue;
|
|
1160
|
-
|
|
1161
|
-
if (
|
|
1162
|
-
|
|
1163
|
-
|
|
1277
|
+
}
|
|
1278
|
+
if (typeof a != "string") {
|
|
1279
|
+
s(`Theme value "${de(f)}" is not a string and will be ignored.`);
|
|
1280
|
+
continue;
|
|
1281
|
+
}
|
|
1282
|
+
const p = f.includes("colorScheme") && f.includes("dark") ? r : e, k = No(f);
|
|
1283
|
+
if (p.push(`--vf-${k}: ${a}`), f.includes("colors")) {
|
|
1284
|
+
const m = ve(a);
|
|
1285
|
+
if (!m) {
|
|
1286
|
+
c(
|
|
1287
|
+
`Theme color "${de(f)}" is not hex. Shade variables will not be generated for it.`
|
|
1288
|
+
);
|
|
1164
1289
|
continue;
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1290
|
+
}
|
|
1291
|
+
if (p.push(`--vf-${k}-rgb: ${he(m)}`), d !== "white")
|
|
1292
|
+
for (let x = 1; x < 10; ++x) {
|
|
1293
|
+
const H = Uo(m, x);
|
|
1294
|
+
p.push(`--vf-${k}-${x}00: ${H}`), p.push(`--vf-${k}-${x}00-rgb: ${he(H)}`);
|
|
1169
1295
|
}
|
|
1170
1296
|
}
|
|
1171
1297
|
}
|
|
1172
1298
|
};
|
|
1173
|
-
return o
|
|
1174
|
-
},
|
|
1175
|
-
|
|
1176
|
-
|
|
1299
|
+
return i(o, []), { baseVars: e, darkVars: r, warnings: t, errors: l };
|
|
1300
|
+
}, Qo = (o) => {
|
|
1301
|
+
if (typeof document > "u")
|
|
1302
|
+
return null;
|
|
1303
|
+
const e = document.getElementById(o);
|
|
1304
|
+
if (e && e.tagName.toLowerCase() === "style")
|
|
1305
|
+
return e;
|
|
1306
|
+
const r = document.createElement("style");
|
|
1307
|
+
return r.id = o, document.head.appendChild(r), r;
|
|
1308
|
+
}, et = (o) => ({
|
|
1309
|
+
selector: o.selector ?? ":root",
|
|
1310
|
+
darkSelector: o.darkSelector ?? ":root[data-theme=dark]"
|
|
1311
|
+
}), ot = (o, e, r, t) => {
|
|
1312
|
+
const { baseVars: l, darkVars: c, warnings: s, errors: i } = Jo(o), n = Qo("vueforge-theme");
|
|
1313
|
+
if (!n)
|
|
1177
1314
|
return;
|
|
1178
|
-
|
|
1179
|
-
|
|
1315
|
+
if (i.length) {
|
|
1316
|
+
if (t)
|
|
1317
|
+
throw new Error(`[VueForge] ${i.join(" ")}`);
|
|
1318
|
+
for (const d of i)
|
|
1319
|
+
console.warn(`[VueForge] ${d}`);
|
|
1320
|
+
}
|
|
1321
|
+
if (s.length)
|
|
1322
|
+
for (const d of s)
|
|
1323
|
+
console.warn(`[VueForge] ${d}`);
|
|
1324
|
+
const u = [];
|
|
1325
|
+
l.length && u.push(`${e} { ${l.join(";")} }`), c.length && u.push(`${r} { ${c.join(";")} }`), n.textContent = u.join(`
|
|
1180
1326
|
`);
|
|
1181
1327
|
};
|
|
1182
|
-
let
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1185
|
-
darkSelector: t.darkSelector ?? ":root[data-theme=dark]"
|
|
1186
|
-
}), Fe = (t) => {
|
|
1187
|
-
const e = _e(t);
|
|
1328
|
+
let N = null;
|
|
1329
|
+
const xe = (o) => {
|
|
1330
|
+
const e = Zo(o);
|
|
1188
1331
|
if (!e)
|
|
1189
1332
|
return;
|
|
1190
|
-
const r =
|
|
1191
|
-
|
|
1192
|
-
},
|
|
1193
|
-
if (!
|
|
1333
|
+
const r = pe(e.preset, e.overrides), { selector: t, darkSelector: l } = et(e);
|
|
1334
|
+
N = { ...e }, ot(r, t, l, e.strict);
|
|
1335
|
+
}, $t = (o) => {
|
|
1336
|
+
if (!N)
|
|
1194
1337
|
return;
|
|
1195
|
-
const e =
|
|
1196
|
-
preset:
|
|
1338
|
+
const e = o.overrides === void 0 ? N.overrides : pe(N.overrides ?? {}, o.overrides ?? {}), r = {
|
|
1339
|
+
preset: o.preset ?? N.preset,
|
|
1197
1340
|
overrides: e,
|
|
1198
|
-
selector:
|
|
1199
|
-
darkSelector:
|
|
1341
|
+
selector: o.selector ?? N.selector,
|
|
1342
|
+
darkSelector: o.darkSelector ?? N.darkSelector
|
|
1200
1343
|
};
|
|
1201
|
-
|
|
1202
|
-
},
|
|
1203
|
-
install(
|
|
1204
|
-
|
|
1205
|
-
r && Fe(r);
|
|
1344
|
+
xe(r);
|
|
1345
|
+
}, Ft = () => N ? { ...N } : null, Bt = {
|
|
1346
|
+
install(o, e = {}) {
|
|
1347
|
+
e.theme && xe(e.theme);
|
|
1206
1348
|
}
|
|
1207
|
-
},
|
|
1349
|
+
}, me = {
|
|
1208
1350
|
colors: {
|
|
1209
1351
|
white: "#ffffff",
|
|
1210
1352
|
green: "#0cbc87",
|
|
@@ -1234,6 +1376,18 @@ const Gt = (t) => ({
|
|
|
1234
1376
|
disabledOpacity: "0.6",
|
|
1235
1377
|
focusRingShadow: "0 0 0 3px rgba(var(--vf-blue-600-rgb), 0.12)"
|
|
1236
1378
|
},
|
|
1379
|
+
sizes: {
|
|
1380
|
+
sm: {
|
|
1381
|
+
fontSize: "0.875rem",
|
|
1382
|
+
paddingY: "0.2rem",
|
|
1383
|
+
paddingX: "0.5rem"
|
|
1384
|
+
},
|
|
1385
|
+
lg: {
|
|
1386
|
+
fontSize: "1.125rem",
|
|
1387
|
+
paddingY: "0.5rem",
|
|
1388
|
+
paddingX: "1rem"
|
|
1389
|
+
}
|
|
1390
|
+
},
|
|
1237
1391
|
colorScheme: {
|
|
1238
1392
|
light: {
|
|
1239
1393
|
bgColor: "#ffffff",
|
|
@@ -1254,19 +1408,19 @@ const Gt = (t) => ({
|
|
|
1254
1408
|
dividerColor: "#2e2e32"
|
|
1255
1409
|
}
|
|
1256
1410
|
}
|
|
1257
|
-
},
|
|
1411
|
+
}, tt = {
|
|
1258
1412
|
fontSize: "var(--vf-typography-font-size)",
|
|
1259
1413
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
1260
1414
|
borderRadius: "var(--vf-radii-md)",
|
|
1261
1415
|
roundedBorderRadius: "2rem",
|
|
1262
1416
|
iconGap: "6px",
|
|
1263
1417
|
small: {
|
|
1264
|
-
fontSize: "
|
|
1265
|
-
padding: "
|
|
1418
|
+
fontSize: "var(--vf-sizes-sm-font-size)",
|
|
1419
|
+
padding: "var(--vf-sizes-sm-padding-y) var(--vf-sizes-sm-padding-x)"
|
|
1266
1420
|
},
|
|
1267
1421
|
large: {
|
|
1268
|
-
fontSize: "
|
|
1269
|
-
padding: "
|
|
1422
|
+
fontSize: "var(--vf-sizes-lg-font-size)",
|
|
1423
|
+
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)"
|
|
1270
1424
|
},
|
|
1271
1425
|
colorScheme: {
|
|
1272
1426
|
light: {
|
|
@@ -1396,11 +1550,11 @@ const Gt = (t) => ({
|
|
|
1396
1550
|
}
|
|
1397
1551
|
}
|
|
1398
1552
|
}
|
|
1399
|
-
},
|
|
1553
|
+
}, rt = {
|
|
1400
1554
|
padding: "12px",
|
|
1401
1555
|
borderColor: "var(--vf-border-color)",
|
|
1402
1556
|
borderRadius: "var(--vf-radii-md)"
|
|
1403
|
-
},
|
|
1557
|
+
}, lt = {}, nt = {
|
|
1404
1558
|
gap: "0.5rem",
|
|
1405
1559
|
fontSize: "var(--vf-typography-font-size)",
|
|
1406
1560
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
@@ -1414,17 +1568,17 @@ const Gt = (t) => ({
|
|
|
1414
1568
|
hoverBorderColor: "var(--vf-blue-500)",
|
|
1415
1569
|
disabledOpacity: "var(--vf-states-disabled-opacity)",
|
|
1416
1570
|
small: {
|
|
1417
|
-
padding: "
|
|
1418
|
-
fontSize: "
|
|
1571
|
+
padding: "var(--vf-sizes-sm-padding-y) var(--vf-sizes-sm-padding-x)",
|
|
1572
|
+
fontSize: "var(--vf-sizes-sm-font-size)"
|
|
1419
1573
|
},
|
|
1420
1574
|
large: {
|
|
1421
|
-
padding: "
|
|
1422
|
-
fontSize: "
|
|
1575
|
+
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
1576
|
+
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
1423
1577
|
}
|
|
1424
|
-
},
|
|
1578
|
+
}, at = {
|
|
1425
1579
|
hoverColor: "var(--vf-blue)",
|
|
1426
1580
|
activeColor: "var(--vf-blue)"
|
|
1427
|
-
},
|
|
1581
|
+
}, st = {
|
|
1428
1582
|
iconGap: "6px",
|
|
1429
1583
|
submenuOffset: "12px",
|
|
1430
1584
|
separatorThickness: "1px",
|
|
@@ -1444,9 +1598,36 @@ const Gt = (t) => ({
|
|
|
1444
1598
|
marginBottom: "0.5rem",
|
|
1445
1599
|
marginLeft: "0.5rem"
|
|
1446
1600
|
}
|
|
1447
|
-
},
|
|
1601
|
+
}, it = {
|
|
1602
|
+
width: "90vw",
|
|
1603
|
+
maxWidth: "520px",
|
|
1604
|
+
maxHeight: "80vh",
|
|
1605
|
+
widthSm: "90vw",
|
|
1606
|
+
maxWidthSm: "420px",
|
|
1607
|
+
widthLg: "90vw",
|
|
1608
|
+
maxWidthLg: "720px",
|
|
1609
|
+
padding: "1.25rem",
|
|
1610
|
+
borderRadius: "var(--vf-radii-lg)",
|
|
1611
|
+
backgroundColor: "var(--vf-bg-color)",
|
|
1612
|
+
textColor: "var(--vf-text-color)",
|
|
1613
|
+
overlayBackgroundColor: "rgba(0, 0, 0, 0.45)",
|
|
1614
|
+
shadow: "0 12px 40px rgba(0, 0, 0, 0.2)",
|
|
1615
|
+
zIndex: "100",
|
|
1616
|
+
headerGap: "0.75rem",
|
|
1617
|
+
bodyGap: "1rem",
|
|
1618
|
+
footerGap: "0.5rem",
|
|
1619
|
+
titleFontSize: "1.125rem",
|
|
1620
|
+
titleLineHeight: "1.4",
|
|
1621
|
+
titleFontWeight: "600",
|
|
1622
|
+
closeSize: "2rem",
|
|
1623
|
+
closeRadius: "999px",
|
|
1624
|
+
closeOffset: "0.5rem",
|
|
1625
|
+
closeColor: "var(--vf-text-color)",
|
|
1626
|
+
closeFontSize: "1.25rem",
|
|
1627
|
+
closeHoverBackgroundColor: "rgba(0, 0, 0, 0.06)"
|
|
1628
|
+
}, dt = {
|
|
1448
1629
|
backgroundColor: "var(--vf-bg-color)"
|
|
1449
|
-
},
|
|
1630
|
+
}, ct = {
|
|
1450
1631
|
minWidth: "12rem",
|
|
1451
1632
|
fontSize: "var(--vf-typography-font-size)",
|
|
1452
1633
|
controlGap: "0.75rem",
|
|
@@ -1472,14 +1653,14 @@ const Gt = (t) => ({
|
|
|
1472
1653
|
optionActiveBackgroundColor: "rgba(var(--vf-blue-600-rgb), 0.14)",
|
|
1473
1654
|
optionActiveTextColor: "var(--vf-text-color)",
|
|
1474
1655
|
small: {
|
|
1475
|
-
padding: "
|
|
1476
|
-
fontSize: "
|
|
1656
|
+
padding: "var(--vf-sizes-sm-padding-y) var(--vf-sizes-sm-padding-x)",
|
|
1657
|
+
fontSize: "var(--vf-sizes-sm-font-size)"
|
|
1477
1658
|
},
|
|
1478
1659
|
large: {
|
|
1479
|
-
padding: "
|
|
1480
|
-
fontSize: "
|
|
1660
|
+
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
1661
|
+
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
1481
1662
|
}
|
|
1482
|
-
},
|
|
1663
|
+
}, ut = {
|
|
1483
1664
|
size: "1rem",
|
|
1484
1665
|
gap: "0.5rem",
|
|
1485
1666
|
borderRadius: "var(--vf-radii-sm)",
|
|
@@ -1491,7 +1672,7 @@ const Gt = (t) => ({
|
|
|
1491
1672
|
checkColor: "#ffffff",
|
|
1492
1673
|
textColor: "var(--vf-text-color)",
|
|
1493
1674
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
1494
|
-
},
|
|
1675
|
+
}, ft = {
|
|
1495
1676
|
width: "2.25rem",
|
|
1496
1677
|
height: "1.25rem",
|
|
1497
1678
|
thumbSize: "1rem",
|
|
@@ -1503,35 +1684,37 @@ const Gt = (t) => ({
|
|
|
1503
1684
|
thumbColor: "#ffffff",
|
|
1504
1685
|
textColor: "var(--vf-text-color)",
|
|
1505
1686
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
1506
|
-
},
|
|
1507
|
-
...
|
|
1687
|
+
}, xt = {
|
|
1688
|
+
...me,
|
|
1508
1689
|
components: {
|
|
1509
|
-
base:
|
|
1510
|
-
button:
|
|
1511
|
-
card:
|
|
1512
|
-
codeBlock:
|
|
1513
|
-
input:
|
|
1514
|
-
link:
|
|
1515
|
-
menu:
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1690
|
+
base: me,
|
|
1691
|
+
button: tt,
|
|
1692
|
+
card: rt,
|
|
1693
|
+
codeBlock: lt,
|
|
1694
|
+
input: nt,
|
|
1695
|
+
link: at,
|
|
1696
|
+
menu: st,
|
|
1697
|
+
modal: it,
|
|
1698
|
+
popover: dt,
|
|
1699
|
+
select: ct,
|
|
1700
|
+
checkbox: ut,
|
|
1701
|
+
switch: ft
|
|
1520
1702
|
}
|
|
1521
1703
|
};
|
|
1522
1704
|
export {
|
|
1523
|
-
|
|
1705
|
+
ht as Button,
|
|
1524
1706
|
Xe as Card,
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1707
|
+
kt as Checkbox,
|
|
1708
|
+
xt as DefaultTheme,
|
|
1709
|
+
mt as Input,
|
|
1710
|
+
$e as Link,
|
|
1711
|
+
bt as Menu,
|
|
1712
|
+
_t as Modal,
|
|
1713
|
+
wt as Popover,
|
|
1714
|
+
yt as Select,
|
|
1715
|
+
Ct as Switch,
|
|
1716
|
+
Bt as VueForge,
|
|
1717
|
+
Ft as getTheme,
|
|
1718
|
+
xe as setTheme,
|
|
1719
|
+
$t as updateTheme
|
|
1537
1720
|
};
|