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