adverich-kun-ui 0.1.508 → 0.1.510

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,4 +1,4 @@
1
- import { mergeModels as X, toRefs as $e, useModel as Fe, ref as C, watch as Y, computed as Z, onMounted as Pe, createElementBlock as n, openBlock as l, mergeProps as O, createCommentVNode as a, createElementVNode as v, renderSlot as r, createBlock as T, unref as s, toDisplayString as j, Fragment as _, withCtx as z, createVNode as $, normalizeClass as D, withDirectives as ee, vModelText as Ae, vShow as se, normalizeProps as p, guardReactiveProps as w, createSlots as oe, renderList as te, isRef as Me, nextTick as Ie } from "vue";
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
2
  import { isMobile as f } from "../../../../utils/_platform.js";
3
3
  import le from "../../../KunIcon/src/components/KunIcon.vue.js";
4
4
  import Re from "../../../../icons/IconFilter.vue.js";
@@ -17,10 +17,13 @@ import Le from "../composables/KunTableProps.js";
17
17
  const Ue = {
18
18
  key: 0,
19
19
  class: "p-2 bg-surface print:hidden flex w-full justify-between"
20
- }, We = { class: "w-full flex items-center" }, Qe = {
20
+ }, We = {
21
21
  key: 0,
22
+ class: "w-full flex items-center"
23
+ }, Qe = {
24
+ key: 1,
22
25
  class: "inline-flex items-center justify-center whitespace-nowrap"
23
- }, qe = { class: "pr-2" }, Ge = { class: "w-full flex h-full items-center justify-end" }, Je = ["placeholder"], Xe = { class: "flex-1 overflow-auto bg-surface" }, Ye = { key: 0 }, Ze = { key: 5 }, _e = {
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 = {
24
27
  key: 1,
25
28
  class: "h-full flex justify-center items-center"
26
29
  }, es = { class: "text-center text-4xl" }, ss = {
@@ -34,10 +37,10 @@ const Ue = {
34
37
  }),
35
38
  emits: /* @__PURE__ */ X(["update:page", "update:itemsPerPage", "update:sortBy", "update:search", "focusOnSearch"], ["update:selectedItems"]),
36
39
  setup(N, { emit: ne }) {
37
- const k = ne, m = N, F = $e(m), y = Fe(N, "selectedItems"), {
40
+ const k = ne, m = N, P = $e(m), w = Fe(N, "selectedItems"), {
38
41
  headers: K,
39
- showExpand: P,
40
- showSelect: A,
42
+ showExpand: A,
43
+ showSelect: M,
41
44
  rowClass: L,
42
45
  hideDefaultFooter: ae,
43
46
  hideDefaultHeader: re,
@@ -47,15 +50,15 @@ const Ue = {
47
50
  items: ls,
48
51
  searchable: U,
49
52
  debounceTime: de
50
- } = F, b = C(m.search);
53
+ } = P, y = S(m.search);
51
54
  Y(() => m.search, (e) => {
52
- e !== b.value && (b.value = e);
55
+ e !== y.value && (y.value = e);
53
56
  });
54
- const M = Z(() => m.headers.map((e) => {
55
- var t, d;
57
+ const I = Z(() => m.headers.map((e) => {
58
+ var l, d;
56
59
  const o = { ...e };
57
60
  if ((e.columnType === "function" || e.columnType == "objectFunction" || e.columnType == "simpleFunction") && typeof e.columnFunction == "string") {
58
- const i = (t = m.functionMap) == null ? void 0 : t[e.columnFunction];
61
+ const i = (l = m.functionMap) == null ? void 0 : l[e.columnFunction];
59
62
  typeof i == "function" ? o.columnFunction = i : (console.warn(
60
63
  `[KunTable] No se encontró la función "${e.columnFunction}" en functionMap`
61
64
  ), o.columnFunction = () => "");
@@ -67,24 +70,24 @@ const Ue = {
67
70
  ), o.columnRowText = () => "");
68
71
  }
69
72
  return o;
70
- })), { filteredItems: h, setSearch: pe, modalFilter: S, applyColumnFilters: me, clearFilters: fe, appliedFilters: he } = Ke(F, de, M);
71
- Y(b, (e) => {
73
+ })), { filteredItems: h, setSearch: pe, modalFilter: b, applyColumnFilters: me, clearFilters: fe, appliedFilters: he } = Ke(P, de, I);
74
+ Y(y, (e) => {
72
75
  k("update:search", e), pe(e);
73
76
  });
74
- const { options: c, paginatedItems: u, updateSort: ge } = De(F, k, h), { isSelected: I, toggleSelect: R, toggleSelectAll: ve, allSelected: we, someSelected: ye, moreThanPaginated: be, clearSelection: W, selectCompleteAll: Q } = Ne(u, y, h), { isExpanded: E, toggleExpand: x } = ze(), g = Z(() => ({
77
+ const { options: c, paginatedItems: u, updateSort: ge } = De(P, k, h), { isSelected: R, toggleSelect: E, toggleSelectAll: ve, allSelected: we, someSelected: ye, moreThanPaginated: be, clearSelection: W, selectCompleteAll: Q } = Ne(u, w, h), { isExpanded: x, toggleExpand: B } = ze(), g = Z(() => ({
75
78
  items: u.value,
76
79
  headers: K.value,
77
80
  page: c.page,
78
81
  itemsPerPage: c.itemsPerPage,
79
- toggleSelect: R,
80
- isSelected: I,
81
- toggleExpand: x,
82
- isExpanded: E,
82
+ toggleSelect: E,
83
+ isSelected: R,
84
+ toggleExpand: B,
85
+ isExpanded: x,
83
86
  sortBy: c.sortBy,
84
87
  hasActions: m.hasActions
85
88
  })), Se = [os, ce.value], Ce = [ts, ie.value];
86
89
  Pe(() => G());
87
- const q = C(null), B = C(!0), H = C(!1);
90
+ const q = S(null), H = S(!0), T = S(!1);
88
91
  function ke() {
89
92
  Te();
90
93
  }
@@ -94,44 +97,44 @@ const Ue = {
94
97
  }));
95
98
  }
96
99
  function G() {
97
- f.value && (V.value = "w-fit", B.value = !1, H.value = !0, k("focusOnSearch", !1));
100
+ f.value && (V.value = "w-fit", H.value = !1, T.value = !0, k("focusOnSearch", !1));
98
101
  }
99
102
  function J() {
100
- f.value && (V.value = "w-full border", H.value = !1, B.value = !0, k("focusOnSearch", !0));
103
+ f.value && (V.value = "w-full border", T.value = !1, H.value = !0, k("focusOnSearch", !0));
101
104
  }
102
- const V = C("w-full border max-w-sm");
103
- return (e, o) => (l(), n("div", O({ class: Se }, 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
- v("div", We, [
105
+ const V = S("w-full border max-w-sm");
106
+ return (e, o) => (t(), n("div", O({ class: Se }, e.$attrs, { style: { "user-select": "text" } }), [
107
+ s(U) || e.filterable || e.$slots.prependHeader || e.$slots.prependSearch || e.$slots.appendSearch ? (t(), n("div", Ue, [
108
+ T.value ? (t(), n("div", We, [
106
109
  r(e.$slots, "prependHeader")
107
- ]),
108
- y.value.length ? (l(), n("div", Qe, [
109
- v("span", qe, "Se han seleccionado " + j(y.value.length) + " registros.", 1),
110
- s(u).length !== s(h).length ? (l(), n(_, { key: 0 }, [
111
- s(u).length === y.value.length ? (l(), n("span", {
110
+ ])) : a("", !0),
111
+ w.value.length ? (t(), n("div", Qe, [
112
+ C("span", qe, "Se han seleccionado " + j(w.value.length) + " registros.", 1),
113
+ s(u).length !== s(h).length ? (t(), n(_, { key: 0 }, [
114
+ s(u).length === w.value.length ? (t(), n("span", {
112
115
  key: 0,
113
- onClick: o[0] || (o[0] = (...t) => s(Q) && s(Q)(...t)),
116
+ onClick: o[0] || (o[0] = (...l) => s(Q) && s(Q)(...l)),
114
117
  class: "bg-secondary hover:!bg-blue-500 rounded cursor-pointer px-2 ml-2"
115
118
  }, " Seleccionar todos los " + j(s(h).length) + " registros ", 1)) : a("", !0),
116
- s(h).length === y.value.length ? (l(), n("span", {
119
+ s(h).length === w.value.length ? (t(), n("span", {
117
120
  key: 1,
118
- onClick: o[1] || (o[1] = (...t) => s(W) && s(W)(...t)),
121
+ onClick: o[1] || (o[1] = (...l) => s(W) && s(W)(...l)),
119
122
  class: "bg-secondary hover:!bg-blue-500 rounded cursor-pointer px-2 ml-2"
120
123
  }, " Anular selección ")) : a("", !0)
121
124
  ], 64)) : a("", !0)
122
125
  ])) : a("", !0),
123
- v("div", Ge, [
126
+ C("div", Ge, [
124
127
  r(e.$slots, "prependSearch"),
125
- e.filterable && e.filters.length ? (l(), T(Oe, {
128
+ e.filterable && e.filters.length ? (t(), $(Oe, {
126
129
  key: 0,
127
130
  class: "h-fit",
128
- onClick: o[2] || (o[2] = (t) => S.value = !0),
131
+ onClick: o[2] || (o[2] = (l) => b.value = !0),
129
132
  rounded: "rounded-full",
130
133
  size: "xs",
131
134
  bgColor: "bg-green-200 dark:bg-green-800"
132
135
  }, {
133
136
  default: z(() => [
134
- $(le, {
137
+ F(le, {
135
138
  class: "h-fit",
136
139
  icon: Re,
137
140
  size: "text-lg"
@@ -139,12 +142,12 @@ const Ue = {
139
142
  ]),
140
143
  _: 1
141
144
  })) : a("", !0),
142
- s(U) ? (l(), n("div", {
145
+ s(U) ? (t(), n("div", {
143
146
  key: 1,
144
147
  class: D(["rounded flex mx-2", [V.value]])
145
148
  }, [
146
- ee(v("input", {
147
- "onUpdate:modelValue": o[3] || (o[3] = (t) => b.value = t),
149
+ ee(C("input", {
150
+ "onUpdate:modelValue": o[3] || (o[3] = (l) => y.value = l),
148
151
  type: "text",
149
152
  placeholder: e.searchPlaceholder,
150
153
  class: D(["w-full text-sm", s(f) ? "px-1" : "px-2 py-1"]),
@@ -153,33 +156,33 @@ const Ue = {
153
156
  onFocus: J,
154
157
  onBlur: G
155
158
  }, null, 42, Je), [
156
- [Ae, b.value],
157
- [se, B.value]
159
+ [Ae, y.value],
160
+ [se, H.value]
158
161
  ]),
159
- ee($(le, {
162
+ ee(F(le, {
160
163
  icon: Ee,
161
164
  onClick: ke
162
165
  }, null, 512), [
163
- [se, H.value]
166
+ [se, T.value]
164
167
  ])
165
168
  ], 2)) : a("", !0),
166
169
  r(e.$slots, "appendSearch")
167
170
  ])
168
171
  ])) : a("", !0),
169
- v("div", Xe, [
170
- s(u).length ? (l(), n("table", {
172
+ C("div", Xe, [
173
+ s(u).length ? (t(), n("table", {
171
174
  key: 0,
172
175
  class: D(Ce)
173
176
  }, [
174
- e.$slots.colgroup && !s(f) ? (l(), n("colgroup", Ye, [
175
- r(e.$slots, "colgroup", p(w(g.value)))
177
+ e.$slots.colgroup && !s(f) ? (t(), n("colgroup", Ye, [
178
+ r(e.$slots, "colgroup", p(v(g.value)))
176
179
  ])) : a("", !0),
177
- !s(re) && !s(f) ? (l(), T(xe, {
180
+ !s(re) && !s(f) ? (t(), $(xe, {
178
181
  key: 1,
179
182
  headers: s(K),
180
183
  "sort-by": s(c).sortBy,
181
- "show-select": s(A),
182
- "show-expand": s(P),
184
+ "show-select": s(M),
185
+ "show-expand": s(A),
183
186
  "all-selected": s(we),
184
187
  "more-than-paginated": s(be),
185
188
  "some-selected": s(ye),
@@ -192,33 +195,33 @@ const Ue = {
192
195
  onToggleSelectAll: s(ve),
193
196
  customHeaders: e.customSlots
194
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))),
195
- s(f) ? (l(), T(Ve, {
198
+ s(f) ? (t(), $(Ve, {
196
199
  key: 4,
197
200
  items: s(u),
198
- headers: M.value,
201
+ headers: I.value,
199
202
  "row-class": s(L),
200
203
  "row-class-condition": e.rowClassCondition,
201
- "is-selected": s(I),
202
- "is-expanded": s(E),
203
- "show-select": s(A),
204
- "show-expand": s(P),
204
+ "is-selected": s(R),
205
+ "is-expanded": s(x),
206
+ "show-select": s(M),
207
+ "show-expand": s(A),
205
208
  "has-actions": e.hasActions,
206
209
  "action-loading-map": e.actionLoadingMap,
207
- onToggleExpand: s(x),
208
- onToggleSelect: s(R),
210
+ onToggleExpand: s(B),
211
+ onToggleSelect: s(E),
209
212
  customSlots: e.customSlots
210
213
  }, oe({ _: 2 }, [
211
- te(e.$slots, (t, d) => ({
214
+ te(e.$slots, (l, d) => ({
212
215
  name: d,
213
216
  fn: z((i) => [
214
- r(e.$slots, d, p(w(i)))
217
+ r(e.$slots, d, p(v(i)))
215
218
  ])
216
219
  }))
217
- ]), 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(_, { key: 3 }, [
218
- r(e.$slots, "body.prepend", p(w(g.value))),
219
- $(He, {
220
+ ]), 1032, ["items", "headers", "row-class", "row-class-condition", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"])) : (t(), n(_, { key: 3 }, [
221
+ r(e.$slots, "body.prepend", p(v(g.value))),
222
+ F(He, {
220
223
  items: s(u),
221
- headers: M.value,
224
+ headers: I.value,
222
225
  "tbody-class": e.tbodyClass,
223
226
  "row-class": s(L),
224
227
  "row-class-condition": e.rowClassCondition,
@@ -226,48 +229,48 @@ const Ue = {
226
229
  "td-class": e.tdClass,
227
230
  "selected-class": e.selectedClass,
228
231
  "striped-class": e.stripedClass,
229
- "is-selected": s(I),
230
- "is-expanded": s(E),
231
- "show-select": s(A),
232
- "show-expand": s(P),
232
+ "is-selected": s(R),
233
+ "is-expanded": s(x),
234
+ "show-select": s(M),
235
+ "show-expand": s(A),
233
236
  "has-actions": e.hasActions,
234
237
  "action-loading-map": e.actionLoadingMap,
235
- onToggleExpand: s(x),
236
- onToggleSelect: s(R),
238
+ onToggleExpand: s(B),
239
+ onToggleSelect: s(E),
237
240
  customSlots: e.customSlots
238
241
  }, oe({ _: 2 }, [
239
- te(e.$slots, (t, d) => ({
242
+ te(e.$slots, (l, d) => ({
240
243
  name: d,
241
244
  fn: z((i) => [
242
- r(e.$slots, d, p(w(i)))
245
+ r(e.$slots, d, p(v(i)))
243
246
  ])
244
247
  }))
245
248
  ]), 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"]),
246
- r(e.$slots, "body.append", p(w(g.value)))
249
+ r(e.$slots, "body.append", p(v(g.value)))
247
250
  ], 64)),
248
- e.$slots.tfoot ? (l(), n("tfoot", Ze, [
249
- r(e.$slots, "tfoot", p(w(g.value)))
251
+ e.$slots.tfoot ? (t(), n("tfoot", Ze, [
252
+ r(e.$slots, "tfoot", p(v(g.value)))
250
253
  ])) : a("", !0)
251
254
  ])) : a("", !0),
252
- s(u).length ? a("", !0) : (l(), n("div", _e, [
253
- v("div", es, j(e.noDataText), 1)
255
+ s(u).length ? a("", !0) : (t(), n("div", _e, [
256
+ C("div", es, j(e.noDataText), 1)
254
257
  ]))
255
258
  ]),
256
- s(ae) ? r(e.$slots, "footer", p(O({ key: 2 }, g.value))) : (l(), n("div", ss, [
257
- $(Be, {
259
+ s(ae) ? r(e.$slots, "footer", p(O({ key: 2 }, g.value))) : (t(), n("div", ss, [
260
+ F(Be, {
258
261
  "items-length": s(h).length,
259
262
  "items-per-page": s(c).itemsPerPage,
260
263
  "current-page": s(c).page,
261
264
  "page-options": s(ue),
262
- "onUpdate:itemsPerPage": o[4] || (o[4] = (t) => s(c).itemsPerPage = t),
263
- "onUpdate:page": o[5] || (o[5] = (t) => s(c).page = t)
265
+ "onUpdate:itemsPerPage": o[4] || (o[4] = (l) => s(c).itemsPerPage = l),
266
+ "onUpdate:page": o[5] || (o[5] = (l) => s(c).page = l)
264
267
  }, null, 8, ["items-length", "items-per-page", "current-page", "page-options"])
265
268
  ])),
266
- e.filterable && s(S) ? (l(), T(je, {
269
+ e.filterable && s(b) ? (t(), $(je, {
267
270
  key: 3,
268
271
  filters: e.filters,
269
- modelValue: s(S),
270
- "onUpdate:modelValue": o[6] || (o[6] = (t) => Me(S) ? S.value = t : null),
272
+ modelValue: s(b),
273
+ "onUpdate:modelValue": o[6] || (o[6] = (l) => Me(b) ? b.value = l : null),
271
274
  onApplyFilters: s(me),
272
275
  onClearFilters: s(fe),
273
276
  activeFilters: s(he).byColumn
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.508",
3
+ "version": "0.1.510",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",