adverich-kun-ui 0.1.239 → 0.1.241

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.
@@ -30,7 +30,9 @@ const b = ["innerHTML"], S = {
30
30
  function d(e) {
31
31
  t.disabled || f("click", e);
32
32
  }
33
- const r = l(() => typeof n.value == "string" && n.value.trim().startsWith("<svg")), n = l(() => {
33
+ const r = l(
34
+ () => typeof n.value == "string" && n.value.trim().toLowerCase().startsWith("<svg")
35
+ ), n = l(() => {
34
36
  if (Array.isArray(t.icon)) return t.icon[0];
35
37
  if (typeof t.icon == "string" && t.icon.startsWith("$")) {
36
38
  const e = t.icon.slice(1);
@@ -52,8 +54,8 @@ const b = ["innerHTML"], S = {
52
54
  class: c([o.color, s.value, o.contentClass])
53
55
  }, null, 8, ["class"])) : (a(), i("span", {
54
56
  key: 2,
55
- class: c([r.value ? "" : n.value, o.color, s.value, o.contentClass]),
56
- innerHTML: [r.value ? n.value : ""]
57
+ innerHTML: r.value ? n.value : "",
58
+ class: c([r.value ? "" : n.value, o.color, s.value, o.contentClass])
57
59
  }, null, 10, b))
58
60
  ], 16));
59
61
  }
@@ -1,29 +1,29 @@
1
- import { mergeModels as V, toRefs as ne, useModel as ie, ref as de, 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 pe, vModelText as ce, normalizeProps as d, guardReactiveProps as u, Fragment as me, createVNode as R, createSlots as U, renderList as N, withCtx as K, isRef as ue } from "vue";
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
2
  import { isMobile as w } from "../../../../utils/_platform.js";
3
- import he from "./KunTableHeaders.vue.js";
4
- import ge from "./KunTableFooter.vue.js";
5
- import fe from "./KunTableRows.vue.js";
6
- import ye from "./KunTableIterators.vue.js";
7
- import be from "../../../KunBtn/src/components/KunBtn.vue.js";
8
- import we from "./KunTableFilter.vue.js";
9
- import ve from "../../../KunCard/src/components/KunCard.vue.js";
10
- import Se from "../composables/useExpand.js";
11
- import Ce from "../composables/useOptions.js";
12
- import $e from "../composables/useSelect.js";
13
- import ke from "../composables/useFilter.js";
14
- import Pe from "../composables/KunTableProps.js";
15
- const Te = ["placeholder"], Fe = { key: 0 }, Ae = { key: 5 }, Ee = { class: "h-full" }, Be = {
3
+ import ge from "./KunTableHeaders.vue.js";
4
+ import fe from "./KunTableFooter.vue.js";
5
+ import ye from "./KunTableRows.vue.js";
6
+ import be from "./KunTableIterators.vue.js";
7
+ import we from "../../../KunBtn/src/components/KunBtn.vue.js";
8
+ import ve from "./KunTableFilter.vue.js";
9
+ import Se from "../../../KunCard/src/components/KunCard.vue.js";
10
+ import Ce from "../composables/useExpand.js";
11
+ import $e from "../composables/useOptions.js";
12
+ import ke from "../composables/useSelect.js";
13
+ import Pe from "../composables/useFilter.js";
14
+ import Te from "../composables/KunTableProps.js";
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
- }, Ie = "overflow-auto h-full w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", Me = "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__ */ V(Pe(), {
20
+ props: /* @__PURE__ */ V(Te(), {
21
21
  selectedItems: { type: Array, default: () => [] },
22
22
  selectedItemsModifiers: {}
23
23
  }),
24
24
  emits: /* @__PURE__ */ V(["update:page", "update:itemsPerPage", "update:sortBy", "update:search"], ["update:selectedItems"]),
25
25
  setup(E, { emit: O }) {
26
- const B = O, r = E, v = ne(r), W = ie(E, "selectedItems"), {
26
+ const B = O, r = E, v = ie(r), W = de(E, "selectedItems"), {
27
27
  headers: b,
28
28
  showExpand: S,
29
29
  showSelect: C,
@@ -35,16 +35,16 @@ const Te = ["placeholder"], Fe = { key: 0 }, Ae = { key: 5 }, Ee = { class: "h-f
35
35
  pageOptions: G,
36
36
  items: J,
37
37
  searchable: M,
38
- debounceTime: Ve
39
- } = v, h = de(r.search);
38
+ debounceTime: X
39
+ } = v, h = pe(r.search);
40
40
  j(() => r.search, (e) => {
41
41
  e !== h.value && (h.value = e);
42
42
  });
43
- const { filteredItems: X, setSearch: Y, modalFilter: g, applyColumnFilters: Z, clearFilters: _, appliedFilters: ee } = ke(v);
43
+ const { filteredItems: Y, setSearch: Z, modalFilter: g, applyColumnFilters: _, clearFilters: ee, appliedFilters: se } = Pe(v, X);
44
44
  j(h, (e) => {
45
- B("update:search", e), Y(e);
45
+ B("update:search", e), Z(e);
46
46
  });
47
- const { options: n, paginatedItems: p, updateSort: se } = Ce(v, B, X), { isSelected: $, toggleSelect: k, toggleSelectAll: te, allSelected: le, someSelected: oe } = $e(p, W), { isExpanded: P, toggleExpand: T } = Se(), m = z(() => ({
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
49
  headers: b.value,
50
50
  page: n.page,
@@ -55,12 +55,12 @@ const Te = ["placeholder"], Fe = { key: 0 }, Ae = { key: 5 }, Ee = { class: "h-f
55
55
  isExpanded: P,
56
56
  sortBy: n.sortBy,
57
57
  hasActions: r.hasActions
58
- })), ae = [Ie, q.value], re = [Me, Q.value];
58
+ })), re = [Me, q.value], ne = [Ve, Q.value];
59
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", A({ class: ae }, e.$attrs, { style: { "user-select": "text" } }), [
63
+ }), (e, t) => (l(), c("div", A({ class: re }, e.$attrs, { style: { "user-select": "text" } }), [
64
64
  s(M) || e.filterable || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), c("div", {
65
65
  key: 0,
66
66
  class: L(["p-2 bg-slate-200 dark:bg-slate-800", {
@@ -70,48 +70,48 @@ const Te = ["placeholder"], Fe = { key: 0 }, Ae = { key: 5 }, Ee = { class: "h-f
70
70
  }])
71
71
  }, [
72
72
  a(e.$slots, "prependSearch"),
73
- e.filterable ? (l(), y(be, {
73
+ e.filterable ? (l(), y(we, {
74
74
  key: 0,
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
78
  })) : i("", !0),
79
- s(M) ? pe((l(), c("input", {
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",
83
83
  placeholder: e.searchPlaceholder,
84
84
  class: "border mx-2 px-3 py-1 rounded w-full max-w-sm text-sm"
85
- }, null, 8, Te)), [
86
- [ce, h.value]
85
+ }, null, 8, Fe)), [
86
+ [me, h.value]
87
87
  ]) : i("", !0),
88
88
  a(e.$slots, "appendSearch")
89
89
  ], 2)) : i("", !0),
90
90
  D("table", {
91
- class: L(re)
91
+ class: L(ne)
92
92
  }, [
93
- e.$slots.colgroup && !s(w) ? (l(), c("colgroup", Fe, [
93
+ e.$slots.colgroup && !s(w) ? (l(), c("colgroup", Ae, [
94
94
  a(e.$slots, "colgroup", d(u(m.value)))
95
95
  ])) : i("", !0),
96
- !s(H) && !s(w) ? (l(), y(he, {
96
+ !s(H) && !s(w) ? (l(), y(ge, {
97
97
  key: 1,
98
98
  headers: s(b),
99
99
  "sort-by": s(n).sortBy,
100
100
  "show-select": s(C),
101
101
  "show-expand": s(S),
102
- "all-selected": s(le),
103
- "some-selected": s(oe),
102
+ "all-selected": s(oe),
103
+ "some-selected": s(ae),
104
104
  "thead-class": e.theadClass,
105
105
  "tr-class": e.trClass,
106
106
  "th-class": e.thClass,
107
107
  "has-actions": e.hasActions,
108
108
  "action-label": e.actionLabel,
109
- onSort: s(se),
110
- onToggleSelectAll: s(te)
109
+ onSort: s(te),
110
+ onToggleSelectAll: s(le)
111
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(me, { key: 3 }, [
112
+ s(p).length && !s(w) ? (l(), c(ue, { key: 3 }, [
113
113
  a(e.$slots, "body.prepend", d(u(m.value))),
114
- R(fe, {
114
+ R(ye, {
115
115
  items: s(p),
116
116
  headers: s(b),
117
117
  "tbody-class": e.tbodyClass,
@@ -137,7 +137,7 @@ const Te = ["placeholder"], Fe = { key: 0 }, Ae = { key: 5 }, Ee = { class: "h-f
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(w) ? (l(), y(ye, {
140
+ ], 64)) : s(p).length && s(w) ? (l(), y(be, {
141
141
  key: 4,
142
142
  items: s(p),
143
143
  headers: s(b),
@@ -158,20 +158,20 @@ const Te = ["placeholder"], Fe = { key: 0 }, Ae = { key: 5 }, Ee = { class: "h-f
158
158
  ])
159
159
  }))
160
160
  ]), 1032, ["items", "headers", "row-class", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect"])) : i("", !0),
161
- e.$slots.tfoot ? (l(), c("tfoot", Ae, [
161
+ e.$slots.tfoot ? (l(), c("tfoot", Ee, [
162
162
  a(e.$slots, "tfoot", d(u(m.value)))
163
163
  ])) : i("", !0)
164
164
  ]),
165
- D("div", Ee, [
166
- s(p).length ? i("", !0) : (l(), y(ve, {
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(A({ key: 2 }, m.value))) : (l(), c("div", Be, [
174
- R(ge, {
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
176
  "items-per-page": s(n).itemsPerPage,
177
177
  "current-page": s(n).page,
@@ -180,14 +180,14 @@ const Te = ["placeholder"], Fe = { key: 0 }, Ae = { key: 5 }, Ee = { class: "h-f
180
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
- e.filterable && s(g) ? (l(), y(we, {
183
+ e.filterable && s(g) ? (l(), y(ve, {
184
184
  key: 3,
185
185
  filters: e.filters,
186
186
  modelValue: s(g),
187
- "onUpdate:modelValue": t[4] || (t[4] = (o) => ue(g) ? g.value = o : null),
188
- onApplyFilters: s(Z),
189
- onClearFilters: s(_),
190
- activeFilters: s(ee).byColumn
187
+ "onUpdate:modelValue": t[4] || (t[4] = (o) => he(g) ? g.value = o : null),
188
+ onApplyFilters: s(_),
189
+ onClearFilters: s(ee),
190
+ activeFilters: s(se).byColumn
191
191
  }, null, 8, ["filters", "modelValue", "onApplyFilters", "onClearFilters", "activeFilters"])) : i("", !0)
192
192
  ], 16));
193
193
  }
@@ -1,14 +1,14 @@
1
- import { reactive as p, ref as F, computed as k, watch as w } from "vue";
2
- import { debounce as A } from "../../../../utils/utils.js";
3
- function L(a) {
4
- const t = p({
1
+ import { reactive as F, ref as k, computed as w, watch as A } from "vue";
2
+ import { debounce as S } from "../../../../utils/utils.js";
3
+ function v(u, i) {
4
+ const t = F({
5
5
  search: "",
6
6
  byColumn: {}
7
- }), { items: c, customFilter: s, searchableKeys: u } = a, f = F(!1), i = (e, r) => e == null ? !1 : String(e).toLowerCase().includes(String(r).toLowerCase()), l = (e, r, n) => {
7
+ }), { items: c, customFilter: s, searchableKeys: f } = u, y = k(!1), a = (e, r) => e == null ? !1 : String(e).toLowerCase().includes(String(r).toLowerCase()), l = (e, r, n) => {
8
8
  const o = e[r];
9
- return typeof (s == null ? void 0 : s.value) == "function" ? s.value(e, r, n) : Array.isArray(n) ? n.some((b) => i(o, b)) : i(o, n);
10
- }, m = k(() => Array.isArray(c.value) ? c.value.filter((e) => {
11
- if (t.search && !(u.value || Object.keys(e)).some((o) => l(e, o, t.search)))
9
+ return typeof (s == null ? void 0 : s.value) == "function" ? s.value(e, r, n) : Array.isArray(n) ? n.some((b) => a(o, b)) : a(o, n);
10
+ }, m = w(() => Array.isArray(c.value) ? c.value.filter((e) => {
11
+ if (t.search && !(f.value || Object.keys(e)).some((o) => l(e, o, t.search)))
12
12
  return !1;
13
13
  for (const r in t.byColumn) {
14
14
  const n = t.byColumn[r];
@@ -16,28 +16,28 @@ function L(a) {
16
16
  return !1;
17
17
  }
18
18
  return !0;
19
- }) : []), y = A((e) => {
19
+ }) : []), h = S((e) => {
20
20
  t.search = (e == null ? void 0 : e.toString().toLowerCase()) || "";
21
- }, a.debounceTime), h = (e, r) => {
21
+ }, i.value), p = (e, r) => {
22
22
  t.byColumn[e] = r;
23
23
  };
24
- function d(e) {
24
+ function C(e) {
25
25
  for (const r in e)
26
- h(r, e[r]);
26
+ p(r, e[r]);
27
27
  }
28
- const C = () => {
28
+ const d = () => {
29
29
  t.search = "", t.byColumn = {};
30
30
  };
31
- return w(() => c.value, () => {
31
+ return A(() => c.value, () => {
32
32
  }, { deep: !0 }), {
33
- modalFilter: f,
33
+ modalFilter: y,
34
34
  appliedFilters: t,
35
35
  filteredItems: m,
36
- setSearch: y,
37
- applyColumnFilters: d,
38
- clearFilters: C
36
+ setSearch: h,
37
+ applyColumnFilters: C,
38
+ clearFilters: d
39
39
  };
40
40
  }
41
41
  export {
42
- L as default
42
+ v as default
43
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.239",
3
+ "version": "0.1.241",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",