adverich-kun-ui 0.1.124 → 0.1.126

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,86 +1,87 @@
1
- import { onMounted as S, nextTick as T, onUnmounted as z, watch as B, onBeforeUnmount as V, createBlock as P, createCommentVNode as A, openBlock as D, Teleport as N, createVNode as W, Transition as I, withCtx as U, withDirectives as F, createElementVNode as O, mergeProps as Y, unref as n, withKeys as $, withModifiers as j, renderSlot as q, vShow as G } from "vue";
2
- import { useKunMenu as J } from "../composables/useKunMenu.js";
3
- import { kunMenuProps as Q } from "../composables/kunMenuProps.js";
4
- import { useKunMenuStyles as R } from "../composables/useKunMenuStyles.js";
1
+ import { onMounted as S, nextTick as T, onUnmounted as B, watch as V, onBeforeUnmount as z, createBlock as P, createCommentVNode as A, openBlock as D, Teleport as N, createVNode as W, Transition as $, withCtx as I, withDirectives as R, createElementVNode as U, mergeProps as F, unref as n, withKeys as O, withModifiers as Y, renderSlot as j, vShow as q } from "vue";
2
+ import { useKunMenu as G } from "../composables/useKunMenu.js";
3
+ import { kunMenuProps as J } from "../composables/kunMenuProps.js";
4
+ import { useKunMenuStyles as Q } from "../composables/useKunMenuStyles.js";
5
5
  import { useKunMenuComposable as X } from "../composables/useKunMenuComposable.js";
6
6
  /* empty css */
7
7
  import Z from "../../../../_virtual/_plugin-vue_export-helper.js";
8
8
  const x = {
9
9
  __name: "kunMenu",
10
- props: Q,
10
+ props: J,
11
11
  emits: ["update:modelValue", "click:outside", "handleEscape"],
12
12
  setup(f, { emit: h }) {
13
- const l = f, u = h, {
13
+ var v;
14
+ const r = f, u = h, {
14
15
  menuVisible: d,
15
16
  handleActivatorClick: m,
16
- handleHover: i,
17
+ handleHover: s,
17
18
  handleFocus: c,
18
- handleEscape: v,
19
+ handleEscape: p,
19
20
  hideMenu: w
20
- } = J(l, u), {
21
- initializeMenu: E,
22
- repositionMenu: s,
21
+ } = G(r, u), {
22
+ initializeMenu: g,
23
+ repositionMenu: a,
23
24
  contentEl: o,
24
- activatorEl: p,
25
- originClass: g,
25
+ originClass: E,
26
26
  computedMaxHeight: k,
27
27
  menuPositionStyle: y
28
- } = R(l, m, i, c), { onClickOutside: L } = X(), { addEventListeners: M, removeEventListeners: b } = L(
28
+ } = Q(r, m, s, c), { onClickOutside: L } = X(), { addEventListeners: M, removeEventListeners: b } = L(
29
29
  o,
30
30
  () => {
31
31
  w(), u("click:outside");
32
32
  },
33
- [p]
33
+ [(v = r.parentRef) == null ? void 0 : v.$el]
34
34
  );
35
35
  S(() => {
36
36
  T(() => {
37
- E(), window.addEventListener("resize", s);
37
+ g(), window.addEventListener("resize", a);
38
38
  });
39
- }), z(() => {
39
+ }), B(() => {
40
40
  const e = o.value;
41
- e && e.removeEventListener("wheel", a), window.removeEventListener("resize", s);
42
- }), B(d, (e) => {
41
+ e && e.removeEventListener("wheel", l), window.removeEventListener("resize", a);
42
+ }), V(d, (e) => {
43
43
  const t = o.value;
44
- t && (e ? (s(), t.addEventListener("wheel", a, { passive: !1 }), M()) : (t.removeEventListener("wheel", a), b()));
44
+ t && (e ? (a(), t.addEventListener("wheel", l, { passive: !1 }), M()) : (t.removeEventListener("wheel", l), b()));
45
45
  });
46
- function a(e) {
46
+ function l(e) {
47
47
  const t = o.value;
48
48
  if (!t) return;
49
- const r = e.deltaY > 0, H = t.scrollTop + t.clientHeight >= t.scrollHeight, K = t.scrollTop <= 0;
50
- (r && H || !r && K) && e.preventDefault();
49
+ const i = e.deltaY > 0, H = t.scrollTop + t.clientHeight >= t.scrollHeight, K = t.scrollTop <= 0;
50
+ (i && H || !i && K) && e.preventDefault();
51
51
  }
52
52
  function C() {
53
- const e = p.value;
54
- e && (e.removeEventListener("click", m), e.removeEventListener("mouseenter", () => i("enter")), e.removeEventListener("mouseleave", () => i("leave")), e.removeEventListener("focus", c));
53
+ var t;
54
+ const e = (t = r.parentRef) == null ? void 0 : t.$el;
55
+ e && (e.removeEventListener("click", m), e.removeEventListener("mouseenter", () => s("enter")), e.removeEventListener("mouseleave", () => s("leave")), e.removeEventListener("focus", c));
55
56
  }
56
- return V(() => {
57
+ return z(() => {
57
58
  C();
58
59
  }), (e, t) => e.attach !== !0 ? (D(), P(N, {
59
60
  key: 0,
60
61
  to: e.attach || "body"
61
62
  }, [
62
- W(I, { name: e.transition }, {
63
- default: U(() => [
64
- F(O("div", Y({
63
+ W($, { name: e.transition }, {
64
+ default: I(() => [
65
+ R(U("div", F({
65
66
  ref_key: "contentEl",
66
67
  ref: o,
67
68
  role: "menu",
68
69
  tabindex: "-1",
69
- class: ["relative shadow-xl overflow-y-auto focus:outline-none z-50 bg-gray-200 dark:bg-gray-800 border border-gray-300 dark:border-gray-700", [e.contentClass, n(g), e.width, e.height, e.minWidth, e.maxWidth, e.minHeight, e.maxHeight, e.zIndex]],
70
+ 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", [e.contentClass, n(E), e.width, e.height, e.minWidth, e.maxWidth, e.minHeight, e.maxHeight, e.zIndex]],
70
71
  style: { ...n(y), maxHeight: n(k) }
71
72
  }, e.contentProps, {
72
- onKeydown: t[0] || (t[0] = $(j((...r) => n(v) && n(v)(...r), ["stop"]), ["escape"]))
73
+ onKeydown: t[0] || (t[0] = O(Y((...i) => n(p) && n(p)(...i), ["stop"]), ["escape"]))
73
74
  }), [
74
- q(e.$slots, "default", {}, void 0, !0)
75
+ j(e.$slots, "default", {}, void 0, !0)
75
76
  ], 16), [
76
- [G, n(d)]
77
+ [q, n(d)]
77
78
  ])
78
79
  ]),
79
80
  _: 3
80
81
  }, 8, ["name"])
81
82
  ], 8, ["to"])) : A("", !0);
82
83
  }
83
- }, se = /* @__PURE__ */ Z(x, [["__scopeId", "data-v-e29439e3"]]);
84
+ }, se = /* @__PURE__ */ Z(x, [["__scopeId", "data-v-8cdd3474"]]);
84
85
  export {
85
86
  se as default
86
87
  };
@@ -1,4 +1,4 @@
1
- const t = {
1
+ const o = {
2
2
  modelValue: Boolean,
3
3
  activator: [String, Object],
4
4
  activatorProps: {
@@ -38,6 +38,7 @@ const t = {
38
38
  type: [String, Number],
39
39
  default: "w-full"
40
40
  },
41
+ zIndex: { type: String, default: "z-50" },
41
42
  offset: [String, Number, Array],
42
43
  openDelay: {
43
44
  type: [String, Number],
@@ -50,16 +51,31 @@ const t = {
50
51
  location: {
51
52
  type: String,
52
53
  default: "bottom",
53
- validator: (e) => ["top", "bottom", "left", "right"].includes(e)
54
+ validator: (t) => ["top", "bottom", "left", "right"].includes(t)
54
55
  },
55
56
  origin: {
56
57
  type: String,
57
- default: "auto"
58
+ default: "auto",
59
+ validator: (t) => [
60
+ "auto",
61
+ "top left",
62
+ "top center",
63
+ "top right",
64
+ "bottom left",
65
+ "bottom center",
66
+ "bottom right",
67
+ "left top",
68
+ "left center",
69
+ "left bottom",
70
+ "right top",
71
+ "right center",
72
+ "right bottom"
73
+ ].includes(t)
58
74
  },
59
75
  transition: {
60
76
  type: String,
61
77
  default: "scale",
62
- validator: (e) => ["fade", "slide-y", "slide-x", "scale"].includes(e)
78
+ validator: (t) => ["fade", "slide-y", "slide-x", "scale"].includes(t)
63
79
  },
64
80
  persistent: Boolean,
65
81
  zIndex: [String, Number],
@@ -78,5 +94,5 @@ const t = {
78
94
  }
79
95
  };
80
96
  export {
81
- t as kunMenuProps
97
+ o as kunMenuProps
82
98
  };
@@ -1,51 +1,49 @@
1
- import { ref as c, computed as g } from "vue";
2
- function w(e, v, r, h) {
3
- const s = c({}), u = c(null), d = c(null), x = {
1
+ import { ref as a, computed as c } from "vue";
2
+ function E(n, u, o, f) {
3
+ const l = a({}), s = a(null), d = {
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
- }, E = g(() => {
8
+ }, m = c(() => {
9
9
  var t;
10
- return ((t = x[e.location]) == null ? void 0 : t.class) || "origin-top";
10
+ return ((t = d[n.location]) == null ? void 0 : t.class) || "origin-top";
11
11
  });
12
- function f(t = 0) {
13
- var m;
14
- const n = (m = e.parentRef) == null ? void 0 : m.$el;
15
- if (!(n instanceof HTMLElement)) return;
16
- const i = n.getBoundingClientRect();
17
- if ((i.width < 10 || i.height < 10) && t < 10) {
18
- requestAnimationFrame(() => f(t + 1));
12
+ function r(t = 0) {
13
+ const i = n.parentRef;
14
+ if (!(i instanceof HTMLElement)) return;
15
+ const e = i.getBoundingClientRect();
16
+ if ((e.width < 10 || e.height < 10) && t < 10) {
17
+ requestAnimationFrame(() => r(t + 1));
19
18
  return;
20
19
  }
21
- const o = n.parentElement, a = o ? window.getComputedStyle(o) : {}, l = parseInt(a.marginTop, 10) || 0, b = parseInt(a.paddingTop, 10) || 0, H = l + b, L = n.offsetWidth - n.clientWidth, T = e.hideDetails ? 0 : 15;
22
- s.value = {
20
+ const x = i.offsetWidth - i.clientWidth, p = n.hideDetails ? 0 : 19;
21
+ l.value = {
23
22
  position: "absolute",
24
- top: `${i.bottom - H - T}px`,
25
- left: `${i.left}px`,
26
- width: `${i.width + L}px`
23
+ top: `${e.bottom - p}px`,
24
+ left: `${e.left}px`,
25
+ width: `${e.width + x}px`
27
26
  };
28
27
  }
29
- function p() {
30
- var n, i, o, a, l;
31
- let t = null;
32
- if (e.activator === "parent" ? t = ((n = e.parentRef) == null ? void 0 : n.$el) || ((i = d.value) == null ? void 0 : i.parentElement) : e.activator && typeof e.activator == "object" && (t = ((o = e.activator) == null ? void 0 : o.$el) || ((l = (a = e.activator) == null ? void 0 : a.$refs) == null ? void 0 : l.input) || e.activator), !(t instanceof HTMLElement)) {
28
+ function g() {
29
+ var i, e;
30
+ const t = ((i = n.parentRef) == null ? void 0 : i.$el) || ((e = s.value) == null ? void 0 : e.parentElement);
31
+ if (!(t instanceof HTMLElement)) {
33
32
  console.warn("[KunMenu] Activator no válido:", t);
34
33
  return;
35
34
  }
36
- t instanceof HTMLElement && (u.value = t, t.addEventListener("click", v), t.addEventListener("mouseenter", () => r("enter")), t.addEventListener("mouseleave", () => r("leave")), t.addEventListener("focus", h));
35
+ t.addEventListener("click", u), t.addEventListener("mouseenter", () => o("enter")), t.addEventListener("mouseleave", () => o("leave")), t.addEventListener("focus", f);
37
36
  }
38
- const M = g(() => typeof e.maxHeight == "number" ? e.maxHeight + "px" : e.maxHeight);
37
+ const h = c(() => typeof n.maxHeight == "number" ? n.maxHeight + "px" : n.maxHeight);
39
38
  return {
40
- initializeMenu: p,
41
- repositionMenu: f,
42
- contentEl: d,
43
- activatorEl: u,
44
- originClass: E,
45
- computedMaxHeight: M,
46
- menuPositionStyle: s
39
+ initializeMenu: g,
40
+ repositionMenu: r,
41
+ contentEl: s,
42
+ originClass: m,
43
+ computedMaxHeight: h,
44
+ menuPositionStyle: l
47
45
  };
48
46
  }
49
47
  export {
50
- w as useKunMenuStyles
48
+ E as useKunMenuStyles
51
49
  };
@@ -0,0 +1,20 @@
1
+ import { createElementBlock as e, openBlock as o, createElementVNode as c } from "vue";
2
+ import n from "../_virtual/_plugin-vue_export-helper.js";
3
+ const r = {}, a = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: "24",
6
+ height: "24",
7
+ viewBox: "0 0 24 24"
8
+ };
9
+ function l(m, t) {
10
+ return o(), e("svg", a, t[0] || (t[0] = [
11
+ c("path", {
12
+ fill: "currentColor",
13
+ d: "M12 4a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m0 7c2.67 0 8 1.33 8 4v3H4v-3c0-2.67 5.33-4 8-4m0 1.9c-2.97 0-6.1 1.46-6.1 2.1v1.1h12.2V17c0-.64-3.13-2.1-6.1-2.1"
14
+ }, null, -1)
15
+ ]));
16
+ }
17
+ const f = /* @__PURE__ */ n(r, [["render", l]]);
18
+ export {
19
+ f as default
20
+ };
@@ -1,16 +1,20 @@
1
- import { createElementBlock as o, openBlock as t, createElementVNode as r } from "vue";
2
- import n from "../_virtual/_plugin-vue_export-helper.js";
3
- const l = {}, c = {
1
+ import { createElementBlock as e, openBlock as o, createElementVNode as l } from "vue";
2
+ import r from "../_virtual/_plugin-vue_export-helper.js";
3
+ const n = {}, c = {
4
4
  xmlns: "http://www.w3.org/2000/svg",
5
- viewBox: "0 0 24 24",
6
- fill: "currentColor"
5
+ width: "24",
6
+ height: "24",
7
+ viewBox: "0 0 24 24"
7
8
  };
8
- function s(f, e) {
9
- return t(), o("svg", c, e[0] || (e[0] = [
10
- r("path", { d: "M6 18L18 6M6 6l12 12" }, null, -1)
9
+ function s(i, t) {
10
+ return o(), e("svg", c, t[0] || (t[0] = [
11
+ l("path", {
12
+ fill: "currentColor",
13
+ d: "m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"
14
+ }, null, -1)
11
15
  ]));
12
16
  }
13
- const i = /* @__PURE__ */ n(l, [["render", s]]);
17
+ const _ = /* @__PURE__ */ r(n, [["render", s]]);
14
18
  export {
15
- i as default
19
+ _ as default
16
20
  };
@@ -0,0 +1,20 @@
1
+ import { createElementBlock as t, openBlock as o, createElementVNode as r } from "vue";
2
+ import l from "../_virtual/_plugin-vue_export-helper.js";
3
+ const n = {}, c = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: "24",
6
+ height: "24",
7
+ viewBox: "0 0 24 24"
8
+ };
9
+ function m(s, e) {
10
+ return o(), t("svg", c, e[0] || (e[0] = [
11
+ r("path", {
12
+ fill: "currentColor",
13
+ d: "m14.06 9l.94.94L5.92 19H5v-.92zm3.6-6c-.25 0-.51.1-.7.29l-1.83 1.83l3.75 3.75l1.83-1.83c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"
14
+ }, null, -1)
15
+ ]));
16
+ }
17
+ const _ = /* @__PURE__ */ l(n, [["render", m]]);
18
+ export {
19
+ _ as default
20
+ };
@@ -0,0 +1,20 @@
1
+ import { createElementBlock as e, openBlock as o, createElementVNode as r } from "vue";
2
+ import n from "../_virtual/_plugin-vue_export-helper.js";
3
+ const l = {}, c = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: "24",
6
+ height: "24",
7
+ viewBox: "0 0 24 24"
8
+ };
9
+ function s(h, t) {
10
+ return o(), e("svg", c, t[0] || (t[0] = [
11
+ r("path", {
12
+ fill: "currentColor",
13
+ d: "M6 19a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7H6zM8 9h8v10H8zm7.5-5l-1-1h-5l-1 1H5v2h14V4z"
14
+ }, null, -1)
15
+ ]));
16
+ }
17
+ const a = /* @__PURE__ */ n(l, [["render", s]]);
18
+ export {
19
+ a as default
20
+ };
@@ -1,27 +1,33 @@
1
1
  import o from "./IconAsterisk.vue.js";
2
2
  import e from "./IconCheck.vue.js";
3
- import r from "./IconClose.vue.js";
4
- import t from "./IconDelete.vue.js";
5
- import n from "./IconEdit.vue.js";
3
+ import t from "./IconClose.vue.js";
4
+ import n from "./IconDelete.vue.js";
5
+ import r from "./IconEdit.vue.js";
6
6
  import i from "./IconMenuDownOutline.vue.js";
7
7
  import m from "./IconMenuUpOutline.vue.js";
8
8
  import c from "./IconSearch.vue.js";
9
9
  import f from "./IconStar.vue.js";
10
- import p from "./IconEyeOutline.vue.js";
11
- import l from "./IconEyeOffOutline.vue.js";
12
- const w = {
10
+ import l from "./IconEyeOutline.vue.js";
11
+ import p from "./IconEyeOffOutline.vue.js";
12
+ import u from "./IconAccountOutline.vue.js";
13
+ import I from "./IconPencil.vue.js";
14
+ import O from "./IconTrashOutline.vue.js";
15
+ const x = {
13
16
  asterisk: o,
14
17
  check: e,
15
- close: r,
16
- delete: t,
17
- edit: n,
18
+ close: t,
19
+ delete: n,
20
+ edit: r,
18
21
  menuDownOutline: i,
19
22
  menuUpOutline: m,
20
23
  search: c,
21
24
  star: f,
22
- eyeOutline: p,
23
- eyeOffOutline: l
25
+ eyeOutline: l,
26
+ eyeOffOutline: p,
27
+ accountOutline: u,
28
+ pencil: I,
29
+ trashOutline: O
24
30
  };
25
31
  export {
26
- w as icons
32
+ x as icons
27
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.124",
3
+ "version": "0.1.126",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",