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