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