@codemonster-ru/vueforge 0.9.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 j, computed as _, watch as re, resolveComponent as ye, openBlock as b, createElementBlock as y, normalizeClass as $, renderSlot as C, Fragment as le, createTextVNode as oe, toDisplayString as E, createBlock as O, withCtx as Y, createCommentVNode as w, createElementVNode as B, renderList as ke, withKeys as Z, withModifiers as J, unref as Q, createVNode as Ce, nextTick as ce, onMounted as Re, onBeforeUnmount as we, Teleport as _e, withDirectives as ue, vShow as fe, reactive as Ve, createSlots as Le, useSlots as We } from "vue";
2
- import { useRoute as Oe, useRouter as Ee } from "vue-router";
3
- import { CmIcon as ee } from "@codemonster-ru/vueiconify";
4
- const He = ["href", "aria-disabled", "tabindex"], $e = /* @__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 },
@@ -14,97 +14,97 @@ const He = ["href", "aria-disabled", "tabindex"], $e = /* @__PURE__ */ K({
14
14
  disabled: { type: Boolean }
15
15
  },
16
16
  emits: ["click", "active", "update:active", "onActive"],
17
- setup(o, { emit: e }) {
18
- const r = e, t = o, l = Oe(), c = Ee(), s = j(null), i = _(() => t.href ?? t.url), n = _(() => t.as ? t.as === "router-link" && !t.to ? "a" : t.as : t.type === "router-link" || t.type === "a" ? t.type === "router-link" && !t.to ? "a" : t.type : t.to ? "router-link" : "a"), u = _(() => t.to), d = _(() => t.to ? c.resolve(t.to) : null), a = _(() => {
17
+ setup(t, { emit: e }) {
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
19
  if (n.value !== "router-link")
20
20
  return !1;
21
- const p = d.value;
22
- return p ? p.name ? l.matched.some(({ name: k }) => k === p.name) : p.fullPath ? l.fullPath === p.fullPath : l.path === p.path : !1;
23
- }), f = _(() => t.active === void 0 ? a.value : t.active), v = (p) => {
24
- if (!t.disabled) {
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
+ if (!o.disabled) {
25
25
  r("click", p);
26
26
  return;
27
27
  }
28
28
  p.preventDefault(), p.stopPropagation();
29
29
  };
30
- return re(a, (p) => {
30
+ return ne(s, (p) => {
31
31
  p && (r("active"), r("onActive")), r("update:active", p);
32
- }), (p, k) => {
33
- const m = ye("router-link");
34
- return n.value === "a" ? (b(), y("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: $(["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 ? C(p.$slots, "default", { key: 0 }) : (b(), y(le, { key: 1 }, [
43
- oe(E(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(), O(m, {
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: $(["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 ? C(p.$slots, "default", { key: 0 }) : (b(), y(le, { key: 1 }, [
59
- oe(E(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
- }), Me = (o, e) => {
67
- const r = o.__vccOpts || o;
68
- for (const [t, l] of e)
69
- r[t] = l;
66
+ }), Qe = (t, e) => {
67
+ const r = t.__vccOpts || t;
68
+ for (const [o, l] of e)
69
+ r[o] = l;
70
70
  return r;
71
- }, Pe = {}, Ae = { class: "vf-card" }, De = {
71
+ }, et = {}, tt = { class: "vf-card" }, ot = {
72
72
  key: 0,
73
73
  class: "vf-card__default"
74
- }, Ie = {
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 Ke(o, e) {
85
- return b(), y("div", Ae, [
86
- o.$slots.default ? (b(), y("div", De, [
87
- C(o.$slots, "default")
88
- ])) : w("", !0),
89
- o.$slots.header ? (b(), y("div", Ie, [
90
- C(o.$slots, "header")
91
- ])) : w("", !0),
92
- o.$slots.body ? (b(), y("div", je, [
93
- C(o.$slots, "body")
94
- ])) : w("", !0),
95
- o.$slots.footer ? (b(), y("div", Ne, [
96
- C(o.$slots, "footer")
97
- ])) : w("", !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 Xe = /* @__PURE__ */ Me(Pe, [["render", Ke]]), Ye = {
100
+ const st = /* @__PURE__ */ Qe(et, [["render", at]]), it = {
101
101
  class: "vf-menu__list",
102
102
  role: "menu"
103
- }, Ge = {
103
+ }, dt = {
104
104
  key: 1,
105
105
  class: "vf-menu__separator",
106
106
  role: "separator"
107
- }, qe = ["aria-expanded", "onClick", "onKeydown"], bt = /* @__PURE__ */ K({
107
+ }, ct = ["aria-expanded", "onClick", "onKeydown"], zo = /* @__PURE__ */ U({
108
108
  name: "VfMenu",
109
109
  __name: "menu",
110
110
  props: {
@@ -112,88 +112,88 @@ const Xe = /* @__PURE__ */ Me(Pe, [["render", Ke]]), Ye = {
112
112
  orientation: { default: "vertical" }
113
113
  },
114
114
  emits: ["active", "onActive"],
115
- setup(o, { emit: e }) {
116
- const r = e, t = o, l = j([]), 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
- })), n = (d) => {
120
- d.items && d.items.length ? (l.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 l.value) {
126
- const v = l.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));
115
+ setup(t, { emit: e }) {
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 re(
132
- () => t.items,
133
- (d) => {
134
- l.value = i(d);
131
+ return ne(
132
+ () => o.items,
133
+ (a) => {
134
+ l.value = c(a);
135
135
  },
136
136
  { deep: !0, immediate: !0 }
137
- ), (d, a) => {
138
- const f = ye("VfMenu");
139
- return b(), y("div", {
140
- class: $(["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", Ye, [
143
- (b(!0), y(le, null, ke(l.value, (v, p) => (b(), y("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)] ? C(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(), y("hr", Ge)) : v.items && v.items.length ? (b(), y(le, { key: 2 }, [
152
- B("div", {
153
- class: $(["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: (k) => n(v),
156
+ "aria-expanded": f.subMenuVisible ? "true" : "false",
157
+ onClick: (w) => n(f),
158
158
  onKeydown: [
159
- Z(J((k) => n(v), ["prevent"]), ["enter"]),
160
- Z(J((k) => n(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(), O(Q(ee), {
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"])) : w("", !0),
168
- oe(" " + E(v.label) + " ", 1),
169
- Ce(Q(ee), { icon: "chevronDown" })
170
- ], 42, qe),
171
- v.items ? (b(), O(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: $(["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"])) : w("", !0)
177
- ], 64)) : (b(), O($e, {
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: (k) => n(v),
188
- onActive: (k) => 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(), O(Q(ee), {
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"])) : w("", !0),
196
- oe(" " + E(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 Xe = /* @__PURE__ */ Me(Pe, [["render", Ke]]), Ye = {
202
202
  ], 2);
203
203
  };
204
204
  }
205
- }), Ue = ["type", "disabled"], ht = /* @__PURE__ */ K({
205
+ }), ut = ["type", "disabled"], So = /* @__PURE__ */ U({
206
206
  __name: "button",
207
207
  props: {
208
208
  to: { default: void 0 },
@@ -220,71 +220,71 @@ const Xe = /* @__PURE__ */ Me(Pe, [["render", Ke]]), Ye = {
220
220
  severity: { default: "primary" },
221
221
  disabled: { type: Boolean, default: !1 }
222
222
  },
223
- setup(o) {
224
- const e = o, r = ["button", "submit", "reset"], t = (d) => !!d && r.includes(d), l = _(() => e.as ? e.as === "button" : !(e.to || e.href || e.url || e.type && !t(e.type))), c = _(() => t(e.type) ? e.type : "button"), s = _(() => e.as === "link" ? e.to ? "router-link" : "a" : e.type && !t(e.type) ? e.type === "router-link" && e.to ? "router-link" : "a" : e.to ? "router-link" : "a"), i = _(() => {
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
- }), n = _(() => ["vf-button__icon", `vf-button__icon_${e.iconPos}`]), u = _(() => ["vf-button__label"]);
228
- return (d, a) => l.value ? (b(), y("button", {
223
+ setup(t) {
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: $(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(), O(Q(ee), {
234
+ e.icon && !e.loading ? (m(), I(ie(de), {
235
235
  key: 0,
236
236
  icon: e.icon,
237
- class: $(n.value)
238
- }, null, 8, ["icon", "class"])) : w("", !0),
239
- e.loading ? (b(), O(Q(ee), {
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: $(n.value),
242
+ class: V(n.value),
243
243
  spin: ""
244
- }, null, 8, ["class"])) : w("", !0),
245
- d.$slots.default ? (b(), y("span", {
244
+ }, null, 8, ["class"])) : $("", !0),
245
+ a.$slots.default ? (m(), k("span", {
246
246
  key: 2,
247
- class: $(u.value)
247
+ class: V(u.value)
248
248
  }, [
249
- C(d.$slots, "default")
250
- ], 2)) : d.label ? (b(), y("span", {
249
+ _(a.$slots, "default")
250
+ ], 2)) : a.label ? (m(), k("span", {
251
251
  key: 3,
252
- class: $(u.value)
253
- }, E(d.label), 3)) : w("", !0)
254
- ], 10, Ue)) : (b(), O($e, {
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: $(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(), O(Q(ee), {
262
+ default: te(() => [
263
+ e.icon ? (m(), I(ie(de), {
264
264
  key: 0,
265
265
  icon: e.icon,
266
- class: $(n.value)
267
- }, null, 8, ["icon", "class"])) : w("", !0),
268
- d.$slots.default ? (b(), y("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: $(u.value)
270
+ class: V(u.value)
271
271
  }, [
272
- C(d.$slots, "default")
273
- ], 2)) : d.label ? (b(), y("span", {
272
+ _(a.$slots, "default")
273
+ ], 2)) : a.label ? (m(), k("span", {
274
274
  key: 2,
275
- class: $(u.value)
276
- }, E(d.label), 3)) : w("", !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
- }), Ze = {
281
+ }), ft = {
282
282
  key: 0,
283
283
  class: "vf-input__prefix"
284
- }, Je = ["type", "value", "placeholder", "disabled", "readonly"], Qe = {
284
+ }, vt = ["type", "value", "placeholder", "disabled", "readonly"], pt = {
285
285
  key: 1,
286
286
  class: "vf-input__suffix"
287
- }, mt = /* @__PURE__ */ K({
287
+ }, To = /* @__PURE__ */ U({
288
288
  __name: "input",
289
289
  props: {
290
290
  modelValue: { default: "" },
@@ -296,38 +296,38 @@ const Xe = /* @__PURE__ */ Me(Pe, [["render", Ke]]), Ye = {
296
296
  variant: { default: "filled" }
297
297
  },
298
298
  emits: ["update:modelValue", "input", "change", "focus", "blur"],
299
- setup(o, { emit: e }) {
300
- const r = e, t = o, l = _(() => {
301
- const u = ["vf-input", `vf-input_${t.variant}`];
302
- return t.size !== "normal" && u.push(`vf-input_${t.size}`), t.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), n = (u) => r("blur", u);
307
- return (u, d) => (b(), y("div", {
308
- class: $(l.value)
299
+ setup(t, { emit: e }) {
300
+ const r = e, o = t, l = T(() => {
301
+ const u = ["vf-input", `vf-input_${o.variant}`];
302
+ return o.size !== "normal" && u.push(`vf-input_${o.size}`), o.disabled && u.push("vf-input_disabled"), u;
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(), y("span", Ze, [
311
- C(u.$slots, "prefix")
312
- ])) : w("", !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,
320
+ onInput: d,
321
+ onChange: i,
322
+ onFocus: c,
323
323
  onBlur: n
324
- }, null, 40, Je),
325
- u.$slots.suffix ? (b(), y("span", Qe, [
326
- C(u.$slots, "suffix")
327
- ])) : w("", !0)
324
+ }, null, 40, vt),
325
+ u.$slots.suffix ? (m(), k("span", pt, [
326
+ _(u.$slots, "suffix")
327
+ ])) : $("", !0)
328
328
  ], 2));
329
329
  }
330
- }), ge = [
330
+ }), ze = [
331
331
  "top",
332
332
  "top-start",
333
333
  "top-end",
@@ -340,368 +340,406 @@ const Xe = /* @__PURE__ */ Me(Pe, [["render", Ke]]), Ye = {
340
340
  "left",
341
341
  "left-start",
342
342
  "left-end"
343
- ], X = (o) => {
344
- if (o == null || !(o instanceof HTMLElement))
343
+ ], q = (t) => {
344
+ if (t == null || !(t instanceof HTMLElement))
345
345
  return null;
346
346
  if (typeof window < "u") {
347
- const e = window.getComputedStyle(o), r = `${e.overflowX}${e.overflowY}`;
347
+ const e = window.getComputedStyle(t), r = `${e.overflowX}${e.overflowY}`;
348
348
  if (/(auto|scroll|overlay)/.test(r))
349
- return o;
349
+ return t;
350
350
  }
351
- return o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth ? o : X(o.parentNode);
351
+ return t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth ? t : q(t.parentNode);
352
352
  };
353
- function eo(o) {
354
- return typeof window > "u" ? !1 : window.getComputedStyle(o).position === "fixed";
353
+ function gt(t) {
354
+ return typeof window > "u" ? !1 : window.getComputedStyle(t).position === "fixed";
355
355
  }
356
- const oo = (o, e) => o.strategy ? o.strategy : eo(e) ? "fixed" : "absolute", q = (o, e) => oo(o, e) === "fixed", V = (o, e, r = {}) => {
357
- const t = o.getBoundingClientRect(), l = e ? e.offsetParent : null, c = e ? q(r, e) : !1;
358
- if (l && !c) {
359
- const s = l.getBoundingClientRect(), i = l.scrollLeft, n = l.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: t.left - s.left + i,
362
- top: t.top - s.top + n,
363
- width: t.width,
364
- height: t.height
361
+ left: o.left - i.left + c,
362
+ top: o.top - i.top + n,
363
+ width: o.width,
364
+ height: o.height
365
365
  };
366
366
  }
367
367
  return {
368
- left: t.left,
369
- top: t.top,
370
- width: t.width,
371
- height: t.height
368
+ left: o.left,
369
+ top: o.top,
370
+ width: o.width,
371
+ height: o.height
372
372
  };
373
- }, G = (o, e) => {
373
+ }, oe = (t, e) => {
374
374
  var r;
375
- return (r = o.middleware) == null ? void 0 : r.find((t) => t.name === e);
376
- }, Fe = (o, e) => !!G(o, e), to = (o) => {
377
- const e = X(o);
375
+ return (r = t.middleware) == null ? void 0 : r.find((o) => o.name === e);
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
- }, ro = (o) => o.scrollLeft + o.clientWidth, lo = (o) => o.scrollTop + o.clientHeight, P = (o, e, r = null, t = {}, l) => {
381
- if (r === null && typeof window < "u" && q(t, e))
382
- return o;
383
- let c = 0;
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
+ return t;
383
+ let d = 0;
384
384
  if (r === null) {
385
- const s = X(e);
386
- c = s ? s.scrollTop : 0;
385
+ const i = q(e);
386
+ d = i ? i.scrollTop : 0;
387
387
  }
388
- return o - c;
389
- }, A = (o, e, r = null, t = {}, l) => {
390
- let c;
391
- if (r === null && typeof window < "u" && q(t, 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 = X(e);
395
- c = s ? ro(s) : 0;
394
+ const i = q(e);
395
+ d = i ? he(i) : 0;
396
396
  } else
397
- c = r.getBoundingClientRect().width;
398
- return -(o + e.clientWidth - c);
399
- }, I = (o, e, r = null, t = {}, l) => {
400
- let c;
401
- if (r === null && typeof window < "u" && q(t, 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 = X(e);
405
- c = s ? lo(s) : 0;
404
+ const i = q(e);
405
+ d = i ? me(i) : 0;
406
406
  } else
407
- c = r.getBoundingClientRect().height;
408
- return -(o + e.clientHeight - c);
409
- }, D = (o, e, r = null, t = {}, l) => {
410
- if (r === null && typeof window < "u" && q(t, e))
411
- return o;
412
- let c = 0;
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
+ return t;
412
+ let d = 0;
413
413
  if (r === null) {
414
- const s = X(e);
415
- c = s ? s.scrollLeft : 0;
414
+ const i = q(e);
415
+ d = i ? i.scrollLeft : 0;
416
416
  }
417
- return o - c;
418
- }, be = ({
419
- options: o,
417
+ return t - d;
418
+ }, Se = ({
419
+ options: t,
420
420
  primaryX: e,
421
421
  primaryY: r,
422
- floating: t,
422
+ floating: o,
423
423
  placement: l,
424
- reference: c,
425
- scrollDirection: s
424
+ reference: d,
425
+ scrollDirection: i
426
426
  }) => {
427
- const i = se(c, t, l, o), n = G(o, "offset");
427
+ const c = be(d, o, l, t), n = oe(t, "offset");
428
428
  if (n) {
429
429
  const u = n.fn({
430
- x: i.x,
431
- y: i.y,
432
- options: o,
430
+ x: c.x,
431
+ y: c.y,
432
+ options: t,
433
433
  primaryX: e,
434
434
  primaryY: r,
435
- floating: t,
435
+ floating: o,
436
436
  placement: l,
437
- reference: c,
438
- scrollDirection: s
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 Fo(i, t, c, o) ? {
443
- x: i.x,
444
- y: i.y,
442
+ return Vt(c, o, d, t) ? {
443
+ x: c.x,
444
+ y: c.y,
445
445
  placement: l
446
446
  } : !1;
447
- }, no = (o) => ({
447
+ }, Me = (t) => ({
448
448
  name: "flip",
449
- params: o,
449
+ params: t,
450
450
  fn: ({
451
451
  x: e,
452
452
  y: r,
453
- options: t,
453
+ options: o,
454
454
  primaryX: l,
455
- primaryY: c,
456
- floating: s,
457
- placement: i,
455
+ primaryY: d,
456
+ floating: i,
457
+ placement: c,
458
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 = {
467
- ...t,
468
- middleware: (d = t.middleware) == null ? void 0 : d.filter((z) => z.name !== "shift")
469
- }, v = (o == null ? void 0 : o.placements) ?? ge, p = !(o != null && o.placements), k = p ? ge : v;
470
- let m = !1;
471
- const x = (z) => {
472
- if (m)
465
+ placement: c
466
+ }, v = {
467
+ ...o,
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 S = be({
475
- options: f,
474
+ const z = Se({
475
+ options: v,
476
476
  primaryX: l,
477
- primaryY: c,
478
- floating: s,
479
- placement: z,
477
+ primaryY: d,
478
+ floating: i,
479
+ placement: B,
480
480
  reference: n,
481
481
  scrollDirection: u
482
482
  });
483
- S && (a.x = S.x, a.y = S.y, a.placement = S.placement, m = !0);
484
- }, H = xo(n, s, f);
485
- if (!p && v.includes(i) && x(i), m || k.forEach(x), !m) {
486
- const z = v.reduce(
487
- (S, L) => {
488
- const M = be({
489
- options: f,
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
490
  primaryX: l,
491
- primaryY: c,
492
- floating: s,
493
- placement: L,
491
+ primaryY: d,
492
+ floating: i,
493
+ placement: C,
494
494
  reference: n,
495
495
  scrollDirection: u
496
496
  });
497
- if (!M)
498
- return S;
499
- const R = te(L), W = H[R];
500
- return !S || W > S.space ? { result: M, space: W } : S;
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
- z && (a.x = z.result.x, a.y = z.result.y, a.placement = z.result.placement, m = !0);
504
+ B && (s.x = B.result.x, s.y = B.result.y, s.placement = B.result.placement, b = !0);
505
505
  }
506
- if (!m && v.length > 0) {
507
- const z = te(i);
508
- let S = z, L = H[z];
509
- v.forEach((h) => {
510
- const g = te(h), F = H[g];
511
- F > L && (L = F, S = 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 M = Bo(S, i, v), R = se(n, s, M, f), W = G(f, "offset");
513
+ const F = Wt(z, c, f), O = be(n, i, F, v), W = oe(v, "offset");
514
514
  if (W) {
515
515
  const h = W.fn({
516
- x: R.x,
517
- y: R.y,
518
- options: f,
516
+ x: O.x,
517
+ y: O.y,
518
+ options: v,
519
519
  primaryX: l,
520
- primaryY: c,
521
- floating: s,
522
- placement: M,
520
+ primaryY: d,
521
+ floating: i,
522
+ placement: F,
523
523
  reference: n,
524
524
  scrollDirection: u
525
525
  });
526
- R.x = h.x, R.y = h.y;
526
+ O.x = h.x, O.y = h.y;
527
527
  }
528
- a.x = R.x, a.y = R.y, a.placement = R.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
- }), ao = (o, e, r, t, l) => {
533
- var c, s, i;
532
+ }), Pe = (t, e, r, o, l) => {
533
+ var d, i, c;
534
534
  let n = 0;
535
- t.startsWith("right") ? n = -o : t.startsWith("left") && (n = o);
536
- const u = G(e, "arrow"), d = G(e, "shift");
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
- t.startsWith("right") ? n -= a.width / 2 : t.startsWith("left") && (n += 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 (Fe(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 += co(v), f -= o, t.startsWith("right") ? A(r - n, l, a, e) <= o ? A(r, l, a, e) > 0 ? n = o - A(r, l, a, e) : n = o : D(r - n - f, l, a, e) <= o && (D(r - n - f, l, a, e) >= 0 ? (n = -o - (D(r - n - f, l, a, e) + o), a && (n = -o)) : n = -o) : t.startsWith("left") ? A(r - n + f, l, a, e) <= o ? (n = o + A(r - f, l, a, e), n <= o && (n = o)) : D(r - n, l, a, e) <= o && (n = -o + D(r, l, a, e), n <= -o && (n = -o)) : A(r - n, l, a, e) <= o ? A(r - n, l, a, e) <= o && A(r, l, a, e) > 0 ? n = o - A(r, l, a, e) : n = o : D(r - n, l, a, e) <= o && (D(r - n, l, a, e) <= o && D(r, l, a, e) > 0 ? n = -(o - D(r, l, a, e)) : n = -o);
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
547
  return n;
548
- }, so = (o, e, r, t, l) => {
549
- var c, s, i;
548
+ }, Ae = (t, e, r, o, l) => {
549
+ var d, i, c;
550
550
  let n = 0;
551
- t.startsWith("top") ? n = o : t.startsWith("bottom") && (n = -o);
552
- const u = G(e, "arrow"), d = G(e, "shift");
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
- t.startsWith("top") ? n += a.height / 2 : t.startsWith("bottom") && (n -= 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 (Fe(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 += uo(v), f -= o, t.startsWith("top") ? P(r - n, l, a, e) <= o ? P(r, l, a, e) >= 0 ? n = -(o - P(r, l, a, e)) : n = -o : I(r - n + f, l, a, e) <= o && (n = o + I(r - f, l, a, e), n <= o && (n = o)) : t.startsWith("bottom") ? P(r - n - f, l, a, e) <= o ? P(r - n - f, l, a, e) >= 0 ? (n = -o - (P(r - n - f, l, a, e) + o), a && (n = -o)) : n = -o : I(r - n, l, a, e) <= o && (I(r, l, a, e) >= 0 ? n = o - I(r, l, a, e) : n = o) : P(r - n, l, a, e) <= o ? P(r - n, l, a, e) >= 0 ? n = -(o - P(r - n, l, a, e)) : n = -o : I(r - n, l, a, e) <= o && (I(r - n, l, a, e) >= 0 ? n = o - I(r - n, l, a, e) : n = o);
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
563
  return n;
564
- }, io = (o) => ({
564
+ }, De = (t) => ({
565
565
  name: "offset",
566
- params: { value: o },
566
+ params: { value: t },
567
567
  fn: ({
568
568
  x: e,
569
569
  y: r,
570
- options: t,
570
+ options: o,
571
571
  primaryX: l,
572
- primaryY: c,
573
- floating: s,
574
- placement: i
572
+ primaryY: d,
573
+ floating: i,
574
+ placement: c
575
575
  }) => ({
576
- x: e - ao(o, t, l, i, s),
577
- y: r - so(o, t, 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
- }), co = (o) => o.getBoundingClientRect().width !== o.clientWidth ? (o.getBoundingClientRect().width - o.clientWidth) / 2 : 0, uo = (o) => o.getBoundingClientRect().height !== o.clientHeight ? (o.getBoundingClientRect().height - o.clientHeight) / 2 : 0, fo = (o, e) => {
581
- const r = X(o), t = [];
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
621
  const l = () => e();
584
- r.addEventListener("scroll", l, !1), t.push(() => r.removeEventListener("scroll", l, !1));
622
+ r.addEventListener("scroll", l, !1), o.push(() => r.removeEventListener("scroll", l, !1));
585
623
  }
586
624
  if (typeof window < "u") {
587
- const l = () => e(), c = () => e();
588
- window.addEventListener("scroll", l, !1), window.addEventListener("resize", c, !1), t.push(() => window.removeEventListener("scroll", l, !1)), t.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
- if (typeof ResizeObserver < "u" && o instanceof HTMLElement) {
628
+ if (typeof ResizeObserver < "u" && t instanceof HTMLElement) {
591
629
  const l = new ResizeObserver(() => e());
592
- l.observe(o), t.push(() => l.disconnect());
630
+ l.observe(t), o.push(() => l.disconnect());
593
631
  }
594
- return () => t.forEach((l) => l());
595
- }, vo = (o, e, r = {}) => {
596
- const t = V(o, e, r);
632
+ return () => o.forEach((l) => l());
633
+ }, wt = (t, e, r = {}) => {
634
+ const o = A(t, e, r);
597
635
  return {
598
- x: t.left - e.getBoundingClientRect().width / 2 + t.width / 2,
599
- y: t.top - e.getBoundingClientRect().height,
636
+ x: o.left - e.getBoundingClientRect().width / 2 + o.width / 2,
637
+ y: o.top - e.getBoundingClientRect().height,
600
638
  placement: "top"
601
639
  };
602
- }, po = (o, e, r = {}) => {
603
- const t = V(o, e, r);
640
+ }, Ct = (t, e, r = {}) => {
641
+ const o = A(t, e, r);
604
642
  return {
605
- x: t.left,
606
- y: t.top - e.getBoundingClientRect().height,
643
+ x: o.left,
644
+ y: o.top - e.getBoundingClientRect().height,
607
645
  placement: "top-start"
608
646
  };
609
- }, go = (o, e, r = {}) => {
610
- const t = V(o, e, r);
647
+ }, _t = (t, e, r = {}) => {
648
+ const o = A(t, e, r);
611
649
  return {
612
- x: t.left - e.getBoundingClientRect().width + t.width,
613
- y: t.top - e.getBoundingClientRect().height,
650
+ x: o.left - e.getBoundingClientRect().width + o.width,
651
+ y: o.top - e.getBoundingClientRect().height,
614
652
  placement: "top-end"
615
653
  };
616
- }, bo = (o, e, r = {}) => {
617
- const t = V(o, e, r);
654
+ }, $t = (t, e, r = {}) => {
655
+ const o = A(t, e, r);
618
656
  return {
619
- x: t.left + t.width,
620
- y: t.top - e.getBoundingClientRect().height / 2 + t.height / 2,
657
+ x: o.left + o.width,
658
+ y: o.top - e.getBoundingClientRect().height / 2 + o.height / 2,
621
659
  placement: "right"
622
660
  };
623
- }, ho = (o, e, r = {}) => {
624
- const t = V(o, e, r);
661
+ }, xt = (t, e, r = {}) => {
662
+ const o = A(t, e, r);
625
663
  return {
626
- x: t.left + t.width,
627
- y: t.top,
664
+ x: o.left + o.width,
665
+ y: o.top,
628
666
  placement: "right-start"
629
667
  };
630
- }, mo = (o, e, r = {}) => {
631
- const t = V(o, e, r);
668
+ }, Ft = (t, e, r = {}) => {
669
+ const o = A(t, e, r);
632
670
  return {
633
- x: t.left + t.width,
634
- y: t.top + t.height - e.getBoundingClientRect().height,
671
+ x: o.left + o.width,
672
+ y: o.top + o.height - e.getBoundingClientRect().height,
635
673
  placement: "right-end"
636
674
  };
637
- }, yo = (o, e, r = {}) => {
638
- const t = V(o, e, r);
675
+ }, Bt = (t, e, r = {}) => {
676
+ const o = A(t, e, r);
639
677
  return {
640
- x: t.left + t.width / 2 - e.getBoundingClientRect().width / 2,
641
- y: t.top + t.height,
678
+ x: o.left + o.width / 2 - e.getBoundingClientRect().width / 2,
679
+ y: o.top + o.height,
642
680
  placement: "bottom"
643
681
  };
644
- }, ko = (o, e, r = {}) => {
645
- const t = V(o, e, r);
682
+ }, zt = (t, e, r = {}) => {
683
+ const o = A(t, e, r);
646
684
  return {
647
- x: t.left,
648
- y: t.top + t.height,
685
+ x: o.left,
686
+ y: o.top + o.height,
649
687
  placement: "bottom-start"
650
688
  };
651
- }, Co = (o, e, r = {}) => {
652
- const t = V(o, e, r);
689
+ }, St = (t, e, r = {}) => {
690
+ const o = A(t, e, r);
653
691
  return {
654
- x: t.left - e.getBoundingClientRect().width + t.width,
655
- y: t.top + t.height,
692
+ x: o.left - e.getBoundingClientRect().width + o.width,
693
+ y: o.top + o.height,
656
694
  placement: "bottom-end"
657
695
  };
658
- }, wo = (o, e, r = {}) => {
659
- const t = V(o, e, r);
696
+ }, Tt = (t, e, r = {}) => {
697
+ const o = A(t, e, r);
660
698
  return {
661
- x: t.left - e.getBoundingClientRect().width,
662
- y: t.top + t.height / 2 - e.getBoundingClientRect().height / 2,
699
+ x: o.left - e.getBoundingClientRect().width,
700
+ y: o.top + o.height / 2 - e.getBoundingClientRect().height / 2,
663
701
  placement: "left"
664
702
  };
665
- }, _o = (o, e, r = {}) => {
666
- const t = V(o, e, r);
703
+ }, Rt = (t, e, r = {}) => {
704
+ const o = A(t, e, r);
667
705
  return {
668
- x: t.left - e.getBoundingClientRect().width,
669
- y: t.top,
706
+ x: o.left - e.getBoundingClientRect().width,
707
+ y: o.top,
670
708
  placement: "left-start"
671
709
  };
672
- }, $o = (o, e, r = {}) => {
673
- const t = V(o, e, r);
710
+ }, Lt = (t, e, r = {}) => {
711
+ const o = A(t, e, r);
674
712
  return {
675
- x: t.left - e.getBoundingClientRect().width,
676
- y: t.top + t.height - e.getBoundingClientRect().height,
713
+ x: o.left - e.getBoundingClientRect().width,
714
+ y: o.top + o.height - e.getBoundingClientRect().height,
677
715
  placement: "left-end"
678
716
  };
679
- }, se = (o, e, r, t = {}) => {
717
+ }, be = (t, e, r, o = {}) => {
680
718
  switch (r) {
681
719
  case "top":
682
- return vo(o, e, t);
720
+ return wt(t, e, o);
683
721
  case "top-start":
684
- return po(o, e, t);
722
+ return Ct(t, e, o);
685
723
  case "top-end":
686
- return go(o, e, t);
724
+ return _t(t, e, o);
687
725
  case "right":
688
- return bo(o, e, t);
726
+ return $t(t, e, o);
689
727
  case "right-start":
690
- return ho(o, e, t);
728
+ return xt(t, e, o);
691
729
  case "right-end":
692
- return mo(o, e, t);
730
+ return Ft(t, e, o);
693
731
  case "bottom":
694
- return yo(o, e, t);
732
+ return Bt(t, e, o);
695
733
  case "bottom-start":
696
- return ko(o, e, t);
734
+ return zt(t, e, o);
697
735
  case "bottom-end":
698
- return Co(o, e, t);
736
+ return St(t, e, o);
699
737
  case "left":
700
- return wo(o, e, t);
738
+ return Tt(t, e, o);
701
739
  case "left-start":
702
- return _o(o, e, t);
740
+ return Rt(t, e, o);
703
741
  case "left-end":
704
- return $o(o, e, t);
742
+ return Lt(t, e, o);
705
743
  default:
706
744
  return {
707
745
  x: 0,
@@ -709,25 +747,25 @@ const oo = (o, e) => o.strategy ? o.strategy : eo(e) ? "fixed" : "absolute", q =
709
747
  placement: ""
710
748
  };
711
749
  }
712
- }, Fo = (o, e, r, t = {}) => {
713
- if (q(t, 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 = o.x, f = o.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 (X(r) !== null)
720
- return P(o.y, e, null, t) > 0 && A(o.x, e, null, t) > 0 && I(o.y, e, null, t) > 0 && D(o.x, e, null, t) > 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 l = 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 + o.x, v = a.top + o.y, p = f + e.clientWidth, k = v + e.clientHeight;
726
- return f >= 0 && v >= 0 && p <= l && k <= 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 = o.x, n = o.y, u = i + e.clientWidth, d = n + e.clientHeight;
729
- return i >= 0 && n >= 0 && u <= l && d <= c;
730
- }, te = (o) => o.startsWith("right") ? "right" : o.startsWith("left") ? "left" : o.startsWith("top") ? "top" : "bottom", Bo = (o, e, r) => te(e) === o && r.includes(e) ? e : r.find((t) => te(t) === o) ?? r[0], xo = (o, 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 oo = (o, e) => o.strategy ? o.strategy : eo(e) ? "fixed" : "absolute", q =
735
773
  bottom: 0,
736
774
  left: 0
737
775
  };
738
- const t = q(r, e) ? null : X(o), l = o.getBoundingClientRect(), c = t ? t.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: l.top - c.top,
746
- right: c.right - l.right,
747
- bottom: c.bottom - l.bottom,
748
- left: l.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
- }, zo = (o, e, r = {}) => new Promise((t) => {
751
- var l, 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
- }, n = se(o, e, s, r);
758
- i.x = n.x, i.y = n.y, i.placement = n.placement;
759
- const u = i.x, d = i.y, a = to(o);
760
- (l = r.middleware) == null || l.forEach((k) => {
761
- const m = k.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,
769
- reference: o,
770
- scrollDirection: a
806
+ placement: c.placement,
807
+ reference: t,
808
+ scrollDirection: s
771
809
  });
772
- i.x = m.x, i.y = m.y, i.placement = m.placement, k.name === "arrow" && (m.baseX = m.x, m.baseY = m.y, m.x = m.arrowX ?? m.x, m.y = m.arrowY ?? m.y), i.middlewareData[k.name] = m;
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 = se(o, e, i.placement, r), v = G(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 (q(r, e)) {
777
- const k = o.getBoundingClientRect(), m = e.getBoundingClientRect().height;
778
- i.placement.startsWith("top") ? i.y = k.top - m - p : i.placement.startsWith("bottom") ? i.y = k.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
- t(i);
782
- }), So = ["disabled", "aria-expanded", "onKeydown"], To = ["data-placement"], Ro = ["disabled", "aria-selected", "onClick"], yt = /* @__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 },
@@ -791,138 +829,138 @@ const oo = (o, e) => o.strategy ? o.strategy : eo(e) ? "fixed" : "absolute", q =
791
829
  size: { default: "normal" }
792
830
  },
793
831
  emits: ["update:modelValue", "change", "focus", "blur"],
794
- setup(o, { emit: e }) {
832
+ setup(t, { emit: e }) {
795
833
  let r = 0;
796
- const t = e, l = o, c = j(null), s = j(null), i = j(null), n = j(!1), u = j("bottom"), d = j("bottom"), a = `vf-select-panel-${++r}`;
797
- let f = null;
798
- const v = _(() => l.options.map((g) => ({
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) => ({
799
837
  label: g[l.optionLabel],
800
838
  value: g[l.optionValue],
801
839
  disabled: g.disabled
802
- }))), p = _(() => v.value.find((g) => g.value === l.modelValue)), k = _(() => {
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
- }), m = _(() => {
843
+ }), b = T(() => {
806
844
  const g = ["vf-select", n.value ? "vf-select_open" : ""];
807
845
  return l.size !== "normal" && g.push(`vf-select_${l.size}`), l.disabled && g.push("vf-select_disabled"), g.filter(Boolean);
808
- }), x = (g) => g.value === l.modelValue, H = (g) => {
809
- g.disabled || (t("update:modelValue", g.value), t("change", g.value), L());
810
- }, z = (g) => t("focus", g), S = (g) => t("blur", g), L = () => {
811
- n.value = !1, u.value = "bottom", d.value = "bottom";
812
- }, M = () => {
813
- l.disabled || (n.value = !n.value, n.value && (u.value = "bottom", d.value = "bottom"));
814
- }, R = async () => {
815
- var g, F;
816
- n.value || (n.value = !0, await ce()), (F = (g = i.value) == null ? void 0 : g.querySelector(".vf-select__option:not(.is-disabled)")) == null || F.focus();
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();
817
855
  }, W = (g) => {
818
- var T;
819
- if (!n.value || !c.value)
856
+ var S;
857
+ if (!n.value || !d.value)
820
858
  return;
821
- const F = g.target;
822
- c.value.contains(F) || (T = i.value) != null && T.contains(F) || L();
859
+ const y = g.target;
860
+ d.value.contains(y) || (S = c.value) != null && S.contains(y) || C();
823
861
  }, h = () => {
824
- if (!s.value || !i.value)
862
+ if (!i.value || !c.value)
825
863
  return;
826
- const g = s.value, F = i.value, T = async () => {
864
+ const g = i.value, y = c.value, S = async () => {
827
865
  const {
828
- x: ze,
829
- y: Se,
830
- placement: Te
831
- } = await zo(g, F, {
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: [io(2), no({ placements: ["bottom", "top"] })]
872
+ middleware: [De(2), Me({ placements: ["bottom", "top"] })]
835
873
  });
836
- d.value = Te ?? u.value, F.style.minWidth = `${g.getBoundingClientRect().width}px`, F.style.left = `${ze}px`, F.style.top = `${Se}px`;
837
- }, U = async () => {
838
- await T();
839
- }, ne = fo(g, () => {
840
- U();
841
- }), ae = () => {
842
- U();
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", ae, !0), window.addEventListener("resize", ae, !1), f = {
845
- update: U,
882
+ document.addEventListener("scroll", D, !0), window.addEventListener("resize", D, !1), v = {
883
+ update: H,
846
884
  destroy: () => {
847
- ne(), document.removeEventListener("scroll", ae, !0), window.removeEventListener("resize", ae, !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 re(n, 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 ce(), f || h(), f == null || f.update();
857
- }), re(
894
+ await _e(), v || h(), v == null || v.update();
895
+ }), ne(
858
896
  () => l.options,
859
897
  () => {
860
- f == null || f.update();
898
+ v == null || v.update();
861
899
  },
862
900
  { deep: !0 }
863
- ), Re(() => {
901
+ ), Oe(() => {
864
902
  document.addEventListener("click", W);
865
- }), we(() => {
866
- document.removeEventListener("click", W), f == null || f.destroy(), f = null;
867
- }), (g, F) => (b(), y("div", {
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: $(m.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
916
  "aria-expanded": n.value,
879
- "aria-controls": a,
917
+ "aria-controls": s,
880
918
  "aria-haspopup": "listbox",
881
- onClick: M,
919
+ onClick: F,
882
920
  onKeydown: [
883
- Z(J(R, ["prevent"]), ["down"]),
884
- Z(J(M, ["prevent"]), ["enter"]),
885
- Z(J(L, ["prevent"]), ["esc"])
921
+ re(le(O, ["prevent"]), ["down"]),
922
+ re(le(F, ["prevent"]), ["enter"]),
923
+ re(le(C, ["prevent"]), ["esc"])
886
924
  ],
887
- onFocus: z,
888
- onBlur: S
925
+ onFocus: B,
926
+ onBlur: z
889
927
  }, [
890
- B("span", {
891
- class: $(["vf-select__label", { "vf-select__label_placeholder": !k.value }])
892
- }, E(k.value || g.placeholder), 3),
893
- F[0] || (F[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, So),
898
- (b(), O(_e, { to: "body" }, [
899
- ue(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), y(le, null, ke(v.value, (T) => (b(), y("button", {
908
- key: T.value,
909
- class: $(["vf-select__option", { "is-active": x(T), "is-disabled": T.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: T.disabled,
913
- "aria-selected": x(T),
914
- onClick: (U) => H(T)
915
- }, E(T.label), 11, Ro))), 128))
916
- ], 8, To), [
917
- [fe, n.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
- }), Vo = ["checked", "disabled"], Lo = {
960
+ }), Pt = ["checked", "disabled"], At = {
923
961
  key: 0,
924
962
  class: "vf-checkbox__label"
925
- }, kt = /* @__PURE__ */ K({
963
+ }, Lo = /* @__PURE__ */ U({
926
964
  __name: "checkbox",
927
965
  props: {
928
966
  modelValue: { type: Boolean, default: !1 },
@@ -930,36 +968,36 @@ const oo = (o, e) => o.strategy ? o.strategy : eo(e) ? "fixed" : "absolute", q =
930
968
  disabled: { type: Boolean, default: !1 }
931
969
  },
932
970
  emits: ["update:modelValue", "change"],
933
- setup(o, { emit: e }) {
934
- const r = e, t = o, l = _(() => {
935
- const s = ["vf-checkbox"];
936
- return t.disabled && s.push("vf-checkbox_disabled"), s;
937
- }), c = (s) => {
938
- const i = s.target;
939
- r("update:modelValue", i.checked), r("change", s);
971
+ setup(t, { emit: e }) {
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(), y("label", {
942
- class: $(l.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, Vo),
951
- i[0] || (i[0] = B("span", { class: "vf-checkbox__box" }, null, -1)),
952
- s.label || s.$slots.default ? (b(), y("span", Lo, [
953
- C(s.$slots, "default", {}, () => [
954
- oe(E(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
- ])) : w("", !0)
994
+ ])) : $("", !0)
957
995
  ], 2));
958
996
  }
959
- }), Wo = ["checked", "disabled"], Oo = {
997
+ }), Dt = ["checked", "disabled"], It = {
960
998
  key: 0,
961
999
  class: "vf-switch__label"
962
- }, Ct = /* @__PURE__ */ K({
1000
+ }, Vo = /* @__PURE__ */ U({
963
1001
  __name: "switch",
964
1002
  props: {
965
1003
  modelValue: { type: Boolean, default: !1 },
@@ -967,114 +1005,114 @@ const oo = (o, e) => o.strategy ? o.strategy : eo(e) ? "fixed" : "absolute", q =
967
1005
  disabled: { type: Boolean, default: !1 }
968
1006
  },
969
1007
  emits: ["update:modelValue", "change"],
970
- setup(o, { emit: e }) {
971
- const r = e, t = o, l = _(() => {
972
- const s = ["vf-switch"];
973
- return t.disabled && s.push("vf-switch_disabled"), s;
974
- }), c = (s) => {
975
- const i = s.target;
976
- r("update:modelValue", i.checked), r("change", s);
1008
+ setup(t, { emit: e }) {
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(), y("label", {
979
- class: $(l.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, Wo),
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(), y("span", Oo, [
992
- C(s.$slots, "default", {}, () => [
993
- oe(E(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
- ])) : w("", !0)
1033
+ ])) : $("", !0)
996
1034
  ], 2));
997
1035
  }
998
- }), Eo = { class: "vf-popover" }, Ho = ["aria-expanded", "onKeydown"], wt = /* @__PURE__ */ K({
1036
+ }), Xt = { class: "vf-popover" }, Yt = ["aria-expanded", "onKeydown"], Wo = /* @__PURE__ */ U({
999
1037
  __name: "popover",
1000
1038
  emits: ["click", "onClick"],
1001
- setup(o, { expose: e, emit: r }) {
1002
- const t = r, l = Ve({ visible: !1 });
1003
- let c = 0;
1004
- const s = `vf-popover-panel-${++c}`, i = () => l.visible = !0, n = () => l.visible = !1, u = () => l.visible = !l.visible, d = () => {
1005
- u(), t("click"), t("onClick");
1039
+ setup(t, { expose: e, emit: r }) {
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 = () => {
1043
+ u(), o("click"), o("onClick");
1006
1044
  };
1007
- return e({ show: i, hide: n, toggle: u }), (a, f) => (b(), y("div", Eo, [
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
1051
  "aria-expanded": l.visible,
1014
- "aria-controls": s,
1015
- onClick: d,
1052
+ "aria-controls": i,
1053
+ onClick: a,
1016
1054
  onKeydown: [
1017
- Z(J(d, ["prevent"]), ["enter"]),
1018
- Z(J(d, ["prevent"]), ["space"])
1055
+ re(le(a, ["prevent"]), ["enter"]),
1056
+ re(le(a, ["prevent"]), ["space"])
1019
1057
  ]
1020
1058
  }, [
1021
- C(a.$slots, "button")
1022
- ], 40, Ho),
1023
- ue(Ce(Xe, {
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
- C(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
- C(a.$slots, "header"),
1043
- a.$slots.header ? w("", !0) : C(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
- C(a.$slots, "body"),
1051
- a.$slots.body ? w("", !0) : C(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
- C(a.$slots, "footer"),
1059
- a.$slots.footer ? w("", !0) : C(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
- [fe, l.visible]
1102
+ [we, l.visible]
1065
1103
  ])
1066
1104
  ]));
1067
1105
  }
1068
- }), Mo = ["aria-labelledby", "aria-describedby"], Po = {
1106
+ }), jt = ["aria-labelledby", "aria-describedby"], Nt = {
1069
1107
  key: 0,
1070
1108
  class: "vf-modal__header"
1071
- }, Ao = {
1109
+ }, Kt = {
1072
1110
  key: 0,
1073
1111
  class: "vf-modal__title"
1074
- }, Do = {
1112
+ }, Gt = {
1075
1113
  key: 3,
1076
1114
  class: "vf-modal__footer"
1077
- }, _t = /* @__PURE__ */ K({
1115
+ }, Oo = /* @__PURE__ */ U({
1078
1116
  __name: "modal",
1079
1117
  props: {
1080
1118
  modelValue: { type: Boolean, default: !1 },
@@ -1086,173 +1124,270 @@ const oo = (o, e) => o.strategy ? o.strategy : eo(e) ? "fixed" : "absolute", q =
1086
1124
  size: { default: "md" }
1087
1125
  },
1088
1126
  emits: ["update:modelValue", "open", "close"],
1089
- setup(o, { expose: e, emit: r }) {
1090
- const t = r, l = o;
1091
- let c = 0, s = 0, i = "", n = null;
1092
- const u = j(null), d = We(), a = `vf-modal-title-${++c}`, f = `vf-modal-body-${c}`, v = _(() => !!l.title || !!d.header), p = _(() => !!d.body || !!d.default), k = _(() => {
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(() => {
1093
1131
  const h = ["vf-modal"];
1094
1132
  return l.size !== "md" && h.push(`vf-modal_${l.size}`), h;
1095
- }), m = () => t("update:modelValue", !0), x = () => {
1096
- t("update:modelValue", !1), t("close");
1097
- }, H = () => {
1133
+ }), b = () => o("update:modelValue", !0), x = () => {
1134
+ o("update:modelValue", !1), o("close");
1135
+ }, L = () => {
1098
1136
  l.closeOnOverlay && x();
1099
- }, z = (h) => {
1137
+ }, B = (h) => {
1100
1138
  !l.modelValue || !l.closeOnEsc || h.key === "Escape" && (h.preventDefault(), x());
1101
- }, S = () => 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")) : [], L = () => {
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 = () => {
1102
1140
  var g;
1103
- const h = S();
1141
+ const h = z();
1104
1142
  h.length ? h[0].focus() : (g = u.value) == null || g.focus();
1105
- }, M = (h) => {
1106
- var ne;
1143
+ }, F = (h) => {
1144
+ var E;
1107
1145
  if (h.key !== "Tab")
1108
1146
  return;
1109
- const g = S();
1147
+ const g = z();
1110
1148
  if (!g.length) {
1111
- h.preventDefault(), (ne = u.value) == null || ne.focus();
1149
+ h.preventDefault(), (E = u.value) == null || E.focus();
1112
1150
  return;
1113
1151
  }
1114
- const F = g[0], T = g[g.length - 1], U = document.activeElement;
1115
- if (h.shiftKey && U === F) {
1116
- h.preventDefault(), T.focus();
1152
+ const y = g[0], S = g[g.length - 1], H = document.activeElement;
1153
+ if (h.shiftKey && H === y) {
1154
+ h.preventDefault(), S.focus();
1117
1155
  return;
1118
1156
  }
1119
- !h.shiftKey && U === T && (h.preventDefault(), F.focus());
1120
- }, R = () => {
1121
- !l.lockScroll || typeof document > "u" || (s === 0 && (i = document.body.style.overflow, document.body.style.overflow = "hidden"), s += 1);
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);
1122
1160
  }, W = () => {
1123
- !l.lockScroll || typeof document > "u" || (s = Math.max(0, s - 1), s === 0 && (document.body.style.overflow = i));
1161
+ !l.lockScroll || typeof document > "u" || (i = Math.max(0, i - 1), i === 0 && (document.body.style.overflow = c));
1124
1162
  };
1125
- return re(
1163
+ return ne(
1126
1164
  () => l.modelValue,
1127
1165
  async (h) => {
1128
- h ? (typeof document < "u" && (n = document.activeElement), R(), t("open"), await ce(), L(), typeof document < "u" && document.addEventListener("keydown", z)) : (W(), typeof document < "u" && (document.removeEventListener("keydown", z), n == null || n.focus()));
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()));
1129
1167
  },
1130
1168
  { immediate: !0 }
1131
- ), we(() => {
1132
- W(), typeof document < "u" && document.removeEventListener("keydown", z);
1133
- }), e({ open: m, close: x }), (h, g) => (b(), O(_e, { to: "body" }, [
1134
- ue(B("div", {
1135
- class: $(k.value),
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),
1136
1174
  role: "presentation"
1137
1175
  }, [
1138
- B("div", {
1176
+ R("div", {
1139
1177
  class: "vf-modal__overlay",
1140
- onClick: H
1178
+ onClick: L
1141
1179
  }),
1142
- B("div", {
1180
+ R("div", {
1143
1181
  ref_key: "panel",
1144
1182
  ref: u,
1145
1183
  class: "vf-modal__panel",
1146
1184
  role: "dialog",
1147
1185
  "aria-modal": "true",
1148
- "aria-labelledby": v.value ? a : void 0,
1149
- "aria-describedby": p.value ? f : void 0,
1186
+ "aria-labelledby": f.value ? s : void 0,
1187
+ "aria-describedby": p.value ? v : void 0,
1150
1188
  tabindex: "-1",
1151
- onKeydown: M
1189
+ onKeydown: F
1152
1190
  }, [
1153
- v.value ? (b(), y("div", Po, [
1154
- B("div", {
1155
- id: a,
1191
+ f.value ? (m(), k("div", Nt, [
1192
+ R("div", {
1193
+ id: s,
1156
1194
  class: "vf-modal__header-content"
1157
1195
  }, [
1158
- C(h.$slots, "header", {}, () => [
1159
- h.title ? (b(), y("h3", Ao, E(h.title), 1)) : w("", !0)
1196
+ _(h.$slots, "header", {}, () => [
1197
+ h.title ? (m(), k("h3", Kt, X(h.title), 1)) : $("", !0)
1160
1198
  ])
1161
1199
  ])
1162
- ])) : w("", !0),
1163
- h.showClose ? C(h.$slots, "close", {
1200
+ ])) : $("", !0),
1201
+ h.showClose ? _(h.$slots, "close", {
1164
1202
  key: 1,
1165
1203
  close: x
1166
1204
  }, () => [
1167
- B("button", {
1205
+ R("button", {
1168
1206
  type: "button",
1169
1207
  class: "vf-modal__close",
1170
1208
  "aria-label": "Close",
1171
1209
  onClick: x
1172
1210
  }, "×")
1173
- ]) : w("", !0),
1174
- h.$slots.body || h.$slots.default ? (b(), y("div", {
1211
+ ]) : $("", !0),
1212
+ h.$slots.body || h.$slots.default ? (m(), k("div", {
1175
1213
  key: 2,
1176
- id: f,
1214
+ id: v,
1177
1215
  class: "vf-modal__body"
1178
1216
  }, [
1179
- C(h.$slots, "body"),
1180
- h.$slots.body ? w("", !0) : C(h.$slots, "default", { key: 0 })
1181
- ])) : w("", !0),
1182
- h.$slots.footer ? (b(), y("div", Do, [
1183
- C(h.$slots, "footer")
1184
- ])) : w("", !0)
1185
- ], 40, Mo)
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)
1186
1224
  ], 2), [
1187
- [fe, h.modelValue]
1225
+ [we, h.modelValue]
1188
1226
  ])
1189
1227
  ]));
1190
1228
  }
1191
- }), Io = ["dark", "light", "theme", "preset", "colors", "components", "colorScheme"], jo = (o) => {
1192
- const e = o.replace(/([A-Z])/g, "-$1");
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) => {
1327
+ const e = t.replace(/([A-Z])/g, "-$1");
1193
1328
  return e.charAt(0).toUpperCase() + e.slice(1);
1194
- }, No = (o) => o.filter((e) => !Io.includes(e)).map((e) => jo(e)).join("-").toLowerCase(), de = (o) => o.join("."), Ko = (o) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(o), ve = (o) => {
1195
- if (!Ko(o))
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))
1196
1331
  return null;
1197
- if (o.length === 4) {
1198
- const e = o[1], r = o[2], t = o[3];
1199
- return `#${e}${e}${r}${r}${t}${t}`;
1332
+ if (t.length === 4) {
1333
+ const e = t[1], r = t[2], o = t[3];
1334
+ return `#${e}${e}${r}${r}${o}${o}`;
1200
1335
  }
1201
- return o.toLowerCase();
1202
- }, Be = (o) => {
1203
- const e = ve(o);
1336
+ return t.toLowerCase();
1337
+ }, Ye = (t) => {
1338
+ const e = Fe(t);
1204
1339
  if (!e)
1205
1340
  return [0, 0, 0];
1206
- const r = parseInt(e.slice(1), 16), t = r >> 16 & 255, l = r >> 8 & 255, c = r & 255;
1207
- return [t, l, c];
1208
- }, he = (o) => {
1209
- const [e, r, t] = Be(o);
1210
- return `${e}, ${r}, ${t}`;
1211
- }, Xo = (o, e, r) => {
1212
- const t = o / 255, l = e / 255, c = r / 255, s = Math.max(t, l, c), i = Math.min(t, l, c), n = s - i;
1213
- let u = 0, d = 0;
1214
- const a = (s + i) / 2;
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);
1345
+ return `${e}, ${r}, ${o}`;
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;
1215
1350
  if (n !== 0) {
1216
- switch (d = n / (1 - Math.abs(2 * a - 1)), s) {
1217
- case t:
1218
- u = (l - c) / n % 6;
1351
+ switch (a = n / (1 - Math.abs(2 * s - 1)), i) {
1352
+ case o:
1353
+ u = (l - d) / n % 6;
1219
1354
  break;
1220
1355
  case l:
1221
- u = (c - t) / n + 2;
1356
+ u = (d - o) / n + 2;
1222
1357
  break;
1223
- case c:
1224
- u = (t - l) / n + 4;
1358
+ case d:
1359
+ u = (o - l) / n + 4;
1225
1360
  break;
1226
1361
  }
1227
1362
  u *= 60, u < 0 && (u += 360);
1228
1363
  }
1229
- return [u, d * 100, a * 100];
1230
- }, Yo = (o, e, r) => {
1231
- const t = e / 100, l = r / 100, c = (1 - Math.abs(2 * l - 1)) * t, s = c * (1 - Math.abs(o / 60 % 2 - 1)), i = l - c / 2;
1232
- let n = 0, u = 0, d = 0;
1233
- o >= 0 && o < 60 ? (n = c, u = s, d = 0) : o >= 60 && o < 120 ? (n = s, u = c, d = 0) : o >= 120 && o < 180 ? (n = 0, u = c, d = s) : o >= 180 && o < 240 ? (n = 0, u = s, d = c) : o >= 240 && o < 300 ? (n = s, u = 0, d = c) : (n = c, u = 0, d = s);
1234
- const a = Math.round((n + i) * 255), f = Math.round((u + i) * 255), v = Math.round((d + i) * 255);
1235
- return [a, f, v];
1236
- }, Go = (o, e, r) => `#${[o, e, r].map((t) => t.toString(16).padStart(2, "0")).join("")}`, qo = (o, e, r) => Math.min(r, Math.max(e, o)), Uo = (o, e) => {
1237
- const r = ve(o);
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);
1238
1373
  if (!r)
1239
- return o;
1240
- const [t, l, c] = Be(r), [s, i, n] = Xo(t, l, c), d = (e - 5) * 7, a = qo(n + d, 0, 100), [f, v, p] = Yo(s, i, a);
1241
- return Go(f, v, p);
1242
- }, ie = (o) => !!o && typeof o == "object" && !Array.isArray(o), pe = (o, e) => {
1374
+ return t;
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) => {
1243
1378
  if (!e)
1244
- return { ...o };
1245
- const r = { ...o };
1246
- for (const t in e) {
1247
- const l = e[t], c = o[t];
1248
- ie(c) && ie(l) ? r[t] = pe(c, l) : r[t] = l;
1379
+ return { ...t };
1380
+ const r = { ...t };
1381
+ for (const o in e) {
1382
+ const l = e[o], d = t[o];
1383
+ ye(d) && ye(l) ? r[o] = Be(d, l) : r[o] = l;
1249
1384
  }
1250
1385
  return r;
1251
- }, Zo = (o) => {
1252
- if (!o)
1386
+ }, so = (t) => {
1387
+ if (!t)
1253
1388
  return null;
1254
- if (ie(o) && "preset" in o) {
1255
- const e = o;
1389
+ if (ye(t) && "preset" in t) {
1390
+ const e = t;
1256
1391
  return {
1257
1392
  preset: e.preset ?? {},
1258
1393
  overrides: e.overrides,
@@ -1261,92 +1396,92 @@ const oo = (o, e) => o.strategy ? o.strategy : eo(e) ? "fixed" : "absolute", q =
1261
1396
  strict: e.strict
1262
1397
  };
1263
1398
  }
1264
- return { preset: o };
1265
- }, Jo = (o) => {
1266
- const e = [], r = [], t = [], l = [], c = (n) => t.push(n), s = (n) => l.push(n), i = (n, u) => {
1399
+ return { preset: t };
1400
+ }, io = (t) => {
1401
+ const e = [], r = [], o = [], l = [], d = (n) => o.push(n), i = (n) => l.push(n), c = (n, u) => {
1267
1402
  if (!(!n || typeof n != "object"))
1268
- for (const d in n) {
1269
- const a = n[d], f = u.concat([d]);
1270
- if (ie(a)) {
1271
- i(a, f);
1403
+ for (const a in n) {
1404
+ const s = n[a], v = u.concat([a]);
1405
+ if (ye(s)) {
1406
+ c(s, v);
1272
1407
  continue;
1273
1408
  }
1274
- if (a && typeof a == "object") {
1275
- s(`Theme value "${de(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.`);
1276
1411
  continue;
1277
1412
  }
1278
- if (typeof a != "string") {
1279
- s(`Theme value "${de(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.`);
1280
1415
  continue;
1281
1416
  }
1282
- const p = f.includes("colorScheme") && f.includes("dark") ? r : e, k = No(f);
1283
- if (p.push(`--vf-${k}: ${a}`), f.includes("colors")) {
1284
- const m = ve(a);
1285
- if (!m) {
1286
- c(
1287
- `Theme color "${de(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.`
1288
1423
  );
1289
1424
  continue;
1290
1425
  }
1291
- if (p.push(`--vf-${k}-rgb: ${he(m)}`), d !== "white")
1426
+ if (p.push(`--vf-${w}-rgb: ${Te(b)}`), a !== "white")
1292
1427
  for (let x = 1; x < 10; ++x) {
1293
- const H = Uo(m, x);
1294
- p.push(`--vf-${k}-${x}00: ${H}`), p.push(`--vf-${k}-${x}00-rgb: ${he(H)}`);
1428
+ const L = ao(b, x);
1429
+ p.push(`--vf-${w}-${x}00: ${L}`), p.push(`--vf-${w}-${x}00-rgb: ${Te(L)}`);
1295
1430
  }
1296
1431
  }
1297
1432
  }
1298
1433
  };
1299
- return i(o, []), { baseVars: e, darkVars: r, warnings: t, errors: l };
1300
- }, Qo = (o) => {
1434
+ return c(t, []), { baseVars: e, darkVars: r, warnings: o, errors: l };
1435
+ }, co = (t) => {
1301
1436
  if (typeof document > "u")
1302
1437
  return null;
1303
- const e = document.getElementById(o);
1438
+ const e = document.getElementById(t);
1304
1439
  if (e && e.tagName.toLowerCase() === "style")
1305
1440
  return e;
1306
1441
  const r = document.createElement("style");
1307
- return r.id = o, document.head.appendChild(r), r;
1308
- }, et = (o) => ({
1309
- selector: o.selector ?? ":root",
1310
- darkSelector: o.darkSelector ?? ":root[data-theme=dark]"
1311
- }), ot = (o, e, r, t) => {
1312
- const { baseVars: l, darkVars: c, warnings: s, errors: i } = Jo(o), n = Qo("vueforge-theme");
1442
+ return r.id = t, document.head.appendChild(r), r;
1443
+ }, uo = (t) => ({
1444
+ selector: t.selector ?? ":root",
1445
+ darkSelector: t.darkSelector ?? ":root[data-theme=dark]"
1446
+ }), fo = (t, e, r, o) => {
1447
+ const { baseVars: l, darkVars: d, warnings: i, errors: c } = io(t), n = co("vueforge-theme");
1313
1448
  if (!n)
1314
1449
  return;
1315
- if (i.length) {
1316
- if (t)
1317
- throw new Error(`[VueForge] ${i.join(" ")}`);
1318
- for (const d of i)
1319
- console.warn(`[VueForge] ${d}`);
1450
+ if (c.length) {
1451
+ if (o)
1452
+ throw new Error(`[VueForge] ${c.join(" ")}`);
1453
+ for (const a of c)
1454
+ console.warn(`[VueForge] ${a}`);
1320
1455
  }
1321
- if (s.length)
1322
- for (const d of s)
1323
- console.warn(`[VueForge] ${d}`);
1456
+ if (i.length)
1457
+ for (const a of i)
1458
+ console.warn(`[VueForge] ${a}`);
1324
1459
  const u = [];
1325
- l.length && u.push(`${e} { ${l.join(";")} }`), c.length && u.push(`${r} { ${c.join(";")} }`), n.textContent = u.join(`
1460
+ l.length && u.push(`${e} { ${l.join(";")} }`), d.length && u.push(`${r} { ${d.join(";")} }`), n.textContent = u.join(`
1326
1461
  `);
1327
1462
  };
1328
- let N = null;
1329
- const xe = (o) => {
1330
- const e = Zo(o);
1463
+ let J = null;
1464
+ const je = (t) => {
1465
+ const e = so(t);
1331
1466
  if (!e)
1332
1467
  return;
1333
- const r = pe(e.preset, e.overrides), { selector: t, darkSelector: l } = et(e);
1334
- N = { ...e }, ot(r, t, l, e.strict);
1335
- }, $t = (o) => {
1336
- if (!N)
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)
1337
1472
  return;
1338
- const e = o.overrides === void 0 ? N.overrides : pe(N.overrides ?? {}, o.overrides ?? {}), r = {
1339
- preset: o.preset ?? N.preset,
1473
+ const e = t.overrides === void 0 ? J.overrides : Be(J.overrides ?? {}, t.overrides ?? {}), r = {
1474
+ preset: t.preset ?? J.preset,
1340
1475
  overrides: e,
1341
- selector: o.selector ?? N.selector,
1342
- darkSelector: o.darkSelector ?? N.darkSelector
1476
+ selector: t.selector ?? J.selector,
1477
+ darkSelector: t.darkSelector ?? J.darkSelector
1343
1478
  };
1344
- xe(r);
1345
- }, Ft = () => N ? { ...N } : null, Bt = {
1346
- install(o, e = {}) {
1347
- e.theme && xe(e.theme);
1479
+ je(r);
1480
+ }, Mo = () => J ? { ...J } : null, Po = {
1481
+ install(t, e = {}) {
1482
+ e.theme && je(e.theme);
1348
1483
  }
1349
- }, me = {
1484
+ }, Re = {
1350
1485
  colors: {
1351
1486
  white: "#ffffff",
1352
1487
  green: "#0cbc87",
@@ -1408,7 +1543,7 @@ const xe = (o) => {
1408
1543
  dividerColor: "#2e2e32"
1409
1544
  }
1410
1545
  }
1411
- }, tt = {
1546
+ }, vo = {
1412
1547
  fontSize: "var(--vf-typography-font-size)",
1413
1548
  padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
1414
1549
  borderRadius: "var(--vf-radii-md)",
@@ -1550,11 +1685,11 @@ const xe = (o) => {
1550
1685
  }
1551
1686
  }
1552
1687
  }
1553
- }, rt = {
1688
+ }, po = {
1554
1689
  padding: "12px",
1555
1690
  borderColor: "var(--vf-border-color)",
1556
1691
  borderRadius: "var(--vf-radii-md)"
1557
- }, lt = {}, nt = {
1692
+ }, go = {}, ho = {
1558
1693
  gap: "0.5rem",
1559
1694
  fontSize: "var(--vf-typography-font-size)",
1560
1695
  padding: "var(--vf-controls-padding-y) var(--vf-controls-padding-x)",
@@ -1575,10 +1710,10 @@ const xe = (o) => {
1575
1710
  padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
1576
1711
  fontSize: "var(--vf-sizes-lg-font-size)"
1577
1712
  }
1578
- }, at = {
1713
+ }, mo = {
1579
1714
  hoverColor: "var(--vf-blue)",
1580
1715
  activeColor: "var(--vf-blue)"
1581
- }, st = {
1716
+ }, bo = {
1582
1717
  iconGap: "6px",
1583
1718
  submenuOffset: "12px",
1584
1719
  separatorThickness: "1px",
@@ -1598,7 +1733,7 @@ const xe = (o) => {
1598
1733
  marginBottom: "0.5rem",
1599
1734
  marginLeft: "0.5rem"
1600
1735
  }
1601
- }, it = {
1736
+ }, yo = {
1602
1737
  width: "90vw",
1603
1738
  maxWidth: "520px",
1604
1739
  maxHeight: "80vh",
@@ -1625,9 +1760,9 @@ const xe = (o) => {
1625
1760
  closeColor: "var(--vf-text-color)",
1626
1761
  closeFontSize: "1.25rem",
1627
1762
  closeHoverBackgroundColor: "rgba(0, 0, 0, 0.06)"
1628
- }, dt = {
1763
+ }, ko = {
1629
1764
  backgroundColor: "var(--vf-bg-color)"
1630
- }, ct = {
1765
+ }, wo = {
1631
1766
  minWidth: "12rem",
1632
1767
  fontSize: "var(--vf-typography-font-size)",
1633
1768
  controlGap: "0.75rem",
@@ -1660,7 +1795,7 @@ const xe = (o) => {
1660
1795
  padding: "var(--vf-sizes-lg-padding-y) var(--vf-sizes-lg-padding-x)",
1661
1796
  fontSize: "var(--vf-sizes-lg-font-size)"
1662
1797
  }
1663
- }, ut = {
1798
+ }, Co = {
1664
1799
  size: "1rem",
1665
1800
  gap: "0.5rem",
1666
1801
  borderRadius: "var(--vf-radii-sm)",
@@ -1672,7 +1807,7 @@ const xe = (o) => {
1672
1807
  checkColor: "#ffffff",
1673
1808
  textColor: "var(--vf-text-color)",
1674
1809
  disabledOpacity: "var(--vf-states-disabled-opacity)"
1675
- }, ft = {
1810
+ }, _o = {
1676
1811
  width: "2.25rem",
1677
1812
  height: "1.25rem",
1678
1813
  thumbSize: "1rem",
@@ -1684,37 +1819,50 @@ const xe = (o) => {
1684
1819
  thumbColor: "#ffffff",
1685
1820
  textColor: "var(--vf-text-color)",
1686
1821
  disabledOpacity: "var(--vf-states-disabled-opacity)"
1687
- }, xt = {
1688
- ...me,
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,
1689
1835
  components: {
1690
- base: me,
1691
- button: tt,
1692
- card: rt,
1693
- codeBlock: lt,
1694
- input: nt,
1695
- link: at,
1696
- menu: st,
1697
- modal: it,
1698
- popover: dt,
1699
- select: ct,
1700
- checkbox: ut,
1701
- switch: ft
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
1702
1849
  }
1703
1850
  };
1704
1851
  export {
1705
- ht as Button,
1706
- Xe as Card,
1707
- kt as Checkbox,
1708
- xt as DefaultTheme,
1709
- mt as Input,
1710
- $e as Link,
1711
- bt as Menu,
1712
- _t as Modal,
1713
- wt as Popover,
1714
- yt as Select,
1715
- Ct as Switch,
1716
- Bt as VueForge,
1717
- Ft as getTheme,
1718
- xe as setTheme,
1719
- $t 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
1720
1868
  };