@tesouro/embedded-components-react 0.11.140 → 0.11.167
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/NOTICE +24 -0
- package/README.md +15 -37
- package/dist/experimental/BalanceHistoryWidget.d.ts +0 -11
- package/dist/experimental/QuickViewWidget.d.ts +0 -11
- package/dist/experimental/RemoteCheckCapture.d.ts +0 -11
- package/dist/experimental/index.d.ts +0 -11
- package/dist/fixtures/index.d.ts +27 -1
- package/dist/index.css +6976 -6246
- package/dist/index.d.ts +64 -173
- package/dist/index.js +9 -10
- package/dist/lib/AcceptDisclosuresWidget.d.ts +0 -11
- package/dist/lib/BalancesWidget.d.ts +0 -11
- package/dist/lib/BankAccountOnboardingWidget.d.ts +0 -11
- package/dist/lib/BankAccountsWidget.d.ts +2 -11
- package/dist/lib/BankingComplianceBannerWidget.d.ts +0 -11
- package/dist/lib/BillPayWidget.d.ts +0 -11
- package/dist/lib/CardDetailsWidget.d.ts +0 -11
- package/dist/lib/CounterpartsWidget.d.ts +1 -12
- package/dist/lib/CounterpartsWidgetPublic.d.ts +1 -12
- package/dist/lib/CreditCardsWidget.d.ts +0 -11
- package/dist/lib/DebitCardsWidget.d.ts +0 -11
- package/dist/lib/ExpenseManagementWidget.d.ts +1 -12
- package/dist/lib/InsightsWidget.d.ts +0 -11
- package/dist/lib/LinkedAccountsWidget.d.ts +0 -11
- package/dist/lib/OfferWidget.d.ts +0 -11
- package/dist/lib/ReceivablesWidget.d.ts +60 -17
- package/dist/lib/ReceivablesWidget.js +3 -2
- package/dist/lib/SettingsWidget.d.ts +0 -11
- package/dist/lib/TransfersWidget.d.ts +0 -11
- package/dist/lib/WidgetProvider.d.ts +0 -11
- package/dist/lib/WidgetProviderPublic.d.ts +0 -11
- package/dist/lib/WidgetSuite.d.ts +60 -15
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +20 -19
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index10.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index4.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index10.js +83 -82
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index4.js +84 -79
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index9.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/formatters.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +51 -46
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index10.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useActivateCard.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useCardLock.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useEditCardNickname.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +66 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +351 -318
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +126 -133
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +63 -56
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilter.js +78 -72
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilterLabels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +138 -129
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +119 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +37 -28
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/tabs.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useInvoicesFilter.js +131 -81
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useLocalDayStart.js +15 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +46 -46
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +440 -438
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +62 -56
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +47 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +78 -86
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +180 -158
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useRecurringSeriesTable.js +132 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/invoicing.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/receivables.js +153 -137
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +6 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +137 -129
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +21 -46
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +143 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +47 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +25 -25
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductDelete.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/mocks/products.js +3 -11
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/scenarios.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js +36 -77
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js +11 -13
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js +20 -17
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index8.js +4 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index12.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +233 -211
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +66 -42
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +5 -4
- 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/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/toasts.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +28 -28
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmbeddedToaster.js +33 -32
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +9 -8
- package/dist/node_modules/sonner/dist/index.js +620 -0
- package/dist/packages/shared-ui-shadcn/dist/index.js +6072 -6062
- package/dist/scenarios/index.d.ts +1 -3
- package/dist/scenarios/index.js +17 -20
- package/package.json +17 -4
- package/dist/lib/CustomersWidget.d.ts +0 -993
- package/dist/lib/CustomersWidget.js +0 -2
- package/dist/lib/ProductsWidget.d.ts +0 -893
- package/dist/lib/ProductsWidget.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/CustomersWidget/CustomersWidget.js +0 -41
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/analytics/events.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/scenarios.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useUtcDayStart.js +0 -15
|
@@ -21,49 +21,58 @@ function r(e) {
|
|
|
21
21
|
function i(e, t) {
|
|
22
22
|
return e.length === t.length && e.every((e) => t.includes(e));
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
var a = 864e5;
|
|
25
|
+
function o(e) {
|
|
26
|
+
let t = e + a;
|
|
27
|
+
return {
|
|
28
|
+
paid_at__gte: (/* @__PURE__ */ new Date(t - 30 * a)).toISOString(),
|
|
29
|
+
paid_at__lte: new Date(t).toISOString()
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function s(e, r = !1) {
|
|
33
|
+
return Object.values(t).find((a) => a === t.Paid === r && i(e, n[a])) ?? null;
|
|
34
|
+
}
|
|
35
|
+
function c(e) {
|
|
36
|
+
return {
|
|
37
|
+
statuses: e ? [...n[e]] : [],
|
|
38
|
+
isPaidWindowApplied: e === t.Paid
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function l({ counts: r, amountsDue: a, paidCounts: o, paidTotals: s, isCountsError: c, isAmountsDueError: l, isPaidError: u, selectedStatuses: d, isPaidWindowApplied: f, messages: p }) {
|
|
42
|
+
let m = (e, t) => e.filter((e) => e.dimension_value && t.includes(e.dimension_value)).reduce((e, t) => e + t.metric_value, 0), h = (e) => i(d, n[e]), g = (e, t) => {
|
|
43
|
+
let r = m(t, n[e]);
|
|
44
|
+
return (r === 1 ? p.summaryInvoice : p.summaryInvoices).replace("{count}", String(r));
|
|
45
|
+
}, _ = (t, i, o = a, s = r, u = c || l) => ({
|
|
29
46
|
value: t,
|
|
30
|
-
label:
|
|
31
|
-
amountLabel:
|
|
32
|
-
amount:
|
|
47
|
+
label: i,
|
|
48
|
+
amountLabel: u ? p.summaryPlaceholder : e({
|
|
49
|
+
amount: m(o, n[t]),
|
|
33
50
|
currency: "USD",
|
|
34
|
-
fallback:
|
|
51
|
+
fallback: p.notAvailable
|
|
35
52
|
}),
|
|
36
|
-
captionLabel:
|
|
37
|
-
selected:
|
|
53
|
+
captionLabel: u ? void 0 : g(t, s),
|
|
54
|
+
selected: h(t)
|
|
38
55
|
});
|
|
39
56
|
return {
|
|
40
57
|
kind: "ready",
|
|
41
58
|
cards: [
|
|
42
|
-
|
|
59
|
+
_(t.Unpaid, p.summaryUnpaid),
|
|
43
60
|
{
|
|
44
|
-
...
|
|
61
|
+
..._(t.Overdue, p.summaryOverdue),
|
|
45
62
|
labelTone: "destructive"
|
|
46
63
|
},
|
|
47
64
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
amountLabel: e({
|
|
51
|
-
amount: 0,
|
|
52
|
-
currency: "USD",
|
|
53
|
-
fallback: c.notAvailable
|
|
54
|
-
}),
|
|
55
|
-
captionLabel: c.summaryInvoices.replace("{count}", "0"),
|
|
56
|
-
selected: !1,
|
|
57
|
-
disabled: !0
|
|
65
|
+
..._(t.Paid, p.summaryPaid, s, o, u),
|
|
66
|
+
selected: f && h(t.Paid)
|
|
58
67
|
},
|
|
59
68
|
{
|
|
60
69
|
value: t.Drafts,
|
|
61
|
-
label:
|
|
62
|
-
amountLabel:
|
|
63
|
-
captionLabel:
|
|
64
|
-
selected:
|
|
70
|
+
label: p.summaryDrafts,
|
|
71
|
+
amountLabel: c ? p.summaryPlaceholder : String(m(r, n[t.Drafts])),
|
|
72
|
+
captionLabel: p.summaryDraftsCaption,
|
|
73
|
+
selected: h(t.Drafts)
|
|
65
74
|
}
|
|
66
75
|
]
|
|
67
76
|
};
|
|
68
77
|
}
|
|
69
|
-
export { t as ReceivableStatusCard, n as STATUSES_BY_CARD,
|
|
78
|
+
export { t as ReceivableStatusCard, n as STATUSES_BY_CARD, o as buildPaidWindow, l as buildReceivableStatusCardsView, i as isSameStatusSet, r as isSelectableStatusCard, s as statusCardForStatuses, c as statusFilterForCard };
|
|
@@ -20,7 +20,6 @@ var i = {
|
|
|
20
20
|
invoicesTab: "Invoices",
|
|
21
21
|
recurringTab: "Recurring",
|
|
22
22
|
customersTab: "Customers",
|
|
23
|
-
productsTab: "Products and services"
|
|
24
|
-
createRecurringInvoiceButton: "Create recurring invoice"
|
|
23
|
+
productsTab: "Products and services"
|
|
25
24
|
};
|
|
26
25
|
export { i as INVOICING_TAB_LABELS_EN, n as INVOICING_TAB_ORDER, t as InvoicingTab, r as isInvoicingTabId };
|
|
@@ -6,47 +6,96 @@ import { useFilterPanel as e } from "../../../../../../../packages/shared-ui-sha
|
|
|
6
6
|
import { getCounterpartName as t } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
7
7
|
import { useCounterpartQuery as n } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
8
8
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useCallback as
|
|
9
|
+
import { ReceivableStatusCard as r, STATUSES_BY_CARD as i, isSameStatusSet as a, isSelectableStatusCard as o, statusCardForStatuses as s, statusFilterForCard as c } from "./statusCards.js";
|
|
10
|
+
import { isInvoicesDatePreset as l, resolveInvoicesDatePreset as u } from "./datePresets.js";
|
|
11
|
+
import { INVOICES_FILTER_FIELDS as d, InvoicesFilterChipKey as f, buildInvoicesDatePresetOptions as p, buildInvoicesFilterChips as m, buildInvoicesFilterQuery as h, buildInvoicesStatusOptions as g, clearInvoicesFilter as _, countActiveInvoiceFilters as v, emptyInvoicesFilterState as y } from "./invoicesFilter.js";
|
|
12
|
+
import { mergeInvoicesFilterLabels as b } from "./invoicesFilterLabels.js";
|
|
13
|
+
import { useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
14
14
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useInvoicesFilter.js
|
|
15
|
-
function
|
|
16
|
-
let
|
|
17
|
-
|
|
15
|
+
function E({ initialCounterpartId: E, selectedStatusCard: D, onStatusCardChange: O, search: k, onSearchChange: A, onFiltersChange: j, statusLabels: M, paidWindow: N, labels: P }) {
|
|
16
|
+
let F = C(() => b(P), [P]), [I] = T(E), [L, R] = T(() => ({
|
|
17
|
+
...y(I),
|
|
18
|
+
...c(D ?? null)
|
|
19
|
+
})), z = s(L.statuses, L.isPaidWindowApplied), B = e(), { data: V } = n(L.customerId), H = V ? t(V) : "", U = x((e) => {
|
|
20
|
+
R((t) => ({
|
|
18
21
|
...t,
|
|
19
22
|
...e
|
|
20
|
-
})),
|
|
21
|
-
}, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
})), j();
|
|
24
|
+
}, [j]), W = x((e, t) => {
|
|
25
|
+
let n = s(e, t);
|
|
26
|
+
n !== z && O?.(n);
|
|
27
|
+
}, [z, O]), G = w(D);
|
|
28
|
+
S(() => {
|
|
29
|
+
D !== void 0 && D !== G.current && (G.current = D, D !== z && (R((e) => ({
|
|
30
|
+
...e,
|
|
31
|
+
...c(D)
|
|
32
|
+
})), j()));
|
|
33
|
+
}, [
|
|
34
|
+
z,
|
|
35
|
+
j,
|
|
36
|
+
D
|
|
37
|
+
]);
|
|
38
|
+
let K = C(() => h(L, N), [N, L]), q = v(L, k), J = C(() => m({
|
|
39
|
+
state: L,
|
|
40
|
+
search: k,
|
|
41
|
+
counterpartName: H,
|
|
42
|
+
labels: F,
|
|
43
|
+
statusLabels: M
|
|
27
44
|
}), [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
S,
|
|
45
|
+
H,
|
|
46
|
+
F,
|
|
31
47
|
k,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
L,
|
|
49
|
+
M
|
|
50
|
+
]), Y = C(() => g(M, F), [F, M]), X = C(() => p(F), [F]), Z = x((e) => {
|
|
51
|
+
if (e === f.Search) {
|
|
52
|
+
A("");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
let t = _(L, e);
|
|
56
|
+
W(t.statuses, t.isPaidWindowApplied), R(t), j();
|
|
57
|
+
}, [
|
|
58
|
+
j,
|
|
59
|
+
A,
|
|
60
|
+
W,
|
|
61
|
+
L
|
|
62
|
+
]), Q = x(() => {
|
|
63
|
+
W([]), R(y()), A(""), j();
|
|
64
|
+
}, [
|
|
65
|
+
j,
|
|
66
|
+
A,
|
|
67
|
+
W
|
|
68
|
+
]), $ = x((e) => {
|
|
69
|
+
W([]), R(y(e)), A(""), j();
|
|
70
|
+
}, [
|
|
71
|
+
j,
|
|
72
|
+
A,
|
|
73
|
+
W
|
|
74
|
+
]), ee = x(() => {
|
|
75
|
+
R(y(I));
|
|
76
|
+
}, [I]), te = x((e) => {
|
|
77
|
+
if (!o(e)) return;
|
|
78
|
+
let t = c(e === z ? null : e);
|
|
79
|
+
W(t.statuses, t.isPaidWindowApplied), R((e) => ({
|
|
45
80
|
...e,
|
|
46
|
-
|
|
47
|
-
})),
|
|
48
|
-
}, [
|
|
49
|
-
|
|
81
|
+
...t
|
|
82
|
+
})), j();
|
|
83
|
+
}, [
|
|
84
|
+
z,
|
|
85
|
+
j,
|
|
86
|
+
W
|
|
87
|
+
]), ne = x((e) => {
|
|
88
|
+
let t = !!L.isPaidWindowApplied && a(e, i[r.Paid]);
|
|
89
|
+
W(e, t), U({
|
|
90
|
+
statuses: e,
|
|
91
|
+
isPaidWindowApplied: t
|
|
92
|
+
});
|
|
93
|
+
}, [
|
|
94
|
+
W,
|
|
95
|
+
L.isPaidWindowApplied,
|
|
96
|
+
U
|
|
97
|
+
]), re = x((e, t) => {
|
|
98
|
+
R((n) => ({
|
|
50
99
|
...n,
|
|
51
100
|
dateRanges: {
|
|
52
101
|
...n.dateRanges,
|
|
@@ -56,62 +105,63 @@ function x({ initialCounterpartId: x, search: S, onSearchChange: C, onFiltersCha
|
|
|
56
105
|
to: t.to
|
|
57
106
|
}
|
|
58
107
|
}
|
|
59
|
-
})),
|
|
60
|
-
}, [
|
|
61
|
-
if (!
|
|
62
|
-
let { from: n, to:
|
|
63
|
-
|
|
64
|
-
...
|
|
108
|
+
})), j();
|
|
109
|
+
}, [j]), ie = x((e, t) => {
|
|
110
|
+
if (!l(t)) return;
|
|
111
|
+
let { from: n, to: r } = u(t);
|
|
112
|
+
R((i) => ({
|
|
113
|
+
...i,
|
|
65
114
|
dateRanges: {
|
|
66
|
-
...
|
|
115
|
+
...i.dateRanges,
|
|
67
116
|
[e]: {
|
|
68
117
|
preset: t,
|
|
69
118
|
from: n,
|
|
70
|
-
to:
|
|
119
|
+
to: r
|
|
71
120
|
}
|
|
72
121
|
}
|
|
73
|
-
})),
|
|
74
|
-
}, [
|
|
122
|
+
})), j();
|
|
123
|
+
}, [j]);
|
|
75
124
|
return {
|
|
76
125
|
filterBar: {
|
|
77
|
-
fields:
|
|
78
|
-
searchValue:
|
|
79
|
-
onSearchChange:
|
|
80
|
-
isPopoverOpen:
|
|
81
|
-
isMenuOpen:
|
|
82
|
-
activePanel:
|
|
83
|
-
onMenuToggle:
|
|
126
|
+
fields: d,
|
|
127
|
+
searchValue: k,
|
|
128
|
+
onSearchChange: A,
|
|
129
|
+
isPopoverOpen: B.isMenuOpen || !!B.activePanelId,
|
|
130
|
+
isMenuOpen: B.isMenuOpen,
|
|
131
|
+
activePanel: B.activePanelId,
|
|
132
|
+
onMenuToggle: B.toggleMenu,
|
|
84
133
|
onPopoverClose: () => {
|
|
85
|
-
|
|
134
|
+
B.closeMenu(), B.closePanel();
|
|
86
135
|
},
|
|
87
|
-
onFieldSelect:
|
|
88
|
-
activeFilterCount:
|
|
89
|
-
chips:
|
|
90
|
-
showClearAll:
|
|
91
|
-
onRemoveChip:
|
|
92
|
-
onClearAll:
|
|
93
|
-
dateRanges:
|
|
94
|
-
datePresets:
|
|
95
|
-
onDateRangeChange:
|
|
96
|
-
onDatePresetChange:
|
|
97
|
-
statusOptions:
|
|
98
|
-
selectedStatuses:
|
|
99
|
-
onStatusChange:
|
|
100
|
-
amountMode:
|
|
101
|
-
onAmountModeChange: (e) =>
|
|
102
|
-
amountMin:
|
|
103
|
-
amountMax:
|
|
104
|
-
onAmountMinChange: (e) =>
|
|
105
|
-
onAmountMaxChange: (e) =>
|
|
106
|
-
customerName:
|
|
107
|
-
onCustomerNameChange: (e) =>
|
|
136
|
+
onFieldSelect: B.openPanel,
|
|
137
|
+
activeFilterCount: q,
|
|
138
|
+
chips: J,
|
|
139
|
+
showClearAll: q > 0,
|
|
140
|
+
onRemoveChip: Z,
|
|
141
|
+
onClearAll: Q,
|
|
142
|
+
dateRanges: L.dateRanges,
|
|
143
|
+
datePresets: X,
|
|
144
|
+
onDateRangeChange: re,
|
|
145
|
+
onDatePresetChange: ie,
|
|
146
|
+
statusOptions: Y,
|
|
147
|
+
selectedStatuses: L.statuses,
|
|
148
|
+
onStatusChange: ne,
|
|
149
|
+
amountMode: L.amountMode,
|
|
150
|
+
onAmountModeChange: (e) => U({ amountMode: e }),
|
|
151
|
+
amountMin: L.amountMin,
|
|
152
|
+
amountMax: L.amountMax,
|
|
153
|
+
onAmountMinChange: (e) => U({ amountMin: e }),
|
|
154
|
+
onAmountMaxChange: (e) => U({ amountMax: e }),
|
|
155
|
+
customerName: L.customerName,
|
|
156
|
+
onCustomerNameChange: (e) => U({ customerName: e })
|
|
108
157
|
},
|
|
109
|
-
query:
|
|
110
|
-
isFiltering:
|
|
111
|
-
selectedStatuses:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
158
|
+
query: K,
|
|
159
|
+
isFiltering: q > 0,
|
|
160
|
+
selectedStatuses: L.statuses,
|
|
161
|
+
isPaidWindowApplied: !!L.isPaidWindowApplied,
|
|
162
|
+
selectStatusCard: te,
|
|
163
|
+
showCustomer: $,
|
|
164
|
+
reset: ee
|
|
115
165
|
};
|
|
116
166
|
}
|
|
117
|
-
export {
|
|
167
|
+
export { E as useInvoicesFilter };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useEffect as e, useState as t } from "react";
|
|
6
|
+
import { addDays as n, startOfDay as r } from "date-fns";
|
|
7
|
+
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useLocalDayStart.js
|
|
8
|
+
function i() {
|
|
9
|
+
let [i, a] = t(() => r(Date.now()).getTime());
|
|
10
|
+
return e(() => {
|
|
11
|
+
let e = setTimeout(() => a(r(Date.now()).getTime()), Math.max(n(i, 1).getTime() - Date.now(), 0));
|
|
12
|
+
return () => clearTimeout(e);
|
|
13
|
+
}, [i]), i;
|
|
14
|
+
}
|
|
15
|
+
export { i as useLocalDayStart };
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../../../
|
|
5
|
+
import { toast as e } from "../../../../../../../node_modules/sonner/dist/index.js";
|
|
6
6
|
import { extractApiErrorMessage as t } from "../../../../../shared/util/dist/lib/apiErrors.js";
|
|
7
7
|
import "../../../../../shared/util/dist/index.js";
|
|
8
8
|
import "../../../../../shared/ui/dist/index.js";
|
|
9
9
|
import { getCounterpartEmail as n } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
10
10
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import { formatMoney as r, isReceivableReadyToIssue as i } from "./helpers.js";
|
|
12
|
+
import { useAcceptReceivableMutation as a, useCancelReceivableMutation as o, useCloneReceivableMutation as s, useDeclineReceivableMutation as c, useDeleteReceivableMutation as l, useIssueReceivableMutation as u } from "../../../../data-access/dist/index11.js";
|
|
13
|
+
import { useMarkReceivablePaidMutation as d, useMarkReceivableUncollectibleMutation as f } from "../../../../data-access/dist/index13.js";
|
|
14
|
+
import { useCancelRecurrenceMutation as ee, usePauseRecurrenceMutation as p, useResumeRecurrenceMutation as te } from "../../../../data-access/dist/index16.js";
|
|
14
15
|
import "../../../../data-access/dist/index.js";
|
|
15
|
-
import { formatMoney as f, isReceivableReadyToIssue as p } from "./helpers.js";
|
|
16
16
|
import { getIssueReminderBlocker as m, hasSelectedReminder as h } from "./reminders.js";
|
|
17
17
|
import { useReceivableIssuePreflight as ne } from "./useReceivableIssuePreflight.js";
|
|
18
18
|
import { useReceivablePaymentRecord as re } from "./useReceivablePaymentRecord.js";
|
|
19
19
|
import { useCallback as g, useEffect as ie, useState as _ } from "react";
|
|
20
20
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js
|
|
21
|
-
function v({ selectedReceivable:
|
|
22
|
-
let D =
|
|
21
|
+
function v({ selectedReceivable: r, selectedRecurrence: v, messages: x, onCreated: S, onDeleted: C, onCompleteBeforeIssue: w, onIssuedForSend: T, onResend: E }) {
|
|
22
|
+
let D = u(), O = o(), k = s(), A = a(), j = c(), M = l(), N = d(), P = f(), F = p(), I = te(), L = ee(), [R, z] = _(), [B, V] = _(""), H = re({ messages: x }), U = H.open, W = F.mutate, G = k.mutate, K = I.mutate, q = r?.type === "invoice" && r.status === "draft" ? r : void 0, J = r?.type === "invoice" && r.status !== "draft" ? r : void 0, [Y, X] = _(), Z = Y?.issueCheck ?? (q ? b(q) : void 0), Q = D.mutate, $ = ne({
|
|
23
23
|
counterpartId: Z?.counterpartId ?? J?.counterpart_id,
|
|
24
24
|
billingAddressId: Z?.billingAddressId,
|
|
25
25
|
billingCountry: Z?.billingCountry,
|
|
@@ -41,30 +41,30 @@ function v({ selectedReceivable: f, selectedRecurrence: v, messages: x, onCreate
|
|
|
41
41
|
$.isLoading,
|
|
42
42
|
$.isTaxIdMissing
|
|
43
43
|
]);
|
|
44
|
-
let se = g((
|
|
45
|
-
let
|
|
46
|
-
id:
|
|
47
|
-
type:
|
|
48
|
-
title:
|
|
49
|
-
action:
|
|
50
|
-
},
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
44
|
+
let se = g((a, o, s) => {
|
|
45
|
+
let c = "documentLabel" in o ? o.documentLabel : o.title, l = {
|
|
46
|
+
id: o.id,
|
|
47
|
+
type: o.type,
|
|
48
|
+
title: c,
|
|
49
|
+
action: a
|
|
50
|
+
}, u = s === void 0 ? r : s ?? void 0;
|
|
51
|
+
if (a === "send") {
|
|
52
|
+
if (u?.type !== "invoice" || $.isCounterpartLoading) return;
|
|
53
53
|
if ($.isCounterpartError) {
|
|
54
54
|
e.error(x.genericError);
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
let t = $.counterpart?.id ===
|
|
57
|
+
let t = $.counterpart?.id === u.counterpart_id ? $.counterpart : void 0;
|
|
58
58
|
if (!t || !n(t)) {
|
|
59
59
|
e.error(x.sendNoEmail);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
E?.(
|
|
62
|
+
E?.(u.id, u.counterpart_id);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
if (
|
|
66
|
-
if (
|
|
67
|
-
let t =
|
|
65
|
+
if (a === "issueAndSend") {
|
|
66
|
+
if (u?.type !== "invoice") return;
|
|
67
|
+
let t = u;
|
|
68
68
|
if ($.isLoading) return;
|
|
69
69
|
if ($.isCounterpartError) {
|
|
70
70
|
e.error(x.genericError);
|
|
@@ -74,7 +74,7 @@ function v({ selectedReceivable: f, selectedRecurrence: v, messages: x, onCreate
|
|
|
74
74
|
e.error(x.sendNoEmail);
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
if (w && !
|
|
77
|
+
if (w && !i(t, x)) {
|
|
78
78
|
w(t, "issueAndSend");
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
@@ -91,8 +91,8 @@ function v({ selectedReceivable: f, selectedRecurrence: v, messages: x, onCreate
|
|
|
91
91
|
});
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
if (
|
|
95
|
-
G({ path: { receivable_id:
|
|
94
|
+
if (a === "clone") {
|
|
95
|
+
G({ path: { receivable_id: o.id } }, {
|
|
96
96
|
onSuccess: (t) => {
|
|
97
97
|
t?.id && S?.(t.id, t.type), e.success(x.cloneSuccess);
|
|
98
98
|
},
|
|
@@ -100,37 +100,37 @@ function v({ selectedReceivable: f, selectedRecurrence: v, messages: x, onCreate
|
|
|
100
100
|
});
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
-
let
|
|
104
|
-
if (
|
|
105
|
-
if (!
|
|
106
|
-
let n =
|
|
103
|
+
let d = u?.type === "invoice" ? u.recurrence_id ?? void 0 : void 0;
|
|
104
|
+
if (a === "pauseRecurrence" || a === "resumeRecurrence") {
|
|
105
|
+
if (!d) return;
|
|
106
|
+
let n = a === "pauseRecurrence";
|
|
107
107
|
(n ? W : K)({
|
|
108
|
-
path: { recurrence_id:
|
|
109
|
-
receivableId:
|
|
108
|
+
path: { recurrence_id: d },
|
|
109
|
+
receivableId: o.id
|
|
110
110
|
}, {
|
|
111
111
|
onSuccess: () => e.success(n ? x.recurrencePaused : x.recurrenceResumed),
|
|
112
112
|
onError: (n) => e.error(t(n) ?? x.genericError)
|
|
113
113
|
});
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (
|
|
117
|
-
if (!
|
|
116
|
+
if (a === "cancelRecurrence") {
|
|
117
|
+
if (!d || u?.type !== "invoice") return;
|
|
118
118
|
z({
|
|
119
|
-
...
|
|
120
|
-
recurrenceId:
|
|
121
|
-
description: ae(
|
|
119
|
+
...l,
|
|
120
|
+
recurrenceId: d,
|
|
121
|
+
description: ae(u, v, x)
|
|
122
122
|
});
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
if (
|
|
126
|
-
|
|
125
|
+
if (a === "recordPayment") {
|
|
126
|
+
u?.type === "invoice" && U(u);
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
|
-
let
|
|
130
|
-
|
|
131
|
-
id:
|
|
132
|
-
issueCheck:
|
|
133
|
-
}) : (V(""), z(
|
|
129
|
+
let f = a === "issue" && u?.type === "invoice" ? u : void 0;
|
|
130
|
+
f && w && !i(f, x) ? w(f, "issue") : a === "issue" ? X({
|
|
131
|
+
id: o.id,
|
|
132
|
+
issueCheck: f ? b(f) : void 0
|
|
133
|
+
}) : (V(""), z(l));
|
|
134
134
|
}, [
|
|
135
135
|
G,
|
|
136
136
|
Q,
|
|
@@ -147,7 +147,7 @@ function v({ selectedReceivable: f, selectedRecurrence: v, messages: x, onCreate
|
|
|
147
147
|
$.isTaxIdMissing,
|
|
148
148
|
W,
|
|
149
149
|
K,
|
|
150
|
-
|
|
150
|
+
r,
|
|
151
151
|
v
|
|
152
152
|
]), ce = g(() => {
|
|
153
153
|
z(void 0);
|
|
@@ -211,15 +211,15 @@ function y(n, r) {
|
|
|
211
211
|
e.error(t(n) ?? r.unrecognizedError), e.error(r.issueFailed);
|
|
212
212
|
}
|
|
213
213
|
function ae(e, t, n) {
|
|
214
|
-
let
|
|
215
|
-
amount: e.total_amount_with_credit_notes *
|
|
214
|
+
let i = (t?.iterations ?? []).filter((e) => e.status === "pending").length, a = r({
|
|
215
|
+
amount: e.total_amount_with_credit_notes * i,
|
|
216
216
|
currency: e.currency,
|
|
217
217
|
fallback: ""
|
|
218
218
|
});
|
|
219
219
|
return [
|
|
220
220
|
n.cancelRecurrenceQuestion,
|
|
221
221
|
n.cancelRecurrenceFutureIterations,
|
|
222
|
-
n.cancelRecurrenceTotal.replace("{count}", String(
|
|
222
|
+
n.cancelRecurrenceTotal.replace("{count}", String(i)).replace("{invoices}", i === 1 ? n.cancelRecurrenceInvoice : n.cancelRecurrenceInvoices).replace("{amount}", a),
|
|
223
223
|
n.cancelRecurrenceIrreversible
|
|
224
224
|
];
|
|
225
225
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../../../
|
|
5
|
+
import { toast as e } from "../../../../../../../node_modules/sonner/dist/index.js";
|
|
6
6
|
import "../../../../../shared/ui/dist/index.js";
|
|
7
7
|
import { getCounterpartEmail as t, getCounterpartName as n } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
8
8
|
import { useCounterpartQuery as r } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { toFileArray as e, validateAttachmentFile as t } from "./attachments.js";
|
|
6
|
+
import { useDeleteReceivableAttachmentMutation as n, useUploadReceivableAttachmentMutation as r } from "../../../../data-access/dist/index8.js";
|
|
6
7
|
import "../../../../data-access/dist/index.js";
|
|
7
|
-
import { toFileArray as n, validateAttachmentFile as r } from "./attachments.js";
|
|
8
8
|
import { useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
|
|
9
9
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js
|
|
10
10
|
function c({ attachments: c, setAttachments: l, receivableId: u }) {
|
|
11
|
-
let { mutateAsync: d } =
|
|
11
|
+
let { mutateAsync: d } = r(), { mutate: f } = n(), [p, m] = s([]), [h, g] = s(!1), _ = o(0), v = o(/* @__PURE__ */ new Set()), y = o(/* @__PURE__ */ new Set()), b = o(/* @__PURE__ */ new Set()), x = o(0), S = o(!1), C = o({
|
|
12
12
|
deleteFile: f,
|
|
13
13
|
receivableId: u
|
|
14
14
|
});
|
|
@@ -63,22 +63,22 @@ function c({ attachments: c, setAttachments: l, receivableId: u }) {
|
|
|
63
63
|
u,
|
|
64
64
|
l,
|
|
65
65
|
d
|
|
66
|
-
]), T = i((
|
|
67
|
-
let
|
|
68
|
-
if (
|
|
66
|
+
]), T = i((n) => {
|
|
67
|
+
let r = e(n);
|
|
68
|
+
if (r.length === 0) return;
|
|
69
69
|
let i = p.filter((e) => e.status === "uploading").length, a = 10 - c.length - i, o = [], s = !1;
|
|
70
|
-
for (let e of
|
|
70
|
+
for (let e of r) {
|
|
71
71
|
_.current += 1;
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
id:
|
|
72
|
+
let n = `pending-attachment-${_.current}`, r = t(e);
|
|
73
|
+
r ? o.push({
|
|
74
|
+
id: n,
|
|
75
75
|
name: e.name,
|
|
76
|
-
status:
|
|
76
|
+
status: r
|
|
77
77
|
}) : a <= 0 ? s = !0 : (--a, o.push({
|
|
78
|
-
id:
|
|
78
|
+
id: n,
|
|
79
79
|
name: e.name,
|
|
80
80
|
status: "uploading"
|
|
81
|
-
}), w(
|
|
81
|
+
}), w(n, e));
|
|
82
82
|
}
|
|
83
83
|
o.length > 0 && m((e) => [...e, ...o]), g(s);
|
|
84
84
|
}, [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../../../
|
|
5
|
+
import { toast as e } from "../../../../../../../node_modules/sonner/dist/index.js";
|
|
6
6
|
import { extractApiErrorMessage as t } from "../../../../../shared/util/dist/lib/apiErrors.js";
|
|
7
7
|
import "../../../../../shared/util/dist/index.js";
|
|
8
8
|
import "../../../../../shared/ui/dist/index.js";
|