adverich-kun-ui 0.1.443 → 0.1.444
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 { mergeModels as W, toRefs as be, useModel as Ce, ref as
|
|
1
|
+
import { mergeModels as W, toRefs as be, useModel as Ce, ref as y, watch as Q, computed as q, onMounted as Te, createElementBlock as r, openBlock as l, mergeProps as V, createCommentVNode as u, createElementVNode as O, renderSlot as a, createBlock as b, unref as s, normalizeClass as C, withCtx as j, createVNode as T, withDirectives as G, vModelText as Fe, vShow as J, normalizeProps as d, guardReactiveProps as g, Fragment as $e, createSlots as X, renderList as Y, toDisplayString as ke, isRef as Pe, nextTick as Me } from "vue";
|
|
2
2
|
import { isMobile as m } from "../../../../utils/_platform.js";
|
|
3
3
|
import Z from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
4
4
|
import Ae from "../../../../icons/IconFilter.vue.js";
|
|
@@ -20,7 +20,7 @@ const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key:
|
|
|
20
20
|
}, qe = { class: "text-center text-4xl" }, Ge = {
|
|
21
21
|
key: 1,
|
|
22
22
|
class: "sticky bottom-0 z-10 print:hidden"
|
|
23
|
-
}, Je = "overflow-hidden h-
|
|
23
|
+
}, Je = "overflow-hidden h-dvh w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", Xe = "table-auto w-full h-fit text-sm text-left", ms = {
|
|
24
24
|
__name: "KunTable",
|
|
25
25
|
props: /* @__PURE__ */ W(Ne(), {
|
|
26
26
|
selectedItems: { type: Array, default: () => [] },
|
|
@@ -41,11 +41,11 @@ const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key:
|
|
|
41
41
|
items: ne,
|
|
42
42
|
searchable: H,
|
|
43
43
|
debounceTime: re
|
|
44
|
-
} = F, w =
|
|
44
|
+
} = F, w = y(p.search);
|
|
45
45
|
Q(() => p.search, (e) => {
|
|
46
46
|
e !== w.value && (w.value = e);
|
|
47
47
|
});
|
|
48
|
-
const { filteredItems: ie, setSearch: ce, modalFilter:
|
|
48
|
+
const { filteredItems: ie, setSearch: ce, modalFilter: v, applyColumnFilters: ue, clearFilters: de, appliedFilters: pe } = He(F, re);
|
|
49
49
|
Q(w, (e) => {
|
|
50
50
|
S("update:search", e), ce(e);
|
|
51
51
|
});
|
|
@@ -60,7 +60,7 @@ const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key:
|
|
|
60
60
|
isExpanded: A,
|
|
61
61
|
sortBy: i.sortBy,
|
|
62
62
|
hasActions: p.hasActions
|
|
63
|
-
})), we = [Je, le.value],
|
|
63
|
+
})), we = [Je, le.value], ve = [Xe, te.value], N = q(() => p.headers.map((e) => {
|
|
64
64
|
var t, c;
|
|
65
65
|
const o = { ...e };
|
|
66
66
|
if ((e.columnType === "function" || e.columnType == "objectFunction" || e.columnType == "simpleFunction") && typeof e.columnFunction == "string") {
|
|
@@ -78,8 +78,8 @@ const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key:
|
|
|
78
78
|
return o;
|
|
79
79
|
}));
|
|
80
80
|
Te(() => L());
|
|
81
|
-
const K =
|
|
82
|
-
function
|
|
81
|
+
const K = y(null), R = y(!0), E = y(!1);
|
|
82
|
+
function ye() {
|
|
83
83
|
Se();
|
|
84
84
|
}
|
|
85
85
|
function Se() {
|
|
@@ -93,7 +93,7 @@ const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key:
|
|
|
93
93
|
function U() {
|
|
94
94
|
m.value && (B.value = "w-full border", E.value = !1, R.value = !0, S("focusOnSearch", !0));
|
|
95
95
|
}
|
|
96
|
-
const B =
|
|
96
|
+
const B = y("w-full border max-w-sm");
|
|
97
97
|
return (e, o) => (l(), r("div", V({ class: we }, e.$attrs, { style: { "user-select": "text" } }), [
|
|
98
98
|
s(H) || e.filterable || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), r("div", {
|
|
99
99
|
key: 0,
|
|
@@ -107,7 +107,7 @@ const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key:
|
|
|
107
107
|
e.filterable && e.filters.length ? (l(), b(Oe, {
|
|
108
108
|
key: 0,
|
|
109
109
|
class: "h-fit",
|
|
110
|
-
onClick: o[0] || (o[0] = (t) =>
|
|
110
|
+
onClick: o[0] || (o[0] = (t) => v.value = !0),
|
|
111
111
|
rounded: "rounded-full",
|
|
112
112
|
size: "xs",
|
|
113
113
|
bgColor: "bg-green-200 dark:bg-green-800"
|
|
@@ -140,7 +140,7 @@ const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key:
|
|
|
140
140
|
]),
|
|
141
141
|
G(T(Z, {
|
|
142
142
|
icon: Ie,
|
|
143
|
-
onClick:
|
|
143
|
+
onClick: ye
|
|
144
144
|
}, null, 512), [
|
|
145
145
|
[J, E.value]
|
|
146
146
|
])
|
|
@@ -150,7 +150,7 @@ const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key:
|
|
|
150
150
|
O("div", Le, [
|
|
151
151
|
s(f).length ? (l(), r("table", {
|
|
152
152
|
key: 0,
|
|
153
|
-
class: C(
|
|
153
|
+
class: C(ve)
|
|
154
154
|
}, [
|
|
155
155
|
e.$slots.colgroup && !s(m) ? (l(), r("colgroup", Ue, [
|
|
156
156
|
a(e.$slots, "colgroup", d(g(h.value)))
|
|
@@ -243,11 +243,11 @@ const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key:
|
|
|
243
243
|
"onUpdate:page": o[3] || (o[3] = (t) => s(i).page = t)
|
|
244
244
|
}, null, 8, ["items-length", "items-per-page", "current-page", "page-options"])
|
|
245
245
|
])),
|
|
246
|
-
e.filterable && s(
|
|
246
|
+
e.filterable && s(v) ? (l(), b(je, {
|
|
247
247
|
key: 3,
|
|
248
248
|
filters: e.filters,
|
|
249
|
-
modelValue: s(
|
|
250
|
-
"onUpdate:modelValue": o[4] || (o[4] = (t) => Pe(
|
|
249
|
+
modelValue: s(v),
|
|
250
|
+
"onUpdate:modelValue": o[4] || (o[4] = (t) => Pe(v) ? v.value = t : null),
|
|
251
251
|
onApplyFilters: s(ue),
|
|
252
252
|
onClearFilters: s(de),
|
|
253
253
|
activeFilters: s(pe).byColumn
|