@grapadigital/shared-app-modules 0.0.219 → 0.0.220
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.4YIVDYLE.js +31 -0
- package/dist/components.d.ts +12 -0
- package/dist/components.js +221 -177
- package/dist/dictionaries.js +1 -1
- package/dist/events.d.ts +6 -46
- package/dist/events.js +24 -12
- package/dist/utils.d.ts +8 -0
- package/dist/utils.js +114 -49
- package/package.json +1 -1
- package/dist/chuncks/format.util.CesJhvUo.js +0 -78
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
};
|
package/dist/components.d.ts
CHANGED
|
@@ -512,6 +512,18 @@ declare interface InfluencerSelectInputProps extends Omit<default_2.ComponentPro
|
|
|
512
512
|
onValueChange: (sale: InfluencerInterface) => void;
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
+
export declare function InputPercentFloat({ value, onValueChange, ...props }: InputPercentFloatProps): JSX.Element;
|
|
516
|
+
|
|
517
|
+
declare interface InputPercentFloatProps extends React.ComponentProps<"input"> {
|
|
518
|
+
onValueChange?: (value: number, triggerEvent: "onChange" | "onKeyDown") => void;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export declare function InputPercentInteger({ value, onValueChange, ...props }: InputPercentIntegerProps): JSX.Element;
|
|
522
|
+
|
|
523
|
+
declare interface InputPercentIntegerProps extends React.ComponentProps<"input"> {
|
|
524
|
+
onValueChange?: (value: number, triggerEvent: "onChange" | "onKeyDown") => void;
|
|
525
|
+
}
|
|
526
|
+
|
|
515
527
|
export declare function InstagramIcon({ size, color, ...props }: LucideProps): JSX.Element;
|
|
516
528
|
|
|
517
529
|
declare interface InstallmentInfo {
|
package/dist/components.js
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { aZ as v, c as u, B as N, a_ as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import S, { useState as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
+
import { jsx as e, jsxs as g, Fragment as R } from "react/jsx-runtime";
|
|
3
|
+
import { onKeyDownPercentageInteger as W, onChangePercentageInteger as X, onKeyDownPercentageFloat as G, onChangePercentageFloat as Q } from "./events.js";
|
|
4
|
+
import { m as Y, a as Z } from "./chuncks/masks.util.4YIVDYLE.js";
|
|
5
|
+
import S, { useState as A, useRef as P, useEffect as H, useMemo as J } from "react";
|
|
6
|
+
import { M as V, s as ee } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
|
|
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";
|
|
8
|
+
import { B as L, m as te, T as ne, k as ae, l as re, S as k } from "./chuncks/badge.tZcF7uIJ.js";
|
|
9
|
+
import { parseISO as C, differenceInCalendarDays as se, format as ie } from "date-fns";
|
|
10
|
+
import { u as oe } from "./chuncks/use-debounce.hook.TyZMbuZv.js";
|
|
9
11
|
import "./chuncks/shared-app-modules.provider.DRJ7n4Cj.js";
|
|
10
|
-
import { useQuery as
|
|
12
|
+
import { useQuery as le } from "@tanstack/react-query";
|
|
11
13
|
import "axios";
|
|
12
|
-
import { l as
|
|
13
|
-
const
|
|
14
|
+
import { l as de } from "./chuncks/organization-users.service.B9edFs4F.js";
|
|
15
|
+
const ce = [
|
|
14
16
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
15
17
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
16
18
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
17
|
-
],
|
|
18
|
-
const
|
|
19
|
+
], ge = v("circle-alert", ce);
|
|
20
|
+
const ue = [
|
|
19
21
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
20
22
|
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
21
23
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
22
|
-
],
|
|
23
|
-
const
|
|
24
|
+
], pe = v("circle-question-mark", ue);
|
|
25
|
+
const xe = [
|
|
24
26
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
25
27
|
["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" }]
|
|
26
|
-
],
|
|
27
|
-
const
|
|
28
|
+
], me = v("copy", xe);
|
|
29
|
+
const be = [
|
|
28
30
|
[
|
|
29
31
|
"path",
|
|
30
32
|
{
|
|
@@ -36,28 +38,68 @@ const de = [
|
|
|
36
38
|
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
37
39
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
38
40
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
39
|
-
],
|
|
40
|
-
const
|
|
41
|
+
], fe = v("file-text", be);
|
|
42
|
+
const he = [
|
|
41
43
|
["path", { d: "M12 3v12", key: "1x0j5s" }],
|
|
42
44
|
["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
|
|
43
45
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
|
|
44
|
-
],
|
|
45
|
-
function
|
|
46
|
-
|
|
46
|
+
], ye = v("upload", he);
|
|
47
|
+
function je({
|
|
48
|
+
value: n,
|
|
49
|
+
onValueChange: t,
|
|
50
|
+
...i
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ e(
|
|
53
|
+
_,
|
|
54
|
+
{
|
|
55
|
+
type: "text",
|
|
56
|
+
value: Y(String(n)),
|
|
57
|
+
onChange: (r) => X(r, (s) => {
|
|
58
|
+
t && t(s, "onChange");
|
|
59
|
+
}),
|
|
60
|
+
onKeyDown: (r) => W(r, (s) => {
|
|
61
|
+
t && t(s, "onKeyDown");
|
|
62
|
+
}),
|
|
63
|
+
...i
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
function qe({
|
|
68
|
+
value: n,
|
|
69
|
+
onValueChange: t,
|
|
70
|
+
...i
|
|
71
|
+
}) {
|
|
72
|
+
return /* @__PURE__ */ e(
|
|
73
|
+
_,
|
|
74
|
+
{
|
|
75
|
+
type: "text",
|
|
76
|
+
value: Z(String(n)),
|
|
77
|
+
onChange: (r) => Q(r, (s) => {
|
|
78
|
+
t && t(s, "onChange");
|
|
79
|
+
}),
|
|
80
|
+
onKeyDown: (r) => G(r, (s) => {
|
|
81
|
+
t && t(s, "onKeyDown");
|
|
82
|
+
}),
|
|
83
|
+
...i
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
function Be({
|
|
88
|
+
icon: n = ye,
|
|
47
89
|
title: t = "Enviar arquivos",
|
|
48
|
-
description:
|
|
90
|
+
description: i = "Arraste e solte os arquivos aqui ou clique para selecionar.",
|
|
49
91
|
buttonText: r = "Selecionar novos arquivos",
|
|
50
|
-
files:
|
|
92
|
+
files: s,
|
|
51
93
|
disabled: a,
|
|
52
94
|
onFilesChange: o,
|
|
53
95
|
...d
|
|
54
96
|
}) {
|
|
55
97
|
const [x, b] = S.useState(!1), m = S.useRef(null), y = (l) => {
|
|
56
|
-
const
|
|
57
|
-
o([...
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
|
|
98
|
+
const f = Array.from(l.target.files ?? []);
|
|
99
|
+
o([...s, ...f]);
|
|
100
|
+
}, h = (l) => {
|
|
101
|
+
const f = [...s];
|
|
102
|
+
f.splice(l, 1), o(f);
|
|
61
103
|
};
|
|
62
104
|
function w(l) {
|
|
63
105
|
l.preventDefault(), b(!0);
|
|
@@ -67,8 +109,8 @@ function Fe({
|
|
|
67
109
|
}
|
|
68
110
|
function p(l) {
|
|
69
111
|
l.preventDefault(), b(!1);
|
|
70
|
-
const
|
|
71
|
-
o([...
|
|
112
|
+
const f = Array.from(l.dataTransfer.files);
|
|
113
|
+
o([...s, ...f]);
|
|
72
114
|
}
|
|
73
115
|
return /* @__PURE__ */ g(
|
|
74
116
|
"div",
|
|
@@ -104,7 +146,7 @@ function Fe({
|
|
|
104
146
|
/* @__PURE__ */ e("div", { className: "w-fit mx-auto", children: /* @__PURE__ */ e(n, { className: "text-muted-foreground size-8" }) }),
|
|
105
147
|
/* @__PURE__ */ g("div", { children: [
|
|
106
148
|
/* @__PURE__ */ e("h3", { className: "font-semibold", children: t }),
|
|
107
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground text-sm", children:
|
|
149
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground text-sm", children: i })
|
|
108
150
|
] }),
|
|
109
151
|
/* @__PURE__ */ e(
|
|
110
152
|
N,
|
|
@@ -120,16 +162,16 @@ function Fe({
|
|
|
120
162
|
]
|
|
121
163
|
}
|
|
122
164
|
),
|
|
123
|
-
|
|
165
|
+
s.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: s.map((l, f) => /* @__PURE__ */ g(L, { children: [
|
|
124
166
|
/* @__PURE__ */ e(
|
|
125
167
|
"button",
|
|
126
168
|
{
|
|
127
|
-
onClick: () => f
|
|
169
|
+
onClick: () => h(f),
|
|
128
170
|
className: "hover:text-red-500",
|
|
129
171
|
"aria-label": "Remover anexo",
|
|
130
172
|
title: "Remover anexo",
|
|
131
173
|
disabled: a,
|
|
132
|
-
children: /* @__PURE__ */ e(
|
|
174
|
+
children: /* @__PURE__ */ e(M, { className: "size-3" })
|
|
133
175
|
}
|
|
134
176
|
),
|
|
135
177
|
l.name
|
|
@@ -138,23 +180,23 @@ function Fe({
|
|
|
138
180
|
}
|
|
139
181
|
);
|
|
140
182
|
}
|
|
141
|
-
function
|
|
183
|
+
function Oe({
|
|
142
184
|
content: n,
|
|
143
185
|
align: t,
|
|
144
|
-
asChild:
|
|
186
|
+
asChild: i,
|
|
145
187
|
className: r,
|
|
146
|
-
openDelay:
|
|
188
|
+
openDelay: s = 0,
|
|
147
189
|
closeDelay: a = 0,
|
|
148
190
|
children: o,
|
|
149
191
|
disabled: d = !1,
|
|
150
192
|
...x
|
|
151
193
|
}) {
|
|
152
|
-
return /* @__PURE__ */ e(R, { children: d === !0 ? o : /* @__PURE__ */ g(
|
|
153
|
-
/* @__PURE__ */ e(
|
|
154
|
-
/* @__PURE__ */ e(
|
|
194
|
+
return /* @__PURE__ */ e(R, { children: d === !0 ? o : /* @__PURE__ */ g(T, { openDelay: s, closeDelay: a, ...x, children: [
|
|
195
|
+
/* @__PURE__ */ e(F, { asChild: i, children: o }),
|
|
196
|
+
/* @__PURE__ */ e(D, { align: t, className: r, children: n })
|
|
155
197
|
] }) });
|
|
156
198
|
}
|
|
157
|
-
const
|
|
199
|
+
const we = {
|
|
158
200
|
red: { bg: "bg-red-50", text: "text-red-600" },
|
|
159
201
|
orange: { bg: "bg-orange-50", text: "text-orange-600" },
|
|
160
202
|
amber: { bg: "bg-amber-50", text: "text-amber-600" },
|
|
@@ -177,7 +219,7 @@ const pe = {
|
|
|
177
219
|
zinc: { bg: "bg-zinc-200", text: "text-zinc-800" },
|
|
178
220
|
neutral: { bg: "bg-neutral-200", text: "text-neutral-800" },
|
|
179
221
|
stone: { bg: "bg-stone-200", text: "text-stone-800" }
|
|
180
|
-
},
|
|
222
|
+
}, ve = {
|
|
181
223
|
red: { bg: "bg-red-500", text: "text-white" },
|
|
182
224
|
orange: { bg: "bg-orange-500", text: "text-white" },
|
|
183
225
|
amber: { bg: "bg-amber-500", text: "text-white" },
|
|
@@ -201,32 +243,32 @@ const pe = {
|
|
|
201
243
|
neutral: { bg: "bg-neutral-500", text: "text-white" },
|
|
202
244
|
stone: { bg: "bg-stone-500", text: "text-white" },
|
|
203
245
|
black: { bg: "bg-black", text: "text-white" }
|
|
204
|
-
},
|
|
246
|
+
}, z = {
|
|
205
247
|
xs: "size-3",
|
|
206
248
|
sm: "size-4",
|
|
207
249
|
md: "size-5",
|
|
208
250
|
lg: "size-6",
|
|
209
251
|
xl: "size-7"
|
|
210
252
|
};
|
|
211
|
-
function
|
|
253
|
+
function Ke({
|
|
212
254
|
size: n,
|
|
213
255
|
color: t,
|
|
214
|
-
className:
|
|
256
|
+
className: i,
|
|
215
257
|
icon: r,
|
|
216
|
-
filled:
|
|
258
|
+
filled: s
|
|
217
259
|
}) {
|
|
218
|
-
const a =
|
|
219
|
-
return /* @__PURE__ */ e("div", { className: u("w-fit p-2 rounded-lg", a?.bg,
|
|
260
|
+
const a = s ? ve[t] : we[t], o = n ? z[n] : z.md;
|
|
261
|
+
return /* @__PURE__ */ e("div", { className: u("w-fit p-2 rounded-lg", a?.bg, i), children: /* @__PURE__ */ e(r, { className: u(o, a?.text) }) });
|
|
220
262
|
}
|
|
221
|
-
function
|
|
263
|
+
function Ue({ className: n, ...t }) {
|
|
222
264
|
return /* @__PURE__ */ e("div", { className: u("divide-y", n), ...t });
|
|
223
265
|
}
|
|
224
|
-
function
|
|
266
|
+
function We({
|
|
225
267
|
label: n,
|
|
226
268
|
value: t,
|
|
227
|
-
tooltip:
|
|
269
|
+
tooltip: i,
|
|
228
270
|
highlight: r = !1,
|
|
229
|
-
negative:
|
|
271
|
+
negative: s = !1,
|
|
230
272
|
positive: a = !1,
|
|
231
273
|
isPercentage: o = !1,
|
|
232
274
|
isDate: d = !1,
|
|
@@ -234,27 +276,27 @@ function He({
|
|
|
234
276
|
isInvoiced: b = !1,
|
|
235
277
|
hasCopyButton: m = !1,
|
|
236
278
|
contrast: y = !1,
|
|
237
|
-
enableHoverableContent:
|
|
279
|
+
enableHoverableContent: h = !1,
|
|
238
280
|
handleCopy: w
|
|
239
281
|
}) {
|
|
240
282
|
let c = "";
|
|
241
283
|
if (d && typeof t == "string" && t !== "" && !b && r) {
|
|
242
|
-
const p =
|
|
284
|
+
const p = C(t), l = se(p, /* @__PURE__ */ new Date());
|
|
243
285
|
l > 15 ? c = "bg-yellow-100 font-bold" : l > 7 ? c = "bg-yellow-300 font-bold" : l >= 0 ? c = "bg-red-300 font-bold" : c = "bg-red-500 text-white font-bold";
|
|
244
286
|
} else r && (c = "bg-orange-100 font-bold");
|
|
245
|
-
return y && (c = "bg-orange-100 font-bold"), /* @__PURE__ */ e("div", { className: u("px-2 py-1 text-sm", c), children: /* @__PURE__ */ g(
|
|
246
|
-
/* @__PURE__ */ e(
|
|
287
|
+
return y && (c = "bg-orange-100 font-bold"), /* @__PURE__ */ e("div", { className: u("px-2 py-1 text-sm", c), children: /* @__PURE__ */ g(T, { openDelay: 0, closeDelay: 0, children: [
|
|
288
|
+
/* @__PURE__ */ e(F, { children: /* @__PURE__ */ g("div", { className: "flex justify-between", children: [
|
|
247
289
|
/* @__PURE__ */ g(
|
|
248
290
|
"span",
|
|
249
291
|
{
|
|
250
292
|
className: u(
|
|
251
293
|
"flex flex-row gap-1",
|
|
252
|
-
|
|
294
|
+
s ? "text-red-600" : a ? "text-green-600" : ""
|
|
253
295
|
),
|
|
254
296
|
children: [
|
|
255
297
|
n,
|
|
256
298
|
" ",
|
|
257
|
-
/* @__PURE__ */ e(
|
|
299
|
+
/* @__PURE__ */ e(ge, { className: "size-3.5" })
|
|
258
300
|
]
|
|
259
301
|
}
|
|
260
302
|
),
|
|
@@ -263,37 +305,37 @@ function He({
|
|
|
263
305
|
{
|
|
264
306
|
className: u(
|
|
265
307
|
"flex flex-row justify-end gap-2 text-right",
|
|
266
|
-
|
|
308
|
+
s ? "text-red-600" : a ? "text-green-600" : ""
|
|
267
309
|
),
|
|
268
310
|
children: [
|
|
269
|
-
o && typeof t == "number" ? `${t.toFixed(2)}%` : d && typeof t == "string" && t !== "" ?
|
|
270
|
-
m && w ? /* @__PURE__ */ e(
|
|
311
|
+
o && typeof t == "number" ? `${t.toFixed(2)}%` : d && typeof t == "string" && t !== "" ? ie(C(t), "dd/MM/yyyy") : d && t === "" ? "—" : x ? t ?? "—" : typeof t == "number" ? `R$ ${t.toLocaleString("pt-BR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : "—",
|
|
312
|
+
m && w ? /* @__PURE__ */ e(me, { size: 15, onClick: () => w(t) }) : null
|
|
271
313
|
]
|
|
272
314
|
}
|
|
273
315
|
)
|
|
274
316
|
] }) }),
|
|
275
317
|
/* @__PURE__ */ e(
|
|
276
|
-
|
|
318
|
+
D,
|
|
277
319
|
{
|
|
278
320
|
align: "start",
|
|
279
|
-
className: u(!
|
|
321
|
+
className: u(!h && "pointer-events-none"),
|
|
280
322
|
children: /* @__PURE__ */ g("div", { className: "space-y-0.5", children: [
|
|
281
323
|
/* @__PURE__ */ e("div", { className: "font-medium", children: n }),
|
|
282
|
-
/* @__PURE__ */ e("div", { className: "font-normal opacity-80", children:
|
|
324
|
+
/* @__PURE__ */ e("div", { className: "font-normal opacity-80", children: i })
|
|
283
325
|
] })
|
|
284
326
|
}
|
|
285
327
|
)
|
|
286
328
|
] }) });
|
|
287
329
|
}
|
|
288
|
-
function
|
|
289
|
-
icon: n =
|
|
330
|
+
function Xe({
|
|
331
|
+
icon: n = fe,
|
|
290
332
|
title: t,
|
|
291
|
-
description:
|
|
333
|
+
description: i,
|
|
292
334
|
tip: r,
|
|
293
|
-
className:
|
|
335
|
+
className: s,
|
|
294
336
|
...a
|
|
295
337
|
}) {
|
|
296
|
-
return /* @__PURE__ */ e($, { className: u(
|
|
338
|
+
return /* @__PURE__ */ e($, { className: u(s), ...a, children: /* @__PURE__ */ g(j, { className: "flex flex-col items-center justify-center px-6 py-12 text-center", children: [
|
|
297
339
|
/* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(
|
|
298
340
|
n,
|
|
299
341
|
{
|
|
@@ -302,29 +344,29 @@ function Le({
|
|
|
302
344
|
}
|
|
303
345
|
) }),
|
|
304
346
|
/* @__PURE__ */ e("h3", { className: "mb-2 text-lg font-semibold text-foreground", children: t }),
|
|
305
|
-
/* @__PURE__ */ e("p", { className: "max-w-md text-sm leading-relaxed text-muted-foreground", children:
|
|
347
|
+
/* @__PURE__ */ e("p", { className: "max-w-md text-sm leading-relaxed text-muted-foreground", children: i }),
|
|
306
348
|
r && /* @__PURE__ */ e("div", { className: "mt-6 rounded-lg border border-dashed border-muted-foreground/20 bg-muted/50 px-4 py-2", children: /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: r }) })
|
|
307
349
|
] }) });
|
|
308
350
|
}
|
|
309
|
-
function
|
|
351
|
+
function Ge({
|
|
310
352
|
actions: n,
|
|
311
|
-
icon: t =
|
|
353
|
+
icon: t = pe
|
|
312
354
|
}) {
|
|
313
|
-
const [
|
|
355
|
+
const [i, r] = A(!1), s = P(null);
|
|
314
356
|
return H(() => {
|
|
315
|
-
if (!
|
|
357
|
+
if (!i) return;
|
|
316
358
|
const a = (d) => {
|
|
317
|
-
|
|
359
|
+
s.current?.contains(d.target) || r(!1);
|
|
318
360
|
}, o = (d) => {
|
|
319
361
|
d.key === "Escape" && r(!1);
|
|
320
362
|
};
|
|
321
363
|
return document.addEventListener("mousedown", a), document.addEventListener("keydown", o), () => {
|
|
322
364
|
document.removeEventListener("mousedown", a), document.removeEventListener("keydown", o);
|
|
323
365
|
};
|
|
324
|
-
}, [
|
|
366
|
+
}, [i]), /* @__PURE__ */ e(te, { children: /* @__PURE__ */ g(
|
|
325
367
|
"div",
|
|
326
368
|
{
|
|
327
|
-
ref:
|
|
369
|
+
ref: s,
|
|
328
370
|
className: "fixed bottom-6 right-6 z-50 flex flex-col items-end gap-3",
|
|
329
371
|
children: [
|
|
330
372
|
/* @__PURE__ */ e("div", { className: "flex flex-col items-end gap-3", children: n.map((a, o) => /* @__PURE__ */ e(
|
|
@@ -332,11 +374,11 @@ function Ee({
|
|
|
332
374
|
{
|
|
333
375
|
className: u(
|
|
334
376
|
"transition-all duration-200 ease-out",
|
|
335
|
-
|
|
377
|
+
i ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-2 opacity-0"
|
|
336
378
|
),
|
|
337
|
-
style: { transitionDelay:
|
|
338
|
-
children: /* @__PURE__ */ g(
|
|
339
|
-
/* @__PURE__ */ e(
|
|
379
|
+
style: { transitionDelay: i ? `${o * 30}ms` : "0ms" },
|
|
380
|
+
children: /* @__PURE__ */ g(ne, { children: [
|
|
381
|
+
/* @__PURE__ */ e(ae, { asChild: !0, children: /* @__PURE__ */ e(
|
|
340
382
|
N,
|
|
341
383
|
{
|
|
342
384
|
size: "icon",
|
|
@@ -353,7 +395,7 @@ function Ee({
|
|
|
353
395
|
children: /* @__PURE__ */ e(a.icon, { className: "size-5" })
|
|
354
396
|
}
|
|
355
397
|
) }),
|
|
356
|
-
/* @__PURE__ */ e(
|
|
398
|
+
/* @__PURE__ */ e(re, { side: "left", children: a.label })
|
|
357
399
|
] })
|
|
358
400
|
},
|
|
359
401
|
a.label
|
|
@@ -364,25 +406,25 @@ function Ee({
|
|
|
364
406
|
size: "icon",
|
|
365
407
|
variant: "outline",
|
|
366
408
|
className: "size-11 rounded-full shadow-md",
|
|
367
|
-
"aria-label":
|
|
368
|
-
"aria-expanded":
|
|
409
|
+
"aria-label": i ? "Fechar menu de ajuda" : "Abrir menu de ajuda",
|
|
410
|
+
"aria-expanded": i,
|
|
369
411
|
onClick: () => r((a) => !a),
|
|
370
|
-
children:
|
|
412
|
+
children: i ? /* @__PURE__ */ e(M, { className: "size-5" }) : /* @__PURE__ */ e(t, { className: "size-5" })
|
|
371
413
|
}
|
|
372
414
|
)
|
|
373
415
|
]
|
|
374
416
|
}
|
|
375
417
|
) });
|
|
376
418
|
}
|
|
377
|
-
function
|
|
419
|
+
function Qe({
|
|
378
420
|
columns: n = 9,
|
|
379
421
|
rows: t = 20,
|
|
380
|
-
hasActions:
|
|
422
|
+
hasActions: i = !1,
|
|
381
423
|
actionsCount: r = 1
|
|
382
424
|
}) {
|
|
383
425
|
return /* @__PURE__ */ g(q, { children: [
|
|
384
|
-
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
|
|
385
|
-
const o =
|
|
426
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: Array.from({ length: n }).map((s, a) => {
|
|
427
|
+
const o = i && a === n - 1;
|
|
386
428
|
return /* @__PURE__ */ e(
|
|
387
429
|
O,
|
|
388
430
|
{
|
|
@@ -397,37 +439,37 @@ function $e({
|
|
|
397
439
|
a
|
|
398
440
|
);
|
|
399
441
|
}) }) }),
|
|
400
|
-
/* @__PURE__ */ e(
|
|
401
|
-
const x =
|
|
442
|
+
/* @__PURE__ */ e(K, { children: Array.from({ length: t }).map((s, a) => /* @__PURE__ */ e(I, { className: "h-[3.05rem]", children: Array.from({ length: n }).map((o, d) => {
|
|
443
|
+
const x = i && d === n - 1;
|
|
402
444
|
return /* @__PURE__ */ e(U, { children: x ? /* @__PURE__ */ e("div", { className: "flex gap-2", children: Array.from({ length: r }).map((b, m) => /* @__PURE__ */ e(k, { className: "ml-auto size-8" }, m)) }) : /* @__PURE__ */ e(k, { className: "h-4 w-full" }) }, d);
|
|
403
445
|
}) }, a)) })
|
|
404
446
|
] });
|
|
405
447
|
}
|
|
406
|
-
const
|
|
407
|
-
function
|
|
408
|
-
const t = [],
|
|
448
|
+
const ke = "@[__display__](__id__)", E = /@\[([^\]]+)\]\(([^)]+)\)/g;
|
|
449
|
+
function Ne(n) {
|
|
450
|
+
const t = [], i = new RegExp(E);
|
|
409
451
|
let r;
|
|
410
|
-
for (; (r =
|
|
452
|
+
for (; (r = i.exec(n)) !== null; )
|
|
411
453
|
t.push({ display: r[1], id: r[2] });
|
|
412
454
|
return t;
|
|
413
455
|
}
|
|
414
|
-
function
|
|
415
|
-
return
|
|
456
|
+
function Ye(n) {
|
|
457
|
+
return Ne(n).map((t) => ({
|
|
416
458
|
userId: t.id,
|
|
417
459
|
username: t.display
|
|
418
460
|
}));
|
|
419
461
|
}
|
|
420
|
-
function
|
|
421
|
-
return
|
|
462
|
+
function Ie(n, t) {
|
|
463
|
+
return le({
|
|
422
464
|
queryKey: ["organization-users", n, t],
|
|
423
|
-
queryFn: () =>
|
|
465
|
+
queryFn: () => de({
|
|
424
466
|
organizationId: n,
|
|
425
467
|
search: t
|
|
426
468
|
}),
|
|
427
469
|
enabled: n.length > 0 && t.length > 0
|
|
428
470
|
});
|
|
429
471
|
}
|
|
430
|
-
const
|
|
472
|
+
const Se = {
|
|
431
473
|
control: {
|
|
432
474
|
fontSize: 14,
|
|
433
475
|
fontWeight: "normal"
|
|
@@ -479,73 +521,73 @@ const fe = {
|
|
|
479
521
|
}
|
|
480
522
|
}
|
|
481
523
|
}
|
|
482
|
-
},
|
|
524
|
+
}, Ce = {
|
|
483
525
|
backgroundColor: "var(--accent, #dbeafe)",
|
|
484
526
|
color: "var(--accent-foreground, #1d4ed8)",
|
|
485
527
|
fontWeight: 600,
|
|
486
528
|
borderRadius: 4,
|
|
487
529
|
padding: "1px 2px"
|
|
488
530
|
};
|
|
489
|
-
function
|
|
531
|
+
function Ze({
|
|
490
532
|
value: n,
|
|
491
533
|
onChange: t,
|
|
492
|
-
onBlur:
|
|
534
|
+
onBlur: i,
|
|
493
535
|
organizationId: r,
|
|
494
|
-
placeholder:
|
|
536
|
+
placeholder: s,
|
|
495
537
|
disabled: a,
|
|
496
538
|
singleLine: o = !1
|
|
497
539
|
}) {
|
|
498
|
-
const [d, x] =
|
|
540
|
+
const [d, x] = A(""), b = oe(d, 200), { data: m } = Ie(r, b), y = P(void 0), h = J(
|
|
499
541
|
() => m?.map((c) => ({ id: c._id, display: c.username })) ?? [],
|
|
500
542
|
[m]
|
|
501
543
|
);
|
|
502
544
|
return H(() => {
|
|
503
|
-
y.current?.(
|
|
504
|
-
}, [
|
|
505
|
-
|
|
545
|
+
y.current?.(h);
|
|
546
|
+
}, [h]), /* @__PURE__ */ e(
|
|
547
|
+
V,
|
|
506
548
|
{
|
|
507
549
|
value: n,
|
|
508
550
|
onChange: (c, p) => t(p),
|
|
509
|
-
onBlur:
|
|
510
|
-
placeholder:
|
|
551
|
+
onBlur: i,
|
|
552
|
+
placeholder: s,
|
|
511
553
|
disabled: a,
|
|
512
554
|
singleLine: o,
|
|
513
555
|
allowSuggestionsAboveCursor: !0,
|
|
514
|
-
style:
|
|
556
|
+
style: Se,
|
|
515
557
|
children: /* @__PURE__ */ e(
|
|
516
|
-
|
|
558
|
+
ee,
|
|
517
559
|
{
|
|
518
560
|
trigger: "@",
|
|
519
|
-
markup:
|
|
561
|
+
markup: ke,
|
|
520
562
|
data: (c, p) => {
|
|
521
|
-
y.current = p, x(c), p(
|
|
563
|
+
y.current = p, x(c), p(h);
|
|
522
564
|
},
|
|
523
565
|
displayTransform: (c, p) => `@${p}`,
|
|
524
566
|
appendSpaceOnAdd: !0,
|
|
525
|
-
style:
|
|
567
|
+
style: Ce
|
|
526
568
|
}
|
|
527
569
|
)
|
|
528
570
|
}
|
|
529
571
|
);
|
|
530
572
|
}
|
|
531
|
-
function
|
|
532
|
-
const
|
|
533
|
-
let
|
|
534
|
-
for (; (a =
|
|
535
|
-
a.index >
|
|
536
|
-
/* @__PURE__ */ e("span", { children: n.slice(
|
|
573
|
+
function Je({ text: n, className: t }) {
|
|
574
|
+
const i = new RegExp(E), r = [];
|
|
575
|
+
let s = 0, a, o = 0;
|
|
576
|
+
for (; (a = i.exec(n)) !== null; )
|
|
577
|
+
a.index > s && r.push(
|
|
578
|
+
/* @__PURE__ */ e("span", { children: n.slice(s, a.index) }, o++)
|
|
537
579
|
), r.push(
|
|
538
580
|
/* @__PURE__ */ g(L, { variant: "secondary", className: t, children: [
|
|
539
581
|
"@",
|
|
540
582
|
a[1]
|
|
541
583
|
] }, o++)
|
|
542
|
-
),
|
|
543
|
-
return
|
|
584
|
+
), s = a.index + a[0].length;
|
|
585
|
+
return s < n.length && r.push(/* @__PURE__ */ e("span", { children: n.slice(s) }, o++)), /* @__PURE__ */ e(R, { children: r });
|
|
544
586
|
}
|
|
545
|
-
function
|
|
587
|
+
function Ve({
|
|
546
588
|
size: n = 24,
|
|
547
589
|
color: t = "currentColor",
|
|
548
|
-
...
|
|
590
|
+
...i
|
|
549
591
|
}) {
|
|
550
592
|
return /* @__PURE__ */ e(
|
|
551
593
|
"svg",
|
|
@@ -560,59 +602,61 @@ function Oe({
|
|
|
560
602
|
"stroke-linecap": "round",
|
|
561
603
|
"stroke-linejoin": "round",
|
|
562
604
|
className: "lucide lucide-twitter-icon lucide-twitter",
|
|
563
|
-
...
|
|
605
|
+
...i,
|
|
564
606
|
children: /* @__PURE__ */ e("path", { d: "M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z" })
|
|
565
607
|
}
|
|
566
608
|
);
|
|
567
609
|
}
|
|
568
610
|
export {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
611
|
+
nt as AsyncBoundary,
|
|
612
|
+
Be as AttachmentInput,
|
|
613
|
+
at as CampaignsSelectInput,
|
|
614
|
+
rt as ClientSelectInput,
|
|
615
|
+
st as ErrorBundary,
|
|
616
|
+
it as ErrorCard,
|
|
617
|
+
ot as FieldCalendar,
|
|
618
|
+
lt as FieldCheckbox,
|
|
619
|
+
dt as FieldClientSelectInput,
|
|
620
|
+
ct as FieldInput,
|
|
621
|
+
gt as FieldLabelWithAsterisk,
|
|
622
|
+
ut as FieldProfileSelectInput,
|
|
623
|
+
pt as FieldResponsibleSelectInput,
|
|
624
|
+
xt as FieldSaleSelectInput,
|
|
625
|
+
mt as FieldSelect,
|
|
626
|
+
bt as FieldSwitch,
|
|
627
|
+
ft as FieldTextarea,
|
|
628
|
+
Oe as HoverContent,
|
|
629
|
+
Ke as IconBadge,
|
|
630
|
+
ht as Image,
|
|
631
|
+
yt as InfluencerSelectInput,
|
|
632
|
+
qe as InputPercentFloat,
|
|
633
|
+
je as InputPercentInteger,
|
|
634
|
+
wt as InstagramIcon,
|
|
635
|
+
vt as LinkedInIcon,
|
|
636
|
+
Ue as List,
|
|
637
|
+
We as ListRow,
|
|
638
|
+
Ze as MentionInput,
|
|
639
|
+
Je as MentionText,
|
|
640
|
+
kt as ModuleTags,
|
|
641
|
+
Xe as NotFoundCard,
|
|
642
|
+
Nt as PageHeader,
|
|
643
|
+
It as PageHeaderActions,
|
|
644
|
+
St as PageHeaderContent,
|
|
645
|
+
Ct as PageHeaderDescription,
|
|
646
|
+
zt as PageHeaderTitle,
|
|
647
|
+
_t as PinterestIcon,
|
|
648
|
+
Mt as ProfileSelectInput,
|
|
649
|
+
Tt as ResponsibleSelectInput,
|
|
650
|
+
Ft as SaleSelectInput,
|
|
651
|
+
Ge as SpeedDialButton,
|
|
652
|
+
Dt as SuppliersSelectInput,
|
|
653
|
+
Qe as TableSkeleton,
|
|
654
|
+
Rt as TikTokIcon,
|
|
655
|
+
Ve as TwitterIcon,
|
|
656
|
+
At as XIcon,
|
|
657
|
+
Pt as YoutubeIcon,
|
|
658
|
+
Ye as getMentionedUsers,
|
|
659
|
+
Ne as parseMentions,
|
|
660
|
+
Ht as useGetTags,
|
|
661
|
+
Lt as useModuleTags
|
|
618
662
|
};
|
package/dist/dictionaries.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./chuncks/switch.D_38xWg-.js";
|
|
2
|
-
import { aj as D, ai as m, ag as n, ak as l, ap as y, am as h, al as k, ao as P, ar as T, aq as g, ah as u, an as w } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
|
|
3
2
|
import "react/jsx-runtime";
|
|
4
3
|
import "react";
|
|
4
|
+
import { aj as D, ai as m, ag as n, ak as l, ap as y, am as h, al as k, ao as P, ar as T, aq as g, ah as u, an as w } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
|
|
5
5
|
import "@tanstack/react-query";
|
|
6
6
|
import "date-fns";
|
|
7
7
|
import "./chuncks/shared-app-modules.provider.DRJ7n4Cj.js";
|
package/dist/events.d.ts
CHANGED
|
@@ -1,52 +1,12 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
* Lida com a alteração de um input de porcentagem, convertendo o valor do input
|
|
6
|
-
* em um número decimal entre 0 e 1 e chamando o callback com esse valor.
|
|
7
|
-
*
|
|
8
|
-
* Esta função utiliza `preFormatPercentage` para:
|
|
9
|
-
* - Remover o símbolo de porcentagem ("%").
|
|
10
|
-
* - Converter o valor em decimal (ex: "50%" → 0.5).
|
|
11
|
-
* - Limitar valores acima de 100% a 1.
|
|
12
|
-
* - Retornar `false` (não chama o callback) se o valor não for numérico.
|
|
13
|
-
*
|
|
14
|
-
* @param {ChangeEvent<HTMLInputElement>} event - O evento de mudança do input.
|
|
15
|
-
* @param {(value: number) => void} callback - Função chamada com o valor decimal
|
|
16
|
-
* após a formatação.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* <nput
|
|
20
|
-
* type="text"
|
|
21
|
-
* value={`${percentage * 100}%`}
|
|
22
|
-
* onChange={(event) => onChangePercentage(event, setPercentage)}
|
|
23
|
-
* />
|
|
24
|
-
*
|
|
25
|
-
* // Se o usuário digitar "75%", o callback receberá 0.75
|
|
26
|
-
* // Se o usuário digitar "150%", o callback receberá 1
|
|
27
|
-
* // Se o usuário digitar "abc", o callback não será chamado
|
|
28
|
-
*/
|
|
29
|
-
export declare const onChangePercentage: (event: ChangeEvent<HTMLInputElement>, callback: (value: number) => void) => void;
|
|
4
|
+
export declare const onChangePercentageFloat: (event: React.ChangeEvent<HTMLInputElement>, callback: (value: number) => void) => void;
|
|
30
5
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* Antes dessa função, ao pressionar "Backspace", a porcentagem era removida
|
|
37
|
-
* em vez do valor numérico.
|
|
38
|
-
*
|
|
39
|
-
* @param {KeyboardEvent<HTMLInputElement>} event - O evento de teclado do input.
|
|
40
|
-
* @param {(value: number) => void} callback - Função chamada com o novo valor numérico
|
|
41
|
-
* após a remoção do último dígito.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* <input
|
|
45
|
-
* type="text"
|
|
46
|
-
* value={`${percentage}%`}
|
|
47
|
-
* onKeyDown={(event) => onKeyDownPercentage(event, setPercentage)}
|
|
48
|
-
* />
|
|
49
|
-
*/
|
|
50
|
-
export declare const onKeyDownPercentage: (event: KeyboardEvent_2<HTMLInputElement>, callback: (value: number) => void) => void;
|
|
6
|
+
export declare const onChangePercentageInteger: (event: ChangeEvent<HTMLInputElement>, callback: (value: number) => void) => void;
|
|
7
|
+
|
|
8
|
+
export declare const onKeyDownPercentageFloat: (event: React.KeyboardEvent<HTMLInputElement>, callback: (value: number) => void) => void;
|
|
9
|
+
|
|
10
|
+
export declare const onKeyDownPercentageInteger: (event: KeyboardEvent_2<HTMLInputElement>, callback: (value: number) => void) => void;
|
|
51
11
|
|
|
52
12
|
export { }
|
package/dist/events.js
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const i = (t,
|
|
3
|
-
const e = t.target.value,
|
|
4
|
-
n
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { u as r, b as u } from "./chuncks/masks.util.4YIVDYLE.js";
|
|
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);
|
|
11
21
|
}
|
|
12
22
|
};
|
|
13
23
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
k as onChangePercentageFloat,
|
|
25
|
+
i as onChangePercentageInteger,
|
|
26
|
+
m as onKeyDownPercentageFloat,
|
|
27
|
+
d as onKeyDownPercentageInteger
|
|
16
28
|
};
|
package/dist/utils.d.ts
CHANGED
|
@@ -185,6 +185,10 @@ export declare function maskCNPJ(value: string): string;
|
|
|
185
185
|
*/
|
|
186
186
|
export declare function maskCPF(value: string): string;
|
|
187
187
|
|
|
188
|
+
export declare function maskPercentageFloat(value: string | number): string;
|
|
189
|
+
|
|
190
|
+
export declare const maskPercentageInteger: (value: string | number) => string | undefined;
|
|
191
|
+
|
|
188
192
|
/**
|
|
189
193
|
* Aplica a máscara de RG a uma string numérica.
|
|
190
194
|
*
|
|
@@ -367,6 +371,10 @@ declare const SOCIAL_NETWORK_VALUES: {
|
|
|
367
371
|
*/
|
|
368
372
|
export declare function unmask(maskedValue: string): string;
|
|
369
373
|
|
|
374
|
+
export declare const unmaskPercentageFloat: (maskedValue: string | number) => number;
|
|
375
|
+
|
|
376
|
+
export declare const unmaskPercentageInteger: (value: string | number) => number;
|
|
377
|
+
|
|
370
378
|
export declare const UTIL: typeof UTIL_MODULES;
|
|
371
379
|
|
|
372
380
|
declare namespace UTIL_MODULES {
|
package/dist/utils.js
CHANGED
|
@@ -1,54 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
1
|
+
import { i as a, f as s } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
|
|
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 { a as J, m as Z, b as H, u as K } from "./chuncks/masks.util.4YIVDYLE.js";
|
|
4
|
+
function c(e) {
|
|
5
|
+
const r = e.replace(/[^0-9]/g, "");
|
|
6
|
+
return Number(r) / 100;
|
|
7
|
+
}
|
|
8
|
+
function i(e) {
|
|
9
|
+
return e.toLocaleString("pt-BR", {
|
|
10
|
+
style: "currency",
|
|
11
|
+
currency: "BRL"
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const u = (e) => {
|
|
15
|
+
const r = a(e) ? e : Number(e);
|
|
16
|
+
return `${parseInt(String(r * 100))}%`;
|
|
17
|
+
}, m = (e) => {
|
|
18
|
+
const r = +String(e).replace("%", "");
|
|
19
|
+
if (!a(r)) return !1;
|
|
20
|
+
const t = r / 100;
|
|
21
|
+
return +String(t).split(".")[0] >= 1 ? 1 : t;
|
|
22
|
+
};
|
|
23
|
+
function l(e) {
|
|
24
|
+
return e.replace(/\D/g, "").replace(/^(\d{3})(\d{3})(\d{3})(\d{2})$/, "$1.$2.$3-$4");
|
|
25
|
+
}
|
|
26
|
+
function p(e) {
|
|
27
|
+
return e.replace(/\D/g, "").replace(/^(\d{2})(\d{3})(\d{3})(\d{1})$/, "$1.$2.$3-$4");
|
|
28
|
+
}
|
|
29
|
+
function g(e) {
|
|
30
|
+
return e.replace(/\D/g, "").replace(
|
|
31
|
+
/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/,
|
|
32
|
+
"$1.$2.$3/$4-$5"
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function d(e) {
|
|
36
|
+
return e.replace(/\D/g, "").replace(/^(\d{5})(\d{3})$/, "$1-$2");
|
|
37
|
+
}
|
|
38
|
+
function f(e) {
|
|
39
|
+
return e.replace(/\D/g, "");
|
|
40
|
+
}
|
|
41
|
+
const $ = (e) => new Intl.NumberFormat("pt-BR", {
|
|
42
|
+
style: "decimal",
|
|
43
|
+
notation: "compact",
|
|
44
|
+
compactDisplay: "short",
|
|
45
|
+
minimumFractionDigits: 0,
|
|
46
|
+
maximumFractionDigits: 3
|
|
47
|
+
}).format(e), S = (e) => new Intl.NumberFormat("pt-BR", {
|
|
48
|
+
style: "percent",
|
|
49
|
+
notation: "compact",
|
|
50
|
+
compactDisplay: "short",
|
|
51
|
+
minimumFractionDigits: 0,
|
|
52
|
+
maximumFractionDigits: 2
|
|
53
|
+
}).format(e), D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
54
|
+
__proto__: null,
|
|
55
|
+
formatCompactNumber: $,
|
|
56
|
+
formatCompactPercent: S,
|
|
57
|
+
formatCurrency: i,
|
|
58
|
+
formatPercentage: u,
|
|
59
|
+
maskCNPJ: g,
|
|
60
|
+
maskCPF: l,
|
|
61
|
+
maskRG: p,
|
|
62
|
+
maskZipCode: d,
|
|
63
|
+
preFormatCurrency: c,
|
|
64
|
+
preFormatPercentage: m,
|
|
65
|
+
unmask: f
|
|
66
|
+
}, Symbol.toStringTag, { value: "Module" })), y = (e) => e ? `${e} é obrigatório.` : "Campo obrigatório.", P = (e, r) => r ? `${r} deve ter no mínimo ${e} caracteres.` : `Deve ter no mínimo ${e} caracteres.`, b = (e, r) => r ? `${r} deve ter no máximo ${e} caracteres.` : `Deve ter no máximo ${e} caracteres.`, V = (e, r) => r ? `${r} não pode ser menor que ${e}.` : `Não pode ser menor que ${e}.`, M = (e, r) => r ? `${r} não pode ser maior que ${e}.` : `Não pode ser maior que ${e}.`, k = (e) => e ? `${e} inválido.` : "Valor inválido.", F = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
67
|
__proto__: null,
|
|
7
|
-
invalidMessage:
|
|
8
|
-
maxLengthMessage:
|
|
9
|
-
maxValueMessage:
|
|
10
|
-
minLengthMessage:
|
|
11
|
-
minValueMessage:
|
|
12
|
-
requiredMessage:
|
|
13
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
68
|
+
invalidMessage: k,
|
|
69
|
+
maxLengthMessage: b,
|
|
70
|
+
maxValueMessage: M,
|
|
71
|
+
minLengthMessage: P,
|
|
72
|
+
minValueMessage: V,
|
|
73
|
+
requiredMessage: y
|
|
74
|
+
}, Symbol.toStringTag, { value: "Module" })), _ = (e) => {
|
|
14
75
|
const r = new URLSearchParams();
|
|
15
|
-
for (const [
|
|
16
|
-
Array.isArray(
|
|
76
|
+
for (const [t, n] of Object.entries(e))
|
|
77
|
+
Array.isArray(n) ? n.forEach((o) => r.append(t, String(o))) : n instanceof Date ? r.append(t, n.toISOString()) : n !== void 0 && r.append(t, String(n));
|
|
17
78
|
return r.toString();
|
|
18
|
-
},
|
|
79
|
+
}, L = D, v = s, h = F;
|
|
19
80
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
81
|
+
h as FIELD_MESSAGE,
|
|
82
|
+
v as IS,
|
|
83
|
+
L as UTIL,
|
|
84
|
+
C as createDictionary,
|
|
85
|
+
O as entries,
|
|
86
|
+
$ as formatCompactNumber,
|
|
87
|
+
S as formatCompactPercent,
|
|
88
|
+
i as formatCurrency,
|
|
89
|
+
u as formatPercentage,
|
|
90
|
+
k as invalidMessage,
|
|
91
|
+
x as isActionStatus,
|
|
92
|
+
U as isBusinessUnit,
|
|
93
|
+
j as isClientType,
|
|
94
|
+
q as isInfluencerBroadcastMethod,
|
|
95
|
+
a as isNumber,
|
|
96
|
+
w as isPaymentPhase,
|
|
97
|
+
B as isPaymentType,
|
|
98
|
+
R as isSocialNetwork,
|
|
99
|
+
T as keys,
|
|
100
|
+
g as maskCNPJ,
|
|
101
|
+
l as maskCPF,
|
|
102
|
+
J as maskPercentageFloat,
|
|
103
|
+
Z as maskPercentageInteger,
|
|
104
|
+
p as maskRG,
|
|
105
|
+
d as maskZipCode,
|
|
106
|
+
b as maxLengthMessage,
|
|
107
|
+
M as maxValueMessage,
|
|
108
|
+
P as minLengthMessage,
|
|
109
|
+
V as minValueMessage,
|
|
110
|
+
A as newDate,
|
|
111
|
+
c as preFormatCurrency,
|
|
112
|
+
m as preFormatPercentage,
|
|
113
|
+
y as requiredMessage,
|
|
114
|
+
_ as serializeParams,
|
|
115
|
+
f as unmask,
|
|
116
|
+
H as unmaskPercentageFloat,
|
|
117
|
+
K as unmaskPercentageInteger,
|
|
118
|
+
z as values
|
|
54
119
|
};
|
package/package.json
CHANGED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { i as n } from "./youtube-icon.component.BSdD-jlw.js";
|
|
2
|
-
function a(e) {
|
|
3
|
-
const r = e.replace(/[^0-9]/g, "");
|
|
4
|
-
return Number(r) / 100;
|
|
5
|
-
}
|
|
6
|
-
function c(e) {
|
|
7
|
-
return e.toLocaleString("pt-BR", {
|
|
8
|
-
style: "currency",
|
|
9
|
-
currency: "BRL"
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
const o = (e) => {
|
|
13
|
-
const r = n(e) ? e : Number(e);
|
|
14
|
-
return `${parseInt(String(r * 100))}%`;
|
|
15
|
-
}, u = (e) => {
|
|
16
|
-
const r = +String(e).replace("%", "");
|
|
17
|
-
if (!n(r)) return !1;
|
|
18
|
-
const t = r / 100;
|
|
19
|
-
return +String(t).split(".")[0] >= 1 ? 1 : t;
|
|
20
|
-
};
|
|
21
|
-
function m(e) {
|
|
22
|
-
return e.replace(/\D/g, "").replace(/^(\d{3})(\d{3})(\d{3})(\d{2})$/, "$1.$2.$3-$4");
|
|
23
|
-
}
|
|
24
|
-
function i(e) {
|
|
25
|
-
return e.replace(/\D/g, "").replace(/^(\d{2})(\d{3})(\d{3})(\d{1})$/, "$1.$2.$3-$4");
|
|
26
|
-
}
|
|
27
|
-
function s(e) {
|
|
28
|
-
return e.replace(/\D/g, "").replace(
|
|
29
|
-
/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/,
|
|
30
|
-
"$1.$2.$3/$4-$5"
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
function l(e) {
|
|
34
|
-
return e.replace(/\D/g, "").replace(/^(\d{5})(\d{3})$/, "$1-$2");
|
|
35
|
-
}
|
|
36
|
-
function p(e) {
|
|
37
|
-
return e.replace(/\D/g, "");
|
|
38
|
-
}
|
|
39
|
-
const d = (e) => new Intl.NumberFormat("pt-BR", {
|
|
40
|
-
style: "decimal",
|
|
41
|
-
notation: "compact",
|
|
42
|
-
compactDisplay: "short",
|
|
43
|
-
minimumFractionDigits: 0,
|
|
44
|
-
maximumFractionDigits: 3
|
|
45
|
-
}).format(e), f = (e) => new Intl.NumberFormat("pt-BR", {
|
|
46
|
-
style: "percent",
|
|
47
|
-
notation: "compact",
|
|
48
|
-
compactDisplay: "short",
|
|
49
|
-
minimumFractionDigits: 0,
|
|
50
|
-
maximumFractionDigits: 2
|
|
51
|
-
}).format(e), D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
52
|
-
__proto__: null,
|
|
53
|
-
formatCompactNumber: d,
|
|
54
|
-
formatCompactPercent: f,
|
|
55
|
-
formatCurrency: c,
|
|
56
|
-
formatPercentage: o,
|
|
57
|
-
maskCNPJ: s,
|
|
58
|
-
maskCPF: m,
|
|
59
|
-
maskRG: i,
|
|
60
|
-
maskZipCode: l,
|
|
61
|
-
preFormatCurrency: a,
|
|
62
|
-
preFormatPercentage: u,
|
|
63
|
-
unmask: p
|
|
64
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
65
|
-
export {
|
|
66
|
-
D as U,
|
|
67
|
-
a,
|
|
68
|
-
o as b,
|
|
69
|
-
i as c,
|
|
70
|
-
s as d,
|
|
71
|
-
l as e,
|
|
72
|
-
c as f,
|
|
73
|
-
d as g,
|
|
74
|
-
f as h,
|
|
75
|
-
m,
|
|
76
|
-
u as p,
|
|
77
|
-
p as u
|
|
78
|
-
};
|