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.
- package/dist/adverich-kun-ui.css +1 -1
- package/dist/components/KunCurrency/src/components/KunCurrency.vue.js +58 -46
- package/dist/components/KunNumberField/src/composables/KunNumberFieldProps.js +1 -1
- package/dist/components/KunTable/src/components/KunTableFooter.vue.js +42 -40
- package/dist/config/kunConfig.js +87 -0
- package/dist/index.js +193 -187
- package/dist/utils/tableFormatters.js +47 -33
- package/package.json +1 -1
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
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
|
|
6
|
-
return
|
|
6
|
+
const r = m(n, t.relationPath);
|
|
7
|
+
return a(r);
|
|
7
8
|
}
|
|
8
9
|
if (t.columnType === "function") {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
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
|
|
14
|
+
return a(e);
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
return t.columnType === "toComplete" ? "" : n == null ? "Sin datos" : t.columnType === "dateTime" || t.columnType === "date" ? (
|
|
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
|
|
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) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
39
|
-
return new Intl.DateTimeFormat(
|
|
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
|
-
|
|
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
|
|
49
|
-
return new Intl.DateTimeFormat(
|
|
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
|
-
|
|
69
|
+
hourCycle: "h23",
|
|
70
|
+
...(u = r.date) == null ? void 0 : u.dateTimeFormat,
|
|
71
|
+
...n.format
|
|
72
|
+
}).format(e);
|
|
59
73
|
},
|
|
60
|
-
secondsToTime: (t) =>
|
|
74
|
+
secondsToTime: (t) => f(t ?? 0)
|
|
61
75
|
};
|
|
62
|
-
function
|
|
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
|
|
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
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
92
|
+
g as formatValue,
|
|
93
|
+
i as formatters,
|
|
94
|
+
m as getNestedValue,
|
|
95
|
+
y as getValue
|
|
82
96
|
};
|