@grapadigital/shared-app-modules 0.0.218 → 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/action.d.ts CHANGED
@@ -435,6 +435,9 @@ declare interface ProfileMetric {
435
435
  declare interface ProposalInterface {
436
436
  businessUnit: "service" | "comercial" | "artistic";
437
437
  origin: "inbound" | "outbound";
438
+ /**
439
+ * @deprecated Use `sale.type` no lugar.
440
+ */
438
441
  type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
439
442
  contact: string;
440
443
  initialScope: string;
@@ -561,7 +564,7 @@ declare interface SaleInterface {
561
564
  };
562
565
  closedAt?: string;
563
566
  isDollarNegotiation: boolean;
564
- type: "new" | "renewal" | "upsell";
567
+ type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
565
568
  }
566
569
 
567
570
  declare type SalePaymentMethod = "transfer" | "direct" | "debit_note" | "client";
@@ -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
+ };
@@ -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 {
@@ -786,6 +798,9 @@ declare interface ProfileSelectInputProps extends Omit<default_2.ComponentProps<
786
798
  declare interface ProposalInterface {
787
799
  businessUnit: "service" | "comercial" | "artistic";
788
800
  origin: "inbound" | "outbound";
801
+ /**
802
+ * @deprecated Use `sale.type` no lugar.
803
+ */
789
804
  type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
790
805
  contact: string;
791
806
  initialScope: string;
@@ -930,7 +945,7 @@ declare interface SaleInterface {
930
945
  };
931
946
  closedAt?: string;
932
947
  isDollarNegotiation: boolean;
933
- type: "new" | "renewal" | "upsell";
948
+ type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
934
949
  }
935
950
 
936
951
  declare type SalePaymentMethod = "transfer" | "direct" | "debit_note" | "client";
@@ -1,30 +1,32 @@
1
- import { aZ as v, c as u, B as N, a_ as _, aq as M, ar as T, as as F, w as $, F as j, W as q, X as B, $ as C, _ as O, Y as P, a0 as U } from "./chuncks/switch.D_38xWg-.js";
2
- import { M as W, s as X } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
3
- import { t as We, L as Xe, O as Ke, u as Ge, H as Qe, Y as Ye, a4 as Ve, Z as Ze, _ as Je, J as et, $ as tt, a5 as at, a0 as nt, a1 as rt, a2 as st, a3 as it, K as ot, Q as lt, a7 as dt, a8 as ct, ad as gt, w as ut, x as pt, y as xt, z as mt, G as bt, a9 as ht, U as ft, X as yt, W as wt, a6 as vt, aa as kt, ab as Nt, ac as Ct, af as St, ae as zt } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
4
- import { jsxs as g, jsx as e, Fragment as R } from "react/jsx-runtime";
5
- import S, { useState as D, useRef as A, useEffect as H, useMemo as K } from "react";
6
- import { B as L, m as G, T as Q, k as Y, l as V, S as k } from "./chuncks/badge.tZcF7uIJ.js";
7
- import { parseISO as z, differenceInCalendarDays as Z, format as J } from "date-fns";
8
- import { u as ee } from "./chuncks/use-debounce.hook.TyZMbuZv.js";
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 te } from "@tanstack/react-query";
12
+ import { useQuery as le } from "@tanstack/react-query";
11
13
  import "axios";
12
- import { l as ae } from "./chuncks/organization-users.service.B9edFs4F.js";
13
- const ne = [
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
- ], re = v("circle-alert", ne);
18
- const se = [
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
- ], ie = v("circle-question-mark", se);
23
- const oe = [
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
- ], le = v("copy", oe);
27
- const de = [
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
- ], ce = v("file-text", de);
40
- const ge = [
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
- ], ue = v("upload", ge);
45
- function Fe({
46
- icon: n = ue,
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: s = "Arraste e solte os arquivos aqui ou clique para selecionar.",
90
+ description: i = "Arraste e solte os arquivos aqui ou clique para selecionar.",
49
91
  buttonText: r = "Selecionar novos arquivos",
50
- files: i,
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 h = Array.from(l.target.files ?? []);
57
- o([...i, ...h]);
58
- }, f = (l) => {
59
- const h = [...i];
60
- h.splice(l, 1), o(h);
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 h = Array.from(l.dataTransfer.files);
71
- o([...i, ...h]);
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: s })
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
- i.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: i.map((l, h) => /* @__PURE__ */ g(L, { children: [
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(h),
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(_, { className: "size-3" })
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 Re({
183
+ function Oe({
142
184
  content: n,
143
185
  align: t,
144
- asChild: s,
186
+ asChild: i,
145
187
  className: r,
146
- openDelay: i = 0,
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(M, { openDelay: i, closeDelay: a, ...x, children: [
153
- /* @__PURE__ */ e(T, { asChild: s, children: o }),
154
- /* @__PURE__ */ e(F, { align: t, className: r, children: n })
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 pe = {
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
- }, xe = {
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
- }, I = {
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 De({
253
+ function Ke({
212
254
  size: n,
213
255
  color: t,
214
- className: s,
256
+ className: i,
215
257
  icon: r,
216
- filled: i
258
+ filled: s
217
259
  }) {
218
- const a = i ? xe[t] : pe[t], o = n ? I[n] : I.md;
219
- return /* @__PURE__ */ e("div", { className: u("w-fit p-2 rounded-lg", a?.bg, s), children: /* @__PURE__ */ e(r, { className: u(o, a?.text) }) });
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 Ae({ className: n, ...t }) {
263
+ function Ue({ className: n, ...t }) {
222
264
  return /* @__PURE__ */ e("div", { className: u("divide-y", n), ...t });
223
265
  }
224
- function He({
266
+ function We({
225
267
  label: n,
226
268
  value: t,
227
- tooltip: s,
269
+ tooltip: i,
228
270
  highlight: r = !1,
229
- negative: i = !1,
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: f = !1,
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 = z(t), l = Z(p, /* @__PURE__ */ new Date());
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(M, { openDelay: 0, closeDelay: 0, children: [
246
- /* @__PURE__ */ e(T, { children: /* @__PURE__ */ g("div", { className: "flex justify-between", children: [
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
- i ? "text-red-600" : a ? "text-green-600" : ""
294
+ s ? "text-red-600" : a ? "text-green-600" : ""
253
295
  ),
254
296
  children: [
255
297
  n,
256
298
  " ",
257
- /* @__PURE__ */ e(re, { className: "size-3.5" })
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
- i ? "text-red-600" : a ? "text-green-600" : ""
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 !== "" ? J(z(t), "dd/MM/yyyy") : d && t === "" ? "—" : x ? t ?? "—" : typeof t == "number" ? `R$ ${t.toLocaleString("pt-BR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : "—",
270
- m && w ? /* @__PURE__ */ e(le, { size: 15, onClick: () => w(t) }) : null
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
- F,
318
+ D,
277
319
  {
278
320
  align: "start",
279
- className: u(!f && "pointer-events-none"),
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: s })
324
+ /* @__PURE__ */ e("div", { className: "font-normal opacity-80", children: i })
283
325
  ] })
284
326
  }
285
327
  )
286
328
  ] }) });
287
329
  }
288
- function Le({
289
- icon: n = ce,
330
+ function Xe({
331
+ icon: n = fe,
290
332
  title: t,
291
- description: s,
333
+ description: i,
292
334
  tip: r,
293
- className: i,
335
+ className: s,
294
336
  ...a
295
337
  }) {
296
- return /* @__PURE__ */ e($, { className: u(i), ...a, children: /* @__PURE__ */ g(j, { className: "flex flex-col items-center justify-center px-6 py-12 text-center", children: [
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: s }),
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 Ee({
351
+ function Ge({
310
352
  actions: n,
311
- icon: t = ie
353
+ icon: t = pe
312
354
  }) {
313
- const [s, r] = D(!1), i = A(null);
355
+ const [i, r] = A(!1), s = P(null);
314
356
  return H(() => {
315
- if (!s) return;
357
+ if (!i) return;
316
358
  const a = (d) => {
317
- i.current?.contains(d.target) || r(!1);
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
- }, [s]), /* @__PURE__ */ e(G, { children: /* @__PURE__ */ g(
366
+ }, [i]), /* @__PURE__ */ e(te, { children: /* @__PURE__ */ g(
325
367
  "div",
326
368
  {
327
- ref: i,
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
- s ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-2 opacity-0"
377
+ i ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-2 opacity-0"
336
378
  ),
337
- style: { transitionDelay: s ? `${o * 30}ms` : "0ms" },
338
- children: /* @__PURE__ */ g(Q, { children: [
339
- /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__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(V, { side: "left", children: a.label })
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": s ? "Fechar menu de ajuda" : "Abrir menu de ajuda",
368
- "aria-expanded": s,
409
+ "aria-label": i ? "Fechar menu de ajuda" : "Abrir menu de ajuda",
410
+ "aria-expanded": i,
369
411
  onClick: () => r((a) => !a),
370
- children: s ? /* @__PURE__ */ e(_, { className: "size-5" }) : /* @__PURE__ */ e(t, { className: "size-5" })
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 $e({
419
+ function Qe({
378
420
  columns: n = 9,
379
421
  rows: t = 20,
380
- hasActions: s = !1,
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(C, { children: Array.from({ length: n }).map((i, a) => {
385
- const o = s && a === n - 1;
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(P, { children: Array.from({ length: t }).map((i, a) => /* @__PURE__ */ e(C, { className: "h-[3.05rem]", children: Array.from({ length: n }).map((o, d) => {
401
- const x = s && d === n - 1;
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 me = "@[__display__](__id__)", E = /@\[([^\]]+)\]\(([^)]+)\)/g;
407
- function be(n) {
408
- const t = [], s = new RegExp(E);
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 = s.exec(n)) !== null; )
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 je(n) {
415
- return be(n).map((t) => ({
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 he(n, t) {
421
- return te({
462
+ function Ie(n, t) {
463
+ return le({
422
464
  queryKey: ["organization-users", n, t],
423
- queryFn: () => ae({
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 fe = {
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
- }, ye = {
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 qe({
531
+ function Ze({
490
532
  value: n,
491
533
  onChange: t,
492
- onBlur: s,
534
+ onBlur: i,
493
535
  organizationId: r,
494
- placeholder: i,
536
+ placeholder: s,
495
537
  disabled: a,
496
538
  singleLine: o = !1
497
539
  }) {
498
- const [d, x] = D(""), b = ee(d, 200), { data: m } = he(r, b), y = A(void 0), f = K(
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?.(f);
504
- }, [f]), /* @__PURE__ */ e(
505
- W,
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: s,
510
- placeholder: i,
551
+ onBlur: i,
552
+ placeholder: s,
511
553
  disabled: a,
512
554
  singleLine: o,
513
555
  allowSuggestionsAboveCursor: !0,
514
- style: fe,
556
+ style: Se,
515
557
  children: /* @__PURE__ */ e(
516
- X,
558
+ ee,
517
559
  {
518
560
  trigger: "@",
519
- markup: me,
561
+ markup: ke,
520
562
  data: (c, p) => {
521
- y.current = p, x(c), p(f);
563
+ y.current = p, x(c), p(h);
522
564
  },
523
565
  displayTransform: (c, p) => `@${p}`,
524
566
  appendSpaceOnAdd: !0,
525
- style: ye
567
+ style: Ce
526
568
  }
527
569
  )
528
570
  }
529
571
  );
530
572
  }
531
- function Be({ text: n, className: t }) {
532
- const s = new RegExp(E), r = [];
533
- let i = 0, a, o = 0;
534
- for (; (a = s.exec(n)) !== null; )
535
- a.index > i && r.push(
536
- /* @__PURE__ */ e("span", { children: n.slice(i, a.index) }, o++)
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
- ), i = a.index + a[0].length;
543
- return i < n.length && r.push(/* @__PURE__ */ e("span", { children: n.slice(i) }, o++)), /* @__PURE__ */ e(R, { children: r });
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 Oe({
587
+ function Ve({
546
588
  size: n = 24,
547
589
  color: t = "currentColor",
548
- ...s
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
- ...s,
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
- We as AsyncBoundary,
570
- Fe as AttachmentInput,
571
- Xe as CampaignsSelectInput,
572
- Ke as ClientSelectInput,
573
- Ge as ErrorBundary,
574
- Qe as ErrorCard,
575
- Ye as FieldCalendar,
576
- Ve as FieldCheckbox,
577
- Ze as FieldClientSelectInput,
578
- Je as FieldInput,
579
- et as FieldLabelWithAsterisk,
580
- tt as FieldProfileSelectInput,
581
- at as FieldResponsibleSelectInput,
582
- nt as FieldSaleSelectInput,
583
- rt as FieldSelect,
584
- st as FieldSwitch,
585
- it as FieldTextarea,
586
- Re as HoverContent,
587
- De as IconBadge,
588
- ot as Image,
589
- lt as InfluencerSelectInput,
590
- dt as InstagramIcon,
591
- ct as LinkedInIcon,
592
- Ae as List,
593
- He as ListRow,
594
- qe as MentionInput,
595
- Be as MentionText,
596
- gt as ModuleTags,
597
- Le as NotFoundCard,
598
- ut as PageHeader,
599
- pt as PageHeaderActions,
600
- xt as PageHeaderContent,
601
- mt as PageHeaderDescription,
602
- bt as PageHeaderTitle,
603
- ht as PinterestIcon,
604
- ft as ProfileSelectInput,
605
- yt as ResponsibleSelectInput,
606
- wt as SaleSelectInput,
607
- Ee as SpeedDialButton,
608
- vt as SuppliersSelectInput,
609
- $e as TableSkeleton,
610
- kt as TikTokIcon,
611
- Oe as TwitterIcon,
612
- Nt as XIcon,
613
- Ct as YoutubeIcon,
614
- je as getMentionedUsers,
615
- be as parseMentions,
616
- St as useGetTags,
617
- zt as useModuleTags
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/content.d.ts CHANGED
@@ -435,6 +435,9 @@ declare interface ProfileMetric {
435
435
  declare interface ProposalInterface {
436
436
  businessUnit: "service" | "comercial" | "artistic";
437
437
  origin: "inbound" | "outbound";
438
+ /**
439
+ * @deprecated Use `sale.type` no lugar.
440
+ */
438
441
  type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
439
442
  contact: string;
440
443
  initialScope: string;
@@ -561,7 +564,7 @@ declare interface SaleInterface {
561
564
  };
562
565
  closedAt?: string;
563
566
  isDollarNegotiation: boolean;
564
- type: "new" | "renewal" | "upsell";
567
+ type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
565
568
  }
566
569
 
567
570
  declare type SalePaymentMethod = "transfer" | "direct" | "debit_note" | "client";
@@ -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
- * Lida com o evento de teclado em um input de porcentagem, garantindo que
33
- * ao pressionar "Backspace" o número seja removido corretamente, sem excluir
34
- * o símbolo de porcentagem (%).
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 { p as o } from "./chuncks/format.util.CesJhvUo.js";
2
- const i = (t, a) => {
3
- const e = t.target.value, n = o(e);
4
- n !== !1 && a(n);
5
- }, f = (t, a) => {
6
- const e = t.target, n = e.value, c = e.selectionStart, r = e.selectionEnd;
7
- if (c === r && t.key === "Backspace") {
8
- const u = n.slice(0, -2), s = o(u);
9
- if (s === !1) return;
10
- a(s);
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
- i as onChangePercentage,
15
- f as onKeyDownPercentage
24
+ k as onChangePercentageFloat,
25
+ i as onChangePercentageInteger,
26
+ m as onKeyDownPercentageFloat,
27
+ d as onKeyDownPercentageInteger
16
28
  };
package/dist/invoice.d.ts CHANGED
@@ -435,6 +435,9 @@ declare interface ProfileMetric {
435
435
  declare interface ProposalInterface {
436
436
  businessUnit: "service" | "comercial" | "artistic";
437
437
  origin: "inbound" | "outbound";
438
+ /**
439
+ * @deprecated Use `sale.type` no lugar.
440
+ */
438
441
  type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
439
442
  contact: string;
440
443
  initialScope: string;
@@ -561,7 +564,7 @@ declare interface SaleInterface {
561
564
  };
562
565
  closedAt?: string;
563
566
  isDollarNegotiation: boolean;
564
- type: "new" | "renewal" | "upsell";
567
+ type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
565
568
  }
566
569
 
567
570
  declare type SalePaymentMethod = "transfer" | "direct" | "debit_note" | "client";
package/dist/payment.d.ts CHANGED
@@ -435,6 +435,9 @@ declare interface ProfileMetric {
435
435
  declare interface ProposalInterface {
436
436
  businessUnit: "service" | "comercial" | "artistic";
437
437
  origin: "inbound" | "outbound";
438
+ /**
439
+ * @deprecated Use `sale.type` no lugar.
440
+ */
438
441
  type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
439
442
  contact: string;
440
443
  initialScope: string;
@@ -561,7 +564,7 @@ declare interface SaleInterface {
561
564
  };
562
565
  closedAt?: string;
563
566
  isDollarNegotiation: boolean;
564
- type: "new" | "renewal" | "upsell";
567
+ type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
565
568
  }
566
569
 
567
570
  declare type SalePaymentMethod = "transfer" | "direct" | "debit_note" | "client";
@@ -435,6 +435,9 @@ declare interface ProfileMetric {
435
435
  declare interface ProposalInterface {
436
436
  businessUnit: "service" | "comercial" | "artistic";
437
437
  origin: "inbound" | "outbound";
438
+ /**
439
+ * @deprecated Use `sale.type` no lugar.
440
+ */
438
441
  type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
439
442
  contact: string;
440
443
  initialScope: string;
@@ -561,7 +564,7 @@ declare interface SaleInterface {
561
564
  };
562
565
  closedAt?: string;
563
566
  isDollarNegotiation: boolean;
564
- type: "new" | "renewal" | "upsell";
567
+ type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
565
568
  }
566
569
 
567
570
  declare type SalePaymentMethod = "transfer" | "direct" | "debit_note" | "client";
package/dist/sale.d.ts CHANGED
@@ -435,6 +435,9 @@ declare interface ProfileMetric {
435
435
  export declare interface ProposalInterface {
436
436
  businessUnit: "service" | "comercial" | "artistic";
437
437
  origin: "inbound" | "outbound";
438
+ /**
439
+ * @deprecated Use `sale.type` no lugar.
440
+ */
438
441
  type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
439
442
  contact: string;
440
443
  initialScope: string;
@@ -561,7 +564,7 @@ export declare interface SaleInterface {
561
564
  };
562
565
  closedAt?: string;
563
566
  isDollarNegotiation: boolean;
564
- type: "new" | "renewal" | "upsell";
567
+ type: "new" | "organic_expansion" | "strategic_expansion" | "renewal" | "comercial_winback" | "organic_winback";
565
568
  }
566
569
 
567
570
  export declare type SalePaymentMethod = "transfer" | "direct" | "debit_note" | "client";
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 { U as o } from "./chuncks/format.util.CesJhvUo.js";
2
- import { g as D, h as E, f as L, b, d as h, m as k, c as C, e as _, a as I, p as U, u as O } from "./chuncks/format.util.CesJhvUo.js";
3
- import { f as n } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
4
- import { r as N, p as x, n as A, j as F, h as T, l as j, i as w, m as G, k as V, g as z, o as B, q as R, v as J } from "./chuncks/youtube-icon.component.BSdD-jlw.js";
5
- const i = (e) => e ? `${e} é obrigatório.` : "Campo obrigatório.", c = (e, r) => r ? `${r} deve ter no mínimo ${e} caracteres.` : `Deve ter no mínimo ${e} caracteres.`, m = (e, r) => r ? `${r} deve ter no máximo ${e} caracteres.` : `Deve ter no máximo ${e} caracteres.`, u = (e, r) => r ? `${r} não pode ser menor que ${e}.` : `Não pode ser menor que ${e}.`, p = (e, r) => r ? `${r} não pode ser maior que ${e}.` : `Não pode ser maior que ${e}.`, f = (e) => e ? `${e} inválido.` : "Valor inválido.", g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
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: f,
8
- maxLengthMessage: m,
9
- maxValueMessage: p,
10
- minLengthMessage: c,
11
- minValueMessage: u,
12
- requiredMessage: i
13
- }, Symbol.toStringTag, { value: "Module" })), l = (e) => {
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 [s, a] of Object.entries(e))
16
- Array.isArray(a) ? a.forEach((t) => r.append(s, String(t))) : a instanceof Date ? r.append(s, a.toISOString()) : a !== void 0 && r.append(s, String(a));
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
- }, $ = o, y = n, M = g;
79
+ }, L = D, v = s, h = F;
19
80
  export {
20
- M as FIELD_MESSAGE,
21
- y as IS,
22
- $ as UTIL,
23
- N as createDictionary,
24
- x as entries,
25
- D as formatCompactNumber,
26
- E as formatCompactPercent,
27
- L as formatCurrency,
28
- b as formatPercentage,
29
- f as invalidMessage,
30
- A as isActionStatus,
31
- F as isBusinessUnit,
32
- T as isClientType,
33
- j as isInfluencerBroadcastMethod,
34
- w as isNumber,
35
- G as isPaymentPhase,
36
- V as isPaymentType,
37
- z as isSocialNetwork,
38
- B as keys,
39
- h as maskCNPJ,
40
- k as maskCPF,
41
- C as maskRG,
42
- _ as maskZipCode,
43
- m as maxLengthMessage,
44
- p as maxValueMessage,
45
- c as minLengthMessage,
46
- u as minValueMessage,
47
- R as newDate,
48
- I as preFormatCurrency,
49
- U as preFormatPercentage,
50
- i as requiredMessage,
51
- l as serializeParams,
52
- O as unmask,
53
- J as values
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-app-modules",
3
3
  "private": false,
4
- "version": "0.0.218",
4
+ "version": "0.0.220",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
@@ -128,13 +128,6 @@
128
128
  }
129
129
  },
130
130
  "type": "module",
131
- "scripts": {
132
- "dev": "vite",
133
- "build": "rm -rf dist && tsc -b && vite build",
134
- "lint": "eslint .",
135
- "preview": "vite preview",
136
- "lib:publish": "pnpm build && pnpm publish --no-git-checks"
137
- },
138
131
  "peerDependencies": {
139
132
  "react": "^18.3.1",
140
133
  "react-dom": "^18.3.1"
@@ -197,5 +190,12 @@
197
190
  "vite": "^7.2.4",
198
191
  "vite-plugin-dts": "^4.5.4",
199
192
  "vite-plugin-lib-inject-css": "^2.2.2"
193
+ },
194
+ "scripts": {
195
+ "dev": "vite",
196
+ "build": "rm -rf dist && tsc -b && vite build",
197
+ "lint": "eslint .",
198
+ "preview": "vite preview",
199
+ "lib:publish": "pnpm build && pnpm publish --no-git-checks"
200
200
  }
201
- }
201
+ }
@@ -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
- };