@tesouro/embedded-components-react 0.4.0 → 0.4.2
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 +8 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +8 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +7 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +56 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +18 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +126 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +22 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +4 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +40 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +5 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +72 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +47 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +91 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +33 -167
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +167 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +75 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +23 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +199 -203
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +198 -89
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +105 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +12 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +47 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +27 -198
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +198 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +30 -234
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +240 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +18 -341
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +343 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +4 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +31 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +78 -163
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +170 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +2 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +46 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +6 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +9 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +3 -128
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +125 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +8 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +43 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +20 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +27 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +83 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +47 -250
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +239 -101
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +107 -202
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +209 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +6 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +115 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index523.js +6 -3
- 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/index8.js +1 -1
- package/package.json +1 -1
|
@@ -1,170 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
-
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
-
import { useAllLedgerAccountsQuery as n } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
|
|
8
|
-
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
-
import "../../../shared/feature/dist/index.js";
|
|
11
|
-
import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index9.js";
|
|
12
|
-
import { usePayableQuery as a } from "../../data-access/dist/index15.js";
|
|
13
|
-
import "../../data-access/dist/index.js";
|
|
14
|
-
import { BillDecisionDialog as o } from "../../ui/dist/index51.js";
|
|
15
|
-
import { BillDetailsSheet as s } from "../../ui/dist/index57.js";
|
|
16
|
-
import { BillDuplicateNotice as c } from "../../ui/dist/index61.js";
|
|
17
|
-
import { MarkAsPaidDialog as l } from "../../ui/dist/index88.js";
|
|
18
|
-
import "../../ui/dist/index.js";
|
|
19
|
-
import { usePayableDuplicateReview as u } from "./index10.js";
|
|
20
|
-
import "./index11.js";
|
|
21
|
-
import { resolveAmountDueMinorUnits as d } from "./index17.js";
|
|
22
|
-
import { PayBillFlow as f } from "./index23.js";
|
|
23
|
-
import "./index24.js";
|
|
24
|
-
import { mergeMarkAsPaidFlowLabels as p } from "./index12.js";
|
|
25
|
-
import { useMarkAsPaidFlow as m } from "./index14.js";
|
|
26
|
-
import "./index15.js";
|
|
27
|
-
import { mergeDecisionDialogCopy as h } from "./index38.js";
|
|
28
|
-
import { useApprovalPolicyCardView as g } from "./index29.js";
|
|
29
|
-
import { useCurrentApprovalRequestId as _ } from "./index30.js";
|
|
30
|
-
import { usePayableDetailActions as v } from "./index31.js";
|
|
31
|
-
import { useScheduledPayment as y } from "./index32.js";
|
|
32
|
-
import { BILL_DETAILS_LABELS_EN as b } from "./index55.js";
|
|
33
|
-
import { mapPayableToBillDetails as x } from "./index56.js";
|
|
34
|
-
import { useMemo as S, useRef as C } from "react";
|
|
35
|
-
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
1
|
+
import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
+
import { derivePayableStatus as t } from "./index4.js";
|
|
3
|
+
import { resolveVendor as n, resolveVendorName as r } from "./index5.js";
|
|
4
|
+
import { formatBillMoney as i } from "./index36.js";
|
|
36
5
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js
|
|
37
|
-
function
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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 = t({
|
|
8
|
+
apiStatus: a.status,
|
|
9
|
+
dueDate: a.due_date,
|
|
10
|
+
scheduledPaymentDate: a.scheduled_payment_date,
|
|
11
|
+
hasScheduledPayment: l,
|
|
12
|
+
now: u
|
|
13
|
+
}), m = n(a), h = r(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
|
|
56
26
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
...N?.approvalPolicyCopy
|
|
27
|
+
{
|
|
28
|
+
label: c.issueDateRow,
|
|
29
|
+
value: g
|
|
61
30
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
31
|
+
{
|
|
32
|
+
label: c.dueDateRow,
|
|
33
|
+
value: _
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: c.poNumberRow,
|
|
37
|
+
value: c.notProvided
|
|
66
38
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
testId: M,
|
|
85
|
-
labels: F.markAsPaid
|
|
86
|
-
}), { actions: G, decisionDialog: K } = v({
|
|
87
|
-
payableId: z ? k : void 0,
|
|
88
|
-
status: z?.status,
|
|
89
|
-
currentApprovalRequestId: V.id,
|
|
90
|
-
isPolicyApprover: V.isPolicyApprover,
|
|
91
|
-
hasWaitingRequest: V.hasWaitingRequest,
|
|
92
|
-
hasScheduledPayment: U.hasScheduledPayment,
|
|
93
|
-
scheduledPaymentIntentId: U.scheduledPaymentIntentId,
|
|
94
|
-
isScheduledPaymentUnknown: U.isResolving,
|
|
95
|
-
pendingApprovers: H.pendingApprovers,
|
|
96
|
-
arePendingApproversUnknown: H.isLoading,
|
|
97
|
-
labels: {
|
|
98
|
-
payBill: F.sheet.payButton,
|
|
99
|
-
markAsPaid: F.sheet.markAsPaidButton,
|
|
100
|
-
reject: F.sheet.rejectButton,
|
|
101
|
-
approve: F.sheet.approveButton,
|
|
102
|
-
cancel: F.sheet.cancelButton,
|
|
103
|
-
cancelScheduledPayment: F.sheet.cancelScheduledPaymentButton,
|
|
104
|
-
reopen: F.sheet.reopenButton,
|
|
105
|
-
forceApprove: F.sheet.forceApproveButton,
|
|
106
|
-
forceReject: F.sheet.forceRejectButton,
|
|
107
|
-
policyOverridesHeading: F.sheet.policyOverridesGroup,
|
|
108
|
-
decisionDialog: F.decisionDialog,
|
|
109
|
-
actionError: F.actionError,
|
|
110
|
-
actionSuccess: F.actionSuccess
|
|
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
|
|
111
56
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
})
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
/* @__PURE__ */ T(s, {
|
|
139
|
-
open: D,
|
|
140
|
-
onOpenChange: O,
|
|
141
|
-
details: Q,
|
|
142
|
-
actions: G,
|
|
143
|
-
approvalPolicy: H.view,
|
|
144
|
-
isLoading: $,
|
|
145
|
-
isError: ee,
|
|
146
|
-
notice: Z,
|
|
147
|
-
onClose: A,
|
|
148
|
-
onExpand: j,
|
|
149
|
-
testId: M,
|
|
150
|
-
labels: F.sheet
|
|
151
|
-
}),
|
|
152
|
-
/* @__PURE__ */ T(o, {
|
|
153
|
-
...K,
|
|
154
|
-
labels: { cancelButton: F.decisionDialog.cancelButton },
|
|
155
|
-
testId: M ? `${M}-decision-dialog` : void 0,
|
|
156
|
-
confirmTestId: M ? `${M}-decision-confirm` : void 0,
|
|
157
|
-
reasonTestId: M ? `${M}-decision-reason` : void 0,
|
|
158
|
-
reasonFieldId: M ? `${M}-decision-reason-field` : void 0
|
|
159
|
-
}),
|
|
160
|
-
/* @__PURE__ */ T(l, { ...W.dialogProps }),
|
|
161
|
-
z ? /* @__PURE__ */ T(f, {
|
|
162
|
-
ref: B,
|
|
163
|
-
payable: z,
|
|
164
|
-
onMissingAchInstructions: j,
|
|
165
|
-
poweredByBankName: P
|
|
166
|
-
}) : null
|
|
167
|
-
] });
|
|
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
|
+
dueDateTone: p.isOverdue ? "danger" : "default",
|
|
78
|
+
payToItems: v,
|
|
79
|
+
invoiceItems: b,
|
|
80
|
+
lineItems: S,
|
|
81
|
+
totals: C
|
|
82
|
+
};
|
|
168
83
|
}
|
|
169
84
|
//#endregion
|
|
170
|
-
export {
|
|
85
|
+
export { a as mapPayableToBillDetails };
|
|
@@ -1,3 +1,170 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
+
import { useAllLedgerAccountsQuery as n } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
+
import "../../../shared/feature/dist/index.js";
|
|
11
|
+
import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index9.js";
|
|
12
|
+
import { usePayableQuery as a } from "../../data-access/dist/index15.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
14
|
+
import { BillDecisionDialog as o } from "../../ui/dist/index51.js";
|
|
15
|
+
import { BillDetailsSheet as s } from "../../ui/dist/index57.js";
|
|
16
|
+
import { BillDuplicateNotice as c } from "../../ui/dist/index61.js";
|
|
17
|
+
import { MarkAsPaidDialog as l } from "../../ui/dist/index88.js";
|
|
18
|
+
import "../../ui/dist/index.js";
|
|
19
|
+
import { usePayableDuplicateReview as u } from "./index10.js";
|
|
20
|
+
import "./index11.js";
|
|
21
|
+
import { resolveAmountDueMinorUnits as d } from "./index17.js";
|
|
22
|
+
import { PayBillFlow as f } from "./index23.js";
|
|
23
|
+
import "./index24.js";
|
|
24
|
+
import { mergeMarkAsPaidFlowLabels as p } from "./index12.js";
|
|
25
|
+
import { useMarkAsPaidFlow as m } from "./index14.js";
|
|
26
|
+
import "./index15.js";
|
|
27
|
+
import { mergeDecisionDialogCopy as h } from "./index39.js";
|
|
28
|
+
import { useApprovalPolicyCardView as g } from "./index30.js";
|
|
29
|
+
import { useCurrentApprovalRequestId as _ } from "./index31.js";
|
|
30
|
+
import { usePayableDetailActions as v } from "./index32.js";
|
|
31
|
+
import { useScheduledPayment as y } from "./index33.js";
|
|
32
|
+
import { BILL_DETAILS_LABELS_EN as b } from "./index56.js";
|
|
33
|
+
import { mapPayableToBillDetails as x } from "./index57.js";
|
|
34
|
+
import { useMemo as S, useRef as C } from "react";
|
|
35
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
36
|
+
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js
|
|
37
|
+
function D({ open: D, onOpenChange: O, payableId: k, onClose: A, onExpand: j, testId: M, labels: N, poweredByBankName: P }) {
|
|
38
|
+
let F = S(() => ({
|
|
39
|
+
...b,
|
|
40
|
+
...N,
|
|
41
|
+
sheet: {
|
|
42
|
+
...b.sheet,
|
|
43
|
+
...N?.sheet,
|
|
44
|
+
statusBadge: {
|
|
45
|
+
...b.sheet.statusBadge,
|
|
46
|
+
...N?.sheet?.statusBadge
|
|
47
|
+
},
|
|
48
|
+
approvalPolicy: {
|
|
49
|
+
...b.sheet.approvalPolicy,
|
|
50
|
+
...N?.sheet?.approvalPolicy
|
|
51
|
+
},
|
|
52
|
+
dueDate: {
|
|
53
|
+
...b.sheet.dueDate,
|
|
54
|
+
...N?.sheet?.dueDate
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
decisionDialog: h(b.decisionDialog, N?.decisionDialog),
|
|
58
|
+
approvalPolicyCopy: {
|
|
59
|
+
...b.approvalPolicyCopy,
|
|
60
|
+
...N?.approvalPolicyCopy
|
|
61
|
+
},
|
|
62
|
+
markAsPaid: p(N?.markAsPaid),
|
|
63
|
+
actionSuccess: {
|
|
64
|
+
...b.actionSuccess,
|
|
65
|
+
...N?.actionSuccess
|
|
66
|
+
}
|
|
67
|
+
}), [N]), I = a(k), L = i(k), R = n(), z = I.data, B = C(null), V = _({
|
|
68
|
+
payableId: k,
|
|
69
|
+
status: z?.status
|
|
70
|
+
}), H = g({
|
|
71
|
+
payableId: k,
|
|
72
|
+
approvalPolicyId: z?.approval_policy_id,
|
|
73
|
+
copy: F.approvalPolicyCopy
|
|
74
|
+
}), U = y({
|
|
75
|
+
payableId: k,
|
|
76
|
+
scheduledPaymentDate: z?.scheduled_payment_date
|
|
77
|
+
}), W = m({
|
|
78
|
+
payableId: k,
|
|
79
|
+
amountDueMinorUnits: d(z) ?? 0,
|
|
80
|
+
amountToPayMinorUnits: z?.amount_to_pay ?? void 0,
|
|
81
|
+
currencyCode: z?.currency ?? void 0,
|
|
82
|
+
dueDate: z?.due_date,
|
|
83
|
+
hasScheduledPayment: U.hasScheduledPayment,
|
|
84
|
+
testId: M,
|
|
85
|
+
labels: F.markAsPaid
|
|
86
|
+
}), { actions: G, decisionDialog: K } = v({
|
|
87
|
+
payableId: z ? k : void 0,
|
|
88
|
+
status: z?.status,
|
|
89
|
+
currentApprovalRequestId: V.id,
|
|
90
|
+
isPolicyApprover: V.isPolicyApprover,
|
|
91
|
+
hasWaitingRequest: V.hasWaitingRequest,
|
|
92
|
+
hasScheduledPayment: U.hasScheduledPayment,
|
|
93
|
+
scheduledPaymentIntentId: U.scheduledPaymentIntentId,
|
|
94
|
+
isScheduledPaymentUnknown: U.isResolving,
|
|
95
|
+
pendingApprovers: H.pendingApprovers,
|
|
96
|
+
arePendingApproversUnknown: H.isLoading,
|
|
97
|
+
labels: {
|
|
98
|
+
payBill: F.sheet.payButton,
|
|
99
|
+
markAsPaid: F.sheet.markAsPaidButton,
|
|
100
|
+
reject: F.sheet.rejectButton,
|
|
101
|
+
approve: F.sheet.approveButton,
|
|
102
|
+
cancel: F.sheet.cancelButton,
|
|
103
|
+
cancelScheduledPayment: F.sheet.cancelScheduledPaymentButton,
|
|
104
|
+
reopen: F.sheet.reopenButton,
|
|
105
|
+
forceApprove: F.sheet.forceApproveButton,
|
|
106
|
+
forceReject: F.sheet.forceRejectButton,
|
|
107
|
+
policyOverridesHeading: F.sheet.policyOverridesGroup,
|
|
108
|
+
decisionDialog: F.decisionDialog,
|
|
109
|
+
actionError: F.actionError,
|
|
110
|
+
actionSuccess: F.actionSuccess
|
|
111
|
+
},
|
|
112
|
+
isMarkAsPaidPending: W.isPending,
|
|
113
|
+
onMarkAsPaidSelect: W.open,
|
|
114
|
+
onPayBillSelect: () => B.current?.open()
|
|
115
|
+
}), q = U.hasScheduledPayment && U.scheduledDateLabel ? /* @__PURE__ */ T("p", {
|
|
116
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
117
|
+
children: F.scheduledSummary(U.scheduledDateLabel)
|
|
118
|
+
}) : void 0, { initResponse: J } = r(), Y = u({
|
|
119
|
+
payable: z,
|
|
120
|
+
canManage: e(J?.scopes, [t.PayableWriteOrg])
|
|
121
|
+
}), X = Y.isPossibleDuplicate ? /* @__PURE__ */ T(c, {
|
|
122
|
+
onNotADuplicate: Y.onNotADuplicate,
|
|
123
|
+
isActionDisabled: Y.isBusy
|
|
124
|
+
}) : void 0, Z = X || q ? /* @__PURE__ */ E(w, { children: [X, q] }) : void 0, Q = S(() => z ? x({
|
|
125
|
+
payable: z,
|
|
126
|
+
lineItems: L.lineItems,
|
|
127
|
+
ledgerAccounts: R.data?.data ?? [],
|
|
128
|
+
labels: F,
|
|
129
|
+
hasScheduledPayment: U.hasScheduledPayment
|
|
130
|
+
}) : void 0, [
|
|
131
|
+
z,
|
|
132
|
+
L.lineItems,
|
|
133
|
+
R.data,
|
|
134
|
+
F,
|
|
135
|
+
U.hasScheduledPayment
|
|
136
|
+
]), $ = I.isLoading || L.isResolving || R.isResolving, ee = I.isError || L.isError || R.isError;
|
|
137
|
+
return /* @__PURE__ */ E(w, { children: [
|
|
138
|
+
/* @__PURE__ */ T(s, {
|
|
139
|
+
open: D,
|
|
140
|
+
onOpenChange: O,
|
|
141
|
+
details: Q,
|
|
142
|
+
actions: G,
|
|
143
|
+
approvalPolicy: H.view,
|
|
144
|
+
isLoading: $,
|
|
145
|
+
isError: ee,
|
|
146
|
+
notice: Z,
|
|
147
|
+
onClose: A,
|
|
148
|
+
onExpand: j,
|
|
149
|
+
testId: M,
|
|
150
|
+
labels: F.sheet
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ T(o, {
|
|
153
|
+
...K,
|
|
154
|
+
labels: { cancelButton: F.decisionDialog.cancelButton },
|
|
155
|
+
testId: M ? `${M}-decision-dialog` : void 0,
|
|
156
|
+
confirmTestId: M ? `${M}-decision-confirm` : void 0,
|
|
157
|
+
reasonTestId: M ? `${M}-decision-reason` : void 0,
|
|
158
|
+
reasonFieldId: M ? `${M}-decision-reason-field` : void 0
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ T(l, { ...W.dialogProps }),
|
|
161
|
+
z ? /* @__PURE__ */ T(f, {
|
|
162
|
+
ref: B,
|
|
163
|
+
payable: z,
|
|
164
|
+
onMissingAchInstructions: j,
|
|
165
|
+
poweredByBankName: P
|
|
166
|
+
}) : null
|
|
167
|
+
] });
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
export { D as BillDetailsContainer, D as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
|
|
1
|
+
import "./index56.js";
|
|
2
|
+
import "./index57.js";
|
|
3
|
+
import "./index58.js";
|
|
@@ -1,46 +1,4 @@
|
|
|
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 "./index59.js";
|
|
8
|
-
import { Payables as r } from "../../../monite-sdk/dist/index444.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";
|
|
14
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js
|
|
15
|
-
var
|
|
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: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
|
|
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
|
-
providerLabels: v,
|
|
39
|
-
children: /* @__PURE__ */ o(c, {
|
|
40
|
-
...b,
|
|
41
|
-
pageTitleComponent: y
|
|
42
|
-
})
|
|
43
|
-
});
|
|
44
|
-
}
|
|
2
|
+
var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
|
|
45
3
|
//#endregion
|
|
46
|
-
export {
|
|
4
|
+
export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
|
|
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 "./index60.js";
|
|
8
|
+
import { Payables as r } from "../../../monite-sdk/dist/index444.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";
|
|
14
|
+
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js
|
|
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: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
|
|
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
|
+
providerLabels: v,
|
|
39
|
+
children: /* @__PURE__ */ o(c, {
|
|
40
|
+
...b,
|
|
41
|
+
pageTitleComponent: y
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { l as BillPayWidgetMonite, l as default };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js
|
|
2
|
-
var e =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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`
|
|
9
|
-
};
|
|
2
|
+
var e = (e) => [
|
|
3
|
+
"bill-pay",
|
|
4
|
+
"upload-queue",
|
|
5
|
+
e ?? ""
|
|
6
|
+
];
|
|
10
7
|
//#endregion
|
|
11
|
-
export { e as
|
|
8
|
+
export { e as billPayUploadQueueKey };
|
|
@@ -1,94 +1,11 @@
|
|
|
1
|
-
"use client";
|
|
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/index12.js";
|
|
9
|
-
import { usePayableOcrQueries as r } from "../../data-access/dist/index14.js";
|
|
10
|
-
import "../../data-access/dist/index.js";
|
|
11
|
-
import { billPayUploadQueueKey as i } from "./index62.js";
|
|
12
|
-
import { BILL_UPLOAD_QUEUE_LABELS_EN as a } from "./index63.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
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
}
|
|
2
|
+
var e = {
|
|
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`
|
|
9
|
+
};
|
|
93
10
|
//#endregion
|
|
94
|
-
export {
|
|
11
|
+
export { e as BILL_UPLOAD_QUEUE_LABELS_EN };
|