adverich-kun-ui 0.1.237 → 0.1.238

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