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