@tesouro/embedded-components-react 0.4.31 → 0.5.1
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 +17 -47
- package/dist/index.d.ts +2 -27
- package/dist/index.js +21 -27
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/ExpenseManagementWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +14 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +8 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +91 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +96 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -137
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +49 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +129 -180
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +32 -74
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +186 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +70 -226
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +22 -219
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +221 -109
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +220 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +119 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +13 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +43 -198
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +29 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +186 -222
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +37 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +229 -420
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +429 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -224
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +222 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +44 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -110
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +12 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +109 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +45 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +28 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +76 -243
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +48 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +239 -196
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +115 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +207 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +3 -114
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +106 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +74 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +11 -247
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +34 -57
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index14.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +253 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +2 -48
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchLauncher.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ReceiptMatchWidget/lib/labels.js +4 -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/widget-suite/feature/dist/index8.js +1 -1
- package/package.json +1 -1
- package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +0 -639
- package/dist/lib/ExpenseApprovalPoliciesWidget.js +0 -3
- package/dist/lib/ExpenseRequirementsWidget.d.ts +0 -639
- package/dist/lib/ExpenseRequirementsWidget.js +0 -3
- package/dist/lib/ReceiptMatchWidget.d.ts +0 -640
- package/dist/lib/ReceiptMatchWidget.js +0 -3
|
@@ -1 +1,74 @@
|
|
|
1
|
-
|
|
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/lib/ReceiptMatchWidget/lib/ReceiptMatchSidebar.js";
|
|
11
|
+
import "../../ui/dist/index.js";
|
|
12
|
+
import { useReceiptMatch as i } from "./index8.js";
|
|
13
|
+
import { ReceiptMatchAnalyticsEvent as a, WIDGET_NAME as o } from "./index9.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/feature/dist/index10.js
|
|
17
|
+
function p({ preSelectedReceiptIds: n = [], onClose: o, targetTransactionId: l, onSingleTransactionUpdate: p }) {
|
|
18
|
+
let m = t();
|
|
19
|
+
c(() => {
|
|
20
|
+
m(a.Mounted);
|
|
21
|
+
}, [m]);
|
|
22
|
+
let h = i({
|
|
23
|
+
preSelectedIds: n,
|
|
24
|
+
onClose: o,
|
|
25
|
+
targetTransactionId: l,
|
|
26
|
+
onSingleTransactionUpdate: p
|
|
27
|
+
}), g = s(() => {
|
|
28
|
+
h.onCancel(), o();
|
|
29
|
+
}, [h.onCancel, o]);
|
|
30
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(e, {}), /* @__PURE__ */ d(r, {
|
|
31
|
+
open: !0,
|
|
32
|
+
onClose: g,
|
|
33
|
+
...h
|
|
34
|
+
})] });
|
|
35
|
+
}
|
|
36
|
+
function m({ isOpen: e, onClose: t, ...n }) {
|
|
37
|
+
let [r, i] = l(!!e);
|
|
38
|
+
c(() => {
|
|
39
|
+
i(!!e);
|
|
40
|
+
}, [e]);
|
|
41
|
+
let a = s(() => {
|
|
42
|
+
i(!1), t?.();
|
|
43
|
+
}, [t]);
|
|
44
|
+
return r ? /* @__PURE__ */ d(p, {
|
|
45
|
+
onClose: a,
|
|
46
|
+
...n
|
|
47
|
+
}) : null;
|
|
48
|
+
}
|
|
49
|
+
function h({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: f, disclosuresAcceptance: p, providerLabels: h, isOpen: g, preSelectedReceiptIds: _, onClose: v, targetTransactionId: y, onSingleTransactionUpdate: b }) {
|
|
50
|
+
return /* @__PURE__ */ d(n, {
|
|
51
|
+
widgetName: o,
|
|
52
|
+
baseUrl: e,
|
|
53
|
+
widgetToken: t,
|
|
54
|
+
organizationId: r,
|
|
55
|
+
configClient: i,
|
|
56
|
+
gatewayRouting: a,
|
|
57
|
+
linkComponent: s,
|
|
58
|
+
implementation: c,
|
|
59
|
+
uiFramework: l,
|
|
60
|
+
errorFallback: u,
|
|
61
|
+
onError: f,
|
|
62
|
+
disclosuresAcceptance: p,
|
|
63
|
+
providerLabels: h,
|
|
64
|
+
children: /* @__PURE__ */ d(m, {
|
|
65
|
+
isOpen: g,
|
|
66
|
+
preSelectedReceiptIds: _,
|
|
67
|
+
onClose: v,
|
|
68
|
+
targetTransactionId: y,
|
|
69
|
+
onSingleTransactionUpdate: b
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { h as ReceiptMatchWidget };
|
|
@@ -2,254 +2,18 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import "../../../shared/ui/dist/index.js";
|
|
7
|
-
import { useWidgetConfig as t, useWidgetLoading as n } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
8
|
-
import "../../../shared/feature/dist/index.js";
|
|
9
|
-
import { ReceiptMatchLabels as r } from "../../ui/dist/lib/ReceiptMatchWidget/lib/labels.js";
|
|
5
|
+
import { ReceiptMatchLauncher as e } from "../../ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchLauncher.js";
|
|
10
6
|
import "../../ui/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { useDeleteReceiptMutation as te } from "../../data-access/dist/index6.js";
|
|
15
|
-
import "../../data-access/dist/index.js";
|
|
16
|
-
import { useCallback as o, useEffect as ne, useMemo as s, useState as c } from "react";
|
|
7
|
+
import { ReceiptMatchWidget as t } from "./index10.js";
|
|
8
|
+
import { useCallback as n, useState as r } from "react";
|
|
9
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
17
10
|
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return e instanceof Error && e.message ? e.message : t;
|
|
27
|
-
}
|
|
28
|
-
function u(e, t) {
|
|
29
|
-
let n = e / 100;
|
|
30
|
-
try {
|
|
31
|
-
return new Intl.NumberFormat("en-US", {
|
|
32
|
-
style: "currency",
|
|
33
|
-
currency: t
|
|
34
|
-
}).format(n);
|
|
35
|
-
} catch {
|
|
36
|
-
return `${t} ${n.toFixed(2)}`;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function d(e) {
|
|
40
|
-
if (!e) return "";
|
|
41
|
-
let t = new Date(e);
|
|
42
|
-
return Number.isNaN(t.getTime()) ? "" : t.toLocaleDateString("en-US", {
|
|
43
|
-
month: "short",
|
|
44
|
-
day: "numeric",
|
|
45
|
-
year: "numeric"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function re(e) {
|
|
49
|
-
if (!e) return "";
|
|
50
|
-
let t = new Date(e);
|
|
51
|
-
return Number.isNaN(t.getTime()) ? "" : t.toLocaleDateString("en-US", {
|
|
52
|
-
month: "long",
|
|
53
|
-
day: "numeric",
|
|
54
|
-
year: "numeric"
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
function f(e) {
|
|
58
|
-
if (!e) return "";
|
|
59
|
-
let t = new Date(e);
|
|
60
|
-
return Number.isNaN(t.getTime()) ? "" : t.toLocaleTimeString("en-US", {
|
|
61
|
-
hour: "numeric",
|
|
62
|
-
minute: "2-digit",
|
|
63
|
-
second: "2-digit",
|
|
64
|
-
hour12: !0
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function ie(e) {
|
|
68
|
-
let t = e.ocr_status === "processing";
|
|
69
|
-
return {
|
|
70
|
-
id: e.id,
|
|
71
|
-
primaryText: t ? r.ReceiptScanningTitle : e.merchant_name?.trim() || r.ReceiptScanningTitle,
|
|
72
|
-
secondaryText: t ? r.ReceiptScanningSubtitle : d(e.issued_at),
|
|
73
|
-
thumbnailUrl: e.file_url ?? void 0
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function p(e) {
|
|
77
|
-
return {
|
|
78
|
-
id: e.id,
|
|
79
|
-
merchantName: e.merchant_name,
|
|
80
|
-
date: d(e.started_at),
|
|
81
|
-
formattedAmount: u(e.amount, e.currency)
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
var m = .5, h = 3, g = .25, _ = 5e3, v = !1;
|
|
85
|
-
function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTransactionUpdate: x }) {
|
|
86
|
-
let { initResponse: S } = t(), C = n(), w = S?.userId ?? void 0, T = !!w && !C, [E, D] = c(1), [O, k] = c(0), [A, j] = c([]), [M, N] = c(() => d), [P, F] = c(""), [I, L] = c([]), R = s(() => I.map((e) => e.id), [I]), [z, B] = c(1), V = i({
|
|
87
|
-
has_transaction: !1,
|
|
88
|
-
created_by_entity_user_id: w,
|
|
89
|
-
enabled: T
|
|
90
|
-
}), H = a({
|
|
91
|
-
merchant_name__icontains: P || void 0,
|
|
92
|
-
has_receipt: !1,
|
|
93
|
-
enabled: E === 2
|
|
94
|
-
}), U = ee(), W = te(), G = V.data?.data ?? [], K = s(() => w ? G.filter((e) => e.created_by_entity_user_id == null || e.created_by_entity_user_id === w) : [], [G, w]);
|
|
95
|
-
ne(() => {
|
|
96
|
-
if (!K.some((e) => e.ocr_status === "processing")) return;
|
|
97
|
-
let e = window.setInterval(() => {
|
|
98
|
-
V.isFetching || V.refetch();
|
|
99
|
-
}, _);
|
|
100
|
-
return () => window.clearInterval(e);
|
|
101
|
-
}, [
|
|
102
|
-
V.isFetching,
|
|
103
|
-
V.refetch,
|
|
104
|
-
K
|
|
105
|
-
]);
|
|
106
|
-
let q = s(() => K.map(ie), [K]), J = s(() => new Set(A.flatMap((e) => e.transactionIds)), [A]), ae = s(() => (H.data?.data ?? []).filter((e) => !J.has(e.id)).map(p), [H.data, J]), Y = H.data?.data ?? [], X = M[O], Z = s(() => K.find((e) => e.id === X), [K, X]), oe = Z?.file_url ?? void 0, se = Z?.file_name ?? void 0, ce = s(() => {
|
|
107
|
-
if (b) return "Attach";
|
|
108
|
-
if (!(M.length <= 1)) return `Review (${O + 1}/${M.length})`;
|
|
109
|
-
}, [
|
|
110
|
-
b,
|
|
111
|
-
M.length,
|
|
112
|
-
O
|
|
113
|
-
]), le = s(() => A.filter((e) => e.receiptId === X).flatMap((e) => e.transactionDetails), [A, X]), ue = O >= M.length - 1 ? r.Done : r.ReviewNextReceipt(O + 2, M.length), Q = o(() => {
|
|
114
|
-
F(""), L([]), B(1);
|
|
115
|
-
}, []), de = o((e) => {
|
|
116
|
-
if (b) {
|
|
117
|
-
N((t) => t.includes(e) ? [] : [e]);
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
N((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
121
|
-
}, [b]), fe = o(() => {
|
|
122
|
-
N(q.map((e) => e.id));
|
|
123
|
-
}, [q]), pe = o(() => {
|
|
124
|
-
N([]);
|
|
125
|
-
}, []), me = o((e) => {
|
|
126
|
-
let t = K.find((t) => t.id === e);
|
|
127
|
-
t?.file_url && window.open(t.file_url, "_blank", "noopener,noreferrer");
|
|
128
|
-
}, [K]), $ = o(async (t) => {
|
|
129
|
-
try {
|
|
130
|
-
await W.mutateAsync({ path: { receipt_id: t } });
|
|
131
|
-
} catch (t) {
|
|
132
|
-
e.error(l(t, "Failed to delete receipt"));
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
N((e) => e.filter((e) => e !== t));
|
|
136
|
-
}, [W]), he = o(async () => {
|
|
137
|
-
if (M.length !== 0) {
|
|
138
|
-
if (b) {
|
|
139
|
-
try {
|
|
140
|
-
await U.mutateAsync({
|
|
141
|
-
path: { receipt_id: M[0] },
|
|
142
|
-
body: { transaction_id: b }
|
|
143
|
-
}), x?.(), y();
|
|
144
|
-
} catch (t) {
|
|
145
|
-
e.error(l(t, "Failed to attach receipt"));
|
|
146
|
-
}
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
k(0), j([]), Q(), D(2);
|
|
150
|
-
}
|
|
151
|
-
}, [
|
|
152
|
-
M,
|
|
153
|
-
b,
|
|
154
|
-
U,
|
|
155
|
-
x,
|
|
156
|
-
y,
|
|
157
|
-
Q
|
|
158
|
-
]), ge = o((e) => {
|
|
159
|
-
F(e);
|
|
160
|
-
}, []), _e = o((e) => {
|
|
161
|
-
L((t) => {
|
|
162
|
-
let n = t.find((t) => t.id === e), r = Y.find((t) => t.id === e);
|
|
163
|
-
return n ? [] : r ? [r] : [];
|
|
164
|
-
});
|
|
165
|
-
}, [Y]), ve = o(async () => {
|
|
166
|
-
if (I.length === 0 || !X) return;
|
|
167
|
-
let t = I, n = (e) => ({
|
|
168
|
-
merchant: e.merchant_name,
|
|
169
|
-
location: e.merchant_location,
|
|
170
|
-
date: re(e.started_at),
|
|
171
|
-
time: f(e.started_at),
|
|
172
|
-
formattedAmount: u(e.amount, e.currency)
|
|
173
|
-
}), r = [], i = [];
|
|
174
|
-
for (let a of t) try {
|
|
175
|
-
await U.mutateAsync({
|
|
176
|
-
path: { receipt_id: X },
|
|
177
|
-
body: { transaction_id: a.id }
|
|
178
|
-
}), r.push(a.id), i.push(n(a));
|
|
179
|
-
} catch (t) {
|
|
180
|
-
r.length > 0 && j((e) => [...e, {
|
|
181
|
-
receiptId: X,
|
|
182
|
-
transactionIds: r,
|
|
183
|
-
transactionDetails: i
|
|
184
|
-
}]), L((e) => e.filter((e) => !r.includes(e.id))), e.error(l(t, "Failed to match receipt"));
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
j((e) => [...e, {
|
|
188
|
-
receiptId: X,
|
|
189
|
-
transactionIds: r,
|
|
190
|
-
transactionDetails: i
|
|
191
|
-
}]), D(3);
|
|
192
|
-
}, [
|
|
193
|
-
I,
|
|
194
|
-
X,
|
|
195
|
-
U
|
|
196
|
-
]), ye = o(() => {
|
|
197
|
-
B((e) => Math.min(e + g, h));
|
|
198
|
-
}, []), be = o(() => {
|
|
199
|
-
B((e) => Math.max(e - g, m));
|
|
200
|
-
}, []), xe = o(() => {
|
|
201
|
-
let e = O + 1;
|
|
202
|
-
if (e < M.length) {
|
|
203
|
-
k(e), Q(), D(2);
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
y();
|
|
207
|
-
}, [
|
|
208
|
-
O,
|
|
209
|
-
M.length,
|
|
210
|
-
Q,
|
|
211
|
-
y
|
|
212
|
-
]), Se = o(() => {
|
|
213
|
-
if (A.length > 0) {
|
|
214
|
-
let e = new Set(A.map((e) => e.receiptId));
|
|
215
|
-
N((t) => t.filter((t) => !e.has(t)));
|
|
216
|
-
}
|
|
217
|
-
Q(), k(0), j([]), D(1);
|
|
218
|
-
}, [Q, A]);
|
|
219
|
-
return {
|
|
220
|
-
step: E,
|
|
221
|
-
receipts: q,
|
|
222
|
-
selectedReceiptIds: M,
|
|
223
|
-
onSelectAll: fe,
|
|
224
|
-
onReset: pe,
|
|
225
|
-
onReceiptToggle: de,
|
|
226
|
-
onViewAttachment: me,
|
|
227
|
-
onDeleteReceipt: $,
|
|
228
|
-
onReview: he,
|
|
229
|
-
isReceiptsLoading: V.isLoading,
|
|
230
|
-
showSelectAllButton: !b,
|
|
231
|
-
receiptPreviewUrl: oe,
|
|
232
|
-
receiptFileName: se,
|
|
233
|
-
transactions: ae,
|
|
234
|
-
isTransactionsLoading: H.isLoading,
|
|
235
|
-
selectedTransactionIds: R,
|
|
236
|
-
allowMultipleTransactions: v,
|
|
237
|
-
searchValue: P,
|
|
238
|
-
onSearchChange: ge,
|
|
239
|
-
onTransactionSelect: _e,
|
|
240
|
-
onConfirmMatch: ve,
|
|
241
|
-
isConfirming: U.isPending,
|
|
242
|
-
zoom: z,
|
|
243
|
-
onZoomIn: ye,
|
|
244
|
-
onZoomOut: be,
|
|
245
|
-
canZoomIn: z < h,
|
|
246
|
-
canZoomOut: z > m,
|
|
247
|
-
matchedTransactions: le,
|
|
248
|
-
primaryLabel: ue,
|
|
249
|
-
onPrimary: xe,
|
|
250
|
-
onCancel: Se,
|
|
251
|
-
reviewLabel: ce
|
|
252
|
-
};
|
|
11
|
+
function s() {
|
|
12
|
+
let [s, c] = r(!1), l = n(() => c(!1), []);
|
|
13
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(e, { onStart: () => c(!0) }), s && /* @__PURE__ */ a(t, {
|
|
14
|
+
isOpen: !0,
|
|
15
|
+
onClose: l
|
|
16
|
+
})] });
|
|
253
17
|
}
|
|
254
18
|
//#endregion
|
|
255
|
-
export {
|
|
19
|
+
export { s as ReceiptMatchPane };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js
|
|
2
|
-
var e = { Mounted: "
|
|
2
|
+
var e = { Mounted: "expense_management_widget.mounted" }, t = "expense_management_widget";
|
|
3
3
|
//#endregion
|
|
4
|
-
export { e as
|
|
4
|
+
export { e as ExpenseManagementWidgetAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -2,73 +2,50 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import "../../../shared/
|
|
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";
|
|
5
|
+
import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
6
|
+
import { WidgetProvider as t } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
9
7
|
import "../../../shared/feature/dist/index.js";
|
|
10
|
-
import {
|
|
8
|
+
import { ExpenseManagementWidgetUi as n } from "../../ui/dist/lib/ExpenseManagementWidgetUi/ExpenseManagementWidgetUi.js";
|
|
11
9
|
import "../../ui/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
10
|
+
import { ExpenseApprovalPoliciesWidget as r } from "./index6.js";
|
|
11
|
+
import { UploadReceiptWidget as i } from "./index7.js";
|
|
12
|
+
import { ReceiptMatchPane as a } from "./index11.js";
|
|
13
|
+
import { ExpenseManagementWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "./index12.js";
|
|
14
|
+
import { ExpenseRequirementsWidget as c } from "../../../expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js";
|
|
15
|
+
import "../../../expense-requirements-widget/feature/dist/index.js";
|
|
16
|
+
import { useEffect as l } from "react";
|
|
17
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
16
18
|
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
h.onCancel(), o();
|
|
29
|
-
}, [h.onCancel, o]);
|
|
30
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(e, {}), /* @__PURE__ */ d(r, {
|
|
31
|
-
open: !0,
|
|
32
|
-
onClose: g,
|
|
33
|
-
...h
|
|
34
|
-
})] });
|
|
35
|
-
}
|
|
36
|
-
function m({ isOpen: e, onClose: t, ...n }) {
|
|
37
|
-
let [r, i] = l(!!e);
|
|
38
|
-
c(() => {
|
|
39
|
-
i(!!e);
|
|
40
|
-
}, [e]);
|
|
41
|
-
let a = s(() => {
|
|
42
|
-
i(!1), t?.();
|
|
43
|
-
}, [t]);
|
|
44
|
-
return r ? /* @__PURE__ */ d(p, {
|
|
45
|
-
onClose: a,
|
|
46
|
-
...n
|
|
47
|
-
}) : null;
|
|
19
|
+
function d({ labels: t, receiptUpload: s, receiptsContent: d, matchingContent: f, policiesContent: p, requirementsContent: m }) {
|
|
20
|
+
let h = e();
|
|
21
|
+
return l(() => {
|
|
22
|
+
h(o.Mounted);
|
|
23
|
+
}, [h]), /* @__PURE__ */ u(n, {
|
|
24
|
+
labels: t,
|
|
25
|
+
receiptsContent: d ?? (s ? /* @__PURE__ */ u(i, { ...s }) : null),
|
|
26
|
+
matchingContent: f ?? /* @__PURE__ */ u(a, {}),
|
|
27
|
+
policiesContent: p ?? /* @__PURE__ */ u(r, {}),
|
|
28
|
+
requirementsContent: m ?? /* @__PURE__ */ u(c, {})
|
|
29
|
+
});
|
|
48
30
|
}
|
|
49
|
-
function
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
widgetName:
|
|
31
|
+
function f({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: f, onError: p, analytics: m, disclosuresAcceptance: h, providerLabels: g, ..._ }) {
|
|
32
|
+
return /* @__PURE__ */ u(t, {
|
|
33
|
+
widgetName: s,
|
|
52
34
|
baseUrl: e,
|
|
53
|
-
widgetToken:
|
|
35
|
+
widgetToken: n,
|
|
54
36
|
organizationId: r,
|
|
55
37
|
configClient: i,
|
|
56
38
|
gatewayRouting: a,
|
|
57
|
-
linkComponent:
|
|
39
|
+
linkComponent: o,
|
|
58
40
|
implementation: c,
|
|
59
41
|
uiFramework: l,
|
|
60
|
-
errorFallback:
|
|
61
|
-
onError:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
preSelectedReceiptIds: _,
|
|
67
|
-
onClose: v,
|
|
68
|
-
targetTransactionId: y,
|
|
69
|
-
onSingleTransactionUpdate: b
|
|
70
|
-
})
|
|
42
|
+
errorFallback: f,
|
|
43
|
+
onError: p,
|
|
44
|
+
analytics: m,
|
|
45
|
+
disclosuresAcceptance: h,
|
|
46
|
+
providerLabels: g,
|
|
47
|
+
children: /* @__PURE__ */ u(d, { ..._ })
|
|
71
48
|
});
|
|
72
49
|
}
|
|
73
50
|
//#endregion
|
|
74
|
-
export {
|
|
51
|
+
export { f as ExpenseManagementWidget, f as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index13.js";
|