@codemonster-ru/vueforge 0.10.0 → 0.12.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 +80 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.ts.mjs +973 -816
- package/dist/index.ts.umd.js +3 -3
- package/dist/package/components/__tests__/radio.test.d.ts +1 -0
- package/dist/package/components/__tests__/textarea.test.d.ts +1 -0
- package/dist/package/components/checkbox.vue.d.ts +3 -0
- package/dist/package/components/radio-button.vue.d.ts +38 -0
- package/dist/package/components/radio-context.d.ts +11 -0
- package/dist/package/components/radio-group.vue.d.ts +39 -0
- package/dist/package/components/select.vue.d.ts +3 -0
- package/dist/package/components/textarea.vue.d.ts +33 -0
- package/dist/package/config/theme-core.d.ts +37 -2
- package/dist/package/themes/default/base.d.ts +1 -0
- package/dist/package/themes/default/components/radio.d.ts +16 -0
- package/dist/package/themes/default/components/textarea.d.ts +25 -0
- package/dist/package/themes/default/index.d.ts +41 -1
- package/package.json +1 -1
- package/dist/package/themes/default/components/codeBlock.d.ts +0 -2
package/dist/index.ts.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as
|
|
1
|
+
import { defineComponent as D, ref as P, computed as C, watch as ne, resolveComponent as Te, openBlock as b, createElementBlock as k, normalizeClass as S, renderSlot as _, Fragment as ce, createTextVNode as te, toDisplayString as A, createBlock as X, withCtx as oe, createCommentVNode as x, createElementVNode as z, renderList as Le, withKeys as le, withModifiers as ae, unref as ie, createVNode as We, nextTick as _e, onMounted as Oe, onBeforeUnmount as $e, Teleport as xe, withDirectives as ke, vShow as Ce, provide as Ge, inject as Ue, reactive as qe, createSlots as Ze, useSlots as Je } from "vue";
|
|
2
|
+
import { useRoute as Qe, useRouter as eo } from "vue-router";
|
|
3
3
|
import { CmIcon as de } from "@codemonster-ru/vueiconify";
|
|
4
|
-
const
|
|
4
|
+
const oo = ["href", "aria-disabled", "tabindex"], He = /* @__PURE__ */ D({
|
|
5
5
|
__name: "link",
|
|
6
6
|
props: {
|
|
7
7
|
to: { default: void 0 },
|
|
@@ -14,14 +14,14 @@ const Je = ["href", "aria-disabled", "tabindex"], He = /* @__PURE__ */ U({
|
|
|
14
14
|
disabled: { type: Boolean }
|
|
15
15
|
},
|
|
16
16
|
emits: ["click", "active", "update:active", "onActive"],
|
|
17
|
-
setup(
|
|
18
|
-
const r = e,
|
|
19
|
-
if (
|
|
17
|
+
setup(o, { emit: e }) {
|
|
18
|
+
const r = e, t = o, l = Qe(), u = eo(), i = P(null), d = C(() => t.href ?? t.url), a = C(() => t.as ? t.as === "router-link" && !t.to ? "a" : t.as : t.type === "router-link" || t.type === "a" ? t.type === "router-link" && !t.to ? "a" : t.type : t.to ? "router-link" : "a"), c = C(() => t.to), n = C(() => t.to ? u.resolve(t.to) : null), s = C(() => {
|
|
19
|
+
if (a.value !== "router-link")
|
|
20
20
|
return !1;
|
|
21
|
-
const p =
|
|
21
|
+
const p = n.value;
|
|
22
22
|
return p ? p.name ? l.matched.some(({ name: w }) => w === p.name) : p.fullPath ? l.fullPath === p.fullPath : l.path === p.path : !1;
|
|
23
|
-
}),
|
|
24
|
-
if (!
|
|
23
|
+
}), f = C(() => t.active === void 0 ? s.value : t.active), v = (p) => {
|
|
24
|
+
if (!t.disabled) {
|
|
25
25
|
r("click", p);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
@@ -30,81 +30,81 @@ const Je = ["href", "aria-disabled", "tabindex"], He = /* @__PURE__ */ U({
|
|
|
30
30
|
return ne(s, (p) => {
|
|
31
31
|
p && (r("active"), r("onActive")), r("update:active", p);
|
|
32
32
|
}), (p, w) => {
|
|
33
|
-
const
|
|
34
|
-
return
|
|
33
|
+
const h = Te("router-link");
|
|
34
|
+
return a.value === "a" ? (b(), k("a", {
|
|
35
35
|
key: 0,
|
|
36
|
-
href:
|
|
37
|
-
class:
|
|
36
|
+
href: d.value,
|
|
37
|
+
class: S(["vf-link", { "vf-link_active": f.value, "vf-link_disabled": p.disabled }]),
|
|
38
38
|
"aria-disabled": p.disabled,
|
|
39
39
|
tabindex: p.disabled ? -1 : void 0,
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: v
|
|
41
41
|
}, [
|
|
42
|
-
p.$slots.default ? _(p.$slots, "default", { key: 0 }) : (
|
|
43
|
-
|
|
42
|
+
p.$slots.default ? _(p.$slots, "default", { key: 0 }) : (b(), k(ce, { key: 1 }, [
|
|
43
|
+
te(A(p.label), 1)
|
|
44
44
|
], 64))
|
|
45
|
-
], 10,
|
|
45
|
+
], 10, oo)) : (b(), X(h, {
|
|
46
46
|
key: 1,
|
|
47
47
|
ref_key: "link",
|
|
48
48
|
ref: i,
|
|
49
|
-
to:
|
|
50
|
-
class:
|
|
49
|
+
to: c.value,
|
|
50
|
+
class: S(["vf-link", { "vf-link_active": f.value }]),
|
|
51
51
|
"aria-disabled": p.disabled,
|
|
52
52
|
tabindex: p.disabled ? -1 : void 0,
|
|
53
53
|
"active-class": "vf-link_partially-active",
|
|
54
54
|
"exact-active-class": "vf-link_active",
|
|
55
|
-
onClick:
|
|
55
|
+
onClick: v
|
|
56
56
|
}, {
|
|
57
|
-
default:
|
|
58
|
-
p.$slots.default ? _(p.$slots, "default", { key: 0 }) : (
|
|
59
|
-
|
|
57
|
+
default: oe(() => [
|
|
58
|
+
p.$slots.default ? _(p.$slots, "default", { key: 0 }) : (b(), k(ce, { key: 1 }, [
|
|
59
|
+
te(A(p.label), 1)
|
|
60
60
|
], 64))
|
|
61
61
|
]),
|
|
62
62
|
_: 3
|
|
63
63
|
}, 8, ["to", "class", "aria-disabled", "tabindex"]));
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
}),
|
|
67
|
-
const r =
|
|
68
|
-
for (const [
|
|
69
|
-
r[
|
|
66
|
+
}), to = (o, e) => {
|
|
67
|
+
const r = o.__vccOpts || o;
|
|
68
|
+
for (const [t, l] of e)
|
|
69
|
+
r[t] = l;
|
|
70
70
|
return r;
|
|
71
|
-
},
|
|
71
|
+
}, ro = {}, lo = { class: "vf-card" }, ao = {
|
|
72
72
|
key: 0,
|
|
73
73
|
class: "vf-card__default"
|
|
74
|
-
},
|
|
74
|
+
}, no = {
|
|
75
75
|
key: 1,
|
|
76
76
|
class: "vf-card__header"
|
|
77
|
-
},
|
|
77
|
+
}, so = {
|
|
78
78
|
key: 2,
|
|
79
79
|
class: "vf-card__body"
|
|
80
|
-
},
|
|
80
|
+
}, io = {
|
|
81
81
|
key: 3,
|
|
82
82
|
class: "vf-card__footer"
|
|
83
83
|
};
|
|
84
|
-
function
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
_(
|
|
88
|
-
])) :
|
|
89
|
-
|
|
90
|
-
_(
|
|
91
|
-
])) :
|
|
92
|
-
|
|
93
|
-
_(
|
|
94
|
-
])) :
|
|
95
|
-
|
|
96
|
-
_(
|
|
97
|
-
])) :
|
|
84
|
+
function co(o, e) {
|
|
85
|
+
return b(), k("div", lo, [
|
|
86
|
+
o.$slots.default ? (b(), k("div", ao, [
|
|
87
|
+
_(o.$slots, "default")
|
|
88
|
+
])) : x("", !0),
|
|
89
|
+
o.$slots.header ? (b(), k("div", no, [
|
|
90
|
+
_(o.$slots, "header")
|
|
91
|
+
])) : x("", !0),
|
|
92
|
+
o.$slots.body ? (b(), k("div", so, [
|
|
93
|
+
_(o.$slots, "body")
|
|
94
|
+
])) : x("", !0),
|
|
95
|
+
o.$slots.footer ? (b(), k("div", io, [
|
|
96
|
+
_(o.$slots, "footer")
|
|
97
|
+
])) : x("", !0)
|
|
98
98
|
]);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const uo = /* @__PURE__ */ to(ro, [["render", co]]), fo = {
|
|
101
101
|
class: "vf-menu__list",
|
|
102
102
|
role: "menu"
|
|
103
|
-
},
|
|
103
|
+
}, vo = {
|
|
104
104
|
key: 1,
|
|
105
105
|
class: "vf-menu__separator",
|
|
106
106
|
role: "separator"
|
|
107
|
-
},
|
|
107
|
+
}, po = ["aria-expanded", "onClick", "onKeydown"], Ht = /* @__PURE__ */ D({
|
|
108
108
|
name: "VfMenu",
|
|
109
109
|
__name: "menu",
|
|
110
110
|
props: {
|
|
@@ -112,88 +112,88 @@ const st = /* @__PURE__ */ Qe(et, [["render", at]]), it = {
|
|
|
112
112
|
orientation: { default: "vertical" }
|
|
113
113
|
},
|
|
114
114
|
emits: ["active", "onActive"],
|
|
115
|
-
setup(
|
|
116
|
-
const r = e,
|
|
115
|
+
setup(o, { emit: e }) {
|
|
116
|
+
const r = e, t = o, l = P([]), 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
117
|
...s,
|
|
118
|
-
items: s.items ?
|
|
119
|
-
})),
|
|
120
|
-
|
|
121
|
-
s !==
|
|
122
|
-
}),
|
|
123
|
-
},
|
|
118
|
+
items: s.items ? d(s.items) : void 0
|
|
119
|
+
})), a = (n) => {
|
|
120
|
+
n.items && n.items.length ? (l.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
124
|
var s;
|
|
125
|
-
for (const
|
|
126
|
-
const
|
|
127
|
-
Object.prototype.hasOwnProperty.call(
|
|
125
|
+
for (const f in l.value) {
|
|
126
|
+
const v = l.value[f];
|
|
127
|
+
Object.prototype.hasOwnProperty.call(v, "items") && ((s = v.items) != null && s.some((p) => p === n) ? (v.active = !0, v.subMenuVisible = !0) : (v.active = !1, v.subMenuVisible = !1));
|
|
128
128
|
}
|
|
129
|
-
r("active",
|
|
129
|
+
r("active", n), r("onActive", n);
|
|
130
130
|
};
|
|
131
131
|
return ne(
|
|
132
|
-
() =>
|
|
133
|
-
(
|
|
134
|
-
l.value =
|
|
132
|
+
() => t.items,
|
|
133
|
+
(n) => {
|
|
134
|
+
l.value = d(n);
|
|
135
135
|
},
|
|
136
136
|
{ deep: !0, immediate: !0 }
|
|
137
|
-
), (
|
|
138
|
-
const
|
|
139
|
-
return
|
|
140
|
-
class:
|
|
137
|
+
), (n, s) => {
|
|
138
|
+
const f = Te("VfMenu");
|
|
139
|
+
return b(), k("div", {
|
|
140
|
+
class: S(["vf-menu", `vf-menu_${n.orientation}`])
|
|
141
141
|
}, [
|
|
142
|
-
|
|
143
|
-
(
|
|
144
|
-
key:
|
|
142
|
+
z("ul", fo, [
|
|
143
|
+
(b(!0), k(ce, null, Le(l.value, (v, p) => (b(), k("li", {
|
|
144
|
+
key: u(v, p),
|
|
145
145
|
class: "vf-menu__item",
|
|
146
146
|
role: "none"
|
|
147
147
|
}, [
|
|
148
|
-
|
|
148
|
+
n.$slots[u(v, p)] ? _(n.$slots, u(v, p), {
|
|
149
149
|
key: 0,
|
|
150
|
-
item: { ...
|
|
151
|
-
}) :
|
|
152
|
-
|
|
153
|
-
class:
|
|
150
|
+
item: { ...v, class: "vf-menu__link" }
|
|
151
|
+
}) : v.separator ? (b(), k("hr", vo)) : v.items && v.items.length ? (b(), k(ce, { key: 2 }, [
|
|
152
|
+
z("div", {
|
|
153
|
+
class: S(["vf-menu__parent", { "vf-menu__parent_active": v.active }]),
|
|
154
154
|
role: "menuitem",
|
|
155
155
|
tabindex: "0",
|
|
156
|
-
"aria-expanded":
|
|
157
|
-
onClick: (w) =>
|
|
156
|
+
"aria-expanded": v.subMenuVisible ? "true" : "false",
|
|
157
|
+
onClick: (w) => a(v),
|
|
158
158
|
onKeydown: [
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
le(ae((w) => a(v), ["prevent"]), ["enter"]),
|
|
160
|
+
le(ae((w) => a(v), ["prevent"]), ["space"])
|
|
161
161
|
]
|
|
162
162
|
}, [
|
|
163
|
-
|
|
163
|
+
v.icon ? (b(), X(ie(de), {
|
|
164
164
|
key: 0,
|
|
165
|
-
icon:
|
|
165
|
+
icon: v.icon,
|
|
166
166
|
class: "vf-menu__icon"
|
|
167
|
-
}, null, 8, ["icon"])) :
|
|
168
|
-
|
|
167
|
+
}, null, 8, ["icon"])) : x("", !0),
|
|
168
|
+
te(" " + A(v.label) + " ", 1),
|
|
169
169
|
We(ie(de), { icon: "chevronDown" })
|
|
170
|
-
], 42,
|
|
171
|
-
|
|
170
|
+
], 42, po),
|
|
171
|
+
v.items ? (b(), X(f, {
|
|
172
172
|
key: 0,
|
|
173
|
-
items:
|
|
174
|
-
class:
|
|
175
|
-
onOnActive:
|
|
176
|
-
}, null, 8, ["items", "class"])) :
|
|
177
|
-
], 64)) : (
|
|
173
|
+
items: v.items,
|
|
174
|
+
class: S(["vf-menu__submenu", { "vf-menu__submenu_visible": v.subMenuVisible }]),
|
|
175
|
+
onOnActive: c
|
|
176
|
+
}, null, 8, ["items", "class"])) : x("", !0)
|
|
177
|
+
], 64)) : (b(), X(He, {
|
|
178
178
|
key: 3,
|
|
179
|
-
to:
|
|
180
|
-
href:
|
|
181
|
-
as: i(
|
|
179
|
+
to: v.to,
|
|
180
|
+
href: v.href ?? v.url,
|
|
181
|
+
as: i(v),
|
|
182
182
|
class: "vf-menu__link",
|
|
183
|
-
active:
|
|
184
|
-
disabled:
|
|
183
|
+
active: v.active,
|
|
184
|
+
disabled: v.disabled,
|
|
185
185
|
role: "menuitem",
|
|
186
|
-
"aria-disabled":
|
|
187
|
-
onClick: (w) =>
|
|
188
|
-
onActive: (w) =>
|
|
186
|
+
"aria-disabled": v.disabled ? "true" : "false",
|
|
187
|
+
onClick: (w) => a(v),
|
|
188
|
+
onActive: (w) => c(v)
|
|
189
189
|
}, {
|
|
190
|
-
default:
|
|
191
|
-
|
|
190
|
+
default: oe(() => [
|
|
191
|
+
v.icon ? (b(), X(ie(de), {
|
|
192
192
|
key: 0,
|
|
193
|
-
icon:
|
|
193
|
+
icon: v.icon,
|
|
194
194
|
class: "vf-menu__icon"
|
|
195
|
-
}, null, 8, ["icon"])) :
|
|
196
|
-
|
|
195
|
+
}, null, 8, ["icon"])) : x("", !0),
|
|
196
|
+
te(" " + A(v.label), 1)
|
|
197
197
|
]),
|
|
198
198
|
_: 2
|
|
199
199
|
}, 1032, ["to", "href", "as", "active", "disabled", "aria-disabled", "onClick", "onActive"]))
|
|
@@ -202,7 +202,7 @@ const st = /* @__PURE__ */ Qe(et, [["render", at]]), it = {
|
|
|
202
202
|
], 2);
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
}),
|
|
205
|
+
}), go = ["type", "disabled"], Et = /* @__PURE__ */ D({
|
|
206
206
|
__name: "button",
|
|
207
207
|
props: {
|
|
208
208
|
to: { default: void 0 },
|
|
@@ -220,71 +220,71 @@ const st = /* @__PURE__ */ Qe(et, [["render", at]]), it = {
|
|
|
220
220
|
severity: { default: "primary" },
|
|
221
221
|
disabled: { type: Boolean, default: !1 }
|
|
222
222
|
},
|
|
223
|
-
setup(
|
|
224
|
-
const e =
|
|
225
|
-
let
|
|
226
|
-
return ["top", "bottom"].includes(e.iconPos) &&
|
|
227
|
-
}),
|
|
228
|
-
return (
|
|
223
|
+
setup(o) {
|
|
224
|
+
const e = o, r = ["button", "submit", "reset"], t = (n) => !!n && r.includes(n), l = C(() => e.as ? e.as === "button" : !(e.to || e.href || e.url || e.type && !t(e.type))), u = C(() => t(e.type) ? e.type : "button"), i = C(() => e.as === "link" ? e.to ? "router-link" : "a" : e.type && !t(e.type) ? e.type === "router-link" && e.to ? "router-link" : "a" : e.to ? "router-link" : "a"), d = C(() => {
|
|
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
|
+
}), a = C(() => ["vf-button__icon", `vf-button__icon_${e.iconPos}`]), c = C(() => ["vf-button__label"]);
|
|
228
|
+
return (n, s) => l.value ? (b(), k("button", {
|
|
229
229
|
key: 0,
|
|
230
|
-
type:
|
|
231
|
-
class:
|
|
230
|
+
type: u.value,
|
|
231
|
+
class: S(d.value),
|
|
232
232
|
disabled: e.loading || e.disabled
|
|
233
233
|
}, [
|
|
234
|
-
e.icon && !e.loading ? (
|
|
234
|
+
e.icon && !e.loading ? (b(), X(ie(de), {
|
|
235
235
|
key: 0,
|
|
236
236
|
icon: e.icon,
|
|
237
|
-
class:
|
|
238
|
-
}, null, 8, ["icon", "class"])) :
|
|
239
|
-
e.loading ? (
|
|
237
|
+
class: S(a.value)
|
|
238
|
+
}, null, 8, ["icon", "class"])) : x("", !0),
|
|
239
|
+
e.loading ? (b(), X(ie(de), {
|
|
240
240
|
key: 1,
|
|
241
241
|
icon: "circleNotch",
|
|
242
|
-
class:
|
|
242
|
+
class: S(a.value),
|
|
243
243
|
spin: ""
|
|
244
|
-
}, null, 8, ["class"])) :
|
|
245
|
-
|
|
244
|
+
}, null, 8, ["class"])) : x("", !0),
|
|
245
|
+
n.$slots.default ? (b(), k("span", {
|
|
246
246
|
key: 2,
|
|
247
|
-
class:
|
|
247
|
+
class: S(c.value)
|
|
248
248
|
}, [
|
|
249
|
-
_(
|
|
250
|
-
], 2)) :
|
|
249
|
+
_(n.$slots, "default")
|
|
250
|
+
], 2)) : n.label ? (b(), k("span", {
|
|
251
251
|
key: 3,
|
|
252
|
-
class:
|
|
253
|
-
},
|
|
254
|
-
], 10,
|
|
252
|
+
class: S(c.value)
|
|
253
|
+
}, A(n.label), 3)) : x("", !0)
|
|
254
|
+
], 10, go)) : (b(), X(He, {
|
|
255
255
|
key: 1,
|
|
256
256
|
to: e.to,
|
|
257
257
|
href: e.href ?? e.url,
|
|
258
258
|
as: i.value,
|
|
259
|
-
class:
|
|
259
|
+
class: S(d.value),
|
|
260
260
|
disabled: e.loading || e.disabled
|
|
261
261
|
}, {
|
|
262
|
-
default:
|
|
263
|
-
e.icon ? (
|
|
262
|
+
default: oe(() => [
|
|
263
|
+
e.icon ? (b(), X(ie(de), {
|
|
264
264
|
key: 0,
|
|
265
265
|
icon: e.icon,
|
|
266
|
-
class:
|
|
267
|
-
}, null, 8, ["icon", "class"])) :
|
|
268
|
-
|
|
266
|
+
class: S(a.value)
|
|
267
|
+
}, null, 8, ["icon", "class"])) : x("", !0),
|
|
268
|
+
n.$slots.default ? (b(), k("span", {
|
|
269
269
|
key: 1,
|
|
270
|
-
class:
|
|
270
|
+
class: S(c.value)
|
|
271
271
|
}, [
|
|
272
|
-
_(
|
|
273
|
-
], 2)) :
|
|
272
|
+
_(n.$slots, "default")
|
|
273
|
+
], 2)) : n.label ? (b(), k("span", {
|
|
274
274
|
key: 2,
|
|
275
|
-
class:
|
|
276
|
-
},
|
|
275
|
+
class: S(c.value)
|
|
276
|
+
}, A(n.label), 3)) : x("", !0)
|
|
277
277
|
]),
|
|
278
278
|
_: 3
|
|
279
279
|
}, 8, ["to", "href", "as", "class", "disabled"]));
|
|
280
280
|
}
|
|
281
|
-
}),
|
|
281
|
+
}), bo = {
|
|
282
282
|
key: 0,
|
|
283
283
|
class: "vf-input__prefix"
|
|
284
|
-
},
|
|
284
|
+
}, mo = ["type", "value", "placeholder", "disabled", "readonly"], ho = {
|
|
285
285
|
key: 1,
|
|
286
286
|
class: "vf-input__suffix"
|
|
287
|
-
},
|
|
287
|
+
}, Mt = /* @__PURE__ */ D({
|
|
288
288
|
__name: "input",
|
|
289
289
|
props: {
|
|
290
290
|
modelValue: { default: "" },
|
|
@@ -296,35 +296,72 @@ const st = /* @__PURE__ */ Qe(et, [["render", at]]), it = {
|
|
|
296
296
|
variant: { default: "filled" }
|
|
297
297
|
},
|
|
298
298
|
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
299
|
-
setup(
|
|
300
|
-
const r = e,
|
|
301
|
-
const
|
|
302
|
-
return
|
|
303
|
-
}),
|
|
304
|
-
const
|
|
305
|
-
r("update:modelValue",
|
|
306
|
-
}, i = (
|
|
307
|
-
return (
|
|
308
|
-
class:
|
|
299
|
+
setup(o, { emit: e }) {
|
|
300
|
+
const r = e, t = o, l = C(() => {
|
|
301
|
+
const c = ["vf-input", `vf-input_${t.variant}`];
|
|
302
|
+
return t.size !== "normal" && c.push(`vf-input_${t.size}`), t.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), a = (c) => r("blur", c);
|
|
307
|
+
return (c, n) => (b(), k("div", {
|
|
308
|
+
class: S(l.value)
|
|
309
309
|
}, [
|
|
310
|
-
|
|
311
|
-
_(
|
|
312
|
-
])) :
|
|
313
|
-
|
|
310
|
+
c.$slots.prefix ? (b(), k("span", bo, [
|
|
311
|
+
_(c.$slots, "prefix")
|
|
312
|
+
])) : x("", !0),
|
|
313
|
+
z("input", {
|
|
314
314
|
class: "vf-input__control",
|
|
315
|
-
type:
|
|
316
|
-
value:
|
|
317
|
-
placeholder:
|
|
318
|
-
disabled:
|
|
319
|
-
readonly:
|
|
320
|
-
onInput:
|
|
315
|
+
type: c.type,
|
|
316
|
+
value: c.modelValue,
|
|
317
|
+
placeholder: c.placeholder,
|
|
318
|
+
disabled: c.disabled,
|
|
319
|
+
readonly: c.readonly,
|
|
320
|
+
onInput: u,
|
|
321
321
|
onChange: i,
|
|
322
|
-
onFocus:
|
|
323
|
-
onBlur:
|
|
324
|
-
}, null, 40,
|
|
325
|
-
|
|
326
|
-
_(
|
|
327
|
-
])) :
|
|
322
|
+
onFocus: d,
|
|
323
|
+
onBlur: a
|
|
324
|
+
}, null, 40, mo),
|
|
325
|
+
c.$slots.suffix ? (b(), k("span", ho, [
|
|
326
|
+
_(c.$slots, "suffix")
|
|
327
|
+
])) : x("", !0)
|
|
328
|
+
], 2));
|
|
329
|
+
}
|
|
330
|
+
}), yo = ["value", "placeholder", "disabled", "readonly", "rows"], Pt = /* @__PURE__ */ D({
|
|
331
|
+
__name: "textarea",
|
|
332
|
+
props: {
|
|
333
|
+
modelValue: { default: "" },
|
|
334
|
+
placeholder: { default: "" },
|
|
335
|
+
disabled: { type: Boolean, default: !1 },
|
|
336
|
+
readonly: { type: Boolean, default: !1 },
|
|
337
|
+
size: { default: "normal" },
|
|
338
|
+
variant: { default: "filled" },
|
|
339
|
+
rows: { default: 3 }
|
|
340
|
+
},
|
|
341
|
+
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
342
|
+
setup(o, { emit: e }) {
|
|
343
|
+
const r = e, t = o, l = C(() => {
|
|
344
|
+
const c = ["vf-textarea", `vf-textarea_${t.variant}`];
|
|
345
|
+
return t.size !== "normal" && c.push(`vf-textarea_${t.size}`), t.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), a = (c) => r("blur", c);
|
|
350
|
+
return (c, n) => (b(), k("div", {
|
|
351
|
+
class: S(l.value)
|
|
352
|
+
}, [
|
|
353
|
+
z("textarea", {
|
|
354
|
+
class: "vf-textarea__control",
|
|
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
|
+
onFocus: d,
|
|
363
|
+
onBlur: a
|
|
364
|
+
}, null, 40, yo)
|
|
328
365
|
], 2));
|
|
329
366
|
}
|
|
330
367
|
}), ze = [
|
|
@@ -340,406 +377,406 @@ const st = /* @__PURE__ */ Qe(et, [["render", at]]), it = {
|
|
|
340
377
|
"left",
|
|
341
378
|
"left-start",
|
|
342
379
|
"left-end"
|
|
343
|
-
], q = (
|
|
344
|
-
if (
|
|
380
|
+
], q = (o) => {
|
|
381
|
+
if (o == null || !(o instanceof HTMLElement))
|
|
345
382
|
return null;
|
|
346
383
|
if (typeof window < "u") {
|
|
347
|
-
const e = window.getComputedStyle(
|
|
384
|
+
const e = window.getComputedStyle(o), r = `${e.overflowX}${e.overflowY}`;
|
|
348
385
|
if (/(auto|scroll|overlay)/.test(r))
|
|
349
|
-
return
|
|
386
|
+
return o;
|
|
350
387
|
}
|
|
351
|
-
return
|
|
388
|
+
return o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth ? o : q(o.parentNode);
|
|
352
389
|
};
|
|
353
|
-
function
|
|
354
|
-
return typeof window > "u" ? !1 : window.getComputedStyle(
|
|
390
|
+
function ko(o) {
|
|
391
|
+
return typeof window > "u" ? !1 : window.getComputedStyle(o).position === "fixed";
|
|
355
392
|
}
|
|
356
|
-
const
|
|
357
|
-
const
|
|
358
|
-
if (l && !
|
|
359
|
-
const i = l.getBoundingClientRect(),
|
|
393
|
+
const Co = (o, e) => o.strategy ? o.strategy : ko(e) ? "fixed" : "absolute", Q = (o, e) => Co(o, e) === "fixed", I = (o, e, r = {}) => {
|
|
394
|
+
const t = o.getBoundingClientRect(), l = e ? e.offsetParent : null, u = e ? Q(r, e) : !1;
|
|
395
|
+
if (l && !u) {
|
|
396
|
+
const i = l.getBoundingClientRect(), d = l.scrollLeft, a = l.scrollTop;
|
|
360
397
|
return {
|
|
361
|
-
left:
|
|
362
|
-
top:
|
|
363
|
-
width:
|
|
364
|
-
height:
|
|
398
|
+
left: t.left - i.left + d,
|
|
399
|
+
top: t.top - i.top + a,
|
|
400
|
+
width: t.width,
|
|
401
|
+
height: t.height
|
|
365
402
|
};
|
|
366
403
|
}
|
|
367
404
|
return {
|
|
368
|
-
left:
|
|
369
|
-
top:
|
|
370
|
-
width:
|
|
371
|
-
height:
|
|
405
|
+
left: t.left,
|
|
406
|
+
top: t.top,
|
|
407
|
+
width: t.width,
|
|
408
|
+
height: t.height
|
|
372
409
|
};
|
|
373
|
-
},
|
|
410
|
+
}, re = (o, e) => {
|
|
374
411
|
var r;
|
|
375
|
-
return (r =
|
|
376
|
-
}, Ee = (
|
|
377
|
-
const e = q(
|
|
412
|
+
return (r = o.middleware) == null ? void 0 : r.find((t) => t.name === e);
|
|
413
|
+
}, Ee = (o, e) => !!re(o, e), wo = (o) => {
|
|
414
|
+
const e = q(o);
|
|
378
415
|
let r = "";
|
|
379
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;
|
|
380
|
-
},
|
|
381
|
-
if (r === null && typeof window < "u" && Q(
|
|
382
|
-
return
|
|
383
|
-
let
|
|
417
|
+
}, be = (o) => o.scrollLeft + o.clientWidth, me = (o) => o.scrollTop + o.clientHeight, K = (o, e, r = null, t = {}, l) => {
|
|
418
|
+
if (r === null && typeof window < "u" && Q(t, e))
|
|
419
|
+
return o;
|
|
420
|
+
let u = 0;
|
|
384
421
|
if (r === null) {
|
|
385
422
|
const i = q(e);
|
|
386
|
-
|
|
423
|
+
u = i ? i.scrollTop : 0;
|
|
387
424
|
}
|
|
388
|
-
return
|
|
389
|
-
},
|
|
390
|
-
let
|
|
391
|
-
if (r === null && typeof window < "u" && Q(
|
|
392
|
-
|
|
425
|
+
return o - u;
|
|
426
|
+
}, G = (o, e, r = null, t = {}, l) => {
|
|
427
|
+
let u;
|
|
428
|
+
if (r === null && typeof window < "u" && Q(t, e))
|
|
429
|
+
u = window.innerWidth;
|
|
393
430
|
else if (r === null) {
|
|
394
431
|
const i = q(e);
|
|
395
|
-
|
|
432
|
+
u = i ? be(i) : 0;
|
|
396
433
|
} else
|
|
397
|
-
|
|
398
|
-
return -(
|
|
399
|
-
}, Z = (
|
|
400
|
-
let
|
|
401
|
-
if (r === null && typeof window < "u" && Q(
|
|
402
|
-
|
|
434
|
+
u = r.getBoundingClientRect().width;
|
|
435
|
+
return -(o + e.clientWidth - u);
|
|
436
|
+
}, Z = (o, e, r = null, t = {}, l) => {
|
|
437
|
+
let u;
|
|
438
|
+
if (r === null && typeof window < "u" && Q(t, e))
|
|
439
|
+
u = window.innerHeight;
|
|
403
440
|
else if (r === null) {
|
|
404
441
|
const i = q(e);
|
|
405
|
-
|
|
442
|
+
u = i ? me(i) : 0;
|
|
406
443
|
} else
|
|
407
|
-
|
|
408
|
-
return -(
|
|
409
|
-
},
|
|
410
|
-
if (r === null && typeof window < "u" && Q(
|
|
411
|
-
return
|
|
412
|
-
let
|
|
444
|
+
u = r.getBoundingClientRect().height;
|
|
445
|
+
return -(o + e.clientHeight - u);
|
|
446
|
+
}, U = (o, e, r = null, t = {}, l) => {
|
|
447
|
+
if (r === null && typeof window < "u" && Q(t, e))
|
|
448
|
+
return o;
|
|
449
|
+
let u = 0;
|
|
413
450
|
if (r === null) {
|
|
414
451
|
const i = q(e);
|
|
415
|
-
|
|
452
|
+
u = i ? i.scrollLeft : 0;
|
|
416
453
|
}
|
|
417
|
-
return
|
|
454
|
+
return o - u;
|
|
418
455
|
}, Se = ({
|
|
419
|
-
options:
|
|
456
|
+
options: o,
|
|
420
457
|
primaryX: e,
|
|
421
458
|
primaryY: r,
|
|
422
|
-
floating:
|
|
459
|
+
floating: t,
|
|
423
460
|
placement: l,
|
|
424
|
-
reference:
|
|
461
|
+
reference: u,
|
|
425
462
|
scrollDirection: i
|
|
426
463
|
}) => {
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
x:
|
|
431
|
-
y:
|
|
432
|
-
options:
|
|
464
|
+
const d = he(u, t, l, o), a = re(o, "offset");
|
|
465
|
+
if (a) {
|
|
466
|
+
const c = a.fn({
|
|
467
|
+
x: d.x,
|
|
468
|
+
y: d.y,
|
|
469
|
+
options: o,
|
|
433
470
|
primaryX: e,
|
|
434
471
|
primaryY: r,
|
|
435
|
-
floating:
|
|
472
|
+
floating: t,
|
|
436
473
|
placement: l,
|
|
437
|
-
reference:
|
|
474
|
+
reference: u,
|
|
438
475
|
scrollDirection: i
|
|
439
476
|
});
|
|
440
|
-
|
|
477
|
+
d.x = c.x, d.y = c.y;
|
|
441
478
|
}
|
|
442
|
-
return
|
|
443
|
-
x:
|
|
444
|
-
y:
|
|
479
|
+
return Mo(d, t, u, o) ? {
|
|
480
|
+
x: d.x,
|
|
481
|
+
y: d.y,
|
|
445
482
|
placement: l
|
|
446
483
|
} : !1;
|
|
447
|
-
}, Me = (
|
|
484
|
+
}, Me = (o) => ({
|
|
448
485
|
name: "flip",
|
|
449
|
-
params:
|
|
486
|
+
params: o,
|
|
450
487
|
fn: ({
|
|
451
488
|
x: e,
|
|
452
489
|
y: r,
|
|
453
|
-
options:
|
|
490
|
+
options: t,
|
|
454
491
|
primaryX: l,
|
|
455
|
-
primaryY:
|
|
492
|
+
primaryY: u,
|
|
456
493
|
floating: i,
|
|
457
|
-
placement:
|
|
458
|
-
reference:
|
|
459
|
-
scrollDirection:
|
|
494
|
+
placement: d,
|
|
495
|
+
reference: a,
|
|
496
|
+
scrollDirection: c
|
|
460
497
|
}) => {
|
|
461
|
-
var
|
|
498
|
+
var n;
|
|
462
499
|
const s = {
|
|
463
500
|
x: e,
|
|
464
501
|
y: r,
|
|
465
|
-
placement:
|
|
466
|
-
},
|
|
467
|
-
...
|
|
468
|
-
middleware: (
|
|
469
|
-
},
|
|
470
|
-
let
|
|
471
|
-
const
|
|
472
|
-
if (
|
|
502
|
+
placement: d
|
|
503
|
+
}, f = {
|
|
504
|
+
...t,
|
|
505
|
+
middleware: (n = t.middleware) == null ? void 0 : n.filter((V) => V.name !== "shift")
|
|
506
|
+
}, v = (o == null ? void 0 : o.placements) ?? ze, p = !(o != null && o.placements), w = p ? ze : v;
|
|
507
|
+
let h = !1;
|
|
508
|
+
const B = (V) => {
|
|
509
|
+
if (h)
|
|
473
510
|
return;
|
|
474
|
-
const
|
|
475
|
-
options:
|
|
511
|
+
const R = Se({
|
|
512
|
+
options: f,
|
|
476
513
|
primaryX: l,
|
|
477
|
-
primaryY:
|
|
514
|
+
primaryY: u,
|
|
478
515
|
floating: i,
|
|
479
|
-
placement:
|
|
480
|
-
reference:
|
|
481
|
-
scrollDirection:
|
|
516
|
+
placement: V,
|
|
517
|
+
reference: a,
|
|
518
|
+
scrollDirection: c
|
|
482
519
|
});
|
|
483
|
-
|
|
484
|
-
}, L =
|
|
485
|
-
if (!p &&
|
|
486
|
-
const
|
|
487
|
-
(
|
|
520
|
+
R && (s.x = R.x, s.y = R.y, s.placement = R.placement, h = !0);
|
|
521
|
+
}, L = Ao(a, i, f);
|
|
522
|
+
if (!p && v.includes(d) && B(d), h || w.forEach(B), !h) {
|
|
523
|
+
const V = v.reduce(
|
|
524
|
+
(R, $) => {
|
|
488
525
|
const F = Se({
|
|
489
|
-
options:
|
|
526
|
+
options: f,
|
|
490
527
|
primaryX: l,
|
|
491
|
-
primaryY:
|
|
528
|
+
primaryY: u,
|
|
492
529
|
floating: i,
|
|
493
|
-
placement:
|
|
494
|
-
reference:
|
|
495
|
-
scrollDirection:
|
|
530
|
+
placement: $,
|
|
531
|
+
reference: a,
|
|
532
|
+
scrollDirection: c
|
|
496
533
|
});
|
|
497
534
|
if (!F)
|
|
498
|
-
return
|
|
499
|
-
const O = fe(
|
|
500
|
-
return !
|
|
535
|
+
return R;
|
|
536
|
+
const O = fe($), W = L[O];
|
|
537
|
+
return !R || W > R.space ? { result: F, space: W } : R;
|
|
501
538
|
},
|
|
502
539
|
null
|
|
503
540
|
);
|
|
504
|
-
|
|
541
|
+
V && (s.x = V.result.x, s.y = V.result.y, s.placement = V.result.placement, h = !0);
|
|
505
542
|
}
|
|
506
|
-
if (!
|
|
507
|
-
const
|
|
508
|
-
let
|
|
509
|
-
|
|
510
|
-
const g = fe(
|
|
511
|
-
y >
|
|
543
|
+
if (!h && v.length > 0) {
|
|
544
|
+
const V = fe(d);
|
|
545
|
+
let R = V, $ = L[V];
|
|
546
|
+
v.forEach((m) => {
|
|
547
|
+
const g = fe(m), y = L[g];
|
|
548
|
+
y > $ && ($ = y, R = g);
|
|
512
549
|
});
|
|
513
|
-
const F =
|
|
550
|
+
const F = Po(R, d, v), O = he(a, i, F, f), W = re(f, "offset");
|
|
514
551
|
if (W) {
|
|
515
|
-
const
|
|
552
|
+
const m = W.fn({
|
|
516
553
|
x: O.x,
|
|
517
554
|
y: O.y,
|
|
518
|
-
options:
|
|
555
|
+
options: f,
|
|
519
556
|
primaryX: l,
|
|
520
|
-
primaryY:
|
|
557
|
+
primaryY: u,
|
|
521
558
|
floating: i,
|
|
522
559
|
placement: F,
|
|
523
|
-
reference:
|
|
524
|
-
scrollDirection:
|
|
560
|
+
reference: a,
|
|
561
|
+
scrollDirection: c
|
|
525
562
|
});
|
|
526
|
-
O.x =
|
|
563
|
+
O.x = m.x, O.y = m.y;
|
|
527
564
|
}
|
|
528
565
|
s.x = O.x, s.y = O.y, s.placement = O.placement;
|
|
529
566
|
}
|
|
530
567
|
return s;
|
|
531
568
|
}
|
|
532
|
-
}), Pe = (
|
|
533
|
-
var
|
|
534
|
-
let
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
if (
|
|
538
|
-
const s = ((
|
|
539
|
-
|
|
569
|
+
}), Pe = (o, e, r, t, l) => {
|
|
570
|
+
var u, i, d;
|
|
571
|
+
let a = 0;
|
|
572
|
+
t.startsWith("right") ? a = -o : t.startsWith("left") && (a = o);
|
|
573
|
+
const c = re(e, "arrow"), n = re(e, "shift");
|
|
574
|
+
if (c) {
|
|
575
|
+
const s = ((u = c.params) == null ? void 0 : u.arrow).getBoundingClientRect();
|
|
576
|
+
t.startsWith("right") ? a -= s.width / 2 : t.startsWith("left") && (a += s.width / 2);
|
|
540
577
|
}
|
|
541
|
-
if (Ee(e, "shift") &&
|
|
542
|
-
let s = null,
|
|
543
|
-
|
|
544
|
-
const
|
|
545
|
-
|
|
578
|
+
if (Ee(e, "shift") && c) {
|
|
579
|
+
let s = null, f = 0;
|
|
580
|
+
n && (s = (i = n.params) == null ? void 0 : i.parent);
|
|
581
|
+
const v = (d = c.params) == null ? void 0 : d.arrow;
|
|
582
|
+
f = v.getBoundingClientRect().width / 2, f += $o(v), f -= o, t.startsWith("right") ? G(r - a, l, s, e) <= o ? G(r, l, s, e) > 0 ? a = o - G(r, l, s, e) : a = o : U(r - a - f, l, s, e) <= o && (U(r - a - f, l, s, e) >= 0 ? (a = -o - (U(r - a - f, l, s, e) + o), s && (a = -o)) : a = -o) : t.startsWith("left") ? G(r - a + f, l, s, e) <= o ? (a = o + G(r - f, l, s, e), a <= o && (a = o)) : U(r - a, l, s, e) <= o && (a = -o + U(r, l, s, e), a <= -o && (a = -o)) : G(r - a, l, s, e) <= o ? G(r - a, l, s, e) <= o && G(r, l, s, e) > 0 ? a = o - G(r, l, s, e) : a = o : U(r - a, l, s, e) <= o && (U(r - a, l, s, e) <= o && U(r, l, s, e) > 0 ? a = -(o - U(r, l, s, e)) : a = -o);
|
|
546
583
|
}
|
|
547
|
-
return
|
|
548
|
-
}, Ae = (
|
|
549
|
-
var
|
|
550
|
-
let
|
|
551
|
-
|
|
552
|
-
const
|
|
553
|
-
if (
|
|
554
|
-
const s = ((
|
|
555
|
-
|
|
584
|
+
return a;
|
|
585
|
+
}, Ae = (o, e, r, t, l) => {
|
|
586
|
+
var u, i, d;
|
|
587
|
+
let a = 0;
|
|
588
|
+
t.startsWith("top") ? a = o : t.startsWith("bottom") && (a = -o);
|
|
589
|
+
const c = re(e, "arrow"), n = re(e, "shift");
|
|
590
|
+
if (c) {
|
|
591
|
+
const s = ((u = c.params) == null ? void 0 : u.arrow).getBoundingClientRect();
|
|
592
|
+
t.startsWith("top") ? a += s.height / 2 : t.startsWith("bottom") && (a -= s.height / 2);
|
|
556
593
|
}
|
|
557
|
-
if (Ee(e, "shift") &&
|
|
558
|
-
let s = null,
|
|
559
|
-
|
|
560
|
-
const
|
|
561
|
-
|
|
594
|
+
if (Ee(e, "shift") && c) {
|
|
595
|
+
let s = null, f = 0;
|
|
596
|
+
n && (s = (i = n.params) == null ? void 0 : i.parent);
|
|
597
|
+
const v = (d = c.params) == null ? void 0 : d.arrow;
|
|
598
|
+
f = v.getBoundingClientRect().height / 2, f += xo(v), f -= o, t.startsWith("top") ? K(r - a, l, s, e) <= o ? K(r, l, s, e) >= 0 ? a = -(o - K(r, l, s, e)) : a = -o : Z(r - a + f, l, s, e) <= o && (a = o + Z(r - f, l, s, e), a <= o && (a = o)) : t.startsWith("bottom") ? K(r - a - f, l, s, e) <= o ? K(r - a - f, l, s, e) >= 0 ? (a = -o - (K(r - a - f, l, s, e) + o), s && (a = -o)) : a = -o : Z(r - a, l, s, e) <= o && (Z(r, l, s, e) >= 0 ? a = o - Z(r, l, s, e) : a = o) : K(r - a, l, s, e) <= o ? K(r - a, l, s, e) >= 0 ? a = -(o - K(r - a, l, s, e)) : a = -o : Z(r - a, l, s, e) <= o && (Z(r - a, l, s, e) >= 0 ? a = o - Z(r - a, l, s, e) : a = o);
|
|
562
599
|
}
|
|
563
|
-
return
|
|
564
|
-
}, De = (
|
|
600
|
+
return a;
|
|
601
|
+
}, De = (o) => ({
|
|
565
602
|
name: "offset",
|
|
566
|
-
params: { value:
|
|
603
|
+
params: { value: o },
|
|
567
604
|
fn: ({
|
|
568
605
|
x: e,
|
|
569
606
|
y: r,
|
|
570
|
-
options:
|
|
607
|
+
options: t,
|
|
571
608
|
primaryX: l,
|
|
572
|
-
primaryY:
|
|
609
|
+
primaryY: u,
|
|
573
610
|
floating: i,
|
|
574
|
-
placement:
|
|
611
|
+
placement: d
|
|
575
612
|
}) => ({
|
|
576
|
-
x: e - Pe(
|
|
577
|
-
y: r - Ae(t,
|
|
578
|
-
placement:
|
|
613
|
+
x: e - Pe(o, t, l, d, i),
|
|
614
|
+
y: r - Ae(o, t, u, d, i),
|
|
615
|
+
placement: d
|
|
579
616
|
})
|
|
580
|
-
}),
|
|
617
|
+
}), _o = (o) => ({
|
|
581
618
|
name: "shift",
|
|
582
|
-
params:
|
|
619
|
+
params: o,
|
|
583
620
|
fn: ({
|
|
584
621
|
x: e,
|
|
585
622
|
y: r,
|
|
586
|
-
options:
|
|
623
|
+
options: t,
|
|
587
624
|
primaryX: l,
|
|
588
|
-
primaryY:
|
|
625
|
+
primaryY: u,
|
|
589
626
|
floating: i,
|
|
590
|
-
placement:
|
|
591
|
-
reference:
|
|
627
|
+
placement: d,
|
|
628
|
+
reference: a
|
|
592
629
|
}) => {
|
|
593
|
-
var
|
|
594
|
-
const
|
|
630
|
+
var c;
|
|
631
|
+
const n = {
|
|
595
632
|
x: e,
|
|
596
633
|
y: r,
|
|
597
|
-
placement:
|
|
598
|
-
}, s =
|
|
599
|
-
let
|
|
600
|
-
const O = w ? Math.abs(
|
|
601
|
-
if (Q(
|
|
602
|
-
const y = W,
|
|
603
|
-
|
|
604
|
-
const j = W, Y = window.innerWidth - i.clientWidth - W, ee =
|
|
605
|
-
return
|
|
634
|
+
placement: d
|
|
635
|
+
}, s = t.middleware || [], f = s.findIndex((y) => y.name === "shift"), v = s.findIndex((y) => y.name === "offset"), p = v !== -1 && (f === -1 || v > f), w = s.find((y) => y.name === "offset"), h = w ? (c = w.params) == null ? void 0 : c.value : 0, B = p ? Pe(h, t, l, d, i) : 0, L = p ? Ae(h, t, u, d, i) : 0, V = e - B, R = r - L;
|
|
636
|
+
let $ = V, F = R;
|
|
637
|
+
const O = w ? Math.abs(h) : 0, W = O, m = O;
|
|
638
|
+
if (Q(t, i) && typeof window < "u") {
|
|
639
|
+
const y = W, T = window.innerWidth - i.clientWidth - W, H = T < y ? y : T, E = m, N = window.innerHeight - i.clientHeight - m, M = N < E ? E : N;
|
|
640
|
+
$ < y ? $ = y : $ > H && ($ = H), F < E ? F = E : F > M && (F = M), p ? (n.x = e + ($ - V), n.y = r + (F - R)) : (n.x = $, n.y = F);
|
|
641
|
+
const j = W, Y = window.innerWidth - i.clientWidth - W, ee = m, ue = window.innerHeight - i.clientHeight - m, se = p ? j + B : j, ve = p ? Y + B : Y, pe = p ? ee + L : ee, ge = p ? ue + L : ue;
|
|
642
|
+
return n.x < se ? n.x = se : n.x > ve && (n.x = ve), n.y < pe ? n.y = pe : n.y > ge && (n.y = ge), n;
|
|
606
643
|
}
|
|
607
644
|
const g = q(i);
|
|
608
645
|
if (g !== null) {
|
|
609
|
-
const y =
|
|
610
|
-
H <= ve ?
|
|
646
|
+
const y = I(a, i, t), T = y.left, H = y.left + y.width, E = y.top, N = y.top + y.height, M = g.scrollLeft + W, j = be(g) - i.clientWidth - W, Y = j < M ? M : j, ee = g.scrollTop + m, ue = me(g) - i.clientHeight - m, se = ue < ee ? ee : ue, ve = g.scrollLeft, pe = be(g), ge = g.scrollTop, Ke = me(g);
|
|
647
|
+
H <= ve ? $ = M : T >= pe && ($ = Y), N <= ge ? F = ee : E >= Ke && (F = se), F < ee ? F = ee : F > se && (F = se), $ < M ? $ = M : $ > Y && ($ = Y);
|
|
611
648
|
}
|
|
612
|
-
if (p ? (
|
|
613
|
-
const y = g.scrollLeft + W,
|
|
614
|
-
|
|
649
|
+
if (p ? (n.x = e + ($ - V), n.y = r + (F - R)) : (n.x = $, n.y = F), g !== null) {
|
|
650
|
+
const y = g.scrollLeft + W, T = be(g) - i.clientWidth - W, H = g.scrollTop + m, E = me(g) - i.clientHeight - m, N = p ? y + B : y, M = p ? T + B : T, j = p ? H + L : H, Y = p ? E + L : E;
|
|
651
|
+
n.x < N ? n.x = N : n.x > M && (n.x = M), n.y < j ? n.y = j : n.y > Y && (n.y = Y);
|
|
615
652
|
}
|
|
616
|
-
return
|
|
653
|
+
return n;
|
|
617
654
|
}
|
|
618
|
-
}),
|
|
619
|
-
const r = q(
|
|
655
|
+
}), $o = (o) => o.getBoundingClientRect().width !== o.clientWidth ? (o.getBoundingClientRect().width - o.clientWidth) / 2 : 0, xo = (o) => o.getBoundingClientRect().height !== o.clientHeight ? (o.getBoundingClientRect().height - o.clientHeight) / 2 : 0, Ie = (o, e) => {
|
|
656
|
+
const r = q(o), t = [];
|
|
620
657
|
if (r !== null) {
|
|
621
658
|
const l = () => e();
|
|
622
|
-
r.addEventListener("scroll", l, !1),
|
|
659
|
+
r.addEventListener("scroll", l, !1), t.push(() => r.removeEventListener("scroll", l, !1));
|
|
623
660
|
}
|
|
624
661
|
if (typeof window < "u") {
|
|
625
|
-
const l = () => e(),
|
|
626
|
-
window.addEventListener("scroll", l, !1), window.addEventListener("resize",
|
|
662
|
+
const l = () => e(), u = () => e();
|
|
663
|
+
window.addEventListener("scroll", l, !1), window.addEventListener("resize", u, !1), t.push(() => window.removeEventListener("scroll", l, !1)), t.push(() => window.removeEventListener("resize", u, !1));
|
|
627
664
|
}
|
|
628
|
-
if (typeof ResizeObserver < "u" &&
|
|
665
|
+
if (typeof ResizeObserver < "u" && o instanceof HTMLElement) {
|
|
629
666
|
const l = new ResizeObserver(() => e());
|
|
630
|
-
l.observe(
|
|
667
|
+
l.observe(o), t.push(() => l.disconnect());
|
|
631
668
|
}
|
|
632
|
-
return () =>
|
|
633
|
-
},
|
|
634
|
-
const
|
|
669
|
+
return () => t.forEach((l) => l());
|
|
670
|
+
}, Bo = (o, e, r = {}) => {
|
|
671
|
+
const t = I(o, e, r);
|
|
635
672
|
return {
|
|
636
|
-
x:
|
|
637
|
-
y:
|
|
673
|
+
x: t.left - e.getBoundingClientRect().width / 2 + t.width / 2,
|
|
674
|
+
y: t.top - e.getBoundingClientRect().height,
|
|
638
675
|
placement: "top"
|
|
639
676
|
};
|
|
640
|
-
},
|
|
641
|
-
const
|
|
677
|
+
}, Fo = (o, e, r = {}) => {
|
|
678
|
+
const t = I(o, e, r);
|
|
642
679
|
return {
|
|
643
|
-
x:
|
|
644
|
-
y:
|
|
680
|
+
x: t.left,
|
|
681
|
+
y: t.top - e.getBoundingClientRect().height,
|
|
645
682
|
placement: "top-start"
|
|
646
683
|
};
|
|
647
|
-
},
|
|
648
|
-
const
|
|
684
|
+
}, zo = (o, e, r = {}) => {
|
|
685
|
+
const t = I(o, e, r);
|
|
649
686
|
return {
|
|
650
|
-
x:
|
|
651
|
-
y:
|
|
687
|
+
x: t.left - e.getBoundingClientRect().width + t.width,
|
|
688
|
+
y: t.top - e.getBoundingClientRect().height,
|
|
652
689
|
placement: "top-end"
|
|
653
690
|
};
|
|
654
|
-
},
|
|
655
|
-
const
|
|
691
|
+
}, So = (o, e, r = {}) => {
|
|
692
|
+
const t = I(o, e, r);
|
|
656
693
|
return {
|
|
657
|
-
x:
|
|
658
|
-
y:
|
|
694
|
+
x: t.left + t.width,
|
|
695
|
+
y: t.top - e.getBoundingClientRect().height / 2 + t.height / 2,
|
|
659
696
|
placement: "right"
|
|
660
697
|
};
|
|
661
|
-
},
|
|
662
|
-
const
|
|
698
|
+
}, Vo = (o, e, r = {}) => {
|
|
699
|
+
const t = I(o, e, r);
|
|
663
700
|
return {
|
|
664
|
-
x:
|
|
665
|
-
y:
|
|
701
|
+
x: t.left + t.width,
|
|
702
|
+
y: t.top,
|
|
666
703
|
placement: "right-start"
|
|
667
704
|
};
|
|
668
|
-
},
|
|
669
|
-
const
|
|
705
|
+
}, Ro = (o, e, r = {}) => {
|
|
706
|
+
const t = I(o, e, r);
|
|
670
707
|
return {
|
|
671
|
-
x:
|
|
672
|
-
y:
|
|
708
|
+
x: t.left + t.width,
|
|
709
|
+
y: t.top + t.height - e.getBoundingClientRect().height,
|
|
673
710
|
placement: "right-end"
|
|
674
711
|
};
|
|
675
|
-
},
|
|
676
|
-
const
|
|
712
|
+
}, To = (o, e, r = {}) => {
|
|
713
|
+
const t = I(o, e, r);
|
|
677
714
|
return {
|
|
678
|
-
x:
|
|
679
|
-
y:
|
|
715
|
+
x: t.left + t.width / 2 - e.getBoundingClientRect().width / 2,
|
|
716
|
+
y: t.top + t.height,
|
|
680
717
|
placement: "bottom"
|
|
681
718
|
};
|
|
682
|
-
},
|
|
683
|
-
const
|
|
719
|
+
}, Lo = (o, e, r = {}) => {
|
|
720
|
+
const t = I(o, e, r);
|
|
684
721
|
return {
|
|
685
|
-
x:
|
|
686
|
-
y:
|
|
722
|
+
x: t.left,
|
|
723
|
+
y: t.top + t.height,
|
|
687
724
|
placement: "bottom-start"
|
|
688
725
|
};
|
|
689
|
-
},
|
|
690
|
-
const
|
|
726
|
+
}, Wo = (o, e, r = {}) => {
|
|
727
|
+
const t = I(o, e, r);
|
|
691
728
|
return {
|
|
692
|
-
x:
|
|
693
|
-
y:
|
|
729
|
+
x: t.left - e.getBoundingClientRect().width + t.width,
|
|
730
|
+
y: t.top + t.height,
|
|
694
731
|
placement: "bottom-end"
|
|
695
732
|
};
|
|
696
|
-
},
|
|
697
|
-
const
|
|
733
|
+
}, Oo = (o, e, r = {}) => {
|
|
734
|
+
const t = I(o, e, r);
|
|
698
735
|
return {
|
|
699
|
-
x:
|
|
700
|
-
y:
|
|
736
|
+
x: t.left - e.getBoundingClientRect().width,
|
|
737
|
+
y: t.top + t.height / 2 - e.getBoundingClientRect().height / 2,
|
|
701
738
|
placement: "left"
|
|
702
739
|
};
|
|
703
|
-
},
|
|
704
|
-
const
|
|
740
|
+
}, Ho = (o, e, r = {}) => {
|
|
741
|
+
const t = I(o, e, r);
|
|
705
742
|
return {
|
|
706
|
-
x:
|
|
707
|
-
y:
|
|
743
|
+
x: t.left - e.getBoundingClientRect().width,
|
|
744
|
+
y: t.top,
|
|
708
745
|
placement: "left-start"
|
|
709
746
|
};
|
|
710
|
-
},
|
|
711
|
-
const
|
|
747
|
+
}, Eo = (o, e, r = {}) => {
|
|
748
|
+
const t = I(o, e, r);
|
|
712
749
|
return {
|
|
713
|
-
x:
|
|
714
|
-
y:
|
|
750
|
+
x: t.left - e.getBoundingClientRect().width,
|
|
751
|
+
y: t.top + t.height - e.getBoundingClientRect().height,
|
|
715
752
|
placement: "left-end"
|
|
716
753
|
};
|
|
717
|
-
},
|
|
754
|
+
}, he = (o, e, r, t = {}) => {
|
|
718
755
|
switch (r) {
|
|
719
756
|
case "top":
|
|
720
|
-
return
|
|
757
|
+
return Bo(o, e, t);
|
|
721
758
|
case "top-start":
|
|
722
|
-
return
|
|
759
|
+
return Fo(o, e, t);
|
|
723
760
|
case "top-end":
|
|
724
|
-
return
|
|
761
|
+
return zo(o, e, t);
|
|
725
762
|
case "right":
|
|
726
|
-
return
|
|
763
|
+
return So(o, e, t);
|
|
727
764
|
case "right-start":
|
|
728
|
-
return
|
|
765
|
+
return Vo(o, e, t);
|
|
729
766
|
case "right-end":
|
|
730
|
-
return
|
|
767
|
+
return Ro(o, e, t);
|
|
731
768
|
case "bottom":
|
|
732
|
-
return
|
|
769
|
+
return To(o, e, t);
|
|
733
770
|
case "bottom-start":
|
|
734
|
-
return
|
|
771
|
+
return Lo(o, e, t);
|
|
735
772
|
case "bottom-end":
|
|
736
|
-
return
|
|
773
|
+
return Wo(o, e, t);
|
|
737
774
|
case "left":
|
|
738
|
-
return
|
|
775
|
+
return Oo(o, e, t);
|
|
739
776
|
case "left-start":
|
|
740
|
-
return
|
|
777
|
+
return Ho(o, e, t);
|
|
741
778
|
case "left-end":
|
|
742
|
-
return
|
|
779
|
+
return Eo(o, e, t);
|
|
743
780
|
default:
|
|
744
781
|
return {
|
|
745
782
|
x: 0,
|
|
@@ -747,25 +784,25 @@ const ht = (t, e) => t.strategy ? t.strategy : gt(e) ? "fixed" : "absolute", Q =
|
|
|
747
784
|
placement: ""
|
|
748
785
|
};
|
|
749
786
|
}
|
|
750
|
-
},
|
|
751
|
-
if (Q(
|
|
787
|
+
}, Mo = (o, e, r, t = {}) => {
|
|
788
|
+
if (Q(t, e)) {
|
|
752
789
|
if (typeof window > "u")
|
|
753
790
|
return !0;
|
|
754
|
-
const s =
|
|
755
|
-
return s >= 0 &&
|
|
791
|
+
const s = o.x, f = o.y, v = s + e.clientWidth, p = f + e.clientHeight;
|
|
792
|
+
return s >= 0 && f >= 0 && v <= window.innerWidth && p <= window.innerHeight;
|
|
756
793
|
}
|
|
757
794
|
if (q(r) !== null)
|
|
758
|
-
return
|
|
795
|
+
return K(o.y, e, null, t) > 0 && G(o.x, e, null, t) > 0 && Z(o.y, e, null, t) > 0 && U(o.x, e, null, t) > 0;
|
|
759
796
|
if (typeof window > "u")
|
|
760
797
|
return !0;
|
|
761
|
-
const l = window.innerWidth,
|
|
798
|
+
const l = window.innerWidth, u = window.innerHeight, i = (r instanceof HTMLElement ? r.offsetParent : null) || e.offsetParent;
|
|
762
799
|
if (i) {
|
|
763
|
-
const s = i.getBoundingClientRect(),
|
|
764
|
-
return
|
|
800
|
+
const s = i.getBoundingClientRect(), f = s.left + o.x, v = s.top + o.y, p = f + e.clientWidth, w = v + e.clientHeight;
|
|
801
|
+
return f >= 0 && v >= 0 && p <= l && w <= u;
|
|
765
802
|
}
|
|
766
|
-
const
|
|
767
|
-
return
|
|
768
|
-
}, fe = (
|
|
803
|
+
const d = o.x, a = o.y, c = d + e.clientWidth, n = a + e.clientHeight;
|
|
804
|
+
return d >= 0 && a >= 0 && c <= l && n <= u;
|
|
805
|
+
}, fe = (o) => o.startsWith("right") ? "right" : o.startsWith("left") ? "left" : o.startsWith("top") ? "top" : "bottom", Po = (o, e, r) => fe(e) === o && r.includes(e) ? e : r.find((t) => fe(t) === o) ?? r[0], Ao = (o, e, r = {}) => {
|
|
769
806
|
if (typeof window > "u")
|
|
770
807
|
return {
|
|
771
808
|
top: 0,
|
|
@@ -773,51 +810,51 @@ const ht = (t, e) => t.strategy ? t.strategy : gt(e) ? "fixed" : "absolute", Q =
|
|
|
773
810
|
bottom: 0,
|
|
774
811
|
left: 0
|
|
775
812
|
};
|
|
776
|
-
const
|
|
813
|
+
const t = Q(r, e) ? null : q(o), l = o.getBoundingClientRect(), u = t ? t.getBoundingClientRect() : {
|
|
777
814
|
top: 0,
|
|
778
815
|
left: 0,
|
|
779
816
|
right: window.innerWidth,
|
|
780
817
|
bottom: window.innerHeight
|
|
781
818
|
};
|
|
782
819
|
return {
|
|
783
|
-
top: l.top -
|
|
784
|
-
right:
|
|
785
|
-
bottom:
|
|
786
|
-
left: l.left -
|
|
820
|
+
top: l.top - u.top,
|
|
821
|
+
right: u.right - l.right,
|
|
822
|
+
bottom: u.bottom - l.bottom,
|
|
823
|
+
left: l.left - u.left
|
|
787
824
|
};
|
|
788
|
-
},
|
|
789
|
-
var l,
|
|
790
|
-
const i = r.placement ? r.placement : "bottom",
|
|
825
|
+
}, Ne = (o, e, r = {}) => new Promise((t) => {
|
|
826
|
+
var l, u;
|
|
827
|
+
const i = r.placement ? r.placement : "bottom", d = {
|
|
791
828
|
x: 0,
|
|
792
829
|
y: 0,
|
|
793
830
|
placement: i,
|
|
794
831
|
middlewareData: {}
|
|
795
|
-
},
|
|
796
|
-
|
|
797
|
-
const
|
|
832
|
+
}, a = he(o, e, i, r);
|
|
833
|
+
d.x = a.x, d.y = a.y, d.placement = a.placement;
|
|
834
|
+
const c = d.x, n = d.y, s = wo(o);
|
|
798
835
|
(l = r.middleware) == null || l.forEach((w) => {
|
|
799
|
-
const
|
|
800
|
-
x:
|
|
801
|
-
y:
|
|
836
|
+
const h = w.fn({
|
|
837
|
+
x: d.x,
|
|
838
|
+
y: d.y,
|
|
802
839
|
options: r,
|
|
803
|
-
primaryX:
|
|
804
|
-
primaryY:
|
|
840
|
+
primaryX: c,
|
|
841
|
+
primaryY: n,
|
|
805
842
|
floating: e,
|
|
806
|
-
placement:
|
|
807
|
-
reference:
|
|
843
|
+
placement: d.placement,
|
|
844
|
+
reference: o,
|
|
808
845
|
scrollDirection: s
|
|
809
846
|
});
|
|
810
|
-
|
|
847
|
+
d.x = h.x, d.y = h.y, d.placement = h.placement, w.name === "arrow" && (h.baseX = h.x, h.baseY = h.y, h.x = h.arrowX ?? h.x, h.y = h.arrowY ?? h.y), d.middlewareData[w.name] = h;
|
|
811
848
|
});
|
|
812
|
-
const
|
|
813
|
-
if (Number.isFinite(
|
|
849
|
+
const f = he(o, e, d.placement, r), v = re(r, "offset"), p = v ? (u = v.params) == null ? void 0 : u.value : 0;
|
|
850
|
+
if (Number.isFinite(d.x) || (d.x = f.x), !Number.isFinite(d.y))
|
|
814
851
|
if (Q(r, e)) {
|
|
815
|
-
const w =
|
|
816
|
-
|
|
852
|
+
const w = o.getBoundingClientRect(), h = e.getBoundingClientRect().height;
|
|
853
|
+
d.placement.startsWith("top") ? d.y = w.top - h - p : d.placement.startsWith("bottom") ? d.y = w.bottom + p : d.y = f.y;
|
|
817
854
|
} else
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
}),
|
|
855
|
+
d.y = f.y;
|
|
856
|
+
t(d);
|
|
857
|
+
}), Do = ["disabled", "aria-expanded", "onKeydown"], Io = ["data-placement"], No = ["disabled", "aria-selected", "onClick"], At = /* @__PURE__ */ D({
|
|
821
858
|
__name: "select",
|
|
822
859
|
props: {
|
|
823
860
|
modelValue: { default: void 0 },
|
|
@@ -826,178 +863,256 @@ const ht = (t, e) => t.strategy ? t.strategy : gt(e) ? "fixed" : "absolute", Q =
|
|
|
826
863
|
optionValue: { default: "value" },
|
|
827
864
|
placeholder: { default: "" },
|
|
828
865
|
disabled: { type: Boolean, default: !1 },
|
|
866
|
+
variant: { default: "filled" },
|
|
829
867
|
size: { default: "normal" }
|
|
830
868
|
},
|
|
831
869
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
832
|
-
setup(
|
|
870
|
+
setup(o, { emit: e }) {
|
|
833
871
|
let r = 0;
|
|
834
|
-
const
|
|
835
|
-
let
|
|
836
|
-
const
|
|
872
|
+
const t = e, l = o, u = P(null), i = P(null), d = P(null), a = P(!1), c = P("bottom"), n = P("bottom"), s = `vf-select-panel-${++r}`;
|
|
873
|
+
let f = null;
|
|
874
|
+
const v = C(() => l.options.map((g) => ({
|
|
837
875
|
label: g[l.optionLabel],
|
|
838
876
|
value: g[l.optionValue],
|
|
839
877
|
disabled: g.disabled
|
|
840
|
-
}))), p =
|
|
878
|
+
}))), p = C(() => v.value.find((g) => g.value === l.modelValue)), w = C(() => {
|
|
841
879
|
var g;
|
|
842
880
|
return ((g = p.value) == null ? void 0 : g.label) ?? "";
|
|
843
|
-
}),
|
|
844
|
-
const g = ["vf-select",
|
|
881
|
+
}), h = C(() => {
|
|
882
|
+
const g = ["vf-select", `vf-select_${l.variant}`, a.value ? "vf-select_open" : ""];
|
|
845
883
|
return l.size !== "normal" && g.push(`vf-select_${l.size}`), l.disabled && g.push("vf-select_disabled"), g.filter(Boolean);
|
|
846
|
-
}),
|
|
847
|
-
g.disabled || (
|
|
848
|
-
},
|
|
849
|
-
|
|
884
|
+
}), B = (g) => g.value === l.modelValue, L = (g) => {
|
|
885
|
+
g.disabled || (t("update:modelValue", g.value), t("change", g.value), $());
|
|
886
|
+
}, V = (g) => t("focus", g), R = (g) => t("blur", g), $ = () => {
|
|
887
|
+
a.value = !1, c.value = "bottom", n.value = "bottom";
|
|
850
888
|
}, F = () => {
|
|
851
|
-
l.disabled || (
|
|
889
|
+
l.disabled || (a.value = !a.value, a.value && (c.value = "bottom", n.value = "bottom"));
|
|
852
890
|
}, O = async () => {
|
|
853
891
|
var g, y;
|
|
854
|
-
|
|
892
|
+
a.value || (a.value = !0, await _e()), (y = (g = d.value) == null ? void 0 : g.querySelector(".vf-select__option:not(.is-disabled)")) == null || y.focus();
|
|
855
893
|
}, W = (g) => {
|
|
856
|
-
var
|
|
857
|
-
if (!
|
|
894
|
+
var T;
|
|
895
|
+
if (!a.value || !u.value)
|
|
858
896
|
return;
|
|
859
897
|
const y = g.target;
|
|
860
|
-
|
|
861
|
-
},
|
|
862
|
-
if (!i.value || !
|
|
898
|
+
u.value.contains(y) || (T = d.value) != null && T.contains(y) || $();
|
|
899
|
+
}, m = () => {
|
|
900
|
+
if (!i.value || !d.value)
|
|
863
901
|
return;
|
|
864
|
-
const g = i.value, y =
|
|
902
|
+
const g = i.value, y = d.value, T = async () => {
|
|
865
903
|
const {
|
|
866
904
|
x: M,
|
|
867
905
|
y: j,
|
|
868
906
|
placement: Y
|
|
869
|
-
} = await
|
|
870
|
-
placement:
|
|
907
|
+
} = await Ne(g, y, {
|
|
908
|
+
placement: c.value,
|
|
871
909
|
strategy: "fixed",
|
|
872
910
|
middleware: [De(2), Me({ placements: ["bottom", "top"] })]
|
|
873
911
|
});
|
|
874
|
-
|
|
912
|
+
n.value = Y ?? c.value, y.style.minWidth = `${g.getBoundingClientRect().width}px`, y.style.left = `${M}px`, y.style.top = `${j}px`;
|
|
875
913
|
}, H = async () => {
|
|
876
|
-
await
|
|
914
|
+
await T();
|
|
877
915
|
}, E = Ie(g, () => {
|
|
878
916
|
H();
|
|
879
|
-
}),
|
|
917
|
+
}), N = () => {
|
|
880
918
|
H();
|
|
881
919
|
};
|
|
882
|
-
document.addEventListener("scroll",
|
|
920
|
+
document.addEventListener("scroll", N, !0), window.addEventListener("resize", N, !1), f = {
|
|
883
921
|
update: H,
|
|
884
922
|
destroy: () => {
|
|
885
|
-
E(), document.removeEventListener("scroll",
|
|
923
|
+
E(), document.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N, !1);
|
|
886
924
|
}
|
|
887
|
-
},
|
|
925
|
+
}, f.update();
|
|
888
926
|
};
|
|
889
|
-
return ne(
|
|
927
|
+
return ne(a, async (g) => {
|
|
890
928
|
if (!g) {
|
|
891
|
-
|
|
929
|
+
f && (f.destroy(), f = null);
|
|
892
930
|
return;
|
|
893
931
|
}
|
|
894
|
-
await _e(),
|
|
932
|
+
await _e(), f || m(), f == null || f.update();
|
|
895
933
|
}), ne(
|
|
896
934
|
() => l.options,
|
|
897
935
|
() => {
|
|
898
|
-
|
|
936
|
+
f == null || f.update();
|
|
899
937
|
},
|
|
900
938
|
{ deep: !0 }
|
|
901
939
|
), Oe(() => {
|
|
902
940
|
document.addEventListener("click", W);
|
|
903
941
|
}), $e(() => {
|
|
904
|
-
document.removeEventListener("click", W),
|
|
905
|
-
}), (g, y) => (
|
|
942
|
+
document.removeEventListener("click", W), f == null || f.destroy(), f = null;
|
|
943
|
+
}), (g, y) => (b(), k("div", {
|
|
906
944
|
ref_key: "root",
|
|
907
|
-
ref:
|
|
908
|
-
class:
|
|
945
|
+
ref: u,
|
|
946
|
+
class: S(h.value)
|
|
909
947
|
}, [
|
|
910
|
-
|
|
948
|
+
z("button", {
|
|
911
949
|
ref_key: "trigger",
|
|
912
950
|
ref: i,
|
|
913
951
|
class: "vf-select__control",
|
|
914
952
|
type: "button",
|
|
915
953
|
disabled: g.disabled,
|
|
916
|
-
"aria-expanded":
|
|
954
|
+
"aria-expanded": a.value,
|
|
917
955
|
"aria-controls": s,
|
|
918
956
|
"aria-haspopup": "listbox",
|
|
919
957
|
onClick: F,
|
|
920
958
|
onKeydown: [
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
959
|
+
le(ae(O, ["prevent"]), ["down"]),
|
|
960
|
+
le(ae(F, ["prevent"]), ["enter"]),
|
|
961
|
+
le(ae($, ["prevent"]), ["esc"])
|
|
924
962
|
],
|
|
925
|
-
onFocus:
|
|
926
|
-
onBlur:
|
|
963
|
+
onFocus: V,
|
|
964
|
+
onBlur: R
|
|
927
965
|
}, [
|
|
928
|
-
|
|
929
|
-
class:
|
|
930
|
-
},
|
|
931
|
-
y[0] || (y[0] =
|
|
966
|
+
z("span", {
|
|
967
|
+
class: S(["vf-select__label", { "vf-select__label_placeholder": !w.value }])
|
|
968
|
+
}, A(w.value || g.placeholder), 3),
|
|
969
|
+
y[0] || (y[0] = z("span", {
|
|
932
970
|
class: "vf-select__chevron",
|
|
933
971
|
"aria-hidden": "true"
|
|
934
972
|
}, "▾", -1))
|
|
935
|
-
], 40,
|
|
936
|
-
(
|
|
937
|
-
ke(
|
|
973
|
+
], 40, Do),
|
|
974
|
+
(b(), X(xe, { to: "body" }, [
|
|
975
|
+
ke(z("div", {
|
|
938
976
|
id: s,
|
|
939
977
|
ref_key: "panel",
|
|
940
|
-
ref:
|
|
978
|
+
ref: d,
|
|
941
979
|
class: "vf-select__panel",
|
|
942
980
|
role: "listbox",
|
|
943
|
-
"data-placement":
|
|
981
|
+
"data-placement": n.value
|
|
944
982
|
}, [
|
|
945
|
-
(
|
|
946
|
-
key:
|
|
947
|
-
class:
|
|
983
|
+
(b(!0), k(ce, null, Le(v.value, (T) => (b(), k("button", {
|
|
984
|
+
key: T.value,
|
|
985
|
+
class: S(["vf-select__option", { "is-active": B(T), "is-disabled": T.disabled }]),
|
|
948
986
|
type: "button",
|
|
949
987
|
role: "option",
|
|
950
|
-
disabled:
|
|
951
|
-
"aria-selected":
|
|
952
|
-
onClick: (H) => L(
|
|
953
|
-
},
|
|
954
|
-
], 8,
|
|
955
|
-
[
|
|
988
|
+
disabled: T.disabled,
|
|
989
|
+
"aria-selected": B(T),
|
|
990
|
+
onClick: (H) => L(T)
|
|
991
|
+
}, A(T.label), 11, No))), 128))
|
|
992
|
+
], 8, Io), [
|
|
993
|
+
[Ce, a.value]
|
|
956
994
|
])
|
|
957
995
|
]))
|
|
958
996
|
], 2));
|
|
959
997
|
}
|
|
960
|
-
}),
|
|
998
|
+
}), Xo = ["checked", "disabled"], Yo = {
|
|
961
999
|
key: 0,
|
|
962
1000
|
class: "vf-checkbox__label"
|
|
963
|
-
},
|
|
1001
|
+
}, Dt = /* @__PURE__ */ D({
|
|
964
1002
|
__name: "checkbox",
|
|
965
1003
|
props: {
|
|
966
1004
|
modelValue: { type: Boolean, default: !1 },
|
|
967
1005
|
label: { default: "" },
|
|
968
|
-
disabled: { type: Boolean, default: !1 }
|
|
1006
|
+
disabled: { type: Boolean, default: !1 },
|
|
1007
|
+
variant: { default: "filled" }
|
|
969
1008
|
},
|
|
970
1009
|
emits: ["update:modelValue", "change"],
|
|
971
|
-
setup(
|
|
972
|
-
const r = e,
|
|
973
|
-
const i = ["vf-checkbox"];
|
|
974
|
-
return
|
|
975
|
-
}),
|
|
976
|
-
const
|
|
977
|
-
r("update:modelValue",
|
|
1010
|
+
setup(o, { emit: e }) {
|
|
1011
|
+
const r = e, t = o, l = C(() => {
|
|
1012
|
+
const i = ["vf-checkbox", `vf-checkbox_${t.variant}`];
|
|
1013
|
+
return t.disabled && i.push("vf-checkbox_disabled"), i;
|
|
1014
|
+
}), u = (i) => {
|
|
1015
|
+
const d = i.target;
|
|
1016
|
+
r("update:modelValue", d.checked), r("change", i);
|
|
978
1017
|
};
|
|
979
|
-
return (i,
|
|
980
|
-
class:
|
|
1018
|
+
return (i, d) => (b(), k("label", {
|
|
1019
|
+
class: S(l.value)
|
|
981
1020
|
}, [
|
|
982
|
-
|
|
1021
|
+
z("input", {
|
|
983
1022
|
class: "vf-checkbox__control",
|
|
984
1023
|
type: "checkbox",
|
|
985
1024
|
checked: i.modelValue,
|
|
986
1025
|
disabled: i.disabled,
|
|
987
|
-
onChange:
|
|
988
|
-
}, null, 40,
|
|
989
|
-
|
|
990
|
-
i.label || i.$slots.default ? (
|
|
1026
|
+
onChange: u
|
|
1027
|
+
}, null, 40, Xo),
|
|
1028
|
+
d[0] || (d[0] = z("span", { class: "vf-checkbox__box" }, null, -1)),
|
|
1029
|
+
i.label || i.$slots.default ? (b(), k("span", Yo, [
|
|
991
1030
|
_(i.$slots, "default", {}, () => [
|
|
992
|
-
|
|
1031
|
+
te(A(i.label), 1)
|
|
1032
|
+
])
|
|
1033
|
+
])) : x("", !0)
|
|
1034
|
+
], 2));
|
|
1035
|
+
}
|
|
1036
|
+
}), Xe = Symbol("VueForgeRadioGroup"), jo = ["aria-disabled", "aria-label", "aria-labelledby"], It = /* @__PURE__ */ D({
|
|
1037
|
+
__name: "radio-group",
|
|
1038
|
+
props: {
|
|
1039
|
+
modelValue: { type: [String, Number, Boolean, null], default: void 0 },
|
|
1040
|
+
name: {},
|
|
1041
|
+
disabled: { type: Boolean, default: !1 },
|
|
1042
|
+
variant: { default: "filled" },
|
|
1043
|
+
direction: { default: "vertical" },
|
|
1044
|
+
ariaLabel: {},
|
|
1045
|
+
ariaLabelledby: {}
|
|
1046
|
+
},
|
|
1047
|
+
emits: ["update:modelValue", "change"],
|
|
1048
|
+
setup(o, { emit: e }) {
|
|
1049
|
+
const r = e, t = o, l = C(() => {
|
|
1050
|
+
const d = ["vf-radio-group"];
|
|
1051
|
+
return t.direction === "horizontal" && d.push("vf-radio-group_horizontal"), d;
|
|
1052
|
+
}), u = (d, a) => {
|
|
1053
|
+
r("update:modelValue", d), r("change", d, a);
|
|
1054
|
+
}, i = {
|
|
1055
|
+
name: C(() => t.name),
|
|
1056
|
+
modelValue: C(() => t.modelValue),
|
|
1057
|
+
disabled: C(() => t.disabled),
|
|
1058
|
+
variant: C(() => t.variant),
|
|
1059
|
+
onChange: u
|
|
1060
|
+
};
|
|
1061
|
+
return Ge(Xe, i), (d, a) => (b(), k("div", {
|
|
1062
|
+
class: S(l.value),
|
|
1063
|
+
role: "radiogroup",
|
|
1064
|
+
"aria-disabled": d.disabled || void 0,
|
|
1065
|
+
"aria-label": d.ariaLabel || void 0,
|
|
1066
|
+
"aria-labelledby": d.ariaLabelledby || void 0
|
|
1067
|
+
}, [
|
|
1068
|
+
_(d.$slots, "default")
|
|
1069
|
+
], 10, jo));
|
|
1070
|
+
}
|
|
1071
|
+
}), Ko = ["name", "value", "checked", "disabled"], Go = {
|
|
1072
|
+
key: 0,
|
|
1073
|
+
class: "vf-radio__label"
|
|
1074
|
+
}, Nt = /* @__PURE__ */ D({
|
|
1075
|
+
__name: "radio-button",
|
|
1076
|
+
props: {
|
|
1077
|
+
modelValue: { type: [String, Number, Boolean, null], default: void 0 },
|
|
1078
|
+
value: { type: [String, Number, Boolean, null], default: void 0 },
|
|
1079
|
+
label: { default: "" },
|
|
1080
|
+
disabled: { type: Boolean, default: !1 },
|
|
1081
|
+
name: {},
|
|
1082
|
+
variant: { default: "filled" }
|
|
1083
|
+
},
|
|
1084
|
+
emits: ["update:modelValue", "change"],
|
|
1085
|
+
setup(o, { emit: e }) {
|
|
1086
|
+
const r = e, t = o, l = Ue(Xe, null), u = C(() => l ? l.modelValue.value : t.modelValue), i = C(() => l ? l.name.value : t.name), d = C(() => l ? l.variant.value : t.variant), a = C(() => (l ? l.disabled.value : !1) || t.disabled), c = C(() => u.value === t.value), n = C(() => {
|
|
1087
|
+
const f = ["vf-radio", `vf-radio_${d.value}`];
|
|
1088
|
+
return a.value && f.push("vf-radio_disabled"), f;
|
|
1089
|
+
}), s = (f) => {
|
|
1090
|
+
a.value || (l ? l.onChange(t.value, f) : r("update:modelValue", t.value), r("change", t.value, f));
|
|
1091
|
+
};
|
|
1092
|
+
return (f, v) => (b(), k("label", {
|
|
1093
|
+
class: S(n.value)
|
|
1094
|
+
}, [
|
|
1095
|
+
z("input", {
|
|
1096
|
+
class: "vf-radio__control",
|
|
1097
|
+
type: "radio",
|
|
1098
|
+
name: i.value,
|
|
1099
|
+
value: f.value,
|
|
1100
|
+
checked: c.value,
|
|
1101
|
+
disabled: a.value,
|
|
1102
|
+
onChange: s
|
|
1103
|
+
}, null, 40, Ko),
|
|
1104
|
+
v[0] || (v[0] = z("span", { class: "vf-radio__circle" }, null, -1)),
|
|
1105
|
+
f.label || f.$slots.default ? (b(), k("span", Go, [
|
|
1106
|
+
_(f.$slots, "default", {}, () => [
|
|
1107
|
+
te(A(f.label), 1)
|
|
993
1108
|
])
|
|
994
|
-
])) :
|
|
1109
|
+
])) : x("", !0)
|
|
995
1110
|
], 2));
|
|
996
1111
|
}
|
|
997
|
-
}),
|
|
1112
|
+
}), Uo = ["checked", "disabled"], qo = {
|
|
998
1113
|
key: 0,
|
|
999
1114
|
class: "vf-switch__label"
|
|
1000
|
-
},
|
|
1115
|
+
}, Xt = /* @__PURE__ */ D({
|
|
1001
1116
|
__name: "switch",
|
|
1002
1117
|
props: {
|
|
1003
1118
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1005,114 +1120,114 @@ const ht = (t, e) => t.strategy ? t.strategy : gt(e) ? "fixed" : "absolute", Q =
|
|
|
1005
1120
|
disabled: { type: Boolean, default: !1 }
|
|
1006
1121
|
},
|
|
1007
1122
|
emits: ["update:modelValue", "change"],
|
|
1008
|
-
setup(
|
|
1009
|
-
const r = e,
|
|
1123
|
+
setup(o, { emit: e }) {
|
|
1124
|
+
const r = e, t = o, l = C(() => {
|
|
1010
1125
|
const i = ["vf-switch"];
|
|
1011
|
-
return
|
|
1012
|
-
}),
|
|
1013
|
-
const
|
|
1014
|
-
r("update:modelValue",
|
|
1126
|
+
return t.disabled && i.push("vf-switch_disabled"), i;
|
|
1127
|
+
}), u = (i) => {
|
|
1128
|
+
const d = i.target;
|
|
1129
|
+
r("update:modelValue", d.checked), r("change", i);
|
|
1015
1130
|
};
|
|
1016
|
-
return (i,
|
|
1017
|
-
class:
|
|
1131
|
+
return (i, d) => (b(), k("label", {
|
|
1132
|
+
class: S(l.value)
|
|
1018
1133
|
}, [
|
|
1019
|
-
|
|
1134
|
+
z("input", {
|
|
1020
1135
|
class: "vf-switch__control",
|
|
1021
1136
|
type: "checkbox",
|
|
1022
1137
|
checked: i.modelValue,
|
|
1023
1138
|
disabled: i.disabled,
|
|
1024
|
-
onChange:
|
|
1025
|
-
}, null, 40,
|
|
1026
|
-
|
|
1027
|
-
|
|
1139
|
+
onChange: u
|
|
1140
|
+
}, null, 40, Uo),
|
|
1141
|
+
d[0] || (d[0] = z("span", { class: "vf-switch__track" }, [
|
|
1142
|
+
z("span", { class: "vf-switch__thumb" })
|
|
1028
1143
|
], -1)),
|
|
1029
|
-
i.label || i.$slots.default ? (
|
|
1144
|
+
i.label || i.$slots.default ? (b(), k("span", qo, [
|
|
1030
1145
|
_(i.$slots, "default", {}, () => [
|
|
1031
|
-
|
|
1146
|
+
te(A(i.label), 1)
|
|
1032
1147
|
])
|
|
1033
|
-
])) :
|
|
1148
|
+
])) : x("", !0)
|
|
1034
1149
|
], 2));
|
|
1035
1150
|
}
|
|
1036
|
-
}),
|
|
1151
|
+
}), Zo = { class: "vf-popover" }, Jo = ["aria-expanded", "onKeydown"], Yt = /* @__PURE__ */ D({
|
|
1037
1152
|
__name: "popover",
|
|
1038
1153
|
emits: ["click", "onClick"],
|
|
1039
|
-
setup(
|
|
1040
|
-
const
|
|
1041
|
-
let
|
|
1042
|
-
const i = `vf-popover-panel-${++
|
|
1043
|
-
|
|
1154
|
+
setup(o, { expose: e, emit: r }) {
|
|
1155
|
+
const t = r, l = qe({ visible: !1 });
|
|
1156
|
+
let u = 0;
|
|
1157
|
+
const i = `vf-popover-panel-${++u}`, d = () => l.visible = !0, a = () => l.visible = !1, c = () => l.visible = !l.visible, n = () => {
|
|
1158
|
+
c(), t("click"), t("onClick");
|
|
1044
1159
|
};
|
|
1045
|
-
return e({ show:
|
|
1046
|
-
|
|
1160
|
+
return e({ show: d, hide: a, toggle: c }), (s, f) => (b(), k("div", Zo, [
|
|
1161
|
+
z("div", {
|
|
1047
1162
|
class: "vf-popover__button",
|
|
1048
1163
|
role: "button",
|
|
1049
1164
|
tabindex: "0",
|
|
1050
1165
|
"aria-haspopup": "dialog",
|
|
1051
1166
|
"aria-expanded": l.visible,
|
|
1052
1167
|
"aria-controls": i,
|
|
1053
|
-
onClick:
|
|
1168
|
+
onClick: n,
|
|
1054
1169
|
onKeydown: [
|
|
1055
|
-
|
|
1056
|
-
|
|
1170
|
+
le(ae(n, ["prevent"]), ["enter"]),
|
|
1171
|
+
le(ae(n, ["prevent"]), ["space"])
|
|
1057
1172
|
]
|
|
1058
1173
|
}, [
|
|
1059
1174
|
_(s.$slots, "button")
|
|
1060
|
-
], 40,
|
|
1061
|
-
ke(We(
|
|
1175
|
+
], 40, Jo),
|
|
1176
|
+
ke(We(uo, {
|
|
1062
1177
|
id: i,
|
|
1063
1178
|
class: "vf-popover__wrapper"
|
|
1064
|
-
},
|
|
1065
|
-
default:
|
|
1066
|
-
|
|
1179
|
+
}, Ze({
|
|
1180
|
+
default: oe(() => [
|
|
1181
|
+
f[0] || (f[0] = z("div", { class: "vf-popover__arrow" }, null, -1))
|
|
1067
1182
|
]),
|
|
1068
1183
|
_: 2
|
|
1069
1184
|
}, [
|
|
1070
1185
|
s.$slots.default ? {
|
|
1071
1186
|
name: "default",
|
|
1072
|
-
fn:
|
|
1187
|
+
fn: oe(() => [
|
|
1073
1188
|
_(s.$slots, "default")
|
|
1074
1189
|
]),
|
|
1075
1190
|
key: "0"
|
|
1076
1191
|
} : void 0,
|
|
1077
1192
|
s.$slots.header || s.$slots.popoverHeader ? {
|
|
1078
1193
|
name: "header",
|
|
1079
|
-
fn:
|
|
1194
|
+
fn: oe(() => [
|
|
1080
1195
|
_(s.$slots, "header"),
|
|
1081
|
-
s.$slots.header ?
|
|
1196
|
+
s.$slots.header ? x("", !0) : _(s.$slots, "popoverHeader", { key: 0 })
|
|
1082
1197
|
]),
|
|
1083
1198
|
key: "1"
|
|
1084
1199
|
} : void 0,
|
|
1085
1200
|
s.$slots.body || s.$slots.popoverBody ? {
|
|
1086
1201
|
name: "body",
|
|
1087
|
-
fn:
|
|
1202
|
+
fn: oe(() => [
|
|
1088
1203
|
_(s.$slots, "body"),
|
|
1089
|
-
s.$slots.body ?
|
|
1204
|
+
s.$slots.body ? x("", !0) : _(s.$slots, "popoverBody", { key: 0 })
|
|
1090
1205
|
]),
|
|
1091
1206
|
key: "2"
|
|
1092
1207
|
} : void 0,
|
|
1093
1208
|
s.$slots.footer || s.$slots.popoverFooter ? {
|
|
1094
1209
|
name: "footer",
|
|
1095
|
-
fn:
|
|
1210
|
+
fn: oe(() => [
|
|
1096
1211
|
_(s.$slots, "footer"),
|
|
1097
|
-
s.$slots.footer ?
|
|
1212
|
+
s.$slots.footer ? x("", !0) : _(s.$slots, "popoverFooter", { key: 0 })
|
|
1098
1213
|
]),
|
|
1099
1214
|
key: "3"
|
|
1100
1215
|
} : void 0
|
|
1101
1216
|
]), 1536), [
|
|
1102
|
-
[
|
|
1217
|
+
[Ce, l.visible]
|
|
1103
1218
|
])
|
|
1104
1219
|
]));
|
|
1105
1220
|
}
|
|
1106
|
-
}),
|
|
1221
|
+
}), Qo = ["aria-labelledby", "aria-describedby"], et = {
|
|
1107
1222
|
key: 0,
|
|
1108
1223
|
class: "vf-modal__header"
|
|
1109
|
-
},
|
|
1224
|
+
}, ot = {
|
|
1110
1225
|
key: 0,
|
|
1111
1226
|
class: "vf-modal__title"
|
|
1112
|
-
},
|
|
1227
|
+
}, tt = {
|
|
1113
1228
|
key: 3,
|
|
1114
1229
|
class: "vf-modal__footer"
|
|
1115
|
-
},
|
|
1230
|
+
}, jt = /* @__PURE__ */ D({
|
|
1116
1231
|
__name: "modal",
|
|
1117
1232
|
props: {
|
|
1118
1233
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1124,113 +1239,113 @@ const ht = (t, e) => t.strategy ? t.strategy : gt(e) ? "fixed" : "absolute", Q =
|
|
|
1124
1239
|
size: { default: "md" }
|
|
1125
1240
|
},
|
|
1126
1241
|
emits: ["update:modelValue", "open", "close"],
|
|
1127
|
-
setup(
|
|
1128
|
-
const
|
|
1129
|
-
let
|
|
1130
|
-
const
|
|
1131
|
-
const
|
|
1132
|
-
return l.size !== "md" &&
|
|
1133
|
-
}),
|
|
1134
|
-
|
|
1242
|
+
setup(o, { expose: e, emit: r }) {
|
|
1243
|
+
const t = r, l = o;
|
|
1244
|
+
let u = 0, i = 0, d = "", a = null;
|
|
1245
|
+
const c = P(null), n = Je(), s = `vf-modal-title-${++u}`, f = `vf-modal-body-${u}`, v = C(() => !!l.title || !!n.header), p = C(() => !!n.body || !!n.default), w = C(() => {
|
|
1246
|
+
const m = ["vf-modal"];
|
|
1247
|
+
return l.size !== "md" && m.push(`vf-modal_${l.size}`), m;
|
|
1248
|
+
}), h = () => t("update:modelValue", !0), B = () => {
|
|
1249
|
+
t("update:modelValue", !1), t("close");
|
|
1135
1250
|
}, L = () => {
|
|
1136
|
-
l.closeOnOverlay &&
|
|
1137
|
-
},
|
|
1138
|
-
!l.modelValue || !l.closeOnEsc ||
|
|
1139
|
-
},
|
|
1251
|
+
l.closeOnOverlay && B();
|
|
1252
|
+
}, V = (m) => {
|
|
1253
|
+
!l.modelValue || !l.closeOnEsc || m.key === "Escape" && (m.preventDefault(), B());
|
|
1254
|
+
}, R = () => 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((g) => !g.hasAttribute("disabled") && !g.getAttribute("aria-hidden")) : [], $ = () => {
|
|
1140
1255
|
var g;
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
}, F = (
|
|
1256
|
+
const m = R();
|
|
1257
|
+
m.length ? m[0].focus() : (g = c.value) == null || g.focus();
|
|
1258
|
+
}, F = (m) => {
|
|
1144
1259
|
var E;
|
|
1145
|
-
if (
|
|
1260
|
+
if (m.key !== "Tab")
|
|
1146
1261
|
return;
|
|
1147
|
-
const g =
|
|
1262
|
+
const g = R();
|
|
1148
1263
|
if (!g.length) {
|
|
1149
|
-
|
|
1264
|
+
m.preventDefault(), (E = c.value) == null || E.focus();
|
|
1150
1265
|
return;
|
|
1151
1266
|
}
|
|
1152
|
-
const y = g[0],
|
|
1153
|
-
if (
|
|
1154
|
-
|
|
1267
|
+
const y = g[0], T = g[g.length - 1], H = document.activeElement;
|
|
1268
|
+
if (m.shiftKey && H === y) {
|
|
1269
|
+
m.preventDefault(), T.focus();
|
|
1155
1270
|
return;
|
|
1156
1271
|
}
|
|
1157
|
-
!
|
|
1272
|
+
!m.shiftKey && H === T && (m.preventDefault(), y.focus());
|
|
1158
1273
|
}, O = () => {
|
|
1159
|
-
!l.lockScroll || typeof document > "u" || (i === 0 && (
|
|
1274
|
+
!l.lockScroll || typeof document > "u" || (i === 0 && (d = document.body.style.overflow, document.body.style.overflow = "hidden"), i += 1);
|
|
1160
1275
|
}, W = () => {
|
|
1161
|
-
!l.lockScroll || typeof document > "u" || (i = Math.max(0, i - 1), i === 0 && (document.body.style.overflow =
|
|
1276
|
+
!l.lockScroll || typeof document > "u" || (i = Math.max(0, i - 1), i === 0 && (document.body.style.overflow = d));
|
|
1162
1277
|
};
|
|
1163
1278
|
return ne(
|
|
1164
1279
|
() => l.modelValue,
|
|
1165
|
-
async (
|
|
1166
|
-
|
|
1280
|
+
async (m) => {
|
|
1281
|
+
m ? (typeof document < "u" && (a = document.activeElement), O(), t("open"), await _e(), $(), typeof document < "u" && document.addEventListener("keydown", V)) : (W(), typeof document < "u" && (document.removeEventListener("keydown", V), a == null || a.focus()));
|
|
1167
1282
|
},
|
|
1168
1283
|
{ immediate: !0 }
|
|
1169
1284
|
), $e(() => {
|
|
1170
|
-
W(), typeof document < "u" && document.removeEventListener("keydown",
|
|
1171
|
-
}), e({ open:
|
|
1172
|
-
ke(
|
|
1173
|
-
class:
|
|
1285
|
+
W(), typeof document < "u" && document.removeEventListener("keydown", V);
|
|
1286
|
+
}), e({ open: h, close: B }), (m, g) => (b(), X(xe, { to: "body" }, [
|
|
1287
|
+
ke(z("div", {
|
|
1288
|
+
class: S(w.value),
|
|
1174
1289
|
role: "presentation"
|
|
1175
1290
|
}, [
|
|
1176
|
-
|
|
1291
|
+
z("div", {
|
|
1177
1292
|
class: "vf-modal__overlay",
|
|
1178
1293
|
onClick: L
|
|
1179
1294
|
}),
|
|
1180
|
-
|
|
1295
|
+
z("div", {
|
|
1181
1296
|
ref_key: "panel",
|
|
1182
|
-
ref:
|
|
1297
|
+
ref: c,
|
|
1183
1298
|
class: "vf-modal__panel",
|
|
1184
1299
|
role: "dialog",
|
|
1185
1300
|
"aria-modal": "true",
|
|
1186
|
-
"aria-labelledby":
|
|
1187
|
-
"aria-describedby": p.value ?
|
|
1301
|
+
"aria-labelledby": v.value ? s : void 0,
|
|
1302
|
+
"aria-describedby": p.value ? f : void 0,
|
|
1188
1303
|
tabindex: "-1",
|
|
1189
1304
|
onKeydown: F
|
|
1190
1305
|
}, [
|
|
1191
|
-
|
|
1192
|
-
|
|
1306
|
+
v.value ? (b(), k("div", et, [
|
|
1307
|
+
z("div", {
|
|
1193
1308
|
id: s,
|
|
1194
1309
|
class: "vf-modal__header-content"
|
|
1195
1310
|
}, [
|
|
1196
|
-
_(
|
|
1197
|
-
|
|
1311
|
+
_(m.$slots, "header", {}, () => [
|
|
1312
|
+
m.title ? (b(), k("h3", ot, A(m.title), 1)) : x("", !0)
|
|
1198
1313
|
])
|
|
1199
1314
|
])
|
|
1200
|
-
])) :
|
|
1201
|
-
|
|
1315
|
+
])) : x("", !0),
|
|
1316
|
+
m.showClose ? _(m.$slots, "close", {
|
|
1202
1317
|
key: 1,
|
|
1203
|
-
close:
|
|
1318
|
+
close: B
|
|
1204
1319
|
}, () => [
|
|
1205
|
-
|
|
1320
|
+
z("button", {
|
|
1206
1321
|
type: "button",
|
|
1207
1322
|
class: "vf-modal__close",
|
|
1208
1323
|
"aria-label": "Close",
|
|
1209
|
-
onClick:
|
|
1324
|
+
onClick: B
|
|
1210
1325
|
}, "×")
|
|
1211
|
-
]) :
|
|
1212
|
-
|
|
1326
|
+
]) : x("", !0),
|
|
1327
|
+
m.$slots.body || m.$slots.default ? (b(), k("div", {
|
|
1213
1328
|
key: 2,
|
|
1214
|
-
id:
|
|
1329
|
+
id: f,
|
|
1215
1330
|
class: "vf-modal__body"
|
|
1216
1331
|
}, [
|
|
1217
|
-
_(
|
|
1218
|
-
|
|
1219
|
-
])) :
|
|
1220
|
-
|
|
1221
|
-
_(
|
|
1222
|
-
])) :
|
|
1223
|
-
], 40,
|
|
1332
|
+
_(m.$slots, "body"),
|
|
1333
|
+
m.$slots.body ? x("", !0) : _(m.$slots, "default", { key: 0 })
|
|
1334
|
+
])) : x("", !0),
|
|
1335
|
+
m.$slots.footer ? (b(), k("div", tt, [
|
|
1336
|
+
_(m.$slots, "footer")
|
|
1337
|
+
])) : x("", !0)
|
|
1338
|
+
], 40, Qo)
|
|
1224
1339
|
], 2), [
|
|
1225
|
-
[
|
|
1340
|
+
[Ce, m.modelValue]
|
|
1226
1341
|
])
|
|
1227
1342
|
]));
|
|
1228
1343
|
}
|
|
1229
|
-
}),
|
|
1344
|
+
}), rt = ["data-placement"], lt = { class: "vf-tooltip__content" }, at = {
|
|
1230
1345
|
key: 0,
|
|
1231
1346
|
class: "vf-tooltip__arrow",
|
|
1232
1347
|
"aria-hidden": "true"
|
|
1233
|
-
},
|
|
1348
|
+
}, Kt = /* @__PURE__ */ D({
|
|
1234
1349
|
__name: "tooltip",
|
|
1235
1350
|
props: {
|
|
1236
1351
|
text: { default: "" },
|
|
@@ -1238,156 +1353,156 @@ const ht = (t, e) => t.strategy ? t.strategy : gt(e) ? "fixed" : "absolute", Q =
|
|
|
1238
1353
|
disabled: { type: Boolean, default: !1 },
|
|
1239
1354
|
arrow: { type: Boolean, default: !1 }
|
|
1240
1355
|
},
|
|
1241
|
-
setup(
|
|
1242
|
-
const e =
|
|
1356
|
+
setup(o) {
|
|
1357
|
+
const e = o;
|
|
1243
1358
|
let r = 0;
|
|
1244
|
-
const
|
|
1245
|
-
let
|
|
1246
|
-
const
|
|
1247
|
-
e.disabled || (
|
|
1248
|
-
},
|
|
1249
|
-
|
|
1359
|
+
const t = P(null), l = P(null), u = P(!1), i = P("top"), d = `vf-tooltip-${++r}`;
|
|
1360
|
+
let a = null;
|
|
1361
|
+
const c = () => {
|
|
1362
|
+
e.disabled || (u.value = !0);
|
|
1363
|
+
}, n = () => {
|
|
1364
|
+
u.value = !1;
|
|
1250
1365
|
}, s = () => {
|
|
1251
|
-
if (!
|
|
1366
|
+
if (!t.value || !l.value)
|
|
1252
1367
|
return;
|
|
1253
|
-
const
|
|
1368
|
+
const v = t.value, p = l.value, w = async () => {
|
|
1254
1369
|
const {
|
|
1255
|
-
x:
|
|
1256
|
-
y:
|
|
1257
|
-
placement:
|
|
1258
|
-
} = await
|
|
1370
|
+
x: V,
|
|
1371
|
+
y: R,
|
|
1372
|
+
placement: $
|
|
1373
|
+
} = await Ne(v, p, {
|
|
1259
1374
|
placement: e.placement,
|
|
1260
1375
|
strategy: "fixed",
|
|
1261
|
-
middleware: [De(8), Me(),
|
|
1376
|
+
middleware: [De(8), Me(), _o()]
|
|
1262
1377
|
});
|
|
1263
|
-
i.value =
|
|
1264
|
-
},
|
|
1378
|
+
i.value = $ ?? e.placement, p.style.left = `${V}px`, p.style.top = `${R}px`;
|
|
1379
|
+
}, h = async () => {
|
|
1265
1380
|
await w();
|
|
1266
|
-
},
|
|
1267
|
-
|
|
1381
|
+
}, B = Ie(v, () => {
|
|
1382
|
+
h();
|
|
1268
1383
|
}), L = () => {
|
|
1269
|
-
|
|
1384
|
+
h();
|
|
1270
1385
|
};
|
|
1271
|
-
document.addEventListener("scroll", L, !0), window.addEventListener("resize", L, !1),
|
|
1272
|
-
update:
|
|
1386
|
+
document.addEventListener("scroll", L, !0), window.addEventListener("resize", L, !1), a = {
|
|
1387
|
+
update: h,
|
|
1273
1388
|
destroy: () => {
|
|
1274
|
-
|
|
1389
|
+
B(), document.removeEventListener("scroll", L, !0), window.removeEventListener("resize", L, !1);
|
|
1275
1390
|
}
|
|
1276
|
-
},
|
|
1391
|
+
}, a.update();
|
|
1277
1392
|
};
|
|
1278
|
-
ne(
|
|
1279
|
-
if (!
|
|
1280
|
-
|
|
1393
|
+
ne(u, async (v) => {
|
|
1394
|
+
if (!v) {
|
|
1395
|
+
a && (a.destroy(), a = null);
|
|
1281
1396
|
return;
|
|
1282
1397
|
}
|
|
1283
|
-
|
|
1398
|
+
a || s(), a == null || a.update();
|
|
1284
1399
|
}), Oe(() => {
|
|
1285
|
-
|
|
1400
|
+
u.value && s();
|
|
1286
1401
|
}), $e(() => {
|
|
1287
|
-
|
|
1402
|
+
a == null || a.destroy(), a = null;
|
|
1288
1403
|
});
|
|
1289
|
-
const
|
|
1290
|
-
return ne(
|
|
1291
|
-
|
|
1292
|
-
}), (
|
|
1293
|
-
|
|
1404
|
+
const f = C(() => !!e.text || !!(l.value && l.value.textContent));
|
|
1405
|
+
return ne(f, (v) => {
|
|
1406
|
+
v || (u.value = !1);
|
|
1407
|
+
}), (v, p) => (b(), k(ce, null, [
|
|
1408
|
+
z("span", {
|
|
1294
1409
|
ref_key: "trigger",
|
|
1295
|
-
ref:
|
|
1410
|
+
ref: t,
|
|
1296
1411
|
class: "vf-tooltip__trigger",
|
|
1297
|
-
"aria-describedby":
|
|
1298
|
-
onMouseenter:
|
|
1299
|
-
onMouseleave:
|
|
1300
|
-
onFocus:
|
|
1301
|
-
onBlur:
|
|
1412
|
+
"aria-describedby": d,
|
|
1413
|
+
onMouseenter: c,
|
|
1414
|
+
onMouseleave: n,
|
|
1415
|
+
onFocus: c,
|
|
1416
|
+
onBlur: n
|
|
1302
1417
|
}, [
|
|
1303
|
-
_(
|
|
1418
|
+
_(v.$slots, "default")
|
|
1304
1419
|
], 544),
|
|
1305
|
-
(
|
|
1306
|
-
ke(
|
|
1307
|
-
id:
|
|
1420
|
+
(b(), X(xe, { to: "body" }, [
|
|
1421
|
+
ke(z("div", {
|
|
1422
|
+
id: d,
|
|
1308
1423
|
ref_key: "panel",
|
|
1309
1424
|
ref: l,
|
|
1310
1425
|
class: "vf-tooltip",
|
|
1311
1426
|
role: "tooltip",
|
|
1312
1427
|
"data-placement": i.value
|
|
1313
1428
|
}, [
|
|
1314
|
-
|
|
1315
|
-
_(
|
|
1316
|
-
|
|
1429
|
+
z("span", lt, [
|
|
1430
|
+
_(v.$slots, "content", {}, () => [
|
|
1431
|
+
te(A(v.text), 1)
|
|
1317
1432
|
])
|
|
1318
1433
|
]),
|
|
1319
|
-
|
|
1320
|
-
], 8,
|
|
1321
|
-
[
|
|
1434
|
+
v.arrow ? (b(), k("span", at)) : x("", !0)
|
|
1435
|
+
], 8, rt), [
|
|
1436
|
+
[Ce, u.value]
|
|
1322
1437
|
])
|
|
1323
1438
|
]))
|
|
1324
1439
|
], 64));
|
|
1325
1440
|
}
|
|
1326
|
-
}),
|
|
1327
|
-
const e =
|
|
1441
|
+
}), nt = ["dark", "light", "theme", "preset", "colors", "components", "colorScheme"], st = (o) => {
|
|
1442
|
+
const e = o.replace(/([A-Z])/g, "-$1");
|
|
1328
1443
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1329
|
-
},
|
|
1330
|
-
if (!
|
|
1444
|
+
}, it = (o) => o.filter((e) => !nt.includes(e)).map((e) => st(e)).join("-").toLowerCase(), we = (o) => o.join("."), dt = (o) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(o), Be = (o) => {
|
|
1445
|
+
if (!dt(o))
|
|
1331
1446
|
return null;
|
|
1332
|
-
if (
|
|
1333
|
-
const e =
|
|
1334
|
-
return `#${e}${e}${r}${r}${
|
|
1447
|
+
if (o.length === 4) {
|
|
1448
|
+
const e = o[1], r = o[2], t = o[3];
|
|
1449
|
+
return `#${e}${e}${r}${r}${t}${t}`;
|
|
1335
1450
|
}
|
|
1336
|
-
return
|
|
1337
|
-
}, Ye = (
|
|
1338
|
-
const e =
|
|
1451
|
+
return o.toLowerCase();
|
|
1452
|
+
}, Ye = (o) => {
|
|
1453
|
+
const e = Be(o);
|
|
1339
1454
|
if (!e)
|
|
1340
1455
|
return [0, 0, 0];
|
|
1341
|
-
const r = parseInt(e.slice(1), 16),
|
|
1342
|
-
return [
|
|
1343
|
-
},
|
|
1344
|
-
const [e, r,
|
|
1345
|
-
return `${e}, ${r}, ${
|
|
1346
|
-
},
|
|
1347
|
-
const
|
|
1348
|
-
let
|
|
1349
|
-
const s = (i +
|
|
1350
|
-
if (
|
|
1351
|
-
switch (
|
|
1352
|
-
case
|
|
1353
|
-
|
|
1456
|
+
const r = parseInt(e.slice(1), 16), t = r >> 16 & 255, l = r >> 8 & 255, u = r & 255;
|
|
1457
|
+
return [t, l, u];
|
|
1458
|
+
}, Ve = (o) => {
|
|
1459
|
+
const [e, r, t] = Ye(o);
|
|
1460
|
+
return `${e}, ${r}, ${t}`;
|
|
1461
|
+
}, ct = (o, e, r) => {
|
|
1462
|
+
const t = o / 255, l = e / 255, u = r / 255, i = Math.max(t, l, u), d = Math.min(t, l, u), a = i - d;
|
|
1463
|
+
let c = 0, n = 0;
|
|
1464
|
+
const s = (i + d) / 2;
|
|
1465
|
+
if (a !== 0) {
|
|
1466
|
+
switch (n = a / (1 - Math.abs(2 * s - 1)), i) {
|
|
1467
|
+
case t:
|
|
1468
|
+
c = (l - u) / a % 6;
|
|
1354
1469
|
break;
|
|
1355
1470
|
case l:
|
|
1356
|
-
|
|
1471
|
+
c = (u - t) / a + 2;
|
|
1357
1472
|
break;
|
|
1358
|
-
case
|
|
1359
|
-
|
|
1473
|
+
case u:
|
|
1474
|
+
c = (t - l) / a + 4;
|
|
1360
1475
|
break;
|
|
1361
1476
|
}
|
|
1362
|
-
|
|
1477
|
+
c *= 60, c < 0 && (c += 360);
|
|
1363
1478
|
}
|
|
1364
|
-
return [
|
|
1365
|
-
},
|
|
1366
|
-
const
|
|
1367
|
-
let
|
|
1368
|
-
|
|
1369
|
-
const s = Math.round((
|
|
1370
|
-
return [s,
|
|
1371
|
-
},
|
|
1372
|
-
const r =
|
|
1479
|
+
return [c, n * 100, s * 100];
|
|
1480
|
+
}, ut = (o, e, r) => {
|
|
1481
|
+
const t = e / 100, l = r / 100, u = (1 - Math.abs(2 * l - 1)) * t, i = u * (1 - Math.abs(o / 60 % 2 - 1)), d = l - u / 2;
|
|
1482
|
+
let a = 0, c = 0, n = 0;
|
|
1483
|
+
o >= 0 && o < 60 ? (a = u, c = i, n = 0) : o >= 60 && o < 120 ? (a = i, c = u, n = 0) : o >= 120 && o < 180 ? (a = 0, c = u, n = i) : o >= 180 && o < 240 ? (a = 0, c = i, n = u) : o >= 240 && o < 300 ? (a = i, c = 0, n = u) : (a = u, c = 0, n = i);
|
|
1484
|
+
const s = Math.round((a + d) * 255), f = Math.round((c + d) * 255), v = Math.round((n + d) * 255);
|
|
1485
|
+
return [s, f, v];
|
|
1486
|
+
}, ft = (o, e, r) => `#${[o, e, r].map((t) => t.toString(16).padStart(2, "0")).join("")}`, vt = (o, e, r) => Math.min(r, Math.max(e, o)), pt = (o, e) => {
|
|
1487
|
+
const r = Be(o);
|
|
1373
1488
|
if (!r)
|
|
1374
|
-
return
|
|
1375
|
-
const [
|
|
1376
|
-
return
|
|
1377
|
-
}, ye = (
|
|
1489
|
+
return o;
|
|
1490
|
+
const [t, l, u] = Ye(r), [i, d, a] = ct(t, l, u), n = (e - 5) * 7, s = vt(a + n, 0, 100), [f, v, p] = ut(i, d, s);
|
|
1491
|
+
return ft(f, v, p);
|
|
1492
|
+
}, ye = (o) => !!o && typeof o == "object" && !Array.isArray(o), Fe = (o, e) => {
|
|
1378
1493
|
if (!e)
|
|
1379
|
-
return { ...
|
|
1380
|
-
const r = { ...
|
|
1381
|
-
for (const
|
|
1382
|
-
const l = e[
|
|
1383
|
-
ye(
|
|
1494
|
+
return { ...o };
|
|
1495
|
+
const r = { ...o };
|
|
1496
|
+
for (const t in e) {
|
|
1497
|
+
const l = e[t], u = o[t];
|
|
1498
|
+
ye(u) && ye(l) ? r[t] = Fe(u, l) : r[t] = l;
|
|
1384
1499
|
}
|
|
1385
1500
|
return r;
|
|
1386
|
-
},
|
|
1387
|
-
if (!
|
|
1501
|
+
}, gt = (o) => {
|
|
1502
|
+
if (!o)
|
|
1388
1503
|
return null;
|
|
1389
|
-
if (ye(
|
|
1390
|
-
const e =
|
|
1504
|
+
if (ye(o) && "preset" in o) {
|
|
1505
|
+
const e = o;
|
|
1391
1506
|
return {
|
|
1392
1507
|
preset: e.preset ?? {},
|
|
1393
1508
|
overrides: e.overrides,
|
|
@@ -1396,89 +1511,89 @@ const ht = (t, e) => t.strategy ? t.strategy : gt(e) ? "fixed" : "absolute", Q =
|
|
|
1396
1511
|
strict: e.strict
|
|
1397
1512
|
};
|
|
1398
1513
|
}
|
|
1399
|
-
return { preset:
|
|
1400
|
-
},
|
|
1401
|
-
const e = [], r = [],
|
|
1402
|
-
if (!(!
|
|
1403
|
-
for (const
|
|
1404
|
-
const s = n
|
|
1514
|
+
return { preset: o };
|
|
1515
|
+
}, bt = (o) => {
|
|
1516
|
+
const e = [], r = [], t = [], l = [], u = (a) => t.push(a), i = (a) => l.push(a), d = (a, c) => {
|
|
1517
|
+
if (!(!a || typeof a != "object"))
|
|
1518
|
+
for (const n in a) {
|
|
1519
|
+
const s = a[n], f = c.concat([n]);
|
|
1405
1520
|
if (ye(s)) {
|
|
1406
|
-
|
|
1521
|
+
d(s, f);
|
|
1407
1522
|
continue;
|
|
1408
1523
|
}
|
|
1409
1524
|
if (s && typeof s == "object") {
|
|
1410
|
-
i(`Theme value "${
|
|
1525
|
+
i(`Theme value "${we(f)}" is not a plain object or string and will be ignored.`);
|
|
1411
1526
|
continue;
|
|
1412
1527
|
}
|
|
1413
1528
|
if (typeof s != "string") {
|
|
1414
|
-
i(`Theme value "${
|
|
1529
|
+
i(`Theme value "${we(f)}" is not a string and will be ignored.`);
|
|
1415
1530
|
continue;
|
|
1416
1531
|
}
|
|
1417
|
-
const p =
|
|
1418
|
-
if (p.push(`--vf-${w}: ${s}`),
|
|
1419
|
-
const
|
|
1420
|
-
if (!
|
|
1421
|
-
|
|
1422
|
-
`Theme color "${
|
|
1532
|
+
const p = f.includes("colorScheme") && f.includes("dark") ? r : e, w = it(f);
|
|
1533
|
+
if (p.push(`--vf-${w}: ${s}`), f.includes("colors")) {
|
|
1534
|
+
const h = Be(s);
|
|
1535
|
+
if (!h) {
|
|
1536
|
+
u(
|
|
1537
|
+
`Theme color "${we(f)}" is not hex. Shade variables will not be generated for it.`
|
|
1423
1538
|
);
|
|
1424
1539
|
continue;
|
|
1425
1540
|
}
|
|
1426
|
-
if (p.push(`--vf-${w}-rgb: ${
|
|
1427
|
-
for (let
|
|
1428
|
-
const L =
|
|
1429
|
-
p.push(`--vf-${w}-${
|
|
1541
|
+
if (p.push(`--vf-${w}-rgb: ${Ve(h)}`), n !== "white")
|
|
1542
|
+
for (let B = 1; B < 10; ++B) {
|
|
1543
|
+
const L = pt(h, B);
|
|
1544
|
+
p.push(`--vf-${w}-${B}00: ${L}`), p.push(`--vf-${w}-${B}00-rgb: ${Ve(L)}`);
|
|
1430
1545
|
}
|
|
1431
1546
|
}
|
|
1432
1547
|
}
|
|
1433
1548
|
};
|
|
1434
|
-
return
|
|
1435
|
-
},
|
|
1549
|
+
return d(o, []), { baseVars: e, darkVars: r, warnings: t, errors: l };
|
|
1550
|
+
}, mt = (o) => {
|
|
1436
1551
|
if (typeof document > "u")
|
|
1437
1552
|
return null;
|
|
1438
|
-
const e = document.getElementById(
|
|
1553
|
+
const e = document.getElementById(o);
|
|
1439
1554
|
if (e && e.tagName.toLowerCase() === "style")
|
|
1440
1555
|
return e;
|
|
1441
1556
|
const r = document.createElement("style");
|
|
1442
|
-
return r.id =
|
|
1443
|
-
},
|
|
1444
|
-
selector:
|
|
1445
|
-
darkSelector:
|
|
1446
|
-
}),
|
|
1447
|
-
const { baseVars: l, darkVars:
|
|
1448
|
-
if (!
|
|
1557
|
+
return r.id = o, document.head.appendChild(r), r;
|
|
1558
|
+
}, ht = (o) => ({
|
|
1559
|
+
selector: o.selector ?? ":root",
|
|
1560
|
+
darkSelector: o.darkSelector ?? ":root[data-theme=dark]"
|
|
1561
|
+
}), yt = (o, e, r, t) => {
|
|
1562
|
+
const { baseVars: l, darkVars: u, warnings: i, errors: d } = bt(o), a = mt("vueforge-theme");
|
|
1563
|
+
if (!a)
|
|
1449
1564
|
return;
|
|
1450
|
-
if (
|
|
1451
|
-
if (
|
|
1452
|
-
throw new Error(`[VueForge] ${
|
|
1453
|
-
for (const
|
|
1454
|
-
console.warn(`[VueForge] ${
|
|
1565
|
+
if (d.length) {
|
|
1566
|
+
if (t)
|
|
1567
|
+
throw new Error(`[VueForge] ${d.join(" ")}`);
|
|
1568
|
+
for (const n of d)
|
|
1569
|
+
console.warn(`[VueForge] ${n}`);
|
|
1455
1570
|
}
|
|
1456
1571
|
if (i.length)
|
|
1457
|
-
for (const
|
|
1458
|
-
console.warn(`[VueForge] ${
|
|
1459
|
-
const
|
|
1460
|
-
l.length &&
|
|
1572
|
+
for (const n of i)
|
|
1573
|
+
console.warn(`[VueForge] ${n}`);
|
|
1574
|
+
const c = [];
|
|
1575
|
+
l.length && c.push(`${e} { ${l.join(";")} }`), u.length && c.push(`${r} { ${u.join(";")} }`), a.textContent = c.join(`
|
|
1461
1576
|
`);
|
|
1462
1577
|
};
|
|
1463
1578
|
let J = null;
|
|
1464
|
-
const je = (
|
|
1465
|
-
const e =
|
|
1579
|
+
const je = (o) => {
|
|
1580
|
+
const e = gt(o);
|
|
1466
1581
|
if (!e)
|
|
1467
1582
|
return;
|
|
1468
|
-
const r =
|
|
1469
|
-
J = { ...e },
|
|
1470
|
-
},
|
|
1583
|
+
const r = Fe(e.preset, e.overrides), { selector: t, darkSelector: l } = ht(e);
|
|
1584
|
+
J = { ...e }, yt(r, t, l, e.strict);
|
|
1585
|
+
}, Gt = (o) => {
|
|
1471
1586
|
if (!J)
|
|
1472
1587
|
return;
|
|
1473
|
-
const e =
|
|
1474
|
-
preset:
|
|
1588
|
+
const e = o.overrides === void 0 ? J.overrides : Fe(J.overrides ?? {}, o.overrides ?? {}), r = {
|
|
1589
|
+
preset: o.preset ?? J.preset,
|
|
1475
1590
|
overrides: e,
|
|
1476
|
-
selector:
|
|
1477
|
-
darkSelector:
|
|
1591
|
+
selector: o.selector ?? J.selector,
|
|
1592
|
+
darkSelector: o.darkSelector ?? J.darkSelector
|
|
1478
1593
|
};
|
|
1479
1594
|
je(r);
|
|
1480
|
-
},
|
|
1481
|
-
install(
|
|
1595
|
+
}, Ut = () => J ? { ...J } : null, qt = {
|
|
1596
|
+
install(o, e = {}) {
|
|
1482
1597
|
e.theme && je(e.theme);
|
|
1483
1598
|
}
|
|
1484
1599
|
}, Re = {
|
|
@@ -1496,7 +1611,8 @@ const je = (t) => {
|
|
|
1496
1611
|
controls: {
|
|
1497
1612
|
height: "2rem",
|
|
1498
1613
|
paddingY: "0.25rem",
|
|
1499
|
-
paddingX: "0.6rem"
|
|
1614
|
+
paddingX: "0.6rem",
|
|
1615
|
+
backgroundColor: "var(--vf-bg-soft-color)"
|
|
1500
1616
|
},
|
|
1501
1617
|
radii: {
|
|
1502
1618
|
sm: "4px",
|
|
@@ -1543,7 +1659,7 @@ const je = (t) => {
|
|
|
1543
1659
|
dividerColor: "#2e2e32"
|
|
1544
1660
|
}
|
|
1545
1661
|
}
|
|
1546
|
-
},
|
|
1662
|
+
}, kt = {
|
|
1547
1663
|
fontSize: "var(--vf-typography-font-size)",
|
|
1548
1664
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
1549
1665
|
borderRadius: "var(--vf-radii-md)",
|
|
@@ -1685,17 +1801,17 @@ const je = (t) => {
|
|
|
1685
1801
|
}
|
|
1686
1802
|
}
|
|
1687
1803
|
}
|
|
1688
|
-
},
|
|
1804
|
+
}, Ct = {
|
|
1689
1805
|
padding: "12px",
|
|
1690
1806
|
borderColor: "var(--vf-border-color)",
|
|
1691
1807
|
borderRadius: "var(--vf-radii-md)"
|
|
1692
|
-
},
|
|
1808
|
+
}, wt = {
|
|
1693
1809
|
gap: "0.5rem",
|
|
1694
1810
|
fontSize: "var(--vf-typography-font-size)",
|
|
1695
1811
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
1696
1812
|
borderRadius: "var(--vf-radii-md)",
|
|
1697
1813
|
borderColor: "var(--vf-border-color)",
|
|
1698
|
-
backgroundColor: "var(--vf-
|
|
1814
|
+
backgroundColor: "var(--vf-controls-background-color)",
|
|
1699
1815
|
textColor: "var(--vf-text-color)",
|
|
1700
1816
|
placeholderColor: "var(--vf-secondary-text-color)",
|
|
1701
1817
|
focusBorderColor: "var(--vf-blue-600)",
|
|
@@ -1710,10 +1826,33 @@ const je = (t) => {
|
|
|
1710
1826
|
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
1711
1827
|
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
1712
1828
|
}
|
|
1713
|
-
},
|
|
1829
|
+
}, _t = {
|
|
1830
|
+
gap: "0.5rem",
|
|
1831
|
+
fontSize: "var(--vf-typography-font-size)",
|
|
1832
|
+
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
1833
|
+
borderRadius: "var(--vf-radii-md)",
|
|
1834
|
+
borderColor: "var(--vf-border-color)",
|
|
1835
|
+
backgroundColor: "var(--vf-controls-background-color)",
|
|
1836
|
+
textColor: "var(--vf-text-color)",
|
|
1837
|
+
placeholderColor: "var(--vf-secondary-text-color)",
|
|
1838
|
+
focusBorderColor: "var(--vf-blue-600)",
|
|
1839
|
+
focusRingShadow: "var(--vf-states-focus-ring-shadow)",
|
|
1840
|
+
hoverBorderColor: "var(--vf-blue-500)",
|
|
1841
|
+
disabledOpacity: "var(--vf-states-disabled-opacity)",
|
|
1842
|
+
minHeight: "calc(var(--vf-controls-height) * 2)",
|
|
1843
|
+
resize: "vertical",
|
|
1844
|
+
small: {
|
|
1845
|
+
padding: "var(--vf-sizes-sm-padding-y) var(--vf-sizes-sm-padding-x)",
|
|
1846
|
+
fontSize: "var(--vf-sizes-sm-font-size)"
|
|
1847
|
+
},
|
|
1848
|
+
large: {
|
|
1849
|
+
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
1850
|
+
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
1851
|
+
}
|
|
1852
|
+
}, $t = {
|
|
1714
1853
|
hoverColor: "var(--vf-blue)",
|
|
1715
1854
|
activeColor: "var(--vf-blue)"
|
|
1716
|
-
},
|
|
1855
|
+
}, xt = {
|
|
1717
1856
|
iconGap: "6px",
|
|
1718
1857
|
submenuOffset: "12px",
|
|
1719
1858
|
separatorThickness: "1px",
|
|
@@ -1733,7 +1872,7 @@ const je = (t) => {
|
|
|
1733
1872
|
marginBottom: "0.5rem",
|
|
1734
1873
|
marginLeft: "0.5rem"
|
|
1735
1874
|
}
|
|
1736
|
-
},
|
|
1875
|
+
}, Bt = {
|
|
1737
1876
|
width: "90vw",
|
|
1738
1877
|
maxWidth: "520px",
|
|
1739
1878
|
maxHeight: "80vh",
|
|
@@ -1760,9 +1899,9 @@ const je = (t) => {
|
|
|
1760
1899
|
closeColor: "var(--vf-text-color)",
|
|
1761
1900
|
closeFontSize: "1.25rem",
|
|
1762
1901
|
closeHoverBackgroundColor: "rgba(0, 0, 0, 0.06)"
|
|
1763
|
-
},
|
|
1902
|
+
}, Ft = {
|
|
1764
1903
|
backgroundColor: "var(--vf-bg-color)"
|
|
1765
|
-
},
|
|
1904
|
+
}, zt = {
|
|
1766
1905
|
minWidth: "12rem",
|
|
1767
1906
|
fontSize: "var(--vf-typography-font-size)",
|
|
1768
1907
|
controlGap: "0.75rem",
|
|
@@ -1770,7 +1909,7 @@ const je = (t) => {
|
|
|
1770
1909
|
padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
|
|
1771
1910
|
borderRadius: "var(--vf-radii-md)",
|
|
1772
1911
|
borderColor: "var(--vf-border-color)",
|
|
1773
|
-
backgroundColor: "var(--vf-
|
|
1912
|
+
backgroundColor: "var(--vf-controls-background-color)",
|
|
1774
1913
|
textColor: "var(--vf-text-color)",
|
|
1775
1914
|
focusBorderColor: "var(--vf-blue-600)",
|
|
1776
1915
|
hoverBorderColor: "var(--vf-blue-500)",
|
|
@@ -1795,19 +1934,33 @@ const je = (t) => {
|
|
|
1795
1934
|
padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
|
|
1796
1935
|
fontSize: "var(--vf-sizes-lg-font-size)"
|
|
1797
1936
|
}
|
|
1798
|
-
},
|
|
1937
|
+
}, St = {
|
|
1799
1938
|
size: "1rem",
|
|
1800
1939
|
gap: "0.5rem",
|
|
1801
1940
|
borderRadius: "var(--vf-radii-sm)",
|
|
1802
1941
|
checkBorderRadius: "2px",
|
|
1803
1942
|
borderColor: "var(--vf-border-color)",
|
|
1804
|
-
backgroundColor: "var(--vf-
|
|
1943
|
+
backgroundColor: "var(--vf-controls-background-color)",
|
|
1805
1944
|
checkedBackgroundColor: "var(--vf-blue)",
|
|
1806
1945
|
checkedBorderColor: "var(--vf-blue)",
|
|
1807
1946
|
checkColor: "#ffffff",
|
|
1808
1947
|
textColor: "var(--vf-text-color)",
|
|
1809
1948
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
1810
|
-
},
|
|
1949
|
+
}, Vt = {
|
|
1950
|
+
size: "1rem",
|
|
1951
|
+
dotSize: "0.45rem",
|
|
1952
|
+
gap: "0.5rem",
|
|
1953
|
+
groupGap: "0.5rem",
|
|
1954
|
+
borderRadius: "999px",
|
|
1955
|
+
dotBorderRadius: "999px",
|
|
1956
|
+
borderColor: "var(--vf-border-color)",
|
|
1957
|
+
backgroundColor: "var(--vf-controls-background-color)",
|
|
1958
|
+
checkedBackgroundColor: "var(--vf-blue)",
|
|
1959
|
+
checkedBorderColor: "var(--vf-blue)",
|
|
1960
|
+
dotColor: "#ffffff",
|
|
1961
|
+
textColor: "var(--vf-text-color)",
|
|
1962
|
+
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
1963
|
+
}, Rt = {
|
|
1811
1964
|
width: "2.25rem",
|
|
1812
1965
|
height: "1.25rem",
|
|
1813
1966
|
thumbSize: "1rem",
|
|
@@ -1819,7 +1972,7 @@ const je = (t) => {
|
|
|
1819
1972
|
thumbColor: "#ffffff",
|
|
1820
1973
|
textColor: "var(--vf-text-color)",
|
|
1821
1974
|
disabledOpacity: "var(--vf-states-disabled-opacity)"
|
|
1822
|
-
},
|
|
1975
|
+
}, Tt = {
|
|
1823
1976
|
padding: "0.35rem 0.6rem",
|
|
1824
1977
|
borderRadius: "8px",
|
|
1825
1978
|
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
|
@@ -1830,39 +1983,43 @@ const je = (t) => {
|
|
|
1830
1983
|
zIndex: "120",
|
|
1831
1984
|
maxWidth: "240px",
|
|
1832
1985
|
arrowSize: "8px"
|
|
1833
|
-
},
|
|
1986
|
+
}, Zt = {
|
|
1834
1987
|
...Re,
|
|
1835
1988
|
components: {
|
|
1836
1989
|
base: Re,
|
|
1837
|
-
button:
|
|
1838
|
-
card:
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
link:
|
|
1842
|
-
menu:
|
|
1843
|
-
modal:
|
|
1844
|
-
popover:
|
|
1845
|
-
select:
|
|
1846
|
-
checkbox:
|
|
1847
|
-
|
|
1848
|
-
|
|
1990
|
+
button: kt,
|
|
1991
|
+
card: Ct,
|
|
1992
|
+
input: wt,
|
|
1993
|
+
textarea: _t,
|
|
1994
|
+
link: $t,
|
|
1995
|
+
menu: xt,
|
|
1996
|
+
modal: Bt,
|
|
1997
|
+
popover: Ft,
|
|
1998
|
+
select: zt,
|
|
1999
|
+
checkbox: St,
|
|
2000
|
+
radio: Vt,
|
|
2001
|
+
switch: Rt,
|
|
2002
|
+
tooltip: Tt
|
|
1849
2003
|
}
|
|
1850
2004
|
};
|
|
1851
2005
|
export {
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
2006
|
+
Et as Button,
|
|
2007
|
+
uo as Card,
|
|
2008
|
+
Dt as Checkbox,
|
|
2009
|
+
Zt as DefaultTheme,
|
|
2010
|
+
Mt as Input,
|
|
1857
2011
|
He as Link,
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
2012
|
+
Ht as Menu,
|
|
2013
|
+
jt as Modal,
|
|
2014
|
+
Yt as Popover,
|
|
2015
|
+
Nt as RadioButton,
|
|
2016
|
+
It as RadioGroup,
|
|
2017
|
+
At as Select,
|
|
2018
|
+
Xt as Switch,
|
|
2019
|
+
Pt as Textarea,
|
|
2020
|
+
Kt as Tooltip,
|
|
2021
|
+
qt as VueForge,
|
|
2022
|
+
Ut as getTheme,
|
|
1866
2023
|
je as setTheme,
|
|
1867
|
-
|
|
2024
|
+
Gt as updateTheme
|
|
1868
2025
|
};
|