adverich-kun-ui 0.1.533 → 0.1.535

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