@codemonster-ru/vueforge 0.14.0 → 0.15.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 +46 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.ts.mjs +1189 -921
- package/dist/index.ts.umd.js +3 -3
- package/dist/package/components/__tests__/autocomplete.test.d.ts +1 -0
- package/dist/package/components/autocomplete.vue.d.ts +55 -0
- package/dist/package/config/theme-core.d.ts +41 -0
- package/dist/package/themes/default/components/autocomplete.d.ts +41 -0
- package/dist/package/themes/default/index.d.ts +40 -0
- package/package.json +1 -1
package/dist/index.ts.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { CmIcon as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as M, ref as H, computed as y, watch as Q, resolveComponent as Me, openBlock as g, createElementBlock as C, normalizeClass as R, renderSlot as $, Fragment as fe, createTextVNode as ee, toDisplayString as A, createBlock as G, withCtx as de, createCommentVNode as L, createElementVNode as T, renderList as Fe, withKeys as J, withModifiers as U, unref as ge, createVNode as De, nextTick as we, onMounted as ze, onBeforeUnmount as ye, Teleport as Ce, withDirectives as ve, vShow as pe, provide as Ke, inject as Ve, reactive as et, createSlots as tt, useSlots as ot } from "vue";
|
|
2
|
+
import { useRoute as rt, useRouter as at } from "vue-router";
|
|
3
|
+
import { CmIcon as me } from "@codemonster-ru/vueiconify";
|
|
4
|
+
const lt = ["href", "aria-disabled", "tabindex"], Ne = /* @__PURE__ */ M({
|
|
5
5
|
__name: "link",
|
|
6
6
|
props: {
|
|
7
7
|
to: { default: void 0 },
|
|
@@ -15,96 +15,96 @@ const ot = ["href", "aria-disabled", "tabindex"], Pe = /* @__PURE__ */ I({
|
|
|
15
15
|
},
|
|
16
16
|
emits: ["click", "active", "update:active", "onActive"],
|
|
17
17
|
setup(t, { emit: e }) {
|
|
18
|
-
const r = e, o = t, a =
|
|
18
|
+
const r = e, o = t, a = rt(), u = at(), i = H(null), d = y(() => o.href ?? o.url), l = y(() => 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"), c = y(() => o.to), n = y(() => o.to ? u.resolve(o.to) : null), s = y(() => {
|
|
19
19
|
if (l.value !== "router-link")
|
|
20
20
|
return !1;
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
}),
|
|
21
|
+
const f = n.value;
|
|
22
|
+
return f ? f.name ? a.matched.some(({ name: _ }) => _ === f.name) : f.fullPath ? a.fullPath === f.fullPath : a.path === f.path : !1;
|
|
23
|
+
}), v = y(() => o.active === void 0 ? s.value : o.active), p = (f) => {
|
|
24
24
|
if (!o.disabled) {
|
|
25
|
-
r("click",
|
|
25
|
+
r("click", f);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
f.preventDefault(), f.stopPropagation();
|
|
29
29
|
};
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
}), (
|
|
33
|
-
const
|
|
30
|
+
return Q(s, (f) => {
|
|
31
|
+
f && (r("active"), r("onActive")), r("update:active", f);
|
|
32
|
+
}), (f, _) => {
|
|
33
|
+
const k = Me("router-link");
|
|
34
34
|
return l.value === "a" ? (g(), C("a", {
|
|
35
35
|
key: 0,
|
|
36
36
|
href: d.value,
|
|
37
|
-
class:
|
|
38
|
-
"aria-disabled":
|
|
39
|
-
tabindex:
|
|
37
|
+
class: R(["vf-link", { "vf-link_active": v.value, "vf-link_disabled": f.disabled }]),
|
|
38
|
+
"aria-disabled": f.disabled,
|
|
39
|
+
tabindex: f.disabled ? -1 : void 0,
|
|
40
40
|
onClick: p
|
|
41
41
|
}, [
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
f.$slots.default ? $(f.$slots, "default", { key: 0 }) : (g(), C(fe, { key: 1 }, [
|
|
43
|
+
ee(A(f.label), 1)
|
|
44
44
|
], 64))
|
|
45
|
-
], 10,
|
|
45
|
+
], 10, lt)) : (g(), G(k, {
|
|
46
46
|
key: 1,
|
|
47
47
|
ref_key: "link",
|
|
48
|
-
ref:
|
|
49
|
-
to:
|
|
50
|
-
class:
|
|
51
|
-
"aria-disabled":
|
|
52
|
-
tabindex:
|
|
48
|
+
ref: i,
|
|
49
|
+
to: c.value,
|
|
50
|
+
class: R(["vf-link", { "vf-link_active": v.value }]),
|
|
51
|
+
"aria-disabled": f.disabled,
|
|
52
|
+
tabindex: f.disabled ? -1 : void 0,
|
|
53
53
|
"active-class": "vf-link_partially-active",
|
|
54
54
|
"exact-active-class": "vf-link_active",
|
|
55
55
|
onClick: p
|
|
56
56
|
}, {
|
|
57
|
-
default:
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
default: de(() => [
|
|
58
|
+
f.$slots.default ? $(f.$slots, "default", { key: 0 }) : (g(), C(fe, { key: 1 }, [
|
|
59
|
+
ee(A(f.label), 1)
|
|
60
60
|
], 64))
|
|
61
61
|
]),
|
|
62
62
|
_: 3
|
|
63
63
|
}, 8, ["to", "class", "aria-disabled", "tabindex"]));
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
}),
|
|
66
|
+
}), nt = (t, e) => {
|
|
67
67
|
const r = t.__vccOpts || t;
|
|
68
68
|
for (const [o, a] of e)
|
|
69
69
|
r[o] = a;
|
|
70
70
|
return r;
|
|
71
|
-
},
|
|
71
|
+
}, st = {}, it = { class: "vf-card" }, dt = {
|
|
72
72
|
key: 0,
|
|
73
73
|
class: "vf-card__default"
|
|
74
|
-
},
|
|
74
|
+
}, ct = {
|
|
75
75
|
key: 1,
|
|
76
76
|
class: "vf-card__header"
|
|
77
|
-
},
|
|
77
|
+
}, ut = {
|
|
78
78
|
key: 2,
|
|
79
79
|
class: "vf-card__body"
|
|
80
|
-
},
|
|
80
|
+
}, ft = {
|
|
81
81
|
key: 3,
|
|
82
82
|
class: "vf-card__footer"
|
|
83
83
|
};
|
|
84
|
-
function
|
|
85
|
-
return g(), C("div",
|
|
86
|
-
t.$slots.default ? (g(), C("div",
|
|
87
|
-
|
|
88
|
-
])) :
|
|
89
|
-
t.$slots.header ? (g(), C("div",
|
|
90
|
-
|
|
91
|
-
])) :
|
|
92
|
-
t.$slots.body ? (g(), C("div",
|
|
93
|
-
|
|
94
|
-
])) :
|
|
95
|
-
t.$slots.footer ? (g(), C("div",
|
|
96
|
-
|
|
97
|
-
])) :
|
|
84
|
+
function vt(t, e) {
|
|
85
|
+
return g(), C("div", it, [
|
|
86
|
+
t.$slots.default ? (g(), C("div", dt, [
|
|
87
|
+
$(t.$slots, "default")
|
|
88
|
+
])) : L("", !0),
|
|
89
|
+
t.$slots.header ? (g(), C("div", ct, [
|
|
90
|
+
$(t.$slots, "header")
|
|
91
|
+
])) : L("", !0),
|
|
92
|
+
t.$slots.body ? (g(), C("div", ut, [
|
|
93
|
+
$(t.$slots, "body")
|
|
94
|
+
])) : L("", !0),
|
|
95
|
+
t.$slots.footer ? (g(), C("div", ft, [
|
|
96
|
+
$(t.$slots, "footer")
|
|
97
|
+
])) : L("", !0)
|
|
98
98
|
]);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const pt = /* @__PURE__ */ nt(st, [["render", vt]]), bt = {
|
|
101
101
|
class: "vf-menu__list",
|
|
102
102
|
role: "menu"
|
|
103
|
-
},
|
|
103
|
+
}, gt = {
|
|
104
104
|
key: 1,
|
|
105
105
|
class: "vf-menu__separator",
|
|
106
106
|
role: "separator"
|
|
107
|
-
},
|
|
107
|
+
}, mt = ["aria-expanded", "onClick", "onKeydown"], rr = /* @__PURE__ */ M({
|
|
108
108
|
name: "VfMenu",
|
|
109
109
|
__name: "menu",
|
|
110
110
|
props: {
|
|
@@ -113,87 +113,87 @@ const ut = /* @__PURE__ */ rt(at, [["render", ct]]), ft = {
|
|
|
113
113
|
},
|
|
114
114
|
emits: ["active", "onActive"],
|
|
115
115
|
setup(t, { emit: e }) {
|
|
116
|
-
const r = e, o = t, a =
|
|
117
|
-
...
|
|
118
|
-
items:
|
|
119
|
-
})), l = (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}),
|
|
123
|
-
},
|
|
124
|
-
var
|
|
125
|
-
for (const
|
|
126
|
-
const p = a.value[
|
|
127
|
-
Object.prototype.hasOwnProperty.call(p, "items") && ((
|
|
116
|
+
const r = e, o = t, a = H([]), u = (n, s) => `${n.label ?? n.to ?? n.href ?? n.url ?? "item"}_${s.toString()}`, i = (n) => n.to ? "router-link" : "a", d = (n) => n.map((s) => ({
|
|
117
|
+
...s,
|
|
118
|
+
items: s.items ? d(s.items) : void 0
|
|
119
|
+
})), l = (n) => {
|
|
120
|
+
n.items && n.items.length ? (a.value.map((s) => {
|
|
121
|
+
s !== n && (s.subMenuVisible = !1);
|
|
122
|
+
}), n.subMenuVisible = !n.subMenuVisible) : Object.prototype.hasOwnProperty.call(n, "command") && typeof n.command == "function" && n.command();
|
|
123
|
+
}, c = (n) => {
|
|
124
|
+
var s;
|
|
125
|
+
for (const v in a.value) {
|
|
126
|
+
const p = a.value[v];
|
|
127
|
+
Object.prototype.hasOwnProperty.call(p, "items") && ((s = p.items) != null && s.some((f) => f === n) ? (p.active = !0, p.subMenuVisible = !0) : (p.active = !1, p.subMenuVisible = !1));
|
|
128
128
|
}
|
|
129
|
-
r("active",
|
|
129
|
+
r("active", n), r("onActive", n);
|
|
130
130
|
};
|
|
131
|
-
return
|
|
131
|
+
return Q(
|
|
132
132
|
() => o.items,
|
|
133
|
-
(
|
|
134
|
-
a.value = d(
|
|
133
|
+
(n) => {
|
|
134
|
+
a.value = d(n);
|
|
135
135
|
},
|
|
136
136
|
{ deep: !0, immediate: !0 }
|
|
137
|
-
), (
|
|
138
|
-
const
|
|
137
|
+
), (n, s) => {
|
|
138
|
+
const v = Me("VfMenu");
|
|
139
139
|
return g(), C("div", {
|
|
140
|
-
class:
|
|
140
|
+
class: R(["vf-menu", `vf-menu_${n.orientation}`])
|
|
141
141
|
}, [
|
|
142
|
-
|
|
143
|
-
(g(!0), C(
|
|
144
|
-
key:
|
|
142
|
+
T("ul", bt, [
|
|
143
|
+
(g(!0), C(fe, null, Fe(a.value, (p, f) => (g(), C("li", {
|
|
144
|
+
key: u(p, f),
|
|
145
145
|
class: "vf-menu__item",
|
|
146
146
|
role: "none"
|
|
147
147
|
}, [
|
|
148
|
-
|
|
148
|
+
n.$slots[u(p, f)] ? $(n.$slots, u(p, f), {
|
|
149
149
|
key: 0,
|
|
150
150
|
item: { ...p, class: "vf-menu__link" }
|
|
151
|
-
}) : p.separator ? (g(), C("hr",
|
|
152
|
-
|
|
153
|
-
class:
|
|
151
|
+
}) : p.separator ? (g(), C("hr", gt)) : p.items && p.items.length ? (g(), C(fe, { key: 2 }, [
|
|
152
|
+
T("div", {
|
|
153
|
+
class: R(["vf-menu__parent", { "vf-menu__parent_active": p.active }]),
|
|
154
154
|
role: "menuitem",
|
|
155
155
|
tabindex: "0",
|
|
156
156
|
"aria-expanded": p.subMenuVisible ? "true" : "false",
|
|
157
|
-
onClick: (
|
|
157
|
+
onClick: (_) => l(p),
|
|
158
158
|
onKeydown: [
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
J(U((_) => l(p), ["prevent"]), ["enter"]),
|
|
160
|
+
J(U((_) => l(p), ["prevent"]), ["space"])
|
|
161
161
|
]
|
|
162
162
|
}, [
|
|
163
|
-
p.icon ? (g(),
|
|
163
|
+
p.icon ? (g(), G(ge(me), {
|
|
164
164
|
key: 0,
|
|
165
165
|
icon: p.icon,
|
|
166
166
|
class: "vf-menu__icon"
|
|
167
|
-
}, null, 8, ["icon"])) :
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
], 42,
|
|
171
|
-
p.items ? (g(),
|
|
167
|
+
}, null, 8, ["icon"])) : L("", !0),
|
|
168
|
+
ee(" " + A(p.label) + " ", 1),
|
|
169
|
+
De(ge(me), { icon: "chevronDown" })
|
|
170
|
+
], 42, mt),
|
|
171
|
+
p.items ? (g(), G(v, {
|
|
172
172
|
key: 0,
|
|
173
173
|
items: p.items,
|
|
174
|
-
class:
|
|
175
|
-
onOnActive:
|
|
176
|
-
}, null, 8, ["items", "class"])) :
|
|
177
|
-
], 64)) : (g(),
|
|
174
|
+
class: R(["vf-menu__submenu", { "vf-menu__submenu_visible": p.subMenuVisible }]),
|
|
175
|
+
onOnActive: c
|
|
176
|
+
}, null, 8, ["items", "class"])) : L("", !0)
|
|
177
|
+
], 64)) : (g(), G(Ne, {
|
|
178
178
|
key: 3,
|
|
179
179
|
to: p.to,
|
|
180
180
|
href: p.href ?? p.url,
|
|
181
|
-
as:
|
|
181
|
+
as: i(p),
|
|
182
182
|
class: "vf-menu__link",
|
|
183
183
|
active: p.active,
|
|
184
184
|
disabled: p.disabled,
|
|
185
185
|
role: "menuitem",
|
|
186
186
|
"aria-disabled": p.disabled ? "true" : "false",
|
|
187
|
-
onClick: (
|
|
188
|
-
onActive: (
|
|
187
|
+
onClick: (_) => l(p),
|
|
188
|
+
onActive: (_) => c(p)
|
|
189
189
|
}, {
|
|
190
|
-
default:
|
|
191
|
-
p.icon ? (g(),
|
|
190
|
+
default: de(() => [
|
|
191
|
+
p.icon ? (g(), G(ge(me), {
|
|
192
192
|
key: 0,
|
|
193
193
|
icon: p.icon,
|
|
194
194
|
class: "vf-menu__icon"
|
|
195
|
-
}, null, 8, ["icon"])) :
|
|
196
|
-
|
|
195
|
+
}, null, 8, ["icon"])) : L("", !0),
|
|
196
|
+
ee(" " + A(p.label), 1)
|
|
197
197
|
]),
|
|
198
198
|
_: 2
|
|
199
199
|
}, 1032, ["to", "href", "as", "active", "disabled", "aria-disabled", "onClick", "onActive"]))
|
|
@@ -202,7 +202,7 @@ const ut = /* @__PURE__ */ rt(at, [["render", ct]]), ft = {
|
|
|
202
202
|
], 2);
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
}),
|
|
205
|
+
}), ht = ["type", "disabled"], ar = /* @__PURE__ */ M({
|
|
206
206
|
__name: "button",
|
|
207
207
|
props: {
|
|
208
208
|
to: { default: void 0 },
|
|
@@ -221,70 +221,70 @@ const ut = /* @__PURE__ */ rt(at, [["render", ct]]), ft = {
|
|
|
221
221
|
disabled: { type: Boolean, default: !1 }
|
|
222
222
|
},
|
|
223
223
|
setup(t) {
|
|
224
|
-
const e = t, r = ["button", "submit", "reset"], o = (
|
|
225
|
-
let
|
|
226
|
-
return ["top", "bottom"].includes(e.iconPos) &&
|
|
227
|
-
}), l =
|
|
228
|
-
return (
|
|
224
|
+
const e = t, r = ["button", "submit", "reset"], o = (n) => !!n && r.includes(n), a = y(() => e.as ? e.as === "button" : !(e.to || e.href || e.url || e.type && !o(e.type))), u = y(() => o(e.type) ? e.type : "button"), i = y(() => e.as === "link" ? e.to ? "router-link" : "a" : e.type && !o(e.type) ? e.type === "router-link" && e.to ? "router-link" : "a" : e.to ? "router-link" : "a"), d = y(() => {
|
|
225
|
+
let n = ["vf-button", `vf-button_${e.severity}`];
|
|
226
|
+
return ["top", "bottom"].includes(e.iconPos) && n.push("vf-button_vertical"), e.variant === "text" && n.push("vf-button_text"), e.variant === "outlined" && n.push("vf-button_outlined"), ["small", "large"].indexOf(e.size) > -1 && n.push(`vf-button_${e.size}`), (e.loading || e.disabled) && n.push("vf-button_disabled"), e.rounded && n.push("vf-button_rounded"), n;
|
|
227
|
+
}), l = y(() => ["vf-button__icon", `vf-button__icon_${e.iconPos}`]), c = y(() => ["vf-button__label"]);
|
|
228
|
+
return (n, s) => a.value ? (g(), C("button", {
|
|
229
229
|
key: 0,
|
|
230
|
-
type:
|
|
231
|
-
class:
|
|
230
|
+
type: u.value,
|
|
231
|
+
class: R(d.value),
|
|
232
232
|
disabled: e.loading || e.disabled
|
|
233
233
|
}, [
|
|
234
|
-
e.icon && !e.loading ? (g(),
|
|
234
|
+
e.icon && !e.loading ? (g(), G(ge(me), {
|
|
235
235
|
key: 0,
|
|
236
236
|
icon: e.icon,
|
|
237
|
-
class:
|
|
238
|
-
}, null, 8, ["icon", "class"])) :
|
|
239
|
-
e.loading ? (g(),
|
|
237
|
+
class: R(l.value)
|
|
238
|
+
}, null, 8, ["icon", "class"])) : L("", !0),
|
|
239
|
+
e.loading ? (g(), G(ge(me), {
|
|
240
240
|
key: 1,
|
|
241
241
|
icon: "circleNotch",
|
|
242
|
-
class:
|
|
242
|
+
class: R(l.value),
|
|
243
243
|
spin: ""
|
|
244
|
-
}, null, 8, ["class"])) :
|
|
245
|
-
|
|
244
|
+
}, null, 8, ["class"])) : L("", !0),
|
|
245
|
+
n.$slots.default ? (g(), C("span", {
|
|
246
246
|
key: 2,
|
|
247
|
-
class:
|
|
247
|
+
class: R(c.value)
|
|
248
248
|
}, [
|
|
249
|
-
|
|
250
|
-
], 2)) :
|
|
249
|
+
$(n.$slots, "default")
|
|
250
|
+
], 2)) : n.label ? (g(), C("span", {
|
|
251
251
|
key: 3,
|
|
252
|
-
class:
|
|
253
|
-
},
|
|
254
|
-
], 10,
|
|
252
|
+
class: R(c.value)
|
|
253
|
+
}, A(n.label), 3)) : L("", !0)
|
|
254
|
+
], 10, ht)) : (g(), G(Ne, {
|
|
255
255
|
key: 1,
|
|
256
256
|
to: e.to,
|
|
257
257
|
href: e.href ?? e.url,
|
|
258
|
-
as:
|
|
259
|
-
class:
|
|
258
|
+
as: i.value,
|
|
259
|
+
class: R(d.value),
|
|
260
260
|
disabled: e.loading || e.disabled
|
|
261
261
|
}, {
|
|
262
|
-
default:
|
|
263
|
-
e.icon ? (g(),
|
|
262
|
+
default: de(() => [
|
|
263
|
+
e.icon ? (g(), G(ge(me), {
|
|
264
264
|
key: 0,
|
|
265
265
|
icon: e.icon,
|
|
266
|
-
class:
|
|
267
|
-
}, null, 8, ["icon", "class"])) :
|
|
268
|
-
|
|
266
|
+
class: R(l.value)
|
|
267
|
+
}, null, 8, ["icon", "class"])) : L("", !0),
|
|
268
|
+
n.$slots.default ? (g(), C("span", {
|
|
269
269
|
key: 1,
|
|
270
|
-
class:
|
|
270
|
+
class: R(c.value)
|
|
271
271
|
}, [
|
|
272
|
-
|
|
273
|
-
], 2)) :
|
|
272
|
+
$(n.$slots, "default")
|
|
273
|
+
], 2)) : n.label ? (g(), C("span", {
|
|
274
274
|
key: 2,
|
|
275
|
-
class:
|
|
276
|
-
},
|
|
275
|
+
class: R(c.value)
|
|
276
|
+
}, A(n.label), 3)) : L("", !0)
|
|
277
277
|
]),
|
|
278
278
|
_: 3
|
|
279
279
|
}, 8, ["to", "href", "as", "class", "disabled"]));
|
|
280
280
|
}
|
|
281
|
-
}),
|
|
281
|
+
}), yt = {
|
|
282
282
|
key: 0,
|
|
283
283
|
class: "vf-input__prefix"
|
|
284
|
-
},
|
|
284
|
+
}, Ct = ["type", "value", "placeholder", "disabled", "readonly"], kt = {
|
|
285
285
|
key: 1,
|
|
286
286
|
class: "vf-input__suffix"
|
|
287
|
-
},
|
|
287
|
+
}, lr = /* @__PURE__ */ M({
|
|
288
288
|
__name: "input",
|
|
289
289
|
props: {
|
|
290
290
|
modelValue: { default: "" },
|
|
@@ -297,37 +297,37 @@ const ut = /* @__PURE__ */ rt(at, [["render", ct]]), ft = {
|
|
|
297
297
|
},
|
|
298
298
|
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
299
299
|
setup(t, { emit: e }) {
|
|
300
|
-
const r = e, o = t, a =
|
|
301
|
-
const
|
|
302
|
-
return o.size !== "normal" &&
|
|
303
|
-
}),
|
|
304
|
-
const
|
|
305
|
-
r("update:modelValue",
|
|
306
|
-
},
|
|
307
|
-
return (
|
|
308
|
-
class:
|
|
300
|
+
const r = e, o = t, a = y(() => {
|
|
301
|
+
const c = ["vf-input", `vf-input_${o.variant}`];
|
|
302
|
+
return o.size !== "normal" && c.push(`vf-input_${o.size}`), o.disabled && c.push("vf-input_disabled"), c;
|
|
303
|
+
}), u = (c) => {
|
|
304
|
+
const n = c.target;
|
|
305
|
+
r("update:modelValue", n.value), r("input", c);
|
|
306
|
+
}, i = (c) => r("change", c), d = (c) => r("focus", c), l = (c) => r("blur", c);
|
|
307
|
+
return (c, n) => (g(), C("div", {
|
|
308
|
+
class: R(a.value)
|
|
309
309
|
}, [
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
])) :
|
|
313
|
-
|
|
310
|
+
c.$slots.prefix ? (g(), C("span", yt, [
|
|
311
|
+
$(c.$slots, "prefix")
|
|
312
|
+
])) : L("", !0),
|
|
313
|
+
T("input", {
|
|
314
314
|
class: "vf-input__control",
|
|
315
|
-
type:
|
|
316
|
-
value:
|
|
317
|
-
placeholder:
|
|
318
|
-
disabled:
|
|
319
|
-
readonly:
|
|
320
|
-
onInput:
|
|
321
|
-
onChange:
|
|
315
|
+
type: c.type,
|
|
316
|
+
value: c.modelValue,
|
|
317
|
+
placeholder: c.placeholder,
|
|
318
|
+
disabled: c.disabled,
|
|
319
|
+
readonly: c.readonly,
|
|
320
|
+
onInput: u,
|
|
321
|
+
onChange: i,
|
|
322
322
|
onFocus: d,
|
|
323
323
|
onBlur: l
|
|
324
|
-
}, null, 40,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
])) :
|
|
324
|
+
}, null, 40, Ct),
|
|
325
|
+
c.$slots.suffix ? (g(), C("span", kt, [
|
|
326
|
+
$(c.$slots, "suffix")
|
|
327
|
+
])) : L("", !0)
|
|
328
328
|
], 2));
|
|
329
329
|
}
|
|
330
|
-
}),
|
|
330
|
+
}), _t = ["value", "placeholder", "disabled", "readonly", "rows"], nr = /* @__PURE__ */ M({
|
|
331
331
|
__name: "textarea",
|
|
332
332
|
props: {
|
|
333
333
|
modelValue: { default: "" },
|
|
@@ -340,31 +340,31 @@ const ut = /* @__PURE__ */ rt(at, [["render", ct]]), ft = {
|
|
|
340
340
|
},
|
|
341
341
|
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
342
342
|
setup(t, { emit: e }) {
|
|
343
|
-
const r = e, o = t, a =
|
|
344
|
-
const
|
|
345
|
-
return o.size !== "normal" &&
|
|
346
|
-
}),
|
|
347
|
-
const
|
|
348
|
-
r("update:modelValue",
|
|
349
|
-
},
|
|
350
|
-
return (
|
|
351
|
-
class:
|
|
343
|
+
const r = e, o = t, a = y(() => {
|
|
344
|
+
const c = ["vf-textarea", `vf-textarea_${o.variant}`];
|
|
345
|
+
return o.size !== "normal" && c.push(`vf-textarea_${o.size}`), o.disabled && c.push("vf-textarea_disabled"), c;
|
|
346
|
+
}), u = (c) => {
|
|
347
|
+
const n = c.target;
|
|
348
|
+
r("update:modelValue", n.value), r("input", c);
|
|
349
|
+
}, i = (c) => r("change", c), d = (c) => r("focus", c), l = (c) => r("blur", c);
|
|
350
|
+
return (c, n) => (g(), C("div", {
|
|
351
|
+
class: R(a.value)
|
|
352
352
|
}, [
|
|
353
|
-
|
|
353
|
+
T("textarea", {
|
|
354
354
|
class: "vf-textarea__control",
|
|
355
|
-
value:
|
|
356
|
-
placeholder:
|
|
357
|
-
disabled:
|
|
358
|
-
readonly:
|
|
359
|
-
rows:
|
|
360
|
-
onInput:
|
|
361
|
-
onChange:
|
|
355
|
+
value: c.modelValue,
|
|
356
|
+
placeholder: c.placeholder,
|
|
357
|
+
disabled: c.disabled,
|
|
358
|
+
readonly: c.readonly,
|
|
359
|
+
rows: c.rows,
|
|
360
|
+
onInput: u,
|
|
361
|
+
onChange: i,
|
|
362
362
|
onFocus: d,
|
|
363
363
|
onBlur: l
|
|
364
|
-
}, null, 40,
|
|
364
|
+
}, null, 40, _t)
|
|
365
365
|
], 2));
|
|
366
366
|
}
|
|
367
|
-
}),
|
|
367
|
+
}), Pe = [
|
|
368
368
|
"top",
|
|
369
369
|
"top-start",
|
|
370
370
|
"top-end",
|
|
@@ -377,7 +377,7 @@ const ut = /* @__PURE__ */ rt(at, [["render", ct]]), ft = {
|
|
|
377
377
|
"left",
|
|
378
378
|
"left-start",
|
|
379
379
|
"left-end"
|
|
380
|
-
],
|
|
380
|
+
], le = (t) => {
|
|
381
381
|
if (t == null || !(t instanceof HTMLElement))
|
|
382
382
|
return null;
|
|
383
383
|
if (typeof window < "u") {
|
|
@@ -385,18 +385,18 @@ const ut = /* @__PURE__ */ rt(at, [["render", ct]]), ft = {
|
|
|
385
385
|
if (/(auto|scroll|overlay)/.test(r))
|
|
386
386
|
return t;
|
|
387
387
|
}
|
|
388
|
-
return t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth ? t :
|
|
388
|
+
return t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth ? t : le(t.parentNode);
|
|
389
389
|
};
|
|
390
|
-
function
|
|
390
|
+
function wt(t) {
|
|
391
391
|
return typeof window > "u" ? !1 : window.getComputedStyle(t).position === "fixed";
|
|
392
392
|
}
|
|
393
|
-
const
|
|
394
|
-
const o = t.getBoundingClientRect(), a = e ? e.offsetParent : null,
|
|
395
|
-
if (a && !
|
|
396
|
-
const
|
|
393
|
+
const $t = (t, e) => t.strategy ? t.strategy : wt(e) ? "fixed" : "absolute", ie = (t, e) => $t(t, e) === "fixed", q = (t, e, r = {}) => {
|
|
394
|
+
const o = t.getBoundingClientRect(), a = e ? e.offsetParent : null, u = e ? ie(r, e) : !1;
|
|
395
|
+
if (a && !u) {
|
|
396
|
+
const i = a.getBoundingClientRect(), d = a.scrollLeft, l = a.scrollTop;
|
|
397
397
|
return {
|
|
398
|
-
left: o.left -
|
|
399
|
-
top: o.top -
|
|
398
|
+
left: o.left - i.left + d,
|
|
399
|
+
top: o.top - i.top + l,
|
|
400
400
|
width: o.width,
|
|
401
401
|
height: o.height
|
|
402
402
|
};
|
|
@@ -407,63 +407,63 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
407
407
|
width: o.width,
|
|
408
408
|
height: o.height
|
|
409
409
|
};
|
|
410
|
-
},
|
|
410
|
+
}, ce = (t, e) => {
|
|
411
411
|
var r;
|
|
412
412
|
return (r = t.middleware) == null ? void 0 : r.find((o) => o.name === e);
|
|
413
|
-
},
|
|
414
|
-
const e =
|
|
413
|
+
}, Xe = (t, e) => !!ce(t, e), xt = (t) => {
|
|
414
|
+
const e = le(t);
|
|
415
415
|
let r = "";
|
|
416
416
|
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;
|
|
417
|
-
},
|
|
418
|
-
if (r === null && typeof window < "u" &&
|
|
417
|
+
}, ke = (t) => t.scrollLeft + t.clientWidth, _e = (t) => t.scrollTop + t.clientHeight, oe = (t, e, r = null, o = {}, a) => {
|
|
418
|
+
if (r === null && typeof window < "u" && ie(o, e))
|
|
419
419
|
return t;
|
|
420
|
-
let
|
|
420
|
+
let u = 0;
|
|
421
421
|
if (r === null) {
|
|
422
|
-
const
|
|
423
|
-
|
|
422
|
+
const i = le(e);
|
|
423
|
+
u = i ? i.scrollTop : 0;
|
|
424
424
|
}
|
|
425
|
-
return t -
|
|
426
|
-
},
|
|
427
|
-
let
|
|
428
|
-
if (r === null && typeof window < "u" &&
|
|
429
|
-
|
|
425
|
+
return t - u;
|
|
426
|
+
}, re = (t, e, r = null, o = {}, a) => {
|
|
427
|
+
let u;
|
|
428
|
+
if (r === null && typeof window < "u" && ie(o, e))
|
|
429
|
+
u = window.innerWidth;
|
|
430
430
|
else if (r === null) {
|
|
431
|
-
const
|
|
432
|
-
|
|
431
|
+
const i = le(e);
|
|
432
|
+
u = i ? ke(i) : 0;
|
|
433
433
|
} else
|
|
434
|
-
|
|
435
|
-
return -(t + e.clientWidth -
|
|
436
|
-
},
|
|
437
|
-
let
|
|
438
|
-
if (r === null && typeof window < "u" &&
|
|
439
|
-
|
|
434
|
+
u = r.getBoundingClientRect().width;
|
|
435
|
+
return -(t + e.clientWidth - u);
|
|
436
|
+
}, ne = (t, e, r = null, o = {}, a) => {
|
|
437
|
+
let u;
|
|
438
|
+
if (r === null && typeof window < "u" && ie(o, e))
|
|
439
|
+
u = window.innerHeight;
|
|
440
440
|
else if (r === null) {
|
|
441
|
-
const
|
|
442
|
-
|
|
441
|
+
const i = le(e);
|
|
442
|
+
u = i ? _e(i) : 0;
|
|
443
443
|
} else
|
|
444
|
-
|
|
445
|
-
return -(t + e.clientHeight -
|
|
446
|
-
},
|
|
447
|
-
if (r === null && typeof window < "u" &&
|
|
444
|
+
u = r.getBoundingClientRect().height;
|
|
445
|
+
return -(t + e.clientHeight - u);
|
|
446
|
+
}, ae = (t, e, r = null, o = {}, a) => {
|
|
447
|
+
if (r === null && typeof window < "u" && ie(o, e))
|
|
448
448
|
return t;
|
|
449
|
-
let
|
|
449
|
+
let u = 0;
|
|
450
450
|
if (r === null) {
|
|
451
|
-
const
|
|
452
|
-
|
|
451
|
+
const i = le(e);
|
|
452
|
+
u = i ? i.scrollLeft : 0;
|
|
453
453
|
}
|
|
454
|
-
return t -
|
|
455
|
-
},
|
|
454
|
+
return t - u;
|
|
455
|
+
}, Ee = ({
|
|
456
456
|
options: t,
|
|
457
457
|
primaryX: e,
|
|
458
458
|
primaryY: r,
|
|
459
459
|
floating: o,
|
|
460
460
|
placement: a,
|
|
461
|
-
reference:
|
|
462
|
-
scrollDirection:
|
|
461
|
+
reference: u,
|
|
462
|
+
scrollDirection: i
|
|
463
463
|
}) => {
|
|
464
|
-
const d =
|
|
464
|
+
const d = $e(u, o, a, t), l = ce(t, "offset");
|
|
465
465
|
if (l) {
|
|
466
|
-
const
|
|
466
|
+
const c = l.fn({
|
|
467
467
|
x: d.x,
|
|
468
468
|
y: d.y,
|
|
469
469
|
options: t,
|
|
@@ -471,17 +471,17 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
471
471
|
primaryY: r,
|
|
472
472
|
floating: o,
|
|
473
473
|
placement: a,
|
|
474
|
-
reference:
|
|
475
|
-
scrollDirection:
|
|
474
|
+
reference: u,
|
|
475
|
+
scrollDirection: i
|
|
476
476
|
});
|
|
477
|
-
d.x =
|
|
477
|
+
d.x = c.x, d.y = c.y;
|
|
478
478
|
}
|
|
479
|
-
return
|
|
479
|
+
return Mt(d, o, u, t) ? {
|
|
480
480
|
x: d.x,
|
|
481
481
|
y: d.y,
|
|
482
482
|
placement: a
|
|
483
483
|
} : !1;
|
|
484
|
-
},
|
|
484
|
+
}, Se = (t) => ({
|
|
485
485
|
name: "flip",
|
|
486
486
|
params: t,
|
|
487
487
|
fn: ({
|
|
@@ -489,116 +489,116 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
489
489
|
y: r,
|
|
490
490
|
options: o,
|
|
491
491
|
primaryX: a,
|
|
492
|
-
primaryY:
|
|
493
|
-
floating:
|
|
492
|
+
primaryY: u,
|
|
493
|
+
floating: i,
|
|
494
494
|
placement: d,
|
|
495
495
|
reference: l,
|
|
496
|
-
scrollDirection:
|
|
496
|
+
scrollDirection: c
|
|
497
497
|
}) => {
|
|
498
|
-
var
|
|
499
|
-
const
|
|
498
|
+
var n;
|
|
499
|
+
const s = {
|
|
500
500
|
x: e,
|
|
501
501
|
y: r,
|
|
502
502
|
placement: d
|
|
503
|
-
},
|
|
503
|
+
}, v = {
|
|
504
504
|
...o,
|
|
505
|
-
middleware: (
|
|
506
|
-
}, p = (t == null ? void 0 : t.placements) ??
|
|
507
|
-
let
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
505
|
+
middleware: (n = o.middleware) == null ? void 0 : n.filter((B) => B.name !== "shift")
|
|
506
|
+
}, p = (t == null ? void 0 : t.placements) ?? Pe, f = !(t != null && t.placements), _ = f ? Pe : p;
|
|
507
|
+
let k = !1;
|
|
508
|
+
const x = (B) => {
|
|
509
|
+
if (k)
|
|
510
510
|
return;
|
|
511
|
-
const
|
|
512
|
-
options:
|
|
511
|
+
const W = Ee({
|
|
512
|
+
options: v,
|
|
513
513
|
primaryX: a,
|
|
514
|
-
primaryY:
|
|
515
|
-
floating:
|
|
516
|
-
placement:
|
|
514
|
+
primaryY: u,
|
|
515
|
+
floating: i,
|
|
516
|
+
placement: B,
|
|
517
517
|
reference: l,
|
|
518
|
-
scrollDirection:
|
|
518
|
+
scrollDirection: c
|
|
519
519
|
});
|
|
520
|
-
|
|
521
|
-
},
|
|
522
|
-
if (!
|
|
523
|
-
const
|
|
524
|
-
(
|
|
525
|
-
const
|
|
526
|
-
options:
|
|
520
|
+
W && (s.x = W.x, s.y = W.y, s.placement = W.placement, k = !0);
|
|
521
|
+
}, I = Kt(l, i, v);
|
|
522
|
+
if (!f && p.includes(d) && x(d), k || _.forEach(x), !k) {
|
|
523
|
+
const B = p.reduce(
|
|
524
|
+
(W, F) => {
|
|
525
|
+
const z = Ee({
|
|
526
|
+
options: v,
|
|
527
527
|
primaryX: a,
|
|
528
|
-
primaryY:
|
|
529
|
-
floating:
|
|
530
|
-
placement:
|
|
528
|
+
primaryY: u,
|
|
529
|
+
floating: i,
|
|
530
|
+
placement: F,
|
|
531
531
|
reference: l,
|
|
532
|
-
scrollDirection:
|
|
532
|
+
scrollDirection: c
|
|
533
533
|
});
|
|
534
|
-
if (!
|
|
535
|
-
return
|
|
536
|
-
const
|
|
537
|
-
return !
|
|
534
|
+
if (!z)
|
|
535
|
+
return W;
|
|
536
|
+
const O = he(F), V = I[O];
|
|
537
|
+
return !W || V > W.space ? { result: z, space: V } : W;
|
|
538
538
|
},
|
|
539
539
|
null
|
|
540
540
|
);
|
|
541
|
-
|
|
541
|
+
B && (s.x = B.result.x, s.y = B.result.y, s.placement = B.result.placement, k = !0);
|
|
542
542
|
}
|
|
543
|
-
if (!
|
|
544
|
-
const
|
|
545
|
-
let
|
|
546
|
-
p.forEach((
|
|
547
|
-
const b =
|
|
548
|
-
|
|
543
|
+
if (!k && p.length > 0) {
|
|
544
|
+
const B = he(d);
|
|
545
|
+
let W = B, F = I[B];
|
|
546
|
+
p.forEach((h) => {
|
|
547
|
+
const b = he(h), w = I[b];
|
|
548
|
+
w > F && (F = w, W = b);
|
|
549
549
|
});
|
|
550
|
-
const
|
|
551
|
-
if (
|
|
552
|
-
const
|
|
553
|
-
x:
|
|
554
|
-
y:
|
|
555
|
-
options:
|
|
550
|
+
const z = Dt(W, d, p), O = $e(l, i, z, v), V = ce(v, "offset");
|
|
551
|
+
if (V) {
|
|
552
|
+
const h = V.fn({
|
|
553
|
+
x: O.x,
|
|
554
|
+
y: O.y,
|
|
555
|
+
options: v,
|
|
556
556
|
primaryX: a,
|
|
557
|
-
primaryY:
|
|
558
|
-
floating:
|
|
559
|
-
placement:
|
|
557
|
+
primaryY: u,
|
|
558
|
+
floating: i,
|
|
559
|
+
placement: z,
|
|
560
560
|
reference: l,
|
|
561
|
-
scrollDirection:
|
|
561
|
+
scrollDirection: c
|
|
562
562
|
});
|
|
563
|
-
|
|
563
|
+
O.x = h.x, O.y = h.y;
|
|
564
564
|
}
|
|
565
|
-
|
|
565
|
+
s.x = O.x, s.y = O.y, s.placement = O.placement;
|
|
566
566
|
}
|
|
567
|
-
return
|
|
567
|
+
return s;
|
|
568
568
|
}
|
|
569
|
-
}),
|
|
570
|
-
var
|
|
569
|
+
}), Ye = (t, e, r, o, a) => {
|
|
570
|
+
var u, i, d;
|
|
571
571
|
let l = 0;
|
|
572
572
|
o.startsWith("right") ? l = -t : o.startsWith("left") && (l = t);
|
|
573
|
-
const
|
|
574
|
-
if (
|
|
575
|
-
const
|
|
576
|
-
o.startsWith("right") ? l -=
|
|
573
|
+
const c = ce(e, "arrow"), n = ce(e, "shift");
|
|
574
|
+
if (c) {
|
|
575
|
+
const s = ((u = c.params) == null ? void 0 : u.arrow).getBoundingClientRect();
|
|
576
|
+
o.startsWith("right") ? l -= s.width / 2 : o.startsWith("left") && (l += s.width / 2);
|
|
577
577
|
}
|
|
578
|
-
if (
|
|
579
|
-
let
|
|
580
|
-
|
|
581
|
-
const p = (d =
|
|
582
|
-
|
|
578
|
+
if (Xe(e, "shift") && c) {
|
|
579
|
+
let s = null, v = 0;
|
|
580
|
+
n && (s = (i = n.params) == null ? void 0 : i.parent);
|
|
581
|
+
const p = (d = c.params) == null ? void 0 : d.arrow;
|
|
582
|
+
v = p.getBoundingClientRect().width / 2, v += Ft(p), v -= t, o.startsWith("right") ? re(r - l, a, s, e) <= t ? re(r, a, s, e) > 0 ? l = t - re(r, a, s, e) : l = t : ae(r - l - v, a, s, e) <= t && (ae(r - l - v, a, s, e) >= 0 ? (l = -t - (ae(r - l - v, a, s, e) + t), s && (l = -t)) : l = -t) : o.startsWith("left") ? re(r - l + v, a, s, e) <= t ? (l = t + re(r - v, a, s, e), l <= t && (l = t)) : ae(r - l, a, s, e) <= t && (l = -t + ae(r, a, s, e), l <= -t && (l = -t)) : re(r - l, a, s, e) <= t ? re(r - l, a, s, e) <= t && re(r, a, s, e) > 0 ? l = t - re(r, a, s, e) : l = t : ae(r - l, a, s, e) <= t && (ae(r - l, a, s, e) <= t && ae(r, a, s, e) > 0 ? l = -(t - ae(r, a, s, e)) : l = -t);
|
|
583
583
|
}
|
|
584
584
|
return l;
|
|
585
|
-
},
|
|
586
|
-
var
|
|
585
|
+
}, je = (t, e, r, o, a) => {
|
|
586
|
+
var u, i, d;
|
|
587
587
|
let l = 0;
|
|
588
588
|
o.startsWith("top") ? l = t : o.startsWith("bottom") && (l = -t);
|
|
589
|
-
const
|
|
590
|
-
if (
|
|
591
|
-
const
|
|
592
|
-
o.startsWith("top") ? l +=
|
|
589
|
+
const c = ce(e, "arrow"), n = ce(e, "shift");
|
|
590
|
+
if (c) {
|
|
591
|
+
const s = ((u = c.params) == null ? void 0 : u.arrow).getBoundingClientRect();
|
|
592
|
+
o.startsWith("top") ? l += s.height / 2 : o.startsWith("bottom") && (l -= s.height / 2);
|
|
593
593
|
}
|
|
594
|
-
if (
|
|
595
|
-
let
|
|
596
|
-
|
|
597
|
-
const p = (d =
|
|
598
|
-
|
|
594
|
+
if (Xe(e, "shift") && c) {
|
|
595
|
+
let s = null, v = 0;
|
|
596
|
+
n && (s = (i = n.params) == null ? void 0 : i.parent);
|
|
597
|
+
const p = (d = c.params) == null ? void 0 : d.arrow;
|
|
598
|
+
v = p.getBoundingClientRect().height / 2, v += zt(p), v -= t, o.startsWith("top") ? oe(r - l, a, s, e) <= t ? oe(r, a, s, e) >= 0 ? l = -(t - oe(r, a, s, e)) : l = -t : ne(r - l + v, a, s, e) <= t && (l = t + ne(r - v, a, s, e), l <= t && (l = t)) : o.startsWith("bottom") ? oe(r - l - v, a, s, e) <= t ? oe(r - l - v, a, s, e) >= 0 ? (l = -t - (oe(r - l - v, a, s, e) + t), s && (l = -t)) : l = -t : ne(r - l, a, s, e) <= t && (ne(r, a, s, e) >= 0 ? l = t - ne(r, a, s, e) : l = t) : oe(r - l, a, s, e) <= t ? oe(r - l, a, s, e) >= 0 ? l = -(t - oe(r - l, a, s, e)) : l = -t : ne(r - l, a, s, e) <= t && (ne(r - l, a, s, e) >= 0 ? l = t - ne(r - l, a, s, e) : l = t);
|
|
599
599
|
}
|
|
600
600
|
return l;
|
|
601
|
-
},
|
|
601
|
+
}, Te = (t) => ({
|
|
602
602
|
name: "offset",
|
|
603
603
|
params: { value: t },
|
|
604
604
|
fn: ({
|
|
@@ -606,15 +606,15 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
606
606
|
y: r,
|
|
607
607
|
options: o,
|
|
608
608
|
primaryX: a,
|
|
609
|
-
primaryY:
|
|
610
|
-
floating:
|
|
609
|
+
primaryY: u,
|
|
610
|
+
floating: i,
|
|
611
611
|
placement: d
|
|
612
612
|
}) => ({
|
|
613
|
-
x: e -
|
|
614
|
-
y: r -
|
|
613
|
+
x: e - Ye(t, o, a, d, i),
|
|
614
|
+
y: r - je(t, o, u, d, i),
|
|
615
615
|
placement: d
|
|
616
616
|
})
|
|
617
|
-
}),
|
|
617
|
+
}), Bt = (t) => ({
|
|
618
618
|
name: "shift",
|
|
619
619
|
params: t,
|
|
620
620
|
fn: ({
|
|
@@ -622,161 +622,161 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
622
622
|
y: r,
|
|
623
623
|
options: o,
|
|
624
624
|
primaryX: a,
|
|
625
|
-
primaryY:
|
|
626
|
-
floating:
|
|
625
|
+
primaryY: u,
|
|
626
|
+
floating: i,
|
|
627
627
|
placement: d,
|
|
628
628
|
reference: l
|
|
629
629
|
}) => {
|
|
630
|
-
var
|
|
631
|
-
const
|
|
630
|
+
var c;
|
|
631
|
+
const n = {
|
|
632
632
|
x: e,
|
|
633
633
|
y: r,
|
|
634
634
|
placement: d
|
|
635
|
-
},
|
|
636
|
-
let
|
|
637
|
-
const
|
|
638
|
-
if (
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
const
|
|
642
|
-
return
|
|
635
|
+
}, s = o.middleware || [], v = s.findIndex((w) => w.name === "shift"), p = s.findIndex((w) => w.name === "offset"), f = p !== -1 && (v === -1 || p > v), _ = s.find((w) => w.name === "offset"), k = _ ? (c = _.params) == null ? void 0 : c.value : 0, x = f ? Ye(k, o, a, d, i) : 0, I = f ? je(k, o, u, d, i) : 0, B = e - x, W = r - I;
|
|
636
|
+
let F = B, z = W;
|
|
637
|
+
const O = _ ? Math.abs(k) : 0, V = O, h = O;
|
|
638
|
+
if (ie(o, i) && typeof window < "u") {
|
|
639
|
+
const w = V, P = window.innerWidth - i.clientWidth - V, D = P < w ? w : P, K = h, X = window.innerHeight - i.clientHeight - h, N = X < K ? K : X;
|
|
640
|
+
F < w ? F = w : F > D && (F = D), z < K ? z = K : z > N && (z = N), f ? (n.x = e + (F - B), n.y = r + (z - W)) : (n.x = F, n.y = z);
|
|
641
|
+
const Z = V, Y = window.innerWidth - i.clientWidth - V, te = h, m = window.innerHeight - i.clientHeight - h, S = f ? Z + x : Z, E = f ? Y + x : Y, j = f ? te + I : te, ue = f ? m + I : m;
|
|
642
|
+
return n.x < S ? n.x = S : n.x > E && (n.x = E), n.y < j ? n.y = j : n.y > ue && (n.y = ue), n;
|
|
643
643
|
}
|
|
644
|
-
const b =
|
|
644
|
+
const b = le(i);
|
|
645
645
|
if (b !== null) {
|
|
646
|
-
const
|
|
647
|
-
|
|
646
|
+
const w = q(l, i, o), P = w.left, D = w.left + w.width, K = w.top, X = w.top + w.height, N = b.scrollLeft + V, Z = ke(b) - i.clientWidth - V, Y = Z < N ? N : Z, te = b.scrollTop + h, m = _e(b) - i.clientHeight - h, S = m < te ? te : m, E = b.scrollLeft, j = ke(b), ue = b.scrollTop, be = _e(b);
|
|
647
|
+
D <= E ? F = N : P >= j && (F = Y), X <= ue ? z = te : K >= be && (z = S), z < te ? z = te : z > S && (z = S), F < N ? F = N : F > Y && (F = Y);
|
|
648
648
|
}
|
|
649
|
-
if (
|
|
650
|
-
const
|
|
651
|
-
|
|
649
|
+
if (f ? (n.x = e + (F - B), n.y = r + (z - W)) : (n.x = F, n.y = z), b !== null) {
|
|
650
|
+
const w = b.scrollLeft + V, P = ke(b) - i.clientWidth - V, D = b.scrollTop + h, K = _e(b) - i.clientHeight - h, X = f ? w + x : w, N = f ? P + x : P, Z = f ? D + I : D, Y = f ? K + I : K;
|
|
651
|
+
n.x < X ? n.x = X : n.x > N && (n.x = N), n.y < Z ? n.y = Z : n.y > Y && (n.y = Y);
|
|
652
652
|
}
|
|
653
|
-
return
|
|
653
|
+
return n;
|
|
654
654
|
}
|
|
655
|
-
}),
|
|
656
|
-
const r =
|
|
655
|
+
}), Ft = (t) => t.getBoundingClientRect().width !== t.clientWidth ? (t.getBoundingClientRect().width - t.clientWidth) / 2 : 0, zt = (t) => t.getBoundingClientRect().height !== t.clientHeight ? (t.getBoundingClientRect().height - t.clientHeight) / 2 : 0, Le = (t, e) => {
|
|
656
|
+
const r = le(t), o = [];
|
|
657
657
|
if (r !== null) {
|
|
658
658
|
const a = () => e();
|
|
659
659
|
r.addEventListener("scroll", a, !1), o.push(() => r.removeEventListener("scroll", a, !1));
|
|
660
660
|
}
|
|
661
661
|
if (typeof window < "u") {
|
|
662
|
-
const a = () => e(),
|
|
663
|
-
window.addEventListener("scroll", a, !1), window.addEventListener("resize",
|
|
662
|
+
const a = () => e(), u = () => e();
|
|
663
|
+
window.addEventListener("scroll", a, !1), window.addEventListener("resize", u, !1), o.push(() => window.removeEventListener("scroll", a, !1)), o.push(() => window.removeEventListener("resize", u, !1));
|
|
664
664
|
}
|
|
665
665
|
if (typeof ResizeObserver < "u" && t instanceof HTMLElement) {
|
|
666
666
|
const a = new ResizeObserver(() => e());
|
|
667
667
|
a.observe(t), o.push(() => a.disconnect());
|
|
668
668
|
}
|
|
669
669
|
return () => o.forEach((a) => a());
|
|
670
|
-
},
|
|
671
|
-
const o =
|
|
670
|
+
}, Vt = (t, e, r = {}) => {
|
|
671
|
+
const o = q(t, e, r);
|
|
672
672
|
return {
|
|
673
673
|
x: o.left - e.getBoundingClientRect().width / 2 + o.width / 2,
|
|
674
674
|
y: o.top - e.getBoundingClientRect().height,
|
|
675
675
|
placement: "top"
|
|
676
676
|
};
|
|
677
|
-
},
|
|
678
|
-
const o =
|
|
677
|
+
}, St = (t, e, r = {}) => {
|
|
678
|
+
const o = q(t, e, r);
|
|
679
679
|
return {
|
|
680
680
|
x: o.left,
|
|
681
681
|
y: o.top - e.getBoundingClientRect().height,
|
|
682
682
|
placement: "top-start"
|
|
683
683
|
};
|
|
684
|
-
},
|
|
685
|
-
const o =
|
|
684
|
+
}, Tt = (t, e, r = {}) => {
|
|
685
|
+
const o = q(t, e, r);
|
|
686
686
|
return {
|
|
687
687
|
x: o.left - e.getBoundingClientRect().width + o.width,
|
|
688
688
|
y: o.top - e.getBoundingClientRect().height,
|
|
689
689
|
placement: "top-end"
|
|
690
690
|
};
|
|
691
|
-
},
|
|
692
|
-
const o =
|
|
691
|
+
}, Lt = (t, e, r = {}) => {
|
|
692
|
+
const o = q(t, e, r);
|
|
693
693
|
return {
|
|
694
694
|
x: o.left + o.width,
|
|
695
695
|
y: o.top - e.getBoundingClientRect().height / 2 + o.height / 2,
|
|
696
696
|
placement: "right"
|
|
697
697
|
};
|
|
698
|
-
},
|
|
699
|
-
const o =
|
|
698
|
+
}, Rt = (t, e, r = {}) => {
|
|
699
|
+
const o = q(t, e, r);
|
|
700
700
|
return {
|
|
701
701
|
x: o.left + o.width,
|
|
702
702
|
y: o.top,
|
|
703
703
|
placement: "right-start"
|
|
704
704
|
};
|
|
705
|
-
},
|
|
706
|
-
const o =
|
|
705
|
+
}, Wt = (t, e, r = {}) => {
|
|
706
|
+
const o = q(t, e, r);
|
|
707
707
|
return {
|
|
708
708
|
x: o.left + o.width,
|
|
709
709
|
y: o.top + o.height - e.getBoundingClientRect().height,
|
|
710
710
|
placement: "right-end"
|
|
711
711
|
};
|
|
712
|
-
},
|
|
713
|
-
const o =
|
|
712
|
+
}, It = (t, e, r = {}) => {
|
|
713
|
+
const o = q(t, e, r);
|
|
714
714
|
return {
|
|
715
715
|
x: o.left + o.width / 2 - e.getBoundingClientRect().width / 2,
|
|
716
716
|
y: o.top + o.height,
|
|
717
717
|
placement: "bottom"
|
|
718
718
|
};
|
|
719
|
-
},
|
|
720
|
-
const o =
|
|
719
|
+
}, Ot = (t, e, r = {}) => {
|
|
720
|
+
const o = q(t, e, r);
|
|
721
721
|
return {
|
|
722
722
|
x: o.left,
|
|
723
723
|
y: o.top + o.height,
|
|
724
724
|
placement: "bottom-start"
|
|
725
725
|
};
|
|
726
|
-
},
|
|
727
|
-
const o =
|
|
726
|
+
}, Pt = (t, e, r = {}) => {
|
|
727
|
+
const o = q(t, e, r);
|
|
728
728
|
return {
|
|
729
729
|
x: o.left - e.getBoundingClientRect().width + o.width,
|
|
730
730
|
y: o.top + o.height,
|
|
731
731
|
placement: "bottom-end"
|
|
732
732
|
};
|
|
733
|
-
},
|
|
734
|
-
const o =
|
|
733
|
+
}, Et = (t, e, r = {}) => {
|
|
734
|
+
const o = q(t, e, r);
|
|
735
735
|
return {
|
|
736
736
|
x: o.left - e.getBoundingClientRect().width,
|
|
737
737
|
y: o.top + o.height / 2 - e.getBoundingClientRect().height / 2,
|
|
738
738
|
placement: "left"
|
|
739
739
|
};
|
|
740
|
-
},
|
|
741
|
-
const o =
|
|
740
|
+
}, Ht = (t, e, r = {}) => {
|
|
741
|
+
const o = q(t, e, r);
|
|
742
742
|
return {
|
|
743
743
|
x: o.left - e.getBoundingClientRect().width,
|
|
744
744
|
y: o.top,
|
|
745
745
|
placement: "left-start"
|
|
746
746
|
};
|
|
747
|
-
},
|
|
748
|
-
const o =
|
|
747
|
+
}, At = (t, e, r = {}) => {
|
|
748
|
+
const o = q(t, e, r);
|
|
749
749
|
return {
|
|
750
750
|
x: o.left - e.getBoundingClientRect().width,
|
|
751
751
|
y: o.top + o.height - e.getBoundingClientRect().height,
|
|
752
752
|
placement: "left-end"
|
|
753
753
|
};
|
|
754
|
-
},
|
|
754
|
+
}, $e = (t, e, r, o = {}) => {
|
|
755
755
|
switch (r) {
|
|
756
756
|
case "top":
|
|
757
|
-
return
|
|
757
|
+
return Vt(t, e, o);
|
|
758
758
|
case "top-start":
|
|
759
|
-
return
|
|
759
|
+
return St(t, e, o);
|
|
760
760
|
case "top-end":
|
|
761
|
-
return
|
|
761
|
+
return Tt(t, e, o);
|
|
762
762
|
case "right":
|
|
763
|
-
return
|
|
763
|
+
return Lt(t, e, o);
|
|
764
764
|
case "right-start":
|
|
765
|
-
return
|
|
765
|
+
return Rt(t, e, o);
|
|
766
766
|
case "right-end":
|
|
767
|
-
return
|
|
767
|
+
return Wt(t, e, o);
|
|
768
768
|
case "bottom":
|
|
769
|
-
return
|
|
769
|
+
return It(t, e, o);
|
|
770
770
|
case "bottom-start":
|
|
771
|
-
return
|
|
771
|
+
return Ot(t, e, o);
|
|
772
772
|
case "bottom-end":
|
|
773
|
-
return
|
|
773
|
+
return Pt(t, e, o);
|
|
774
774
|
case "left":
|
|
775
|
-
return
|
|
775
|
+
return Et(t, e, o);
|
|
776
776
|
case "left-start":
|
|
777
|
-
return
|
|
777
|
+
return Ht(t, e, o);
|
|
778
778
|
case "left-end":
|
|
779
|
-
return
|
|
779
|
+
return At(t, e, o);
|
|
780
780
|
default:
|
|
781
781
|
return {
|
|
782
782
|
x: 0,
|
|
@@ -784,25 +784,25 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
784
784
|
placement: ""
|
|
785
785
|
};
|
|
786
786
|
}
|
|
787
|
-
},
|
|
788
|
-
if (
|
|
787
|
+
}, Mt = (t, e, r, o = {}) => {
|
|
788
|
+
if (ie(o, e)) {
|
|
789
789
|
if (typeof window > "u")
|
|
790
790
|
return !0;
|
|
791
|
-
const
|
|
792
|
-
return
|
|
791
|
+
const s = t.x, v = t.y, p = s + e.clientWidth, f = v + e.clientHeight;
|
|
792
|
+
return s >= 0 && v >= 0 && p <= window.innerWidth && f <= window.innerHeight;
|
|
793
793
|
}
|
|
794
|
-
if (
|
|
795
|
-
return
|
|
794
|
+
if (le(r) !== null)
|
|
795
|
+
return oe(t.y, e, null, o) > 0 && re(t.x, e, null, o) > 0 && ne(t.y, e, null, o) > 0 && ae(t.x, e, null, o) > 0;
|
|
796
796
|
if (typeof window > "u")
|
|
797
797
|
return !0;
|
|
798
|
-
const a = window.innerWidth,
|
|
799
|
-
if (
|
|
800
|
-
const
|
|
801
|
-
return
|
|
798
|
+
const a = window.innerWidth, u = window.innerHeight, i = (r instanceof HTMLElement ? r.offsetParent : null) || e.offsetParent;
|
|
799
|
+
if (i) {
|
|
800
|
+
const s = i.getBoundingClientRect(), v = s.left + t.x, p = s.top + t.y, f = v + e.clientWidth, _ = p + e.clientHeight;
|
|
801
|
+
return v >= 0 && p >= 0 && f <= a && _ <= u;
|
|
802
802
|
}
|
|
803
|
-
const d = t.x, l = t.y,
|
|
804
|
-
return d >= 0 && l >= 0 &&
|
|
805
|
-
},
|
|
803
|
+
const d = t.x, l = t.y, c = d + e.clientWidth, n = l + e.clientHeight;
|
|
804
|
+
return d >= 0 && l >= 0 && c <= a && n <= u;
|
|
805
|
+
}, he = (t) => t.startsWith("right") ? "right" : t.startsWith("left") ? "left" : t.startsWith("top") ? "top" : "bottom", Dt = (t, e, r) => he(e) === t && r.includes(e) ? e : r.find((o) => he(o) === t) ?? r[0], Kt = (t, e, r = {}) => {
|
|
806
806
|
if (typeof window > "u")
|
|
807
807
|
return {
|
|
808
808
|
top: 0,
|
|
@@ -810,51 +810,51 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
810
810
|
bottom: 0,
|
|
811
811
|
left: 0
|
|
812
812
|
};
|
|
813
|
-
const o =
|
|
813
|
+
const o = ie(r, e) ? null : le(t), a = t.getBoundingClientRect(), u = o ? o.getBoundingClientRect() : {
|
|
814
814
|
top: 0,
|
|
815
815
|
left: 0,
|
|
816
816
|
right: window.innerWidth,
|
|
817
817
|
bottom: window.innerHeight
|
|
818
818
|
};
|
|
819
819
|
return {
|
|
820
|
-
top: a.top -
|
|
821
|
-
right:
|
|
822
|
-
bottom:
|
|
823
|
-
left: a.left -
|
|
820
|
+
top: a.top - u.top,
|
|
821
|
+
right: u.right - a.right,
|
|
822
|
+
bottom: u.bottom - a.bottom,
|
|
823
|
+
left: a.left - u.left
|
|
824
824
|
};
|
|
825
|
-
},
|
|
826
|
-
var a,
|
|
827
|
-
const
|
|
825
|
+
}, Re = (t, e, r = {}) => new Promise((o) => {
|
|
826
|
+
var a, u;
|
|
827
|
+
const i = r.placement ? r.placement : "bottom", d = {
|
|
828
828
|
x: 0,
|
|
829
829
|
y: 0,
|
|
830
|
-
placement:
|
|
830
|
+
placement: i,
|
|
831
831
|
middlewareData: {}
|
|
832
|
-
}, l =
|
|
832
|
+
}, l = $e(t, e, i, r);
|
|
833
833
|
d.x = l.x, d.y = l.y, d.placement = l.placement;
|
|
834
|
-
const
|
|
835
|
-
(a = r.middleware) == null || a.forEach((
|
|
836
|
-
const
|
|
834
|
+
const c = d.x, n = d.y, s = xt(t);
|
|
835
|
+
(a = r.middleware) == null || a.forEach((_) => {
|
|
836
|
+
const k = _.fn({
|
|
837
837
|
x: d.x,
|
|
838
838
|
y: d.y,
|
|
839
839
|
options: r,
|
|
840
|
-
primaryX:
|
|
841
|
-
primaryY:
|
|
840
|
+
primaryX: c,
|
|
841
|
+
primaryY: n,
|
|
842
842
|
floating: e,
|
|
843
843
|
placement: d.placement,
|
|
844
844
|
reference: t,
|
|
845
|
-
scrollDirection:
|
|
845
|
+
scrollDirection: s
|
|
846
846
|
});
|
|
847
|
-
d.x =
|
|
847
|
+
d.x = k.x, d.y = k.y, d.placement = k.placement, _.name === "arrow" && (k.baseX = k.x, k.baseY = k.y, k.x = k.arrowX ?? k.x, k.y = k.arrowY ?? k.y), d.middlewareData[_.name] = k;
|
|
848
848
|
});
|
|
849
|
-
const
|
|
850
|
-
if (Number.isFinite(d.x) || (d.x =
|
|
851
|
-
if (
|
|
852
|
-
const
|
|
853
|
-
d.placement.startsWith("top") ? d.y =
|
|
849
|
+
const v = $e(t, e, d.placement, r), p = ce(r, "offset"), f = p ? (u = p.params) == null ? void 0 : u.value : 0;
|
|
850
|
+
if (Number.isFinite(d.x) || (d.x = v.x), !Number.isFinite(d.y))
|
|
851
|
+
if (ie(r, e)) {
|
|
852
|
+
const _ = t.getBoundingClientRect(), k = e.getBoundingClientRect().height;
|
|
853
|
+
d.placement.startsWith("top") ? d.y = _.top - k - f : d.placement.startsWith("bottom") ? d.y = _.bottom + f : d.y = v.y;
|
|
854
854
|
} else
|
|
855
|
-
d.y =
|
|
855
|
+
d.y = v.y;
|
|
856
856
|
o(d);
|
|
857
|
-
}),
|
|
857
|
+
}), Nt = ["disabled", "aria-expanded", "onKeydown"], Xt = ["data-placement"], Yt = ["disabled", "aria-selected", "onClick"], sr = /* @__PURE__ */ M({
|
|
858
858
|
__name: "select",
|
|
859
859
|
props: {
|
|
860
860
|
modelValue: { default: void 0 },
|
|
@@ -869,136 +869,363 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
869
869
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
870
870
|
setup(t, { emit: e }) {
|
|
871
871
|
let r = 0;
|
|
872
|
-
const o = e, a = t,
|
|
873
|
-
let
|
|
874
|
-
const p =
|
|
872
|
+
const o = e, a = t, u = H(null), i = H(null), d = H(null), l = H(!1), c = H("bottom"), n = H("bottom"), s = `vf-select-panel-${++r}`;
|
|
873
|
+
let v = null;
|
|
874
|
+
const p = y(() => a.options.map((b) => ({
|
|
875
875
|
label: b[a.optionLabel],
|
|
876
876
|
value: b[a.optionValue],
|
|
877
877
|
disabled: b.disabled
|
|
878
|
-
}))),
|
|
878
|
+
}))), f = y(() => p.value.find((b) => b.value === a.modelValue)), _ = y(() => {
|
|
879
879
|
var b;
|
|
880
|
-
return ((b =
|
|
881
|
-
}),
|
|
880
|
+
return ((b = f.value) == null ? void 0 : b.label) ?? "";
|
|
881
|
+
}), k = y(() => {
|
|
882
882
|
const b = ["vf-select", `vf-select_${a.variant}`, l.value ? "vf-select_open" : ""];
|
|
883
883
|
return a.size !== "normal" && b.push(`vf-select_${a.size}`), a.disabled && b.push("vf-select_disabled"), b.filter(Boolean);
|
|
884
|
-
}),
|
|
885
|
-
b.disabled || (o("update:modelValue", b.value), o("change", b.value),
|
|
886
|
-
},
|
|
887
|
-
l.value = !1,
|
|
888
|
-
},
|
|
889
|
-
a.disabled || (l.value = !l.value, l.value && (
|
|
890
|
-
},
|
|
891
|
-
var b,
|
|
892
|
-
l.value || (l.value = !0, await
|
|
893
|
-
},
|
|
894
|
-
var
|
|
895
|
-
if (!l.value || !
|
|
884
|
+
}), x = (b) => b.value === a.modelValue, I = (b) => {
|
|
885
|
+
b.disabled || (o("update:modelValue", b.value), o("change", b.value), F());
|
|
886
|
+
}, B = (b) => o("focus", b), W = (b) => o("blur", b), F = () => {
|
|
887
|
+
l.value = !1, c.value = "bottom", n.value = "bottom";
|
|
888
|
+
}, z = () => {
|
|
889
|
+
a.disabled || (l.value = !l.value, l.value && (c.value = "bottom", n.value = "bottom"));
|
|
890
|
+
}, O = async () => {
|
|
891
|
+
var b, w;
|
|
892
|
+
l.value || (l.value = !0, await we()), (w = (b = d.value) == null ? void 0 : b.querySelector(".vf-select__option:not(.is-disabled)")) == null || w.focus();
|
|
893
|
+
}, V = (b) => {
|
|
894
|
+
var P;
|
|
895
|
+
if (!l.value || !u.value)
|
|
896
896
|
return;
|
|
897
|
-
const
|
|
898
|
-
|
|
899
|
-
},
|
|
900
|
-
if (!
|
|
897
|
+
const w = b.target;
|
|
898
|
+
u.value.contains(w) || (P = d.value) != null && P.contains(w) || F();
|
|
899
|
+
}, h = () => {
|
|
900
|
+
if (!i.value || !d.value)
|
|
901
901
|
return;
|
|
902
|
-
const b =
|
|
902
|
+
const b = i.value, w = d.value, P = async () => {
|
|
903
903
|
const {
|
|
904
|
-
x:
|
|
905
|
-
y:
|
|
906
|
-
placement:
|
|
907
|
-
} = await
|
|
908
|
-
placement:
|
|
904
|
+
x: N,
|
|
905
|
+
y: Z,
|
|
906
|
+
placement: Y
|
|
907
|
+
} = await Re(b, w, {
|
|
908
|
+
placement: c.value,
|
|
909
909
|
strategy: "fixed",
|
|
910
|
-
middleware: [
|
|
910
|
+
middleware: [Te(2), Se({ placements: ["bottom", "top"] })]
|
|
911
911
|
});
|
|
912
|
-
|
|
913
|
-
},
|
|
914
|
-
await
|
|
915
|
-
},
|
|
916
|
-
|
|
917
|
-
}),
|
|
918
|
-
|
|
912
|
+
n.value = Y ?? c.value, w.style.minWidth = `${b.getBoundingClientRect().width}px`, w.style.left = `${N}px`, w.style.top = `${Z}px`;
|
|
913
|
+
}, D = async () => {
|
|
914
|
+
await P();
|
|
915
|
+
}, K = Le(b, () => {
|
|
916
|
+
D();
|
|
917
|
+
}), X = () => {
|
|
918
|
+
D();
|
|
919
919
|
};
|
|
920
|
-
document.addEventListener("scroll",
|
|
921
|
-
update:
|
|
920
|
+
document.addEventListener("scroll", X, !0), window.addEventListener("resize", X, !1), v = {
|
|
921
|
+
update: D,
|
|
922
922
|
destroy: () => {
|
|
923
|
-
|
|
923
|
+
K(), document.removeEventListener("scroll", X, !0), window.removeEventListener("resize", X, !1);
|
|
924
924
|
}
|
|
925
|
-
},
|
|
925
|
+
}, v.update();
|
|
926
926
|
};
|
|
927
|
-
return
|
|
927
|
+
return Q(l, async (b) => {
|
|
928
928
|
if (!b) {
|
|
929
|
-
|
|
929
|
+
v && (v.destroy(), v = null);
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
|
-
await
|
|
933
|
-
}),
|
|
932
|
+
await we(), v || h(), v == null || v.update();
|
|
933
|
+
}), Q(
|
|
934
934
|
() => a.options,
|
|
935
935
|
() => {
|
|
936
|
-
|
|
936
|
+
v == null || v.update();
|
|
937
937
|
},
|
|
938
938
|
{ deep: !0 }
|
|
939
|
-
),
|
|
940
|
-
document.addEventListener("click",
|
|
941
|
-
}),
|
|
942
|
-
document.removeEventListener("click",
|
|
943
|
-
}), (b,
|
|
939
|
+
), ze(() => {
|
|
940
|
+
document.addEventListener("click", V);
|
|
941
|
+
}), ye(() => {
|
|
942
|
+
document.removeEventListener("click", V), v == null || v.destroy(), v = null;
|
|
943
|
+
}), (b, w) => (g(), C("div", {
|
|
944
944
|
ref_key: "root",
|
|
945
|
-
ref:
|
|
946
|
-
class:
|
|
945
|
+
ref: u,
|
|
946
|
+
class: R(k.value)
|
|
947
947
|
}, [
|
|
948
|
-
|
|
948
|
+
T("button", {
|
|
949
949
|
ref_key: "trigger",
|
|
950
|
-
ref:
|
|
950
|
+
ref: i,
|
|
951
951
|
class: "vf-select__control",
|
|
952
952
|
type: "button",
|
|
953
953
|
disabled: b.disabled,
|
|
954
954
|
"aria-expanded": l.value,
|
|
955
|
-
"aria-controls":
|
|
955
|
+
"aria-controls": s,
|
|
956
956
|
"aria-haspopup": "listbox",
|
|
957
|
-
onClick:
|
|
957
|
+
onClick: z,
|
|
958
958
|
onKeydown: [
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
959
|
+
J(U(O, ["prevent"]), ["down"]),
|
|
960
|
+
J(U(z, ["prevent"]), ["enter"]),
|
|
961
|
+
J(U(F, ["prevent"]), ["esc"])
|
|
962
962
|
],
|
|
963
|
-
onFocus:
|
|
964
|
-
onBlur:
|
|
963
|
+
onFocus: B,
|
|
964
|
+
onBlur: W
|
|
965
965
|
}, [
|
|
966
|
-
|
|
967
|
-
class:
|
|
968
|
-
},
|
|
969
|
-
|
|
966
|
+
T("span", {
|
|
967
|
+
class: R(["vf-select__label", { "vf-select__label_placeholder": !_.value }])
|
|
968
|
+
}, A(_.value || b.placeholder), 3),
|
|
969
|
+
w[0] || (w[0] = T("span", {
|
|
970
970
|
class: "vf-select__chevron",
|
|
971
971
|
"aria-hidden": "true"
|
|
972
972
|
}, "▾", -1))
|
|
973
|
-
], 40,
|
|
974
|
-
(g(),
|
|
975
|
-
|
|
976
|
-
id:
|
|
973
|
+
], 40, Nt),
|
|
974
|
+
(g(), G(Ce, { to: "body" }, [
|
|
975
|
+
ve(T("div", {
|
|
976
|
+
id: s,
|
|
977
977
|
ref_key: "panel",
|
|
978
978
|
ref: d,
|
|
979
979
|
class: "vf-select__panel",
|
|
980
980
|
role: "listbox",
|
|
981
|
-
"data-placement":
|
|
981
|
+
"data-placement": n.value
|
|
982
|
+
}, [
|
|
983
|
+
(g(!0), C(fe, null, Fe(p.value, (P) => (g(), C("button", {
|
|
984
|
+
key: P.value,
|
|
985
|
+
class: R(["vf-select__option", { "is-active": x(P), "is-disabled": P.disabled }]),
|
|
986
|
+
type: "button",
|
|
987
|
+
role: "option",
|
|
988
|
+
disabled: P.disabled,
|
|
989
|
+
"aria-selected": x(P),
|
|
990
|
+
onClick: (D) => I(P)
|
|
991
|
+
}, A(P.label), 11, Yt))), 128))
|
|
992
|
+
], 8, Xt), [
|
|
993
|
+
[pe, l.value]
|
|
994
|
+
])
|
|
995
|
+
]))
|
|
996
|
+
], 2));
|
|
997
|
+
}
|
|
998
|
+
}), jt = ["value", "placeholder", "disabled", "readonly", "aria-expanded", "aria-activedescendant", "onKeydown"], Gt = ["disabled"], Ut = ["data-placement"], qt = {
|
|
999
|
+
key: 0,
|
|
1000
|
+
class: "vf-autocomplete__loading"
|
|
1001
|
+
}, Zt = ["id", "disabled", "aria-selected", "onClick"], Jt = {
|
|
1002
|
+
key: 2,
|
|
1003
|
+
class: "vf-autocomplete__empty"
|
|
1004
|
+
}, ir = /* @__PURE__ */ M({
|
|
1005
|
+
__name: "autocomplete",
|
|
1006
|
+
props: {
|
|
1007
|
+
modelValue: { default: void 0 },
|
|
1008
|
+
options: { default: () => [] },
|
|
1009
|
+
optionLabel: { default: "label" },
|
|
1010
|
+
optionValue: { default: "value" },
|
|
1011
|
+
placeholder: { default: "" },
|
|
1012
|
+
disabled: { type: Boolean, default: !1 },
|
|
1013
|
+
readonly: { type: Boolean, default: !1 },
|
|
1014
|
+
loading: { type: Boolean, default: !1 },
|
|
1015
|
+
loadingText: { default: "Loading..." },
|
|
1016
|
+
emptyText: { default: "No results" },
|
|
1017
|
+
filter: { type: Boolean, default: !0 },
|
|
1018
|
+
variant: { default: "filled" },
|
|
1019
|
+
size: { default: "normal" }
|
|
1020
|
+
},
|
|
1021
|
+
emits: ["update:modelValue", "change", "focus", "blur", "search"],
|
|
1022
|
+
setup(t, { emit: e }) {
|
|
1023
|
+
let r = 0;
|
|
1024
|
+
const o = e, a = t, u = H(null), i = H(null), d = H(null), l = H(!1), c = H(""), n = H(-1), s = H("bottom"), v = H("bottom"), p = `vf-autocomplete-panel-${++r}`;
|
|
1025
|
+
let f = null;
|
|
1026
|
+
const _ = y(() => a.options.map((m) => ({
|
|
1027
|
+
label: m[a.optionLabel],
|
|
1028
|
+
value: m[a.optionValue],
|
|
1029
|
+
disabled: m.disabled
|
|
1030
|
+
}))), k = y(() => _.value.find((m) => m.value === a.modelValue)), x = y(() => {
|
|
1031
|
+
if (!a.filter)
|
|
1032
|
+
return _.value;
|
|
1033
|
+
const m = c.value.trim().toLowerCase();
|
|
1034
|
+
return m ? _.value.filter((S) => S.label.toLowerCase().includes(m)) : _.value;
|
|
1035
|
+
}), I = y(() => {
|
|
1036
|
+
if (!(!l.value || n.value < 0))
|
|
1037
|
+
return W(n.value);
|
|
1038
|
+
}), B = y(() => {
|
|
1039
|
+
const m = ["vf-autocomplete", `vf-autocomplete_${a.variant}`, l.value ? "vf-autocomplete_open" : ""];
|
|
1040
|
+
return a.size !== "normal" && m.push(`vf-autocomplete_${a.size}`), a.disabled && m.push("vf-autocomplete_disabled"), m.filter(Boolean);
|
|
1041
|
+
}), W = (m) => `${p}-option-${m}`, F = (m) => m.value === a.modelValue, z = () => x.value.findIndex((m) => !m.disabled), O = (m) => {
|
|
1042
|
+
const S = x.value;
|
|
1043
|
+
if (!S.length) {
|
|
1044
|
+
n.value = -1;
|
|
1045
|
+
return;
|
|
1046
|
+
}
|
|
1047
|
+
let E = n.value;
|
|
1048
|
+
(E < 0 || E >= S.length) && (E = m > 0 ? -1 : S.length);
|
|
1049
|
+
for (let j = 0; j < S.length; j += 1)
|
|
1050
|
+
if (E = (E + m + S.length) % S.length, !S[E].disabled) {
|
|
1051
|
+
n.value = E;
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
n.value = -1;
|
|
1055
|
+
}, V = () => {
|
|
1056
|
+
a.disabled || (l.value = !0, s.value = "bottom", v.value = "bottom", n.value < 0 && (n.value = z()));
|
|
1057
|
+
}, h = () => {
|
|
1058
|
+
l.value = !1, n.value = -1, s.value = "bottom", v.value = "bottom";
|
|
1059
|
+
}, b = () => {
|
|
1060
|
+
if (l.value) {
|
|
1061
|
+
h();
|
|
1062
|
+
return;
|
|
1063
|
+
}
|
|
1064
|
+
V();
|
|
1065
|
+
}, w = (m) => {
|
|
1066
|
+
m.disabled || (c.value = m.label, o("update:modelValue", m.value), o("change", m.value), h());
|
|
1067
|
+
}, P = (m) => {
|
|
1068
|
+
const S = m.target;
|
|
1069
|
+
c.value = S.value, o("search", S.value), V(), n.value = z();
|
|
1070
|
+
}, D = (m) => {
|
|
1071
|
+
o("focus", m), V();
|
|
1072
|
+
}, K = (m) => {
|
|
1073
|
+
o("blur", m);
|
|
1074
|
+
}, X = () => {
|
|
1075
|
+
if (!l.value) {
|
|
1076
|
+
V();
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
O(1);
|
|
1080
|
+
}, N = () => {
|
|
1081
|
+
if (!l.value) {
|
|
1082
|
+
V();
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
O(-1);
|
|
1086
|
+
}, Z = () => {
|
|
1087
|
+
if (!l.value) {
|
|
1088
|
+
V();
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
const m = x.value[n.value];
|
|
1092
|
+
m && !m.disabled && w(m);
|
|
1093
|
+
}, Y = (m) => {
|
|
1094
|
+
var E;
|
|
1095
|
+
if (!l.value || !u.value)
|
|
1096
|
+
return;
|
|
1097
|
+
const S = m.target;
|
|
1098
|
+
u.value.contains(S) || (E = d.value) != null && E.contains(S) || h();
|
|
1099
|
+
}, te = () => {
|
|
1100
|
+
if (!i.value || !d.value)
|
|
1101
|
+
return;
|
|
1102
|
+
const m = i.value, S = d.value, E = async () => {
|
|
1103
|
+
const {
|
|
1104
|
+
x: Ze,
|
|
1105
|
+
y: Je,
|
|
1106
|
+
placement: Qe
|
|
1107
|
+
} = await Re(m, S, {
|
|
1108
|
+
placement: s.value,
|
|
1109
|
+
strategy: "fixed",
|
|
1110
|
+
middleware: [Te(2), Se({ placements: ["bottom", "top"] })]
|
|
1111
|
+
});
|
|
1112
|
+
v.value = Qe ?? s.value, S.style.minWidth = `${m.getBoundingClientRect().width}px`, S.style.left = `${Ze}px`, S.style.top = `${Je}px`;
|
|
1113
|
+
}, j = async () => {
|
|
1114
|
+
await E();
|
|
1115
|
+
}, ue = Le(m, () => {
|
|
1116
|
+
j();
|
|
1117
|
+
}), be = () => {
|
|
1118
|
+
j();
|
|
1119
|
+
};
|
|
1120
|
+
document.addEventListener("scroll", be, !0), window.addEventListener("resize", be, !1), f = {
|
|
1121
|
+
update: j,
|
|
1122
|
+
destroy: () => {
|
|
1123
|
+
ue(), document.removeEventListener("scroll", be, !0), window.removeEventListener("resize", be, !1);
|
|
1124
|
+
}
|
|
1125
|
+
}, f.update();
|
|
1126
|
+
};
|
|
1127
|
+
return Q(
|
|
1128
|
+
() => a.modelValue,
|
|
1129
|
+
() => {
|
|
1130
|
+
var m;
|
|
1131
|
+
c.value = ((m = k.value) == null ? void 0 : m.label) ?? "";
|
|
1132
|
+
},
|
|
1133
|
+
{ immediate: !0 }
|
|
1134
|
+
), Q(
|
|
1135
|
+
() => a.options,
|
|
1136
|
+
() => {
|
|
1137
|
+
var m;
|
|
1138
|
+
l.value || (c.value = ((m = k.value) == null ? void 0 : m.label) ?? ""), f == null || f.update();
|
|
1139
|
+
},
|
|
1140
|
+
{ deep: !0 }
|
|
1141
|
+
), Q(x, () => {
|
|
1142
|
+
n.value >= x.value.length && (n.value = z());
|
|
1143
|
+
}), Q(l, async (m) => {
|
|
1144
|
+
if (!m) {
|
|
1145
|
+
f && (f.destroy(), f = null);
|
|
1146
|
+
return;
|
|
1147
|
+
}
|
|
1148
|
+
await we(), f || te(), f == null || f.update();
|
|
1149
|
+
}), ze(() => {
|
|
1150
|
+
document.addEventListener("click", Y);
|
|
1151
|
+
}), ye(() => {
|
|
1152
|
+
document.removeEventListener("click", Y), f == null || f.destroy(), f = null;
|
|
1153
|
+
}), (m, S) => (g(), C("div", {
|
|
1154
|
+
ref_key: "root",
|
|
1155
|
+
ref: u,
|
|
1156
|
+
class: R(B.value)
|
|
1157
|
+
}, [
|
|
1158
|
+
T("input", {
|
|
1159
|
+
ref_key: "control",
|
|
1160
|
+
ref: i,
|
|
1161
|
+
class: "vf-autocomplete__control",
|
|
1162
|
+
type: "text",
|
|
1163
|
+
role: "combobox",
|
|
1164
|
+
value: c.value,
|
|
1165
|
+
placeholder: m.placeholder,
|
|
1166
|
+
disabled: m.disabled,
|
|
1167
|
+
readonly: m.readonly,
|
|
1168
|
+
"aria-expanded": l.value,
|
|
1169
|
+
"aria-autocomplete": "list",
|
|
1170
|
+
"aria-controls": p,
|
|
1171
|
+
"aria-activedescendant": I.value,
|
|
1172
|
+
onInput: P,
|
|
1173
|
+
onFocus: D,
|
|
1174
|
+
onBlur: K,
|
|
1175
|
+
onClick: V,
|
|
1176
|
+
onKeydown: [
|
|
1177
|
+
J(U(X, ["prevent"]), ["down"]),
|
|
1178
|
+
J(U(N, ["prevent"]), ["up"]),
|
|
1179
|
+
J(U(Z, ["prevent"]), ["enter"]),
|
|
1180
|
+
J(U(h, ["prevent"]), ["esc"]),
|
|
1181
|
+
J(h, ["tab"])
|
|
1182
|
+
]
|
|
1183
|
+
}, null, 40, jt),
|
|
1184
|
+
T("button", {
|
|
1185
|
+
class: "vf-autocomplete__chevron",
|
|
1186
|
+
type: "button",
|
|
1187
|
+
disabled: m.disabled,
|
|
1188
|
+
"aria-hidden": "true",
|
|
1189
|
+
tabindex: "-1",
|
|
1190
|
+
onMousedown: S[0] || (S[0] = U(() => {
|
|
1191
|
+
}, ["prevent"])),
|
|
1192
|
+
onClick: b
|
|
1193
|
+
}, " ▾ ", 40, Gt),
|
|
1194
|
+
(g(), G(Ce, { to: "body" }, [
|
|
1195
|
+
ve(T("div", {
|
|
1196
|
+
id: p,
|
|
1197
|
+
ref_key: "panel",
|
|
1198
|
+
ref: d,
|
|
1199
|
+
class: "vf-autocomplete__panel",
|
|
1200
|
+
role: "listbox",
|
|
1201
|
+
"data-placement": v.value
|
|
982
1202
|
}, [
|
|
983
|
-
(g(!0), C(
|
|
984
|
-
|
|
985
|
-
|
|
1203
|
+
m.loading ? (g(), C("div", qt, A(m.loadingText), 1)) : x.value.length > 0 ? (g(!0), C(fe, { key: 1 }, Fe(x.value, (E, j) => (g(), C("button", {
|
|
1204
|
+
id: W(j),
|
|
1205
|
+
key: E.value,
|
|
1206
|
+
class: R(["vf-autocomplete__option", {
|
|
1207
|
+
"is-active": F(E),
|
|
1208
|
+
"is-disabled": E.disabled,
|
|
1209
|
+
"is-highlighted": j === n.value
|
|
1210
|
+
}]),
|
|
986
1211
|
type: "button",
|
|
987
1212
|
role: "option",
|
|
988
|
-
disabled:
|
|
989
|
-
"aria-selected":
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1213
|
+
disabled: E.disabled,
|
|
1214
|
+
"aria-selected": F(E),
|
|
1215
|
+
onMousedown: S[1] || (S[1] = U(() => {
|
|
1216
|
+
}, ["prevent"])),
|
|
1217
|
+
onClick: (ue) => w(E)
|
|
1218
|
+
}, A(E.label), 43, Zt))), 128)) : (g(), C("div", Jt, A(m.emptyText), 1))
|
|
1219
|
+
], 8, Ut), [
|
|
1220
|
+
[pe, l.value]
|
|
994
1221
|
])
|
|
995
1222
|
]))
|
|
996
1223
|
], 2));
|
|
997
1224
|
}
|
|
998
|
-
}),
|
|
1225
|
+
}), Qt = ["checked", "disabled"], eo = {
|
|
999
1226
|
key: 0,
|
|
1000
1227
|
class: "vf-checkbox__label"
|
|
1001
|
-
},
|
|
1228
|
+
}, dr = /* @__PURE__ */ M({
|
|
1002
1229
|
__name: "checkbox",
|
|
1003
1230
|
props: {
|
|
1004
1231
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1008,32 +1235,32 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1008
1235
|
},
|
|
1009
1236
|
emits: ["update:modelValue", "change"],
|
|
1010
1237
|
setup(t, { emit: e }) {
|
|
1011
|
-
const r = e, o = t, a =
|
|
1012
|
-
const
|
|
1013
|
-
return o.disabled &&
|
|
1014
|
-
}),
|
|
1015
|
-
const d =
|
|
1016
|
-
r("update:modelValue", d.checked), r("change",
|
|
1238
|
+
const r = e, o = t, a = y(() => {
|
|
1239
|
+
const i = ["vf-checkbox", `vf-checkbox_${o.variant}`];
|
|
1240
|
+
return o.disabled && i.push("vf-checkbox_disabled"), i;
|
|
1241
|
+
}), u = (i) => {
|
|
1242
|
+
const d = i.target;
|
|
1243
|
+
r("update:modelValue", d.checked), r("change", i);
|
|
1017
1244
|
};
|
|
1018
|
-
return (
|
|
1019
|
-
class:
|
|
1245
|
+
return (i, d) => (g(), C("label", {
|
|
1246
|
+
class: R(a.value)
|
|
1020
1247
|
}, [
|
|
1021
|
-
|
|
1248
|
+
T("input", {
|
|
1022
1249
|
class: "vf-checkbox__control",
|
|
1023
1250
|
type: "checkbox",
|
|
1024
|
-
checked:
|
|
1025
|
-
disabled:
|
|
1026
|
-
onChange:
|
|
1027
|
-
}, null, 40,
|
|
1028
|
-
d[0] || (d[0] =
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1251
|
+
checked: i.modelValue,
|
|
1252
|
+
disabled: i.disabled,
|
|
1253
|
+
onChange: u
|
|
1254
|
+
}, null, 40, Qt),
|
|
1255
|
+
d[0] || (d[0] = T("span", { class: "vf-checkbox__box" }, null, -1)),
|
|
1256
|
+
i.label || i.$slots.default ? (g(), C("span", eo, [
|
|
1257
|
+
$(i.$slots, "default", {}, () => [
|
|
1258
|
+
ee(A(i.label), 1)
|
|
1032
1259
|
])
|
|
1033
|
-
])) :
|
|
1260
|
+
])) : L("", !0)
|
|
1034
1261
|
], 2));
|
|
1035
1262
|
}
|
|
1036
|
-
}),
|
|
1263
|
+
}), Ge = Symbol("VueForgeRadioGroup"), to = ["aria-disabled", "aria-label", "aria-labelledby"], cr = /* @__PURE__ */ M({
|
|
1037
1264
|
__name: "radio-group",
|
|
1038
1265
|
props: {
|
|
1039
1266
|
modelValue: { type: [String, Number, Boolean, null], default: void 0 },
|
|
@@ -1046,32 +1273,32 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1046
1273
|
},
|
|
1047
1274
|
emits: ["update:modelValue", "change"],
|
|
1048
1275
|
setup(t, { emit: e }) {
|
|
1049
|
-
const r = e, o = t, a =
|
|
1276
|
+
const r = e, o = t, a = y(() => {
|
|
1050
1277
|
const d = ["vf-radio-group"];
|
|
1051
1278
|
return o.direction === "horizontal" && d.push("vf-radio-group_horizontal"), d;
|
|
1052
|
-
}),
|
|
1279
|
+
}), u = (d, l) => {
|
|
1053
1280
|
r("update:modelValue", d), r("change", d, l);
|
|
1054
|
-
},
|
|
1055
|
-
name:
|
|
1056
|
-
modelValue:
|
|
1057
|
-
disabled:
|
|
1058
|
-
variant:
|
|
1059
|
-
onChange:
|
|
1281
|
+
}, i = {
|
|
1282
|
+
name: y(() => o.name),
|
|
1283
|
+
modelValue: y(() => o.modelValue),
|
|
1284
|
+
disabled: y(() => o.disabled),
|
|
1285
|
+
variant: y(() => o.variant),
|
|
1286
|
+
onChange: u
|
|
1060
1287
|
};
|
|
1061
|
-
return
|
|
1062
|
-
class:
|
|
1288
|
+
return Ke(Ge, i), (d, l) => (g(), C("div", {
|
|
1289
|
+
class: R(a.value),
|
|
1063
1290
|
role: "radiogroup",
|
|
1064
1291
|
"aria-disabled": d.disabled || void 0,
|
|
1065
1292
|
"aria-label": d.ariaLabel || void 0,
|
|
1066
1293
|
"aria-labelledby": d.ariaLabelledby || void 0
|
|
1067
1294
|
}, [
|
|
1068
|
-
|
|
1069
|
-
], 10,
|
|
1295
|
+
$(d.$slots, "default")
|
|
1296
|
+
], 10, to));
|
|
1070
1297
|
}
|
|
1071
|
-
}),
|
|
1298
|
+
}), oo = ["name", "value", "checked", "disabled"], ro = {
|
|
1072
1299
|
key: 0,
|
|
1073
1300
|
class: "vf-radio__label"
|
|
1074
|
-
},
|
|
1301
|
+
}, ur = /* @__PURE__ */ M({
|
|
1075
1302
|
__name: "radio-button",
|
|
1076
1303
|
props: {
|
|
1077
1304
|
modelValue: { type: [String, Number, Boolean, null], default: void 0 },
|
|
@@ -1083,33 +1310,33 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1083
1310
|
},
|
|
1084
1311
|
emits: ["update:modelValue", "change"],
|
|
1085
1312
|
setup(t, { emit: e }) {
|
|
1086
|
-
const r = e, o = t, a =
|
|
1087
|
-
const
|
|
1088
|
-
return l.value &&
|
|
1089
|
-
}),
|
|
1090
|
-
l.value || (a ? a.onChange(o.value,
|
|
1313
|
+
const r = e, o = t, a = Ve(Ge, null), u = y(() => a ? a.modelValue.value : o.modelValue), i = y(() => a ? a.name.value : o.name), d = y(() => a ? a.variant.value : o.variant), l = y(() => (a ? a.disabled.value : !1) || o.disabled), c = y(() => u.value === o.value), n = y(() => {
|
|
1314
|
+
const v = ["vf-radio", `vf-radio_${d.value}`];
|
|
1315
|
+
return l.value && v.push("vf-radio_disabled"), v;
|
|
1316
|
+
}), s = (v) => {
|
|
1317
|
+
l.value || (a ? a.onChange(o.value, v) : r("update:modelValue", o.value), r("change", o.value, v));
|
|
1091
1318
|
};
|
|
1092
|
-
return (
|
|
1093
|
-
class:
|
|
1319
|
+
return (v, p) => (g(), C("label", {
|
|
1320
|
+
class: R(n.value)
|
|
1094
1321
|
}, [
|
|
1095
|
-
|
|
1322
|
+
T("input", {
|
|
1096
1323
|
class: "vf-radio__control",
|
|
1097
1324
|
type: "radio",
|
|
1098
|
-
name:
|
|
1099
|
-
value:
|
|
1100
|
-
checked:
|
|
1325
|
+
name: i.value,
|
|
1326
|
+
value: v.value,
|
|
1327
|
+
checked: c.value,
|
|
1101
1328
|
disabled: l.value,
|
|
1102
|
-
onChange:
|
|
1103
|
-
}, null, 40,
|
|
1104
|
-
p[0] || (p[0] =
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1329
|
+
onChange: s
|
|
1330
|
+
}, null, 40, oo),
|
|
1331
|
+
p[0] || (p[0] = T("span", { class: "vf-radio__circle" }, null, -1)),
|
|
1332
|
+
v.label || v.$slots.default ? (g(), C("span", ro, [
|
|
1333
|
+
$(v.$slots, "default", {}, () => [
|
|
1334
|
+
ee(A(v.label), 1)
|
|
1108
1335
|
])
|
|
1109
|
-
])) :
|
|
1336
|
+
])) : L("", !0)
|
|
1110
1337
|
], 2));
|
|
1111
1338
|
}
|
|
1112
|
-
}),
|
|
1339
|
+
}), We = Symbol("VueForgeTabs"), ao = ["aria-orientation", "aria-label", "aria-labelledby"], lo = { class: "vf-tabs__panels" }, fr = /* @__PURE__ */ M({
|
|
1113
1340
|
__name: "tabs",
|
|
1114
1341
|
props: {
|
|
1115
1342
|
modelValue: { default: void 0 },
|
|
@@ -1121,54 +1348,54 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1121
1348
|
emits: ["update:modelValue", "change"],
|
|
1122
1349
|
setup(t, { emit: e }) {
|
|
1123
1350
|
let r = 0;
|
|
1124
|
-
const o = e, a = t,
|
|
1125
|
-
const
|
|
1126
|
-
return a.orientation === "vertical" &&
|
|
1127
|
-
}), l =
|
|
1128
|
-
|
|
1129
|
-
},
|
|
1351
|
+
const o = e, a = t, u = ++r, i = (f) => String(f).toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9_-]/g, ""), d = y(() => {
|
|
1352
|
+
const f = ["vf-tabs"];
|
|
1353
|
+
return a.orientation === "vertical" && f.push("vf-tabs_vertical"), a.disabled && f.push("vf-tabs_disabled"), f;
|
|
1354
|
+
}), l = H(null), c = () => l.value ? Array.from(l.value.querySelectorAll('[role="tab"]:not([disabled])')) : [], n = (f) => {
|
|
1355
|
+
f && (f.focus(), f.click());
|
|
1356
|
+
}, s = (f) => {
|
|
1130
1357
|
if (a.disabled)
|
|
1131
1358
|
return;
|
|
1132
|
-
const
|
|
1133
|
-
if (![...
|
|
1359
|
+
const _ = a.orientation === "horizontal", k = f.key, x = _ ? ["ArrowRight"] : ["ArrowDown"], I = _ ? ["ArrowLeft"] : ["ArrowUp"];
|
|
1360
|
+
if (![...x, ...I, "Home", "End"].includes(k))
|
|
1134
1361
|
return;
|
|
1135
|
-
const
|
|
1136
|
-
if (
|
|
1362
|
+
const B = c();
|
|
1363
|
+
if (!B.length)
|
|
1137
1364
|
return;
|
|
1138
|
-
const
|
|
1139
|
-
let
|
|
1140
|
-
|
|
1141
|
-
},
|
|
1142
|
-
o("update:modelValue",
|
|
1365
|
+
const W = B.findIndex((V) => V.getAttribute("aria-selected") === "true"), F = B.findIndex((V) => V === document.activeElement), z = F >= 0 ? F : Math.max(W, 0);
|
|
1366
|
+
let O = z;
|
|
1367
|
+
x.includes(k) ? O = (z + 1) % B.length : I.includes(k) ? O = (z - 1 + B.length) % B.length : k === "Home" ? O = 0 : k === "End" && (O = B.length - 1), f.preventDefault(), n(B[O]);
|
|
1368
|
+
}, v = (f, _) => {
|
|
1369
|
+
o("update:modelValue", f), o("change", f, _);
|
|
1143
1370
|
}, p = {
|
|
1144
|
-
activeValue:
|
|
1145
|
-
disabled:
|
|
1146
|
-
orientation:
|
|
1147
|
-
onChange:
|
|
1148
|
-
getTabId: (
|
|
1149
|
-
getPanelId: (
|
|
1371
|
+
activeValue: y(() => a.modelValue),
|
|
1372
|
+
disabled: y(() => a.disabled),
|
|
1373
|
+
orientation: y(() => a.orientation),
|
|
1374
|
+
onChange: v,
|
|
1375
|
+
getTabId: (f) => `vf-tab-${u}-${i(f)}`,
|
|
1376
|
+
getPanelId: (f) => `vf-tabpanel-${u}-${i(f)}`
|
|
1150
1377
|
};
|
|
1151
|
-
return
|
|
1152
|
-
class:
|
|
1378
|
+
return Ke(We, p), (f, _) => (g(), C("div", {
|
|
1379
|
+
class: R(d.value)
|
|
1153
1380
|
}, [
|
|
1154
|
-
|
|
1381
|
+
T("div", {
|
|
1155
1382
|
ref_key: "list",
|
|
1156
1383
|
ref: l,
|
|
1157
1384
|
class: "vf-tabs__list",
|
|
1158
1385
|
role: "tablist",
|
|
1159
|
-
"aria-orientation":
|
|
1160
|
-
"aria-label":
|
|
1161
|
-
"aria-labelledby":
|
|
1162
|
-
onKeydown:
|
|
1386
|
+
"aria-orientation": f.orientation,
|
|
1387
|
+
"aria-label": f.ariaLabel || void 0,
|
|
1388
|
+
"aria-labelledby": f.ariaLabelledby || void 0,
|
|
1389
|
+
onKeydown: s
|
|
1163
1390
|
}, [
|
|
1164
|
-
|
|
1165
|
-
], 40,
|
|
1166
|
-
|
|
1167
|
-
|
|
1391
|
+
$(f.$slots, "tabs")
|
|
1392
|
+
], 40, ao),
|
|
1393
|
+
T("div", lo, [
|
|
1394
|
+
$(f.$slots, "panels")
|
|
1168
1395
|
])
|
|
1169
1396
|
], 2));
|
|
1170
1397
|
}
|
|
1171
|
-
}),
|
|
1398
|
+
}), no = ["id", "aria-selected", "aria-controls", "disabled", "tabindex"], vr = /* @__PURE__ */ M({
|
|
1172
1399
|
__name: "tab",
|
|
1173
1400
|
props: {
|
|
1174
1401
|
value: {},
|
|
@@ -1177,51 +1404,51 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1177
1404
|
},
|
|
1178
1405
|
emits: ["change"],
|
|
1179
1406
|
setup(t, { emit: e }) {
|
|
1180
|
-
const r = e, o = t, a =
|
|
1181
|
-
!a ||
|
|
1407
|
+
const r = e, o = t, a = Ve(We, null), u = y(() => (a == null ? void 0 : a.activeValue.value) === o.value), i = y(() => ((a == null ? void 0 : a.disabled.value) ?? !1) || o.disabled), d = y(() => a ? a.getTabId(o.value) : void 0), l = y(() => a ? a.getPanelId(o.value) : void 0), c = y(() => i.value ? -1 : u.value ? 0 : -1), n = (s) => {
|
|
1408
|
+
!a || i.value || (a.onChange(o.value, s), r("change", o.value, s));
|
|
1182
1409
|
};
|
|
1183
|
-
return (
|
|
1410
|
+
return (s, v) => (g(), C("button", {
|
|
1184
1411
|
id: d.value,
|
|
1185
|
-
class:
|
|
1412
|
+
class: R(["vf-tab", { "vf-tab_active": u.value, "vf-tab_disabled": i.value }]),
|
|
1186
1413
|
type: "button",
|
|
1187
1414
|
role: "tab",
|
|
1188
|
-
"aria-selected":
|
|
1415
|
+
"aria-selected": u.value,
|
|
1189
1416
|
"aria-controls": l.value,
|
|
1190
|
-
disabled:
|
|
1191
|
-
tabindex:
|
|
1192
|
-
onClick:
|
|
1417
|
+
disabled: i.value,
|
|
1418
|
+
tabindex: c.value,
|
|
1419
|
+
onClick: n
|
|
1193
1420
|
}, [
|
|
1194
|
-
|
|
1195
|
-
|
|
1421
|
+
$(s.$slots, "default", {}, () => [
|
|
1422
|
+
ee(A(s.label), 1)
|
|
1196
1423
|
])
|
|
1197
|
-
], 10,
|
|
1424
|
+
], 10, no));
|
|
1198
1425
|
}
|
|
1199
|
-
}),
|
|
1426
|
+
}), so = ["id", "aria-labelledby"], pr = /* @__PURE__ */ M({
|
|
1200
1427
|
__name: "tab-panel",
|
|
1201
1428
|
props: {
|
|
1202
1429
|
value: {}
|
|
1203
1430
|
},
|
|
1204
1431
|
setup(t) {
|
|
1205
|
-
const e = t, r =
|
|
1206
|
-
return (
|
|
1207
|
-
id:
|
|
1432
|
+
const e = t, r = Ve(We, null), o = y(() => (r == null ? void 0 : r.activeValue.value) === e.value), a = y(() => r ? r.getTabId(e.value) : void 0), u = y(() => r ? r.getPanelId(e.value) : void 0);
|
|
1433
|
+
return (i, d) => ve((g(), C("div", {
|
|
1434
|
+
id: u.value,
|
|
1208
1435
|
class: "vf-tab-panel",
|
|
1209
1436
|
role: "tabpanel",
|
|
1210
1437
|
tabindex: "0",
|
|
1211
1438
|
"aria-labelledby": a.value
|
|
1212
1439
|
}, [
|
|
1213
|
-
|
|
1214
|
-
], 8,
|
|
1215
|
-
[
|
|
1440
|
+
$(i.$slots, "default")
|
|
1441
|
+
], 8, so)), [
|
|
1442
|
+
[pe, o.value]
|
|
1216
1443
|
]);
|
|
1217
1444
|
}
|
|
1218
|
-
}),
|
|
1445
|
+
}), io = ["data-severity"], co = { class: "vf-toast__body" }, uo = {
|
|
1219
1446
|
key: 0,
|
|
1220
1447
|
class: "vf-toast__title"
|
|
1221
|
-
},
|
|
1448
|
+
}, fo = {
|
|
1222
1449
|
key: 1,
|
|
1223
1450
|
class: "vf-toast__message"
|
|
1224
|
-
},
|
|
1451
|
+
}, br = /* @__PURE__ */ M({
|
|
1225
1452
|
__name: "toast",
|
|
1226
1453
|
props: {
|
|
1227
1454
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1235,36 +1462,36 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1235
1462
|
setup(t, { emit: e }) {
|
|
1236
1463
|
const r = e, o = t;
|
|
1237
1464
|
let a = null;
|
|
1238
|
-
const
|
|
1465
|
+
const u = () => {
|
|
1239
1466
|
a !== null && (clearTimeout(a), a = null);
|
|
1240
|
-
},
|
|
1241
|
-
|
|
1467
|
+
}, i = () => {
|
|
1468
|
+
u(), !(!o.modelValue || o.duration <= 0) && (a = window.setTimeout(() => {
|
|
1242
1469
|
r("update:modelValue", !1), r("close");
|
|
1243
1470
|
}, o.duration));
|
|
1244
1471
|
}, d = () => {
|
|
1245
|
-
|
|
1472
|
+
u(), r("update:modelValue", !1), r("close");
|
|
1246
1473
|
};
|
|
1247
|
-
return
|
|
1474
|
+
return Q(
|
|
1248
1475
|
() => o.modelValue,
|
|
1249
1476
|
(l) => {
|
|
1250
|
-
l && r("open"),
|
|
1477
|
+
l && r("open"), i();
|
|
1251
1478
|
},
|
|
1252
1479
|
{ immediate: !0 }
|
|
1253
|
-
),
|
|
1254
|
-
|
|
1255
|
-
}), (l,
|
|
1480
|
+
), ye(() => {
|
|
1481
|
+
u();
|
|
1482
|
+
}), (l, c) => ve((g(), C("div", {
|
|
1256
1483
|
class: "vf-toast",
|
|
1257
1484
|
role: "status",
|
|
1258
1485
|
"aria-live": "polite",
|
|
1259
1486
|
"data-severity": l.severity
|
|
1260
1487
|
}, [
|
|
1261
|
-
|
|
1262
|
-
l.title ? (g(), C("div",
|
|
1263
|
-
l.message || l.$slots.default ? (g(), C("div",
|
|
1264
|
-
|
|
1265
|
-
|
|
1488
|
+
T("div", co, [
|
|
1489
|
+
l.title ? (g(), C("div", uo, A(l.title), 1)) : L("", !0),
|
|
1490
|
+
l.message || l.$slots.default ? (g(), C("div", fo, [
|
|
1491
|
+
$(l.$slots, "default", {}, () => [
|
|
1492
|
+
ee(A(l.message), 1)
|
|
1266
1493
|
])
|
|
1267
|
-
])) :
|
|
1494
|
+
])) : L("", !0)
|
|
1268
1495
|
]),
|
|
1269
1496
|
l.closable ? (g(), C("button", {
|
|
1270
1497
|
key: 0,
|
|
@@ -1272,35 +1499,35 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1272
1499
|
type: "button",
|
|
1273
1500
|
onClick: d
|
|
1274
1501
|
}, [
|
|
1275
|
-
|
|
1276
|
-
|
|
1502
|
+
$(l.$slots, "close", {}, () => [
|
|
1503
|
+
c[0] || (c[0] = ee("×"))
|
|
1277
1504
|
])
|
|
1278
|
-
])) :
|
|
1279
|
-
], 8,
|
|
1280
|
-
[
|
|
1505
|
+
])) : L("", !0)
|
|
1506
|
+
], 8, io)), [
|
|
1507
|
+
[pe, l.modelValue]
|
|
1281
1508
|
]);
|
|
1282
1509
|
}
|
|
1283
|
-
}),
|
|
1510
|
+
}), gr = /* @__PURE__ */ M({
|
|
1284
1511
|
__name: "toast-container",
|
|
1285
1512
|
props: {
|
|
1286
1513
|
position: { default: "top-right" }
|
|
1287
1514
|
},
|
|
1288
1515
|
setup(t) {
|
|
1289
|
-
const e = t, r =
|
|
1290
|
-
return (o, a) => (g(),
|
|
1291
|
-
|
|
1292
|
-
class:
|
|
1516
|
+
const e = t, r = y(() => `vf-toast-container_${e.position}`);
|
|
1517
|
+
return (o, a) => (g(), G(Ce, { to: "body" }, [
|
|
1518
|
+
T("div", {
|
|
1519
|
+
class: R(["vf-toast-container", r.value]),
|
|
1293
1520
|
role: "region",
|
|
1294
1521
|
"aria-live": "polite"
|
|
1295
1522
|
}, [
|
|
1296
|
-
|
|
1523
|
+
$(o.$slots, "default")
|
|
1297
1524
|
], 2)
|
|
1298
1525
|
]));
|
|
1299
1526
|
}
|
|
1300
|
-
}),
|
|
1527
|
+
}), vo = ["checked", "disabled"], po = {
|
|
1301
1528
|
key: 0,
|
|
1302
1529
|
class: "vf-switch__label"
|
|
1303
|
-
},
|
|
1530
|
+
}, mr = /* @__PURE__ */ M({
|
|
1304
1531
|
__name: "switch",
|
|
1305
1532
|
props: {
|
|
1306
1533
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1309,113 +1536,113 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1309
1536
|
},
|
|
1310
1537
|
emits: ["update:modelValue", "change"],
|
|
1311
1538
|
setup(t, { emit: e }) {
|
|
1312
|
-
const r = e, o = t, a =
|
|
1313
|
-
const
|
|
1314
|
-
return o.disabled &&
|
|
1315
|
-
}),
|
|
1316
|
-
const d =
|
|
1317
|
-
r("update:modelValue", d.checked), r("change",
|
|
1539
|
+
const r = e, o = t, a = y(() => {
|
|
1540
|
+
const i = ["vf-switch"];
|
|
1541
|
+
return o.disabled && i.push("vf-switch_disabled"), i;
|
|
1542
|
+
}), u = (i) => {
|
|
1543
|
+
const d = i.target;
|
|
1544
|
+
r("update:modelValue", d.checked), r("change", i);
|
|
1318
1545
|
};
|
|
1319
|
-
return (
|
|
1320
|
-
class:
|
|
1546
|
+
return (i, d) => (g(), C("label", {
|
|
1547
|
+
class: R(a.value)
|
|
1321
1548
|
}, [
|
|
1322
|
-
|
|
1549
|
+
T("input", {
|
|
1323
1550
|
class: "vf-switch__control",
|
|
1324
1551
|
type: "checkbox",
|
|
1325
|
-
checked:
|
|
1326
|
-
disabled:
|
|
1327
|
-
onChange:
|
|
1328
|
-
}, null, 40,
|
|
1329
|
-
d[0] || (d[0] =
|
|
1330
|
-
|
|
1552
|
+
checked: i.modelValue,
|
|
1553
|
+
disabled: i.disabled,
|
|
1554
|
+
onChange: u
|
|
1555
|
+
}, null, 40, vo),
|
|
1556
|
+
d[0] || (d[0] = T("span", { class: "vf-switch__track" }, [
|
|
1557
|
+
T("span", { class: "vf-switch__thumb" })
|
|
1331
1558
|
], -1)),
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1559
|
+
i.label || i.$slots.default ? (g(), C("span", po, [
|
|
1560
|
+
$(i.$slots, "default", {}, () => [
|
|
1561
|
+
ee(A(i.label), 1)
|
|
1335
1562
|
])
|
|
1336
|
-
])) :
|
|
1563
|
+
])) : L("", !0)
|
|
1337
1564
|
], 2));
|
|
1338
1565
|
}
|
|
1339
|
-
}),
|
|
1566
|
+
}), bo = { class: "vf-popover" }, go = ["aria-expanded", "onKeydown"], hr = /* @__PURE__ */ M({
|
|
1340
1567
|
__name: "popover",
|
|
1341
1568
|
emits: ["click", "onClick"],
|
|
1342
1569
|
setup(t, { expose: e, emit: r }) {
|
|
1343
|
-
const o = r, a =
|
|
1344
|
-
let
|
|
1345
|
-
const
|
|
1346
|
-
|
|
1570
|
+
const o = r, a = et({ visible: !1 });
|
|
1571
|
+
let u = 0;
|
|
1572
|
+
const i = `vf-popover-panel-${++u}`, d = () => a.visible = !0, l = () => a.visible = !1, c = () => a.visible = !a.visible, n = () => {
|
|
1573
|
+
c(), o("click"), o("onClick");
|
|
1347
1574
|
};
|
|
1348
|
-
return e({ show: d, hide: l, toggle:
|
|
1349
|
-
|
|
1575
|
+
return e({ show: d, hide: l, toggle: c }), (s, v) => (g(), C("div", bo, [
|
|
1576
|
+
T("div", {
|
|
1350
1577
|
class: "vf-popover__button",
|
|
1351
1578
|
role: "button",
|
|
1352
1579
|
tabindex: "0",
|
|
1353
1580
|
"aria-haspopup": "dialog",
|
|
1354
1581
|
"aria-expanded": a.visible,
|
|
1355
|
-
"aria-controls":
|
|
1356
|
-
onClick:
|
|
1582
|
+
"aria-controls": i,
|
|
1583
|
+
onClick: n,
|
|
1357
1584
|
onKeydown: [
|
|
1358
|
-
|
|
1359
|
-
|
|
1585
|
+
J(U(n, ["prevent"]), ["enter"]),
|
|
1586
|
+
J(U(n, ["prevent"]), ["space"])
|
|
1360
1587
|
]
|
|
1361
1588
|
}, [
|
|
1362
|
-
|
|
1363
|
-
], 40,
|
|
1364
|
-
|
|
1365
|
-
id:
|
|
1589
|
+
$(s.$slots, "button")
|
|
1590
|
+
], 40, go),
|
|
1591
|
+
ve(De(pt, {
|
|
1592
|
+
id: i,
|
|
1366
1593
|
class: "vf-popover__wrapper"
|
|
1367
|
-
},
|
|
1368
|
-
default:
|
|
1369
|
-
|
|
1594
|
+
}, tt({
|
|
1595
|
+
default: de(() => [
|
|
1596
|
+
v[0] || (v[0] = T("div", { class: "vf-popover__arrow" }, null, -1))
|
|
1370
1597
|
]),
|
|
1371
1598
|
_: 2
|
|
1372
1599
|
}, [
|
|
1373
|
-
|
|
1600
|
+
s.$slots.default ? {
|
|
1374
1601
|
name: "default",
|
|
1375
|
-
fn:
|
|
1376
|
-
|
|
1602
|
+
fn: de(() => [
|
|
1603
|
+
$(s.$slots, "default")
|
|
1377
1604
|
]),
|
|
1378
1605
|
key: "0"
|
|
1379
1606
|
} : void 0,
|
|
1380
|
-
|
|
1607
|
+
s.$slots.header || s.$slots.popoverHeader ? {
|
|
1381
1608
|
name: "header",
|
|
1382
|
-
fn:
|
|
1383
|
-
|
|
1384
|
-
|
|
1609
|
+
fn: de(() => [
|
|
1610
|
+
$(s.$slots, "header"),
|
|
1611
|
+
s.$slots.header ? L("", !0) : $(s.$slots, "popoverHeader", { key: 0 })
|
|
1385
1612
|
]),
|
|
1386
1613
|
key: "1"
|
|
1387
1614
|
} : void 0,
|
|
1388
|
-
|
|
1615
|
+
s.$slots.body || s.$slots.popoverBody ? {
|
|
1389
1616
|
name: "body",
|
|
1390
|
-
fn:
|
|
1391
|
-
|
|
1392
|
-
|
|
1617
|
+
fn: de(() => [
|
|
1618
|
+
$(s.$slots, "body"),
|
|
1619
|
+
s.$slots.body ? L("", !0) : $(s.$slots, "popoverBody", { key: 0 })
|
|
1393
1620
|
]),
|
|
1394
1621
|
key: "2"
|
|
1395
1622
|
} : void 0,
|
|
1396
|
-
|
|
1623
|
+
s.$slots.footer || s.$slots.popoverFooter ? {
|
|
1397
1624
|
name: "footer",
|
|
1398
|
-
fn:
|
|
1399
|
-
|
|
1400
|
-
|
|
1625
|
+
fn: de(() => [
|
|
1626
|
+
$(s.$slots, "footer"),
|
|
1627
|
+
s.$slots.footer ? L("", !0) : $(s.$slots, "popoverFooter", { key: 0 })
|
|
1401
1628
|
]),
|
|
1402
1629
|
key: "3"
|
|
1403
1630
|
} : void 0
|
|
1404
1631
|
]), 1536), [
|
|
1405
|
-
[
|
|
1632
|
+
[pe, a.visible]
|
|
1406
1633
|
])
|
|
1407
1634
|
]));
|
|
1408
1635
|
}
|
|
1409
|
-
}),
|
|
1636
|
+
}), mo = ["aria-labelledby", "aria-describedby"], ho = {
|
|
1410
1637
|
key: 0,
|
|
1411
1638
|
class: "vf-modal__header"
|
|
1412
|
-
},
|
|
1639
|
+
}, yo = {
|
|
1413
1640
|
key: 0,
|
|
1414
1641
|
class: "vf-modal__title"
|
|
1415
|
-
},
|
|
1642
|
+
}, Co = {
|
|
1416
1643
|
key: 3,
|
|
1417
1644
|
class: "vf-modal__footer"
|
|
1418
|
-
},
|
|
1645
|
+
}, yr = /* @__PURE__ */ M({
|
|
1419
1646
|
__name: "modal",
|
|
1420
1647
|
props: {
|
|
1421
1648
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1429,111 +1656,111 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1429
1656
|
emits: ["update:modelValue", "open", "close"],
|
|
1430
1657
|
setup(t, { expose: e, emit: r }) {
|
|
1431
1658
|
const o = r, a = t;
|
|
1432
|
-
let
|
|
1433
|
-
const
|
|
1434
|
-
const
|
|
1435
|
-
return a.size !== "md" &&
|
|
1436
|
-
}),
|
|
1659
|
+
let u = 0, i = 0, d = "", l = null;
|
|
1660
|
+
const c = H(null), n = ot(), s = `vf-modal-title-${++u}`, v = `vf-modal-body-${u}`, p = y(() => !!a.title || !!n.header), f = y(() => !!n.body || !!n.default), _ = y(() => {
|
|
1661
|
+
const h = ["vf-modal"];
|
|
1662
|
+
return a.size !== "md" && h.push(`vf-modal_${a.size}`), h;
|
|
1663
|
+
}), k = () => o("update:modelValue", !0), x = () => {
|
|
1437
1664
|
o("update:modelValue", !1), o("close");
|
|
1438
|
-
},
|
|
1439
|
-
a.closeOnOverlay &&
|
|
1440
|
-
},
|
|
1441
|
-
!a.modelValue || !a.closeOnEsc ||
|
|
1442
|
-
},
|
|
1665
|
+
}, I = () => {
|
|
1666
|
+
a.closeOnOverlay && x();
|
|
1667
|
+
}, B = (h) => {
|
|
1668
|
+
!a.modelValue || !a.closeOnEsc || h.key === "Escape" && (h.preventDefault(), x());
|
|
1669
|
+
}, W = () => c.value ? Array.from(c.value.querySelectorAll('a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])')).filter((b) => !b.hasAttribute("disabled") && !b.getAttribute("aria-hidden")) : [], F = () => {
|
|
1443
1670
|
var b;
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1446
|
-
},
|
|
1447
|
-
var
|
|
1448
|
-
if (
|
|
1671
|
+
const h = W();
|
|
1672
|
+
h.length ? h[0].focus() : (b = c.value) == null || b.focus();
|
|
1673
|
+
}, z = (h) => {
|
|
1674
|
+
var K;
|
|
1675
|
+
if (h.key !== "Tab")
|
|
1449
1676
|
return;
|
|
1450
|
-
const b =
|
|
1677
|
+
const b = W();
|
|
1451
1678
|
if (!b.length) {
|
|
1452
|
-
|
|
1679
|
+
h.preventDefault(), (K = c.value) == null || K.focus();
|
|
1453
1680
|
return;
|
|
1454
1681
|
}
|
|
1455
|
-
const
|
|
1456
|
-
if (
|
|
1457
|
-
|
|
1682
|
+
const w = b[0], P = b[b.length - 1], D = document.activeElement;
|
|
1683
|
+
if (h.shiftKey && D === w) {
|
|
1684
|
+
h.preventDefault(), P.focus();
|
|
1458
1685
|
return;
|
|
1459
1686
|
}
|
|
1460
|
-
!
|
|
1461
|
-
},
|
|
1462
|
-
!a.lockScroll || typeof document > "u" || (
|
|
1463
|
-
},
|
|
1464
|
-
!a.lockScroll || typeof document > "u" || (
|
|
1687
|
+
!h.shiftKey && D === P && (h.preventDefault(), w.focus());
|
|
1688
|
+
}, O = () => {
|
|
1689
|
+
!a.lockScroll || typeof document > "u" || (i === 0 && (d = document.body.style.overflow, document.body.style.overflow = "hidden"), i += 1);
|
|
1690
|
+
}, V = () => {
|
|
1691
|
+
!a.lockScroll || typeof document > "u" || (i = Math.max(0, i - 1), i === 0 && (document.body.style.overflow = d));
|
|
1465
1692
|
};
|
|
1466
|
-
return
|
|
1693
|
+
return Q(
|
|
1467
1694
|
() => a.modelValue,
|
|
1468
|
-
async (
|
|
1469
|
-
|
|
1695
|
+
async (h) => {
|
|
1696
|
+
h ? (typeof document < "u" && (l = document.activeElement), O(), o("open"), await we(), F(), typeof document < "u" && document.addEventListener("keydown", B)) : (V(), typeof document < "u" && (document.removeEventListener("keydown", B), l == null || l.focus()));
|
|
1470
1697
|
},
|
|
1471
1698
|
{ immediate: !0 }
|
|
1472
|
-
),
|
|
1473
|
-
|
|
1474
|
-
}), e({ open:
|
|
1475
|
-
|
|
1476
|
-
class:
|
|
1699
|
+
), ye(() => {
|
|
1700
|
+
V(), typeof document < "u" && document.removeEventListener("keydown", B);
|
|
1701
|
+
}), e({ open: k, close: x }), (h, b) => (g(), G(Ce, { to: "body" }, [
|
|
1702
|
+
ve(T("div", {
|
|
1703
|
+
class: R(_.value),
|
|
1477
1704
|
role: "presentation"
|
|
1478
1705
|
}, [
|
|
1479
|
-
|
|
1706
|
+
T("div", {
|
|
1480
1707
|
class: "vf-modal__overlay",
|
|
1481
|
-
onClick:
|
|
1708
|
+
onClick: I
|
|
1482
1709
|
}),
|
|
1483
|
-
|
|
1710
|
+
T("div", {
|
|
1484
1711
|
ref_key: "panel",
|
|
1485
|
-
ref:
|
|
1712
|
+
ref: c,
|
|
1486
1713
|
class: "vf-modal__panel",
|
|
1487
1714
|
role: "dialog",
|
|
1488
1715
|
"aria-modal": "true",
|
|
1489
|
-
"aria-labelledby": p.value ?
|
|
1490
|
-
"aria-describedby":
|
|
1716
|
+
"aria-labelledby": p.value ? s : void 0,
|
|
1717
|
+
"aria-describedby": f.value ? v : void 0,
|
|
1491
1718
|
tabindex: "-1",
|
|
1492
|
-
onKeydown:
|
|
1719
|
+
onKeydown: z
|
|
1493
1720
|
}, [
|
|
1494
|
-
p.value ? (g(), C("div",
|
|
1495
|
-
|
|
1496
|
-
id:
|
|
1721
|
+
p.value ? (g(), C("div", ho, [
|
|
1722
|
+
T("div", {
|
|
1723
|
+
id: s,
|
|
1497
1724
|
class: "vf-modal__header-content"
|
|
1498
1725
|
}, [
|
|
1499
|
-
|
|
1500
|
-
|
|
1726
|
+
$(h.$slots, "header", {}, () => [
|
|
1727
|
+
h.title ? (g(), C("h3", yo, A(h.title), 1)) : L("", !0)
|
|
1501
1728
|
])
|
|
1502
1729
|
])
|
|
1503
|
-
])) :
|
|
1504
|
-
|
|
1730
|
+
])) : L("", !0),
|
|
1731
|
+
h.showClose ? $(h.$slots, "close", {
|
|
1505
1732
|
key: 1,
|
|
1506
|
-
close:
|
|
1733
|
+
close: x
|
|
1507
1734
|
}, () => [
|
|
1508
|
-
|
|
1735
|
+
T("button", {
|
|
1509
1736
|
type: "button",
|
|
1510
1737
|
class: "vf-modal__close",
|
|
1511
1738
|
"aria-label": "Close",
|
|
1512
|
-
onClick:
|
|
1739
|
+
onClick: x
|
|
1513
1740
|
}, "×")
|
|
1514
|
-
]) :
|
|
1515
|
-
|
|
1741
|
+
]) : L("", !0),
|
|
1742
|
+
h.$slots.body || h.$slots.default ? (g(), C("div", {
|
|
1516
1743
|
key: 2,
|
|
1517
|
-
id:
|
|
1744
|
+
id: v,
|
|
1518
1745
|
class: "vf-modal__body"
|
|
1519
1746
|
}, [
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
])) :
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
])) :
|
|
1526
|
-
], 40,
|
|
1747
|
+
$(h.$slots, "body"),
|
|
1748
|
+
h.$slots.body ? L("", !0) : $(h.$slots, "default", { key: 0 })
|
|
1749
|
+
])) : L("", !0),
|
|
1750
|
+
h.$slots.footer ? (g(), C("div", Co, [
|
|
1751
|
+
$(h.$slots, "footer")
|
|
1752
|
+
])) : L("", !0)
|
|
1753
|
+
], 40, mo)
|
|
1527
1754
|
], 2), [
|
|
1528
|
-
[
|
|
1755
|
+
[pe, h.modelValue]
|
|
1529
1756
|
])
|
|
1530
1757
|
]));
|
|
1531
1758
|
}
|
|
1532
|
-
}),
|
|
1759
|
+
}), ko = ["data-placement"], _o = { class: "vf-tooltip__content" }, wo = {
|
|
1533
1760
|
key: 0,
|
|
1534
1761
|
class: "vf-tooltip__arrow",
|
|
1535
1762
|
"aria-hidden": "true"
|
|
1536
|
-
},
|
|
1763
|
+
}, Cr = /* @__PURE__ */ M({
|
|
1537
1764
|
__name: "tooltip",
|
|
1538
1765
|
props: {
|
|
1539
1766
|
text: { default: "" },
|
|
@@ -1544,152 +1771,152 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1544
1771
|
setup(t) {
|
|
1545
1772
|
const e = t;
|
|
1546
1773
|
let r = 0;
|
|
1547
|
-
const o =
|
|
1774
|
+
const o = H(null), a = H(null), u = H(!1), i = H("top"), d = `vf-tooltip-${++r}`;
|
|
1548
1775
|
let l = null;
|
|
1549
|
-
const
|
|
1550
|
-
e.disabled || (
|
|
1551
|
-
}, i = () => {
|
|
1552
|
-
c.value = !1;
|
|
1776
|
+
const c = () => {
|
|
1777
|
+
e.disabled || (u.value = !0);
|
|
1553
1778
|
}, n = () => {
|
|
1779
|
+
u.value = !1;
|
|
1780
|
+
}, s = () => {
|
|
1554
1781
|
if (!o.value || !a.value)
|
|
1555
1782
|
return;
|
|
1556
|
-
const p = o.value,
|
|
1783
|
+
const p = o.value, f = a.value, _ = async () => {
|
|
1557
1784
|
const {
|
|
1558
|
-
x:
|
|
1559
|
-
y:
|
|
1560
|
-
placement:
|
|
1561
|
-
} = await
|
|
1785
|
+
x: B,
|
|
1786
|
+
y: W,
|
|
1787
|
+
placement: F
|
|
1788
|
+
} = await Re(p, f, {
|
|
1562
1789
|
placement: e.placement,
|
|
1563
1790
|
strategy: "fixed",
|
|
1564
|
-
middleware: [
|
|
1791
|
+
middleware: [Te(8), Se(), Bt()]
|
|
1565
1792
|
});
|
|
1566
|
-
|
|
1567
|
-
},
|
|
1568
|
-
await
|
|
1569
|
-
},
|
|
1570
|
-
|
|
1571
|
-
}),
|
|
1572
|
-
|
|
1793
|
+
i.value = F ?? e.placement, f.style.left = `${B}px`, f.style.top = `${W}px`;
|
|
1794
|
+
}, k = async () => {
|
|
1795
|
+
await _();
|
|
1796
|
+
}, x = Le(p, () => {
|
|
1797
|
+
k();
|
|
1798
|
+
}), I = () => {
|
|
1799
|
+
k();
|
|
1573
1800
|
};
|
|
1574
|
-
document.addEventListener("scroll",
|
|
1575
|
-
update:
|
|
1801
|
+
document.addEventListener("scroll", I, !0), window.addEventListener("resize", I, !1), l = {
|
|
1802
|
+
update: k,
|
|
1576
1803
|
destroy: () => {
|
|
1577
|
-
|
|
1804
|
+
x(), document.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I, !1);
|
|
1578
1805
|
}
|
|
1579
1806
|
}, l.update();
|
|
1580
1807
|
};
|
|
1581
|
-
|
|
1808
|
+
Q(u, async (p) => {
|
|
1582
1809
|
if (!p) {
|
|
1583
1810
|
l && (l.destroy(), l = null);
|
|
1584
1811
|
return;
|
|
1585
1812
|
}
|
|
1586
|
-
l ||
|
|
1587
|
-
}),
|
|
1588
|
-
|
|
1589
|
-
}),
|
|
1813
|
+
l || s(), l == null || l.update();
|
|
1814
|
+
}), ze(() => {
|
|
1815
|
+
u.value && s();
|
|
1816
|
+
}), ye(() => {
|
|
1590
1817
|
l == null || l.destroy(), l = null;
|
|
1591
1818
|
});
|
|
1592
|
-
const
|
|
1593
|
-
return
|
|
1594
|
-
p || (
|
|
1595
|
-
}), (p,
|
|
1596
|
-
|
|
1819
|
+
const v = y(() => !!e.text || !!(a.value && a.value.textContent));
|
|
1820
|
+
return Q(v, (p) => {
|
|
1821
|
+
p || (u.value = !1);
|
|
1822
|
+
}), (p, f) => (g(), C(fe, null, [
|
|
1823
|
+
T("span", {
|
|
1597
1824
|
ref_key: "trigger",
|
|
1598
1825
|
ref: o,
|
|
1599
1826
|
class: "vf-tooltip__trigger",
|
|
1600
1827
|
"aria-describedby": d,
|
|
1601
|
-
onMouseenter:
|
|
1602
|
-
onMouseleave:
|
|
1603
|
-
onFocus:
|
|
1604
|
-
onBlur:
|
|
1828
|
+
onMouseenter: c,
|
|
1829
|
+
onMouseleave: n,
|
|
1830
|
+
onFocus: c,
|
|
1831
|
+
onBlur: n
|
|
1605
1832
|
}, [
|
|
1606
|
-
|
|
1833
|
+
$(p.$slots, "default")
|
|
1607
1834
|
], 544),
|
|
1608
|
-
(g(),
|
|
1609
|
-
|
|
1835
|
+
(g(), G(Ce, { to: "body" }, [
|
|
1836
|
+
ve(T("div", {
|
|
1610
1837
|
id: d,
|
|
1611
1838
|
ref_key: "panel",
|
|
1612
1839
|
ref: a,
|
|
1613
1840
|
class: "vf-tooltip",
|
|
1614
1841
|
role: "tooltip",
|
|
1615
|
-
"data-placement":
|
|
1842
|
+
"data-placement": i.value
|
|
1616
1843
|
}, [
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1844
|
+
T("span", _o, [
|
|
1845
|
+
$(p.$slots, "content", {}, () => [
|
|
1846
|
+
ee(A(p.text), 1)
|
|
1620
1847
|
])
|
|
1621
1848
|
]),
|
|
1622
|
-
p.arrow ? (g(), C("span",
|
|
1623
|
-
], 8,
|
|
1624
|
-
[
|
|
1849
|
+
p.arrow ? (g(), C("span", wo)) : L("", !0)
|
|
1850
|
+
], 8, ko), [
|
|
1851
|
+
[pe, u.value]
|
|
1625
1852
|
])
|
|
1626
1853
|
]))
|
|
1627
1854
|
], 64));
|
|
1628
1855
|
}
|
|
1629
|
-
}),
|
|
1856
|
+
}), $o = ["dark", "light", "theme", "preset", "colors", "components", "colorScheme"], xo = (t) => {
|
|
1630
1857
|
const e = t.replace(/([A-Z])/g, "-$1");
|
|
1631
1858
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1632
|
-
},
|
|
1633
|
-
if (!
|
|
1859
|
+
}, Bo = (t) => t.filter((e) => !$o.includes(e)).map((e) => xo(e)).join("-").toLowerCase(), Be = (t) => t.join("."), Fo = (t) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t), Ie = (t) => {
|
|
1860
|
+
if (!Fo(t))
|
|
1634
1861
|
return null;
|
|
1635
1862
|
if (t.length === 4) {
|
|
1636
1863
|
const e = t[1], r = t[2], o = t[3];
|
|
1637
1864
|
return `#${e}${e}${r}${r}${o}${o}`;
|
|
1638
1865
|
}
|
|
1639
1866
|
return t.toLowerCase();
|
|
1640
|
-
},
|
|
1641
|
-
const e =
|
|
1867
|
+
}, Ue = (t) => {
|
|
1868
|
+
const e = Ie(t);
|
|
1642
1869
|
if (!e)
|
|
1643
1870
|
return [0, 0, 0];
|
|
1644
|
-
const r = parseInt(e.slice(1), 16), o = r >> 16 & 255, a = r >> 8 & 255,
|
|
1645
|
-
return [o, a,
|
|
1646
|
-
},
|
|
1647
|
-
const [e, r, o] =
|
|
1871
|
+
const r = parseInt(e.slice(1), 16), o = r >> 16 & 255, a = r >> 8 & 255, u = r & 255;
|
|
1872
|
+
return [o, a, u];
|
|
1873
|
+
}, He = (t) => {
|
|
1874
|
+
const [e, r, o] = Ue(t);
|
|
1648
1875
|
return `${e}, ${r}, ${o}`;
|
|
1649
|
-
},
|
|
1650
|
-
const o = t / 255, a = e / 255,
|
|
1651
|
-
let
|
|
1652
|
-
const
|
|
1876
|
+
}, zo = (t, e, r) => {
|
|
1877
|
+
const o = t / 255, a = e / 255, u = r / 255, i = Math.max(o, a, u), d = Math.min(o, a, u), l = i - d;
|
|
1878
|
+
let c = 0, n = 0;
|
|
1879
|
+
const s = (i + d) / 2;
|
|
1653
1880
|
if (l !== 0) {
|
|
1654
|
-
switch (
|
|
1881
|
+
switch (n = l / (1 - Math.abs(2 * s - 1)), i) {
|
|
1655
1882
|
case o:
|
|
1656
|
-
|
|
1883
|
+
c = (a - u) / l % 6;
|
|
1657
1884
|
break;
|
|
1658
1885
|
case a:
|
|
1659
|
-
|
|
1886
|
+
c = (u - o) / l + 2;
|
|
1660
1887
|
break;
|
|
1661
|
-
case
|
|
1662
|
-
|
|
1888
|
+
case u:
|
|
1889
|
+
c = (o - a) / l + 4;
|
|
1663
1890
|
break;
|
|
1664
1891
|
}
|
|
1665
|
-
|
|
1892
|
+
c *= 60, c < 0 && (c += 360);
|
|
1666
1893
|
}
|
|
1667
|
-
return [
|
|
1668
|
-
},
|
|
1669
|
-
const o = e / 100, a = r / 100,
|
|
1670
|
-
let l = 0,
|
|
1671
|
-
t >= 0 && t < 60 ? (l =
|
|
1672
|
-
const
|
|
1673
|
-
return [
|
|
1674
|
-
},
|
|
1675
|
-
const r =
|
|
1894
|
+
return [c, n * 100, s * 100];
|
|
1895
|
+
}, Vo = (t, e, r) => {
|
|
1896
|
+
const o = e / 100, a = r / 100, u = (1 - Math.abs(2 * a - 1)) * o, i = u * (1 - Math.abs(t / 60 % 2 - 1)), d = a - u / 2;
|
|
1897
|
+
let l = 0, c = 0, n = 0;
|
|
1898
|
+
t >= 0 && t < 60 ? (l = u, c = i, n = 0) : t >= 60 && t < 120 ? (l = i, c = u, n = 0) : t >= 120 && t < 180 ? (l = 0, c = u, n = i) : t >= 180 && t < 240 ? (l = 0, c = i, n = u) : t >= 240 && t < 300 ? (l = i, c = 0, n = u) : (l = u, c = 0, n = i);
|
|
1899
|
+
const s = Math.round((l + d) * 255), v = Math.round((c + d) * 255), p = Math.round((n + d) * 255);
|
|
1900
|
+
return [s, v, p];
|
|
1901
|
+
}, So = (t, e, r) => `#${[t, e, r].map((o) => o.toString(16).padStart(2, "0")).join("")}`, To = (t, e, r) => Math.min(r, Math.max(e, t)), Lo = (t, e) => {
|
|
1902
|
+
const r = Ie(t);
|
|
1676
1903
|
if (!r)
|
|
1677
1904
|
return t;
|
|
1678
|
-
const [o, a,
|
|
1679
|
-
return
|
|
1680
|
-
},
|
|
1905
|
+
const [o, a, u] = Ue(r), [i, d, l] = zo(o, a, u), n = (e - 5) * 7, s = To(l + n, 0, 100), [v, p, f] = Vo(i, d, s);
|
|
1906
|
+
return So(v, p, f);
|
|
1907
|
+
}, xe = (t) => !!t && typeof t == "object" && !Array.isArray(t), Oe = (t, e) => {
|
|
1681
1908
|
if (!e)
|
|
1682
1909
|
return { ...t };
|
|
1683
1910
|
const r = { ...t };
|
|
1684
1911
|
for (const o in e) {
|
|
1685
|
-
const a = e[o],
|
|
1686
|
-
|
|
1912
|
+
const a = e[o], u = t[o];
|
|
1913
|
+
xe(u) && xe(a) ? r[o] = Oe(u, a) : r[o] = a;
|
|
1687
1914
|
}
|
|
1688
1915
|
return r;
|
|
1689
|
-
},
|
|
1916
|
+
}, Ro = (t) => {
|
|
1690
1917
|
if (!t)
|
|
1691
1918
|
return null;
|
|
1692
|
-
if (
|
|
1919
|
+
if (xe(t) && "preset" in t) {
|
|
1693
1920
|
const e = t;
|
|
1694
1921
|
return {
|
|
1695
1922
|
preset: e.preset ?? {},
|
|
@@ -1700,42 +1927,42 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1700
1927
|
};
|
|
1701
1928
|
}
|
|
1702
1929
|
return { preset: t };
|
|
1703
|
-
},
|
|
1704
|
-
const e = [], r = [], o = [], a = [],
|
|
1930
|
+
}, Wo = (t) => {
|
|
1931
|
+
const e = [], r = [], o = [], a = [], u = (l) => o.push(l), i = (l) => a.push(l), d = (l, c) => {
|
|
1705
1932
|
if (!(!l || typeof l != "object"))
|
|
1706
|
-
for (const
|
|
1707
|
-
const
|
|
1708
|
-
if (
|
|
1709
|
-
d(
|
|
1933
|
+
for (const n in l) {
|
|
1934
|
+
const s = l[n], v = c.concat([n]);
|
|
1935
|
+
if (xe(s)) {
|
|
1936
|
+
d(s, v);
|
|
1710
1937
|
continue;
|
|
1711
1938
|
}
|
|
1712
|
-
if (
|
|
1713
|
-
|
|
1939
|
+
if (s && typeof s == "object") {
|
|
1940
|
+
i(`Theme value "${Be(v)}" is not a plain object or string and will be ignored.`);
|
|
1714
1941
|
continue;
|
|
1715
1942
|
}
|
|
1716
|
-
if (typeof
|
|
1717
|
-
|
|
1943
|
+
if (typeof s != "string") {
|
|
1944
|
+
i(`Theme value "${Be(v)}" is not a string and will be ignored.`);
|
|
1718
1945
|
continue;
|
|
1719
1946
|
}
|
|
1720
|
-
const
|
|
1721
|
-
if (
|
|
1722
|
-
const
|
|
1723
|
-
if (!
|
|
1724
|
-
|
|
1725
|
-
`Theme color "${
|
|
1947
|
+
const f = v.includes("colorScheme") && v.includes("dark") ? r : e, _ = Bo(v);
|
|
1948
|
+
if (f.push(`--vf-${_}: ${s}`), v.includes("colors")) {
|
|
1949
|
+
const k = Ie(s);
|
|
1950
|
+
if (!k) {
|
|
1951
|
+
u(
|
|
1952
|
+
`Theme color "${Be(v)}" is not hex. Shade variables will not be generated for it.`
|
|
1726
1953
|
);
|
|
1727
1954
|
continue;
|
|
1728
1955
|
}
|
|
1729
|
-
if (
|
|
1730
|
-
for (let
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1956
|
+
if (f.push(`--vf-${_}-rgb: ${He(k)}`), n !== "white")
|
|
1957
|
+
for (let x = 1; x < 10; ++x) {
|
|
1958
|
+
const I = Lo(k, x);
|
|
1959
|
+
f.push(`--vf-${_}-${x}00: ${I}`), f.push(`--vf-${_}-${x}00-rgb: ${He(I)}`);
|
|
1733
1960
|
}
|
|
1734
1961
|
}
|
|
1735
1962
|
}
|
|
1736
1963
|
};
|
|
1737
1964
|
return d(t, []), { baseVars: e, darkVars: r, warnings: o, errors: a };
|
|
1738
|
-
},
|
|
1965
|
+
}, Io = (t) => {
|
|
1739
1966
|
if (typeof document > "u")
|
|
1740
1967
|
return null;
|
|
1741
1968
|
const e = document.getElementById(t);
|
|
@@ -1743,48 +1970,48 @@ const kt = (t, e) => t.strategy ? t.strategy : Ct(e) ? "fixed" : "absolute", ee
|
|
|
1743
1970
|
return e;
|
|
1744
1971
|
const r = document.createElement("style");
|
|
1745
1972
|
return r.id = t, document.head.appendChild(r), r;
|
|
1746
|
-
},
|
|
1973
|
+
}, Oo = (t) => ({
|
|
1747
1974
|
selector: t.selector ?? ":root",
|
|
1748
1975
|
darkSelector: t.darkSelector ?? ":root[data-theme=dark]"
|
|
1749
|
-
}),
|
|
1750
|
-
const { baseVars: a, darkVars:
|
|
1976
|
+
}), Po = (t, e, r, o) => {
|
|
1977
|
+
const { baseVars: a, darkVars: u, warnings: i, errors: d } = Wo(t), l = Io("vueforge-theme");
|
|
1751
1978
|
if (!l)
|
|
1752
1979
|
return;
|
|
1753
1980
|
if (d.length) {
|
|
1754
1981
|
if (o)
|
|
1755
1982
|
throw new Error(`[VueForge] ${d.join(" ")}`);
|
|
1756
|
-
for (const
|
|
1757
|
-
console.warn(`[VueForge] ${
|
|
1983
|
+
for (const n of d)
|
|
1984
|
+
console.warn(`[VueForge] ${n}`);
|
|
1758
1985
|
}
|
|
1759
|
-
if (
|
|
1760
|
-
for (const
|
|
1761
|
-
console.warn(`[VueForge] ${
|
|
1762
|
-
const
|
|
1763
|
-
a.length &&
|
|
1986
|
+
if (i.length)
|
|
1987
|
+
for (const n of i)
|
|
1988
|
+
console.warn(`[VueForge] ${n}`);
|
|
1989
|
+
const c = [];
|
|
1990
|
+
a.length && c.push(`${e} { ${a.join(";")} }`), u.length && c.push(`${r} { ${u.join(";")} }`), l.textContent = c.join(`
|
|
1764
1991
|
`);
|
|
1765
1992
|
};
|
|
1766
|
-
let
|
|
1767
|
-
const
|
|
1768
|
-
const e =
|
|
1993
|
+
let se = null;
|
|
1994
|
+
const qe = (t) => {
|
|
1995
|
+
const e = Ro(t);
|
|
1769
1996
|
if (!e)
|
|
1770
1997
|
return;
|
|
1771
|
-
const r =
|
|
1772
|
-
|
|
1773
|
-
},
|
|
1774
|
-
if (!
|
|
1998
|
+
const r = Oe(e.preset, e.overrides), { selector: o, darkSelector: a } = Oo(e);
|
|
1999
|
+
se = { ...e }, Po(r, o, a, e.strict);
|
|
2000
|
+
}, kr = (t) => {
|
|
2001
|
+
if (!se)
|
|
1775
2002
|
return;
|
|
1776
|
-
const e = t.overrides === void 0 ?
|
|
1777
|
-
preset: t.preset ??
|
|
2003
|
+
const e = t.overrides === void 0 ? se.overrides : Oe(se.overrides ?? {}, t.overrides ?? {}), r = {
|
|
2004
|
+
preset: t.preset ?? se.preset,
|
|
1778
2005
|
overrides: e,
|
|
1779
|
-
selector: t.selector ??
|
|
1780
|
-
darkSelector: t.darkSelector ??
|
|
2006
|
+
selector: t.selector ?? se.selector,
|
|
2007
|
+
darkSelector: t.darkSelector ?? se.darkSelector
|
|
1781
2008
|
};
|
|
1782
|
-
|
|
1783
|
-
},
|
|
2009
|
+
qe(r);
|
|
2010
|
+
}, _r = () => se ? { ...se } : null, wr = {
|
|
1784
2011
|
install(t, e = {}) {
|
|
1785
|
-
e.theme &&
|
|
2012
|
+
e.theme && qe(e.theme);
|
|
1786
2013
|
}
|
|
1787
|
-
},
|
|
2014
|
+
}, Ae = {
|
|
1788
2015
|
colors: {
|
|
1789
2016
|
white: "#ffffff",
|
|
1790
2017
|
green: "#0cbc87",
|
|
@@ -1847,7 +2074,7 @@ const Ue = (t) => {
|
|
|
1847
2074
|
dividerColor: "#2e2e32"
|
|
1848
2075
|
}
|
|
1849
2076
|
}
|
|
1850
|
-
},
|
|
2077
|
+
}, Eo = {
|
|
1851
2078
|
fontSize: "var(--vf-typography-font-size)",
|
|
1852
2079
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
1853
2080
|
borderRadius: "var(--vf-radii-md)",
|
|
@@ -1989,11 +2216,11 @@ const Ue = (t) => {
|
|
|
1989
2216
|
}
|
|
1990
2217
|
}
|
|
1991
2218
|
}
|
|
1992
|
-
},
|
|
2219
|
+
}, Ho = {
|
|
1993
2220
|
padding: "12px",
|
|
1994
2221
|
borderColor: "var(--vf-border-color)",
|
|
1995
2222
|
borderRadius: "var(--vf-radii-md)"
|
|
1996
|
-
},
|
|
2223
|
+
}, Ao = {
|
|
1997
2224
|
gap: "0.5rem",
|
|
1998
2225
|
fontSize: "var(--vf-typography-font-size)",
|
|
1999
2226
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
@@ -2014,7 +2241,7 @@ const Ue = (t) => {
|
|
|
2014
2241
|
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
2015
2242
|
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
2016
2243
|
}
|
|
2017
|
-
},
|
|
2244
|
+
}, Mo = {
|
|
2018
2245
|
gap: "0.5rem",
|
|
2019
2246
|
fontSize: "var(--vf-typography-font-size)",
|
|
2020
2247
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
@@ -2037,10 +2264,10 @@ const Ue = (t) => {
|
|
|
2037
2264
|
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
2038
2265
|
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
2039
2266
|
}
|
|
2040
|
-
},
|
|
2267
|
+
}, Do = {
|
|
2041
2268
|
hoverColor: "var(--vf-blue)",
|
|
2042
2269
|
activeColor: "var(--vf-blue)"
|
|
2043
|
-
},
|
|
2270
|
+
}, Ko = {
|
|
2044
2271
|
iconGap: "6px",
|
|
2045
2272
|
submenuOffset: "12px",
|
|
2046
2273
|
separatorThickness: "1px",
|
|
@@ -2060,7 +2287,7 @@ const Ue = (t) => {
|
|
|
2060
2287
|
marginBottom: "0.5rem",
|
|
2061
2288
|
marginLeft: "0.5rem"
|
|
2062
2289
|
}
|
|
2063
|
-
},
|
|
2290
|
+
}, No = {
|
|
2064
2291
|
width: "90vw",
|
|
2065
2292
|
maxWidth: "520px",
|
|
2066
2293
|
maxHeight: "80vh",
|
|
@@ -2087,9 +2314,9 @@ const Ue = (t) => {
|
|
|
2087
2314
|
closeColor: "var(--vf-text-color)",
|
|
2088
2315
|
closeFontSize: "1.25rem",
|
|
2089
2316
|
closeHoverBackgroundColor: "rgba(0, 0, 0, 0.06)"
|
|
2090
|
-
},
|
|
2317
|
+
}, Xo = {
|
|
2091
2318
|
backgroundColor: "var(--vf-bg-color)"
|
|
2092
|
-
},
|
|
2319
|
+
}, Yo = {
|
|
2093
2320
|
minWidth: "12rem",
|
|
2094
2321
|
fontSize: "var(--vf-typography-font-size)",
|
|
2095
2322
|
controlGap: "0.75rem",
|
|
@@ -2122,7 +2349,46 @@ const Ue = (t) => {
|
|
|
2122
2349
|
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
2123
2350
|
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
2124
2351
|
}
|
|
2125
|
-
},
|
|
2352
|
+
}, jo = {
|
|
2353
|
+
minWidth: "12rem",
|
|
2354
|
+
fontSize: "var(--vf-typography-font-size)",
|
|
2355
|
+
controlGap: "0.5rem",
|
|
2356
|
+
chevronSize: "0.9em",
|
|
2357
|
+
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
2358
|
+
borderRadius: "var(--vf-radii-md)",
|
|
2359
|
+
borderColor: "var(--vf-border-color)",
|
|
2360
|
+
backgroundColor: "var(--vf-controls-background-color)",
|
|
2361
|
+
textColor: "var(--vf-text-color)",
|
|
2362
|
+
placeholderColor: "var(--vf-secondary-text-color)",
|
|
2363
|
+
focusBorderColor: "var(--vf-blue-600)",
|
|
2364
|
+
hoverBorderColor: "var(--vf-blue-500)",
|
|
2365
|
+
disabledOpacity: "var(--vf-states-disabled-opacity)",
|
|
2366
|
+
panelBackgroundColor: "var(--vf-bg-color)",
|
|
2367
|
+
panelBorderColor: "var(--vf-border-color)",
|
|
2368
|
+
panelPadding: "0.35rem",
|
|
2369
|
+
panelMaxHeight: "16rem",
|
|
2370
|
+
panelRadiusOffset: "2px",
|
|
2371
|
+
panelShadow: "0 10px 30px rgba(0, 0, 0, 0.12)",
|
|
2372
|
+
focusRingShadow: "var(--vf-states-focus-ring-shadow)",
|
|
2373
|
+
optionPadding: "0.5rem 0.6rem",
|
|
2374
|
+
optionBorderRadius: "var(--vf-radii-md)",
|
|
2375
|
+
optionHoverBackgroundColor: "rgba(var(--vf-blue-600-rgb), 0.08)",
|
|
2376
|
+
optionActiveBackgroundColor: "rgba(var(--vf-blue-600-rgb), 0.14)",
|
|
2377
|
+
optionActiveTextColor: "var(--vf-text-color)",
|
|
2378
|
+
optionHighlightedBackgroundColor: "rgba(var(--vf-blue-600-rgb), 0.14)",
|
|
2379
|
+
emptyPadding: "0.5rem 0.6rem",
|
|
2380
|
+
emptyColor: "var(--vf-secondary-text-color)",
|
|
2381
|
+
loadingPadding: "0.5rem 0.6rem",
|
|
2382
|
+
loadingColor: "var(--vf-secondary-text-color)",
|
|
2383
|
+
small: {
|
|
2384
|
+
padding: "var(--vf-sizes-sm-padding-y) var(--vf-sizes-sm-padding-x)",
|
|
2385
|
+
fontSize: "var(--vf-sizes-sm-font-size)"
|
|
2386
|
+
},
|
|
2387
|
+
large: {
|
|
2388
|
+
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
2389
|
+
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
2390
|
+
}
|
|
2391
|
+
}, Go = {
|
|
2126
2392
|
size: "1rem",
|
|
2127
2393
|
gap: "0.5rem",
|
|
2128
2394
|
borderRadius: "var(--vf-radii-sm)",
|
|
@@ -2134,7 +2400,7 @@ const Ue = (t) => {
|
|
|
2134
2400
|
checkColor: "#ffffff",
|
|
2135
2401
|
textColor: "var(--vf-text-color)",
|
|
2136
2402
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
2137
|
-
},
|
|
2403
|
+
}, Uo = {
|
|
2138
2404
|
size: "1rem",
|
|
2139
2405
|
dotSize: "0.45rem",
|
|
2140
2406
|
gap: "0.5rem",
|
|
@@ -2148,7 +2414,7 @@ const Ue = (t) => {
|
|
|
2148
2414
|
dotColor: "#ffffff",
|
|
2149
2415
|
textColor: "var(--vf-text-color)",
|
|
2150
2416
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
2151
|
-
},
|
|
2417
|
+
}, qo = {
|
|
2152
2418
|
width: "2.25rem",
|
|
2153
2419
|
height: "1.25rem",
|
|
2154
2420
|
thumbSize: "1rem",
|
|
@@ -2160,7 +2426,7 @@ const Ue = (t) => {
|
|
|
2160
2426
|
thumbColor: "#ffffff",
|
|
2161
2427
|
textColor: "var(--vf-text-color)",
|
|
2162
2428
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
2163
|
-
},
|
|
2429
|
+
}, Zo = {
|
|
2164
2430
|
gap: "0.75rem",
|
|
2165
2431
|
listGap: "0.5rem",
|
|
2166
2432
|
listBorderWidth: "1px",
|
|
@@ -2181,7 +2447,7 @@ const Ue = (t) => {
|
|
|
2181
2447
|
panelBackgroundColor: "transparent",
|
|
2182
2448
|
panelTextColor: "var(--vf-text-color)",
|
|
2183
2449
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
2184
|
-
},
|
|
2450
|
+
}, Jo = {
|
|
2185
2451
|
padding: "0.35rem 0.6rem",
|
|
2186
2452
|
borderRadius: "8px",
|
|
2187
2453
|
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
|
@@ -2192,7 +2458,7 @@ const Ue = (t) => {
|
|
|
2192
2458
|
zIndex: "120",
|
|
2193
2459
|
maxWidth: "240px",
|
|
2194
2460
|
arrowSize: "8px"
|
|
2195
|
-
},
|
|
2461
|
+
}, Qo = {
|
|
2196
2462
|
gap: "0.75rem",
|
|
2197
2463
|
padding: "0.75rem 0.9rem",
|
|
2198
2464
|
borderRadius: "var(--vf-radii-md)",
|
|
@@ -2231,50 +2497,52 @@ const Ue = (t) => {
|
|
|
2231
2497
|
borderColor: "rgba(var(--vf-red-600-rgb), 0.45)",
|
|
2232
2498
|
textColor: "var(--vf-text-color)"
|
|
2233
2499
|
}
|
|
2234
|
-
},
|
|
2235
|
-
...
|
|
2500
|
+
}, $r = {
|
|
2501
|
+
...Ae,
|
|
2236
2502
|
components: {
|
|
2237
|
-
base:
|
|
2238
|
-
button:
|
|
2239
|
-
card:
|
|
2240
|
-
input:
|
|
2241
|
-
textarea:
|
|
2242
|
-
link:
|
|
2243
|
-
menu:
|
|
2244
|
-
modal:
|
|
2245
|
-
popover:
|
|
2246
|
-
select:
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2503
|
+
base: Ae,
|
|
2504
|
+
button: Eo,
|
|
2505
|
+
card: Ho,
|
|
2506
|
+
input: Ao,
|
|
2507
|
+
textarea: Mo,
|
|
2508
|
+
link: Do,
|
|
2509
|
+
menu: Ko,
|
|
2510
|
+
modal: No,
|
|
2511
|
+
popover: Xo,
|
|
2512
|
+
select: Yo,
|
|
2513
|
+
autocomplete: jo,
|
|
2514
|
+
checkbox: Go,
|
|
2515
|
+
radio: Uo,
|
|
2516
|
+
switch: qo,
|
|
2517
|
+
tabs: Zo,
|
|
2518
|
+
tooltip: Jo,
|
|
2519
|
+
toast: Qo
|
|
2253
2520
|
}
|
|
2254
2521
|
};
|
|
2255
2522
|
export {
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2523
|
+
ir as Autocomplete,
|
|
2524
|
+
ar as Button,
|
|
2525
|
+
pt as Card,
|
|
2526
|
+
dr as Checkbox,
|
|
2527
|
+
$r as DefaultTheme,
|
|
2528
|
+
lr as Input,
|
|
2529
|
+
Ne as Link,
|
|
2530
|
+
rr as Menu,
|
|
2531
|
+
yr as Modal,
|
|
2532
|
+
hr as Popover,
|
|
2533
|
+
ur as RadioButton,
|
|
2534
|
+
cr as RadioGroup,
|
|
2535
|
+
sr as Select,
|
|
2536
|
+
mr as Switch,
|
|
2537
|
+
vr as Tab,
|
|
2538
|
+
pr as TabPanel,
|
|
2539
|
+
fr as Tabs,
|
|
2540
|
+
nr as Textarea,
|
|
2541
|
+
br as Toast,
|
|
2542
|
+
gr as ToastContainer,
|
|
2543
|
+
Cr as Tooltip,
|
|
2544
|
+
wr as VueForge,
|
|
2545
|
+
_r as getTheme,
|
|
2546
|
+
qe as setTheme,
|
|
2547
|
+
kr as updateTheme
|
|
2280
2548
|
};
|