adverich-kun-ui 0.1.317 → 0.1.319
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,163 +1,163 @@
|
|
|
1
|
-
import { mergeModels as W, toRefs as be, useModel as Se, ref as
|
|
2
|
-
import { isMobile as
|
|
1
|
+
import { mergeModels as W, toRefs as be, useModel as Se, ref as v, watch as Q, computed as q, onMounted as Ce, createElementBlock as r, openBlock as l, mergeProps as B, createCommentVNode as u, createElementVNode as V, renderSlot as a, createBlock as b, unref as s, normalizeClass as S, withCtx as j, createVNode as C, withDirectives as G, vModelText as Te, vShow as J, normalizeProps as d, guardReactiveProps as g, Fragment as ke, createSlots as X, renderList as Y, toDisplayString as Fe, isRef as $e, nextTick as Pe } from "vue";
|
|
2
|
+
import { isMobile as m } from "../../../../utils/_platform.js";
|
|
3
3
|
import Z from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import xe from "
|
|
13
|
-
import ze from "../composables/
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, Qe = {
|
|
4
|
+
import Me from "../../../../icons/IconFilter.vue.js";
|
|
5
|
+
import Ae from "../../../../icons/IconSearch.vue.js";
|
|
6
|
+
import Ie from "./KunTableHeaders.vue.js";
|
|
7
|
+
import Re from "./KunTableFooter.vue.js";
|
|
8
|
+
import Ee from "./KunTableRows.vue.js";
|
|
9
|
+
import Be from "./KunTableIterators.vue.js";
|
|
10
|
+
import Ve from "../../../KunBtn/src/components/KunBtn.vue.js";
|
|
11
|
+
import je from "./KunTableFilter.vue.js";
|
|
12
|
+
import xe from "../composables/useExpand.js";
|
|
13
|
+
import ze from "../composables/useOptions.js";
|
|
14
|
+
import De from "../composables/useSelect.js";
|
|
15
|
+
import He from "../composables/useFilter.js";
|
|
16
|
+
import Ne from "../composables/KunTableProps.js";
|
|
17
|
+
const Ke = ["placeholder"], Le = { class: "flex-1 overflow-auto" }, Ue = { key: 0 }, Oe = { key: 5 }, We = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "h-full flex justify-center items-center"
|
|
20
|
+
}, Qe = { class: "text-center text-4xl" }, qe = {
|
|
22
21
|
key: 1,
|
|
23
22
|
class: "sticky bottom-0 z-10 print:hidden"
|
|
24
|
-
},
|
|
23
|
+
}, Ge = "overflow-hidden h-full w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", Je = "table-auto w-full h-fit text-sm text-left", ps = {
|
|
25
24
|
__name: "KunTable",
|
|
26
|
-
props: /* @__PURE__ */ W(
|
|
25
|
+
props: /* @__PURE__ */ W(Ne(), {
|
|
27
26
|
selectedItems: { type: Array, default: () => [] },
|
|
28
27
|
selectedItemsModifiers: {}
|
|
29
28
|
}),
|
|
30
29
|
emits: /* @__PURE__ */ W(["update:page", "update:itemsPerPage", "update:sortBy", "update:search"], ["update:selectedItems"]),
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
headers:
|
|
34
|
-
showExpand:
|
|
30
|
+
setup(x, { emit: _ }) {
|
|
31
|
+
const z = _, p = x, T = be(p), ee = Se(x, "selectedItems"), {
|
|
32
|
+
headers: D,
|
|
33
|
+
showExpand: k,
|
|
35
34
|
showSelect: F,
|
|
36
|
-
rowClass:
|
|
35
|
+
rowClass: H,
|
|
37
36
|
hideDefaultFooter: se,
|
|
38
37
|
hideDefaultHeader: oe,
|
|
39
38
|
tableClass: te,
|
|
40
39
|
wrapperClass: le,
|
|
41
40
|
pageOptions: ae,
|
|
42
41
|
items: ne,
|
|
43
|
-
searchable:
|
|
42
|
+
searchable: N,
|
|
44
43
|
debounceTime: re
|
|
45
|
-
} = T, w =
|
|
46
|
-
Q(() =>
|
|
44
|
+
} = T, w = v(p.search);
|
|
45
|
+
Q(() => p.search, (e) => {
|
|
47
46
|
e !== w.value && (w.value = e);
|
|
48
47
|
});
|
|
49
|
-
const { filteredItems: ie, setSearch: ce, modalFilter:
|
|
48
|
+
const { filteredItems: ie, setSearch: ce, modalFilter: y, applyColumnFilters: ue, clearFilters: de, appliedFilters: pe } = He(T, re);
|
|
50
49
|
Q(w, (e) => {
|
|
51
|
-
|
|
50
|
+
z("update:search", e), ce(e);
|
|
52
51
|
});
|
|
53
|
-
const { options:
|
|
52
|
+
const { options: i, paginatedItems: f, updateSort: me } = ze(T, z, ie), { isSelected: $, toggleSelect: P, toggleSelectAll: fe, allSelected: he, someSelected: ge } = De(f, ee), { isExpanded: M, toggleExpand: A } = xe(), h = q(() => ({
|
|
54
53
|
items: f.value,
|
|
55
|
-
headers:
|
|
56
|
-
page:
|
|
57
|
-
itemsPerPage:
|
|
54
|
+
headers: D.value,
|
|
55
|
+
page: i.page,
|
|
56
|
+
itemsPerPage: i.itemsPerPage,
|
|
58
57
|
toggleSelect: P,
|
|
59
|
-
isSelected:
|
|
58
|
+
isSelected: $,
|
|
60
59
|
toggleExpand: A,
|
|
61
60
|
isExpanded: M,
|
|
62
|
-
sortBy:
|
|
63
|
-
hasActions:
|
|
64
|
-
})), we = [
|
|
65
|
-
var t,
|
|
61
|
+
sortBy: i.sortBy,
|
|
62
|
+
hasActions: p.hasActions
|
|
63
|
+
})), we = [Ge, le.value], ye = [Je, te.value], K = q(() => p.headers.map((e) => {
|
|
64
|
+
var t, c;
|
|
66
65
|
const o = { ...e };
|
|
67
66
|
if ((e.columnType === "function" || e.columnType == "objectFunction" || e.columnType == "simpleFunction") && typeof e.columnFunction == "string") {
|
|
68
|
-
const n = (t =
|
|
67
|
+
const n = (t = p.functionMap) == null ? void 0 : t[e.columnFunction];
|
|
69
68
|
typeof n == "function" ? o.columnFunction = n : (console.warn(
|
|
70
69
|
`[KunTable] No se encontró la función "${e.columnFunction}" en functionMap`
|
|
71
70
|
), o.columnFunction = () => "");
|
|
72
71
|
}
|
|
73
72
|
if (e.columnFormat === "function" && typeof e.columnRowText == "string") {
|
|
74
|
-
const n = (
|
|
73
|
+
const n = (c = p.functionMap) == null ? void 0 : c[e.columnRowText];
|
|
75
74
|
typeof n == "function" ? o.columnRowText = n : (console.warn(
|
|
76
75
|
`[KunTable] No se encontró la función "${e.columnRowText}" en functionMap`
|
|
77
76
|
), o.columnRowText = () => "");
|
|
78
77
|
}
|
|
79
78
|
return o;
|
|
80
79
|
}));
|
|
81
|
-
Ce(() =>
|
|
82
|
-
const
|
|
83
|
-
function
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
Ce(() => U());
|
|
81
|
+
const L = v(null), I = v(!0), R = v(!1);
|
|
82
|
+
function ve() {
|
|
83
|
+
m.value && (O(), Pe(() => {
|
|
84
|
+
L.value.focus();
|
|
86
85
|
}));
|
|
87
86
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
87
|
+
function U() {
|
|
88
|
+
m.value && (E.value = "w-fit", I.value = !1, R.value = !0);
|
|
90
89
|
}
|
|
91
90
|
function O() {
|
|
92
|
-
|
|
91
|
+
m.value && (E.value = "w-full border", R.value = !1, I.value = !0);
|
|
93
92
|
}
|
|
94
|
-
const E =
|
|
95
|
-
return (e, o) => (l(),
|
|
96
|
-
s(
|
|
93
|
+
const E = v("w-full border max-w-sm");
|
|
94
|
+
return (e, o) => (l(), r("div", B({ class: we }, e.$attrs, { style: { "user-select": "text" } }), [
|
|
95
|
+
s(N) || e.filterable || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), r("div", {
|
|
97
96
|
key: 0,
|
|
98
|
-
class:
|
|
97
|
+
class: S(["p-2 bg-slate-200 dark:bg-slate-800 print:hidden", {
|
|
99
98
|
"justify-start flex": e.searchPosition === "start",
|
|
100
99
|
"justify-center flex": e.searchPosition === "center",
|
|
101
100
|
"justify-end flex": e.searchPosition === "end"
|
|
102
101
|
}])
|
|
103
102
|
}, [
|
|
104
103
|
a(e.$slots, "prependSearch"),
|
|
105
|
-
e.filterable && e.filters.length ? (l(),
|
|
104
|
+
e.filterable && e.filters.length ? (l(), b(Ve, {
|
|
106
105
|
key: 0,
|
|
107
106
|
class: "h-fit",
|
|
108
|
-
onClick: o[0] || (o[0] = (t) =>
|
|
107
|
+
onClick: o[0] || (o[0] = (t) => y.value = !0),
|
|
109
108
|
rounded: "rounded-full",
|
|
110
109
|
size: "xs",
|
|
111
110
|
bgColor: "bg-green-200 dark:bg-green-800"
|
|
112
111
|
}, {
|
|
113
|
-
default:
|
|
114
|
-
|
|
112
|
+
default: j(() => [
|
|
113
|
+
C(Z, {
|
|
115
114
|
class: "h-fit",
|
|
116
|
-
icon:
|
|
115
|
+
icon: Me,
|
|
117
116
|
size: "text-lg"
|
|
118
117
|
})
|
|
119
118
|
]),
|
|
120
119
|
_: 1
|
|
121
120
|
})) : u("", !0),
|
|
122
|
-
s(
|
|
121
|
+
s(N) ? (l(), r("div", {
|
|
123
122
|
key: 1,
|
|
124
|
-
class:
|
|
123
|
+
class: S(["rounded flex mx-2", [E.value]])
|
|
125
124
|
}, [
|
|
126
125
|
G(V("input", {
|
|
127
126
|
"onUpdate:modelValue": o[1] || (o[1] = (t) => w.value = t),
|
|
128
127
|
type: "text",
|
|
129
128
|
placeholder: e.searchPlaceholder,
|
|
130
|
-
class:
|
|
129
|
+
class: S(["w-full text-sm", s(m) ? "px-1" : "px-2 py-1"]),
|
|
131
130
|
ref_key: "searchRef",
|
|
132
|
-
ref:
|
|
131
|
+
ref: L,
|
|
133
132
|
onFocus: O,
|
|
134
|
-
onBlur:
|
|
135
|
-
}, null, 42,
|
|
133
|
+
onBlur: U
|
|
134
|
+
}, null, 42, Ke), [
|
|
136
135
|
[Te, w.value],
|
|
137
136
|
[J, I.value]
|
|
138
137
|
]),
|
|
139
|
-
G(
|
|
140
|
-
icon:
|
|
141
|
-
onClick:
|
|
138
|
+
G(C(Z, {
|
|
139
|
+
icon: Ae,
|
|
140
|
+
onClick: ve
|
|
142
141
|
}, null, 512), [
|
|
143
142
|
[J, R.value]
|
|
144
143
|
])
|
|
145
144
|
], 2)) : u("", !0),
|
|
146
145
|
a(e.$slots, "appendSearch")
|
|
147
146
|
], 2)) : u("", !0),
|
|
148
|
-
V("div",
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
V("div", Le, [
|
|
148
|
+
s(f).length ? (l(), r("table", {
|
|
149
|
+
key: 0,
|
|
150
|
+
class: S(ye)
|
|
151
151
|
}, [
|
|
152
|
-
e.$slots.colgroup && !s(
|
|
152
|
+
e.$slots.colgroup && !s(m) ? (l(), r("colgroup", Ue, [
|
|
153
153
|
a(e.$slots, "colgroup", d(g(h.value)))
|
|
154
154
|
])) : u("", !0),
|
|
155
|
-
!s(oe) && !s(
|
|
155
|
+
!s(oe) && !s(m) ? (l(), b(Ie, {
|
|
156
156
|
key: 1,
|
|
157
|
-
headers: s(
|
|
158
|
-
"sort-by": s(
|
|
157
|
+
headers: s(D),
|
|
158
|
+
"sort-by": s(i).sortBy,
|
|
159
159
|
"show-select": s(F),
|
|
160
|
-
"show-expand": s(
|
|
160
|
+
"show-expand": s(k),
|
|
161
161
|
"all-selected": s(he),
|
|
162
162
|
"some-selected": s(ge),
|
|
163
163
|
"thead-class": e.theadClass,
|
|
@@ -166,88 +166,85 @@ const Le = ["placeholder"], Ue = { class: "flex-1 overflow-auto" }, He = { key:
|
|
|
166
166
|
"has-actions": e.hasActions,
|
|
167
167
|
"action-label": e.actionLabel,
|
|
168
168
|
onSort: s(me),
|
|
169
|
-
onToggleSelectAll: s(fe)
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
onToggleSelectAll: s(fe),
|
|
170
|
+
customHeaders: e.customSlots
|
|
171
|
+
}, null, 8, ["headers", "sort-by", "show-select", "show-expand", "all-selected", "some-selected", "thead-class", "tr-class", "th-class", "has-actions", "action-label", "onSort", "onToggleSelectAll", "customHeaders"])) : a(e.$slots, "thead", d(B({ key: 2 }, h.value))),
|
|
172
|
+
s(m) ? (l(), b(Be, {
|
|
173
|
+
key: 4,
|
|
174
|
+
items: s(f),
|
|
175
|
+
headers: K.value,
|
|
176
|
+
"row-class": s(H),
|
|
177
|
+
"row-class-condition": e.rowClassCondition,
|
|
178
|
+
"is-selected": s($),
|
|
179
|
+
"is-expanded": s(M),
|
|
180
|
+
"show-select": s(F),
|
|
181
|
+
"show-expand": s(k),
|
|
182
|
+
"has-actions": e.hasActions,
|
|
183
|
+
"action-loading-map": e.actionLoadingMap,
|
|
184
|
+
onToggleExpand: s(A),
|
|
185
|
+
onToggleSelect: s(P),
|
|
186
|
+
customSlots: e.customSlots
|
|
187
|
+
}, X({ _: 2 }, [
|
|
188
|
+
Y(e.$slots, (t, c) => ({
|
|
189
|
+
name: c,
|
|
190
|
+
fn: j((n) => [
|
|
191
|
+
a(e.$slots, c, d(g(n)))
|
|
192
|
+
])
|
|
193
|
+
}))
|
|
194
|
+
]), 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(), r(ke, { key: 3 }, [
|
|
172
195
|
a(e.$slots, "body.prepend", d(g(h.value))),
|
|
173
|
-
|
|
196
|
+
C(Ee, {
|
|
174
197
|
items: s(f),
|
|
175
|
-
headers:
|
|
198
|
+
headers: K.value,
|
|
176
199
|
"tbody-class": e.tbodyClass,
|
|
177
|
-
"row-class": s(
|
|
200
|
+
"row-class": s(H),
|
|
178
201
|
"row-class-condition": e.rowClassCondition,
|
|
179
202
|
"tr-class": e.trClass,
|
|
180
203
|
"td-class": e.tdClass,
|
|
181
204
|
"selected-class": e.selectedClass,
|
|
182
205
|
"striped-class": e.stripedClass,
|
|
183
|
-
"is-selected": s(
|
|
206
|
+
"is-selected": s($),
|
|
184
207
|
"is-expanded": s(M),
|
|
185
208
|
"show-select": s(F),
|
|
186
|
-
"show-expand": s(
|
|
209
|
+
"show-expand": s(k),
|
|
187
210
|
"has-actions": e.hasActions,
|
|
188
211
|
"action-loading-map": e.actionLoadingMap,
|
|
189
212
|
onToggleExpand: s(A),
|
|
190
213
|
onToggleSelect: s(P),
|
|
191
214
|
customSlots: e.customSlots
|
|
192
215
|
}, X({ _: 2 }, [
|
|
193
|
-
Y(e.$slots, (t,
|
|
194
|
-
name:
|
|
195
|
-
fn:
|
|
196
|
-
a(e.$slots,
|
|
216
|
+
Y(e.$slots, (t, c) => ({
|
|
217
|
+
name: c,
|
|
218
|
+
fn: j((n) => [
|
|
219
|
+
a(e.$slots, c, d(g(n)))
|
|
197
220
|
])
|
|
198
221
|
}))
|
|
199
222
|
]), 1032, ["items", "headers", "tbody-class", "row-class", "row-class-condition", "tr-class", "td-class", "selected-class", "striped-class", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"]),
|
|
200
223
|
a(e.$slots, "body.append", d(g(h.value)))
|
|
201
|
-
], 64))
|
|
202
|
-
|
|
203
|
-
items: s(f),
|
|
204
|
-
headers: L.value,
|
|
205
|
-
"row-class": s(D),
|
|
206
|
-
"row-class-condition": e.rowClassCondition,
|
|
207
|
-
"is-selected": s(k),
|
|
208
|
-
"is-expanded": s(M),
|
|
209
|
-
"show-select": s(F),
|
|
210
|
-
"show-expand": s($),
|
|
211
|
-
"has-actions": e.hasActions,
|
|
212
|
-
"action-loading-map": e.actionLoadingMap,
|
|
213
|
-
onToggleExpand: s(A),
|
|
214
|
-
onToggleSelect: s(P),
|
|
215
|
-
customSlots: e.customSlots
|
|
216
|
-
}, X({ _: 2 }, [
|
|
217
|
-
Y(e.$slots, (t, i) => ({
|
|
218
|
-
name: i,
|
|
219
|
-
fn: x((n) => [
|
|
220
|
-
a(e.$slots, i, d(g(n)))
|
|
221
|
-
])
|
|
222
|
-
}))
|
|
223
|
-
]), 1032, ["items", "headers", "row-class", "row-class-condition", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"])) : u("", !0),
|
|
224
|
-
e.$slots.tfoot ? (l(), c("tfoot", Oe, [
|
|
224
|
+
], 64)),
|
|
225
|
+
e.$slots.tfoot ? (l(), r("tfoot", Oe, [
|
|
225
226
|
a(e.$slots, "tfoot", d(g(h.value)))
|
|
226
227
|
])) : u("", !0)
|
|
227
|
-
]),
|
|
228
|
-
s(f).length ? u("", !0) : (l(),
|
|
229
|
-
|
|
230
|
-
class: "h-full flex justify-center items-center text-center",
|
|
231
|
-
title: e.noDataText,
|
|
232
|
-
titleSize: "text-4xl"
|
|
233
|
-
}, null, 8, ["title"])
|
|
228
|
+
])) : u("", !0),
|
|
229
|
+
s(f).length ? u("", !0) : (l(), r("div", We, [
|
|
230
|
+
V("div", Qe, Fe(e.noDataText), 1)
|
|
234
231
|
]))
|
|
235
232
|
]),
|
|
236
|
-
s(se) ? a(e.$slots, "footer", d(B({ key: 2 }, h.value))) : (l(),
|
|
237
|
-
|
|
233
|
+
s(se) ? a(e.$slots, "footer", d(B({ key: 2 }, h.value))) : (l(), r("div", qe, [
|
|
234
|
+
C(Re, {
|
|
238
235
|
"items-length": s(ne).length,
|
|
239
|
-
"items-per-page": s(
|
|
240
|
-
"current-page": s(
|
|
236
|
+
"items-per-page": s(i).itemsPerPage,
|
|
237
|
+
"current-page": s(i).page,
|
|
241
238
|
"page-options": s(ae),
|
|
242
|
-
"onUpdate:itemsPerPage": o[2] || (o[2] = (t) => s(
|
|
243
|
-
"onUpdate:page": o[3] || (o[3] = (t) => s(
|
|
239
|
+
"onUpdate:itemsPerPage": o[2] || (o[2] = (t) => s(i).itemsPerPage = t),
|
|
240
|
+
"onUpdate:page": o[3] || (o[3] = (t) => s(i).page = t)
|
|
244
241
|
}, null, 8, ["items-length", "items-per-page", "current-page", "page-options"])
|
|
245
242
|
])),
|
|
246
|
-
e.filterable && s(
|
|
243
|
+
e.filterable && s(y) ? (l(), b(je, {
|
|
247
244
|
key: 3,
|
|
248
245
|
filters: e.filters,
|
|
249
|
-
modelValue: s(
|
|
250
|
-
"onUpdate:modelValue": o[4] || (o[4] = (t) =>
|
|
246
|
+
modelValue: s(y),
|
|
247
|
+
"onUpdate:modelValue": o[4] || (o[4] = (t) => $e(y) ? y.value = t : null),
|
|
251
248
|
onApplyFilters: s(ue),
|
|
252
249
|
onClearFilters: s(de),
|
|
253
250
|
activeFilters: s(pe).byColumn
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as $, onMounted as E, watch as f, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { ref as $, onMounted as E, watch as f, createElementBlock as r, openBlock as a, normalizeClass as o, createElementVNode as k, createCommentVNode as u, renderSlot as g, Fragment as T, renderList as D, normalizeStyle as H, createBlock as h, resolveDynamicComponent as b, toDisplayString as x } from "vue";
|
|
2
|
+
import O from "../../../../icons/IconArrowUp.vue.js";
|
|
3
|
+
import j from "../../../../icons/IconArrowDown.vue.js";
|
|
4
|
+
import z from "../../../../icons/IconArrowDownUp.vue.js";
|
|
5
|
+
const I = { key: 0 }, L = { key: 1 }, N = ["checked", "aria-checked"], R = ["onClick"], U = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "inline-flex items-center gap-1 ml-1 print:hidden"
|
|
8
|
-
},
|
|
8
|
+
}, V = "bg-slate-200 dark:bg-slate-800 sticky top-0 z-5", F = "", K = "px-3 py-2 text-xs font-medium text-slate-700 dark:text-slate-300 uppercase tracking-wider", Q = {
|
|
9
9
|
__name: "KunTableHeaders",
|
|
10
10
|
props: {
|
|
11
11
|
headers: Array,
|
|
@@ -20,7 +20,7 @@ const L = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
|
|
|
20
20
|
thClass: String,
|
|
21
21
|
hasActions: Boolean,
|
|
22
22
|
actionLabel: String,
|
|
23
|
-
|
|
23
|
+
customHeaders: Object
|
|
24
24
|
},
|
|
25
25
|
emits: ["toggle-select-all", "sort", "expandAll", "collapseAll"],
|
|
26
26
|
setup(l, { emit: S }) {
|
|
@@ -44,30 +44,30 @@ const L = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
|
|
|
44
44
|
}
|
|
45
45
|
const w = (s) => {
|
|
46
46
|
const n = B(s);
|
|
47
|
-
return n ? n === "asc" ?
|
|
48
|
-
}, A = [
|
|
47
|
+
return n ? n === "asc" ? O : j : z;
|
|
48
|
+
}, A = [V, t.theadClass], v = [F, t.trClass], i = [K, t.thClass], y = $(null), m = () => {
|
|
49
49
|
y.value && (y.value.indeterminate = t.someSelected && !t.allSelected);
|
|
50
50
|
};
|
|
51
|
-
return E(m), f(() => t.someSelected, m), f(() => t.allSelected, m), (s, n) => (
|
|
52
|
-
class:
|
|
51
|
+
return E(m), f(() => t.someSelected, m), f(() => t.allSelected, m), (s, n) => (a(), r("thead", {
|
|
52
|
+
class: o(A)
|
|
53
53
|
}, [
|
|
54
54
|
k("tr", {
|
|
55
|
-
class:
|
|
55
|
+
class: o(v)
|
|
56
56
|
}, [
|
|
57
|
-
l.showExpand ? (
|
|
57
|
+
l.showExpand ? (a(), r("th", {
|
|
58
58
|
key: 0,
|
|
59
|
-
class:
|
|
59
|
+
class: o([i])
|
|
60
60
|
}, [
|
|
61
|
-
s.$slots.expandIcon ? g(s.$slots, "expand-icon", { key: 0 }) : (
|
|
61
|
+
s.$slots.expandIcon ? g(s.$slots, "expand-icon", { key: 0 }) : (a(), r("button", {
|
|
62
62
|
key: 1,
|
|
63
63
|
onClick: n[0] || (n[0] = (e) => l.isExpanded ? c("expandAll") : c("collapseAll"))
|
|
64
64
|
}, [
|
|
65
|
-
l.isExpanded ? (
|
|
65
|
+
l.isExpanded ? (a(), r("span", I, "−")) : (a(), r("span", L, "+"))
|
|
66
66
|
]))
|
|
67
67
|
], 2)) : u("", !0),
|
|
68
|
-
l.showSelect ? (
|
|
68
|
+
l.showSelect ? (a(), r("th", {
|
|
69
69
|
key: 1,
|
|
70
|
-
class:
|
|
70
|
+
class: o([i, "h-full w-10 flex flex-col items-center justify-center"])
|
|
71
71
|
}, [
|
|
72
72
|
k("input", {
|
|
73
73
|
ref_key: "checkboxRef",
|
|
@@ -77,17 +77,17 @@ const L = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
|
|
|
77
77
|
"aria-checked": l.someSelected && !l.allSelected ? "mixed" : l.allSelected ? "true" : "false",
|
|
78
78
|
onChange: p,
|
|
79
79
|
class: "h-6 w-6 text-blue-600 transition-all duration-200 ease-in-out rounded print:hidden border-gray-300 dark:border-slate-600 checked:bg-blue-600 checked:border-blue-600 indeterminate:bg-blue-400 indeterminate:border-blue-400"
|
|
80
|
-
}, null, 40,
|
|
80
|
+
}, null, 40, N)
|
|
81
81
|
])) : u("", !0),
|
|
82
|
-
(
|
|
82
|
+
(a(!0), r(T, null, D(l.headers, (e) => {
|
|
83
83
|
var d;
|
|
84
|
-
return
|
|
84
|
+
return a(), r("th", {
|
|
85
85
|
key: e.key,
|
|
86
|
-
class:
|
|
86
|
+
class: o([i, e.headerAlign === "right" ? "text-right" : e.headerAlign === "left" ? "text-left" : "text-center"]),
|
|
87
87
|
onClick: (M) => C(e),
|
|
88
|
-
style:
|
|
88
|
+
style: H({ cursor: e.sortable ? "pointer" : "default" })
|
|
89
89
|
}, [
|
|
90
|
-
(d = l.
|
|
90
|
+
(d = l.customHeaders) != null && d[`header.${e.value}`] ? (a(), h(b(l.customHeaders[`header.${e.value}`]), {
|
|
91
91
|
key: 0,
|
|
92
92
|
header: e
|
|
93
93
|
}, null, 8, ["header"])) : g(s.$slots, `header.${e.key}`, {
|
|
@@ -95,15 +95,15 @@ const L = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
|
|
|
95
95
|
header: e
|
|
96
96
|
}, () => [
|
|
97
97
|
k("span", null, x(e.label ?? e.text), 1),
|
|
98
|
-
e.sortable ? (
|
|
99
|
-
(
|
|
98
|
+
e.sortable ? (a(), r("span", U, [
|
|
99
|
+
(a(), h(b(w(e)), { class: "w-4 h-4 text-gray-500" }))
|
|
100
100
|
])) : u("", !0)
|
|
101
101
|
])
|
|
102
|
-
], 14,
|
|
102
|
+
], 14, R);
|
|
103
103
|
}), 128)),
|
|
104
|
-
l.hasActions ? (
|
|
104
|
+
l.hasActions ? (a(), r("th", {
|
|
105
105
|
key: 2,
|
|
106
|
-
class:
|
|
106
|
+
class: o([[i], "text-center print:hidden"])
|
|
107
107
|
}, x(l.actionLabel), 3)) : u("", !0)
|
|
108
108
|
])
|
|
109
109
|
]));
|
|
@@ -56,6 +56,7 @@ const t = () => ({
|
|
|
56
56
|
loadingText: { type: String, default: "Cargando..." },
|
|
57
57
|
// Slots control
|
|
58
58
|
customSlots: { type: Object, default: () => ({}) },
|
|
59
|
+
customHeaders: { type: Object, default: () => ({}) },
|
|
59
60
|
showTopSlot: { type: Boolean, default: !1 },
|
|
60
61
|
showBottomSlot: { type: Boolean, default: !1 },
|
|
61
62
|
functionMap: { type: Object, default: () => ({}) }
|