@tesouro/embedded-components-react 0.5.230 → 0.5.231
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 +10 -0
- package/dist/index.d.ts +22 -21
- package/dist/index.js +2 -2
- package/dist/lib/ExpenseManagementWidget.d.ts +22 -21
- package/dist/lib/ExpenseManagementWidget.js +1 -1
- package/dist/lib/UploadReceiptWidget.d.ts +2 -2
- package/dist/lib/UploadReceiptWidget.js +2 -2
- package/dist/lib/WidgetSuite.d.ts +17 -15
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index2.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index24.js → approval-policies/feature/dist/index3.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index25.js → approval-policies/feature/dist/index4.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index26.js → approval-policies/feature/dist/index5.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index27.js → approval-policies/feature/dist/index6.js} +53 -53
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/types.js → approval-policies/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js → approval-policies/ui/dist/index3.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/conditionLabel.js → approval-policies/ui/dist/index4.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/EmptyApprovalRules.js → approval-policies/ui/dist/index5.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleCard.js → approval-policies/ui/dist/index6.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleForm.js → approval-policies/ui/dist/index7.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js → approval-policies/ui/dist/index8.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index.js +18 -19
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/invalidation.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index20.js → lib/invalidateTransactionViews.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index10.js → lib/queryKeys.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index5.js → lib/useEntityUsersByIdsQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index8.js → lib/useExpenseHistoryQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index7.js → lib/useExpenseLedgerAccountsQuery.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index17.js → lib/useExpenseReceiptsCountQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index16.js → lib/useExpenseTransactionIdsQuery.js} +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index15.js → lib/useExpenseTransactionsCountQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index19.js → lib/useGetApprovalRequestsQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index9.js → lib/useGetTransactionQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index3.js → lib/useGetTransactionsQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/lib/useHasDirectReportsQuery.js +34 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index4.js → lib/useOrganizationDepartmentsQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index6.js → lib/useOrganizationLocationsQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index11.js → lib/usePatchReceiptMutation.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index14.js → lib/useTrackReceiptMatching.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index21.js → lib/useTransactionReviewMutations.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index18.js → lib/useTransactionValidationsQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index13.js → lib/useUploadReceiptMutation.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +77 -160
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +356 -63
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +36 -71
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +130 -344
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index14.js +223 -36
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index15.js +192 -137
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index16.js +11 -227
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index17.js +81 -186
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index18.js +37 -11
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index19.js +309 -82
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index2.js +30 -87
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index20.js +1 -39
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +23 -257
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index7.js +160 -59
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +62 -28
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +28 -18
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{data-access → receipt-match/data-access}/dist/index2.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index3.js +40 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +256 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index3.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +65 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/labels.js → receipt-match/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptInboxItem.js → receipt-match/ui/dist/index3.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptInboxStep.js → receipt-match/ui/dist/index4.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/TransactionsMatchStep.js → receipt-match/ui/dist/index5.js} +27 -27
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/MatchConfirmationStep.js → receipt-match/ui/dist/index6.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchSidebar.js → receipt-match/ui/dist/index7.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchLauncher.js → receipt-match/ui/dist/index8.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/index.js +9 -28
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +7 -12
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +1 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +61 -55
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +42 -44
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +137 -138
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +82 -80
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui → util}/dist/lib/isPdf.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/util/dist/lib/widgetName.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.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/util/dist/lib/formatTimestampDate.js +13 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index2.js +91 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/labels.js → upload-receipt-widget/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/UploadReceiptButton.js → upload-receipt-widget/ui/dist/index3.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/UploadReceiptModal.js → upload-receipt-widget/ui/dist/index4.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index11.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index12.js +0 -39
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index21.js +0 -297
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index22.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index23.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/labels.js +0 -13
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { getReceiptsOptions as e } from "
|
|
6
|
-
import { withAuthEpoch as t } from "
|
|
7
|
-
import { useEmbedApi as n } from "
|
|
8
|
-
import "
|
|
5
|
+
import { getReceiptsOptions 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 "../../../../shared/data-access/dist/index.js";
|
|
9
9
|
import { useQuery as r } from "@tanstack/react-query";
|
|
10
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index2.js
|
|
10
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index2.js
|
|
11
11
|
function i({ enabled: i, ...a } = {}) {
|
|
12
12
|
let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationStatus: u } = n(), d = !!(s && c) && (i === !0 || i === void 0), f = e({
|
|
13
13
|
query: a,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { deleteReceiptsIdMutation as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
|
+
import { invalidateAllClients as t } from "../../../../shared/data-access/dist/lib/clientRegistry.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";
|
|
9
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
10
|
+
import { analyticsReceiptsInvalidationKey as i, receiptsInvalidationKey as a, transactionsInvalidationKey as o } from "../../../data-access/dist/lib/queryKeys.js";
|
|
11
|
+
import "../../../data-access/dist/invalidation.js";
|
|
12
|
+
import { useMutation as s } from "@tanstack/react-query";
|
|
13
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index3.js
|
|
14
|
+
function c() {
|
|
15
|
+
let { client: c, organizationId: l } = n();
|
|
16
|
+
return s({
|
|
17
|
+
...e({
|
|
18
|
+
client: c,
|
|
19
|
+
headers: r(l)
|
|
20
|
+
}),
|
|
21
|
+
onSuccess: async () => {
|
|
22
|
+
await Promise.all([
|
|
23
|
+
t(a({
|
|
24
|
+
client: c,
|
|
25
|
+
organizationId: l
|
|
26
|
+
})),
|
|
27
|
+
t(i({
|
|
28
|
+
client: c,
|
|
29
|
+
organizationId: l
|
|
30
|
+
})),
|
|
31
|
+
t(o({
|
|
32
|
+
client: c,
|
|
33
|
+
organizationId: l
|
|
34
|
+
}))
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { c as useDeleteReceiptMutation };
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { formatCalendarDate as t } from "../../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
7
|
+
import { formatTimestampDate as n } from "../../../../shared/util/dist/lib/formatTimestampDate.js";
|
|
8
|
+
import { isOrganizationOnItsWay as r } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
9
|
+
import { useEmbedApi as i } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
11
|
+
import "../../../../shared/ui/dist/index.js";
|
|
12
|
+
import { useWidgetConfig as a, useWidgetLoading as ee } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
13
|
+
import "../../../../shared/feature/dist/index.js";
|
|
14
|
+
import { useGetTransactionsQuery as te } from "../../../data-access/dist/lib/useGetTransactionsQuery.js";
|
|
15
|
+
import { usePatchReceiptMutation as ne } from "../../../data-access/dist/lib/usePatchReceiptMutation.js";
|
|
16
|
+
import "../../../data-access/dist/index.js";
|
|
17
|
+
import { ReceiptMatchLabels as o } from "../../ui/dist/index2.js";
|
|
18
|
+
import "../../ui/dist/index.js";
|
|
19
|
+
import { useGetReceiptsQuery as s } from "../../data-access/dist/index2.js";
|
|
20
|
+
import { useDeleteReceiptMutation as re } from "../../data-access/dist/index3.js";
|
|
21
|
+
import "../../data-access/dist/index.js";
|
|
22
|
+
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
23
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js
|
|
24
|
+
function f(e, t) {
|
|
25
|
+
if (typeof e == "object" && e) {
|
|
26
|
+
let t = e.error;
|
|
27
|
+
if (typeof t == "object" && t) {
|
|
28
|
+
let e = t.message;
|
|
29
|
+
if (typeof e == "string") return e;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return e instanceof Error && e.message ? e.message : t;
|
|
33
|
+
}
|
|
34
|
+
function p(e, t) {
|
|
35
|
+
let n = e / 100;
|
|
36
|
+
try {
|
|
37
|
+
return new Intl.NumberFormat("en-US", {
|
|
38
|
+
style: "currency",
|
|
39
|
+
currency: t
|
|
40
|
+
}).format(n);
|
|
41
|
+
} catch {
|
|
42
|
+
return `${t} ${n.toFixed(2)}`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
var m = /^\d{4}-\d{2}-\d{2}$/;
|
|
46
|
+
function h(e) {
|
|
47
|
+
return e ? m.test(e) ? t(e) : n(e) : "";
|
|
48
|
+
}
|
|
49
|
+
function ie(e) {
|
|
50
|
+
if (!e) return "";
|
|
51
|
+
let t = new Date(e);
|
|
52
|
+
return Number.isNaN(t.getTime()) ? "" : t.toLocaleTimeString("en-US", {
|
|
53
|
+
hour: "numeric",
|
|
54
|
+
minute: "2-digit",
|
|
55
|
+
second: "2-digit",
|
|
56
|
+
hour12: !0
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function g(e) {
|
|
60
|
+
let t = e.ocr_status === "processing";
|
|
61
|
+
return {
|
|
62
|
+
id: e.id,
|
|
63
|
+
primaryText: t ? o.ReceiptScanningTitle : e.merchant_name?.trim() || o.ReceiptScanningTitle,
|
|
64
|
+
secondaryText: t ? o.ReceiptScanningSubtitle : h(e.issued_at),
|
|
65
|
+
thumbnailUrl: e.file_url ?? void 0
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function ae(e) {
|
|
69
|
+
return {
|
|
70
|
+
id: e.id,
|
|
71
|
+
merchantName: e.merchant_name,
|
|
72
|
+
date: n(e.started_at),
|
|
73
|
+
formattedAmount: p(e.amount, e.currency)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
var _ = .5, v = 3, y = .25, oe = 5e3, b = !1;
|
|
77
|
+
function x({ preSelectedIds: t, onClose: m, targetTransactionId: h, onSingleTransactionUpdate: x, enabled: S = !0 }) {
|
|
78
|
+
let { initResponse: C } = a(), w = ee(), se = r(i().organizationStatus), T = C?.userId ?? void 0, ce = S && !!T && !w, [E, D] = d(1), [O, k] = d(0), [A, j] = d([]), [M, N] = d(() => t), [P, F] = d(""), [I, L] = d([]), le = u(() => I.map((e) => e.id), [I]), [R, z] = d(1), B = s({
|
|
79
|
+
has_transaction: !1,
|
|
80
|
+
created_by_entity_user_id: T,
|
|
81
|
+
enabled: ce
|
|
82
|
+
}), V = te({
|
|
83
|
+
merchant_name__icontains: P || void 0,
|
|
84
|
+
has_receipt: !1,
|
|
85
|
+
enabled: E === 2
|
|
86
|
+
}), H = ne(), U = re(), 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]);
|
|
87
|
+
l(() => {
|
|
88
|
+
if (!G.some((e) => e.ocr_status === "processing")) return;
|
|
89
|
+
let e = window.setInterval(() => {
|
|
90
|
+
B.isFetching || B.refetch();
|
|
91
|
+
}, oe);
|
|
92
|
+
return () => window.clearInterval(e);
|
|
93
|
+
}, [
|
|
94
|
+
B.isFetching,
|
|
95
|
+
B.refetch,
|
|
96
|
+
G
|
|
97
|
+
]);
|
|
98
|
+
let K = u(() => G.map(g), [G]), q = u(() => new Set(A.flatMap((e) => e.transactionIds)), [A]), ue = u(() => (V.data?.data ?? []).filter((e) => !q.has(e.id)).map(ae), [V.data, q]), J = V.data?.data ?? [], Y = M[O], X = u(() => G.find((e) => e.id === Y), [G, Y]), de = X?.file_url ?? void 0, fe = X?.file_name ?? void 0, Z = u(() => {
|
|
99
|
+
if (h) return "Attach";
|
|
100
|
+
if (!(M.length <= 1)) return `Review (${O + 1}/${M.length})`;
|
|
101
|
+
}, [
|
|
102
|
+
h,
|
|
103
|
+
M.length,
|
|
104
|
+
O
|
|
105
|
+
]), pe = u(() => A.filter((e) => e.receiptId === Y).flatMap((e) => e.transactionDetails), [A, Y]), me = O >= M.length - 1 ? o.Done : o.ReviewNextReceipt(O + 2, M.length), Q = c(() => {
|
|
106
|
+
F(""), L([]), z(1);
|
|
107
|
+
}, []), he = c((e) => {
|
|
108
|
+
if (h) {
|
|
109
|
+
N((t) => t.includes(e) ? [] : [e]);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
N((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
113
|
+
}, [h]), ge = c(() => {
|
|
114
|
+
N(K.map((e) => e.id));
|
|
115
|
+
}, [K]), _e = c(() => {
|
|
116
|
+
N([]);
|
|
117
|
+
}, []), ve = c((e) => {
|
|
118
|
+
let t = G.find((t) => t.id === e);
|
|
119
|
+
t?.file_url && window.open(t.file_url, "_blank", "noopener,noreferrer");
|
|
120
|
+
}, [G]), ye = c(async (t) => {
|
|
121
|
+
try {
|
|
122
|
+
await U.mutateAsync({ path: { receipt_id: t } });
|
|
123
|
+
} catch (t) {
|
|
124
|
+
e.error(f(t, "Failed to delete receipt"));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
N((e) => e.filter((e) => e !== t));
|
|
128
|
+
}, [U]), be = c(async () => {
|
|
129
|
+
if (M.length !== 0) {
|
|
130
|
+
if (h) {
|
|
131
|
+
try {
|
|
132
|
+
await H.mutateAsync({
|
|
133
|
+
path: { receipt_id: M[0] },
|
|
134
|
+
body: { transaction_id: h }
|
|
135
|
+
}), x?.(), m();
|
|
136
|
+
} catch (t) {
|
|
137
|
+
e.error(f(t, "Failed to attach receipt"));
|
|
138
|
+
}
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
k(0), j([]), Q(), D(2);
|
|
142
|
+
}
|
|
143
|
+
}, [
|
|
144
|
+
M,
|
|
145
|
+
h,
|
|
146
|
+
H,
|
|
147
|
+
x,
|
|
148
|
+
m,
|
|
149
|
+
Q
|
|
150
|
+
]), xe = c(() => {
|
|
151
|
+
B.refetch();
|
|
152
|
+
}, [B.refetch]), Se = c((e) => {
|
|
153
|
+
F(e);
|
|
154
|
+
}, []), Ce = c((e) => {
|
|
155
|
+
L((t) => {
|
|
156
|
+
let n = t.find((t) => t.id === e), r = J.find((t) => t.id === e);
|
|
157
|
+
return n ? [] : r ? [r] : [];
|
|
158
|
+
});
|
|
159
|
+
}, [J]), we = c(async () => {
|
|
160
|
+
if (I.length === 0 || !Y) return;
|
|
161
|
+
let t = I, r = (e) => ({
|
|
162
|
+
merchant: e.merchant_name,
|
|
163
|
+
location: e.merchant_location,
|
|
164
|
+
date: n(e.started_at, { month: "long" }),
|
|
165
|
+
time: ie(e.started_at),
|
|
166
|
+
formattedAmount: p(e.amount, e.currency)
|
|
167
|
+
}), i = [], a = [];
|
|
168
|
+
for (let n of t) try {
|
|
169
|
+
await H.mutateAsync({
|
|
170
|
+
path: { receipt_id: Y },
|
|
171
|
+
body: { transaction_id: n.id }
|
|
172
|
+
}), i.push(n.id), a.push(r(n));
|
|
173
|
+
} catch (t) {
|
|
174
|
+
i.length > 0 && j((e) => [...e, {
|
|
175
|
+
receiptId: Y,
|
|
176
|
+
transactionIds: i,
|
|
177
|
+
transactionDetails: a
|
|
178
|
+
}]), L((e) => e.filter((e) => !i.includes(e.id))), e.error(f(t, "Failed to match receipt"));
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
j((e) => [...e, {
|
|
182
|
+
receiptId: Y,
|
|
183
|
+
transactionIds: i,
|
|
184
|
+
transactionDetails: a
|
|
185
|
+
}]), D(3);
|
|
186
|
+
}, [
|
|
187
|
+
I,
|
|
188
|
+
Y,
|
|
189
|
+
H
|
|
190
|
+
]), Te = c(() => {
|
|
191
|
+
V.refetch();
|
|
192
|
+
}, [V.refetch]), Ee = c(() => {
|
|
193
|
+
z((e) => Math.min(e + y, v));
|
|
194
|
+
}, []), De = c(() => {
|
|
195
|
+
z((e) => Math.max(e - y, _));
|
|
196
|
+
}, []), $ = c(() => {
|
|
197
|
+
if (A.length > 0) {
|
|
198
|
+
let e = new Set(A.map((e) => e.receiptId));
|
|
199
|
+
N((t) => t.filter((t) => !e.has(t)));
|
|
200
|
+
}
|
|
201
|
+
Q(), k(0), j([]), D(1);
|
|
202
|
+
}, [Q, A]), Oe = c(() => {
|
|
203
|
+
let e = O + 1;
|
|
204
|
+
if (e < M.length) {
|
|
205
|
+
k(e), Q(), D(2);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
$(), m();
|
|
209
|
+
}, [
|
|
210
|
+
O,
|
|
211
|
+
M.length,
|
|
212
|
+
Q,
|
|
213
|
+
$,
|
|
214
|
+
m
|
|
215
|
+
]);
|
|
216
|
+
return {
|
|
217
|
+
step: E,
|
|
218
|
+
receipts: K,
|
|
219
|
+
selectedReceiptIds: M,
|
|
220
|
+
onSelectAll: ge,
|
|
221
|
+
onReset: _e,
|
|
222
|
+
onReceiptToggle: he,
|
|
223
|
+
onViewAttachment: ve,
|
|
224
|
+
onDeleteReceipt: ye,
|
|
225
|
+
onReview: be,
|
|
226
|
+
isReceiptsLoading: B.isLoading || w && !C || se && !B.data,
|
|
227
|
+
isReceiptsError: B.isError,
|
|
228
|
+
onRetryReceipts: xe,
|
|
229
|
+
showSelectAllButton: !h,
|
|
230
|
+
receiptPreviewUrl: de,
|
|
231
|
+
receiptFileName: fe,
|
|
232
|
+
transactions: ue,
|
|
233
|
+
isTransactionsLoading: V.isLoading,
|
|
234
|
+
isTransactionsError: V.isError,
|
|
235
|
+
onRetryTransactions: Te,
|
|
236
|
+
selectedTransactionIds: le,
|
|
237
|
+
allowMultipleTransactions: b,
|
|
238
|
+
searchValue: P,
|
|
239
|
+
onSearchChange: Se,
|
|
240
|
+
onTransactionSelect: Ce,
|
|
241
|
+
onConfirmMatch: we,
|
|
242
|
+
isConfirming: H.isPending,
|
|
243
|
+
zoom: R,
|
|
244
|
+
onZoomIn: Ee,
|
|
245
|
+
onZoomOut: De,
|
|
246
|
+
canZoomIn: R < v,
|
|
247
|
+
canZoomOut: R > _,
|
|
248
|
+
matchedTransactions: pe,
|
|
249
|
+
primaryLabel: me,
|
|
250
|
+
onPrimary: Oe,
|
|
251
|
+
onCancel: $,
|
|
252
|
+
reviewLabel: Z
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
256
|
+
export { x as useReceiptMatch };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EXPENSE_MANAGEMENT_WIDGET_NAME as e } from "../../../util/dist/lib/widgetName.js";
|
|
2
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index3.js
|
|
3
|
+
var t = `${e}.receipt_match`, n = { Mounted: `${t}.mounted` };
|
|
4
|
+
//#endregion
|
|
5
|
+
export { n as ReceiptMatchAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { EmbeddedToaster as e } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
6
|
+
import "../../../../shared/ui/dist/index.js";
|
|
7
|
+
import { useAnalyticsTrack as t } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
8
|
+
import { WidgetProvider as n } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
9
|
+
import "../../../../shared/feature/dist/index.js";
|
|
10
|
+
import { ReceiptMatchSidebar as r } from "../../ui/dist/index7.js";
|
|
11
|
+
import "../../ui/dist/index.js";
|
|
12
|
+
import { useReceiptMatch as i } from "./index2.js";
|
|
13
|
+
import { ReceiptMatchAnalyticsEvent as a, WIDGET_NAME as o } from "./index3.js";
|
|
14
|
+
import { useCallback as s, useEffect as c, useState as l } from "react";
|
|
15
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
16
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js
|
|
17
|
+
function p({ isOpen: n = !1, preSelectedReceiptIds: o = [], onClose: l, targetTransactionId: p, onSingleTransactionUpdate: m }) {
|
|
18
|
+
let h = t();
|
|
19
|
+
c(() => {
|
|
20
|
+
h(a.Mounted);
|
|
21
|
+
}, [h]);
|
|
22
|
+
let g = i({
|
|
23
|
+
preSelectedIds: o,
|
|
24
|
+
onClose: l,
|
|
25
|
+
targetTransactionId: p,
|
|
26
|
+
onSingleTransactionUpdate: m,
|
|
27
|
+
enabled: n
|
|
28
|
+
}), _ = s(() => {
|
|
29
|
+
g.onCancel(), l();
|
|
30
|
+
}, [g.onCancel, l]);
|
|
31
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(e, {}), /* @__PURE__ */ d(r, {
|
|
32
|
+
open: n,
|
|
33
|
+
onClose: _,
|
|
34
|
+
...g
|
|
35
|
+
})] });
|
|
36
|
+
}
|
|
37
|
+
function m({ isOpen: e, onClose: t, ...n }) {
|
|
38
|
+
let [r, i] = l(!!e);
|
|
39
|
+
c(() => {
|
|
40
|
+
i(!!e);
|
|
41
|
+
}, [e]);
|
|
42
|
+
let a = s(() => {
|
|
43
|
+
i(!1), t?.();
|
|
44
|
+
}, [t]);
|
|
45
|
+
return /* @__PURE__ */ d(p, {
|
|
46
|
+
isOpen: r,
|
|
47
|
+
onClose: a,
|
|
48
|
+
...n
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function h({ isOpen: e, preSelectedReceiptIds: t, onClose: r, targetTransactionId: i, onSingleTransactionUpdate: a, ...s }) {
|
|
52
|
+
return /* @__PURE__ */ d(n, {
|
|
53
|
+
...s,
|
|
54
|
+
widgetName: o,
|
|
55
|
+
children: /* @__PURE__ */ d(m, {
|
|
56
|
+
isOpen: e,
|
|
57
|
+
preSelectedReceiptIds: t,
|
|
58
|
+
onClose: r,
|
|
59
|
+
targetTransactionId: i,
|
|
60
|
+
onSingleTransactionUpdate: a
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { h as ReceiptMatchWidget };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReceiptMatchLabels as e } from "./index2.js";
|
|
2
|
+
import "./index3.js";
|
|
3
|
+
import "./index4.js";
|
|
4
|
+
import "./index5.js";
|
|
5
|
+
import "./index6.js";
|
|
6
|
+
import { ReceiptMatchSidebar as t } from "./index7.js";
|
|
7
|
+
import "./index8.js";
|
|
8
|
+
export { e as ReceiptMatchLabels, t as ReceiptMatchSidebar };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index2.js
|
|
2
2
|
var e = {
|
|
3
3
|
ReceiptPdfPreviewTitle: "Receipt PDF preview",
|
|
4
4
|
DialogTitle: "Match receipt to transaction",
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuTrigger as i } from "
|
|
6
|
-
import { ReceiptMatchLabels as a } from "./
|
|
5
|
+
import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuTrigger as i } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { ReceiptMatchLabels as a } from "./index2.js";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
8
|
import { FileText as c, ImageOff as l, MoreVertical as u, Search as d, Trash2 as f } from "lucide-react";
|
|
9
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
9
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index3.js
|
|
10
10
|
function p(e) {
|
|
11
11
|
if (!e) return "missing";
|
|
12
12
|
let t = e.split(/[?#]/)[0].toLowerCase();
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Button as e, Skeleton as t } from "
|
|
6
|
-
import { ErrorState as n } from "
|
|
7
|
-
import "
|
|
8
|
-
import { ReceiptMatchLabels as r } from "./
|
|
9
|
-
import { ReceiptInboxItem as i } from "./
|
|
5
|
+
import { Button as e, Skeleton as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { ErrorState as n } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
7
|
+
import "../../../../shared/ui/dist/index.js";
|
|
8
|
+
import { ReceiptMatchLabels as r } from "./index2.js";
|
|
9
|
+
import { ReceiptInboxItem as i } from "./index3.js";
|
|
10
10
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
11
11
|
import { ArrowRight as s, FileText as c, X as l } from "lucide-react";
|
|
12
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
12
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index4.js
|
|
13
13
|
var u = 4;
|
|
14
14
|
function d({ receipts: t, selectedReceiptIds: d, onSelectAll: p, onReset: m, onReceiptToggle: h, onViewAttachment: g, onDeleteReceipt: _, onReview: v, onClose: y, reviewLabel: b, isLoading: x = !1, isError: S = !1, onRetry: C, showSelectAllButton: w = !0 }) {
|
|
15
15
|
return /* @__PURE__ */ o("div", {
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Button as e, Input as t, Skeleton as n } from "
|
|
6
|
-
import { ErrorState as r } from "
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { Button as e, Input as t, Skeleton as n } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { ErrorState as r } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
7
|
+
import "../../../../shared/ui/dist/index.js";
|
|
8
|
+
import { isPdf as i } from "../../../util/dist/lib/isPdf.js";
|
|
9
|
+
import { ReceiptMatchLabels as a } from "./index2.js";
|
|
10
10
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
11
11
|
import { Check as c, DollarSign as l, Loader2 as u, Search as d, X as f, ZoomIn as p, ZoomOut as m } from "lucide-react";
|
|
12
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
12
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index5.js
|
|
13
13
|
var h = 5;
|
|
14
|
-
function g({ receiptPreviewUrl: n, receiptFileName:
|
|
14
|
+
function g({ receiptPreviewUrl: n, receiptFileName: i, transactions: g, selectedTransactionIds: y, allowMultipleTransactions: b = !1, searchValue: x, onSearchChange: S, onTransactionSelect: C, onConfirmMatch: w, isConfirming: T = !1, zoom: E = 1, onZoomIn: D, onZoomOut: O, canZoomIn: k = !0, canZoomOut: A = !0, showZoomControls: j = !!(n && (D || O)), onCancel: M, onClose: N, isLoading: P = !1, isError: F = !1, onRetry: I }) {
|
|
15
15
|
return /* @__PURE__ */ s("div", {
|
|
16
16
|
className: "ttw:flex ttw:w-full ttw:h-full",
|
|
17
17
|
children: [/* @__PURE__ */ s("div", {
|
|
18
18
|
className: "ttw:w-110 ttw:ml-auto ttw:bg-muted ttw:relative ttw:flex ttw:items-center ttw:justify-center ttw:overflow-hidden",
|
|
19
19
|
children: [n && /* @__PURE__ */ o(v, {
|
|
20
20
|
url: n,
|
|
21
|
-
fileName:
|
|
21
|
+
fileName: i,
|
|
22
22
|
zoom: E
|
|
23
23
|
}), j && /* @__PURE__ */ s("div", {
|
|
24
24
|
className: "ttw:absolute ttw:bottom-4 ttw:left-4 ttw:flex ttw:items-center ttw:border ttw:rounded-[14px] ttw:border-border ttw:bg-card",
|
|
@@ -28,7 +28,7 @@ function g({ receiptPreviewUrl: n, receiptFileName: a, transactions: g, selected
|
|
|
28
28
|
size: "icon-sm",
|
|
29
29
|
onClick: O,
|
|
30
30
|
disabled: !O || !A,
|
|
31
|
-
"aria-label":
|
|
31
|
+
"aria-label": a.ZoomOut,
|
|
32
32
|
className: "ttw:rounded-none ttw:rounded-tl-[14px] ttw:rounded-bl-[14px]",
|
|
33
33
|
children: /* @__PURE__ */ o(m, { className: "ttw:size-4" })
|
|
34
34
|
}),
|
|
@@ -38,7 +38,7 @@ function g({ receiptPreviewUrl: n, receiptFileName: a, transactions: g, selected
|
|
|
38
38
|
size: "icon-sm",
|
|
39
39
|
onClick: D,
|
|
40
40
|
disabled: !D || !k,
|
|
41
|
-
"aria-label":
|
|
41
|
+
"aria-label": a.ZoomIn,
|
|
42
42
|
className: "ttw:rounded-none ttw:rounded-tr-[14px] ttw:rounded-br-[14px]",
|
|
43
43
|
children: /* @__PURE__ */ o(p, { className: "ttw:size-4" })
|
|
44
44
|
})
|
|
@@ -51,13 +51,13 @@ function g({ receiptPreviewUrl: n, receiptFileName: a, transactions: g, selected
|
|
|
51
51
|
className: "ttw:flex ttw:items-center ttw:justify-between ttw:px-6 ttw:pt-5 ttw:pb-2",
|
|
52
52
|
children: [/* @__PURE__ */ o("h2", {
|
|
53
53
|
className: "ttw:text-lg ttw:font-semibold",
|
|
54
|
-
children:
|
|
54
|
+
children: a.TransactionsTitle
|
|
55
55
|
}), /* @__PURE__ */ o(e, {
|
|
56
56
|
variant: "ghost",
|
|
57
57
|
size: "sm",
|
|
58
58
|
className: "ttw:p-1 ttw:h-auto",
|
|
59
59
|
onClick: N,
|
|
60
|
-
"aria-label":
|
|
60
|
+
"aria-label": a.Close,
|
|
61
61
|
children: /* @__PURE__ */ o(f, { size: 18 })
|
|
62
62
|
})]
|
|
63
63
|
}),
|
|
@@ -71,7 +71,7 @@ function g({ receiptPreviewUrl: n, receiptFileName: a, transactions: g, selected
|
|
|
71
71
|
}), /* @__PURE__ */ o(t, {
|
|
72
72
|
value: x,
|
|
73
73
|
onChange: (e) => S(e.target.value),
|
|
74
|
-
placeholder:
|
|
74
|
+
placeholder: a.SearchPlaceholder,
|
|
75
75
|
className: "ttw:pl-9!"
|
|
76
76
|
})]
|
|
77
77
|
})
|
|
@@ -85,15 +85,15 @@ function g({ receiptPreviewUrl: n, receiptFileName: a, transactions: g, selected
|
|
|
85
85
|
}),
|
|
86
86
|
/* @__PURE__ */ o("span", {
|
|
87
87
|
className: "ttw:flex-1 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
|
|
88
|
-
children:
|
|
88
|
+
children: a.Merchant
|
|
89
89
|
}),
|
|
90
90
|
/* @__PURE__ */ o("span", {
|
|
91
91
|
className: "ttw:w-24 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
|
|
92
|
-
children:
|
|
92
|
+
children: a.Date
|
|
93
93
|
}),
|
|
94
94
|
/* @__PURE__ */ o("span", {
|
|
95
95
|
className: "ttw:w-20 ttw:text-xs ttw:font-medium ttw:text-muted-foreground ttw:text-right",
|
|
96
|
-
children:
|
|
96
|
+
children: a.Amount
|
|
97
97
|
})
|
|
98
98
|
]
|
|
99
99
|
}),
|
|
@@ -104,13 +104,13 @@ function g({ receiptPreviewUrl: n, receiptFileName: a, transactions: g, selected
|
|
|
104
104
|
role: "status",
|
|
105
105
|
children: [/* @__PURE__ */ o("span", {
|
|
106
106
|
className: "ttw:sr-only",
|
|
107
|
-
children:
|
|
107
|
+
children: a.LoadingTransactions
|
|
108
108
|
}), Array.from({ length: h }).map((e, t) => /* @__PURE__ */ o(_, {}, t))]
|
|
109
109
|
}),
|
|
110
110
|
!P && F && /* @__PURE__ */ o(r, {
|
|
111
|
-
title:
|
|
112
|
-
description:
|
|
113
|
-
retryLabel:
|
|
111
|
+
title: a.TransactionsErrorTitle,
|
|
112
|
+
description: a.TransactionsErrorSubtitle,
|
|
113
|
+
retryLabel: a.Retry,
|
|
114
114
|
onRetry: I
|
|
115
115
|
}),
|
|
116
116
|
!P && !F && g.length === 0 && /* @__PURE__ */ s("div", {
|
|
@@ -125,10 +125,10 @@ function g({ receiptPreviewUrl: n, receiptFileName: a, transactions: g, selected
|
|
|
125
125
|
className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-1 ttw:text-center ttw:px-6",
|
|
126
126
|
children: [/* @__PURE__ */ o("span", {
|
|
127
127
|
className: "ttw:text-sm ttw:font-medium",
|
|
128
|
-
children:
|
|
128
|
+
children: a.NoTransactionsTitle
|
|
129
129
|
}), /* @__PURE__ */ o("span", {
|
|
130
130
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
131
|
-
children:
|
|
131
|
+
children: a.NoTransactionsSubtitle
|
|
132
132
|
})]
|
|
133
133
|
})]
|
|
134
134
|
}),
|
|
@@ -173,7 +173,7 @@ function g({ receiptPreviewUrl: n, receiptFileName: a, transactions: g, selected
|
|
|
173
173
|
variant: "outline",
|
|
174
174
|
className: "ttw:flex-1",
|
|
175
175
|
onClick: M,
|
|
176
|
-
children:
|
|
176
|
+
children: a.Back
|
|
177
177
|
}), /* @__PURE__ */ s(e, {
|
|
178
178
|
className: "ttw:flex-1",
|
|
179
179
|
disabled: y.length === 0 || T,
|
|
@@ -181,7 +181,7 @@ function g({ receiptPreviewUrl: n, receiptFileName: a, transactions: g, selected
|
|
|
181
181
|
children: [T ? /* @__PURE__ */ o(u, {
|
|
182
182
|
size: 16,
|
|
183
183
|
className: "ttw:animate-spin"
|
|
184
|
-
}) : /* @__PURE__ */ o(c, { size: 16 }),
|
|
184
|
+
}) : /* @__PURE__ */ o(c, { size: 16 }), a.ConfirmMatch]
|
|
185
185
|
})]
|
|
186
186
|
})
|
|
187
187
|
]
|
|
@@ -200,16 +200,16 @@ function _() {
|
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
function v({ url: e, fileName: t, zoom: n }) {
|
|
203
|
-
return
|
|
203
|
+
return i(e, t) ? /* @__PURE__ */ o("iframe", {
|
|
204
204
|
src: `${e}#toolbar=0&navpanes=0&scrollbar=0`,
|
|
205
|
-
title:
|
|
205
|
+
title: a.ReceiptPdfPreviewTitle,
|
|
206
206
|
sandbox: "",
|
|
207
207
|
referrerPolicy: "no-referrer",
|
|
208
208
|
className: "ttw:w-full ttw:h-full ttw:border-0 ttw:transition-transform",
|
|
209
209
|
style: { transform: `scale(${n})` }
|
|
210
210
|
}) : /* @__PURE__ */ o("img", {
|
|
211
211
|
src: e,
|
|
212
|
-
alt:
|
|
212
|
+
alt: a.ReceiptImageAlt,
|
|
213
213
|
className: "ttw:max-h-full ttw:max-w-full ttw:object-contain ttw:transition-transform",
|
|
214
214
|
style: { transform: `scale(${n})` }
|
|
215
215
|
});
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Button as e } from "
|
|
6
|
-
import { ReceiptMatchLabels as t } from "./
|
|
5
|
+
import { Button as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { ReceiptMatchLabels as t } from "./index2.js";
|
|
7
7
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
8
8
|
import { Check as a } from "lucide-react";
|
|
9
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
9
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index6.js
|
|
10
10
|
function o({ matchedTransactions: o, primaryLabel: c, onPrimary: l }) {
|
|
11
11
|
let u = o ?? [], d = u.length === 1, f = u[0];
|
|
12
12
|
return /* @__PURE__ */ i("div", {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Dialog as e, DialogContent as t, DialogDescription as n, DialogTitle as r } from "
|
|
6
|
-
import { ReceiptMatchLabels as i } from "./
|
|
7
|
-
import { ReceiptInboxStep as a } from "./
|
|
8
|
-
import { TransactionsMatchStep as o } from "./
|
|
9
|
-
import { MatchConfirmationStep as s } from "./
|
|
5
|
+
import { Dialog as e, DialogContent as t, DialogDescription as n, DialogTitle as r } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { ReceiptMatchLabels as i } from "./index2.js";
|
|
7
|
+
import { ReceiptInboxStep as a } from "./index4.js";
|
|
8
|
+
import { TransactionsMatchStep as o } from "./index5.js";
|
|
9
|
+
import { MatchConfirmationStep as s } from "./index6.js";
|
|
10
10
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
11
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index7.js
|
|
12
12
|
function u({ open: u, onClose: d, step: f, receipts: p, selectedReceiptIds: m, onSelectAll: h, onReset: g, onReceiptToggle: _, onViewAttachment: v, onDeleteReceipt: y, onReview: b, isReceiptsLoading: x, isReceiptsError: S, onRetryReceipts: C, receiptPreviewUrl: w, receiptFileName: T, transactions: E, isTransactionsLoading: D, isTransactionsError: O, onRetryTransactions: k, selectedTransactionIds: A, allowMultipleTransactions: j, searchValue: M, onSearchChange: N, onTransactionSelect: P, onConfirmMatch: F, isConfirming: I, zoom: L, onZoomIn: R, onZoomOut: z, canZoomIn: B, canZoomOut: V, showZoomControls: H, matchedTransactions: U, primaryLabel: W, onPrimary: G, onCancel: K, reviewLabel: q, showSelectAllButton: J }) {
|
|
13
13
|
let Y = {
|
|
14
14
|
receipts: p,
|