@tesouro/embedded-components-react 0.7.17 → 0.7.19
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 +14 -14
- package/dist/index.css +3 -0
- package/dist/index.d.ts +50 -7
- package/dist/lib/CounterpartsWidget.d.ts +49 -6
- package/dist/lib/CounterpartsWidgetPublic.d.ts +49 -6
- package/dist/lib/CustomersWidget.d.ts +49 -6
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index3.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +18 -13
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +146 -137
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +56 -55
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +108 -77
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +181 -25
- 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 +50 -7
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +127 -596
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +66 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +210 -0
- 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 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useInvoicesFilter.js +10 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +141 -125
- 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/ui/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -13,200 +13,209 @@ import { ConfirmDeleteDialog as a } from "../../../../../shared/counterpart-mana
|
|
|
13
13
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
14
14
|
import { CounterpartsWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "../analytics/events.js";
|
|
15
15
|
import { PAGE_SIZE_OPTIONS as c } from "./constants.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { EDIT_FORM_FIELD_KEYS as l, addressFormLabelOverrides as u, buildCounterpartEditFormView as d, editFormLabelOverrides as f, withAddressLabelOverrides as p } from "./viewModels.js";
|
|
17
|
+
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as m } from "../../../../ui/dist/index2.js";
|
|
18
|
+
import { CounterpartsScreen as h } from "../../../../ui/dist/index3.js";
|
|
19
|
+
import { CounterpartDetailsSheet as g } from "../../../../ui/dist/index7.js";
|
|
18
20
|
import "../../../../ui/dist/index.js";
|
|
19
|
-
import { useCounterpartsWidget as
|
|
20
|
-
import { useEffect as
|
|
21
|
-
import { Fragment as
|
|
21
|
+
import { useCounterpartsWidget as _ } from "./useCounterpartsWidget.js";
|
|
22
|
+
import { useEffect as v, useMemo as y } from "react";
|
|
23
|
+
import { Fragment as ee, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
22
24
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js
|
|
23
|
-
function
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
let { stateOptions:
|
|
25
|
+
function S({ counterpartType: n, pageSizeOptions: s = c, onViewAllDocuments: S, onCreateDocument: C, screenLabels: w, formLabels: T, detailsLabels: E, bankAccountLabels: D, addressLabels: O, deleteLabels: k, messageLabels: A }) {
|
|
26
|
+
let j = t();
|
|
27
|
+
v(() => {
|
|
28
|
+
j(o.Mounted);
|
|
29
|
+
}, [j]);
|
|
30
|
+
let { stateOptions: M, isEditDirty: N, isAddressDirty: P, selectedId: F, view: I, table: L, details: R, detailsSheetView: z, permissions: B, isPermissionLoading: V, form: H, bank: U, address: W, del: G, handleRowClick: K, closeDetails: q, handleEditProfile: J } = _({
|
|
29
31
|
counterpartType: n,
|
|
30
|
-
detailsLabels:
|
|
31
|
-
messageLabels:
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
detailsLabels: E,
|
|
33
|
+
messageLabels: A
|
|
34
|
+
}), Y = y(() => p(E, O), [O, E]), X = y(() => u(O), [O]), Z = y(() => f(T), [T]), Q = y(() => I === "edit" ? d(n, H.values, H.errors, {
|
|
35
|
+
...m,
|
|
36
|
+
...Y,
|
|
37
|
+
...Z.labels
|
|
38
|
+
}) : void 0, [
|
|
39
|
+
n,
|
|
40
|
+
Z,
|
|
41
|
+
H.errors,
|
|
42
|
+
H.values,
|
|
43
|
+
Y,
|
|
44
|
+
I
|
|
45
|
+
]), $ = y(() => F && z ? {
|
|
46
|
+
id: F,
|
|
47
|
+
name: z.name
|
|
48
|
+
} : void 0, [z, F]);
|
|
49
|
+
return /* @__PURE__ */ x(ee, { children: [
|
|
50
|
+
/* @__PURE__ */ b(e, {}),
|
|
51
|
+
/* @__PURE__ */ b(h, {
|
|
39
52
|
mode: n,
|
|
40
|
-
counterparts:
|
|
41
|
-
isLoading:
|
|
42
|
-
isError:
|
|
43
|
-
sorting:
|
|
44
|
-
onSortingChange:
|
|
45
|
-
pageSize:
|
|
46
|
-
onPageSizeChange:
|
|
53
|
+
counterparts: L.rows,
|
|
54
|
+
isLoading: V || L.isLoading,
|
|
55
|
+
isError: L.isError,
|
|
56
|
+
sorting: L.sorting,
|
|
57
|
+
onSortingChange: L.onSortingChange,
|
|
58
|
+
pageSize: L.pageSize,
|
|
59
|
+
onPageSizeChange: L.onPageSizeChange,
|
|
47
60
|
pageSizeOptions: s,
|
|
48
|
-
hasNextPage:
|
|
49
|
-
hasPrevPage:
|
|
50
|
-
onNextPage:
|
|
51
|
-
onPrevPage:
|
|
52
|
-
searchValue:
|
|
53
|
-
onSearchChange:
|
|
54
|
-
entityFilter:
|
|
55
|
-
onEntityFilterChange:
|
|
56
|
-
isFiltering:
|
|
57
|
-
canCreate:
|
|
58
|
-
isAccessRestricted: !
|
|
59
|
-
onCreateClick:
|
|
60
|
-
onRowClick:
|
|
61
|
-
onRetry:
|
|
62
|
-
labels:
|
|
61
|
+
hasNextPage: L.hasNextPage,
|
|
62
|
+
hasPrevPage: L.hasPrevPage,
|
|
63
|
+
onNextPage: L.onNextPage,
|
|
64
|
+
onPrevPage: L.onPrevPage,
|
|
65
|
+
searchValue: L.searchValue,
|
|
66
|
+
onSearchChange: L.onSearchChange,
|
|
67
|
+
entityFilter: L.entityFilter,
|
|
68
|
+
onEntityFilterChange: L.onEntityFilterChange,
|
|
69
|
+
isFiltering: L.isFiltering,
|
|
70
|
+
canCreate: B.canCreate,
|
|
71
|
+
isAccessRestricted: !V && !B.canRead,
|
|
72
|
+
onCreateClick: B.canCreate ? H.openCreate : () => void 0,
|
|
73
|
+
onRowClick: K,
|
|
74
|
+
onRetry: L.onRetry,
|
|
75
|
+
labels: w,
|
|
63
76
|
emptyStateTestId: "counterparts-widget-empty-state",
|
|
64
77
|
accessRestrictedTestId: "counterparts-widget-access-restricted"
|
|
65
78
|
}),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
open:
|
|
79
|
+
/* @__PURE__ */ b(r, {
|
|
80
|
+
open: I === "create",
|
|
68
81
|
onOpenChange: (e) => {
|
|
69
|
-
e ||
|
|
82
|
+
e || H.close();
|
|
70
83
|
},
|
|
71
84
|
mode: "create",
|
|
72
85
|
counterpartMode: n,
|
|
73
|
-
values:
|
|
74
|
-
errors:
|
|
75
|
-
stateOptions:
|
|
76
|
-
inProgress:
|
|
77
|
-
submitDisabled:
|
|
78
|
-
onChange: (e) =>
|
|
86
|
+
values: H.values,
|
|
87
|
+
errors: H.errors,
|
|
88
|
+
stateOptions: M,
|
|
89
|
+
inProgress: H.isSubmitting,
|
|
90
|
+
submitDisabled: H.isSubmitting,
|
|
91
|
+
onChange: (e) => H.setValues((t) => ({
|
|
79
92
|
...t,
|
|
80
93
|
...e
|
|
81
94
|
})),
|
|
82
|
-
onAddressChange: (e) =>
|
|
95
|
+
onAddressChange: (e) => H.setValues((t) => ({
|
|
83
96
|
...t,
|
|
84
97
|
address: {
|
|
85
98
|
...t.address,
|
|
86
99
|
...e
|
|
87
100
|
}
|
|
88
101
|
})),
|
|
89
|
-
onBankAccountChange: (e) =>
|
|
102
|
+
onBankAccountChange: (e) => H.setValues((t) => ({
|
|
90
103
|
...t,
|
|
91
104
|
bankAccount: {
|
|
92
105
|
...t.bankAccount,
|
|
93
106
|
...e
|
|
94
107
|
}
|
|
95
108
|
})),
|
|
96
|
-
onSubmit:
|
|
97
|
-
onCancel:
|
|
109
|
+
onSubmit: H.submit,
|
|
110
|
+
onCancel: H.close,
|
|
98
111
|
sections: { address: "collapsible" },
|
|
99
|
-
sectionsToExpand:
|
|
100
|
-
onAddressExpand:
|
|
101
|
-
labels:
|
|
112
|
+
sectionsToExpand: H.sectionsToExpand,
|
|
113
|
+
onAddressExpand: H.expandAddress,
|
|
114
|
+
labels: T
|
|
102
115
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
open:
|
|
116
|
+
/* @__PURE__ */ b(g, {
|
|
117
|
+
open: F !== void 0 && (I === "none" || I === "edit"),
|
|
105
118
|
onOpenChange: (e) => {
|
|
106
|
-
e ||
|
|
119
|
+
e || q();
|
|
107
120
|
},
|
|
108
|
-
privacyResetKey:
|
|
121
|
+
privacyResetKey: F,
|
|
109
122
|
mode: n,
|
|
110
|
-
counterpart:
|
|
111
|
-
isLoading:
|
|
112
|
-
isError:
|
|
113
|
-
canEdit:
|
|
114
|
-
canDelete:
|
|
115
|
-
onEdit:
|
|
116
|
-
onDelete:
|
|
117
|
-
onClose:
|
|
118
|
-
onAddAddress:
|
|
119
|
-
onEditAddress:
|
|
120
|
-
onAddBankAccount:
|
|
121
|
-
onEditBankAccount:
|
|
122
|
-
onViewAllDocuments:
|
|
123
|
-
onCreateDocument:
|
|
124
|
-
onDeleteBankAccount: (e) =>
|
|
123
|
+
counterpart: z,
|
|
124
|
+
isLoading: R.isLoading,
|
|
125
|
+
isError: R.isError,
|
|
126
|
+
canEdit: B.canUpdate,
|
|
127
|
+
canDelete: B.canDelete,
|
|
128
|
+
onEdit: J,
|
|
129
|
+
onDelete: G.requestDeleteCounterpart,
|
|
130
|
+
onClose: q,
|
|
131
|
+
onAddAddress: W.openCreate,
|
|
132
|
+
onEditAddress: W.openEdit,
|
|
133
|
+
onAddBankAccount: U.form.openCreate,
|
|
134
|
+
onEditBankAccount: U.form.openEdit,
|
|
135
|
+
onViewAllDocuments: S && $ ? () => S($) : void 0,
|
|
136
|
+
onCreateDocument: C && $ ? () => C($) : void 0,
|
|
137
|
+
onDeleteBankAccount: (e) => G.requestDelete({
|
|
125
138
|
kind: "bankAccount",
|
|
126
139
|
id: e,
|
|
127
|
-
label:
|
|
140
|
+
label: R.bankItems.find((t) => t.id === e)?.primary ?? ""
|
|
128
141
|
}),
|
|
129
|
-
editForm:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
stateOptions:
|
|
133
|
-
inProgress:
|
|
134
|
-
submitDisabled:
|
|
135
|
-
|
|
142
|
+
editForm: Q && {
|
|
143
|
+
...Q,
|
|
144
|
+
...Z,
|
|
145
|
+
stateOptions: M,
|
|
146
|
+
inProgress: H.isSubmitting,
|
|
147
|
+
submitDisabled: !N,
|
|
148
|
+
onFieldChange: (e, t) => H.setValues((n) => ({
|
|
149
|
+
...n,
|
|
150
|
+
[l[e]]: t
|
|
151
|
+
})),
|
|
152
|
+
onRemindersChange: (e) => H.setValues((t) => ({
|
|
136
153
|
...t,
|
|
137
|
-
|
|
154
|
+
remindersEnabled: e
|
|
138
155
|
})),
|
|
139
|
-
onAddressChange: (e) =>
|
|
156
|
+
onAddressChange: (e) => H.setValues((t) => ({
|
|
140
157
|
...t,
|
|
141
158
|
address: {
|
|
142
159
|
...t.address,
|
|
143
160
|
...e
|
|
144
161
|
}
|
|
145
162
|
})),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
addressForm: L.open ? {
|
|
160
|
-
values: L.values,
|
|
161
|
-
errors: L.errors,
|
|
162
|
-
stateOptions: D,
|
|
163
|
-
inProgress: L.isPending,
|
|
164
|
-
formError: L.formError,
|
|
165
|
-
onChange: (e) => L.setValues((t) => ({
|
|
163
|
+
onSubmit: H.submit,
|
|
164
|
+
onCancel: H.close
|
|
165
|
+
},
|
|
166
|
+
addressForm: W.open ? {
|
|
167
|
+
hasExistingAddress: !!R.primaryAddress,
|
|
168
|
+
values: W.values,
|
|
169
|
+
errors: W.errors,
|
|
170
|
+
stateOptions: M,
|
|
171
|
+
inProgress: W.isPending,
|
|
172
|
+
submitDisabled: !P,
|
|
173
|
+
formError: W.formError,
|
|
174
|
+
...X,
|
|
175
|
+
onChange: (e) => W.setValues((t) => ({
|
|
166
176
|
...t,
|
|
167
177
|
...e
|
|
168
178
|
})),
|
|
169
|
-
onSubmit:
|
|
170
|
-
onCancel:
|
|
171
|
-
labels: C
|
|
179
|
+
onSubmit: W.submit,
|
|
180
|
+
onCancel: W.close
|
|
172
181
|
} : void 0,
|
|
173
|
-
labels:
|
|
182
|
+
labels: Y
|
|
174
183
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
open:
|
|
184
|
+
/* @__PURE__ */ b(i, {
|
|
185
|
+
open: U.form.sheet.open,
|
|
177
186
|
onOpenChange: (e) => {
|
|
178
|
-
e ||
|
|
187
|
+
e || U.form.close();
|
|
179
188
|
},
|
|
180
|
-
mode:
|
|
181
|
-
values:
|
|
182
|
-
errors:
|
|
183
|
-
currencyOptions:
|
|
184
|
-
inProgress:
|
|
185
|
-
onChange: (e) =>
|
|
189
|
+
mode: U.form.sheet.mode,
|
|
190
|
+
values: U.form.values,
|
|
191
|
+
errors: U.form.errors,
|
|
192
|
+
currencyOptions: U.currencyOptions,
|
|
193
|
+
inProgress: U.inProgress,
|
|
194
|
+
onChange: (e) => U.form.setValues((t) => ({
|
|
186
195
|
...t,
|
|
187
196
|
...e
|
|
188
197
|
})),
|
|
189
|
-
onSubmit:
|
|
190
|
-
onCancel:
|
|
191
|
-
labels:
|
|
198
|
+
onSubmit: U.form.submit,
|
|
199
|
+
onCancel: U.form.close,
|
|
200
|
+
labels: D
|
|
192
201
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
open:
|
|
202
|
+
/* @__PURE__ */ b(a, {
|
|
203
|
+
open: G.target !== null,
|
|
195
204
|
onOpenChange: (e) => {
|
|
196
|
-
e ||
|
|
205
|
+
e || G.close();
|
|
197
206
|
},
|
|
198
|
-
title:
|
|
199
|
-
message:
|
|
200
|
-
isDeleting:
|
|
201
|
-
onConfirm:
|
|
202
|
-
onCancel:
|
|
203
|
-
labels:
|
|
207
|
+
title: G.dialogTitle,
|
|
208
|
+
message: G.dialogMessage,
|
|
209
|
+
isDeleting: G.isDeleting,
|
|
210
|
+
onConfirm: G.confirm,
|
|
211
|
+
onCancel: G.close,
|
|
212
|
+
labels: k
|
|
204
213
|
})
|
|
205
214
|
] });
|
|
206
215
|
}
|
|
207
|
-
function
|
|
208
|
-
return /* @__PURE__ */
|
|
209
|
-
widgetName:
|
|
216
|
+
function C({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, passThrough: h, ...g }) {
|
|
217
|
+
return /* @__PURE__ */ b(n, {
|
|
218
|
+
widgetName: h === !0 && e === void 0 && t === void 0 ? void 0 : s,
|
|
210
219
|
baseUrl: e,
|
|
211
220
|
widgetToken: t,
|
|
212
221
|
organizationId: r,
|
|
@@ -220,8 +229,8 @@ function v({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gat
|
|
|
220
229
|
analytics: f,
|
|
221
230
|
disclosuresAcceptance: p,
|
|
222
231
|
providerLabels: m,
|
|
223
|
-
children: /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ b(S, { ...g }, g.counterpartType)
|
|
224
233
|
});
|
|
225
234
|
}
|
|
226
235
|
//#endregion
|
|
227
|
-
export {
|
|
236
|
+
export { C as CounterpartsWidget, C as default };
|
|
@@ -6,92 +6,93 @@ import { buildAnalyticsMap as e, formatMoney as t } from "../../../../../shared/
|
|
|
6
6
|
import { useCounterpartDetails as n } from "../../../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
|
|
7
7
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
8
8
|
import { PAYABLES_BILLED_STATUSES as r, PAYABLES_OWED_STATUSES as i, PAYABLES_REJECTED_STATUSES as a, RECEIVABLES_BILLED_STATUSES as o, RECEIVABLES_DUE_STATUSES as s } from "./constants.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { buildPaymentMethodView as c, buildRecentDocumentRows as l, formatDetailsDate as u, maskTaxId as d } from "./viewModels.js";
|
|
10
|
+
import { usePayablesAnalyticsByCounterpartQuery as f, useReceivablesAnalyticsByCounterpartQuery as p } from "../../../../data-access/dist/index2.js";
|
|
11
|
+
import { useRecentPayablesByCounterpartQuery as m, useRecentReceivablesByCounterpartQuery as h } from "../../../../data-access/dist/index3.js";
|
|
11
12
|
import "../../../../data-access/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import { useMemo as h } from "react";
|
|
13
|
+
import { useMemo as g } from "react";
|
|
14
14
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js
|
|
15
|
-
function
|
|
16
|
-
let
|
|
17
|
-
selectedId:
|
|
18
|
-
enabled:
|
|
19
|
-
}),
|
|
15
|
+
function _({ selectedId: _, isCustomer: v, enabled: y, detailsText: b }) {
|
|
16
|
+
let x = n({
|
|
17
|
+
selectedId: _,
|
|
18
|
+
enabled: y
|
|
19
|
+
}), S = g(() => _ ? [_] : [], [_]), C = S.length > 0, w = p({
|
|
20
20
|
type: "invoice",
|
|
21
21
|
statusIn: [...o],
|
|
22
|
-
counterpartIdIn:
|
|
23
|
-
enabled:
|
|
24
|
-
}),
|
|
22
|
+
counterpartIdIn: S,
|
|
23
|
+
enabled: y && v && C
|
|
24
|
+
}), T = p({
|
|
25
25
|
metric: "amount_due",
|
|
26
26
|
type: "invoice",
|
|
27
27
|
statusIn: [...s],
|
|
28
|
-
counterpartIdIn:
|
|
29
|
-
enabled:
|
|
30
|
-
}),
|
|
28
|
+
counterpartIdIn: S,
|
|
29
|
+
enabled: y && v && C
|
|
30
|
+
}), E = f({
|
|
31
31
|
statusIn: [...r],
|
|
32
|
-
counterpartIdIn:
|
|
33
|
-
enabled:
|
|
34
|
-
}),
|
|
32
|
+
counterpartIdIn: S,
|
|
33
|
+
enabled: y && !v && C
|
|
34
|
+
}), D = f({
|
|
35
35
|
metric: "amount_due",
|
|
36
36
|
statusIn: [...i],
|
|
37
|
-
counterpartIdIn:
|
|
38
|
-
enabled:
|
|
39
|
-
}),
|
|
37
|
+
counterpartIdIn: S,
|
|
38
|
+
enabled: y && !v && C
|
|
39
|
+
}), O = f({
|
|
40
40
|
statusIn: [...a],
|
|
41
|
-
counterpartIdIn:
|
|
42
|
-
enabled:
|
|
43
|
-
}),
|
|
44
|
-
counterpartId:
|
|
45
|
-
enabled:
|
|
46
|
-
}),
|
|
47
|
-
counterpartId:
|
|
48
|
-
enabled:
|
|
41
|
+
counterpartIdIn: S,
|
|
42
|
+
enabled: y && !v && C
|
|
43
|
+
}), k = h({
|
|
44
|
+
counterpartId: _,
|
|
45
|
+
enabled: y && v && C
|
|
46
|
+
}), A = m({
|
|
47
|
+
counterpartId: _,
|
|
48
|
+
enabled: y && !v && C
|
|
49
49
|
});
|
|
50
50
|
return {
|
|
51
|
-
details:
|
|
52
|
-
detailsSheetView:
|
|
53
|
-
if (!
|
|
54
|
-
let n = e(
|
|
51
|
+
details: x,
|
|
52
|
+
detailsSheetView: g(() => {
|
|
53
|
+
if (!x.detailsView || !_) return;
|
|
54
|
+
let n = e(v ? w.data?.data : E.data?.data), r = e(v ? T.data?.data : D.data?.data), i = n.get(_) ?? 0, a = r.get(_) ?? 0, o = i - a, s = v ? w.isLoading : E.isLoading, f = v ? T.isLoading : D.isLoading, p = e(O.data?.data), m = v ? 0 : p.get(_) ?? 0, h = v ? k.data?.data : A.data?.data, g = c(x.bankAccounts?.[0], b.paymentMethodTitle), y = v ? b.customerSubtitleLabel : b.vendorSubtitleLabel;
|
|
55
55
|
return {
|
|
56
|
-
...
|
|
57
|
-
subtitle:
|
|
58
|
-
entityTypeLabel:
|
|
59
|
-
taxIdMasked:
|
|
60
|
-
remindersLabel:
|
|
56
|
+
...x.detailsView,
|
|
57
|
+
subtitle: b.subtitleTemplate.replace("{type}", y).replace("{date}", u(x.counterpart?.created_at)),
|
|
58
|
+
entityTypeLabel: x.detailsView.entityType === "individual" ? b.entityTypePersonLabel : b.entityTypeBusinessLabel,
|
|
59
|
+
taxIdMasked: d(x.detailsView.taxId),
|
|
60
|
+
remindersLabel: x.counterpart?.reminders_enabled ? b.remindersEnabledLabel : b.remindersDisabledLabel,
|
|
61
61
|
summary: {
|
|
62
62
|
primaryAmountLabel: t(a),
|
|
63
63
|
billedAmountLabel: t(i),
|
|
64
64
|
receivedOrPaidAmountLabel: t(o),
|
|
65
|
-
rejectedAmountLabel:
|
|
66
|
-
isPrimaryAmountLoading:
|
|
65
|
+
rejectedAmountLabel: v ? void 0 : t(m),
|
|
66
|
+
isPrimaryAmountLoading: f,
|
|
67
67
|
isBilledAmountLoading: s,
|
|
68
|
-
isReceivedOrPaidAmountLoading: s ||
|
|
69
|
-
isRejectedAmountLoading:
|
|
68
|
+
isReceivedOrPaidAmountLoading: s || f,
|
|
69
|
+
isRejectedAmountLoading: v ? void 0 : O.isLoading
|
|
70
70
|
},
|
|
71
|
-
recentDocuments:
|
|
72
|
-
paymentMethod:
|
|
71
|
+
recentDocuments: l(h, v ? "invoice" : "bill", b),
|
|
72
|
+
paymentMethod: g
|
|
73
73
|
};
|
|
74
74
|
}, [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
x.detailsView,
|
|
76
|
+
x.bankAccounts,
|
|
77
|
+
x.counterpart?.reminders_enabled,
|
|
78
|
+
x.counterpart?.created_at,
|
|
79
79
|
_,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
C.isLoading,
|
|
83
|
-
T.data,
|
|
84
|
-
T.isLoading,
|
|
80
|
+
v,
|
|
81
|
+
b,
|
|
85
82
|
w.data,
|
|
86
83
|
w.isLoading,
|
|
87
84
|
E.data,
|
|
88
85
|
E.isLoading,
|
|
86
|
+
T.data,
|
|
87
|
+
T.isLoading,
|
|
89
88
|
D.data,
|
|
90
89
|
D.isLoading,
|
|
91
90
|
O.data,
|
|
92
|
-
|
|
91
|
+
O.isLoading,
|
|
92
|
+
k.data,
|
|
93
|
+
A.data
|
|
93
94
|
])
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
97
|
//#endregion
|
|
97
|
-
export {
|
|
98
|
+
export { _ as useCounterpartDetailsSheetView };
|