adverich-kun-ui 0.1.298 → 0.1.300

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 I, toRefs as de, useModel as ce, ref as pe, watch as V, computed as x, createElementBlock as m, openBlock as l, mergeProps as A, createCommentVNode as d, createElementVNode as N, renderSlot as a, createBlock as b, unref as s, normalizeClass as j, withDirectives as ue, vModelText as me, normalizeProps as c, guardReactiveProps as g, Fragment as fe, createVNode as z, createSlots as D, renderList as K, withCtx as L, isRef as ge } from "vue";
1
+ import { mergeModels as I, toRefs as ce, useModel as de, ref as pe, watch as V, computed as j, createElementBlock as m, openBlock as l, mergeProps as A, createCommentVNode as c, createElementVNode as x, renderSlot as a, createBlock as b, unref as s, normalizeClass as N, withDirectives as ue, vModelText as me, normalizeProps as d, guardReactiveProps as g, Fragment as fe, createVNode as z, createSlots as D, renderList as K, withCtx as L, isRef as ge } from "vue";
2
2
  import { isMobile as w } from "../../../../utils/_platform.js";
3
3
  import he from "./KunTableHeaders.vue.js";
4
4
  import ye from "./KunTableFooter.vue.js";
5
5
  import be from "./KunTableRows.vue.js";
6
6
  import we from "./KunTableIterators.vue.js";
7
7
  import ve from "../../../KunBtn/src/components/KunBtn.vue.js";
8
- import Se from "./KunTableFilter.vue.js";
9
- import Te from "../../../KunCard/src/components/KunCard.vue.js";
8
+ import Te from "./KunTableFilter.vue.js";
9
+ import Se from "../../../KunCard/src/components/KunCard.vue.js";
10
10
  import $e from "../composables/useExpand.js";
11
- import Ce from "../composables/useOptions.js";
12
- import Fe from "../composables/useSelect.js";
11
+ import Fe from "../composables/useOptions.js";
12
+ import Ce from "../composables/useSelect.js";
13
13
  import ke from "../composables/useFilter.js";
14
14
  import Pe from "../composables/KunTableProps.js";
15
15
  const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-full" }, Be = {
@@ -23,9 +23,9 @@ const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-f
23
23
  }),
24
24
  emits: /* @__PURE__ */ I(["update:page", "update:itemsPerPage", "update:sortBy", "update:search"], ["update:selectedItems"]),
25
25
  setup(M, { emit: U }) {
26
- const E = U, p = M, v = de(p), H = ce(M, "selectedItems"), {
27
- headers: S,
28
- showExpand: T,
26
+ const E = U, p = M, v = ce(p), H = de(M, "selectedItems"), {
27
+ headers: T,
28
+ showExpand: S,
29
29
  showSelect: $,
30
30
  rowClass: R,
31
31
  hideDefaultFooter: O,
@@ -44,21 +44,21 @@ const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-f
44
44
  V(h, (e) => {
45
45
  E("update:search", e), Z(e);
46
46
  });
47
- const { options: r, paginatedItems: u, updateSort: te } = Ce(v, E, Y), { isSelected: C, toggleSelect: F, toggleSelectAll: oe, allSelected: le, someSelected: ae } = Fe(u, H), { isExpanded: k, toggleExpand: P } = $e(), f = x(() => ({
47
+ const { options: r, paginatedItems: u, updateSort: te } = Fe(v, E, Y), { isSelected: F, toggleSelect: C, toggleSelectAll: oe, allSelected: le, someSelected: ae } = Ce(u, H), { isExpanded: k, toggleExpand: P } = $e(), f = j(() => ({
48
48
  items: u.value,
49
- headers: S.value,
49
+ headers: T.value,
50
50
  page: r.page,
51
51
  itemsPerPage: r.itemsPerPage,
52
- toggleSelect: F,
53
- isSelected: C,
52
+ toggleSelect: C,
53
+ isSelected: F,
54
54
  toggleExpand: P,
55
55
  isExpanded: k,
56
56
  sortBy: r.sortBy,
57
57
  hasActions: p.hasActions
58
- })), ne = [Ie, q.value], re = [Ve, Q.value], ie = x(() => p.headers.map((e) => {
58
+ })), ne = [Ie, q.value], re = [Ve, Q.value], ie = j(() => p.headers.map((e) => {
59
59
  var o, i;
60
60
  const t = { ...e };
61
- if (e.columnType === "function" && typeof e.columnFunction == "string") {
61
+ if ((e.columnType === "function" || e.columnType == "objectFunction" || e.columnType == "simpleFunction") && typeof e.columnFunction == "string") {
62
62
  const n = (o = p.functionMap) == null ? void 0 : o[e.columnFunction];
63
63
  typeof n == "function" ? t.columnFunction = n : (console.warn(
64
64
  `[KunTable] No se encontró la función "${e.columnFunction}" en functionMap`
@@ -75,7 +75,7 @@ const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-f
75
75
  return (e, t) => (l(), m("div", A({ class: ne }, e.$attrs, { style: { "user-select": "text" } }), [
76
76
  s(B) || e.filterable || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), m("div", {
77
77
  key: 0,
78
- class: j(["p-2 bg-slate-200 dark:bg-slate-800 print:hidden", {
78
+ class: N(["p-2 bg-slate-200 dark:bg-slate-800 print:hidden", {
79
79
  "justify-start flex": e.searchPosition === "start",
80
80
  "justify-center flex": e.searchPosition === "center",
81
81
  "justify-end flex": e.searchPosition === "end"
@@ -87,7 +87,7 @@ const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-f
87
87
  onClick: t[0] || (t[0] = (o) => y.value = !0),
88
88
  text: "Filtros",
89
89
  bgColor: "bg-green-200 dark:bg-green-800 px-2"
90
- })) : d("", !0),
90
+ })) : c("", !0),
91
91
  s(B) ? ue((l(), m("input", {
92
92
  key: 1,
93
93
  "onUpdate:modelValue": t[1] || (t[1] = (o) => h.value = o),
@@ -96,21 +96,21 @@ const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-f
96
96
  class: "border mx-2 px-3 py-1 rounded w-full max-w-sm text-sm"
97
97
  }, null, 8, Ae)), [
98
98
  [me, h.value]
99
- ]) : d("", !0),
99
+ ]) : c("", !0),
100
100
  a(e.$slots, "appendSearch")
101
- ], 2)) : d("", !0),
102
- N("table", {
103
- class: j(re)
101
+ ], 2)) : c("", !0),
102
+ x("table", {
103
+ class: N(re)
104
104
  }, [
105
105
  e.$slots.colgroup && !s(w) ? (l(), m("colgroup", Me, [
106
- a(e.$slots, "colgroup", c(g(f.value)))
107
- ])) : d("", !0),
106
+ a(e.$slots, "colgroup", d(g(f.value)))
107
+ ])) : c("", !0),
108
108
  !s(W) && !s(w) ? (l(), b(he, {
109
109
  key: 1,
110
- headers: s(S),
110
+ headers: s(T),
111
111
  "sort-by": s(r).sortBy,
112
112
  "show-select": s($),
113
- "show-expand": s(T),
113
+ "show-expand": s(S),
114
114
  "all-selected": s(le),
115
115
  "some-selected": s(ae),
116
116
  "thead-class": e.theadClass,
@@ -120,9 +120,9 @@ const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-f
120
120
  "action-label": e.actionLabel,
121
121
  onSort: s(te),
122
122
  onToggleSelectAll: s(oe)
123
- }, 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"])) : a(e.$slots, "thead", c(A({ key: 2 }, f.value))),
123
+ }, 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"])) : a(e.$slots, "thead", d(A({ key: 2 }, f.value))),
124
124
  s(u).length && !s(w) ? (l(), m(fe, { key: 3 }, [
125
- a(e.$slots, "body.prepend", c(g(f.value))),
125
+ a(e.$slots, "body.prepend", d(g(f.value))),
126
126
  z(be, {
127
127
  items: s(u),
128
128
  headers: ie.value,
@@ -132,58 +132,58 @@ const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-f
132
132
  "td-class": e.tdClass,
133
133
  "selected-class": e.selectedClass,
134
134
  "striped-class": e.stripedClass,
135
- "is-selected": s(C),
135
+ "is-selected": s(F),
136
136
  "is-expanded": s(k),
137
137
  "show-select": s($),
138
- "show-expand": s(T),
138
+ "show-expand": s(S),
139
139
  "has-actions": e.hasActions,
140
140
  "action-loading-map": e.actionLoadingMap,
141
141
  onToggleExpand: s(P),
142
- onToggleSelect: s(F),
142
+ onToggleSelect: s(C),
143
143
  customSlots: e.customSlots
144
144
  }, D({ _: 2 }, [
145
145
  K(e.$slots, (o, i) => ({
146
146
  name: i,
147
147
  fn: L((n) => [
148
- a(e.$slots, i, c(g(n)))
148
+ a(e.$slots, i, d(g(n)))
149
149
  ])
150
150
  }))
151
151
  ]), 1032, ["items", "headers", "tbody-class", "row-class", "tr-class", "td-class", "selected-class", "striped-class", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"]),
152
- a(e.$slots, "body.append", c(g(f.value)))
152
+ a(e.$slots, "body.append", d(g(f.value)))
153
153
  ], 64)) : s(u).length && s(w) ? (l(), b(we, {
154
154
  key: 4,
155
155
  items: s(u),
156
- headers: s(S),
156
+ headers: s(T),
157
157
  "row-class": s(R),
158
- "is-selected": s(C),
158
+ "is-selected": s(F),
159
159
  "is-expanded": s(k),
160
160
  "show-select": s($),
161
- "show-expand": s(T),
161
+ "show-expand": s(S),
162
162
  "has-actions": e.hasActions,
163
163
  "action-loading-map": e.actionLoadingMap,
164
164
  onToggleExpand: s(P),
165
- onToggleSelect: s(F)
165
+ onToggleSelect: s(C)
166
166
  }, D({ _: 2 }, [
167
167
  K(e.$slots, (o, i) => ({
168
168
  name: i,
169
169
  fn: L((n) => [
170
- a(e.$slots, i, c(g(n)))
170
+ a(e.$slots, i, d(g(n)))
171
171
  ])
172
172
  }))
173
- ]), 1032, ["items", "headers", "row-class", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect"])) : d("", !0),
173
+ ]), 1032, ["items", "headers", "row-class", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect"])) : c("", !0),
174
174
  e.$slots.tfoot ? (l(), m("tfoot", Ee, [
175
- a(e.$slots, "tfoot", c(g(f.value)))
176
- ])) : d("", !0)
175
+ a(e.$slots, "tfoot", d(g(f.value)))
176
+ ])) : c("", !0)
177
177
  ]),
178
- N("div", Re, [
179
- s(u).length ? d("", !0) : (l(), b(Te, {
178
+ x("div", Re, [
179
+ s(u).length ? c("", !0) : (l(), b(Se, {
180
180
  key: 0,
181
181
  class: "h-full flex justify-center items-center",
182
182
  title: e.noDataText,
183
183
  titleSize: "text-4xl"
184
184
  }, null, 8, ["title"]))
185
185
  ]),
186
- s(O) ? a(e.$slots, "footer", c(A({ key: 2 }, f.value))) : (l(), m("div", Be, [
186
+ s(O) ? a(e.$slots, "footer", d(A({ key: 2 }, f.value))) : (l(), m("div", Be, [
187
187
  z(ye, {
188
188
  "items-length": s(J).length,
189
189
  "items-per-page": s(r).itemsPerPage,
@@ -193,7 +193,7 @@ const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-f
193
193
  "onUpdate:page": t[3] || (t[3] = (o) => s(r).page = o)
194
194
  }, null, 8, ["items-length", "items-per-page", "current-page", "page-options"])
195
195
  ])),
196
- e.filterable && s(y) ? (l(), b(Se, {
196
+ e.filterable && s(y) ? (l(), b(Te, {
197
197
  key: 3,
198
198
  filters: e.filters,
199
199
  modelValue: s(y),
@@ -201,7 +201,7 @@ const Ae = ["placeholder"], Me = { key: 0 }, Ee = { key: 5 }, Re = { class: "h-f
201
201
  onApplyFilters: s(_),
202
202
  onClearFilters: s(ee),
203
203
  activeFilters: s(se).byColumn
204
- }, null, 8, ["filters", "modelValue", "onApplyFilters", "onClearFilters", "activeFilters"])) : d("", !0)
204
+ }, null, 8, ["filters", "modelValue", "onApplyFilters", "onClearFilters", "activeFilters"])) : c("", !0)
205
205
  ], 16));
206
206
  }
207
207
  };
@@ -10,6 +10,7 @@ function a(t, n) {
10
10
  return i(u);
11
11
  }
12
12
  if (t.columnFormat === "function") {
13
+ console.log(t);
13
14
  const u = (c = t.columnFunction) == null ? void 0 : c.call(t, n, t);
14
15
  return i(u);
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.298",
3
+ "version": "0.1.300",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",