adverich-kun-ui 0.1.270 → 0.1.272
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,4 +1,4 @@
|
|
|
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
|
|
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
3
|
import { RouterLink as Q } from "vue-router";
|
|
4
4
|
const T = { class: "flex w-full items-center" }, W = {
|
|
@@ -39,7 +39,6 @@ const T = { class: "flex w-full items-center" }, W = {
|
|
|
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,22 +52,22 @@ const T = { class: "flex w-full items-center" }, W = {
|
|
|
53
52
|
},
|
|
54
53
|
emits: ["click"],
|
|
55
54
|
setup(e, { emit: N }) {
|
|
56
|
-
const O = F(), t = e, P = N, f = U(null),
|
|
55
|
+
const O = F(), t = e, P = N, f = U(null), y = E("registerListItemRef", null), c = E("kunListContext", null);
|
|
57
56
|
q(() => {
|
|
58
|
-
|
|
57
|
+
y && f.value && y(f.value);
|
|
59
58
|
}), H(() => {
|
|
60
|
-
|
|
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
64
|
}), I = d(() => t.active), D = d(() => !!t.to);
|
|
66
|
-
function
|
|
67
|
-
var m,
|
|
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
72
|
const G = d(() => {
|
|
74
73
|
switch (t.variant) {
|
|
@@ -94,52 +93,54 @@ const T = { class: "flex w-full items-center" }, W = {
|
|
|
94
93
|
default:
|
|
95
94
|
return "py-3";
|
|
96
95
|
}
|
|
97
|
-
}), 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(() =>
|
|
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
|
+
...Array.isArray(l) ? l : [l],
|
|
100
|
+
re,
|
|
101
|
+
G.value,
|
|
102
|
+
M.value,
|
|
103
|
+
V.value,
|
|
104
|
+
z.value,
|
|
105
|
+
t.bgItems,
|
|
106
|
+
t.textColor,
|
|
107
|
+
t.itemPosition,
|
|
108
|
+
{
|
|
109
|
+
"cursor-not-allowed opacity-50": t.disabled,
|
|
110
|
+
[`cursor-pointer ${t.hoverBg}`]: t.selectable && !t.disabled,
|
|
111
|
+
[t.activeClass]: C.value || I.value,
|
|
112
|
+
"px-4": !t.noGutters
|
|
113
|
+
}
|
|
114
|
+
];
|
|
115
|
+
});
|
|
115
116
|
return (l, S) => D.value ? (n(), u(J(Q), {
|
|
116
117
|
key: 0,
|
|
117
118
|
to: e.to,
|
|
118
119
|
replace: e.replace,
|
|
119
120
|
custom: !0
|
|
120
121
|
}, {
|
|
121
|
-
default:
|
|
122
|
+
default: A(({ href: i, navigate: m, isActive: g }) => [
|
|
122
123
|
(n(), u(v(e.tag), j({
|
|
123
124
|
ref_key: "liRef",
|
|
124
125
|
ref: f,
|
|
125
126
|
href: i,
|
|
126
127
|
role: "option",
|
|
127
|
-
"aria-selected": C.value || I.value ||
|
|
128
|
+
"aria-selected": C.value || I.value || g,
|
|
128
129
|
"aria-disabled": e.disabled,
|
|
129
130
|
tabindex: "-1",
|
|
130
131
|
class: x.value,
|
|
131
|
-
onClick: (w) =>
|
|
132
|
-
onKeydown: K(R((w) =>
|
|
132
|
+
onClick: (w) => b(w, m),
|
|
133
|
+
onKeydown: K(R((w) => b(w, m), ["prevent"]), ["enter"])
|
|
133
134
|
}, l.$attrs), {
|
|
134
|
-
default:
|
|
135
|
+
default: A(() => [
|
|
135
136
|
k("div", T, [
|
|
136
|
-
|
|
137
|
+
B.value || l.$slots.prepend ? (n(), a("div", W, [
|
|
137
138
|
o(l.$slots, "prepend", {}, () => [
|
|
138
139
|
e.prependAvatar ? (n(), a("img", {
|
|
139
140
|
key: 0,
|
|
140
141
|
src: e.prependAvatar,
|
|
141
142
|
class: r(["rounded-full", e.prependClass])
|
|
142
|
-
}, null, 10, X)) :
|
|
143
|
+
}, null, 10, X)) : p(e.prependIcon) ? (n(), u(v(e.prependIcon), {
|
|
143
144
|
key: 1,
|
|
144
145
|
class: r(e.prependClass)
|
|
145
146
|
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (n(), u(L, {
|
|
@@ -165,14 +166,14 @@ const T = { class: "flex w-full items-center" }, W = {
|
|
|
165
166
|
])
|
|
166
167
|
])
|
|
167
168
|
]),
|
|
168
|
-
|
|
169
|
+
$.value ? (n(), a("div", Z, [
|
|
169
170
|
o(l.$slots, "append", {}, () => [
|
|
170
171
|
e.appendAvatar ? (n(), a("img", {
|
|
171
172
|
key: 0,
|
|
172
173
|
src: e.appendAvatar,
|
|
173
174
|
class: "w-8 h-8 rounded-full"
|
|
174
175
|
}, null, 8, _)) : s("", !0),
|
|
175
|
-
|
|
176
|
+
p(e.appendIcon) ? (n(), u(v(e.appendIcon), {
|
|
176
177
|
key: 1,
|
|
177
178
|
class: "w-5 h-5"
|
|
178
179
|
})) : e.appendIcon ? (n(), a("i", {
|
|
@@ -196,18 +197,18 @@ const T = { class: "flex w-full items-center" }, W = {
|
|
|
196
197
|
"aria-disabled": e.disabled,
|
|
197
198
|
tabindex: "-1",
|
|
198
199
|
class: x.value,
|
|
199
|
-
onClick:
|
|
200
|
-
onKeydown: K(R(
|
|
200
|
+
onClick: b,
|
|
201
|
+
onKeydown: K(R(b, ["prevent"]), ["enter"])
|
|
201
202
|
}, l.$attrs), {
|
|
202
|
-
default:
|
|
203
|
+
default: A(() => [
|
|
203
204
|
k("div", ee, [
|
|
204
|
-
|
|
205
|
+
B.value || l.$slots.prepend ? (n(), a("div", te, [
|
|
205
206
|
o(l.$slots, "prepend", {}, () => [
|
|
206
207
|
e.prependAvatar ? (n(), a("img", {
|
|
207
208
|
key: 0,
|
|
208
209
|
src: e.prependAvatar,
|
|
209
210
|
class: r(["rounded-full", e.prependClass])
|
|
210
|
-
}, null, 10, le)) :
|
|
211
|
+
}, null, 10, le)) : p(e.prependIcon) ? (n(), u(v(e.prependIcon), {
|
|
211
212
|
key: 1,
|
|
212
213
|
class: r(e.prependClass)
|
|
213
214
|
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (n(), u(L, {
|
|
@@ -233,14 +234,14 @@ const T = { class: "flex w-full items-center" }, W = {
|
|
|
233
234
|
])
|
|
234
235
|
])
|
|
235
236
|
]),
|
|
236
|
-
|
|
237
|
+
$.value ? (n(), a("div", ae, [
|
|
237
238
|
o(l.$slots, "append", {}, () => [
|
|
238
239
|
e.appendAvatar ? (n(), a("img", {
|
|
239
240
|
key: 0,
|
|
240
241
|
src: e.appendAvatar,
|
|
241
242
|
class: "w-8 h-8 rounded-full"
|
|
242
243
|
}, null, 8, se)) : s("", !0),
|
|
243
|
-
|
|
244
|
+
p(e.appendIcon) ? (n(), u(v(e.appendIcon), {
|
|
244
245
|
key: 1,
|
|
245
246
|
class: "w-5 h-5"
|
|
246
247
|
})) : e.appendIcon ? (n(), a("i", {
|