adverich-kun-ui 0.1.275 → 0.1.278

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