adverich-kun-ui 0.1.218 → 0.1.219

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,30 +1,18 @@
1
- import { ref as z, inject as E, onMounted as F, onBeforeUnmount as U, computed as i, resolveComponent as q, createBlock as c, openBlock as a, unref as H, withCtx as x, resolveDynamicComponent as v, mergeProps as K, withKeys as j, withModifiers as R, createElementVNode as k, createElementBlock as l, createCommentVNode as s, renderSlot as d, normalizeClass as u, toDisplayString as h } from "vue";
1
+ import { ref as z, inject as E, onMounted as F, onBeforeUnmount as U, computed as d, resolveComponent as q, createBlock as u, openBlock as l, unref as H, withCtx as B, resolveDynamicComponent as v, mergeProps as K, withKeys as j, withModifiers as R, createElementVNode as k, createElementBlock as a, createCommentVNode as s, renderSlot as o, normalizeClass as r, toDisplayString as h } from "vue";
2
2
  import { RouterLink as J } from "vue-router";
3
3
  const Q = { class: "flex w-full items-center" }, T = {
4
4
  key: 0,
5
5
  class: "shrink-0 flex items-center gap-2 me-2"
6
6
  }, W = ["src"], X = { class: "flex flex-col min-w-0 flex-1" }, Y = {
7
- key: 0,
8
- class: "font-medium truncate"
9
- }, Z = {
10
- key: 0,
11
- class: "text-sm text-gray-500 dark:text-gray-400 truncate"
12
- }, _ = {
13
7
  key: 1,
14
8
  class: "shrink-0 flex items-center gap-2 ms-3"
15
- }, ee = ["src"], te = { class: "flex w-full items-center" }, ne = {
9
+ }, Z = ["src"], _ = { class: "flex w-full items-center" }, ee = {
16
10
  key: 0,
17
11
  class: "shrink-0 flex items-center gap-2 me-2"
18
- }, ae = ["src"], le = { class: "flex flex-col min-w-0 flex-1" }, se = {
19
- key: 0,
20
- class: "font-medium truncate"
21
- }, re = {
22
- key: 0,
23
- class: "text-sm text-gray-500 dark:text-gray-400 truncate"
24
- }, ie = {
12
+ }, te = ["src"], ne = { class: "flex flex-col min-w-0 flex-1" }, le = {
25
13
  key: 1,
26
14
  class: "shrink-0 flex items-center gap-2 ms-3"
27
- }, de = ["src"], oe = "w-full flex transition duration-150 ease-in-out", fe = {
15
+ }, ae = ["src"], se = "w-full flex transition duration-150 ease-in-out", de = {
28
16
  __name: "KunListItem",
29
17
  props: {
30
18
  value: [String, Number, Boolean, Object, Array, null],
@@ -58,28 +46,30 @@ const Q = { class: "flex w-full items-center" }, T = {
58
46
  appendAvatar: String,
59
47
  appendClass: String,
60
48
  title: [String, Number, Boolean],
61
- subtitle: [String, Number, Boolean]
49
+ titleClass: { type: String, default: "font-medium" },
50
+ subtitle: [String, Number, Boolean],
51
+ subtitleClass: { type: String, default: "text-sm text-slate-800 dark:text-slate-200" }
62
52
  },
63
53
  emits: ["click"],
64
54
  setup(e, { emit: L }) {
65
- const t = e, N = L, f = z(null), m = E("registerListItemRef", null), o = E("kunListContext", null);
55
+ const t = e, N = L, f = z(null), p = E("registerListItemRef", null), c = E("kunListContext", null);
66
56
  F(() => {
67
- m && f.value && m(f.value);
57
+ p && f.value && p(f.value);
68
58
  }), U(() => {
69
- m && m(null);
59
+ p && p(null);
70
60
  });
71
- const y = (n) => typeof n == "object" || typeof n == "function", B = i(() => !!(t.prependIcon || t.prependAvatar)), $ = i(() => !!(t.appendIcon || t.appendAvatar)), C = i(() => {
61
+ const y = (n) => typeof n == "object" || typeof n == "function", $ = d(() => !!(t.prependIcon || t.prependAvatar)), x = d(() => !!(t.appendIcon || t.appendAvatar)), C = d(() => {
72
62
  var n;
73
- return ((n = o == null ? void 0 : o.isSelected) == null ? void 0 : n.call(o, t.value)) ?? !1;
74
- }), I = i(() => t.active), O = i(() => !!t.to);
63
+ return ((n = c == null ? void 0 : c.isSelected) == null ? void 0 : n.call(c, t.value)) ?? !1;
64
+ }), I = d(() => t.active), O = d(() => !!t.to);
75
65
  function g(n, S = null) {
76
- var b, p;
66
+ var b, m;
77
67
  if (t.disabled) return;
78
68
  N("click", n);
79
- const r = ((b = f.value) == null ? void 0 : b.$el) ?? f.value;
80
- r != null && r.dispatchEvent && r.dispatchEvent(new CustomEvent("select", { detail: t.value, bubbles: !0 })), o && t.selectable && t.value !== null && ((p = o.toggleItem) == null || p.call(o, t.value), r != null && r.dispatchEvent && r.dispatchEvent(new CustomEvent("selected", { detail: t.value, bubbles: !0 }))), S && S(n);
69
+ const i = ((b = f.value) == null ? void 0 : b.$el) ?? f.value;
70
+ i != null && i.dispatchEvent && i.dispatchEvent(new CustomEvent("select", { detail: t.value, bubbles: !0 })), c && t.selectable && t.value !== null && ((m = c.toggleItem) == null || m.call(c, t.value), i != null && i.dispatchEvent && i.dispatchEvent(new CustomEvent("selected", { detail: t.value, bubbles: !0 }))), S && S(n);
81
71
  }
82
- const P = i(() => {
72
+ const P = d(() => {
83
73
  switch (t.variant) {
84
74
  case "outlined":
85
75
  return "border border-gray-300 dark:border-gray-700";
@@ -94,7 +84,7 @@ const Q = { class: "flex w-full items-center" }, T = {
94
84
  default:
95
85
  return "";
96
86
  }
97
- }), D = i(() => {
87
+ }), D = d(() => {
98
88
  switch (t.density) {
99
89
  case "comfortable":
100
90
  return "py-2";
@@ -103,8 +93,8 @@ const Q = { class: "flex w-full items-center" }, T = {
103
93
  default:
104
94
  return "py-3";
105
95
  }
106
- }), G = i(() => t.tile ? "rounded-none" : t.rounded === !0 ? "rounded-md" : t.rounded === !1 ? "" : `rounded-${t.rounded}`), M = i(() => t.ripple ? "relative overflow-hidden" : ""), A = i(() => [
107
- oe,
96
+ }), G = d(() => t.tile ? "rounded-none" : t.rounded === !0 ? "rounded-md" : t.rounded === !1 ? "" : `rounded-${t.rounded}`), M = d(() => t.ripple ? "relative overflow-hidden" : ""), A = d(() => [
97
+ se,
108
98
  P.value,
109
99
  D.value,
110
100
  G.value,
@@ -121,15 +111,15 @@ const Q = { class: "flex w-full items-center" }, T = {
121
111
  t.itemClass
122
112
  ]);
123
113
  return (n, S) => {
124
- const r = q("KunIcon");
125
- return O.value ? (a(), c(H(J), {
114
+ const i = q("KunIcon");
115
+ return O.value ? (l(), u(H(J), {
126
116
  key: 0,
127
117
  to: e.to,
128
118
  replace: e.replace,
129
119
  custom: !0
130
120
  }, {
131
- default: x(({ href: b, navigate: p, isActive: V }) => [
132
- (a(), c(v(e.tag), K({
121
+ default: B(({ href: b, navigate: m, isActive: V }) => [
122
+ (l(), u(v(e.tag), K({
133
123
  ref_key: "liRef",
134
124
  ref: f,
135
125
  href: b,
@@ -138,50 +128,56 @@ const Q = { class: "flex w-full items-center" }, T = {
138
128
  "aria-disabled": e.disabled,
139
129
  tabindex: "-1",
140
130
  class: A.value,
141
- onClick: (w) => g(w, p),
142
- onKeydown: j(R((w) => g(w, p), ["prevent"]), ["enter"])
131
+ onClick: (w) => g(w, m),
132
+ onKeydown: j(R((w) => g(w, m), ["prevent"]), ["enter"])
143
133
  }, n.$attrs), {
144
- default: x(() => [
134
+ default: B(() => [
145
135
  k("div", Q, [
146
- B.value || n.$slots.prepend ? (a(), l("div", T, [
147
- d(n.$slots, "prepend", {}, () => [
148
- e.prependAvatar ? (a(), l("img", {
136
+ $.value || n.$slots.prepend ? (l(), a("div", T, [
137
+ o(n.$slots, "prepend", {}, () => [
138
+ e.prependAvatar ? (l(), a("img", {
149
139
  key: 0,
150
140
  src: e.prependAvatar,
151
- class: u(["rounded-full", e.prependClass])
152
- }, null, 10, W)) : y(e.prependIcon) ? (a(), c(v(e.prependIcon), {
141
+ class: r(["rounded-full", e.prependClass])
142
+ }, null, 10, W)) : y(e.prependIcon) ? (l(), u(v(e.prependIcon), {
153
143
  key: 1,
154
- class: u(e.prependClass)
155
- }, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(), c(r, {
144
+ class: r(e.prependClass)
145
+ }, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (l(), u(i, {
156
146
  key: 2,
157
147
  icon: e.prependIcon,
158
- class: u(e.prependClass)
148
+ class: r(e.prependClass)
159
149
  }, null, 8, ["icon", "class"])) : s("", !0)
160
150
  ])
161
151
  ])) : s("", !0),
162
152
  k("div", X, [
163
- d(n.$slots, "default", {}, () => [
164
- d(n.$slots, "title", {}, () => [
165
- e.title ? (a(), l("div", Y, h(e.title), 1)) : s("", !0)
153
+ o(n.$slots, "default", {}, () => [
154
+ o(n.$slots, "title", {}, () => [
155
+ e.title ? (l(), a("div", {
156
+ key: 0,
157
+ class: r(["truncate", e.titleClass])
158
+ }, h(e.title), 3)) : s("", !0)
166
159
  ]),
167
- d(n.$slots, "subtitle", {}, () => [
168
- e.subtitle ? (a(), l("div", Z, h(e.subtitle), 1)) : s("", !0)
160
+ o(n.$slots, "subtitle", {}, () => [
161
+ e.subtitle ? (l(), a("div", {
162
+ key: 0,
163
+ class: r(["truncate", e.subtitleClass])
164
+ }, h(e.subtitle), 3)) : s("", !0)
169
165
  ])
170
166
  ])
171
167
  ]),
172
- $.value ? (a(), l("div", _, [
173
- d(n.$slots, "append", {}, () => [
174
- e.appendAvatar ? (a(), l("img", {
168
+ x.value ? (l(), a("div", Y, [
169
+ o(n.$slots, "append", {}, () => [
170
+ e.appendAvatar ? (l(), a("img", {
175
171
  key: 0,
176
172
  src: e.appendAvatar,
177
173
  class: "w-8 h-8 rounded-full"
178
- }, null, 8, ee)) : s("", !0),
179
- y(e.appendIcon) ? (a(), c(v(e.appendIcon), {
174
+ }, null, 8, Z)) : s("", !0),
175
+ y(e.appendIcon) ? (l(), u(v(e.appendIcon), {
180
176
  key: 1,
181
177
  class: "w-5 h-5"
182
- })) : e.appendIcon ? (a(), l("i", {
178
+ })) : e.appendIcon ? (l(), a("i", {
183
179
  key: 2,
184
- class: u([e.appendClass, "text-xl leading-none"])
180
+ class: r([e.appendClass, "text-xl leading-none"])
185
181
  }, null, 2)) : s("", !0)
186
182
  ])
187
183
  ])) : s("", !0)
@@ -191,7 +187,7 @@ const Q = { class: "flex w-full items-center" }, T = {
191
187
  }, 1040, ["href", "aria-selected", "aria-disabled", "class", "onClick", "onKeydown"]))
192
188
  ]),
193
189
  _: 3
194
- }, 8, ["to", "replace"])) : (a(), c(v(e.tag), K({
190
+ }, 8, ["to", "replace"])) : (l(), u(v(e.tag), K({
195
191
  key: 1,
196
192
  ref_key: "liRef",
197
193
  ref: f,
@@ -203,47 +199,53 @@ const Q = { class: "flex w-full items-center" }, T = {
203
199
  onClick: g,
204
200
  onKeydown: j(R(g, ["prevent"]), ["enter"])
205
201
  }, n.$attrs), {
206
- default: x(() => [
207
- k("div", te, [
208
- B.value || n.$slots.prepend ? (a(), l("div", ne, [
209
- d(n.$slots, "prepend", {}, () => [
210
- e.prependAvatar ? (a(), l("img", {
202
+ default: B(() => [
203
+ k("div", _, [
204
+ $.value || n.$slots.prepend ? (l(), a("div", ee, [
205
+ o(n.$slots, "prepend", {}, () => [
206
+ e.prependAvatar ? (l(), a("img", {
211
207
  key: 0,
212
208
  src: e.prependAvatar,
213
- class: u(["rounded-full", e.prependClass])
214
- }, null, 10, ae)) : y(e.prependIcon) ? (a(), c(v(e.prependIcon), {
209
+ class: r(["rounded-full", e.prependClass])
210
+ }, null, 10, te)) : y(e.prependIcon) ? (l(), u(v(e.prependIcon), {
215
211
  key: 1,
216
- class: u(e.prependClass)
217
- }, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(), c(r, {
212
+ class: r(e.prependClass)
213
+ }, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (l(), u(i, {
218
214
  key: 2,
219
215
  icon: e.prependIcon,
220
- class: u(e.prependClass)
216
+ class: r(e.prependClass)
221
217
  }, null, 8, ["icon", "class"])) : s("", !0)
222
218
  ])
223
219
  ])) : s("", !0),
224
- k("div", le, [
225
- d(n.$slots, "default", {}, () => [
226
- d(n.$slots, "title", {}, () => [
227
- e.title ? (a(), l("div", se, h(e.title), 1)) : s("", !0)
220
+ k("div", ne, [
221
+ o(n.$slots, "default", {}, () => [
222
+ o(n.$slots, "title", {}, () => [
223
+ e.title ? (l(), a("div", {
224
+ key: 0,
225
+ class: r(["truncate", e.titleClass])
226
+ }, h(e.title), 3)) : s("", !0)
228
227
  ]),
229
- d(n.$slots, "subtitle", {}, () => [
230
- e.subtitle ? (a(), l("div", re, h(e.subtitle), 1)) : s("", !0)
228
+ o(n.$slots, "subtitle", {}, () => [
229
+ e.subtitle ? (l(), a("div", {
230
+ key: 0,
231
+ class: r(["truncate", e.subtitleClass])
232
+ }, h(e.subtitle), 3)) : s("", !0)
231
233
  ])
232
234
  ])
233
235
  ]),
234
- $.value ? (a(), l("div", ie, [
235
- d(n.$slots, "append", {}, () => [
236
- e.appendAvatar ? (a(), l("img", {
236
+ x.value ? (l(), a("div", le, [
237
+ o(n.$slots, "append", {}, () => [
238
+ e.appendAvatar ? (l(), a("img", {
237
239
  key: 0,
238
240
  src: e.appendAvatar,
239
241
  class: "w-8 h-8 rounded-full"
240
- }, null, 8, de)) : s("", !0),
241
- y(e.appendIcon) ? (a(), c(v(e.appendIcon), {
242
+ }, null, 8, ae)) : s("", !0),
243
+ y(e.appendIcon) ? (l(), u(v(e.appendIcon), {
242
244
  key: 1,
243
245
  class: "w-5 h-5"
244
- })) : e.appendIcon ? (a(), l("i", {
246
+ })) : e.appendIcon ? (l(), a("i", {
245
247
  key: 2,
246
- class: u([e.appendIcon, "text-xl leading-none"])
248
+ class: r([e.appendIcon, "text-xl leading-none"])
247
249
  }, null, 2)) : s("", !0)
248
250
  ])
249
251
  ])) : s("", !0)
@@ -255,5 +257,5 @@ const Q = { class: "flex w-full items-center" }, T = {
255
257
  }
256
258
  };
257
259
  export {
258
- fe as default
260
+ de as default
259
261
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.218",
3
+ "version": "0.1.219",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",