@tesouro/embedded-components-react 0.5.295 → 0.5.296
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/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +23 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +247 -216
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +21 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index24.js +87 -89
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +110 -112
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -67,15 +67,15 @@ function w({ payableId: t, form: y, counterpartId: b, isVendorPending: x, onVend
|
|
|
67
67
|
N,
|
|
68
68
|
W,
|
|
69
69
|
Z
|
|
70
|
-
]), $ = _(async (e, t) => {
|
|
71
|
-
let
|
|
70
|
+
]), $ = _(async (e, t, n) => {
|
|
71
|
+
let s = !I && L ? {
|
|
72
72
|
base64EncodedFile: await r(L),
|
|
73
73
|
fileName: L.name
|
|
74
|
-
} : void 0,
|
|
74
|
+
} : void 0, c = y.isTotalsDirty ? {
|
|
75
75
|
discount: y.discount,
|
|
76
76
|
tax: y.tax,
|
|
77
77
|
total: y.totalOverride
|
|
78
|
-
} : void 0,
|
|
78
|
+
} : void 0, l = i({
|
|
79
79
|
values: y.values,
|
|
80
80
|
initialLineItems: I ? void 0 : y.lineItems,
|
|
81
81
|
counterpartId: t ?? b,
|
|
@@ -87,29 +87,32 @@ function w({ payableId: t, form: y, counterpartId: b, isVendorPending: x, onVend
|
|
|
87
87
|
total: y.totalOverride
|
|
88
88
|
},
|
|
89
89
|
lineItems: y.lineItems,
|
|
90
|
-
editedTotals:
|
|
91
|
-
document:
|
|
92
|
-
}),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
editedTotals: c,
|
|
91
|
+
document: s
|
|
92
|
+
}), u = n ? {
|
|
93
|
+
...l,
|
|
94
|
+
counterpart_raw_data: n
|
|
95
|
+
} : l, d = I;
|
|
96
|
+
if (d ? await q.mutateAsync({
|
|
97
|
+
path: { payable_id: d },
|
|
98
|
+
body: u
|
|
99
|
+
}) : (d = (await G.mutateAsync({ body: u }))?.id, d && (F(d), O?.(d), s && R(void 0))), !d) throw Error("Payable was created without an id");
|
|
97
100
|
if (z) {
|
|
98
101
|
try {
|
|
99
|
-
await K.mutateAsync({ path: { payable_id:
|
|
102
|
+
await K.mutateAsync({ path: { payable_id: d } });
|
|
100
103
|
} catch {}
|
|
101
104
|
B(!1);
|
|
102
105
|
}
|
|
103
106
|
return await J.mutateAsync({
|
|
104
|
-
path: { payable_id:
|
|
107
|
+
path: { payable_id: d },
|
|
105
108
|
body: { data: a(y.lineItems) }
|
|
106
|
-
}),
|
|
107
|
-
path: { payable_id:
|
|
109
|
+
}), c && await q.mutateAsync({
|
|
110
|
+
path: { payable_id: d },
|
|
108
111
|
body: o({
|
|
109
112
|
lineItems: y.lineItems,
|
|
110
|
-
editedTotals:
|
|
113
|
+
editedTotals: c
|
|
111
114
|
})
|
|
112
|
-
}),
|
|
115
|
+
}), d;
|
|
113
116
|
}, [
|
|
114
117
|
b,
|
|
115
118
|
T,
|
|
@@ -137,7 +140,7 @@ function w({ payableId: t, form: y, counterpartId: b, isVendorPending: x, onVend
|
|
|
137
140
|
try {
|
|
138
141
|
let t = await E?.({ allowIncompleteVendor: !0 });
|
|
139
142
|
if (t && !t.ok) return;
|
|
140
|
-
let n = await $(t?.counterpartBankAccountId, t?.counterpartId);
|
|
143
|
+
let n = await $(t?.counterpartBankAccountId, t?.counterpartId, t?.counterpartRawData);
|
|
141
144
|
y.setErrors(void 0), D?.(n), A?.(n);
|
|
142
145
|
let r = await k?.();
|
|
143
146
|
return e.success(r === "draft" ? N.submittedDemoted : N.draftSaved), n;
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index24.js
CHANGED
|
@@ -1,127 +1,125 @@
|
|
|
1
1
|
import { Badge as e, Command as t, CommandGroup as n, CommandInput as r, CommandItem as i, CommandList as a, CommandSeparator as o, FieldDescription as s, FieldRequirement as c, Label as l, Popover as u, PopoverContent as d, PopoverTrigger as f, Skeleton as p, cn as m } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
2
|
import { mergeVendorSearchComboboxLabels as h } from "./index23.js";
|
|
3
3
|
import { useId as g, useState as _ } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { ChevronDown as
|
|
4
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronDown as x, Plus as S } from "lucide-react";
|
|
6
6
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index24.js
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return /* @__PURE__ */
|
|
7
|
+
var C = 5, w = "ttw:min-h-44";
|
|
8
|
+
function T({ query: T, onQueryChange: E, results: D, isLoading: O, onAddVendor: k, selectedLabel: A, badge: j, helperText: M, resultsHeading: N, addVendorDescription: P, testId: F, labels: I }) {
|
|
9
|
+
let L = h(I), R = g(), z = g(), [B, V] = _(!1);
|
|
10
|
+
return /* @__PURE__ */ b("div", {
|
|
11
11
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
12
|
-
"data-testid":
|
|
12
|
+
"data-testid": F,
|
|
13
13
|
children: [
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
htmlFor:
|
|
14
|
+
/* @__PURE__ */ y(l, {
|
|
15
|
+
htmlFor: R,
|
|
16
16
|
requirement: c.Required,
|
|
17
|
-
labels:
|
|
18
|
-
children:
|
|
17
|
+
labels: L.fieldMarkers,
|
|
18
|
+
children: L.fieldLabel
|
|
19
19
|
}),
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ b(u, {
|
|
21
21
|
modal: !0,
|
|
22
|
-
open:
|
|
23
|
-
onOpenChange:
|
|
24
|
-
children: [/* @__PURE__ */
|
|
22
|
+
open: B,
|
|
23
|
+
onOpenChange: V,
|
|
24
|
+
children: [/* @__PURE__ */ y(f, {
|
|
25
25
|
asChild: !0,
|
|
26
|
-
children: /* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ b("button", {
|
|
27
27
|
type: "button",
|
|
28
|
-
id:
|
|
28
|
+
id: R,
|
|
29
29
|
role: "combobox",
|
|
30
|
-
"aria-expanded":
|
|
30
|
+
"aria-expanded": B,
|
|
31
31
|
"aria-required": !0,
|
|
32
|
-
"aria-describedby":
|
|
32
|
+
"aria-describedby": M ? z : void 0,
|
|
33
33
|
className: "ttw:flex ttw:h-10 ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2 ttw:rounded-md ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:text-left ttw:text-sm ttw:shadow-xs ttw:outline-none ttw:focus-visible:border-ring ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-ring/50",
|
|
34
34
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
className: m("ttw:min-w-0 ttw:flex-1 ttw:truncate",
|
|
37
|
-
children:
|
|
35
|
+
/* @__PURE__ */ y("span", {
|
|
36
|
+
className: m("ttw:min-w-0 ttw:flex-1 ttw:truncate", A ? "ttw:text-foreground" : "ttw:text-muted-foreground"),
|
|
37
|
+
children: A || L.triggerPlaceholder
|
|
38
38
|
}),
|
|
39
|
-
|
|
39
|
+
j ? /* @__PURE__ */ y(e, {
|
|
40
40
|
variant: "secondary",
|
|
41
|
-
children:
|
|
41
|
+
children: j
|
|
42
42
|
}) : null,
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ y(x, {
|
|
44
44
|
"aria-hidden": !0,
|
|
45
45
|
className: "ttw:size-4 ttw:shrink-0 ttw:opacity-50"
|
|
46
46
|
})
|
|
47
47
|
]
|
|
48
48
|
})
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ y(d, {
|
|
50
50
|
align: "start",
|
|
51
51
|
className: "ttw:w-[var(--radix-popover-trigger-width)] ttw:p-0",
|
|
52
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ b(t, {
|
|
53
53
|
shouldFilter: !1,
|
|
54
|
-
children: [/* @__PURE__ */
|
|
55
|
-
value:
|
|
56
|
-
onValueChange:
|
|
57
|
-
placeholder:
|
|
58
|
-
"aria-label":
|
|
59
|
-
}), /* @__PURE__ */
|
|
60
|
-
className: m("ttw:max-h-72",
|
|
61
|
-
children: [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
children: /* @__PURE__ */ y("div", {
|
|
87
|
-
className: "ttw:flex ttw:min-w-0 ttw:flex-col",
|
|
88
|
-
children: [/* @__PURE__ */ v("span", {
|
|
89
|
-
className: "ttw:truncate ttw:text-foreground",
|
|
90
|
-
children: e.name
|
|
91
|
-
}), e.email ? /* @__PURE__ */ v("span", {
|
|
92
|
-
className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
|
|
93
|
-
children: e.email
|
|
94
|
-
}) : null]
|
|
95
|
-
})
|
|
96
|
-
}, `${e.name}:${e.email}:${t}`))
|
|
97
|
-
}),
|
|
98
|
-
/* @__PURE__ */ v(o, {}),
|
|
99
|
-
/* @__PURE__ */ y(i, {
|
|
100
|
-
value: "__add_vendor__",
|
|
101
|
-
onSelect: O,
|
|
102
|
-
className: "ttw:sticky ttw:bottom-0 ttw:bg-popover ttw:text-primary",
|
|
103
|
-
children: [/* @__PURE__ */ v(x, { className: "ttw:size-4 ttw:text-primary" }), /* @__PURE__ */ y("div", {
|
|
54
|
+
children: [/* @__PURE__ */ y(r, {
|
|
55
|
+
value: T,
|
|
56
|
+
onValueChange: E,
|
|
57
|
+
placeholder: L.placeholder,
|
|
58
|
+
"aria-label": L.placeholder
|
|
59
|
+
}), /* @__PURE__ */ b(a, {
|
|
60
|
+
className: m("ttw:max-h-72", w),
|
|
61
|
+
children: [O ? /* @__PURE__ */ b("div", {
|
|
62
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:p-2",
|
|
63
|
+
"aria-busy": "true",
|
|
64
|
+
children: [/* @__PURE__ */ y("span", {
|
|
65
|
+
className: "ttw:sr-only",
|
|
66
|
+
children: L.loading
|
|
67
|
+
}), Array.from({ length: C }).map((e, t) => /* @__PURE__ */ b("div", {
|
|
68
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:px-2 ttw:py-1.5",
|
|
69
|
+
children: [/* @__PURE__ */ y(p, {
|
|
70
|
+
height: 14,
|
|
71
|
+
width: "55%"
|
|
72
|
+
}), /* @__PURE__ */ y(p, {
|
|
73
|
+
height: 14,
|
|
74
|
+
width: "30%"
|
|
75
|
+
})]
|
|
76
|
+
}, t))]
|
|
77
|
+
}) : D.length === 0 ? /* @__PURE__ */ y("div", {
|
|
78
|
+
className: m("ttw:flex ttw:items-center ttw:justify-center ttw:py-6 ttw:text-center ttw:text-sm", w),
|
|
79
|
+
children: L.emptyResults
|
|
80
|
+
}) : /* @__PURE__ */ y(n, {
|
|
81
|
+
heading: N,
|
|
82
|
+
children: D.map((e, t) => /* @__PURE__ */ y(i, {
|
|
83
|
+
value: `${e.name} ${e.email} ${t}`,
|
|
84
|
+
onSelect: () => e.onSelect(),
|
|
85
|
+
children: /* @__PURE__ */ b("div", {
|
|
104
86
|
className: "ttw:flex ttw:min-w-0 ttw:flex-col",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
106
|
-
className: "ttw:truncate",
|
|
107
|
-
children:
|
|
108
|
-
}),
|
|
87
|
+
children: [/* @__PURE__ */ y("span", {
|
|
88
|
+
className: "ttw:truncate ttw:text-foreground",
|
|
89
|
+
children: e.name
|
|
90
|
+
}), e.email ? /* @__PURE__ */ y("span", {
|
|
109
91
|
className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
|
|
110
|
-
children:
|
|
92
|
+
children: e.email
|
|
111
93
|
}) : null]
|
|
112
|
-
})
|
|
113
|
-
})
|
|
114
|
-
|
|
94
|
+
})
|
|
95
|
+
}, `${e.name}:${e.email}:${t}`))
|
|
96
|
+
}), k ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(o, {}), /* @__PURE__ */ b(i, {
|
|
97
|
+
value: "__add_vendor__",
|
|
98
|
+
onSelect: () => {
|
|
99
|
+
V(!1), k();
|
|
100
|
+
},
|
|
101
|
+
className: "ttw:sticky ttw:bottom-0 ttw:bg-popover ttw:text-primary",
|
|
102
|
+
children: [/* @__PURE__ */ y(S, { className: "ttw:size-4 ttw:text-primary" }), /* @__PURE__ */ b("div", {
|
|
103
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-col",
|
|
104
|
+
children: [/* @__PURE__ */ y("span", {
|
|
105
|
+
className: "ttw:truncate",
|
|
106
|
+
children: L.addVendorAction
|
|
107
|
+
}), P ? /* @__PURE__ */ y("span", {
|
|
108
|
+
className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
|
|
109
|
+
children: P
|
|
110
|
+
}) : null]
|
|
111
|
+
})]
|
|
112
|
+
})] }) : null]
|
|
115
113
|
})]
|
|
116
114
|
})
|
|
117
115
|
})]
|
|
118
116
|
}),
|
|
119
|
-
|
|
120
|
-
id:
|
|
121
|
-
children:
|
|
117
|
+
M ? /* @__PURE__ */ y(s, {
|
|
118
|
+
id: z,
|
|
119
|
+
children: M
|
|
122
120
|
}) : null
|
|
123
121
|
]
|
|
124
122
|
});
|
|
125
123
|
}
|
|
126
124
|
//#endregion
|
|
127
|
-
export {
|
|
125
|
+
export { T as VendorSearchCombobox, T as default };
|
|
@@ -3,31 +3,31 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { extractApiErrorMessage as e } from "../../../../util/dist/lib/apiErrors.js";
|
|
6
|
-
import { addressFormToCreatePayload as t, addressFormToUpdatePayload as n, addressResponseToFormValues as r, counterpartFormBankAccountToCreatePayload as i, counterpartFormBankAccountToUpdatePayload as
|
|
7
|
-
import { useCreateCounterpartMutation as
|
|
8
|
-
import { useCreateCounterpartBankAccountMutation as
|
|
9
|
-
import { useCreateCounterpartAddressMutation as
|
|
6
|
+
import { addressFormToCreatePayload as t, addressFormToUpdatePayload as n, addressResponseToFormValues as r, counterpartFormBankAccountToCreatePayload as i, counterpartFormBankAccountToUpdatePayload as a, counterpartFormToCreatePayload as o, counterpartFormToUpdatePayload as s, counterpartToFormValues as c, emptyCounterpartFormValues as l, getAchInstructions as u, hasCounterpartFormAddressValues as d, hasCounterpartFormBankAccountValues as f, hasCounterpartFormErrors as p, resolveCounterpartBankAccountWrite as ee, validateCounterpartForm as m, withoutUnchangedContactErrors as h } from "./helpers.js";
|
|
7
|
+
import { useCreateCounterpartMutation as g, useUpdateCounterpartMutation as _ } from "../../../data-access/dist/index3.js";
|
|
8
|
+
import { useCreateCounterpartBankAccountMutation as v, useUpdateCounterpartBankAccountMutation as y } from "../../../data-access/dist/index5.js";
|
|
9
|
+
import { useCreateCounterpartAddressMutation as b, useUpdateCounterpartAddressMutation as x } from "../../../data-access/dist/index7.js";
|
|
10
10
|
import "../../../data-access/dist/index.js";
|
|
11
|
-
import { useCallback as
|
|
11
|
+
import { useCallback as S, useLayoutEffect as C, useState as w } from "react";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js
|
|
13
|
-
function
|
|
14
|
-
if (!t) return
|
|
13
|
+
function te(e, t) {
|
|
14
|
+
if (!t) return d(e);
|
|
15
15
|
let n = r(t);
|
|
16
16
|
return e.address.line1.trim() !== n.line1.trim() || e.address.line2.trim() !== n.line2.trim() || e.address.city.trim() !== n.city.trim() || e.address.state.trim() !== n.state.trim() || e.address.postalCode.trim() !== n.postalCode.trim();
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function T(e) {
|
|
19
19
|
return {
|
|
20
20
|
accountHolderName: e.account_holder_name ?? "",
|
|
21
21
|
routingNumber: e.routing_number ?? "",
|
|
22
22
|
accountNumber: e.account_number ?? ""
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
if (!t) return
|
|
27
|
-
let n =
|
|
25
|
+
function ne(e, t) {
|
|
26
|
+
if (!t) return f(e);
|
|
27
|
+
let n = T(t);
|
|
28
28
|
return e.bankAccount.accountHolderName.trim() !== n.accountHolderName.trim() || e.bankAccount.routingNumber.trim() !== n.routingNumber.trim() || e.bankAccount.accountNumber.trim() !== n.accountNumber.trim();
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function re(e, t) {
|
|
31
31
|
let n = { ...e };
|
|
32
32
|
if ([
|
|
33
33
|
"legalName",
|
|
@@ -52,148 +52,146 @@ function E(e, t) {
|
|
|
52
52
|
}
|
|
53
53
|
return JSON.stringify(n) === JSON.stringify(e) ? e : n;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
let
|
|
55
|
+
function E({ view: r, setView: E, selectedId: D, setSelectedId: O, messages: k, counterpartType: A, counterpart: j, primaryAddress: M, bankAccounts: N, isBankAccountsLoading: P, isBankAccountsError: F, includeBankAccount: I = !0 }) {
|
|
56
|
+
let L = A === "vendor" && I, R = g(), z = b(), B = v(), V = _(), H = x(), U = y(), [W, G] = w(() => l()), [ie, K] = w({}), [ae, q] = w({
|
|
57
57
|
address: !1,
|
|
58
58
|
bankAccount: !1
|
|
59
|
-
}), [
|
|
60
|
-
|
|
61
|
-
address:
|
|
59
|
+
}), [J, Y] = w(), [X, Z] = w(), oe = R.isPending || z.isPending || B.isPending || U.isPending || V.isPending || H.isPending, se = S(() => {
|
|
60
|
+
O(void 0), Z(void 0), Y(void 0), q({
|
|
61
|
+
address: A === "vendor",
|
|
62
62
|
bankAccount: !1
|
|
63
|
-
}),
|
|
63
|
+
}), G(l("organization", A)), K({}), E("create");
|
|
64
64
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
]),
|
|
69
|
-
if (!
|
|
70
|
-
let e =
|
|
71
|
-
|
|
72
|
-
address:
|
|
65
|
+
A,
|
|
66
|
+
O,
|
|
67
|
+
E
|
|
68
|
+
]), ce = S(() => {
|
|
69
|
+
if (!j || L && (P || F)) return;
|
|
70
|
+
let e = L ? u(N) : void 0, t = c(j, M);
|
|
71
|
+
Z(void 0), Y(e?.id), q({
|
|
72
|
+
address: d(t),
|
|
73
73
|
bankAccount: !1
|
|
74
|
-
}),
|
|
74
|
+
}), G({
|
|
75
75
|
...t,
|
|
76
|
-
...e ? { bankAccount:
|
|
77
|
-
}),
|
|
76
|
+
...e ? { bankAccount: T(e) } : {}
|
|
77
|
+
}), K({}), E("edit");
|
|
78
78
|
}, [
|
|
79
|
+
N,
|
|
80
|
+
j,
|
|
81
|
+
F,
|
|
79
82
|
P,
|
|
80
83
|
M,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
D("none");
|
|
88
|
-
}, [D]), se = x(() => {
|
|
89
|
-
Y((e) => ({
|
|
84
|
+
E,
|
|
85
|
+
L
|
|
86
|
+
]), le = S(() => {
|
|
87
|
+
E("none");
|
|
88
|
+
}, [E]), ue = S(() => {
|
|
89
|
+
q((e) => ({
|
|
90
90
|
...e,
|
|
91
91
|
address: !0
|
|
92
92
|
}));
|
|
93
|
-
}, []),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
}, []), [Q, $] = w(!1), de = S(() => $(!0), []);
|
|
94
|
+
return C(() => {
|
|
95
|
+
let e = r === "edit" ? "edit" : "create", t = m(W, e, k, A, e === "edit" && L && !!J);
|
|
96
|
+
if (Q) {
|
|
97
|
+
$(!1), K(t);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
K((e) => p(e) ? re(e, t) : e);
|
|
98
101
|
}, [
|
|
99
|
-
|
|
100
|
-
j,
|
|
102
|
+
J,
|
|
101
103
|
A,
|
|
104
|
+
Q,
|
|
105
|
+
k,
|
|
106
|
+
W,
|
|
102
107
|
r,
|
|
103
|
-
|
|
104
|
-
]),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
openEdit: ae,
|
|
120
|
-
close: oe,
|
|
121
|
-
submit: x(async () => {
|
|
122
|
-
let c = r === "edit" ? "edit" : "create", h = te(m(G, c, A, j, c === "edit" && R && !!X), G, c === "edit" && M ? s(M, N) : void 0);
|
|
123
|
-
if (f(h)) return J(h), Y((e) => ({
|
|
124
|
-
address: e.address || !!h.address,
|
|
125
|
-
bankAccount: e.bankAccount || !!h.bankAccount
|
|
108
|
+
L
|
|
109
|
+
]), {
|
|
110
|
+
values: W,
|
|
111
|
+
errors: ie,
|
|
112
|
+
setValues: G,
|
|
113
|
+
isSubmitting: oe,
|
|
114
|
+
sectionsToExpand: ae,
|
|
115
|
+
expandAddress: ue,
|
|
116
|
+
openCreate: se,
|
|
117
|
+
openEdit: ce,
|
|
118
|
+
close: le,
|
|
119
|
+
submit: S(async () => {
|
|
120
|
+
let l = r === "edit" ? "edit" : "create", g = h(m(W, l, k, A, l === "edit" && L && !!J), W, l === "edit" && j ? c(j, M) : void 0);
|
|
121
|
+
if (p(g)) return K(g), q((e) => ({
|
|
122
|
+
address: e.address || !!g.address,
|
|
123
|
+
bankAccount: e.bankAccount || !!g.bankAccount
|
|
126
124
|
})), { ok: !1 };
|
|
127
|
-
|
|
125
|
+
K({}), q({
|
|
128
126
|
address: !1,
|
|
129
127
|
bankAccount: !1
|
|
130
128
|
});
|
|
131
|
-
let
|
|
129
|
+
let _ = X;
|
|
132
130
|
try {
|
|
133
|
-
if (r === "edit" &&
|
|
134
|
-
|
|
135
|
-
path: { counterpart_id:
|
|
136
|
-
body:
|
|
131
|
+
if (r === "edit" && D) {
|
|
132
|
+
Z(void 0), await V.mutateAsync({
|
|
133
|
+
path: { counterpart_id: D },
|
|
134
|
+
body: s(W, A)
|
|
137
135
|
});
|
|
138
|
-
let e =
|
|
136
|
+
let e = M ? te(W, M) ? H.mutateAsync({
|
|
139
137
|
path: {
|
|
140
|
-
counterpart_id:
|
|
141
|
-
address_id:
|
|
138
|
+
counterpart_id: D,
|
|
139
|
+
address_id: M.id
|
|
142
140
|
},
|
|
143
|
-
body: n(
|
|
144
|
-
}) : void 0 :
|
|
145
|
-
path: { counterpart_id:
|
|
146
|
-
body: t(
|
|
147
|
-
}) : void 0, r =
|
|
141
|
+
body: n(W.address)
|
|
142
|
+
}) : void 0 : d(W) ? z.mutateAsync({
|
|
143
|
+
path: { counterpart_id: D },
|
|
144
|
+
body: t(W.address)
|
|
145
|
+
}) : void 0, r = L && ne(W, u(N)) ? ee(N, J) : void 0, o = r?.kind === "update" ? U.mutateAsync({
|
|
148
146
|
path: {
|
|
149
|
-
counterpart_id:
|
|
147
|
+
counterpart_id: D,
|
|
150
148
|
bank_account_id: r.bankAccountId
|
|
151
149
|
},
|
|
152
|
-
body:
|
|
153
|
-
}) : r?.kind === "create" ?
|
|
154
|
-
path: { counterpart_id:
|
|
155
|
-
body: i(
|
|
156
|
-
}) : void 0, [
|
|
157
|
-
if (r?.kind === "create" &&
|
|
158
|
-
if (
|
|
159
|
-
return
|
|
150
|
+
body: a(W.bankAccount, { includeAchDefaults: r.includeAchDefaults })
|
|
151
|
+
}) : r?.kind === "create" ? B.mutateAsync({
|
|
152
|
+
path: { counterpart_id: D },
|
|
153
|
+
body: i(W.bankAccount, { isDefaultForCurrency: r.isDefaultForCurrency })
|
|
154
|
+
}) : void 0, [c, l] = await Promise.allSettled([e, o]);
|
|
155
|
+
if (r?.kind === "create" && l.status === "fulfilled" && Y(l.value?.id), c.status === "rejected") throw c.reason;
|
|
156
|
+
if (l.status === "rejected") throw l.reason;
|
|
157
|
+
return E("none"), {
|
|
160
158
|
ok: !0,
|
|
161
|
-
counterpartId:
|
|
159
|
+
counterpartId: D
|
|
162
160
|
};
|
|
163
161
|
}
|
|
164
|
-
return
|
|
165
|
-
path: { counterpart_id:
|
|
166
|
-
body: i(
|
|
167
|
-
})),
|
|
162
|
+
return _ ||= (await R.mutateAsync({ body: o(W, A) }))?.id, _ && L && f(W) && (Z(_), await B.mutateAsync({
|
|
163
|
+
path: { counterpart_id: _ },
|
|
164
|
+
body: i(W.bankAccount)
|
|
165
|
+
})), Z(void 0), E("none"), _ && O(_), {
|
|
168
166
|
ok: !0,
|
|
169
|
-
counterpartId:
|
|
167
|
+
counterpartId: _
|
|
170
168
|
};
|
|
171
169
|
} catch (t) {
|
|
172
|
-
return
|
|
170
|
+
return _ && (Z(_), O(_)), K({ form: e(t) ?? k.genericError }), { ok: !1 };
|
|
173
171
|
}
|
|
174
172
|
}, [
|
|
175
173
|
r,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
W,
|
|
175
|
+
D,
|
|
176
|
+
X,
|
|
177
|
+
k,
|
|
179
178
|
A,
|
|
180
179
|
j,
|
|
181
180
|
M,
|
|
182
181
|
N,
|
|
183
|
-
|
|
184
|
-
X,
|
|
185
|
-
B,
|
|
186
|
-
V,
|
|
182
|
+
J,
|
|
187
183
|
z,
|
|
188
|
-
|
|
189
|
-
|
|
184
|
+
B,
|
|
185
|
+
R,
|
|
190
186
|
H,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
187
|
+
U,
|
|
188
|
+
V,
|
|
189
|
+
E,
|
|
190
|
+
O,
|
|
191
|
+
L
|
|
194
192
|
]),
|
|
195
|
-
revealErrors:
|
|
193
|
+
revealErrors: de
|
|
196
194
|
};
|
|
197
195
|
}
|
|
198
196
|
//#endregion
|
|
199
|
-
export {
|
|
197
|
+
export { E as useCounterpartForm };
|
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.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.296", n = "6b18e8f6b106c920f597e3837fcd53571fcb5b9a", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|