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