adverich-kun-ui 0.1.52 → 0.1.53
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.
- package/dist/adverich-kun-ui.css +1 -1
- package/dist/components/KunAutocomplete/src/components/KunAutocomplete.vue.js +209 -126
- package/dist/components/KunAutocomplete/src/composables/KunAutocompleteProps.js +9 -1
- package/dist/components/KunAutocomplete/src/composables/useAutocomplete.js +125 -87
- package/dist/components/KunAutocomplete/src/composables/useIntersect.js +22 -0
- package/dist/components/KunCard/src/composables/kunCardProps.js +8 -0
- package/dist/components/KunCard/src/composables/useCard.js +11 -10
- package/dist/components/KunList/src/components/KunList.vue.js +36 -7
- package/dist/components/KunList/src/composables/useKunList.js +31 -0
- package/dist/components/KunListGroup/src/components/KunListGroup.vue.js +31 -0
- package/dist/components/KunListImg/src/components/KunListImg.vue.js +37 -0
- package/dist/components/KunListItem/src/components/KunListItem.vue.js +39 -0
- package/dist/components/KunListItemAction/src/components/KunListItemAction.vue.js +31 -0
- package/dist/components/KunListItemAvatar/src/components/KunListItemAvatar.vue.js +31 -0
- package/dist/components/KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js +31 -0
- package/dist/components/KunListItemText/src/components/KunListItemText.vue.js +31 -0
- package/dist/components/KunListSubheader/src/components/KunListSubheader.vue.js +31 -0
- package/dist/components/KunSlider/src/components/KunSlider.vue.js +3 -3
- package/dist/components/KunTooltip/src/components/KunTooltip.vue.js +97 -0
- package/dist/components/KunTooltip/src/composables/useTooltip.js +93 -0
- package/dist/components/kunMenu/src/components/kunMenu.vue.js +150 -0
- package/dist/components/kunMenu/src/composables/kunMenuProps.js +63 -0
- package/dist/components/kunMenu/src/composables/useKunMenu.js +169 -0
- package/dist/components/kunMenu/src/composables/useKunMenuComposable.js +25 -0
- package/dist/components/kunMenu/src/composables/useKunScrollStrategy.js +25 -0
- package/dist/index.js +95 -65
- package/package.json +1 -1
|
@@ -1,119 +1,157 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { isArray as
|
|
3
|
-
function
|
|
4
|
-
const n =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
(e) => i(e) ? t.returnObject ? t.itemValue ? e[t.itemValue] === l.value[t.itemValue] : e[t.itemTitle] === l.value[t.itemTitle] : e[t.itemValue] === l.value : e === l.value
|
|
1
|
+
import { ref as s, computed as i } from "vue";
|
|
2
|
+
import { isArray as S, isObject as c } from "../utils/helpers.js";
|
|
3
|
+
function ae(u, L, l, o, h) {
|
|
4
|
+
const n = s(null), x = s(null), y = s(null), g = s(!1), v = s(""), R = s(!1), m = i(() => !u.searchableKeys.length), I = i(() => u.clearOnSelect), E = i(() => u.clearSearchOnSelect), D = i(() => u.focusOnSelect), N = i(() => u.closeOnSelect), j = (e, t) => t.split(".").reduce((r, a) => r && r[a] !== void 0 ? r[a] : null, e);
|
|
5
|
+
function z() {
|
|
6
|
+
S(l.value) && (l.value.length ? n.value = o.value.filter((e) => {
|
|
7
|
+
let t = j(e, u.itemTitle);
|
|
8
|
+
return c(e) ? l.value.some(
|
|
9
|
+
(r) => j(r, u.itemTitle).includes(t)
|
|
10
|
+
) : l.value.some((r) => r.includes(e));
|
|
11
|
+
}) : n.value = []), (c(l.value) && Object.keys(l.value).length || typeof l.value == "number" && l.value || typeof l.value == "string" && l.value || typeof l.value == "boolean") && (n.value = o.value.find(
|
|
12
|
+
(e) => c(e) ? u.returnObject ? u.itemValue ? e[u.itemValue] === l.value[u.itemValue] : e[u.itemTitle] === l.value[u.itemTitle] : e[u.itemValue] === l.value : e === l.value
|
|
14
13
|
));
|
|
15
14
|
}
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
20
|
-
return
|
|
21
|
-
}), a = [
|
|
22
|
-
return
|
|
23
|
-
(
|
|
24
|
-
) :
|
|
15
|
+
const Z = i(() => n.value ? S(n.value) ? n.value.length ? d(n.value, u.itemTitle, "hasDefault") : u.placeholderText : c(n.value) ? d(n.value, u.itemTitle, "hasDefault") : n.value.toString() : o.value.length ? u.placeholderText : u.textNoItems), $ = i(() => u.startEmtpy && v.value.length < 3 ? [] : o.value.filter((t) => {
|
|
16
|
+
if (c(t)) {
|
|
17
|
+
const r = Object.values(t).filter((f) => {
|
|
18
|
+
if (!c(f) && !S(f))
|
|
19
|
+
return f;
|
|
20
|
+
}), a = [t].reduce((f, w) => u.searchableKeys.map((T) => T.includes(".") ? T.split(".").reduce((M, ee) => M && M[ee], w) : w[T]), []), O = m.value ? r : a;
|
|
21
|
+
return O ? O.some(
|
|
22
|
+
(f) => f ? f.toString().toLowerCase().includes(v.value.toLowerCase()) : ""
|
|
23
|
+
) : v.value ? t == v.value : t;
|
|
25
24
|
}
|
|
26
|
-
return
|
|
27
|
-
}).slice(0,
|
|
28
|
-
function
|
|
29
|
-
if (
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
return t.toString().toLowerCase().includes(v.value.toLowerCase());
|
|
26
|
+
}).slice(0, b.value)), q = i(() => u.itemText.includes(",") ? u.itemText.split(",") : u.itemText);
|
|
27
|
+
function d(e, t, r) {
|
|
28
|
+
if (c(e)) {
|
|
29
|
+
if (t) {
|
|
30
|
+
if (S(t))
|
|
31
|
+
return t.map((a) => e[a] ?? "No definido").join(" - ");
|
|
32
|
+
if (t.includes(","))
|
|
33
|
+
return t.split(",").map((a) => e[a]).join(" - ");
|
|
34
|
+
if (t.includes(".")) {
|
|
35
|
+
const a = t.split(".");
|
|
36
|
+
let O = e;
|
|
37
|
+
for (const f of a)
|
|
38
|
+
O = O[f];
|
|
39
|
+
return O;
|
|
40
|
+
}
|
|
41
|
+
return !u.returnObject && typeof e[t] == "number" || e[t] ? e[t].toString() : "";
|
|
42
|
+
}
|
|
43
|
+
if (r)
|
|
33
44
|
return Object.values(e)[0];
|
|
34
45
|
}
|
|
35
|
-
return
|
|
36
|
-
}
|
|
37
|
-
function
|
|
38
|
-
let
|
|
39
|
-
if (!
|
|
40
|
-
n.value = e[0],
|
|
41
|
-
else if (n.value || (n.value = []), A(
|
|
42
|
-
|
|
46
|
+
return S(e) ? u.returnObject ? e.map((a) => a[t]).join(" - ") : e.map((a) => a).join(" - ") : r && typeof e != "number" && e.includes(",") ? e.split(",") : e;
|
|
47
|
+
}
|
|
48
|
+
function G(e) {
|
|
49
|
+
let t = e[0];
|
|
50
|
+
if (!u.multiple)
|
|
51
|
+
n.value = e[0], u.returnObject && (l.value = t), !u.returnObject && c(t) && (u.itemValue ? l.value = t[u.itemValue] : l.value = Object.values(t)[0]), c(t) || (l.value = t), g.value = !1;
|
|
52
|
+
else if (n.value || (n.value = []), A(t))
|
|
53
|
+
t && C(t), l.value = n.value;
|
|
43
54
|
else {
|
|
44
|
-
if (
|
|
45
|
-
if (
|
|
46
|
-
n.value.push(u
|
|
55
|
+
if (u.returnObject && n.value.push(t), !u.returnObject && c(t))
|
|
56
|
+
if (u.itemValue)
|
|
57
|
+
n.value.push(t[u.itemValue]);
|
|
47
58
|
else {
|
|
48
|
-
l.value = n.value.push(Object.values(
|
|
59
|
+
l.value = n.value.push(Object.values(t)[0]);
|
|
49
60
|
return;
|
|
50
61
|
}
|
|
51
62
|
l.value = n.value;
|
|
52
63
|
}
|
|
53
|
-
|
|
64
|
+
I.value && F(), x.value.focus();
|
|
54
65
|
}
|
|
55
66
|
function A(e) {
|
|
56
|
-
return n.value === null ? !1 : n.value.some(
|
|
57
|
-
(
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
function
|
|
61
|
-
if (
|
|
62
|
-
let
|
|
63
|
-
(a) => a[
|
|
64
|
-
),
|
|
65
|
-
n.value.splice(
|
|
67
|
+
return n.value === null ? !1 : e ? n.value.some(
|
|
68
|
+
(t) => u.returnObject ? t[u.itemValue] === e[u.itemValue] : t === e[u.itemValue]
|
|
69
|
+
) : !0;
|
|
70
|
+
}
|
|
71
|
+
function C(e) {
|
|
72
|
+
if (u.returnObject) {
|
|
73
|
+
let t = n.value.find(
|
|
74
|
+
(a) => a[u.itemValue] === e[u.itemValue]
|
|
75
|
+
), r = n.value.indexOf(t);
|
|
76
|
+
n.value.splice(r, 1);
|
|
66
77
|
} else {
|
|
67
|
-
let
|
|
68
|
-
n.value.splice(
|
|
78
|
+
let t = n.value.indexOf(e[u.itemValue]);
|
|
79
|
+
n.value.splice(t, 1);
|
|
69
80
|
}
|
|
70
81
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
82
|
+
function H() {
|
|
83
|
+
V(), E.value && (v.value = ""), D.value && x.value.focus();
|
|
84
|
+
}
|
|
85
|
+
function J(e) {
|
|
86
|
+
B(e.key) && (g.value = !0);
|
|
73
87
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
88
|
+
function B(e) {
|
|
89
|
+
return /^[a-zA-Z0-9]$/.test(e);
|
|
76
90
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
91
|
+
function Q() {
|
|
92
|
+
g.value = !0, y.value && y.value.focus();
|
|
79
93
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
94
|
+
function U(e) {
|
|
95
|
+
const t = e.key;
|
|
96
|
+
(B(t) || t === "Backspace") && x.value.focus();
|
|
82
97
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
85
|
-
n.value.splice(u, 1), l.value = n.value;
|
|
98
|
+
function W() {
|
|
99
|
+
g.value = !1, L("createItem");
|
|
86
100
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
101
|
+
function X(e) {
|
|
102
|
+
let t = n.value.indexOf(e);
|
|
103
|
+
n.value.splice(t, 1), l.value = n.value;
|
|
89
104
|
}
|
|
90
|
-
function
|
|
105
|
+
function F() {
|
|
106
|
+
v.value = "", S(l.value) && (n.value = []), c(l.value) && (n.value = {}), typeof l.value == "number" && l.value && (n.value = null), typeof l.value == "string" && l.value && (n.value = ""), typeof l.value == "boolean" && (n.value = !1), l.value = n.value;
|
|
107
|
+
}
|
|
108
|
+
function Y(e) {
|
|
91
109
|
if (!e.disabledItem) return !1;
|
|
92
110
|
if (e.disabledItem) return !0;
|
|
93
111
|
}
|
|
112
|
+
const K = s(null), b = s(h.value), _ = i(
|
|
113
|
+
() => Math.ceil(o.value / h.value)
|
|
114
|
+
), k = i(() => _.length >= b.value);
|
|
115
|
+
i(() => o.value.length);
|
|
116
|
+
const P = i(
|
|
117
|
+
() => h.value === b.value
|
|
118
|
+
);
|
|
119
|
+
function V() {
|
|
120
|
+
b.value = h.value;
|
|
121
|
+
}
|
|
122
|
+
function p() {
|
|
123
|
+
if (!(P.value && k.value) && !k.value)
|
|
124
|
+
return b.value += h.value, K.value = b.value + h.value, o.value.slice(0, K.value);
|
|
125
|
+
}
|
|
94
126
|
return {
|
|
95
127
|
selectedItem: n,
|
|
96
|
-
textFieldRef:
|
|
128
|
+
textFieldRef: x,
|
|
97
129
|
listRef: y,
|
|
98
|
-
menuModel:
|
|
99
|
-
search:
|
|
100
|
-
isCloseOnSelect:
|
|
101
|
-
isClearOnSelect:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
130
|
+
menuModel: g,
|
|
131
|
+
search: v,
|
|
132
|
+
isCloseOnSelect: N,
|
|
133
|
+
isClearOnSelect: I,
|
|
134
|
+
getItemText: j,
|
|
135
|
+
setSelectedItemValue: z,
|
|
136
|
+
placeholder: Z,
|
|
137
|
+
filteredItems: $,
|
|
138
|
+
textArr: q,
|
|
139
|
+
itemToString: d,
|
|
140
|
+
getSelectedItem: G,
|
|
141
|
+
checkIfValueExist: A,
|
|
142
|
+
removeFromArray: C,
|
|
143
|
+
lightReset: H,
|
|
144
|
+
openMenu: J,
|
|
145
|
+
focusOnMenu: Q,
|
|
146
|
+
onMenuKeydown: U,
|
|
147
|
+
createItem: W,
|
|
148
|
+
removeItem: X,
|
|
149
|
+
clearSelection: F,
|
|
150
|
+
checkDisabled: Y,
|
|
151
|
+
handleIntersect: p,
|
|
152
|
+
intersectObserved: R
|
|
115
153
|
};
|
|
116
154
|
}
|
|
117
155
|
export {
|
|
118
|
-
|
|
156
|
+
ae as useAutocomplete
|
|
119
157
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function f(n, a = "0px", o, v, e) {
|
|
2
|
+
const r = {
|
|
3
|
+
root: null,
|
|
4
|
+
rootMargin: a,
|
|
5
|
+
threshold: 0.5
|
|
6
|
+
}, l = new IntersectionObserver(n, r);
|
|
7
|
+
function s() {
|
|
8
|
+
e.value && !o.value ? (o.value = !0, l.observe(e.value)) : console.warn("El valor de intersectRef es nulo.");
|
|
9
|
+
}
|
|
10
|
+
function u() {
|
|
11
|
+
e.value && (o.value = !1, l.unobserve(e.value));
|
|
12
|
+
}
|
|
13
|
+
return watch(v, (t) => {
|
|
14
|
+
!t && o.value && u();
|
|
15
|
+
}), {
|
|
16
|
+
observe: s,
|
|
17
|
+
stopObserver: u
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
f as useIntersect
|
|
22
|
+
};
|
|
@@ -24,6 +24,14 @@ const e = {
|
|
|
24
24
|
default: !0,
|
|
25
25
|
validator: (t) => typeof t == "boolean" || ["sm", "md", "lg", "xl"].includes(t)
|
|
26
26
|
},
|
|
27
|
+
outlined: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
outlineColor: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "border-gray-300 dark:border-gray-600"
|
|
34
|
+
},
|
|
27
35
|
elevation: {
|
|
28
36
|
type: [String, Number],
|
|
29
37
|
default: 1,
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
function
|
|
3
|
-
const n =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { computed as d } from "vue";
|
|
2
|
+
function r(e) {
|
|
3
|
+
const n = d(() => [
|
|
4
|
+
e.bgColor,
|
|
5
|
+
e.flat ? "shadow-none" : "shadow-md",
|
|
6
|
+
e.rounded === !0 ? "rounded-lg" : e.rounded ? `rounded-${e.rounded}` : "",
|
|
7
|
+
e.outlined ? `border ${e.outlineColor}` : "",
|
|
8
|
+
e.class
|
|
9
|
+
].filter(Boolean)), o = d(() => e.style || {});
|
|
9
10
|
return {
|
|
10
11
|
cardClass: n,
|
|
11
|
-
cardStyle:
|
|
12
|
+
cardStyle: o
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
r as useCard
|
|
16
17
|
};
|
|
@@ -1,9 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { createElementBlock as a, openBlock as t, normalizeClass as r, renderSlot as s } from "vue";
|
|
2
|
+
import { useKunList as n } from "../composables/useKunList.js";
|
|
3
|
+
const c = {
|
|
4
|
+
__name: "KunList",
|
|
5
|
+
props: {
|
|
6
|
+
nav: Boolean,
|
|
7
|
+
sub: Boolean,
|
|
8
|
+
dense: Boolean,
|
|
9
|
+
selectable: {
|
|
10
|
+
type: [Boolean, String],
|
|
11
|
+
default: !1,
|
|
12
|
+
validator: (e) => ["single", "multiple", !0, !1].includes(e)
|
|
13
|
+
},
|
|
14
|
+
selectedClass: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-300"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(e) {
|
|
20
|
+
return n(e), (l, u) => (t(), a("ul", {
|
|
21
|
+
role: "list",
|
|
22
|
+
class: r([
|
|
23
|
+
"kun-list",
|
|
24
|
+
{
|
|
25
|
+
"space-y-1": !e.dense,
|
|
26
|
+
"space-y-0.5": e.dense,
|
|
27
|
+
"pl-4 border-l-2 border-gray-200 dark:border-gray-700": e.sub,
|
|
28
|
+
"bg-gray-100 dark:bg-gray-800 p-2 rounded-md": e.nav
|
|
29
|
+
}
|
|
30
|
+
])
|
|
31
|
+
}, [
|
|
32
|
+
s(l.$slots, "default")
|
|
33
|
+
], 2));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
7
36
|
export {
|
|
8
|
-
|
|
37
|
+
c as default
|
|
9
38
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ref as c, provide as a } from "vue";
|
|
2
|
+
const o = Symbol("kun-list");
|
|
3
|
+
function d(l) {
|
|
4
|
+
const e = c([]);
|
|
5
|
+
function t(i) {
|
|
6
|
+
if (!l.selectable || l.disabled) return;
|
|
7
|
+
const u = l.selectable === "multiple";
|
|
8
|
+
if (l.selectable === "single")
|
|
9
|
+
e.value = e.value[0] === i ? [] : [i];
|
|
10
|
+
else if (u) {
|
|
11
|
+
const s = e.value.indexOf(i);
|
|
12
|
+
s === -1 ? e.value.push(i) : e.value.splice(s, 1);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function n(i) {
|
|
16
|
+
return e.value.includes(i);
|
|
17
|
+
}
|
|
18
|
+
return a(o, {
|
|
19
|
+
toggleItem: t,
|
|
20
|
+
isSelected: n,
|
|
21
|
+
isMultiple: () => l.selectable === "multiple",
|
|
22
|
+
isSingle: () => l.selectable === "single"
|
|
23
|
+
}), {
|
|
24
|
+
selectedValues: e,
|
|
25
|
+
toggleItem: t,
|
|
26
|
+
isSelected: n
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
d as useKunList
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElementBlock as s, openBlock as a, normalizeClass as l, renderSlot as n, createTextVNode as o, toDisplayString as u } from "vue";
|
|
2
|
+
const i = {
|
|
3
|
+
__name: "KunListGroup",
|
|
4
|
+
props: {
|
|
5
|
+
text: {
|
|
6
|
+
type: [String, Number],
|
|
7
|
+
default: null
|
|
8
|
+
},
|
|
9
|
+
class: {
|
|
10
|
+
type: [String, Object, Array],
|
|
11
|
+
default: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
const t = e;
|
|
16
|
+
return (r, c) => (a(), s("span", {
|
|
17
|
+
class: l([
|
|
18
|
+
"kun-list-item-subtitle",
|
|
19
|
+
"text-xs text-gray-500 dark:text-gray-400 truncate",
|
|
20
|
+
t.class
|
|
21
|
+
])
|
|
22
|
+
}, [
|
|
23
|
+
n(r.$slots, "default", {}, () => [
|
|
24
|
+
o(u(t.text), 1)
|
|
25
|
+
])
|
|
26
|
+
], 2));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
i as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createElementBlock as r, openBlock as l, normalizeClass as s, createElementVNode as a } from "vue";
|
|
2
|
+
const c = ["src", "alt"], i = {
|
|
3
|
+
__name: "KunListImg",
|
|
4
|
+
props: {
|
|
5
|
+
src: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: !0
|
|
8
|
+
},
|
|
9
|
+
alt: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
class: {
|
|
14
|
+
type: [String, Object, Array],
|
|
15
|
+
default: null
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(t) {
|
|
19
|
+
const e = t;
|
|
20
|
+
return (n, o) => (l(), r("div", {
|
|
21
|
+
class: s([
|
|
22
|
+
"kun-list-img",
|
|
23
|
+
"overflow-hidden rounded-md bg-gray-200 dark:bg-gray-700",
|
|
24
|
+
e.class
|
|
25
|
+
])
|
|
26
|
+
}, [
|
|
27
|
+
a("img", {
|
|
28
|
+
src: e.src,
|
|
29
|
+
alt: e.alt,
|
|
30
|
+
class: "w-full h-full object-cover"
|
|
31
|
+
}, null, 8, c)
|
|
32
|
+
], 2));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
i as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ref as i, inject as o, createElementBlock as s, openBlock as u, normalizeClass as c, renderSlot as d } from "vue";
|
|
2
|
+
const m = {
|
|
3
|
+
__name: "KunListItem",
|
|
4
|
+
props: {
|
|
5
|
+
value: {
|
|
6
|
+
type: [String, Number, Boolean, Object, Array, null],
|
|
7
|
+
default: null
|
|
8
|
+
},
|
|
9
|
+
disabled: Boolean,
|
|
10
|
+
active: Boolean,
|
|
11
|
+
activeClass: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-300"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
setup(e) {
|
|
17
|
+
const t = e, l = i(t.active), a = o("kun-list", null);
|
|
18
|
+
function r() {
|
|
19
|
+
t.disabled || (a && t.value !== null ? a.toggleItem(t.value) : l.value = !l.value);
|
|
20
|
+
}
|
|
21
|
+
return (n, b) => (u(), s("li", {
|
|
22
|
+
role: "listitem",
|
|
23
|
+
class: c([
|
|
24
|
+
"kun-list-item",
|
|
25
|
+
{
|
|
26
|
+
"px-4 py-2 rounded-md cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700 flex items-center gap-2": !e.disabled,
|
|
27
|
+
"text-gray-500 dark:text-gray-400 cursor-not-allowed": e.disabled,
|
|
28
|
+
[e.activeClass]: l.value
|
|
29
|
+
}
|
|
30
|
+
]),
|
|
31
|
+
onClick: r
|
|
32
|
+
}, [
|
|
33
|
+
d(n.$slots, "default")
|
|
34
|
+
], 2));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
m as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElementBlock as a, openBlock as s, normalizeClass as n, renderSlot as l, createTextVNode as o, toDisplayString as c } from "vue";
|
|
2
|
+
const m = {
|
|
3
|
+
__name: "KunListItemAction",
|
|
4
|
+
props: {
|
|
5
|
+
text: {
|
|
6
|
+
type: [String, Number],
|
|
7
|
+
default: null
|
|
8
|
+
},
|
|
9
|
+
class: {
|
|
10
|
+
type: [String, Object, Array],
|
|
11
|
+
default: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
const t = e;
|
|
16
|
+
return (r, u) => (s(), a("span", {
|
|
17
|
+
class: n([
|
|
18
|
+
"kun-list-item-text",
|
|
19
|
+
"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",
|
|
20
|
+
t.class
|
|
21
|
+
])
|
|
22
|
+
}, [
|
|
23
|
+
l(r.$slots, "default", {}, () => [
|
|
24
|
+
o(c(t.text), 1)
|
|
25
|
+
])
|
|
26
|
+
], 2));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
m as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElementBlock as a, openBlock as s, normalizeClass as l, renderSlot as n, createTextVNode as o, toDisplayString as c } from "vue";
|
|
2
|
+
const p = {
|
|
3
|
+
__name: "KunListItemAvatar",
|
|
4
|
+
props: {
|
|
5
|
+
text: {
|
|
6
|
+
type: [String, Number],
|
|
7
|
+
default: null
|
|
8
|
+
},
|
|
9
|
+
class: {
|
|
10
|
+
type: [String, Object, Array],
|
|
11
|
+
default: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
const t = e;
|
|
16
|
+
return (r, u) => (s(), a("span", {
|
|
17
|
+
class: l([
|
|
18
|
+
"kun-list-item-text",
|
|
19
|
+
"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",
|
|
20
|
+
t.class
|
|
21
|
+
])
|
|
22
|
+
}, [
|
|
23
|
+
n(r.$slots, "default", {}, () => [
|
|
24
|
+
o(c(t.text), 1)
|
|
25
|
+
])
|
|
26
|
+
], 2));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
p as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElementBlock as s, openBlock as a, normalizeClass as l, renderSlot as n, createTextVNode as o, toDisplayString as u } from "vue";
|
|
2
|
+
const p = {
|
|
3
|
+
__name: "KunListItemSubtitle",
|
|
4
|
+
props: {
|
|
5
|
+
text: {
|
|
6
|
+
type: [String, Number],
|
|
7
|
+
default: null
|
|
8
|
+
},
|
|
9
|
+
class: {
|
|
10
|
+
type: [String, Object, Array],
|
|
11
|
+
default: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
const t = e;
|
|
16
|
+
return (r, c) => (a(), s("span", {
|
|
17
|
+
class: l([
|
|
18
|
+
"kun-list-item-subtitle",
|
|
19
|
+
"text-xs text-gray-500 dark:text-gray-400 truncate",
|
|
20
|
+
t.class
|
|
21
|
+
])
|
|
22
|
+
}, [
|
|
23
|
+
n(r.$slots, "default", {}, () => [
|
|
24
|
+
o(u(t.text), 1)
|
|
25
|
+
])
|
|
26
|
+
], 2));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
p as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElementBlock as a, openBlock as s, normalizeClass as l, renderSlot as n, createTextVNode as o, toDisplayString as c } from "vue";
|
|
2
|
+
const p = {
|
|
3
|
+
__name: "KunListItemText",
|
|
4
|
+
props: {
|
|
5
|
+
text: {
|
|
6
|
+
type: [String, Number],
|
|
7
|
+
default: null
|
|
8
|
+
},
|
|
9
|
+
class: {
|
|
10
|
+
type: [String, Object, Array],
|
|
11
|
+
default: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
const t = e;
|
|
16
|
+
return (r, u) => (s(), a("span", {
|
|
17
|
+
class: l([
|
|
18
|
+
"kun-list-item-text",
|
|
19
|
+
"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",
|
|
20
|
+
t.class
|
|
21
|
+
])
|
|
22
|
+
}, [
|
|
23
|
+
n(r.$slots, "default", {}, () => [
|
|
24
|
+
o(c(t.text), 1)
|
|
25
|
+
])
|
|
26
|
+
], 2));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
p as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElementBlock as a, openBlock as s, normalizeClass as l, createTextVNode as o, renderSlot as n, toDisplayString as p } from "vue";
|
|
2
|
+
const i = {
|
|
3
|
+
__name: "KunListSubheader",
|
|
4
|
+
props: {
|
|
5
|
+
text: {
|
|
6
|
+
type: [String, Number],
|
|
7
|
+
default: ""
|
|
8
|
+
},
|
|
9
|
+
class: {
|
|
10
|
+
type: [String, Object, Array],
|
|
11
|
+
default: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(t) {
|
|
15
|
+
const e = t;
|
|
16
|
+
return (r, c) => (s(), a("li", {
|
|
17
|
+
class: l([
|
|
18
|
+
"kun-list-subheader",
|
|
19
|
+
"px-4 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",
|
|
20
|
+
e.class
|
|
21
|
+
]),
|
|
22
|
+
role: "separator"
|
|
23
|
+
}, [
|
|
24
|
+
o(p(e.text) + " ", 1),
|
|
25
|
+
n(r.$slots, "default")
|
|
26
|
+
], 2));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
i as default
|
|
31
|
+
};
|