@tesouro/embedded-components-react 0.3.22 → 0.3.23
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.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +31 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +42 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +158 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +33 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +45 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +4 -64
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +13 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +14 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +56 -123
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +18 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +15 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +61 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +130 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +20 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +38 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +48 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +5 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +71 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +48 -139
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +91 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +22 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +34 -22
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +144 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +63 -209
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +21 -103
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +209 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +211 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +104 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +12 -165
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +47 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +29 -99
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +64 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +166 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +34 -243
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +104 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +12 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +259 -81
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +4 -145
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +33 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +82 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +155 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +43 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +1 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +8 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +85 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +3 -59
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +19 -120
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +56 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +3 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +3 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +116 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +8 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +43 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +19 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +27 -249
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +82 -109
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +47 -206
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +253 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +111 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +6 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +197 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +6 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +114 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +3 -162
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +123 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -170
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +7 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +163 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +89 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
3
|
-
import "./
|
|
1
|
+
import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index52.js";
|
|
2
|
+
import "../../ui/dist/index.js";
|
|
3
|
+
import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index2.js";
|
|
4
|
+
import "./index5.js";
|
|
5
|
+
import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index15.js";
|
|
6
|
+
import { BILL_DETAIL_ACTIONS_LABELS_EN as r, SCHEDULED_SUMMARY_LABEL_EN as i } from "./index29.js";
|
|
7
|
+
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js
|
|
8
|
+
var a = {
|
|
9
|
+
subtitle: "Accounts payable",
|
|
10
|
+
vendorRow: "Vendor",
|
|
11
|
+
bankAccountRow: "ACH bank account",
|
|
12
|
+
bankAccountValue: (e) => `Account ending in ${e}`,
|
|
13
|
+
invoiceNumberRow: "Number",
|
|
14
|
+
issueDateRow: "Issue date",
|
|
15
|
+
dueDateRow: "Due date",
|
|
16
|
+
poNumberRow: "PO number",
|
|
17
|
+
notProvided: "Not provided",
|
|
18
|
+
glCodeMissing: "GL code not specified",
|
|
19
|
+
quantityValue: (e, t) => `${e} x ${t}`,
|
|
20
|
+
subtotalRow: "Subtotal",
|
|
21
|
+
discountsRow: "Discounts",
|
|
22
|
+
taxRow: "Tax",
|
|
23
|
+
totalRow: "Total",
|
|
24
|
+
actionError: r.actionError,
|
|
25
|
+
actionSuccess: r.actionSuccess,
|
|
26
|
+
scheduledSummary: i,
|
|
27
|
+
sheet: e,
|
|
28
|
+
decisionDialog: r.decisionDialog,
|
|
29
|
+
approvalPolicyCopy: n,
|
|
30
|
+
markAsPaid: t
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { a as BILL_DETAILS_LABELS_EN };
|
|
@@ -1,4 +1,84 @@
|
|
|
1
|
+
import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
+
import { resolveVendor as t, resolveVendorName as n } from "./index7.js";
|
|
3
|
+
import { derivePayableStatus as r } from "./index25.js";
|
|
4
|
+
import { formatBillMoney as i } from "./index26.js";
|
|
1
5
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js
|
|
2
|
-
|
|
6
|
+
function a({ payable: a, lineItems: o, ledgerAccounts: s, labels: c, hasScheduledPayment: l, now: u }) {
|
|
7
|
+
let d = a.currency, f = (e) => i(e, d), p = r({
|
|
8
|
+
apiStatus: a.status,
|
|
9
|
+
dueDate: a.due_date,
|
|
10
|
+
scheduledPaymentDate: a.scheduled_payment_date,
|
|
11
|
+
hasScheduledPayment: l,
|
|
12
|
+
now: u
|
|
13
|
+
}), m = t(a), h = n(a), g = e(a.issued_at) || c.notProvided, _ = e(a.due_date) || c.notProvided, v = [{
|
|
14
|
+
label: c.vendorRow,
|
|
15
|
+
value: h || c.notProvided,
|
|
16
|
+
secondaryValue: m?.email ?? void 0
|
|
17
|
+
}], y = m?.bank_account?.account_number;
|
|
18
|
+
y && v.push({
|
|
19
|
+
label: c.bankAccountRow,
|
|
20
|
+
value: c.bankAccountValue(y.slice(-4))
|
|
21
|
+
});
|
|
22
|
+
let b = [
|
|
23
|
+
{
|
|
24
|
+
label: c.invoiceNumberRow,
|
|
25
|
+
value: a.document_id || c.notProvided
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: c.issueDateRow,
|
|
29
|
+
value: g
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: c.dueDateRow,
|
|
33
|
+
value: _
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: c.poNumberRow,
|
|
37
|
+
value: c.notProvided
|
|
38
|
+
}
|
|
39
|
+
], x = new Map(s.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), S = o.map((e) => {
|
|
40
|
+
let t = f(e.unit_price);
|
|
41
|
+
return {
|
|
42
|
+
id: e.id,
|
|
43
|
+
description: e.name ?? e.description ?? "",
|
|
44
|
+
glCodeLabel: (e.ledger_account_id ? x.get(e.ledger_account_id) : void 0) || c.glCodeMissing,
|
|
45
|
+
quantityLabel: e.quantity != null && t ? c.quantityValue(String(e.quantity), t) : "",
|
|
46
|
+
amountLabel: f(e.subtotal) ?? ""
|
|
47
|
+
};
|
|
48
|
+
}), C = [
|
|
49
|
+
{
|
|
50
|
+
label: c.subtotalRow,
|
|
51
|
+
value: a.subtotal
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: c.discountsRow,
|
|
55
|
+
value: a.discount
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: c.taxRow,
|
|
59
|
+
value: a.tax_amount
|
|
60
|
+
}
|
|
61
|
+
].map(({ label: e, value: t }) => ({
|
|
62
|
+
label: e,
|
|
63
|
+
value: f(t)
|
|
64
|
+
})).filter((e) => !!e.value), w = f(a.total_amount);
|
|
65
|
+
return w && C.push({
|
|
66
|
+
label: c.totalRow,
|
|
67
|
+
value: w,
|
|
68
|
+
emphasis: !0
|
|
69
|
+
}), {
|
|
70
|
+
title: h,
|
|
71
|
+
subtitle: c.subtitle,
|
|
72
|
+
status: p.status,
|
|
73
|
+
statusTone: p.tone,
|
|
74
|
+
amountDueLabel: f(a.amount_due) ?? f(a.total_amount) ?? "",
|
|
75
|
+
invoiceDateLabel: g,
|
|
76
|
+
dueDateLabel: _,
|
|
77
|
+
payToItems: v,
|
|
78
|
+
invoiceItems: b,
|
|
79
|
+
lineItems: S,
|
|
80
|
+
totals: C
|
|
81
|
+
};
|
|
82
|
+
}
|
|
3
83
|
//#endregion
|
|
4
|
-
export {
|
|
84
|
+
export { a as mapPayableToBillDetails };
|
|
@@ -2,44 +2,162 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import "../../../shared/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
10
|
-
import {
|
|
11
|
-
import "
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
5
|
+
import { useAllLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
|
|
6
|
+
import "../../../shared/data-access/dist/index.js";
|
|
7
|
+
import { resolveAmountDueMinorUnits as t } from "./index6.js";
|
|
8
|
+
import { resolveVendor as n } from "./index7.js";
|
|
9
|
+
import { BillDecisionDialog as r } from "../../ui/dist/index47.js";
|
|
10
|
+
import { BillDetailsSheet as i } from "../../ui/dist/index53.js";
|
|
11
|
+
import { BillDuplicateNotice as a } from "../../ui/dist/index57.js";
|
|
12
|
+
import { MarkAsPaidDialog as o } from "../../ui/dist/index83.js";
|
|
13
|
+
import "../../ui/dist/index.js";
|
|
14
|
+
import { useAllPayableLineItemsQuery as s } from "../../data-access/dist/index7.js";
|
|
15
|
+
import { usePayableQuery as c } from "../../data-access/dist/index13.js";
|
|
16
|
+
import "../../data-access/dist/index.js";
|
|
17
|
+
import { PayBillFlow as l } from "./index13.js";
|
|
18
|
+
import "./index14.js";
|
|
19
|
+
import { mergeMarkAsPaidFlowLabels as u } from "./index2.js";
|
|
20
|
+
import { useMarkAsPaidFlow as d } from "./index4.js";
|
|
21
|
+
import "./index5.js";
|
|
22
|
+
import { mergeDecisionDialogCopy as f } from "./index29.js";
|
|
23
|
+
import { useApprovalPolicyCardView as p } from "./index19.js";
|
|
24
|
+
import { useCurrentApprovalRequestId as m } from "./index20.js";
|
|
25
|
+
import { usePayableDetailActions as h } from "./index22.js";
|
|
26
|
+
import { useScheduledPayment as g } from "./index23.js";
|
|
27
|
+
import { BILL_DETAILS_LABELS_EN as _ } from "./index46.js";
|
|
28
|
+
import { mapPayableToBillDetails as v } from "./index47.js";
|
|
29
|
+
import { useMemo as y, useRef as b } from "react";
|
|
30
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
14
31
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let i = e();
|
|
18
|
-
return a(() => {
|
|
19
|
-
i(t.Mounted);
|
|
20
|
-
}, [i]), /* @__PURE__ */ o(r, { ...n });
|
|
32
|
+
function w(e) {
|
|
33
|
+
return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
|
|
21
34
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
function T({ open: T, onOpenChange: E, payableId: D, onClose: O, onExpand: k, testId: A, labels: j, poweredByBankName: M, isPossibleDuplicate: N }) {
|
|
36
|
+
let P = y(() => ({
|
|
37
|
+
..._,
|
|
38
|
+
...j,
|
|
39
|
+
sheet: {
|
|
40
|
+
..._.sheet,
|
|
41
|
+
...j?.sheet,
|
|
42
|
+
statusBadge: {
|
|
43
|
+
..._.sheet.statusBadge,
|
|
44
|
+
...j?.sheet?.statusBadge
|
|
45
|
+
},
|
|
46
|
+
approvalPolicy: {
|
|
47
|
+
..._.sheet.approvalPolicy,
|
|
48
|
+
...j?.sheet?.approvalPolicy
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
decisionDialog: f(_.decisionDialog, j?.decisionDialog),
|
|
52
|
+
approvalPolicyCopy: {
|
|
53
|
+
..._.approvalPolicyCopy,
|
|
54
|
+
...j?.approvalPolicyCopy
|
|
55
|
+
},
|
|
56
|
+
markAsPaid: u(j?.markAsPaid),
|
|
57
|
+
actionSuccess: {
|
|
58
|
+
..._.actionSuccess,
|
|
59
|
+
...j?.actionSuccess
|
|
60
|
+
}
|
|
61
|
+
}), [j]), F = c(D), I = s(D), L = e(), R = F.data, z = b(null), B = m({
|
|
62
|
+
payableId: D,
|
|
63
|
+
status: R?.status
|
|
64
|
+
}), V = p({
|
|
65
|
+
payableId: D,
|
|
66
|
+
approvalPolicyId: R?.approval_policy_id,
|
|
67
|
+
copy: P.approvalPolicyCopy
|
|
68
|
+
}), H = g({
|
|
69
|
+
payableId: D,
|
|
70
|
+
scheduledPaymentDate: R?.scheduled_payment_date
|
|
71
|
+
}), U = d({
|
|
72
|
+
payableId: D,
|
|
73
|
+
amountDueMinorUnits: t(R) ?? 0,
|
|
74
|
+
amountToPayMinorUnits: R?.amount_to_pay ?? void 0,
|
|
75
|
+
currencyCode: R?.currency ?? void 0,
|
|
76
|
+
dueDate: R?.due_date,
|
|
77
|
+
hasScheduledPayment: H.hasScheduledPayment,
|
|
78
|
+
testId: A,
|
|
79
|
+
labels: P.markAsPaid
|
|
80
|
+
}), { actions: W, decisionDialog: G } = h({
|
|
81
|
+
payableId: R ? D : void 0,
|
|
82
|
+
status: R?.status,
|
|
83
|
+
currentApprovalRequestId: B.id,
|
|
84
|
+
isPolicyApprover: B.isPolicyApprover,
|
|
85
|
+
hasWaitingRequest: B.hasWaitingRequest,
|
|
86
|
+
hasScheduledPayment: H.hasScheduledPayment,
|
|
87
|
+
scheduledPaymentRecordId: H.scheduledPaymentRecordId,
|
|
88
|
+
isScheduledPaymentUnknown: H.isResolving,
|
|
89
|
+
pendingApprovers: V.pendingApprovers,
|
|
90
|
+
arePendingApproversUnknown: V.isLoading,
|
|
91
|
+
labels: {
|
|
92
|
+
payBill: P.sheet.payButton,
|
|
93
|
+
markAsPaid: P.sheet.markAsPaidButton,
|
|
94
|
+
reject: P.sheet.rejectButton,
|
|
95
|
+
approve: P.sheet.approveButton,
|
|
96
|
+
cancel: P.sheet.cancelButton,
|
|
97
|
+
cancelScheduledPayment: P.sheet.cancelScheduledPaymentButton,
|
|
98
|
+
reopen: P.sheet.reopenButton,
|
|
99
|
+
forceApprove: P.sheet.forceApproveButton,
|
|
100
|
+
forceReject: P.sheet.forceRejectButton,
|
|
101
|
+
policyOverridesHeading: P.sheet.policyOverridesGroup,
|
|
102
|
+
decisionDialog: P.decisionDialog,
|
|
103
|
+
actionError: P.actionError,
|
|
104
|
+
actionSuccess: P.actionSuccess
|
|
105
|
+
},
|
|
106
|
+
isMarkAsPaidPending: U.isPending,
|
|
107
|
+
onMarkAsPaidSelect: U.open,
|
|
108
|
+
onPayBillSelect: () => {
|
|
109
|
+
if (!w(n(R)) && k) {
|
|
110
|
+
k();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
z.current?.open();
|
|
114
|
+
}
|
|
115
|
+
}), K = H.hasScheduledPayment && H.scheduledDateLabel ? /* @__PURE__ */ S("p", {
|
|
116
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
117
|
+
children: P.scheduledSummary(H.scheduledDateLabel)
|
|
118
|
+
}) : void 0, q = N ? /* @__PURE__ */ S(a, {}) : void 0, J = q || K ? /* @__PURE__ */ C(x, { children: [q, K] }) : void 0, Y = y(() => R ? v({
|
|
119
|
+
payable: R,
|
|
120
|
+
lineItems: I.lineItems,
|
|
121
|
+
ledgerAccounts: L.data?.data ?? [],
|
|
122
|
+
labels: P,
|
|
123
|
+
hasScheduledPayment: H.hasScheduledPayment
|
|
124
|
+
}) : void 0, [
|
|
125
|
+
R,
|
|
126
|
+
I.lineItems,
|
|
127
|
+
L.data,
|
|
128
|
+
P,
|
|
129
|
+
H.hasScheduledPayment
|
|
130
|
+
]), X = F.isLoading || I.isResolving || L.isResolving, Z = F.isError || I.isError || L.isError;
|
|
131
|
+
return /* @__PURE__ */ C(x, { children: [
|
|
132
|
+
/* @__PURE__ */ S(i, {
|
|
133
|
+
open: T,
|
|
134
|
+
onOpenChange: E,
|
|
135
|
+
details: Y,
|
|
136
|
+
actions: W,
|
|
137
|
+
approvalPolicy: V.view,
|
|
138
|
+
isLoading: X,
|
|
139
|
+
isError: Z,
|
|
140
|
+
notice: J,
|
|
141
|
+
onClose: O,
|
|
142
|
+
onExpand: k,
|
|
143
|
+
testId: A,
|
|
144
|
+
labels: P.sheet
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ S(r, {
|
|
147
|
+
...G,
|
|
148
|
+
labels: { cancelButton: P.decisionDialog.cancelButton },
|
|
149
|
+
testId: A ? `${A}-decision-dialog` : void 0,
|
|
150
|
+
confirmTestId: A ? `${A}-decision-confirm` : void 0,
|
|
151
|
+
reasonTestId: A ? `${A}-decision-reason` : void 0,
|
|
152
|
+
reasonFieldId: A ? `${A}-decision-reason-field` : void 0
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ S(o, { ...U.dialogProps }),
|
|
155
|
+
R ? /* @__PURE__ */ S(l, {
|
|
156
|
+
ref: z,
|
|
157
|
+
payable: R,
|
|
158
|
+
poweredByBankName: M
|
|
159
|
+
}) : null
|
|
160
|
+
] });
|
|
43
161
|
}
|
|
44
162
|
//#endregion
|
|
45
|
-
export {
|
|
163
|
+
export { T as BillDetailsContainer, T as default };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js
|
|
2
|
-
var e =
|
|
3
|
-
"bill-pay",
|
|
4
|
-
"upload-queue",
|
|
5
|
-
e ?? ""
|
|
6
|
-
];
|
|
2
|
+
var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
|
|
7
3
|
//#endregion
|
|
8
|
-
export { e as
|
|
4
|
+
export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -1,11 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
6
|
+
import "../../../shared/feature/dist/index.js";
|
|
7
|
+
import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index50.js";
|
|
8
|
+
import { Payables as r } from "../../../monite-sdk/dist/index443.js";
|
|
9
|
+
import "../../../monite-sdk/dist/index.js";
|
|
10
|
+
import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
|
|
11
|
+
import "../../../shared/monite-wrapper/feature/dist/index.js";
|
|
12
|
+
import { useEffect as a } from "react";
|
|
13
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
1
14
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
15
|
+
var s = (e) => e;
|
|
16
|
+
function c(n) {
|
|
17
|
+
let i = e();
|
|
18
|
+
return a(() => {
|
|
19
|
+
i(t.Mounted);
|
|
20
|
+
}, [i]), /* @__PURE__ */ o(r, { ...n });
|
|
21
|
+
}
|
|
22
|
+
function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, pageTitleComponent: v = s, ...y }) {
|
|
23
|
+
return /* @__PURE__ */ o(i, {
|
|
24
|
+
widgetName: n,
|
|
25
|
+
baseUrl: e,
|
|
26
|
+
widgetToken: t,
|
|
27
|
+
organizationId: r,
|
|
28
|
+
configClient: a,
|
|
29
|
+
gatewayRouting: l,
|
|
30
|
+
linkComponent: u,
|
|
31
|
+
implementation: d,
|
|
32
|
+
uiFramework: f,
|
|
33
|
+
errorFallback: p,
|
|
34
|
+
onError: m,
|
|
35
|
+
finopsThemeColors: h,
|
|
36
|
+
analytics: g,
|
|
37
|
+
disclosuresAcceptance: _,
|
|
38
|
+
children: /* @__PURE__ */ o(c, {
|
|
39
|
+
...y,
|
|
40
|
+
pageTitleComponent: v
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
10
44
|
//#endregion
|
|
11
|
-
export {
|
|
45
|
+
export { l as BillPayWidgetMonite, l as default };
|
|
@@ -1,94 +1 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
-
import "../../../shared/ui/dist/index.js";
|
|
8
|
-
import { useUploadPayableFromFileMutation as n } from "../../data-access/dist/index10.js";
|
|
9
|
-
import { usePayableOcrQueries as r } from "../../data-access/dist/index12.js";
|
|
10
|
-
import "../../data-access/dist/index.js";
|
|
11
|
-
import { billPayUploadQueueKey as i } from "./index50.js";
|
|
12
|
-
import { BILL_UPLOAD_QUEUE_LABELS_EN as a } from "./index51.js";
|
|
13
|
-
import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
14
|
-
import { useQuery as u, useQueryClient as d } from "@tanstack/react-query";
|
|
15
|
-
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js
|
|
16
|
-
function f({ onOpenBill: f, labels: p } = {}) {
|
|
17
|
-
let m = {
|
|
18
|
-
...a,
|
|
19
|
-
...p
|
|
20
|
-
}, h = p?.tooManyFilesError ?? a.tooManyFilesError, g = p?.remainingCapacityError ?? a.remainingCapacityError, { organizationId: _ } = t(), v = d(), y = c(() => i(_), [_]), b = n(), [x, S] = l(!1), { data: C = [] } = u({
|
|
21
|
-
queryKey: y,
|
|
22
|
-
queryFn: () => v.getQueryData(y) ?? [],
|
|
23
|
-
staleTime: Infinity,
|
|
24
|
-
gcTime: Infinity,
|
|
25
|
-
initialData: []
|
|
26
|
-
}), w = o((e, t) => {
|
|
27
|
-
v.setQueryData(y, (n) => (n ?? []).map((n) => n.localId === e ? {
|
|
28
|
-
...n,
|
|
29
|
-
...t
|
|
30
|
-
} : n));
|
|
31
|
-
}, [v, y]), T = o((t) => {
|
|
32
|
-
let n = (v.getQueryData(y) ?? []).filter((e) => e.status === "uploading").length;
|
|
33
|
-
if (t.length + n > 10) {
|
|
34
|
-
e.error(n > 0 ? g(10 - n) : h(10));
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
S(!1);
|
|
38
|
-
for (let e of t) {
|
|
39
|
-
let t = crypto.randomUUID();
|
|
40
|
-
v.setQueryData(y, (n) => [...n ?? [], {
|
|
41
|
-
localId: t,
|
|
42
|
-
fileName: e.name,
|
|
43
|
-
status: "uploading"
|
|
44
|
-
}]), b.mutateAsync({ file: e }).then((e) => w(t, { payableId: e?.id })).catch(() => w(t, { status: "failed" }));
|
|
45
|
-
}
|
|
46
|
-
}, [
|
|
47
|
-
w,
|
|
48
|
-
v,
|
|
49
|
-
y,
|
|
50
|
-
g,
|
|
51
|
-
h,
|
|
52
|
-
b
|
|
53
|
-
]), E = r({ payableIds: C.filter((e) => e.status === "uploading" && e.payableId).map((e) => e.payableId) });
|
|
54
|
-
s(() => {
|
|
55
|
-
for (let { payableId: e, ocrStatus: t, isError: n } of E) {
|
|
56
|
-
let r = C.find((t) => t.payableId === e && t.status === "uploading");
|
|
57
|
-
r && (t === "success" ? w(r.localId, { status: "ready" }) : (n || t === "error" || t === "canceled") && w(r.localId, { status: "failed" }));
|
|
58
|
-
}
|
|
59
|
-
}, [
|
|
60
|
-
C,
|
|
61
|
-
E,
|
|
62
|
-
w
|
|
63
|
-
]);
|
|
64
|
-
let D = C.filter((e) => e.status === "uploading"), O = C.filter((e) => e.status === "ready"), k = C.filter((e) => e.status === "failed"), A = (e) => ({
|
|
65
|
-
id: e.localId,
|
|
66
|
-
fileName: e.fileName,
|
|
67
|
-
status: e.status,
|
|
68
|
-
onOpen: e.status === "ready" && e.payableId && f ? () => f(e.payableId) : void 0
|
|
69
|
-
}), j = D.length ? [{
|
|
70
|
-
id: "in-progress",
|
|
71
|
-
items: C.map(A)
|
|
72
|
-
}] : [...O.length ? [{
|
|
73
|
-
id: "ready",
|
|
74
|
-
caption: m.readyCaption(O.length),
|
|
75
|
-
items: O.map(A)
|
|
76
|
-
}] : [], ...k.length ? [{
|
|
77
|
-
id: "failed",
|
|
78
|
-
caption: m.failedCaption(k.length),
|
|
79
|
-
items: k.map(A)
|
|
80
|
-
}] : []], M = D.length ? m.uploadingSummary(C.length) : O.length ? m.completeSummary(O.length) : m.failedCaption(k.length), N = o(() => {
|
|
81
|
-
v.setQueryData(y, []);
|
|
82
|
-
}, [v, y]);
|
|
83
|
-
return {
|
|
84
|
-
enqueue: T,
|
|
85
|
-
sections: j,
|
|
86
|
-
summaryLabel: M,
|
|
87
|
-
collapsed: x,
|
|
88
|
-
onToggleCollapsed: o(() => S((e) => !e), []),
|
|
89
|
-
onClose: N,
|
|
90
|
-
isVisible: C.length > 0
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
export { f as useBillUploadQueue };
|
|
1
|
+
import "./index51.js";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js
|
|
2
|
+
var e = (e) => [
|
|
3
|
+
"bill-pay",
|
|
4
|
+
"upload-queue",
|
|
5
|
+
e ?? ""
|
|
6
|
+
];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as billPayUploadQueueKey };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js
|
|
2
2
|
var e = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
uploadingSummary: (e) => `Uploading and scanning ${e} ${e === 1 ? "file" : "files"}`,
|
|
4
|
+
completeSummary: (e) => `${e} ${e === 1 ? "upload" : "uploads"} complete`,
|
|
5
|
+
readyCaption: (e) => `${e} new ${e === 1 ? "bill" : "bills"} ready`,
|
|
6
|
+
failedCaption: (e) => `${e} failed to upload`,
|
|
7
|
+
tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
|
|
8
|
+
remainingCapacityError: (e) => e === 0 ? "Wait for the current uploads to finish before adding more files" : `You can upload ${e} more ${e === 1 ? "file" : "files"} right now`
|
|
7
9
|
};
|
|
8
10
|
//#endregion
|
|
9
|
-
export { e as
|
|
11
|
+
export { e as BILL_UPLOAD_QUEUE_LABELS_EN };
|
|
@@ -2,21 +2,93 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
+
import "../../../shared/ui/dist/index.js";
|
|
8
|
+
import { useUploadPayableFromFileMutation as n } from "../../data-access/dist/index10.js";
|
|
9
|
+
import { usePayableOcrQueries as r } from "../../data-access/dist/index12.js";
|
|
10
|
+
import "../../data-access/dist/index.js";
|
|
11
|
+
import { billPayUploadQueueKey as i } from "./index53.js";
|
|
12
|
+
import { BILL_UPLOAD_QUEUE_LABELS_EN as a } from "./index54.js";
|
|
13
|
+
import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
14
|
+
import { useQuery as u, useQueryClient as d } from "@tanstack/react-query";
|
|
6
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
a
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
function f({ onOpenBill: f, labels: p } = {}) {
|
|
17
|
+
let m = {
|
|
18
|
+
...a,
|
|
19
|
+
...p
|
|
20
|
+
}, h = p?.tooManyFilesError ?? a.tooManyFilesError, g = p?.remainingCapacityError ?? a.remainingCapacityError, { organizationId: _ } = t(), v = d(), y = c(() => i(_), [_]), b = n(), [x, S] = l(!1), { data: C = [] } = u({
|
|
21
|
+
queryKey: y,
|
|
22
|
+
queryFn: () => v.getQueryData(y) ?? [],
|
|
23
|
+
staleTime: Infinity,
|
|
24
|
+
gcTime: Infinity,
|
|
25
|
+
initialData: []
|
|
26
|
+
}), w = o((e, t) => {
|
|
27
|
+
v.setQueryData(y, (n) => (n ?? []).map((n) => n.localId === e ? {
|
|
28
|
+
...n,
|
|
29
|
+
...t
|
|
30
|
+
} : n));
|
|
31
|
+
}, [v, y]), T = o((t) => {
|
|
32
|
+
let n = (v.getQueryData(y) ?? []).filter((e) => e.status === "uploading").length;
|
|
33
|
+
if (t.length + n > 10) {
|
|
34
|
+
e.error(n > 0 ? g(10 - n) : h(10));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
S(!1);
|
|
38
|
+
for (let e of t) {
|
|
39
|
+
let t = crypto.randomUUID();
|
|
40
|
+
v.setQueryData(y, (n) => [...n ?? [], {
|
|
41
|
+
localId: t,
|
|
42
|
+
fileName: e.name,
|
|
43
|
+
status: "uploading"
|
|
44
|
+
}]), b.mutateAsync({ file: e }).then((e) => w(t, { payableId: e?.id })).catch(() => w(t, { status: "failed" }));
|
|
45
|
+
}
|
|
46
|
+
}, [
|
|
47
|
+
w,
|
|
48
|
+
v,
|
|
49
|
+
y,
|
|
50
|
+
g,
|
|
51
|
+
h,
|
|
52
|
+
b
|
|
53
|
+
]), E = r({ payableIds: C.filter((e) => e.status === "uploading" && e.payableId).map((e) => e.payableId) });
|
|
54
|
+
s(() => {
|
|
55
|
+
for (let { payableId: e, ocrStatus: t, isError: n } of E) {
|
|
56
|
+
let r = C.find((t) => t.payableId === e && t.status === "uploading");
|
|
57
|
+
r && (t === "success" ? w(r.localId, { status: "ready" }) : (n || t === "error" || t === "canceled") && w(r.localId, { status: "failed" }));
|
|
58
|
+
}
|
|
59
|
+
}, [
|
|
60
|
+
C,
|
|
61
|
+
E,
|
|
62
|
+
w
|
|
63
|
+
]);
|
|
64
|
+
let D = C.filter((e) => e.status === "uploading"), O = C.filter((e) => e.status === "ready"), k = C.filter((e) => e.status === "failed"), A = (e) => ({
|
|
65
|
+
id: e.localId,
|
|
66
|
+
fileName: e.fileName,
|
|
67
|
+
status: e.status,
|
|
68
|
+
onOpen: e.status === "ready" && e.payableId && f ? () => f(e.payableId) : void 0
|
|
69
|
+
}), j = D.length ? [{
|
|
70
|
+
id: "in-progress",
|
|
71
|
+
items: C.map(A)
|
|
72
|
+
}] : [...O.length ? [{
|
|
73
|
+
id: "ready",
|
|
74
|
+
caption: m.readyCaption(O.length),
|
|
75
|
+
items: O.map(A)
|
|
76
|
+
}] : [], ...k.length ? [{
|
|
77
|
+
id: "failed",
|
|
78
|
+
caption: m.failedCaption(k.length),
|
|
79
|
+
items: k.map(A)
|
|
80
|
+
}] : []], M = D.length ? m.uploadingSummary(C.length) : O.length ? m.completeSummary(O.length) : m.failedCaption(k.length), N = o(() => {
|
|
81
|
+
v.setQueryData(y, []);
|
|
82
|
+
}, [v, y]);
|
|
13
83
|
return {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
84
|
+
enqueue: T,
|
|
85
|
+
sections: j,
|
|
86
|
+
summaryLabel: M,
|
|
87
|
+
collapsed: x,
|
|
88
|
+
onToggleCollapsed: o(() => S((e) => !e), []),
|
|
89
|
+
onClose: N,
|
|
90
|
+
isVisible: C.length > 0
|
|
19
91
|
};
|
|
20
92
|
}
|
|
21
93
|
//#endregion
|
|
22
|
-
export {
|
|
94
|
+
export { f as useBillUploadQueue };
|