@tesouro/embedded-components-react 0.5.267 → 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.
- package/dist/index.css +4 -10
- package/dist/index.d.ts +13 -9
- package/dist/lib/ReceivablesWidget.d.ts +13 -9
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +44 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +97 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +76 -150
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +63 -57
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/actionsModal.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +161 -152
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +30 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +12 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +18 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +208 -158
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +91 -85
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +197 -196
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +147 -115
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +14 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +3 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +37 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +22 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +17 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +17 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +37 -31
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +29 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +38 -11
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +26 -28
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +20 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +8 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +34 -83
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +14 -404
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +28 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +79 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +490 -68
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +2 -502
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +41 -216
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +70 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +484 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +224 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +21 -263
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +8 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +261 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +2 -237
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +100 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +21 -242
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +226 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +3 -59
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +233 -178
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +85 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +60 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +194 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +45 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- 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 {
|
|
6
|
-
import {
|
|
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
|
|
9
|
-
import { RECEIVABLE_STATUS_BADGE_LABELS_EN as
|
|
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
|
|
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
|
|
14
|
-
import { getDocumentTitle as
|
|
15
|
-
import { RECEIVABLE_MESSAGE_LABELS_EN as
|
|
16
|
-
import { getReceivablePermissions as
|
|
17
|
-
import { useReceivableActions as
|
|
18
|
-
import { useReceivableActionsModal as
|
|
19
|
-
import { useReceivableDetails as
|
|
20
|
-
import { useReceivableForm as
|
|
21
|
-
import { useReceivablesTable as
|
|
22
|
-
import { useCallback as a, useEffect as o, useMemo as s, useRef as
|
|
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
|
|
25
|
-
let
|
|
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
|
-
|
|
28
|
-
}, [
|
|
29
|
-
let { initResponse:
|
|
30
|
-
...
|
|
31
|
-
...
|
|
32
|
-
}), [
|
|
33
|
-
...
|
|
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] =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
}),
|
|
46
|
-
}, [
|
|
47
|
-
initialCounterpartId:
|
|
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:
|
|
55
|
+
filterLabels: _e,
|
|
51
56
|
enabled: T,
|
|
52
57
|
visible: C
|
|
53
|
-
}),
|
|
54
|
-
N(e), F(!0),
|
|
55
|
-
}, [
|
|
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:
|
|
62
|
-
onOpenReceivable:
|
|
63
|
-
|
|
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:
|
|
66
|
-
embeddedBankName:
|
|
67
|
-
onCreated:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
88
|
+
Y.current || p === "create" && E && (Y.current = !0, J.openCreate("invoice", { customerId: f }));
|
|
73
89
|
}, [
|
|
74
90
|
E,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
91
|
+
J.openCreate,
|
|
92
|
+
f,
|
|
93
|
+
p
|
|
78
94
|
]);
|
|
79
|
-
let
|
|
80
|
-
selectedReceivable:
|
|
81
|
-
selectedRecurrence:
|
|
95
|
+
let X = ue({
|
|
96
|
+
selectedReceivable: K.receivable,
|
|
97
|
+
selectedRecurrence: K.recurrence,
|
|
82
98
|
messages: k,
|
|
83
|
-
onCreated:
|
|
99
|
+
onCreated: Oe,
|
|
84
100
|
onDeleted: (e) => {
|
|
85
101
|
e === M && (N(void 0), F(!1));
|
|
86
102
|
},
|
|
87
|
-
onCompleteBeforeIssue: (e) => {
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
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
|
-
|
|
121
|
+
Z && Q && (Ne(), Pe(), Fe(), Ie(), Le(), $(), H());
|
|
93
122
|
}, [
|
|
94
|
-
|
|
123
|
+
Fe,
|
|
95
124
|
$,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
F(!1), N(void 0);
|
|
108
|
-
}, []),
|
|
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
|
-
|
|
140
|
+
K.receivable && (q.current = "edit", J.openEdit(K.receivable), R(!0), F(!1));
|
|
112
141
|
return;
|
|
113
142
|
}
|
|
114
|
-
|
|
143
|
+
X.openAction(e, {
|
|
115
144
|
id: t.id,
|
|
116
|
-
title:
|
|
145
|
+
title: K.receivable ? se(K.receivable, k) : t.title,
|
|
117
146
|
type: t.type
|
|
118
|
-
},
|
|
147
|
+
}, K.receivable ?? null);
|
|
119
148
|
}
|
|
120
149
|
}, [
|
|
121
|
-
|
|
150
|
+
X,
|
|
122
151
|
E,
|
|
123
|
-
|
|
124
|
-
|
|
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:
|
|
159
|
+
actionsSuspended: Se,
|
|
131
160
|
isAccessRestricted: x && !S.canRead,
|
|
132
|
-
table: C ?
|
|
133
|
-
...
|
|
161
|
+
table: C ? G : {
|
|
162
|
+
...G,
|
|
134
163
|
rows: [],
|
|
135
164
|
statusCards: void 0,
|
|
136
165
|
isError: !1
|
|
137
166
|
},
|
|
138
|
-
isTableLoading: C ?
|
|
139
|
-
isError: D || C &&
|
|
140
|
-
onRetry: D ?
|
|
141
|
-
details:
|
|
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:
|
|
172
|
+
closeDetails: ze,
|
|
173
|
+
detailsPanelKey: I,
|
|
174
|
+
customerDetailsId: we,
|
|
175
|
+
closeCustomerDetails: Ee,
|
|
144
176
|
form: {
|
|
145
|
-
...
|
|
146
|
-
open: w &&
|
|
147
|
-
counterpartView: w ?
|
|
177
|
+
...J,
|
|
178
|
+
open: w && J.open,
|
|
179
|
+
counterpartView: w ? J.counterpartView : "none",
|
|
148
180
|
counterpartForm: {
|
|
149
|
-
...
|
|
150
|
-
submit:
|
|
181
|
+
...J.counterpartForm,
|
|
182
|
+
submit: d(E, J.counterpartForm.submit)
|
|
151
183
|
},
|
|
152
|
-
submit:
|
|
153
|
-
submitDraft:
|
|
154
|
-
submitPrimary:
|
|
184
|
+
submit: d(E, J.submit),
|
|
185
|
+
submitDraft: d(E, J.submitDraft),
|
|
186
|
+
submitPrimary: d(E, J.submitPrimary)
|
|
155
187
|
},
|
|
156
|
-
openCreate:
|
|
157
|
-
measureUnitsOpen: w &&
|
|
158
|
-
openMeasureUnits:
|
|
159
|
-
closeMeasureUnits:
|
|
188
|
+
openCreate: Me,
|
|
189
|
+
measureUnitsOpen: w && B,
|
|
190
|
+
openMeasureUnits: De,
|
|
191
|
+
closeMeasureUnits: H,
|
|
160
192
|
actions: {
|
|
161
|
-
...
|
|
162
|
-
actionDialog: w ?
|
|
163
|
-
sendOpen: w &&
|
|
164
|
-
openAction:
|
|
165
|
-
confirmAction:
|
|
166
|
-
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
|
-
...
|
|
169
|
-
isOpen: w &&
|
|
170
|
-
save:
|
|
171
|
-
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
|
-
...
|
|
176
|
-
isOpen: w &&
|
|
177
|
-
send:
|
|
178
|
-
saveItems:
|
|
207
|
+
...U,
|
|
208
|
+
isOpen: w && U.isOpen,
|
|
209
|
+
send: d(E, U.send),
|
|
210
|
+
saveItems: d(E, U.saveItems)
|
|
179
211
|
},
|
|
180
|
-
handleRowClick:
|
|
181
|
-
handleDetailsActionClick:
|
|
212
|
+
handleRowClick: Re,
|
|
213
|
+
handleDetailsActionClick: Be
|
|
182
214
|
};
|
|
183
215
|
}
|
|
184
|
-
function
|
|
216
|
+
function d(e, t) {
|
|
185
217
|
return (...n) => {
|
|
186
218
|
e && t(...n);
|
|
187
219
|
};
|
|
188
220
|
}
|
|
189
221
|
//#endregion
|
|
190
|
-
export {
|
|
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 "./
|
|
20
|
-
import "./
|
|
21
|
-
import { ReceivableFormDialog as f } from "./
|
|
22
|
-
import { ReceivablePaymentDialog as p } from "./
|
|
23
|
-
import "./
|
|
24
|
-
import { ReceivablePreview as m } from "./
|
|
25
|
-
import "./
|
|
26
|
-
import { ReceivableRecurrenceEmailDialog as h } from "./
|
|
27
|
-
import { ReceivableRecurrenceSection as g } from "./
|
|
28
|
-
import "./
|
|
29
|
-
import { ReceivableRemindersSection as _ } from "./
|
|
30
|
-
import { ReceivableSendDialog as v } from "./
|
|
31
|
-
import { ReceivablesScreen as y } from "./
|
|
32
|
-
import { UnsavedInvoiceDialog as b } from "./
|
|
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: "
|
|
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, {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
children:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
children:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
13
|
-
let
|
|
27
|
+
function c({ status: o, label: c, tone: l = "neutral", variant: u = "outline", labels: d, icon: f }) {
|
|
28
|
+
let p = {
|
|
14
29
|
...n,
|
|
15
|
-
...
|
|
16
|
-
},
|
|
30
|
+
...d
|
|
31
|
+
}, m = c ?? p[o] ?? p.unknown;
|
|
17
32
|
return /* @__PURE__ */ r(e, {
|
|
18
33
|
variant: "outline",
|
|
19
|
-
className: t(
|
|
20
|
-
children: [
|
|
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 {
|
|
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,
|
|
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
|
|
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:
|
|
19
|
+
}, y = {
|
|
20
|
+
edit: m,
|
|
20
21
|
issue: u,
|
|
22
|
+
issueAndSend: g,
|
|
21
23
|
recordPayment: s,
|
|
22
|
-
send:
|
|
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:
|
|
30
|
-
pauseRecurrence:
|
|
31
|
-
resumeRecurrence:
|
|
31
|
+
delete: _,
|
|
32
|
+
pauseRecurrence: f,
|
|
33
|
+
resumeRecurrence: h,
|
|
32
34
|
cancelRecurrence: t
|
|
33
|
-
},
|
|
34
|
-
draft:
|
|
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
|
-
},
|
|
43
|
+
}, x = {
|
|
42
44
|
forward: r,
|
|
43
|
-
pause:
|
|
45
|
+
pause: f,
|
|
44
46
|
ban: e,
|
|
45
47
|
check: n
|
|
46
|
-
},
|
|
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
|
-
},
|
|
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 {
|
|
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 {
|
|
2
|
-
import { amountValueToneClass as
|
|
3
|
-
import { jsx as
|
|
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
|
|
6
|
-
let
|
|
7
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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 {
|
|
23
|
+
export { a as AmountCell };
|