@tesouro/embedded-components-react 0.11.65 → 0.11.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -28
- package/dist/index.css +6 -27
- package/dist/index.d.ts +29 -41
- package/dist/lib/CardDetailsWidget.d.ts +1 -1
- package/dist/lib/CounterpartsWidget.d.ts +26 -39
- package/dist/lib/CounterpartsWidgetPublic.d.ts +26 -39
- package/dist/lib/CreditCardsWidget.d.ts +2 -2
- package/dist/lib/CustomersWidget.d.ts +26 -39
- package/dist/lib/DebitCardsWidget.d.ts +2 -2
- package/dist/lib/ReceivablesWidget.d.ts +14 -4
- package/dist/lib/WidgetSuite.d.ts +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +37 -39
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +72 -73
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +16 -22
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +8 -12
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +93 -110
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +52 -52
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +72 -107
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +27 -27
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +112 -145
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +13 -16
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +3 -122
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +5 -5
- 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/index2.js +44 -65
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +157 -134
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +18 -14
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +362 -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 +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +16 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +2 -66
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +48 -46
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +138 -149
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +19 -20
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +21 -27
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index3.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +30 -63
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +0 -211
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -509
|
@@ -2,167 +2,134 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import "../../../../../shared/
|
|
7
|
-
import {
|
|
8
|
-
import { useCounterpartsQuery as i } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
9
|
-
import { useCounterpartAddressesForRowsQuery as a } from "../../../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
5
|
+
import { buildAnalyticsMap as e, buildCounterpartRows as t } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
6
|
+
import { useCounterpartsQuery as n } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
7
|
+
import { useCounterpartAddressesForRowsQuery as r } from "../../../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
10
8
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
11
|
-
import { PAGE_SIZE_OPTIONS as
|
|
12
|
-
import { usePayablesAnalyticsByCounterpartQuery as
|
|
9
|
+
import { PAGE_SIZE_OPTIONS as i, PAYABLES_BILLED_STATUSES as a, PAYABLES_OWED_STATUSES as o, RECEIVABLES_BILLED_STATUSES as s, RECEIVABLES_DUE_STATUSES as c, TYPE_FILTER_OPTIONS as ee } from "./constants.js";
|
|
10
|
+
import { usePayablesAnalyticsByCounterpartQuery as l, useReceivablesAnalyticsByCounterpartQuery as u } from "../../../../data-access/dist/index2.js";
|
|
13
11
|
import "../../../../data-access/dist/index.js";
|
|
14
|
-
import { useCallback as
|
|
12
|
+
import { useCallback as d, useEffect as f, useMemo as p, useState as m } from "react";
|
|
15
13
|
// ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function _({ isCustomer: _, enabled: v = !0, pageSizeOptions: y = o, messages: b, labels: x }) {
|
|
21
|
-
let [S, C] = h([]), [w, ne] = h(y[0] ?? 10), [re, T] = h(), [E, D] = h(""), [O, k] = h(""), [A, j] = h([]), M = A.length === 1 ? A[0] : void 0, N = t();
|
|
22
|
-
p(() => {
|
|
23
|
-
if (E === O) return;
|
|
14
|
+
function h({ isCustomer: h, enabled: g = !0, pageSizeOptions: _ = i, labels: v }) {
|
|
15
|
+
let [y, b] = m([]), [x, S] = m(_[0] ?? 10), [C, w] = m(), [T, E] = m(""), [D, O] = m(""), [k, A] = m(""), j = k || void 0;
|
|
16
|
+
f(() => {
|
|
17
|
+
if (T === D) return;
|
|
24
18
|
let e = setTimeout(() => {
|
|
25
|
-
|
|
19
|
+
O(T), w(void 0);
|
|
26
20
|
}, 400);
|
|
27
21
|
return () => clearTimeout(e);
|
|
28
|
-
}, [
|
|
29
|
-
let
|
|
30
|
-
sort:
|
|
31
|
-
order:
|
|
32
|
-
limit:
|
|
33
|
-
pagination_token:
|
|
34
|
-
counterpart_name__icontains:
|
|
35
|
-
type:
|
|
36
|
-
...
|
|
37
|
-
enabled:
|
|
38
|
-
}),
|
|
39
|
-
counterpartIds:
|
|
40
|
-
enabled:
|
|
41
|
-
}),
|
|
22
|
+
}, [T, D]);
|
|
23
|
+
let M = y[0], N = n({
|
|
24
|
+
sort: M ? "counterpart_name" : void 0,
|
|
25
|
+
order: M ? M.desc ? "desc" : "asc" : void 0,
|
|
26
|
+
limit: x,
|
|
27
|
+
pagination_token: C,
|
|
28
|
+
counterpart_name__icontains: D || void 0,
|
|
29
|
+
type: j,
|
|
30
|
+
...h ? { is_customer: !0 } : { is_vendor: !0 },
|
|
31
|
+
enabled: g
|
|
32
|
+
}), P = p(() => N.data?.data.map((e) => e.id) ?? [], [N.data?.data]), F = P.length > 0, I = r({
|
|
33
|
+
counterpartIds: P,
|
|
34
|
+
enabled: g && F
|
|
35
|
+
}), L = u({
|
|
42
36
|
type: "invoice",
|
|
43
37
|
statusIn: [...s],
|
|
44
|
-
counterpartIdIn:
|
|
45
|
-
enabled:
|
|
46
|
-
}),
|
|
38
|
+
counterpartIdIn: P,
|
|
39
|
+
enabled: g && h && F
|
|
40
|
+
}), R = u({
|
|
47
41
|
metric: "amount_due",
|
|
48
42
|
type: "invoice",
|
|
49
43
|
statusIn: [...c],
|
|
50
|
-
counterpartIdIn:
|
|
51
|
-
enabled:
|
|
52
|
-
}),
|
|
53
|
-
statusIn: [...
|
|
54
|
-
counterpartIdIn:
|
|
55
|
-
enabled:
|
|
56
|
-
}),
|
|
44
|
+
counterpartIdIn: P,
|
|
45
|
+
enabled: g && h && F
|
|
46
|
+
}), z = l({
|
|
47
|
+
statusIn: [...a],
|
|
48
|
+
counterpartIdIn: P,
|
|
49
|
+
enabled: g && !h && F
|
|
50
|
+
}), B = l({
|
|
57
51
|
metric: "amount_due",
|
|
58
|
-
statusIn: [...
|
|
59
|
-
counterpartIdIn:
|
|
60
|
-
enabled:
|
|
61
|
-
}),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
]),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
]),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
isDueOrOwedAmountLoading: W === void 0,
|
|
84
|
-
isBilledAmountError: K,
|
|
85
|
-
isDueOrOwedAmountError: q
|
|
86
|
-
}).map((e) => {
|
|
87
|
-
let t = (U?.get(e.id) ?? 0) - (W?.get(e.id) ?? 0);
|
|
88
|
-
return {
|
|
89
|
-
...e,
|
|
90
|
-
name: e.name || x.unnamedCounterpart,
|
|
91
|
-
isReceivedOrPaidPositive: t > 0
|
|
92
|
-
};
|
|
93
|
-
}), [
|
|
94
|
-
F.data?.data,
|
|
95
|
-
G,
|
|
52
|
+
statusIn: [...o],
|
|
53
|
+
counterpartIdIn: P,
|
|
54
|
+
enabled: g && !h && F
|
|
55
|
+
}), V = p(() => h ? L.data ? e(L.data.data) : void 0 : z.data ? e(z.data.data) : void 0, [
|
|
56
|
+
h,
|
|
57
|
+
L.data,
|
|
58
|
+
z.data
|
|
59
|
+
]), H = p(() => h ? R.data ? e(R.data.data) : void 0 : B.data ? e(B.data.data) : void 0, [
|
|
60
|
+
h,
|
|
61
|
+
R.data,
|
|
62
|
+
B.data
|
|
63
|
+
]), U = p(() => new Map(P.map((e, t) => [e, I[t]?.data?.data?.[0]])), [P, I]), W = h ? L.isError : z.isError, G = h ? R.isError : B.isError, K = p(() => t({
|
|
64
|
+
counterparts: N.data?.data ?? [],
|
|
65
|
+
addresses: U,
|
|
66
|
+
billedAmounts: V,
|
|
67
|
+
dueOrOwedAmounts: H,
|
|
68
|
+
isBilledAmountLoading: V === void 0,
|
|
69
|
+
isDueOrOwedAmountLoading: H === void 0,
|
|
70
|
+
isBilledAmountError: W,
|
|
71
|
+
isDueOrOwedAmountError: G
|
|
72
|
+
}).map((e) => ({
|
|
73
|
+
...e,
|
|
74
|
+
name: e.name || v.unnamedCounterpart
|
|
75
|
+
})), [
|
|
76
|
+
N.data?.data,
|
|
96
77
|
U,
|
|
78
|
+
V,
|
|
79
|
+
H,
|
|
97
80
|
W,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
]), Y = m(() => l.map((e) => ({
|
|
81
|
+
G,
|
|
82
|
+
v.unnamedCounterpart
|
|
83
|
+
]), q = p(() => ee.map((e) => ({
|
|
102
84
|
value: e,
|
|
103
|
-
label: e === "individual" ?
|
|
104
|
-
})), [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
searchValue: E,
|
|
134
|
-
onSearchChange: D,
|
|
135
|
-
isPopoverOpen: N.isMenuOpen || !!N.activePanelId,
|
|
136
|
-
isMenuOpen: N.isMenuOpen,
|
|
137
|
-
isTypePanelOpen: N.activePanelId === g.Type,
|
|
138
|
-
onMenuToggle: N.toggleMenu,
|
|
139
|
-
onPopoverClose: () => {
|
|
140
|
-
N.closeMenu(), N.closePanel();
|
|
141
|
-
},
|
|
142
|
-
onTypeFieldSelect: () => N.openPanel(g.Type),
|
|
143
|
-
activeFilterCount: X.length,
|
|
144
|
-
chips: X,
|
|
145
|
-
onRemoveChip: le,
|
|
146
|
-
onClearAll: ue,
|
|
147
|
-
typeOptions: Y,
|
|
148
|
-
selectedTypes: A,
|
|
149
|
-
onTypeChange: Q
|
|
85
|
+
label: e === "individual" ? v.entityFilterIndividual : v.entityFilterOrganization
|
|
86
|
+
})), [v.entityFilterIndividual, v.entityFilterOrganization]), J = !!(D || j), Y = d((e) => {
|
|
87
|
+
b((t) => typeof e == "function" ? e(t) : e), w(void 0);
|
|
88
|
+
}, []), X = d((e) => {
|
|
89
|
+
S(e), w(void 0);
|
|
90
|
+
}, []), Z = d(() => w(N.data?.next_pagination_token ?? void 0), [N.data?.next_pagination_token]), Q = d(() => w(N.data?.prev_pagination_token ?? void 0), [N.data?.prev_pagination_token]), te = d(() => {
|
|
91
|
+
N.refetch();
|
|
92
|
+
}, [N]), ne = d((e) => {
|
|
93
|
+
A(e), w(void 0);
|
|
94
|
+
}, []), $ = d(() => {
|
|
95
|
+
E(""), O(""), A(""), w(void 0);
|
|
96
|
+
}, []), re = d((e) => {
|
|
97
|
+
e === "search" ? (E(""), O("")) : e === "type" && A(""), w(void 0);
|
|
98
|
+
}, []), ie = h ? [L, R] : [z, B], ae = () => {
|
|
99
|
+
for (let e of ie) e.isError && e.refetch();
|
|
100
|
+
}, oe = {
|
|
101
|
+
searchValue: T,
|
|
102
|
+
onSearchChange: E,
|
|
103
|
+
typeOptions: q,
|
|
104
|
+
selectedType: k,
|
|
105
|
+
onTypeChange: ne,
|
|
106
|
+
chips: [...D ? [{
|
|
107
|
+
key: "search",
|
|
108
|
+
label: v.searchChip(D)
|
|
109
|
+
}] : [], ...k ? [{
|
|
110
|
+
key: "type",
|
|
111
|
+
label: v.typeChip(q.find((e) => e.value === k)?.label ?? k)
|
|
112
|
+
}] : []],
|
|
113
|
+
onRemoveChip: re,
|
|
114
|
+
onClearAll: $
|
|
150
115
|
};
|
|
151
116
|
return {
|
|
152
|
-
rows:
|
|
153
|
-
isLoading:
|
|
154
|
-
isError:
|
|
155
|
-
sorting:
|
|
156
|
-
onSortingChange:
|
|
157
|
-
pageSize:
|
|
158
|
-
onPageSizeChange:
|
|
159
|
-
hasNextPage: !!
|
|
160
|
-
hasPrevPage: !!
|
|
161
|
-
onNextPage:
|
|
162
|
-
onPrevPage:
|
|
163
|
-
filters:
|
|
164
|
-
isFiltering:
|
|
165
|
-
|
|
117
|
+
rows: K,
|
|
118
|
+
isLoading: N.isLoading,
|
|
119
|
+
isError: N.isError,
|
|
120
|
+
sorting: y,
|
|
121
|
+
onSortingChange: Y,
|
|
122
|
+
pageSize: x,
|
|
123
|
+
onPageSizeChange: X,
|
|
124
|
+
hasNextPage: !!N.data?.next_pagination_token,
|
|
125
|
+
hasPrevPage: !!N.data?.prev_pagination_token,
|
|
126
|
+
onNextPage: Z,
|
|
127
|
+
onPrevPage: Q,
|
|
128
|
+
filters: oe,
|
|
129
|
+
isFiltering: J,
|
|
130
|
+
isAmountsError: W || G,
|
|
131
|
+
onRetryAmounts: ae,
|
|
132
|
+
onRetry: te
|
|
166
133
|
};
|
|
167
134
|
}
|
|
168
|
-
export {
|
|
135
|
+
export { h as useCounterpartsTable };
|
|
@@ -41,22 +41,13 @@ function g({ counterpartType: g, pageSizeOptions: _, detailsLabels: v, messageLa
|
|
|
41
41
|
isCustomer: O,
|
|
42
42
|
enabled: j.canRead,
|
|
43
43
|
pageSizeOptions: _,
|
|
44
|
-
messages: T,
|
|
45
44
|
labels: D
|
|
46
45
|
}), { details: z, detailsSheetView: B } = d({
|
|
47
46
|
selectedId: L,
|
|
48
47
|
isCustomer: O,
|
|
49
48
|
enabled: j.canRead,
|
|
50
49
|
detailsText: E
|
|
51
|
-
})
|
|
52
|
-
counterpartType: g,
|
|
53
|
-
selectedId: L,
|
|
54
|
-
setSelectedId: P,
|
|
55
|
-
view: F,
|
|
56
|
-
setView: I,
|
|
57
|
-
details: z,
|
|
58
|
-
messages: T
|
|
59
|
-
}), { closeAddress: H } = V;
|
|
50
|
+
});
|
|
60
51
|
return {
|
|
61
52
|
stateOptions: A,
|
|
62
53
|
selectedId: L,
|
|
@@ -67,13 +58,19 @@ function g({ counterpartType: g, pageSizeOptions: _, detailsLabels: v, messageLa
|
|
|
67
58
|
detailsSheetView: B,
|
|
68
59
|
permissions: j,
|
|
69
60
|
isPermissionLoading: M,
|
|
70
|
-
actions:
|
|
61
|
+
actions: u({
|
|
62
|
+
counterpartType: g,
|
|
63
|
+
selectedId: L,
|
|
64
|
+
setSelectedId: P,
|
|
65
|
+
view: F,
|
|
66
|
+
setView: I,
|
|
67
|
+
details: z,
|
|
68
|
+
messages: T
|
|
69
|
+
}),
|
|
71
70
|
handleRowClick: f((e) => {
|
|
72
|
-
j.canRead && !a() && (
|
|
73
|
-
}, [j.canRead
|
|
74
|
-
closeDetails: f(() =>
|
|
75
|
-
H(), P(void 0);
|
|
76
|
-
}, [H])
|
|
71
|
+
j.canRead && !a() && (P(e.id), I("none"));
|
|
72
|
+
}, [j.canRead]),
|
|
73
|
+
closeDetails: f(() => P(void 0), [])
|
|
77
74
|
};
|
|
78
75
|
}
|
|
79
76
|
export { g as useCounterpartsWidget };
|
|
@@ -54,7 +54,7 @@ function c(a, o, s, c) {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
var l = new Intl.DateTimeFormat(void 0, {
|
|
57
|
-
day: "
|
|
57
|
+
day: "numeric",
|
|
58
58
|
month: "short",
|
|
59
59
|
year: "numeric"
|
|
60
60
|
});
|
|
@@ -66,6 +66,7 @@ function u(e) {
|
|
|
66
66
|
function d(e, t, n) {
|
|
67
67
|
return (e ?? []).map((e) => ({
|
|
68
68
|
id: e.id,
|
|
69
|
+
documentNumberLabel: e.document_id ?? void 0,
|
|
69
70
|
amountLabel: a(e.total_amount ?? 0, e.currency ?? void 0),
|
|
70
71
|
dateLabel: u(e.issued_at ?? e.issue_date ?? e.created_at),
|
|
71
72
|
...c(t, e.status ?? void 0, e.due_date, n)
|
|
@@ -85,124 +86,4 @@ function p(e, t) {
|
|
|
85
86
|
isIncomplete: !(n.account_holder_name && n.account_number && n.routing_number)
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
-
if (!t) return e;
|
|
90
|
-
let n = t.address;
|
|
91
|
-
return {
|
|
92
|
-
...g({
|
|
93
|
-
editingAddressHeading: t.title,
|
|
94
|
-
addingAddressHeading: t.title,
|
|
95
|
-
cancelButton: t.cancelButton,
|
|
96
|
-
saveButton: t.saveButton,
|
|
97
|
-
streetAddressLabel: n?.line1,
|
|
98
|
-
addressLine2Label: n?.line2,
|
|
99
|
-
cityLabel: n?.city,
|
|
100
|
-
stateLabel: n?.state,
|
|
101
|
-
statePlaceholder: n?.statePlaceholder,
|
|
102
|
-
postalCodeLabel: n?.postalCode,
|
|
103
|
-
countryLabel: n?.country,
|
|
104
|
-
countryUnitedStates: n?.countryValue
|
|
105
|
-
}),
|
|
106
|
-
...e
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function h(e) {
|
|
110
|
-
return e ? {
|
|
111
|
-
fieldMarkers: e.fieldMarkers,
|
|
112
|
-
addressFieldMarkers: e.address?.fieldMarkers,
|
|
113
|
-
requiredFieldsLegend: e.requiredFieldsLegend
|
|
114
|
-
} : {};
|
|
115
|
-
}
|
|
116
|
-
function g(e) {
|
|
117
|
-
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
118
|
-
}
|
|
119
|
-
function _(e) {
|
|
120
|
-
if (!e) return {};
|
|
121
|
-
let t = e.address;
|
|
122
|
-
return {
|
|
123
|
-
labels: g({
|
|
124
|
-
editingCustomerDetailsHeading: e.editTitleCustomer,
|
|
125
|
-
editingVendorDetailsHeading: e.editTitleVendor,
|
|
126
|
-
firstNameLabel: e.firstNameLabel,
|
|
127
|
-
lastNameLabel: e.lastNameLabel,
|
|
128
|
-
businessNameLabel: e.businessNameLabel,
|
|
129
|
-
rowEmail: e.emailLabel,
|
|
130
|
-
rowPhone: e.phoneLabel,
|
|
131
|
-
rowTaxIdSsn: e.taxIdSsnLabel ?? e.taxIdLabel,
|
|
132
|
-
rowTaxIdEin: e.taxIdEinLabel ?? e.taxIdLabel,
|
|
133
|
-
taxIdSsnPlaceholder: e.taxIdSsnPlaceholder,
|
|
134
|
-
taxIdEinPlaceholder: e.taxIdEinPlaceholder,
|
|
135
|
-
customerTaxIdHelp: e.customerTaxIdHelp,
|
|
136
|
-
vendorTaxIdHelp: e.vendorTaxIdHelp,
|
|
137
|
-
remindersCheckboxLabel: e.paymentRemindersLabel,
|
|
138
|
-
remindersCheckboxDescription: e.paymentRemindersDescription,
|
|
139
|
-
streetAddressLabel: t?.line1,
|
|
140
|
-
addressLine2Label: t?.line2,
|
|
141
|
-
cityLabel: t?.city,
|
|
142
|
-
stateLabel: t?.state,
|
|
143
|
-
statePlaceholder: t?.statePlaceholder,
|
|
144
|
-
postalCodeLabel: t?.postalCode,
|
|
145
|
-
countryLabel: t?.country,
|
|
146
|
-
countryUnitedStates: t?.countryValue,
|
|
147
|
-
cancelButton: e.cancelButton,
|
|
148
|
-
saveButton: e.saveButton
|
|
149
|
-
}),
|
|
150
|
-
fieldMarkers: e.fieldMarkers,
|
|
151
|
-
addressFieldMarkers: t?.fieldMarkers,
|
|
152
|
-
requiredFieldsLegend: e.requiredFieldsLegend
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
var v = {
|
|
156
|
-
firstName: "firstName",
|
|
157
|
-
lastName: "lastName",
|
|
158
|
-
businessName: "legalName",
|
|
159
|
-
email: "email",
|
|
160
|
-
phone: "phone",
|
|
161
|
-
taxId: "taxId"
|
|
162
|
-
};
|
|
163
|
-
function y(e, t, n, r) {
|
|
164
|
-
let i = e === "vendor", a = t.entityType === "individual";
|
|
165
|
-
return {
|
|
166
|
-
heading: i ? r.editingVendorDetailsHeading : r.editingCustomerDetailsHeading,
|
|
167
|
-
formError: n.form,
|
|
168
|
-
name: a ? {
|
|
169
|
-
kind: "person",
|
|
170
|
-
firstName: {
|
|
171
|
-
value: t.firstName,
|
|
172
|
-
error: n.firstName
|
|
173
|
-
},
|
|
174
|
-
lastName: {
|
|
175
|
-
value: t.lastName,
|
|
176
|
-
error: n.lastName
|
|
177
|
-
}
|
|
178
|
-
} : {
|
|
179
|
-
kind: "business",
|
|
180
|
-
businessName: {
|
|
181
|
-
value: t.legalName,
|
|
182
|
-
error: n.legalName
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
email: {
|
|
186
|
-
value: t.email,
|
|
187
|
-
error: n.email
|
|
188
|
-
},
|
|
189
|
-
phone: {
|
|
190
|
-
value: t.phone,
|
|
191
|
-
error: n.phone
|
|
192
|
-
},
|
|
193
|
-
taxId: {
|
|
194
|
-
value: t.taxId,
|
|
195
|
-
error: n.taxId,
|
|
196
|
-
label: a ? r.rowTaxIdSsn : r.rowTaxIdEin,
|
|
197
|
-
placeholder: a ? r.taxIdSsnPlaceholder : r.taxIdEinPlaceholder,
|
|
198
|
-
description: i ? r.vendorTaxIdHelp : r.customerTaxIdHelp
|
|
199
|
-
},
|
|
200
|
-
contactLayout: i ? "inline" : "stacked",
|
|
201
|
-
reminders: i ? void 0 : { checked: t.remindersEnabled },
|
|
202
|
-
address: i ? {
|
|
203
|
-
values: t.address,
|
|
204
|
-
errors: n.address
|
|
205
|
-
} : void 0
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
export { v as EDIT_FORM_FIELD_KEYS, h as addressFormLabelOverrides, y as buildCounterpartEditFormView, p as buildPaymentMethodView, d as buildRecentDocumentRows, _ as editFormLabelOverrides, u as formatDetailsDate, s as maskTaxId, m as withAddressLabelOverrides };
|
|
89
|
+
export { p as buildPaymentMethodView, d as buildRecentDocumentRows, u as formatDetailsDate, s as maskTaxId };
|
package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js
|
|
2
2
|
var e = {
|
|
3
3
|
blurbs: {
|
|
4
|
-
populated: "Six customers with their billed, received and due totals. Search by name, filter by type, sort by name, or click a row to open the customer.
|
|
5
|
-
empty: "The organization has no customers yet. Press
|
|
4
|
+
populated: "Six customers with their billed, received and due totals. Search by name, filter by type, sort by name, or click a row to open the customer. Add customer adds one, and the sheet edits and deletes it; changes last until you switch scenario. In vendor mode, three vendors with their bills and bank accounts.",
|
|
5
|
+
empty: "The organization has no customers yet. Press Add customer, fill in a name and email, and save: the customer opens in its sheet and joins the list.",
|
|
6
6
|
loading: "The customers read is held open, so the table skeleton stays on screen.",
|
|
7
|
-
error: "The customers read fails with a 500, so the table shows
|
|
8
|
-
"control-hidden": "The token has counterpart:read:org but not counterpart:write:org. The list and the customer sheet render, but
|
|
7
|
+
error: "The customers read fails with a 500, so the table shows Couldn't load customers. Try again re-issues the read, which fails again.",
|
|
8
|
+
"control-hidden": "The token has counterpart:read:org but not counterpart:write:org. The list and the customer sheet render, but Add customer, Edit and the delete menu are absent.",
|
|
9
9
|
paginated: "Fourteen customers at ten a page. The next and previous arrows follow the pagination token; the rows-per-page menu starts again from page one."
|
|
10
10
|
},
|
|
11
11
|
scenarios: {
|
|
@@ -15,7 +15,7 @@ var e = {
|
|
|
15
15
|
},
|
|
16
16
|
"amounts-unavailable": {
|
|
17
17
|
label: "Amounts unavailable",
|
|
18
|
-
blurb: "The customers load but both totals reads fail, so the money columns show
|
|
18
|
+
blurb: "The customers load but both totals reads fail, so the money columns show an em dash under a warning that says Couldn't load amounts, with Try again."
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { COUNTERPARTS_SCREEN_LABELS_EN as e, COUNTERPART_DETAILS_SHEET_LABELS_EN as t } from "./index2.js";
|
|
2
2
|
import { CounterpartsScreen as n } from "./index3.js";
|
|
3
|
-
import { CounterpartDetailsSheet as r } from "./
|
|
3
|
+
import { CounterpartDetailsSheet as r } from "./index5.js";
|
|
4
4
|
export { e as COUNTERPARTS_SCREEN_LABELS_EN, t as COUNTERPART_DETAILS_SHEET_LABELS_EN, r as CounterpartDetailsSheet, n as CounterpartsScreen };
|