adverich-kun-ui 0.1.597 → 0.1.598
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.
- package/AGENTS.md +2 -1
- package/dist/AGENTS.md +2 -1
- package/dist/components/KunTable/src/components/KunTable.vue.js +190 -169
- package/dist/components/KunTable/src/components/KunTableIterators.vue.js +42 -48
- package/dist/components/KunTable/src/components/KunTableRows.vue.js +27 -30
- package/dist/components/KunTable/src/composables/KunTableProps.js +2 -0
- package/dist/components/KunTable/src/composables/kunTableIteratorsProps.js +7 -3
- package/dist/components/KunTable/src/composables/kunTableRowsProps.js +7 -3
- package/dist/components/KunTable/src/composables/useRowKey.js +27 -0
- package/dist/components/KunTable/src/composables/useSelect.js +55 -34
- package/dist/components/KunTableServerSide/src/components/KunTableServerSide.vue.js +241 -227
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -317,7 +317,8 @@ const handleSort = (sortBy) => {
|
|
|
317
317
|
| showExpand | Boolean | false | Habilita expansión de filas |
|
|
318
318
|
| hasActions | Boolean | false | Muestra columna de acciones |
|
|
319
319
|
| actionLabel | String | 'Acciones' | Etiqueta de columna de acciones |
|
|
320
|
-
| actionLoadingMap | Object | {} | Mapa de estado loading por
|
|
320
|
+
| actionLoadingMap | Object | {} | Mapa de estado loading por `rowKey` |
|
|
321
|
+
| rowKey | String/Function | 'id' | Clave estable de fila. Fallback automático a `uuid`; también acepta función compuesta |
|
|
321
322
|
| itemsPerPage | Number | 10 | Items por página |
|
|
322
323
|
| page | Number | 1 | Página actual |
|
|
323
324
|
| sortBy | Array/String | [] | v-model: Criterio de ordenamiento |
|
package/dist/AGENTS.md
CHANGED
|
@@ -317,7 +317,8 @@ const handleSort = (sortBy) => {
|
|
|
317
317
|
| showExpand | Boolean | false | Habilita expansión de filas |
|
|
318
318
|
| hasActions | Boolean | false | Muestra columna de acciones |
|
|
319
319
|
| actionLabel | String | 'Acciones' | Etiqueta de columna de acciones |
|
|
320
|
-
| actionLoadingMap | Object | {} | Mapa de estado loading por
|
|
320
|
+
| actionLoadingMap | Object | {} | Mapa de estado loading por `rowKey` |
|
|
321
|
+
| rowKey | String/Function | 'id' | Clave estable de fila. Fallback automático a `uuid`; también acepta función compuesta |
|
|
321
322
|
| itemsPerPage | Number | 10 | Items por página |
|
|
322
323
|
| page | Number | 1 | Página actual |
|
|
323
324
|
| sortBy | Array/String | [] | v-model: Criterio de ordenamiento |
|
|
@@ -1,218 +1,237 @@
|
|
|
1
|
-
import { toRefs as
|
|
2
|
-
import { isMobile as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
|
|
1
|
+
import { toRefs as Re, useModel as Ee, ref as w, watch as se, computed as te, onMounted as Me, openBlock as l, createElementBlock as a, mergeProps as O, unref as s, renderSlot as i, createCommentVNode as r, createElementVNode as b, toDisplayString as z, Fragment as oe, createBlock as F, withCtx as D, createVNode as T, normalizeClass as j, withDirectives as le, vModelText as Be, vShow as ae, normalizeProps as d, guardReactiveProps as h, createSlots as re, renderList as ne, isRef as Ve, mergeModels as ie, nextTick as He } from "vue";
|
|
2
|
+
import { isMobile as u } from "../../../../utils/_platform.js";
|
|
3
|
+
import ce from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
4
|
+
import Ke from "../../../../icons/IconFilter.vue.js";
|
|
5
|
+
import Le from "../../../../icons/IconSearch.vue.js";
|
|
6
|
+
import Oe from "./KunTableHeaders.vue.js";
|
|
7
|
+
import ze from "./KunTableFooter.vue.js";
|
|
8
|
+
import De from "./KunTableRows.vue.js";
|
|
9
|
+
import je from "./KunTableIterators.vue.js";
|
|
10
|
+
import Ue from "../../../KunBtn/src/components/KunBtn.vue.js";
|
|
11
|
+
import xe from "./KunTableFilter.vue.js";
|
|
12
|
+
import Ne from "../composables/useExpand.js";
|
|
13
|
+
import We from "../composables/useOptions.js";
|
|
14
|
+
import Qe from "../composables/useSelect.js";
|
|
15
|
+
import qe from "../composables/useFilter.js";
|
|
16
|
+
import { resolveRowKeyValue as Ge } from "../composables/useRowKey.js";
|
|
17
|
+
import Je from "../composables/KunTableProps.js";
|
|
18
|
+
const Xe = {
|
|
18
19
|
key: 0,
|
|
19
20
|
class: "p-2 bg-surface print:hidden flex w-full justify-between"
|
|
20
|
-
},
|
|
21
|
+
}, Ye = {
|
|
21
22
|
key: 0,
|
|
22
23
|
class: "w-full flex items-center"
|
|
23
|
-
},
|
|
24
|
+
}, Ze = {
|
|
24
25
|
key: 1,
|
|
25
26
|
class: "inline-flex items-center justify-center whitespace-nowrap"
|
|
26
|
-
},
|
|
27
|
+
}, _e = { class: "pr-2" }, es = { class: "min-w-1/3 flex h-full items-center justify-end" }, ss = ["placeholder"], ts = { class: "flex-1 overflow-auto bg-surface" }, os = { key: 0 }, ls = { key: 5 }, as = {
|
|
27
28
|
key: 1,
|
|
28
29
|
class: "h-full flex justify-center items-center"
|
|
29
|
-
},
|
|
30
|
+
}, rs = { class: "text-center text-4xl" }, ns = {
|
|
30
31
|
key: 1,
|
|
31
32
|
class: "sticky bottom-0 z-10 print:hidden"
|
|
32
|
-
},
|
|
33
|
+
}, is = "overflow-hidden h-full w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", cs = "table-auto w-full h-fit text-sm text-left", As = {
|
|
33
34
|
__name: "KunTable",
|
|
34
|
-
props: /* @__PURE__ */
|
|
35
|
+
props: /* @__PURE__ */ ie(Je(), {
|
|
35
36
|
selectedItems: { type: Array, default: () => [] },
|
|
36
37
|
selectedItemsModifiers: {}
|
|
37
38
|
}),
|
|
38
|
-
emits: /* @__PURE__ */
|
|
39
|
-
setup(
|
|
40
|
-
const
|
|
41
|
-
headers:
|
|
42
|
-
showExpand:
|
|
43
|
-
showSelect:
|
|
39
|
+
emits: /* @__PURE__ */ ie(["update:page", "update:itemsPerPage", "update:sortBy", "update:search", "focusOnSearch"], ["update:selectedItems"]),
|
|
40
|
+
setup(U, { emit: de }) {
|
|
41
|
+
const S = de, p = U, P = Re(p), A = Ee(U, "selectedItems"), {
|
|
42
|
+
headers: x,
|
|
43
|
+
showExpand: I,
|
|
44
|
+
showSelect: R,
|
|
45
|
+
rowKey: ue,
|
|
44
46
|
rowClass: N,
|
|
45
|
-
hideDefaultFooter:
|
|
46
|
-
hideDefaultHeader:
|
|
47
|
-
tableClass:
|
|
48
|
-
wrapperClass:
|
|
49
|
-
pageOptions:
|
|
50
|
-
items:
|
|
51
|
-
searchable:
|
|
52
|
-
debounceTime:
|
|
53
|
-
} = P,
|
|
54
|
-
|
|
55
|
-
e !==
|
|
47
|
+
hideDefaultFooter: pe,
|
|
48
|
+
hideDefaultHeader: me,
|
|
49
|
+
tableClass: fe,
|
|
50
|
+
wrapperClass: he,
|
|
51
|
+
pageOptions: ge,
|
|
52
|
+
items: ds,
|
|
53
|
+
searchable: W,
|
|
54
|
+
debounceTime: ye
|
|
55
|
+
} = P, g = w(p.search);
|
|
56
|
+
se(() => p.search, (e) => {
|
|
57
|
+
e !== g.value && (g.value = e);
|
|
56
58
|
});
|
|
57
|
-
const k =
|
|
58
|
-
var
|
|
59
|
+
const k = te(() => p.headers.map((e) => {
|
|
60
|
+
var o;
|
|
59
61
|
const t = { ...e };
|
|
60
62
|
if (e.columnType === "function" && typeof e.columnFunction == "string") {
|
|
61
|
-
const
|
|
62
|
-
typeof
|
|
63
|
+
const n = (o = p.functionMap) == null ? void 0 : o[e.columnFunction];
|
|
64
|
+
typeof n == "function" ? t.columnFunction = n : t.columnFunction = () => "";
|
|
63
65
|
}
|
|
64
66
|
return t;
|
|
65
|
-
})), { filteredItems:
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
})), { filteredItems: y, setSearch: ve, modalFilter: v, applyColumnFilters: we, clearFilters: be, appliedFilters: Se } = qe(P, ye, k);
|
|
68
|
+
se(g, (e) => {
|
|
69
|
+
S("update:search", e), ve(e);
|
|
68
70
|
});
|
|
69
|
-
const { options:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
toggleSelect: B,
|
|
71
|
+
const { options: c, paginatedItems: m, updateSort: ke } = We(P, S, y, k), C = (e, t = -1) => Ge(e, ue.value, t), Q = (e, t = -1) => C(e, t) ?? `kun-table-row-${t}`, q = (e, t = -1) => {
|
|
72
|
+
var n;
|
|
73
|
+
const o = C(e, t);
|
|
74
|
+
return o === null ? !1 : ((n = p.actionLoadingMap) == null ? void 0 : n[o]) || !1;
|
|
75
|
+
}, {
|
|
75
76
|
isSelected: E,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
toggleSelect: M,
|
|
78
|
+
toggleSelectAll: Ce,
|
|
79
|
+
allSelected: G,
|
|
80
|
+
allFilteredSelected: J,
|
|
81
|
+
someSelected: $e,
|
|
82
|
+
moreThanPaginated: Fe,
|
|
83
|
+
clearSelection: X,
|
|
84
|
+
selectCompleteAll: Y
|
|
85
|
+
} = Qe(m, A, y, C), { isExpanded: B, toggleExpand: V } = Ne(), f = te(() => ({
|
|
86
|
+
items: m.value,
|
|
87
|
+
headers: x.value,
|
|
88
|
+
page: c.page,
|
|
89
|
+
itemsPerPage: c.itemsPerPage,
|
|
90
|
+
toggleSelect: M,
|
|
91
|
+
isSelected: E,
|
|
92
|
+
toggleExpand: V,
|
|
93
|
+
isExpanded: B,
|
|
94
|
+
sortBy: c.sortBy,
|
|
95
|
+
hasActions: p.hasActions,
|
|
96
|
+
getRowKey: C
|
|
97
|
+
})), Te = [is, he.value], Pe = [cs, fe.value];
|
|
98
|
+
Me(() => _());
|
|
99
|
+
const Z = w(null), H = w(!0), $ = w(!1);
|
|
100
|
+
function Ae() {
|
|
101
|
+
Ie();
|
|
85
102
|
}
|
|
86
|
-
function
|
|
87
|
-
|
|
88
|
-
|
|
103
|
+
function Ie() {
|
|
104
|
+
u.value && (ee(), He(() => {
|
|
105
|
+
Z.value.focus();
|
|
89
106
|
}));
|
|
90
107
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
108
|
+
function _() {
|
|
109
|
+
u.value && (K.value = "w-fit", H.value = !1, $.value = !0, S("focusOnSearch", !1));
|
|
93
110
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
111
|
+
function ee() {
|
|
112
|
+
u.value && (K.value = "w-full border", $.value = !1, H.value = !0, S("focusOnSearch", !0));
|
|
96
113
|
}
|
|
97
|
-
const
|
|
98
|
-
return (e, t) => (
|
|
99
|
-
s(
|
|
100
|
-
$.value || !s(
|
|
101
|
-
|
|
114
|
+
const K = w("w-full border max-w-sm");
|
|
115
|
+
return (e, t) => (l(), a("div", O({ class: Te }, e.$attrs, { style: { "user-select": "text" } }), [
|
|
116
|
+
s(W) || e.filterable || e.$slots.prependHeader || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), a("div", Xe, [
|
|
117
|
+
$.value || !s(u) ? (l(), a("div", Ye, [
|
|
118
|
+
i(e.$slots, "prependHeader")
|
|
102
119
|
])) : r("", !0),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
s(
|
|
106
|
-
s(
|
|
120
|
+
A.value.length ? (l(), a("div", Ze, [
|
|
121
|
+
b("span", _e, "Se han seleccionado " + z(A.value.length) + " registros.", 1),
|
|
122
|
+
s(m).length !== s(y).length ? (l(), a(oe, { key: 0 }, [
|
|
123
|
+
s(G) && !s(J) ? (l(), a("span", {
|
|
107
124
|
key: 0,
|
|
108
|
-
onClick: t[0] || (t[0] = (...
|
|
125
|
+
onClick: t[0] || (t[0] = (...o) => s(Y) && s(Y)(...o)),
|
|
109
126
|
class: "bg-secondary hover:!bg-blue-500 rounded cursor-pointer px-2 ml-2"
|
|
110
|
-
}, " Seleccionar todos los " +
|
|
111
|
-
s(
|
|
127
|
+
}, " Seleccionar todos los " + z(s(y).length) + " registros ", 1)) : r("", !0),
|
|
128
|
+
s(J) ? (l(), a("span", {
|
|
112
129
|
key: 1,
|
|
113
|
-
onClick: t[1] || (t[1] = (...
|
|
130
|
+
onClick: t[1] || (t[1] = (...o) => s(X) && s(X)(...o)),
|
|
114
131
|
class: "bg-secondary hover:!bg-blue-500 rounded cursor-pointer px-2 ml-2"
|
|
115
132
|
}, " Anular selección ")) : r("", !0)
|
|
116
133
|
], 64)) : r("", !0)
|
|
117
134
|
])) : r("", !0),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
e.filterable && e.filters.length ? (
|
|
135
|
+
b("div", es, [
|
|
136
|
+
i(e.$slots, "prependSearch"),
|
|
137
|
+
e.filterable && e.filters.length ? (l(), F(Ue, {
|
|
121
138
|
key: 0,
|
|
122
139
|
class: "h-fit",
|
|
123
|
-
onClick: t[2] || (t[2] = (
|
|
140
|
+
onClick: t[2] || (t[2] = (o) => v.value = !0),
|
|
124
141
|
rounded: "rounded-full",
|
|
125
142
|
size: "xs",
|
|
126
143
|
bgColor: "bg-green-200 dark:bg-green-800"
|
|
127
144
|
}, {
|
|
128
|
-
default:
|
|
129
|
-
T(
|
|
145
|
+
default: D(() => [
|
|
146
|
+
T(ce, {
|
|
130
147
|
class: "h-fit",
|
|
131
|
-
icon:
|
|
148
|
+
icon: Ke,
|
|
132
149
|
size: "text-lg"
|
|
133
150
|
})
|
|
134
151
|
]),
|
|
135
152
|
_: 1
|
|
136
153
|
})) : r("", !0),
|
|
137
|
-
s(
|
|
154
|
+
s(W) ? (l(), a("div", {
|
|
138
155
|
key: 1,
|
|
139
|
-
class:
|
|
156
|
+
class: j(["rounded flex mx-2", [K.value]])
|
|
140
157
|
}, [
|
|
141
|
-
|
|
142
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
158
|
+
le(b("input", {
|
|
159
|
+
"onUpdate:modelValue": t[3] || (t[3] = (o) => g.value = o),
|
|
143
160
|
type: "text",
|
|
144
161
|
placeholder: e.searchPlaceholder,
|
|
145
|
-
class:
|
|
162
|
+
class: j(["w-full text-sm", s(u) ? "px-1" : "px-2 py-1"]),
|
|
146
163
|
ref_key: "searchRef",
|
|
147
|
-
ref:
|
|
148
|
-
onFocus:
|
|
149
|
-
onBlur:
|
|
150
|
-
}, null, 42,
|
|
151
|
-
[
|
|
152
|
-
[
|
|
164
|
+
ref: Z,
|
|
165
|
+
onFocus: ee,
|
|
166
|
+
onBlur: _
|
|
167
|
+
}, null, 42, ss), [
|
|
168
|
+
[Be, g.value],
|
|
169
|
+
[ae, H.value]
|
|
153
170
|
]),
|
|
154
|
-
|
|
155
|
-
icon:
|
|
156
|
-
onClick:
|
|
171
|
+
le(T(ce, {
|
|
172
|
+
icon: Le,
|
|
173
|
+
onClick: Ae
|
|
157
174
|
}, null, 512), [
|
|
158
|
-
[
|
|
175
|
+
[ae, $.value]
|
|
159
176
|
])
|
|
160
177
|
], 2)) : r("", !0),
|
|
161
|
-
|
|
178
|
+
i(e.$slots, "appendSearch")
|
|
162
179
|
])
|
|
163
180
|
])) : r("", !0),
|
|
164
|
-
|
|
165
|
-
s(
|
|
181
|
+
b("div", ts, [
|
|
182
|
+
s(m).length ? (l(), a("table", {
|
|
166
183
|
key: 0,
|
|
167
|
-
class:
|
|
184
|
+
class: j(Pe)
|
|
168
185
|
}, [
|
|
169
|
-
e.$slots.colgroup && !s(
|
|
170
|
-
|
|
186
|
+
e.$slots.colgroup && !s(u) ? (l(), a("colgroup", os, [
|
|
187
|
+
i(e.$slots, "colgroup", d(h(f.value)))
|
|
171
188
|
])) : r("", !0),
|
|
172
|
-
!s(
|
|
189
|
+
!s(me) && !s(u) ? (l(), F(Oe, {
|
|
173
190
|
key: 1,
|
|
174
|
-
headers: s(
|
|
175
|
-
"sort-by": s(
|
|
176
|
-
"show-select": s(
|
|
177
|
-
"show-expand": s(
|
|
178
|
-
"all-selected": s(
|
|
179
|
-
"more-than-paginated": s(
|
|
180
|
-
"some-selected": s(
|
|
191
|
+
headers: s(x),
|
|
192
|
+
"sort-by": s(c).sortBy,
|
|
193
|
+
"show-select": s(R),
|
|
194
|
+
"show-expand": s(I),
|
|
195
|
+
"all-selected": s(G),
|
|
196
|
+
"more-than-paginated": s(Fe),
|
|
197
|
+
"some-selected": s($e),
|
|
181
198
|
"thead-class": e.theadClass,
|
|
182
199
|
"tr-class": e.trClass,
|
|
183
200
|
"th-class": e.thClass,
|
|
184
201
|
"has-actions": e.hasActions,
|
|
185
202
|
"action-label": e.actionLabel,
|
|
186
|
-
onSort: s(
|
|
187
|
-
onToggleSelectAll: s(
|
|
203
|
+
onSort: s(ke),
|
|
204
|
+
onToggleSelectAll: s(Ce),
|
|
188
205
|
customHeaders: e.customSlots
|
|
189
|
-
}, 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"])) :
|
|
190
|
-
s(
|
|
206
|
+
}, 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"])) : i(e.$slots, "thead", d(O({ key: 2 }, f.value))),
|
|
207
|
+
s(u) ? (l(), F(je, {
|
|
191
208
|
key: 4,
|
|
192
|
-
items: s(
|
|
209
|
+
items: s(m),
|
|
193
210
|
headers: k.value,
|
|
194
211
|
"row-class": s(N),
|
|
195
212
|
"row-class-condition": e.rowClassCondition,
|
|
196
213
|
"is-selected": s(E),
|
|
197
|
-
"is-expanded": s(
|
|
198
|
-
"show-select": s(
|
|
199
|
-
"show-expand": s(
|
|
214
|
+
"is-expanded": s(B),
|
|
215
|
+
"show-select": s(R),
|
|
216
|
+
"show-expand": s(I),
|
|
200
217
|
"has-actions": e.hasActions,
|
|
201
218
|
"action-loading-map": e.actionLoadingMap,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
219
|
+
"item-key": Q,
|
|
220
|
+
onToggleExpand: s(V),
|
|
221
|
+
onToggleSelect: s(M),
|
|
222
|
+
customSlots: e.customSlots,
|
|
223
|
+
"get-action-loading": q
|
|
224
|
+
}, re({ _: 2 }, [
|
|
225
|
+
ne(e.$slots, (o, n) => ({
|
|
226
|
+
name: n,
|
|
227
|
+
fn: D((L) => [
|
|
228
|
+
i(e.$slots, n, d(h(L)))
|
|
210
229
|
])
|
|
211
230
|
}))
|
|
212
|
-
]), 1032, ["items", "headers", "row-class", "row-class-condition", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"])) : (
|
|
213
|
-
|
|
214
|
-
T(
|
|
215
|
-
items: s(
|
|
231
|
+
]), 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(), a(oe, { key: 3 }, [
|
|
232
|
+
i(e.$slots, "body.prepend", d(h(f.value))),
|
|
233
|
+
T(De, {
|
|
234
|
+
items: s(m),
|
|
216
235
|
headers: k.value,
|
|
217
236
|
"tbody-class": e.tbodyClass,
|
|
218
237
|
"row-class": s(N),
|
|
@@ -222,54 +241,56 @@ const Ke = {
|
|
|
222
241
|
"selected-class": e.selectedClass,
|
|
223
242
|
"striped-class": e.stripedClass,
|
|
224
243
|
"is-selected": s(E),
|
|
225
|
-
"is-expanded": s(
|
|
226
|
-
"show-select": s(
|
|
227
|
-
"show-expand": s(
|
|
244
|
+
"is-expanded": s(B),
|
|
245
|
+
"show-select": s(R),
|
|
246
|
+
"show-expand": s(I),
|
|
228
247
|
"has-actions": e.hasActions,
|
|
229
248
|
"action-loading-map": e.actionLoadingMap,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
249
|
+
"item-key": Q,
|
|
250
|
+
onToggleExpand: s(V),
|
|
251
|
+
onToggleSelect: s(M),
|
|
252
|
+
customSlots: e.customSlots,
|
|
253
|
+
"get-action-loading": q
|
|
254
|
+
}, re({ _: 2 }, [
|
|
255
|
+
ne(e.$slots, (o, n) => ({
|
|
256
|
+
name: n,
|
|
257
|
+
fn: D((L) => [
|
|
258
|
+
i(e.$slots, n, d(h(L)))
|
|
238
259
|
])
|
|
239
260
|
}))
|
|
240
261
|
]), 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"]),
|
|
241
|
-
|
|
262
|
+
i(e.$slots, "body.append", d(h(f.value)))
|
|
242
263
|
], 64)),
|
|
243
|
-
e.$slots.tfoot ? (
|
|
244
|
-
|
|
264
|
+
e.$slots.tfoot ? (l(), a("tfoot", ls, [
|
|
265
|
+
i(e.$slots, "tfoot", d(h(f.value)))
|
|
245
266
|
])) : r("", !0)
|
|
246
267
|
])) : r("", !0),
|
|
247
|
-
s(
|
|
248
|
-
|
|
268
|
+
s(m).length ? r("", !0) : (l(), a("div", as, [
|
|
269
|
+
b("div", rs, z(e.noDataText), 1)
|
|
249
270
|
]))
|
|
250
271
|
]),
|
|
251
|
-
s(
|
|
252
|
-
T(
|
|
253
|
-
"items-length": s(
|
|
254
|
-
"items-per-page": s(
|
|
255
|
-
"current-page": s(
|
|
256
|
-
"page-options": s(
|
|
257
|
-
"onUpdate:itemsPerPage": t[4] || (t[4] = (
|
|
258
|
-
"onUpdate:page": t[5] || (t[5] = (
|
|
272
|
+
s(pe) ? i(e.$slots, "footer", d(O({ key: 2 }, f.value))) : (l(), a("div", ns, [
|
|
273
|
+
T(ze, {
|
|
274
|
+
"items-length": s(y).length,
|
|
275
|
+
"items-per-page": s(c).itemsPerPage,
|
|
276
|
+
"current-page": s(c).page,
|
|
277
|
+
"page-options": s(ge),
|
|
278
|
+
"onUpdate:itemsPerPage": t[4] || (t[4] = (o) => s(c).itemsPerPage = o),
|
|
279
|
+
"onUpdate:page": t[5] || (t[5] = (o) => s(c).page = o)
|
|
259
280
|
}, null, 8, ["items-length", "items-per-page", "current-page", "page-options"])
|
|
260
281
|
])),
|
|
261
|
-
e.filterable && s(
|
|
282
|
+
e.filterable && s(v) ? (l(), F(xe, {
|
|
262
283
|
key: 3,
|
|
263
284
|
filters: e.filters,
|
|
264
|
-
modelValue: s(
|
|
265
|
-
"onUpdate:modelValue": t[6] || (t[6] = (
|
|
266
|
-
onApplyFilters: s(
|
|
267
|
-
onClearFilters: s(
|
|
268
|
-
activeFilters: s(
|
|
285
|
+
modelValue: s(v),
|
|
286
|
+
"onUpdate:modelValue": t[6] || (t[6] = (o) => Ve(v) ? v.value = o : null),
|
|
287
|
+
onApplyFilters: s(we),
|
|
288
|
+
onClearFilters: s(be),
|
|
289
|
+
activeFilters: s(Se).byColumn
|
|
269
290
|
}, null, 8, ["filters", "modelValue", "onApplyFilters", "onClearFilters", "activeFilters"])) : r("", !0)
|
|
270
291
|
], 16));
|
|
271
292
|
}
|
|
272
293
|
};
|
|
273
294
|
export {
|
|
274
|
-
|
|
295
|
+
As as default
|
|
275
296
|
};
|
|
@@ -1,58 +1,52 @@
|
|
|
1
|
-
import { openBlock as l, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
import { kunTableIteratorsProps as
|
|
4
|
-
const
|
|
1
|
+
import { openBlock as l, createElementBlock as r, Fragment as i, renderList as p, createVNode as f, mergeProps as g, createSlots as h, withCtx as w, renderSlot as c, createElementVNode as S, createCommentVNode as k } from "vue";
|
|
2
|
+
import E from "./KunTableIterator.vue.js";
|
|
3
|
+
import { kunTableIteratorsProps as $ } from "../composables/kunTableIteratorsProps.js";
|
|
4
|
+
const T = { class: "h-full w-full flex flex-col bg-blue-800" }, b = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "px-4 pb-2"
|
|
7
|
-
},
|
|
7
|
+
}, A = {
|
|
8
8
|
__name: "KunTableIterators",
|
|
9
|
-
props:
|
|
9
|
+
props: $,
|
|
10
10
|
emits: ["toggle-expand", "toggle-select", "row-click"],
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
return (e,
|
|
14
|
-
(l(!0),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fn: k((h) => {
|
|
36
|
-
var p;
|
|
37
|
-
return [
|
|
38
|
-
f(e.$slots, i, u({ ref_for: !0 }, { ...h, item: o, index: t, loading: ((p = e.actionLoadingMap) == null ? void 0 : p[o.id]) || !1 }))
|
|
39
|
-
];
|
|
40
|
-
})
|
|
41
|
-
}))
|
|
42
|
-
]), 1040, ["item", "index", "headers", "show-expand", "show-select", "is-expanded", "is-selected", "has-actions", "loading", "onToggleExpand", "onToggleSelect", "customSlots"]),
|
|
43
|
-
e.isExpanded(o) ? (l(), a("div", x, [
|
|
44
|
-
f(e.$slots, "expand", {
|
|
45
|
-
item: o,
|
|
46
|
-
index: t
|
|
47
|
-
}, () => [
|
|
48
|
-
s[1] || (s[1] = E("div", { class: "text-center text-sm opacity-70" }, "No hay contenido expandido.", -1))
|
|
11
|
+
setup(v, { emit: u }) {
|
|
12
|
+
const a = u;
|
|
13
|
+
return (e, t) => (l(), r("div", T, [
|
|
14
|
+
(l(!0), r(i, null, p(e.items, (o, s) => (l(), r(i, {
|
|
15
|
+
key: e.itemKey(o, s)
|
|
16
|
+
}, [
|
|
17
|
+
f(E, g({
|
|
18
|
+
item: o,
|
|
19
|
+
index: s,
|
|
20
|
+
headers: e.headers,
|
|
21
|
+
"show-expand": e.showExpand,
|
|
22
|
+
"show-select": e.showSelect,
|
|
23
|
+
"is-expanded": e.isExpanded(o),
|
|
24
|
+
"is-selected": e.isSelected(o),
|
|
25
|
+
"has-actions": e.hasActions,
|
|
26
|
+
loading: e.getActionLoading(o, s),
|
|
27
|
+
onToggleExpand: (n) => a("toggle-expand", o),
|
|
28
|
+
onToggleSelect: (n) => a("toggle-select", o),
|
|
29
|
+
onRowClick: t[0] || (t[0] = (n) => a("row-click", n))
|
|
30
|
+
}, { ref_for: !0 }, e.$attrs, { customSlots: e.customSlots }), h({ _: 2 }, [
|
|
31
|
+
p(e.$slots, (n, d) => ({
|
|
32
|
+
name: d,
|
|
33
|
+
fn: w((m) => [
|
|
34
|
+
c(e.$slots, d, g({ ref_for: !0 }, { ...m, item: o, index: s, loading: e.getActionLoading(o, s) }))
|
|
49
35
|
])
|
|
50
|
-
|
|
51
|
-
],
|
|
52
|
-
|
|
36
|
+
}))
|
|
37
|
+
]), 1040, ["item", "index", "headers", "show-expand", "show-select", "is-expanded", "is-selected", "has-actions", "loading", "onToggleExpand", "onToggleSelect", "customSlots"]),
|
|
38
|
+
e.isExpanded(o) ? (l(), r("div", b, [
|
|
39
|
+
c(e.$slots, "expand", {
|
|
40
|
+
item: o,
|
|
41
|
+
index: s
|
|
42
|
+
}, () => [
|
|
43
|
+
t[1] || (t[1] = S("div", { class: "text-center text-sm opacity-70" }, "No hay contenido expandido.", -1))
|
|
44
|
+
])
|
|
45
|
+
])) : k("", !0)
|
|
46
|
+
], 64))), 128))
|
|
53
47
|
]));
|
|
54
48
|
}
|
|
55
49
|
};
|
|
56
50
|
export {
|
|
57
|
-
|
|
51
|
+
A as default
|
|
58
52
|
};
|