adverich-kun-ui 0.1.597 → 0.1.599

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 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 ID de item |
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 ID de item |
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 Fe, useModel as Te, ref as b, watch as X, computed as Y, onMounted as Pe, openBlock as o, createElementBlock as a, mergeProps as z, unref as s, renderSlot as n, createCommentVNode as r, createElementVNode as S, toDisplayString as D, Fragment as Z, createBlock as F, withCtx as j, createVNode as T, normalizeClass as x, withDirectives as _, vModelText as Ae, vShow as ee, normalizeProps as u, guardReactiveProps as g, createSlots as se, renderList as te, isRef as Ie, mergeModels as oe, nextTick as Ee } from "vue";
2
- import { isMobile as p } from "../../../../utils/_platform.js";
3
- import le from "../../../KunIcon/src/components/KunIcon.vue.js";
4
- import Be from "../../../../icons/IconFilter.vue.js";
5
- import Me from "../../../../icons/IconSearch.vue.js";
6
- import He from "./KunTableHeaders.vue.js";
7
- import Ve from "./KunTableFooter.vue.js";
8
- import Oe from "./KunTableRows.vue.js";
9
- import Re from "./KunTableIterators.vue.js";
10
- import ze from "../../../KunBtn/src/components/KunBtn.vue.js";
11
- import De from "./KunTableFilter.vue.js";
12
- import je from "../composables/useExpand.js";
13
- import xe from "../composables/useOptions.js";
14
- import Le from "../composables/useSelect.js";
15
- import Ue from "../composables/useFilter.js";
16
- import Ne from "../composables/KunTableProps.js";
17
- const Ke = {
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
- }, We = {
21
+ }, Ye = {
21
22
  key: 0,
22
23
  class: "w-full flex items-center"
23
- }, Qe = {
24
+ }, Ze = {
24
25
  key: 1,
25
26
  class: "inline-flex items-center justify-center whitespace-nowrap"
26
- }, qe = { class: "pr-2" }, Ge = { class: "min-w-1/3 flex h-full items-center justify-end" }, Je = ["placeholder"], Xe = { class: "flex-1 overflow-auto bg-surface" }, Ye = { key: 0 }, Ze = { key: 5 }, _e = {
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
- }, es = { class: "text-center text-4xl" }, ss = {
30
+ }, rs = { class: "text-center text-4xl" }, ns = {
30
31
  key: 1,
31
32
  class: "sticky bottom-0 z-10 print:hidden"
32
- }, ts = "overflow-hidden h-full w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", os = "table-auto w-full h-fit text-sm text-left", Ss = {
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__ */ oe(Ne(), {
35
+ props: /* @__PURE__ */ ie(Je(), {
35
36
  selectedItems: { type: Array, default: () => [] },
36
37
  selectedItemsModifiers: {}
37
38
  }),
38
- emits: /* @__PURE__ */ oe(["update:page", "update:itemsPerPage", "update:sortBy", "update:search", "focusOnSearch"], ["update:selectedItems"]),
39
- setup(L, { emit: ae }) {
40
- const C = ae, m = L, P = Fe(m), v = Te(L, "selectedItems"), {
41
- headers: U,
42
- showExpand: A,
43
- showSelect: I,
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: re,
46
- hideDefaultHeader: ne,
47
- tableClass: ie,
48
- wrapperClass: ce,
49
- pageOptions: de,
50
- items: ls,
51
- searchable: K,
52
- debounceTime: ue
53
- } = P, y = b(m.search);
54
- X(() => m.search, (e) => {
55
- e !== y.value && (y.value = 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 = Y(() => m.headers.map((e) => {
58
- var l;
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 d = (l = m.functionMap) == null ? void 0 : l[e.columnFunction];
62
- typeof d == "function" ? t.columnFunction = d : t.columnFunction = () => "";
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: f, setSearch: pe, modalFilter: w, applyColumnFilters: me, clearFilters: fe, appliedFilters: he } = Ue(P, ue, k);
66
- X(y, (e) => {
67
- C("update:search", e), pe(e);
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: i, paginatedItems: c, updateSort: ge } = xe(P, C, f, k), { isSelected: E, toggleSelect: B, toggleSelectAll: ve, allSelected: ye, someSelected: we, moreThanPaginated: be, clearSelection: W, selectCompleteAll: Q } = Le(c, v, f), { isExpanded: M, toggleExpand: H } = je(), h = Y(() => ({
70
- items: c.value,
71
- headers: U.value,
72
- page: i.page,
73
- itemsPerPage: i.itemsPerPage,
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
- toggleExpand: H,
77
- isExpanded: M,
78
- sortBy: i.sortBy,
79
- hasActions: m.hasActions
80
- })), Se = [ts, ce.value], Ce = [os, ie.value];
81
- Pe(() => G());
82
- const q = b(null), V = b(!0), $ = b(!1);
83
- function ke() {
84
- $e();
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 $e() {
87
- p.value && (J(), Ee(() => {
88
- q.value.focus();
103
+ function Ie() {
104
+ u.value && (ee(), He(() => {
105
+ Z.value.focus();
89
106
  }));
90
107
  }
91
- function G() {
92
- p.value && (O.value = "w-fit", V.value = !1, $.value = !0, C("focusOnSearch", !1));
108
+ function _() {
109
+ u.value && (K.value = "w-fit", H.value = !1, $.value = !0, S("focusOnSearch", !1));
93
110
  }
94
- function J() {
95
- p.value && (O.value = "w-full border", $.value = !1, V.value = !0, C("focusOnSearch", !0));
111
+ function ee() {
112
+ u.value && (K.value = "w-full border", $.value = !1, H.value = !0, S("focusOnSearch", !0));
96
113
  }
97
- const O = b("w-full border max-w-sm");
98
- return (e, t) => (o(), a("div", z({ class: Se }, e.$attrs, { style: { "user-select": "text" } }), [
99
- s(K) || e.filterable || e.$slots.prependHeader || e.$slots.prependSearch || e.$slots.appendSearch ? (o(), a("div", Ke, [
100
- $.value || !s(p) ? (o(), a("div", We, [
101
- n(e.$slots, "prependHeader")
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
- v.value.length ? (o(), a("div", Qe, [
104
- S("span", qe, "Se han seleccionado " + D(v.value.length) + " registros.", 1),
105
- s(c).length !== s(f).length ? (o(), a(Z, { key: 0 }, [
106
- s(c).length === v.value.length ? (o(), a("span", {
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] = (...l) => s(Q) && s(Q)(...l)),
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 " + D(s(f).length) + " registros ", 1)) : r("", !0),
111
- s(f).length === v.value.length ? (o(), a("span", {
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] = (...l) => s(W) && s(W)(...l)),
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
- S("div", Ge, [
119
- n(e.$slots, "prependSearch"),
120
- e.filterable && e.filters.length ? (o(), F(ze, {
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] = (l) => w.value = !0),
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: j(() => [
129
- T(le, {
145
+ default: D(() => [
146
+ T(ce, {
130
147
  class: "h-fit",
131
- icon: Be,
148
+ icon: Ke,
132
149
  size: "text-lg"
133
150
  })
134
151
  ]),
135
152
  _: 1
136
153
  })) : r("", !0),
137
- s(K) ? (o(), a("div", {
154
+ s(W) ? (l(), a("div", {
138
155
  key: 1,
139
- class: x(["rounded flex mx-2", [O.value]])
156
+ class: j(["rounded flex mx-2", [K.value]])
140
157
  }, [
141
- _(S("input", {
142
- "onUpdate:modelValue": t[3] || (t[3] = (l) => y.value = l),
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: x(["w-full text-sm", s(p) ? "px-1" : "px-2 py-1"]),
162
+ class: j(["w-full text-sm", s(u) ? "px-1" : "px-2 py-1"]),
146
163
  ref_key: "searchRef",
147
- ref: q,
148
- onFocus: J,
149
- onBlur: G
150
- }, null, 42, Je), [
151
- [Ae, y.value],
152
- [ee, V.value]
164
+ ref: Z,
165
+ onFocus: ee,
166
+ onBlur: _
167
+ }, null, 42, ss), [
168
+ [Be, g.value],
169
+ [ae, H.value]
153
170
  ]),
154
- _(T(le, {
155
- icon: Me,
156
- onClick: ke
171
+ le(T(ce, {
172
+ icon: Le,
173
+ onClick: Ae
157
174
  }, null, 512), [
158
- [ee, $.value]
175
+ [ae, $.value]
159
176
  ])
160
177
  ], 2)) : r("", !0),
161
- n(e.$slots, "appendSearch")
178
+ i(e.$slots, "appendSearch")
162
179
  ])
163
180
  ])) : r("", !0),
164
- S("div", Xe, [
165
- s(c).length ? (o(), a("table", {
181
+ b("div", ts, [
182
+ s(m).length ? (l(), a("table", {
166
183
  key: 0,
167
- class: x(Ce)
184
+ class: j(Pe)
168
185
  }, [
169
- e.$slots.colgroup && !s(p) ? (o(), a("colgroup", Ye, [
170
- n(e.$slots, "colgroup", u(g(h.value)))
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(ne) && !s(p) ? (o(), F(He, {
189
+ !s(me) && !s(u) ? (l(), F(Oe, {
173
190
  key: 1,
174
- headers: s(U),
175
- "sort-by": s(i).sortBy,
176
- "show-select": s(I),
177
- "show-expand": s(A),
178
- "all-selected": s(ye),
179
- "more-than-paginated": s(be),
180
- "some-selected": s(we),
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(ge),
187
- onToggleSelectAll: s(ve),
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"])) : n(e.$slots, "thead", u(z({ key: 2 }, h.value))),
190
- s(p) ? (o(), F(Re, {
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(c),
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(M),
198
- "show-select": s(I),
199
- "show-expand": s(A),
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
- onToggleExpand: s(H),
203
- onToggleSelect: s(B),
204
- customSlots: e.customSlots
205
- }, se({ _: 2 }, [
206
- te(e.$slots, (l, d) => ({
207
- name: d,
208
- fn: j((R) => [
209
- n(e.$slots, d, u(g(R)))
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"])) : (o(), a(Z, { key: 3 }, [
213
- n(e.$slots, "body.prepend", u(g(h.value))),
214
- T(Oe, {
215
- items: s(c),
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(M),
226
- "show-select": s(I),
227
- "show-expand": s(A),
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
- onToggleExpand: s(H),
231
- onToggleSelect: s(B),
232
- customSlots: e.customSlots
233
- }, se({ _: 2 }, [
234
- te(e.$slots, (l, d) => ({
235
- name: d,
236
- fn: j((R) => [
237
- n(e.$slots, d, u(g(R)))
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
- n(e.$slots, "body.append", u(g(h.value)))
262
+ i(e.$slots, "body.append", d(h(f.value)))
242
263
  ], 64)),
243
- e.$slots.tfoot ? (o(), a("tfoot", Ze, [
244
- n(e.$slots, "tfoot", u(g(h.value)))
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(c).length ? r("", !0) : (o(), a("div", _e, [
248
- S("div", es, D(e.noDataText), 1)
268
+ s(m).length ? r("", !0) : (l(), a("div", as, [
269
+ b("div", rs, z(e.noDataText), 1)
249
270
  ]))
250
271
  ]),
251
- s(re) ? n(e.$slots, "footer", u(z({ key: 2 }, h.value))) : (o(), a("div", ss, [
252
- T(Ve, {
253
- "items-length": s(f).length,
254
- "items-per-page": s(i).itemsPerPage,
255
- "current-page": s(i).page,
256
- "page-options": s(de),
257
- "onUpdate:itemsPerPage": t[4] || (t[4] = (l) => s(i).itemsPerPage = l),
258
- "onUpdate:page": t[5] || (t[5] = (l) => s(i).page = l)
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(w) ? (o(), F(De, {
282
+ e.filterable && s(v) ? (l(), F(xe, {
262
283
  key: 3,
263
284
  filters: e.filters,
264
- modelValue: s(w),
265
- "onUpdate:modelValue": t[6] || (t[6] = (l) => Ie(w) ? w.value = l : null),
266
- onApplyFilters: s(me),
267
- onClearFilters: s(fe),
268
- activeFilters: s(he).byColumn
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
- Ss as default
295
+ As as default
275
296
  };
@@ -1,58 +1,52 @@
1
- import { openBlock as l, createElementBlock as a, Fragment as g, renderList as c, createVNode as w, mergeProps as u, createSlots as S, withCtx as k, renderSlot as f, createElementVNode as E, createCommentVNode as $ } from "vue";
2
- import T from "./KunTableIterator.vue.js";
3
- import { kunTableIteratorsProps as b } from "../composables/kunTableIteratorsProps.js";
4
- const v = { class: "h-full w-full flex flex-col bg-blue-800" }, x = {
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
- }, V = {
7
+ }, A = {
8
8
  __name: "KunTableIterators",
9
- props: b,
9
+ props: $,
10
10
  emits: ["toggle-expand", "toggle-select", "row-click"],
11
- setup(y, { emit: m }) {
12
- const r = m;
13
- return (e, s) => (l(), a("div", v, [
14
- (l(!0), a(g, null, c(e.items, (o, t) => {
15
- var d;
16
- return l(), a(g, {
17
- key: e.itemKey(o, t)
18
- }, [
19
- w(T, u({
20
- item: o,
21
- index: t,
22
- headers: e.headers,
23
- "show-expand": e.showExpand,
24
- "show-select": e.showSelect,
25
- "is-expanded": e.isExpanded(o),
26
- "is-selected": e.isSelected(o),
27
- "has-actions": e.hasActions,
28
- loading: ((d = e.actionLoadingMap) == null ? void 0 : d[o.id]) || !1,
29
- onToggleExpand: (n) => r("toggle-expand", o),
30
- onToggleSelect: (n) => r("toggle-select", o),
31
- onRowClick: s[0] || (s[0] = (n) => r("row-click", n))
32
- }, { ref_for: !0 }, e.$attrs, { customSlots: e.customSlots }), S({ _: 2 }, [
33
- c(e.$slots, (n, i) => ({
34
- name: i,
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
- ])) : $("", !0)
51
- ], 64);
52
- }), 128))
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
- V as default
51
+ A as default
58
52
  };