adverich-kun-ui 0.1.535 → 0.1.537

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