@grapadigital/shared-app-modules 0.0.154 → 0.0.155
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/{format.util.BcKRgBQI.js → format.util.BPVDuHoX.js} +33 -19
- package/dist/chuncks/{youtube-icon.component.SEaPAD3Z.js → youtube-icon.component.BQUJXvPb.js} +217 -210
- package/dist/components.js +7 -7
- package/dist/constants.js +1 -1
- package/dist/events.js +1 -1
- package/dist/utils.d.ts +90 -0
- package/dist/utils.js +31 -15
- package/package.json +9 -9
package/dist/components.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { a as b, y as N, c, H as v, B as S, aw as C, ax as I, ay as z, Y as T, Z as H, a1 as y, a0 as _, _ as j, a2 as A } from "./chuncks/switch.q7qsNhmq.js";
|
|
2
|
-
import {
|
|
2
|
+
import { l as ge, m as xe, q as be, y as me, r as he, s as fe, F as ue, t as pe, u as ye, v as we, w as ke, x as Ne, k as ve, n as Ce, z as Ie, L as ze, P as Fe, f as Me, g as Se, h as Te, j as He, D as _e, o as je, p as Ae, T as Le, X as Pe, Y as De } from "./chuncks/youtube-icon.component.BQUJXvPb.js";
|
|
3
3
|
import { jsx as e, jsxs as o, Fragment as L } from "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import { parseISO as w, differenceInCalendarDays as P, format as
|
|
5
|
+
import { parseISO as w, differenceInCalendarDays as P, format as D } from "date-fns";
|
|
6
6
|
import { S as f } from "./chuncks/skeleton.BjmmpFAG.js";
|
|
7
|
-
const
|
|
7
|
+
const $ = [
|
|
8
8
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
9
9
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
10
10
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
11
|
-
],
|
|
11
|
+
], B = b("circle-alert", $);
|
|
12
12
|
const q = [
|
|
13
13
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
14
14
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
@@ -178,7 +178,7 @@ function ne({
|
|
|
178
178
|
children: [
|
|
179
179
|
a,
|
|
180
180
|
" ",
|
|
181
|
-
/* @__PURE__ */ e(
|
|
181
|
+
/* @__PURE__ */ e(B, { className: "size-3.5" })
|
|
182
182
|
]
|
|
183
183
|
}
|
|
184
184
|
),
|
|
@@ -190,7 +190,7 @@ function ne({
|
|
|
190
190
|
i ? "text-red-600" : r ? "text-green-600" : ""
|
|
191
191
|
),
|
|
192
192
|
children: [
|
|
193
|
-
s && typeof t == "number" ? `${t.toFixed(2)}%` : d && typeof t == "string" ?
|
|
193
|
+
s && typeof t == "number" ? `${t.toFixed(2)}%` : d && typeof t == "string" ? D(w(t), "dd/MM/yyyy") : x && typeof t == "string" ? t : `R$ ${t.toLocaleString("pt-BR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`,
|
|
194
194
|
m && p && /* @__PURE__ */ e(R, { size: 15, onClick: () => p(t) })
|
|
195
195
|
]
|
|
196
196
|
}
|
|
@@ -317,5 +317,5 @@ export {
|
|
|
317
317
|
Le as TikTokIcon,
|
|
318
318
|
oe as TwitterIcon,
|
|
319
319
|
Pe as XIcon,
|
|
320
|
-
|
|
320
|
+
De as YoutubeIcon
|
|
321
321
|
};
|
package/dist/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, B as A, C as S,
|
|
1
|
+
import { A as s, B as A, C as S, a as O, b as T, S as c } from "./chuncks/youtube-icon.component.BQUJXvPb.js";
|
|
2
2
|
const o = "Não há dados para atualizar.", a = "O filtro selecionado já está ativo. Por favor, escolha outro filtro antes de tentar novamente.", e = "Nenhum dado novo foi informado para realizar a operação. Por favor, atualize os campos antes de tentar novamente.", t = "Não foi possível concluir a operação. Tente novamente mais tarde ou entre em contato com o suporte.", E = "Há um erro na validação dos campos. Por favor, entre em contato com o suporte.", r = "Campo obrigatório.";
|
|
3
3
|
export {
|
|
4
4
|
s as ACTION_TYPE_VALUES,
|
package/dist/events.js
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -8,6 +8,17 @@ declare const CLIENT_TYPE_VALUES: {
|
|
|
8
8
|
readonly brand: "Marca";
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
export declare const FIELD_MESSAGE: typeof FIELD_MESSAGE_MODULES;
|
|
12
|
+
|
|
13
|
+
declare namespace FIELD_MESSAGE_MODULES {
|
|
14
|
+
export {
|
|
15
|
+
requiredMessage,
|
|
16
|
+
minLengthMessage,
|
|
17
|
+
maxLengthMessage,
|
|
18
|
+
invalidMessage
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
11
22
|
/**
|
|
12
23
|
* Formata um número em notação compacta usando o locale pt-BR.
|
|
13
24
|
*
|
|
@@ -55,6 +66,29 @@ export declare function formatCurrency(value: number): string;
|
|
|
55
66
|
*/
|
|
56
67
|
export declare const formatPercentage: (value: string | number) => string;
|
|
57
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Gera uma mensagem de erro genérica para campos inválidos.
|
|
71
|
+
*
|
|
72
|
+
* @param {string} [field] - Nome do campo (opcional).
|
|
73
|
+
* @returns {string} Mensagem indicando que o valor é inválido.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* invalidMessage(); // "Valor inválido."
|
|
77
|
+
* invalidMessage("Email"); // "Email inválido."
|
|
78
|
+
*/
|
|
79
|
+
export declare const invalidMessage: (field?: string) => string;
|
|
80
|
+
|
|
81
|
+
export declare const IS: typeof IS_MODULES;
|
|
82
|
+
|
|
83
|
+
declare namespace IS_MODULES {
|
|
84
|
+
export {
|
|
85
|
+
isNumber,
|
|
86
|
+
isSocialNetwork,
|
|
87
|
+
isClientType,
|
|
88
|
+
isBusinessUnit
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
58
92
|
export declare function isBusinessUnit(value?: string): value is keyof typeof BUSINESS_UNIT_VALUES;
|
|
59
93
|
|
|
60
94
|
export declare function isClientType(value?: string): value is keyof typeof CLIENT_TYPE_VALUES;
|
|
@@ -121,6 +155,32 @@ export declare function maskRG(value: string): string;
|
|
|
121
155
|
*/
|
|
122
156
|
export declare function maskZipCode(value: string): string;
|
|
123
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Gera uma mensagem de erro para campos que excedem o número máximo de caracteres.
|
|
160
|
+
*
|
|
161
|
+
* @param {number} max - Número máximo de caracteres.
|
|
162
|
+
* @param {string} [field] - Nome do campo (opcional).
|
|
163
|
+
* @returns {string} Mensagem indicando a quantidade máxima de caracteres.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* maxLengthMessage(10); // "Deve ter no máximo 10 caracteres."
|
|
167
|
+
* maxLengthMessage(10, "Nome"); // "Nome deve ter no máximo 10 caracteres."
|
|
168
|
+
*/
|
|
169
|
+
export declare const maxLengthMessage: (max: number, field?: string) => string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Gera uma mensagem de erro para campos que não atingem o número mínimo de caracteres.
|
|
173
|
+
*
|
|
174
|
+
* @param {number} min - Número mínimo de caracteres.
|
|
175
|
+
* @param {string} [field] - Nome do campo (opcional).
|
|
176
|
+
* @returns {string} Mensagem indicando a quantidade mínima de caracteres.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* minLengthMessage(3); // "Deve ter no mínimo 3 caracteres."
|
|
180
|
+
* minLengthMessage(3, "Senha"); // "Senha deve ter no mínimo 3 caracteres."
|
|
181
|
+
*/
|
|
182
|
+
export declare const minLengthMessage: (min: number, field?: string) => string;
|
|
183
|
+
|
|
124
184
|
export declare function preFormatCurrency(value: string): number;
|
|
125
185
|
|
|
126
186
|
/**
|
|
@@ -133,6 +193,18 @@ export declare function preFormatCurrency(value: string): number;
|
|
|
133
193
|
*/
|
|
134
194
|
export declare const preFormatPercentage: (value: string | number) => number | false;
|
|
135
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Gera uma mensagem padrão para campos obrigatórios.
|
|
198
|
+
*
|
|
199
|
+
* @param {string} [field] - Nome do campo (opcional).
|
|
200
|
+
* @returns {string} Mensagem indicando que o campo é obrigatório.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* requiredMessage(); // "Campo obrigatório."
|
|
204
|
+
* requiredMessage("Nome"); // "Nome é obrigatório."
|
|
205
|
+
*/
|
|
206
|
+
export declare const requiredMessage: (field?: string) => string;
|
|
207
|
+
|
|
136
208
|
declare const SOCIAL_NETWORK_VALUES: {
|
|
137
209
|
readonly instagram: "Instagram";
|
|
138
210
|
readonly tiktok: "TikTok";
|
|
@@ -153,4 +225,22 @@ declare const SOCIAL_NETWORK_VALUES: {
|
|
|
153
225
|
*/
|
|
154
226
|
export declare function unmask(maskedValue: string): string;
|
|
155
227
|
|
|
228
|
+
export declare const UTIL: typeof UTIL_MODULES;
|
|
229
|
+
|
|
230
|
+
declare namespace UTIL_MODULES {
|
|
231
|
+
export {
|
|
232
|
+
preFormatCurrency,
|
|
233
|
+
formatCurrency,
|
|
234
|
+
maskCPF,
|
|
235
|
+
maskRG,
|
|
236
|
+
maskCNPJ,
|
|
237
|
+
maskZipCode,
|
|
238
|
+
unmask,
|
|
239
|
+
formatPercentage,
|
|
240
|
+
preFormatPercentage,
|
|
241
|
+
formatCompactNumber,
|
|
242
|
+
formatCompactPercent
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
156
246
|
export { }
|
package/dist/utils.js
CHANGED
|
@@ -1,19 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { U as a } 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 $, e as d, p as l, b as D, u as I } from "./chuncks/format.util.BPVDuHoX.js";
|
|
3
|
+
import { I as t } from "./chuncks/youtube-icon.component.BQUJXvPb.js";
|
|
4
|
+
import { e as k, d as P, i as x, c as y } from "./chuncks/youtube-icon.component.BQUJXvPb.js";
|
|
5
|
+
const o = (e) => e ? `${e} é obrigatório.` : "Campo obrigatório.", s = (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) => e ? `${e} inválido.` : "Valor inválido.", i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
|
+
__proto__: null,
|
|
7
|
+
invalidMessage: m,
|
|
8
|
+
maxLengthMessage: n,
|
|
9
|
+
minLengthMessage: s,
|
|
10
|
+
requiredMessage: o
|
|
11
|
+
}, Symbol.toStringTag, { value: "Module" })), p = a, g = t, S = i;
|
|
3
12
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
S as FIELD_MESSAGE,
|
|
14
|
+
g as IS,
|
|
15
|
+
p as UTIL,
|
|
16
|
+
C as formatCompactNumber,
|
|
17
|
+
E as formatCompactPercent,
|
|
18
|
+
L as formatCurrency,
|
|
19
|
+
_ as formatPercentage,
|
|
20
|
+
m as invalidMessage,
|
|
8
21
|
k as isBusinessUnit,
|
|
9
22
|
P as isClientType,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
x as isNumber,
|
|
24
|
+
y as isSocialNetwork,
|
|
25
|
+
b as maskCNPJ,
|
|
26
|
+
v as maskCPF,
|
|
27
|
+
$ as maskRG,
|
|
28
|
+
d as maskZipCode,
|
|
29
|
+
n as maxLengthMessage,
|
|
30
|
+
s as minLengthMessage,
|
|
31
|
+
l as preFormatCurrency,
|
|
32
|
+
D as preFormatPercentage,
|
|
33
|
+
o as requiredMessage,
|
|
34
|
+
I as unmask
|
|
19
35
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grapadigital/shared-app-modules",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.155",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
@@ -120,13 +120,6 @@
|
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
"type": "module",
|
|
123
|
-
"scripts": {
|
|
124
|
-
"dev": "vite",
|
|
125
|
-
"build": "rm -rf dist && tsc -b && vite build",
|
|
126
|
-
"lint": "eslint .",
|
|
127
|
-
"preview": "vite preview",
|
|
128
|
-
"lib:publish": "pnpm build && pnpm publish --no-git-checks"
|
|
129
|
-
},
|
|
130
123
|
"peerDependencies": {
|
|
131
124
|
"react": "^18.3.1",
|
|
132
125
|
"react-dom": "^18.3.1"
|
|
@@ -182,5 +175,12 @@
|
|
|
182
175
|
"vite": "^7.2.4",
|
|
183
176
|
"vite-plugin-dts": "^4.5.4",
|
|
184
177
|
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
178
|
+
},
|
|
179
|
+
"scripts": {
|
|
180
|
+
"dev": "vite",
|
|
181
|
+
"build": "rm -rf dist && tsc -b && vite build",
|
|
182
|
+
"lint": "eslint .",
|
|
183
|
+
"preview": "vite preview",
|
|
184
|
+
"lib:publish": "pnpm build && pnpm publish --no-git-checks"
|
|
185
185
|
}
|
|
186
|
-
}
|
|
186
|
+
}
|