@m4l/components 9.57.2-beta-pkg-783-ajustes-mf-49.0 → 9.57.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.57.2
|
|
3
|
+
"version": "9.57.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@hookform/resolvers": "2.9.11",
|
|
54
54
|
"nprogress": "0.2.0",
|
|
55
55
|
"react-transition-group": "4.4.5",
|
|
56
|
-
"react-color": "2.19.3",
|
|
57
|
-
"@tanstack/react-virtual": "3.13.23",
|
|
58
56
|
"@mui/x-date-pickers": "6.20.2",
|
|
57
|
+
"@tanstack/react-virtual": "3.13.23",
|
|
59
58
|
"react-draggable": "4.5.0",
|
|
60
|
-
"react-rnd": "10.5.2",
|
|
61
59
|
"react-spinners": "0.13.8",
|
|
60
|
+
"react-color": "2.19.3",
|
|
62
61
|
"react-dropzone": "14.4.1",
|
|
62
|
+
"react-rnd": "10.5.2",
|
|
63
63
|
"chart.js": "4.5.1",
|
|
64
64
|
"chartjs-chart-error-bars": "4.4.5",
|
|
65
65
|
"qrcode.react": "3.2.0",
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { PresentationTimeType, FormatDistanteToNowDictionary, FormatDistanceToNowReturn } from './types';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* TODO: Documentar
|
|
4
|
+
*/
|
|
3
5
|
export declare const formatDistanceToNow: (type: PresentationTimeType, date: Date, dictionary: FormatDistanteToNowDictionary) => FormatDistanceToNowReturn;
|
|
4
6
|
//# sourceMappingURL=formatDistanteToNow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatDistanteToNow.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/utils/formatDistanceToNow/formatDistanteToNow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"formatDistanteToNow.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/utils/formatDistanceToNow/formatDistanteToNow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAezG;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,oBAAoB,EAC1B,MAAM,IAAI,EACV,YAAY,6BAA6B,KACzC,yBAkGD,CAAC"}
|
|
@@ -4,25 +4,25 @@ const s = (i, ...h) => {
|
|
|
4
4
|
for (let b = 0; b < h.length; b++)
|
|
5
5
|
e = e?.replaceAll(`$${b + 1}`, h[b]);
|
|
6
6
|
return e;
|
|
7
|
-
},
|
|
7
|
+
}, N = (i, h, e) => {
|
|
8
8
|
if (!(h instanceof Date))
|
|
9
9
|
return { time: "No date", value: "", unit: "" };
|
|
10
|
-
const w =
|
|
10
|
+
const w = (/* @__PURE__ */ new Date()).getTime() - h.getTime(), o = Math.floor(w / 1e3), u = Math.floor(o / 60), l = Math.floor(u / 60), n = Math.floor(l / 24), a = Math.floor(n / 30), f = Math.floor(a / 12);
|
|
11
11
|
let r, m, t = "";
|
|
12
|
-
const
|
|
12
|
+
const M = f > 1 ? e.label_unit_time_years : e.label_unit_time_year, S = a % 12 > 1 ? e.label_unit_time_months : e.label_unit_time_month, p = n % 30 > 1 ? e.label_unit_time_days : e.label_unit_time_day, g = l % 24 > 1 ? e.label_unit_time_hours : e.label_unit_time_hour, c = o > 1 ? e.label_unit_time_seconds : e.label_unit_time_second, D = u % 60 > 1 ? e.label_unit_time_minutes : e.label_unit_time_minute;
|
|
13
13
|
let _ = e.label_sentence_present_others;
|
|
14
14
|
i === "past" ? _ = e.label_sentence_past_others : i === "future" && (_ = e.label_sentence_future_others);
|
|
15
15
|
const T = ":", $ = "-";
|
|
16
|
-
return o < 60 ? (i === "past" ? t = s(e.label_sentence_past_seconds, o + "",
|
|
16
|
+
return o < 60 ? (i === "past" ? t = s(e.label_sentence_past_seconds, o + "", c) : i === "future" ? t = s(
|
|
17
17
|
e.label_sentence_future_seconds,
|
|
18
18
|
o + "",
|
|
19
|
-
|
|
19
|
+
c
|
|
20
20
|
) : t = s(
|
|
21
21
|
e.label_sentence_present_seconds,
|
|
22
22
|
o + "",
|
|
23
|
-
|
|
24
|
-
), r = o.toString().padStart(2, "0") + "", m = e.label_unit_time_seconds_short) : u < 60 ? (t = s(_, `${u}`, D), r = u.toString().padStart(2, "0") + ":" + (o % 60).toString().padStart(2, "0"), m = e.label_unit_time_minutes_short + e.label_separator_time + e.label_unit_time_seconds_short) : l < 24 ? (u % 60 > 0 ? t = s(_, `${l} ${g} ${u % 60} ${D}`, "") : t = s(_, `${l} ${g}`, ""), r = l.toString().padStart(2, "0") + ":" + (u % 60).toString().padStart(2, "0"), m = e.label_unit_time_hours_short + T + e.label_unit_time_minutes_short) : n < 30 ? (l % 24 > 0 ? t = s(_, `${n} ${p} ${l % 24} ${g}`, "") : t = s(_, `${n} ${p}`, ""), r = n.toString().padStart(2, "0") + " " + (l % 24).toString().padStart(2, "0"), m = e.label_unit_time_days_short + " " + e.label_unit_time_hours_short) : a < 12 ? (n % 30 > 0 ? t = s(_, `${a} ${S} ${n % 30} ${p}`, "") : t = s(_, `${a} ${S}`, ""), r = a.toString().padStart(2, "0") + $ + (n % 30).toString().padStart(2, "0"), m = e.label_unit_time_months_short + $ + e.label_unit_time_days_short) : (a % 12 > 0 ? t = s(_, `${f} ${
|
|
23
|
+
c
|
|
24
|
+
), r = o.toString().padStart(2, "0") + "", m = e.label_unit_time_seconds_short) : u < 60 ? (t = s(_, `${u}`, D), r = u.toString().padStart(2, "0") + ":" + (o % 60).toString().padStart(2, "0"), m = e.label_unit_time_minutes_short + e.label_separator_time + e.label_unit_time_seconds_short) : l < 24 ? (u % 60 > 0 ? t = s(_, `${l} ${g} ${u % 60} ${D}`, "") : t = s(_, `${l} ${g}`, ""), r = l.toString().padStart(2, "0") + ":" + (u % 60).toString().padStart(2, "0"), m = e.label_unit_time_hours_short + T + e.label_unit_time_minutes_short) : n < 30 ? (l % 24 > 0 ? t = s(_, `${n} ${p} ${l % 24} ${g}`, "") : t = s(_, `${n} ${p}`, ""), r = n.toString().padStart(2, "0") + " " + (l % 24).toString().padStart(2, "0"), m = e.label_unit_time_days_short + " " + e.label_unit_time_hours_short) : a < 12 ? (n % 30 > 0 ? t = s(_, `${a} ${S} ${n % 30} ${p}`, "") : t = s(_, `${a} ${S}`, ""), r = a.toString().padStart(2, "0") + $ + (n % 30).toString().padStart(2, "0"), m = e.label_unit_time_months_short + $ + e.label_unit_time_days_short) : (a % 12 > 0 ? t = s(_, `${f} ${M} ${a % 12} ${S}`, "") : t = s(_, `${f} ${M}`, ""), r = f.toString().padStart(2, "0") + $ + (a % 12).toString().padStart(2, "0"), m = e.label_unit_time_years_short + $ + e.label_unit_time_months_short), { time: t, value: r, unit: m };
|
|
25
25
|
};
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
N as formatDistanceToNow
|
|
28
28
|
};
|