adverich-kun-ui 0.1.295 → 0.1.297

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.
@@ -27,14 +27,14 @@ const j = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
27
27
  function x() {
28
28
  c("toggle-select-all");
29
29
  }
30
- function S(l) {
30
+ function p(l) {
31
31
  if (!l.sortable) return;
32
32
  let s = null;
33
33
  Array.isArray(t.sortBy) ? s = t.sortBy.find((f) => f.key === l.value) : typeof t.sortBy == "string" && (s = t.sortBy === l.value ? { key: l.value, order: "asc" } : null);
34
34
  const e = (s == null ? void 0 : s.order) === "asc" ? "desc" : "asc";
35
35
  c("sort", { key: l.value, order: e });
36
36
  }
37
- function p(l) {
37
+ function S(l) {
38
38
  var s;
39
39
  if (Array.isArray(t.sortBy))
40
40
  return (s = t.sortBy.find((e) => e.key === l.value)) == null ? void 0 : s.order;
@@ -42,7 +42,7 @@ const j = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
42
42
  return "asc";
43
43
  }
44
44
  const C = (l) => {
45
- const s = p(l);
45
+ const s = S(l);
46
46
  return s ? s === "asc" ? I : L : O;
47
47
  }, B = [F, t.theadClass], w = [H, t.trClass], i = [K, t.thClass], u = A(null), y = () => {
48
48
  u.value && (u.value.indeterminate = t.someSelected && !t.allSelected);
@@ -81,7 +81,7 @@ const j = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
81
81
  (o(!0), r(E, null, T(n.headers, (e) => (o(), r("th", {
82
82
  key: e.key,
83
83
  class: a([i, e.headerAlign === "right" ? "text-right" : e.headerAlign === "left" ? "text-left" : "text-center"]),
84
- onClick: (f) => S(e),
84
+ onClick: (f) => p(e),
85
85
  style: $({ cursor: e.sortable ? "pointer" : "default" })
86
86
  }, [
87
87
  g(l.$slots, `header.${e.key}`, { header: e }, () => [
@@ -93,7 +93,7 @@ const j = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
93
93
  ], 14, U))), 128)),
94
94
  n.hasActions ? (o(), r("th", {
95
95
  key: 2,
96
- class: a([[i], "text-center"])
96
+ class: a([[i], "text-center print:hidden"])
97
97
  }, h(n.actionLabel), 3)) : d("", !0)
98
98
  ])
99
99
  ]));
@@ -1,22 +1,22 @@
1
- function m(n, t) {
2
- var r, i;
1
+ function f(n, t) {
2
+ var e, i;
3
3
  if (!n || !n.value) return;
4
4
  if (n.columnType === "relation") {
5
- const e = c(t, n.relationPath);
6
- return u(e);
5
+ const r = a(t, n.relationPath);
6
+ return u(r);
7
7
  }
8
8
  if (n.columnType === "function") {
9
- const e = (r = n.columnFunction) == null ? void 0 : r.call(n, t, n);
10
- return u(e);
9
+ const r = (e = n.columnFunction) == null ? void 0 : e.call(n, t, n);
10
+ return u(r);
11
11
  }
12
12
  if (n.columnFormat === "function") {
13
- const e = (i = n.columnRowText) == null ? void 0 : i.call(n, t, n);
14
- return u(e);
13
+ const r = (i = n.columnRowText) == null ? void 0 : i.call(n, t, n);
14
+ return u(r);
15
15
  }
16
16
  const o = t == null ? void 0 : t[n.value];
17
17
  return u(o);
18
18
  }
19
- function f(n, t) {
19
+ function l(n, t) {
20
20
  return t == null ? "Sin datos" : (s[n.columnFormat] || s.default)(t);
21
21
  }
22
22
  const s = {
@@ -38,10 +38,9 @@ const s = {
38
38
  noCeros: (n) => parseFloat(n ?? 0),
39
39
  percentage: (n) => `${parseFloat(n ?? 0)}%`,
40
40
  date: (n) => {
41
- if (!n || n === "0000-00-00") return "Nunca";
42
- const t = Date.parse(n);
41
+ if (!n || n === "0000-00-00" || !c(n)) return "Nunca";
42
+ const t = new Date(n);
43
43
  return new Intl.DateTimeFormat("es-MX", {
44
- locale: "es-ES",
45
44
  weekday: "short",
46
45
  day: "numeric",
47
46
  month: "short",
@@ -49,8 +48,8 @@ const s = {
49
48
  }).format(t);
50
49
  },
51
50
  dateTime: (n) => {
52
- if (!n || n === "0000-00-00") return "Nunca";
53
- const t = Date.parse(n);
51
+ if (!n || n === "0000-00-00" || !c(n)) return "Nunca";
52
+ const t = new Date(n);
54
53
  return new Intl.DateTimeFormat("es-MX", {
55
54
  day: "numeric",
56
55
  month: "short",
@@ -60,22 +59,26 @@ const s = {
60
59
  second: "numeric"
61
60
  }).format(t);
62
61
  },
63
- secondsToTime: (n) => a(n ?? 0)
62
+ secondsToTime: (n) => m(n ?? 0)
64
63
  };
65
- function c(n, t) {
66
- return !n || !t ? n : t.split(".").reduce((o, r) => o == null ? void 0 : o[r], n);
64
+ function a(n, t) {
65
+ return !n || !t ? n : t.split(".").reduce((o, e) => o == null ? void 0 : o[e], n);
67
66
  }
68
- function a(n) {
69
- const t = Math.floor(n / 3600), o = Math.floor(n % 3600 / 60), r = n % 60;
70
- return `${t} horas, ${o} minutos y ${r} segundos`;
67
+ function m(n) {
68
+ const t = Math.floor(n / 3600), o = Math.floor(n % 3600 / 60), e = n % 60;
69
+ return `${t} horas, ${o} minutos y ${e} segundos`;
71
70
  }
72
71
  function u(n) {
73
72
  if (n != null && !(n === "null" || n === "undefined"))
74
73
  return n;
75
74
  }
75
+ function c(n) {
76
+ const t = new Date(n);
77
+ return !isNaN(t.getTime());
78
+ }
76
79
  export {
77
- f as formatValue,
80
+ l as formatValue,
78
81
  s as formatters,
79
- c as getNestedValue,
80
- m as getValue
82
+ a as getNestedValue,
83
+ f as getValue
81
84
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.295",
3
+ "version": "0.1.297",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",