@grapadigital/shared-app-modules 0.0.220 → 0.0.221
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/chuncks/masks.util.BRKIo9dr.js +27 -0
- package/dist/chuncks/on-key-down.event.jEzdzJis.js +26 -0
- package/dist/components.js +2 -2
- package/dist/events.js +5 -26
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chuncks/masks.util.4YIVDYLE.js +0 -31
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { i as s } from "./youtube-icon.component.BSdD-jlw.js";
|
|
2
|
+
const i = (t) => {
|
|
3
|
+
const e = s(t) ? t : Number(t);
|
|
4
|
+
return `${parseInt(String(e * 100))}%`;
|
|
5
|
+
}, l = (t) => {
|
|
6
|
+
const r = +String(t).replace(/\D/g, "") / 100;
|
|
7
|
+
return +String(r).split(".")[0] >= 1 ? 1 : r;
|
|
8
|
+
};
|
|
9
|
+
function o(t) {
|
|
10
|
+
const e = String((+t * 100).toFixed(2)).padStart(5, "0").replace(/\D/g, "");
|
|
11
|
+
if (Number(t) >= 1) return "100,00%";
|
|
12
|
+
const r = e.slice(0, 2), n = e.slice(2, 4);
|
|
13
|
+
return `${r},${n}%`;
|
|
14
|
+
}
|
|
15
|
+
const u = (t) => {
|
|
16
|
+
let e = String(t).replace(/\D/g, "");
|
|
17
|
+
if (e.length === 5 && e[0] !== "0" || e.slice(0, 5) === "10000") return 1;
|
|
18
|
+
e = e.slice(-4), e = e.padStart(4, "0");
|
|
19
|
+
const r = e.slice(0, 2), n = e.slice(2, 4);
|
|
20
|
+
return e = `${r}.${n}`, +(String(+e / 100).length > 6 ? (+e / 100).toFixed(4) : String(+e / 100));
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
u as a,
|
|
24
|
+
o as b,
|
|
25
|
+
i as m,
|
|
26
|
+
l as u
|
|
27
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { u as r, a as l } from "./masks.util.BRKIo9dr.js";
|
|
2
|
+
const i = (t, n) => {
|
|
3
|
+
const e = t.target.value, a = r(e);
|
|
4
|
+
n(a);
|
|
5
|
+
}, k = (t, n) => {
|
|
6
|
+
const e = t.target.value, a = l(e);
|
|
7
|
+
n(a);
|
|
8
|
+
}, d = (t, n) => {
|
|
9
|
+
const e = t.target, a = e.value, s = e.selectionStart, c = e.selectionEnd;
|
|
10
|
+
if (s === c && t.key === "Backspace") {
|
|
11
|
+
const o = a.slice(0, -2), u = r(o);
|
|
12
|
+
n(u);
|
|
13
|
+
}
|
|
14
|
+
}, m = (t, n) => {
|
|
15
|
+
const e = t.target, a = e.value, s = e.selectionStart, c = e.selectionEnd;
|
|
16
|
+
if (s === c && t.key === "Backspace") {
|
|
17
|
+
const o = a.slice(0, -2), u = l(o);
|
|
18
|
+
n(u);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
d as a,
|
|
23
|
+
k as b,
|
|
24
|
+
m as c,
|
|
25
|
+
i as o
|
|
26
|
+
};
|
package/dist/components.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { aZ as v, I as _, c as u, B as N, a_ as M, aq as T, ar as F, as as D, w as $, F as j, W as q, X as B, $ as I, _ as O, Y as K, a0 as U } from "./chuncks/switch.D_38xWg-.js";
|
|
2
2
|
import { jsx as e, jsxs as g, Fragment as R } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { m as Y,
|
|
3
|
+
import { a as W, o as X, c as G, b as Q } from "./chuncks/on-key-down.event.jEzdzJis.js";
|
|
4
|
+
import { m as Y, b as Z } from "./chuncks/masks.util.BRKIo9dr.js";
|
|
5
5
|
import S, { useState as A, useRef as P, useEffect as H, useMemo as J } from "react";
|
|
6
6
|
import { M as V, s as ee } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
|
|
7
7
|
import { t as nt, L as at, O as rt, u as st, H as it, Y as ot, a4 as lt, Z as dt, _ as ct, J as gt, $ as ut, a5 as pt, a0 as xt, a1 as mt, a2 as bt, a3 as ft, K as ht, Q as yt, a7 as wt, a8 as vt, ad as kt, w as Nt, x as It, y as St, z as Ct, G as zt, a9 as _t, U as Mt, X as Tt, W as Ft, a6 as Dt, aa as Rt, ab as At, ac as Pt, af as Ht, ae as Lt } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
|
package/dist/events.js
CHANGED
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const i = (t, n) => {
|
|
3
|
-
const e = t.target.value, a = r(e);
|
|
4
|
-
n(a);
|
|
5
|
-
}, k = (t, n) => {
|
|
6
|
-
let e = t.target.value;
|
|
7
|
-
e = e.replace(",", ".");
|
|
8
|
-
const a = u(e);
|
|
9
|
-
n(a);
|
|
10
|
-
}, d = (t, n) => {
|
|
11
|
-
const e = t.target, a = e.value, s = e.selectionStart, c = e.selectionEnd;
|
|
12
|
-
if (s === c && t.key === "Backspace") {
|
|
13
|
-
const o = a.slice(0, -2), l = r(o);
|
|
14
|
-
n(l);
|
|
15
|
-
}
|
|
16
|
-
}, m = (t, n) => {
|
|
17
|
-
const e = t.target, a = e.value, s = e.selectionStart, c = e.selectionEnd;
|
|
18
|
-
if (s === c && t.key === "Backspace") {
|
|
19
|
-
const o = a.slice(0, -2), l = u(o);
|
|
20
|
-
n(l);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
1
|
+
import { b as a, o, c as t, a as g } from "./chuncks/on-key-down.event.jEzdzJis.js";
|
|
23
2
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
3
|
+
a as onChangePercentageFloat,
|
|
4
|
+
o as onChangePercentageInteger,
|
|
5
|
+
t as onKeyDownPercentageFloat,
|
|
6
|
+
g as onKeyDownPercentageInteger
|
|
28
7
|
};
|
package/dist/utils.d.ts
CHANGED
|
@@ -187,7 +187,7 @@ export declare function maskCPF(value: string): string;
|
|
|
187
187
|
|
|
188
188
|
export declare function maskPercentageFloat(value: string | number): string;
|
|
189
189
|
|
|
190
|
-
export declare const maskPercentageInteger: (value: string | number) => string
|
|
190
|
+
export declare const maskPercentageInteger: (value: string | number) => string;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* Aplica a máscara de RG a uma string numérica.
|
|
@@ -373,7 +373,7 @@ export declare function unmask(maskedValue: string): string;
|
|
|
373
373
|
|
|
374
374
|
export declare const unmaskPercentageFloat: (maskedValue: string | number) => number;
|
|
375
375
|
|
|
376
|
-
export declare const unmaskPercentageInteger: (
|
|
376
|
+
export declare const unmaskPercentageInteger: (maskedValue: string | number) => number;
|
|
377
377
|
|
|
378
378
|
export declare const UTIL: typeof UTIL_MODULES;
|
|
379
379
|
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as a, f as s } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
|
|
2
2
|
import { r as C, p as O, n as x, j as U, h as j, l as q, m as w, k as B, g as R, o as T, q as A, v as z } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
|
|
3
|
-
import {
|
|
3
|
+
import { b as J, m as Z, a as H, u as K } from "./chuncks/masks.util.BRKIo9dr.js";
|
|
4
4
|
function c(e) {
|
|
5
5
|
const r = e.replace(/[^0-9]/g, "");
|
|
6
6
|
return Number(r) / 100;
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const c = (r) => {
|
|
2
|
-
let e = String(r).replace(/\D/g, "");
|
|
3
|
-
if (e.slice(0, 5) === "10000" || e.length === 5 && e[0] !== "0")
|
|
4
|
-
return "100,00";
|
|
5
|
-
e = e.slice(-4);
|
|
6
|
-
const t = e.padStart(4, "0"), n = t.slice(0, 2), a = t.slice(2, 4), s = `${n},${a}`;
|
|
7
|
-
if (parseInt(e) <= 1e4)
|
|
8
|
-
return s;
|
|
9
|
-
}, i = (r) => {
|
|
10
|
-
const t = +String(r).replace("%", "") / 100;
|
|
11
|
-
return +String(t).split(".")[0] >= 1 ? 1 : t;
|
|
12
|
-
};
|
|
13
|
-
function l(r) {
|
|
14
|
-
const e = String((+r * 100).toFixed(2)).padStart(5, "0").replace(/\D/g, "");
|
|
15
|
-
if (Number(r) >= 1) return "100,00%";
|
|
16
|
-
const t = e.slice(0, 2), n = e.slice(2, 4);
|
|
17
|
-
return `${t},${n}%`;
|
|
18
|
-
}
|
|
19
|
-
const o = (r) => {
|
|
20
|
-
let e = String(r).replace(/\D/g, "");
|
|
21
|
-
if (e.length === 5 && e[0] !== "0" || e.slice(0, 5) === "10000") return 1;
|
|
22
|
-
e = e.slice(-4), e = e.padStart(4, "0");
|
|
23
|
-
const t = e.slice(0, 2), n = e.slice(2, 4);
|
|
24
|
-
return e = `${t}.${n}`, +(String(+e / 100).length > 6 ? (+e / 100).toFixed(4) : String(+e / 100));
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
l as a,
|
|
28
|
-
o as b,
|
|
29
|
-
c as m,
|
|
30
|
-
i as u
|
|
31
|
-
};
|