adverich-kun-ui 0.1.189 → 0.1.190

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,49 +1,49 @@
1
- import { toRefs as ne, ref as ie, watch as L, computed as M, createElementBlock as i, openBlock as l, mergeProps as E, createCommentVNode as m, createElementVNode as B, renderSlot as a, createBlock as w, unref as s, normalizeClass as N, withDirectives as de, vModelText as pe, normalizeProps as d, guardReactiveProps as u, Fragment as ce, createVNode as V, createSlots as R, renderList as U, withCtx as D, isRef as me } from "vue";
1
+ import { toRefs as re, ref as ne, watch as j, computed as z, createElementBlock as c, openBlock as l, mergeProps as E, createCommentVNode as i, createElementVNode as D, renderSlot as a, createBlock as b, unref as s, normalizeClass as L, withDirectives as ie, vModelText as de, normalizeProps as d, guardReactiveProps as u, Fragment as pe, createVNode as M, createSlots as R, renderList as U, withCtx as I, isRef as ce } from "vue";
2
2
  import { isMobile as v } from "../../../../utils/_platform.js";
3
- import ue from "./KunTableHeaders.vue.js";
4
- import he from "./KunTableFooter.vue.js";
5
- import ge from "./KunTableRows.vue.js";
6
- import fe from "./KunTableIterators.vue.js";
7
- import be from "../../../KunBtn/src/components/KunBtn.vue.js";
8
- import ye from "./KunTableFilter.vue.js";
9
- import we from "../../../KunCard/src/components/KunCard.vue.js";
10
- import ve from "../composables/useExpand.js";
11
- import Ce from "../composables/useOptions.js";
3
+ import me from "./KunTableHeaders.vue.js";
4
+ import ue from "./KunTableFooter.vue.js";
5
+ import he from "./KunTableRows.vue.js";
6
+ import ge from "./KunTableIterators.vue.js";
7
+ import fe from "../../../KunBtn/src/components/KunBtn.vue.js";
8
+ import be from "./KunTableFilter.vue.js";
9
+ import ye from "../../../KunCard/src/components/KunCard.vue.js";
10
+ import we from "../composables/useExpand.js";
11
+ import ve from "../composables/useOptions.js";
12
12
  import Se from "../composables/useSelect.js";
13
- import $e from "../composables/useFilter.js";
14
- import ke from "../composables/KunTableProps.js";
15
- const Pe = ["placeholder"], Te = { key: 0 }, Fe = { key: 5 }, Ae = ["colspan"], Ee = { key: 6 }, Be = {
13
+ import Ce from "../composables/useFilter.js";
14
+ import $e from "../composables/KunTableProps.js";
15
+ const ke = ["placeholder"], Pe = { key: 0 }, Te = { key: 5 }, Fe = { class: "h-full" }, Ae = {
16
16
  key: 1,
17
17
  class: "sticky bottom-0 z-10"
18
- }, Ve = "overflow-auto h-full w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", je = "table-auto w-full h-fit text-sm text-left", qe = {
18
+ }, Ee = "overflow-auto h-full w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", Be = "table-auto w-full h-fit text-sm text-left", He = {
19
19
  __name: "KunTable",
20
- props: ke(),
20
+ props: $e(),
21
21
  emits: ["update:page", "update:itemsPerPage", "update:sortBy", "update:selectedItems", "update:search"],
22
- setup(I, { emit: K }) {
23
- const C = K, r = I, b = ne(r), {
24
- headers: y,
25
- showExpand: S,
22
+ setup(N, { emit: K }) {
23
+ const S = K, r = N, y = re(r), {
24
+ headers: w,
25
+ showExpand: C,
26
26
  showSelect: $,
27
- rowClass: j,
27
+ rowClass: B,
28
28
  hideDefaultFooter: O,
29
29
  hideDefaultHeader: W,
30
30
  tableClass: x,
31
31
  wrapperClass: H,
32
32
  pageOptions: Q,
33
33
  items: q,
34
- searchable: z,
34
+ searchable: V,
35
35
  debounceTime: G
36
- } = b, h = ie(r.search);
37
- L(() => r.search, (e) => {
36
+ } = y, h = ne(r.search);
37
+ j(() => r.search, (e) => {
38
38
  e !== h.value && (h.value = e);
39
39
  });
40
- const { filteredItems: J, setSearch: X, modalFilter: g, applyColumnFilters: Y, clearFilters: Z, appliedFilters: _ } = $e(b, G);
41
- L(h, (e) => {
42
- C("update:search", e), X(e);
40
+ const { filteredItems: J, setSearch: X, modalFilter: g, applyColumnFilters: Y, clearFilters: Z, appliedFilters: _ } = Ce(y, G);
41
+ j(h, (e) => {
42
+ S("update:search", e), X(e);
43
43
  });
44
- const { options: n, paginatedItems: p, updateSort: ee } = Ce(b, C, J), { isSelected: k, toggleSelect: P, toggleSelectAll: se, allSelected: te, someSelected: le } = Se(b, C, p), { isExpanded: T, toggleExpand: F } = ve(), c = M(() => ({
44
+ const { options: n, paginatedItems: p, updateSort: ee } = ve(y, S, J), { isSelected: k, toggleSelect: P, toggleSelectAll: se, allSelected: te, someSelected: le } = Se(y, S, p), { isExpanded: T, toggleExpand: F } = we(), m = z(() => ({
45
45
  items: p.value,
46
- headers: y.value,
46
+ headers: w.value,
47
47
  page: n.page,
48
48
  itemsPerPage: n.itemsPerPage,
49
49
  toggleSelect: P,
@@ -52,50 +52,50 @@ const Pe = ["placeholder"], Te = { key: 0 }, Fe = { key: 5 }, Ae = ["colspan"],
52
52
  isExpanded: T,
53
53
  sortBy: n.sortBy,
54
54
  hasActions: r.hasActions
55
- })), oe = [Ve, H.value], ae = [je, x.value], re = M(() => {
55
+ })), oe = [Ee, H.value], ae = [Be, x.value];
56
+ return z(() => {
56
57
  var t;
57
58
  let e = ((t = r.headers) == null ? void 0 : t.length) || 0;
58
59
  return r.showSelect && (e += 1), r.showExpand && (e += 1), r.hasActions && (e += 1), e;
59
- });
60
- return (e, t) => (l(), i("div", E({ class: oe }, e.$attrs, { style: { "user-select": "text" } }), [
61
- s(z) || e.filterable || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), i("div", {
60
+ }), (e, t) => (l(), c("div", E({ class: oe }, e.$attrs, { style: { "user-select": "text" } }), [
61
+ s(V) || e.filterable || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), c("div", {
62
62
  key: 0,
63
- class: N(["p-2 bg-slate-200 dark:bg-slate-800", {
63
+ class: L(["p-2 bg-slate-200 dark:bg-slate-800", {
64
64
  "justify-start flex": e.searchPosition === "start",
65
65
  "justify-center flex": e.searchPosition === "center",
66
66
  "justify-end flex": e.searchPosition === "end"
67
67
  }])
68
68
  }, [
69
69
  a(e.$slots, "prependSearch"),
70
- e.filterable ? (l(), w(be, {
70
+ e.filterable ? (l(), b(fe, {
71
71
  key: 0,
72
72
  onClick: t[0] || (t[0] = (o) => g.value = !0),
73
73
  text: "Filtrar",
74
74
  bgColor: "bg-slate-300 dark:bg-slate-700"
75
- })) : m("", !0),
76
- s(z) ? de((l(), i("input", {
75
+ })) : i("", !0),
76
+ s(V) ? ie((l(), c("input", {
77
77
  key: 1,
78
78
  "onUpdate:modelValue": t[1] || (t[1] = (o) => h.value = o),
79
79
  type: "text",
80
80
  placeholder: e.searchPlaceholder,
81
81
  class: "border mx-2 px-3 py-1 rounded w-full max-w-sm text-sm"
82
- }, null, 8, Pe)), [
83
- [pe, h.value]
84
- ]) : m("", !0),
82
+ }, null, 8, ke)), [
83
+ [de, h.value]
84
+ ]) : i("", !0),
85
85
  a(e.$slots, "appendSearch")
86
- ], 2)) : m("", !0),
87
- B("table", {
88
- class: N(ae)
86
+ ], 2)) : i("", !0),
87
+ D("table", {
88
+ class: L(ae)
89
89
  }, [
90
- e.$slots.colgroup && !s(v) ? (l(), i("colgroup", Te, [
91
- a(e.$slots, "colgroup", d(u(c.value)))
92
- ])) : m("", !0),
93
- !s(W) && !s(v) ? (l(), w(ue, {
90
+ e.$slots.colgroup && !s(v) ? (l(), c("colgroup", Pe, [
91
+ a(e.$slots, "colgroup", d(u(m.value)))
92
+ ])) : i("", !0),
93
+ !s(W) && !s(v) ? (l(), b(me, {
94
94
  key: 1,
95
- headers: s(y),
95
+ headers: s(w),
96
96
  "sort-by": s(n).sortBy,
97
97
  "show-select": s($),
98
- "show-expand": s(S),
98
+ "show-expand": s(C),
99
99
  "all-selected": s(te),
100
100
  "some-selected": s(le),
101
101
  "thead-class": e.theadClass,
@@ -105,14 +105,14 @@ const Pe = ["placeholder"], Te = { key: 0 }, Fe = { key: 5 }, Ae = ["colspan"],
105
105
  "action-label": e.actionLabel,
106
106
  onSort: s(ee),
107
107
  onToggleSelectAll: s(se)
108
- }, 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(E({ key: 2 }, c.value))),
109
- s(p).length && !s(v) ? (l(), i(ce, { key: 3 }, [
110
- a(e.$slots, "body.prepend", d(u(c.value))),
111
- V(ge, {
108
+ }, 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(E({ key: 2 }, m.value))),
109
+ s(p).length && !s(v) ? (l(), c(pe, { key: 3 }, [
110
+ a(e.$slots, "body.prepend", d(u(m.value))),
111
+ M(he, {
112
112
  items: s(p),
113
- headers: s(y),
113
+ headers: s(w),
114
114
  "tbody-class": e.tbodyClass,
115
- "row-class": s(j),
115
+ "row-class": s(B),
116
116
  "tr-class": e.trClass,
117
117
  "td-class": e.tdClass,
118
118
  "selected-class": e.selectedClass,
@@ -120,7 +120,7 @@ const Pe = ["placeholder"], Te = { key: 0 }, Fe = { key: 5 }, Ae = ["colspan"],
120
120
  "is-selected": s(k),
121
121
  "is-expanded": s(T),
122
122
  "show-select": s($),
123
- "show-expand": s(S),
123
+ "show-expand": s(C),
124
124
  "has-actions": e.hasActions,
125
125
  "action-loading-map": e.actionLoadingMap,
126
126
  onToggleExpand: s(F),
@@ -128,21 +128,21 @@ const Pe = ["placeholder"], Te = { key: 0 }, Fe = { key: 5 }, Ae = ["colspan"],
128
128
  }, R({ _: 2 }, [
129
129
  U(e.$slots, (o, f) => ({
130
130
  name: f,
131
- fn: D((A) => [
131
+ fn: I((A) => [
132
132
  a(e.$slots, f, d(u(A)))
133
133
  ])
134
134
  }))
135
135
  ]), 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"]),
136
- a(e.$slots, "body.append", d(u(c.value)))
137
- ], 64)) : s(p).length && s(v) ? (l(), w(fe, {
136
+ a(e.$slots, "body.append", d(u(m.value)))
137
+ ], 64)) : s(p).length && s(v) ? (l(), b(ge, {
138
138
  key: 4,
139
139
  items: s(p),
140
- headers: s(y),
141
- "row-class": s(j),
140
+ headers: s(w),
141
+ "row-class": s(B),
142
142
  "is-selected": s(k),
143
143
  "is-expanded": s(T),
144
144
  "show-select": s($),
145
- "show-expand": s(S),
145
+ "show-expand": s(C),
146
146
  "has-actions": e.hasActions,
147
147
  "action-loading-map": e.actionLoadingMap,
148
148
  onToggleExpand: s(F),
@@ -150,26 +150,25 @@ const Pe = ["placeholder"], Te = { key: 0 }, Fe = { key: 5 }, Ae = ["colspan"],
150
150
  }, R({ _: 2 }, [
151
151
  U(e.$slots, (o, f) => ({
152
152
  name: f,
153
- fn: D((A) => [
153
+ fn: I((A) => [
154
154
  a(e.$slots, f, d(u(A)))
155
155
  ])
156
156
  }))
157
- ]), 1032, ["items", "headers", "row-class", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect"])) : (l(), i("tr", Fe, [
158
- B("td", { colspan: re.value }, [
159
- V(we, {
160
- class: "h-full flex justify-center items-center",
161
- title: "No hay elementos disponibles",
162
- titleSize: "text-4xl"
163
- })
164
- ], 8, Ae)
165
- ])),
166
- e.$slots.tfoot ? (l(), i("tfoot", Ee, [
167
- a(e.$slots, "tfoot", d(u(c.value)))
168
- ])) : m("", !0)
157
+ ]), 1032, ["items", "headers", "row-class", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect"])) : i("", !0),
158
+ e.$slots.tfoot ? (l(), c("tfoot", Te, [
159
+ a(e.$slots, "tfoot", d(u(m.value)))
160
+ ])) : i("", !0)
161
+ ]),
162
+ D("div", Fe, [
163
+ s(p).length ? i("", !0) : (l(), b(ye, {
164
+ key: 0,
165
+ class: "h-full flex justify-center items-center",
166
+ title: e.noDataText,
167
+ titleSize: "text-4xl"
168
+ }, null, 8, ["title"]))
169
169
  ]),
170
- t[5] || (t[5] = B("div", { class: "h-full" }, null, -1)),
171
- s(O) ? a(e.$slots, "footer", d(E({ key: 2 }, c.value))) : (l(), i("div", Be, [
172
- V(he, {
170
+ s(O) ? a(e.$slots, "footer", d(E({ key: 2 }, m.value))) : (l(), c("div", Ae, [
171
+ M(ue, {
173
172
  "items-length": s(q).length,
174
173
  "items-per-page": s(n).itemsPerPage,
175
174
  "current-page": s(n).page,
@@ -178,18 +177,18 @@ const Pe = ["placeholder"], Te = { key: 0 }, Fe = { key: 5 }, Ae = ["colspan"],
178
177
  "onUpdate:page": t[3] || (t[3] = (o) => s(n).page = o)
179
178
  }, null, 8, ["items-length", "items-per-page", "current-page", "page-options"])
180
179
  ])),
181
- e.filterable && s(g) ? (l(), w(ye, {
180
+ e.filterable && s(g) ? (l(), b(be, {
182
181
  key: 3,
183
182
  filters: e.filters,
184
183
  modelValue: s(g),
185
- "onUpdate:modelValue": t[4] || (t[4] = (o) => me(g) ? g.value = o : null),
184
+ "onUpdate:modelValue": t[4] || (t[4] = (o) => ce(g) ? g.value = o : null),
186
185
  onApplyFilters: s(Y),
187
186
  onClearFilters: s(Z),
188
187
  activeFilters: s(_).byColumn
189
- }, null, 8, ["filters", "modelValue", "onApplyFilters", "onClearFilters", "activeFilters"])) : m("", !0)
188
+ }, null, 8, ["filters", "modelValue", "onApplyFilters", "onClearFilters", "activeFilters"])) : i("", !0)
190
189
  ], 16));
191
190
  }
192
191
  };
193
192
  export {
194
- qe as default
193
+ He as default
195
194
  };
@@ -50,8 +50,8 @@ const t = () => ({
50
50
  tfootClass: { type: String, default: "" },
51
51
  rowClass: { type: String, default: "" },
52
52
  // Misc
53
- noDataText: { type: String, default: "No data available" },
54
- loadingText: { type: String, default: "Loading..." },
53
+ noDataText: { type: String, default: "No hay elementos disponibles" },
54
+ loadingText: { type: String, default: "Cargando..." },
55
55
  // Slots control
56
56
  showTopSlot: { type: Boolean, default: !1 },
57
57
  showBottomSlot: { type: Boolean, default: !1 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.189",
3
+ "version": "0.1.190",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",