@tesouro/embedded-components-react 0.3.48 → 0.3.50
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/dist/index.css +8 -2
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +39 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +26 -311
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +325 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +13 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +20 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +75 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +36 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +80 -68
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +86 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +77 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +18 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +50 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +22 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +82 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -42
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +15 -159
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +23 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +66 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +2 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +5 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +31 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +23 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +37 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +161 -61
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +29 -130
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +1 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +47 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +4 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +12 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +26 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +23 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +62 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +133 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +20 -163
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +4 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +39 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +5 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +70 -211
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +47 -103
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +92 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +34 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +59 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +163 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +67 -181
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +20 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +203 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +214 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +98 -312
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +16 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +49 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +29 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +183 -156
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +38 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +102 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +18 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +343 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +30 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +79 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +179 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +2 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +6 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +92 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +123 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +7 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +45 -250
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +69 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +21 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +27 -208
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +86 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +47 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +244 -106
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +115 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +201 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +115 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +44 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +28 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +6 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +119 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +24 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +89 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +5 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +5 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +34 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +10 -104
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +105 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +15 -123
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +125 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +7 -167
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +170 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +11 -105
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +108 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +2 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +8 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +47 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +144 -130
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +23 -23
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +87 -71
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
+
import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import "../../../shared/ui/dist/index.js";
|
|
10
|
+
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
+
import "../../../shared/feature/dist/index.js";
|
|
12
|
+
import { useDeletePayableMutation as i } from "../../data-access/dist/index12.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
14
|
+
import { useState as a } from "react";
|
|
1
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
|
|
17
|
+
let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
|
|
18
|
+
id: "deleteDraft",
|
|
19
|
+
label: l.menuItem,
|
|
20
|
+
destructive: !0,
|
|
21
|
+
onSelect: () => m(!0)
|
|
22
|
+
}] : [], v = p && g;
|
|
23
|
+
return {
|
|
24
|
+
menuItems: _,
|
|
25
|
+
dialog: {
|
|
26
|
+
open: v,
|
|
27
|
+
copy: v ? l.dialog : void 0,
|
|
28
|
+
isPending: f.isPending,
|
|
29
|
+
onCancel: () => {
|
|
30
|
+
f.isPending || m(!1);
|
|
31
|
+
},
|
|
32
|
+
onConfirm: () => {
|
|
33
|
+
!g || !o || f.isPending || f.mutate({ path: { payable_id: o } }, {
|
|
34
|
+
onError: () => e.error(l.error),
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
m(!1), u();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
21
40
|
}
|
|
22
41
|
};
|
|
23
|
-
return r.legalName || r.email || r.phone || Object.values(r.address).some(Boolean) ? r : void 0;
|
|
24
42
|
}
|
|
25
43
|
//#endregion
|
|
26
|
-
export {
|
|
44
|
+
export { o as useDraftDelete };
|
|
@@ -1,213 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import { getStateOptions as t } from "../../../shared/util/dist/lib/usStates.js";
|
|
7
|
-
import { AchFieldGroup as n } from "../../../shared/counterpart-management/ui/dist/index5.js";
|
|
8
|
-
import { CounterpartFormFields as r, useFocusFirstInvalidField as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
|
|
9
|
-
import { VENDOR_INLINE_FORM_LABELS_EN as a } from "./index32.js";
|
|
10
|
-
import { COUNTERPART_MESSAGE_LABELS_EN as o } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
11
|
-
import { useCounterpartForm as s } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
12
|
-
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
13
|
-
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
14
|
-
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
-
import { Landmark as g, Plus as _, X as v } from "lucide-react";
|
|
1
|
+
import { formatMoneyExact as e } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
2
|
+
import "../../data-access/dist/index.js";
|
|
16
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
...a,
|
|
20
|
-
...A
|
|
21
|
-
}, [M, N] = f("none"), [P, F] = f(b?.id), [I, L] = f(!1), [R, z] = f(!1);
|
|
22
|
-
l(() => {
|
|
23
|
-
k?.(R);
|
|
24
|
-
}, [R, k]);
|
|
25
|
-
let B = u(() => t(), []), V = d(M), H = d(!1), U = s({
|
|
26
|
-
view: M,
|
|
27
|
-
setView: N,
|
|
28
|
-
selectedId: P,
|
|
29
|
-
setSelectedId: F,
|
|
30
|
-
messages: o,
|
|
31
|
-
counterpartType: "vendor",
|
|
32
|
-
counterpart: b,
|
|
33
|
-
primaryAddress: x,
|
|
34
|
-
bankAccounts: S,
|
|
35
|
-
isBankAccountsLoading: C,
|
|
36
|
-
isBankAccountsError: w
|
|
37
|
-
}), { openCreate: W, openEdit: G, setValues: K, expandAddress: q } = U, J = i(U.errors);
|
|
38
|
-
l(() => {
|
|
39
|
-
y === "edit" ? G() : W();
|
|
40
|
-
}, [
|
|
41
|
-
y,
|
|
42
|
-
W,
|
|
43
|
-
G
|
|
44
|
-
]), l(() => {
|
|
45
|
-
V.current !== "none" && M === "none" && P && D(P), V.current = M;
|
|
46
|
-
}, [
|
|
47
|
-
M,
|
|
48
|
-
P,
|
|
49
|
-
D
|
|
50
|
-
]), l(() => {
|
|
51
|
-
y !== "create" || H.current || (H.current = !0, K((e) => ({
|
|
52
|
-
...e,
|
|
53
|
-
entityType: "organization",
|
|
54
|
-
legalName: T?.trim() || E?.legalName || e.legalName,
|
|
55
|
-
email: E?.email || e.email,
|
|
56
|
-
phone: E?.phone || e.phone,
|
|
57
|
-
address: E?.address ?? e.address
|
|
58
|
-
})), E?.address && Object.values(E.address).some(Boolean) && q());
|
|
59
|
-
}, [
|
|
60
|
-
y,
|
|
61
|
-
T,
|
|
62
|
-
E,
|
|
63
|
-
K,
|
|
64
|
-
q
|
|
65
|
-
]), l(() => {
|
|
66
|
-
y === "edit" && (U.values.bankAccount.routingNumber || U.values.bankAccount.accountNumber) && L(!0);
|
|
67
|
-
}, [
|
|
68
|
-
y,
|
|
69
|
-
U.values.bankAccount.accountNumber,
|
|
70
|
-
U.values.bankAccount.routingNumber
|
|
71
|
-
]), l(() => {
|
|
72
|
-
U.sectionsToExpand.bankAccount && L(!0);
|
|
73
|
-
}, [U.sectionsToExpand.bankAccount]);
|
|
74
|
-
let Y = c((e) => {
|
|
75
|
-
z(!0), K((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
|
|
76
|
-
...t,
|
|
77
|
-
...e,
|
|
78
|
-
firstName: t.firstName || t.legalName,
|
|
79
|
-
legalName: t.legalName
|
|
80
|
-
} : e.entityType === "organization" && t.entityType !== "organization" ? {
|
|
81
|
-
...t,
|
|
82
|
-
...e,
|
|
83
|
-
legalName: t.legalName || [t.firstName, t.lastName].filter(Boolean).join(" ")
|
|
84
|
-
} : {
|
|
85
|
-
...t,
|
|
86
|
-
...e
|
|
87
|
-
});
|
|
88
|
-
}, [K]);
|
|
89
|
-
return /* @__PURE__ */ h("div", {
|
|
90
|
-
ref: J,
|
|
91
|
-
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
|
|
92
|
-
children: [
|
|
93
|
-
/* @__PURE__ */ h("div", {
|
|
94
|
-
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
|
|
95
|
-
children: [/* @__PURE__ */ m("p", {
|
|
96
|
-
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
97
|
-
children: y === "edit" ? j.editTitle : j.createTitle
|
|
98
|
-
}), /* @__PURE__ */ m(e, {
|
|
99
|
-
type: "button",
|
|
100
|
-
variant: "ghost",
|
|
101
|
-
size: "icon",
|
|
102
|
-
"aria-label": j.close,
|
|
103
|
-
onClick: O,
|
|
104
|
-
children: /* @__PURE__ */ m(v, { className: "ttw:size-4" })
|
|
105
|
-
})]
|
|
106
|
-
}),
|
|
107
|
-
/* @__PURE__ */ m(r, {
|
|
108
|
-
mode: y,
|
|
109
|
-
counterpartMode: "vendor",
|
|
110
|
-
values: U.values,
|
|
111
|
-
errors: U.errors,
|
|
112
|
-
stateOptions: B,
|
|
113
|
-
onChange: Y,
|
|
114
|
-
onAddressChange: (e) => {
|
|
115
|
-
z(!0), K((t) => ({
|
|
116
|
-
...t,
|
|
117
|
-
address: {
|
|
118
|
-
...t.address,
|
|
119
|
-
...e
|
|
120
|
-
}
|
|
121
|
-
}));
|
|
122
|
-
},
|
|
123
|
-
sections: {
|
|
124
|
-
entityType: !0,
|
|
125
|
-
profileHeading: !1,
|
|
126
|
-
title: !1,
|
|
127
|
-
taxId: !1,
|
|
128
|
-
address: "collapsible",
|
|
129
|
-
bankAccount: !1
|
|
130
|
-
},
|
|
131
|
-
sectionsToExpand: U.sectionsToExpand,
|
|
132
|
-
onAddressExpand: U.expandAddress,
|
|
133
|
-
labels: { businessNameLabel: j.nameLabel }
|
|
134
|
-
}),
|
|
135
|
-
/* @__PURE__ */ h("div", {
|
|
136
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
137
|
-
children: [/* @__PURE__ */ m("p", {
|
|
138
|
-
className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
|
|
139
|
-
children: j.paymentMethodsHeading
|
|
140
|
-
}), /* @__PURE__ */ m("p", {
|
|
141
|
-
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
142
|
-
children: j.paymentMethodsDescription
|
|
143
|
-
})]
|
|
144
|
-
}),
|
|
145
|
-
/* @__PURE__ */ h("div", {
|
|
146
|
-
className: "ttw:flex ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:p-3",
|
|
147
|
-
children: [/* @__PURE__ */ m("span", {
|
|
148
|
-
className: "ttw:flex ttw:size-8 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-md ttw:bg-primary",
|
|
149
|
-
children: /* @__PURE__ */ m(g, {
|
|
150
|
-
"aria-hidden": !0,
|
|
151
|
-
className: "ttw:size-4 ttw:text-white"
|
|
152
|
-
})
|
|
153
|
-
}), /* @__PURE__ */ h("div", {
|
|
154
|
-
className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-3",
|
|
155
|
-
children: [/* @__PURE__ */ h("div", {
|
|
156
|
-
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
157
|
-
children: [/* @__PURE__ */ m("p", {
|
|
158
|
-
className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
|
|
159
|
-
children: j.achTitle
|
|
160
|
-
}), /* @__PURE__ */ m("p", {
|
|
161
|
-
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
162
|
-
children: j.achDescription
|
|
163
|
-
})]
|
|
164
|
-
}), I ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
|
|
165
|
-
idPrefix: "vendor-inline-ach",
|
|
166
|
-
values: U.values.bankAccount,
|
|
167
|
-
errors: U.errors?.bankAccount,
|
|
168
|
-
onChange: (e) => {
|
|
169
|
-
z(!0), K((t) => ({
|
|
170
|
-
...t,
|
|
171
|
-
bankAccount: {
|
|
172
|
-
...t.bankAccount,
|
|
173
|
-
...e
|
|
174
|
-
}
|
|
175
|
-
}));
|
|
176
|
-
},
|
|
177
|
-
labels: {
|
|
178
|
-
accountHolderName: j.accountHolderNameLabel,
|
|
179
|
-
routingNumber: j.routingNumberLabel,
|
|
180
|
-
accountNumber: j.accountNumberLabel
|
|
181
|
-
}
|
|
182
|
-
}), /* @__PURE__ */ m("p", {
|
|
183
|
-
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
184
|
-
children: j.achHelp
|
|
185
|
-
})] }) : /* @__PURE__ */ h(e, {
|
|
186
|
-
type: "button",
|
|
187
|
-
variant: "link",
|
|
188
|
-
className: "ttw:w-fit ttw:px-0",
|
|
189
|
-
onClick: () => L(!0),
|
|
190
|
-
children: [/* @__PURE__ */ m(_, { className: "ttw:size-4" }), j.addBankAccount]
|
|
191
|
-
})]
|
|
192
|
-
})]
|
|
193
|
-
}),
|
|
194
|
-
/* @__PURE__ */ h("div", {
|
|
195
|
-
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
196
|
-
children: [/* @__PURE__ */ m(e, {
|
|
197
|
-
type: "button",
|
|
198
|
-
variant: "outline",
|
|
199
|
-
onClick: O,
|
|
200
|
-
children: j.cancel
|
|
201
|
-
}), /* @__PURE__ */ m(e, {
|
|
202
|
-
type: "button",
|
|
203
|
-
onClick: U.submit,
|
|
204
|
-
loading: U.isSubmitting,
|
|
205
|
-
disabled: U.isSubmitting,
|
|
206
|
-
children: j.save
|
|
207
|
-
})]
|
|
208
|
-
})
|
|
209
|
-
]
|
|
210
|
-
});
|
|
4
|
+
function t(t, n) {
|
|
5
|
+
if (typeof t == "number") return e(t / 100, { currencyCode: n ?? "USD" });
|
|
211
6
|
}
|
|
212
7
|
//#endregion
|
|
213
|
-
export {
|
|
8
|
+
export { t as formatBillMoney };
|
|
@@ -1,217 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import { usePayableSuggestionsQuery as t } from "../../data-access/dist/index15.js";
|
|
7
|
-
import "../../data-access/dist/index.js";
|
|
8
|
-
import { VENDOR_SECTION_PROPS_LABELS_EN as n } from "./index32.js";
|
|
9
|
-
import { buildVendorPrefill as r } from "./index34.js";
|
|
10
|
-
import { counterpartFormBankAccountToCreatePayload as i, counterpartFormBankAccountToUpdatePayload as ee, getAchInstructions as te, getCounterpartEmail as a, getCounterpartName as o, getPayableAchInstructions as s, hasAchFormValues as c, resolveCounterpartBankAccountWrite as ne, validateAchFormValues as re } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
11
|
-
import { useCounterpartsQuery as ie } from "../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
12
|
-
import { useCreateCounterpartBankAccountMutation as ae, useUpdateCounterpartBankAccountMutation as l } from "../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
13
|
-
import { useCounterpartDetails as u } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
|
|
14
|
-
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
15
|
-
import { VendorInlineForm as oe } from "./index35.js";
|
|
16
|
-
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
17
|
-
import { jsx as se } from "react/jsx-runtime";
|
|
1
|
+
import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
+
import { derivePayableStatus as t } from "./index4.js";
|
|
3
|
+
import { resolveVendor as n } from "./index5.js";
|
|
4
|
+
import { resolveAmountDueMinorUnits as r } from "./index16.js";
|
|
5
|
+
import { formatBillMoney as i } from "./index35.js";
|
|
18
6
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
name: o(t),
|
|
63
|
-
email: a(t),
|
|
64
|
-
methodLabel: C.paymentMethodLoading,
|
|
65
|
-
fields: []
|
|
66
|
-
};
|
|
67
|
-
if (K.isBankAccountsError) return {
|
|
68
|
-
name: o(t),
|
|
69
|
-
email: a(t),
|
|
70
|
-
methodLabel: C.paymentMethodUnavailable,
|
|
71
|
-
fields: []
|
|
72
|
-
};
|
|
73
|
-
let n = s(K.bankAccounts);
|
|
74
|
-
return {
|
|
75
|
-
name: o(t),
|
|
76
|
-
email: a(t),
|
|
77
|
-
methodLabel: n ? C.achMethod : C.noMethod,
|
|
78
|
-
fields: n ? [
|
|
79
|
-
{
|
|
80
|
-
label: C.accountHolder,
|
|
81
|
-
value: n.account_holder_name ?? ""
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
label: C.routingNumber,
|
|
85
|
-
value: n.routing_number ?? ""
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
label: C.accountNumber,
|
|
89
|
-
value: n.account_number ?? "",
|
|
90
|
-
maskedValue: n.account_number ? e(n.account_number) : ""
|
|
91
|
-
}
|
|
92
|
-
] : []
|
|
93
|
-
};
|
|
94
|
-
}, [
|
|
95
|
-
K.bankAccounts,
|
|
96
|
-
K.counterpart,
|
|
97
|
-
K.isBankAccountsError,
|
|
98
|
-
K.isBankAccountsLoading,
|
|
99
|
-
C
|
|
100
|
-
]), X = p(() => te(K.bankAccounts), [K.bankAccounts]), Z = p(() => s(K.bankAccounts)?.id, [K.bankAccounts]), Q = d(async () => {
|
|
101
|
-
let e = N.current;
|
|
102
|
-
if (!v) return { ok: !0 };
|
|
103
|
-
if (!c(e)) return b && v === y ? {
|
|
104
|
-
ok: !0,
|
|
105
|
-
counterpartBankAccountId: b
|
|
106
|
-
} : K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError ? { ok: !1 } : {
|
|
107
|
-
ok: !0,
|
|
108
|
-
counterpartBankAccountId: Z
|
|
109
|
-
};
|
|
110
|
-
if (K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError) return { ok: !1 };
|
|
111
|
-
let t = re(e);
|
|
112
|
-
if (Object.keys(t).length > 0) return L(t), A(!0), { ok: !1 };
|
|
113
|
-
L(void 0);
|
|
114
|
-
let n = ne(K.bankAccounts, R ?? X?.id);
|
|
115
|
-
if (n.kind === "update") return await J.mutateAsync({
|
|
116
|
-
path: {
|
|
117
|
-
counterpart_id: v,
|
|
118
|
-
bank_account_id: n.bankAccountId
|
|
7
|
+
function a({ payable: a, lineItems: o, glCodeOptions: s, glCodeRosterAvailable: c = !0, history: l, approvalPolicy: u, labels: d, hasScheduledPayment: f }) {
|
|
8
|
+
let p = a.currency, m = t({
|
|
9
|
+
apiStatus: a.status,
|
|
10
|
+
dueDate: a.due_date,
|
|
11
|
+
scheduledPaymentDate: a.scheduled_payment_date,
|
|
12
|
+
hasScheduledPayment: f
|
|
13
|
+
}), h = n(a), g = h?.bank_account?.account_number, _ = e(a.issued_at) || d.notProvided, v = e(a.due_date) || d.notProvided, y = new Map(s.map((e) => [e.value, e.label])), b = [
|
|
14
|
+
{
|
|
15
|
+
label: d.subtotalRow,
|
|
16
|
+
minorUnits: a.subtotal
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: d.discountRow,
|
|
20
|
+
minorUnits: a.discount
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: d.taxRow,
|
|
24
|
+
minorUnits: a.tax_amount
|
|
25
|
+
}
|
|
26
|
+
].map((e) => ({
|
|
27
|
+
label: e.label,
|
|
28
|
+
value: i(e.minorUnits, p)
|
|
29
|
+
})).filter((e) => !!e.value), x = i(a.total_amount, p);
|
|
30
|
+
return x && b.push({
|
|
31
|
+
label: d.totalRow,
|
|
32
|
+
value: x,
|
|
33
|
+
emphasis: !0
|
|
34
|
+
}), {
|
|
35
|
+
amountDue: i(r(a), p) ?? "",
|
|
36
|
+
invoiceDateLabel: _,
|
|
37
|
+
dueDateLabel: v,
|
|
38
|
+
dueDateTone: m.isOverdue ? "danger" : "default",
|
|
39
|
+
status: m.status,
|
|
40
|
+
statusTone: m.tone,
|
|
41
|
+
payTo: {
|
|
42
|
+
name: h?.name || d.notProvided,
|
|
43
|
+
email: h?.email ?? void 0,
|
|
44
|
+
paymentInstructionsLabel: g ? d.paymentInstructionsValue(g.slice(-4)) : void 0
|
|
45
|
+
},
|
|
46
|
+
invoiceFields: [
|
|
47
|
+
{
|
|
48
|
+
label: d.invoiceDateRow,
|
|
49
|
+
value: _
|
|
119
50
|
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
counterpartBankAccountId: n.bankAccountId
|
|
124
|
-
};
|
|
125
|
-
let r = await q.mutateAsync({
|
|
126
|
-
path: { counterpart_id: v },
|
|
127
|
-
body: i(e, { isDefaultForCurrency: n.isDefaultForCurrency })
|
|
128
|
-
});
|
|
129
|
-
return z(r?.id), {
|
|
130
|
-
ok: !0,
|
|
131
|
-
counterpartBankAccountId: r?.id
|
|
132
|
-
};
|
|
133
|
-
}, [
|
|
134
|
-
X,
|
|
135
|
-
v,
|
|
136
|
-
q,
|
|
137
|
-
K.bankAccounts,
|
|
138
|
-
K.isBankAccountsError,
|
|
139
|
-
K.isBankAccountsFetching,
|
|
140
|
-
K.isBankAccountsLoading,
|
|
141
|
-
R,
|
|
142
|
-
Z,
|
|
143
|
-
b,
|
|
144
|
-
y,
|
|
145
|
-
J
|
|
146
|
-
]), he = p(() => (G.data?.data ?? []).map((e) => ({
|
|
147
|
-
name: o(e),
|
|
148
|
-
email: a(e),
|
|
149
|
-
onSelect: () => U(e.id)
|
|
150
|
-
})), [G.data, U]), ge = p(() => r(S), [S]), $ = d(() => {
|
|
151
|
-
O(void 0), P(!1);
|
|
152
|
-
}, []), _e = d((e) => {
|
|
153
|
-
O(void 0), P(!1), U(e);
|
|
154
|
-
}, [U]);
|
|
155
|
-
if (D) return {
|
|
156
|
-
mode: "creating",
|
|
157
|
-
newVendorForm: /* @__PURE__ */ se(oe, {
|
|
158
|
-
mode: D,
|
|
159
|
-
counterpart: D === "edit" ? K.counterpart : void 0,
|
|
160
|
-
primaryAddress: D === "edit" ? K.primaryAddress : void 0,
|
|
161
|
-
bankAccounts: D === "edit" ? K.bankAccounts : void 0,
|
|
162
|
-
isBankAccountsLoading: D === "edit" ? K.isBankAccountsLoading : void 0,
|
|
163
|
-
isBankAccountsError: D === "edit" ? K.isBankAccountsError : void 0,
|
|
164
|
-
initialName: D === "create" ? w : void 0,
|
|
165
|
-
initialValues: D === "create" ? ge : void 0,
|
|
166
|
-
onSaved: _e,
|
|
167
|
-
onCancel: $,
|
|
168
|
-
onDirtyChange: P
|
|
169
|
-
}),
|
|
170
|
-
onClear: $,
|
|
171
|
-
hasUnsavedVendorChanges: F
|
|
172
|
-
};
|
|
173
|
-
if (Y) {
|
|
174
|
-
let e = K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError;
|
|
175
|
-
return {
|
|
176
|
-
mode: "resolved",
|
|
177
|
-
summary: Y,
|
|
178
|
-
onEdit: e ? void 0 : () => O("edit"),
|
|
179
|
-
onClear: () => U(void 0),
|
|
180
|
-
paymentInstructions: e ? void 0 : {
|
|
181
|
-
isOpen: k,
|
|
182
|
-
values: j,
|
|
183
|
-
errors: I,
|
|
184
|
-
onOpen: () => {
|
|
185
|
-
A(!0), X && (M({
|
|
186
|
-
accountHolderName: X.account_holder_name ?? "",
|
|
187
|
-
routingNumber: X.routing_number ?? "",
|
|
188
|
-
accountNumber: X.account_number ?? ""
|
|
189
|
-
}), z(X.id));
|
|
190
|
-
},
|
|
191
|
-
onChange: (e) => {
|
|
192
|
-
M((t) => ({
|
|
193
|
-
...t,
|
|
194
|
-
...e
|
|
195
|
-
})), L(void 0);
|
|
196
|
-
}
|
|
51
|
+
{
|
|
52
|
+
label: d.dueDateRow,
|
|
53
|
+
value: v
|
|
197
54
|
},
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
55
|
+
{
|
|
56
|
+
label: d.invoiceNumberRow,
|
|
57
|
+
value: a.document_id || d.notProvided
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
lineItems: o.map((e) => {
|
|
61
|
+
let t = i(e.unit_price, p);
|
|
62
|
+
return {
|
|
63
|
+
id: e.id,
|
|
64
|
+
description: e.name ?? e.description ?? "",
|
|
65
|
+
glCodeLabel: e.ledger_account_id ? y.get(e.ledger_account_id) ?? (c ? d.glCodeMissing : d.glCodeUnavailable) : d.glCodeMissing,
|
|
66
|
+
qtyPriceLabel: e.quantity != null && t ? d.qtyPriceValue(String(e.quantity), t) : "",
|
|
67
|
+
amount: i(e.subtotal, p) ?? ""
|
|
68
|
+
};
|
|
69
|
+
}),
|
|
70
|
+
amountRows: b,
|
|
71
|
+
approvalPolicy: u,
|
|
72
|
+
history: l
|
|
214
73
|
};
|
|
215
74
|
}
|
|
216
75
|
//#endregion
|
|
217
|
-
export {
|
|
76
|
+
export { a as buildBillDetailView };
|