adverich-kun-ui 0.1.214 → 0.1.215
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,16 +1,13 @@
|
|
|
1
|
-
import { ref as V, inject as
|
|
1
|
+
import { ref as V, inject as $, 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 E, withKeys as j, withModifiers as K, createElementVNode as m, renderSlot as d, createElementBlock as l, createCommentVNode as s, normalizeClass as h, toDisplayString as k } from "vue";
|
|
2
2
|
import { RouterLink as q } from "vue-router";
|
|
3
|
-
const H = { class: "flex w-full items-center" }, J = {
|
|
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 = {
|
|
3
|
+
const H = { class: "flex w-full items-center" }, J = { class: "shrink-0 flex items-center gap-2 me-3" }, Q = ["src"], T = { class: "flex flex-col min-w-0 flex-1" }, W = {
|
|
7
4
|
key: 0,
|
|
8
5
|
class: "font-medium truncate"
|
|
9
6
|
}, X = {
|
|
10
7
|
key: 0,
|
|
11
8
|
class: "text-sm text-gray-500 dark:text-gray-400 truncate"
|
|
12
9
|
}, Y = {
|
|
13
|
-
key:
|
|
10
|
+
key: 0,
|
|
14
11
|
class: "shrink-0 flex items-center gap-2 ms-3"
|
|
15
12
|
}, Z = ["src"], _ = { class: "flex w-full items-center" }, ee = {
|
|
16
13
|
key: 0,
|
|
@@ -52,30 +49,32 @@ const H = { class: "flex w-full items-center" }, J = {
|
|
|
52
49
|
itemPosition: { type: String, default: "items-start" },
|
|
53
50
|
itemClass: String,
|
|
54
51
|
prependIcon: [String, Object, Function],
|
|
55
|
-
appendIcon: [String, Object, Function],
|
|
56
52
|
prependAvatar: String,
|
|
53
|
+
prependClass: String,
|
|
54
|
+
appendIcon: [String, Object, Function],
|
|
57
55
|
appendAvatar: String,
|
|
56
|
+
appendClass: String,
|
|
58
57
|
title: [String, Number, Boolean],
|
|
59
58
|
subtitle: [String, Number, Boolean]
|
|
60
59
|
},
|
|
61
60
|
emits: ["click"],
|
|
62
|
-
setup(e, { emit:
|
|
63
|
-
const t = e,
|
|
61
|
+
setup(e, { emit: R }) {
|
|
62
|
+
const t = e, L = R, u = V(null), g = $("registerListItemRef", null), o = $("kunListContext", null);
|
|
64
63
|
z(() => {
|
|
65
|
-
|
|
64
|
+
g && u.value && g(u.value);
|
|
66
65
|
}), F(() => {
|
|
67
|
-
|
|
66
|
+
g && g(null);
|
|
68
67
|
});
|
|
69
|
-
const
|
|
68
|
+
const p = (a) => typeof a == "object" || typeof a == "function", N = i(() => !!(t.prependIcon || t.prependAvatar)), B = i(() => !!(t.appendIcon || t.appendAvatar)), w = i(() => {
|
|
70
69
|
var a;
|
|
71
70
|
return ((a = o == null ? void 0 : o.isSelected) == null ? void 0 : a.call(o, t.value)) ?? !1;
|
|
72
71
|
}), I = i(() => t.active), O = i(() => !!t.to);
|
|
73
|
-
function
|
|
74
|
-
var v,
|
|
72
|
+
function y(a, x = null) {
|
|
73
|
+
var v, b;
|
|
75
74
|
if (t.disabled) return;
|
|
76
|
-
|
|
75
|
+
L("click", a);
|
|
77
76
|
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 && ((
|
|
77
|
+
r != null && r.dispatchEvent && r.dispatchEvent(new CustomEvent("select", { detail: t.value, bubbles: !0 })), o && t.selectable && t.value !== null && ((b = o.toggleItem) == null || b.call(o, t.value), r != null && r.dispatchEvent && r.dispatchEvent(new CustomEvent("selected", { detail: t.value, bubbles: !0 }))), x && x(a);
|
|
79
78
|
}
|
|
80
79
|
const P = i(() => {
|
|
81
80
|
switch (t.variant) {
|
|
@@ -101,7 +100,7 @@ const H = { class: "flex w-full items-center" }, J = {
|
|
|
101
100
|
default:
|
|
102
101
|
return "py-3";
|
|
103
102
|
}
|
|
104
|
-
}), G = i(() => t.tile ? "rounded-none" : t.rounded === !0 ? "rounded-md" : t.rounded === !1 ? "" : `rounded-${t.rounded}`), M = i(() => t.ripple ? "relative overflow-hidden" : ""),
|
|
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" : ""), A = i(() => [
|
|
105
104
|
ie,
|
|
106
105
|
P.value,
|
|
107
106
|
D.value,
|
|
@@ -124,38 +123,38 @@ const H = { class: "flex w-full items-center" }, J = {
|
|
|
124
123
|
replace: e.replace,
|
|
125
124
|
custom: !0
|
|
126
125
|
}, {
|
|
127
|
-
default: C(({ href: r, navigate: v, isActive:
|
|
128
|
-
(n(), c(f(e.tag),
|
|
126
|
+
default: C(({ href: r, navigate: v, isActive: b }) => [
|
|
127
|
+
(n(), c(f(e.tag), E({
|
|
129
128
|
ref_key: "liRef",
|
|
130
129
|
ref: u,
|
|
131
130
|
href: r,
|
|
132
131
|
role: "option",
|
|
133
|
-
"aria-selected": w.value || I.value ||
|
|
132
|
+
"aria-selected": w.value || I.value || b,
|
|
134
133
|
"aria-disabled": e.disabled,
|
|
135
134
|
tabindex: "-1",
|
|
136
|
-
class:
|
|
137
|
-
onClick: (S) =>
|
|
138
|
-
onKeydown: K(
|
|
135
|
+
class: A.value,
|
|
136
|
+
onClick: (S) => y(S, v),
|
|
137
|
+
onKeydown: j(K((S) => y(S, v), ["prevent"]), ["enter"])
|
|
139
138
|
}, a.$attrs), {
|
|
140
139
|
default: C(() => [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
m("div", H, [
|
|
141
|
+
d(a.$slots, "prepend", {}, () => [
|
|
142
|
+
m("div", J, [
|
|
144
143
|
e.prependAvatar ? (n(), l("img", {
|
|
145
144
|
key: 0,
|
|
146
145
|
src: e.prependAvatar,
|
|
147
146
|
class: "w-8 h-8 rounded-full"
|
|
148
147
|
}, null, 8, Q)) : s("", !0),
|
|
149
|
-
|
|
148
|
+
p(e.prependIcon) ? (n(), c(f(e.prependIcon), {
|
|
150
149
|
key: 1,
|
|
151
150
|
class: "w-5 h-5"
|
|
152
151
|
})) : e.prependIcon ? (n(), l("i", {
|
|
153
152
|
key: 2,
|
|
154
|
-
class: h([e.
|
|
153
|
+
class: h([e.prependClass, "text-xl leading-none"])
|
|
155
154
|
}, null, 2)) : s("", !0)
|
|
156
155
|
])
|
|
157
|
-
])
|
|
158
|
-
|
|
156
|
+
]),
|
|
157
|
+
m("div", T, [
|
|
159
158
|
d(a.$slots, "default", {}, () => [
|
|
160
159
|
d(a.$slots, "title", {}, () => [
|
|
161
160
|
e.title ? (n(), l("div", W, k(e.title), 1)) : s("", !0)
|
|
@@ -165,19 +164,19 @@ const H = { class: "flex w-full items-center" }, J = {
|
|
|
165
164
|
])
|
|
166
165
|
])
|
|
167
166
|
]),
|
|
168
|
-
|
|
167
|
+
B.value ? (n(), l("div", Y, [
|
|
169
168
|
d(a.$slots, "append", {}, () => [
|
|
170
169
|
e.appendAvatar ? (n(), l("img", {
|
|
171
170
|
key: 0,
|
|
172
171
|
src: e.appendAvatar,
|
|
173
172
|
class: "w-8 h-8 rounded-full"
|
|
174
173
|
}, null, 8, Z)) : s("", !0),
|
|
175
|
-
|
|
174
|
+
p(e.appendIcon) ? (n(), c(f(e.appendIcon), {
|
|
176
175
|
key: 1,
|
|
177
176
|
class: "w-5 h-5"
|
|
178
177
|
})) : e.appendIcon ? (n(), l("i", {
|
|
179
178
|
key: 2,
|
|
180
|
-
class: h([e.
|
|
179
|
+
class: h([e.appendClass, "text-xl leading-none"])
|
|
181
180
|
}, null, 2)) : s("", !0)
|
|
182
181
|
])
|
|
183
182
|
])) : s("", !0)
|
|
@@ -187,7 +186,7 @@ const H = { class: "flex w-full items-center" }, J = {
|
|
|
187
186
|
}, 1040, ["href", "aria-selected", "aria-disabled", "class", "onClick", "onKeydown"]))
|
|
188
187
|
]),
|
|
189
188
|
_: 3
|
|
190
|
-
}, 8, ["to", "replace"])) : (n(), c(f(e.tag),
|
|
189
|
+
}, 8, ["to", "replace"])) : (n(), c(f(e.tag), E({
|
|
191
190
|
key: 1,
|
|
192
191
|
ref_key: "liRef",
|
|
193
192
|
ref: u,
|
|
@@ -195,20 +194,20 @@ const H = { class: "flex w-full items-center" }, J = {
|
|
|
195
194
|
"aria-selected": w.value || I.value,
|
|
196
195
|
"aria-disabled": e.disabled,
|
|
197
196
|
tabindex: "-1",
|
|
198
|
-
class:
|
|
199
|
-
onClick:
|
|
200
|
-
onKeydown: K(
|
|
197
|
+
class: A.value,
|
|
198
|
+
onClick: y,
|
|
199
|
+
onKeydown: j(K(y, ["prevent"]), ["enter"])
|
|
201
200
|
}, a.$attrs), {
|
|
202
201
|
default: C(() => [
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
m("div", _, [
|
|
203
|
+
N.value ? (n(), l("div", ee, [
|
|
205
204
|
d(a.$slots, "prepend", {}, () => [
|
|
206
205
|
e.prependAvatar ? (n(), l("img", {
|
|
207
206
|
key: 0,
|
|
208
207
|
src: e.prependAvatar,
|
|
209
208
|
class: "w-8 h-8 rounded-full"
|
|
210
209
|
}, null, 8, te)) : s("", !0),
|
|
211
|
-
|
|
210
|
+
p(e.prependIcon) ? (n(), c(f(e.prependIcon), {
|
|
212
211
|
key: 1,
|
|
213
212
|
class: "w-5 h-5"
|
|
214
213
|
})) : e.prependIcon ? (n(), l("i", {
|
|
@@ -217,7 +216,7 @@ const H = { class: "flex w-full items-center" }, J = {
|
|
|
217
216
|
}, null, 2)) : s("", !0)
|
|
218
217
|
])
|
|
219
218
|
])) : s("", !0),
|
|
220
|
-
|
|
219
|
+
m("div", ne, [
|
|
221
220
|
d(a.$slots, "default", {}, () => [
|
|
222
221
|
d(a.$slots, "title", {}, () => [
|
|
223
222
|
e.title ? (n(), l("div", ae, k(e.title), 1)) : s("", !0)
|
|
@@ -227,14 +226,14 @@ const H = { class: "flex w-full items-center" }, J = {
|
|
|
227
226
|
])
|
|
228
227
|
])
|
|
229
228
|
]),
|
|
230
|
-
|
|
229
|
+
B.value ? (n(), l("div", se, [
|
|
231
230
|
d(a.$slots, "append", {}, () => [
|
|
232
231
|
e.appendAvatar ? (n(), l("img", {
|
|
233
232
|
key: 0,
|
|
234
233
|
src: e.appendAvatar,
|
|
235
234
|
class: "w-8 h-8 rounded-full"
|
|
236
235
|
}, null, 8, re)) : s("", !0),
|
|
237
|
-
|
|
236
|
+
p(e.appendIcon) ? (n(), c(f(e.appendIcon), {
|
|
238
237
|
key: 1,
|
|
239
238
|
class: "w-5 h-5"
|
|
240
239
|
})) : e.appendIcon ? (n(), l("i", {
|