@tesouro/embedded-components-react 0.5.268 → 0.5.270

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.
Files changed (56) hide show
  1. package/dist/index.css +4 -10
  2. package/dist/index.d.ts +13 -9
  3. package/dist/lib/ReceivablesWidget.d.ts +13 -9
  4. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index.js +3 -1
  5. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +44 -0
  6. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +97 -0
  7. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +76 -150
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +63 -57
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/actionsModal.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +161 -152
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +30 -34
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +12 -8
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +18 -19
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +208 -158
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +91 -85
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +197 -196
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +147 -115
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +14 -14
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +3 -5
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +37 -34
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +22 -7
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +17 -15
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +17 -13
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +37 -31
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +29 -23
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +38 -11
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +26 -28
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +20 -14
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +8 -24
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +34 -83
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +14 -404
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +28 -2
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +79 -39
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +490 -68
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +2 -502
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +41 -216
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +70 -21
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +484 -5
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +224 -0
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +21 -263
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +8 -2
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +261 -24
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +2 -237
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +100 -3
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +21 -242
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +226 -82
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +3 -59
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +233 -178
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +85 -37
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +60 -0
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +194 -0
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +45 -0
  54. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  55. package/package.json +1 -1
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +0 -100
@@ -2,189 +2,221 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useAnalyticsTrack as e } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import { useRefetchWidget as t, useWidgetConfig as n, useWidgetError as r, useWidgetInitStaleForToken as ee, useWidgetLoading as te } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
5
+ import { hasAnyScope as e } from "../../../../../shared/data-access/dist/lib/hasAnyScope.js";
6
+ import { Scope as t } from "../../../../../shared/data-access/dist/lib/scopes.js";
7
+ import "../../../../../shared/data-access/dist/index.js";
8
+ import { useAnalyticsTrack as n } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
9
+ import { useRefetchWidget as r, useWidgetConfig as i, useWidgetError as ee, useWidgetInitStaleForToken as te, useWidgetLoading as ne } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
7
10
  import "../../../../../shared/feature/dist/index.js";
8
- import { ReceivablesWidgetAnalyticsEvent as ne } from "./analytics/events.js";
9
- import { RECEIVABLE_STATUS_BADGE_LABELS_EN as re } from "../../../../ui/dist/index13.js";
11
+ import { ReceivablesWidgetAnalyticsEvent as re } from "./analytics/events.js";
12
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as ie } from "../../../../ui/dist/index13.js";
10
13
  import "../../../../ui/dist/index.js";
11
- import { hasSelectedText as ie } from "../../../../../shared/product-catalog/feature/dist/lib/helpers.js";
14
+ import { hasSelectedText as ae } from "../../../../../shared/product-catalog/feature/dist/lib/helpers.js";
12
15
  import "../../../../../shared/product-catalog/feature/dist/index.js";
13
- import { getCreateFollowUp as ae } from "./actionsModal.js";
14
- import { getDocumentTitle as oe } from "./helpers.js";
15
- import { RECEIVABLE_MESSAGE_LABELS_EN as i } from "./labels.js";
16
- import { getReceivablePermissions as se } from "./permissions.js";
17
- import { useReceivableActions as ce } from "./useReceivableActions.js";
18
- import { useReceivableActionsModal as le } from "./useReceivableActionsModal.js";
19
- import { useReceivableDetails as ue } from "./useReceivableDetails.js";
20
- import { useReceivableForm as de } from "./useReceivableForm.js";
21
- import { useReceivablesTable as fe } from "./useReceivablesTable.js";
22
- import { useCallback as a, useEffect as o, useMemo as s, useRef as pe, useState as c } from "react";
16
+ import { getCreateFollowUp as oe } from "./actionsModal.js";
17
+ import { getDocumentTitle as se } from "./helpers.js";
18
+ import { RECEIVABLE_MESSAGE_LABELS_EN as ce } from "./labels.js";
19
+ import { getReceivablePermissions as le } from "./permissions.js";
20
+ import { useReceivableActions as ue } from "./useReceivableActions.js";
21
+ import { useReceivableActionsModal as de } from "./useReceivableActionsModal.js";
22
+ import { useReceivableDetails as fe } from "./useReceivableDetails.js";
23
+ import { useReceivableForm as pe } from "./useReceivableForm.js";
24
+ import { useReceivablesTable as me } from "./useReceivablesTable.js";
25
+ import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
23
26
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js
24
- function l({ auditHistoryLabels: l, counterpartMessageLabels: me, embeddedBankName: he, filterLabels: ge, initialCounterpartId: d, initialView: f, messageLabels: p, onReceivableCreated: m, onReceivableOpened: h, screenLabels: _e }) {
25
- let g = e();
27
+ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankName: ge, filterLabels: _e, initialCounterpartId: f, initialView: p, messageLabels: m, onReceivableCreated: h, onReceivableOpened: g, screenLabels: ve }) {
28
+ let _ = n();
26
29
  o(() => {
27
- g(ne.Mounted);
28
- }, [g]);
29
- let { initResponse: _, widgetToken: ve } = n(), v = te(), ye = r(), y = t(), b = ee(), x = !!_ && !b, S = s(() => se(_?.scopes), [_?.scopes]), be = !!_ && b, C = !!_ && S.canRead, w = !!_ && S.canWrite, T = x && S.canRead, E = x && S.canWrite, D = !!ye && !x && !v, O = !x && !D && !!(ve || v), k = s(() => ({
30
- ...i,
31
- ...p
32
- }), [p]), A = _e?.statusBadge, j = s(() => ({
33
- ...re,
30
+ _(re.Mounted);
31
+ }, [_]);
32
+ let { initResponse: v, widgetToken: ye } = i(), y = ne(), be = ee(), xe = r(), b = te(), x = !!v && !b, S = s(() => le(v?.scopes), [v?.scopes]), Se = !!v && b, C = !!v && S.canRead, w = !!v && S.canWrite, T = x && S.canRead, E = x && S.canWrite, D = !!be && !x && !y, O = !x && !D && !!(ye || y), k = s(() => ({
33
+ ...ce,
34
+ ...m
35
+ }), [m]), A = ve?.statusBadge, j = s(() => ({
36
+ ...ie,
34
37
  ...A
35
- }), [A]), [M, N] = c(), [P, F] = c(!1), [I, L] = c(!1), xe = a(() => L(!0), []), R = a(() => L(!1), []), Se = a((e, t) => {
36
- N(e), F(!0), m?.(e, t);
37
- }, [m]), z = le({ messages: k }), B = z.open, Ce = a((e, t, n) => {
38
- let r = ae(n);
39
- r.openDetails && (N(e), F(!0)), r.actionsModal && B({
38
+ }), [A]), [M, N] = l(), [P, F] = l(!1), [I, Ce] = l(M);
39
+ M && M !== I && Ce(M);
40
+ let [L, R] = l(!1), [we, z] = l(), Te = e(v?.scopes, [t.CounterpartReadOrg]), Ee = a(() => z(void 0), []), [B, V] = l(!1), De = a(() => V(!0), []), H = a(() => V(!1), []), Oe = a((e, t) => {
41
+ N(e), F(!0), h?.(e, t);
42
+ }, [h]), U = de({ messages: k }), W = U.open, ke = a((e, t, n) => {
43
+ let r = oe(n);
44
+ r.openDetails && (N(e), F(!0)), r.actionsModal && W({
40
45
  action: n.mode,
41
46
  receivableId: e,
42
47
  counterpartId: n.counterpartId,
43
48
  inlineItems: n.inlineItems,
44
49
  showEmailStep: r.actionsModal.showEmailStep
45
- }), m?.(e, t);
46
- }, [m, B]), V = fe({
47
- initialCounterpartId: f === "create" ? void 0 : d,
50
+ }), h?.(e, t);
51
+ }, [h, W]), G = me({
52
+ initialCounterpartId: p === "create" ? void 0 : f,
48
53
  messages: k,
49
54
  statusLabels: j,
50
- filterLabels: ge,
55
+ filterLabels: _e,
51
56
  enabled: T,
52
57
  visible: C
53
- }), we = a((e) => {
54
- N(e), F(!0), h?.(e, "invoice");
55
- }, [h]), H = ue({
58
+ }), Ae = a((e) => {
59
+ N(e), F(!0), g?.(e, "invoice");
60
+ }, [g]), K = fe({
56
61
  selectedReceivableId: M,
57
62
  enabled: P && T,
58
63
  canWrite: w,
59
64
  messages: k,
60
65
  statusLabels: j,
61
- auditHistoryLabels: l,
62
- onOpenReceivable: we
63
- }), U = de({
66
+ auditHistoryLabels: u,
67
+ onOpenReceivable: Ae,
68
+ onOpenCustomer: Te ? z : void 0
69
+ }), q = c("edit"), je = a((e, t, n) => {
70
+ let r = n.mode === "issue", i = r && q.current !== "issue" && n.hasCustomerEmail;
71
+ (i || n.inlineItems.length !== 0) && W({
72
+ action: r || n.mode === "recurrence" ? n.mode : "update",
73
+ receivableId: e,
74
+ counterpartId: n.counterpartId,
75
+ inlineItems: n.inlineItems,
76
+ showEmailStep: i
77
+ });
78
+ }, [W]), J = pe({
64
79
  messages: k,
65
- counterpartMessageLabels: me,
66
- embeddedBankName: he,
67
- onCreated: Ce
68
- }), Te = a(() => {
69
- E && U.openCreate("invoice");
70
- }, [E, U.openCreate]), W = pe(!1);
80
+ counterpartMessageLabels: he,
81
+ embeddedBankName: ge,
82
+ onCreated: ke,
83
+ onUpdated: je
84
+ }), Me = a(() => {
85
+ E && J.openCreate("invoice");
86
+ }, [E, J.openCreate]), Y = c(!1);
71
87
  o(() => {
72
- W.current || f === "create" && E && (W.current = !0, U.openCreate("invoice", { customerId: d }));
88
+ Y.current || p === "create" && E && (Y.current = !0, J.openCreate("invoice", { customerId: f }));
73
89
  }, [
74
90
  E,
75
- U.openCreate,
76
- d,
77
- f
91
+ J.openCreate,
92
+ f,
93
+ p
78
94
  ]);
79
- let G = ce({
80
- selectedReceivable: H.receivable,
81
- selectedRecurrence: H.recurrence,
95
+ let X = ue({
96
+ selectedReceivable: K.receivable,
97
+ selectedRecurrence: K.recurrence,
82
98
  messages: k,
83
- onCreated: Se,
99
+ onCreated: Oe,
84
100
  onDeleted: (e) => {
85
101
  e === M && (N(void 0), F(!1));
86
102
  },
87
- onCompleteBeforeIssue: (e) => {
88
- U.openEdit(e, { highlightForIssue: !0 }), F(!1);
89
- }
90
- }), K = x && !S.canWrite, q = U.open || U.counterpartView !== "none" || !!G.actionTarget || G.sendOpen || G.payment.isOpen || z.isOpen || I, J = U.close, Y = U.counterpartForm.close, { closeAction: X, closeSend: Z } = G, Q = G.payment.close, $ = z.close;
103
+ onCompleteBeforeIssue: (e, t) => {
104
+ q.current = t, J.openEdit(e, { highlightForIssue: !0 }), P && R(!0), F(!1);
105
+ },
106
+ onIssuedForSend: (e, t) => W({
107
+ action: "issue",
108
+ receivableId: e,
109
+ counterpartId: t,
110
+ inlineItems: [],
111
+ showEmailStep: !0
112
+ })
113
+ });
114
+ o(() => {
115
+ J.open || (q.current = "edit");
116
+ }, [J.open]), o(() => {
117
+ !J.open && L && (R(!1), F(!0));
118
+ }, [J.open, L]);
119
+ let Z = x && !S.canWrite, Q = J.open || J.counterpartView !== "none" || !!X.actionTarget || X.sendOpen || X.payment.isOpen || U.isOpen || B, Ne = J.close, Pe = J.counterpartForm.close, { closeAction: Fe, closeSend: Ie } = X, Le = X.payment.close, $ = U.close;
91
120
  o(() => {
92
- K && q && (J(), Y(), X(), Z(), Q(), $(), R());
121
+ Z && Q && (Ne(), Pe(), Fe(), Ie(), Le(), $(), H());
93
122
  }, [
94
- X,
123
+ Fe,
95
124
  $,
96
- Y,
97
- J,
98
- R,
125
+ Pe,
126
+ Ne,
127
+ H,
128
+ Le,
129
+ Ie,
99
130
  Q,
100
- Z,
101
- q,
102
- K
131
+ Z
103
132
  ]);
104
- let Ee = a((e) => {
105
- ie() || (N(e.id), F(!0), h?.(e.id, e.type));
106
- }, [h]), De = a(() => {
107
- F(!1), N(void 0);
108
- }, []), Oe = a((e, t) => {
133
+ let Re = a((e) => {
134
+ ae() || (N(e.id), F(!0), g?.(e.id, e.type));
135
+ }, [g]), ze = a(() => {
136
+ F(!1), N(void 0), z(void 0);
137
+ }, []), Be = a((e, t) => {
109
138
  if (E) {
110
139
  if (e === "edit") {
111
- H.receivable && (U.openEdit(H.receivable), F(!1));
140
+ K.receivable && (q.current = "edit", J.openEdit(K.receivable), R(!0), F(!1));
112
141
  return;
113
142
  }
114
- G.openAction(e, {
143
+ X.openAction(e, {
115
144
  id: t.id,
116
- title: H.receivable ? oe(H.receivable, k) : t.title,
145
+ title: K.receivable ? se(K.receivable, k) : t.title,
117
146
  type: t.type
118
- }, H.receivable ?? null);
147
+ }, K.receivable ?? null);
119
148
  }
120
149
  }, [
121
- G,
150
+ X,
122
151
  E,
123
- H.receivable,
124
- U.openEdit,
152
+ K.receivable,
153
+ J.openEdit,
125
154
  k
126
155
  ]);
127
156
  return {
128
157
  canWrite: w,
129
158
  canEditSettings: C && S.canEditSettings,
130
- actionsSuspended: be,
159
+ actionsSuspended: Se,
131
160
  isAccessRestricted: x && !S.canRead,
132
- table: C ? V : {
133
- ...V,
161
+ table: C ? G : {
162
+ ...G,
134
163
  rows: [],
135
164
  statusCards: void 0,
136
165
  isError: !1
137
166
  },
138
- isTableLoading: C ? V.isLoading || O && V.rows.length === 0 : O,
139
- isError: D || C && V.isError,
140
- onRetry: D ? y : V.onRetry,
141
- details: H,
167
+ isTableLoading: C ? G.isLoading || O && G.rows.length === 0 : O,
168
+ isError: D || C && G.isError,
169
+ onRetry: D ? xe : G.onRetry,
170
+ details: K,
142
171
  detailsOpen: P && C,
143
- closeDetails: De,
172
+ closeDetails: ze,
173
+ detailsPanelKey: I,
174
+ customerDetailsId: we,
175
+ closeCustomerDetails: Ee,
144
176
  form: {
145
- ...U,
146
- open: w && U.open,
147
- counterpartView: w ? U.counterpartView : "none",
177
+ ...J,
178
+ open: w && J.open,
179
+ counterpartView: w ? J.counterpartView : "none",
148
180
  counterpartForm: {
149
- ...U.counterpartForm,
150
- submit: u(E, U.counterpartForm.submit)
181
+ ...J.counterpartForm,
182
+ submit: d(E, J.counterpartForm.submit)
151
183
  },
152
- submit: u(E, U.submit),
153
- submitDraft: u(E, U.submitDraft),
154
- submitPrimary: u(E, U.submitPrimary)
184
+ submit: d(E, J.submit),
185
+ submitDraft: d(E, J.submitDraft),
186
+ submitPrimary: d(E, J.submitPrimary)
155
187
  },
156
- openCreate: Te,
157
- measureUnitsOpen: w && I,
158
- openMeasureUnits: xe,
159
- closeMeasureUnits: R,
188
+ openCreate: Me,
189
+ measureUnitsOpen: w && B,
190
+ openMeasureUnits: De,
191
+ closeMeasureUnits: H,
160
192
  actions: {
161
- ...G,
162
- actionDialog: w ? G.actionDialog : void 0,
163
- sendOpen: w && G.sendOpen,
164
- openAction: u(E, G.openAction),
165
- confirmAction: u(E, G.confirmAction),
166
- submitSend: u(E, G.submitSend),
193
+ ...X,
194
+ actionDialog: w ? X.actionDialog : void 0,
195
+ sendOpen: w && X.sendOpen,
196
+ openAction: d(E, X.openAction),
197
+ confirmAction: d(E, X.confirmAction),
198
+ submitSend: d(E, X.submitSend),
167
199
  payment: {
168
- ...G.payment,
169
- isOpen: w && G.payment.isOpen,
170
- save: u(E, G.payment.save),
171
- confirm: u(E, G.payment.confirm)
200
+ ...X.payment,
201
+ isOpen: w && X.payment.isOpen,
202
+ save: d(E, X.payment.save),
203
+ confirm: d(E, X.payment.confirm)
172
204
  }
173
205
  },
174
206
  actionsModal: {
175
- ...z,
176
- isOpen: w && z.isOpen,
177
- send: u(E, z.send),
178
- saveItems: u(E, z.saveItems)
207
+ ...U,
208
+ isOpen: w && U.isOpen,
209
+ send: d(E, U.send),
210
+ saveItems: d(E, U.saveItems)
179
211
  },
180
- handleRowClick: Ee,
181
- handleDetailsActionClick: Oe
212
+ handleRowClick: Re,
213
+ handleDetailsActionClick: Be
182
214
  };
183
215
  }
184
- function u(e, t) {
216
+ function d(e, t) {
185
217
  return (...n) => {
186
218
  e && t(...n);
187
219
  };
188
220
  }
189
221
  //#endregion
190
- export { l as useReceivablesWidget };
222
+ export { u as useReceivablesWidget };
@@ -16,18 +16,18 @@ import { ReceivableBillingSection as l } from "./index20.js";
16
16
  import "./index21.js";
17
17
  import "./index22.js";
18
18
  import { RECEIVABLE_DETAILS_SECTION as u } from "./index25.js";
19
- import { ReceivableDetailsPanel as d } from "./index34.js";
20
- import "./index35.js";
21
- import { ReceivableFormDialog as f } from "./index38.js";
22
- import { ReceivablePaymentDialog as p } from "./index39.js";
23
- import "./index40.js";
24
- import { ReceivablePreview as m } from "./index43.js";
25
- import "./index44.js";
26
- import { ReceivableRecurrenceEmailDialog as h } from "./index45.js";
27
- import { ReceivableRecurrenceSection as g } from "./index47.js";
28
- import "./index48.js";
29
- import { ReceivableRemindersSection as _ } from "./index49.js";
30
- import { ReceivableSendDialog as v } from "./index50.js";
31
- import { ReceivablesScreen as y } from "./index52.js";
32
- import { UnsavedInvoiceDialog as b } from "./index53.js";
19
+ import { ReceivableDetailsPanel as d } from "./index37.js";
20
+ import "./index38.js";
21
+ import { ReceivableFormDialog as f } from "./index41.js";
22
+ import { ReceivablePaymentDialog as p } from "./index42.js";
23
+ import "./index43.js";
24
+ import { ReceivablePreview as m } from "./index46.js";
25
+ import "./index47.js";
26
+ import { ReceivableRecurrenceEmailDialog as h } from "./index48.js";
27
+ import { ReceivableRecurrenceSection as g } from "./index50.js";
28
+ import "./index51.js";
29
+ import { ReceivableRemindersSection as _ } from "./index52.js";
30
+ import { ReceivableSendDialog as v } from "./index53.js";
31
+ import { ReceivablesScreen as y } from "./index55.js";
32
+ import { UnsavedInvoiceDialog as b } from "./index56.js";
33
33
  export { t as InvoicesFilterBar, e as InvoicesFilterField, u as RECEIVABLE_DETAILS_SECTION, s as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, c as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE, r as RECEIVABLE_STATUS_BADGE_LABELS_EN, i as ReceivableActionDialog, n as ReceivableActionsModal, o as ReceivableAttachmentsSection, a as ReceivableBankAccountSection, l as ReceivableBillingSection, d as ReceivableDetailsPanel, f as ReceivableFormDialog, p as ReceivablePaymentDialog, m as ReceivablePreview, h as ReceivableRecurrenceEmailDialog, g as ReceivableRecurrenceSection, _ as ReceivableRemindersSection, v as ReceivableSendDialog, y as ReceivablesScreen, b as UnsavedInvoiceDialog };
@@ -13,7 +13,7 @@ var r = {
13
13
  partially_paid: "Partially paid",
14
14
  paid: "Paid",
15
15
  overdue: "Overdue",
16
- uncollectible: "Written off",
16
+ uncollectible: "Uncollectible",
17
17
  canceled: "Cancelled",
18
18
  deleted: "Deleted",
19
19
  unknown: "Unknown"
@@ -63,7 +63,6 @@ var r = {
63
63
  customerDescription: "Who are you billing?",
64
64
  customerEmailLabel: "Email",
65
65
  addCustomerDetailsButton: "Add more details including address, phone, etc.",
66
- issueDateLabel: "Issue date",
67
66
  dueDateLabel: "Due date",
68
67
  lineItemsHeading: "Products and services",
69
68
  lineItemsDescription: "Add the products and services on this invoice. You'll have the option to save new items to your inventory.",
@@ -142,9 +141,7 @@ var r = {
142
141
  reminderSaveButton: "Save"
143
142
  }, c = {
144
143
  hiddenDescription: "Invoice details",
145
- loadingTitle: "Loading...",
146
- errorTitle: "Invoice not found",
147
- errorDescription: "We could not load this invoice. Please try again.",
144
+ loadingTitle: "Loading invoice details",
148
145
  moreActionsLabel: "More actions",
149
146
  viewPdfButton: "View PDF",
150
147
  closeButton: "Close",
@@ -182,6 +179,7 @@ var r = {
182
179
  noLineItems: "No line items.",
183
180
  editButton: "Edit",
184
181
  issueButton: "Issue",
182
+ issueAndSendButton: "Issue and send",
185
183
  recordPaymentButton: "Record payment",
186
184
  sendButton: "Resend",
187
185
  acceptButton: "Accept",
@@ -11,40 +11,43 @@ function p({ open: p, onOpenChange: m, title: h, description: g, confirmLabel: _
11
11
  return /* @__PURE__ */ d(t, {
12
12
  open: p,
13
13
  onOpenChange: m,
14
- children: /* @__PURE__ */ f(n, { children: [
15
- /* @__PURE__ */ f(a, { children: [/* @__PURE__ */ d(o, { children: h }), /* @__PURE__ */ d(r, {
16
- className: "ttw:whitespace-pre-line",
17
- children: g
18
- })] }),
19
- C !== void 0 && /* @__PURE__ */ f("div", {
20
- className: "ttw:flex ttw:flex-col ttw:gap-2",
21
- children: [/* @__PURE__ */ d(s, {
22
- htmlFor: k,
23
- children: O.commentLabel
24
- }), /* @__PURE__ */ d(c, {
25
- id: k,
26
- rows: 3,
27
- placeholder: O.commentPlaceholder,
28
- value: C,
29
- onChange: (e) => w?.(e.target.value)
30
- })]
31
- }),
32
- x && /* @__PURE__ */ d("p", {
33
- role: "alert",
34
- className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
35
- children: x
36
- }),
37
- /* @__PURE__ */ f(i, { children: [/* @__PURE__ */ d(e, {
38
- variant: y,
39
- onClick: E,
40
- children: v ?? O.cancelButton
41
- }), /* @__PURE__ */ d(e, {
42
- variant: b ? "destructive" : "default",
43
- loading: S,
44
- onClick: T,
45
- children: _ ?? O.confirmButton
46
- })] })
47
- ] })
14
+ children: /* @__PURE__ */ f(n, {
15
+ className: "ttw:flex ttw:flex-col ttw:gap-6",
16
+ children: [
17
+ /* @__PURE__ */ f(a, { children: [/* @__PURE__ */ d(o, { children: h }), /* @__PURE__ */ d(r, {
18
+ className: "ttw:whitespace-pre-line",
19
+ children: g
20
+ })] }),
21
+ C !== void 0 && /* @__PURE__ */ f("div", {
22
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
23
+ children: [/* @__PURE__ */ d(s, {
24
+ htmlFor: k,
25
+ children: O.commentLabel
26
+ }), /* @__PURE__ */ d(c, {
27
+ id: k,
28
+ rows: 3,
29
+ placeholder: O.commentPlaceholder,
30
+ value: C,
31
+ onChange: (e) => w?.(e.target.value)
32
+ })]
33
+ }),
34
+ x && /* @__PURE__ */ d("p", {
35
+ role: "alert",
36
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
37
+ children: x
38
+ }),
39
+ /* @__PURE__ */ f(i, { children: [/* @__PURE__ */ d(e, {
40
+ variant: y,
41
+ onClick: E,
42
+ children: v ?? O.cancelButton
43
+ }), /* @__PURE__ */ d(e, {
44
+ variant: b ? "destructive" : "default",
45
+ loading: S,
46
+ onClick: T,
47
+ children: _ ?? O.confirmButton
48
+ })] })
49
+ ]
50
+ })
48
51
  });
49
52
  }
50
53
  //#endregion
@@ -8,17 +8,32 @@ var i = {
8
8
  neutral: "ttw:border-border ttw:bg-muted ttw:text-foreground ttw:hover:bg-muted",
9
9
  success: "ttw:border-emerald-200 ttw:bg-emerald-50 ttw:text-emerald-700 ttw:hover:bg-emerald-50",
10
10
  warning: "ttw:border-amber-200 ttw:bg-amber-50 ttw:text-amber-800 ttw:hover:bg-amber-50"
11
+ }, a = "ttw:bg-muted ttw:text-muted-foreground", o = "ttw:bg-destructive/10 ttw:text-destructive", s = {
12
+ draft: a,
13
+ recurring: a,
14
+ issuing: "ttw:bg-cyan-100 ttw:text-cyan-700",
15
+ issued: "ttw:bg-cyan-100 ttw:text-cyan-700",
16
+ accepted: "ttw:bg-green-100 ttw:text-green-700",
17
+ paid: "ttw:bg-green-100 ttw:text-green-700",
18
+ partially_paid: "ttw:bg-purple-100 ttw:text-purple-700",
19
+ overdue: "ttw:bg-orange-100 ttw:text-orange-700",
20
+ failed: o,
21
+ expired: o,
22
+ uncollectible: o,
23
+ canceled: o,
24
+ declined: o,
25
+ deleted: o
11
26
  };
12
- function a({ status: a, label: o, tone: s, labels: c, icon: l }) {
13
- let u = {
27
+ function c({ status: o, label: c, tone: l = "neutral", variant: u = "outline", labels: d, icon: f }) {
28
+ let p = {
14
29
  ...n,
15
- ...c
16
- }, d = o ?? u[a] ?? u.unknown;
30
+ ...d
31
+ }, m = c ?? p[o] ?? p.unknown;
17
32
  return /* @__PURE__ */ r(e, {
18
33
  variant: "outline",
19
- className: t(l && "ttw:gap-1", i[s]),
20
- children: [l, d]
34
+ className: t(f && "ttw:gap-1", u === "filled" ? ["ttw:border-transparent", s[o ?? ""] ?? a] : i[l]),
35
+ children: [f, m]
21
36
  });
22
37
  }
23
38
  //#endregion
24
- export { a as ReceivableStatusBadge, a as default };
39
+ export { c as ReceivableStatusBadge, c as default };
@@ -1,8 +1,9 @@
1
- import { Ban as e, CalendarX2 as t, Check as n, ChevronsRight as r, CircleCheck as i, CircleSlash as a, CircleX as o, ClipboardCheck as s, Clock as c, CopyPlus as l, Mail as u, Pause as d, PenTool as f, Pencil as p, Play as m, Trash2 as h } from "lucide-react";
1
+ import { Ban as e, CalendarX2 as t, Check as n, ChevronsRight as r, CircleCheck as i, CircleOff as a, CircleX as o, ClipboardCheck as s, Clock as c, CopyPlus as l, FileCheck as u, Mail as d, Pause as f, PenTool as p, Pencil as m, Play as h, Send as g, Trash2 as _ } from "lucide-react";
2
2
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js
3
- var g = {
3
+ var v = {
4
4
  edit: "editButton",
5
5
  issue: "issueButton",
6
+ issueAndSend: "issueAndSendButton",
6
7
  recordPayment: "recordPaymentButton",
7
8
  send: "sendButton",
8
9
  accept: "acceptButton",
@@ -15,39 +16,40 @@ var g = {
15
16
  pauseRecurrence: "pauseRecurrenceButton",
16
17
  resumeRecurrence: "resumeRecurrenceButton",
17
18
  cancelRecurrence: "cancelRecurrenceButton"
18
- }, _ = {
19
- edit: p,
19
+ }, y = {
20
+ edit: m,
20
21
  issue: u,
22
+ issueAndSend: g,
21
23
  recordPayment: s,
22
- send: u,
24
+ send: d,
23
25
  accept: i,
24
26
  decline: o,
25
27
  markPaid: i,
26
28
  markUncollectible: a,
27
29
  cancel: e,
28
30
  clone: l,
29
- delete: h,
30
- pauseRecurrence: d,
31
- resumeRecurrence: m,
31
+ delete: _,
32
+ pauseRecurrence: f,
33
+ resumeRecurrence: h,
32
34
  cancelRecurrence: t
33
- }, v = {
34
- draft: f,
35
+ }, b = {
36
+ draft: p,
35
37
  issuing: c,
36
38
  issued: c,
37
39
  partially_paid: c,
38
40
  paid: n,
39
41
  overdue: c,
40
42
  canceled: e
41
- }, y = {
43
+ }, x = {
42
44
  forward: r,
43
- pause: d,
45
+ pause: f,
44
46
  ban: e,
45
47
  check: n
46
- }, b = {
48
+ }, S = {
47
49
  default: "ttw:text-foreground",
48
50
  danger: "ttw:text-red-600",
49
51
  success: "ttw:text-emerald-600",
50
52
  muted: "ttw:text-muted-foreground"
51
- }, x = "ttw:bg-muted ttw:text-muted-foreground ttw:hover:bg-accent";
53
+ }, C = "ttw:group ttw:cursor-pointer ttw:hover:no-underline", w = "ttw:translate-y-0.5", T = "ttw:border-border", E = "ttw:rounded-full ttw:bg-muted ttw:text-muted-foreground", D = "ttw:bg-primary ttw:text-primary-foreground", O = "ttw:bg-primary ttw:fill-primary", k = "ttw:bg-muted ttw:text-muted-foreground ttw:hover:bg-accent", A = (e) => e.preventDefault();
52
54
  //#endregion
53
- export { _ as ACTION_ICON, g as ACTION_LABEL_KEY, y as SERIES_STATUS_ICON, v as STATUS_ICON, b as amountValueToneClass, x as headerIconButtonClass };
55
+ export { y as ACTION_ICON, v as ACTION_LABEL_KEY, x as SERIES_STATUS_ICON, b as STATUS_ICON, S as amountValueToneClass, k as headerIconButtonClass, O as headerTooltipArrowClass, D as headerTooltipClass, A as preventTooltipFocusOpen, w as sectionChevronClass, E as sectionCountBadgeClass, T as sectionItemClass, C as sectionTriggerClass };
@@ -1,19 +1,23 @@
1
- import { cn as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { amountValueToneClass as t } from "./index23.js";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
1
+ import { Typography as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { amountValueToneClass as n } from "./index23.js";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js
5
- function i({ row: i, defaultTone: a }) {
6
- let o = i.tone ?? (i.emphasis ? a : "default");
7
- return /* @__PURE__ */ r("div", {
5
+ function a({ row: a, defaultTone: o }) {
6
+ let s = a.tone ?? (a.emphasis ? o : "default");
7
+ return /* @__PURE__ */ i("div", {
8
8
  className: "ttw:flex ttw:flex-col ttw:gap-0.5",
9
- children: [/* @__PURE__ */ n("span", {
10
- className: "ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
11
- children: i.label
12
- }), /* @__PURE__ */ n("span", {
13
- className: e(i.emphasis ? "ttw:text-2xl ttw:font-semibold" : "ttw:text-base ttw:font-medium", t[o]),
14
- children: i.value
9
+ children: [/* @__PURE__ */ r(e, {
10
+ variant: "caption",
11
+ color: "muted",
12
+ className: "ttw:font-medium",
13
+ children: a.label
14
+ }), /* @__PURE__ */ r(e, {
15
+ component: "span",
16
+ variant: a.emphasis ? "h3" : "body1",
17
+ className: t(!a.emphasis && "ttw:font-medium", n[s]),
18
+ children: a.value
15
19
  })]
16
20
  });
17
21
  }
18
22
  //#endregion
19
- export { i as AmountCell };
23
+ export { a as AmountCell };