@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
|
@@ -6,108 +6,114 @@ import { buildReceivableAuditHistory as e } from "../../../../../shared/util/dis
|
|
|
6
6
|
import { hasAnyScope as t } from "../../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
7
|
import { Scope as n } from "../../../../../shared/data-access/dist/lib/scopes.js";
|
|
8
8
|
import "../../../../../shared/data-access/dist/index.js";
|
|
9
|
-
import { useWidgetConfig as
|
|
10
|
-
import { useOrganizationUserNames as
|
|
9
|
+
import { useWidgetConfig as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
+
import { useOrganizationUserNames as i } from "../../../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
|
|
11
11
|
import "../../../../../shared/feature/dist/index.js";
|
|
12
|
-
import { RECEIVABLE_DETAILS_SECTION as
|
|
12
|
+
import { RECEIVABLE_DETAILS_SECTION as a } from "../../../../ui/dist/index25.js";
|
|
13
13
|
import "../../../../ui/dist/index.js";
|
|
14
|
-
import { useAllReceivableHistoryQuery as
|
|
15
|
-
import { usePaymentAccountsQuery as
|
|
16
|
-
import { useReceivablePaymentRecordsQuery as
|
|
17
|
-
import { useReceivablePdfLinkQuery as
|
|
18
|
-
import { useOverdueRemindersQuery as
|
|
14
|
+
import { useAllReceivableHistoryQuery as ee } from "../../../../data-access/dist/index3.js";
|
|
15
|
+
import { usePaymentAccountsQuery as o } from "../../../../data-access/dist/index5.js";
|
|
16
|
+
import { useReceivablePaymentRecordsQuery as s } from "../../../../data-access/dist/index10.js";
|
|
17
|
+
import { useReceivablePdfLinkQuery as te, useReceivableQuery as ne, useReceivablesByIdQueries as re } from "../../../../data-access/dist/index12.js";
|
|
18
|
+
import { useOverdueRemindersQuery as ie, usePaymentRemindersQuery as c, useRecurrenceQuery as l } from "../../../../data-access/dist/index13.js";
|
|
19
19
|
import "../../../../data-access/dist/index.js";
|
|
20
20
|
import { canRecordPayments as u } from "./paymentRecord.js";
|
|
21
|
-
import { buildReceivableAuditHistoryLabels as
|
|
22
|
-
import { getBankAccountPermissions as
|
|
23
|
-
import {
|
|
24
|
-
import { useMemo as
|
|
21
|
+
import { buildReceivableAuditHistoryLabels as ae } from "./auditHistory/labels.js";
|
|
22
|
+
import { getBankAccountPermissions as oe } from "./bankAccounts.js";
|
|
23
|
+
import { buildDetailsMessageView as se, buildReceivableDetailsView as ce } from "./details.js";
|
|
24
|
+
import { useMemo as d, useState as f } from "react";
|
|
25
25
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js
|
|
26
|
-
var
|
|
27
|
-
function
|
|
28
|
-
let { initResponse:
|
|
29
|
-
enabled:
|
|
30
|
-
canReadEmbedded:
|
|
31
|
-
canReadExternal:
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
let
|
|
35
|
-
...
|
|
36
|
-
...
|
|
26
|
+
var p = [a.attachments];
|
|
27
|
+
function m({ selectedReceivableId: m, enabled: h = !0, canWrite: g = !0, messages: _, statusLabels: v, auditHistoryLabels: y, onOpenReceivable: b, onOpenCustomer: x }) {
|
|
28
|
+
let { initResponse: S } = r(), C = d(() => oe(S?.scopes), [S?.scopes]), w = u(S?.scopes), T = ne(m, { enabled: h }), E = T.data, D = E?.type === "invoice" ? E : void 0, le = te(m, { enabled: h && !!D }), ue = c({ enabled: h && !!D?.payment_reminder_id }), O = ie({ enabled: h && !!D?.overdue_reminder_id }), k = o({
|
|
29
|
+
enabled: h && !!D,
|
|
30
|
+
canReadEmbedded: C.canReadEmbedded,
|
|
31
|
+
canReadExternal: C.canReadExternal
|
|
32
|
+
}), A = l(h ? D?.recurrence_id : void 0), j = A.data, M = s(D?.id, { enabled: h }), N = ee(D?.id, { enabled: h && !!D }), P = d(() => D?.status === "recurring" ? (j?.iterations ?? []).flatMap((e) => e.issued_invoice_id ? [e.issued_invoice_id] : []) : [], [D?.status, j?.iterations]), F = re(P, { enabled: h }), I = d(() => new Map(F.filter((e) => !!e).map((e) => [e.id, e])), [F]), [L, R] = f(p), [z, B] = f(m);
|
|
33
|
+
z !== m && (B(m), R(p));
|
|
34
|
+
let V = L.includes(a.auditHistory), H = d(() => N.data?.data ?? [], [N.data]), U = H.some((e) => e.recorded_by === "user" && !!e.entity_user_id), W = t(S?.scopes, [n.UserReadOrg]), { userNames: G, isError: K } = i({ enabled: h && V && W && U }), q = d(() => ({
|
|
35
|
+
...ae(_, v),
|
|
36
|
+
...y
|
|
37
37
|
}), [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
]),
|
|
42
|
-
let t =
|
|
38
|
+
_,
|
|
39
|
+
v,
|
|
40
|
+
y
|
|
41
|
+
]), J = d(() => {
|
|
42
|
+
let t = D ? e(H, G, q, {
|
|
43
43
|
documentType: "invoice",
|
|
44
|
-
currency:
|
|
45
|
-
documentNumber:
|
|
46
|
-
dueDate:
|
|
44
|
+
currency: D.currency,
|
|
45
|
+
documentNumber: D.document_id,
|
|
46
|
+
dueDate: D.due_date
|
|
47
47
|
}) : [];
|
|
48
48
|
return {
|
|
49
49
|
rows: t,
|
|
50
|
-
countLabel:
|
|
51
|
-
isLoading:
|
|
52
|
-
isError:
|
|
53
|
-
showNamesError:
|
|
50
|
+
countLabel: N.data && !N.isLoading && !N.isError ? String(t.length) : void 0,
|
|
51
|
+
isLoading: N.isLoading,
|
|
52
|
+
isError: N.isError,
|
|
53
|
+
showNamesError: W && K && U
|
|
54
54
|
};
|
|
55
55
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
K,
|
|
59
|
-
J,
|
|
60
|
-
P.data,
|
|
61
|
-
P.isLoading,
|
|
62
|
-
P.isError,
|
|
56
|
+
D,
|
|
57
|
+
H,
|
|
63
58
|
G,
|
|
64
59
|
q,
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
N.data,
|
|
61
|
+
N.isLoading,
|
|
62
|
+
N.isError,
|
|
63
|
+
W,
|
|
64
|
+
K,
|
|
65
|
+
U
|
|
66
|
+
]), Y = ue.data?.data.find((e) => e.id === D?.payment_reminder_id), X = O.data?.data.find((e) => e.id === D?.overdue_reminder_id), Z = k.paymentAccounts.find((e) => e.id === D?.bank_account_id), Q = le.data?.file_url || void 0, de = d(() => ce({
|
|
67
|
+
receivable: E,
|
|
68
|
+
pdfUrl: Q,
|
|
69
|
+
paymentReminder: Y,
|
|
70
|
+
overdueReminder: X,
|
|
71
|
+
depositAccount: Z,
|
|
72
|
+
isAccountListIncomplete: k.isIncomplete,
|
|
73
|
+
recurrence: j,
|
|
74
|
+
paymentRecords: M.data?.data,
|
|
75
|
+
isLoadingPaymentRecords: M.isLoading,
|
|
76
|
+
iterationInvoices: I,
|
|
77
|
+
auditHistory: J,
|
|
78
|
+
statusLabels: v,
|
|
79
|
+
messages: _,
|
|
80
|
+
canRecordPayment: w,
|
|
81
|
+
canWrite: g,
|
|
82
|
+
onOpenReceivable: b,
|
|
83
|
+
onOpenCustomer: x
|
|
84
|
+
}), [
|
|
85
|
+
E,
|
|
86
|
+
Q,
|
|
87
|
+
Y,
|
|
88
|
+
X,
|
|
89
|
+
Z,
|
|
90
|
+
k.isIncomplete,
|
|
91
|
+
j,
|
|
92
|
+
M.data,
|
|
93
|
+
M.isLoading,
|
|
94
|
+
I,
|
|
95
|
+
J,
|
|
96
|
+
v,
|
|
97
|
+
_,
|
|
98
|
+
w,
|
|
99
|
+
g,
|
|
100
|
+
b,
|
|
101
|
+
x
|
|
102
|
+
]), $ = T.isLoading || A.isLoading;
|
|
67
103
|
return {
|
|
68
|
-
receivable:
|
|
69
|
-
recurrence:
|
|
70
|
-
detailsView:
|
|
71
|
-
|
|
72
|
-
pdfUrl: $,
|
|
73
|
-
paymentReminder: X,
|
|
74
|
-
overdueReminder: Z,
|
|
75
|
-
depositAccount: Q,
|
|
76
|
-
isAccountListIncomplete: A.isIncomplete,
|
|
77
|
-
recurrence: M,
|
|
78
|
-
paymentRecords: N.data?.data,
|
|
79
|
-
isLoadingPaymentRecords: N.isLoading,
|
|
80
|
-
iterationInvoices: L,
|
|
81
|
-
auditHistory: Y,
|
|
82
|
-
statusLabels: b,
|
|
83
|
-
messages: y,
|
|
84
|
-
canRecordPayment: T,
|
|
85
|
-
canWrite: v,
|
|
86
|
-
onOpenReceivable: S
|
|
87
|
-
}), [
|
|
88
|
-
D,
|
|
104
|
+
receivable: E,
|
|
105
|
+
recurrence: j,
|
|
106
|
+
detailsView: de,
|
|
107
|
+
messageView: d(() => $ ? void 0 : se(E, m ?? "", _), [
|
|
89
108
|
$,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
A.isIncomplete,
|
|
94
|
-
M,
|
|
95
|
-
N.data,
|
|
96
|
-
N.isLoading,
|
|
97
|
-
L,
|
|
98
|
-
Y,
|
|
99
|
-
b,
|
|
100
|
-
y,
|
|
101
|
-
T,
|
|
102
|
-
v,
|
|
103
|
-
S
|
|
109
|
+
E,
|
|
110
|
+
m,
|
|
111
|
+
_
|
|
104
112
|
]),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
isLoading: E.isLoading || k.isLoading || j.isLoading,
|
|
109
|
-
isError: E.isError
|
|
113
|
+
openSections: L,
|
|
114
|
+
setOpenSections: R,
|
|
115
|
+
isLoading: $
|
|
110
116
|
};
|
|
111
117
|
}
|
|
112
118
|
//#endregion
|
|
113
|
-
export {
|
|
119
|
+
export { m as useReceivableDetails };
|