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