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