@tesouro/embedded-components-react 0.5.303 → 0.5.305
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/bill-detail/feature/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +8 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +24 -157
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +20 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +13 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +153 -89
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +17 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +23 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +42 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +93 -107
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +77 -185
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +3 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +55 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +111 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +184 -463
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +78 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +61 -74
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +115 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +449 -216
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +116 -42
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +11 -249
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +85 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +80 -648
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +240 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +44 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +38 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +242 -240
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +25 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +538 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +3 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +42 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +239 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +67 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +227 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +82 -224
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +45 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +4 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index29.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillsTab.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,101 +1,165 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
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 "../../../../shared/ui/dist/index.js";
|
|
7
|
+
import { useWidgetConfig as t } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
8
|
+
import "../../../../shared/feature/dist/index.js";
|
|
9
|
+
import { useApprovePayableApprovalRequestMutation as n, useRejectPayableApprovalRequestMutation as r } from "../../data-access/dist/index2.js";
|
|
10
|
+
import { useCancelPayableMutation as i } from "../../data-access/dist/index6.js";
|
|
11
|
+
import { useCancelScheduledPaymentMutation as a } from "../../data-access/dist/index7.js";
|
|
12
|
+
import { useForceApprovePayableMutation as o } from "../../data-access/dist/index11.js";
|
|
13
|
+
import { useForceRejectPayableMutation as s } from "../../data-access/dist/index12.js";
|
|
14
|
+
import { useReopenPayableMutation as c } from "../../data-access/dist/index13.js";
|
|
15
|
+
import "../../data-access/dist/index.js";
|
|
16
|
+
import { getBillDetailActions as l } from "./index6.js";
|
|
17
|
+
import { useState as u } from "react";
|
|
18
|
+
import { BanIcon as d, HandIcon as f } from "lucide-react";
|
|
7
19
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
function p({ payableId: d, status: f, currentApprovalRequestId: p, arePendingApproversUnknown: m, hasScheduledPayment: h, scheduledPaymentIntentId: g, isScheduledPaymentUnknown: v, isPayabilityUnknown: x, labels: S, isMarkAsPaidPending: C, hasApprovalPolicy: w = !0, hasWaitingRequest: T, pendingApprovers: E, onPayBillSelect: D, onMarkAsPaidSelect: O, onEditSelect: k, onActionSucceeded: A }) {
|
|
21
|
+
let { initResponse: j } = t(), M = r(), N = n(), P = i(), F = a(), I = c(), L = o(), R = s(), z = C || M.isPending || N.isPending || P.isPending || F.isPending || I.isPending || L.isPending || R.isPending, [B, V] = u(), H = B && (B.id !== "cancelScheduledPayment" || B.scheduledPaymentIntentId === g) ? B : void 0, U = d && f ? l({
|
|
22
|
+
status: f,
|
|
23
|
+
scopes: j?.scopes,
|
|
24
|
+
canDecideApprovalRequest: !!p,
|
|
25
|
+
arePendingApproversUnknown: m,
|
|
26
|
+
hasApprovalPolicy: w,
|
|
27
|
+
hasWaitingRequest: T,
|
|
28
|
+
hasScheduledPayment: h || v,
|
|
29
|
+
scheduledPaymentIntentId: g,
|
|
30
|
+
isPayabilityUnknown: x,
|
|
31
|
+
canEdit: !!k,
|
|
32
|
+
labels: S
|
|
33
|
+
}) : [], W = (t) => ({
|
|
34
|
+
onError: () => e.error(S.actionError),
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
let n = b(t) && !w ? `${t}NoApprovalPolicy` : t;
|
|
37
|
+
e.success(S.actionSuccess[n]), A?.(t);
|
|
38
|
+
}
|
|
39
|
+
}), G = {
|
|
40
|
+
reject: {
|
|
41
|
+
isPending: M.isPending,
|
|
42
|
+
run: (e) => p && M.mutate({
|
|
43
|
+
path: { approval_request_id: p },
|
|
44
|
+
body: e ? { reject_reason: e } : void 0
|
|
45
|
+
}, W("reject"))
|
|
34
46
|
},
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
47
|
+
approve: {
|
|
48
|
+
isPending: N.isPending,
|
|
49
|
+
run: () => p && N.mutate({ path: { approval_request_id: p } }, W("approve"))
|
|
38
50
|
},
|
|
39
|
-
{
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
cancel: {
|
|
52
|
+
isPending: P.isPending,
|
|
53
|
+
run: () => d && P.mutate({ path: { payable_id: d } }, W("cancel"))
|
|
42
54
|
},
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}), j = [
|
|
57
|
-
{
|
|
58
|
-
label: p.subtotalRow,
|
|
59
|
-
value: l.subtotal
|
|
55
|
+
cancelScheduledPayment: {
|
|
56
|
+
isPending: F.isPending,
|
|
57
|
+
run: () => {
|
|
58
|
+
let e = H?.scheduledPaymentIntentId;
|
|
59
|
+
d && e && F.mutate({
|
|
60
|
+
path: { payment_intent_id: e },
|
|
61
|
+
payableId: d
|
|
62
|
+
}, W("cancelScheduledPayment"));
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
reopen: {
|
|
66
|
+
isPending: I.isPending,
|
|
67
|
+
run: () => d && I.mutate({ path: { payable_id: d } }, W("reopen"))
|
|
60
68
|
},
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
forceApprove: {
|
|
70
|
+
isPending: L.isPending,
|
|
71
|
+
run: () => d && L.mutate({ path: { payable_id: d } }, W("forceApprove"))
|
|
64
72
|
},
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
forceReject: {
|
|
74
|
+
isPending: R.isPending,
|
|
75
|
+
run: () => d && R.mutate({ path: { payable_id: d } }, W("forceReject"))
|
|
68
76
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
}, K = U.map((e) => ({
|
|
78
|
+
...e,
|
|
79
|
+
disabled: z,
|
|
80
|
+
loading: e.id === "markAsPaid" ? C : G[e.id]?.isPending ?? !1,
|
|
81
|
+
onSelect: () => {
|
|
82
|
+
if (!z && d) {
|
|
83
|
+
if (e.id === "payBill") {
|
|
84
|
+
D();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (e.id === "markAsPaid") {
|
|
88
|
+
O();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (e.id === "edit") {
|
|
92
|
+
k?.();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (y(e.id)) {
|
|
96
|
+
V({
|
|
97
|
+
id: e.id,
|
|
98
|
+
scheduledPaymentIntentId: g
|
|
99
|
+
});
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
G[e.id]?.run();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
79
106
|
return {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
isActionPending: z,
|
|
108
|
+
actions: {
|
|
109
|
+
row: K.filter((e) => e.surface === "row"),
|
|
110
|
+
menu: K.filter((e) => e.surface === "menu")
|
|
111
|
+
},
|
|
112
|
+
decisionDialog: {
|
|
113
|
+
open: !!H,
|
|
114
|
+
copy: H ? {
|
|
115
|
+
...S.decisionDialog[H.id],
|
|
116
|
+
...b(H.id) && !w ? S.decisionDialog[H.id].noApprovalPolicy : void 0,
|
|
117
|
+
presentation: _(H.id),
|
|
118
|
+
pendingApprovers: b(H.id) ? E ?? [] : void 0
|
|
119
|
+
} : void 0,
|
|
120
|
+
isPending: H ? G[H.id]?.isPending ?? !1 : !1,
|
|
121
|
+
onCancel: () => {
|
|
122
|
+
z || V(void 0);
|
|
123
|
+
},
|
|
124
|
+
onConfirm: (e) => {
|
|
125
|
+
H && !z && (G[H.id]?.run(e), V(void 0));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
95
128
|
};
|
|
96
129
|
}
|
|
97
|
-
|
|
98
|
-
|
|
130
|
+
var m = {
|
|
131
|
+
alignment: "center",
|
|
132
|
+
icon: f,
|
|
133
|
+
tone: "destructive",
|
|
134
|
+
actionWidth: "equal"
|
|
135
|
+
}, h = {
|
|
136
|
+
alignment: "center",
|
|
137
|
+
icon: d,
|
|
138
|
+
tone: "destructive",
|
|
139
|
+
actionWidth: "equal"
|
|
140
|
+
}, g = {
|
|
141
|
+
alignment: "center",
|
|
142
|
+
icon: d,
|
|
143
|
+
tone: "destructive",
|
|
144
|
+
actionWidth: "equal"
|
|
145
|
+
};
|
|
146
|
+
function _(e) {
|
|
147
|
+
if (b(e)) return m;
|
|
148
|
+
if (e === "reject") return h;
|
|
149
|
+
if (e === "cancel") return g;
|
|
150
|
+
}
|
|
151
|
+
var v = [
|
|
152
|
+
"reject",
|
|
153
|
+
"cancel",
|
|
154
|
+
"cancelScheduledPayment",
|
|
155
|
+
"forceApprove",
|
|
156
|
+
"forceReject"
|
|
157
|
+
];
|
|
158
|
+
function y(e) {
|
|
159
|
+
return v.includes(e);
|
|
160
|
+
}
|
|
161
|
+
function b(e) {
|
|
162
|
+
return e === "forceApprove" || e === "forceReject";
|
|
99
163
|
}
|
|
100
164
|
//#endregion
|
|
101
|
-
export {
|
|
165
|
+
export { p as usePayableDetailActions };
|
|
@@ -1,86 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useLocalCalendarDay as e } from "../../../../shared/feature/dist/lib/calendar/useLocalCalendarDay.js";
|
|
6
|
+
import "../../../../shared/feature/dist/index.js";
|
|
7
|
+
import { formatScheduledDateLabel as t } from "../../../util/dist/lib/formatScheduledDateLabel.js";
|
|
8
|
+
import { useMemo as n } from "react";
|
|
9
9
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
label: g.subtotalRow,
|
|
19
|
-
minorUnits: l.subtotal
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
label: g.discountRow,
|
|
23
|
-
minorUnits: l.discount
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
label: g.taxRow,
|
|
27
|
-
minorUnits: l.tax_amount
|
|
28
|
-
}
|
|
29
|
-
].map((e) => ({
|
|
30
|
-
label: e.label,
|
|
31
|
-
value: n(e.minorUnits, x)
|
|
32
|
-
})).filter((e) => !!e.value), j = n(c(l), x);
|
|
33
|
-
j && A.push({
|
|
34
|
-
label: g.totalRow,
|
|
35
|
-
value: j,
|
|
36
|
-
emphasis: !0
|
|
37
|
-
});
|
|
38
|
-
let M = s(l);
|
|
39
|
-
return {
|
|
40
|
-
amountDue: n(r(l), x) ?? "",
|
|
41
|
-
amountPaid: M ? n(l.amount_paid, x) : void 0,
|
|
42
|
-
paidOnLabel: M ? g.paidOnLabel(M) : void 0,
|
|
43
|
-
invoiceDateLabel: D,
|
|
44
|
-
dueDateLabel: O,
|
|
45
|
-
dueDateTone: S.isOverdue ? "danger" : "default",
|
|
46
|
-
status: S.status,
|
|
47
|
-
statusTone: S.tone,
|
|
48
|
-
payTo: {
|
|
49
|
-
name: C?.name || g.notProvided,
|
|
50
|
-
email: C?.email ?? "",
|
|
51
|
-
methodLabel: E ? g.paymentInstructionsValue(T?.slice(-4) ?? "") : g.paymentInstructionsNotSet,
|
|
52
|
-
hasPaymentInstructions: E
|
|
53
|
-
},
|
|
54
|
-
invoiceFields: [
|
|
55
|
-
{
|
|
56
|
-
label: g.invoiceDateRow,
|
|
57
|
-
value: D
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
label: g.dueDateRow,
|
|
61
|
-
value: O
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: g.invoiceNumberRow,
|
|
65
|
-
value: l.document_id || g.notProvided
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
lineItems: u.map((e) => {
|
|
69
|
-
let t = n(e.unit_price, x), r = String(a(e));
|
|
70
|
-
return {
|
|
71
|
-
id: e.id,
|
|
72
|
-
description: e.name ?? e.description ?? "",
|
|
73
|
-
glCodeLabel: e.ledger_account_id ? k.get(e.ledger_account_id) ?? (f ? g.glCodeMissing : g.glCodeUnavailable) : g.glCodeMissing,
|
|
74
|
-
qtyPriceLabel: t ? g.qtyPriceValue(r, t) : g.qtyOnlyValue(r),
|
|
75
|
-
amount: n(i(e), x) ?? ""
|
|
76
|
-
};
|
|
77
|
-
}),
|
|
78
|
-
amountRows: A,
|
|
79
|
-
approvalPolicy: h,
|
|
80
|
-
paymentHistory: m,
|
|
81
|
-
history: p,
|
|
82
|
-
rejection: v
|
|
83
|
-
};
|
|
10
|
+
function r({ hasScheduledPayment: r, scheduledDate: i, labels: a }) {
|
|
11
|
+
let o = e();
|
|
12
|
+
return n(() => r && i ? t(i, a, o) : void 0, [
|
|
13
|
+
r,
|
|
14
|
+
i,
|
|
15
|
+
a,
|
|
16
|
+
o
|
|
17
|
+
]);
|
|
84
18
|
}
|
|
85
19
|
//#endregion
|
|
86
|
-
export {
|
|
20
|
+
export { r as useScheduledDateLabel };
|
|
@@ -1,6 +1,26 @@
|
|
|
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 "../../../../shared/data-access/dist/index.js";
|
|
8
|
+
import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
|
+
import "../../../../shared/feature/dist/index.js";
|
|
10
|
+
import { isLiveScheduledPaymentRecord as r } from "../../../util/dist/lib/isLiveScheduledPaymentRecord.js";
|
|
11
|
+
import { usePayablePaymentRecordsQuery as i } from "../../data-access/dist/index18.js";
|
|
12
|
+
import "../../data-access/dist/index.js";
|
|
1
13
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js
|
|
2
|
-
function
|
|
3
|
-
|
|
14
|
+
function a({ payableId: a, scheduledPaymentDate: o, enabled: s = !0 }) {
|
|
15
|
+
let { initResponse: c } = n(), l = e(c?.scopes, [t.PaymentRecordReadOrg]), u = i(s ? a : void 0, { enabled: s && l }), d = u.paymentRecords.find(r), f = !!d || !!o, p = d?.planned_payment_date ?? (f ? o : void 0);
|
|
16
|
+
return {
|
|
17
|
+
hasScheduledPayment: f,
|
|
18
|
+
paymentRecords: u.paymentRecords,
|
|
19
|
+
isError: u.isError,
|
|
20
|
+
isResolving: u.isResolving,
|
|
21
|
+
scheduledDate: p ?? void 0,
|
|
22
|
+
scheduledPaymentIntentId: d?.payment_intent_id ?? void 0
|
|
23
|
+
};
|
|
4
24
|
}
|
|
5
25
|
//#endregion
|
|
6
|
-
export {
|
|
26
|
+
export { a as useScheduledPayment };
|
|
@@ -1,57 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { hasAnyScope as t } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
+
import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
9
|
+
import "../../../../shared/ui/dist/index.js";
|
|
10
|
+
import { useWidgetConfig as r } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
+
import "../../../../shared/feature/dist/index.js";
|
|
12
|
+
import { useDeletePayableMutation as i } from "../../data-access/dist/index10.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
14
|
+
import { useState as a } from "react";
|
|
3
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
quotedReason: (e) => `"${e}"`,
|
|
32
|
-
cancelled: "Cancelled",
|
|
33
|
-
reopened: "Re-opened",
|
|
34
|
-
paymentReleased: "Payment released",
|
|
35
|
-
paid: (e) => `Paid ${e}`,
|
|
36
|
-
paymentReverted: "Payment reverted",
|
|
37
|
-
calendarDateLabel: (t) => e(t),
|
|
38
|
-
paymentScheduled: "Payment scheduled",
|
|
39
|
-
scheduledFor: (e) => `Scheduled for ${e}`,
|
|
40
|
-
scheduledPaymentCancelled: "Scheduled payment cancelled",
|
|
41
|
-
cancelledAsBillChanged: "The bill was changed",
|
|
42
|
-
cancelledAsBillDeleted: "The bill was deleted",
|
|
43
|
-
paymentFailed: "Payment failed",
|
|
44
|
-
billMarkedAsFullyPaid: "Bill marked as fully paid",
|
|
45
|
-
billMarkedAsPartiallyPaid: "Bill marked as partially paid",
|
|
46
|
-
draftDeleted: "Draft deleted",
|
|
47
|
-
fileAttached: "File attached",
|
|
48
|
-
fileRemoved: "File removed",
|
|
49
|
-
creditNoteLinked: "Credit note linked",
|
|
50
|
-
creditNoteUnlinked: "Credit note unlinked",
|
|
51
|
-
lineItemsUpdated: "Line items updated",
|
|
52
|
-
lineItemAdded: "Line item added",
|
|
53
|
-
lineItemUpdated: "Line item updated",
|
|
54
|
-
lineItemRemoved: "Line item removed"
|
|
55
|
-
};
|
|
16
|
+
function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
|
|
17
|
+
let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
|
|
18
|
+
id: "deleteDraft",
|
|
19
|
+
label: l.menuItem,
|
|
20
|
+
destructive: !0,
|
|
21
|
+
onSelect: () => m(!0)
|
|
22
|
+
}] : [], v = p && g;
|
|
23
|
+
return {
|
|
24
|
+
menuItems: _,
|
|
25
|
+
dialog: {
|
|
26
|
+
open: v,
|
|
27
|
+
copy: v ? l.dialog : void 0,
|
|
28
|
+
isPending: f.isPending,
|
|
29
|
+
onCancel: () => {
|
|
30
|
+
f.isPending || m(!1);
|
|
31
|
+
},
|
|
32
|
+
onConfirm: () => {
|
|
33
|
+
g && o && !f.isPending && f.mutate({ path: { payable_id: o } }, {
|
|
34
|
+
onError: () => e.error(l.error),
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
m(!1), u();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
56
43
|
//#endregion
|
|
57
|
-
export {
|
|
44
|
+
export { o as useDraftDelete };
|