@tesouro/embedded-components-react 0.5.225 → 0.5.227
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/README.md +21 -21
- package/dist/index.d.ts +23 -2
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +23 -2
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index3.js +41 -39
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +150 -147
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +46 -51
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +130 -128
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +31 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +36 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index2.js +6 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index8.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +154 -150
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +151 -149
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index3.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index15.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index17.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index18.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index19.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index8.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index9.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index24.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index27.js +89 -87
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +133 -130
- package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js +36 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +50 -36
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +40 -39
- 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/index12.js +51 -32
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +20 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +17 -202
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +220 -31
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +32 -145
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -44
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +145 -117
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +46 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +113 -87
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +58 -116
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +98 -225
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +111 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +225 -462
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +34 -41
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +627 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +39 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -112
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +75 -310
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +124 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +324 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +20 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +56 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +33 -29
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +184 -162
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +78 -69
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +209 -207
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index4.js +10 -5
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index5.js +10 -5
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index6.js +11 -6
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index14.js +30 -28
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index17.js +28 -26
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index18.js +37 -34
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index21.js +28 -26
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index22.js +37 -34
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +294 -292
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js +58 -58
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +47 -48
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +20 -19
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -39
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/EmbedApiContext.js +14 -13
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/allPages.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js +16 -15
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js +28 -29
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organizationStatus.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +26 -27
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +210 -199
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +60 -52
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js +31 -32
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useRolePermissionsQueries.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useCurrentUserQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useGetUserDataQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMailboxAddress.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMyEntityQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js +33 -34
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js +33 -22
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +43 -32
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +138 -127
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/deriveOrganizationStatus.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useWidgetFetch.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js +60 -58
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js
CHANGED
|
@@ -3,19 +3,22 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { isOrganizationOnItsWay as t } from "../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
7
|
+
import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
6
9
|
import "../../../shared/ui/dist/index.js";
|
|
7
|
-
import { useWidgetConfig as
|
|
10
|
+
import { useWidgetConfig as r, useWidgetLoading as i } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
8
11
|
import "../../../shared/feature/dist/index.js";
|
|
9
|
-
import { ReceiptMatchLabels as
|
|
12
|
+
import { ReceiptMatchLabels as a } from "../../ui/dist/lib/ReceiptMatchWidget/lib/labels.js";
|
|
10
13
|
import "../../ui/dist/index.js";
|
|
11
|
-
import { useGetReceiptsQuery as
|
|
12
|
-
import { useGetTransactionsQuery as
|
|
13
|
-
import { usePatchReceiptMutation as
|
|
14
|
-
import { useDeleteReceiptMutation as
|
|
14
|
+
import { useGetReceiptsQuery as ee } from "../../data-access/dist/index2.js";
|
|
15
|
+
import { useGetTransactionsQuery as o } from "../../data-access/dist/index3.js";
|
|
16
|
+
import { usePatchReceiptMutation as te } from "../../data-access/dist/index11.js";
|
|
17
|
+
import { useDeleteReceiptMutation as s } from "../../data-access/dist/index12.js";
|
|
15
18
|
import "../../data-access/dist/index.js";
|
|
16
|
-
import { useCallback as
|
|
19
|
+
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
17
20
|
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js
|
|
18
|
-
function
|
|
21
|
+
function f(e, t) {
|
|
19
22
|
if (typeof e == "object" && e) {
|
|
20
23
|
let t = e.error;
|
|
21
24
|
if (typeof t == "object" && t) {
|
|
@@ -25,7 +28,7 @@ function u(e, t) {
|
|
|
25
28
|
}
|
|
26
29
|
return e instanceof Error && e.message ? e.message : t;
|
|
27
30
|
}
|
|
28
|
-
function
|
|
31
|
+
function p(e, t) {
|
|
29
32
|
let n = e / 100;
|
|
30
33
|
try {
|
|
31
34
|
return new Intl.NumberFormat("en-US", {
|
|
@@ -36,7 +39,7 @@ function d(e, t) {
|
|
|
36
39
|
return `${t} ${n.toFixed(2)}`;
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
|
-
function
|
|
42
|
+
function m(e) {
|
|
40
43
|
if (!e) return "";
|
|
41
44
|
let t = new Date(e);
|
|
42
45
|
return Number.isNaN(t.getTime()) ? "" : t.toLocaleDateString("en-US", {
|
|
@@ -54,7 +57,7 @@ function ne(e) {
|
|
|
54
57
|
year: "numeric"
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
|
-
function
|
|
60
|
+
function re(e) {
|
|
58
61
|
if (!e) return "";
|
|
59
62
|
let t = new Date(e);
|
|
60
63
|
return Number.isNaN(t.getTime()) ? "" : t.toLocaleTimeString("en-US", {
|
|
@@ -64,201 +67,201 @@ function p(e) {
|
|
|
64
67
|
hour12: !0
|
|
65
68
|
});
|
|
66
69
|
}
|
|
67
|
-
function
|
|
70
|
+
function h(e) {
|
|
68
71
|
let t = e.ocr_status === "processing";
|
|
69
72
|
return {
|
|
70
73
|
id: e.id,
|
|
71
|
-
primaryText: t ?
|
|
72
|
-
secondaryText: t ?
|
|
74
|
+
primaryText: t ? a.ReceiptScanningTitle : e.merchant_name?.trim() || a.ReceiptScanningTitle,
|
|
75
|
+
secondaryText: t ? a.ReceiptScanningSubtitle : m(e.issued_at),
|
|
73
76
|
thumbnailUrl: e.file_url ?? void 0
|
|
74
77
|
};
|
|
75
78
|
}
|
|
76
|
-
function
|
|
79
|
+
function g(e) {
|
|
77
80
|
return {
|
|
78
81
|
id: e.id,
|
|
79
82
|
merchantName: e.merchant_name,
|
|
80
|
-
date:
|
|
81
|
-
formattedAmount:
|
|
83
|
+
date: m(e.started_at),
|
|
84
|
+
formattedAmount: p(e.amount, e.currency)
|
|
82
85
|
};
|
|
83
86
|
}
|
|
84
|
-
var
|
|
85
|
-
function
|
|
86
|
-
let { initResponse:
|
|
87
|
+
var _ = .5, v = 3, y = .25, ie = 5e3, ae = !1;
|
|
88
|
+
function b({ preSelectedIds: m, onClose: b, targetTransactionId: x, onSingleTransactionUpdate: S, enabled: oe = !0 }) {
|
|
89
|
+
let { initResponse: C } = r(), w = i(), se = t(n().organizationStatus), T = C?.userId ?? void 0, ce = oe && !!T && !w, [E, D] = d(1), [O, k] = d(0), [A, j] = d([]), [M, N] = d(() => m), [P, F] = d(""), [I, L] = d([]), le = u(() => I.map((e) => e.id), [I]), [R, z] = d(1), B = ee({
|
|
87
90
|
has_transaction: !1,
|
|
88
|
-
created_by_entity_user_id:
|
|
89
|
-
enabled:
|
|
90
|
-
}), V =
|
|
91
|
-
merchant_name__icontains:
|
|
91
|
+
created_by_entity_user_id: T,
|
|
92
|
+
enabled: ce
|
|
93
|
+
}), V = o({
|
|
94
|
+
merchant_name__icontains: P || void 0,
|
|
92
95
|
has_receipt: !1,
|
|
93
|
-
enabled:
|
|
94
|
-
}), H =
|
|
95
|
-
|
|
96
|
+
enabled: E === 2
|
|
97
|
+
}), H = te(), U = s(), W = B.data?.data ?? [], G = u(() => T ? W.filter((e) => e.created_by_entity_user_id == null || e.created_by_entity_user_id === T) : [], [W, T]);
|
|
98
|
+
l(() => {
|
|
96
99
|
if (!G.some((e) => e.ocr_status === "processing")) return;
|
|
97
100
|
let e = window.setInterval(() => {
|
|
98
101
|
B.isFetching || B.refetch();
|
|
99
|
-
},
|
|
102
|
+
}, ie);
|
|
100
103
|
return () => window.clearInterval(e);
|
|
101
104
|
}, [
|
|
102
105
|
B.isFetching,
|
|
103
106
|
B.refetch,
|
|
104
107
|
G
|
|
105
108
|
]);
|
|
106
|
-
let K =
|
|
107
|
-
if (
|
|
108
|
-
if (!(
|
|
109
|
+
let K = u(() => G.map(h), [G]), q = u(() => new Set(A.flatMap((e) => e.transactionIds)), [A]), J = u(() => (V.data?.data ?? []).filter((e) => !q.has(e.id)).map(g), [V.data, q]), Y = V.data?.data ?? [], X = M[O], Z = u(() => G.find((e) => e.id === X), [G, X]), ue = Z?.file_url ?? void 0, de = Z?.file_name ?? void 0, fe = u(() => {
|
|
110
|
+
if (x) return "Attach";
|
|
111
|
+
if (!(M.length <= 1)) return `Review (${O + 1}/${M.length})`;
|
|
109
112
|
}, [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
]),
|
|
114
|
-
|
|
115
|
-
}, []),
|
|
116
|
-
if (
|
|
117
|
-
|
|
113
|
+
x,
|
|
114
|
+
M.length,
|
|
115
|
+
O
|
|
116
|
+
]), pe = u(() => A.filter((e) => e.receiptId === X).flatMap((e) => e.transactionDetails), [A, X]), me = O >= M.length - 1 ? a.Done : a.ReviewNextReceipt(O + 2, M.length), Q = c(() => {
|
|
117
|
+
F(""), L([]), z(1);
|
|
118
|
+
}, []), he = c((e) => {
|
|
119
|
+
if (x) {
|
|
120
|
+
N((t) => t.includes(e) ? [] : [e]);
|
|
118
121
|
return;
|
|
119
122
|
}
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
-
|
|
123
|
-
}, [K]),
|
|
124
|
-
|
|
125
|
-
}, []),
|
|
123
|
+
N((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
124
|
+
}, [x]), ge = c(() => {
|
|
125
|
+
N(K.map((e) => e.id));
|
|
126
|
+
}, [K]), _e = c(() => {
|
|
127
|
+
N([]);
|
|
128
|
+
}, []), ve = c((e) => {
|
|
126
129
|
let t = G.find((t) => t.id === e);
|
|
127
130
|
t?.file_url && window.open(t.file_url, "_blank", "noopener,noreferrer");
|
|
128
|
-
}, [G]),
|
|
131
|
+
}, [G]), ye = c(async (t) => {
|
|
129
132
|
try {
|
|
130
133
|
await U.mutateAsync({ path: { receipt_id: t } });
|
|
131
134
|
} catch (t) {
|
|
132
|
-
e.error(
|
|
135
|
+
e.error(f(t, "Failed to delete receipt"));
|
|
133
136
|
return;
|
|
134
137
|
}
|
|
135
|
-
|
|
136
|
-
}, [U]),
|
|
137
|
-
if (
|
|
138
|
-
if (
|
|
138
|
+
N((e) => e.filter((e) => e !== t));
|
|
139
|
+
}, [U]), be = c(async () => {
|
|
140
|
+
if (M.length !== 0) {
|
|
141
|
+
if (x) {
|
|
139
142
|
try {
|
|
140
143
|
await H.mutateAsync({
|
|
141
|
-
path: { receipt_id:
|
|
142
|
-
body: { transaction_id:
|
|
143
|
-
}),
|
|
144
|
+
path: { receipt_id: M[0] },
|
|
145
|
+
body: { transaction_id: x }
|
|
146
|
+
}), S?.(), b();
|
|
144
147
|
} catch (t) {
|
|
145
|
-
e.error(
|
|
148
|
+
e.error(f(t, "Failed to attach receipt"));
|
|
146
149
|
}
|
|
147
150
|
return;
|
|
148
151
|
}
|
|
149
|
-
|
|
152
|
+
k(0), j([]), Q(), D(2);
|
|
150
153
|
}
|
|
151
154
|
}, [
|
|
152
|
-
|
|
153
|
-
b,
|
|
154
|
-
H,
|
|
155
|
+
M,
|
|
155
156
|
x,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
H,
|
|
158
|
+
S,
|
|
159
|
+
b,
|
|
160
|
+
Q
|
|
161
|
+
]), xe = c(() => {
|
|
159
162
|
B.refetch();
|
|
160
|
-
}, [B.refetch]),
|
|
161
|
-
|
|
162
|
-
}, []),
|
|
163
|
-
|
|
164
|
-
let n = t.find((t) => t.id === e), r =
|
|
163
|
+
}, [B.refetch]), Se = c((e) => {
|
|
164
|
+
F(e);
|
|
165
|
+
}, []), Ce = c((e) => {
|
|
166
|
+
L((t) => {
|
|
167
|
+
let n = t.find((t) => t.id === e), r = Y.find((t) => t.id === e);
|
|
165
168
|
return n ? [] : r ? [r] : [];
|
|
166
169
|
});
|
|
167
|
-
}, [
|
|
168
|
-
if (
|
|
169
|
-
let t =
|
|
170
|
+
}, [Y]), we = c(async () => {
|
|
171
|
+
if (I.length === 0 || !X) return;
|
|
172
|
+
let t = I, n = (e) => ({
|
|
170
173
|
merchant: e.merchant_name,
|
|
171
174
|
location: e.merchant_location,
|
|
172
175
|
date: ne(e.started_at),
|
|
173
|
-
time:
|
|
174
|
-
formattedAmount:
|
|
176
|
+
time: re(e.started_at),
|
|
177
|
+
formattedAmount: p(e.amount, e.currency)
|
|
175
178
|
}), r = [], i = [];
|
|
176
179
|
for (let a of t) try {
|
|
177
180
|
await H.mutateAsync({
|
|
178
|
-
path: { receipt_id:
|
|
181
|
+
path: { receipt_id: X },
|
|
179
182
|
body: { transaction_id: a.id }
|
|
180
183
|
}), r.push(a.id), i.push(n(a));
|
|
181
184
|
} catch (t) {
|
|
182
|
-
r.length > 0 &&
|
|
183
|
-
receiptId:
|
|
185
|
+
r.length > 0 && j((e) => [...e, {
|
|
186
|
+
receiptId: X,
|
|
184
187
|
transactionIds: r,
|
|
185
188
|
transactionDetails: i
|
|
186
|
-
}]),
|
|
189
|
+
}]), L((e) => e.filter((e) => !r.includes(e.id))), e.error(f(t, "Failed to match receipt"));
|
|
187
190
|
return;
|
|
188
191
|
}
|
|
189
|
-
|
|
190
|
-
receiptId:
|
|
192
|
+
j((e) => [...e, {
|
|
193
|
+
receiptId: X,
|
|
191
194
|
transactionIds: r,
|
|
192
195
|
transactionDetails: i
|
|
193
|
-
}]),
|
|
196
|
+
}]), D(3);
|
|
194
197
|
}, [
|
|
195
|
-
|
|
196
|
-
|
|
198
|
+
I,
|
|
199
|
+
X,
|
|
197
200
|
H
|
|
198
|
-
]),
|
|
201
|
+
]), Te = c(() => {
|
|
199
202
|
V.refetch();
|
|
200
|
-
}, [V.refetch]),
|
|
201
|
-
z((e) => Math.min(e +
|
|
202
|
-
}, []),
|
|
203
|
-
z((e) => Math.max(e -
|
|
204
|
-
}, []), $ =
|
|
205
|
-
if (
|
|
206
|
-
let e = new Set(
|
|
207
|
-
|
|
203
|
+
}, [V.refetch]), Ee = c(() => {
|
|
204
|
+
z((e) => Math.min(e + y, v));
|
|
205
|
+
}, []), De = c(() => {
|
|
206
|
+
z((e) => Math.max(e - y, _));
|
|
207
|
+
}, []), $ = c(() => {
|
|
208
|
+
if (A.length > 0) {
|
|
209
|
+
let e = new Set(A.map((e) => e.receiptId));
|
|
210
|
+
N((t) => t.filter((t) => !e.has(t)));
|
|
208
211
|
}
|
|
209
|
-
|
|
210
|
-
}, [
|
|
211
|
-
let e =
|
|
212
|
-
if (e <
|
|
213
|
-
|
|
212
|
+
Q(), k(0), j([]), D(1);
|
|
213
|
+
}, [Q, A]), Oe = c(() => {
|
|
214
|
+
let e = O + 1;
|
|
215
|
+
if (e < M.length) {
|
|
216
|
+
k(e), Q(), D(2);
|
|
214
217
|
return;
|
|
215
218
|
}
|
|
216
|
-
$(),
|
|
219
|
+
$(), b();
|
|
217
220
|
}, [
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
+
O,
|
|
222
|
+
M.length,
|
|
223
|
+
Q,
|
|
221
224
|
$,
|
|
222
|
-
|
|
225
|
+
b
|
|
223
226
|
]);
|
|
224
227
|
return {
|
|
225
|
-
step:
|
|
228
|
+
step: E,
|
|
226
229
|
receipts: K,
|
|
227
|
-
selectedReceiptIds:
|
|
228
|
-
onSelectAll:
|
|
229
|
-
onReset:
|
|
230
|
-
onReceiptToggle:
|
|
231
|
-
onViewAttachment:
|
|
232
|
-
onDeleteReceipt:
|
|
233
|
-
onReview:
|
|
234
|
-
isReceiptsLoading: B.isLoading || C && !
|
|
230
|
+
selectedReceiptIds: M,
|
|
231
|
+
onSelectAll: ge,
|
|
232
|
+
onReset: _e,
|
|
233
|
+
onReceiptToggle: he,
|
|
234
|
+
onViewAttachment: ve,
|
|
235
|
+
onDeleteReceipt: ye,
|
|
236
|
+
onReview: be,
|
|
237
|
+
isReceiptsLoading: B.isLoading || w && !C || se && !B.data,
|
|
235
238
|
isReceiptsError: B.isError,
|
|
236
|
-
onRetryReceipts:
|
|
237
|
-
showSelectAllButton: !
|
|
238
|
-
receiptPreviewUrl:
|
|
239
|
-
receiptFileName:
|
|
240
|
-
transactions:
|
|
239
|
+
onRetryReceipts: xe,
|
|
240
|
+
showSelectAllButton: !x,
|
|
241
|
+
receiptPreviewUrl: ue,
|
|
242
|
+
receiptFileName: de,
|
|
243
|
+
transactions: J,
|
|
241
244
|
isTransactionsLoading: V.isLoading,
|
|
242
245
|
isTransactionsError: V.isError,
|
|
243
|
-
onRetryTransactions:
|
|
244
|
-
selectedTransactionIds:
|
|
245
|
-
allowMultipleTransactions:
|
|
246
|
-
searchValue:
|
|
247
|
-
onSearchChange:
|
|
248
|
-
onTransactionSelect:
|
|
249
|
-
onConfirmMatch:
|
|
246
|
+
onRetryTransactions: Te,
|
|
247
|
+
selectedTransactionIds: le,
|
|
248
|
+
allowMultipleTransactions: ae,
|
|
249
|
+
searchValue: P,
|
|
250
|
+
onSearchChange: Se,
|
|
251
|
+
onTransactionSelect: Ce,
|
|
252
|
+
onConfirmMatch: we,
|
|
250
253
|
isConfirming: H.isPending,
|
|
251
254
|
zoom: R,
|
|
252
|
-
onZoomIn:
|
|
253
|
-
onZoomOut:
|
|
254
|
-
canZoomIn: R <
|
|
255
|
-
canZoomOut: R >
|
|
256
|
-
matchedTransactions:
|
|
257
|
-
primaryLabel:
|
|
258
|
-
onPrimary:
|
|
255
|
+
onZoomIn: Ee,
|
|
256
|
+
onZoomOut: De,
|
|
257
|
+
canZoomIn: R < v,
|
|
258
|
+
canZoomOut: R > _,
|
|
259
|
+
matchedTransactions: pe,
|
|
260
|
+
primaryLabel: me,
|
|
261
|
+
onPrimary: Oe,
|
|
259
262
|
onCancel: $,
|
|
260
|
-
reviewLabel:
|
|
263
|
+
reviewLabel: fe
|
|
261
264
|
};
|
|
262
265
|
}
|
|
263
266
|
//#endregion
|
|
264
|
-
export {
|
|
267
|
+
export { b as useReceiptMatch };
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { OrganizationStatus as e } from "../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
6
|
+
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
+
import { useAllBankAccountsQuery as n } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
|
|
8
|
+
import { useAllExternalBankAccountsQuery as r } from "../../../shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js";
|
|
7
9
|
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import { useRefetchWidget as
|
|
10
|
+
import { useRefetchWidget as i, useWidgetConfig as a, useWidgetError as o, useWidgetLoading as s } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
11
|
import "../../../shared/feature/dist/index.js";
|
|
10
|
-
import { INSIGHTS_FEATURE_LABELS_EN as
|
|
11
|
-
import { useDismissedInsightIds as
|
|
12
|
-
import { shouldShowRoutingOnboardingInsight as
|
|
13
|
-
import { getInsightsPermissions as
|
|
14
|
-
import { createContext as
|
|
15
|
-
import { jsx as
|
|
12
|
+
import { INSIGHTS_FEATURE_LABELS_EN as c } from "./index3.js";
|
|
13
|
+
import { useDismissedInsightIds as l } from "./index5.js";
|
|
14
|
+
import { shouldShowRoutingOnboardingInsight as u } from "./index6.js";
|
|
15
|
+
import { getInsightsPermissions as d } from "./index7.js";
|
|
16
|
+
import { createContext as f, useCallback as p, useContext as m, useMemo as h, useState as g } from "react";
|
|
17
|
+
import { jsx as ee } from "react/jsx-runtime";
|
|
16
18
|
//#region ../../libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js
|
|
17
|
-
var
|
|
19
|
+
var _ = f({
|
|
18
20
|
activeFilter: "active",
|
|
19
21
|
setActiveFilter: () => {},
|
|
20
22
|
filteredInsights: [],
|
|
@@ -22,13 +24,13 @@ var g = u({
|
|
|
22
24
|
isError: !1,
|
|
23
25
|
refetch: async () => void 0,
|
|
24
26
|
onDismissClick: () => {},
|
|
25
|
-
featureLabels:
|
|
27
|
+
featureLabels: c,
|
|
26
28
|
createdDateLabel: ""
|
|
27
|
-
}),
|
|
28
|
-
let { initResponse:
|
|
29
|
-
...
|
|
30
|
-
...
|
|
31
|
-
}), [
|
|
29
|
+
}), v = () => m(_), y = ({ children: f, routingEnabled: m = !1, onRoutingToggleChange: v, onLinkExternalAccountClick: y, featureLabels: b }) => {
|
|
30
|
+
let { initResponse: x } = a(), te = s(), { organizationStatus: ne } = t(), S = o(), C = i(), w = h(() => u(x?.scopes), [x?.scopes]), { canReadBankAccounts: T, canReadExternalBankAccounts: E } = h(() => d(x?.scopes), [x?.scopes]), D = h(() => ({
|
|
31
|
+
...c,
|
|
32
|
+
...b
|
|
33
|
+
}), [b]), [O, k] = g("active"), [A, j] = g(!1), M = v !== void 0, N = M ? m : A, P = M ? v : j, { dismissedIds: F, isLoading: I, refetch: L, dismissInsight: R } = l(), { data: z, isLoading: B, isError: V, refetch: H } = n({ enabled: T }), { data: U, isLoading: W, isError: G, refetch: K } = r({ enabled: E }), q = z?.data, J = U?.data, Y = !T || q !== void 0 || V, X = !E || J !== void 0 || G, re = ne === e.None, Z = te || B || W || I || !(Y && X) && !S && !re, Q = !!S || (T || E) && !(T && !V) && !(E && !G), ie = p(() => (C(), Promise.all([
|
|
32
34
|
T ? H() : void 0,
|
|
33
35
|
E ? K() : void 0,
|
|
34
36
|
L()
|
|
@@ -39,8 +41,8 @@ var g = u({
|
|
|
39
41
|
L,
|
|
40
42
|
T,
|
|
41
43
|
E
|
|
42
|
-
]),
|
|
43
|
-
if (
|
|
44
|
+
]), ae = h(() => (/* @__PURE__ */ new Date()).toLocaleDateString(), []), $ = h(() => {
|
|
45
|
+
if (Z || Q) return [];
|
|
44
46
|
let e = [];
|
|
45
47
|
if (w && e.push({
|
|
46
48
|
id: "insight-routing-onboarding",
|
|
@@ -63,8 +65,8 @@ var g = u({
|
|
|
63
65
|
canDismiss: !0,
|
|
64
66
|
showToggle: !1,
|
|
65
67
|
displayText: D.connectExternalText,
|
|
66
|
-
actionText:
|
|
67
|
-
onActionClick:
|
|
68
|
+
actionText: y ? D.linkAccountAction : void 0,
|
|
69
|
+
onActionClick: y
|
|
68
70
|
}), J !== void 0) {
|
|
69
71
|
for (let t of J) if (t.verificationStatus !== "VERIFIED") {
|
|
70
72
|
let n = `insight-verify-external-${t.id}`;
|
|
@@ -81,35 +83,35 @@ var g = u({
|
|
|
81
83
|
}, [
|
|
82
84
|
q,
|
|
83
85
|
J,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
Z,
|
|
87
|
+
Q,
|
|
86
88
|
F,
|
|
87
89
|
w,
|
|
88
90
|
N,
|
|
89
91
|
P,
|
|
90
|
-
|
|
92
|
+
y,
|
|
91
93
|
D
|
|
92
|
-
]),
|
|
94
|
+
]), oe = p((e) => {
|
|
93
95
|
R(e);
|
|
94
|
-
}, [R]),
|
|
96
|
+
}, [R]), se = h(() => O === "dismissed" ? $.filter((e) => F.includes(e.id)) : $.filter((e) => !F.includes(e.id)), [
|
|
95
97
|
$,
|
|
96
98
|
O,
|
|
97
99
|
F
|
|
98
100
|
]);
|
|
99
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ ee(_.Provider, {
|
|
100
102
|
value: {
|
|
101
103
|
activeFilter: O,
|
|
102
104
|
setActiveFilter: k,
|
|
103
|
-
filteredInsights:
|
|
104
|
-
isLoading:
|
|
105
|
-
isError:
|
|
106
|
-
refetch:
|
|
107
|
-
onDismissClick:
|
|
105
|
+
filteredInsights: se,
|
|
106
|
+
isLoading: Z,
|
|
107
|
+
isError: Q,
|
|
108
|
+
refetch: ie,
|
|
109
|
+
onDismissClick: oe,
|
|
108
110
|
featureLabels: D,
|
|
109
|
-
createdDateLabel:
|
|
111
|
+
createdDateLabel: ae
|
|
110
112
|
},
|
|
111
|
-
children:
|
|
113
|
+
children: f
|
|
112
114
|
});
|
|
113
115
|
};
|
|
114
116
|
//#endregion
|
|
115
|
-
export {
|
|
117
|
+
export { y as InsightsWidgetContextProvider, v as useInsightsWidgetContext };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useSendReceivableEmailMutation as a } from "./index5.js";
|
|
|
7
7
|
import { useAcceptReceivableMutation as o, useCancelReceivableMutation as s, useCloneReceivableMutation as c, useCreateReceivableMutation as l, useDeclineReceivableMutation as u, useDeleteReceivableMutation as d, useIssueReceivableMutation as f, useUpdateReceivableMutation as p } from "./index7.js";
|
|
8
8
|
import "./index8.js";
|
|
9
9
|
import { useMarkReceivablePaidMutation as m, useMarkReceivablePartiallyPaidMutation as h, useMarkReceivableUncollectibleMutation as g } from "./index9.js";
|
|
10
|
-
import { useReceivableHistoryQuery as _, useReceivableMailsQuery as v, useReceivablePdfLinkQuery as y, useReceivableQuery as b,
|
|
11
|
-
import { useCreateOverdueReminderMutation as
|
|
12
|
-
import { useReceivablesAnalyticsQuery as
|
|
13
|
-
export { o as useAcceptReceivableMutation, s as useCancelReceivableMutation, c as useCloneReceivableMutation, t as useCreateEntityBankAccountMutation,
|
|
10
|
+
import { useReceivableHistoryQuery as _, useReceivableMailsQuery as v, useReceivablePdfLinkQuery as y, useReceivableQuery as b, useReceivableRequiredFieldsQuery as x, useReceivablesQuery as S } from "./index10.js";
|
|
11
|
+
import { useCreateOverdueReminderMutation as C, useCreatePaymentReminderMutation as w, useCreateRecurrenceMutation as T, useOverdueRemindersQuery as E, usePaymentRemindersQuery as D, useRecurrenceQuery as O, useUpdateRecurrenceMutation as k } from "./index11.js";
|
|
12
|
+
import { useReceivablesAnalyticsQuery as A } from "./index12.js";
|
|
13
|
+
export { o as useAcceptReceivableMutation, s as useCancelReceivableMutation, c as useCloneReceivableMutation, t as useCreateEntityBankAccountMutation, C as useCreateOverdueReminderMutation, w as useCreatePaymentReminderMutation, l as useCreateReceivableMutation, T as useCreateRecurrenceMutation, u as useDeclineReceivableMutation, r as useDeleteReceivableAttachmentMutation, d as useDeleteReceivableMutation, f as useIssueReceivableMutation, m as useMarkReceivablePaidMutation, h as useMarkReceivablePartiallyPaidMutation, g as useMarkReceivableUncollectibleMutation, E as useOverdueRemindersQuery, n as usePaymentAccountsQuery, D as usePaymentRemindersQuery, e as usePaymentTermsQuery, _ as useReceivableHistoryQuery, v as useReceivableMailsQuery, y as useReceivablePdfLinkQuery, b as useReceivableQuery, x as useReceivableRequiredFieldsQuery, A as useReceivablesAnalyticsQuery, S as useReceivablesQuery, O as useRecurrenceQuery, a as useSendReceivableEmailMutation, p as useUpdateReceivableMutation, k as useUpdateRecurrenceMutation, i as useUploadReceivableAttachmentMutation };
|