@tesouro/embedded-components-react 0.2.298 → 0.2.300
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 +6 -0
- package/dist/index.d.ts +107 -87
- package/dist/lib/CounterpartsWidget.d.ts +24 -4
- package/dist/lib/ReceivablesWidget.d.ts +20 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +31 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +122 -149
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +163 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +52 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +8 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +98 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +6 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +7 -3
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +12 -7
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +17 -16
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +103 -50
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +126 -76
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +12 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +6 -173
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +173 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +5 -57
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +51 -22
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +24 -72
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +76 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +13 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +53 -110
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index6.js +115 -51
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js +53 -47
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +44 -504
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +480 -6
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +2939 -2975
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -38,113 +38,119 @@ function v(e, t) {
|
|
|
38
38
|
};
|
|
39
39
|
return n;
|
|
40
40
|
}
|
|
41
|
-
function y({ payableId: h, form: g, counterpartId: y,
|
|
42
|
-
let
|
|
41
|
+
function y({ payableId: h, form: g, counterpartId: y, clearCounterpart: b, prepareVendorForSave: x, onSaved: S, onPayableCreated: C, onDraftSaved: w, onFinalized: T, labels: E }) {
|
|
42
|
+
let D = {
|
|
43
43
|
...t,
|
|
44
|
-
...
|
|
45
|
-
}, [
|
|
46
|
-
let t = d(g.lineItems,
|
|
47
|
-
return g.setLineItemErrors(t), !t && !n || (t ? (g.setErrors(void 0), e.error(
|
|
48
|
-
}, [g,
|
|
44
|
+
...E
|
|
45
|
+
}, [O, k] = m(), A = h ?? O, [j, M] = m(), N = p(!1), P = r(), F = a(), I = n(), L = o(), R = i(), z = f(() => {
|
|
46
|
+
let t = d(g.lineItems, D), n = u(g.discount, g.tax, g.totalOverride, D);
|
|
47
|
+
return g.setLineItemErrors(t), !t && !n || (t ? (g.setErrors(void 0), e.error(D.lineItemsNeedAttention)) : g.setErrors(n), !1);
|
|
48
|
+
}, [g, D]), B = f(async () => {
|
|
49
49
|
let e = s({
|
|
50
50
|
values: g.values,
|
|
51
51
|
counterpartId: y,
|
|
52
|
+
clearCounterpart: b,
|
|
52
53
|
editedTotals: g.isTotalsDirty ? {
|
|
53
54
|
discount: g.discount,
|
|
54
55
|
tax: g.tax,
|
|
55
56
|
total: g.totalOverride
|
|
56
57
|
} : void 0
|
|
57
|
-
}), t =
|
|
58
|
-
if (t ? await
|
|
58
|
+
}), t = A;
|
|
59
|
+
if (t ? await F.mutateAsync({
|
|
59
60
|
path: { payable_id: t },
|
|
60
61
|
body: e
|
|
61
|
-
}) : (t = (await
|
|
62
|
-
return await
|
|
62
|
+
}) : (t = (await P.mutateAsync({ body: e }))?.id, t && (k(t), C?.(t))), !t) throw Error("Payable was created without an id");
|
|
63
|
+
return await I.mutateAsync({
|
|
63
64
|
path: { payable_id: t },
|
|
64
65
|
body: { data: c(g.lineItems) }
|
|
65
66
|
}), t;
|
|
66
67
|
}, [
|
|
67
68
|
y,
|
|
68
|
-
|
|
69
|
+
b,
|
|
70
|
+
P,
|
|
69
71
|
g.discount,
|
|
70
72
|
g.isTotalsDirty,
|
|
71
73
|
g.lineItems,
|
|
72
74
|
g.tax,
|
|
73
75
|
g.totalOverride,
|
|
74
76
|
g.values,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
C,
|
|
78
|
+
A,
|
|
79
|
+
I,
|
|
80
|
+
F
|
|
79
81
|
]);
|
|
80
82
|
return {
|
|
81
83
|
saveDraft: f(async () => {
|
|
82
|
-
if (!
|
|
83
|
-
|
|
84
|
+
if (!N.current && z()) {
|
|
85
|
+
N.current = !0, M("draft");
|
|
84
86
|
try {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
if (await x?.() === !1) return;
|
|
88
|
+
let t = await B();
|
|
89
|
+
g.setErrors(void 0), S?.(t), w?.(t), e.success(D.draftSaved);
|
|
87
90
|
} catch {
|
|
88
|
-
g.setErrors({ form:
|
|
91
|
+
g.setErrors({ form: D.saveFailed });
|
|
89
92
|
} finally {
|
|
90
|
-
|
|
93
|
+
M(void 0), N.current = !1;
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
}, [
|
|
94
97
|
g,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
z,
|
|
99
|
+
D.draftSaved,
|
|
100
|
+
D.saveFailed,
|
|
101
|
+
w,
|
|
98
102
|
S,
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
x,
|
|
104
|
+
B
|
|
101
105
|
]),
|
|
102
106
|
finalize: f(async () => {
|
|
103
|
-
if (
|
|
104
|
-
let t = d(g.lineItems,
|
|
107
|
+
if (N.current) return;
|
|
108
|
+
let t = d(g.lineItems, D), n = u(g.discount, g.tax, g.totalOverride, D), { formErrors: r, lineItemErrors: i } = l(g.values, y, g.lineItems, D), a = v(i, t);
|
|
105
109
|
g.setLineItemErrors(a);
|
|
106
110
|
let o = {
|
|
107
111
|
...r,
|
|
108
112
|
...n
|
|
109
113
|
};
|
|
110
|
-
if (g.setErrors(Object.keys(o).length ? o : void 0), t && e.error(
|
|
111
|
-
|
|
114
|
+
if (g.setErrors(Object.keys(o).length ? o : void 0), t && e.error(D.lineItemsNeedAttention), !(a || Object.keys(o).length)) {
|
|
115
|
+
N.current = !0, M("finalize");
|
|
112
116
|
try {
|
|
113
117
|
let t;
|
|
114
118
|
try {
|
|
115
|
-
|
|
119
|
+
if (await x?.() === !1) return;
|
|
120
|
+
t = await B();
|
|
116
121
|
} catch {
|
|
117
|
-
g.setErrors({ form:
|
|
122
|
+
g.setErrors({ form: D.saveFailed });
|
|
118
123
|
return;
|
|
119
124
|
}
|
|
120
|
-
|
|
125
|
+
S?.(t);
|
|
121
126
|
try {
|
|
122
|
-
let n = await
|
|
127
|
+
let n = await L.mutateAsync({ path: { payable_id: t } });
|
|
123
128
|
if (n.validation_errors.length) {
|
|
124
|
-
g.setErrors(_(n.validation_errors,
|
|
129
|
+
g.setErrors(_(n.validation_errors, D));
|
|
125
130
|
return;
|
|
126
131
|
}
|
|
127
|
-
await
|
|
132
|
+
await R.mutateAsync({ path: { payable_id: t } }), g.setErrors(void 0), T?.(t), e.success(D.billFinalized);
|
|
128
133
|
} catch {
|
|
129
|
-
g.setErrors({ form:
|
|
134
|
+
g.setErrors({ form: D.finalizeFailed });
|
|
130
135
|
}
|
|
131
136
|
} finally {
|
|
132
|
-
|
|
137
|
+
M(void 0), N.current = !1;
|
|
133
138
|
}
|
|
134
139
|
}
|
|
135
140
|
}, [
|
|
136
141
|
y,
|
|
137
142
|
g,
|
|
143
|
+
D,
|
|
138
144
|
T,
|
|
139
|
-
|
|
140
|
-
|
|
145
|
+
S,
|
|
146
|
+
x,
|
|
147
|
+
B,
|
|
141
148
|
R,
|
|
142
|
-
|
|
143
|
-
F
|
|
149
|
+
L
|
|
144
150
|
]),
|
|
145
|
-
payableId:
|
|
146
|
-
isSavingDraft:
|
|
147
|
-
isFinalizing:
|
|
151
|
+
payableId: A,
|
|
152
|
+
isSavingDraft: j === "draft",
|
|
153
|
+
isFinalizing: j === "finalize"
|
|
148
154
|
};
|
|
149
155
|
}
|
|
150
156
|
//#endregion
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { ACH_FIELD_GROUP_LABELS_EN as e } from "../../../shared/counterpart-management/ui/dist/index2.js";
|
|
2
|
+
import "../../../shared/counterpart-management/ui/dist/index.js";
|
|
1
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js
|
|
2
|
-
var
|
|
4
|
+
var t = {
|
|
3
5
|
payToHeading: "Pay to",
|
|
4
6
|
editAction: "Edit",
|
|
5
7
|
clearAction: "Clear",
|
|
8
|
+
paymentInstructionsHeading: "Payment instructions",
|
|
9
|
+
paymentInstructionsDescription: "How and where will the money be sent. This information is required to send a payment.",
|
|
10
|
+
addPaymentInstructions: "Add payment instructions",
|
|
11
|
+
ach: e,
|
|
6
12
|
revealField: (e) => `Show ${e.toLowerCase()}`,
|
|
7
13
|
hideField: (e) => `Hide ${e.toLowerCase()}`
|
|
8
14
|
};
|
|
9
15
|
//#endregion
|
|
10
|
-
export {
|
|
16
|
+
export { t as VENDOR_SUMMARY_CARD_LABELS_EN };
|
|
@@ -1,89 +1,120 @@
|
|
|
1
1
|
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { AchFieldGroup as t } from "../../../shared/counterpart-management/ui/dist/index5.js";
|
|
3
|
+
import "../../../shared/counterpart-management/ui/dist/index.js";
|
|
4
|
+
import { VENDOR_SUMMARY_CARD_LABELS_EN as n } from "./index18.js";
|
|
5
|
+
import { useState as r } from "react";
|
|
6
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { Eye as s, EyeOff as c, Pencil as l, Plus as u, X as d } from "lucide-react";
|
|
6
8
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js
|
|
7
|
-
function
|
|
8
|
-
let [
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
function f({ field: e, labels: t }) {
|
|
10
|
+
let [n, i] = r(!1), l = !!e.maskedValue, u = l && !n ? e.maskedValue : e.value;
|
|
11
|
+
return /* @__PURE__ */ o("div", {
|
|
10
12
|
className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-sm",
|
|
11
13
|
children: [
|
|
12
|
-
/* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ a("span", {
|
|
13
15
|
className: "ttw:w-44 ttw:shrink-0 ttw:text-muted-foreground",
|
|
14
16
|
children: e.label
|
|
15
17
|
}),
|
|
16
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ a("span", {
|
|
17
19
|
className: "ttw:text-foreground",
|
|
18
20
|
children: u
|
|
19
21
|
}),
|
|
20
|
-
l ? /* @__PURE__ */
|
|
22
|
+
l ? /* @__PURE__ */ a("button", {
|
|
21
23
|
type: "button",
|
|
22
|
-
onClick: () =>
|
|
23
|
-
"aria-label":
|
|
24
|
+
onClick: () => i((e) => !e),
|
|
25
|
+
"aria-label": n ? t.hideField(e.label) : t.revealField(e.label),
|
|
24
26
|
className: "ttw:text-muted-foreground ttw:hover:text-foreground",
|
|
25
|
-
children:
|
|
27
|
+
children: a(n ? c : s, { className: "ttw:size-4" })
|
|
26
28
|
}) : null
|
|
27
29
|
]
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
|
-
function
|
|
31
|
-
let
|
|
32
|
-
...
|
|
33
|
-
...
|
|
32
|
+
function p({ summary: r, onEdit: s, onClear: c, paymentInstructions: p, testId: m, labels: h }) {
|
|
33
|
+
let g = {
|
|
34
|
+
...n,
|
|
35
|
+
...h,
|
|
36
|
+
ach: {
|
|
37
|
+
...n.ach,
|
|
38
|
+
...h?.ach
|
|
39
|
+
}
|
|
34
40
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ o("div", {
|
|
36
42
|
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-muted/30 ttw:p-4",
|
|
37
|
-
"data-testid":
|
|
38
|
-
children: [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
43
|
+
"data-testid": m,
|
|
44
|
+
children: [/* @__PURE__ */ o("div", {
|
|
45
|
+
className: "ttw:flex ttw:items-start ttw:justify-between",
|
|
46
|
+
children: [/* @__PURE__ */ o("div", {
|
|
47
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ a("span", {
|
|
50
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
51
|
+
children: g.payToHeading
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ a("span", {
|
|
54
|
+
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
55
|
+
children: r.name
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ a("span", {
|
|
58
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
59
|
+
children: r.email
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
}), /* @__PURE__ */ o("div", {
|
|
63
|
+
className: "ttw:flex ttw:items-center ttw:gap-1",
|
|
64
|
+
children: [s ? /* @__PURE__ */ a(e, {
|
|
65
|
+
type: "button",
|
|
66
|
+
variant: "ghost",
|
|
67
|
+
size: "icon",
|
|
68
|
+
"aria-label": g.editAction,
|
|
69
|
+
onClick: s,
|
|
70
|
+
children: /* @__PURE__ */ a(l, { className: "ttw:size-4" })
|
|
71
|
+
}) : null, c ? /* @__PURE__ */ a(e, {
|
|
72
|
+
type: "button",
|
|
73
|
+
variant: "ghost",
|
|
74
|
+
size: "icon",
|
|
75
|
+
"aria-label": g.clearAction,
|
|
76
|
+
onClick: c,
|
|
77
|
+
children: /* @__PURE__ */ a(d, { className: "ttw:size-4" })
|
|
78
|
+
}) : null]
|
|
79
|
+
})]
|
|
80
|
+
}), r.fields.length ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("p", {
|
|
81
|
+
className: "ttw:mt-3 ttw:text-xs ttw:text-muted-foreground",
|
|
82
|
+
children: r.methodLabel
|
|
83
|
+
}), /* @__PURE__ */ a("div", {
|
|
84
|
+
className: "ttw:mt-2 ttw:flex ttw:flex-col ttw:gap-1",
|
|
85
|
+
children: r.fields.map((e) => /* @__PURE__ */ a(f, {
|
|
86
|
+
field: e,
|
|
87
|
+
labels: g
|
|
88
|
+
}, `${e.label}:${e.value}:${e.maskedValue ?? ""}`))
|
|
89
|
+
})] }) : /* @__PURE__ */ o("div", {
|
|
90
|
+
className: "ttw:mt-4 ttw:flex ttw:flex-col ttw:gap-3",
|
|
91
|
+
children: [/* @__PURE__ */ o("div", {
|
|
92
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
93
|
+
children: [/* @__PURE__ */ a("p", {
|
|
94
|
+
className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
|
|
95
|
+
children: g.paymentInstructionsHeading
|
|
96
|
+
}), /* @__PURE__ */ a("p", {
|
|
97
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
98
|
+
children: g.paymentInstructionsDescription
|
|
72
99
|
})]
|
|
73
|
-
}),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
100
|
+
}), p?.isOpen ? /* @__PURE__ */ a(t, {
|
|
101
|
+
idPrefix: "vendor-summary-ach",
|
|
102
|
+
values: p.values,
|
|
103
|
+
errors: p.errors,
|
|
104
|
+
onChange: p.onChange,
|
|
105
|
+
labels: g.ach
|
|
106
|
+
}) : p ? /* @__PURE__ */ o(e, {
|
|
107
|
+
type: "button",
|
|
108
|
+
variant: "link",
|
|
109
|
+
className: "ttw:w-fit ttw:px-0",
|
|
110
|
+
onClick: p.onOpen,
|
|
111
|
+
children: [/* @__PURE__ */ a(u, { className: "ttw:size-4" }), g.addPaymentInstructions]
|
|
112
|
+
}) : /* @__PURE__ */ a("p", {
|
|
113
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
114
|
+
children: r.methodLabel
|
|
115
|
+
})]
|
|
116
|
+
})]
|
|
86
117
|
});
|
|
87
118
|
}
|
|
88
119
|
//#endregion
|
|
89
|
-
export {
|
|
120
|
+
export { p as VendorSummaryCard, p as default };
|
|
@@ -12,7 +12,11 @@ function o(o) {
|
|
|
12
12
|
...d,
|
|
13
13
|
summaryCard: {
|
|
14
14
|
...r.summaryCard,
|
|
15
|
-
...d?.summaryCard
|
|
15
|
+
...d?.summaryCard,
|
|
16
|
+
ach: {
|
|
17
|
+
...r.summaryCard.ach,
|
|
18
|
+
...d?.summaryCard?.ach
|
|
19
|
+
}
|
|
16
20
|
},
|
|
17
21
|
search: {
|
|
18
22
|
...r.search,
|
|
@@ -33,6 +37,7 @@ function o(o) {
|
|
|
33
37
|
summary: o.summary,
|
|
34
38
|
onEdit: s,
|
|
35
39
|
onClear: c,
|
|
40
|
+
paymentInstructions: f ? void 0 : o.paymentInstructions,
|
|
36
41
|
labels: p.summaryCard
|
|
37
42
|
}) : f ? /* @__PURE__ */ i(e, {
|
|
38
43
|
variant: "body2",
|
|
@@ -20,7 +20,11 @@ function b({ open: b, onOpenChange: x, title: S, subtitle: C, notice: w, vendor:
|
|
|
20
20
|
...V?.vendorSection,
|
|
21
21
|
summaryCard: {
|
|
22
22
|
...m.vendorSection.summaryCard,
|
|
23
|
-
...V?.vendorSection?.summaryCard
|
|
23
|
+
...V?.vendorSection?.summaryCard,
|
|
24
|
+
ach: {
|
|
25
|
+
...m.vendorSection.summaryCard.ach,
|
|
26
|
+
...V?.vendorSection?.summaryCard?.ach
|
|
27
|
+
}
|
|
24
28
|
},
|
|
25
29
|
search: {
|
|
26
30
|
...m.vendorSection.search,
|
|
@@ -137,13 +141,13 @@ function b({ open: b, onOpenChange: x, title: S, subtitle: C, notice: w, vendor:
|
|
|
137
141
|
variant: "secondary",
|
|
138
142
|
onClick: R,
|
|
139
143
|
loading: F,
|
|
140
|
-
disabled: I || N,
|
|
144
|
+
disabled: I || N || T.mode === "creating",
|
|
141
145
|
children: H.saveDraftButton
|
|
142
146
|
}), /* @__PURE__ */ g(e, {
|
|
143
147
|
type: "button",
|
|
144
148
|
onClick: z,
|
|
145
149
|
loading: I,
|
|
146
|
-
disabled: F || N,
|
|
150
|
+
disabled: F || N || T.mode === "creating",
|
|
147
151
|
children: H.finalizeButton
|
|
148
152
|
})] })]
|
|
149
153
|
})
|
package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js
CHANGED
|
@@ -10,7 +10,7 @@ import "../../../shared/data-access/dist/index.js";
|
|
|
10
10
|
import { useQuery as a } from "@tanstack/react-query";
|
|
11
11
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js
|
|
12
12
|
function o({ metric: n = "total_amount", type: o, statusIn: s, counterpartIdIn: c, enabled: l } = {}) {
|
|
13
|
-
let { client: u, organizationId: d, widgetToken: f, authEpoch: p } = e(), m = c
|
|
13
|
+
let { client: u, organizationId: d, widgetToken: f, authEpoch: p } = e(), m = c == null || c.length > 0, h = !!(d && f) && m && (l === !0 || l === void 0), g = r({
|
|
14
14
|
client: u,
|
|
15
15
|
headers: t(d),
|
|
16
16
|
query: {
|
|
@@ -28,7 +28,7 @@ function o({ metric: n = "total_amount", type: o, statusIn: s, counterpartIdIn:
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
function s({ metric: r = "total_amount", statusIn: o, counterpartIdIn: s, enabled: c } = {}) {
|
|
31
|
-
let { client: l, organizationId: u, widgetToken: d, authEpoch: f } = e(), p = s
|
|
31
|
+
let { client: l, organizationId: u, widgetToken: d, authEpoch: f } = e(), p = s == null || s.length > 0, m = !!(u && d) && p && (c === !0 || c === void 0), h = n({
|
|
32
32
|
client: l,
|
|
33
33
|
headers: t(u),
|
|
34
34
|
query: {
|
package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js
CHANGED
|
@@ -79,7 +79,10 @@ function T({ counterpartType: T, detailsLabels: E, messageLabels: D }) {
|
|
|
79
79
|
messages: M,
|
|
80
80
|
counterpartType: T,
|
|
81
81
|
counterpart: W.counterpart,
|
|
82
|
-
primaryAddress: W.primaryAddress
|
|
82
|
+
primaryAddress: W.primaryAddress,
|
|
83
|
+
bankAccounts: W.bankAccounts,
|
|
84
|
+
isBankAccountsLoading: W.isBankAccountsLoading,
|
|
85
|
+
isBankAccountsError: W.isBankAccountsError
|
|
83
86
|
}), ce = f({
|
|
84
87
|
items: W.bankAccounts,
|
|
85
88
|
selectedId: H,
|
package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
6
6
|
import { WidgetProvider as t } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
7
7
|
import "../../../shared/feature/dist/index.js";
|
|
8
|
-
import { CounterpartFormSheet as n } from "../../../shared/counterpart-management/ui/dist/
|
|
9
|
-
import { BankAccountFormSheet as r } from "../../../shared/counterpart-management/ui/dist/
|
|
10
|
-
import { AddressFormSheet as i } from "../../../shared/counterpart-management/ui/dist/
|
|
11
|
-
import { ConfirmDeleteDialog as a } from "../../../shared/counterpart-management/ui/dist/
|
|
8
|
+
import { CounterpartFormSheet as n } from "../../../shared/counterpart-management/ui/dist/index9.js";
|
|
9
|
+
import { BankAccountFormSheet as r } from "../../../shared/counterpart-management/ui/dist/index11.js";
|
|
10
|
+
import { AddressFormSheet as i } from "../../../shared/counterpart-management/ui/dist/index13.js";
|
|
11
|
+
import { ConfirmDeleteDialog as a } from "../../../shared/counterpart-management/ui/dist/index14.js";
|
|
12
12
|
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
13
13
|
import { CounterpartsWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "./index2.js";
|
|
14
14
|
import { PAGE_SIZE_OPTIONS as c } from "./index3.js";
|
|
@@ -70,7 +70,7 @@ function g({ counterpartType: t, pageSizeOptions: s = c, showTitle: g, onViewAll
|
|
|
70
70
|
errors: P.errors,
|
|
71
71
|
stateOptions: E,
|
|
72
72
|
inProgress: P.isSubmitting,
|
|
73
|
-
submitDisabled: P.
|
|
73
|
+
submitDisabled: P.isSubmitting,
|
|
74
74
|
onChange: (e) => P.setValues((t) => ({
|
|
75
75
|
...t,
|
|
76
76
|
...e
|
|
@@ -91,6 +91,9 @@ function g({ counterpartType: t, pageSizeOptions: s = c, showTitle: g, onViewAll
|
|
|
91
91
|
})),
|
|
92
92
|
onSubmit: P.submit,
|
|
93
93
|
onCancel: P.close,
|
|
94
|
+
sections: { address: "collapsible" },
|
|
95
|
+
sectionsToExpand: P.sectionsToExpand,
|
|
96
|
+
onAddressExpand: P.expandAddress,
|
|
94
97
|
labels: y
|
|
95
98
|
}),
|
|
96
99
|
/* @__PURE__ */ m(u, {
|
|
@@ -103,7 +106,7 @@ function g({ counterpartType: t, pageSizeOptions: s = c, showTitle: g, onViewAll
|
|
|
103
106
|
counterpart: j,
|
|
104
107
|
isLoading: A.isLoading,
|
|
105
108
|
isError: A.isError,
|
|
106
|
-
canEdit: M.canUpdate,
|
|
109
|
+
canEdit: M.canUpdate && !(t === "vendor" && (A.isBankAccountsLoading || A.isBankAccountsError)),
|
|
107
110
|
canDelete: M.canDelete,
|
|
108
111
|
onEdit: P.openEdit,
|
|
109
112
|
onDelete: L.requestDeleteCounterpart,
|
|
@@ -123,7 +126,7 @@ function g({ counterpartType: t, pageSizeOptions: s = c, showTitle: g, onViewAll
|
|
|
123
126
|
errors: P.errors,
|
|
124
127
|
stateOptions: E,
|
|
125
128
|
inProgress: P.isSubmitting,
|
|
126
|
-
submitDisabled: P.
|
|
129
|
+
submitDisabled: P.isSubmitting,
|
|
127
130
|
onChange: (e) => P.setValues((t) => ({
|
|
128
131
|
...t,
|
|
129
132
|
...e
|
|
@@ -144,6 +147,8 @@ function g({ counterpartType: t, pageSizeOptions: s = c, showTitle: g, onViewAll
|
|
|
144
147
|
})),
|
|
145
148
|
onSubmit: P.submit,
|
|
146
149
|
onCancel: P.close,
|
|
150
|
+
sections: { address: "collapsible" },
|
|
151
|
+
sectionsToExpand: P.sectionsToExpand,
|
|
147
152
|
labels: y
|
|
148
153
|
} : void 0,
|
|
149
154
|
labels: b
|
|
@@ -3,7 +3,7 @@ import { EmptyState as ee } from "../../../shared/ui/dist/lib/EmptyState/EmptySt
|
|
|
3
3
|
import { ErrorState as te } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
4
4
|
import "../../../shared/ui/dist/index.js";
|
|
5
5
|
import { COUNTERPART_FORM_SHEET_LABELS_EN as m } from "../../../shared/counterpart-management/ui/dist/index2.js";
|
|
6
|
-
import { CounterpartFormFields as h } from "../../../shared/counterpart-management/ui/dist/
|
|
6
|
+
import { CounterpartFormFields as h } from "../../../shared/counterpart-management/ui/dist/index9.js";
|
|
7
7
|
import "../../../shared/counterpart-management/ui/dist/index.js";
|
|
8
8
|
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as g } from "./index2.js";
|
|
9
9
|
import { useEffect as ne, useState as re } from "react";
|
package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js
CHANGED
|
@@ -56,9 +56,9 @@ function b({ onEdit: r, onDelete: o, onAdd: b, screenLabels: x, formLabels: S, d
|
|
|
56
56
|
}, [P, B]), K = f((e) => {
|
|
57
57
|
L(e), z(void 0);
|
|
58
58
|
}, []), q = f(() => {
|
|
59
|
-
z(U?.next_pagination_token);
|
|
59
|
+
z(U?.next_pagination_token ?? void 0);
|
|
60
60
|
}, [U?.next_pagination_token]), J = f(() => {
|
|
61
|
-
z(U?.prev_pagination_token);
|
|
61
|
+
z(U?.prev_pagination_token ?? void 0);
|
|
62
62
|
}, [U?.prev_pagination_token]);
|
|
63
63
|
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(c, {
|
|
64
64
|
...T,
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js
CHANGED
|
@@ -38,7 +38,7 @@ function l({ activeTab: l, messages: d }) {
|
|
|
38
38
|
h(e), _(void 0);
|
|
39
39
|
}, []), F = i((e) => {
|
|
40
40
|
C(e), _(void 0);
|
|
41
|
-
}, []), I = i(() => _(D.data?.next_pagination_token), [D.data?.next_pagination_token]), L = i(() => _(D.data?.prev_pagination_token), [D.data?.prev_pagination_token]), R = i(() => {
|
|
41
|
+
}, []), I = i(() => _(D.data?.next_pagination_token ?? void 0), [D.data?.next_pagination_token]), L = i(() => _(D.data?.prev_pagination_token ?? void 0), [D.data?.prev_pagination_token]), R = i(() => {
|
|
42
42
|
D.refetch();
|
|
43
43
|
}, [D]);
|
|
44
44
|
return {
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
6
6
|
import { WidgetProvider as t } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
7
7
|
import "../../../shared/feature/dist/index.js";
|
|
8
|
-
import { CounterpartFormSheet as n } from "../../../shared/counterpart-management/ui/dist/
|
|
8
|
+
import { CounterpartFormSheet as n } from "../../../shared/counterpart-management/ui/dist/index9.js";
|
|
9
9
|
import { CounterpartSelector as r } from "../../../shared/counterpart-management/feature/dist/lib/CounterpartSelector.js";
|
|
10
10
|
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
11
11
|
import { ReceivablesWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index2.js";
|
|
@@ -160,7 +160,7 @@ function v({ receivable: e, history: t, mails: n, pdfUrl: r, messages: i }) {
|
|
|
160
160
|
currency: e.currency,
|
|
161
161
|
fallback: i.notAvailable
|
|
162
162
|
}),
|
|
163
|
-
pdfUrl: r || e.file_url || e.original_file_url,
|
|
163
|
+
pdfUrl: r || e.file_url || e.original_file_url || void 0,
|
|
164
164
|
summaryItems: [
|
|
165
165
|
{
|
|
166
166
|
label: i.summaryDocumentType,
|
|
@@ -22,7 +22,7 @@ function o({ selectedReceivableId: o, enabled: s = !0, messages: c }) {
|
|
|
22
22
|
receivable: l.data,
|
|
23
23
|
history: u.data?.data ?? [],
|
|
24
24
|
mails: d.data?.data ?? [],
|
|
25
|
-
pdfUrl: f.data?.file_url || f.data?.original_file_url,
|
|
25
|
+
pdfUrl: f.data?.file_url || f.data?.original_file_url || void 0,
|
|
26
26
|
messages: c
|
|
27
27
|
}), [
|
|
28
28
|
l.data,
|
|
@@ -33,7 +33,7 @@ function o({ unitNamesById: o }) {
|
|
|
33
33
|
c(t), f(void 0);
|
|
34
34
|
}, [s]), D = n((e) => {
|
|
35
35
|
u(e), f(void 0);
|
|
36
|
-
}, []), O = n(() => f(C.data?.next_pagination_token), [C.data?.next_pagination_token]), k = n(() => f(C.data?.prev_pagination_token), [C.data?.prev_pagination_token]), A = n(() => {
|
|
36
|
+
}, []), O = n(() => f(C.data?.next_pagination_token ?? void 0), [C.data?.next_pagination_token]), k = n(() => f(C.data?.prev_pagination_token ?? void 0), [C.data?.prev_pagination_token]), A = n(() => {
|
|
37
37
|
C.refetch();
|
|
38
38
|
}, [C]), j = n((e) => (t) => {
|
|
39
39
|
e(t), f(void 0);
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import "../../../util/dist/lib/apiErrors.js";
|
|
2
|
-
import {
|
|
3
|
-
import { CounterpartFormFields as t, CounterpartFormSheet as n } from "../../ui/dist/
|
|
4
|
-
import { BankAccountFormSheet as
|
|
5
|
-
import { AddressFormSheet as
|
|
6
|
-
import { ConfirmDeleteDialog as
|
|
2
|
+
import { AchFieldGroup as e } from "../../ui/dist/index5.js";
|
|
3
|
+
import { CounterpartFormFields as t, CounterpartFormSheet as n, useFocusFirstInvalidField as r } from "../../ui/dist/index9.js";
|
|
4
|
+
import { BankAccountFormSheet as i } from "../../ui/dist/index11.js";
|
|
5
|
+
import { AddressFormSheet as a } from "../../ui/dist/index13.js";
|
|
6
|
+
import { ConfirmDeleteDialog as o } from "../../ui/dist/index14.js";
|
|
7
7
|
import "../../ui/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "../../data-access/dist/
|
|
11
|
-
import {
|
|
8
|
+
import { COUNTERPART_MESSAGE_LABELS_EN as s } from "./lib/labels.js";
|
|
9
|
+
import { buildAnalyticsMap as c, buildCounterpartRows as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as d, formatCounterpartDate as f, formatMoney as p, getAchInstructions as m, getCounterpartEmail as h, getCounterpartName as g, getPayableAchInstructions as _, hasAchFormValues as v, hasSelectedText as y, resolveCounterpartBankAccountWrite as b, validateAchFormValues as x } from "./lib/helpers.js";
|
|
10
|
+
import { useCounterpartsQuery as S } from "../../data-access/dist/index3.js";
|
|
11
|
+
import { useCreateCounterpartBankAccountMutation as C, useUpdateCounterpartBankAccountMutation as w } from "../../data-access/dist/index5.js";
|
|
12
|
+
import { useCounterpartAddressesForRowsQuery as T, useCounterpartAddressesQuery as E } from "../../data-access/dist/index7.js";
|
|
12
13
|
import "../../data-access/dist/index.js";
|
|
13
|
-
import { useAddressForm as
|
|
14
|
-
import { useCounterpartDetails as
|
|
15
|
-
import { useCounterpartForm as
|
|
14
|
+
import { useAddressForm as D } from "./lib/useAddressForm.js";
|
|
15
|
+
import { useCounterpartDetails as O } from "./lib/useCounterpartDetails.js";
|
|
16
|
+
import { useCounterpartForm as k } from "./lib/useCounterpartForm.js";
|
|
16
17
|
import "./lib/useCounterpartSelector.js";
|
|
17
|
-
import { CounterpartSelector as
|
|
18
|
-
import { useDeleteController as
|
|
18
|
+
import { CounterpartSelector as A } from "./lib/CounterpartSelector.js";
|
|
19
|
+
import { useDeleteController as j } from "./lib/useDeleteController.js";
|
|
19
20
|
import "./lib/useSubEntityForm.js";
|
|
20
|
-
import { useBankAccountForm as
|
|
21
|
-
export {
|
|
21
|
+
import { useBankAccountForm as M } from "./lib/subEntityForms.js";
|
|
22
|
+
export { e as AchFieldGroup, a as AddressFormSheet, i as BankAccountFormSheet, s as COUNTERPART_MESSAGE_LABELS_EN, o as ConfirmDeleteDialog, t as CounterpartFormFields, n as CounterpartFormSheet, A as CounterpartSelector, c as buildAnalyticsMap, l as buildCounterpartRows, u as counterpartFormBankAccountToCreatePayload, d as counterpartFormBankAccountToUpdatePayload, f as formatCounterpartDate, p as formatMoney, m as getAchInstructions, h as getCounterpartEmail, g as getCounterpartName, _ as getPayableAchInstructions, v as hasAchFormValues, y as hasSelectedText, b as resolveCounterpartBankAccountWrite, D as useAddressForm, M as useBankAccountForm, T as useCounterpartAddressesForRowsQuery, E as useCounterpartAddressesQuery, O as useCounterpartDetails, k as useCounterpartForm, S as useCounterpartsQuery, C as useCreateCounterpartBankAccountMutation, j as useDeleteController, r as useFocusFirstInvalidField, w as useUpdateCounterpartBankAccountMutation, x as validateAchFormValues };
|