@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.
Files changed (48) hide show
  1. package/README.md +28 -28
  2. package/dist/index.css +6 -27
  3. package/dist/index.d.ts +29 -41
  4. package/dist/lib/CardDetailsWidget.d.ts +1 -1
  5. package/dist/lib/CounterpartsWidget.d.ts +26 -39
  6. package/dist/lib/CounterpartsWidgetPublic.d.ts +26 -39
  7. package/dist/lib/CreditCardsWidget.d.ts +2 -2
  8. package/dist/lib/CustomersWidget.d.ts +26 -39
  9. package/dist/lib/DebitCardsWidget.d.ts +2 -2
  10. package/dist/lib/ReceivablesWidget.d.ts +14 -4
  11. package/dist/lib/WidgetSuite.d.ts +2 -2
  12. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +0 -4
  13. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +7 -8
  14. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +37 -39
  15. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +72 -73
  16. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +16 -22
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +8 -12
  18. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +93 -110
  19. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +52 -52
  20. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +72 -107
  21. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +27 -27
  22. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +112 -145
  23. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +13 -16
  24. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +3 -122
  25. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +5 -5
  26. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +44 -65
  28. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +157 -134
  29. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +18 -14
  30. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +362 -55
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +7 -7
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +16 -9
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +2 -66
  35. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +48 -46
  36. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +5 -5
  37. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +138 -149
  38. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +19 -20
  39. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +1 -0
  40. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +21 -27
  41. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index3.js +0 -1
  43. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +2 -2
  44. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +30 -63
  45. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +0 -211
  48. 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 { toast as e, useFilterPanel as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import "../../../../../shared/ui/dist/index.js";
7
- import { buildAnalyticsMap as n, buildCounterpartRows as r } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
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 o, PAYABLES_BILLED_STATUSES as ee, PAYABLES_OWED_STATUSES as te, RECEIVABLES_BILLED_STATUSES as s, RECEIVABLES_DUE_STATUSES as c, TYPE_FILTER_OPTIONS as l } from "./constants.js";
12
- import { usePayablesAnalyticsByCounterpartQuery as u, useReceivablesAnalyticsByCounterpartQuery as d } from "../../../../data-access/dist/index2.js";
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 f, useEffect as p, useMemo as m, useState as h } from "react";
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
- var g = {
17
- Type: "type",
18
- Search: "search"
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
- k(E), T(void 0);
19
+ O(T), w(void 0);
26
20
  }, 400);
27
21
  return () => clearTimeout(e);
28
- }, [E, O]);
29
- let P = S[0], F = i({
30
- sort: P ? "counterpart_name" : void 0,
31
- order: P ? P.desc ? "desc" : "asc" : void 0,
32
- limit: w,
33
- pagination_token: re,
34
- counterpart_name__icontains: O || void 0,
35
- type: M,
36
- ..._ ? { is_customer: !0 } : { is_vendor: !0 },
37
- enabled: v
38
- }), I = m(() => F.data?.data.map((e) => e.id) ?? [], [F.data?.data]), L = I.length > 0, R = a({
39
- counterpartIds: I,
40
- enabled: v && L
41
- }), z = d({
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: I,
45
- enabled: v && _ && L
46
- }), B = d({
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: I,
51
- enabled: v && _ && L
52
- }), V = u({
53
- statusIn: [...ee],
54
- counterpartIdIn: I,
55
- enabled: v && !_ && L
56
- }), H = u({
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: [...te],
59
- counterpartIdIn: I,
60
- enabled: v && !_ && L
61
- }), U = m(() => _ ? z.data ? n(z.data.data) : void 0 : V.data ? n(V.data.data) : void 0, [
62
- _,
63
- z.data,
64
- V.data
65
- ]), W = m(() => _ ? B.data ? n(B.data.data) : void 0 : H.data ? n(H.data.data) : void 0, [
66
- _,
67
- B.data,
68
- H.data
69
- ]), G = m(() => new Map(I.map((e, t) => [e, R[t]?.data?.data?.[0]])), [I, R]), K = _ ? z.isError : V.isError, q = _ ? B.isError : H.isError;
70
- p(() => {
71
- (K || q) && e.error(b.amountsUnavailable);
72
- }, [
73
- K,
74
- q,
75
- b.amountsUnavailable
76
- ]);
77
- let J = m(() => r({
78
- counterparts: F.data?.data ?? [],
79
- addresses: G,
80
- billedAmounts: U,
81
- dueOrOwedAmounts: W,
82
- isBilledAmountLoading: U === void 0,
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
- K,
99
- q,
100
- x.unnamedCounterpart
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" ? x.entityFilterIndividual : x.entityFilterOrganization
104
- })), [x.entityFilterIndividual, x.entityFilterOrganization]), X = m(() => {
105
- let e = [], t = Y.find((e) => e.value === M)?.label;
106
- return t && e.push({
107
- key: g.Type,
108
- label: x.typeChip(t)
109
- }), O && e.push({
110
- key: g.Search,
111
- label: x.searchChip(O)
112
- }), e;
113
- }, [
114
- O,
115
- M,
116
- x,
117
- Y
118
- ]), ie = X.length > 0, ae = f((e) => {
119
- C((t) => typeof e == "function" ? e(t) : e), T(void 0);
120
- }, []), oe = f((e) => {
121
- ne(e), T(void 0);
122
- }, []), se = f(() => T(F.data?.next_pagination_token ?? void 0), [F.data?.next_pagination_token]), ce = f(() => T(F.data?.prev_pagination_token ?? void 0), [F.data?.prev_pagination_token]), Z = f(() => {
123
- F.refetch();
124
- }, [F]), Q = f((e) => {
125
- j(e), T(void 0);
126
- }, []), $ = f(() => {
127
- D(""), k(""), T(void 0);
128
- }, []), le = f((e) => {
129
- e === g.Search ? $() : Q([]);
130
- }, [$, Q]), ue = f(() => {
131
- $(), j([]);
132
- }, [$]), de = {
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: J,
153
- isLoading: F.isLoading,
154
- isError: F.isError,
155
- sorting: S,
156
- onSortingChange: ae,
157
- pageSize: w,
158
- onPageSizeChange: oe,
159
- hasNextPage: !!F.data?.next_pagination_token,
160
- hasPrevPage: !!F.data?.prev_pagination_token,
161
- onNextPage: se,
162
- onPrevPage: ce,
163
- filters: de,
164
- isFiltering: ie,
165
- onRetry: Z
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 { g as CounterpartsFilterChipKey, _ as useCounterpartsTable };
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
- }), V = u({
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: V,
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() && (H(), P(e.id), I("none"));
73
- }, [j.canRead, H]),
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: "2-digit",
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
- function m(e, t) {
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 };
@@ -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. Create new adds a customer, and the sheet edits, deletes and adds an address; 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 Create new, fill in a name and email, and save: the customer opens in its sheet and joins the list.",
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 Failed to load Customer. Reload 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 Create new, Edit, the delete menu and Add address are absent.",
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 a dash and a toast says the amounts could not be loaded."
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 "./index7.js";
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 };