adverich-kun-ui 0.1.393 → 0.1.395
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,53 +1,107 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { kunCardProps as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { computed as f, resolveComponent as S, createBlock as n, openBlock as l, withCtx as o, resolveDynamicComponent as m, mergeProps as k, createElementBlock as i, createCommentVNode as r, createVNode as s, renderSlot as u } from "vue";
|
|
2
|
+
import { kunCardProps as _ } from "../composables/kunCardProps.js";
|
|
3
|
+
import a from "../../../KunCardItem/src/components/KunCardItem.vue.js";
|
|
4
|
+
import p from "../../../KunCardTitle/src/components/KunCardTitle.vue.js";
|
|
5
|
+
import $ from "../../../KunCardText/src/components/KunCardText.vue.js";
|
|
6
|
+
import c from "../../../KunCardActions/src/components/KunCardActions.vue.js";
|
|
7
|
+
const z = { key: 0 }, g = { key: 1 }, w = { key: 2 }, B = { key: 0 }, L = { key: 1 }, j = { key: 2 }, E = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
8
8
|
__name: "KunCard",
|
|
9
|
-
props:
|
|
10
|
-
setup(
|
|
11
|
-
const t =
|
|
9
|
+
props: _,
|
|
10
|
+
setup(h) {
|
|
11
|
+
const t = h, d = f(() => [
|
|
12
12
|
"w-full",
|
|
13
13
|
t.bgColor,
|
|
14
14
|
t.textColor || "text-black",
|
|
15
15
|
t.outlined ? `border ${t.outlineColor}` : "",
|
|
16
16
|
t.rounded === !0 ? "rounded-lg" : t.rounded ? `rounded-${t.rounded}` : "",
|
|
17
17
|
t.flat ? "shadow-none" : `shadow-${t.elevation}`
|
|
18
|
-
].filter(Boolean).join(" "));
|
|
19
|
-
return (e,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
18
|
+
].filter(Boolean).join(" ")), v = f(() => !!(t.to || t.href));
|
|
19
|
+
return (e, K) => {
|
|
20
|
+
const y = S("RouterLink");
|
|
21
|
+
return v.value ? (l(), n(y, {
|
|
22
|
+
key: 0,
|
|
23
|
+
to: t.to,
|
|
24
|
+
replace: t.replace,
|
|
25
|
+
custom: !0
|
|
26
|
+
}, {
|
|
27
|
+
default: o(({ href: C, navigate: b }) => [
|
|
28
|
+
(l(), n(m("a"), k({
|
|
29
|
+
href: C,
|
|
30
|
+
class: d.value
|
|
31
|
+
}, e.$attrs, { onClick: b }), {
|
|
32
|
+
default: o(() => [
|
|
33
|
+
e.$slots.title || e.title || e.subtitle ? (l(), i("div", z, [
|
|
34
|
+
s(a, { dense: "" }, {
|
|
35
|
+
default: o(() => [
|
|
36
|
+
s(p, {
|
|
37
|
+
title: e.title,
|
|
38
|
+
subtitle: e.subtitle,
|
|
39
|
+
titleSize: e.titleSize
|
|
40
|
+
}, null, 8, ["title", "subtitle", "titleSize"])
|
|
41
|
+
]),
|
|
42
|
+
_: 1
|
|
43
|
+
})
|
|
44
|
+
])) : r("", !0),
|
|
45
|
+
e.$slots.default || e.text ? (l(), i("div", g, [
|
|
46
|
+
e.text ? (l(), n(a, { key: 0 }, {
|
|
47
|
+
default: o(() => [
|
|
48
|
+
s($, { text: e.text }, null, 8, ["text"])
|
|
49
|
+
]),
|
|
50
|
+
_: 1
|
|
51
|
+
})) : u(e.$slots, "default", { key: 1 })
|
|
52
|
+
])) : r("", !0),
|
|
53
|
+
e.$slots.actions ? (l(), i("div", w, [
|
|
54
|
+
s(c, null, {
|
|
55
|
+
default: o(() => [
|
|
56
|
+
u(e.$slots, "actions")
|
|
57
|
+
]),
|
|
58
|
+
_: 3
|
|
59
|
+
})
|
|
60
|
+
])) : r("", !0)
|
|
61
|
+
]),
|
|
62
|
+
_: 2
|
|
63
|
+
}, 1040, ["href", "class", "onClick"]))
|
|
64
|
+
]),
|
|
65
|
+
_: 3
|
|
66
|
+
}, 8, ["to", "replace"])) : (l(), n(m("div"), k({
|
|
67
|
+
key: 1,
|
|
68
|
+
class: d.value
|
|
69
|
+
}, e.$attrs), {
|
|
70
|
+
default: o(() => [
|
|
71
|
+
e.$slots.title || e.title || e.subtitle ? (l(), i("div", B, [
|
|
72
|
+
s(a, { dense: "" }, {
|
|
73
|
+
default: o(() => [
|
|
74
|
+
s(p, {
|
|
75
|
+
title: e.title,
|
|
76
|
+
subtitle: e.subtitle,
|
|
77
|
+
titleSize: e.titleSize
|
|
78
|
+
}, null, 8, ["title", "subtitle", "titleSize"])
|
|
79
|
+
]),
|
|
80
|
+
_: 1
|
|
81
|
+
})
|
|
82
|
+
])) : r("", !0),
|
|
83
|
+
e.$slots.default || e.text ? (l(), i("div", L, [
|
|
84
|
+
e.text ? (l(), n(a, { key: 0 }, {
|
|
85
|
+
default: o(() => [
|
|
86
|
+
s($, { text: e.text }, null, 8, ["text"])
|
|
87
|
+
]),
|
|
88
|
+
_: 1
|
|
89
|
+
})) : u(e.$slots, "default", { key: 1 })
|
|
90
|
+
])) : r("", !0),
|
|
91
|
+
e.$slots.actions ? (l(), i("div", j, [
|
|
92
|
+
s(c, null, {
|
|
93
|
+
default: o(() => [
|
|
94
|
+
u(e.$slots, "actions")
|
|
95
|
+
]),
|
|
96
|
+
_: 3
|
|
97
|
+
})
|
|
98
|
+
])) : r("", !0)
|
|
99
|
+
]),
|
|
100
|
+
_: 3
|
|
101
|
+
}, 16, ["class"]));
|
|
102
|
+
};
|
|
49
103
|
}
|
|
50
104
|
});
|
|
51
105
|
export {
|
|
52
|
-
|
|
106
|
+
E as default
|
|
53
107
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAttrs as H, computed as r, ref as J, inject as
|
|
2
|
-
import
|
|
1
|
+
import { useAttrs as H, computed as r, ref as J, inject as L, getCurrentInstance as Q, onMounted as T, onBeforeUnmount as W, createBlock as c, openBlock as a, unref as X, withCtx as B, resolveDynamicComponent as v, mergeProps as C, withKeys as P, withModifiers as M, createElementVNode as I, createElementBlock as l, createCommentVNode as s, renderSlot as o, normalizeClass as i, toDisplayString as S } from "vue";
|
|
2
|
+
import D from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
3
3
|
import { RouterLink as Y } from "vue-router";
|
|
4
4
|
const Z = { class: "flex w-full items-center" }, _ = {
|
|
5
5
|
key: 0,
|
|
@@ -50,11 +50,11 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
50
50
|
id: [String, Number]
|
|
51
51
|
},
|
|
52
52
|
emits: ["click"],
|
|
53
|
-
setup(e, { emit:
|
|
54
|
-
const
|
|
55
|
-
const { class: n, ...m } =
|
|
53
|
+
setup(e, { emit: G }) {
|
|
54
|
+
const x = H(), j = r(() => x.class), E = r(() => {
|
|
55
|
+
const { class: n, ...m } = x;
|
|
56
56
|
return m;
|
|
57
|
-
}), t = e,
|
|
57
|
+
}), t = e, V = G, f = J(null), g = L("registerListItemRef", null), u = L("kunListContext", null), K = r(() => {
|
|
58
58
|
var n;
|
|
59
59
|
return t.id ? t.id : `kun-list-item-${((n = Q()) == null ? void 0 : n.uid) ?? Math.random().toString(36).slice(2, 7)}`;
|
|
60
60
|
});
|
|
@@ -63,20 +63,20 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
63
63
|
}), W(() => {
|
|
64
64
|
g && g(null);
|
|
65
65
|
});
|
|
66
|
-
const b = (n) => typeof n == "object" || typeof n == "function",
|
|
66
|
+
const b = (n) => typeof n == "object" || typeof n == "function", N = r(() => !!(t.prependIcon || t.prependAvatar)), O = r(() => !!(t.appendIcon || t.appendAvatar)), w = r(() => {
|
|
67
67
|
var n;
|
|
68
|
-
return ((n =
|
|
69
|
-
}), A = r(() => t.active),
|
|
68
|
+
return ((n = u == null ? void 0 : u.isSelected) == null ? void 0 : n.call(u, t.value)) ?? !1;
|
|
69
|
+
}), A = r(() => t.active), $ = r(() => !!t.to);
|
|
70
70
|
function k(n, m = null) {
|
|
71
71
|
var p, h;
|
|
72
72
|
if (t.disabled) return;
|
|
73
|
-
if (
|
|
73
|
+
if (V("click", n), (n.ctrlKey || n.metaKey) && t.to) {
|
|
74
74
|
const y = typeof t.to == "string" ? t.to : t.to.path;
|
|
75
75
|
window.open(y, "_blank");
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
const d = ((p = f.value) == null ? void 0 : p.$el) ?? f.value;
|
|
79
|
-
d != null && d.dispatchEvent && d.dispatchEvent(new CustomEvent("select", { detail: t.value, bubbles: !0 })),
|
|
79
|
+
d != null && d.dispatchEvent && d.dispatchEvent(new CustomEvent("select", { detail: t.value, bubbles: !0 })), u && t.selectable && t.value !== null && ((h = u.toggleItem) == null || h.call(u, t.value), d != null && d.dispatchEvent && d.dispatchEvent(new CustomEvent("selected", { detail: t.value, bubbles: !0 }))), m && m(n);
|
|
80
80
|
}
|
|
81
81
|
const z = r(() => {
|
|
82
82
|
switch (t.variant) {
|
|
@@ -102,7 +102,7 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
102
102
|
default:
|
|
103
103
|
return "py-3";
|
|
104
104
|
}
|
|
105
|
-
}), U = r(() => t.tile ? "rounded-none" : t.rounded === !0 ? "rounded-md" : t.rounded === !1 ? "" : `rounded-${t.rounded}`), q = r(() => t.ripple ? "relative overflow-hidden" : ""),
|
|
105
|
+
}), U = r(() => t.tile ? "rounded-none" : t.rounded === !0 ? "rounded-md" : t.rounded === !1 ? "" : `rounded-${t.rounded}`), q = r(() => t.ripple ? "relative overflow-hidden" : ""), R = r(() => [
|
|
106
106
|
de,
|
|
107
107
|
z.value,
|
|
108
108
|
F.value,
|
|
@@ -119,15 +119,15 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
119
119
|
},
|
|
120
120
|
t.containerClass
|
|
121
121
|
]);
|
|
122
|
-
return (n, m) =>
|
|
122
|
+
return (n, m) => $.value ? (a(), c(X(Y), {
|
|
123
123
|
key: 0,
|
|
124
124
|
to: e.to,
|
|
125
125
|
replace: e.replace,
|
|
126
126
|
custom: !0
|
|
127
127
|
}, {
|
|
128
|
-
default:
|
|
129
|
-
(a(),
|
|
130
|
-
id:
|
|
128
|
+
default: B(({ href: d, navigate: p, isActive: h }) => [
|
|
129
|
+
(a(), c(v($.value ? "a" : e.tag), C({
|
|
130
|
+
id: K.value,
|
|
131
131
|
ref_key: "liRef",
|
|
132
132
|
ref: f,
|
|
133
133
|
href: d,
|
|
@@ -135,22 +135,22 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
135
135
|
"aria-selected": w.value || A.value || h,
|
|
136
136
|
"aria-disabled": e.disabled,
|
|
137
137
|
tabindex: "-1",
|
|
138
|
-
class:
|
|
138
|
+
class: R.value,
|
|
139
139
|
onClick: (y) => k(y, p),
|
|
140
|
-
onKeydown:
|
|
140
|
+
onKeydown: P(M((y) => k(y, p), ["prevent"]), ["enter"])
|
|
141
141
|
}, n.$attrs), {
|
|
142
|
-
default:
|
|
142
|
+
default: B(() => [
|
|
143
143
|
I("div", Z, [
|
|
144
|
-
|
|
144
|
+
N.value || n.$slots.prepend ? (a(), l("div", _, [
|
|
145
145
|
o(n.$slots, "prepend", {}, () => [
|
|
146
146
|
e.prependAvatar ? (a(), l("img", {
|
|
147
147
|
key: 0,
|
|
148
148
|
src: e.prependAvatar,
|
|
149
149
|
class: i(["rounded-full", e.prependClass])
|
|
150
|
-
}, null, 10, ee)) : b(e.prependIcon) ? (a(),
|
|
150
|
+
}, null, 10, ee)) : b(e.prependIcon) ? (a(), c(v(e.prependIcon), {
|
|
151
151
|
key: 1,
|
|
152
152
|
class: i(e.prependClass)
|
|
153
|
-
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(),
|
|
153
|
+
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(), c(D, {
|
|
154
154
|
key: 2,
|
|
155
155
|
icon: e.prependIcon,
|
|
156
156
|
class: i(e.prependClass)
|
|
@@ -158,8 +158,8 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
158
158
|
])
|
|
159
159
|
])) : s("", !0),
|
|
160
160
|
I("div", C({
|
|
161
|
-
class: ["flex flex-col min-w-0 flex-1",
|
|
162
|
-
},
|
|
161
|
+
class: ["flex flex-col min-w-0 flex-1", j.value]
|
|
162
|
+
}, E.value), [
|
|
163
163
|
o(n.$slots, "default", {}, () => [
|
|
164
164
|
o(n.$slots, "title", {}, () => [
|
|
165
165
|
e.title ? (a(), l("div", {
|
|
@@ -175,14 +175,14 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
175
175
|
])
|
|
176
176
|
])
|
|
177
177
|
], 16),
|
|
178
|
-
|
|
178
|
+
O.value ? (a(), l("div", te, [
|
|
179
179
|
o(n.$slots, "append", {}, () => [
|
|
180
180
|
e.appendAvatar ? (a(), l("img", {
|
|
181
181
|
key: 0,
|
|
182
182
|
src: e.appendAvatar,
|
|
183
183
|
class: "w-8 h-8 rounded-full"
|
|
184
184
|
}, null, 8, ne)) : s("", !0),
|
|
185
|
-
b(e.appendIcon) ? (a(),
|
|
185
|
+
b(e.appendIcon) ? (a(), c(v(e.appendIcon), {
|
|
186
186
|
key: 1,
|
|
187
187
|
class: "w-5 h-5"
|
|
188
188
|
})) : e.appendIcon ? (a(), l("i", {
|
|
@@ -197,31 +197,31 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
197
197
|
}, 1040, ["id", "href", "aria-selected", "aria-disabled", "class", "onClick", "onKeydown"]))
|
|
198
198
|
]),
|
|
199
199
|
_: 3
|
|
200
|
-
}, 8, ["to", "replace"])) : (a(),
|
|
200
|
+
}, 8, ["to", "replace"])) : (a(), c(v($.value ? "a" : e.tag), C({
|
|
201
201
|
key: 1,
|
|
202
|
-
id:
|
|
202
|
+
id: K.value,
|
|
203
203
|
ref_key: "liRef",
|
|
204
204
|
ref: f,
|
|
205
205
|
role: "option",
|
|
206
206
|
"aria-selected": w.value || A.value,
|
|
207
207
|
"aria-disabled": e.disabled,
|
|
208
208
|
tabindex: "-1",
|
|
209
|
-
class: [
|
|
209
|
+
class: [R.value],
|
|
210
210
|
onClick: k,
|
|
211
|
-
onKeydown:
|
|
211
|
+
onKeydown: P(M(k, ["prevent"]), ["enter"])
|
|
212
212
|
}, n.$attrs), {
|
|
213
|
-
default:
|
|
213
|
+
default: B(() => [
|
|
214
214
|
I("div", ae, [
|
|
215
|
-
|
|
215
|
+
N.value || n.$slots.prepend ? (a(), l("div", le, [
|
|
216
216
|
o(n.$slots, "prepend", {}, () => [
|
|
217
217
|
e.prependAvatar ? (a(), l("img", {
|
|
218
218
|
key: 0,
|
|
219
219
|
src: e.prependAvatar,
|
|
220
220
|
class: i(["rounded-full", e.prependClass])
|
|
221
|
-
}, null, 10, se)) : b(e.prependIcon) ? (a(),
|
|
221
|
+
}, null, 10, se)) : b(e.prependIcon) ? (a(), c(v(e.prependIcon), {
|
|
222
222
|
key: 1,
|
|
223
223
|
class: i(e.prependClass)
|
|
224
|
-
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(),
|
|
224
|
+
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(), c(D, {
|
|
225
225
|
key: 2,
|
|
226
226
|
icon: e.prependIcon,
|
|
227
227
|
class: i(e.prependClass)
|
|
@@ -229,8 +229,8 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
229
229
|
])
|
|
230
230
|
])) : s("", !0),
|
|
231
231
|
I("div", C({
|
|
232
|
-
class: ["flex flex-col min-w-0 flex-1",
|
|
233
|
-
},
|
|
232
|
+
class: ["flex flex-col min-w-0 flex-1", j.value]
|
|
233
|
+
}, E.value), [
|
|
234
234
|
o(n.$slots, "default", {}, () => [
|
|
235
235
|
o(n.$slots, "title", {}, () => [
|
|
236
236
|
e.title ? (a(), l("div", {
|
|
@@ -246,14 +246,14 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
246
246
|
])
|
|
247
247
|
])
|
|
248
248
|
], 16),
|
|
249
|
-
|
|
249
|
+
O.value ? (a(), l("div", re, [
|
|
250
250
|
o(n.$slots, "append", {}, () => [
|
|
251
251
|
e.appendAvatar ? (a(), l("img", {
|
|
252
252
|
key: 0,
|
|
253
253
|
src: e.appendAvatar,
|
|
254
254
|
class: "w-8 h-8 rounded-full"
|
|
255
255
|
}, null, 8, ie)) : s("", !0),
|
|
256
|
-
b(e.appendIcon) ? (a(),
|
|
256
|
+
b(e.appendIcon) ? (a(), c(v(e.appendIcon), {
|
|
257
257
|
key: 1,
|
|
258
258
|
class: "w-5 h-5"
|
|
259
259
|
})) : e.appendIcon ? (a(), l("i", {
|