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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
|
|
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),
|
|
55
|
+
const t = e, N = L, f = z(null), p = E("registerListItemRef", null), c = E("kunListContext", null);
|
|
66
56
|
F(() => {
|
|
67
|
-
|
|
57
|
+
p && f.value && p(f.value);
|
|
68
58
|
}), U(() => {
|
|
69
|
-
|
|
59
|
+
p && p(null);
|
|
70
60
|
});
|
|
71
|
-
const y = (n) => typeof n == "object" || typeof n == "function",
|
|
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 =
|
|
74
|
-
}), I =
|
|
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,
|
|
66
|
+
var b, m;
|
|
77
67
|
if (t.disabled) return;
|
|
78
68
|
N("click", n);
|
|
79
|
-
const
|
|
80
|
-
|
|
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 =
|
|
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 =
|
|
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 =
|
|
107
|
-
|
|
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
|
|
125
|
-
return O.value ? (
|
|
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:
|
|
132
|
-
(
|
|
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,
|
|
142
|
-
onKeydown: j(R((w) => g(w,
|
|
131
|
+
onClick: (w) => g(w, m),
|
|
132
|
+
onKeydown: j(R((w) => g(w, m), ["prevent"]), ["enter"])
|
|
143
133
|
}, n.$attrs), {
|
|
144
|
-
default:
|
|
134
|
+
default: B(() => [
|
|
145
135
|
k("div", Q, [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
e.prependAvatar ? (
|
|
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:
|
|
152
|
-
}, null, 10, W)) : y(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:
|
|
155
|
-
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (
|
|
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:
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
e.title ? (
|
|
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
|
-
|
|
168
|
-
e.subtitle ? (
|
|
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
|
-
|
|
173
|
-
|
|
174
|
-
e.appendAvatar ? (
|
|
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,
|
|
179
|
-
y(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 ? (
|
|
178
|
+
})) : e.appendIcon ? (l(), a("i", {
|
|
183
179
|
key: 2,
|
|
184
|
-
class:
|
|
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"])) : (
|
|
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:
|
|
207
|
-
k("div",
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
e.prependAvatar ? (
|
|
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:
|
|
214
|
-
}, null, 10,
|
|
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:
|
|
217
|
-
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (
|
|
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:
|
|
216
|
+
class: r(e.prependClass)
|
|
221
217
|
}, null, 8, ["icon", "class"])) : s("", !0)
|
|
222
218
|
])
|
|
223
219
|
])) : s("", !0),
|
|
224
|
-
k("div",
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
e.title ? (
|
|
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
|
-
|
|
230
|
-
e.subtitle ? (
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
e.appendAvatar ? (
|
|
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,
|
|
241
|
-
y(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 ? (
|
|
246
|
+
})) : e.appendIcon ? (l(), a("i", {
|
|
245
247
|
key: 2,
|
|
246
|
-
class:
|
|
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
|
-
|
|
260
|
+
de as default
|
|
259
261
|
};
|