adverich-kun-ui 0.1.269 → 0.1.271
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.
|
@@ -11,14 +11,8 @@ const R = {
|
|
|
11
11
|
default: "single",
|
|
12
12
|
validator: (o) => ["single", "multiple"].includes(o)
|
|
13
13
|
},
|
|
14
|
-
bgList: {
|
|
15
|
-
|
|
16
|
-
default: "bg-transparent"
|
|
17
|
-
},
|
|
18
|
-
borderColor: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "border-gray-300 dark:border-gray-700"
|
|
21
|
-
}
|
|
14
|
+
bgList: { type: String, default: "bg-transparent" },
|
|
15
|
+
borderColor: { type: String, default: "border-gray-300 dark:border-gray-700" }
|
|
22
16
|
}, {
|
|
23
17
|
selected: {
|
|
24
18
|
type: [Array, String, Number, Object, null],
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { useAttrs as F, ref as U, inject as E, onMounted as q, onBeforeUnmount as H, computed as d, createBlock as u, openBlock as n, unref as J, withCtx as A, resolveDynamicComponent as v, mergeProps as j, withKeys as K, 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 L from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
3
|
-
import { RouterLink as
|
|
4
|
-
const
|
|
3
|
+
import { RouterLink as Q } from "vue-router";
|
|
4
|
+
const T = { class: "flex w-full items-center" }, W = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "shrink-0 flex items-center gap-2 me-2"
|
|
7
|
-
},
|
|
7
|
+
}, X = ["src"], Y = { class: "flex flex-col min-w-0 flex-1" }, Z = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "shrink-0 flex items-center gap-2 ms-3"
|
|
10
|
-
},
|
|
10
|
+
}, _ = ["src"], ee = { class: "flex w-full items-center" }, te = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "shrink-0 flex items-center gap-2 me-2"
|
|
13
|
-
},
|
|
13
|
+
}, le = ["src"], ne = { class: "flex flex-col min-w-0 flex-1" }, ae = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "shrink-0 flex items-center gap-2 ms-3"
|
|
16
|
-
},
|
|
16
|
+
}, se = ["src"], re = "w-full flex transition duration-150 ease-in-out", ce = {
|
|
17
17
|
__name: "KunListItem",
|
|
18
18
|
props: {
|
|
19
19
|
value: [String, Number, Boolean, Object, Array, null],
|
|
@@ -39,7 +39,6 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
39
39
|
hoverBg: { type: String, default: "hover:bg-gray-100 dark:hover:bg-gray-600" },
|
|
40
40
|
noGutters: Boolean,
|
|
41
41
|
itemPosition: { type: String, default: "items-start" },
|
|
42
|
-
itemClass: String,
|
|
43
42
|
prependIcon: [String, Object, Function],
|
|
44
43
|
prependAvatar: String,
|
|
45
44
|
prependClass: String,
|
|
@@ -53,24 +52,24 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
53
52
|
},
|
|
54
53
|
emits: ["click"],
|
|
55
54
|
setup(e, { emit: N }) {
|
|
56
|
-
const t = e,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}),
|
|
60
|
-
|
|
55
|
+
const O = F(), t = e, P = N, f = U(null), y = E("registerListItemRef", null), c = E("kunListContext", null);
|
|
56
|
+
q(() => {
|
|
57
|
+
y && f.value && y(f.value);
|
|
58
|
+
}), H(() => {
|
|
59
|
+
y && y(null);
|
|
61
60
|
});
|
|
62
|
-
const
|
|
61
|
+
const p = (l) => typeof l == "object" || typeof l == "function", B = d(() => !!(t.prependIcon || t.prependAvatar)), $ = d(() => !!(t.appendIcon || t.appendAvatar)), C = d(() => {
|
|
63
62
|
var l;
|
|
64
63
|
return ((l = c == null ? void 0 : c.isSelected) == null ? void 0 : l.call(c, t.value)) ?? !1;
|
|
65
|
-
}), I = d(() => t.active),
|
|
66
|
-
function
|
|
67
|
-
var m,
|
|
64
|
+
}), I = d(() => t.active), D = d(() => !!t.to);
|
|
65
|
+
function b(l, S = null) {
|
|
66
|
+
var m, g;
|
|
68
67
|
if (t.disabled) return;
|
|
69
|
-
|
|
68
|
+
P("click", l);
|
|
70
69
|
const i = ((m = f.value) == null ? void 0 : m.$el) ?? f.value;
|
|
71
|
-
i != null && i.dispatchEvent && i.dispatchEvent(new CustomEvent("select", { detail: t.value, bubbles: !0 })), c && t.selectable && t.value !== null && ((
|
|
70
|
+
i != null && i.dispatchEvent && i.dispatchEvent(new CustomEvent("select", { detail: t.value, bubbles: !0 })), c && t.selectable && t.value !== null && ((g = c.toggleItem) == null || g.call(c, t.value), i != null && i.dispatchEvent && i.dispatchEvent(new CustomEvent("selected", { detail: t.value, bubbles: !0 }))), S && S(l);
|
|
72
71
|
}
|
|
73
|
-
const
|
|
72
|
+
const G = d(() => {
|
|
74
73
|
switch (t.variant) {
|
|
75
74
|
case "outlined":
|
|
76
75
|
return "border border-gray-300 dark:border-gray-700";
|
|
@@ -85,7 +84,7 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
85
84
|
default:
|
|
86
85
|
return "";
|
|
87
86
|
}
|
|
88
|
-
}),
|
|
87
|
+
}), M = d(() => {
|
|
89
88
|
switch (t.density) {
|
|
90
89
|
case "comfortable":
|
|
91
90
|
return "py-2";
|
|
@@ -94,51 +93,54 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
94
93
|
default:
|
|
95
94
|
return "py-3";
|
|
96
95
|
}
|
|
97
|
-
}),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
96
|
+
}), V = d(() => t.tile ? "rounded-none" : t.rounded === !0 ? "rounded-md" : t.rounded === !1 ? "" : `rounded-${t.rounded}`), z = d(() => t.ripple ? "relative overflow-hidden" : ""), x = d(() => {
|
|
97
|
+
const l = O.class;
|
|
98
|
+
return [
|
|
99
|
+
re,
|
|
100
|
+
G.value,
|
|
101
|
+
M.value,
|
|
102
|
+
V.value,
|
|
103
|
+
z.value,
|
|
104
|
+
t.bgItems,
|
|
105
|
+
t.textColor,
|
|
106
|
+
t.itemPosition,
|
|
107
|
+
{
|
|
108
|
+
"cursor-not-allowed opacity-50": t.disabled,
|
|
109
|
+
[`cursor-pointer ${t.hoverBg}`]: t.selectable && !t.disabled,
|
|
110
|
+
[t.activeClass]: C.value || I.value,
|
|
111
|
+
"px-4": !t.noGutters
|
|
112
|
+
},
|
|
113
|
+
...Array.isArray(l) ? l : [l]
|
|
114
|
+
];
|
|
115
|
+
});
|
|
116
|
+
return (l, S) => D.value ? (n(), u(J(Q), {
|
|
115
117
|
key: 0,
|
|
116
118
|
to: e.to,
|
|
117
119
|
replace: e.replace,
|
|
118
120
|
custom: !0
|
|
119
121
|
}, {
|
|
120
|
-
default:
|
|
122
|
+
default: A(({ href: i, navigate: m, isActive: g }) => [
|
|
121
123
|
(n(), u(v(e.tag), j({
|
|
122
124
|
ref_key: "liRef",
|
|
123
125
|
ref: f,
|
|
124
126
|
href: i,
|
|
125
127
|
role: "option",
|
|
126
|
-
"aria-selected": C.value || I.value ||
|
|
128
|
+
"aria-selected": C.value || I.value || g,
|
|
127
129
|
"aria-disabled": e.disabled,
|
|
128
130
|
tabindex: "-1",
|
|
129
|
-
class:
|
|
130
|
-
onClick: (w) =>
|
|
131
|
-
onKeydown: K(R((w) =>
|
|
131
|
+
class: x.value,
|
|
132
|
+
onClick: (w) => b(w, m),
|
|
133
|
+
onKeydown: K(R((w) => b(w, m), ["prevent"]), ["enter"])
|
|
132
134
|
}, l.$attrs), {
|
|
133
|
-
default:
|
|
134
|
-
k("div",
|
|
135
|
-
|
|
135
|
+
default: A(() => [
|
|
136
|
+
k("div", T, [
|
|
137
|
+
B.value || l.$slots.prepend ? (n(), a("div", W, [
|
|
136
138
|
o(l.$slots, "prepend", {}, () => [
|
|
137
139
|
e.prependAvatar ? (n(), a("img", {
|
|
138
140
|
key: 0,
|
|
139
141
|
src: e.prependAvatar,
|
|
140
142
|
class: r(["rounded-full", e.prependClass])
|
|
141
|
-
}, null, 10,
|
|
143
|
+
}, null, 10, X)) : p(e.prependIcon) ? (n(), u(v(e.prependIcon), {
|
|
142
144
|
key: 1,
|
|
143
145
|
class: r(e.prependClass)
|
|
144
146
|
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (n(), u(L, {
|
|
@@ -148,7 +150,7 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
148
150
|
}, null, 8, ["icon", "class"])) : s("", !0)
|
|
149
151
|
])
|
|
150
152
|
])) : s("", !0),
|
|
151
|
-
k("div",
|
|
153
|
+
k("div", Y, [
|
|
152
154
|
o(l.$slots, "default", {}, () => [
|
|
153
155
|
o(l.$slots, "title", {}, () => [
|
|
154
156
|
e.title ? (n(), a("div", {
|
|
@@ -164,14 +166,14 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
164
166
|
])
|
|
165
167
|
])
|
|
166
168
|
]),
|
|
167
|
-
|
|
169
|
+
$.value ? (n(), a("div", Z, [
|
|
168
170
|
o(l.$slots, "append", {}, () => [
|
|
169
171
|
e.appendAvatar ? (n(), a("img", {
|
|
170
172
|
key: 0,
|
|
171
173
|
src: e.appendAvatar,
|
|
172
174
|
class: "w-8 h-8 rounded-full"
|
|
173
|
-
}, null, 8,
|
|
174
|
-
|
|
175
|
+
}, null, 8, _)) : s("", !0),
|
|
176
|
+
p(e.appendIcon) ? (n(), u(v(e.appendIcon), {
|
|
175
177
|
key: 1,
|
|
176
178
|
class: "w-5 h-5"
|
|
177
179
|
})) : e.appendIcon ? (n(), a("i", {
|
|
@@ -194,19 +196,19 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
194
196
|
"aria-selected": C.value || I.value,
|
|
195
197
|
"aria-disabled": e.disabled,
|
|
196
198
|
tabindex: "-1",
|
|
197
|
-
class:
|
|
198
|
-
onClick:
|
|
199
|
-
onKeydown: K(R(
|
|
199
|
+
class: x.value,
|
|
200
|
+
onClick: b,
|
|
201
|
+
onKeydown: K(R(b, ["prevent"]), ["enter"])
|
|
200
202
|
}, l.$attrs), {
|
|
201
|
-
default:
|
|
202
|
-
k("div",
|
|
203
|
-
|
|
203
|
+
default: A(() => [
|
|
204
|
+
k("div", ee, [
|
|
205
|
+
B.value || l.$slots.prepend ? (n(), a("div", te, [
|
|
204
206
|
o(l.$slots, "prepend", {}, () => [
|
|
205
207
|
e.prependAvatar ? (n(), a("img", {
|
|
206
208
|
key: 0,
|
|
207
209
|
src: e.prependAvatar,
|
|
208
210
|
class: r(["rounded-full", e.prependClass])
|
|
209
|
-
}, null, 10,
|
|
211
|
+
}, null, 10, le)) : p(e.prependIcon) ? (n(), u(v(e.prependIcon), {
|
|
210
212
|
key: 1,
|
|
211
213
|
class: r(e.prependClass)
|
|
212
214
|
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (n(), u(L, {
|
|
@@ -216,7 +218,7 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
216
218
|
}, null, 8, ["icon", "class"])) : s("", !0)
|
|
217
219
|
])
|
|
218
220
|
])) : s("", !0),
|
|
219
|
-
k("div",
|
|
221
|
+
k("div", ne, [
|
|
220
222
|
o(l.$slots, "default", {}, () => [
|
|
221
223
|
o(l.$slots, "title", {}, () => [
|
|
222
224
|
e.title ? (n(), a("div", {
|
|
@@ -232,14 +234,14 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
232
234
|
])
|
|
233
235
|
])
|
|
234
236
|
]),
|
|
235
|
-
|
|
237
|
+
$.value ? (n(), a("div", ae, [
|
|
236
238
|
o(l.$slots, "append", {}, () => [
|
|
237
239
|
e.appendAvatar ? (n(), a("img", {
|
|
238
240
|
key: 0,
|
|
239
241
|
src: e.appendAvatar,
|
|
240
242
|
class: "w-8 h-8 rounded-full"
|
|
241
|
-
}, null, 8,
|
|
242
|
-
|
|
243
|
+
}, null, 8, se)) : s("", !0),
|
|
244
|
+
p(e.appendIcon) ? (n(), u(v(e.appendIcon), {
|
|
243
245
|
key: 1,
|
|
244
246
|
class: "w-5 h-5"
|
|
245
247
|
})) : e.appendIcon ? (n(), a("i", {
|
|
@@ -255,5 +257,5 @@ const J = { class: "flex w-full items-center" }, Q = {
|
|
|
255
257
|
}
|
|
256
258
|
};
|
|
257
259
|
export {
|
|
258
|
-
|
|
260
|
+
ce as default
|
|
259
261
|
};
|