adverich-kun-ui 0.1.504 → 0.1.506

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