adverich-kun-ui 0.1.504 → 0.1.505
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,15 +1,15 @@
|
|
|
1
|
-
import { mergeModels as X, toRefs as Te, useModel as
|
|
1
|
+
import { mergeModels as X, toRefs as Te, useModel as $e, ref as C, watch as Y, computed as Z, onMounted as Fe, createElementBlock as n, openBlock as l, mergeProps as O, createCommentVNode as a, createElementVNode as g, renderSlot as r, createBlock as T, unref as s, toDisplayString as z, withCtx as D, createVNode as $, normalizeClass as N, withDirectives as _, vModelText as Pe, vShow as ee, normalizeProps as d, guardReactiveProps as v, Fragment as Ae, createSlots as se, renderList as oe, isRef as Me, nextTick as Ie } from "vue";
|
|
2
2
|
import { isMobile as f } from "../../../../utils/_platform.js";
|
|
3
3
|
import te from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import Re from "../../../../icons/IconFilter.vue.js";
|
|
5
|
+
import Ee from "../../../../icons/IconSearch.vue.js";
|
|
6
|
+
import xe from "./KunTableHeaders.vue.js";
|
|
7
7
|
import Be from "./KunTableFooter.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import He from "./KunTableRows.vue.js";
|
|
9
|
+
import Ve from "./KunTableIterators.vue.js";
|
|
10
|
+
import Oe from "../../../KunBtn/src/components/KunBtn.vue.js";
|
|
11
|
+
import ze from "./KunTableFilter.vue.js";
|
|
12
|
+
import De from "../composables/useExpand.js";
|
|
13
13
|
import Ne from "../composables/useOptions.js";
|
|
14
14
|
import je from "../composables/useSelect.js";
|
|
15
15
|
import Ke from "../composables/useFilter.js";
|
|
@@ -34,7 +34,7 @@ const Ue = {
|
|
|
34
34
|
}),
|
|
35
35
|
emits: /* @__PURE__ */ X(["update:page", "update:itemsPerPage", "update:sortBy", "update:search", "focusOnSearch"], ["update:selectedItems"]),
|
|
36
36
|
setup(j, { emit: le }) {
|
|
37
|
-
const k = le, p = j,
|
|
37
|
+
const k = le, p = j, F = Te(p), w = $e(j, "selectedItems"), {
|
|
38
38
|
headers: K,
|
|
39
39
|
showExpand: P,
|
|
40
40
|
showSelect: A,
|
|
@@ -47,7 +47,7 @@ const Ue = {
|
|
|
47
47
|
items: ls,
|
|
48
48
|
searchable: U,
|
|
49
49
|
debounceTime: ue
|
|
50
|
-
} =
|
|
50
|
+
} = F, y = C(p.search);
|
|
51
51
|
Y(() => p.search, (e) => {
|
|
52
52
|
e !== y.value && (y.value = e);
|
|
53
53
|
});
|
|
@@ -67,51 +67,51 @@ const Ue = {
|
|
|
67
67
|
), o.columnRowText = () => "");
|
|
68
68
|
}
|
|
69
69
|
return o;
|
|
70
|
-
})), { filteredItems: b, setSearch: de, modalFilter: S, applyColumnFilters: pe, clearFilters: me, appliedFilters: fe } = Ke(
|
|
70
|
+
})), { filteredItems: b, setSearch: de, modalFilter: S, applyColumnFilters: pe, clearFilters: me, appliedFilters: fe } = Ke(F, ue, M);
|
|
71
71
|
Y(y, (e) => {
|
|
72
72
|
k("update:search", e), de(e);
|
|
73
73
|
});
|
|
74
|
-
const { options: c, paginatedItems: m, updateSort: he } = Ne(
|
|
74
|
+
const { options: c, paginatedItems: m, updateSort: he } = Ne(F, k, b), { isSelected: I, toggleSelect: R, toggleSelectAll: ge, allSelected: ve, someSelected: we, moreThanPaginated: ye, clearSelection: W, selectCompleteAll: Q } = je(m, w, b), { isExpanded: E, toggleExpand: x } = De(), h = Z(() => ({
|
|
75
75
|
items: m.value,
|
|
76
76
|
headers: K.value,
|
|
77
77
|
page: c.page,
|
|
78
78
|
itemsPerPage: c.itemsPerPage,
|
|
79
|
-
toggleSelect:
|
|
80
|
-
isSelected:
|
|
81
|
-
toggleExpand:
|
|
82
|
-
isExpanded:
|
|
79
|
+
toggleSelect: R,
|
|
80
|
+
isSelected: I,
|
|
81
|
+
toggleExpand: x,
|
|
82
|
+
isExpanded: E,
|
|
83
83
|
sortBy: c.sortBy,
|
|
84
84
|
hasActions: p.hasActions
|
|
85
85
|
})), be = [os, ie.value], Se = [ts, re.value];
|
|
86
|
-
|
|
87
|
-
const q = C(null), B = C(!0),
|
|
86
|
+
Fe(() => G());
|
|
87
|
+
const q = C(null), B = C(!0), H = C(!1);
|
|
88
88
|
function Ce() {
|
|
89
89
|
ke();
|
|
90
90
|
}
|
|
91
91
|
function ke() {
|
|
92
|
-
f.value && (J(),
|
|
92
|
+
f.value && (J(), Ie(() => {
|
|
93
93
|
q.value.focus();
|
|
94
94
|
}));
|
|
95
95
|
}
|
|
96
96
|
function G() {
|
|
97
|
-
f.value && (
|
|
97
|
+
f.value && (V.value = "w-fit", B.value = !1, H.value = !0, k("focusOnSearch", !1));
|
|
98
98
|
}
|
|
99
99
|
function J() {
|
|
100
|
-
f.value && (
|
|
100
|
+
f.value && (V.value = "w-full border", H.value = !1, B.value = !0, k("focusOnSearch", !0));
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
return (e, o) => (l(), n("div",
|
|
104
|
-
s(U) || e.filterable || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), n("div", Ue, [
|
|
102
|
+
const V = C("w-full border max-w-sm");
|
|
103
|
+
return (e, o) => (l(), n("div", O({ class: be }, e.$attrs, { style: { "user-select": "text" } }), [
|
|
104
|
+
s(U) || e.filterable || e.$slots.prependHeader || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), n("div", Ue, [
|
|
105
105
|
g("div", We, [
|
|
106
|
-
r(e.$slots, "
|
|
106
|
+
r(e.$slots, "prependHeader")
|
|
107
107
|
]),
|
|
108
108
|
w.value.length ? (l(), n("div", Qe, [
|
|
109
|
-
g("span", qe, "Se han seleccionado " +
|
|
109
|
+
g("span", qe, "Se han seleccionado " + z(w.value.length) + " registros.", 1),
|
|
110
110
|
s(m).length === w.value.length ? (l(), n("span", {
|
|
111
111
|
key: 0,
|
|
112
112
|
class: "bg-secondary hover:!bg-blue-500 rounded cursor-pointer px-2",
|
|
113
113
|
onClick: o[0] || (o[0] = (...t) => s(Q) && s(Q)(...t))
|
|
114
|
-
}, "Seleccionar todos los " +
|
|
114
|
+
}, "Seleccionar todos los " + z(s(b).length) + " registros", 1)) : a("", !0),
|
|
115
115
|
s(b).length === w.value.length ? (l(), n("span", {
|
|
116
116
|
key: 1,
|
|
117
117
|
class: "bg-secondary hover:!bg-blue-500 rounded cursor-pointer px-2",
|
|
@@ -119,7 +119,8 @@ const Ue = {
|
|
|
119
119
|
}, "Anular selección")) : a("", !0)
|
|
120
120
|
])) : a("", !0),
|
|
121
121
|
g("div", Ge, [
|
|
122
|
-
e
|
|
122
|
+
r(e.$slots, "prependSearch"),
|
|
123
|
+
e.filterable && e.filters.length ? (l(), T(Oe, {
|
|
123
124
|
key: 0,
|
|
124
125
|
class: "h-fit",
|
|
125
126
|
onClick: o[2] || (o[2] = (t) => S.value = !0),
|
|
@@ -127,10 +128,10 @@ const Ue = {
|
|
|
127
128
|
size: "xs",
|
|
128
129
|
bgColor: "bg-green-200 dark:bg-green-800"
|
|
129
130
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
|
|
131
|
+
default: D(() => [
|
|
132
|
+
$(te, {
|
|
132
133
|
class: "h-fit",
|
|
133
|
-
icon:
|
|
134
|
+
icon: Re,
|
|
134
135
|
size: "text-lg"
|
|
135
136
|
})
|
|
136
137
|
]),
|
|
@@ -138,7 +139,7 @@ const Ue = {
|
|
|
138
139
|
})) : a("", !0),
|
|
139
140
|
s(U) ? (l(), n("div", {
|
|
140
141
|
key: 1,
|
|
141
|
-
class: N(["rounded flex mx-2", [
|
|
142
|
+
class: N(["rounded flex mx-2", [V.value]])
|
|
142
143
|
}, [
|
|
143
144
|
_(g("input", {
|
|
144
145
|
"onUpdate:modelValue": o[3] || (o[3] = (t) => y.value = t),
|
|
@@ -153,11 +154,11 @@ const Ue = {
|
|
|
153
154
|
[Pe, y.value],
|
|
154
155
|
[ee, B.value]
|
|
155
156
|
]),
|
|
156
|
-
_(
|
|
157
|
-
icon:
|
|
157
|
+
_($(te, {
|
|
158
|
+
icon: Ee,
|
|
158
159
|
onClick: Ce
|
|
159
160
|
}, null, 512), [
|
|
160
|
-
[ee,
|
|
161
|
+
[ee, H.value]
|
|
161
162
|
])
|
|
162
163
|
], 2)) : a("", !0),
|
|
163
164
|
r(e.$slots, "appendSearch")
|
|
@@ -171,7 +172,7 @@ const Ue = {
|
|
|
171
172
|
e.$slots.colgroup && !s(f) ? (l(), n("colgroup", Ye, [
|
|
172
173
|
r(e.$slots, "colgroup", d(v(h.value)))
|
|
173
174
|
])) : a("", !0),
|
|
174
|
-
!s(ae) && !s(f) ? (l(), T(
|
|
175
|
+
!s(ae) && !s(f) ? (l(), T(xe, {
|
|
175
176
|
key: 1,
|
|
176
177
|
headers: s(K),
|
|
177
178
|
"sort-by": s(c).sortBy,
|
|
@@ -188,32 +189,32 @@ const Ue = {
|
|
|
188
189
|
onSort: s(he),
|
|
189
190
|
onToggleSelectAll: s(ge),
|
|
190
191
|
customHeaders: e.customSlots
|
|
191
|
-
}, 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", d(
|
|
192
|
-
s(f) ? (l(), T(
|
|
192
|
+
}, 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", d(O({ key: 2 }, h.value))),
|
|
193
|
+
s(f) ? (l(), T(Ve, {
|
|
193
194
|
key: 4,
|
|
194
195
|
items: s(m),
|
|
195
196
|
headers: M.value,
|
|
196
197
|
"row-class": s(L),
|
|
197
198
|
"row-class-condition": e.rowClassCondition,
|
|
198
|
-
"is-selected": s(
|
|
199
|
-
"is-expanded": s(
|
|
199
|
+
"is-selected": s(I),
|
|
200
|
+
"is-expanded": s(E),
|
|
200
201
|
"show-select": s(A),
|
|
201
202
|
"show-expand": s(P),
|
|
202
203
|
"has-actions": e.hasActions,
|
|
203
204
|
"action-loading-map": e.actionLoadingMap,
|
|
204
|
-
onToggleExpand: s(
|
|
205
|
-
onToggleSelect: s(
|
|
205
|
+
onToggleExpand: s(x),
|
|
206
|
+
onToggleSelect: s(R),
|
|
206
207
|
customSlots: e.customSlots
|
|
207
208
|
}, se({ _: 2 }, [
|
|
208
209
|
oe(e.$slots, (t, u) => ({
|
|
209
210
|
name: u,
|
|
210
|
-
fn:
|
|
211
|
+
fn: D((i) => [
|
|
211
212
|
r(e.$slots, u, d(v(i)))
|
|
212
213
|
])
|
|
213
214
|
}))
|
|
214
215
|
]), 1032, ["items", "headers", "row-class", "row-class-condition", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"])) : (l(), n(Ae, { key: 3 }, [
|
|
215
216
|
r(e.$slots, "body.prepend", d(v(h.value))),
|
|
216
|
-
|
|
217
|
+
$(He, {
|
|
217
218
|
items: s(m),
|
|
218
219
|
headers: M.value,
|
|
219
220
|
"tbody-class": e.tbodyClass,
|
|
@@ -223,19 +224,19 @@ const Ue = {
|
|
|
223
224
|
"td-class": e.tdClass,
|
|
224
225
|
"selected-class": e.selectedClass,
|
|
225
226
|
"striped-class": e.stripedClass,
|
|
226
|
-
"is-selected": s(
|
|
227
|
-
"is-expanded": s(
|
|
227
|
+
"is-selected": s(I),
|
|
228
|
+
"is-expanded": s(E),
|
|
228
229
|
"show-select": s(A),
|
|
229
230
|
"show-expand": s(P),
|
|
230
231
|
"has-actions": e.hasActions,
|
|
231
232
|
"action-loading-map": e.actionLoadingMap,
|
|
232
|
-
onToggleExpand: s(
|
|
233
|
-
onToggleSelect: s(
|
|
233
|
+
onToggleExpand: s(x),
|
|
234
|
+
onToggleSelect: s(R),
|
|
234
235
|
customSlots: e.customSlots
|
|
235
236
|
}, se({ _: 2 }, [
|
|
236
237
|
oe(e.$slots, (t, u) => ({
|
|
237
238
|
name: u,
|
|
238
|
-
fn:
|
|
239
|
+
fn: D((i) => [
|
|
239
240
|
r(e.$slots, u, d(v(i)))
|
|
240
241
|
])
|
|
241
242
|
}))
|
|
@@ -247,11 +248,11 @@ const Ue = {
|
|
|
247
248
|
])) : a("", !0)
|
|
248
249
|
])) : a("", !0),
|
|
249
250
|
s(m).length ? a("", !0) : (l(), n("div", _e, [
|
|
250
|
-
g("div", es,
|
|
251
|
+
g("div", es, z(e.noDataText), 1)
|
|
251
252
|
]))
|
|
252
253
|
]),
|
|
253
|
-
s(ne) ? r(e.$slots, "footer", d(
|
|
254
|
-
|
|
254
|
+
s(ne) ? r(e.$slots, "footer", d(O({ key: 2 }, h.value))) : (l(), n("div", ss, [
|
|
255
|
+
$(Be, {
|
|
255
256
|
"items-length": s(b).length,
|
|
256
257
|
"items-per-page": s(c).itemsPerPage,
|
|
257
258
|
"current-page": s(c).page,
|
|
@@ -260,7 +261,7 @@ const Ue = {
|
|
|
260
261
|
"onUpdate:page": o[5] || (o[5] = (t) => s(c).page = t)
|
|
261
262
|
}, null, 8, ["items-length", "items-per-page", "current-page", "page-options"])
|
|
262
263
|
])),
|
|
263
|
-
e.filterable && s(S) ? (l(), T(
|
|
264
|
+
e.filterable && s(S) ? (l(), T(ze, {
|
|
264
265
|
key: 3,
|
|
265
266
|
filters: e.filters,
|
|
266
267
|
modelValue: s(S),
|