@tesouro/embedded-components-react 0.5.280 → 0.5.281
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 +8 -0
- package/dist/index.d.ts +2 -2
- package/dist/lib/BankAccountOnboardingWidget.d.ts +2 -2
- package/dist/lib/WidgetSuite.d.ts +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +7 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +8 -160
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +20 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +148 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +21 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +37 -79
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +98 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +83 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +3 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +54 -184
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +108 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +181 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +74 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +27 -412
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +88 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +413 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +13 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +77 -226
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +78 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +216 -234
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +44 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +233 -611
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +25 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +647 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +4 -243
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +42 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +250 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +2 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +5 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +67 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index12.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +47 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/reconcileCancelledPaymentQueries.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillsTab.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/data-access/dist/index4.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/labels.js +2 -2
- package/package.json +1 -1
|
@@ -1,35 +1,187 @@
|
|
|
1
|
+
import { AWAITING_APPROVAL_LABEL_EN as e, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as t, BILL_DETAIL_ACTIONS_LABELS_EN as n, PAYMENT_HISTORY_LABELS_EN as r, SCHEDULED_RELATIVE_DAY_LABELS_EN as i, SCHEDULED_STATUS_BADGE_LABEL_EN as a, SCHEDULED_SUMMARY_LABEL_EN as o, mergeBillDetailActionsLabels as s, mergePaymentHistoryMethodLabels as c } from "../../../util/dist/lib/billDetailLabels.js";
|
|
2
|
+
import { APPROVAL_POLICY_RULE_COPY_EN as l } from "./index8.js";
|
|
3
|
+
import { PAYABLE_AUDIT_HISTORY_LABELS_EN as u } from "./index23.js";
|
|
4
|
+
import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as d } from "./index24.js";
|
|
5
|
+
import { ACH_FIELD_GROUP_LABELS_EN as f } from "../../../../shared/counterpart-management/ui/dist/index2.js";
|
|
6
|
+
import "../../../../shared/counterpart-management/ui/dist/index.js";
|
|
7
|
+
import { BILL_REJECTED_BANNER_LABELS_EN as p } from "../../ui/dist/index39.js";
|
|
8
|
+
import { DISCARD_CHANGES_DIALOG_LABELS_EN as m } from "../../ui/dist/index42.js";
|
|
9
|
+
import { UNSAVED_BILL_DIALOG_LABELS_EN as h } from "../../ui/dist/index51.js";
|
|
10
|
+
import "../../ui/dist/index.js";
|
|
1
11
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
var g = {
|
|
13
|
+
unmappedValidationError: (e, t) => `${e}: ${t}`,
|
|
14
|
+
unknownValidationField: "(unknown field)",
|
|
15
|
+
requiredField: "This field is required.",
|
|
16
|
+
saveFailed: "We could not save this bill. Try again.",
|
|
17
|
+
discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
|
|
18
|
+
vendorResolutionFailed: "We couldn't create this vendor automatically. Select or add a vendor before submitting.",
|
|
19
|
+
finalizeFailed: "We could not submit this bill. Try again.",
|
|
20
|
+
draftSaved: "Bill saved as a draft.",
|
|
21
|
+
submittedSaved: "Bill updated.",
|
|
22
|
+
submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
|
|
23
|
+
billFinalized: "Bill submitted for approval.",
|
|
24
|
+
numbersOnly: "Enter numbers only.",
|
|
25
|
+
unreadableMoney: "Enter a valid amount.",
|
|
26
|
+
unusableQuantity: "Enter a quantity greater than 0.",
|
|
27
|
+
lineItemsNeedAttention: "Check the highlighted line items before saving.",
|
|
28
|
+
unreadableDiscount: "Enter a valid discount amount.",
|
|
29
|
+
unreadableTax: "Enter a valid tax amount.",
|
|
30
|
+
unreadableTotal: "Enter a valid total amount.",
|
|
31
|
+
totalNotGreaterThanZero: "Total amount must be greater than $0.",
|
|
32
|
+
poNumberTooLong: "PO number must be 255 characters or fewer.",
|
|
33
|
+
implausibleInvoiceDate: "Enter an invoice date within the last 10 years, no more than 30 days from today.",
|
|
34
|
+
implausibleDueDate: "Enter a due date within the last 10 years and next 5 years.",
|
|
35
|
+
dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
|
|
36
|
+
}, _ = {
|
|
37
|
+
paymentInstructionsValue: (e) => `Account ending in ${e}`,
|
|
38
|
+
noMethod: "No payment method on file",
|
|
39
|
+
paymentMethodLoading: "Loading payment method...",
|
|
40
|
+
paymentMethodUnavailable: "We could not load payment methods. Try again.",
|
|
41
|
+
searchFailed: "We could not load vendors. Try again.",
|
|
42
|
+
vendorDetailsFailed: "We could not load this vendor. Try again.",
|
|
43
|
+
pendingVendorDescription: "Will be created when submitted",
|
|
44
|
+
bankAccountSaveFailed: "We could not save these payment instructions. Try again."
|
|
45
|
+
}, v = {
|
|
46
|
+
attachFailed: "We could not attach that file. Try again.",
|
|
47
|
+
deleteFailed: "We could not remove that document. Try again.",
|
|
48
|
+
noDocument: "No document attached to this bill.",
|
|
49
|
+
pendingDeletionNotice: "This document will be removed when you save this bill.",
|
|
50
|
+
preview: d
|
|
51
|
+
}, y = {
|
|
52
|
+
...r,
|
|
53
|
+
notProvided: "Not provided",
|
|
54
|
+
paymentInstructionsValue: (e) => `Account ending in ${e}`,
|
|
55
|
+
paymentInstructionsNotSet: "Not set",
|
|
56
|
+
invoiceDateRow: "Invoice date",
|
|
57
|
+
dueDateRow: "Due date",
|
|
58
|
+
invoiceNumberRow: "Invoice number",
|
|
59
|
+
glCodeMissing: "GL code not specified",
|
|
60
|
+
glCodeUnavailable: "GL code unavailable",
|
|
61
|
+
qtyPriceValue: (e, t) => `${e} x ${t}`,
|
|
62
|
+
qtyOnlyValue: (e) => e,
|
|
63
|
+
subtotalRow: "Subtotal",
|
|
64
|
+
taxRow: "Tax",
|
|
65
|
+
discountRow: "Discounts",
|
|
66
|
+
totalRow: "Total",
|
|
67
|
+
paidOnLabel: (e) => `Paid on ${e}`,
|
|
68
|
+
paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
|
|
69
|
+
paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
|
|
70
|
+
rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
|
|
71
|
+
rejectedOn: (e) => `Rejected on ${e}`,
|
|
72
|
+
rejectionMessage: (e) => `"${e}"`
|
|
73
|
+
}, b = {
|
|
74
|
+
newTitle: "New bill",
|
|
75
|
+
extractedTitle: (e) => `Bill from ${e}`,
|
|
76
|
+
viewTitle: (e) => `Bill from ${e}`,
|
|
77
|
+
readOnlyTitle: "Bill details",
|
|
78
|
+
addedOn: (e) => `Added on ${e}`,
|
|
79
|
+
unsavedChanges: h,
|
|
80
|
+
discardChanges: m,
|
|
81
|
+
scheduledRelativeDay: i,
|
|
82
|
+
scheduledSummary: o,
|
|
83
|
+
scheduledStatusBadge: a,
|
|
84
|
+
awaitingApprovalNotice: e,
|
|
85
|
+
awaitingApprovalUnknownNotice: t,
|
|
86
|
+
actions: n,
|
|
87
|
+
detail: y,
|
|
88
|
+
history: u,
|
|
89
|
+
approvalPolicyCopy: l,
|
|
90
|
+
deleteDraft: {
|
|
91
|
+
menuItem: "Delete draft",
|
|
92
|
+
dialog: {
|
|
93
|
+
title: "Delete this draft?",
|
|
94
|
+
description: "The draft and anything entered on it are removed. This can't be undone.",
|
|
95
|
+
confirmButton: "Delete draft"
|
|
96
|
+
},
|
|
97
|
+
error: "Couldn't delete this draft. Try again."
|
|
98
|
+
},
|
|
99
|
+
lineItemsGlCodeUnavailable: {
|
|
100
|
+
loadError: "Couldn't load GL codes",
|
|
101
|
+
noAccess: "You don't have access to GL codes",
|
|
102
|
+
empty: "No GL codes set up yet"
|
|
103
|
+
},
|
|
104
|
+
rejectedBanner: p
|
|
105
|
+
};
|
|
106
|
+
function x(e) {
|
|
107
|
+
return {
|
|
108
|
+
...b,
|
|
109
|
+
...e,
|
|
110
|
+
actions: s(e?.actions),
|
|
111
|
+
detail: {
|
|
112
|
+
...b.detail,
|
|
113
|
+
...e?.detail,
|
|
114
|
+
paymentHistoryMethodLabels: c(e?.detail?.paymentHistoryMethodLabels)
|
|
115
|
+
},
|
|
116
|
+
history: {
|
|
117
|
+
...b.history,
|
|
118
|
+
...e?.history
|
|
119
|
+
},
|
|
120
|
+
lineItemsGlCodeUnavailable: {
|
|
121
|
+
...b.lineItemsGlCodeUnavailable,
|
|
122
|
+
...e?.lineItemsGlCodeUnavailable
|
|
123
|
+
},
|
|
124
|
+
unsavedChanges: {
|
|
125
|
+
...b.unsavedChanges,
|
|
126
|
+
...e?.unsavedChanges
|
|
127
|
+
},
|
|
128
|
+
discardChanges: {
|
|
129
|
+
...b.discardChanges,
|
|
130
|
+
...e?.discardChanges
|
|
131
|
+
},
|
|
132
|
+
rejectedBanner: {
|
|
133
|
+
...b.rejectedBanner,
|
|
134
|
+
...e?.rejectedBanner
|
|
135
|
+
},
|
|
136
|
+
approvalPolicyCopy: {
|
|
137
|
+
...b.approvalPolicyCopy,
|
|
138
|
+
...e?.approvalPolicyCopy
|
|
139
|
+
},
|
|
140
|
+
scheduledRelativeDay: {
|
|
141
|
+
...b.scheduledRelativeDay,
|
|
142
|
+
...e?.scheduledRelativeDay
|
|
143
|
+
},
|
|
144
|
+
deleteDraft: {
|
|
145
|
+
...b.deleteDraft,
|
|
146
|
+
...e?.deleteDraft,
|
|
147
|
+
dialog: (() => {
|
|
148
|
+
let t = {
|
|
149
|
+
...b.deleteDraft.dialog,
|
|
150
|
+
...e?.deleteDraft?.dialog
|
|
151
|
+
};
|
|
152
|
+
return delete t.reason, t;
|
|
153
|
+
})()
|
|
154
|
+
}
|
|
15
155
|
};
|
|
16
156
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
157
|
+
var S = {
|
|
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
|
+
paymentInstructionsHeading: "Payment instructions",
|
|
168
|
+
paymentInstructionsDescription: "How and where will the money be sent. This information is required to send a payment.",
|
|
169
|
+
paymentInstructionsExtracted: "We read these from the bill. Check them before saving.",
|
|
170
|
+
ach: f
|
|
171
|
+
};
|
|
172
|
+
function C(e) {
|
|
173
|
+
return {
|
|
174
|
+
...S,
|
|
175
|
+
...e,
|
|
176
|
+
ach: {
|
|
177
|
+
...S.ach,
|
|
178
|
+
...e?.ach,
|
|
179
|
+
fieldMarkers: {
|
|
180
|
+
...S.ach.fieldMarkers,
|
|
181
|
+
...e?.ach?.fieldMarkers
|
|
182
|
+
}
|
|
183
|
+
}
|
|
31
184
|
};
|
|
32
|
-
return i.legalName || i.email || i.phone || Object.values(i.address).some(Boolean) || i.bankAccount ? i : void 0;
|
|
33
185
|
}
|
|
34
186
|
//#endregion
|
|
35
|
-
export {
|
|
187
|
+
export { g as BILL_CREATE_MESSAGE_LABELS_EN, b as BILL_CREATE_SCREEN_LABELS_EN, y as BILL_DETAIL_VIEW_LABELS_EN, v as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, S as VENDOR_INLINE_FORM_LABELS_EN, _ as VENDOR_SECTION_PROPS_LABELS_EN, x as mergeBillCreateScreenCopy, C as mergeVendorInlineFormLabels };
|
|
@@ -2,91 +2,82 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { AchFieldGroup as n } from "../../../../shared/counterpart-management/ui/dist/index5.js";
|
|
8
|
-
import { CounterpartFormFields as r, useFocusFirstInvalidField as i } from "../../../../shared/counterpart-management/ui/dist/index9.js";
|
|
9
|
-
import "../../../../shared/counterpart-management/ui/dist/index.js";
|
|
10
|
-
import { VendorSearchCombobox as a } from "../../ui/dist/index24.js";
|
|
5
|
+
import { createSourceDocumentPreview as e } from "./index24.js";
|
|
6
|
+
import { SourceDocumentPanel as t } from "../../ui/dist/index49.js";
|
|
11
7
|
import "../../ui/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import "
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
8
|
+
import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as n } from "./index25.js";
|
|
9
|
+
import { useAttachPayableFileMutation as r } from "../../data-access/dist/index5.js";
|
|
10
|
+
import "../../data-access/dist/index.js";
|
|
11
|
+
import { useEffect as i, useState as a } from "react";
|
|
12
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
16
13
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
loading: y,
|
|
84
|
-
disabled: y,
|
|
85
|
-
children: C.save
|
|
86
|
-
}) : null]
|
|
87
|
-
})
|
|
88
|
-
]
|
|
14
|
+
function s(e) {
|
|
15
|
+
let [t, n] = a();
|
|
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;
|
|
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
|
+
...n,
|
|
28
|
+
...p,
|
|
29
|
+
preview: {
|
|
30
|
+
...n.preview,
|
|
31
|
+
...p?.preview
|
|
32
|
+
}
|
|
33
|
+
}, w = r(), T = s(m), E = !!(a && !v || m);
|
|
34
|
+
if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
|
|
35
|
+
mode: "loading",
|
|
36
|
+
fileName: l,
|
|
37
|
+
labels: p?.panel
|
|
38
|
+
});
|
|
39
|
+
if (!E && u) return /* @__PURE__ */ o("div", {
|
|
40
|
+
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
|
|
41
|
+
children: C.noDocument
|
|
42
|
+
});
|
|
43
|
+
if (!E) return /* @__PURE__ */ o(t, {
|
|
44
|
+
mode: "upload",
|
|
45
|
+
labels: p?.panel,
|
|
46
|
+
uploadStatus: w.isPending || x ? "uploading" : "idle",
|
|
47
|
+
uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
|
|
48
|
+
noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
|
|
49
|
+
onFilesSelected: (e) => {
|
|
50
|
+
let [t] = e;
|
|
51
|
+
if (t) {
|
|
52
|
+
if (i) {
|
|
53
|
+
let e = () => w.mutate({
|
|
54
|
+
path: { payable_id: i },
|
|
55
|
+
file: t
|
|
56
|
+
});
|
|
57
|
+
if (v && b) {
|
|
58
|
+
b().then(e, () => void 0);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
e();
|
|
62
|
+
} else h?.(t);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
let D = a?.name ?? m?.name ?? "", O = e(a || {
|
|
67
|
+
name: D,
|
|
68
|
+
url: T ?? "",
|
|
69
|
+
mimetype: m?.type ?? ""
|
|
70
|
+
}, C.preview);
|
|
71
|
+
return /* @__PURE__ */ o(t, {
|
|
72
|
+
mode: "document",
|
|
73
|
+
labels: p?.panel,
|
|
74
|
+
fileName: D,
|
|
75
|
+
preview: O,
|
|
76
|
+
isDeleting: x,
|
|
77
|
+
deleteErrorMessage: S ? C.deleteFailed : void 0,
|
|
78
|
+
onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
|
|
79
|
+
onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
|
|
89
80
|
});
|
|
90
81
|
}
|
|
91
82
|
//#endregion
|
|
92
|
-
export {
|
|
83
|
+
export { c as SourceDocumentContainer, c as default };
|