adverich-kun-ui 0.1.297 → 0.1.299

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