@tesouro/embedded-components-react 0.3.45 → 0.3.47
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 +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +42 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +4 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +40 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +56 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +5 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +72 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +47 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +91 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +33 -160
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +163 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +75 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +23 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +198 -202
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +197 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +105 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +12 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +47 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +26 -182
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +187 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +32 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +102 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +16 -301
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +322 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +4 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +31 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +77 -159
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +167 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +2 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +46 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +6 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +9 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +7 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +14 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +59 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +3 -128
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +125 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +8 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +41 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +20 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +27 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +83 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +47 -250
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +240 -101
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +107 -204
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +211 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +6 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +115 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +28 -27
- 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
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { RefreshingRootWidgetProvider as _ } from "./libs/tesouro-embedded-compo
|
|
|
14
14
|
import { useDisclosuresAcceptanceSurface as v, useOwnWidgetConfig as y, useRefetchWidget as b, useWidgetConfig as x, useWidgetError as S, useWidgetLoading as C } from "./libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
15
|
import { BankAccountsWidget as w } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
|
|
16
16
|
import { CounterpartsWidget as T } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
|
|
17
|
-
import { BillPayWidget as E } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/
|
|
17
|
+
import { BillPayWidget as E } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js";
|
|
18
18
|
import { CardDetailsWidget as D } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js";
|
|
19
19
|
import { CardFormatValue as O } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
|
|
20
20
|
import { CREATE_CARD_FEATURE_LABELS_EN as k, resolveCreateCardFeatureLabels as A } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index5.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/
|
|
1
|
+
import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js";
|
|
2
2
|
import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
|
|
3
3
|
export { e as BillPayWidget };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import "./index13.js";
|
|
2
2
|
import "./index14.js";
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./index44.js";
|
|
3
|
+
import "./index26.js";
|
|
4
|
+
import "./index32.js";
|
|
5
|
+
import "./index41.js";
|
|
6
|
+
import "./index43.js";
|
|
8
7
|
import "./index45.js";
|
|
9
8
|
import "./index46.js";
|
|
10
9
|
import "./index47.js";
|
|
11
10
|
import "./index48.js";
|
|
12
11
|
import "./index49.js";
|
|
13
|
-
import "./
|
|
12
|
+
import "./index50.js";
|
|
14
13
|
import "./index54.js";
|
|
15
14
|
import "./index55.js";
|
|
16
15
|
import "./index56.js";
|
|
@@ -19,9 +18,10 @@ import "./index58.js";
|
|
|
19
18
|
import "./index59.js";
|
|
20
19
|
import "./index60.js";
|
|
21
20
|
import "./index61.js";
|
|
22
|
-
import "./
|
|
23
|
-
import "./
|
|
21
|
+
import "./index62.js";
|
|
22
|
+
import "./index64.js";
|
|
24
23
|
import "./index70.js";
|
|
25
24
|
import "./index71.js";
|
|
26
|
-
import
|
|
25
|
+
import "./index72.js";
|
|
26
|
+
import { BillPayWidget as e } from "./index76.js";
|
|
27
27
|
export { e as BillPayWidget };
|
|
@@ -13,10 +13,10 @@ import { getBillDetailActions as l } from "./index21.js";
|
|
|
13
13
|
import { useState as u } from "react";
|
|
14
14
|
import { HandIcon as d } from "lucide-react";
|
|
15
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js
|
|
16
|
-
function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyApprover: _, hasWaitingRequest: v, arePendingApproversUnknown: y, hasScheduledPayment: b, scheduledPaymentIntentId: x, isScheduledPaymentUnknown: S, labels: C, isMarkAsPaidPending: w, pendingApprovers: T, onPayBillSelect: E, onMarkAsPaidSelect: D }) {
|
|
17
|
-
let { initResponse:
|
|
16
|
+
function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyApprover: _, hasWaitingRequest: v, arePendingApproversUnknown: y, hasScheduledPayment: b, scheduledPaymentIntentId: x, isScheduledPaymentUnknown: S, labels: C, isMarkAsPaidPending: w, pendingApprovers: T, onPayBillSelect: E, onMarkAsPaidSelect: D, onActionSucceeded: O }) {
|
|
17
|
+
let { initResponse: k } = t(), A = r(), j = n(), M = i(), N = a(), P = c(), F = o(), I = s(), L = w || A.isPending || j.isPending || M.isPending || N.isPending || P.isPending || F.isPending || I.isPending, [R, z] = u(), B = R && (R.id !== "cancelScheduledPayment" || R.scheduledPaymentIntentId === x) ? R : void 0, V = d && f ? l({
|
|
18
18
|
status: f,
|
|
19
|
-
scopes:
|
|
19
|
+
scopes: k?.scopes,
|
|
20
20
|
canDecideApprovalRequest: !!m,
|
|
21
21
|
isPolicyApprover: _,
|
|
22
22
|
hasWaitingRequest: v,
|
|
@@ -24,53 +24,55 @@ function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyAppro
|
|
|
24
24
|
hasScheduledPayment: b || S,
|
|
25
25
|
scheduledPaymentIntentId: x,
|
|
26
26
|
labels: C
|
|
27
|
-
}) : [],
|
|
27
|
+
}) : [], H = (t) => ({
|
|
28
28
|
onError: () => e.error(C.actionError),
|
|
29
|
-
onSuccess: () =>
|
|
30
|
-
|
|
29
|
+
onSuccess: () => {
|
|
30
|
+
e.success(C.actionSuccess[t]), O?.();
|
|
31
|
+
}
|
|
32
|
+
}), U = {
|
|
31
33
|
reject: {
|
|
32
|
-
isPending:
|
|
33
|
-
run: (e) => m &&
|
|
34
|
+
isPending: A.isPending,
|
|
35
|
+
run: (e) => m && A.mutate({
|
|
34
36
|
path: { approval_request_id: m },
|
|
35
37
|
body: e ? { reject_reason: e } : void 0
|
|
36
|
-
},
|
|
38
|
+
}, H("reject"))
|
|
37
39
|
},
|
|
38
40
|
approve: {
|
|
39
|
-
isPending:
|
|
40
|
-
run: () => m &&
|
|
41
|
+
isPending: j.isPending,
|
|
42
|
+
run: () => m && j.mutate({ path: { approval_request_id: m } }, H("approve"))
|
|
41
43
|
},
|
|
42
44
|
cancel: {
|
|
43
|
-
isPending:
|
|
44
|
-
run: () => d &&
|
|
45
|
+
isPending: M.isPending,
|
|
46
|
+
run: () => d && M.mutate({ path: { payable_id: d } }, H("cancel"))
|
|
45
47
|
},
|
|
46
48
|
cancelScheduledPayment: {
|
|
47
|
-
isPending:
|
|
49
|
+
isPending: N.isPending,
|
|
48
50
|
run: () => {
|
|
49
|
-
let e =
|
|
50
|
-
!d || !e ||
|
|
51
|
+
let e = B?.scheduledPaymentIntentId;
|
|
52
|
+
!d || !e || N.mutate({
|
|
51
53
|
path: { payment_intent_id: e },
|
|
52
54
|
payableId: d
|
|
53
|
-
},
|
|
55
|
+
}, H("cancelScheduledPayment"));
|
|
54
56
|
}
|
|
55
57
|
},
|
|
56
58
|
reopen: {
|
|
57
|
-
isPending:
|
|
58
|
-
run: () => d &&
|
|
59
|
+
isPending: P.isPending,
|
|
60
|
+
run: () => d && P.mutate({ path: { payable_id: d } }, H("reopen"))
|
|
59
61
|
},
|
|
60
62
|
forceApprove: {
|
|
61
|
-
isPending:
|
|
62
|
-
run: () => d &&
|
|
63
|
+
isPending: F.isPending,
|
|
64
|
+
run: () => d && F.mutate({ path: { payable_id: d } }, H("forceApprove"))
|
|
63
65
|
},
|
|
64
66
|
forceReject: {
|
|
65
|
-
isPending:
|
|
66
|
-
run: () => d &&
|
|
67
|
+
isPending: I.isPending,
|
|
68
|
+
run: () => d && I.mutate({ path: { payable_id: d } }, H("forceReject"))
|
|
67
69
|
}
|
|
68
|
-
},
|
|
70
|
+
}, W = V.map((e) => ({
|
|
69
71
|
...e,
|
|
70
|
-
disabled:
|
|
71
|
-
loading: e.id === "markAsPaid" ? w :
|
|
72
|
+
disabled: L,
|
|
73
|
+
loading: e.id === "markAsPaid" ? w : U[e.id]?.isPending ?? !1,
|
|
72
74
|
onSelect: () => {
|
|
73
|
-
if (!(
|
|
75
|
+
if (!(L || !d)) {
|
|
74
76
|
if (e.id === "payBill") {
|
|
75
77
|
E();
|
|
76
78
|
return;
|
|
@@ -80,34 +82,35 @@ function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyAppro
|
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
84
|
if (h(e.id)) {
|
|
83
|
-
|
|
85
|
+
z({
|
|
84
86
|
id: e.id,
|
|
85
87
|
scheduledPaymentIntentId: x
|
|
86
88
|
});
|
|
87
89
|
return;
|
|
88
90
|
}
|
|
89
|
-
|
|
91
|
+
U[e.id]?.run();
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
}));
|
|
93
95
|
return {
|
|
96
|
+
isActionPending: L,
|
|
94
97
|
actions: {
|
|
95
|
-
row:
|
|
96
|
-
menu:
|
|
98
|
+
row: W.filter((e) => e.surface === "row"),
|
|
99
|
+
menu: W.filter((e) => e.surface === "menu")
|
|
97
100
|
},
|
|
98
101
|
decisionDialog: {
|
|
99
|
-
open: !!
|
|
100
|
-
copy:
|
|
101
|
-
...C.decisionDialog[
|
|
102
|
-
presentation: g(
|
|
103
|
-
pendingApprovers: g(
|
|
102
|
+
open: !!B,
|
|
103
|
+
copy: B ? {
|
|
104
|
+
...C.decisionDialog[B.id],
|
|
105
|
+
presentation: g(B.id) ? p : void 0,
|
|
106
|
+
pendingApprovers: g(B.id) ? T ?? [] : void 0
|
|
104
107
|
} : void 0,
|
|
105
|
-
isPending:
|
|
108
|
+
isPending: B ? U[B.id]?.isPending ?? !1 : !1,
|
|
106
109
|
onCancel: () => {
|
|
107
|
-
|
|
110
|
+
L || z(void 0);
|
|
108
111
|
},
|
|
109
112
|
onConfirm: (e) => {
|
|
110
|
-
!
|
|
113
|
+
!B || L || (U[B.id]?.run(e), z(void 0));
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
};
|
|
@@ -1,44 +1,7 @@
|
|
|
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/index11.js";
|
|
13
|
-
import "../../data-access/dist/index.js";
|
|
14
|
-
import { useState as a } from "react";
|
|
15
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
};
|
|
2
|
+
var e = /* @__PURE__ */ new Set(["draft", "new"]);
|
|
3
|
+
function t(t) {
|
|
4
|
+
return !!(t && e.has(t));
|
|
42
5
|
}
|
|
43
6
|
//#endregion
|
|
44
|
-
export {
|
|
7
|
+
export { t as isEditablePayableStatus };
|
|
@@ -1,59 +1,44 @@
|
|
|
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/index11.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
14
|
+
import { useState as a } from "react";
|
|
1
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js
|
|
2
|
-
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
}
|
|
17
41
|
};
|
|
18
|
-
let s = !!(e.has(n) && r && t(r, o));
|
|
19
|
-
switch (n) {
|
|
20
|
-
case "draft": return {
|
|
21
|
-
status: "draft",
|
|
22
|
-
tone: "neutral",
|
|
23
|
-
isOverdue: s
|
|
24
|
-
};
|
|
25
|
-
case "new":
|
|
26
|
-
case "approve_in_progress": return {
|
|
27
|
-
status: "pending_approval",
|
|
28
|
-
tone: "warning",
|
|
29
|
-
isOverdue: s
|
|
30
|
-
};
|
|
31
|
-
case "waiting_to_be_paid": return {
|
|
32
|
-
status: "ready_to_pay",
|
|
33
|
-
tone: "info",
|
|
34
|
-
isOverdue: s
|
|
35
|
-
};
|
|
36
|
-
case "partially_paid": return {
|
|
37
|
-
status: "partially_paid",
|
|
38
|
-
tone: "success",
|
|
39
|
-
isOverdue: s
|
|
40
|
-
};
|
|
41
|
-
case "paid": return {
|
|
42
|
-
status: "paid",
|
|
43
|
-
tone: "success",
|
|
44
|
-
isOverdue: s
|
|
45
|
-
};
|
|
46
|
-
case "canceled": return {
|
|
47
|
-
status: "canceled",
|
|
48
|
-
tone: "muted",
|
|
49
|
-
isOverdue: s
|
|
50
|
-
};
|
|
51
|
-
case "rejected": return {
|
|
52
|
-
status: "rejected",
|
|
53
|
-
tone: "danger",
|
|
54
|
-
isOverdue: s
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
42
|
}
|
|
58
43
|
//#endregion
|
|
59
|
-
export {
|
|
44
|
+
export { o as useDraftDelete };
|
|
@@ -1,8 +1,59 @@
|
|
|
1
|
-
import { formatMoneyExact as e } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
2
|
-
import "../../data-access/dist/index.js";
|
|
3
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var e = /* @__PURE__ */ new Set([
|
|
3
|
+
"new",
|
|
4
|
+
"approve_in_progress",
|
|
5
|
+
"waiting_to_be_paid",
|
|
6
|
+
"partially_paid"
|
|
7
|
+
]);
|
|
8
|
+
function t(e, t) {
|
|
9
|
+
let n = /* @__PURE__ */ new Date(`${e.slice(0, 10)}T00:00:00Z`), r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
|
|
10
|
+
return n.getTime() < r;
|
|
11
|
+
}
|
|
12
|
+
function n({ apiStatus: n, dueDate: r, scheduledPaymentDate: i, hasScheduledPayment: a = !!i, now: o = /* @__PURE__ */ new Date() }) {
|
|
13
|
+
if (e.has(n) && a) return {
|
|
14
|
+
status: "scheduled",
|
|
15
|
+
tone: "accent",
|
|
16
|
+
isOverdue: !1
|
|
17
|
+
};
|
|
18
|
+
let s = !!(e.has(n) && r && t(r, o));
|
|
19
|
+
switch (n) {
|
|
20
|
+
case "draft": return {
|
|
21
|
+
status: "draft",
|
|
22
|
+
tone: "neutral",
|
|
23
|
+
isOverdue: s
|
|
24
|
+
};
|
|
25
|
+
case "new":
|
|
26
|
+
case "approve_in_progress": return {
|
|
27
|
+
status: "pending_approval",
|
|
28
|
+
tone: "warning",
|
|
29
|
+
isOverdue: s
|
|
30
|
+
};
|
|
31
|
+
case "waiting_to_be_paid": return {
|
|
32
|
+
status: "ready_to_pay",
|
|
33
|
+
tone: "info",
|
|
34
|
+
isOverdue: s
|
|
35
|
+
};
|
|
36
|
+
case "partially_paid": return {
|
|
37
|
+
status: "partially_paid",
|
|
38
|
+
tone: "success",
|
|
39
|
+
isOverdue: s
|
|
40
|
+
};
|
|
41
|
+
case "paid": return {
|
|
42
|
+
status: "paid",
|
|
43
|
+
tone: "success",
|
|
44
|
+
isOverdue: s
|
|
45
|
+
};
|
|
46
|
+
case "canceled": return {
|
|
47
|
+
status: "canceled",
|
|
48
|
+
tone: "muted",
|
|
49
|
+
isOverdue: s
|
|
50
|
+
};
|
|
51
|
+
case "rejected": return {
|
|
52
|
+
status: "rejected",
|
|
53
|
+
tone: "danger",
|
|
54
|
+
isOverdue: s
|
|
55
|
+
};
|
|
56
|
+
}
|
|
6
57
|
}
|
|
7
58
|
//#endregion
|
|
8
|
-
export {
|
|
59
|
+
export { n as derivePayableStatus };
|
|
@@ -1,76 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { resolveVendor as n } from "./index7.js";
|
|
4
|
-
import { derivePayableStatus as r } from "./index25.js";
|
|
5
|
-
import { formatBillMoney as i } from "./index26.js";
|
|
1
|
+
import { formatMoneyExact as e } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
2
|
+
import "../../data-access/dist/index.js";
|
|
6
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
apiStatus: a.status,
|
|
10
|
-
dueDate: a.due_date,
|
|
11
|
-
scheduledPaymentDate: a.scheduled_payment_date,
|
|
12
|
-
hasScheduledPayment: f
|
|
13
|
-
}), h = n(a), g = h?.bank_account?.account_number, _ = e(a.issued_at) || d.notProvided, v = e(a.due_date) || d.notProvided, y = new Map(s.map((e) => [e.value, e.label])), b = [
|
|
14
|
-
{
|
|
15
|
-
label: d.subtotalRow,
|
|
16
|
-
minorUnits: a.subtotal
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: d.discountRow,
|
|
20
|
-
minorUnits: a.discount
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: d.taxRow,
|
|
24
|
-
minorUnits: a.tax_amount
|
|
25
|
-
}
|
|
26
|
-
].map((e) => ({
|
|
27
|
-
label: e.label,
|
|
28
|
-
value: i(e.minorUnits, p)
|
|
29
|
-
})).filter((e) => !!e.value), x = i(a.total_amount, p);
|
|
30
|
-
return x && b.push({
|
|
31
|
-
label: d.totalRow,
|
|
32
|
-
value: x,
|
|
33
|
-
emphasis: !0
|
|
34
|
-
}), {
|
|
35
|
-
amountDue: i(t(a), p) ?? "",
|
|
36
|
-
invoiceDateLabel: _,
|
|
37
|
-
dueDateLabel: v,
|
|
38
|
-
dueDateTone: m.isOverdue ? "danger" : "default",
|
|
39
|
-
status: m.status,
|
|
40
|
-
statusTone: m.tone,
|
|
41
|
-
payTo: {
|
|
42
|
-
name: h?.name || d.notProvided,
|
|
43
|
-
email: h?.email ?? void 0,
|
|
44
|
-
paymentInstructionsLabel: g ? d.paymentInstructionsValue(g.slice(-4)) : void 0
|
|
45
|
-
},
|
|
46
|
-
invoiceFields: [
|
|
47
|
-
{
|
|
48
|
-
label: d.invoiceDateRow,
|
|
49
|
-
value: _
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: d.dueDateRow,
|
|
53
|
-
value: v
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
label: d.invoiceNumberRow,
|
|
57
|
-
value: a.document_id || d.notProvided
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
lineItems: o.map((e) => {
|
|
61
|
-
let t = i(e.unit_price, p);
|
|
62
|
-
return {
|
|
63
|
-
id: e.id,
|
|
64
|
-
description: e.name ?? e.description ?? "",
|
|
65
|
-
glCodeLabel: e.ledger_account_id ? y.get(e.ledger_account_id) ?? (c ? d.glCodeMissing : d.glCodeUnavailable) : d.glCodeMissing,
|
|
66
|
-
qtyPriceLabel: e.quantity != null && t ? d.qtyPriceValue(String(e.quantity), t) : "",
|
|
67
|
-
amount: i(e.subtotal, p) ?? ""
|
|
68
|
-
};
|
|
69
|
-
}),
|
|
70
|
-
amountRows: b,
|
|
71
|
-
approvalPolicy: u,
|
|
72
|
-
history: l
|
|
73
|
-
};
|
|
4
|
+
function t(t, n) {
|
|
5
|
+
if (typeof t == "number") return e(t / 100, { currencyCode: n ?? "USD" });
|
|
74
6
|
}
|
|
75
7
|
//#endregion
|
|
76
|
-
export {
|
|
8
|
+
export { t as formatBillMoney };
|
|
@@ -1,52 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
1
|
+
import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
+
import { resolveAmountDueMinorUnits as t } from "./index6.js";
|
|
3
|
+
import { resolveVendor as n } from "./index7.js";
|
|
4
|
+
import { derivePayableStatus as r } from "./index26.js";
|
|
5
|
+
import { formatBillMoney as i } from "./index27.js";
|
|
4
6
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
function a({ payable: a, lineItems: o, glCodeOptions: s, glCodeRosterAvailable: c = !0, history: l, approvalPolicy: u, labels: d, hasScheduledPayment: f }) {
|
|
8
|
+
let p = a.currency, m = r({
|
|
9
|
+
apiStatus: a.status,
|
|
10
|
+
dueDate: a.due_date,
|
|
11
|
+
scheduledPaymentDate: a.scheduled_payment_date,
|
|
12
|
+
hasScheduledPayment: f
|
|
13
|
+
}), h = n(a), g = h?.bank_account?.account_number, _ = e(a.issued_at) || d.notProvided, v = e(a.due_date) || d.notProvided, y = new Map(s.map((e) => [e.value, e.label])), b = [
|
|
14
|
+
{
|
|
15
|
+
label: d.subtotalRow,
|
|
16
|
+
minorUnits: a.subtotal
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: d.discountRow,
|
|
20
|
+
minorUnits: a.discount
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: d.taxRow,
|
|
24
|
+
minorUnits: a.tax_amount
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
26
|
+
].map((e) => ({
|
|
27
|
+
label: e.label,
|
|
28
|
+
value: i(e.minorUnits, p)
|
|
29
|
+
})).filter((e) => !!e.value), x = i(a.total_amount, p);
|
|
30
|
+
return x && b.push({
|
|
31
|
+
label: d.totalRow,
|
|
32
|
+
value: x,
|
|
33
|
+
emphasis: !0
|
|
34
|
+
}), {
|
|
35
|
+
amountDue: i(t(a), p) ?? "",
|
|
36
|
+
invoiceDateLabel: _,
|
|
37
|
+
dueDateLabel: v,
|
|
38
|
+
dueDateTone: m.isOverdue ? "danger" : "default",
|
|
39
|
+
status: m.status,
|
|
40
|
+
statusTone: m.tone,
|
|
41
|
+
payTo: {
|
|
42
|
+
name: h?.name || d.notProvided,
|
|
43
|
+
email: h?.email ?? void 0,
|
|
44
|
+
paymentInstructionsLabel: g ? d.paymentInstructionsValue(g.slice(-4)) : void 0
|
|
45
|
+
},
|
|
46
|
+
invoiceFields: [
|
|
47
|
+
{
|
|
48
|
+
label: d.invoiceDateRow,
|
|
49
|
+
value: _
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: d.dueDateRow,
|
|
53
|
+
value: v
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: d.invoiceNumberRow,
|
|
57
|
+
value: a.document_id || d.notProvided
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
lineItems: o.map((e) => {
|
|
61
|
+
let t = i(e.unit_price, p);
|
|
62
|
+
return {
|
|
63
|
+
id: e.id,
|
|
64
|
+
description: e.name ?? e.description ?? "",
|
|
65
|
+
glCodeLabel: e.ledger_account_id ? y.get(e.ledger_account_id) ?? (c ? d.glCodeMissing : d.glCodeUnavailable) : d.glCodeMissing,
|
|
66
|
+
qtyPriceLabel: e.quantity != null && t ? d.qtyPriceValue(String(e.quantity), t) : "",
|
|
67
|
+
amount: i(e.subtotal, p) ?? ""
|
|
68
|
+
};
|
|
69
|
+
}),
|
|
70
|
+
amountRows: b,
|
|
71
|
+
approvalPolicy: u,
|
|
72
|
+
history: l
|
|
73
|
+
};
|
|
50
74
|
}
|
|
51
75
|
//#endregion
|
|
52
|
-
export {
|
|
76
|
+
export { a as buildBillDetailView };
|