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