@tesouro/embedded-components-react 0.11.200 → 0.11.202
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 +35 -19
- package/dist/index.d.ts +16 -1
- package/dist/index.js +43 -42
- package/dist/lib/BillPayWidget.d.ts +16 -1
- package/dist/lib/BillPayWidget.js +4 -3
- 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/shared/feature/dist/lib/analytics/build-info.js +1 -1
- 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/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.202", n = "d933bf53ea81d7279ad8f9536a723b6d196c6444", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|