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