adverich-kun-ui 0.1.156 → 0.1.157
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,15 +1,29 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
1
|
+
import { ref as A, inject as p, onMounted as C, onBeforeUnmount as $, computed as o, createBlock as f, openBlock as a, resolveDynamicComponent as v, mergeProps as j, withKeys as E, withModifiers as L, withCtx as N, createElementBlock as i, createCommentVNode as r, createElementVNode as R, renderSlot as c, normalizeClass as S, toDisplayString as x } from "vue";
|
|
2
|
+
import "vue-router";
|
|
3
|
+
const K = {
|
|
3
4
|
key: 0,
|
|
4
5
|
class: "shrink-0 flex items-center gap-2 me-3"
|
|
5
|
-
}, O = ["src"], P = { class: "flex flex-col min-w-0 flex-1" },
|
|
6
|
+
}, O = ["src"], P = { class: "flex flex-col min-w-0 flex-1" }, D = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "font-medium truncate"
|
|
9
|
+
}, F = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "text-sm text-gray-500 dark:text-gray-400 truncate"
|
|
12
|
+
}, G = {
|
|
6
13
|
key: 1,
|
|
7
14
|
class: "shrink-0 flex items-center gap-2 ms-3"
|
|
8
|
-
},
|
|
15
|
+
}, M = ["src"], H = {
|
|
9
16
|
__name: "KunListItem",
|
|
10
17
|
props: {
|
|
11
18
|
value: [String, Number, Boolean, Object, Array, null],
|
|
12
19
|
to: [String, Object],
|
|
20
|
+
href: String,
|
|
21
|
+
tag: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "li"
|
|
24
|
+
},
|
|
25
|
+
replace: Boolean,
|
|
26
|
+
exact: Boolean,
|
|
13
27
|
disabled: Boolean,
|
|
14
28
|
active: Boolean,
|
|
15
29
|
activeClass: {
|
|
@@ -36,41 +50,44 @@ const E = ["aria-selected", "aria-disabled", "onKeydown"], K = {
|
|
|
36
50
|
prependIcon: [String, Object, Function],
|
|
37
51
|
appendIcon: [String, Object, Function],
|
|
38
52
|
prependAvatar: String,
|
|
39
|
-
appendAvatar: String
|
|
53
|
+
appendAvatar: String,
|
|
54
|
+
title: [String, Number, Boolean],
|
|
55
|
+
subtitle: [String, Number, Boolean]
|
|
40
56
|
},
|
|
41
57
|
setup(e) {
|
|
42
|
-
const n = e,
|
|
43
|
-
|
|
44
|
-
d &&
|
|
45
|
-
}),
|
|
58
|
+
const n = e, s = A(null), d = p("registerListItemRef", null), l = p("kunListContext", null);
|
|
59
|
+
C(() => {
|
|
60
|
+
d && s.value && d(s.value);
|
|
61
|
+
}), $(() => {
|
|
46
62
|
d && d(null);
|
|
47
63
|
});
|
|
48
|
-
const
|
|
64
|
+
const g = (t) => typeof t == "object" || typeof t == "function", I = o(() => !!(n.prependIcon || n.prependAvatar)), w = o(() => !!(n.appendIcon || n.appendAvatar)), m = o(() => {
|
|
49
65
|
var t;
|
|
50
|
-
return ((t =
|
|
51
|
-
}),
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
function p() {
|
|
56
|
-
var t, u, b;
|
|
57
|
-
n.disabled || ((t = o.value) == null || t.dispatchEvent(
|
|
66
|
+
return ((t = l == null ? void 0 : l.isSelected) == null ? void 0 : t.call(l, n.value)) ?? !1;
|
|
67
|
+
}), b = o(() => n.active), h = o(() => !!n.to), B = o(() => !!n.href);
|
|
68
|
+
function y() {
|
|
69
|
+
var t, u, k;
|
|
70
|
+
n.disabled || ((t = s.value) == null || t.dispatchEvent(
|
|
58
71
|
new CustomEvent("select", {
|
|
59
72
|
detail: n.value,
|
|
60
73
|
bubbles: !0
|
|
61
74
|
})
|
|
62
|
-
),
|
|
75
|
+
), l && n.value !== null && ((u = l.toggleItem) == null || u.call(l, n.value), (k = s.value) == null || k.dispatchEvent(
|
|
63
76
|
new CustomEvent("selected", {
|
|
64
77
|
detail: n.value,
|
|
65
78
|
bubbles: !0
|
|
66
79
|
})
|
|
67
80
|
)));
|
|
68
81
|
}
|
|
69
|
-
return (t, u) => (
|
|
82
|
+
return (t, u) => (a(), f(v(h.value ? "RouterLink" : e.tag), j({
|
|
83
|
+
to: h.value ? e.to : void 0,
|
|
84
|
+
href: B.value ? e.href : void 0,
|
|
85
|
+
replace: e.replace,
|
|
86
|
+
exact: e.exact,
|
|
70
87
|
ref_key: "liRef",
|
|
71
|
-
ref:
|
|
88
|
+
ref: s,
|
|
72
89
|
role: "option",
|
|
73
|
-
"aria-selected":
|
|
90
|
+
"aria-selected": m.value || b.value,
|
|
74
91
|
"aria-disabled": e.disabled,
|
|
75
92
|
tabindex: "-1",
|
|
76
93
|
class: ["w-full flex", [
|
|
@@ -81,54 +98,61 @@ const E = ["aria-selected", "aria-disabled", "onKeydown"], K = {
|
|
|
81
98
|
{
|
|
82
99
|
"cursor-not-allowed opacity-50": e.disabled,
|
|
83
100
|
[`cursor-pointer ${e.hoverBg}`]: !e.disabled,
|
|
84
|
-
[e.activeClass]:
|
|
101
|
+
[e.activeClass]: m.value || b.value,
|
|
85
102
|
"px-4 py-2": !e.noGutters
|
|
86
103
|
}
|
|
87
104
|
]],
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, t.$attrs),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
onClick: y,
|
|
106
|
+
onKeydown: E(L(y, ["prevent"]), ["enter"])
|
|
107
|
+
}, t.$attrs), {
|
|
108
|
+
default: N(() => [
|
|
109
|
+
I.value ? (a(), i("div", K, [
|
|
110
|
+
c(t.$slots, "prepend", {}, () => [
|
|
111
|
+
e.prependAvatar ? (a(), i("img", {
|
|
112
|
+
key: 0,
|
|
113
|
+
src: e.prependAvatar,
|
|
114
|
+
class: "w-8 h-8 rounded-full"
|
|
115
|
+
}, null, 8, O)) : r("", !0),
|
|
116
|
+
g(e.prependIcon) ? (a(), f(v(e.prependIcon), {
|
|
117
|
+
key: 1,
|
|
118
|
+
class: "w-5 h-5"
|
|
119
|
+
})) : e.prependIcon ? (a(), i("i", {
|
|
120
|
+
key: 2,
|
|
121
|
+
class: S([e.prependIcon, "text-xl leading-none"])
|
|
122
|
+
}, null, 2)) : r("", !0)
|
|
123
|
+
])
|
|
124
|
+
])) : r("", !0),
|
|
125
|
+
R("div", P, [
|
|
126
|
+
c(t.$slots, "default", {}, () => [
|
|
127
|
+
c(t.$slots, "title", {}, () => [
|
|
128
|
+
e.title ? (a(), i("div", D, x(e.title), 1)) : r("", !0)
|
|
129
|
+
]),
|
|
130
|
+
c(t.$slots, "subtitle", {}, () => [
|
|
131
|
+
e.subtitle ? (a(), i("div", F, x(e.subtitle), 1)) : r("", !0)
|
|
132
|
+
])
|
|
133
|
+
])
|
|
134
|
+
]),
|
|
135
|
+
w.value ? (a(), i("div", G, [
|
|
136
|
+
c(t.$slots, "append", {}, () => [
|
|
137
|
+
e.appendAvatar ? (a(), i("img", {
|
|
138
|
+
key: 0,
|
|
139
|
+
src: e.appendAvatar,
|
|
140
|
+
class: "w-8 h-8 rounded-full"
|
|
141
|
+
}, null, 8, M)) : r("", !0),
|
|
142
|
+
g(e.appendIcon) ? (a(), f(v(e.appendIcon), {
|
|
143
|
+
key: 1,
|
|
144
|
+
class: "w-5 h-5"
|
|
145
|
+
})) : e.appendIcon ? (a(), i("i", {
|
|
146
|
+
key: 2,
|
|
147
|
+
class: S([e.appendIcon, "text-xl leading-none"])
|
|
148
|
+
}, null, 2)) : r("", !0)
|
|
149
|
+
])
|
|
150
|
+
])) : r("", !0)
|
|
112
151
|
]),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
e.appendAvatar ? (l(), r("img", {
|
|
116
|
-
key: 0,
|
|
117
|
-
src: e.appendAvatar,
|
|
118
|
-
class: "w-8 h-8 rounded-full"
|
|
119
|
-
}, null, 8, L)) : i("", !0),
|
|
120
|
-
m(e.appendIcon) ? (l(), h(y(e.appendIcon), {
|
|
121
|
-
key: 1,
|
|
122
|
-
class: "w-5 h-5"
|
|
123
|
-
})) : e.appendIcon ? (l(), r("i", {
|
|
124
|
-
key: 2,
|
|
125
|
-
class: k([e.appendIcon, "text-xl leading-none"])
|
|
126
|
-
}, null, 2)) : i("", !0)
|
|
127
|
-
])
|
|
128
|
-
])) : i("", !0)
|
|
129
|
-
], 16, E));
|
|
152
|
+
_: 3
|
|
153
|
+
}, 16, ["to", "href", "replace", "exact", "aria-selected", "aria-disabled", "class", "onKeydown"]));
|
|
130
154
|
}
|
|
131
155
|
};
|
|
132
156
|
export {
|
|
133
|
-
|
|
157
|
+
H as default
|
|
134
158
|
};
|