@grapadigital/shared-app-modules 0.0.155 → 0.0.156
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/utils.d.ts +28 -0
- package/dist/utils.js +25 -21
- package/package.json +1 -1
package/dist/utils.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ declare namespace FIELD_MESSAGE_MODULES {
|
|
|
15
15
|
requiredMessage,
|
|
16
16
|
minLengthMessage,
|
|
17
17
|
maxLengthMessage,
|
|
18
|
+
minValueMessage,
|
|
19
|
+
maxValueMessage,
|
|
18
20
|
invalidMessage
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -168,6 +170,19 @@ export declare function maskZipCode(value: string): string;
|
|
|
168
170
|
*/
|
|
169
171
|
export declare const maxLengthMessage: (max: number, field?: string) => string;
|
|
170
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Gera uma mensagem de erro para valores que excedem o máximo permitido.
|
|
175
|
+
*
|
|
176
|
+
* @param {number} max - Valor máximo permitido.
|
|
177
|
+
* @param {string} [field] - Nome do campo (opcional).
|
|
178
|
+
* @returns {string} Mensagem indicando que o valor não pode ser maior que o máximo.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* maxValueMessage(100); // "Não pode ser maior que 100."
|
|
182
|
+
* maxValueMessage(100, "Pontuação"); // "Pontuação não pode ser maior que 100."
|
|
183
|
+
*/
|
|
184
|
+
export declare const maxValueMessage: (max: number, field?: string) => string;
|
|
185
|
+
|
|
171
186
|
/**
|
|
172
187
|
* Gera uma mensagem de erro para campos que não atingem o número mínimo de caracteres.
|
|
173
188
|
*
|
|
@@ -181,6 +196,19 @@ export declare const maxLengthMessage: (max: number, field?: string) => string;
|
|
|
181
196
|
*/
|
|
182
197
|
export declare const minLengthMessage: (min: number, field?: string) => string;
|
|
183
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Gera uma mensagem de erro para valores que estão abaixo do mínimo permitido.
|
|
201
|
+
*
|
|
202
|
+
* @param {number} min - Valor mínimo permitido.
|
|
203
|
+
* @param {string} [field] - Nome do campo (opcional).
|
|
204
|
+
* @returns {string} Mensagem indicando que o valor não pode ser menor que o mínimo.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* minValueMessage(5); // "Não pode ser menor que 5."
|
|
208
|
+
* minValueMessage(5, "Idade"); // "Idade não pode ser menor que 5."
|
|
209
|
+
*/
|
|
210
|
+
export declare const minValueMessage: (min: number, field?: string) => string;
|
|
211
|
+
|
|
184
212
|
export declare function preFormatCurrency(value: string): number;
|
|
185
213
|
|
|
186
214
|
/**
|
package/dist/utils.js
CHANGED
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
import { U as
|
|
2
|
-
import { g as C, h as E, f as L, a as _, d as b, m as v, c as
|
|
3
|
-
import { I as
|
|
4
|
-
import { e as
|
|
5
|
-
const
|
|
1
|
+
import { U as o } from "./chuncks/format.util.BPVDuHoX.js";
|
|
2
|
+
import { g as C, h as E, f as L, a as _, d as b, m as v, c as l, e as D, p as I, b as U, u as k } from "./chuncks/format.util.BPVDuHoX.js";
|
|
3
|
+
import { I as a } from "./chuncks/youtube-icon.component.BQUJXvPb.js";
|
|
4
|
+
import { e as P, d as q, i as x, c as y } from "./chuncks/youtube-icon.component.BQUJXvPb.js";
|
|
5
|
+
const s = (e) => e ? `${e} é obrigatório.` : "Campo obrigatório.", t = (e, r) => r ? `${r} deve ter no mínimo ${e} caracteres.` : `Deve ter no mínimo ${e} caracteres.`, n = (e, r) => r ? `${r} deve ter no máximo ${e} caracteres.` : `Deve ter no máximo ${e} caracteres.`, m = (e, r) => r ? `${r} não pode ser menor que ${e}.` : `Não pode ser menor que ${e}.`, i = (e, r) => r ? `${r} não pode ser maior que ${e}.` : `Não pode ser maior que ${e}.`, c = (e) => e ? `${e} inválido.` : "Valor inválido.", u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
6
|
__proto__: null,
|
|
7
|
-
invalidMessage:
|
|
7
|
+
invalidMessage: c,
|
|
8
8
|
maxLengthMessage: n,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
maxValueMessage: i,
|
|
10
|
+
minLengthMessage: t,
|
|
11
|
+
minValueMessage: m,
|
|
12
|
+
requiredMessage: s
|
|
13
|
+
}, Symbol.toStringTag, { value: "Module" })), $ = o, M = a, S = u;
|
|
12
14
|
export {
|
|
13
15
|
S as FIELD_MESSAGE,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
M as IS,
|
|
17
|
+
$ as UTIL,
|
|
16
18
|
C as formatCompactNumber,
|
|
17
19
|
E as formatCompactPercent,
|
|
18
20
|
L as formatCurrency,
|
|
19
21
|
_ as formatPercentage,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
c as invalidMessage,
|
|
23
|
+
P as isBusinessUnit,
|
|
24
|
+
q as isClientType,
|
|
23
25
|
x as isNumber,
|
|
24
26
|
y as isSocialNetwork,
|
|
25
27
|
b as maskCNPJ,
|
|
26
28
|
v as maskCPF,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
l as maskRG,
|
|
30
|
+
D as maskZipCode,
|
|
29
31
|
n as maxLengthMessage,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
i as maxValueMessage,
|
|
33
|
+
t as minLengthMessage,
|
|
34
|
+
m as minValueMessage,
|
|
35
|
+
I as preFormatCurrency,
|
|
36
|
+
U as preFormatPercentage,
|
|
37
|
+
s as requiredMessage,
|
|
38
|
+
k as unmask
|
|
35
39
|
};
|