adverich-kun-ui 0.1.278 → 0.1.279

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,4 +1,4 @@
1
- import { onMounted as W, nextTick as x, onUnmounted as P, watch as R, onBeforeUnmount as U, computed as w, createElementBlock as E, openBlock as c, Fragment as I, createBlock as O, createCommentVNode as g, Teleport as Y, createVNode as j, Transition as q, unref as n, withCtx as G, withDirectives as J, createElementVNode as Q, withKeys as X, normalizeStyle as Z, normalizeClass as _, withModifiers as ee, renderSlot as k, vShow as te } from "vue";
1
+ import { onMounted as R, nextTick as W, onUnmounted as x, watch as P, onBeforeUnmount as U, computed as E, createElementBlock as g, openBlock as c, Fragment as I, createBlock as O, createCommentVNode as k, Teleport as Y, createVNode as j, Transition as q, unref as n, withCtx as G, withDirectives as J, createElementVNode as Q, withKeys as X, normalizeStyle as Z, normalizeClass as _, withModifiers as ee, renderSlot as C, vShow as te } from "vue";
2
2
  import { useKunMenu as ne } from "../composables/useKunMenu.js";
3
3
  import { kunMenuProps as oe } from "../composables/kunMenuProps.js";
4
4
  import { useKunMenuStyles as se } from "../composables/useKunMenuStyles.js";
@@ -7,46 +7,48 @@ const de = {
7
7
  __name: "kunMenu",
8
8
  props: oe,
9
9
  emits: ["update:modelValue", "click:outside", "handleEscape"],
10
- setup(L, { emit: C }) {
11
- var y;
12
- const o = L, u = C, {
10
+ setup(L, { emit: M }) {
11
+ var w;
12
+ const o = L, u = M, {
13
13
  menuVisible: d,
14
14
  handleActivatorClick: m,
15
15
  handleHover: a,
16
16
  handleFocus: v,
17
17
  handleEscape: p,
18
- hideMenu: M
18
+ hideMenu: b
19
19
  } = ne(o, u), {
20
- initializeMenu: b,
21
- repositionMenu: i,
22
- contentEl: s,
23
- activatorEl: T,
20
+ initializeMenu: T,
21
+ repositionMenu: l,
22
+ contentEl: r,
23
+ activatorEl: f,
24
24
  originClass: H,
25
25
  computedMaxHeight: S,
26
26
  menuPositionStyle: z
27
27
  } = se(o, m, a, v), { onClickOutside: B } = re(), { addEventListeners: K, removeEventListeners: V } = B(
28
- s,
28
+ r,
29
29
  () => {
30
- M(), u("click:outside");
30
+ var s;
31
+ const e = o.parentRef || f.value, t = window.__lastClickEvent;
32
+ (s = e == null ? void 0 : e.contains) != null && s.call(e, t == null ? void 0 : t.target) || (b(), u("click:outside"));
31
33
  },
32
- [(y = o.parentRef) == null ? void 0 : y.$el]
34
+ [(w = o.parentRef) == null ? void 0 : w.$el]
33
35
  );
34
- W(() => {
35
- x(() => {
36
- b(), window.addEventListener("resize", i);
36
+ R(() => {
37
+ W(() => {
38
+ T(), window.addEventListener("resize", l);
37
39
  });
38
- }), P(() => {
39
- const e = s.value;
40
- e && e.removeEventListener("wheel", l), window.removeEventListener("resize", i);
41
- }), R(d, (e) => {
42
- const t = s.value;
43
- t && (e ? (i(), t.addEventListener("wheel", l, { passive: !1 }), K()) : (t.removeEventListener("wheel", l), V()));
40
+ }), x(() => {
41
+ const e = r.value;
42
+ e && e.removeEventListener("wheel", i), window.removeEventListener("resize", l);
43
+ }), P(d, (e) => {
44
+ const t = r.value;
45
+ t && (e ? (l(), t.addEventListener("wheel", i, { passive: !1 }), K()) : (t.removeEventListener("wheel", i), V()));
44
46
  });
45
- function l(e) {
46
- const t = s.value;
47
+ function i(e) {
48
+ const t = r.value;
47
49
  if (!t) return;
48
- const r = e.deltaY > 0, D = t.scrollTop + t.clientHeight >= t.scrollHeight, N = t.scrollTop <= 0;
49
- (r && D || !r && N) && e.preventDefault();
50
+ const s = e.deltaY > 0, D = t.scrollTop + t.clientHeight >= t.scrollHeight, N = t.scrollTop <= 0;
51
+ (s && D || !s && N) && e.preventDefault();
50
52
  }
51
53
  function $() {
52
54
  var t;
@@ -56,7 +58,7 @@ const de = {
56
58
  U(() => {
57
59
  $();
58
60
  });
59
- const f = w(() => {
61
+ const h = E(() => {
60
62
  switch (o.transition) {
61
63
  case "fade":
62
64
  return "opacity-0";
@@ -73,8 +75,8 @@ const de = {
73
75
  default:
74
76
  return "";
75
77
  }
76
- }), h = w(() => "opacity-100 scale-100 translate-x-0 translate-y-0"), F = h, A = f;
77
- return (e, t) => (c(), E(I, null, [
78
+ }), y = E(() => "opacity-100 scale-100 translate-x-0 translate-y-0"), F = y, A = h;
79
+ return (e, t) => (c(), g(I, null, [
78
80
  e.attach !== !0 ? (c(), O(Y, {
79
81
  key: 0,
80
82
  to: e.attach || "body"
@@ -82,36 +84,36 @@ const de = {
82
84
  j(q, {
83
85
  "enter-active-class": "transition ease-out duration-150",
84
86
  "leave-active-class": "transition ease-in duration-100",
85
- "enter-from-class": f.value,
86
- "enter-to-class": h.value,
87
+ "enter-from-class": h.value,
88
+ "enter-to-class": y.value,
87
89
  "leave-from-class": n(F),
88
90
  "leave-to-class": n(A)
89
91
  }, {
90
92
  default: G(() => [
91
93
  J(Q("div", {
92
94
  ref_key: "contentEl",
93
- ref: s,
95
+ ref: r,
94
96
  role: "menu",
95
97
  tabindex: "-1",
96
98
  class: _(["relative shadow-xl rounded-b overflow-y-auto focus:outline-none bg-gray-200 dark:bg-gray-800 border border-gray-300 dark:border-gray-700", [o.class, n(H), e.width, e.height, e.minWidth, e.maxWidth, e.minHeight, e.maxHeight, e.zIndex]]),
97
99
  style: Z({ ...n(z), maxHeight: n(S) }),
98
- onKeydown: t[0] || (t[0] = X(ee((...r) => n(p) && n(p)(...r), ["stop"]), ["escape"]))
100
+ onKeydown: t[0] || (t[0] = X(ee((...s) => n(p) && n(p)(...s), ["stop"]), ["escape"]))
99
101
  }, [
100
- k(e.$slots, "default")
102
+ C(e.$slots, "default")
101
103
  ], 38), [
102
104
  [te, n(d)]
103
105
  ])
104
106
  ]),
105
107
  _: 3
106
108
  }, 8, ["enter-from-class", "enter-to-class", "leave-from-class", "leave-to-class"])
107
- ], 8, ["to"])) : g("", !0),
108
- e.$slots.activator ? (c(), E("span", {
109
+ ], 8, ["to"])) : k("", !0),
110
+ e.$slots.activator ? (c(), g("span", {
109
111
  key: 1,
110
112
  ref_key: "activatorEl",
111
- ref: T
113
+ ref: f
112
114
  }, [
113
- k(e.$slots, "activator")
114
- ], 512)) : g("", !0)
115
+ C(e.$slots, "activator")
116
+ ], 512)) : k("", !0)
115
117
  ], 64));
116
118
  }
117
119
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.278",
3
+ "version": "0.1.279",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",