@tesouro/embedded-components-react 0.11.235 → 0.11.236

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 (75) hide show
  1. package/README.md +2 -2
  2. package/dist/index.css +12 -0
  3. package/dist/index.d.ts +24 -0
  4. package/dist/lib/ReceivablesWidget.d.ts +24 -0
  5. package/dist/lib/WidgetSuite.d.ts +24 -0
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +6 -6
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +198 -118
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +76 -194
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +67 -75
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +111 -69
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +459 -108
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +101 -449
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +9 -117
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +85 -8
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +67 -73
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +246 -71
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +40 -251
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +237 -38
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +21 -244
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +529 -21
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +4 -530
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +44 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +242 -41
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +3 -245
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +5 -3
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +63 -4
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +1 -64
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +386 -354
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +1 -0
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +1 -1
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +260 -258
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +219 -179
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +26 -25
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +15 -0
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +31 -40
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -17
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +40 -8
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +30 -63
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +463 -27
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +15 -29
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +8 -18
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +18 -18
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +19 -30
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +15 -66
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +66 -391
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +148 -2
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +173 -43
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +3 -71
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +37 -432
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +66 -188
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +455 -22
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +191 -5
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +23 -0
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +5 -265
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +261 -125
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +2 -27
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +122 -230
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +27 -3
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +216 -224
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +3 -30
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +228 -168
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +29 -21
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +152 -109
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +22 -2
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +140 -43
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +2 -0
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index65.js +47 -0
  70. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/document-preview.js +1 -0
  71. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  72. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/document/documentPreview.js +122 -0
  73. package/package.json +1 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +0 -1
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +0 -2
@@ -2,125 +2,136 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
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";
5
+ import { toast as e } from "../../../../../../../node_modules/sonner/dist/index.js";
6
+ import { hasAnyScope as t } from "../../../../../shared/data-access/dist/lib/hasAnyScope.js";
7
+ import { Scope as n } from "../../../../../shared/data-access/dist/lib/scopes.js";
7
8
  import "../../../../../shared/data-access/dist/index.js";
8
- import { useRefetchWidget as n, useWidgetConfig as r, useWidgetError as i, useWidgetInitStaleForToken as ee, useWidgetLoading as te } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
+ import "../../../../../shared/ui/dist/index.js";
10
+ import { useRefetchWidget as r, useWidgetConfig as i, useWidgetError as ee, useWidgetInitStaleForToken as te, useWidgetLoading as ne } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
11
  import "../../../../../shared/feature/dist/index.js";
10
- import { RECEIVABLE_STATUS_BADGE_LABELS_EN as ne } from "../../../../../shared/document-status/ui/dist/index6.js";
12
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as re } from "../../../../../shared/document-status/ui/dist/index6.js";
11
13
  import "../../../../../shared/document-status/ui/dist/index.js";
12
- import { getDocumentTitle as re } from "./helpers.js";
13
- import { hasSelectedText as a } from "../../../../../shared/product-catalog/feature/dist/lib/helpers.js";
14
+ import { getDocumentTitle as a } from "./helpers.js";
15
+ import { hasSelectedText as ie } from "../../../../../shared/product-catalog/feature/dist/lib/helpers.js";
14
16
  import "../../../../../shared/product-catalog/feature/dist/index.js";
15
- import { getCreateFollowUp as ie } from "./actionsModal.js";
16
- import { RECEIVABLE_MESSAGE_LABELS_EN as ae } from "./labels.js";
17
- import { getReceivablePermissions as oe } from "./permissions.js";
18
- import { useReceivableActions as se } from "./useReceivableActions.js";
19
- import { useReceivableActionsModal as ce } from "./useReceivableActionsModal.js";
20
- import { useReceivableDetails as le } from "./useReceivableDetails.js";
21
- import { useReceivableForm as ue } from "./useReceivableForm.js";
22
- import { useReceivablesTable as de } from "./useReceivablesTable.js";
23
- import { useRecurringSeriesTable as fe } from "./useRecurringSeriesTable.js";
17
+ import { getCreateFollowUp as ae } from "./actionsModal.js";
18
+ import { RECEIVABLE_MESSAGE_LABELS_EN as oe } from "./labels.js";
19
+ import { getReceivablePermissions as se } from "./permissions.js";
20
+ import { useReceivableActions as ce } from "./useReceivableActions.js";
21
+ import { useReceivableActionsModal as le } from "./useReceivableActionsModal.js";
22
+ import { useReceivableDetails as ue } from "./useReceivableDetails.js";
23
+ import { useReceivableForm as de } from "./useReceivableForm.js";
24
+ import { useReceivablesTable as fe } from "./useReceivablesTable.js";
25
+ import { useRecurringSeriesTable as pe } from "./useRecurringSeriesTable.js";
24
26
  import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
25
27
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js
26
- function pe({ auditHistoryLabels: pe, counterpartMessageLabels: me, embeddedBankName: he, filterLabels: ge, initialCounterpartId: f, initialView: p, messageLabels: _e, onReceivableCreated: ve, onReceivableOpened: m, onStatusCardChange: ye, pageSizeOptions: h, screenLabels: be, selectedStatusCard: xe, isRecurringTabActive: Se = !1 }) {
27
- let { initResponse: g, widgetToken: Ce } = r(), we = te(), Te = i(), _ = n(), v = ee(), y = !!g && !v, b = c(() => oe(g?.scopes), [g?.scopes]), Ee = !!g && v, x = !!g && b.canRead, S = !!g && b.canWrite, C = y && b.canRead, w = y && b.canWrite, T = !!Te && !y && !we, E = !y && !T && !!(Ce || we), D = c(() => ({
28
- ...ae,
28
+ function d({ auditHistoryLabels: d, counterpartMessageLabels: me, embeddedBankName: he, filterLabels: ge, initialCounterpartId: p, initialView: m, messageLabels: _e, onReceivableCreated: ve, onReceivableOpened: h, onStatusCardChange: ye, pageSizeOptions: be, screenLabels: xe, selectedStatusCard: Se, isRecurringTabActive: Ce = !1 }) {
29
+ let { initResponse: g, widgetToken: we } = i(), Te = ne(), Ee = ee(), De = r(), Oe = te(), _ = !!g && !Oe, v = c(() => se(g?.scopes), [g?.scopes]), ke = !!g && Oe, y = !!g && v.canRead, b = !!g && v.canWrite, x = _ && v.canRead, S = _ && v.canWrite, C = !!Ee && !_ && !Te, w = !_ && !C && !!(we || Te), T = c(() => ({
30
+ ...oe,
29
31
  ..._e
30
- }), [_e]), O = be?.statusBadge, k = c(() => ({
31
- ...ne,
32
- ...O
33
- }), [O]), [A, j] = u(), [M, N] = u(!1), [P, De] = u(A);
34
- A && A !== P && De(A);
35
- let [F, I] = u(!1), [Oe, L] = u(), [ke, R] = u(!1), Ae = o((e) => {
36
- R(!0), L(e);
37
- }, []), je = o((e) => {
38
- R(!1), L(e);
39
- }, []), z = e(g?.scopes, [t.CounterpartReadOrg]), Me = o(() => L(void 0), []), [B, V] = u(!1), Ne = o(() => V(!0), []), H = o(() => V(!1), []), Pe = o((e) => {
40
- j(e), N(!0);
41
- }, []), U = ce({ messages: D }), W = U.open, Fe = o((e, t, n) => {
42
- let r = ie(n);
43
- r.openDetails && (j(e), N(!0)), r.actionsModal && W({
32
+ }), [_e]), E = xe?.statusBadge, D = c(() => ({
33
+ ...re,
34
+ ...E
35
+ }), [E]), [O, k] = u(), [A, j] = u(!1), [M, Ae] = u(O);
36
+ O && O !== M && Ae(O);
37
+ let [N, P] = u(!1), [je, Me] = u("screen"), [Ne, F] = u(), [Pe, Fe] = u(!1), Ie = o((e) => {
38
+ Fe(!0), F(e);
39
+ }, []), Le = o((e) => {
40
+ Fe(!1), F(e);
41
+ }, []), Re = t(g?.scopes, [n.CounterpartReadOrg]), ze = o(() => F(void 0), []), [Be, Ve] = u(!1), He = o(() => Ve(!0), []), I = o(() => Ve(!1), []), Ue = o((e) => {
42
+ k(e), j(!0);
43
+ }, []), L = le({ messages: T }), R = L.open, We = o((e, t, n) => {
44
+ let r = ae(n);
45
+ r.openDetails && (k(e), j(!0)), r.actionsModal && R({
44
46
  action: n.mode,
45
47
  receivableId: e,
46
48
  counterpartId: n.counterpartId,
47
49
  inlineItems: n.inlineItems,
48
50
  showEmailStep: r.actionsModal.showEmailStep
49
51
  }), ve?.(e, t);
50
- }, [ve, W]), G = de({
51
- initialCounterpartId: p === "create" ? void 0 : f,
52
- selectedStatusCard: xe,
52
+ }, [ve, R]), z = fe({
53
+ initialCounterpartId: m === "create" ? void 0 : p,
54
+ selectedStatusCard: Se,
53
55
  onStatusCardChange: ye,
54
- messages: D,
55
- statusLabels: k,
56
+ messages: T,
57
+ statusLabels: D,
56
58
  filterLabels: ge,
57
- pageSizeOptions: h,
58
- enabled: C,
59
- visible: x
60
- }), K = fe({
61
- messages: D,
59
+ pageSizeOptions: be,
60
+ enabled: x,
61
+ visible: y
62
+ }), B = pe({
63
+ messages: T,
62
64
  filterLabels: ge,
63
- pageSizeOptions: h,
64
- enabled: C && Se
65
- }), q = o((e) => {
66
- j(e), N(!0), m?.(e, "invoice");
67
- }, [m]), J = le({
68
- selectedReceivableId: A,
69
- enabled: M && C,
70
- canWrite: S,
71
- messages: D,
72
- statusLabels: k,
73
- auditHistoryLabels: pe,
74
- onOpenReceivable: q,
75
- onOpenCustomer: z ? Ae : void 0
76
- }), Y = l("edit"), Ie = o((e, t, n) => {
77
- let r = n.mode === "issue", i = r && Y.current !== "issue" && n.hasCustomerEmail;
78
- (i || n.inlineItems.length !== 0) && W({
65
+ pageSizeOptions: be,
66
+ enabled: x && Ce
67
+ }), V = o((e) => {
68
+ k(e), j(!0), h?.(e, "invoice");
69
+ }, [h]), H = ue({
70
+ selectedReceivableId: O,
71
+ enabled: A && x,
72
+ canWrite: b,
73
+ messages: T,
74
+ statusLabels: D,
75
+ auditHistoryLabels: d,
76
+ onOpenReceivable: V,
77
+ onOpenCustomer: Re ? Ie : void 0
78
+ }), U = l("edit"), Ge = o((e, t, n) => {
79
+ let r = n.mode === "issue";
80
+ r && (k(e), P(!0));
81
+ let i = r && U.current !== "issue" && n.hasCustomerEmail;
82
+ (i || n.inlineItems.length !== 0) && R({
79
83
  action: r || n.mode === "recurrence" ? n.mode : "update",
80
84
  receivableId: e,
81
85
  counterpartId: n.counterpartId,
82
86
  inlineItems: n.inlineItems,
83
87
  showEmailStep: i
84
88
  });
85
- }, [W]), X = ue({
86
- messages: D,
89
+ }, [R]), W = de({
90
+ messages: T,
87
91
  counterpartMessageLabels: me,
88
92
  embeddedBankName: he,
89
- canCreateCustomer: b.canCreateCustomer,
90
- onCreated: Fe,
91
- onUpdated: Ie
92
- }), { openCreate: Z, openEdit: Le } = X, Re = o(() => {
93
- w && Z("invoice");
94
- }, [w, Z]), ze = o(() => {
95
- w && Z("invoice", { recurring: !0 });
96
- }, [w, Z]), Be = l(!1);
93
+ canCreateCustomer: v.canCreateCustomer,
94
+ onCreated: We,
95
+ onUpdated: Ge
96
+ }), { openCreate: G, openEdit: K } = W, { open: q, close: J } = W, Ke = o((e, t, n) => {
97
+ q && n.status === "draft" ? (k(e), K(n)) : (q && J(), Ue(e));
98
+ }, [
99
+ J,
100
+ Ue,
101
+ q,
102
+ K
103
+ ]), qe = o(() => {
104
+ S && G("invoice");
105
+ }, [S, G]), Je = o(() => {
106
+ S && G("invoice", { recurring: !0 });
107
+ }, [S, G]), Ye = l(!1);
97
108
  s(() => {
98
- Be.current || p === "create" && w && (Be.current = !0, Z("invoice", { customerId: f }));
109
+ Ye.current || m === "create" && S && (Ye.current = !0, G("invoice", { customerId: p }));
99
110
  }, [
100
- w,
101
- Z,
102
- f,
103
- p
111
+ S,
112
+ G,
113
+ p,
114
+ m
104
115
  ]);
105
- let Q = se({
106
- selectedReceivable: J.receivable,
107
- selectedRecurrence: J.recurrence,
108
- messages: D,
109
- onCreated: Pe,
116
+ let Y = ce({
117
+ selectedReceivable: H.receivable,
118
+ selectedRecurrence: H.recurrence,
119
+ messages: T,
120
+ onCreated: Ke,
110
121
  onDeleted: (e) => {
111
- e === A && (j(void 0), N(!1));
122
+ e === O && (k(void 0), j(!1)), e === W.editingReceivable?.id && (P(!1), W.close());
112
123
  },
113
124
  onCompleteBeforeIssue: (e, t) => {
114
- Y.current = t, X.openEdit(e, { highlightForIssue: !0 }), M && I(!0), N(!1);
125
+ U.current = t, K(e, { highlightForIssue: !0 }), A && P(!0), j(!1);
115
126
  },
116
- onIssuedForSend: (e, t) => W({
127
+ onIssuedForSend: (e, t) => R({
117
128
  action: "issue",
118
129
  receivableId: e,
119
130
  counterpartId: t,
120
131
  inlineItems: [],
121
132
  showEmailStep: !0
122
133
  }),
123
- onResend: (e, t) => W({
134
+ onResend: (e, t) => R({
124
135
  action: "issue",
125
136
  receivableId: e,
126
137
  counterpartId: t,
@@ -130,136 +141,165 @@ function pe({ auditHistoryLabels: pe, counterpartMessageLabels: me, embeddedBank
130
141
  })
131
142
  });
132
143
  s(() => {
133
- X.open || (Y.current = "edit");
134
- }, [X.open]), s(() => {
135
- X.open || U.isOpen || !F || (I(!1), N(!0));
144
+ W.open || (U.current = "edit");
145
+ }, [W.open]), s(() => {
146
+ W.open || L.isOpen || !N || (P(!1), j(!0));
136
147
  }, [
137
- U.isOpen,
138
- X.open,
139
- F
148
+ L.isOpen,
149
+ W.open,
150
+ N
140
151
  ]);
141
- let Ve = y && !b.canWrite, He = X.open || X.counterpartView !== "none" || !!Q.actionTarget || Q.payment.isOpen || U.isOpen || B, Ue = X.close, We = X.counterpartForm.close, { closeAction: Ge } = Q, Ke = Q.payment.close, qe = U.close;
152
+ let Xe = _ && !v.canWrite, Ze = W.open || W.counterpartView !== "none" || !!Y.actionTarget || Y.payment.isOpen || L.isOpen || Be, Qe = W.counterpartForm.close, { closeAction: $e } = Y, et = Y.payment.close, X = L.close;
142
153
  s(() => {
143
- Ve && He && (Ue(), We(), Ge(), Ke(), qe(), H());
154
+ Xe && Ze && (J(), Qe(), $e(), et(), X(), I());
144
155
  }, [
145
- Ge,
146
- qe,
147
- We,
148
- Ue,
149
- H,
150
- Ke,
151
- He,
152
- Ve
156
+ $e,
157
+ X,
158
+ Qe,
159
+ J,
160
+ I,
161
+ et,
162
+ Ze,
163
+ Xe
153
164
  ]);
154
- let Je = o((e) => {
155
- a() || (j(e.id), N(!0), m?.(e.id, e.type));
156
- }, [m]), Ye = o((e) => {
157
- a() || q(e.id);
158
- }, [q]), $ = o(() => {
159
- N(!1), j(void 0), L(void 0);
160
- }, []), { showCustomer: Xe } = G, Ze = o((e) => {
161
- $(), Xe(e.id);
162
- }, [$, Xe]), Qe = o((e) => {
163
- w && ($(), Z("invoice", { customerId: e.id }));
165
+ let { getReceivableById: tt } = z, nt = o((e) => {
166
+ if (ie()) return;
167
+ let t = S && e.status === "draft" ? tt(e.id) : void 0;
168
+ t ? (U.current = "edit", K(t)) : (k(e.id), j(!0)), h?.(e.id, e.type);
169
+ }, [
170
+ S,
171
+ tt,
172
+ h,
173
+ K
174
+ ]), rt = o(() => Me("screen"), []), it = o(() => Me("sheet"), []), at = o((e) => {
175
+ ie() || V(e.id);
176
+ }, [V]), Z = o(() => {
177
+ j(!1), k(void 0), F(void 0);
178
+ }, []), { showCustomer: ot } = z, st = o((e) => {
179
+ Z(), ot(e.id);
180
+ }, [Z, ot]), ct = o((e) => {
181
+ S && (Z(), G("invoice", { customerId: e.id }));
164
182
  }, [
165
- w,
166
- $,
167
- Z
168
- ]), $e = o((e, t) => {
169
- w && (e === "edit" ? J.receivable && (Y.current = "edit", Le(J.receivable), I(!0), N(!1)) : Q.openAction(e, {
183
+ S,
184
+ Z,
185
+ G
186
+ ]), lt = o((e, t) => {
187
+ S && (e === "edit" ? H.receivable && (U.current = "edit", K(H.receivable), P(!0), j(!1)) : Y.openAction(e, {
170
188
  id: t.id,
171
- title: J.receivable ? re(J.receivable, D) : t.title,
189
+ title: H.receivable ? a(H.receivable, T) : t.title,
172
190
  type: t.type
173
- }, J.receivable ?? null));
191
+ }, H.receivable ?? null));
174
192
  }, [
175
- Q,
176
- w,
177
- J.receivable,
178
- Le,
179
- D
180
- ]);
193
+ Y,
194
+ S,
195
+ H.receivable,
196
+ K,
197
+ T
198
+ ]), Q = S && W.editingReceivable?.status === "draft" ? W.editingReceivable : void 0, ut = Q && {
199
+ disabled: Y.pendingActions.includes("clone") || !!W.attachmentsUploading,
200
+ onClone: () => {
201
+ W.hasPendingChanges() ? e.error(T.cloneUnsavedChanges) : Y.openAction("clone", dt(Q), null);
202
+ },
203
+ onDelete: () => Y.openAction("delete", dt(Q), null)
204
+ };
205
+ function dt(e) {
206
+ return {
207
+ id: e.id,
208
+ type: "invoice",
209
+ title: a(e, T)
210
+ };
211
+ }
212
+ let $ = A && y;
181
213
  return {
182
- canWrite: S,
183
- canEditSettings: x && b.canEditSettings,
184
- actionsSuspended: Ee,
185
- isAccessRestricted: y && !b.canRead,
186
- table: x ? G : {
187
- ...G,
214
+ canWrite: b,
215
+ canEditSettings: y && v.canEditSettings,
216
+ actionsSuspended: ke,
217
+ isAccessRestricted: _ && !v.canRead,
218
+ table: y ? z : {
219
+ ...z,
188
220
  rows: [],
189
221
  statusCards: void 0,
190
222
  isError: !1
191
223
  },
192
- isTableLoading: x ? G.isLoading || E && G.rows.length === 0 : E,
193
- isError: T || x && G.isError,
194
- onRetry: T ? _ : G.onRetry,
195
- series: x ? K : {
196
- ...K,
224
+ isTableLoading: y ? z.isLoading || w && z.rows.length === 0 : w,
225
+ isError: C || y && z.isError,
226
+ onRetry: C ? De : z.onRetry,
227
+ series: y ? B : {
228
+ ...B,
197
229
  rows: [],
198
230
  isError: !1
199
231
  },
200
- isSeriesLoading: x ? K.isLoading || E && K.rows.length === 0 : E,
201
- isSeriesError: T || x && K.isError,
202
- onSeriesRetry: T ? _ : K.onRetry,
203
- details: J,
204
- detailsOpen: M && x,
205
- closeDetails: $,
206
- detailsPanelKey: P,
207
- customerDetailsId: Oe,
208
- closeCustomerDetails: Me,
209
- openCustomerDetails: z ? je : void 0,
210
- customerDetailsActions: ke ? {
211
- onViewAllDocuments: x ? Ze : void 0,
212
- onCreateDocument: S ? Qe : void 0
232
+ isSeriesLoading: y ? B.isLoading || w && B.rows.length === 0 : w,
233
+ isSeriesError: C || y && B.isError,
234
+ onSeriesRetry: C ? De : B.onRetry,
235
+ details: H,
236
+ detailsOpen: $,
237
+ detailsScreenOpen: $ && je === "screen",
238
+ detailsSheetOpen: $ && je === "sheet",
239
+ expandDetails: rt,
240
+ collapseDetails: it,
241
+ draftMenu: ut,
242
+ onDetailsOpenChange: (e) => {
243
+ e || Z();
244
+ },
245
+ closeDetails: Z,
246
+ detailsPanelKey: M,
247
+ customerDetailsId: Ne,
248
+ closeCustomerDetails: ze,
249
+ openCustomerDetails: Re ? Le : void 0,
250
+ customerDetailsActions: Pe ? {
251
+ onViewAllDocuments: y ? st : void 0,
252
+ onCreateDocument: b ? ct : void 0
213
253
  } : {},
214
254
  customersTabActions: {
215
- onViewAllDocuments: x ? Ze : void 0,
216
- onCreateDocument: S ? Qe : void 0
255
+ onViewAllDocuments: y ? st : void 0,
256
+ onCreateDocument: b ? ct : void 0
217
257
  },
218
- canCreateCustomer: b.canCreateCustomer,
219
- messages: D,
258
+ canCreateCustomer: v.canCreateCustomer,
259
+ messages: T,
220
260
  form: {
221
- ...X,
222
- open: S && X.open,
223
- counterpartView: S ? X.counterpartView : "none",
261
+ ...W,
262
+ open: b && W.open,
263
+ counterpartView: b ? W.counterpartView : "none",
224
264
  counterpartForm: {
225
- ...X.counterpartForm,
226
- submit: d(w, X.counterpartForm.submit)
265
+ ...W.counterpartForm,
266
+ submit: f(S, W.counterpartForm.submit)
227
267
  },
228
- submit: d(w, X.submit),
229
- submitDraft: d(w, X.submitDraft),
230
- submitPrimary: d(w, X.submitPrimary)
268
+ submit: f(S, W.submit),
269
+ submitDraft: f(S, W.submitDraft),
270
+ submitPrimary: f(S, W.submitPrimary)
231
271
  },
232
- openCreate: Re,
233
- openCreateRecurring: ze,
234
- measureUnitsOpen: S && B,
235
- openMeasureUnits: Ne,
236
- closeMeasureUnits: H,
272
+ openCreate: qe,
273
+ openCreateRecurring: Je,
274
+ measureUnitsOpen: b && Be,
275
+ openMeasureUnits: He,
276
+ closeMeasureUnits: I,
237
277
  actions: {
238
- ...Q,
239
- actionDialog: S ? Q.actionDialog : void 0,
240
- openAction: d(w, Q.openAction),
241
- confirmAction: d(w, Q.confirmAction),
278
+ ...Y,
279
+ actionDialog: b ? Y.actionDialog : void 0,
280
+ openAction: f(S, Y.openAction),
281
+ confirmAction: f(S, Y.confirmAction),
242
282
  payment: {
243
- ...Q.payment,
244
- isOpen: S && Q.payment.isOpen,
245
- save: d(w, Q.payment.save),
246
- confirm: d(w, Q.payment.confirm)
283
+ ...Y.payment,
284
+ isOpen: b && Y.payment.isOpen,
285
+ save: f(S, Y.payment.save),
286
+ confirm: f(S, Y.payment.confirm)
247
287
  }
248
288
  },
249
289
  actionsModal: {
250
- ...U,
251
- isOpen: S && U.isOpen,
252
- send: d(w, U.send),
253
- saveItems: d(w, U.saveItems)
290
+ ...L,
291
+ isOpen: b && L.isOpen,
292
+ send: f(S, L.send),
293
+ saveItems: f(S, L.saveItems)
254
294
  },
255
- handleRowClick: Je,
256
- handleSeriesRowClick: Ye,
257
- handleDetailsActionClick: $e
295
+ handleRowClick: nt,
296
+ handleSeriesRowClick: at,
297
+ handleDetailsActionClick: lt
258
298
  };
259
299
  }
260
- function d(e, t) {
300
+ function f(e, t) {
261
301
  return (...n) => {
262
302
  e && t(...n);
263
303
  };
264
304
  }
265
- export { pe as useReceivablesWidget };
305
+ export { d as useReceivablesWidget };
@@ -12,31 +12,32 @@ import "./index15.js";
12
12
  import "./index16.js";
13
13
  import "./index17.js";
14
14
  import "./index18.js";
15
- import "./index19.js";
16
- import { ReceivableActionDialog as o } from "./index20.js";
17
- import { ReceivableBankAccountSection as s } from "./index21.js";
18
- import { ReceivableAttachmentsSection as c } from "./index22.js";
19
- import { RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE as l, RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as u } from "./index25.js";
20
- import { ReceivableBillingSection as d } from "./index26.js";
15
+ import { RECEIVABLE_DETAILS_PANEL_LABELS_EN as o } from "./index19.js";
16
+ import { ReceivableActionDialog as s } from "./index20.js";
17
+ import { ReceivableBankAccountSection as c } from "./index21.js";
18
+ import { ReceivableAttachmentsSection as l } from "./index22.js";
19
+ import { RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE as u, RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as d } from "./index25.js";
20
+ import { ReceivableBillingSection as f } from "./index26.js";
21
21
  import "./index27.js";
22
- import { ReceivableCustomerSection as f } from "./index28.js";
22
+ import { ReceivableCustomerSection as p } from "./index28.js";
23
23
  import "./index29.js";
24
24
  import "./index30.js";
25
- import { RECEIVABLE_DETAILS_SECTION as p } from "./index34.js";
26
- import { ReceivableDetailsPanel as m } from "./index42.js";
27
- import "./index43.js";
28
- import { ReceivableFormDialog as h } from "./index46.js";
29
- import { ReceivablePaymentDialog as g } from "./index47.js";
30
- import "./index48.js";
31
- import { ReceivablePreview as _ } from "./index51.js";
32
- import "./index52.js";
33
- import { ReceivableRecurrenceEmailDialog as v } from "./index53.js";
34
- import { ReceivableRecurrenceSection as y } from "./index55.js";
35
- import "./index56.js";
36
- import { ReceivableRemindersSection as b } from "./index57.js";
37
- import { ReceivablesScreen as x } from "./index59.js";
38
- import { RECURRING_SERIES_SCREEN_LABELS_EN as S } from "./index60.js";
39
- import { RecurringSeriesScreen as C } from "./index61.js";
40
- import "./index62.js";
41
- import { UnsavedInvoiceDialog as w } from "./index63.js";
42
- export { n as INVOICING_TABS_LABELS_EN, t as InvoicesFilterBar, e as InvoicesFilterField, r as InvoicingHeader, i as InvoicingTabs, p as RECEIVABLE_DETAILS_SECTION, l as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, u as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE, S as RECURRING_SERIES_SCREEN_LABELS_EN, o as ReceivableActionDialog, a as ReceivableActionsModal, c as ReceivableAttachmentsSection, s as ReceivableBankAccountSection, d as ReceivableBillingSection, f as ReceivableCustomerSection, m as ReceivableDetailsPanel, h as ReceivableFormDialog, g as ReceivablePaymentDialog, _ as ReceivablePreview, v as ReceivableRecurrenceEmailDialog, y as ReceivableRecurrenceSection, b as ReceivableRemindersSection, x as ReceivablesScreen, C as RecurringSeriesScreen, w as UnsavedInvoiceDialog };
25
+ import { RECEIVABLE_DETAILS_SECTION as m } from "./index38.js";
26
+ import { ReceivableDetailsPanel as h } from "./index43.js";
27
+ import { ReceivableDetailsScreen as g } from "./index44.js";
28
+ import "./index45.js";
29
+ import { ReceivableFormDialog as _ } from "./index48.js";
30
+ import { ReceivablePaymentDialog as v } from "./index49.js";
31
+ import "./index50.js";
32
+ import { ReceivablePreview as y } from "./index53.js";
33
+ import "./index54.js";
34
+ import { ReceivableRecurrenceEmailDialog as b } from "./index55.js";
35
+ import { ReceivableRecurrenceSection as x } from "./index57.js";
36
+ import "./index58.js";
37
+ import { ReceivableRemindersSection as S } from "./index59.js";
38
+ import { ReceivablesScreen as C } from "./index61.js";
39
+ import { RECURRING_SERIES_SCREEN_LABELS_EN as w } from "./index62.js";
40
+ import { RecurringSeriesScreen as T } from "./index63.js";
41
+ import "./index64.js";
42
+ import { UnsavedInvoiceDialog as E } from "./index65.js";
43
+ export { n as INVOICING_TABS_LABELS_EN, t as InvoicesFilterBar, e as InvoicesFilterField, r as InvoicingHeader, i as InvoicingTabs, o as RECEIVABLE_DETAILS_PANEL_LABELS_EN, m as RECEIVABLE_DETAILS_SECTION, u as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, d as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE, w as RECURRING_SERIES_SCREEN_LABELS_EN, s as ReceivableActionDialog, a as ReceivableActionsModal, l as ReceivableAttachmentsSection, c as ReceivableBankAccountSection, f as ReceivableBillingSection, p as ReceivableCustomerSection, h as ReceivableDetailsPanel, g as ReceivableDetailsScreen, _ as ReceivableFormDialog, v as ReceivablePaymentDialog, y as ReceivablePreview, b as ReceivableRecurrenceEmailDialog, x as ReceivableRecurrenceSection, S as ReceivableRemindersSection, C as ReceivablesScreen, T as RecurringSeriesScreen, E as UnsavedInvoiceDialog };
@@ -51,6 +51,9 @@ var a = {
51
51
  editTitle: "Edit invoice",
52
52
  editDescription: "Invoice details",
53
53
  closeButton: "Close",
54
+ moreActionsButton: "More actions",
55
+ duplicateButton: "Duplicate",
56
+ deleteButton: "Delete",
54
57
  dueDateLabel: "Due date",
55
58
  lineItemsHeading: "Products and services",
56
59
  lineItemsDescription: "Add the products and services on this invoice. You'll have the option to save new items to your inventory.",
@@ -132,6 +135,18 @@ var a = {
132
135
  moreActionsLabel: "More actions",
133
136
  viewPdfButton: "View PDF",
134
137
  closeButton: "Close",
138
+ expandButton: "Open full screen",
139
+ collapseButton: "Exit full screen",
140
+ documentPaneRegion: "Invoice PDF",
141
+ downloadPdfButton: "Download PDF",
142
+ pdfUnavailable: "The PDF for this invoice is not available yet.",
143
+ pdfPagesRegion: "Invoice PDF pages",
144
+ pdfPreviewFailed: "The PDF could not be shown here.",
145
+ openPdfButton: "Open PDF",
146
+ lineItemsDescriptionColumn: "Description",
147
+ lineItemsQuantityColumn: "Qty",
148
+ lineItemsPriceColumn: "Price",
149
+ lineItemsAmountColumn: "Amount",
135
150
  invoiceDateCaption: "Invoice date",
136
151
  paymentHistoryHeading: "Payment history",
137
152
  paymentHistoryEmpty: "You've received no payments yet.",