@tesouro/embedded-components-react 0.5.65 → 0.5.67
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/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +35 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +89 -88
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js
CHANGED
|
@@ -8,40 +8,41 @@ import { getPayables as n } from "../../../shared/data-access/dist/lib/rest/sdk.
|
|
|
8
8
|
import { getPayablesAnalyticsOptions as r, getPayablesIdOptions as i, getPayablesOptions as a, getPayablesQueryKey as o } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
9
9
|
import { withAuthEpoch as s } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
10
10
|
import "../../../shared/data-access/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import { payablePolicyAssignmentQueryOptions as
|
|
13
|
-
import { queryOptions as
|
|
11
|
+
import { OCR_POLL_INTERVAL_MS as c, payableOcrQueryOptions as l } from "./index4.js";
|
|
12
|
+
import { payablePolicyAssignmentQueryOptions as u } from "./index16.js";
|
|
13
|
+
import { queryOptions as d, useQuery as f } from "@tanstack/react-query";
|
|
14
14
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js
|
|
15
|
-
function
|
|
16
|
-
let { client:
|
|
17
|
-
client:
|
|
18
|
-
headers: t(
|
|
19
|
-
query:
|
|
15
|
+
function p({ enabled: n, pollWhileOcrProcessing: r = !1, ...i } = {}) {
|
|
16
|
+
let { client: o, organizationId: l, widgetToken: u, authEpoch: d } = e(), p = !!(l && u) && (n === !0 || n === void 0), m = a({
|
|
17
|
+
client: o,
|
|
18
|
+
headers: t(l),
|
|
19
|
+
query: i
|
|
20
20
|
});
|
|
21
|
-
return
|
|
22
|
-
...s(
|
|
23
|
-
enabled:
|
|
21
|
+
return f({
|
|
22
|
+
...s(m, d),
|
|
23
|
+
enabled: p,
|
|
24
|
+
...r ? { refetchInterval: (e) => (e.state.data?.data ?? []).some((e) => e.ocr_status === "processing") ? c : !1 } : {}
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
|
-
var
|
|
27
|
-
function
|
|
28
|
-
let { client: i, organizationId: a, widgetToken: c, authEpoch: l } = e(),
|
|
27
|
+
var m = 100;
|
|
28
|
+
function h({ enabled: r } = {}) {
|
|
29
|
+
let { client: i, organizationId: a, widgetToken: c, authEpoch: l } = e(), u = t(a), p = {
|
|
29
30
|
duplicate_match_status: "suspected",
|
|
30
|
-
limit:
|
|
31
|
-
}, h =
|
|
31
|
+
limit: m
|
|
32
|
+
}, h = d({
|
|
32
33
|
queryKey: [...o({
|
|
33
34
|
client: i,
|
|
34
|
-
headers:
|
|
35
|
-
query:
|
|
35
|
+
headers: u,
|
|
36
|
+
query: p
|
|
36
37
|
}), "all"],
|
|
37
38
|
queryFn: async ({ signal: e }) => {
|
|
38
39
|
let t = [], r = /* @__PURE__ */ new Set(), a;
|
|
39
40
|
do {
|
|
40
41
|
let { data: o } = await n({
|
|
41
42
|
client: i,
|
|
42
|
-
headers:
|
|
43
|
+
headers: u,
|
|
43
44
|
query: {
|
|
44
|
-
...
|
|
45
|
+
...p,
|
|
45
46
|
pagination_token: a
|
|
46
47
|
},
|
|
47
48
|
signal: e,
|
|
@@ -54,33 +55,33 @@ function m({ enabled: r } = {}) {
|
|
|
54
55
|
return { data: t };
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
|
-
return
|
|
58
|
+
return f({
|
|
58
59
|
...s(h, l),
|
|
59
60
|
enabled: !!(a && c) && r !== !1
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function g({ enabled: n } = {}) {
|
|
63
64
|
let { client: i, organizationId: a, widgetToken: o, authEpoch: c } = e(), l = !!(a && o) && (n === !0 || n === void 0), u = r({
|
|
64
65
|
client: i,
|
|
65
66
|
headers: t(a)
|
|
66
67
|
});
|
|
67
|
-
return
|
|
68
|
+
return f({
|
|
68
69
|
...s(u, c),
|
|
69
70
|
enabled: l
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
let { client:
|
|
74
|
-
client:
|
|
75
|
-
organizationId:
|
|
73
|
+
function _(n, { enabled: r = !0, pollWhileOcrProcessing: a = !1, pollWhilePolicyAssignmentUnsettled: o = !1 } = {}) {
|
|
74
|
+
let { client: c, organizationId: d, widgetToken: p, authEpoch: m } = e(), h = !!(d && p && n) && r, g = a ? l({
|
|
75
|
+
client: c,
|
|
76
|
+
organizationId: d,
|
|
76
77
|
payableId: n ?? ""
|
|
77
|
-
}) : void 0, _ = o ?
|
|
78
|
-
client:
|
|
79
|
-
organizationId:
|
|
78
|
+
}) : void 0, _ = o ? u({
|
|
79
|
+
client: c,
|
|
80
|
+
organizationId: d,
|
|
80
81
|
payableId: n ?? ""
|
|
81
82
|
}) : void 0, v = g ?? _ ?? i({
|
|
82
|
-
client:
|
|
83
|
-
headers: t(
|
|
83
|
+
client: c,
|
|
84
|
+
headers: t(d),
|
|
84
85
|
path: { payable_id: n ?? "" }
|
|
85
86
|
}), y = g && _ ? {
|
|
86
87
|
...v,
|
|
@@ -89,10 +90,10 @@ function g(n, { enabled: r = !0, pollWhileOcrProcessing: a = !1, pollWhilePolicy
|
|
|
89
90
|
return t.length ? Math.min(...t) : !1;
|
|
90
91
|
}
|
|
91
92
|
} : v;
|
|
92
|
-
return
|
|
93
|
+
return f({
|
|
93
94
|
...s(y, m),
|
|
94
95
|
enabled: h
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
98
|
//#endregion
|
|
98
|
-
export {
|
|
99
|
+
export { h as useAllSuspectedDuplicatePayablesQuery, _ as usePayableQuery, p as usePayablesQuery, g as usePayablesTotalCountQuery };
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js
CHANGED
|
@@ -245,19 +245,20 @@ async function K({ client: e, organizationId: t, payableId: n }) {
|
|
|
245
245
|
payableId: n
|
|
246
246
|
}), o;
|
|
247
247
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
var q = 9e4;
|
|
249
|
+
async function J({ client: e, organizationId: t, payableId: n }) {
|
|
250
|
+
let i = Date.now() + q, o = v, s = !1;
|
|
251
|
+
for (; !s && Date.now() < i;) {
|
|
251
252
|
await new Promise((e) => {
|
|
252
|
-
setTimeout(e,
|
|
253
|
-
});
|
|
253
|
+
setTimeout(e, o);
|
|
254
|
+
}), o = E(o);
|
|
254
255
|
try {
|
|
255
256
|
let { data: i } = await a({
|
|
256
257
|
client: e,
|
|
257
258
|
headers: r(t),
|
|
258
259
|
path: { payable_id: n }
|
|
259
260
|
});
|
|
260
|
-
|
|
261
|
+
s = i?.ocr_status !== "processing";
|
|
261
262
|
} catch {}
|
|
262
263
|
}
|
|
263
264
|
return await y({
|
|
@@ -265,7 +266,7 @@ async function q({ client: e, organizationId: t, payableId: n }) {
|
|
|
265
266
|
organizationId: t,
|
|
266
267
|
payableId: n,
|
|
267
268
|
includeLineItems: !0
|
|
268
|
-
}),
|
|
269
|
+
}), s;
|
|
269
270
|
}
|
|
270
271
|
//#endregion
|
|
271
|
-
export { R as beginApprovalRequestWatch, k as invalidateApprovalDecisionQueries, x as invalidateDeletedPayableQueries, y as invalidatePayableQueries, z as reconcileApprovalDecisionQueries, K as reconcileCancelledPaymentQueries, W as reconcileScheduledPaymentQueries, H as reconcileSubmittedForApprovalQueries,
|
|
272
|
+
export { R as beginApprovalRequestWatch, k as invalidateApprovalDecisionQueries, x as invalidateDeletedPayableQueries, y as invalidatePayableQueries, z as reconcileApprovalDecisionQueries, K as reconcileCancelledPaymentQueries, W as reconcileScheduledPaymentQueries, H as reconcileSubmittedForApprovalQueries, J as reconcileUploadedPayableOcr };
|
|
@@ -9,126 +9,127 @@ import { hasSuspectedPayableDuplicate as ee } from "../../data-access/dist/index
|
|
|
9
9
|
import { usePayablesQuery as r, usePayablesTotalCountQuery as i } from "../../data-access/dist/index17.js";
|
|
10
10
|
import "../../data-access/dist/index.js";
|
|
11
11
|
import { derivePayableStatus as te } from "./index7.js";
|
|
12
|
-
import { resolveVendorName as
|
|
13
|
-
import { isEditablePayableStatus as
|
|
14
|
-
import { BillQueue as
|
|
15
|
-
import { useBillsFilters as
|
|
16
|
-
import { useCallback as
|
|
12
|
+
import { resolveVendorName as ne } from "./index8.js";
|
|
13
|
+
import { isEditablePayableStatus as re } from "./index19.js";
|
|
14
|
+
import { BillQueue as a, DEFAULT_BILL_QUEUE as o, billQueueColumns as s, billQueueHasScheduledPayment as c, billQueueOffersAddPanel as l, billQueueStatuses as u, billSortColumnId as d, billSortField as f } from "./index73.js";
|
|
15
|
+
import { useBillsFilters as p } from "./index81.js";
|
|
16
|
+
import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
|
|
17
17
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js
|
|
18
|
-
var
|
|
18
|
+
var v = 10, y = [{
|
|
19
19
|
id: "addedOnLabel",
|
|
20
20
|
desc: !0
|
|
21
21
|
}];
|
|
22
|
-
function
|
|
23
|
-
let [
|
|
24
|
-
|
|
22
|
+
function b({ enabled: b = !0, canReadVendors: x = !0, isVendorFilterPaused: S = !1, filterLabels: C, onOpenBill: w, duplicateRowNote: T, attachmentLabel: E }) {
|
|
23
|
+
let [D, O] = _(o), [k, A] = _(y), [j, ie] = _(v), [M, N] = _(), [P, F] = _(""), [I, L] = _(""), R = m(() => N(void 0), []);
|
|
24
|
+
h(() => {
|
|
25
25
|
let e = setTimeout(() => {
|
|
26
|
-
|
|
26
|
+
L(P), R();
|
|
27
27
|
}, 300);
|
|
28
28
|
return () => clearTimeout(e);
|
|
29
|
-
}, [
|
|
30
|
-
let
|
|
31
|
-
offersStatusFilter:
|
|
32
|
-
offersVendorFilter:
|
|
33
|
-
isVendorFilterPaused:
|
|
34
|
-
labels:
|
|
35
|
-
onFiltersChange:
|
|
36
|
-
}),
|
|
37
|
-
...
|
|
38
|
-
limit:
|
|
39
|
-
pagination_token:
|
|
40
|
-
status__in:
|
|
41
|
-
has_scheduled_payment:
|
|
42
|
-
counterpart_name__icontains:
|
|
43
|
-
sort:
|
|
44
|
-
order:
|
|
29
|
+
}, [P, R]);
|
|
30
|
+
let z = p({
|
|
31
|
+
offersStatusFilter: D === a.All,
|
|
32
|
+
offersVendorFilter: x,
|
|
33
|
+
isVendorFilterPaused: S,
|
|
34
|
+
labels: C,
|
|
35
|
+
onFiltersChange: R
|
|
36
|
+
}), B = k[0], V = f(B?.id), H = V ? B?.desc ? "desc" : "asc" : void 0, U = g(() => ({
|
|
37
|
+
...z.query,
|
|
38
|
+
limit: j,
|
|
39
|
+
pagination_token: M,
|
|
40
|
+
status__in: u(D) ?? z.query.status__in,
|
|
41
|
+
has_scheduled_payment: c(D),
|
|
42
|
+
counterpart_name__icontains: I || void 0,
|
|
43
|
+
sort: V,
|
|
44
|
+
order: H
|
|
45
45
|
}), [
|
|
46
|
-
|
|
46
|
+
z.query,
|
|
47
|
+
j,
|
|
47
48
|
M,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}), [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
let
|
|
49
|
+
D,
|
|
50
|
+
I,
|
|
51
|
+
V,
|
|
52
|
+
H
|
|
53
|
+
]), { organizationId: W } = e(), G = JSON.stringify([W, U]), K = r({
|
|
54
|
+
...U,
|
|
55
|
+
enabled: b,
|
|
56
|
+
pollWhileOcrProcessing: !0
|
|
57
|
+
}), [q, J] = _(G);
|
|
58
|
+
h(() => {
|
|
59
|
+
K.isFetching || J(G);
|
|
60
|
+
}, [K.isFetching, G]);
|
|
61
|
+
let Y = K.data?.data.length, X = Y === 0, Z = i({ enabled: b && X }), ae = !X || (Z.data?.count ?? 1) > 0, Q = g(() => (K.data?.data ?? []).filter((e) => e.ocr_status !== "processing").map((e) => {
|
|
61
62
|
let r = te({
|
|
62
63
|
apiStatus: e.status,
|
|
63
64
|
dueDate: e.due_date,
|
|
64
65
|
scheduledPaymentDate: e.scheduled_payment_date
|
|
65
|
-
}), i = e.amount_due ?? e.total_amount,
|
|
66
|
+
}), i = e.amount_due ?? e.total_amount, o = e.status === "partially_paid" || e.status === "paid", s = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" });
|
|
66
67
|
return {
|
|
67
68
|
rowKey: e.id,
|
|
68
|
-
vendorLabel:
|
|
69
|
+
vendorLabel: ne(e),
|
|
69
70
|
issueDateLabel: t(e.issued_at),
|
|
70
71
|
dueDateLabel: t(e.due_date),
|
|
71
72
|
dueDateTone: r.isOverdue ? "danger" : "default",
|
|
72
73
|
scheduledDateLabel: t(e.scheduled_payment_date),
|
|
73
|
-
scheduledDateIsGap:
|
|
74
|
+
scheduledDateIsGap: D === a.Scheduled,
|
|
74
75
|
paidDateLabel: t(e.paid_at?.slice(0, 10)),
|
|
75
|
-
amountDueLabel:
|
|
76
|
-
amountPaidLabel:
|
|
77
|
-
amountPaidIsGap:
|
|
78
|
-
amountScheduledLabel:
|
|
79
|
-
totalAmountLabel:
|
|
80
|
-
attachment: e.file_id ? { label:
|
|
76
|
+
amountDueLabel: s(i),
|
|
77
|
+
amountPaidLabel: o ? s(e.amount_paid) : "",
|
|
78
|
+
amountPaidIsGap: D === a.Paid,
|
|
79
|
+
amountScheduledLabel: s(e.amount_to_pay ?? i),
|
|
80
|
+
totalAmountLabel: s(e.total_amount),
|
|
81
|
+
attachment: e.file_id ? { label: E } : void 0,
|
|
81
82
|
status: r.status,
|
|
82
83
|
statusTone: r.tone,
|
|
83
84
|
addedOnLabel: t(e.created_at?.slice(0, 10)),
|
|
84
85
|
...ee(e) ? {
|
|
85
86
|
rowTone: "warning",
|
|
86
|
-
rowNote:
|
|
87
|
+
rowNote: T
|
|
87
88
|
} : {},
|
|
88
|
-
onOpen: () =>
|
|
89
|
+
onOpen: () => w(e.id, re(e.status))
|
|
89
90
|
};
|
|
90
91
|
}), [
|
|
91
|
-
|
|
92
|
-
E,
|
|
93
|
-
D,
|
|
92
|
+
K.data?.data,
|
|
94
93
|
T,
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
E,
|
|
95
|
+
w,
|
|
96
|
+
D
|
|
97
|
+
]), oe = m((e) => {
|
|
97
98
|
let t = e;
|
|
98
|
-
|
|
99
|
+
O(t), A((e) => {
|
|
99
100
|
let n = e[0]?.id;
|
|
100
|
-
return n ?
|
|
101
|
-
}),
|
|
102
|
-
}, [
|
|
103
|
-
|
|
104
|
-
}, [
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
|
|
108
|
-
}, [
|
|
101
|
+
return n ? s(t).some((e) => d(e) === n) ? e : y : e;
|
|
102
|
+
}), R();
|
|
103
|
+
}, [R]), se = m((e) => {
|
|
104
|
+
A((t) => typeof e == "function" ? e(t) : e), R();
|
|
105
|
+
}, [R]), ce = m((e) => {
|
|
106
|
+
ie(e), R();
|
|
107
|
+
}, [R]), le = m(() => N(K.data?.next_pagination_token ?? void 0), [K.data?.next_pagination_token]), $ = m(() => N(K.data?.prev_pagination_token ?? void 0), [K.data?.prev_pagination_token]), ue = m(() => {
|
|
108
|
+
K.refetch();
|
|
109
|
+
}, [K.refetch]);
|
|
109
110
|
return {
|
|
110
|
-
rows:
|
|
111
|
-
isLoading:
|
|
112
|
-
isError:
|
|
113
|
-
onRetry:
|
|
114
|
-
selectedFilterTabId:
|
|
115
|
-
onFilterTabChange:
|
|
116
|
-
searchValue:
|
|
117
|
-
onSearchChange:
|
|
118
|
-
hasAnyBills:
|
|
119
|
-
isSearchActive:
|
|
120
|
-
filterBarProps:
|
|
121
|
-
visibleColumns:
|
|
122
|
-
showAddPanelWhenEmpty:
|
|
123
|
-
sorting:
|
|
124
|
-
onSortingChange:
|
|
125
|
-
pageSize:
|
|
126
|
-
onPageSizeChange:
|
|
127
|
-
hasNextPage: !!
|
|
128
|
-
hasPrevPage: !!
|
|
129
|
-
onNextPage:
|
|
130
|
-
onPrevPage:
|
|
111
|
+
rows: Q,
|
|
112
|
+
isLoading: K.isLoading || G !== q || X && Z.isLoading || (Y ?? 0) > 0 && Q.length === 0,
|
|
113
|
+
isError: K.isError,
|
|
114
|
+
onRetry: ue,
|
|
115
|
+
selectedFilterTabId: D,
|
|
116
|
+
onFilterTabChange: oe,
|
|
117
|
+
searchValue: P,
|
|
118
|
+
onSearchChange: F,
|
|
119
|
+
hasAnyBills: ae,
|
|
120
|
+
isSearchActive: I.length > 0 || z.isFilterActive,
|
|
121
|
+
filterBarProps: z.filterBarProps,
|
|
122
|
+
visibleColumns: s(D),
|
|
123
|
+
showAddPanelWhenEmpty: l(D),
|
|
124
|
+
sorting: k,
|
|
125
|
+
onSortingChange: se,
|
|
126
|
+
pageSize: j,
|
|
127
|
+
onPageSizeChange: ce,
|
|
128
|
+
hasNextPage: !!K.data?.next_pagination_token,
|
|
129
|
+
hasPrevPage: !!K.data?.prev_pagination_token,
|
|
130
|
+
onNextPage: le,
|
|
131
|
+
onPrevPage: $
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
134
|
//#endregion
|
|
134
|
-
export {
|
|
135
|
+
export { b as useBillsTable };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.67", n = "7426395559729900fa647ef8cfc5ad4c4048564b", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|