adverich-kun-ui 0.1.147 → 0.1.149

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,5 +1,5 @@
1
- import { ref as b, inject as c, onMounted as v, onBeforeUnmount as g, computed as f, createElementBlock as m, openBlock as y, mergeProps as h, withKeys as k, withModifiers as w, renderSlot as B } from "vue";
2
- const S = ["aria-selected", "aria-disabled", "onKeydown"], x = {
1
+ import { ref as w, inject as g, onMounted as p, onBeforeUnmount as B, computed as y, createElementBlock as c, openBlock as i, mergeProps as I, withKeys as x, withModifiers as A, createElementVNode as s, renderSlot as r, createBlock as h, createCommentVNode as d, resolveDynamicComponent as k, toDisplayString as S } from "vue";
2
+ const $ = ["aria-selected", "aria-disabled", "onKeydown"], C = { class: "shrink-0 flex items-center" }, E = ["src"], N = { class: "flex flex-col min-w-0 flex-1" }, j = { class: "font-medium truncate" }, K = { class: "text-sm text-gray-500 dark:text-gray-400 truncate" }, R = { class: "shrink-0 flex items-center ml-auto" }, L = ["src"], P = {
3
3
  __name: "KunListItem",
4
4
  props: {
5
5
  value: {
@@ -31,59 +31,100 @@ const S = ["aria-selected", "aria-disabled", "onKeydown"], x = {
31
31
  itemPosition: {
32
32
  type: String,
33
33
  default: "items-start"
34
- }
34
+ },
35
+ prependIcon: [String, Object, Function],
36
+ appendIcon: [String, Object, Function],
37
+ prependAvatar: String,
38
+ appendAvatar: String,
39
+ title: [String, Number, Boolean],
40
+ subtitle: [String, Number, Boolean],
41
+ slim: Boolean
35
42
  },
36
43
  setup(e) {
37
- const a = e, n = b(null), i = c("registerListItemRef", null), t = c("kunListContext", null);
38
- v(() => {
39
- i && n.value && i(n.value);
40
- }), g(() => {
41
- i && i(null);
44
+ const n = e, a = w(null), o = g("registerListItemRef", null), l = g("kunListContext", null);
45
+ p(() => {
46
+ o && a.value && o(a.value);
47
+ }), B(() => {
48
+ o && o(null);
42
49
  });
43
- const u = f(() => {
44
- var l;
45
- return ((l = t == null ? void 0 : t.isSelected) == null ? void 0 : l.call(t, a.value)) ?? !1;
46
- }), o = f(() => a.active);
47
- function s() {
48
- var l, r, d;
49
- a.disabled || ((l = n.value) == null || l.dispatchEvent(
50
+ const v = y(() => {
51
+ var t;
52
+ return ((t = l == null ? void 0 : l.isSelected) == null ? void 0 : t.call(l, n.value)) ?? !1;
53
+ }), m = y(() => n.active);
54
+ function f() {
55
+ var t, u, b;
56
+ n.disabled || ((t = a.value) == null || t.dispatchEvent(
50
57
  new CustomEvent("select", {
51
- detail: a.value,
58
+ detail: n.value,
52
59
  bubbles: !0
53
60
  })
54
- ), t && a.value !== null && ((r = t.toggleItem) == null || r.call(t, a.value), (d = n.value) == null || d.dispatchEvent(
61
+ ), l && n.value !== null && ((u = l.toggleItem) == null || u.call(l, n.value), (b = a.value) == null || b.dispatchEvent(
55
62
  new CustomEvent("selected", {
56
- detail: a.value,
63
+ detail: n.value,
57
64
  bubbles: !0
58
65
  })
59
66
  )));
60
67
  }
61
- return (l, r) => (y(), m("li", h({
68
+ return (t, u) => (i(), c("li", I({
62
69
  ref_key: "liRef",
63
- ref: n,
70
+ ref: a,
64
71
  role: "option",
65
- "aria-selected": u.value || o.value,
72
+ "aria-selected": v.value || m.value,
66
73
  "aria-disabled": e.disabled,
67
74
  tabindex: "-1",
68
- class: ["w-full flex flex-col", [
75
+ class: ["w-full flex", [
69
76
  "kun-list-item",
70
77
  e.bgItems,
71
- e.itemPosition,
72
78
  e.textColor,
79
+ e.itemPosition,
73
80
  {
74
81
  "cursor-not-allowed opacity-50": e.disabled,
75
82
  [`cursor-pointer ${e.hoverBg}`]: !e.disabled,
76
- [e.activeClass]: u.value || o.value,
77
- "px-4 py-2": !e.noGutters
83
+ [e.activeClass]: v.value || m.value,
84
+ "px-4 py-2": !e.noGutters,
85
+ "gap-2": !e.slim
78
86
  }
79
87
  ]],
80
- onKeydown: k(w(s, ["prevent"]), ["enter"]),
81
- onClick: s
82
- }, l.$attrs), [
83
- B(l.$slots, "default")
84
- ], 16, S));
88
+ onKeydown: x(A(f, ["prevent"]), ["enter"]),
89
+ onClick: f
90
+ }, t.$attrs), [
91
+ s("div", C, [
92
+ r(t.$slots, "prepend", {}, () => [
93
+ e.prependAvatar ? (i(), c("img", {
94
+ key: 0,
95
+ src: e.prependAvatar,
96
+ class: "w-8 h-8 rounded-full"
97
+ }, null, 8, E)) : e.prependIcon ? (i(), h(k(e.prependIcon), {
98
+ key: 1,
99
+ class: "w-5 h-5"
100
+ })) : d("", !0)
101
+ ])
102
+ ]),
103
+ s("div", N, [
104
+ r(t.$slots, "default", {}, () => [
105
+ e.title ? r(t.$slots, "title", { key: 0 }, () => [
106
+ s("div", j, S(e.title), 1)
107
+ ]) : d("", !0),
108
+ e.subtitle ? r(t.$slots, "subtitle", { key: 1 }, () => [
109
+ s("div", K, S(e.subtitle), 1)
110
+ ]) : d("", !0)
111
+ ])
112
+ ]),
113
+ s("div", R, [
114
+ r(t.$slots, "append", {}, () => [
115
+ e.appendAvatar ? (i(), c("img", {
116
+ key: 0,
117
+ src: e.appendAvatar,
118
+ class: "w-8 h-8 rounded-full"
119
+ }, null, 8, L)) : e.appendIcon ? (i(), h(k(e.appendIcon), {
120
+ key: 1,
121
+ class: "w-5 h-5"
122
+ })) : d("", !0)
123
+ ])
124
+ ])
125
+ ], 16, $));
85
126
  }
86
127
  };
87
128
  export {
88
- x as default
129
+ P as default
89
130
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.147",
3
+ "version": "0.1.149",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",