@tesouro/embedded-components-react 0.5.145 → 0.5.147

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 (30) hide show
  1. package/README.md +22 -1
  2. package/dist/index.d.ts +72 -22
  3. package/dist/index.js +38 -36
  4. package/dist/lib/CounterpartsWidget.d.ts +21 -18
  5. package/dist/lib/CounterpartsWidget.js +1 -2
  6. package/dist/lib/CounterpartsWidgetPublic.d.ts +976 -0
  7. package/dist/lib/CounterpartsWidgetPublic.js +10 -0
  8. package/dist/lib/CustomersWidget.d.ts +955 -0
  9. package/dist/lib/CustomersWidget.js +3 -0
  10. package/dist/lib/ReceivablesWidget.d.ts +2 -0
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js +98 -89
  13. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +114 -108
  14. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +40 -42
  15. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +1 -0
  16. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +90 -76
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +300 -226
  18. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index.js +2 -0
  19. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index2.js +4 -0
  20. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index3.js +45 -0
  21. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index4.js +42 -0
  22. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index5.js +27 -0
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -12
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +103 -100
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -0
  26. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +9 -9
  27. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +4 -74
  28. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +6 -1
  29. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  30. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import { CustomersWidget as e } from "../libs/tesouro-embedded-components-react/customers-widget/feature/dist/index5.js";
2
+ import "../libs/tesouro-embedded-components-react/customers-widget/feature/dist/index.js";
3
+ export { e as CustomersWidget };
@@ -769,6 +769,8 @@ interface CounterpartMessageLabels {
769
769
  vatIdValueRequired: string;
770
770
  /** Shown for a non-field-specific submit failure. */
771
771
  genericError: string;
772
+ /** Toasted when the list's billed/received/due analytics fail to load. */
773
+ amountsUnavailable: string;
772
774
  /** Delete confirmation title; `{name}` is replaced with the entity name. */
773
775
  deleteTitle: string;
774
776
  /** Delete confirmation title for a bank account; `{account}` is display-ready. */
@@ -60,6 +60,7 @@ function C({ labels: i, initialTab: f = x.Bills, tabsLabels: C, vendorLabels: w,
60
60
  content: /* @__PURE__ */ y(m, {
61
61
  ...w,
62
62
  counterpartType: "vendor",
63
+ passThrough: !0,
63
64
  onViewAllDocuments: A ? (e) => V({
64
65
  vendorId: e.id,
65
66
  vendorName: e.name,
@@ -2,114 +2,123 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useCounterpartsQuery as e } from "../../../shared/counterpart-management/data-access/dist/index3.js";
6
- import { useCounterpartAddressesForRowsQuery as t } from "../../../shared/counterpart-management/data-access/dist/index7.js";
7
- import { buildAnalyticsMap as n, buildCounterpartRows as r } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../shared/ui/dist/index.js";
7
+ import { useCounterpartsQuery as t } from "../../../shared/counterpart-management/data-access/dist/index3.js";
8
+ import { useCounterpartAddressesForRowsQuery as n } from "../../../shared/counterpart-management/data-access/dist/index7.js";
9
+ import { buildAnalyticsMap as r, buildCounterpartRows as i } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
8
10
  import "../../../shared/counterpart-management/feature/dist/index.js";
9
- import { PAYABLES_BILLED_STATUSES as i, PAYABLES_OWED_STATUSES as a, RECEIVABLES_BILLED_STATUSES as o, RECEIVABLES_DUE_STATUSES as s } from "./index3.js";
10
- import { usePayablesAnalyticsByCounterpartQuery as c, useReceivablesAnalyticsByCounterpartQuery as l } from "../../data-access/dist/index2.js";
11
+ import { PAYABLES_BILLED_STATUSES as a, PAYABLES_OWED_STATUSES as o, RECEIVABLES_BILLED_STATUSES as s, RECEIVABLES_DUE_STATUSES as c } from "./index3.js";
12
+ import { usePayablesAnalyticsByCounterpartQuery as l, useReceivablesAnalyticsByCounterpartQuery as u } from "../../data-access/dist/index2.js";
11
13
  import "../../data-access/dist/index.js";
12
- import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "react";
14
+ import { useCallback as d, useEffect as f, useMemo as p, useState as m } from "react";
13
15
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js
14
- function m({ isCustomer: m, enabled: h = !0 }) {
15
- let [g, _] = p([]), [v, y] = p(10), [b, x] = p(), [S, C] = p(""), [w, T] = p(""), [E, D] = p("all");
16
- d(() => {
16
+ function h({ isCustomer: h, enabled: g = !0, messages: _ }) {
17
+ let [v, y] = m([]), [b, x] = m(10), [S, C] = m(), [w, T] = m(""), [E, D] = m(""), [O, k] = m("all");
18
+ f(() => {
17
19
  let e = setTimeout(() => {
18
- T(S), x(void 0);
20
+ D(w), C(void 0);
19
21
  }, 400);
20
22
  return () => clearTimeout(e);
21
- }, [S]);
22
- let O = g[0]?.desc ? "desc" : "asc", k = e({
23
- sort: "counterpart_name",
24
- order: O,
25
- limit: v,
26
- pagination_token: b,
27
- counterpart_name__icontains: w || void 0,
28
- type: E === "all" ? void 0 : E,
29
- ...m ? { is_customer: !0 } : { is_vendor: !0 },
30
- enabled: h
31
- }), A = f(() => k.data?.data.map((e) => e.id) ?? [], [k.data?.data]), j = A.length > 0, M = t({
32
- counterpartIds: A,
33
- enabled: h && j
34
- }), N = l({
35
- type: "invoice",
36
- statusIn: [...o],
37
- counterpartIdIn: A,
38
- enabled: h && m && j
39
- }), P = l({
40
- metric: "amount_due",
23
+ }, [w]);
24
+ let A = v[0], j = t({
25
+ sort: A ? "counterpart_name" : void 0,
26
+ order: A ? A.desc ? "desc" : "asc" : void 0,
27
+ limit: b,
28
+ pagination_token: S,
29
+ counterpart_name__icontains: E || void 0,
30
+ type: O === "all" ? void 0 : O,
31
+ ...h ? { is_customer: !0 } : { is_vendor: !0 },
32
+ enabled: g
33
+ }), M = p(() => j.data?.data.map((e) => e.id) ?? [], [j.data?.data]), N = M.length > 0, P = n({
34
+ counterpartIds: M,
35
+ enabled: g && N
36
+ }), F = u({
41
37
  type: "invoice",
42
38
  statusIn: [...s],
43
- counterpartIdIn: A,
44
- enabled: h && m && j
45
- }), F = c({
46
- statusIn: [...i],
47
- counterpartIdIn: A,
48
- enabled: h && !m && j
49
- }), I = c({
39
+ counterpartIdIn: M,
40
+ enabled: g && h && N
41
+ }), I = u({
50
42
  metric: "amount_due",
43
+ type: "invoice",
44
+ statusIn: [...c],
45
+ counterpartIdIn: M,
46
+ enabled: g && h && N
47
+ }), L = l({
51
48
  statusIn: [...a],
52
- counterpartIdIn: A,
53
- enabled: h && !m && j
54
- }), L = f(() => m ? N.data ? n(N.data.data) : void 0 : F.data ? n(F.data.data) : void 0, [
55
- m,
56
- N.data,
57
- F.data
58
- ]), R = f(() => m ? P.data ? n(P.data.data) : void 0 : I.data ? n(I.data.data) : void 0, [
59
- m,
60
- P.data,
61
- I.data
62
- ]), z = f(() => new Map(A.map((e, t) => [e, M[t]?.data?.data?.[0]])), [A, M]), B = f(() => r({
63
- counterparts: k.data?.data ?? [],
64
- addresses: z,
65
- billedAmounts: L,
66
- dueOrOwedAmounts: R,
67
- isBilledAmountLoading: m ? N.isLoading : F.isLoading,
68
- isDueOrOwedAmountLoading: m ? P.isLoading : I.isLoading
49
+ counterpartIdIn: M,
50
+ enabled: g && !h && N
51
+ }), R = l({
52
+ metric: "amount_due",
53
+ statusIn: [...o],
54
+ counterpartIdIn: M,
55
+ enabled: g && !h && N
56
+ }), z = p(() => h ? F.data ? r(F.data.data) : void 0 : L.data ? r(L.data.data) : void 0, [
57
+ h,
58
+ F.data,
59
+ L.data
60
+ ]), B = p(() => h ? I.data ? r(I.data.data) : void 0 : R.data ? r(R.data.data) : void 0, [
61
+ h,
62
+ I.data,
63
+ R.data
64
+ ]), V = p(() => new Map(M.map((e, t) => [e, P[t]?.data?.data?.[0]])), [M, P]), H = h ? F.isError : L.isError, U = h ? I.isError : R.isError;
65
+ f(() => {
66
+ (H || U) && e.error(_.amountsUnavailable);
67
+ }, [
68
+ H,
69
+ U,
70
+ _.amountsUnavailable
71
+ ]);
72
+ let W = p(() => i({
73
+ counterparts: j.data?.data ?? [],
74
+ addresses: V,
75
+ billedAmounts: z,
76
+ dueOrOwedAmounts: B,
77
+ isBilledAmountLoading: z === void 0,
78
+ isDueOrOwedAmountLoading: B === void 0,
79
+ isBilledAmountError: H,
80
+ isDueOrOwedAmountError: U
69
81
  }).map((e) => {
70
- let t = (L?.get(e.id) ?? 0) - (R?.get(e.id) ?? 0);
82
+ let t = (z?.get(e.id) ?? 0) - (B?.get(e.id) ?? 0);
71
83
  return {
72
84
  ...e,
73
85
  isReceivedOrPaidPositive: t > 0
74
86
  };
75
87
  }), [
76
- k.data?.data,
88
+ j.data?.data,
89
+ V,
77
90
  z,
78
- L,
79
- R,
80
- m,
81
- N.isLoading,
82
- F.isLoading,
83
- P.isLoading,
84
- I.isLoading
85
- ]), V = !!w || E !== "all", H = u((e) => {
86
- _((t) => typeof e == "function" ? e(t) : e), x(void 0);
87
- }, []), U = u((e) => {
88
- y(e), x(void 0);
89
- }, []), W = u(() => x(k.data?.next_pagination_token ?? void 0), [k.data?.next_pagination_token]), G = u(() => x(k.data?.prev_pagination_token ?? void 0), [k.data?.prev_pagination_token]), K = u(() => {
90
- k.refetch();
91
- }, [k]), q = u((e) => {
92
- D(e), x(void 0);
91
+ B,
92
+ H,
93
+ U
94
+ ]), G = !!E || O !== "all", K = d((e) => {
95
+ y((t) => typeof e == "function" ? e(t) : e), C(void 0);
96
+ }, []), q = d((e) => {
97
+ x(e), C(void 0);
98
+ }, []), J = d(() => C(j.data?.next_pagination_token ?? void 0), [j.data?.next_pagination_token]), Y = d(() => C(j.data?.prev_pagination_token ?? void 0), [j.data?.prev_pagination_token]), X = d(() => {
99
+ j.refetch();
100
+ }, [j]), Z = d((e) => {
101
+ k(e), C(void 0);
93
102
  }, []);
94
103
  return {
95
- rows: B,
96
- isLoading: k.isLoading,
97
- isError: k.isError,
98
- sorting: g,
99
- onSortingChange: H,
100
- pageSize: v,
101
- onPageSizeChange: U,
102
- hasNextPage: !!k.data?.next_pagination_token,
103
- hasPrevPage: !!k.data?.prev_pagination_token,
104
- onNextPage: W,
105
- onPrevPage: G,
106
- searchValue: S,
107
- onSearchChange: C,
108
- entityFilter: E,
109
- onEntityFilterChange: q,
110
- isFiltering: V,
111
- onRetry: K
104
+ rows: W,
105
+ isLoading: j.isLoading,
106
+ isError: j.isError,
107
+ sorting: v,
108
+ onSortingChange: K,
109
+ pageSize: b,
110
+ onPageSizeChange: q,
111
+ hasNextPage: !!j.data?.next_pagination_token,
112
+ hasPrevPage: !!j.data?.prev_pagination_token,
113
+ onNextPage: J,
114
+ onPrevPage: Y,
115
+ searchValue: w,
116
+ onSearchChange: T,
117
+ entityFilter: O,
118
+ onEntityFilterChange: Z,
119
+ isFiltering: G,
120
+ onRetry: X
112
121
  };
113
122
  }
114
123
  //#endregion
115
- export { m as useCounterpartsTable };
124
+ export { h as useCounterpartsTable };
@@ -13,149 +13,155 @@ import { useCounterpartForm as u } from "../../../shared/counterpart-management/
13
13
  import { useDeleteController as d } from "../../../shared/counterpart-management/feature/dist/lib/useDeleteController.js";
14
14
  import { useBankAccountForm as f } from "../../../shared/counterpart-management/feature/dist/lib/subEntityForms.js";
15
15
  import "../../../shared/counterpart-management/feature/dist/index.js";
16
- import { PAYABLES_BILLED_STATUSES as p, PAYABLES_OWED_STATUSES as ee, PAYABLES_REJECTED_STATUSES as m, RECEIVABLES_BILLED_STATUSES as te, RECEIVABLES_DUE_STATUSES as ne } from "./index3.js";
17
- import { usePayablesAnalyticsByCounterpartQuery as h, useReceivablesAnalyticsByCounterpartQuery as g } from "../../data-access/dist/index2.js";
18
- import { useRecentPayablesByCounterpartQuery as _, useRecentReceivablesByCounterpartQuery as v } from "../../data-access/dist/index3.js";
16
+ import { PAYABLES_BILLED_STATUSES as p, PAYABLES_OWED_STATUSES as ee, PAYABLES_REJECTED_STATUSES as te, RECEIVABLES_BILLED_STATUSES as ne, RECEIVABLES_DUE_STATUSES as re } from "./index3.js";
17
+ import { usePayablesAnalyticsByCounterpartQuery as m, useReceivablesAnalyticsByCounterpartQuery as h } from "../../data-access/dist/index2.js";
18
+ import { useRecentPayablesByCounterpartQuery as ie, useRecentReceivablesByCounterpartQuery as g } from "../../data-access/dist/index3.js";
19
19
  import "../../data-access/dist/index.js";
20
- import { useCounterpartsTable as re } from "./index4.js";
21
- import { getCounterpartPermissions as ie } from "./index5.js";
22
- import { buildPaymentMethodView as ae, buildRecentDocumentRows as y, maskTaxId as b } from "./index6.js";
23
- import { COUNTERPART_DETAILS_SHEET_LABELS_EN as oe } from "../../ui/dist/index2.js";
20
+ import { useCounterpartsTable as ae } from "./index4.js";
21
+ import { getCounterpartPermissions as _ } from "./index5.js";
22
+ import { buildPaymentMethodView as v, buildRecentDocumentRows as y, maskTaxId as oe } from "./index6.js";
23
+ import { COUNTERPART_DETAILS_SHEET_LABELS_EN as se } from "../../ui/dist/index2.js";
24
24
  import "../../ui/dist/index.js";
25
- import { useCallback as x, useEffect as S, useMemo as C, useState as w } from "react";
25
+ import { useCallback as b, useEffect as x, useMemo as S, useState as C } from "react";
26
26
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js
27
- function T({ counterpartType: T, detailsLabels: E, messageLabels: D }) {
28
- let { initResponse: O, widgetToken: k } = t(), A = r(), j = n(), M = C(() => ({
27
+ function w({ counterpartType: w, detailsLabels: T, messageLabels: E }) {
28
+ let { initResponse: D, widgetToken: O } = t(), k = r(), A = n(), j = S(() => ({
29
29
  ...i,
30
- ...D
31
- }), [D]), N = C(() => ({
32
- ...oe,
33
30
  ...E
34
- }), [E]), P = T === "customer", F = C(() => e(), []), I = C(() => ie(O?.scopes), [O?.scopes]), L = !(!k || O || j) || A && !O, [R, z] = w(), [B, V] = w("none"), H = I.canRead ? R : void 0;
35
- S(() => {
36
- I.canRead || (z(void 0), V("none"));
37
- }, [I.canRead]);
38
- let U = re({
39
- isCustomer: P,
40
- enabled: I.canRead
41
- }), W = l({
42
- selectedId: H,
43
- enabled: I.canRead
44
- }), G = C(() => H ? [H] : [], [H]), K = G.length > 0, q = g({
31
+ }), [E]), M = S(() => ({
32
+ ...se,
33
+ ...T
34
+ }), [T]), N = w === "customer", ce = S(() => e(), []), P = S(() => _(D?.scopes), [D?.scopes]), F = !(!O || D || A) || k && !D, [I, L] = C(), [R, z] = C("none"), B = P.canRead ? I : void 0;
35
+ x(() => {
36
+ P.canRead || (L(void 0), z("none"));
37
+ }, [P.canRead]);
38
+ let V = ae({
39
+ isCustomer: N,
40
+ enabled: P.canRead,
41
+ messages: j
42
+ }), H = l({
43
+ selectedId: B,
44
+ enabled: P.canRead
45
+ }), U = S(() => B ? [B] : [], [B]), W = U.length > 0, G = h({
45
46
  type: "invoice",
46
- statusIn: [...te],
47
- counterpartIdIn: G,
48
- enabled: I.canRead && P && K
49
- }), J = g({
47
+ statusIn: [...ne],
48
+ counterpartIdIn: U,
49
+ enabled: P.canRead && N && W
50
+ }), K = h({
50
51
  metric: "amount_due",
51
52
  type: "invoice",
52
- statusIn: [...ne],
53
- counterpartIdIn: G,
54
- enabled: I.canRead && P && K
55
- }), Y = h({
53
+ statusIn: [...re],
54
+ counterpartIdIn: U,
55
+ enabled: P.canRead && N && W
56
+ }), q = m({
56
57
  statusIn: [...p],
57
- counterpartIdIn: G,
58
- enabled: I.canRead && !P && K
59
- }), X = h({
58
+ counterpartIdIn: U,
59
+ enabled: P.canRead && !N && W
60
+ }), J = m({
60
61
  metric: "amount_due",
61
62
  statusIn: [...ee],
62
- counterpartIdIn: G,
63
- enabled: I.canRead && !P && K
64
- }), Z = h({
65
- statusIn: [...m],
66
- counterpartIdIn: G,
67
- enabled: I.canRead && !P && K
68
- }), Q = v({
69
- counterpartId: H,
70
- enabled: I.canRead && P && K
71
- }), $ = _({
72
- counterpartId: H,
73
- enabled: I.canRead && !P && K
74
- }), se = u({
75
- view: B,
76
- setView: V,
77
- selectedId: H,
78
- setSelectedId: z,
79
- messages: M,
80
- counterpartType: T,
81
- counterpart: W.counterpart,
82
- primaryAddress: W.primaryAddress,
83
- bankAccounts: W.bankAccounts,
84
- isBankAccountsLoading: W.isBankAccountsLoading,
85
- isBankAccountsError: W.isBankAccountsError
86
- }), ce = f({
87
- items: W.bankAccounts,
88
- selectedId: H,
89
- messages: M
90
- }), le = c({
91
- selectedId: H,
92
- primaryAddress: W.primaryAddress,
93
- messages: M
63
+ counterpartIdIn: U,
64
+ enabled: P.canRead && !N && W
65
+ }), Y = m({
66
+ statusIn: [...te],
67
+ counterpartIdIn: U,
68
+ enabled: P.canRead && !N && W
69
+ }), X = g({
70
+ counterpartId: B,
71
+ enabled: P.canRead && N && W
72
+ }), Z = ie({
73
+ counterpartId: B,
74
+ enabled: P.canRead && !N && W
75
+ }), Q = u({
76
+ view: R,
77
+ setView: z,
78
+ selectedId: B,
79
+ setSelectedId: L,
80
+ messages: j,
81
+ counterpartType: w,
82
+ counterpart: H.counterpart,
83
+ primaryAddress: H.primaryAddress,
84
+ bankAccounts: H.bankAccounts,
85
+ isBankAccountsLoading: H.isBankAccountsLoading,
86
+ isBankAccountsError: H.isBankAccountsError
87
+ }), le = f({
88
+ items: H.bankAccounts,
89
+ selectedId: B,
90
+ messages: j
91
+ }), $ = c({
92
+ selectedId: B,
93
+ primaryAddress: H.primaryAddress,
94
+ messages: j
94
95
  }), ue = d({
95
- selectedId: H,
96
- setSelectedId: z,
97
- detailsView: W.detailsView,
98
- messages: M
96
+ selectedId: B,
97
+ setSelectedId: L,
98
+ detailsView: H.detailsView,
99
+ messages: j
99
100
  });
100
101
  return {
101
- stateOptions: F,
102
- selectedId: H,
103
- view: B,
104
- table: U,
105
- details: W,
106
- detailsSheetView: C(() => {
107
- if (!W.detailsView || !H) return;
108
- let e = a(P ? q.data?.data : Y.data?.data), t = a(P ? J.data?.data : X.data?.data), n = e.get(H) ?? 0, r = t.get(H) ?? 0, i = n - r, s = P ? q.isLoading : Y.isLoading, c = P ? J.isLoading : X.isLoading, l = a(Z.data?.data), u = P ? 0 : l.get(H) ?? 0, d = P ? Q.data?.data : $.data?.data, f = ae(W.bankAccounts?.[0], N.paymentMethodTitle), p = P ? N.customerSubtitleLabel : N.vendorSubtitleLabel;
102
+ stateOptions: ce,
103
+ selectedId: B,
104
+ view: R,
105
+ table: V,
106
+ details: H,
107
+ detailsSheetView: S(() => {
108
+ if (!H.detailsView || !B) return;
109
+ let e = a(N ? G.data?.data : q.data?.data), t = a(N ? K.data?.data : J.data?.data), n = e.get(B) ?? 0, r = t.get(B) ?? 0, i = n - r, s = N ? G.isLoading : q.isLoading, c = N ? K.isLoading : J.isLoading, l = a(Y.data?.data), u = N ? 0 : l.get(B) ?? 0, d = N ? X.data?.data : Z.data?.data, f = v(H.bankAccounts?.[0], M.paymentMethodTitle), p = N ? M.customerSubtitleLabel : M.vendorSubtitleLabel;
109
110
  return {
110
- ...W.detailsView,
111
- subtitle: N.subtitleTemplate.replace("{type}", p).replace("{date}", W.detailsView.createdAtLabel),
112
- entityTypeLabel: W.detailsView.entityType === "individual" ? N.entityTypePersonLabel : N.entityTypeBusinessLabel,
113
- taxIdMasked: b(W.detailsView.taxId),
114
- remindersLabel: W.counterpart?.reminders_enabled ? N.remindersEnabledLabel : N.remindersDisabledLabel,
111
+ ...H.detailsView,
112
+ subtitle: M.subtitleTemplate.replace("{type}", p).replace("{date}", H.detailsView.createdAtLabel),
113
+ entityTypeLabel: H.detailsView.entityType === "individual" ? M.entityTypePersonLabel : M.entityTypeBusinessLabel,
114
+ taxIdMasked: oe(H.detailsView.taxId),
115
+ remindersLabel: H.counterpart?.reminders_enabled ? M.remindersEnabledLabel : M.remindersDisabledLabel,
115
116
  summary: {
116
117
  primaryAmountLabel: o(r),
117
118
  billedAmountLabel: o(n),
118
119
  receivedOrPaidAmountLabel: o(i),
119
- rejectedAmountLabel: P ? void 0 : o(u),
120
+ rejectedAmountLabel: N ? void 0 : o(u),
120
121
  isPrimaryAmountLoading: c,
121
122
  isBilledAmountLoading: s,
122
123
  isReceivedOrPaidAmountLoading: s || c,
123
- isRejectedAmountLoading: P ? void 0 : Z.isLoading
124
+ isRejectedAmountLoading: N ? void 0 : Y.isLoading
124
125
  },
125
126
  recentDocuments: y(d),
126
127
  paymentMethod: f
127
128
  };
128
129
  }, [
129
- W.detailsView,
130
- W.bankAccounts,
131
- W.counterpart?.reminders_enabled,
132
- H,
133
- P,
130
+ H.detailsView,
131
+ H.bankAccounts,
132
+ H.counterpart?.reminders_enabled,
133
+ B,
134
134
  N,
135
+ M,
136
+ G.data,
137
+ G.isLoading,
135
138
  q.data,
136
139
  q.isLoading,
137
- Y.data,
138
- Y.isLoading,
140
+ K.data,
141
+ K.isLoading,
139
142
  J.data,
140
143
  J.isLoading,
144
+ Y.data,
145
+ Y.isLoading,
141
146
  X.data,
142
- X.isLoading,
143
- Z.data,
144
- Z.isLoading,
145
- Q.data,
146
- $.data
147
+ Z.data
147
148
  ]),
148
- permissions: I,
149
- isPermissionLoading: L,
150
- form: se,
151
- bank: ce,
152
- address: le,
149
+ permissions: P,
150
+ isPermissionLoading: F,
151
+ form: Q,
152
+ bank: le,
153
+ address: $,
153
154
  del: ue,
154
- handleRowClick: x((e) => {
155
- I.canRead && !s() && (z(e.id), V("none"));
156
- }, [I.canRead]),
157
- closeDetails: x(() => z(void 0), [])
155
+ handleRowClick: b((e) => {
156
+ P.canRead && !s() && ($.close(), L(e.id), z("none"));
157
+ }, [P.canRead, $.close]),
158
+ closeDetails: b(() => {
159
+ $.close(), L(void 0);
160
+ }, [$.close]),
161
+ handleEditProfile: b(() => {
162
+ $.close(), Q.openEdit();
163
+ }, [$.close, Q.openEdit])
158
164
  };
159
165
  }
160
166
  //#endregion
161
- export { T as useCounterpartsWidget };
167
+ export { w as useCounterpartsWidget };