adverich-kun-ui 0.1.287 → 0.1.289
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,6 +1,6 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { getValue as x, formatValue as
|
|
3
|
-
const
|
|
1
|
+
import { computed as k, createElementBlock as s, openBlock as l, normalizeClass as o, createCommentVNode as r, renderSlot as u, createElementVNode as y, withModifiers as v, Fragment as w, renderList as S, createBlock as h, resolveDynamicComponent as B, unref as c, createTextVNode as $, toDisplayString as A } from "vue";
|
|
2
|
+
import { getValue as x, formatValue as E } from "../../../../utils/tableFormatters.js";
|
|
3
|
+
const T = { key: 0 }, V = { key: 1 }, N = ["checked"], j = "hover:bg-slate-300 dark:hover:bg-slate-600 border-t border-slate-300 dark:border-slate-700", D = "bg-slate-100 dark:bg-slate-900", F = "px-3 py-2 whitespace-nowrap text-sm text-black dark:text-white", z = {
|
|
4
4
|
__name: "KunTableRow",
|
|
5
5
|
props: {
|
|
6
6
|
item: Object,
|
|
@@ -21,77 +21,86 @@ const V = { key: 0 }, N = { key: 1 }, j = ["checked"], D = "hover:bg-slate-300 d
|
|
|
21
21
|
customSlots: Object
|
|
22
22
|
},
|
|
23
23
|
emits: ["toggle-expand", "toggle-select", "row-click"],
|
|
24
|
-
setup(e, { emit:
|
|
25
|
-
const n = e,
|
|
24
|
+
setup(e, { emit: C }) {
|
|
25
|
+
const n = e, m = C, b = k(() => [
|
|
26
|
+
j,
|
|
26
27
|
D,
|
|
27
|
-
F,
|
|
28
28
|
n.rowClass,
|
|
29
29
|
n.trClass,
|
|
30
30
|
n.stripedClass,
|
|
31
31
|
n.isSelected ? n.selectedClass : ""
|
|
32
|
-
])
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
]);
|
|
33
|
+
function d(a = null, i = null) {
|
|
34
|
+
return typeof n.tdClass == "function" ? n.tdClass({
|
|
35
|
+
item: n.item,
|
|
36
|
+
header: a,
|
|
37
|
+
value: i,
|
|
38
|
+
index: n.index
|
|
39
|
+
}) : n.tdClass;
|
|
40
|
+
}
|
|
41
|
+
const f = k(() => ["text-center", n.actionsAlign]);
|
|
42
|
+
return (a, i) => (l(), s("tr", {
|
|
43
|
+
class: o(b.value),
|
|
44
|
+
onClick: i[2] || (i[2] = (t) => m("row-click", { item: e.item, index: e.index, event: t }))
|
|
36
45
|
}, [
|
|
37
46
|
e.showExpand ? (l(), s("td", {
|
|
38
47
|
key: 0,
|
|
39
|
-
class:
|
|
48
|
+
class: o(d(e.item, "expand"))
|
|
40
49
|
}, [
|
|
41
|
-
|
|
50
|
+
a.$slots.expandIcon ? u(a.$slots, "expand-icon", {
|
|
42
51
|
key: 0,
|
|
43
52
|
item: e.item,
|
|
44
53
|
index: e.index
|
|
45
54
|
}) : (l(), s("button", {
|
|
46
55
|
key: 1,
|
|
47
|
-
onClick: i[0] || (i[0] = (t) =>
|
|
56
|
+
onClick: i[0] || (i[0] = (t) => m("toggle-expand", e.item))
|
|
48
57
|
}, [
|
|
49
|
-
e.isExpanded ? (l(), s("span",
|
|
58
|
+
e.isExpanded ? (l(), s("span", T, "−")) : (l(), s("span", V, "+"))
|
|
50
59
|
]))
|
|
51
60
|
], 2)) : r("", !0),
|
|
52
61
|
e.showSelect ? (l(), s("td", {
|
|
53
62
|
key: 1,
|
|
54
|
-
class:
|
|
63
|
+
class: o([d(e.item, "checkbox"), "h-full w-10 flex flex-col items-center justify-center"])
|
|
55
64
|
}, [
|
|
56
|
-
|
|
65
|
+
y("input", {
|
|
57
66
|
type: "checkbox",
|
|
58
67
|
checked: e.isSelected,
|
|
59
|
-
onChange: i[1] || (i[1] =
|
|
68
|
+
onChange: i[1] || (i[1] = v((t) => m("toggle-select", e.item), ["stop"])),
|
|
60
69
|
class: "h-5 w-5 text-blue-600 transition-all duration-200 ease-in-out rounded"
|
|
61
|
-
}, null, 40,
|
|
70
|
+
}, null, 40, N)
|
|
62
71
|
], 2)) : r("", !0),
|
|
63
|
-
(l(!0), s(
|
|
64
|
-
var
|
|
72
|
+
(l(!0), s(w, null, S(e.headers, (t) => {
|
|
73
|
+
var g;
|
|
65
74
|
return l(), s("td", {
|
|
66
75
|
key: t.value,
|
|
67
|
-
class:
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
class: o([
|
|
77
|
+
F,
|
|
78
|
+
d(e.item, t),
|
|
70
79
|
t.align === "right" ? "text-right" : t.align === "left" ? "text-left" : "text-center"
|
|
71
80
|
])
|
|
72
81
|
}, [
|
|
73
|
-
(
|
|
82
|
+
(g = e.customSlots) != null && g[`item.${t.value}`] ? (l(), h(B(e.customSlots[`item.${t.value}`]), {
|
|
74
83
|
key: 0,
|
|
75
84
|
item: e.item,
|
|
76
|
-
value:
|
|
85
|
+
value: c(x)(t, e.item),
|
|
77
86
|
index: e.index,
|
|
78
87
|
header: t
|
|
79
|
-
}, null, 8, ["item", "value", "index", "header"])) :
|
|
88
|
+
}, null, 8, ["item", "value", "index", "header"])) : u(a.$slots, `item.${t.value}`, {
|
|
80
89
|
key: 1,
|
|
81
90
|
item: e.item,
|
|
82
|
-
value:
|
|
91
|
+
value: c(x)(t, e.item),
|
|
83
92
|
index: e.index,
|
|
84
93
|
header: t
|
|
85
94
|
}, () => [
|
|
86
|
-
A(E
|
|
95
|
+
$(A(c(E)(t, c(x)(t, e.item))), 1)
|
|
87
96
|
])
|
|
88
97
|
], 2);
|
|
89
98
|
}), 128)),
|
|
90
99
|
e.hasActions ? (l(), s("td", {
|
|
91
100
|
key: 2,
|
|
92
|
-
class:
|
|
101
|
+
class: o([d(e.item, "actions"), f.value])
|
|
93
102
|
}, [
|
|
94
|
-
|
|
103
|
+
u(a.$slots, "item.actions", {
|
|
95
104
|
item: e.item,
|
|
96
105
|
index: e.index,
|
|
97
106
|
loading: e.loading
|