adverich-kun-ui 0.1.214 → 0.1.216

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