@tesouro/embedded-components-react 0.7.40 → 0.7.42
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 +2 -2
- package/dist/index.css +11 -0
- package/dist/index.d.ts +16 -14
- package/dist/lib/CounterpartsWidget.d.ts +16 -14
- package/dist/lib/CounterpartsWidgetPublic.d.ts +16 -14
- package/dist/lib/CustomersWidget.d.ts +16 -14
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/mocks/acceptDisclosures.js +33 -28
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/mocks/labels.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/PersonalDetailsStep.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/businessDetailsPanelMapping.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/personalDetailsPanelMapping.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/mocks/bankAccountOnboarding.js +40 -22
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/mocks/labels.js +14 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +8 -10
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +274 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +30 -4
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +21 -272
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +65 -26
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +341 -21
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +27 -65
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +26 -341
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +72 -27
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +85 -26
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +8 -74
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +55 -83
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +42 -37
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +30 -29
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/constants.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +143 -95
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +60 -48
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +22 -15
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +137 -135
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/mocks/expenseManagement.js +163 -140
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/mocks/labels.js +22 -16
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/labels.js +12 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js +255 -88
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +106 -108
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/scenarios/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js +0 -11
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js +0 -64
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { formatMoneyExact as e } from "../../../../util/dist/lib/formatMoneyExact.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { EMPTY_ADDRESS_FORM_VALUES as i } from "../../../ui/dist/index6.js";
|
|
2
|
+
import { isValidAchAccountNumber as t } from "../../../../util/dist/lib/isValidAchAccountNumber.js";
|
|
3
|
+
import { COUNTERPART_FORM_SHEET_LABELS_EN as n } from "../../../ui/dist/index2.js";
|
|
4
|
+
import { EMPTY_ADDRESS_FORM_VALUES as r } from "../../../ui/dist/index6.js";
|
|
6
5
|
import "../../../ui/dist/index.js";
|
|
7
|
-
import { COUNTERPART_MESSAGE_LABELS_EN as
|
|
6
|
+
import { COUNTERPART_MESSAGE_LABELS_EN as i } from "./labels.js";
|
|
8
7
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js
|
|
9
|
-
function
|
|
8
|
+
function a(e) {
|
|
10
9
|
try {
|
|
11
10
|
return new Intl.NumberFormat("en-US", {
|
|
12
11
|
style: "currency",
|
|
@@ -16,58 +15,57 @@ function o(e) {
|
|
|
16
15
|
return 2;
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
function
|
|
20
|
-
return e / 10 **
|
|
18
|
+
function o(e, t) {
|
|
19
|
+
return e / 10 ** a(t);
|
|
21
20
|
}
|
|
22
|
-
function
|
|
23
|
-
return e(
|
|
21
|
+
function s(t, n = "USD") {
|
|
22
|
+
return e(o(t, n), { currencyCode: n });
|
|
24
23
|
}
|
|
25
|
-
var
|
|
24
|
+
var c = new Intl.DateTimeFormat(void 0, {
|
|
26
25
|
year: "numeric",
|
|
27
26
|
month: "short",
|
|
28
27
|
day: "numeric"
|
|
29
28
|
});
|
|
30
|
-
function
|
|
29
|
+
function l(e) {
|
|
31
30
|
if (!e) return "";
|
|
32
31
|
let t = new Date(e);
|
|
33
|
-
return Number.isNaN(t.getTime()) ? "" :
|
|
32
|
+
return Number.isNaN(t.getTime()) ? "" : c.format(t);
|
|
34
33
|
}
|
|
35
|
-
function
|
|
34
|
+
function u(e) {
|
|
36
35
|
if ("organization" in e) return e.organization.legal_name;
|
|
37
36
|
let { first_name: t, last_name: n } = e.individual;
|
|
38
37
|
return [t, n].filter(Boolean).join(" ").trim();
|
|
39
38
|
}
|
|
40
|
-
function
|
|
39
|
+
function d(e) {
|
|
41
40
|
return "organization" in e ? e.organization.email ?? "" : e.individual.email ?? "";
|
|
42
41
|
}
|
|
43
|
-
function
|
|
42
|
+
function f(e) {
|
|
44
43
|
return "organization" in e ? e.organization.phone ?? "" : e.individual.phone ?? "";
|
|
45
44
|
}
|
|
46
|
-
function
|
|
45
|
+
function p(e) {
|
|
47
46
|
let t = /* @__PURE__ */ new Map();
|
|
48
47
|
for (let n of e ?? []) n.dimension_value && t.set(n.dimension_value, Math.round(n.metric_value));
|
|
49
48
|
return t;
|
|
50
49
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
50
|
+
var m = "-";
|
|
51
|
+
function h({ counterparts: e, addresses: t, billedAmounts: n, dueOrOwedAmounts: r, isBilledAmountLoading: i = !1, isDueOrOwedAmountLoading: a = !1, isBilledAmountError: o = !1, isDueOrOwedAmountError: c = !1 }) {
|
|
53
52
|
return e.map((e) => {
|
|
54
|
-
let
|
|
53
|
+
let l = n?.get(e.id) ?? 0, d = r?.get(e.id) ?? 0, f = l - d, p = i || a, h = o || c, g = u(e);
|
|
55
54
|
return {
|
|
56
55
|
id: e.id,
|
|
57
|
-
name:
|
|
58
|
-
initials: t(_),
|
|
56
|
+
name: g,
|
|
59
57
|
entityType: e.type,
|
|
60
|
-
locationLabel:
|
|
61
|
-
billedAmountLabel:
|
|
62
|
-
receivedOrPaidAmountLabel:
|
|
63
|
-
dueOrOwedAmountLabel:
|
|
64
|
-
isBilledAmountLoading:
|
|
65
|
-
isReceivedOrPaidAmountLoading:
|
|
66
|
-
isDueOrOwedAmountLoading:
|
|
58
|
+
locationLabel: _(t?.get(e.id)),
|
|
59
|
+
billedAmountLabel: o ? m : n && !i ? s(l) : "",
|
|
60
|
+
receivedOrPaidAmountLabel: h ? m : n && r && !p ? s(f) : "",
|
|
61
|
+
dueOrOwedAmountLabel: c ? m : r && !a ? s(d) : "",
|
|
62
|
+
isBilledAmountLoading: i && !o,
|
|
63
|
+
isReceivedOrPaidAmountLoading: p && !h,
|
|
64
|
+
isDueOrOwedAmountLoading: a && !c
|
|
67
65
|
};
|
|
68
66
|
});
|
|
69
67
|
}
|
|
70
|
-
function
|
|
68
|
+
function g(e) {
|
|
71
69
|
if (!e) return [];
|
|
72
70
|
let t = [
|
|
73
71
|
e.city,
|
|
@@ -81,27 +79,27 @@ function _(e) {
|
|
|
81
79
|
e.country
|
|
82
80
|
].filter((e) => !!(e && e.trim()));
|
|
83
81
|
}
|
|
84
|
-
function
|
|
85
|
-
return e
|
|
82
|
+
function _(e) {
|
|
83
|
+
return !e?.country || !e.city ? "" : `${e.country} • ${e.city}`;
|
|
86
84
|
}
|
|
87
|
-
function
|
|
85
|
+
function v({ counterpart: e, primaryAddress: t }) {
|
|
88
86
|
return {
|
|
89
|
-
name:
|
|
87
|
+
name: u(e),
|
|
90
88
|
entityType: e.type,
|
|
91
|
-
email:
|
|
92
|
-
phone:
|
|
89
|
+
email: d(e),
|
|
90
|
+
phone: f(e),
|
|
93
91
|
taxId: e.tax_id ?? "",
|
|
94
|
-
addressLines:
|
|
95
|
-
createdAtLabel:
|
|
96
|
-
updatedAtLabel:
|
|
92
|
+
addressLines: g(t),
|
|
93
|
+
createdAtLabel: l(e.created_at),
|
|
94
|
+
updatedAtLabel: l(e.updated_at)
|
|
97
95
|
};
|
|
98
96
|
}
|
|
99
|
-
function
|
|
97
|
+
function y(e) {
|
|
100
98
|
if (e) return `•••• ${e.slice(-4)}`;
|
|
101
99
|
}
|
|
102
|
-
function
|
|
100
|
+
function b(e) {
|
|
103
101
|
return (e ?? []).map((e) => {
|
|
104
|
-
let t =
|
|
102
|
+
let t = y(e.iban || e.account_number || void 0), n = [e.currency, t].filter(Boolean).join(" · ");
|
|
105
103
|
return {
|
|
106
104
|
id: e.id,
|
|
107
105
|
primary: e.name || e.account_holder_name || e.currency,
|
|
@@ -110,17 +108,17 @@ function x(e) {
|
|
|
110
108
|
};
|
|
111
109
|
});
|
|
112
110
|
}
|
|
113
|
-
function
|
|
111
|
+
function x(e) {
|
|
114
112
|
let t = (e ?? []).filter((e) => e.currency === "USD" && (!!e.routing_number || !!e.account_number));
|
|
115
113
|
return t.find((e) => e.is_default_for_currency) ?? t[0];
|
|
116
114
|
}
|
|
117
|
-
function
|
|
118
|
-
let r = n && (e ?? []).find((e) => e.id === n &&
|
|
115
|
+
function S(e, t = "USD", n) {
|
|
116
|
+
let r = n && (e ?? []).find((e) => e.id === n && B(e));
|
|
119
117
|
if (r) return r;
|
|
120
118
|
let i = (e ?? []).filter((e) => e.currency === t && !!e.account_holder_name && !!e.routing_number && !!e.account_number);
|
|
121
119
|
return i.find((e) => e.is_default_for_currency) ?? i[0];
|
|
122
120
|
}
|
|
123
|
-
function
|
|
121
|
+
function C(e) {
|
|
124
122
|
return {
|
|
125
123
|
line1: e.line1.trim(),
|
|
126
124
|
line2: e.line2.trim() || void 0,
|
|
@@ -130,7 +128,7 @@ function w(e) {
|
|
|
130
128
|
country: "US"
|
|
131
129
|
};
|
|
132
130
|
}
|
|
133
|
-
function
|
|
131
|
+
function w(e) {
|
|
134
132
|
return {
|
|
135
133
|
line1: e.line1 ?? "",
|
|
136
134
|
line2: e.line2 ?? "",
|
|
@@ -139,10 +137,10 @@ function T(e) {
|
|
|
139
137
|
postalCode: e.postal_code ?? ""
|
|
140
138
|
};
|
|
141
139
|
}
|
|
142
|
-
function
|
|
143
|
-
return
|
|
140
|
+
function T(e) {
|
|
141
|
+
return C(e);
|
|
144
142
|
}
|
|
145
|
-
function
|
|
143
|
+
function E(e) {
|
|
146
144
|
return {
|
|
147
145
|
line1: e.line1.trim(),
|
|
148
146
|
line2: e.line2.trim(),
|
|
@@ -152,7 +150,7 @@ function D(e) {
|
|
|
152
150
|
country: "US"
|
|
153
151
|
};
|
|
154
152
|
}
|
|
155
|
-
function
|
|
153
|
+
function D(e = "organization", t) {
|
|
156
154
|
return {
|
|
157
155
|
entityType: e,
|
|
158
156
|
legalName: "",
|
|
@@ -163,7 +161,7 @@ function O(e = "organization", t) {
|
|
|
163
161
|
phone: "",
|
|
164
162
|
taxId: "",
|
|
165
163
|
remindersEnabled: t === "customer",
|
|
166
|
-
address: { ...
|
|
164
|
+
address: { ...r },
|
|
167
165
|
bankAccount: {
|
|
168
166
|
accountHolderName: "",
|
|
169
167
|
routingNumber: "",
|
|
@@ -171,11 +169,11 @@ function O(e = "organization", t) {
|
|
|
171
169
|
}
|
|
172
170
|
};
|
|
173
171
|
}
|
|
174
|
-
function
|
|
175
|
-
let n =
|
|
176
|
-
return n.email =
|
|
172
|
+
function O(e, t) {
|
|
173
|
+
let n = D(e.type);
|
|
174
|
+
return n.email = d(e), n.phone = f(e), n.taxId = e.tax_id ?? "", n.remindersEnabled = !!e.reminders_enabled, t && (n.address = w(t)), "organization" in e ? n.legalName = e.organization.legal_name : (n.firstName = e.individual.first_name, n.lastName = e.individual.last_name), n;
|
|
177
175
|
}
|
|
178
|
-
function
|
|
176
|
+
function k(e) {
|
|
179
177
|
return [
|
|
180
178
|
e.line1,
|
|
181
179
|
e.line2,
|
|
@@ -184,11 +182,11 @@ function A(e) {
|
|
|
184
182
|
e.postalCode
|
|
185
183
|
].some((e) => e.trim().length > 0);
|
|
186
184
|
}
|
|
187
|
-
function
|
|
188
|
-
return
|
|
185
|
+
function A(e) {
|
|
186
|
+
return k(e) ? C(e) : void 0;
|
|
189
187
|
}
|
|
190
|
-
function
|
|
191
|
-
let n = t === "customer", r = t === "vendor", i =
|
|
188
|
+
function j(e, t) {
|
|
189
|
+
let n = t === "customer", r = t === "vendor", i = A(e.address), a = e.taxId.trim() || void 0, o = e.email.trim(), s = e.phone.trim() || void 0, c = {
|
|
192
190
|
is_customer: n,
|
|
193
191
|
is_vendor: r,
|
|
194
192
|
language: "en",
|
|
@@ -217,7 +215,7 @@ function M(e, t) {
|
|
|
217
215
|
}
|
|
218
216
|
};
|
|
219
217
|
}
|
|
220
|
-
function
|
|
218
|
+
function M(e, t) {
|
|
221
219
|
let n = e.taxId.trim(), r = e.email.trim(), i = e.phone.trim(), a = {
|
|
222
220
|
reminders_enabled: t === "customer" ? e.remindersEnabled : void 0,
|
|
223
221
|
tax_id: n
|
|
@@ -239,31 +237,31 @@ function N(e, t) {
|
|
|
239
237
|
}
|
|
240
238
|
};
|
|
241
239
|
}
|
|
242
|
-
function
|
|
240
|
+
function N(e, t, r) {
|
|
243
241
|
let i = {
|
|
244
|
-
...
|
|
245
|
-
...
|
|
242
|
+
...n,
|
|
243
|
+
...r
|
|
246
244
|
}, a = e === "individual";
|
|
247
245
|
return {
|
|
248
|
-
label: a ?
|
|
246
|
+
label: a ? r?.taxIdSsnLabel ?? r?.taxIdLabel ?? i.taxIdSsnLabel : r?.taxIdEinLabel ?? r?.taxIdLabel ?? i.taxIdEinLabel,
|
|
249
247
|
placeholder: a ? i.taxIdSsnPlaceholder : i.taxIdEinPlaceholder,
|
|
250
248
|
description: t === "vendor" ? i.vendorTaxIdHelp : i.customerTaxIdHelp
|
|
251
249
|
};
|
|
252
250
|
}
|
|
253
|
-
function
|
|
254
|
-
return
|
|
251
|
+
function P(e) {
|
|
252
|
+
return k(e.address);
|
|
255
253
|
}
|
|
256
|
-
function
|
|
254
|
+
function F(e) {
|
|
257
255
|
return [
|
|
258
256
|
e.accountHolderName,
|
|
259
257
|
e.routingNumber,
|
|
260
258
|
e.accountNumber
|
|
261
259
|
].some((e) => e.trim().length > 0);
|
|
262
260
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
261
|
+
function I(e) {
|
|
262
|
+
return F(e.bankAccount);
|
|
265
263
|
}
|
|
266
|
-
function
|
|
264
|
+
function L(e, t = {}) {
|
|
267
265
|
return {
|
|
268
266
|
account_holder_name: e.accountHolderName.trim() || void 0,
|
|
269
267
|
account_number: e.accountNumber.trim() || void 0,
|
|
@@ -273,7 +271,7 @@ function R(e, t = {}) {
|
|
|
273
271
|
is_default_for_currency: t.isDefaultForCurrency ?? !0
|
|
274
272
|
};
|
|
275
273
|
}
|
|
276
|
-
function
|
|
274
|
+
function R(e, t = {}) {
|
|
277
275
|
return {
|
|
278
276
|
account_holder_name: e.accountHolderName.trim() || void 0,
|
|
279
277
|
account_number: e.accountNumber.trim() || void 0,
|
|
@@ -284,7 +282,7 @@ function z(e, t = {}) {
|
|
|
284
282
|
} : {}
|
|
285
283
|
};
|
|
286
284
|
}
|
|
287
|
-
function
|
|
285
|
+
function z(e) {
|
|
288
286
|
return [
|
|
289
287
|
e.account_number,
|
|
290
288
|
e.iban,
|
|
@@ -293,102 +291,102 @@ function B(e) {
|
|
|
293
291
|
e.bic
|
|
294
292
|
].every((e) => !e);
|
|
295
293
|
}
|
|
296
|
-
function
|
|
297
|
-
return
|
|
294
|
+
function B(e) {
|
|
295
|
+
return z(e) ? !0 : !(e.country !== "US" || e.currency !== "USD" || e.iban || e.sort_code || e.bic || !e.routing_number && !e.account_number);
|
|
298
296
|
}
|
|
299
|
-
function
|
|
297
|
+
function V(e, t) {
|
|
300
298
|
if (t) {
|
|
301
299
|
let n = e?.find((e) => e.id === t);
|
|
302
300
|
return {
|
|
303
301
|
kind: "update",
|
|
304
302
|
bankAccountId: t,
|
|
305
|
-
includeAchDefaults: n ?
|
|
303
|
+
includeAchDefaults: n ? z(n) : !1
|
|
306
304
|
};
|
|
307
305
|
}
|
|
308
|
-
let n = e?.find(
|
|
306
|
+
let n = e?.find(z);
|
|
309
307
|
return n ? {
|
|
310
308
|
kind: "update",
|
|
311
309
|
bankAccountId: n.id,
|
|
312
310
|
includeAchDefaults: !0
|
|
313
311
|
} : {
|
|
314
312
|
kind: "create",
|
|
315
|
-
isDefaultForCurrency: !(e ?? []).some((e) => e.currency === "USD" && e.is_default_for_currency &&
|
|
313
|
+
isDefaultForCurrency: !(e ?? []).some((e) => e.currency === "USD" && e.is_default_for_currency && B(e))
|
|
316
314
|
};
|
|
317
315
|
}
|
|
318
|
-
function
|
|
316
|
+
function H() {
|
|
319
317
|
return {
|
|
320
318
|
accountHolderName: "",
|
|
321
319
|
routingNumber: "",
|
|
322
320
|
accountNumber: ""
|
|
323
321
|
};
|
|
324
322
|
}
|
|
325
|
-
function
|
|
323
|
+
function U(e) {
|
|
326
324
|
return {
|
|
327
325
|
accountHolderName: e.account_holder_name ?? "",
|
|
328
326
|
routingNumber: e.routing_number ?? "",
|
|
329
327
|
accountNumber: e.account_number ?? ""
|
|
330
328
|
};
|
|
331
329
|
}
|
|
332
|
-
function
|
|
330
|
+
function W(e) {
|
|
333
331
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
334
332
|
}
|
|
335
|
-
function
|
|
333
|
+
function G(e, t) {
|
|
336
334
|
let n = {};
|
|
337
335
|
return e.line1.trim().length === 0 && (n.line1 = t.addressLine1Required), e.city.trim().length === 0 && (n.city = t.cityRequired), e.state.trim().length === 0 && (n.state = t.stateRequired), e.postalCode.trim().length === 0 && (n.postalCode = t.postalCodeRequired), n;
|
|
338
336
|
}
|
|
339
|
-
function
|
|
337
|
+
function K(e) {
|
|
340
338
|
return Object.values(e).some(Boolean);
|
|
341
339
|
}
|
|
342
|
-
function
|
|
340
|
+
function q(e) {
|
|
343
341
|
if (!/^\d{9}$/.test(e)) return !1;
|
|
344
342
|
let t = [...e].map(Number);
|
|
345
343
|
return (3 * (t[0] + t[3] + t[6]) + 7 * (t[1] + t[4] + t[7]) + (t[2] + t[5] + t[8])) % 10 == 0;
|
|
346
344
|
}
|
|
347
|
-
function
|
|
348
|
-
let r = {},
|
|
349
|
-
return
|
|
345
|
+
function J(e, n = i) {
|
|
346
|
+
let r = {}, a = e.accountHolderName.trim(), o = e.routingNumber.trim(), s = e.accountNumber.trim();
|
|
347
|
+
return a.length === 0 && (r.accountHolderName = n.accountHolderNameRequired), (o.length === 0 || !q(o)) && (r.routingNumber = n.routingNumberInvalid), t(s) || (r.accountNumber = n.accountNumberInvalid), r;
|
|
350
348
|
}
|
|
351
|
-
function
|
|
349
|
+
function Y(e) {
|
|
352
350
|
let t = (/^(\+?[\d\s().-]+?)\s*(?:(?:x|ext\.?)\s*\d+)?$/i.exec(e)?.[1])?.replace(/\D/g, "").length ?? 0;
|
|
353
351
|
return t >= 7 && t <= 15;
|
|
354
352
|
}
|
|
355
|
-
function
|
|
353
|
+
function X(e) {
|
|
356
354
|
return /^[\d\s-]+$/.test(e) && e.replace(/\D/g, "").length === 9;
|
|
357
355
|
}
|
|
358
|
-
function
|
|
356
|
+
function Z(e, t, n = i, r = "customer", a = !1) {
|
|
359
357
|
let o = {};
|
|
360
|
-
e.entityType === "organization" ? e.legalName.trim().length === 0 && (o.legalName = n.legalNameRequired) : (e.firstName.trim().length === 0 && (o.firstName = n.firstNameRequired), e.lastName.trim().length === 0 && (o.lastName = n.lastNameRequired)), e.email.trim().length === 0 ? o.email = n.emailRequired :
|
|
358
|
+
e.entityType === "organization" ? e.legalName.trim().length === 0 && (o.legalName = n.legalNameRequired) : (e.firstName.trim().length === 0 && (o.firstName = n.firstNameRequired), e.lastName.trim().length === 0 && (o.lastName = n.lastNameRequired)), e.email.trim().length === 0 ? o.email = n.emailRequired : W(e.email.trim()) || (o.email = n.emailInvalid);
|
|
361
359
|
let s = e.phone.trim();
|
|
362
|
-
s && !
|
|
360
|
+
s && !Y(s) && (o.phone = n.phoneInvalid);
|
|
363
361
|
let c = e.taxId.trim();
|
|
364
|
-
if (c && !
|
|
365
|
-
let t =
|
|
366
|
-
|
|
362
|
+
if (c && !X(c) && (o.taxId = n.taxIdInvalid), t === "create" && r === "vendor" || k(e.address)) {
|
|
363
|
+
let t = G(e.address, n);
|
|
364
|
+
K(t) && (o.address = t);
|
|
367
365
|
}
|
|
368
|
-
if (r === "vendor" && (
|
|
369
|
-
let t =
|
|
370
|
-
|
|
366
|
+
if (r === "vendor" && (a || I(e))) {
|
|
367
|
+
let t = J(e.bankAccount, n);
|
|
368
|
+
K(t) && (o.bankAccount = t);
|
|
371
369
|
}
|
|
372
370
|
return o;
|
|
373
371
|
}
|
|
374
|
-
function
|
|
372
|
+
function Q(e, t, n) {
|
|
375
373
|
if (!n) return e;
|
|
376
374
|
let r = { ...e };
|
|
377
375
|
return t.phone.trim() === n.phone.trim() && delete r.phone, t.taxId.trim() === n.taxId.trim() && delete r.taxId, r;
|
|
378
376
|
}
|
|
379
|
-
function
|
|
377
|
+
function $(e) {
|
|
380
378
|
let { address: t, bankAccount: n, ...r } = e;
|
|
381
|
-
return
|
|
379
|
+
return K(r) || (t ? K(t) : !1) || (n ? K(n) : !1);
|
|
382
380
|
}
|
|
383
|
-
function
|
|
384
|
-
return
|
|
381
|
+
function ee(e) {
|
|
382
|
+
return K(e);
|
|
385
383
|
}
|
|
386
|
-
function
|
|
387
|
-
return
|
|
384
|
+
function te(e, t = i) {
|
|
385
|
+
return G(e, t);
|
|
388
386
|
}
|
|
389
|
-
function
|
|
387
|
+
function ne() {
|
|
390
388
|
let e = globalThis.getSelection?.();
|
|
391
389
|
return !!(e && e.toString().length > 0);
|
|
392
390
|
}
|
|
393
391
|
//#endregion
|
|
394
|
-
export {
|
|
392
|
+
export { T as addressFormToCreatePayload, E as addressFormToUpdatePayload, w as addressResponseToFormValues, U as bankAccountToAchFormValues, p as buildAnalyticsMap, b as buildBankAccountItems, v as buildCounterpartDetailsView, N as buildCounterpartFormTaxIdField, h as buildCounterpartRows, L as counterpartFormBankAccountToCreatePayload, R as counterpartFormBankAccountToUpdatePayload, j as counterpartFormToCreatePayload, M as counterpartFormToUpdatePayload, O as counterpartToFormValues, H as emptyAchFormValues, D as emptyCounterpartFormValues, l as formatCounterpartDate, s as formatMoney, o as fromMinorUnits, x as getAchInstructions, d as getCounterpartEmail, u as getCounterpartName, S as getPayableAchInstructions, ee as hasAchFormErrors, F as hasAchFormValues, P as hasCounterpartFormAddressValues, I as hasCounterpartFormBankAccountValues, $ as hasCounterpartFormErrors, ne as hasSelectedText, B as isAchCompatibleBankAccount, V as resolveCounterpartBankAccountWrite, J as validateAchFormValues, te as validateAddressForm, Z as validateCounterpartForm, Q as withoutUnchangedContactErrors };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.7.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.7.42", n = "acce50e6858601c354e5585cbdfe2b11996ec00a", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -546,7 +546,7 @@ declare const offerScenarios: Scenario[];
|
|
|
546
546
|
declare const productsScenarios: Scenario[];
|
|
547
547
|
|
|
548
548
|
interface SettingsDemoProps {
|
|
549
|
-
defaultSelectedSection?: 'profile' | 'team' | 'legal' | 'help';
|
|
549
|
+
defaultSelectedSection?: 'profile' | 'team' | 'legal' | 'help' | 'expense' | 'bill-pay' | 'accounting';
|
|
550
550
|
helpContactUrl?: string;
|
|
551
551
|
profileContactUrl?: string;
|
|
552
552
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js
|
|
2
|
-
var e = {
|
|
3
|
-
title: "Delete this application?",
|
|
4
|
-
descriptionBeforeEmphasis: "Everything you've entered so far will be permanently removed. If you'd rather come back later, use ",
|
|
5
|
-
descriptionEmphasis: "Save and continue later",
|
|
6
|
-
descriptionAfterEmphasis: " instead.",
|
|
7
|
-
keepEditingButton: "Keep editing",
|
|
8
|
-
deleteButton: "Delete application"
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
export { e as DELETE_APPLICATION_DIALOG_LABELS_EN };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import { DELETE_APPLICATION_DIALOG_LABELS_EN as s } from "./index30.js";
|
|
3
|
-
import { useRef as c } from "react";
|
|
4
|
-
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
|
-
import { Trash2Icon as d } from "lucide-react";
|
|
6
|
-
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js
|
|
7
|
-
function f({ open: f, onConfirm: p, onCancel: m, isDeleting: h = !1, labels: g, testIds: _ }) {
|
|
8
|
-
let v = {
|
|
9
|
-
...s,
|
|
10
|
-
...g
|
|
11
|
-
}, y = c(null);
|
|
12
|
-
return /* @__PURE__ */ l(e, {
|
|
13
|
-
open: f,
|
|
14
|
-
onOpenChange: (e) => {
|
|
15
|
-
!e && !h && m();
|
|
16
|
-
},
|
|
17
|
-
children: /* @__PURE__ */ u(t, {
|
|
18
|
-
"data-testid": _?.root,
|
|
19
|
-
onOpenAutoFocus: (e) => {
|
|
20
|
-
e.preventDefault(), y.current?.focus();
|
|
21
|
-
},
|
|
22
|
-
children: [/* @__PURE__ */ u(i, {
|
|
23
|
-
className: "ttw:items-center ttw:text-center ttw:sm:items-center ttw:sm:text-center",
|
|
24
|
-
children: [
|
|
25
|
-
/* @__PURE__ */ l("div", {
|
|
26
|
-
className: "ttw:flex ttw:size-14 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-destructive/10",
|
|
27
|
-
"aria-hidden": !0,
|
|
28
|
-
children: /* @__PURE__ */ l(d, { className: "ttw:size-6 ttw:text-destructive" })
|
|
29
|
-
}),
|
|
30
|
-
/* @__PURE__ */ l(a, { children: v.title }),
|
|
31
|
-
/* @__PURE__ */ u(n, { children: [
|
|
32
|
-
v.descriptionBeforeEmphasis,
|
|
33
|
-
/* @__PURE__ */ l("strong", {
|
|
34
|
-
className: "ttw:font-semibold ttw:text-foreground",
|
|
35
|
-
children: v.descriptionEmphasis
|
|
36
|
-
}),
|
|
37
|
-
v.descriptionAfterEmphasis
|
|
38
|
-
] })
|
|
39
|
-
]
|
|
40
|
-
}), /* @__PURE__ */ u(r, {
|
|
41
|
-
className: "ttw:sm:justify-center",
|
|
42
|
-
children: [/* @__PURE__ */ l(o, {
|
|
43
|
-
ref: y,
|
|
44
|
-
type: "button",
|
|
45
|
-
variant: "outline",
|
|
46
|
-
onClick: m,
|
|
47
|
-
disabled: h,
|
|
48
|
-
"data-testid": _?.cancel,
|
|
49
|
-
children: v.keepEditingButton
|
|
50
|
-
}), /* @__PURE__ */ l(o, {
|
|
51
|
-
type: "button",
|
|
52
|
-
variant: "destructive",
|
|
53
|
-
loading: h,
|
|
54
|
-
disabled: h,
|
|
55
|
-
onClick: p,
|
|
56
|
-
"data-testid": _?.confirm,
|
|
57
|
-
children: v.deleteButton
|
|
58
|
-
})]
|
|
59
|
-
})]
|
|
60
|
-
})
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
//#endregion
|
|
64
|
-
export { s as DELETE_APPLICATION_DIALOG_LABELS_EN, f as DeleteApplicationDialog };
|