@tesouro/embedded-components-react 0.11.198 → 0.11.201
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 +16 -1
- package/dist/index.css +14 -0
- package/dist/index.d.ts +70 -2
- package/dist/index.js +43 -40
- package/dist/lib/BillPayWidget.d.ts +16 -1
- package/dist/lib/BillPayWidget.js +4 -3
- package/dist/lib/RecentActivityWidget.d.ts +651 -0
- package/dist/lib/RecentActivityWidget.js +4 -0
- package/dist/lib/WidgetSuite.d.ts +45 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/mocks/bankAccounts.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +184 -174
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +208 -206
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +59 -56
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +61 -59
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/index.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/data-access/dist/index.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/data-access/dist/index2.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/RecentActivityWidgetFeature.js +71 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/labels.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/testIds.js +9 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/analytics/events.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/recentActivityView/buildRecentActivityRows.js +65 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/mocks/labels.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/mocks/recentActivity.js +52 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/scenarios.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/ui/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/ui/dist/lib/RecentActivityCard/RecentActivityCard.js +129 -0
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/ui/dist/lib/RecentActivityCard/labels.js +15 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +229 -218
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +192 -180
- 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/ui/dist/index.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/WidgetSuiteProvider.js +35 -30
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/AccountsSection.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/DashboardSection.js +26 -16
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/mocks/widgetSuite.js +29 -26
- package/dist/scenarios/index.d.ts +3 -1
- package/dist/scenarios/index.js +6 -4
- package/package.json +1 -1
|
@@ -16,93 +16,96 @@ import "../../../../../shared/feature/dist/index.js";
|
|
|
16
16
|
import { BillPayWidgetAnalyticsEvent as c, WIDGET_NAME as l } from "../analytics/events.js";
|
|
17
17
|
import { BillPayWidgetUi as u } from "../../../../ui/dist/index14.js";
|
|
18
18
|
import "../../../../ui/dist/index.js";
|
|
19
|
-
import {
|
|
19
|
+
import { BillQueue as d } from "../../../../bills-list/feature/dist/index5.js";
|
|
20
|
+
import { BillSummaryCard as f } from "../../../../bills-list/feature/dist/index10.js";
|
|
20
21
|
import "../../../../bills-list/feature/dist/index.js";
|
|
21
|
-
import { BillUploadWidget as
|
|
22
|
+
import { BillUploadWidget as p } from "../../../../bill-upload/feature/dist/index8.js";
|
|
22
23
|
import "../../../../bill-upload/feature/dist/index.js";
|
|
23
|
-
import { BillsTab as
|
|
24
|
-
import { BILL_PAY_WIDGET_LABELS_EN as
|
|
25
|
-
import { CounterpartsWidget as
|
|
24
|
+
import { BillsTab as m } from "./BillsTab.js";
|
|
25
|
+
import { BILL_PAY_WIDGET_LABELS_EN as h } from "./labels.js";
|
|
26
|
+
import { CounterpartsWidget as g } from "../../../../../counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js";
|
|
26
27
|
import "../../../../../counterparts-widget/feature/dist/index.js";
|
|
27
|
-
import { useCallback as
|
|
28
|
-
import { Fragment as
|
|
28
|
+
import { useCallback as _, useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
29
|
+
import { Fragment as ee, jsx as S, jsxs as te } from "react/jsx-runtime";
|
|
29
30
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js
|
|
30
31
|
var C = {
|
|
31
32
|
Bills: "bills",
|
|
32
33
|
Vendors: "vendors"
|
|
33
34
|
}, w = [C.Bills, C.Vendors];
|
|
34
|
-
function
|
|
35
|
+
function ne(e) {
|
|
35
36
|
return w.includes(e);
|
|
36
37
|
}
|
|
37
|
-
function T({ labels: a, initialTab: l = C.Bills, selectedTab: d, onTabChange:
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
|
|
38
|
+
function T({ labels: a, initialTab: l = C.Bills, selectedTab: d, onTabChange: f, initialView: T, poweredByBankName: E, onSettingsClick: D, selectedSummaryCard: O, onSummaryCardChange: k, selectedBillsView: A, onBillsViewChange: j }) {
|
|
39
|
+
let M = i();
|
|
40
|
+
v(() => {
|
|
41
|
+
M(c.Mounted);
|
|
42
|
+
}, [M]);
|
|
43
|
+
let N = y(() => e(h, a), [a]), { initResponse: P } = o(), F = t(P?.scopes, [n.PayableReadOrg]), I = t(P?.scopes, [n.PayableWriteOrg]), L = t(P?.scopes, [n.ApprovalPolicyWriteOrg]) && t(P?.scopes, [n.PayableWriteOrg]) && t(P?.scopes, [n.RoleReadOrg]) && t(P?.scopes, [n.UserReadOrg]), [R, z] = x(l), B = d ?? R, V = _((e) => {
|
|
44
|
+
ne(e) && (z(e), f?.(e));
|
|
45
|
+
}, [f]), [H, U] = x(null), [W, G] = x(), K = _((e) => {
|
|
46
|
+
V(C.Bills), G(e);
|
|
47
|
+
}, [V]), q = b(null), J = _((e) => q.current?.enqueue(e), []), [Y, X] = x(), Z = _((e) => {
|
|
48
|
+
V(C.Bills), X(e);
|
|
49
|
+
}, [V]), re = s(), [ie, ae] = x(T === "create"), [oe, Q] = x(!1);
|
|
50
|
+
ie && P && !re && (ae(!1), I && B === C.Bills && Q(!0));
|
|
50
51
|
let $ = [{
|
|
51
52
|
id: C.Bills,
|
|
52
|
-
label:
|
|
53
|
-
content: /* @__PURE__ */
|
|
54
|
-
labels:
|
|
55
|
-
onEnqueueFiles:
|
|
56
|
-
openPayableId:
|
|
57
|
-
onOpenPayableHandled: () =>
|
|
58
|
-
vendorIntent:
|
|
59
|
-
onVendorIntentHandled: () =>
|
|
60
|
-
openAddBill:
|
|
53
|
+
label: N.tabs.bills,
|
|
54
|
+
content: /* @__PURE__ */ S(m, {
|
|
55
|
+
labels: N,
|
|
56
|
+
onEnqueueFiles: J,
|
|
57
|
+
openPayableId: W,
|
|
58
|
+
onOpenPayableHandled: () => G(void 0),
|
|
59
|
+
vendorIntent: Y,
|
|
60
|
+
onVendorIntentHandled: () => X(void 0),
|
|
61
|
+
openAddBill: oe,
|
|
61
62
|
onOpenAddBillHandled: () => Q(!1),
|
|
62
|
-
poweredByBankName:
|
|
63
|
-
headerActionContainer:
|
|
64
|
-
selectedSummaryCard:
|
|
65
|
-
onSummaryCardChange:
|
|
63
|
+
poweredByBankName: E,
|
|
64
|
+
headerActionContainer: H,
|
|
65
|
+
selectedSummaryCard: O,
|
|
66
|
+
onSummaryCardChange: k,
|
|
67
|
+
selectedQueue: A,
|
|
68
|
+
onQueueChange: j
|
|
66
69
|
})
|
|
67
70
|
}, {
|
|
68
71
|
id: C.Vendors,
|
|
69
|
-
label:
|
|
70
|
-
content: /* @__PURE__ */
|
|
71
|
-
...
|
|
72
|
+
label: N.tabs.vendors,
|
|
73
|
+
content: /* @__PURE__ */ S(g, {
|
|
74
|
+
...N.vendors,
|
|
72
75
|
counterpartType: "vendor",
|
|
73
76
|
passThrough: !0,
|
|
74
|
-
headerActionContainer:
|
|
75
|
-
onViewAllDocuments:
|
|
77
|
+
headerActionContainer: H,
|
|
78
|
+
onViewAllDocuments: F ? (e) => Z({
|
|
76
79
|
vendorId: e.id,
|
|
77
80
|
vendorName: e.name,
|
|
78
81
|
action: "viewBills"
|
|
79
82
|
}) : void 0,
|
|
80
|
-
onCreateDocument:
|
|
83
|
+
onCreateDocument: I ? (e) => Z({
|
|
81
84
|
vendorId: e.id,
|
|
82
85
|
vendorName: e.name,
|
|
83
86
|
action: "createBill"
|
|
84
87
|
}) : void 0
|
|
85
88
|
})
|
|
86
|
-
}],
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
labels:
|
|
89
|
+
}], se = $.some((e) => e.id === B) ? B : w.find((e) => $.some((t) => t.id === e)) ?? $[0]?.id ?? "";
|
|
90
|
+
return /* @__PURE__ */ te(ee, { children: [
|
|
91
|
+
/* @__PURE__ */ S(r, {}),
|
|
92
|
+
/* @__PURE__ */ S(u, {
|
|
93
|
+
labels: N.widget,
|
|
91
94
|
tabs: $,
|
|
92
|
-
selectedTabId:
|
|
93
|
-
onTabChange:
|
|
94
|
-
onSettingsClick:
|
|
95
|
-
actionContainerRef:
|
|
95
|
+
selectedTabId: se,
|
|
96
|
+
onTabChange: V,
|
|
97
|
+
onSettingsClick: D && L ? D : void 0,
|
|
98
|
+
actionContainerRef: U
|
|
96
99
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
ref:
|
|
99
|
-
onOpenBill:
|
|
100
|
-
labels:
|
|
100
|
+
/* @__PURE__ */ S(p, {
|
|
101
|
+
ref: q,
|
|
102
|
+
onOpenBill: K,
|
|
103
|
+
labels: N.billUpload
|
|
101
104
|
})
|
|
102
105
|
] });
|
|
103
106
|
}
|
|
104
107
|
function E({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, uiFramework: s, errorFallback: c, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
|
|
105
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ S(a, {
|
|
106
109
|
widgetName: l,
|
|
107
110
|
baseUrl: e,
|
|
108
111
|
widgetToken: t,
|
|
@@ -116,8 +119,8 @@ function E({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
|
|
|
116
119
|
analytics: d,
|
|
117
120
|
disclosuresAcceptance: f,
|
|
118
121
|
providerLabels: p,
|
|
119
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ S(T, { ...m })
|
|
120
123
|
});
|
|
121
124
|
}
|
|
122
125
|
var D = E;
|
|
123
|
-
export { D as BillPayWidget, D as default, E as BillPayWidgetWithLabels,
|
|
126
|
+
export { D as BillPayWidget, D as default, E as BillPayWidgetWithLabels, f as BillSummaryCard, d as BillsView };
|
|
@@ -18,22 +18,22 @@ import "../../../../pay-bill/feature/dist/index.js";
|
|
|
18
18
|
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
19
19
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
20
20
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js
|
|
21
|
-
function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandled: v, vendorIntent: y, onVendorIntentHandled: b, openAddBill: x, onOpenAddBillHandled: S, poweredByBankName: C, headerActionContainer: w, selectedSummaryCard: T, onSummaryCardChange: E }) {
|
|
22
|
-
let
|
|
23
|
-
create:
|
|
24
|
-
details:
|
|
25
|
-
view:
|
|
26
|
-
}[
|
|
21
|
+
function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandled: v, vendorIntent: y, onVendorIntentHandled: b, openAddBill: x, onOpenAddBillHandled: S, poweredByBankName: C, headerActionContainer: w, selectedSummaryCard: T, onSummaryCardChange: ee, selectedQueue: E, onQueueChange: D }) {
|
|
22
|
+
let O = d(null), [k, A] = f(), [j, M] = f(), [N, P] = f(!1), [F, I] = f(), [L, R] = f(!1), [z, B] = f(!1), [V, H] = f(null), U = !V || {
|
|
23
|
+
create: N,
|
|
24
|
+
details: L,
|
|
25
|
+
view: z
|
|
26
|
+
}[V.surface];
|
|
27
27
|
l(() => {
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
let
|
|
28
|
+
U || H(null);
|
|
29
|
+
}, [U]);
|
|
30
|
+
let W = h?.payBill, G = u(() => {
|
|
31
31
|
let e = (e) => (t) => /* @__PURE__ */ p(s, {
|
|
32
32
|
...t,
|
|
33
33
|
poweredByBankName: C,
|
|
34
|
-
labels:
|
|
35
|
-
openFlow:
|
|
36
|
-
onOpenFlowChange: (t) =>
|
|
34
|
+
labels: W,
|
|
35
|
+
openFlow: V?.surface === e ? V.flow : null,
|
|
36
|
+
onOpenFlowChange: (t) => H(t ? {
|
|
37
37
|
surface: e,
|
|
38
38
|
flow: t
|
|
39
39
|
} : null)
|
|
@@ -44,85 +44,87 @@ function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandle
|
|
|
44
44
|
view: e("view")
|
|
45
45
|
};
|
|
46
46
|
}, [
|
|
47
|
-
|
|
47
|
+
V,
|
|
48
48
|
C,
|
|
49
|
-
|
|
50
|
-
]), { initResponse:
|
|
51
|
-
t &&
|
|
52
|
-
}, [
|
|
53
|
-
|
|
54
|
-
}, Y = () => {
|
|
55
|
-
L(!1), z(!0);
|
|
49
|
+
W
|
|
50
|
+
]), { initResponse: K } = n(), q = !K || e(K.scopes, [t.PayableWriteOrg]), J = c((e, t) => {
|
|
51
|
+
t && q ? (A(e), M(void 0), P(!0)) : (I(e), B(!0));
|
|
52
|
+
}, [q]), Y = (e, t) => {
|
|
53
|
+
P(!1), B(!1), J(e, t);
|
|
56
54
|
}, X = () => {
|
|
57
|
-
|
|
55
|
+
R(!1), B(!0);
|
|
58
56
|
}, Z = () => {
|
|
59
|
-
|
|
60
|
-
}, Q =
|
|
61
|
-
|
|
57
|
+
B(!1), R(!0);
|
|
58
|
+
}, Q = () => {
|
|
59
|
+
R(!1), B(!1), A(F), M(void 0), P(!0);
|
|
60
|
+
}, $ = c((e) => {
|
|
61
|
+
A(void 0), M(e), P(!0);
|
|
62
62
|
}, []);
|
|
63
63
|
return l(() => {
|
|
64
|
-
_ && (
|
|
64
|
+
_ && (A(_), M(void 0), P(!0), v?.());
|
|
65
65
|
}, [v, _]), l(() => {
|
|
66
|
-
y && (y.action === "createBill" ?
|
|
66
|
+
y && (y.action === "createBill" ? q && $(y.vendorId) : O.current?.showVendorBills({
|
|
67
67
|
id: y.vendorId,
|
|
68
68
|
name: y.vendorName
|
|
69
69
|
}), b?.());
|
|
70
70
|
}, [
|
|
71
|
-
|
|
71
|
+
q,
|
|
72
72
|
b,
|
|
73
|
-
|
|
73
|
+
$,
|
|
74
74
|
y
|
|
75
75
|
]), l(() => {
|
|
76
|
-
x && (
|
|
76
|
+
x && (q && O.current?.openAddBill(), S?.());
|
|
77
77
|
}, [
|
|
78
|
-
|
|
78
|
+
q,
|
|
79
79
|
S,
|
|
80
80
|
x
|
|
81
81
|
]), /* @__PURE__ */ m("div", {
|
|
82
82
|
"data-testid": r.root,
|
|
83
83
|
children: [
|
|
84
84
|
/* @__PURE__ */ p(i, {
|
|
85
|
-
ref:
|
|
85
|
+
ref: O,
|
|
86
86
|
labels: h?.billsList,
|
|
87
|
-
onOpenBill:
|
|
88
|
-
onEnterManually: () =>
|
|
87
|
+
onOpenBill: J,
|
|
88
|
+
onEnterManually: () => $(),
|
|
89
89
|
onFilesSelected: g,
|
|
90
90
|
maxFiles: 10,
|
|
91
91
|
headerActionContainer: w,
|
|
92
92
|
selectedSummaryCard: T,
|
|
93
|
-
onSummaryCardChange:
|
|
93
|
+
onSummaryCardChange: ee,
|
|
94
|
+
selectedQueue: E,
|
|
95
|
+
onQueueChange: D
|
|
94
96
|
}),
|
|
95
|
-
|
|
96
|
-
open:
|
|
97
|
-
onOpenChange:
|
|
98
|
-
payableId:
|
|
99
|
-
initialCounterpartId:
|
|
100
|
-
onOpenBill:
|
|
101
|
-
renderPaymentFlows:
|
|
97
|
+
N ? /* @__PURE__ */ p(o, {
|
|
98
|
+
open: N,
|
|
99
|
+
onOpenChange: P,
|
|
100
|
+
payableId: k,
|
|
101
|
+
initialCounterpartId: j,
|
|
102
|
+
onOpenBill: Y,
|
|
103
|
+
renderPaymentFlows: G.create,
|
|
102
104
|
copy: h?.billDialog
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
open:
|
|
106
|
-
onOpenChange:
|
|
107
|
-
payableId:
|
|
108
|
-
onClose: () =>
|
|
109
|
-
onExpand:
|
|
110
|
-
onEdit:
|
|
105
|
+
}, k) : null,
|
|
106
|
+
L ? /* @__PURE__ */ p(a, {
|
|
107
|
+
open: L,
|
|
108
|
+
onOpenChange: R,
|
|
109
|
+
payableId: F,
|
|
110
|
+
onClose: () => R(!1),
|
|
111
|
+
onExpand: X,
|
|
112
|
+
onEdit: Q,
|
|
111
113
|
testId: r.detailsSheet,
|
|
112
|
-
renderPaymentFlows:
|
|
114
|
+
renderPaymentFlows: G.details,
|
|
113
115
|
labels: h?.billDetails
|
|
114
116
|
}) : null,
|
|
115
|
-
|
|
116
|
-
open:
|
|
117
|
-
onOpenChange:
|
|
118
|
-
payableId:
|
|
117
|
+
z ? /* @__PURE__ */ p(o, {
|
|
118
|
+
open: z,
|
|
119
|
+
onOpenChange: B,
|
|
120
|
+
payableId: F,
|
|
119
121
|
readOnly: !0,
|
|
120
|
-
onCollapse:
|
|
121
|
-
onEdit:
|
|
122
|
-
onOpenBill:
|
|
123
|
-
renderPaymentFlows:
|
|
122
|
+
onCollapse: Z,
|
|
123
|
+
onEdit: Q,
|
|
124
|
+
onOpenBill: Y,
|
|
125
|
+
renderPaymentFlows: G.view,
|
|
124
126
|
copy: h?.billDialog
|
|
125
|
-
},
|
|
127
|
+
}, F) : null
|
|
126
128
|
]
|
|
127
129
|
});
|
|
128
130
|
}
|
package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/data-access/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useRecentActivityQuery } from "./index2.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { getOrganizationTransactionsOptions as e } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
|
+
import { withAuthEpoch as t } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
7
|
+
import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { organizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
9
|
+
import "../../../shared/data-access/dist/index.js";
|
|
10
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
11
|
+
// ../../libs/tesouro-embedded-components-react/recent-activity-widget/data-access/dist/index2.js
|
|
12
|
+
function a({ limit: a = 5, enabled: o } = {}) {
|
|
13
|
+
let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: d } = n(), f = e({
|
|
14
|
+
query: { limit: a },
|
|
15
|
+
client: s,
|
|
16
|
+
headers: r(c)
|
|
17
|
+
}), { data: p, isLoading: m, isError: h, refetch: g } = i({
|
|
18
|
+
...t(f, {
|
|
19
|
+
authEpoch: u,
|
|
20
|
+
organizationStatus: d
|
|
21
|
+
}),
|
|
22
|
+
enabled: !!(c && l) && o !== !1
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
transactions: p?.data,
|
|
26
|
+
isLoading: m,
|
|
27
|
+
isError: h,
|
|
28
|
+
refetch: g
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export { a as useRecentActivityQuery };
|
package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RECENT_ACTIVITY_WIDGET_LABELS_EN as e } from "./lib/RecentActivityWidget/labels.js";
|
|
2
|
+
import { RecentActivityWidget as t } from "./lib/RecentActivityWidget/RecentActivityWidgetFeature.js";
|
|
3
|
+
export { e as RECENT_ACTIVITY_WIDGET_LABELS_EN, t as RecentActivityWidget };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { OrganizationStatus as e, isOrganizationOnItsWay as t } from "../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
6
|
+
import { useEmbedApi as n } from "../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
+
import { Scope as r } from "../../../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
+
import "../../../../../shared/data-access/dist/index.js";
|
|
9
|
+
import { useAnalyticsTrack as i } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
10
|
+
import { WidgetProvider as a } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
11
|
+
import { useRefetchWidget as o, useWidgetConfig as s, useWidgetError as c, useWidgetInitStaleForToken as l, useWidgetLoading as u } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
12
|
+
import "../../../../../shared/feature/dist/index.js";
|
|
13
|
+
import { RecentActivityCard as d } from "../../../../ui/dist/lib/RecentActivityCard/RecentActivityCard.js";
|
|
14
|
+
import "../../../../ui/dist/index.js";
|
|
15
|
+
import { RECENT_ACTIVITY_WIDGET_LABELS_EN as f } from "./labels.js";
|
|
16
|
+
import { RecentActivityWidgetAnalyticsEvent as p, WIDGET_NAME as m } from "../analytics/events.js";
|
|
17
|
+
import { buildRecentActivityRows as h, localIsoDate as g } from "../recentActivityView/buildRecentActivityRows.js";
|
|
18
|
+
import { recentActivityWidgetTestIds as _ } from "./testIds.js";
|
|
19
|
+
import { useRecentActivityQuery as v } from "../../../../data-access/dist/index2.js";
|
|
20
|
+
import "../../../../data-access/dist/index.js";
|
|
21
|
+
import { useCallback as y, useEffect as b, useMemo as x } from "react";
|
|
22
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
23
|
+
// ../../libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/RecentActivityWidgetFeature.js
|
|
24
|
+
function C({ labels: a, onTransactionClick: m, className: C, style: w }) {
|
|
25
|
+
let T = x(() => ({
|
|
26
|
+
...f,
|
|
27
|
+
...a
|
|
28
|
+
}), [a]), E = i();
|
|
29
|
+
b(() => {
|
|
30
|
+
E(p.Mounted);
|
|
31
|
+
}, [E]);
|
|
32
|
+
let { initResponse: D } = s(), O = u(), k = c(), A = o(), { organizationId: j, organizationStatus: M } = n(), N = D?.scopes?.includes(r.BankAccountReadOrg) ?? !1, P = l(), F = N && !P, I = v({ enabled: F }), { transactions: L } = I, R = O && !D || t(M) && !L || P && !L || I.isLoading, z = (!!k || I.isError) && !L, B = I.refetch, V = y(() => {
|
|
33
|
+
A(), F && j && B();
|
|
34
|
+
}, [
|
|
35
|
+
A,
|
|
36
|
+
B,
|
|
37
|
+
F,
|
|
38
|
+
j
|
|
39
|
+
]), H = x(() => h(L ?? [], T, g(/* @__PURE__ */ new Date())), [L, T]), U = y((e) => {
|
|
40
|
+
let t = L?.[Number(e)]?.bankAccount.id;
|
|
41
|
+
t && m && (E(p.TransactionClicked), m(t));
|
|
42
|
+
}, [
|
|
43
|
+
L,
|
|
44
|
+
m,
|
|
45
|
+
E
|
|
46
|
+
]);
|
|
47
|
+
return D && !N || M === e.None ? null : /* @__PURE__ */ S(d, {
|
|
48
|
+
rows: H,
|
|
49
|
+
onRowClick: m && F ? U : void 0,
|
|
50
|
+
isLoading: R,
|
|
51
|
+
isError: z,
|
|
52
|
+
onRetry: z ? V : void 0,
|
|
53
|
+
labels: T,
|
|
54
|
+
testIds: _,
|
|
55
|
+
className: C,
|
|
56
|
+
style: w
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function w({ labels: e, onTransactionClick: t, className: n, style: r, ...i }) {
|
|
60
|
+
return /* @__PURE__ */ S(a, {
|
|
61
|
+
...i,
|
|
62
|
+
widgetName: m,
|
|
63
|
+
children: /* @__PURE__ */ S(C, {
|
|
64
|
+
labels: e,
|
|
65
|
+
onTransactionClick: t,
|
|
66
|
+
className: n,
|
|
67
|
+
style: r
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export { w as RecentActivityWidget, C as RecentActivityWidgetWithContext };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RECENT_ACTIVITY_CARD_LABELS_EN as e } from "../../../../ui/dist/lib/RecentActivityCard/labels.js";
|
|
2
|
+
import "../../../../ui/dist/index.js";
|
|
3
|
+
// ../../libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/labels.js
|
|
4
|
+
var t = {
|
|
5
|
+
...e,
|
|
6
|
+
rowAriaLabel: ({ description: e, nickname: t, last4: n, date: r, amount: i }) => `${e}, ${t} ending ${n}, ${r}, ${i}`
|
|
7
|
+
};
|
|
8
|
+
export { t as RECENT_ACTIVITY_WIDGET_LABELS_EN };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// ../../libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/testIds.js
|
|
2
|
+
var e = {
|
|
3
|
+
root: "recent-activity-widget",
|
|
4
|
+
row: "recent-activity-widget-row",
|
|
5
|
+
skeleton: "recent-activity-widget-skeleton",
|
|
6
|
+
empty: "recent-activity-widget-empty",
|
|
7
|
+
error: "recent-activity-widget-error"
|
|
8
|
+
};
|
|
9
|
+
export { e as recentActivityWidgetTestIds };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// ../../libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/analytics/events.js
|
|
2
|
+
var e = "recent_activity_widget", t = {
|
|
3
|
+
Mounted: `${e}.mounted`,
|
|
4
|
+
TransactionClicked: `${e}.transaction_clicked`
|
|
5
|
+
};
|
|
6
|
+
export { t as RecentActivityWidgetAnalyticsEvent, e as WIDGET_NAME };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { amountOutputToMajorUnits as e, minorExponentForCurrency as t } from "../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
2
|
+
import { formatMoneyExact as n } from "../../../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
3
|
+
import "../../../../../shared/util/dist/index.js";
|
|
4
|
+
// ../../libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/recentActivityView/buildRecentActivityRows.js
|
|
5
|
+
var r = "−";
|
|
6
|
+
function i(e) {
|
|
7
|
+
let [t, n, r] = e.split("-").map(Number);
|
|
8
|
+
if (!t || !n || !r) return {
|
|
9
|
+
month: "",
|
|
10
|
+
day: "",
|
|
11
|
+
year: "",
|
|
12
|
+
spoken: e
|
|
13
|
+
};
|
|
14
|
+
let i = new Date(Date.UTC(t, n - 1, r)).toLocaleDateString("en-US", {
|
|
15
|
+
month: "short",
|
|
16
|
+
timeZone: "UTC"
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
month: i.toUpperCase(),
|
|
20
|
+
day: String(r),
|
|
21
|
+
year: String(t),
|
|
22
|
+
spoken: `${i} ${r}, ${t}`
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function a(e) {
|
|
26
|
+
let t = (e) => String(e).padStart(2, "0");
|
|
27
|
+
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
|
|
28
|
+
}
|
|
29
|
+
function o(e, t) {
|
|
30
|
+
let n = Number(t.slice(0, 4));
|
|
31
|
+
return n ? e < `${String(n - 1).padStart(4, "0")}${t.slice(4)}` : !1;
|
|
32
|
+
}
|
|
33
|
+
function s(i) {
|
|
34
|
+
let a = i.amount.currencyCode || "USD", o = t(a), s = n(Math.abs(e(i.amount)), {
|
|
35
|
+
currencyCode: a,
|
|
36
|
+
includeSpaceAfterCurrencySymbol: !1,
|
|
37
|
+
minimumFractionDigits: o,
|
|
38
|
+
maximumFractionDigits: o
|
|
39
|
+
});
|
|
40
|
+
return `${i.direction === "CREDIT" ? "+" : r}${s}`;
|
|
41
|
+
}
|
|
42
|
+
function c(e, t, n) {
|
|
43
|
+
return e.map((r, a) => {
|
|
44
|
+
let c = i(r.date), l = a === 0 ? n : e[a - 1].date, u = s(r), { nickname: d, accountNumberLast4: f } = r.bankAccount;
|
|
45
|
+
return {
|
|
46
|
+
id: String(a),
|
|
47
|
+
month: c.month,
|
|
48
|
+
day: c.day,
|
|
49
|
+
...o(r.date, l) ? { year: c.year } : {},
|
|
50
|
+
date: c.spoken,
|
|
51
|
+
title: r.description,
|
|
52
|
+
accountName: d,
|
|
53
|
+
accountLast4: f,
|
|
54
|
+
amount: u,
|
|
55
|
+
ariaLabel: t.rowAriaLabel({
|
|
56
|
+
description: r.description,
|
|
57
|
+
nickname: d,
|
|
58
|
+
last4: f,
|
|
59
|
+
date: c.spoken,
|
|
60
|
+
amount: u
|
|
61
|
+
})
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export { c as buildRecentActivityRows, a as localIsoDate, s as signedAmount };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// ../../libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/mocks/labels.js
|
|
2
|
+
var e = {
|
|
3
|
+
blurbs: {
|
|
4
|
+
populated: "The five newest transactions across the organization’s accounts, debits and credits mixed. A row opens its account through the host’s onTransactionClick.",
|
|
5
|
+
empty: "The organization has no transactions yet.",
|
|
6
|
+
loading: "The transactions read is held open, so the skeleton stays on screen.",
|
|
7
|
+
error: "The transactions read fails with a 500, so the card shows its own error. Retry re-issues it, and it fails again."
|
|
8
|
+
},
|
|
9
|
+
scenarios: { "unsupported-core": {
|
|
10
|
+
label: "Unsupported core",
|
|
11
|
+
blurb: "The bank’s core cannot list organization-wide transactions and the read answers 422. The card shows the same error as any failed read."
|
|
12
|
+
} }
|
|
13
|
+
};
|
|
14
|
+
export { e as RECENT_ACTIVITY_LABELS };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Scope as e } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
2
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
3
|
+
import { A_BANK_ACCOUNT as t } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
|
|
4
|
+
import { PROXY as n, answer as r, crossCuttingScenarios as i, initRoute as a, page as o, problem as s } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
|
|
5
|
+
import { RECENT_ACTIVITY_LABELS as c } from "./labels.js";
|
|
6
|
+
// ../../libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/mocks/recentActivity.js
|
|
7
|
+
var l = `${n}/bank-accounts/transactions`, u = (e) => e === l, d = [e.BankAccountReadOrg], f = {
|
|
8
|
+
id: t.id,
|
|
9
|
+
nickname: t.nickname ?? "Operating",
|
|
10
|
+
accountNumberLast4: t.accountNumber.slice(-4)
|
|
11
|
+
}, p = {
|
|
12
|
+
id: "00000000-0000-4000-8000-000000000206",
|
|
13
|
+
nickname: "Payroll",
|
|
14
|
+
accountNumberLast4: "4006"
|
|
15
|
+
}, m = (e, t, n, r, i) => ({
|
|
16
|
+
amount: {
|
|
17
|
+
value: i,
|
|
18
|
+
currencyCode: "USD"
|
|
19
|
+
},
|
|
20
|
+
bankAccount: n,
|
|
21
|
+
date: e,
|
|
22
|
+
description: t,
|
|
23
|
+
direction: r,
|
|
24
|
+
runningBalance: {
|
|
25
|
+
value: 0,
|
|
26
|
+
currencyCode: "USD"
|
|
27
|
+
}
|
|
28
|
+
}), h = [
|
|
29
|
+
m("2026-10-28", "Home Depot", f, "DEBIT", 31840),
|
|
30
|
+
m("2026-10-27", "Customer payment — Rivera", f, "CREDIT", 24e4),
|
|
31
|
+
m("2026-10-26", "Gusto payroll", p, "DEBIT", 1842066),
|
|
32
|
+
m("2026-10-25", "Transfer from Operating", p, "CREDIT", 5e5),
|
|
33
|
+
m("2026-10-24", "Shell Oil 57442", f, "DEBIT", 8655)
|
|
34
|
+
], g = [...i({
|
|
35
|
+
scopes: d,
|
|
36
|
+
read: {
|
|
37
|
+
matches: u,
|
|
38
|
+
body: o(h),
|
|
39
|
+
emptyBody: o([])
|
|
40
|
+
},
|
|
41
|
+
blurbs: c.blurbs
|
|
42
|
+
}, [
|
|
43
|
+
"populated",
|
|
44
|
+
"empty",
|
|
45
|
+
"loading",
|
|
46
|
+
"error"
|
|
47
|
+
]), {
|
|
48
|
+
key: "unsupported-core",
|
|
49
|
+
...c.scenarios["unsupported-core"],
|
|
50
|
+
routes: [a(d), r(u, () => s(422, "Unprocessable Entity", "Listing organization transactions is not supported by this core."))]
|
|
51
|
+
}];
|
|
52
|
+
export { h as RECENT_TRANSACTIONS, l as TRANSACTIONS_PATH, g as recentActivityScenarios };
|
package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/scenarios.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { recentActivityScenarios } from "./mocks/recentActivity.js";
|