@tesouro/embedded-components-react 0.7.28 → 0.7.30
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.d.ts +1 -12
- package/dist/lib/CounterpartsWidget.d.ts +1 -12
- package/dist/lib/CounterpartsWidgetPublic.d.ts +1 -12
- package/dist/lib/CustomersWidget.d.ts +0 -2
- package/dist/lib/ReceivablesWidget.d.ts +0 -2
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +59 -38
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +137 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +86 -182
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +116 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +51 -108
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useRebaseOnRefresh.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +40 -39
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +2 -65
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +37 -181
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +193 -502
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +520 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +31 -55
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +98 -163
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +37 -32
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +86 -93
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +42 -173
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +3 -12
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +117 -125
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -6,119 +6,62 @@ import { getStateOptions as e } from "../../../../../shared/util/dist/lib/usStat
|
|
|
6
6
|
import { useWidgetConfig as t, useWidgetError as n, useWidgetLoading as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
7
7
|
import "../../../../../shared/feature/dist/index.js";
|
|
8
8
|
import { COUNTERPART_MESSAGE_LABELS_EN as i } from "../../../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
9
|
-
import {
|
|
10
|
-
import { useAddressForm as c } from "../../../../../shared/counterpart-management/feature/dist/lib/useAddressForm.js";
|
|
11
|
-
import { useCounterpartForm as l } from "../../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
12
|
-
import { useDeleteController as u } from "../../../../../shared/counterpart-management/feature/dist/lib/useDeleteController.js";
|
|
13
|
-
import { useBankAccountForm as d } from "../../../../../shared/counterpart-management/feature/dist/lib/subEntityForms.js";
|
|
9
|
+
import { hasSelectedText as a } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
14
10
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
15
|
-
import { getCounterpartPermissions as
|
|
16
|
-
import {
|
|
17
|
-
import { useCounterpartDetailsSheetView as m } from "./useCounterpartDetailsSheetView.js";
|
|
18
|
-
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as h } from "../../../../ui/dist/index2.js";
|
|
11
|
+
import { getCounterpartPermissions as o } from "./permissions.js";
|
|
12
|
+
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as s } from "../../../../ui/dist/index2.js";
|
|
19
13
|
import "../../../../ui/dist/index.js";
|
|
20
|
-
import {
|
|
14
|
+
import { useCounterpartsTable as c } from "./useCounterpartsTable.js";
|
|
15
|
+
import { useCounterpartDetailsActions as l } from "./useCounterpartDetailsActions.js";
|
|
16
|
+
import { useCounterpartDetailsSheetView as u } from "./useCounterpartDetailsSheetView.js";
|
|
17
|
+
import { useCallback as d, useEffect as f, useMemo as p, useState as m } from "react";
|
|
21
18
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
line2: "",
|
|
25
|
-
city: "",
|
|
26
|
-
state: "",
|
|
27
|
-
postalCode: ""
|
|
28
|
-
};
|
|
29
|
-
function x(e, t) {
|
|
30
|
-
return e.line1 === t.line1 && e.line2 === t.line2 && e.city === t.city && e.state === t.state && e.postalCode === t.postalCode;
|
|
31
|
-
}
|
|
32
|
-
function S({ counterpartType: S, detailsLabels: C, messageLabels: w }) {
|
|
33
|
-
let { initResponse: T, widgetToken: E } = t(), D = r(), O = n(), k = v(() => ({
|
|
19
|
+
function h({ counterpartType: h, detailsLabels: g, messageLabels: _ }) {
|
|
20
|
+
let { initResponse: v, widgetToken: y } = t(), b = r(), x = n(), S = p(() => ({
|
|
34
21
|
...i,
|
|
35
|
-
...
|
|
36
|
-
}), [
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
}), [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
let
|
|
44
|
-
isCustomer:
|
|
45
|
-
enabled:
|
|
46
|
-
messages:
|
|
47
|
-
}), { details:
|
|
48
|
-
selectedId:
|
|
49
|
-
isCustomer:
|
|
50
|
-
enabled:
|
|
51
|
-
detailsText:
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
includeBankAccount: L === "create"
|
|
62
|
-
}), W = d({
|
|
63
|
-
items: V.bankAccounts,
|
|
64
|
-
selectedId: z,
|
|
65
|
-
messages: k
|
|
66
|
-
}), G = c({
|
|
67
|
-
selectedId: z,
|
|
68
|
-
primaryAddress: V.primaryAddress,
|
|
69
|
-
messages: k
|
|
70
|
-
}), K = u({
|
|
71
|
-
selectedId: z,
|
|
72
|
-
setSelectedId: I,
|
|
73
|
-
detailsView: V.detailsView,
|
|
74
|
-
messages: k
|
|
75
|
-
}), q = v(() => {
|
|
76
|
-
if (!V.counterpart) return !1;
|
|
77
|
-
let e = o(V.counterpart, V.primaryAddress), t = U.values;
|
|
78
|
-
return t.legalName !== e.legalName || t.firstName !== e.firstName || t.lastName !== e.lastName || t.email !== e.email || t.phone !== e.phone || t.taxId !== e.taxId || t.remindersEnabled !== e.remindersEnabled || !j && !x(t.address, e.address);
|
|
79
|
-
}, [
|
|
80
|
-
V.counterpart,
|
|
81
|
-
V.primaryAddress,
|
|
82
|
-
U.values,
|
|
83
|
-
j
|
|
84
|
-
]), J = v(() => !x(G.values, V.primaryAddress ? a(V.primaryAddress) : b), [G.values, V.primaryAddress]), { close: Y } = G, { openEdit: X, setValues: Z } = U;
|
|
22
|
+
..._
|
|
23
|
+
}), [_]), C = p(() => ({
|
|
24
|
+
...s,
|
|
25
|
+
...g
|
|
26
|
+
}), [g]), w = h === "customer", T = p(() => e(), []), E = p(() => o(v?.scopes), [v?.scopes]), D = !(!y || v || x) || b && !v, [O, k] = m(), [A, j] = m("none"), M = E.canRead ? O : void 0;
|
|
27
|
+
f(() => {
|
|
28
|
+
E.canRead || (k(void 0), j("none"));
|
|
29
|
+
}, [E.canRead]);
|
|
30
|
+
let N = c({
|
|
31
|
+
isCustomer: w,
|
|
32
|
+
enabled: E.canRead,
|
|
33
|
+
messages: S
|
|
34
|
+
}), { details: P, detailsSheetView: F } = u({
|
|
35
|
+
selectedId: M,
|
|
36
|
+
isCustomer: w,
|
|
37
|
+
enabled: E.canRead,
|
|
38
|
+
detailsText: C
|
|
39
|
+
}), I = l({
|
|
40
|
+
counterpartType: h,
|
|
41
|
+
selectedId: M,
|
|
42
|
+
setSelectedId: k,
|
|
43
|
+
view: A,
|
|
44
|
+
setView: j,
|
|
45
|
+
details: P,
|
|
46
|
+
messages: S
|
|
47
|
+
}), { closeAddress: L } = I;
|
|
85
48
|
return {
|
|
86
|
-
stateOptions:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
N.canRead && !s() && (Y(), I(e.id), R("none"));
|
|
102
|
-
}, [N.canRead, Y]),
|
|
103
|
-
closeDetails: g(() => {
|
|
104
|
-
Y(), I(void 0);
|
|
105
|
-
}, [Y]),
|
|
106
|
-
handleEditProfile: g(() => {
|
|
107
|
-
if (!j) {
|
|
108
|
-
Y(), X();
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
X(), Z((e) => ({
|
|
112
|
-
...e,
|
|
113
|
-
address: b
|
|
114
|
-
}));
|
|
115
|
-
}, [
|
|
116
|
-
Y,
|
|
117
|
-
X,
|
|
118
|
-
Z,
|
|
119
|
-
j
|
|
120
|
-
])
|
|
49
|
+
stateOptions: T,
|
|
50
|
+
selectedId: M,
|
|
51
|
+
view: A,
|
|
52
|
+
table: N,
|
|
53
|
+
details: P,
|
|
54
|
+
detailsSheetView: F,
|
|
55
|
+
permissions: E,
|
|
56
|
+
isPermissionLoading: D,
|
|
57
|
+
actions: I,
|
|
58
|
+
handleRowClick: d((e) => {
|
|
59
|
+
E.canRead && !a() && (L(), k(e.id), j("none"));
|
|
60
|
+
}, [E.canRead, L]),
|
|
61
|
+
closeDetails: d(() => {
|
|
62
|
+
L(), k(void 0);
|
|
63
|
+
}, [L])
|
|
121
64
|
};
|
|
122
65
|
}
|
|
123
66
|
//#endregion
|
|
124
|
-
export {
|
|
67
|
+
export { h as useCounterpartsWidget };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useState as e } from "react";
|
|
6
|
+
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useRebaseOnRefresh.js
|
|
7
|
+
function t(e) {
|
|
8
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
9
|
+
}
|
|
10
|
+
function n(e, r) {
|
|
11
|
+
return e === r ? !0 : !t(e) || !t(r) ? !1 : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(r)])].every((t) => n(e[t], r[t]));
|
|
12
|
+
}
|
|
13
|
+
function r(e, i, a) {
|
|
14
|
+
if (t(e) && t(i) && t(a)) {
|
|
15
|
+
let t = { ...e };
|
|
16
|
+
for (let n of Object.keys(a)) t[n] = r(e[n], i[n], a[n]);
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
return n(e, i) ? a : e;
|
|
20
|
+
}
|
|
21
|
+
function i(e, t, n) {
|
|
22
|
+
return r(e, t, n);
|
|
23
|
+
}
|
|
24
|
+
function a({ open: t, seed: r, setValues: a }) {
|
|
25
|
+
let [o, s] = e(void 0), c = t ? r : void 0;
|
|
26
|
+
if (!c || !o) {
|
|
27
|
+
o !== c && s(c);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
n(o, c) || (s(c), a((e) => i(e, o, c)));
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { i as rebaseFormValues, a as useRebaseOnRefresh };
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { formatMoney as e } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
1
|
+
import { formatMoney as e, isAchCompatibleBankAccount as t } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
2
2
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
3
3
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js
|
|
4
|
-
function
|
|
4
|
+
function n(e) {
|
|
5
5
|
if (!e) return "";
|
|
6
6
|
let t = [...e], n = t.flatMap((e, t) => /\d/.test(e) ? [t] : []);
|
|
7
7
|
if (n.length <= 4) return "••••";
|
|
8
8
|
let r = /* @__PURE__ */ new Set([...n.slice(0, 2), ...n.slice(-2)]);
|
|
9
9
|
return t.map((e, t) => /\d/.test(e) && !r.has(t) ? "•" : e).join("");
|
|
10
10
|
}
|
|
11
|
-
var
|
|
11
|
+
var r = /* @__PURE__ */ new Set([
|
|
12
12
|
"new",
|
|
13
13
|
"approve_in_progress",
|
|
14
14
|
"waiting_to_be_paid",
|
|
15
15
|
"partially_paid"
|
|
16
16
|
]);
|
|
17
|
-
function
|
|
18
|
-
if (!t || !e || !
|
|
19
|
-
let
|
|
20
|
-
|
|
17
|
+
function i(e, t) {
|
|
18
|
+
if (!t || !e || !r.has(e)) return !1;
|
|
19
|
+
let n = /* @__PURE__ */ new Date();
|
|
20
|
+
n.setUTCHours(0, 0, 0, 0);
|
|
21
21
|
let i = new Date(t);
|
|
22
|
-
return i.setUTCHours(0, 0, 0, 0), i.getTime() <
|
|
22
|
+
return i.setUTCHours(0, 0, 0, 0), i.getTime() < n.getTime();
|
|
23
23
|
}
|
|
24
|
-
var
|
|
24
|
+
var a = {
|
|
25
25
|
draft: ["billStatusDraft", "billNeutral"],
|
|
26
26
|
new: ["billStatusReadyToSubmit", "billAccent"],
|
|
27
27
|
approve_in_progress: ["billStatusPendingApproval", "billInfo"],
|
|
@@ -30,7 +30,7 @@ var i = {
|
|
|
30
30
|
paid: ["billStatusPaid", "billSettled"],
|
|
31
31
|
canceled: ["billStatusCanceled", "billNeutral"],
|
|
32
32
|
rejected: ["billStatusRejected", "billDanger"]
|
|
33
|
-
},
|
|
33
|
+
}, o = {
|
|
34
34
|
draft: ["receivableStatusDraft", "invoiceNeutral"],
|
|
35
35
|
recurring: ["receivableStatusRecurring", "invoiceNeutral"],
|
|
36
36
|
issuing: ["receivableStatusIssuing", "invoiceCyan"],
|
|
@@ -46,53 +46,54 @@ var i = {
|
|
|
46
46
|
declined: ["receivableStatusDeclined", "invoiceDanger"],
|
|
47
47
|
deleted: ["receivableStatusDeleted", "invoiceDanger"]
|
|
48
48
|
};
|
|
49
|
-
function
|
|
50
|
-
let [r,
|
|
49
|
+
function s(e, t, n) {
|
|
50
|
+
let [r, i] = (t === "bill" ? a : o)[e ?? ""] ?? ["receivableStatusUnknown", t === "bill" ? "billNeutral" : "invoiceNeutral"];
|
|
51
51
|
return {
|
|
52
52
|
statusLabel: n[r],
|
|
53
|
-
statusTone:
|
|
53
|
+
statusTone: i
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
var
|
|
56
|
+
var c = new Intl.DateTimeFormat(void 0, {
|
|
57
57
|
day: "2-digit",
|
|
58
58
|
month: "short",
|
|
59
59
|
year: "numeric"
|
|
60
60
|
});
|
|
61
|
-
function
|
|
61
|
+
function l(e) {
|
|
62
62
|
if (!e) return "";
|
|
63
63
|
let t = new Date(e);
|
|
64
|
-
return Number.isNaN(t.getTime()) ? "" :
|
|
64
|
+
return Number.isNaN(t.getTime()) ? "" : c.format(t);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function u(t, n, r) {
|
|
67
67
|
return (t ?? []).map((t) => {
|
|
68
|
-
let a = t.status ?? void 0,
|
|
68
|
+
let a = t.status ?? void 0, o = n === "bill" && i(a, t.due_date), c = s(a, n, r);
|
|
69
69
|
return {
|
|
70
70
|
id: t.id,
|
|
71
71
|
amountLabel: e(t.total_amount ?? 0, t.currency ?? void 0),
|
|
72
|
-
dateLabel:
|
|
73
|
-
...
|
|
74
|
-
isOverdue:
|
|
72
|
+
dateLabel: l(t.issued_at ?? t.issue_date ?? t.created_at),
|
|
73
|
+
...c,
|
|
74
|
+
isOverdue: o
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function d(e) {
|
|
79
79
|
return e ? `•••• ${e.slice(-4)}` : "";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
function f(e, n) {
|
|
82
|
+
let r = e?.find(t);
|
|
83
|
+
if (r) return {
|
|
84
|
+
id: r.id,
|
|
85
|
+
title: n,
|
|
86
|
+
accountHolderLabel: r.account_holder_name ?? "",
|
|
87
|
+
accountNumberLabel: d(r.account_number),
|
|
88
|
+
routingNumberLabel: r.routing_number ?? "",
|
|
89
|
+
isIncomplete: !(r.account_holder_name && r.account_number && r.routing_number)
|
|
89
90
|
};
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function p(e, t) {
|
|
92
93
|
if (!t) return e;
|
|
93
94
|
let n = t.address;
|
|
94
95
|
return {
|
|
95
|
-
...
|
|
96
|
+
...h({
|
|
96
97
|
editingAddressHeading: t.title,
|
|
97
98
|
addingAddressHeading: t.title,
|
|
98
99
|
cancelButton: t.cancelButton,
|
|
@@ -109,21 +110,21 @@ function f(e, t) {
|
|
|
109
110
|
...e
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
+
function m(e) {
|
|
113
114
|
return e ? {
|
|
114
115
|
fieldMarkers: e.fieldMarkers,
|
|
115
116
|
addressFieldMarkers: e.address?.fieldMarkers,
|
|
116
117
|
requiredFieldsLegend: e.requiredFieldsLegend
|
|
117
118
|
} : {};
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function h(e) {
|
|
120
121
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
+
function g(e) {
|
|
123
124
|
if (!e) return {};
|
|
124
125
|
let t = e.address;
|
|
125
126
|
return {
|
|
126
|
-
labels:
|
|
127
|
+
labels: h({
|
|
127
128
|
editingCustomerDetailsHeading: e.editTitleCustomer,
|
|
128
129
|
editingVendorDetailsHeading: e.editTitleVendor,
|
|
129
130
|
firstNameLabel: e.firstNameLabel,
|
|
@@ -155,7 +156,7 @@ function h(e) {
|
|
|
155
156
|
requiredFieldsLegend: e.requiredFieldsLegend
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
|
-
var
|
|
159
|
+
var _ = {
|
|
159
160
|
firstName: "firstName",
|
|
160
161
|
lastName: "lastName",
|
|
161
162
|
businessName: "legalName",
|
|
@@ -163,7 +164,7 @@ var g = {
|
|
|
163
164
|
phone: "phone",
|
|
164
165
|
taxId: "taxId"
|
|
165
166
|
};
|
|
166
|
-
function
|
|
167
|
+
function v(e, t, n, r) {
|
|
167
168
|
let i = e === "vendor", a = t.entityType === "individual";
|
|
168
169
|
return {
|
|
169
170
|
heading: i ? r.editingVendorDetailsHeading : r.editingCustomerDetailsHeading,
|
|
@@ -209,4 +210,4 @@ function _(e, t, n, r) {
|
|
|
209
210
|
};
|
|
210
211
|
}
|
|
211
212
|
//#endregion
|
|
212
|
-
export {
|
|
213
|
+
export { _ as EDIT_FORM_FIELD_KEYS, m as addressFormLabelOverrides, v as buildCounterpartEditFormView, f as buildPaymentMethodView, u as buildRecentDocumentRows, g as editFormLabelOverrides, l as formatDetailsDate, n as maskTaxId, p as withAddressLabelOverrides };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as e } from "./index2.js";
|
|
2
2
|
import { CounterpartsScreen as t } from "./index3.js";
|
|
3
|
-
import { CounterpartDetailsSheet as n } from "./
|
|
3
|
+
import { CounterpartDetailsSheet as n } from "./index7.js";
|
|
4
4
|
export { e as COUNTERPART_DETAILS_SHEET_LABELS_EN, n as CounterpartDetailsSheet, t as CounterpartsScreen };
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { Button as e, LABEL_LABELS_EN as t, RequiredFieldsLegend as n, Spinner as r, Typography as i, mergeRequiredFieldsLegendLabels as a } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import { CounterpartAddressFields as o } from "../../../shared/counterpart-management/ui/dist/index7.js";
|
|
3
|
-
import "../../../shared/counterpart-management/ui/dist/index.js";
|
|
4
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
1
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js
|
|
6
|
-
function
|
|
2
|
+
function e(e, t) {
|
|
7
3
|
return {
|
|
8
4
|
line1: e.streetAddressLabel,
|
|
9
5
|
line2: e.addressLine2Label,
|
|
@@ -16,64 +12,5 @@ function l(e, t) {
|
|
|
16
12
|
fieldMarkers: t
|
|
17
13
|
};
|
|
18
14
|
}
|
|
19
|
-
function u({ form: u, labels: d }) {
|
|
20
|
-
let f = {
|
|
21
|
-
...t,
|
|
22
|
-
...u.fieldMarkers
|
|
23
|
-
};
|
|
24
|
-
return /* @__PURE__ */ c("form", {
|
|
25
|
-
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-[10px] ttw:border ttw:border-border ttw:bg-muted ttw:p-4",
|
|
26
|
-
onSubmit: (e) => {
|
|
27
|
-
e.preventDefault(), u.onSubmit();
|
|
28
|
-
},
|
|
29
|
-
children: [/* @__PURE__ */ c("div", {
|
|
30
|
-
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ s("div", {
|
|
33
|
-
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3 ttw:border-b ttw:border-border ttw:pt-6 ttw:pb-7",
|
|
34
|
-
children: /* @__PURE__ */ s(i, {
|
|
35
|
-
variant: "body1",
|
|
36
|
-
className: "ttw:font-medium",
|
|
37
|
-
children: u.hasExistingAddress ? d.editingAddressHeading : d.addingAddressHeading
|
|
38
|
-
})
|
|
39
|
-
}),
|
|
40
|
-
/* @__PURE__ */ s(n, { labels: a(f, u.requiredFieldsLegend) }),
|
|
41
|
-
u.formError && /* @__PURE__ */ s(i, {
|
|
42
|
-
variant: "body2",
|
|
43
|
-
color: "destructive",
|
|
44
|
-
role: "alert",
|
|
45
|
-
children: u.formError
|
|
46
|
-
}),
|
|
47
|
-
/* @__PURE__ */ s(o, {
|
|
48
|
-
idPrefix: "counterpart-address-form",
|
|
49
|
-
values: u.values,
|
|
50
|
-
errors: u.errors,
|
|
51
|
-
stateOptions: u.stateOptions,
|
|
52
|
-
disabled: u.inProgress,
|
|
53
|
-
onChange: u.onChange,
|
|
54
|
-
labels: l(d, {
|
|
55
|
-
...f,
|
|
56
|
-
...u.addressFieldMarkers
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
]
|
|
60
|
-
}), /* @__PURE__ */ c("div", {
|
|
61
|
-
className: "ttw:flex ttw:justify-end ttw:gap-4 ttw:pt-6",
|
|
62
|
-
children: [/* @__PURE__ */ s(e, {
|
|
63
|
-
type: "button",
|
|
64
|
-
variant: "outline",
|
|
65
|
-
className: "ttw:w-fit ttw:border-border",
|
|
66
|
-
disabled: u.inProgress,
|
|
67
|
-
onClick: u.onCancel,
|
|
68
|
-
children: d.cancelButton
|
|
69
|
-
}), /* @__PURE__ */ c(e, {
|
|
70
|
-
type: "submit",
|
|
71
|
-
className: "ttw:w-fit",
|
|
72
|
-
disabled: u.inProgress || u.submitDisabled,
|
|
73
|
-
children: [u.inProgress && /* @__PURE__ */ s(r, {}), d.saveButton]
|
|
74
|
-
})]
|
|
75
|
-
})]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
15
|
//#endregion
|
|
79
|
-
export {
|
|
16
|
+
export { e as addressFieldLabels };
|