adverich-kun-ui 0.1.280 → 0.1.281

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.
@@ -1,52 +1,36 @@
1
- import { ref as f, computed as E } from "vue";
2
- function F(n, H, g, b) {
3
- const h = f({}), s = f(null), d = f(null), M = {
1
+ import { ref as a, computed as x } from "vue";
2
+ function q(n, p, u, w) {
3
+ const f = a({}), c = a(null), g = a(null), H = {
4
4
  top: { class: "origin-bottom" },
5
5
  bottom: { class: "origin-top" },
6
6
  left: { class: "origin-right" },
7
7
  right: { class: "origin-left" }
8
- }, w = E(() => {
8
+ }, M = x(() => {
9
9
  var t;
10
- return ((t = M[n.location]) == null ? void 0 : t.class) || "origin-top";
10
+ return ((t = H[n.location]) == null ? void 0 : t.class) || "origin-top";
11
11
  });
12
- function a(t = 0) {
13
- const o = n.parentRef || d.value, i = s.value;
12
+ function s(t = 0) {
13
+ const o = n.parentRef || g.value, i = c.value;
14
14
  if (!(o instanceof HTMLElement) || !(i instanceof HTMLElement)) return;
15
15
  const e = o.getBoundingClientRect();
16
16
  if ((e.width < 1 || e.height < 1) && t < 10) {
17
- requestAnimationFrame(() => a(t + 1));
17
+ requestAnimationFrame(() => s(t + 1));
18
18
  return;
19
19
  }
20
20
  requestAnimationFrame(() => {
21
- const u = i.getBoundingClientRect();
22
- if ((u.width < 1 || u.height < 1) && t < 10) {
23
- requestAnimationFrame(() => a(t + 1));
21
+ const h = i.getBoundingClientRect();
22
+ if ((h.width < 1 || h.height < 1) && t < 10) {
23
+ requestAnimationFrame(() => s(t + 1));
24
24
  return;
25
25
  }
26
- const m = n.origin || L(n.location), [p, v] = m.split(" ");
27
- console.log(n.hideDetails);
28
- const A = n.hideDetails ? 0 : 19, x = i.offsetWidth, r = i.offsetHeight;
29
- let l = 0, c = 0;
30
- v === "right" ? c = e.right - x : v === "center" ? c = e.left + e.width / 2 - x / 2 : c = e.left, p === "top" ? l = e.top - r : p === "center" ? l = e.top + e.height / 2 - r / 2 : l = e.bottom - A, h.value = {
26
+ const A = n.origin || L(n.location), [d, m] = A.split(" "), F = n.hideDetails ? 0 : 19, v = i.offsetWidth, E = i.offsetHeight;
27
+ let l = 0, r = 0;
28
+ m === "right" ? r = e.right - v : m === "center" ? r = e.left + e.width / 2 - v / 2 : r = e.left, d === "top" ? l = e.top - E : d === "center" ? l = e.top + e.height / 2 - E / 2 : l = e.bottom - F, f.value = {
31
29
  position: "fixed",
32
30
  top: `${l}px`,
33
- left: `${c}px`,
31
+ left: `${r}px`,
34
32
  width: n.width === "w-full" ? `${e.width}px` : void 0
35
- }, console.log("[KunMenu] Debug:", {
36
- origin: m,
37
- parent: {
38
- top: e.top,
39
- bottom: e.bottom,
40
- height: e.height
41
- },
42
- menu: {
43
- height: r,
44
- offsetHeight: i.offsetHeight,
45
- rectHeight: u.height
46
- },
47
- calculatedTop: l,
48
- expectedTop: e.top - r
49
- });
33
+ };
50
34
  });
51
35
  }
52
36
  function L(t) {
@@ -63,26 +47,26 @@ function F(n, H, g, b) {
63
47
  return "bottom left";
64
48
  }
65
49
  }
66
- function R() {
50
+ function b() {
67
51
  var o, i;
68
- const t = ((o = n.parentRef) == null ? void 0 : o.$el) || ((i = s.value) == null ? void 0 : i.parentElement);
52
+ const t = ((o = n.parentRef) == null ? void 0 : o.$el) || ((i = c.value) == null ? void 0 : i.parentElement);
69
53
  if (!(t instanceof HTMLElement)) {
70
54
  console.warn("[KunMenu] Activator no válido:", t);
71
55
  return;
72
56
  }
73
- t.addEventListener("click", H), t.addEventListener("mouseenter", () => g("enter")), t.addEventListener("mouseleave", () => g("leave")), t.addEventListener("focus", b);
57
+ t.addEventListener("click", p), t.addEventListener("mouseenter", () => u("enter")), t.addEventListener("mouseleave", () => u("leave")), t.addEventListener("focus", w);
74
58
  }
75
- const T = E(() => typeof n.maxHeight == "number" ? n.maxHeight + "px" : n.maxHeight);
59
+ const R = x(() => typeof n.maxHeight == "number" ? n.maxHeight + "px" : n.maxHeight);
76
60
  return {
77
- initializeMenu: R,
78
- repositionMenu: a,
79
- contentEl: s,
80
- activatorEl: d,
81
- originClass: w,
82
- computedMaxHeight: T,
83
- menuPositionStyle: h
61
+ initializeMenu: b,
62
+ repositionMenu: s,
63
+ contentEl: c,
64
+ activatorEl: g,
65
+ originClass: M,
66
+ computedMaxHeight: R,
67
+ menuPositionStyle: f
84
68
  };
85
69
  }
86
70
  export {
87
- F as useKunMenuStyles
71
+ q as useKunMenuStyles
88
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.280",
3
+ "version": "0.1.281",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",