adverich-kun-ui 0.1.509 → 0.1.511
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
1
|
import { mergeModels as X, toRefs as $e, useModel as Fe, ref as S, watch as Y, computed as Z, onMounted as Pe, createElementBlock as n, openBlock as t, mergeProps as O, createCommentVNode as a, createElementVNode as C, renderSlot as r, createBlock as $, unref as s, toDisplayString as j, Fragment as _, withCtx as z, createVNode as F, normalizeClass as D, withDirectives as ee, vModelText as Ae, vShow as se, normalizeProps as p, guardReactiveProps as v, createSlots as oe, renderList as te, isRef as Me, nextTick as Ie } from "vue";
|
|
2
|
-
import { isMobile as
|
|
2
|
+
import { isMobile as m } from "../../../../utils/_platform.js";
|
|
3
3
|
import le from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
4
4
|
import Re from "../../../../icons/IconFilter.vue.js";
|
|
5
5
|
import Ee from "../../../../icons/IconSearch.vue.js";
|
|
@@ -37,7 +37,7 @@ const Ue = {
|
|
|
37
37
|
}),
|
|
38
38
|
emits: /* @__PURE__ */ X(["update:page", "update:itemsPerPage", "update:sortBy", "update:search", "focusOnSearch"], ["update:selectedItems"]),
|
|
39
39
|
setup(N, { emit: ne }) {
|
|
40
|
-
const k = ne,
|
|
40
|
+
const k = ne, f = N, P = $e(f), w = Fe(N, "selectedItems"), {
|
|
41
41
|
headers: K,
|
|
42
42
|
showExpand: A,
|
|
43
43
|
showSelect: M,
|
|
@@ -50,21 +50,21 @@ const Ue = {
|
|
|
50
50
|
items: ls,
|
|
51
51
|
searchable: U,
|
|
52
52
|
debounceTime: de
|
|
53
|
-
} = P, y = S(
|
|
54
|
-
Y(() =>
|
|
53
|
+
} = P, y = S(f.search);
|
|
54
|
+
Y(() => f.search, (e) => {
|
|
55
55
|
e !== y.value && (y.value = e);
|
|
56
56
|
});
|
|
57
|
-
const I = Z(() =>
|
|
57
|
+
const I = Z(() => f.headers.map((e) => {
|
|
58
58
|
var l, d;
|
|
59
59
|
const o = { ...e };
|
|
60
60
|
if ((e.columnType === "function" || e.columnType == "objectFunction" || e.columnType == "simpleFunction") && typeof e.columnFunction == "string") {
|
|
61
|
-
const i = (l =
|
|
61
|
+
const i = (l = f.functionMap) == null ? void 0 : l[e.columnFunction];
|
|
62
62
|
typeof i == "function" ? o.columnFunction = i : (console.warn(
|
|
63
63
|
`[KunTable] No se encontró la función "${e.columnFunction}" en functionMap`
|
|
64
64
|
), o.columnFunction = () => "");
|
|
65
65
|
}
|
|
66
66
|
if (e.columnFormat === "function" && typeof e.columnRowText == "string") {
|
|
67
|
-
const i = (d =
|
|
67
|
+
const i = (d = f.functionMap) == null ? void 0 : d[e.columnRowText];
|
|
68
68
|
typeof i == "function" ? o.columnRowText = i : (console.warn(
|
|
69
69
|
`[KunTable] No se encontró la función "${e.columnRowText}" en functionMap`
|
|
70
70
|
), o.columnRowText = () => "");
|
|
@@ -84,30 +84,30 @@ const Ue = {
|
|
|
84
84
|
toggleExpand: B,
|
|
85
85
|
isExpanded: x,
|
|
86
86
|
sortBy: c.sortBy,
|
|
87
|
-
hasActions:
|
|
87
|
+
hasActions: f.hasActions
|
|
88
88
|
})), Se = [os, ce.value], Ce = [ts, ie.value];
|
|
89
89
|
Pe(() => G());
|
|
90
|
-
const q = S(null),
|
|
90
|
+
const q = S(null), H = S(!0), T = S(!1);
|
|
91
91
|
function ke() {
|
|
92
92
|
Te();
|
|
93
93
|
}
|
|
94
94
|
function Te() {
|
|
95
|
-
|
|
95
|
+
m.value && (J(), Ie(() => {
|
|
96
96
|
q.value.focus();
|
|
97
97
|
}));
|
|
98
98
|
}
|
|
99
99
|
function G() {
|
|
100
|
-
|
|
100
|
+
m.value && (V.value = "w-fit", H.value = !1, T.value = !0, k("focusOnSearch", !1));
|
|
101
101
|
}
|
|
102
102
|
function J() {
|
|
103
|
-
|
|
103
|
+
m.value && (V.value = "w-full border", T.value = !1, H.value = !0, k("focusOnSearch", !0));
|
|
104
104
|
}
|
|
105
105
|
const V = S("w-full border max-w-sm");
|
|
106
106
|
return (e, o) => (t(), n("div", O({ class: Se }, e.$attrs, { style: { "user-select": "text" } }), [
|
|
107
107
|
s(U) || e.filterable || e.$slots.prependHeader || e.$slots.prependSearch || e.$slots.appendSearch ? (t(), n("div", Ue, [
|
|
108
|
-
T.value
|
|
108
|
+
T.value || !s(m) ? (t(), n("div", We, [
|
|
109
109
|
r(e.$slots, "prependHeader")
|
|
110
|
-
])),
|
|
110
|
+
])) : a("", !0),
|
|
111
111
|
w.value.length ? (t(), n("div", Qe, [
|
|
112
112
|
C("span", qe, "Se han seleccionado " + j(w.value.length) + " registros.", 1),
|
|
113
113
|
s(u).length !== s(h).length ? (t(), n(_, { key: 0 }, [
|
|
@@ -150,20 +150,20 @@ const Ue = {
|
|
|
150
150
|
"onUpdate:modelValue": o[3] || (o[3] = (l) => y.value = l),
|
|
151
151
|
type: "text",
|
|
152
152
|
placeholder: e.searchPlaceholder,
|
|
153
|
-
class: D(["w-full text-sm", s(
|
|
153
|
+
class: D(["w-full text-sm", s(m) ? "px-1" : "px-2 py-1"]),
|
|
154
154
|
ref_key: "searchRef",
|
|
155
155
|
ref: q,
|
|
156
156
|
onFocus: J,
|
|
157
157
|
onBlur: G
|
|
158
158
|
}, null, 42, Je), [
|
|
159
159
|
[Ae, y.value],
|
|
160
|
-
[se,
|
|
160
|
+
[se, H.value]
|
|
161
161
|
]),
|
|
162
162
|
ee(F(le, {
|
|
163
163
|
icon: Ee,
|
|
164
164
|
onClick: ke
|
|
165
165
|
}, null, 512), [
|
|
166
|
-
[se,
|
|
166
|
+
[se, T.value]
|
|
167
167
|
])
|
|
168
168
|
], 2)) : a("", !0),
|
|
169
169
|
r(e.$slots, "appendSearch")
|
|
@@ -174,10 +174,10 @@ const Ue = {
|
|
|
174
174
|
key: 0,
|
|
175
175
|
class: D(Ce)
|
|
176
176
|
}, [
|
|
177
|
-
e.$slots.colgroup && !s(
|
|
177
|
+
e.$slots.colgroup && !s(m) ? (t(), n("colgroup", Ye, [
|
|
178
178
|
r(e.$slots, "colgroup", p(v(g.value)))
|
|
179
179
|
])) : a("", !0),
|
|
180
|
-
!s(re) && !s(
|
|
180
|
+
!s(re) && !s(m) ? (t(), $(xe, {
|
|
181
181
|
key: 1,
|
|
182
182
|
headers: s(K),
|
|
183
183
|
"sort-by": s(c).sortBy,
|
|
@@ -195,7 +195,7 @@ const Ue = {
|
|
|
195
195
|
onToggleSelectAll: s(ve),
|
|
196
196
|
customHeaders: e.customSlots
|
|
197
197
|
}, null, 8, ["headers", "sort-by", "show-select", "show-expand", "all-selected", "more-than-paginated", "some-selected", "thead-class", "tr-class", "th-class", "has-actions", "action-label", "onSort", "onToggleSelectAll", "customHeaders"])) : r(e.$slots, "thead", p(O({ key: 2 }, g.value))),
|
|
198
|
-
s(
|
|
198
|
+
s(m) ? (t(), $(Ve, {
|
|
199
199
|
key: 4,
|
|
200
200
|
items: s(u),
|
|
201
201
|
headers: I.value,
|