adverich-kun-ui 0.1.462 → 0.1.463

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,43 +1,50 @@
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({
1
+ import { reactive as w, ref as A, computed as S, watch as L } from "vue";
2
+ import { debounce as V } from "../../../../utils/utils.js";
3
+ import { getValue as k, formatValue as x } from "../../../../utils/tableFormatters.js";
4
+ function j(f, m) {
5
+ const n = w({
5
6
  search: "",
6
7
  byColumn: {}
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
- 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) => 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)))
8
+ }), { items: u, customFilter: s, searchableKeys: y, headers: a } = f, p = A(!1), c = (e, r) => e == null ? !1 : String(e).toLowerCase().includes(String(r).toLowerCase()), h = (e, r) => {
9
+ var l;
10
+ const t = (l = a == null ? void 0 : a.value) == null ? void 0 : l.find((g) => g.value === r);
11
+ if (!t) return e[r];
12
+ const o = k(t, e);
13
+ return x(t, o);
14
+ }, i = (e, r, t) => {
15
+ const o = h(e, r);
16
+ return typeof (s == null ? void 0 : s.value) == "function" ? s.value(e, r, t) : Array.isArray(t) ? t.some((l) => c(o, l)) : c(o, t);
17
+ }, d = S(() => Array.isArray(u.value) ? u.value.filter((e) => {
18
+ if (n.search && !(y.value || a.value.map((o) => o.value)).some((o) => i(e, o, n.search)))
12
19
  return !1;
13
- for (const r in t.byColumn) {
14
- const n = t.byColumn[r];
15
- if (n != null && n !== "" && !l(e, r, n))
20
+ for (const r in n.byColumn) {
21
+ const t = n.byColumn[r];
22
+ if (t != null && t !== "" && !i(e, r, t))
16
23
  return !1;
17
24
  }
18
25
  return !0;
19
- }) : []), h = S((e) => {
20
- t.search = (e == null ? void 0 : e.toString().toLowerCase()) || "";
21
- }, i.value), p = (e, r) => {
22
- t.byColumn[e] = r;
26
+ }) : []), C = V((e) => {
27
+ n.search = (e == null ? void 0 : e.toString().toLowerCase()) || "";
28
+ }, m.value), b = (e, r) => {
29
+ n.byColumn[e] = r;
23
30
  };
24
- function C(e) {
31
+ function F(e) {
25
32
  for (const r in e)
26
- p(r, e[r]);
33
+ b(r, e[r]);
27
34
  }
28
- const d = () => {
29
- t.search = "", t.byColumn = {};
35
+ const v = () => {
36
+ n.search = "", n.byColumn = {};
30
37
  };
31
- return A(() => c.value, () => {
38
+ return L(() => u.value, () => {
32
39
  }, { deep: !0 }), {
33
- modalFilter: y,
34
- appliedFilters: t,
35
- filteredItems: m,
36
- setSearch: h,
37
- applyColumnFilters: C,
38
- clearFilters: d
40
+ modalFilter: p,
41
+ appliedFilters: n,
42
+ filteredItems: d,
43
+ setSearch: C,
44
+ applyColumnFilters: F,
45
+ clearFilters: v
39
46
  };
40
47
  }
41
48
  export {
42
- v as default
49
+ j as default
43
50
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.462",
3
+ "version": "0.1.463",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",