adverich-kun-ui 0.1.238 → 0.1.240
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,4 +1,4 @@
|
|
|
1
|
-
import { ref as A, onMounted as v, watch as
|
|
1
|
+
import { ref as A, onMounted as v, watch as k, createElementBlock as r, openBlock as o, normalizeClass as a, createElementVNode as m, createCommentVNode as d, renderSlot as g, Fragment as E, renderList as T, normalizeStyle as $, toDisplayString as h, createBlock as D, resolveDynamicComponent as z } from "vue";
|
|
2
2
|
import I from "../../../../icons/IconArrowUp.vue.js";
|
|
3
3
|
import L from "../../../../icons/IconArrowDown.vue.js";
|
|
4
4
|
import O from "../../../../icons/IconArrowDownUp.vue.js";
|
|
@@ -30,7 +30,7 @@ const j = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
|
|
|
30
30
|
function S(l) {
|
|
31
31
|
if (!l.sortable) return;
|
|
32
32
|
let s = null;
|
|
33
|
-
Array.isArray(t.sortBy) ? s = t.sortBy.find((
|
|
33
|
+
Array.isArray(t.sortBy) ? s = t.sortBy.find((f) => f.key === l.value) : typeof t.sortBy == "string" && (s = t.sortBy === l.value ? { key: l.value, order: "asc" } : null);
|
|
34
34
|
const e = (s == null ? void 0 : s.order) === "asc" ? "desc" : "asc";
|
|
35
35
|
c("sort", { key: l.value, order: e });
|
|
36
36
|
}
|
|
@@ -47,7 +47,7 @@ const j = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
|
|
|
47
47
|
}, B = [F, t.theadClass], w = [H, t.trClass], i = [K, t.thClass], u = A(null), y = () => {
|
|
48
48
|
u.value && (u.value.indeterminate = t.someSelected && !t.allSelected);
|
|
49
49
|
};
|
|
50
|
-
return v(y),
|
|
50
|
+
return v(y), k(() => t.someSelected, y), k(() => t.allSelected, y), (l, s) => (o(), r("thead", {
|
|
51
51
|
class: a(B)
|
|
52
52
|
}, [
|
|
53
53
|
m("tr", {
|
|
@@ -80,8 +80,8 @@ const j = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
|
|
|
80
80
|
])) : d("", !0),
|
|
81
81
|
(o(!0), r(E, null, T(n.headers, (e) => (o(), r("th", {
|
|
82
82
|
key: e.key,
|
|
83
|
-
class: a([i, e.headerAlign === "right" ? "text-right" : e.headerAlign === "
|
|
84
|
-
onClick: (
|
|
83
|
+
class: a([i, e.headerAlign === "right" ? "text-right" : e.headerAlign === "left" ? "text-left" : "text-center"]),
|
|
84
|
+
onClick: (f) => S(e),
|
|
85
85
|
style: $({ cursor: e.sortable ? "pointer" : "default" })
|
|
86
86
|
}, [
|
|
87
87
|
g(l.$slots, `header.${e.key}`, { header: e }, () => [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElementBlock as s, openBlock as n, normalizeClass as a, createCommentVNode as c, renderSlot as m, createElementVNode as b, withModifiers as w, Fragment as
|
|
1
|
+
import { createElementBlock as s, openBlock as n, normalizeClass as a, createCommentVNode as c, renderSlot as m, createElementVNode as b, withModifiers as w, Fragment as f, renderList as h, unref as g, createTextVNode as y, toDisplayString as S } from "vue";
|
|
2
2
|
import { getValue as x, formatValue as v } from "../../../../utils/tableFormatters.js";
|
|
3
3
|
const B = { key: 0 }, $ = { key: 1 }, A = ["checked"], E = "hover:bg-slate-300 dark:hover:bg-slate-600 border-t border-slate-300 dark:border-slate-700", T = "bg-slate-100 dark:bg-slate-900", V = "px-3 py-2 whitespace-nowrap text-sm text-black dark:text-white", R = {
|
|
4
4
|
__name: "KunTableRow",
|
|
@@ -59,16 +59,16 @@ const B = { key: 0 }, $ = { key: 1 }, A = ["checked"], E = "hover:bg-slate-300 d
|
|
|
59
59
|
class: "h-5 w-5 text-blue-600 transition-all duration-200 ease-in-out rounded"
|
|
60
60
|
}, null, 40, A)
|
|
61
61
|
])) : c("", !0),
|
|
62
|
-
(n(!0), s(
|
|
62
|
+
(n(!0), s(f, null, h(e.headers, (t) => (n(), s("td", {
|
|
63
63
|
key: t.value,
|
|
64
|
-
class: a([o, t.align === "right" ? "text-right" : t.align === "
|
|
64
|
+
class: a([o, t.align === "right" ? "text-right" : t.align === "left" ? "text-left" : "text-center"])
|
|
65
65
|
}, [
|
|
66
66
|
m(d.$slots, `item.${t.value}`, {
|
|
67
67
|
item: e.item,
|
|
68
68
|
value: g(x)(t, e.item),
|
|
69
69
|
index: e.index
|
|
70
70
|
}, () => [
|
|
71
|
-
S(
|
|
71
|
+
y(S(g(v)(t, g(x)(t, e.item))), 1)
|
|
72
72
|
])
|
|
73
73
|
], 2))), 128)),
|
|
74
74
|
e.hasActions ? (n(), s("td", {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { reactive as F, ref as k, computed as w, watch as A } from "vue";
|
|
2
2
|
import { debounce as S } from "../../../../utils/utils.js";
|
|
3
|
-
function
|
|
3
|
+
function v(u, i) {
|
|
4
4
|
const t = F({
|
|
5
5
|
search: "",
|
|
6
6
|
byColumn: {}
|
|
7
|
-
}), { items: c, customFilter: s, searchableKeys: f } =
|
|
7
|
+
}), { items: c, customFilter: s, searchableKeys: f } = u, y = k(!1), a = (e, r) => e == null ? !1 : String(e).toLowerCase().includes(String(r).toLowerCase()), l = (e, r, n) => {
|
|
8
8
|
const o = e[r];
|
|
9
9
|
return typeof (s == null ? void 0 : s.value) == "function" ? s.value(e, r, n) : Array.isArray(n) ? n.some((b) => a(o, b)) : a(o, n);
|
|
10
10
|
}, m = w(() => Array.isArray(c.value) ? c.value.filter((e) => {
|
|
@@ -18,7 +18,7 @@ function j(i, u) {
|
|
|
18
18
|
return !0;
|
|
19
19
|
}) : []), h = S((e) => {
|
|
20
20
|
t.search = (e == null ? void 0 : e.toString().toLowerCase()) || "";
|
|
21
|
-
},
|
|
21
|
+
}, i.value), p = (e, r) => {
|
|
22
22
|
t.byColumn[e] = r;
|
|
23
23
|
};
|
|
24
24
|
function C(e) {
|
|
@@ -39,5 +39,5 @@ function j(i, u) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
v as default
|
|
43
43
|
};
|