@tesouro/embedded-components-react 0.11.141 → 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
|
@@ -9,108 +9,118 @@ import { useRefetchWidget as n, useWidgetConfig as r, useWidgetError as i, useWi
|
|
|
9
9
|
import "../../../../../shared/feature/dist/index.js";
|
|
10
10
|
import { RECEIVABLE_STATUS_BADGE_LABELS_EN as ne } from "../../../../../shared/document-status/ui/dist/index6.js";
|
|
11
11
|
import "../../../../../shared/document-status/ui/dist/index.js";
|
|
12
|
-
import {
|
|
12
|
+
import { getDocumentTitle as re } from "./helpers.js";
|
|
13
|
+
import { hasSelectedText as a } from "../../../../../shared/product-catalog/feature/dist/lib/helpers.js";
|
|
13
14
|
import "../../../../../shared/product-catalog/feature/dist/index.js";
|
|
14
15
|
import { getCreateFollowUp as ie } from "./actionsModal.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { useCallback as
|
|
16
|
+
import { RECEIVABLE_MESSAGE_LABELS_EN as ae } from "./labels.js";
|
|
17
|
+
import { getReceivablePermissions as oe } from "./permissions.js";
|
|
18
|
+
import { useReceivableActions as se } from "./useReceivableActions.js";
|
|
19
|
+
import { useReceivableActionsModal as ce } from "./useReceivableActionsModal.js";
|
|
20
|
+
import { useReceivableDetails as le } from "./useReceivableDetails.js";
|
|
21
|
+
import { useReceivableForm as ue } from "./useReceivableForm.js";
|
|
22
|
+
import { useReceivablesTable as de } from "./useReceivablesTable.js";
|
|
23
|
+
import { useRecurringSeriesTable as fe } from "./useRecurringSeriesTable.js";
|
|
24
|
+
import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
24
25
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js
|
|
25
|
-
function
|
|
26
|
-
let { initResponse: g, widgetToken:
|
|
27
|
-
...
|
|
28
|
-
...
|
|
29
|
-
}), [
|
|
26
|
+
function pe({ auditHistoryLabels: pe, counterpartMessageLabels: me, embeddedBankName: he, filterLabels: ge, initialCounterpartId: f, initialView: p, messageLabels: _e, onReceivableCreated: ve, onReceivableOpened: m, onStatusCardChange: ye, pageSizeOptions: h, screenLabels: be, selectedStatusCard: xe, isRecurringTabActive: Se = !1 }) {
|
|
27
|
+
let { initResponse: g, widgetToken: Ce } = r(), we = te(), Te = i(), _ = n(), v = ee(), y = !!g && !v, b = c(() => oe(g?.scopes), [g?.scopes]), Ee = !!g && v, x = !!g && b.canRead, S = !!g && b.canWrite, C = y && b.canRead, w = y && b.canWrite, T = !!Te && !y && !we, E = !y && !T && !!(Ce || we), D = c(() => ({
|
|
28
|
+
...ae,
|
|
29
|
+
..._e
|
|
30
|
+
}), [_e]), O = be?.statusBadge, k = c(() => ({
|
|
30
31
|
...ne,
|
|
31
|
-
...
|
|
32
|
-
}), [
|
|
33
|
-
|
|
34
|
-
let [
|
|
35
|
-
|
|
36
|
-
}, []),
|
|
37
|
-
|
|
38
|
-
}, []),
|
|
39
|
-
|
|
40
|
-
}, []),
|
|
32
|
+
...O
|
|
33
|
+
}), [O]), [A, j] = u(), [M, N] = u(!1), [P, De] = u(A);
|
|
34
|
+
A && A !== P && De(A);
|
|
35
|
+
let [F, I] = u(!1), [Oe, L] = u(), [ke, R] = u(!1), Ae = o((e) => {
|
|
36
|
+
R(!0), L(e);
|
|
37
|
+
}, []), je = o((e) => {
|
|
38
|
+
R(!1), L(e);
|
|
39
|
+
}, []), z = e(g?.scopes, [t.CounterpartReadOrg]), Me = o(() => L(void 0), []), [B, V] = u(!1), Ne = o(() => V(!0), []), H = o(() => V(!1), []), Pe = o((e) => {
|
|
40
|
+
j(e), N(!0);
|
|
41
|
+
}, []), U = ce({ messages: D }), W = U.open, Fe = o((e, t, n) => {
|
|
41
42
|
let r = ie(n);
|
|
42
|
-
r.openDetails && (
|
|
43
|
+
r.openDetails && (j(e), N(!0)), r.actionsModal && W({
|
|
43
44
|
action: n.mode,
|
|
44
45
|
receivableId: e,
|
|
45
46
|
counterpartId: n.counterpartId,
|
|
46
47
|
inlineItems: n.inlineItems,
|
|
47
48
|
showEmailStep: r.actionsModal.showEmailStep
|
|
48
|
-
}),
|
|
49
|
-
}, [
|
|
49
|
+
}), ve?.(e, t);
|
|
50
|
+
}, [ve, W]), G = de({
|
|
50
51
|
initialCounterpartId: p === "create" ? void 0 : f,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
selectedStatusCard: xe,
|
|
53
|
+
onStatusCardChange: ye,
|
|
54
|
+
messages: D,
|
|
55
|
+
statusLabels: k,
|
|
56
|
+
filterLabels: ge,
|
|
57
|
+
pageSizeOptions: h,
|
|
58
|
+
enabled: C,
|
|
59
|
+
visible: x
|
|
60
|
+
}), K = fe({
|
|
61
|
+
messages: D,
|
|
62
|
+
filterLabels: ge,
|
|
63
|
+
pageSizeOptions: h,
|
|
64
|
+
enabled: C && Se
|
|
65
|
+
}), q = o((e) => {
|
|
66
|
+
j(e), N(!0), m?.(e, "invoice");
|
|
67
|
+
}, [m]), J = le({
|
|
68
|
+
selectedReceivableId: A,
|
|
69
|
+
enabled: M && C,
|
|
70
|
+
canWrite: S,
|
|
71
|
+
messages: D,
|
|
72
|
+
statusLabels: k,
|
|
73
|
+
auditHistoryLabels: pe,
|
|
74
|
+
onOpenReceivable: q,
|
|
75
|
+
onOpenCustomer: z ? Ae : void 0
|
|
76
|
+
}), Y = l("edit"), Ie = o((e, t, n) => {
|
|
77
|
+
let r = n.mode === "issue", i = r && Y.current !== "issue" && n.hasCustomerEmail;
|
|
78
|
+
(i || n.inlineItems.length !== 0) && W({
|
|
71
79
|
action: r || n.mode === "recurrence" ? n.mode : "update",
|
|
72
80
|
receivableId: e,
|
|
73
81
|
counterpartId: n.counterpartId,
|
|
74
82
|
inlineItems: n.inlineItems,
|
|
75
83
|
showEmailStep: i
|
|
76
84
|
});
|
|
77
|
-
}, [
|
|
78
|
-
messages:
|
|
79
|
-
counterpartMessageLabels:
|
|
80
|
-
embeddedBankName:
|
|
81
|
-
canCreateCustomer:
|
|
82
|
-
onCreated:
|
|
83
|
-
onUpdated:
|
|
84
|
-
}), { openCreate:
|
|
85
|
-
|
|
86
|
-
}, [
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
}, [W]), X = ue({
|
|
86
|
+
messages: D,
|
|
87
|
+
counterpartMessageLabels: me,
|
|
88
|
+
embeddedBankName: he,
|
|
89
|
+
canCreateCustomer: b.canCreateCustomer,
|
|
90
|
+
onCreated: Fe,
|
|
91
|
+
onUpdated: Ie
|
|
92
|
+
}), { openCreate: Z, openEdit: Le } = X, Re = o(() => {
|
|
93
|
+
w && Z("invoice");
|
|
94
|
+
}, [w, Z]), ze = o(() => {
|
|
95
|
+
w && Z("invoice", { recurring: !0 });
|
|
96
|
+
}, [w, Z]), Be = l(!1);
|
|
97
|
+
s(() => {
|
|
98
|
+
Be.current || p === "create" && w && (Be.current = !0, Z("invoice", { customerId: f }));
|
|
89
99
|
}, [
|
|
90
|
-
|
|
91
|
-
|
|
100
|
+
w,
|
|
101
|
+
Z,
|
|
92
102
|
f,
|
|
93
103
|
p
|
|
94
104
|
]);
|
|
95
|
-
let
|
|
96
|
-
selectedReceivable:
|
|
97
|
-
selectedRecurrence:
|
|
98
|
-
messages:
|
|
99
|
-
onCreated:
|
|
105
|
+
let Q = se({
|
|
106
|
+
selectedReceivable: J.receivable,
|
|
107
|
+
selectedRecurrence: J.recurrence,
|
|
108
|
+
messages: D,
|
|
109
|
+
onCreated: Pe,
|
|
100
110
|
onDeleted: (e) => {
|
|
101
|
-
e ===
|
|
111
|
+
e === A && (j(void 0), N(!1));
|
|
102
112
|
},
|
|
103
113
|
onCompleteBeforeIssue: (e, t) => {
|
|
104
|
-
|
|
114
|
+
Y.current = t, X.openEdit(e, { highlightForIssue: !0 }), M && I(!0), N(!1);
|
|
105
115
|
},
|
|
106
|
-
onIssuedForSend: (e, t) =>
|
|
116
|
+
onIssuedForSend: (e, t) => W({
|
|
107
117
|
action: "issue",
|
|
108
118
|
receivableId: e,
|
|
109
119
|
counterpartId: t,
|
|
110
120
|
inlineItems: [],
|
|
111
121
|
showEmailStep: !0
|
|
112
122
|
}),
|
|
113
|
-
onResend: (e, t) =>
|
|
123
|
+
onResend: (e, t) => W({
|
|
114
124
|
action: "issue",
|
|
115
125
|
receivableId: e,
|
|
116
126
|
counterpartId: t,
|
|
@@ -119,120 +129,132 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: pe, embeddedBankNa
|
|
|
119
129
|
isResend: !0
|
|
120
130
|
})
|
|
121
131
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}, [
|
|
125
|
-
|
|
132
|
+
s(() => {
|
|
133
|
+
X.open || (Y.current = "edit");
|
|
134
|
+
}, [X.open]), s(() => {
|
|
135
|
+
X.open || U.isOpen || !F || (I(!1), N(!0));
|
|
126
136
|
}, [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
137
|
+
U.isOpen,
|
|
138
|
+
X.open,
|
|
139
|
+
F
|
|
130
140
|
]);
|
|
131
|
-
let
|
|
132
|
-
|
|
133
|
-
|
|
141
|
+
let Ve = y && !b.canWrite, He = X.open || X.counterpartView !== "none" || !!Q.actionTarget || Q.payment.isOpen || U.isOpen || B, Ue = X.close, We = X.counterpartForm.close, { closeAction: Ge } = Q, Ke = Q.payment.close, qe = U.close;
|
|
142
|
+
s(() => {
|
|
143
|
+
Ve && He && (Ue(), We(), Ge(), Ke(), qe(), H());
|
|
134
144
|
}, [
|
|
135
|
-
|
|
145
|
+
Ge,
|
|
146
|
+
qe,
|
|
147
|
+
We,
|
|
148
|
+
Ue,
|
|
149
|
+
H,
|
|
150
|
+
Ke,
|
|
136
151
|
He,
|
|
137
|
-
|
|
138
|
-
Re,
|
|
139
|
-
V,
|
|
140
|
-
Ve,
|
|
141
|
-
Le,
|
|
142
|
-
Ie
|
|
152
|
+
Ve
|
|
143
153
|
]);
|
|
144
|
-
let
|
|
145
|
-
|
|
146
|
-
}, [
|
|
147
|
-
|
|
148
|
-
}, []),
|
|
149
|
-
|
|
150
|
-
}, [
|
|
151
|
-
|
|
154
|
+
let Je = o((e) => {
|
|
155
|
+
a() || (j(e.id), N(!0), m?.(e.id, e.type));
|
|
156
|
+
}, [m]), Ye = o((e) => {
|
|
157
|
+
a() || q(e.id);
|
|
158
|
+
}, [q]), $ = o(() => {
|
|
159
|
+
N(!1), j(void 0), L(void 0);
|
|
160
|
+
}, []), { showCustomer: Xe } = G, Ze = o((e) => {
|
|
161
|
+
$(), Xe(e.id);
|
|
162
|
+
}, [$, Xe]), Qe = o((e) => {
|
|
163
|
+
w && ($(), Z("invoice", { customerId: e.id }));
|
|
152
164
|
}, [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
]),
|
|
157
|
-
|
|
165
|
+
w,
|
|
166
|
+
$,
|
|
167
|
+
Z
|
|
168
|
+
]), $e = o((e, t) => {
|
|
169
|
+
w && (e === "edit" ? J.receivable && (Y.current = "edit", Le(J.receivable), I(!0), N(!1)) : Q.openAction(e, {
|
|
158
170
|
id: t.id,
|
|
159
|
-
title:
|
|
171
|
+
title: J.receivable ? re(J.receivable, D) : t.title,
|
|
160
172
|
type: t.type
|
|
161
|
-
},
|
|
173
|
+
}, J.receivable ?? null));
|
|
162
174
|
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
175
|
+
Q,
|
|
176
|
+
w,
|
|
177
|
+
J.receivable,
|
|
178
|
+
Le,
|
|
179
|
+
D
|
|
168
180
|
]);
|
|
169
181
|
return {
|
|
170
|
-
canWrite:
|
|
171
|
-
canEditSettings:
|
|
172
|
-
actionsSuspended:
|
|
173
|
-
isAccessRestricted:
|
|
174
|
-
table:
|
|
175
|
-
...
|
|
182
|
+
canWrite: S,
|
|
183
|
+
canEditSettings: x && b.canEditSettings,
|
|
184
|
+
actionsSuspended: Ee,
|
|
185
|
+
isAccessRestricted: y && !b.canRead,
|
|
186
|
+
table: x ? G : {
|
|
187
|
+
...G,
|
|
176
188
|
rows: [],
|
|
177
189
|
statusCards: void 0,
|
|
178
190
|
isError: !1
|
|
179
191
|
},
|
|
180
|
-
isTableLoading:
|
|
181
|
-
isError:
|
|
182
|
-
onRetry:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
isTableLoading: x ? G.isLoading || E && G.rows.length === 0 : E,
|
|
193
|
+
isError: T || x && G.isError,
|
|
194
|
+
onRetry: T ? _ : G.onRetry,
|
|
195
|
+
series: x ? K : {
|
|
196
|
+
...K,
|
|
197
|
+
rows: [],
|
|
198
|
+
isError: !1
|
|
199
|
+
},
|
|
200
|
+
isSeriesLoading: x ? K.isLoading || E && K.rows.length === 0 : E,
|
|
201
|
+
isSeriesError: T || x && K.isError,
|
|
202
|
+
onSeriesRetry: T ? _ : K.onRetry,
|
|
203
|
+
details: J,
|
|
204
|
+
detailsOpen: M && x,
|
|
205
|
+
closeDetails: $,
|
|
206
|
+
detailsPanelKey: P,
|
|
207
|
+
customerDetailsId: Oe,
|
|
208
|
+
closeCustomerDetails: Me,
|
|
209
|
+
openCustomerDetails: z ? je : void 0,
|
|
210
|
+
customerDetailsActions: ke ? {
|
|
211
|
+
onViewAllDocuments: x ? Ze : void 0,
|
|
212
|
+
onCreateDocument: S ? Qe : void 0
|
|
193
213
|
} : {},
|
|
194
214
|
customersTabActions: {
|
|
195
|
-
onViewAllDocuments:
|
|
196
|
-
onCreateDocument:
|
|
215
|
+
onViewAllDocuments: x ? Ze : void 0,
|
|
216
|
+
onCreateDocument: S ? Qe : void 0
|
|
197
217
|
},
|
|
198
|
-
canCreateCustomer:
|
|
199
|
-
messages:
|
|
218
|
+
canCreateCustomer: b.canCreateCustomer,
|
|
219
|
+
messages: D,
|
|
200
220
|
form: {
|
|
201
|
-
...
|
|
202
|
-
open:
|
|
203
|
-
counterpartView:
|
|
221
|
+
...X,
|
|
222
|
+
open: S && X.open,
|
|
223
|
+
counterpartView: S ? X.counterpartView : "none",
|
|
204
224
|
counterpartForm: {
|
|
205
|
-
...
|
|
206
|
-
submit: d(
|
|
225
|
+
...X.counterpartForm,
|
|
226
|
+
submit: d(w, X.counterpartForm.submit)
|
|
207
227
|
},
|
|
208
|
-
submit: d(
|
|
209
|
-
submitDraft: d(
|
|
210
|
-
submitPrimary: d(
|
|
228
|
+
submit: d(w, X.submit),
|
|
229
|
+
submitDraft: d(w, X.submitDraft),
|
|
230
|
+
submitPrimary: d(w, X.submitPrimary)
|
|
211
231
|
},
|
|
212
|
-
openCreate:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
232
|
+
openCreate: Re,
|
|
233
|
+
openCreateRecurring: ze,
|
|
234
|
+
measureUnitsOpen: S && B,
|
|
235
|
+
openMeasureUnits: Ne,
|
|
236
|
+
closeMeasureUnits: H,
|
|
216
237
|
actions: {
|
|
217
|
-
...
|
|
218
|
-
actionDialog:
|
|
219
|
-
openAction: d(
|
|
220
|
-
confirmAction: d(
|
|
238
|
+
...Q,
|
|
239
|
+
actionDialog: S ? Q.actionDialog : void 0,
|
|
240
|
+
openAction: d(w, Q.openAction),
|
|
241
|
+
confirmAction: d(w, Q.confirmAction),
|
|
221
242
|
payment: {
|
|
222
|
-
...
|
|
223
|
-
isOpen:
|
|
224
|
-
save: d(
|
|
225
|
-
confirm: d(
|
|
243
|
+
...Q.payment,
|
|
244
|
+
isOpen: S && Q.payment.isOpen,
|
|
245
|
+
save: d(w, Q.payment.save),
|
|
246
|
+
confirm: d(w, Q.payment.confirm)
|
|
226
247
|
}
|
|
227
248
|
},
|
|
228
249
|
actionsModal: {
|
|
229
|
-
...
|
|
230
|
-
isOpen:
|
|
231
|
-
send: d(
|
|
232
|
-
saveItems: d(
|
|
250
|
+
...U,
|
|
251
|
+
isOpen: S && U.isOpen,
|
|
252
|
+
send: d(w, U.send),
|
|
253
|
+
saveItems: d(w, U.saveItems)
|
|
233
254
|
},
|
|
234
|
-
handleRowClick:
|
|
235
|
-
|
|
255
|
+
handleRowClick: Je,
|
|
256
|
+
handleSeriesRowClick: Ye,
|
|
257
|
+
handleDetailsActionClick: $e
|
|
236
258
|
};
|
|
237
259
|
}
|
|
238
260
|
function d(e, t) {
|
|
@@ -240,4 +262,4 @@ function d(e, t) {
|
|
|
240
262
|
e && t(...n);
|
|
241
263
|
};
|
|
242
264
|
}
|
|
243
|
-
export {
|
|
265
|
+
export { pe as useReceivablesWidget };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useFilterPanel as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { useReceivablesQuery as t } from "../../../../data-access/dist/index15.js";
|
|
7
|
+
import { useRecurrencesQuery as n } from "../../../../data-access/dist/index16.js";
|
|
8
|
+
import "../../../../data-access/dist/index.js";
|
|
9
|
+
import { InvoicesFilterChipKey as r, buildInvoicesFilterChips as i, clearInvoicesFilter as a, countActiveInvoiceFilters as o, emptyInvoicesFilterState as s } from "./invoicesFilter.js";
|
|
10
|
+
import { mergeInvoicesFilterLabels as c } from "./invoicesFilterLabels.js";
|
|
11
|
+
import { useReceivableCustomerNames as l } from "./useReceivableCustomerNames.js";
|
|
12
|
+
import { SERIES_FILTER_FIELDS as u, buildRecurringSeriesRows as d, buildSeriesFilterQuery as f, buildSeriesStatusLabels as p, buildSeriesStatusOptions as m } from "./recurringSeries.js";
|
|
13
|
+
import { useCallback as h, useEffect as g, useMemo as _, useState as v } from "react";
|
|
14
|
+
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useRecurringSeriesTable.js
|
|
15
|
+
var y = [], b = [];
|
|
16
|
+
function x({ messages: x, filterLabels: S, pageSizeOptions: ee, enabled: C = !0 }) {
|
|
17
|
+
let [w, T] = v([]), [E, D] = v(ee?.[0] ?? 10), [O, k] = v(), [A, j] = v(""), [M, te] = v(""), [N, P] = v(() => s()), F = e(), I = _(() => c(S), [S]), L = h(() => k(void 0), []);
|
|
18
|
+
g(() => {
|
|
19
|
+
if (A === M) return;
|
|
20
|
+
let e = setTimeout(() => {
|
|
21
|
+
te(A), L();
|
|
22
|
+
}, 300);
|
|
23
|
+
return () => clearTimeout(e);
|
|
24
|
+
}, [
|
|
25
|
+
M,
|
|
26
|
+
L,
|
|
27
|
+
A
|
|
28
|
+
]);
|
|
29
|
+
let R = n({ enabled: C }), z = R.data?.data, B = f(N, z), V = B.kind === "query" ? (B.query.id__in ?? []).join(",") : B.kind, [H, U] = v(V);
|
|
30
|
+
H !== V && (U(V), k(void 0));
|
|
31
|
+
let W = w[0]?.desc ? "desc" : "asc", G = t({
|
|
32
|
+
enabled: C && B.kind === "query",
|
|
33
|
+
type: "invoice",
|
|
34
|
+
limit: E,
|
|
35
|
+
pagination_token: O,
|
|
36
|
+
search_text: M || void 0,
|
|
37
|
+
...B.kind === "query" ? B.query : {},
|
|
38
|
+
...w[0] ? {
|
|
39
|
+
sort: "total_amount",
|
|
40
|
+
order: W
|
|
41
|
+
} : {
|
|
42
|
+
sort: "created_at",
|
|
43
|
+
order: "desc"
|
|
44
|
+
}
|
|
45
|
+
}), K = B.kind === "none" ? y : G.data?.data ?? y, q = l(K), J = _(() => new Map((z ?? b).map((e) => [e.id, e])), [z]), Y = _(() => d({
|
|
46
|
+
receivables: K,
|
|
47
|
+
recurrences: J,
|
|
48
|
+
isRecurrencesLoading: R.isLoading,
|
|
49
|
+
messages: x,
|
|
50
|
+
customerNames: q
|
|
51
|
+
}), [
|
|
52
|
+
q,
|
|
53
|
+
x,
|
|
54
|
+
K,
|
|
55
|
+
J,
|
|
56
|
+
R.isLoading
|
|
57
|
+
]), X = h((e) => {
|
|
58
|
+
P((t) => ({
|
|
59
|
+
...t,
|
|
60
|
+
...e
|
|
61
|
+
})), L();
|
|
62
|
+
}, [L]), Z = _(() => p(x), [x]), ne = _(() => m(x), [x]), re = _(() => i({
|
|
63
|
+
state: N,
|
|
64
|
+
search: A,
|
|
65
|
+
labels: I,
|
|
66
|
+
statusLabels: Z
|
|
67
|
+
}), [
|
|
68
|
+
N,
|
|
69
|
+
I,
|
|
70
|
+
A,
|
|
71
|
+
Z
|
|
72
|
+
]), Q = o(N, A), ie = h((e) => {
|
|
73
|
+
e === r.Search ? j("") : (P((t) => a(t, e)), L());
|
|
74
|
+
}, [L]), ae = h(() => {
|
|
75
|
+
P(s()), j(""), L();
|
|
76
|
+
}, [L]), oe = {
|
|
77
|
+
fields: u,
|
|
78
|
+
searchValue: A,
|
|
79
|
+
onSearchChange: j,
|
|
80
|
+
isPopoverOpen: F.isMenuOpen || !!F.activePanelId,
|
|
81
|
+
isMenuOpen: F.isMenuOpen,
|
|
82
|
+
activePanel: F.activePanelId,
|
|
83
|
+
onMenuToggle: F.toggleMenu,
|
|
84
|
+
onPopoverClose: () => {
|
|
85
|
+
F.closeMenu(), F.closePanel();
|
|
86
|
+
},
|
|
87
|
+
onFieldSelect: F.openPanel,
|
|
88
|
+
activeFilterCount: Q,
|
|
89
|
+
chips: re,
|
|
90
|
+
showClearAll: Q > 0,
|
|
91
|
+
onRemoveChip: ie,
|
|
92
|
+
onClearAll: ae,
|
|
93
|
+
dateRanges: {},
|
|
94
|
+
datePresets: [],
|
|
95
|
+
onDateRangeChange: () => void 0,
|
|
96
|
+
onDatePresetChange: () => void 0,
|
|
97
|
+
statusOptions: ne,
|
|
98
|
+
selectedStatuses: N.statuses,
|
|
99
|
+
onStatusChange: (e) => X({ statuses: e }),
|
|
100
|
+
amountMode: N.amountMode,
|
|
101
|
+
onAmountModeChange: (e) => X({ amountMode: e }),
|
|
102
|
+
amountMin: N.amountMin,
|
|
103
|
+
amountMax: N.amountMax,
|
|
104
|
+
onAmountMinChange: (e) => X({ amountMin: e }),
|
|
105
|
+
onAmountMaxChange: (e) => X({ amountMax: e }),
|
|
106
|
+
customerName: N.customerName,
|
|
107
|
+
onCustomerNameChange: (e) => X({ customerName: e })
|
|
108
|
+
}, se = h((e) => {
|
|
109
|
+
T(typeof e == "function" ? e(w) : e), L();
|
|
110
|
+
}, [L, w]), ce = h((e) => {
|
|
111
|
+
D(e), L();
|
|
112
|
+
}, [L]), le = h(() => k(G.data?.next_pagination_token ?? void 0), [G.data?.next_pagination_token]), ue = h(() => k(G.data?.prev_pagination_token ?? void 0), [G.data?.prev_pagination_token]), de = h(() => {
|
|
113
|
+
R.refetch(), G.refetch();
|
|
114
|
+
}, [G, R]), $ = B.kind === "query";
|
|
115
|
+
return {
|
|
116
|
+
rows: Y,
|
|
117
|
+
isLoading: B.kind === "waiting" ? R.isLoading : $ && G.isLoading,
|
|
118
|
+
isError: G.isError || R.isError,
|
|
119
|
+
sorting: w,
|
|
120
|
+
onSortingChange: se,
|
|
121
|
+
pageSize: E,
|
|
122
|
+
onPageSizeChange: ce,
|
|
123
|
+
hasNextPage: $ && !!G.data?.next_pagination_token,
|
|
124
|
+
hasPrevPage: $ && !!G.data?.prev_pagination_token,
|
|
125
|
+
onNextPage: le,
|
|
126
|
+
onPrevPage: ue,
|
|
127
|
+
filterBar: oe,
|
|
128
|
+
isFiltering: Q > 0,
|
|
129
|
+
onRetry: de
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
export { x as useRecurringSeriesTable };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/invoicing.js
CHANGED
|
@@ -108,6 +108,10 @@ var g = (e) => `00000000-0000-4000-8010-0000000002${String(e).padStart(2, "0")}`
|
|
|
108
108
|
if (s !== null && o < Number(s)) return !1;
|
|
109
109
|
let c = t.get("total_amount__lte");
|
|
110
110
|
if (c !== null && o > Number(c)) return !1;
|
|
111
|
+
let l = e.paid_at ?? "", u = t.get("paid_at__gte");
|
|
112
|
+
if (u && (!l || l < u)) return !1;
|
|
113
|
+
let d = t.get("paid_at__lte");
|
|
114
|
+
if (d && (!l || l > d)) return !1;
|
|
111
115
|
for (let n of [
|
|
112
116
|
"due_date",
|
|
113
117
|
"issue_date",
|