adverich-kun-ui 0.1.73 → 0.1.75

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 { ref as c, provide as p, createElementBlock as v, openBlock as k, normalizeClass as h, renderSlot as x } from "vue";
1
+ import { ref as c, provide as y, createElementBlock as v, openBlock as h, normalizeClass as k, renderSlot as x } from "vue";
2
2
  import { useKunList as A } from "../composables/useKunList.js";
3
3
  const K = {
4
4
  __name: "KunList",
@@ -9,7 +9,7 @@ const K = {
9
9
  selectable: {
10
10
  type: [Boolean, String],
11
11
  default: !1,
12
- validator: (r) => ["single", "multiple", !0, !1].includes(r)
12
+ validator: (l) => ["single", "multiple", !0, !1].includes(l)
13
13
  },
14
14
  selectedClass: {
15
15
  type: String,
@@ -17,58 +17,58 @@ const K = {
17
17
  },
18
18
  bgList: {
19
19
  type: String,
20
- default: "bg-gray-100 dark:bg-gray-800"
20
+ default: "bg-transparent"
21
21
  }
22
22
  },
23
23
  emits: ["keyDown"],
24
- setup(r, { expose: d, emit: g }) {
25
- const b = r, m = g;
26
- A(b);
24
+ setup(l, { expose: d, emit: g }) {
25
+ const m = l, b = g;
26
+ A(m);
27
27
  const u = c(null), o = c([]);
28
28
  d({
29
29
  focusWithKey: (e) => {
30
- var n, l;
30
+ var n, r;
31
31
  const t = o.value.filter(Boolean);
32
- t.length !== 0 && (e === "ArrowDown" ? (n = t[0]) == null || n.focus() : e === "ArrowUp" && ((l = t[t.length - 1]) == null || l.focus()));
32
+ t.length !== 0 && (e === "ArrowDown" ? (n = t[0]) == null || n.focus() : e === "ArrowUp" && ((r = t[t.length - 1]) == null || r.focus()));
33
33
  },
34
34
  focus: () => {
35
35
  var e, t;
36
36
  (t = (e = u.value) == null ? void 0 : e.focus) == null || t.call(e);
37
37
  }
38
- }), p("registerListItemRef", (e) => {
38
+ }), y("registerListItemRef", (e) => {
39
39
  e ? o.value.includes(e) || o.value.push(e) : o.value = o.value.filter((t) => t !== e);
40
40
  });
41
- function y(e) {
42
- var a, i, f;
41
+ function w(e) {
42
+ var i, a, f;
43
43
  const t = e.key;
44
- if (m("keyDown", e), !["ArrowDown", "ArrowUp"].includes(t)) return;
44
+ if (b("keyDown", e), !["ArrowDown", "ArrowUp"].includes(t)) return;
45
45
  e.preventDefault();
46
46
  const n = o.value.filter(Boolean);
47
47
  if (n.length === 0) return;
48
- const l = n.findIndex((w) => w === document.activeElement);
49
- if (l === -1) {
50
- t === "ArrowDown" ? (a = n[0]) == null || a.focus() : t === "ArrowUp" && ((i = n[n.length - 1]) == null || i.focus());
48
+ const r = n.findIndex((p) => p === document.activeElement);
49
+ if (r === -1) {
50
+ t === "ArrowDown" ? (i = n[0]) == null || i.focus() : t === "ArrowUp" && ((a = n[n.length - 1]) == null || a.focus());
51
51
  return;
52
52
  }
53
- let s = l;
54
- t === "ArrowDown" ? s = (l + 1) % n.length : t === "ArrowUp" && (s = (l - 1 + n.length) % n.length), (f = n[s]) == null || f.focus();
53
+ let s = r;
54
+ t === "ArrowDown" ? s = (r + 1) % n.length : t === "ArrowUp" && (s = (r - 1 + n.length) % n.length), (f = n[s]) == null || f.focus();
55
55
  }
56
- return (e, t) => (k(), v("ul", {
56
+ return (e, t) => (h(), v("ul", {
57
57
  role: "list",
58
- class: h(["w-full bg-gray-500", [
58
+ class: k(["w-full bg-gray-500", [
59
59
  "kun-list",
60
- r.bgList,
60
+ l.bgList,
61
61
  {
62
- "space-y-1": !r.dense,
63
- "space-y-0.5": r.dense,
64
- "pl-4 border-l-2 border-gray-200 dark:border-gray-700": r.sub,
65
- "bg-gray-100 dark:bg-gray-800 p-2 rounded-md": r.nav
62
+ "space-y-1": !l.dense,
63
+ "space-y-0.5": l.dense,
64
+ "pl-4 border-l-2 border-gray-300 dark:border-gray-700": l.sub,
65
+ "p-2 rounded-md": l.nav
66
66
  }
67
67
  ]]),
68
68
  ref_key: "ulRef",
69
69
  ref: u,
70
70
  tabindex: "-1",
71
- onKeydown: y
71
+ onKeydown: w
72
72
  }, [
73
73
  x(e.$slots, "default")
74
74
  ], 34));
@@ -1,4 +1,4 @@
1
- import { ref as i, inject as o, onMounted as d, onBeforeUnmount as f, watch as g, computed as b, createElementBlock as v, openBlock as m, normalizeClass as k, renderSlot as y } from "vue";
1
+ import { ref as i, inject as o, onMounted as f, onBeforeUnmount as d, watch as g, computed as v, createElementBlock as b, openBlock as m, normalizeClass as k, renderSlot as y } from "vue";
2
2
  const S = {
3
3
  __name: "KunListItem",
4
4
  props: {
@@ -15,43 +15,48 @@ const S = {
15
15
  },
16
16
  bgItems: {
17
17
  type: String,
18
- default: "bg-gray-200 dark:bg-gray-700"
18
+ default: "bg-transparent"
19
19
  },
20
20
  hoverBg: {
21
21
  type: String,
22
22
  default: "hover:bg-gray-100 dark:hover:bg-gray-600"
23
+ },
24
+ noGutters: {
25
+ type: Boolean,
26
+ default: !1
23
27
  }
24
28
  },
25
- setup(l) {
26
- const t = l, n = i(null), r = o("registerListItemRef", null), e = o("kun-list", null);
27
- d(() => {
28
- r && n.value && r(n.value);
29
- }), f(() => {
30
- r && r(null);
29
+ setup(e) {
30
+ const l = e, r = i(null), n = o("registerListItemRef", null), t = o("kun-list", null);
31
+ f(() => {
32
+ n && r.value && n(r.value);
33
+ }), d(() => {
34
+ n && n(null);
31
35
  });
32
- const u = i(t.active);
33
- g(() => t.active, (a) => {
36
+ const u = i(l.active);
37
+ g(() => l.active, (a) => {
34
38
  u.value = a;
35
39
  });
36
- const s = b(() => {
40
+ const s = v(() => {
37
41
  var a;
38
- return ((a = e == null ? void 0 : e.isSelected) == null ? void 0 : a.call(e, t.value)) ?? !1;
42
+ return ((a = t == null ? void 0 : t.isSelected) == null ? void 0 : a.call(t, l.value)) ?? !1;
39
43
  });
40
44
  function c() {
41
- t.disabled || e && t.value !== null && e.toggleItem(t.value);
45
+ l.disabled || t && l.value !== null && t.toggleItem(l.value);
42
46
  }
43
- return (a, B) => (m(), v("li", {
47
+ return (a, B) => (m(), b("li", {
44
48
  ref_key: "liRef",
45
- ref: n,
49
+ ref: r,
46
50
  role: "listitem",
47
51
  tabindex: "-1",
48
52
  class: k(["w-full flex flex-col items-start", [
49
53
  "kun-list-item",
50
- l.bgItems,
54
+ e.bgItems,
51
55
  {
52
- "cursor-not-allowed": l.disabled,
53
- [`px-4 py-2 cursor-pointer ${l.hoverBg}`]: !l.disabled,
54
- [l.activeClass]: s.value || u.value
56
+ "cursor-not-allowed": e.disabled,
57
+ [`cursor-pointer ${e.hoverBg}`]: !e.disabled,
58
+ [e.activeClass]: s.value || u.value,
59
+ "px-4 py-2": !e.noGutters
55
60
  }
56
61
  ]]),
57
62
  onClick: c
@@ -1,5 +1,5 @@
1
- import { createElementBlock as n, openBlock as r, normalizeClass as a, renderSlot as o, createTextVNode as s, toDisplayString as i } from "vue";
2
- const p = {
1
+ import { createElementBlock as l, openBlock as r, normalizeClass as a, renderSlot as o, createTextVNode as s, toDisplayString as i } from "vue";
2
+ const u = {
3
3
  __name: "KunListItemTitle",
4
4
  props: {
5
5
  title: {
@@ -16,12 +16,12 @@ const p = {
16
16
  },
17
17
  class: {
18
18
  type: [String, Object, Array],
19
- default: null
19
+ default: "font-semibold uppercase"
20
20
  }
21
21
  },
22
22
  setup(e) {
23
23
  const t = e;
24
- return (l, u) => (r(), n("span", {
24
+ return (n, p) => (r(), l("span", {
25
25
  class: a([
26
26
  "truncate",
27
27
  t.fontSize,
@@ -29,12 +29,12 @@ const p = {
29
29
  t.class
30
30
  ])
31
31
  }, [
32
- o(l.$slots, "default", {}, () => [
32
+ o(n.$slots, "default", {}, () => [
33
33
  s(i(t.title), 1)
34
34
  ])
35
35
  ], 2));
36
36
  }
37
37
  };
38
38
  export {
39
- p as default
39
+ u as default
40
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.73",
3
+ "version": "0.1.75",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",