adverich-kun-ui 0.1.524 → 0.1.525

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 { mergeModels as g, ref as v, useModel as D, provide as p, computed as B, onUpdated as C, createElementBlock as M, openBlock as S, mergeProps as I, withModifiers as E, renderSlot as L } from "vue";
1
+ import { mergeModels as g, ref as v, useModel as D, provide as b, computed as h, onUpdated as B, createElementBlock as E, openBlock as I, mergeProps as S, renderSlot as M } from "vue";
2
2
  const R = {
3
3
  __name: "KunList",
4
4
  props: /* @__PURE__ */ g({
@@ -21,15 +21,15 @@ const R = {
21
21
  selectedModifiers: {}
22
22
  }),
23
23
  emits: /* @__PURE__ */ g(["keyDown", "click:select", "update:selected"], ["update:selected"]),
24
- setup(o, { expose: w, emit: b }) {
25
- const c = o, a = b, f = v(null), s = v([]), i = D(o, "selected");
26
- p("registerListItemRef", (e) => {
24
+ setup(o, { expose: p, emit: w }) {
25
+ const c = o, a = w, f = v(null), s = v([]), i = D(o, "selected");
26
+ b("registerListItemRef", (e) => {
27
27
  e ? e.isConnected && !s.value.includes(e) && (s.value.push(e), s.value.sort((t, n) => {
28
28
  const r = t.id ?? "", l = n.id ?? "";
29
29
  return r.localeCompare(l, void 0, { numeric: !0, sensitivity: "base" });
30
30
  })) : s.value = s.value.filter((t) => t && t.isConnected);
31
31
  });
32
- const m = B(() => c.selectable && c.selectionMode === "multiple");
32
+ const m = h(() => c.selectable && c.selectionMode === "multiple");
33
33
  function y(e) {
34
34
  if (!(!c.selectable || e == null))
35
35
  if (m.value) {
@@ -38,20 +38,21 @@ const R = {
38
38
  } else
39
39
  i.value = e;
40
40
  }
41
- C(() => {
41
+ B(() => {
42
42
  s.value = s.value.filter((e) => e && e.isConnected);
43
43
  });
44
- function k(e) {
44
+ function A(e) {
45
45
  var t, n;
46
46
  return !c.selectable || e == null ? !1 : m.value ? (n = (t = i.value) == null ? void 0 : t.includes) == null ? void 0 : n.call(t, e) : i.value === e;
47
47
  }
48
- p("kunListContext", {
48
+ b("kunListContext", {
49
49
  toggleItem: y,
50
- isSelected: k
50
+ isSelected: A
51
51
  });
52
- function A(e) {
52
+ function k(e) {
53
53
  var r;
54
- a("keyDown", e);
54
+ if (a("keyDown", e), ["INPUT", "TEXTAREA"].includes(e.target.tagName) || e.target.isContentEditable)
55
+ return;
55
56
  const t = e.key, n = s.value.filter((l) => l && l.isConnected);
56
57
  if (!(!n.length || !["ArrowUp", "ArrowDown", "Enter"].includes(t))) {
57
58
  if (t === "Enter") {
@@ -61,7 +62,7 @@ const R = {
61
62
  }
62
63
  if (t === "ArrowUp" || t === "ArrowDown") {
63
64
  e.preventDefault();
64
- const l = n.findIndex((x) => x === document.activeElement);
65
+ const l = n.findIndex((C) => C === document.activeElement);
65
66
  let d = -1;
66
67
  l === -1 ? d = t === "ArrowDown" ? 0 : n.length - 1 : t === "ArrowDown" ? d = (l + 1) % n.length : t === "ArrowUp" && (d = (l - 1 + n.length) % n.length);
67
68
  const u = n[d];
@@ -70,17 +71,17 @@ const R = {
70
71
  }
71
72
  }
72
73
  }
73
- function h(e = "ArrowDown") {
74
+ function x(e = "ArrowDown") {
74
75
  var l;
75
76
  const t = s.value.filter(Boolean);
76
77
  if (!t.length) return;
77
78
  const n = e === "ArrowDown" ? 0 : t.length - 1, r = t[n];
78
79
  (l = r == null ? void 0 : r.focus) == null || l.call(r);
79
80
  }
80
- return w({ focusWithKey: h, focus: () => {
81
+ return p({ focusWithKey: x, focus: () => {
81
82
  var e, t;
82
83
  return (t = (e = f.value) == null ? void 0 : e.focus) == null ? void 0 : t.call(e);
83
- } }), (e, t) => (S(), M("ul", I({
84
+ } }), (e, t) => (I(), E("ul", S({
84
85
  ref_key: "ulRef",
85
86
  ref: f,
86
87
  role: "list",
@@ -95,10 +96,10 @@ const R = {
95
96
  }
96
97
  ]],
97
98
  tabindex: "-1",
98
- onKeydown: E(A, ["prevent"]),
99
+ onKeydown: k,
99
100
  onSelect: t[0] || (t[0] = (n) => a("click:select", n.detail))
100
101
  }, e.$attrs), [
101
- L(e.$slots, "default")
102
+ M(e.$slots, "default")
102
103
  ], 16));
103
104
  }
104
105
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.524",
3
+ "version": "0.1.525",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",