@tesouro/embedded-components-react 0.11.169 → 0.11.172
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 +10 -6
- package/dist/index.d.ts +15 -4
- package/dist/lib/BillPayWidget.d.ts +9 -4
- package/dist/lib/ReceivablesWidget.d.ts +6 -0
- package/dist/lib/WidgetSuite.d.ts +6 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +75 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +62 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +44 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +331 -326
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +10 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +190 -187
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +12 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +25 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +4 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +23 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +196 -187
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +8 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +20 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +11 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +313 -324
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +46 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +45 -22
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/index.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/resolveBillDueDate.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +116 -98
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +99 -92
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +7 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +15 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +59 -69
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DateDisclosure/DateDisclosure.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DueDateText/DueDateText.js +19 -0
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +28 -27
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/dueDateDisplay.js +23 -0
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
|
@@ -16,33 +16,34 @@ import { hasSuspectedPayableDuplicate as s, suspectedPayableDuplicates as c } fr
|
|
|
16
16
|
import { compareByArrival as l, duplicateVerdictMatches as u, resolveDuplicateOriginalId as d } from "../../../util/dist/lib/groupDuplicates.js";
|
|
17
17
|
import { isEditablePayableStatus as f } from "../../../util/dist/lib/isEditablePayableStatus.js";
|
|
18
18
|
import { payableRemoval as p } from "../../../util/dist/lib/payableRemoval.js";
|
|
19
|
+
import { resolveBillDueDate as m } from "../../../util/dist/lib/resolveBillDueDate.js";
|
|
19
20
|
import { resolveVendorName as ee } from "../../../util/dist/lib/resolveVendor.js";
|
|
20
|
-
import { buildGroupCollapse as
|
|
21
|
+
import { buildGroupCollapse as h } from "../../../util/dist/lib/groupCollapse.js";
|
|
21
22
|
import "../../../util/dist/index.js";
|
|
22
23
|
import { derivePayableStatus as te } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
|
|
23
|
-
import { useApplyDuplicateVerdictsMutation as
|
|
24
|
+
import { useApplyDuplicateVerdictsMutation as g } from "../../../data-access/dist/lib/useApplyDuplicateVerdictsMutation.js";
|
|
24
25
|
import "../../../data-access/dist/index.js";
|
|
25
|
-
import { BillColumn as
|
|
26
|
+
import { BillColumn as _ } from "../../ui/dist/index19.js";
|
|
26
27
|
import "../../ui/dist/index.js";
|
|
27
|
-
import { BillQueue as
|
|
28
|
-
import { duplicateRemovalPrompt as
|
|
29
|
-
import { useBillsFilters as
|
|
30
|
-
import { BillVendorLookup as
|
|
31
|
-
import { useFirstPayablesPagesQuery as
|
|
32
|
-
import { usePayablesQuery as
|
|
33
|
-
import { usePayablesTotalCountQuery as
|
|
28
|
+
import { BillQueue as v, DEFAULT_BILL_QUEUE as y, billQueueColumns as b, billQueueFilters as x, billQueueOffersAddPanel as ne, billSortColumnId as re, billSortField as ie } from "./index5.js";
|
|
29
|
+
import { duplicateRemovalPrompt as ae } from "./index11.js";
|
|
30
|
+
import { useBillsFilters as oe } from "./index14.js";
|
|
31
|
+
import { BillVendorLookup as se, useBillVendorNames as ce } from "./index15.js";
|
|
32
|
+
import { useFirstPayablesPagesQuery as le } from "../../data-access/dist/index2.js";
|
|
33
|
+
import { usePayablesQuery as ue } from "../../data-access/dist/index4.js";
|
|
34
|
+
import { usePayablesTotalCountQuery as de } from "../../data-access/dist/index5.js";
|
|
34
35
|
import "../../data-access/dist/index.js";
|
|
35
|
-
import { useCallback as
|
|
36
|
-
import { BanIcon as
|
|
36
|
+
import { useCallback as S, useEffect as fe, useMemo as C, useState as w } from "react";
|
|
37
|
+
import { BanIcon as pe, FileCheckIcon as me, Trash2Icon as he } from "lucide-react";
|
|
37
38
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js
|
|
38
|
-
var
|
|
39
|
+
var ge = 10, T = 100, _e = 3, ve = [{
|
|
39
40
|
id: "addedOnLabel",
|
|
40
41
|
desc: !0
|
|
41
|
-
}],
|
|
42
|
+
}], E = {
|
|
42
43
|
AllBills: "allBills",
|
|
43
44
|
PossibleDuplicates: "possibleDuplicates"
|
|
44
45
|
};
|
|
45
|
-
function
|
|
46
|
+
function ye(e, t) {
|
|
46
47
|
let n = new Map(e.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map(), i = (e) => {
|
|
47
48
|
r.has(e) || r.set(e, /* @__PURE__ */ new Set());
|
|
48
49
|
}, a = (e, t) => {
|
|
@@ -65,11 +66,11 @@ function xe(e, t) {
|
|
|
65
66
|
for (let t of r.get(e) ?? []) s.has(t) || (s.add(t), a.push(t));
|
|
66
67
|
}
|
|
67
68
|
if (i.length === 0) continue;
|
|
68
|
-
let c = i.map((e) => n.get(e)).filter((e) => !!e).sort(l), u = d(c), [f] = c, p = ee(f), m = f?.document_id ?? "",
|
|
69
|
+
let c = i.map((e) => n.get(e)).filter((e) => !!e).sort(l), u = d(c), [f] = c, p = ee(f), m = f?.document_id ?? "", h = u ?? f?.id ?? e, te = `duplicate-group:${p || m ? `${p}|${m}` : h}`;
|
|
69
70
|
o.push({
|
|
70
71
|
componentIds: i,
|
|
71
|
-
baseKey:
|
|
72
|
-
anchorId:
|
|
72
|
+
baseKey: te,
|
|
73
|
+
anchorId: h,
|
|
73
74
|
group: {
|
|
74
75
|
label: t.groupHeader({
|
|
75
76
|
vendorLabel: p,
|
|
@@ -95,68 +96,68 @@ function xe(e, t) {
|
|
|
95
96
|
}
|
|
96
97
|
return f;
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
-
let
|
|
100
|
-
d !== void 0 &&
|
|
101
|
-
let
|
|
102
|
-
|
|
99
|
+
function be({ enabled: c = !0, canPay: d, canReadVendors: h = !0, isVendorFilterPaused: se = !1, filterLabels: be, onOpenBill: we, duplicateRowNote: Te, attachmentLabel: Ee, duplicateGroupLabels: D, canManageDuplicates: De = !1, duplicateView: O = E.AllBills, scheduledRelativeDayLabels: Oe, dueDateLabels: ke }) {
|
|
100
|
+
let k = i(), [A, Ae] = w(y), [je, Me] = w(ve), [j, Ne] = w(ge), [Pe, M] = w(), [Fe, Ie] = w(d);
|
|
101
|
+
d !== void 0 && Fe !== d && (Ie(d), M(void 0));
|
|
102
|
+
let Le = d ?? Fe, [Re, ze] = w(0), [N, Be] = w(""), [P, Ve] = w(""), [F, He] = w(), [I, Ue] = w(), L = S(() => {
|
|
103
|
+
M(void 0), ze(0);
|
|
103
104
|
}, []);
|
|
104
|
-
|
|
105
|
-
if (
|
|
105
|
+
fe(() => {
|
|
106
|
+
if (N === P) return;
|
|
106
107
|
let e = setTimeout(() => {
|
|
107
|
-
|
|
108
|
+
Ve(N), L();
|
|
108
109
|
}, 300);
|
|
109
110
|
return () => clearTimeout(e);
|
|
110
111
|
}, [
|
|
111
|
-
j,
|
|
112
112
|
N,
|
|
113
|
+
P,
|
|
113
114
|
L
|
|
114
|
-
]),
|
|
115
|
+
]), fe(() => {
|
|
115
116
|
L();
|
|
116
|
-
}, [
|
|
117
|
-
let R =
|
|
118
|
-
offersStatusFilter:
|
|
119
|
-
offersVendorFilter:
|
|
120
|
-
isVendorFilterPaused:
|
|
121
|
-
labels:
|
|
117
|
+
}, [O, L]);
|
|
118
|
+
let R = O === E.PossibleDuplicates, z = oe({
|
|
119
|
+
offersStatusFilter: A === v.All && !R,
|
|
120
|
+
offersVendorFilter: h,
|
|
121
|
+
isVendorFilterPaused: se,
|
|
122
|
+
labels: be,
|
|
122
123
|
onFiltersChange: L
|
|
123
|
-
}), { clearAll:
|
|
124
|
-
let e =
|
|
124
|
+
}), { clearAll: We, filterByVendor: Ge } = z, Ke = je[0], qe = ie(Ke?.id), Je = qe ? Ke?.desc ? "desc" : "asc" : void 0, B = R ? v.All : A, Ye = C(() => {
|
|
125
|
+
let e = x(B, Le ?? !1);
|
|
125
126
|
return {
|
|
126
127
|
...z.query,
|
|
127
128
|
...e,
|
|
128
|
-
limit: R ?
|
|
129
|
-
pagination_token: R ? void 0 :
|
|
129
|
+
limit: R ? T : j,
|
|
130
|
+
pagination_token: R ? void 0 : Pe,
|
|
130
131
|
status__in: R ? void 0 : e.status__in ?? z.query.status__in,
|
|
131
132
|
duplicate_match_status: R ? "suspected" : void 0,
|
|
132
|
-
counterpart_name__icontains:
|
|
133
|
-
sort:
|
|
134
|
-
order:
|
|
133
|
+
counterpart_name__icontains: P || void 0,
|
|
134
|
+
sort: qe,
|
|
135
|
+
order: Je
|
|
135
136
|
};
|
|
136
137
|
}, [
|
|
137
138
|
z.query,
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
j,
|
|
140
|
+
Pe,
|
|
140
141
|
R,
|
|
141
142
|
B,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
]), { organizationId:
|
|
147
|
-
...
|
|
143
|
+
Le,
|
|
144
|
+
P,
|
|
145
|
+
qe,
|
|
146
|
+
Je
|
|
147
|
+
]), { organizationId: Xe } = r(), V = JSON.stringify([Xe, Ye]), H = ue({
|
|
148
|
+
...Ye,
|
|
148
149
|
enabled: c && d !== void 0 && !R,
|
|
149
150
|
pollWhileOcrProcessing: !0
|
|
150
|
-
}), U =
|
|
151
|
-
...
|
|
151
|
+
}), U = le({
|
|
152
|
+
...Ye,
|
|
152
153
|
enabled: c && R,
|
|
153
|
-
maxPages:
|
|
154
|
+
maxPages: _e
|
|
154
155
|
}), W = R ? {
|
|
155
156
|
...U,
|
|
156
157
|
data: { data: U.payables },
|
|
157
158
|
isLoading: U.isResolving,
|
|
158
159
|
isFetching: U.isFetching || U.isResolving
|
|
159
|
-
} : H, G = (W.data?.data ?? []).filter((e) => e.ocr_status !== "processing"), K =
|
|
160
|
+
} : H, G = (W.data?.data ?? []).filter((e) => e.ocr_status !== "processing"), K = g(), q = S(async (t, n, r, i) => {
|
|
160
161
|
let a = u(t, n, i);
|
|
161
162
|
if (a.length) try {
|
|
162
163
|
await K.mutateAsync({
|
|
@@ -169,54 +170,54 @@ function Se({ enabled: c = !0, canPay: d, canReadVendors: m = !0, isVendorFilter
|
|
|
169
170
|
}))
|
|
170
171
|
}), e.success(r);
|
|
171
172
|
} catch {
|
|
172
|
-
e.error(
|
|
173
|
+
e.error(D.actionFailedToast);
|
|
173
174
|
}
|
|
174
|
-
}, [K,
|
|
175
|
+
}, [K, D.actionFailedToast]), J = C(() => ({
|
|
175
176
|
delete: {
|
|
176
|
-
action:
|
|
177
|
-
title:
|
|
178
|
-
description:
|
|
179
|
-
confirmButton:
|
|
180
|
-
backButton:
|
|
181
|
-
toast:
|
|
177
|
+
action: D.deleteAction,
|
|
178
|
+
title: D.deleteConfirmTitle,
|
|
179
|
+
description: D.deleteConfirmDescription,
|
|
180
|
+
confirmButton: D.deleteConfirmButton,
|
|
181
|
+
backButton: D.cancelConfirmBackButton,
|
|
182
|
+
toast: D.deletedToast
|
|
182
183
|
},
|
|
183
184
|
cancel: {
|
|
184
|
-
action:
|
|
185
|
-
title:
|
|
186
|
-
description:
|
|
187
|
-
confirmButton:
|
|
188
|
-
backButton:
|
|
189
|
-
toast:
|
|
185
|
+
action: D.cancelAction,
|
|
186
|
+
title: D.cancelConfirmTitle,
|
|
187
|
+
description: D.cancelConfirmDescription,
|
|
188
|
+
confirmButton: D.cancelConfirmButton,
|
|
189
|
+
backButton: D.cancelConfirmBackButton,
|
|
190
|
+
toast: D.cancelledToast
|
|
190
191
|
},
|
|
191
192
|
confirm: {
|
|
192
|
-
action:
|
|
193
|
-
title:
|
|
194
|
-
description:
|
|
195
|
-
confirmButton:
|
|
196
|
-
backButton:
|
|
197
|
-
toast:
|
|
193
|
+
action: D.confirmAction,
|
|
194
|
+
title: D.confirmDuplicateTitle,
|
|
195
|
+
description: D.confirmDuplicateDescription,
|
|
196
|
+
confirmButton: D.confirmDuplicateButton,
|
|
197
|
+
backButton: D.cancelConfirmBackButton,
|
|
198
|
+
toast: D.confirmedToast
|
|
198
199
|
}
|
|
199
|
-
}), [
|
|
200
|
-
|
|
200
|
+
}), [D]), Ze = F?.removeBy ?? "cancel", Qe = S(async () => {
|
|
201
|
+
F && (await q(F.payable, a.Remove, J[F.removeBy].toast), He(void 0));
|
|
201
202
|
}, [
|
|
202
203
|
q,
|
|
203
|
-
|
|
204
|
+
F,
|
|
204
205
|
J
|
|
205
|
-
]),
|
|
206
|
-
I && (await q(I.payable, a.Keep,
|
|
206
|
+
]), $e = S(async () => {
|
|
207
|
+
I && (await q(I.payable, a.Keep, D.dismissedToast, I.originalPayableId), Ue(void 0));
|
|
207
208
|
}, [
|
|
208
209
|
q,
|
|
209
|
-
|
|
210
|
+
D.dismissedToast,
|
|
210
211
|
I
|
|
211
|
-
]), [
|
|
212
|
-
|
|
213
|
-
W.isFetching ||
|
|
212
|
+
]), [et, tt] = w(V);
|
|
213
|
+
fe(() => {
|
|
214
|
+
W.isFetching || tt(V);
|
|
214
215
|
}, [W.isFetching, V]);
|
|
215
|
-
let
|
|
216
|
-
|
|
216
|
+
let nt = W.data?.data.length, rt = nt === 0, it = de({ enabled: c && rt }), at = !rt || (it.data?.count ?? 1) > 0, Y = C(() => O === E.PossibleDuplicates ? ye(G, D) : /* @__PURE__ */ new Map(), [
|
|
217
|
+
O,
|
|
217
218
|
G,
|
|
218
|
-
|
|
219
|
-
]),
|
|
219
|
+
D
|
|
220
|
+
]), ot = C(() => {
|
|
220
221
|
if (Y.size === 0) return G;
|
|
221
222
|
let e = /* @__PURE__ */ new Map();
|
|
222
223
|
return G.forEach((t, n) => {
|
|
@@ -227,191 +228,199 @@ function Se({ enabled: c = !0, canPay: d, canReadVendors: m = !0, isVendorFilter
|
|
|
227
228
|
index: n,
|
|
228
229
|
order: e.get(Y.get(t.id)?.key ?? "") ?? n
|
|
229
230
|
})).sort((e, t) => e.order - t.order || l(e.payable, t.payable) || e.index - t.index).map(({ payable: e }) => e);
|
|
230
|
-
}, [G, Y]), { vendorNames: X, lookup:
|
|
231
|
+
}, [G, Y]), { vendorNames: X, lookup: st } = ce({
|
|
231
232
|
payables: W.data?.data,
|
|
232
233
|
enabled: c,
|
|
233
|
-
canReadVendors:
|
|
234
|
-
isPaused:
|
|
235
|
-
}),
|
|
234
|
+
canReadVendors: h,
|
|
235
|
+
isPaused: se
|
|
236
|
+
}), ct = S((e) => {
|
|
236
237
|
let t = e.title || (e.vendorCounterpartId ? X.get(e.vendorCounterpartId) ?? "" : "");
|
|
237
238
|
return {
|
|
238
239
|
key: e.key,
|
|
239
|
-
label: t === e.title ? e.label :
|
|
240
|
+
label: t === e.title ? e.label : D.groupHeader({
|
|
240
241
|
vendorLabel: t,
|
|
241
242
|
invoiceNumberLabel: e.invoiceNumberLabel
|
|
242
243
|
}),
|
|
243
244
|
title: t,
|
|
244
245
|
meta: e.meta
|
|
245
246
|
};
|
|
246
|
-
}, [X,
|
|
247
|
+
}, [X, D]), Z = C(() => xe(ot.map((e) => {
|
|
247
248
|
let r = te({
|
|
248
249
|
apiStatus: e.status,
|
|
249
250
|
dueDate: e.due_date,
|
|
250
251
|
scheduledPaymentDate: e.scheduled_payment_date
|
|
251
|
-
}), i = e.amount_due ?? e.total_amount, a = e.status === "partially_paid" || e.status === "paid", c = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" }), l = o(e.scheduled_payment_date,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
}), i = e.amount_due ?? e.total_amount, a = e.status === "partially_paid" || e.status === "paid", c = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" }), l = o(e.scheduled_payment_date, Oe, k), u = m({
|
|
253
|
+
status: e.status,
|
|
254
|
+
dueDate: e.due_date,
|
|
255
|
+
today: k,
|
|
256
|
+
isScheduled: r.status === "scheduled",
|
|
257
|
+
labels: ke
|
|
258
|
+
}), d = Y.get(e.id), h = s(e), g = ee(e) || (e.counterpart_id ? X.get(e.counterpart_id) ?? "" : ""), _ = e.document_id ?? "", y = p(e.status), b = d?.originalPayableId !== void 0 && d.originalPayableId === e.id, x = R && h && De && d ? {
|
|
259
|
+
triggerLabel: D.menuTrigger({
|
|
260
|
+
vendorLabel: g,
|
|
261
|
+
invoiceNumberLabel: _
|
|
255
262
|
}),
|
|
256
263
|
items: [{
|
|
257
264
|
id: "not-duplicate",
|
|
258
|
-
label:
|
|
259
|
-
icon:
|
|
265
|
+
label: D.notDuplicateAction,
|
|
266
|
+
icon: me,
|
|
260
267
|
disabled: K.isPending,
|
|
261
|
-
onSelect: () =>
|
|
268
|
+
onSelect: () => Ue({
|
|
262
269
|
payable: e,
|
|
263
|
-
originalPayableId:
|
|
270
|
+
originalPayableId: b ? void 0 : d.originalPayableId
|
|
264
271
|
})
|
|
265
|
-
}, ...
|
|
272
|
+
}, ...y ? [{
|
|
266
273
|
id: "cancel-duplicate",
|
|
267
|
-
label: J[
|
|
268
|
-
icon:
|
|
274
|
+
label: J[y].action,
|
|
275
|
+
icon: y === "delete" ? he : pe,
|
|
269
276
|
disabled: K.isPending,
|
|
270
|
-
onSelect: () =>
|
|
277
|
+
onSelect: () => He({
|
|
271
278
|
payable: e,
|
|
272
|
-
removeBy:
|
|
279
|
+
removeBy: y
|
|
273
280
|
})
|
|
274
281
|
}] : []]
|
|
275
282
|
} : void 0;
|
|
276
283
|
return {
|
|
277
284
|
rowKey: e.id,
|
|
278
|
-
vendorLabel:
|
|
279
|
-
vendorLookup:
|
|
280
|
-
invoiceNumberLabel:
|
|
285
|
+
vendorLabel: g,
|
|
286
|
+
vendorLookup: g || !e.counterpart_id ? void 0 : Ce(st),
|
|
287
|
+
invoiceNumberLabel: _,
|
|
281
288
|
issueDateLabel: t(e.issued_at),
|
|
282
|
-
dueDateLabel:
|
|
283
|
-
|
|
289
|
+
dueDateLabel: u.label,
|
|
290
|
+
dueDateOverdueLabel: u.overdueLabel,
|
|
291
|
+
dueDateAccessibleLabel: u.accessibleLabel,
|
|
284
292
|
scheduledDateLabel: l.label,
|
|
285
293
|
scheduledDateExact: l.absoluteLabel,
|
|
286
|
-
scheduledDateIsGap: B ===
|
|
294
|
+
scheduledDateIsGap: B === v.Scheduled,
|
|
287
295
|
paidDateLabel: t(e.paid_at?.slice(0, 10)),
|
|
288
296
|
amountDueLabel: c(i),
|
|
289
297
|
amountPaidLabel: a ? c(e.amount_paid) : "",
|
|
290
|
-
amountPaidIsGap: B ===
|
|
298
|
+
amountPaidIsGap: B === v.Paid,
|
|
291
299
|
amountScheduledLabel: c(e.amount_to_pay ?? i),
|
|
292
300
|
totalAmountLabel: c(e.total_amount),
|
|
293
|
-
attachment: e.file_id ? { label:
|
|
301
|
+
attachment: e.file_id ? { label: Ee } : void 0,
|
|
294
302
|
status: r.status,
|
|
295
303
|
statusTone: r.tone,
|
|
296
304
|
addedOnLabel: t(e.created_at?.slice(0, 10)),
|
|
297
|
-
...
|
|
298
|
-
...
|
|
299
|
-
...!R && !
|
|
305
|
+
...d ? { group: ct(d) } : {},
|
|
306
|
+
...x ? { menu: x } : {},
|
|
307
|
+
...!R && !d && h ? {
|
|
300
308
|
marker: "duplicate",
|
|
301
|
-
rowNote:
|
|
309
|
+
rowNote: Te
|
|
302
310
|
} : {},
|
|
303
|
-
onOpen: () =>
|
|
311
|
+
onOpen: () => we(e.id, f(e.status))
|
|
304
312
|
};
|
|
305
|
-
}),
|
|
306
|
-
|
|
313
|
+
}), D), [
|
|
314
|
+
ot,
|
|
307
315
|
Y,
|
|
308
|
-
|
|
316
|
+
D,
|
|
309
317
|
J,
|
|
310
318
|
K.isPending,
|
|
311
|
-
ke,
|
|
312
|
-
R,
|
|
313
319
|
De,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
je,
|
|
320
|
+
R,
|
|
321
|
+
Te,
|
|
317
322
|
Ee,
|
|
323
|
+
Oe,
|
|
324
|
+
ke,
|
|
325
|
+
k,
|
|
326
|
+
we,
|
|
318
327
|
B,
|
|
319
328
|
X,
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
]),
|
|
329
|
+
st,
|
|
330
|
+
ct
|
|
331
|
+
]), lt = C(() => R ? Se(Z, T) : [], [Z, R]), Q = Math.min(Re, Math.max(0, lt.length - 1)), ut = R ? lt[Q] ?? [] : Z, $ = S((e) => {
|
|
323
332
|
let t = e;
|
|
324
|
-
|
|
333
|
+
Ae(t), Me((e) => {
|
|
325
334
|
let n = e[0]?.id;
|
|
326
|
-
return n ?
|
|
335
|
+
return n ? b(t).some((e) => re(e) === n) ? e : ve : e;
|
|
327
336
|
}), L();
|
|
328
|
-
}, [L]),
|
|
329
|
-
$(
|
|
330
|
-
}, [
|
|
331
|
-
|
|
332
|
-
}, [
|
|
333
|
-
|
|
334
|
-
}, [L]),
|
|
335
|
-
|
|
336
|
-
}, [L]),
|
|
337
|
-
R ?
|
|
337
|
+
}, [L]), dt = S((e) => {
|
|
338
|
+
$(v.All), Be(""), Ge(e);
|
|
339
|
+
}, [Ge, $]), ft = S(() => {
|
|
340
|
+
Be(""), Ve(""), We(), L();
|
|
341
|
+
}, [We, L]), pt = S((e) => {
|
|
342
|
+
Me((t) => typeof e == "function" ? e(t) : e), L();
|
|
343
|
+
}, [L]), mt = S((e) => {
|
|
344
|
+
Ne(e), L();
|
|
345
|
+
}, [L]), ht = S(() => {
|
|
346
|
+
R ? ze(Q + 1) : M(H.data?.next_pagination_token ?? void 0);
|
|
338
347
|
}, [
|
|
339
348
|
Q,
|
|
340
349
|
R,
|
|
341
350
|
H.data?.next_pagination_token
|
|
342
|
-
]),
|
|
343
|
-
R ?
|
|
351
|
+
]), gt = S(() => {
|
|
352
|
+
R ? ze(Math.max(0, Q - 1)) : M(H.data?.prev_pagination_token ?? void 0);
|
|
344
353
|
}, [
|
|
345
354
|
Q,
|
|
346
355
|
R,
|
|
347
356
|
H.data?.prev_pagination_token
|
|
348
|
-
]),
|
|
357
|
+
]), _t = S(() => {
|
|
349
358
|
W.refetch();
|
|
350
359
|
}, [W.refetch]);
|
|
351
360
|
return {
|
|
352
|
-
rows:
|
|
353
|
-
isLoading: W.isLoading || !R &&
|
|
361
|
+
rows: ut,
|
|
362
|
+
isLoading: W.isLoading || !R && Le === void 0 || V !== et || rt && it.isLoading || (nt ?? 0) > 0 && ut.length === 0,
|
|
354
363
|
isError: W.isError,
|
|
355
|
-
onRetry:
|
|
356
|
-
selectedFilterTabId:
|
|
364
|
+
onRetry: _t,
|
|
365
|
+
selectedFilterTabId: A,
|
|
357
366
|
onFilterTabChange: $,
|
|
358
|
-
showVendorBills:
|
|
359
|
-
clearQueryConstraints:
|
|
360
|
-
searchValue:
|
|
361
|
-
onSearchChange:
|
|
362
|
-
hasAnyBills:
|
|
363
|
-
isSearchActive:
|
|
367
|
+
showVendorBills: dt,
|
|
368
|
+
clearQueryConstraints: ft,
|
|
369
|
+
searchValue: N,
|
|
370
|
+
onSearchChange: Be,
|
|
371
|
+
hasAnyBills: at,
|
|
372
|
+
isSearchActive: P.length > 0 || z.isFilterActive,
|
|
364
373
|
filterBarProps: z.filterBarProps,
|
|
365
374
|
visibleColumns: R ? [
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
] :
|
|
375
|
+
_.AddedOn,
|
|
376
|
+
_.DueDate,
|
|
377
|
+
_.AmountDue,
|
|
378
|
+
_.Status
|
|
379
|
+
] : b(A),
|
|
371
380
|
keepsColumnOrder: R,
|
|
372
381
|
isSortable: !R,
|
|
373
|
-
pageInfo: R ?
|
|
382
|
+
pageInfo: R ? D.pageInfo({
|
|
374
383
|
billCount: Z.length,
|
|
375
384
|
invoiceCount: new Set(Z.map((e) => e.group?.key ?? e.rowKey)).size
|
|
376
385
|
}) : void 0,
|
|
377
|
-
showAddPanelWhenEmpty: !R &&
|
|
378
|
-
sorting:
|
|
379
|
-
onSortingChange:
|
|
380
|
-
pageSize: R ?
|
|
381
|
-
pageSizeOptions: R ? [
|
|
382
|
-
onPageSizeChange:
|
|
383
|
-
hasNextPage: R ? Q <
|
|
386
|
+
showAddPanelWhenEmpty: !R && ne(A),
|
|
387
|
+
sorting: je,
|
|
388
|
+
onSortingChange: pt,
|
|
389
|
+
pageSize: R ? T : j,
|
|
390
|
+
pageSizeOptions: R ? [T] : void 0,
|
|
391
|
+
onPageSizeChange: mt,
|
|
392
|
+
hasNextPage: R ? Q < lt.length - 1 : !!H.data?.next_pagination_token,
|
|
384
393
|
hasPrevPage: R ? Q > 0 : !!H.data?.prev_pagination_token,
|
|
385
|
-
onNextPage:
|
|
386
|
-
onPrevPage:
|
|
394
|
+
onNextPage: ht,
|
|
395
|
+
onPrevPage: gt,
|
|
387
396
|
cancelConfirmation: {
|
|
388
|
-
open: !!
|
|
389
|
-
copy:
|
|
390
|
-
onConfirm: () => void
|
|
391
|
-
onCancel: () =>
|
|
397
|
+
open: !!F,
|
|
398
|
+
copy: ae(J[Ze], Ze),
|
|
399
|
+
onConfirm: () => void Qe(),
|
|
400
|
+
onCancel: () => He(void 0),
|
|
392
401
|
isPending: K.isPending,
|
|
393
|
-
cancelButtonLabel: J[
|
|
402
|
+
cancelButtonLabel: J[Ze].backButton
|
|
394
403
|
},
|
|
395
404
|
keepConfirmation: {
|
|
396
405
|
open: !!I,
|
|
397
406
|
copy: {
|
|
398
|
-
title:
|
|
399
|
-
description:
|
|
400
|
-
confirmButton:
|
|
407
|
+
title: D.notDuplicateConfirmTitle,
|
|
408
|
+
description: D.notDuplicateConfirmDescription,
|
|
409
|
+
confirmButton: D.notDuplicateConfirmButton,
|
|
401
410
|
presentation: {
|
|
402
411
|
alignment: "center",
|
|
403
|
-
icon:
|
|
412
|
+
icon: me,
|
|
404
413
|
actionWidth: "equal"
|
|
405
414
|
}
|
|
406
415
|
},
|
|
407
|
-
onConfirm: () => void
|
|
408
|
-
onCancel: () =>
|
|
416
|
+
onConfirm: () => void $e(),
|
|
417
|
+
onCancel: () => Ue(void 0),
|
|
409
418
|
isPending: K.isPending,
|
|
410
|
-
cancelButtonLabel:
|
|
419
|
+
cancelButtonLabel: D.notDuplicateConfirmBackButton
|
|
411
420
|
}
|
|
412
421
|
};
|
|
413
422
|
}
|
|
414
|
-
function
|
|
423
|
+
function xe(e, t) {
|
|
415
424
|
let n = /* @__PURE__ */ new Map();
|
|
416
425
|
for (let t of e) {
|
|
417
426
|
if (!t.group) continue;
|
|
@@ -420,7 +429,7 @@ function Ce(e, t) {
|
|
|
420
429
|
}
|
|
421
430
|
return e.map((e) => {
|
|
422
431
|
if (!e.group) return e;
|
|
423
|
-
let r =
|
|
432
|
+
let r = h({
|
|
424
433
|
statuses: n.get(e.group.key) ?? [],
|
|
425
434
|
statusLabels: t.statusLabels,
|
|
426
435
|
labels: {
|
|
@@ -438,14 +447,14 @@ function Ce(e, t) {
|
|
|
438
447
|
} : e;
|
|
439
448
|
});
|
|
440
449
|
}
|
|
441
|
-
function
|
|
450
|
+
function Se(e, t) {
|
|
442
451
|
let n = [], r = [];
|
|
443
452
|
return e.forEach((i, a) => {
|
|
444
453
|
let o = i.group !== void 0 && i.group.key === e[a - 1]?.group?.key;
|
|
445
454
|
r.length >= t && !o && (n.push(r), r = []), r.push(i);
|
|
446
455
|
}), r.length && n.push(r), n;
|
|
447
456
|
}
|
|
448
|
-
function
|
|
449
|
-
return e ===
|
|
457
|
+
function Ce(e) {
|
|
458
|
+
return e === se.Settled ? void 0 : e;
|
|
450
459
|
}
|
|
451
|
-
export {
|
|
460
|
+
export { E as BillDuplicateView, be as useBillsTable };
|
|
@@ -30,7 +30,7 @@ import { useCallback as d, useImperativeHandle as ue, useMemo as f, useState as
|
|
|
30
30
|
import { Fragment as m, jsx as h, jsxs as de } from "react/jsx-runtime";
|
|
31
31
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js
|
|
32
32
|
var fe = () => void 0;
|
|
33
|
-
function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, maxFiles: b,
|
|
33
|
+
function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, maxFiles: b, headerActionContainer: pe, ref: me }) {
|
|
34
34
|
let x = f(() => ({
|
|
35
35
|
...o,
|
|
36
36
|
...g,
|
|
@@ -42,6 +42,10 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
|
|
|
42
42
|
...o.scheduledRelativeDay,
|
|
43
43
|
...g?.scheduledRelativeDay
|
|
44
44
|
},
|
|
45
|
+
dueDate: {
|
|
46
|
+
...o.dueDate,
|
|
47
|
+
...g?.dueDate
|
|
48
|
+
},
|
|
45
49
|
filters: {
|
|
46
50
|
...o.filters,
|
|
47
51
|
...g?.filters,
|
|
@@ -155,7 +159,8 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
|
|
|
155
159
|
duplicateGroupLabels: P,
|
|
156
160
|
canManageDuplicates: k,
|
|
157
161
|
duplicateView: C,
|
|
158
|
-
scheduledRelativeDayLabels: x.scheduledRelativeDay
|
|
162
|
+
scheduledRelativeDayLabels: x.scheduledRelativeDay,
|
|
163
|
+
dueDateLabels: x.dueDate
|
|
159
164
|
}), z = l({ enabled: O }), B = C === s.PossibleDuplicates, _e = se(z, x), V = le({
|
|
160
165
|
enabled: O,
|
|
161
166
|
canPay: A
|
|
@@ -183,7 +188,6 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
|
|
|
183
188
|
}, [W, G]), q = g?.screen, ye = f(() => ({
|
|
184
189
|
...q,
|
|
185
190
|
createButton: x.createButton,
|
|
186
|
-
settingsButton: x.settingsButton,
|
|
187
191
|
addBill: {
|
|
188
192
|
...q?.addBill,
|
|
189
193
|
heading: x.nonEmptyHeading
|
|
@@ -198,7 +202,6 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
|
|
|
198
202
|
x.duplicateColumnAmount,
|
|
199
203
|
q,
|
|
200
204
|
x.createButton,
|
|
201
|
-
x.settingsButton,
|
|
202
205
|
x.nonEmptyHeading
|
|
203
206
|
]), be = f(() => ({
|
|
204
207
|
...R.filterBarProps,
|
|
@@ -251,7 +254,7 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
|
|
|
251
254
|
showAddPanelWhenEmpty: R.showAddPanelWhenEmpty,
|
|
252
255
|
emptyState: B ? x.duplicatesEmptyState : x.queueEmptyStates[R.selectedFilterTabId],
|
|
253
256
|
onCreateClick: k ? () => S(!0) : void 0,
|
|
254
|
-
|
|
257
|
+
headerActionContainer: pe,
|
|
255
258
|
onEnterManually: k ? J : void 0,
|
|
256
259
|
onFilesSelected: k ? Y : void 0,
|
|
257
260
|
maxFiles: b,
|