adverich-kun-ui 0.1.296 → 0.1.298

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,56 +1,55 @@
1
- function m(n, t) {
2
- var r, i;
3
- if (!n || !n.value) return;
4
- if (n.columnType === "relation") {
5
- const e = c(t, n.relationPath);
6
- return u(e);
1
+ function a(t, n) {
2
+ var r, c;
3
+ if (!t || !t.value) return;
4
+ if (t.columnType === "relation") {
5
+ const u = m(n, t.relationPath);
6
+ return i(u);
7
7
  }
8
- if (n.columnType === "function") {
9
- const e = (r = n.columnFunction) == null ? void 0 : r.call(n, t, n);
10
- return u(e);
8
+ if (t.columnType === "function") {
9
+ const u = (r = t.columnFunction) == null ? void 0 : r.call(t, n, t);
10
+ return i(u);
11
11
  }
12
- if (n.columnFormat === "function") {
13
- const e = (i = n.columnRowText) == null ? void 0 : i.call(n, t, n);
14
- return u(e);
12
+ if (t.columnFormat === "function") {
13
+ const u = (c = t.columnFunction) == null ? void 0 : c.call(t, n, t);
14
+ return i(u);
15
15
  }
16
- const o = t == null ? void 0 : t[n.value];
17
- return u(o);
16
+ const o = n == null ? void 0 : n[t.value];
17
+ return i(o);
18
18
  }
19
- function f(n, t) {
20
- return t == null ? "Sin datos" : (s[n.columnFormat] || s.default)(t);
19
+ function l(t, n) {
20
+ return n == null ? "Sin datos" : t.columnType === "dateTime" || t.columnType === "date" ? (e[t.columnType] || e.default)(n) : (e[t.columnFormat] || e.default)(n);
21
21
  }
22
- const s = {
23
- default: (n) => n,
22
+ const e = {
23
+ default: (t) => t,
24
24
  // TEXTS
25
- text: (n) => String(n),
26
- activeOrInactive: (n) => n ? "Activa" : "Inactiva",
27
- composed: (n) => n,
25
+ text: (t) => String(t),
26
+ activeOrInactive: (t) => t ? "Activa" : "Inactiva",
27
+ composed: (t) => t,
28
28
  // ya está procesado por getComposedValue
29
29
  // NUMBERS
30
- number: (n) => Number(n).toLocaleString("es-AR"),
31
- money: (n) => new Intl.NumberFormat("es-CL", {
30
+ number: (t) => Number(t).toLocaleString("es-AR"),
31
+ money: (t) => new Intl.NumberFormat("es-CL", {
32
32
  style: "currency",
33
33
  currency: "CLP",
34
34
  minimumFractionDigits: 2
35
- }).format(n ?? 0),
36
- noDecimal: (n) => parseFloat(n ?? 0).toFixed(0),
37
- withDecimals: (n, t = 2) => parseFloat(n ?? 0).toFixed(t),
38
- noCeros: (n) => parseFloat(n ?? 0),
39
- percentage: (n) => `${parseFloat(n ?? 0)}%`,
40
- date: (n) => {
41
- if (!n || n === "0000-00-00") return "Nunca";
42
- const t = Date.parse(n);
35
+ }).format(t ?? 0),
36
+ noDecimal: (t) => parseFloat(t ?? 0).toFixed(0),
37
+ withDecimals: (t, n = 2) => parseFloat(t ?? 0).toFixed(n),
38
+ noCeros: (t) => parseFloat(t ?? 0),
39
+ percentage: (t) => `${parseFloat(t ?? 0)}%`,
40
+ date: (t) => {
41
+ if (!t || t === "0000-00-00" || !s(t)) return "Nunca";
42
+ const n = new Date(t);
43
43
  return new Intl.DateTimeFormat("es-MX", {
44
- locale: "es-ES",
45
44
  weekday: "short",
46
45
  day: "numeric",
47
46
  month: "short",
48
47
  year: "2-digit"
49
- }).format(t);
48
+ }).format(n);
50
49
  },
51
- dateTime: (n) => {
52
- if (!n || n === "0000-00-00") return "Nunca";
53
- const t = Date.parse(n);
50
+ dateTime: (t) => {
51
+ if (!t || t === "0000-00-00" || !s(t)) return "Nunca";
52
+ const n = new Date(t);
54
53
  return new Intl.DateTimeFormat("es-MX", {
55
54
  day: "numeric",
56
55
  month: "short",
@@ -58,24 +57,28 @@ const s = {
58
57
  hour: "numeric",
59
58
  minute: "numeric",
60
59
  second: "numeric"
61
- }).format(t);
60
+ }).format(n);
62
61
  },
63
- secondsToTime: (n) => a(n ?? 0)
62
+ secondsToTime: (t) => f(t ?? 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 m(t, n) {
65
+ return !t || !n ? t : n.split(".").reduce((o, r) => o == null ? void 0 : o[r], t);
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 f(t) {
68
+ const n = Math.floor(t / 3600), o = Math.floor(t % 3600 / 60), r = t % 60;
69
+ return `${n} horas, ${o} minutos y ${r} segundos`;
71
70
  }
72
- function u(n) {
73
- if (n != null && !(n === "null" || n === "undefined"))
74
- return n;
71
+ function i(t) {
72
+ if (t != null && !(t === "null" || t === "undefined"))
73
+ return t;
74
+ }
75
+ function s(t) {
76
+ const n = new Date(t);
77
+ return !isNaN(n.getTime());
75
78
  }
76
79
  export {
77
- f as formatValue,
78
- s as formatters,
79
- c as getNestedValue,
80
- m as getValue
80
+ l as formatValue,
81
+ e as formatters,
82
+ m as getNestedValue,
83
+ a as getValue
81
84
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.296",
3
+ "version": "0.1.298",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",