@tesouro/embedded-components-react 0.7.32 → 0.7.35
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 +10 -8
- package/dist/index.d.ts +45 -31
- package/dist/index.js +5 -5
- package/dist/lib/CounterpartsWidget.d.ts +14 -0
- package/dist/lib/CounterpartsWidgetPublic.d.ts +14 -0
- package/dist/lib/CustomersWidget.d.ts +14 -0
- package/dist/lib/{MarketingWidget.d.ts → OfferWidget.d.ts} +31 -31
- package/dist/lib/OfferWidget.js +6 -0
- package/dist/lib/ReceivablesWidget.d.ts +14 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +107 -91
- package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/index.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget/MarketingWidget.js → offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js} +11 -11
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget → offer-widget/feature/dist/lib/OfferWidget}/labels.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget/marketingApplicationView.js → offer-widget/feature/dist/lib/OfferWidget/offerApplicationView.js} +2 -2
- package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/analytics/events.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/feature/dist/lib/testIds.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/feature/dist/mocks/labels.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/mocks/marketing.js → offer-widget/feature/dist/mocks/offer.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/scenarios.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index2.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index7.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index8.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index9.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +11 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +36 -38
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +43 -41
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +40 -34
- 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/mocks/widgetSuite.js +2 -2
- package/dist/scenarios/index.d.ts +2 -2
- package/dist/scenarios/index.js +3 -3
- package/package.json +1 -1
- package/dist/lib/MarketingWidget.js +0 -6
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +0 -5
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/lib/analytics/events.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/scenarios.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +0 -5
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index2.js +0 -10
|
@@ -2,115 +2,131 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import "../../../../../shared/ui/dist/index.js";
|
|
7
|
+
import { addressResponseToFormValues as t, bankAccountToAchFormValues as n, counterpartToFormValues as r } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
8
|
+
import { useAddressForm as i } from "../../../../../shared/counterpart-management/feature/dist/lib/useAddressForm.js";
|
|
9
|
+
import { useCounterpartForm as a } from "../../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
10
|
+
import { useDeleteController as o } from "../../../../../shared/counterpart-management/feature/dist/lib/useDeleteController.js";
|
|
11
|
+
import { useBankAccountForm as s } from "../../../../../shared/counterpart-management/feature/dist/lib/subEntityForms.js";
|
|
10
12
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
11
|
-
import { useRebaseOnRefresh as
|
|
12
|
-
import { useCallback as
|
|
13
|
+
import { useRebaseOnRefresh as c } from "./useRebaseOnRefresh.js";
|
|
14
|
+
import { useCallback as l, useMemo as u } from "react";
|
|
13
15
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js
|
|
14
|
-
var
|
|
16
|
+
var d = {
|
|
15
17
|
line1: "",
|
|
16
18
|
line2: "",
|
|
17
19
|
city: "",
|
|
18
20
|
state: "",
|
|
19
21
|
postalCode: ""
|
|
20
22
|
};
|
|
21
|
-
function
|
|
23
|
+
function f(e, t) {
|
|
22
24
|
return e.line1 === t.line1 && e.line2 === t.line2 && e.city === t.city && e.state === t.state && e.postalCode === t.postalCode;
|
|
23
25
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
selectedId:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
26
|
+
function p(e) {
|
|
27
|
+
return e.entityType === "organization" ? e.legalName.trim() : [e.firstName.trim(), e.lastName.trim()].filter(Boolean).join(" ");
|
|
28
|
+
}
|
|
29
|
+
function m({ counterpartType: m, selectedId: h, setSelectedId: g, view: _, setView: v, details: y, messages: b }) {
|
|
30
|
+
let x = m === "customer", S = a({
|
|
31
|
+
view: _,
|
|
32
|
+
setView: v,
|
|
33
|
+
selectedId: h,
|
|
34
|
+
setSelectedId: g,
|
|
35
|
+
messages: b,
|
|
36
|
+
counterpartType: m,
|
|
37
|
+
counterpart: y.counterpart,
|
|
38
|
+
primaryAddress: x && _ === "edit" ? void 0 : y.primaryAddress,
|
|
39
|
+
includeBankAccount: _ === "create"
|
|
40
|
+
}), C = s({
|
|
41
|
+
items: y.bankAccounts,
|
|
42
|
+
selectedId: h,
|
|
43
|
+
messages: b
|
|
44
|
+
}), w = i({
|
|
45
|
+
selectedId: h,
|
|
46
|
+
primaryAddress: y.primaryAddress,
|
|
47
|
+
messages: b
|
|
48
|
+
}), T = o({
|
|
49
|
+
selectedId: h,
|
|
50
|
+
setSelectedId: g,
|
|
51
|
+
detailsView: y.detailsView,
|
|
52
|
+
messages: b
|
|
53
|
+
}), E = u(() => {
|
|
54
|
+
if (!y.counterpart) return;
|
|
55
|
+
let e = r(y.counterpart, y.primaryAddress);
|
|
56
|
+
return x ? {
|
|
52
57
|
...e,
|
|
53
|
-
address:
|
|
58
|
+
address: d
|
|
54
59
|
} : e;
|
|
55
60
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]),
|
|
60
|
-
if (
|
|
61
|
-
let e =
|
|
62
|
-
return e ?
|
|
61
|
+
y.counterpart,
|
|
62
|
+
y.primaryAddress,
|
|
63
|
+
x
|
|
64
|
+
]), D = u(() => y.primaryAddress ? t(y.primaryAddress) : d, [y.primaryAddress]), O = u(() => {
|
|
65
|
+
if (C.form.sheet.mode !== "edit") return;
|
|
66
|
+
let e = y.bankAccounts?.find((e) => e.id === C.form.sheet.id);
|
|
67
|
+
return e ? n(e) : void 0;
|
|
63
68
|
}, [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
C.form.sheet.id,
|
|
70
|
+
C.form.sheet.mode,
|
|
71
|
+
y.bankAccounts
|
|
67
72
|
]);
|
|
68
|
-
|
|
69
|
-
open:
|
|
70
|
-
seed: w,
|
|
71
|
-
setValues: b.setValues
|
|
72
|
-
}), s({
|
|
73
|
-
open: S.open,
|
|
74
|
-
seed: T,
|
|
75
|
-
setValues: S.setValues
|
|
76
|
-
}), s({
|
|
77
|
-
open: x.form.sheet.open,
|
|
73
|
+
c({
|
|
74
|
+
open: _ === "edit",
|
|
78
75
|
seed: E,
|
|
79
|
-
setValues:
|
|
80
|
-
}),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
setValues: S.setValues
|
|
77
|
+
}), c({
|
|
78
|
+
open: w.open,
|
|
79
|
+
seed: D,
|
|
80
|
+
setValues: w.setValues
|
|
81
|
+
}), c({
|
|
82
|
+
open: C.form.sheet.open,
|
|
83
|
+
seed: O,
|
|
84
|
+
setValues: C.form.setValues
|
|
85
|
+
}), C.form.sheet.open && C.form.sheet.mode === "edit" && y.bankAccounts !== void 0 && !y.isBankAccountsFetching && !O && C.form.close();
|
|
86
|
+
let k = u(() => {
|
|
87
|
+
if (!E) return !1;
|
|
88
|
+
let e = S.values;
|
|
89
|
+
return e.legalName !== E.legalName || e.firstName !== E.firstName || e.lastName !== E.lastName || e.email !== E.email || e.phone !== E.phone || e.taxId !== E.taxId || e.remindersEnabled !== E.remindersEnabled || !x && !f(e.address, E.address);
|
|
90
|
+
}, [
|
|
91
|
+
E,
|
|
92
|
+
S.values,
|
|
93
|
+
x
|
|
94
|
+
]), A = u(() => !f(w.values, D), [w.values, D]), { close: j } = w, { openEdit: M, setValues: N, submit: P, values: F } = S, I = l(async () => {
|
|
95
|
+
let t = _ === "edit" ? b.updateSucceeded : b.createSucceeded, n = p(F), r = await P();
|
|
96
|
+
return r.ok && e.success(t.replace("{name}", () => n)), r;
|
|
85
97
|
}, [
|
|
86
|
-
|
|
87
|
-
b
|
|
88
|
-
|
|
89
|
-
|
|
98
|
+
_,
|
|
99
|
+
b,
|
|
100
|
+
F,
|
|
101
|
+
P
|
|
102
|
+
]), L = l(() => {
|
|
103
|
+
if (!x) {
|
|
104
|
+
j(), M();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
M(), N((e) => ({
|
|
108
|
+
...e,
|
|
109
|
+
address: d
|
|
110
|
+
}));
|
|
111
|
+
}, [
|
|
112
|
+
j,
|
|
113
|
+
M,
|
|
114
|
+
N,
|
|
115
|
+
x
|
|
116
|
+
]);
|
|
90
117
|
return {
|
|
91
|
-
form:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
A(), j((e) => ({
|
|
104
|
-
...e,
|
|
105
|
-
address: u
|
|
106
|
-
}));
|
|
107
|
-
}, [
|
|
108
|
-
k,
|
|
109
|
-
A,
|
|
110
|
-
j,
|
|
111
|
-
y
|
|
112
|
-
])
|
|
118
|
+
form: {
|
|
119
|
+
...S,
|
|
120
|
+
submit: I
|
|
121
|
+
},
|
|
122
|
+
bank: C,
|
|
123
|
+
address: w,
|
|
124
|
+
del: T,
|
|
125
|
+
isEditDirty: k,
|
|
126
|
+
isAddressDirty: A,
|
|
127
|
+
closeAddress: j,
|
|
128
|
+
handleEditProfile: L
|
|
113
129
|
};
|
|
114
130
|
}
|
|
115
131
|
//#endregion
|
|
116
|
-
export {
|
|
132
|
+
export { m as useCounterpartDetailsActions };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OFFER_WIDGET_STATUS_LABELS_EN as e } from "./lib/OfferWidget/labels.js";
|
|
2
|
+
import { OFFER_WIDGET_LABELS_EN as t } from "../../ui/dist/index2.js";
|
|
3
|
+
import { OfferBenefitIcon as n } from "../../ui/dist/index3.js";
|
|
4
|
+
import { OfferWidget as r } from "./lib/OfferWidget/OfferWidget.js";
|
|
5
|
+
export { t as OFFER_WIDGET_LABELS_EN, e as OFFER_WIDGET_STATUS_LABELS_EN, n as OfferBenefitIcon, r as OfferWidget };
|
|
@@ -9,17 +9,17 @@ import { WidgetProvider as n } from "../../../../../shared/feature/dist/lib/Widg
|
|
|
9
9
|
import { useWidgetConfig as r, useWidgetInitStaleForToken as i } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
10
|
import { deniedNoticeExpiresAt as a, selectBankAccountApplication as o } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
|
|
11
11
|
import "../../../../../shared/feature/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
12
|
+
import { OFFER_WIDGET_STATUS_LABELS_EN as s } from "./labels.js";
|
|
13
|
+
import { OfferWidgetAnalyticsEvent as c, WIDGET_NAME as l } from "../analytics/events.js";
|
|
14
|
+
import { offerWidgetTestIds as u } from "../testIds.js";
|
|
15
|
+
import { OfferApplicationView as d, offerApplicationViewFor as f } from "./offerApplicationView.js";
|
|
16
|
+
import { OFFER_WIDGET_LABELS_EN as p } from "../../../../ui/dist/index2.js";
|
|
17
|
+
import { OfferBenefitIcon as m, OfferWidgetStatusTone as h } from "../../../../ui/dist/index3.js";
|
|
18
|
+
import { OfferWidget as g } from "../../../../ui/dist/index9.js";
|
|
19
19
|
import "../../../../ui/dist/index.js";
|
|
20
20
|
import { useCallback as _, useEffect as v, useMemo as y, useReducer as b, useState as x } from "react";
|
|
21
21
|
import { jsx as S } from "react/jsx-runtime";
|
|
22
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
22
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js
|
|
23
23
|
var C = 2 ** 31 - 1, w = /* @__PURE__ */ new Set([
|
|
24
24
|
"ACTIVE",
|
|
25
25
|
"INACTIVE",
|
|
@@ -120,8 +120,8 @@ function A({ content: n, onPrimaryCtaClick: s, labels: l, statusLabels: p }) {
|
|
|
120
120
|
howItWorksSteps: n.howItWorksSteps,
|
|
121
121
|
fromDayOneHeader: n.fromDayOneHeader,
|
|
122
122
|
benefits: n.benefits,
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
onOpenOfferModal: W,
|
|
124
|
+
onCloseOfferModal: G,
|
|
125
125
|
onPrimaryCtaClick: K,
|
|
126
126
|
statusMessage: V,
|
|
127
127
|
labels: H,
|
|
@@ -157,4 +157,4 @@ function j({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gat
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
//#endregion
|
|
160
|
-
export { p as
|
|
160
|
+
export { p as OFFER_WIDGET_LABELS_EN, s as OFFER_WIDGET_STATUS_LABELS_EN, m as OfferBenefitIcon, j as OfferWidget };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/labels.js
|
|
2
2
|
function e(e) {
|
|
3
3
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
4
4
|
}
|
|
@@ -34,4 +34,4 @@ var n = {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
37
|
-
export { r as
|
|
37
|
+
export { r as OFFER_WIDGET_STATUS_LABELS_EN };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { deniedNoticeExpiresAt as e } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
|
|
2
2
|
import "../../../../../shared/feature/dist/index.js";
|
|
3
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
3
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/offerApplicationView.js
|
|
4
4
|
var t = {
|
|
5
5
|
Offer: "offer",
|
|
6
6
|
Resume: "resume",
|
|
@@ -28,4 +28,4 @@ function n(n, r = Date.now()) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
export { t as
|
|
31
|
+
export { t as OfferApplicationView, n as offerApplicationViewFor };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/analytics/events.js
|
|
2
|
+
var e = {
|
|
3
|
+
Mounted: "marketing.mounted",
|
|
4
|
+
OpenModal: "marketing.open_modal",
|
|
5
|
+
PrimaryCta: "marketing.primary_cta"
|
|
6
|
+
}, t = "marketing";
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as OfferWidgetAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/testIds.js
|
|
2
2
|
var e = {
|
|
3
3
|
root: "marketing-widget",
|
|
4
4
|
learnMoreButton: "marketing-widget-learn-more-button",
|
|
@@ -8,4 +8,4 @@ var e = {
|
|
|
8
8
|
primaryCtaButton: "marketing-widget-primary-cta-button"
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
|
-
export { e as
|
|
11
|
+
export { e as offerWidgetTestIds };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/mocks/labels.js
|
|
2
2
|
var e = { scenarios: {
|
|
3
3
|
default: {
|
|
4
4
|
label: "Available",
|
|
@@ -26,4 +26,4 @@ var e = { scenarios: {
|
|
|
26
26
|
}
|
|
27
27
|
} };
|
|
28
28
|
//#endregion
|
|
29
|
-
export { e as
|
|
29
|
+
export { e as OFFER_LABELS };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A_COMPLETE_BANK_ACCOUNT_APPLICATION as e } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
|
|
2
2
|
import { PROXY as t, initRoute as n, readRoute as r } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
|
|
3
|
-
import {
|
|
4
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
3
|
+
import { OFFER_LABELS as i } from "./labels.js";
|
|
4
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/mocks/offer.js
|
|
5
5
|
var a = {
|
|
6
6
|
status: "NOT_FOUND",
|
|
7
7
|
organizationId: null,
|
|
@@ -31,4 +31,4 @@ var a = {
|
|
|
31
31
|
u("existing-customer", {})
|
|
32
32
|
];
|
|
33
33
|
//#endregion
|
|
34
|
-
export { d as
|
|
34
|
+
export { d as offerScenarios };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OFFER_WIDGET_LABELS_EN as e } from "./index2.js";
|
|
2
|
+
import { OfferBenefitIcon as t, OfferWidgetStatusTone as n } from "./index3.js";
|
|
3
|
+
import "./index7.js";
|
|
4
|
+
import { OfferWidget as r } from "./index9.js";
|
|
5
|
+
export { e as OFFER_WIDGET_LABELS_EN, t as OfferBenefitIcon, r as OfferWidget, n as OfferWidgetStatusTone };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index2.js
|
|
2
|
+
var e = {
|
|
3
|
+
applyNow: "Apply now",
|
|
4
|
+
learnMore: "Learn more",
|
|
5
|
+
primaryCta: "Start application",
|
|
6
|
+
primaryCtaSubtext: "takes about 5 minutes",
|
|
7
|
+
dismissModalAriaLabel: "Close offer modal"
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { e as OFFER_WIDGET_LABELS_EN };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index3.js
|
|
2
2
|
var e = {
|
|
3
3
|
Sync: "sync",
|
|
4
4
|
Users: "users",
|
|
@@ -11,4 +11,4 @@ var e = {
|
|
|
11
11
|
Danger: "danger"
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { e as
|
|
14
|
+
export { e as OfferBenefitIcon, t as OfferWidgetStatusTone };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OfferBenefitIcon as e } from "./index3.js";
|
|
2
2
|
import { CreditCard as t, DollarSign as n, FileText as r, RefreshCw as i, Users as a } from "lucide-react";
|
|
3
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
3
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index4.js
|
|
4
4
|
var o = {
|
|
5
5
|
[e.Sync]: i,
|
|
6
6
|
[e.Users]: a,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BENEFIT_ICON_COMPONENTS as e } from "./index4.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
3
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index5.js
|
|
4
4
|
function r({ text: r, icon: i }) {
|
|
5
5
|
let a = e[i];
|
|
6
6
|
return /* @__PURE__ */ n("div", {
|
|
@@ -15,4 +15,4 @@ function r({ text: r, icon: i }) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
|
-
export { r as
|
|
18
|
+
export { r as OfferBenefitItem };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
2
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index6.js
|
|
3
3
|
function n({ header: n, steps: r }) {
|
|
4
4
|
return r.length === 0 ? null : /* @__PURE__ */ t("div", {
|
|
5
5
|
className: "ttw:mb-6",
|
|
@@ -37,4 +37,4 @@ function n({ header: n, steps: r }) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
|
-
export { n as
|
|
40
|
+
export { n as OfferWidgetHowItWorks };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Button as e, Dialog as t, DialogClose as n, DialogContent as r, DialogTitle as i } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { OFFER_WIDGET_LABELS_EN as a } from "./index2.js";
|
|
3
|
+
import { OfferBenefitItem as o } from "./index5.js";
|
|
4
|
+
import { OfferWidgetHowItWorks as s } from "./index6.js";
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
import { ArrowRight as u, X as d } from "lucide-react";
|
|
7
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
7
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index7.js
|
|
8
8
|
function f({ open: f, vspLogo: p, providedByCaption: m, primaryModalHeader: h, howItWorksHeader: g, howItWorksSteps: _, fromDayOneHeader: v, benefits: y, onClose: b, onPrimaryCtaClick: x, labels: S, testIds: C }) {
|
|
9
9
|
let w = {
|
|
10
10
|
...a,
|
|
@@ -95,4 +95,4 @@ function f({ open: f, vspLogo: p, providedByCaption: m, primaryModalHeader: h, h
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
|
-
export { f as
|
|
98
|
+
export { f as OfferWidgetModal };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Badge as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { OfferWidgetStatusTone as n } from "./index3.js";
|
|
3
3
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
4
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index8.js
|
|
5
5
|
var a = {
|
|
6
6
|
[n.Brand]: "ttw:border-transparent ttw:bg-primary/10 ttw:text-primary",
|
|
7
7
|
[n.Warning]: "ttw:border-amber-100 ttw:bg-amber-100 ttw:text-amber-700",
|
|
@@ -33,4 +33,4 @@ function o({ statusMessage: n, testId: o }) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
//#endregion
|
|
36
|
-
export { o as
|
|
36
|
+
export { o as OfferWidgetStatus };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { OFFER_WIDGET_LABELS_EN as t } from "./index2.js";
|
|
3
|
+
import { OfferWidgetModal as n } from "./index7.js";
|
|
4
|
+
import { OfferWidgetStatus as r } from "./index8.js";
|
|
5
5
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
7
|
-
function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCaption: d, providedByCaption: f, primaryModalHeader: p, howItWorksHeader: m, howItWorksSteps: h, fromDayOneHeader: g, benefits: _,
|
|
6
|
+
//#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index9.js
|
|
7
|
+
function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCaption: d, providedByCaption: f, primaryModalHeader: p, howItWorksHeader: m, howItWorksSteps: h, fromDayOneHeader: g, benefits: _, onOpenOfferModal: v, onCloseOfferModal: y, onPrimaryCtaClick: b, statusMessage: x, labels: S, testIds: C }) {
|
|
8
8
|
let w = {
|
|
9
9
|
...t,
|
|
10
10
|
...S
|
|
@@ -74,4 +74,4 @@ function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCa
|
|
|
74
74
|
})] });
|
|
75
75
|
}
|
|
76
76
|
//#endregion
|
|
77
|
-
export { s as
|
|
77
|
+
export { s as OfferWidget };
|
|
@@ -20,7 +20,17 @@ var e = {
|
|
|
20
20
|
deleteTitle: "Delete {name}?",
|
|
21
21
|
deleteBankAccountTitle: "Delete bank account “{account}”?",
|
|
22
22
|
deleteCounterpartMessage: "This record and its contacts, bank accounts, and tax ID will be permanently removed. You can't undo this action.",
|
|
23
|
-
deleteBankAccountMessage: "This removes these payment instructions from the vendor. The vendor will not be deleted. You can't undo this action."
|
|
23
|
+
deleteBankAccountMessage: "This removes these payment instructions from the vendor. The vendor will not be deleted. You can't undo this action.",
|
|
24
|
+
createSucceeded: "{name} has been added to the list.",
|
|
25
|
+
updateSucceeded: "{name} has been updated.",
|
|
26
|
+
addressAdded: "Address has been added.",
|
|
27
|
+
addressUpdated: "Address has been updated.",
|
|
28
|
+
bankAccountAdded: "Bank Account has been added.",
|
|
29
|
+
bankAccountUpdated: "Bank account information has been updated.",
|
|
30
|
+
counterpartDeleted: "Counterpart has been deleted.",
|
|
31
|
+
bankAccountDeleted: "Bank Account has been deleted.",
|
|
32
|
+
deleteCounterpartFailed: "Failed to delete Counterpart.",
|
|
33
|
+
deleteBankAccountFailed: "Failed to delete Bank Account."
|
|
24
34
|
};
|
|
25
35
|
//#endregion
|
|
26
36
|
export { e as COUNTERPART_MESSAGE_LABELS_EN };
|
|
@@ -2,48 +2,46 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import "../../../../ui/dist/index.js";
|
|
7
|
+
import { bankAccountToAchFormValues as t, counterpartFormBankAccountToCreatePayload as n, counterpartFormBankAccountToUpdatePayload as r, emptyAchFormValues as i, hasAchFormErrors as a, resolveCounterpartBankAccountWrite as o, validateAchFormValues as s } from "./helpers.js";
|
|
8
|
+
import { useCreateCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "../../../data-access/dist/index5.js";
|
|
7
9
|
import "../../../data-access/dist/index.js";
|
|
8
|
-
import { useSubEntityForm as
|
|
10
|
+
import { useSubEntityForm as u } from "./useSubEntityForm.js";
|
|
9
11
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
items:
|
|
13
|
-
empty:
|
|
14
|
-
toFormValues:
|
|
15
|
-
validate: (e) =>
|
|
16
|
-
hasErrors: (e) =>
|
|
17
|
-
genericError:
|
|
18
|
-
onSubmit: async ({ mode:
|
|
19
|
-
if (!
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
await p.mutateAsync({
|
|
32
|
-
path: { counterpart_id: d },
|
|
33
|
-
body: t(i, { isDefaultForCurrency: o.isDefaultForCurrency })
|
|
34
|
-
});
|
|
12
|
+
function d({ items: d, selectedId: f, messages: p }) {
|
|
13
|
+
let m = c(), h = l(), g = u({
|
|
14
|
+
items: d,
|
|
15
|
+
empty: i,
|
|
16
|
+
toFormValues: t,
|
|
17
|
+
validate: (e) => s(e, p),
|
|
18
|
+
hasErrors: (e) => a(e),
|
|
19
|
+
genericError: p.genericError,
|
|
20
|
+
onSubmit: async ({ mode: t, id: i, values: a }) => {
|
|
21
|
+
if (!f) return;
|
|
22
|
+
let s = o(d, t === "edit" ? i : void 0);
|
|
23
|
+
s.kind === "update" ? await h.mutateAsync({
|
|
24
|
+
path: {
|
|
25
|
+
counterpart_id: f,
|
|
26
|
+
bank_account_id: s.bankAccountId
|
|
27
|
+
},
|
|
28
|
+
body: r(a, { includeAchDefaults: s.includeAchDefaults })
|
|
29
|
+
}) : await m.mutateAsync({
|
|
30
|
+
path: { counterpart_id: f },
|
|
31
|
+
body: n(a, { isDefaultForCurrency: s.isDefaultForCurrency })
|
|
32
|
+
}), e.success(t === "edit" && i ? p.bankAccountUpdated : p.bankAccountAdded);
|
|
35
33
|
}
|
|
36
|
-
}),
|
|
37
|
-
accountHolderName: !
|
|
38
|
-
routingNumber: !
|
|
39
|
-
accountNumber: !
|
|
40
|
-
} : void 0,
|
|
34
|
+
}), _ = g.sheet.mode === "edit" ? d?.find((e) => e.id === g.sheet.id) : void 0, v = _ ? {
|
|
35
|
+
accountHolderName: !g.values.accountHolderName.trim(),
|
|
36
|
+
routingNumber: !g.values.routingNumber.trim(),
|
|
37
|
+
accountNumber: !g.values.accountNumber.trim()
|
|
38
|
+
} : void 0, y = _ ? t(_) : i(), b = Object.keys(y).some((e) => g.values[e] !== y[e]);
|
|
41
39
|
return {
|
|
42
|
-
form:
|
|
43
|
-
inProgress:
|
|
44
|
-
highlightedFields:
|
|
45
|
-
isDirty:
|
|
40
|
+
form: g,
|
|
41
|
+
inProgress: m.isPending || h.isPending,
|
|
42
|
+
highlightedFields: v,
|
|
43
|
+
isDirty: b
|
|
46
44
|
};
|
|
47
45
|
}
|
|
48
46
|
//#endregion
|
|
49
|
-
export {
|
|
47
|
+
export { d as useBankAccountForm };
|