@tesouro/embedded-components-react 0.5.75 → 0.5.76
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.css +0 -8
- 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/index45.js +140 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +46 -140
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +114 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +163 -112
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +75 -164
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +21 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +71 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +376 -65
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +12 -381
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +84 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +54 -79
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +223 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +37 -223
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +245 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +21 -252
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +571 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -572
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +44 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +247 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -234
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +11 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +127 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -129
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +47 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +123 -241
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +211 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -219
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +7 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +98 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -100
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +26 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +2 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +12 -269
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +2 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +16 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +97 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +76 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +277 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +2 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +16 -369
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +56 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +2 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +15 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +50 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +1 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +32 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +374 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +1 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +20 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +87 -188
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +48 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +47 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +10 -85
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +197 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +41 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +14 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +88 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +167 -161
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +5 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +1391 -1369
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -27
|
@@ -1,169 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useAttachPayableFileMutation as e } from "../../data-access/dist/index13.js";
|
|
6
|
+
import "../../data-access/dist/index.js";
|
|
7
|
+
import { SourceDocumentPanel as t } from "../../ui/dist/index109.js";
|
|
4
8
|
import "../../ui/dist/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
import { AWAITING_APPROVAL_LABEL_EN as c, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as l, BILL_DETAIL_ACTIONS_LABELS_EN as u, PAYMENT_HISTORY_LABELS_EN as d, SCHEDULED_STATUS_BADGE_LABEL_EN as f, SCHEDULED_SUMMARY_LABEL_EN as p, mergeBillDetailActionsLabels as m, mergePaymentHistoryMethodLabels as h } from "./index46.js";
|
|
10
|
-
import { PAYABLE_AUDIT_HISTORY_LABELS_EN as g } from "./index47.js";
|
|
11
|
-
import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as _ } from "./index48.js";
|
|
9
|
+
import { createSourceDocumentPreview as n } from "./index47.js";
|
|
10
|
+
import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as r } from "./index48.js";
|
|
11
|
+
import { useEffect as i, useState as a } from "react";
|
|
12
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
12
13
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
vendorResolutionFailed: "We couldn't create this vendor automatically. Select or add a vendor before submitting.",
|
|
20
|
-
finalizeFailed: "We could not submit this bill. Try again.",
|
|
21
|
-
draftSaved: "Bill saved as a draft.",
|
|
22
|
-
submittedSaved: "Bill updated.",
|
|
23
|
-
submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
|
|
24
|
-
billFinalized: "Bill submitted for approval.",
|
|
25
|
-
numbersOnly: "Enter numbers only.",
|
|
26
|
-
unreadableMoney: "Enter a valid amount.",
|
|
27
|
-
unusableQuantity: "Enter a quantity greater than 0.",
|
|
28
|
-
lineItemsNeedAttention: "Check the highlighted line items before saving.",
|
|
29
|
-
unreadableDiscount: "Enter a valid discount amount.",
|
|
30
|
-
unreadableTax: "Enter a valid tax amount.",
|
|
31
|
-
unreadableTotal: "Enter a valid total amount.",
|
|
32
|
-
totalNotGreaterThanZero: "Total amount must be greater than $0.",
|
|
33
|
-
poNumberTooLong: "PO number must be 255 characters or fewer.",
|
|
34
|
-
dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
|
|
35
|
-
}, y = {
|
|
36
|
-
paymentInstructionsValue: (e) => `Account ending in ${e}`,
|
|
37
|
-
noMethod: "No payment method on file",
|
|
38
|
-
paymentMethodLoading: "Loading payment method...",
|
|
39
|
-
paymentMethodUnavailable: "We could not load payment methods. Try again.",
|
|
40
|
-
searchFailed: "We could not load vendors. Try again.",
|
|
41
|
-
vendorDetailsFailed: "We could not load this vendor. Try again.",
|
|
42
|
-
pendingVendorDescription: "Will be created when submitted",
|
|
43
|
-
bankAccountSaveFailed: "We could not save these payment instructions. Try again."
|
|
44
|
-
}, b = {
|
|
45
|
-
attachFailed: "We could not attach that file. Try again.",
|
|
46
|
-
deleteFailed: "We could not remove that document. Try again.",
|
|
47
|
-
noDocument: "No document attached to this bill.",
|
|
48
|
-
pendingDeletionNotice: "This document will be removed when you save this bill.",
|
|
49
|
-
preview: _
|
|
50
|
-
}, x = {
|
|
51
|
-
...d,
|
|
52
|
-
historyDateTime: (e, t) => `${e}, ${t}`,
|
|
53
|
-
historyWithMeta: (e, t) => `${e} · ${t}`,
|
|
54
|
-
notProvided: "Not provided",
|
|
55
|
-
paymentInstructionsValue: (e) => `Account ending in ${e}`,
|
|
56
|
-
paymentInstructionsNotSet: "Not set",
|
|
57
|
-
invoiceDateRow: "Invoice date",
|
|
58
|
-
dueDateRow: "Due date",
|
|
59
|
-
invoiceNumberRow: "Invoice number",
|
|
60
|
-
glCodeMissing: "GL code not specified",
|
|
61
|
-
glCodeUnavailable: "GL code unavailable",
|
|
62
|
-
qtyPriceValue: (e, t) => `${e} x ${t}`,
|
|
63
|
-
qtyOnlyValue: (e) => e,
|
|
64
|
-
subtotalRow: "Subtotal",
|
|
65
|
-
taxRow: "Tax",
|
|
66
|
-
discountRow: "Discounts",
|
|
67
|
-
totalRow: "Total",
|
|
68
|
-
paidOnLabel: (e) => `Paid on ${e}`,
|
|
69
|
-
paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
|
|
70
|
-
paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
|
|
71
|
-
rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
|
|
72
|
-
rejectedOn: (e) => `Rejected on ${e}`,
|
|
73
|
-
rejectionMessage: (e) => `"${e}"`
|
|
74
|
-
}, S = {
|
|
75
|
-
newTitle: "New bill",
|
|
76
|
-
extractedTitle: (e) => `Bill from ${e}`,
|
|
77
|
-
viewTitle: (e) => `Bill from ${e}`,
|
|
78
|
-
readOnlyTitle: "Bill details",
|
|
79
|
-
addedOn: (e) => `Added on ${e}`,
|
|
80
|
-
unsavedChanges: n,
|
|
81
|
-
discardChanges: e,
|
|
82
|
-
scheduledSummary: p,
|
|
83
|
-
scheduledStatusBadge: f,
|
|
84
|
-
awaitingApprovalNotice: c,
|
|
85
|
-
awaitingApprovalUnknownNotice: l,
|
|
86
|
-
actions: u,
|
|
87
|
-
detail: x,
|
|
88
|
-
history: g,
|
|
89
|
-
payBill: r,
|
|
90
|
-
markAsPaid: a,
|
|
91
|
-
approvalPolicyCopy: s,
|
|
92
|
-
deleteDraft: {
|
|
93
|
-
menuItem: "Delete draft",
|
|
94
|
-
dialog: {
|
|
95
|
-
title: "Delete this draft?",
|
|
96
|
-
description: "The draft and anything entered on it are removed. This can't be undone.",
|
|
97
|
-
confirmButton: "Delete draft"
|
|
98
|
-
},
|
|
99
|
-
error: "Couldn't delete this draft. Try again."
|
|
100
|
-
},
|
|
101
|
-
lineItemsGlCodeUnavailable: {
|
|
102
|
-
loadError: "Couldn't load GL codes",
|
|
103
|
-
noAccess: "You don't have access to GL codes",
|
|
104
|
-
empty: "No GL codes set up yet"
|
|
105
|
-
},
|
|
106
|
-
rejectedBanner: t
|
|
107
|
-
};
|
|
108
|
-
function C(e) {
|
|
109
|
-
return {
|
|
110
|
-
...S,
|
|
111
|
-
...e,
|
|
112
|
-
actions: m(e?.actions),
|
|
113
|
-
detail: {
|
|
114
|
-
...S.detail,
|
|
115
|
-
...e?.detail,
|
|
116
|
-
paymentHistoryMethodLabels: h(e?.detail?.paymentHistoryMethodLabels)
|
|
117
|
-
},
|
|
118
|
-
history: {
|
|
119
|
-
...S.history,
|
|
120
|
-
...e?.history
|
|
121
|
-
},
|
|
122
|
-
payBill: i(e?.payBill),
|
|
123
|
-
markAsPaid: o(e?.markAsPaid),
|
|
124
|
-
lineItemsGlCodeUnavailable: {
|
|
125
|
-
...S.lineItemsGlCodeUnavailable,
|
|
126
|
-
...e?.lineItemsGlCodeUnavailable
|
|
127
|
-
},
|
|
128
|
-
unsavedChanges: {
|
|
129
|
-
...S.unsavedChanges,
|
|
130
|
-
...e?.unsavedChanges
|
|
131
|
-
},
|
|
132
|
-
discardChanges: {
|
|
133
|
-
...S.discardChanges,
|
|
134
|
-
...e?.discardChanges
|
|
135
|
-
},
|
|
136
|
-
rejectedBanner: {
|
|
137
|
-
...S.rejectedBanner,
|
|
138
|
-
...e?.rejectedBanner
|
|
139
|
-
},
|
|
140
|
-
approvalPolicyCopy: {
|
|
141
|
-
...S.approvalPolicyCopy,
|
|
142
|
-
...e?.approvalPolicyCopy
|
|
143
|
-
},
|
|
144
|
-
deleteDraft: {
|
|
145
|
-
...S.deleteDraft,
|
|
146
|
-
...e?.deleteDraft,
|
|
147
|
-
dialog: (() => {
|
|
148
|
-
let t = {
|
|
149
|
-
...S.deleteDraft.dialog,
|
|
150
|
-
...e?.deleteDraft?.dialog
|
|
151
|
-
};
|
|
152
|
-
return delete t.reason, t;
|
|
153
|
-
})()
|
|
14
|
+
function s(e) {
|
|
15
|
+
let [t, n] = a();
|
|
16
|
+
return i(() => {
|
|
17
|
+
if (!e) {
|
|
18
|
+
n(void 0);
|
|
19
|
+
return;
|
|
154
20
|
}
|
|
155
|
-
|
|
21
|
+
let t = URL.createObjectURL(e);
|
|
22
|
+
return n(t), () => URL.revokeObjectURL(t);
|
|
23
|
+
}, [e]), t;
|
|
24
|
+
}
|
|
25
|
+
function c({ payableId: i, file: a, isDocumentPending: c, pendingFileName: l, readOnly: u, staging: d, deletion: f, labels: p }) {
|
|
26
|
+
let { stagedFile: m, onFileStaged: h, onClearStagedFile: g, isSaving: _ } = d ?? {}, { isPending: v, onRequest: y, onDetachNow: b, isDeleting: x, hasFailed: S } = f ?? {}, C = {
|
|
27
|
+
...r,
|
|
28
|
+
...p,
|
|
29
|
+
preview: {
|
|
30
|
+
...r.preview,
|
|
31
|
+
...p?.preview
|
|
32
|
+
}
|
|
33
|
+
}, w = e(), T = s(m), E = !!(a && !v || m);
|
|
34
|
+
if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
|
|
35
|
+
mode: "loading",
|
|
36
|
+
fileName: l
|
|
37
|
+
});
|
|
38
|
+
if (!E && u) return /* @__PURE__ */ o("div", {
|
|
39
|
+
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
|
|
40
|
+
children: C.noDocument
|
|
41
|
+
});
|
|
42
|
+
if (!E) return /* @__PURE__ */ o(t, {
|
|
43
|
+
mode: "upload",
|
|
44
|
+
uploadStatus: w.isPending || x ? "uploading" : "idle",
|
|
45
|
+
uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
|
|
46
|
+
noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
|
|
47
|
+
onFilesSelected: (e) => {
|
|
48
|
+
let [t] = e;
|
|
49
|
+
if (t) {
|
|
50
|
+
if (i) {
|
|
51
|
+
let e = () => w.mutate({
|
|
52
|
+
path: { payable_id: i },
|
|
53
|
+
file: t
|
|
54
|
+
});
|
|
55
|
+
if (v && b) {
|
|
56
|
+
b().then(e, () => void 0);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
e();
|
|
60
|
+
} else h?.(t);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
let D = a?.name ?? m?.name ?? "", O = n(a || {
|
|
65
|
+
name: D,
|
|
66
|
+
url: T ?? "",
|
|
67
|
+
mimetype: m?.type ?? ""
|
|
68
|
+
}, C.preview);
|
|
69
|
+
return /* @__PURE__ */ o(t, {
|
|
70
|
+
mode: "document",
|
|
71
|
+
fileName: D,
|
|
72
|
+
preview: O,
|
|
73
|
+
isDeleting: x,
|
|
74
|
+
deleteErrorMessage: S ? C.deleteFailed : void 0,
|
|
75
|
+
onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
|
|
76
|
+
onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
|
|
77
|
+
});
|
|
156
78
|
}
|
|
157
|
-
var w = {
|
|
158
|
-
createTitle: "New vendor",
|
|
159
|
-
editTitle: "Edit vendor",
|
|
160
|
-
switchVendorFieldLabel: "Switch to a different vendor",
|
|
161
|
-
nameLabel: "Business name",
|
|
162
|
-
addAddress: "Add address (optional)",
|
|
163
|
-
cancel: "Cancel",
|
|
164
|
-
save: "Save",
|
|
165
|
-
cancelAriaLabel: "Cancel vendor",
|
|
166
|
-
saveAriaLabel: "Save vendor"
|
|
167
|
-
};
|
|
168
79
|
//#endregion
|
|
169
|
-
export {
|
|
80
|
+
export { c as SourceDocumentContainer, c as default };
|
|
@@ -1,80 +1,26 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { useAttachPayableFileMutation as e } from "../../data-access/dist/index13.js";
|
|
6
|
-
import "../../data-access/dist/index.js";
|
|
7
|
-
import { SourceDocumentPanel as t } from "../../ui/dist/index109.js";
|
|
8
|
-
import "../../ui/dist/index.js";
|
|
9
|
-
import { createSourceDocumentPreview as n } from "./index48.js";
|
|
10
|
-
import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as r } from "./index49.js";
|
|
11
|
-
import { useEffect as i, useState as a } from "react";
|
|
12
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
13
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
return i(() => {
|
|
17
|
-
if (!e) {
|
|
18
|
-
n(void 0);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
let t = URL.createObjectURL(e);
|
|
22
|
-
return n(t), () => URL.revokeObjectURL(t);
|
|
23
|
-
}, [e]), t;
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e?.trim() ?? "";
|
|
24
4
|
}
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
42
|
-
if (!E) return /* @__PURE__ */ o(t, {
|
|
43
|
-
mode: "upload",
|
|
44
|
-
uploadStatus: w.isPending || x ? "uploading" : "idle",
|
|
45
|
-
uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
|
|
46
|
-
noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
|
|
47
|
-
onFilesSelected: (e) => {
|
|
48
|
-
let [t] = e;
|
|
49
|
-
if (t) {
|
|
50
|
-
if (i) {
|
|
51
|
-
let e = () => w.mutate({
|
|
52
|
-
path: { payable_id: i },
|
|
53
|
-
file: t
|
|
54
|
-
});
|
|
55
|
-
if (v && b) {
|
|
56
|
-
b().then(e, () => void 0);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
e();
|
|
60
|
-
} else h?.(t);
|
|
61
|
-
}
|
|
5
|
+
function t(t) {
|
|
6
|
+
let n = e(t);
|
|
7
|
+
return n.length === 2 ? n.toUpperCase() : "";
|
|
8
|
+
}
|
|
9
|
+
function n(n) {
|
|
10
|
+
if (!n) return;
|
|
11
|
+
let r = {
|
|
12
|
+
legalName: e(n.name),
|
|
13
|
+
email: e(n.email),
|
|
14
|
+
phone: e(n.phone),
|
|
15
|
+
address: {
|
|
16
|
+
line1: e(n.address?.line1),
|
|
17
|
+
line2: e(n.address?.line2),
|
|
18
|
+
city: e(n.address?.city),
|
|
19
|
+
state: t(n.address?.state),
|
|
20
|
+
postalCode: e(n.address?.postal_code)
|
|
62
21
|
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
name: D,
|
|
66
|
-
url: T ?? "",
|
|
67
|
-
mimetype: m?.type ?? ""
|
|
68
|
-
}, C.preview);
|
|
69
|
-
return /* @__PURE__ */ o(t, {
|
|
70
|
-
mode: "document",
|
|
71
|
-
fileName: D,
|
|
72
|
-
preview: O,
|
|
73
|
-
isDeleting: x,
|
|
74
|
-
deleteErrorMessage: S ? C.deleteFailed : void 0,
|
|
75
|
-
onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
|
|
76
|
-
onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
|
|
77
|
-
});
|
|
22
|
+
};
|
|
23
|
+
return r.legalName || r.email || r.phone || Object.values(r.address).some(Boolean) ? r : void 0;
|
|
78
24
|
}
|
|
79
25
|
//#endregion
|
|
80
|
-
export {
|
|
26
|
+
export { n as buildVendorPrefill };
|
|
@@ -1,26 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { getStateOptions as t } from "../../../shared/util/dist/lib/usStates.js";
|
|
7
|
+
import { CounterpartFormFields as n, useFocusFirstInvalidField as r } from "../../../shared/counterpart-management/ui/dist/index9.js";
|
|
8
|
+
import { VendorSearchCombobox as i } from "../../ui/dist/index50.js";
|
|
9
|
+
import "../../ui/dist/index.js";
|
|
10
|
+
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
11
|
+
import { VENDOR_INLINE_FORM_LABELS_EN as a } from "./index48.js";
|
|
12
|
+
import { useMemo as o } from "react";
|
|
13
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
1
14
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
function l({ mode: l, values: u, errors: d, onChange: f, onAddressChange: p, sectionsToExpand: m, onAddressExpand: h, onCancel: g, onSave: _, isSaving: v = !1, search: y, labels: b }) {
|
|
16
|
+
let x = {
|
|
17
|
+
...a,
|
|
18
|
+
...b
|
|
19
|
+
}, S = o(() => t(), []), C = r(d ?? {});
|
|
20
|
+
return /* @__PURE__ */ c("div", {
|
|
21
|
+
ref: C,
|
|
22
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ s("p", {
|
|
25
|
+
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
26
|
+
children: l === "edit" ? x.editTitle : x.createTitle
|
|
27
|
+
}),
|
|
28
|
+
l === "edit" && y ? /* @__PURE__ */ s(i, {
|
|
29
|
+
...y,
|
|
30
|
+
labels: { fieldLabel: x.switchVendorFieldLabel }
|
|
31
|
+
}) : null,
|
|
32
|
+
/* @__PURE__ */ s(n, {
|
|
33
|
+
mode: l,
|
|
34
|
+
counterpartMode: "vendor",
|
|
35
|
+
values: u,
|
|
36
|
+
errors: d,
|
|
37
|
+
stateOptions: S,
|
|
38
|
+
onChange: f,
|
|
39
|
+
onAddressChange: p,
|
|
40
|
+
sections: {
|
|
41
|
+
entityType: !0,
|
|
42
|
+
profileHeading: !1,
|
|
43
|
+
title: !1,
|
|
44
|
+
taxId: !1,
|
|
45
|
+
address: "collapsible",
|
|
46
|
+
bankAccount: !1
|
|
47
|
+
},
|
|
48
|
+
sectionsToExpand: m,
|
|
49
|
+
onAddressExpand: h,
|
|
50
|
+
labels: { businessNameLabel: x.nameLabel }
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ c("div", {
|
|
53
|
+
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
54
|
+
children: [/* @__PURE__ */ s(e, {
|
|
55
|
+
type: "button",
|
|
56
|
+
variant: "outline",
|
|
57
|
+
onClick: g,
|
|
58
|
+
"aria-label": x.cancelAriaLabel,
|
|
59
|
+
disabled: v,
|
|
60
|
+
children: x.cancel
|
|
61
|
+
}), _ ? /* @__PURE__ */ s(e, {
|
|
62
|
+
type: "button",
|
|
63
|
+
onClick: _,
|
|
64
|
+
"aria-label": x.saveAriaLabel,
|
|
65
|
+
loading: v,
|
|
66
|
+
disabled: v,
|
|
67
|
+
children: x.save
|
|
68
|
+
}) : null]
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
});
|
|
24
72
|
}
|
|
25
73
|
//#endregion
|
|
26
|
-
export {
|
|
74
|
+
export { l as VendorInlineForm, l as default };
|