@tesouro/embedded-components-react 0.5.146 → 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.
- package/README.md +22 -1
- package/dist/index.d.ts +72 -22
- package/dist/index.js +38 -36
- package/dist/lib/CounterpartsWidget.d.ts +21 -18
- package/dist/lib/CounterpartsWidget.js +1 -2
- package/dist/lib/CounterpartsWidgetPublic.d.ts +976 -0
- package/dist/lib/CounterpartsWidgetPublic.js +10 -0
- package/dist/lib/CustomersWidget.d.ts +955 -0
- package/dist/lib/CustomersWidget.js +3 -0
- package/dist/lib/ReceivablesWidget.d.ts +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js +98 -89
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +114 -108
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +40 -42
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +90 -76
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +300 -226
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index2.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index3.js +45 -0
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index4.js +42 -0
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index5.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -12
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +103 -100
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +4 -74
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -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. */
|
package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js
CHANGED
|
@@ -2,114 +2,123 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
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
|
|
10
|
-
import { usePayablesAnalyticsByCounterpartQuery as
|
|
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
|
|
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
|
|
15
|
-
let [
|
|
16
|
-
|
|
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
|
-
|
|
20
|
+
D(w), C(void 0);
|
|
19
21
|
}, 400);
|
|
20
22
|
return () => clearTimeout(e);
|
|
21
|
-
}, [
|
|
22
|
-
let
|
|
23
|
-
sort: "counterpart_name",
|
|
24
|
-
order:
|
|
25
|
-
limit:
|
|
26
|
-
pagination_token:
|
|
27
|
-
counterpart_name__icontains:
|
|
28
|
-
type:
|
|
29
|
-
...
|
|
30
|
-
enabled:
|
|
31
|
-
}),
|
|
32
|
-
counterpartIds:
|
|
33
|
-
enabled:
|
|
34
|
-
}),
|
|
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:
|
|
44
|
-
enabled:
|
|
45
|
-
}),
|
|
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:
|
|
53
|
-
enabled:
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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 = (
|
|
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
|
-
|
|
88
|
+
j.data?.data,
|
|
89
|
+
V,
|
|
77
90
|
z,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
]),
|
|
86
|
-
|
|
87
|
-
}, []),
|
|
88
|
-
|
|
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:
|
|
96
|
-
isLoading:
|
|
97
|
-
isError:
|
|
98
|
-
sorting:
|
|
99
|
-
onSortingChange:
|
|
100
|
-
pageSize:
|
|
101
|
-
onPageSizeChange:
|
|
102
|
-
hasNextPage: !!
|
|
103
|
-
hasPrevPage: !!
|
|
104
|
-
onNextPage:
|
|
105
|
-
onPrevPage:
|
|
106
|
-
searchValue:
|
|
107
|
-
onSearchChange:
|
|
108
|
-
entityFilter:
|
|
109
|
-
onEntityFilterChange:
|
|
110
|
-
isFiltering:
|
|
111
|
-
onRetry:
|
|
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 {
|
|
124
|
+
export { h as useCounterpartsTable };
|
package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js
CHANGED
|
@@ -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
|
|
17
|
-
import { usePayablesAnalyticsByCounterpartQuery as
|
|
18
|
-
import { useRecentPayablesByCounterpartQuery as
|
|
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
|
|
21
|
-
import { getCounterpartPermissions as
|
|
22
|
-
import { buildPaymentMethodView as
|
|
23
|
-
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as
|
|
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
|
|
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
|
|
28
|
-
let { initResponse:
|
|
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]),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, [I.canRead
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
enabled:
|
|
44
|
-
|
|
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: [...
|
|
47
|
-
counterpartIdIn:
|
|
48
|
-
enabled:
|
|
49
|
-
}),
|
|
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: [...
|
|
53
|
-
counterpartIdIn:
|
|
54
|
-
enabled:
|
|
55
|
-
}),
|
|
53
|
+
statusIn: [...re],
|
|
54
|
+
counterpartIdIn: U,
|
|
55
|
+
enabled: P.canRead && N && W
|
|
56
|
+
}), q = m({
|
|
56
57
|
statusIn: [...p],
|
|
57
|
-
counterpartIdIn:
|
|
58
|
-
enabled:
|
|
59
|
-
}),
|
|
58
|
+
counterpartIdIn: U,
|
|
59
|
+
enabled: P.canRead && !N && W
|
|
60
|
+
}), J = m({
|
|
60
61
|
metric: "amount_due",
|
|
61
62
|
statusIn: [...ee],
|
|
62
|
-
counterpartIdIn:
|
|
63
|
-
enabled:
|
|
64
|
-
}),
|
|
65
|
-
statusIn: [...
|
|
66
|
-
counterpartIdIn:
|
|
67
|
-
enabled:
|
|
68
|
-
}),
|
|
69
|
-
counterpartId:
|
|
70
|
-
enabled:
|
|
71
|
-
}),
|
|
72
|
-
counterpartId:
|
|
73
|
-
enabled:
|
|
74
|
-
}),
|
|
75
|
-
view:
|
|
76
|
-
setView:
|
|
77
|
-
selectedId:
|
|
78
|
-
setSelectedId:
|
|
79
|
-
messages:
|
|
80
|
-
counterpartType:
|
|
81
|
-
counterpart:
|
|
82
|
-
primaryAddress:
|
|
83
|
-
bankAccounts:
|
|
84
|
-
isBankAccountsLoading:
|
|
85
|
-
isBankAccountsError:
|
|
86
|
-
}),
|
|
87
|
-
items:
|
|
88
|
-
selectedId:
|
|
89
|
-
messages:
|
|
90
|
-
}),
|
|
91
|
-
selectedId:
|
|
92
|
-
primaryAddress:
|
|
93
|
-
messages:
|
|
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:
|
|
96
|
-
setSelectedId:
|
|
97
|
-
detailsView:
|
|
98
|
-
messages:
|
|
96
|
+
selectedId: B,
|
|
97
|
+
setSelectedId: L,
|
|
98
|
+
detailsView: H.detailsView,
|
|
99
|
+
messages: j
|
|
99
100
|
});
|
|
100
101
|
return {
|
|
101
|
-
stateOptions:
|
|
102
|
-
selectedId:
|
|
103
|
-
view:
|
|
104
|
-
table:
|
|
105
|
-
details:
|
|
106
|
-
detailsSheetView:
|
|
107
|
-
if (!
|
|
108
|
-
let e = a(
|
|
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
|
-
...
|
|
111
|
-
subtitle:
|
|
112
|
-
entityTypeLabel:
|
|
113
|
-
taxIdMasked:
|
|
114
|
-
remindersLabel:
|
|
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:
|
|
120
|
+
rejectedAmountLabel: N ? void 0 : o(u),
|
|
120
121
|
isPrimaryAmountLoading: c,
|
|
121
122
|
isBilledAmountLoading: s,
|
|
122
123
|
isReceivedOrPaidAmountLoading: s || c,
|
|
123
|
-
isRejectedAmountLoading:
|
|
124
|
+
isRejectedAmountLoading: N ? void 0 : Y.isLoading
|
|
124
125
|
},
|
|
125
126
|
recentDocuments: y(d),
|
|
126
127
|
paymentMethod: f
|
|
127
128
|
};
|
|
128
129
|
}, [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
138
|
-
|
|
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
|
-
|
|
143
|
-
Z.data,
|
|
144
|
-
Z.isLoading,
|
|
145
|
-
Q.data,
|
|
146
|
-
$.data
|
|
147
|
+
Z.data
|
|
147
148
|
]),
|
|
148
|
-
permissions:
|
|
149
|
-
isPermissionLoading:
|
|
150
|
-
form:
|
|
151
|
-
bank:
|
|
152
|
-
address:
|
|
149
|
+
permissions: P,
|
|
150
|
+
isPermissionLoading: F,
|
|
151
|
+
form: Q,
|
|
152
|
+
bank: le,
|
|
153
|
+
address: $,
|
|
153
154
|
del: ue,
|
|
154
|
-
handleRowClick:
|
|
155
|
-
|
|
156
|
-
}, [
|
|
157
|
-
closeDetails:
|
|
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 {
|
|
167
|
+
export { w as useCounterpartsWidget };
|