adverich-kun-ui 0.1.536 → 0.1.538

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,5 +1,5 @@
1
- import { inject as f, reactive as a, readonly as u } from "vue";
2
- const l = {
1
+ import { inject as l, reactive as a, readonly as u } from "vue";
2
+ const f = {
3
3
  locale: "es-AR",
4
4
  currency: {
5
5
  code: "ARS",
@@ -31,7 +31,7 @@ function c(e, r) {
31
31
  r[t] !== null && typeof r[t] == "object" && !Array.isArray(r[t]) && e[t] !== null && typeof e[t] == "object" && !Array.isArray(e[t]) ? o[t] = c(e[t], r[t]) : o[t] = r[t];
32
32
  return o;
33
33
  }
34
- const n = a({ ...l }), d = Symbol("kunConfig"), y = {
34
+ const n = a({ ...f }), d = Symbol("kunConfig"), y = {
35
35
  // Acceso readonly para evitar mutaciones directas
36
36
  get current() {
37
37
  return u(n);
@@ -48,13 +48,12 @@ const n = a({ ...l }), d = Symbol("kunConfig"), y = {
48
48
  },
49
49
  // Configurar (merge profundo)
50
50
  configure(e = {}) {
51
- console.log(e);
52
51
  const r = c(n, e);
53
52
  Object.assign(n, r);
54
53
  },
55
54
  // Reset a valores por defecto
56
55
  reset() {
57
- Object.assign(n, c({}, l));
56
+ Object.assign(n, c({}, f));
58
57
  },
59
58
  // Setters individuales para configuración dinámica
60
59
  setLocale(e) {
@@ -65,7 +64,7 @@ const n = a({ ...l }), d = Symbol("kunConfig"), y = {
65
64
  }
66
65
  };
67
66
  function m() {
68
- const e = f(d, null);
67
+ const e = l(d, null);
69
68
  return e || y.current;
70
69
  }
71
70
  function b(e, r, o) {
@@ -1,64 +1,64 @@
1
- import { resolveConfigValue as c, kunConfig as l } from "../config/kunConfig.js";
2
- function y(t, n) {
3
- var o;
1
+ import { kunConfig as i } from "../config/kunConfig.js";
2
+ function g(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 = l(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 y(t, n) {
17
+ const o = i.current, e = o.locale, r = o.currency;
18
+ return console.log(r), console.log(e), t.columnType === "toComplete" ? "" : n == null ? "Sin datos" : t.columnType === "dateTime" || t.columnType === "date" ? (c[t.columnType] || c.default)(n) : (c[t.columnFormat] || c.default)(n);
18
19
  }
19
- const i = {
20
+ const c = {
20
21
  default: (t) => t,
21
22
  // TEXTS
22
23
  text: (t) => String(t),
23
24
  activeOrInactive: (t) => t ? "Activa" : "Inactiva",
24
25
  composed: (t) => t,
25
26
  // 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);
27
+ // NUMBERS - Usa config global directamente
28
+ number: (t) => {
29
+ const n = i.locale;
30
+ return Number(t).toLocaleString(n);
30
31
  },
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, {
32
+ money: (t) => {
33
+ const n = i.current, o = n.locale, e = n.currency;
34
+ return new Intl.NumberFormat(o, {
34
35
  style: "currency",
35
- currency: o,
36
- minimumFractionDigits: r,
37
- maximumFractionDigits: r
36
+ currency: e.code,
37
+ minimumFractionDigits: e.precision,
38
+ maximumFractionDigits: e.precision
38
39
  }).format(t ?? 0);
39
40
  },
40
41
  noDecimal: (t) => parseFloat(t ?? 0).toFixed(0),
41
42
  withDecimals: (t, n = 2) => parseFloat(t ?? 0).toFixed(n),
42
43
  noCeros: (t) => parseFloat(t ?? 0),
43
44
  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, {
45
+ date: (t) => {
46
+ var r;
47
+ if (!t || t === "0000-00-00" || !a(t)) return "Nunca";
48
+ const n = new Date(t), o = i.current, e = o.locale;
49
+ return new Intl.DateTimeFormat(e, {
49
50
  weekday: "short",
50
51
  day: "2-digit",
51
52
  month: "short",
52
53
  year: "2-digit",
53
- ...(u = r.date) == null ? void 0 : u.dateFormat,
54
- ...n.format
55
- }).format(e);
54
+ ...(r = o.date) == null ? void 0 : r.dateFormat
55
+ }).format(n);
56
56
  },
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, {
57
+ dateTime: (t) => {
58
+ var r;
59
+ if (!t || t === "0000-00-00" || !a(t)) return "Nunca";
60
+ const n = new Date(t), o = i.current, e = o.locale;
61
+ return new Intl.DateTimeFormat(e, {
62
62
  weekday: "short",
63
63
  day: "2-digit",
64
64
  month: "short",
@@ -67,30 +67,29 @@ const i = {
67
67
  minute: "2-digit",
68
68
  second: "2-digit",
69
69
  hourCycle: "h23",
70
- ...(u = r.date) == null ? void 0 : u.dateTimeFormat,
71
- ...n.format
72
- }).format(e);
70
+ ...(r = o.date) == null ? void 0 : r.dateTimeFormat
71
+ }).format(n);
73
72
  },
74
73
  secondsToTime: (t) => f(t ?? 0)
75
74
  };
76
- function m(t, n) {
77
- return !t || !n ? t : n.split(".").reduce((e, o) => e == null ? void 0 : e[o], t);
75
+ function l(t, n) {
76
+ return !t || !n ? t : n.split(".").reduce((o, e) => o == null ? void 0 : o[e], t);
78
77
  }
79
78
  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`;
79
+ const n = Math.floor(t / 3600), o = Math.floor(t % 3600 / 60), e = t % 60;
80
+ return `${n} horas, ${o} minutos y ${e} segundos`;
82
81
  }
83
- function a(t) {
82
+ function u(t) {
84
83
  if (t != null && !(t === "null" || t === "undefined"))
85
84
  return t;
86
85
  }
87
- function s(t) {
86
+ function a(t) {
88
87
  const n = new Date(t);
89
88
  return !isNaN(n.getTime());
90
89
  }
91
90
  export {
92
- g as formatValue,
93
- i as formatters,
94
- m as getNestedValue,
95
- y as getValue
91
+ y as formatValue,
92
+ c as formatters,
93
+ l as getNestedValue,
94
+ g as getValue
96
95
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.536",
3
+ "version": "0.1.538",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",