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