@tesouro/embedded-components-react 0.5.217 → 0.5.221
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 +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +1 -0
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +22 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +39 -70
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +34 -106
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +75 -307
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +121 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +317 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +50 -335
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +353 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { InsightsWidget as L } from "./libs/tesouro-embedded-components-react/in
|
|
|
27
27
|
import { UploadReceiptWidget as R } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index2.js";
|
|
28
28
|
import { ExpenseManagementWidget as z } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index21.js";
|
|
29
29
|
import { InvoicingWidget as B } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js";
|
|
30
|
-
import { ReceivablesWidget as V } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/
|
|
30
|
+
import { ReceivablesWidget as V } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js";
|
|
31
31
|
import { SettingsSection as H } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index4.js";
|
|
32
32
|
import { HELP_FAQ_EN as U } from "./libs/tesouro-embedded-components-react/settings-widget/help/ui/contract/dist/index3.js";
|
|
33
33
|
import { SettingsWidget as W } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ReceivablesWidget as e } from "../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/
|
|
1
|
+
import { ReceivablesWidget as e } from "../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js";
|
|
2
2
|
import "../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js";
|
|
3
3
|
export { e as ReceivablesWidget };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js
CHANGED
|
@@ -9,5 +9,5 @@ import "./index8.js";
|
|
|
9
9
|
import { useMarkReceivablePaidMutation as m, useMarkReceivablePartiallyPaidMutation as h, useMarkReceivableUncollectibleMutation as g } from "./index9.js";
|
|
10
10
|
import { useReceivableHistoryQuery as _, useReceivableMailsQuery as v, useReceivablePdfLinkQuery as y, useReceivableQuery as b, useReceivablesQuery as x } from "./index10.js";
|
|
11
11
|
import { useCreateOverdueReminderMutation as S, useCreatePaymentReminderMutation as C, useCreateRecurrenceMutation as w, useOverdueRemindersQuery as T, usePaymentRemindersQuery as E, useRecurrenceQuery as D, useUpdateRecurrenceMutation as O } from "./index11.js";
|
|
12
|
-
import "./index12.js";
|
|
13
|
-
export { o as useAcceptReceivableMutation, s as useCancelReceivableMutation, c as useCloneReceivableMutation, t as useCreateEntityBankAccountMutation, S as useCreateOverdueReminderMutation, C as useCreatePaymentReminderMutation, l as useCreateReceivableMutation, w as useCreateRecurrenceMutation, u as useDeclineReceivableMutation, r as useDeleteReceivableAttachmentMutation, d as useDeleteReceivableMutation, f as useIssueReceivableMutation, m as useMarkReceivablePaidMutation, h as useMarkReceivablePartiallyPaidMutation, g as useMarkReceivableUncollectibleMutation, T as useOverdueRemindersQuery, n as usePaymentAccountsQuery, E as usePaymentRemindersQuery, e as usePaymentTermsQuery, _ as useReceivableHistoryQuery, v as useReceivableMailsQuery, y as useReceivablePdfLinkQuery, b as useReceivableQuery, x as useReceivablesQuery, D as useRecurrenceQuery, a as useSendReceivableEmailMutation, p as useUpdateReceivableMutation, O as useUpdateRecurrenceMutation, i as useUploadReceivableAttachmentMutation };
|
|
12
|
+
import { useReceivablesAnalyticsQuery as k } from "./index12.js";
|
|
13
|
+
export { o as useAcceptReceivableMutation, s as useCancelReceivableMutation, c as useCloneReceivableMutation, t as useCreateEntityBankAccountMutation, S as useCreateOverdueReminderMutation, C as useCreatePaymentReminderMutation, l as useCreateReceivableMutation, w as useCreateRecurrenceMutation, u as useDeclineReceivableMutation, r as useDeleteReceivableAttachmentMutation, d as useDeleteReceivableMutation, f as useIssueReceivableMutation, m as useMarkReceivablePaidMutation, h as useMarkReceivablePartiallyPaidMutation, g as useMarkReceivableUncollectibleMutation, T as useOverdueRemindersQuery, n as usePaymentAccountsQuery, E as usePaymentRemindersQuery, e as usePaymentTermsQuery, _ as useReceivableHistoryQuery, v as useReceivableMailsQuery, y as useReceivablePdfLinkQuery, b as useReceivableQuery, k as useReceivablesAnalyticsQuery, x as useReceivablesQuery, D as useRecurrenceQuery, a as useSendReceivableEmailMutation, p as useUpdateReceivableMutation, O as useUpdateRecurrenceMutation, i as useUploadReceivableAttachmentMutation };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js
CHANGED
|
@@ -2,5 +2,26 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
+
import { getAnalyticsReceivablesOptions as e } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
|
+
import { withAuthEpoch as t } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
7
|
+
import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { organizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
5
9
|
import "../../../shared/data-access/dist/index.js";
|
|
6
|
-
import "@tanstack/react-query";
|
|
10
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
11
|
+
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js
|
|
12
|
+
function a({ enabled: a = !0, ...o }) {
|
|
13
|
+
let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = !!(c && l) && a, p = e({
|
|
14
|
+
client: s,
|
|
15
|
+
headers: r(c),
|
|
16
|
+
query: o
|
|
17
|
+
});
|
|
18
|
+
return i({
|
|
19
|
+
...t(p, {
|
|
20
|
+
authEpoch: u,
|
|
21
|
+
organizationPending: d
|
|
22
|
+
}),
|
|
23
|
+
enabled: f
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { a as useReceivablesAnalyticsQuery };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js
CHANGED
|
@@ -1,75 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { buildReceivableRows as e, statusFilterOptions as t, typeForTab as n } from "./index12.js";
|
|
6
|
-
import { useReceivablesQuery as r } from "../../data-access/dist/index10.js";
|
|
7
|
-
import "../../data-access/dist/index.js";
|
|
8
|
-
import { useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
|
|
1
|
+
import { formatMoney as e, getStatusTone as t } from "./index12.js";
|
|
9
2
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
status:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
order: E
|
|
30
|
-
} : {}
|
|
31
|
-
}), O = D.data?.data ?? c, k = o(() => new Map(O.map((e) => [e.id, e])), [O]), A = i((e) => k.get(e), [k]), j = o(() => e({
|
|
32
|
-
receivables: O,
|
|
33
|
-
messages: d
|
|
34
|
-
}), [d, O]), M = !!b || S !== "all", N = i((e) => {
|
|
35
|
-
let t = typeof e == "function" ? e(f) : e;
|
|
36
|
-
p(t), _(void 0);
|
|
37
|
-
}, [f]), P = i((e) => {
|
|
38
|
-
h(e), _(void 0);
|
|
39
|
-
}, []), F = i((e) => {
|
|
40
|
-
C(e), _(void 0);
|
|
41
|
-
}, []), I = i(() => _(D.data?.next_pagination_token ?? void 0), [D.data?.next_pagination_token]), L = i(() => _(D.data?.prev_pagination_token ?? void 0), [D.data?.prev_pagination_token]), R = i(() => {
|
|
42
|
-
D.refetch();
|
|
43
|
-
}, [D]);
|
|
3
|
+
var n = [
|
|
4
|
+
"draft",
|
|
5
|
+
"issued",
|
|
6
|
+
"overdue",
|
|
7
|
+
"partially_paid",
|
|
8
|
+
"paid",
|
|
9
|
+
"recurring",
|
|
10
|
+
"canceled",
|
|
11
|
+
"uncollectible"
|
|
12
|
+
];
|
|
13
|
+
function r(e) {
|
|
14
|
+
let t = n.indexOf(e);
|
|
15
|
+
return t === -1 ? n.length : t;
|
|
16
|
+
}
|
|
17
|
+
function i({ counts: n, amounts: i, statusFilter: a, statusLabels: o, fallback: s }) {
|
|
18
|
+
let c = new Map(Object.entries(o)), l = new Map(i.map((e) => [e.dimension_value, e.metric_value])), u = n.flatMap((e) => e.dimension_value ? [{
|
|
19
|
+
status: e.dimension_value,
|
|
20
|
+
count: e.metric_value
|
|
21
|
+
}] : []), d = u.filter(({ status: e }) => e !== "recurring").reduce((e, { count: t }) => e + t, 0);
|
|
44
22
|
return {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
getReceivableById: A
|
|
23
|
+
kind: "ready",
|
|
24
|
+
all: {
|
|
25
|
+
value: "all",
|
|
26
|
+
countLabel: String(d),
|
|
27
|
+
selected: a === "all"
|
|
28
|
+
},
|
|
29
|
+
statuses: [...u].sort((e, t) => r(e.status) - r(t.status)).map(({ status: n, count: r }) => ({
|
|
30
|
+
value: n,
|
|
31
|
+
statusLabel: c.get(n) ?? o.unknown,
|
|
32
|
+
statusTone: t(n),
|
|
33
|
+
countLabel: String(r),
|
|
34
|
+
amountLabel: e({
|
|
35
|
+
amount: l.get(n) ?? 0,
|
|
36
|
+
currency: "USD",
|
|
37
|
+
fallback: s
|
|
38
|
+
}),
|
|
39
|
+
selected: a === n
|
|
40
|
+
}))
|
|
64
41
|
};
|
|
65
42
|
}
|
|
66
|
-
var u = {
|
|
67
|
-
documentLabel: "document_id",
|
|
68
|
-
customerLabel: "counterpart_name",
|
|
69
|
-
status: "status",
|
|
70
|
-
issueDateLabel: "issue_date",
|
|
71
|
-
dueDateLabel: "due_date",
|
|
72
|
-
totalLabel: "total_amount"
|
|
73
|
-
};
|
|
74
43
|
//#endregion
|
|
75
|
-
export {
|
|
44
|
+
export { i as buildReceivableStatusCardsView };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js
CHANGED
|
@@ -2,114 +2,42 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { RECEIVABLE_MESSAGE_LABELS_EN as o } from "./index13.js";
|
|
10
|
-
import { useReceivableActions as s } from "./index15.js";
|
|
11
|
-
import { useReceivableDetails as c } from "./index16.js";
|
|
12
|
-
import { hasSelectedText as l } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
|
|
13
|
-
import "../../../shared/product-catalog/feature/dist/index.js";
|
|
14
|
-
import { useReceivableForm as u } from "./index23.js";
|
|
15
|
-
import { useReceivablesTable as d } from "./index24.js";
|
|
16
|
-
import { useCallback as f, useEffect as p, useMemo as m, useState as h } from "react";
|
|
5
|
+
import { useReceivablesAnalyticsQuery as e } from "../../data-access/dist/index12.js";
|
|
6
|
+
import "../../data-access/dist/index.js";
|
|
7
|
+
import { buildReceivableStatusCardsView as t } from "./index24.js";
|
|
8
|
+
import { useMemo as n } from "react";
|
|
17
9
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
function r({ enabled: r, statusFilter: i, messages: a, statusLabels: o }) {
|
|
11
|
+
let s = e({
|
|
12
|
+
enabled: r,
|
|
13
|
+
dimension: "status",
|
|
14
|
+
metric: "id",
|
|
15
|
+
aggregation_function: "count",
|
|
16
|
+
type: "invoice"
|
|
17
|
+
}), c = e({
|
|
18
|
+
enabled: r,
|
|
19
|
+
dimension: "status",
|
|
20
|
+
metric: "total_amount",
|
|
21
|
+
aggregation_function: "summary",
|
|
22
|
+
type: "invoice"
|
|
23
|
+
}), l = s.data?.data, u = c.data?.data, d = s.isPending || c.isPending;
|
|
24
|
+
return n(() => {
|
|
25
|
+
if (r) return d ? { kind: "loading" } : t({
|
|
26
|
+
counts: l ?? [],
|
|
27
|
+
amounts: u ?? [],
|
|
28
|
+
statusFilter: i,
|
|
29
|
+
statusLabels: o,
|
|
30
|
+
fallback: a.notAvailable
|
|
31
|
+
});
|
|
35
32
|
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
u,
|
|
34
|
+
l,
|
|
35
|
+
r,
|
|
36
|
+
d,
|
|
37
|
+
a.notAvailable,
|
|
38
|
+
i,
|
|
39
|
+
o
|
|
39
40
|
]);
|
|
40
|
-
let M = f((e, t) => {
|
|
41
|
-
D(i(t)), k(e), j(!0), x?.(e, t);
|
|
42
|
-
}, [x]), N = d({
|
|
43
|
-
activeTab: E,
|
|
44
|
-
messages: w
|
|
45
|
-
}), P = c({
|
|
46
|
-
selectedReceivableId: O,
|
|
47
|
-
enabled: A,
|
|
48
|
-
messages: w
|
|
49
|
-
}), F = u({
|
|
50
|
-
messages: w,
|
|
51
|
-
counterpartMessageLabels: g,
|
|
52
|
-
embeddedBankName: v,
|
|
53
|
-
onCreated: M
|
|
54
|
-
}), I = f(() => {
|
|
55
|
-
let e = a(E);
|
|
56
|
-
F.openCreate(e === "quote" ? "quote" : "invoice");
|
|
57
|
-
}, [E, F.openCreate]), L = s({
|
|
58
|
-
selectedReceivable: P.receivable,
|
|
59
|
-
messages: w,
|
|
60
|
-
onCreated: M,
|
|
61
|
-
onDeleted: (e) => {
|
|
62
|
-
e === O && (k(void 0), j(!1));
|
|
63
|
-
}
|
|
64
|
-
}), R = f((e) => {
|
|
65
|
-
l() || (k(e.id), j(!0), S?.(e.id, e.type));
|
|
66
|
-
}, [S]);
|
|
67
|
-
return {
|
|
68
|
-
activeTab: E,
|
|
69
|
-
enabledTabs: T,
|
|
70
|
-
setActiveTab: D,
|
|
71
|
-
table: N,
|
|
72
|
-
details: P,
|
|
73
|
-
detailsOpen: A,
|
|
74
|
-
closeDetails: f(() => {
|
|
75
|
-
j(!1), k(void 0);
|
|
76
|
-
}, []),
|
|
77
|
-
form: F,
|
|
78
|
-
openCreate: I,
|
|
79
|
-
actions: L,
|
|
80
|
-
handleRowClick: R,
|
|
81
|
-
handleActionClick: f((e, t) => {
|
|
82
|
-
let n = N.getReceivableById(t.id);
|
|
83
|
-
if (e === "edit") {
|
|
84
|
-
if (n) {
|
|
85
|
-
F.openEdit(n);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
k(t.id), j(!0);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
k(t.id), L.openAction(e, t, n ?? null);
|
|
92
|
-
}, [
|
|
93
|
-
L,
|
|
94
|
-
F.openEdit,
|
|
95
|
-
N.getReceivableById
|
|
96
|
-
]),
|
|
97
|
-
handleDetailsActionClick: f((e, t) => {
|
|
98
|
-
if (e === "edit") {
|
|
99
|
-
P.receivable && (F.openEdit(P.receivable), j(!1));
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
L.openAction(e, {
|
|
103
|
-
id: t.id,
|
|
104
|
-
title: t.title,
|
|
105
|
-
type: t.type
|
|
106
|
-
}, P.receivable ?? null);
|
|
107
|
-
}, [
|
|
108
|
-
L,
|
|
109
|
-
P.receivable,
|
|
110
|
-
F.openEdit
|
|
111
|
-
])
|
|
112
|
-
};
|
|
113
41
|
}
|
|
114
42
|
//#endregion
|
|
115
|
-
export {
|
|
43
|
+
export { r as useReceivableStatusCards };
|