@tesouro/embedded-components-react 0.5.230 → 0.5.232
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/README.md +1 -0
- package/dist/index.css +14 -0
- package/dist/index.d.ts +125 -22
- package/dist/index.js +3 -3
- package/dist/lib/ExpenseManagementWidget.d.ts +22 -21
- package/dist/lib/ExpenseManagementWidget.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +104 -2
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/lib/UploadReceiptWidget.d.ts +2 -2
- package/dist/lib/UploadReceiptWidget.js +2 -2
- package/dist/lib/WidgetSuite.d.ts +17 -15
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index2.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index24.js → approval-policies/feature/dist/index3.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index25.js → approval-policies/feature/dist/index4.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index26.js → approval-policies/feature/dist/index5.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index27.js → approval-policies/feature/dist/index6.js} +53 -53
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/types.js → approval-policies/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js → approval-policies/ui/dist/index3.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/conditionLabel.js → approval-policies/ui/dist/index4.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/EmptyApprovalRules.js → approval-policies/ui/dist/index5.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleCard.js → approval-policies/ui/dist/index6.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleForm.js → approval-policies/ui/dist/index7.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js → approval-policies/ui/dist/index8.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index.js +18 -19
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/invalidation.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index20.js → lib/invalidateTransactionViews.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index10.js → lib/queryKeys.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index5.js → lib/useEntityUsersByIdsQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index8.js → lib/useExpenseHistoryQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index7.js → lib/useExpenseLedgerAccountsQuery.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index17.js → lib/useExpenseReceiptsCountQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index16.js → lib/useExpenseTransactionIdsQuery.js} +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index15.js → lib/useExpenseTransactionsCountQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index19.js → lib/useGetApprovalRequestsQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index9.js → lib/useGetTransactionQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index3.js → lib/useGetTransactionsQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/lib/useHasDirectReportsQuery.js +34 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index4.js → lib/useOrganizationDepartmentsQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/lib/useOrganizationLocationsQuery.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index11.js → lib/usePatchReceiptMutation.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index14.js → lib/useTrackReceiptMatching.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index21.js → lib/useTransactionReviewMutations.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index18.js → lib/useTransactionValidationsQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index13.js → lib/useUploadReceiptMutation.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +77 -160
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +356 -63
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +36 -71
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +130 -344
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index14.js +223 -36
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index15.js +192 -137
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index16.js +11 -227
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index17.js +81 -186
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index18.js +37 -11
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index19.js +309 -82
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index2.js +30 -87
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index20.js +1 -39
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +23 -257
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index7.js +160 -59
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +62 -28
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +28 -18
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{data-access → receipt-match/data-access}/dist/index2.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index3.js +40 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +256 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index3.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +65 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/labels.js → receipt-match/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptInboxItem.js → receipt-match/ui/dist/index3.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptInboxStep.js → receipt-match/ui/dist/index4.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/TransactionsMatchStep.js → receipt-match/ui/dist/index5.js} +27 -27
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/MatchConfirmationStep.js → receipt-match/ui/dist/index6.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchSidebar.js → receipt-match/ui/dist/index7.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchLauncher.js → receipt-match/ui/dist/index8.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/index.js +9 -28
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +7 -12
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +1 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +61 -55
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +42 -44
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +137 -138
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +82 -80
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui → util}/dist/lib/isPdf.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/util/dist/lib/widgetName.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +92 -55
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +64 -142
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +186 -17
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/data-access/dist/index6.js → invoicing-widget/data-access/dist/index13.js} +8 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +45 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +68 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +66 -32
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +32 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +24 -166
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +175 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +42 -95
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +36 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +38 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +206 -147
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +39 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +53 -227
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +216 -287
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +453 -43
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +103 -126
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +122 -146
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +145 -41
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +39 -115
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +113 -90
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +81 -98
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +111 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +26 -633
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +639 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +41 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +35 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +73 -130
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +133 -329
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index36.js +345 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +15 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +35 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +8 -71
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +70 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +31 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +18 -30
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +12 -301
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +33 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +14 -46
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +23 -67
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +76 -485
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +392 -95
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/feature/dist/index22.js → invoicing-widget/ui/dist/index31.js} +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +48 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +72 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +496 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +97 -91
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +2 -236
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +1 -249
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +89 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +23 -54
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +223 -340
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +249 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +59 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +353 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +17 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +41 -41
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +75 -43
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/formatTimestampDate.js +13 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index2.js +91 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/labels.js → upload-receipt-widget/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/UploadReceiptButton.js → upload-receipt-widget/ui/dist/index3.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/UploadReceiptModal.js → upload-receipt-widget/ui/dist/index4.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index11.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index12.js +0 -39
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index21.js +0 -297
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index23.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/labels.js +0 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +0 -28
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js
CHANGED
|
@@ -4,118 +4,101 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { extractApiErrorMessage as t } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
7
|
-
import { usePaymentTermsQuery as n } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
|
|
8
7
|
import "../../../shared/ui/dist/index.js";
|
|
9
|
-
import { useWidgetConfig as
|
|
8
|
+
import { useWidgetConfig as n } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
9
|
import "../../../shared/feature/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import { useCreateOverdueReminderMutation as f, useCreatePaymentReminderMutation as p, useOverdueRemindersQuery as m, usePaymentRemindersQuery as h } from "../../data-access/dist/index11.js";
|
|
10
|
+
import { useCreateEntityBankAccountMutation as r, usePaymentAccountsQuery as i } from "../../data-access/dist/index4.js";
|
|
13
11
|
import "../../data-access/dist/index.js";
|
|
14
|
-
import {
|
|
12
|
+
import { EMPTY_BANK_ACCOUNT_FORM_VALUES as a, bankAccountFormToPayload as o, buildBankAccountSectionView as s, buildPaymentAccountOptions as c, getBankAccountPermissions as l, validateBankAccountForm as u } from "./index20.js";
|
|
13
|
+
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
15
14
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
paymentTermsId: C,
|
|
32
|
-
paymentTermsCustomDate: w,
|
|
33
|
-
paymentTerms: A,
|
|
34
|
-
today: /* @__PURE__ */ new Date()
|
|
35
|
-
}), [
|
|
36
|
-
A,
|
|
37
|
-
w,
|
|
38
|
-
C
|
|
39
|
-
]), Q = g(async () => {
|
|
40
|
-
if (u(P)) try {
|
|
41
|
-
let t = await V.mutateAsync({ body: o({
|
|
42
|
-
daysBefore: Number(P),
|
|
43
|
-
dueDate: Z(),
|
|
44
|
-
messages: D
|
|
45
|
-
}) });
|
|
46
|
-
F(""), O({ paymentReminderId: t.id }), e.success(D.reminderAdded);
|
|
47
|
-
} catch (n) {
|
|
48
|
-
e.error(t(n) ?? D.genericError);
|
|
49
|
-
}
|
|
15
|
+
function g({ open: g, bankAccountId: _, embeddedBankName: v, messages: y, onSelect: b }) {
|
|
16
|
+
let { initResponse: x } = n(), S = p(() => l(x?.scopes), [x?.scopes]), { paymentAccounts: C, isLoading: w, isIncomplete: T } = i({
|
|
17
|
+
enabled: g,
|
|
18
|
+
canReadEmbedded: S.canReadEmbedded,
|
|
19
|
+
canReadExternal: S.canReadExternal
|
|
20
|
+
}), E = r(), [D, O] = h(!1), [k, A] = h(a), [j, M] = h({}), N = m(!1), P = d(() => {
|
|
21
|
+
N.current = !1, O(!1), A(a), M({});
|
|
22
|
+
}, []);
|
|
23
|
+
f(() => {
|
|
24
|
+
if (!g || T || N.current || C.length !== 1) return;
|
|
25
|
+
let [e] = C;
|
|
26
|
+
N.current = !0, b({
|
|
27
|
+
bankAccountId: e.id,
|
|
28
|
+
bankAccountType: e.type
|
|
29
|
+
});
|
|
50
30
|
}, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
31
|
+
T,
|
|
32
|
+
b,
|
|
33
|
+
g,
|
|
34
|
+
C
|
|
35
|
+
]);
|
|
36
|
+
let F = d((e) => {
|
|
37
|
+
let t = C.find((t) => t.id === e);
|
|
38
|
+
t && b({
|
|
39
|
+
bankAccountId: t.id,
|
|
40
|
+
bankAccountType: t.type
|
|
41
|
+
});
|
|
42
|
+
}, [b, C]), I = d(() => O(!0), []), L = d(() => {
|
|
43
|
+
O(!1), A(a), M({});
|
|
44
|
+
}, []), R = d((e) => A((t) => ({
|
|
45
|
+
...t,
|
|
46
|
+
...e
|
|
47
|
+
})), []), z = d(async () => {
|
|
48
|
+
let n = u(k, y);
|
|
49
|
+
if (M(n), !(Object.keys(n).length > 0)) try {
|
|
50
|
+
let t = await E.mutateAsync({ body: o(k) });
|
|
51
|
+
O(!1), A(a), b({
|
|
52
|
+
bankAccountId: t.id,
|
|
53
|
+
bankAccountType: "BANK_DETAILS"
|
|
54
|
+
}), e.success(y.bankAccountCreated.replace("{name}", t.display_name ?? ""));
|
|
64
55
|
} catch (n) {
|
|
65
|
-
e.error(t(n) ??
|
|
56
|
+
e.error(t(n) ?? y.bankAccountCreateFailed);
|
|
66
57
|
}
|
|
67
58
|
}, [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
59
|
+
E,
|
|
60
|
+
k,
|
|
61
|
+
y,
|
|
62
|
+
b
|
|
63
|
+
]), B = p(() => c({
|
|
64
|
+
accounts: C,
|
|
65
|
+
embeddedBankName: v,
|
|
66
|
+
messages: y
|
|
67
|
+
}), [
|
|
68
|
+
v,
|
|
69
|
+
y,
|
|
70
|
+
C
|
|
73
71
|
]);
|
|
74
72
|
return {
|
|
75
|
-
view:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
isCreatingPaymentReminder: V.isPending,
|
|
88
|
-
isCreatingOverdueReminder: H.isPending,
|
|
89
|
-
today: /* @__PURE__ */ new Date(),
|
|
90
|
-
messages: D
|
|
91
|
-
}) : void 0, [
|
|
92
|
-
P,
|
|
73
|
+
view: p(() => s({
|
|
74
|
+
options: B,
|
|
75
|
+
isLoading: w,
|
|
76
|
+
selectedId: _,
|
|
77
|
+
isAddingAccount: D,
|
|
78
|
+
canAddAccount: S.canAddAccount,
|
|
79
|
+
formValues: k,
|
|
80
|
+
formErrors: j,
|
|
81
|
+
isSaving: E.isPending
|
|
82
|
+
}), [
|
|
83
|
+
_,
|
|
84
|
+
E.isPending,
|
|
93
85
|
j,
|
|
94
|
-
|
|
95
|
-
V.isPending,
|
|
96
|
-
S,
|
|
97
|
-
x,
|
|
86
|
+
k,
|
|
98
87
|
D,
|
|
99
|
-
E,
|
|
100
|
-
B.data?.data,
|
|
101
|
-
I,
|
|
102
|
-
T,
|
|
103
|
-
z.data?.data,
|
|
104
88
|
w,
|
|
105
|
-
|
|
106
|
-
|
|
89
|
+
B,
|
|
90
|
+
S.canAddAccount
|
|
107
91
|
]),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
saveOverdue: $
|
|
92
|
+
isLoading: w,
|
|
93
|
+
hasAccounts: C.length > 0,
|
|
94
|
+
canAddAccount: S.canAddAccount,
|
|
95
|
+
reset: P,
|
|
96
|
+
selectAccount: F,
|
|
97
|
+
openAddAccount: I,
|
|
98
|
+
cancelAddAccount: L,
|
|
99
|
+
updateAccountForm: R,
|
|
100
|
+
saveAccount: z
|
|
118
101
|
};
|
|
119
102
|
}
|
|
120
103
|
//#endregion
|
|
121
|
-
export {
|
|
104
|
+
export { g as useReceivableBankAccount };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js
CHANGED
|
@@ -2,36 +2,120 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "../../../shared/data-access/dist/
|
|
8
|
-
import
|
|
9
|
-
import "../../../shared/
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { extractApiErrorMessage as t } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
7
|
+
import { usePaymentTermsQuery as n } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
|
|
8
|
+
import "../../../shared/ui/dist/index.js";
|
|
9
|
+
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
+
import "../../../shared/feature/dist/index.js";
|
|
11
|
+
import { areOverdueTermsValid as i, buildOverdueReminderPayload as a, buildPaymentReminderPayload as o, buildRemindersView as s, canCreateReminders as c, getImpliedDueDate as l, isBeforeDueDaysValid as u, sanitizeReminderDays as d } from "./index15.js";
|
|
12
|
+
import { useCreateOverdueReminderMutation as f, useCreatePaymentReminderMutation as p, useOverdueRemindersQuery as m, usePaymentRemindersQuery as h } from "../../data-access/dist/index12.js";
|
|
10
13
|
import "../../data-access/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import { useMemo as i } from "react";
|
|
14
|
+
import { useCallback as g, useMemo as _, useState as v } from "react";
|
|
13
15
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
var y = [""];
|
|
17
|
+
function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTermsCustomDate: w, paymentReminderId: T, overdueReminderId: E, messages: D, onSelect: O }) {
|
|
18
|
+
let { initResponse: k } = r(), A = n().data?.data, j = _(() => c(k?.scopes), [k?.scopes]), [M, N] = v(!1), [P, F] = v(""), [I, L] = v(y), R = b && x && M, z = h({ enabled: R }), B = m({ enabled: R }), V = p(), H = f(), U = g((e) => {
|
|
19
|
+
N(e), F(""), L(y);
|
|
20
|
+
}, []), W = g((e) => {
|
|
21
|
+
e || (O({
|
|
22
|
+
paymentReminderId: "",
|
|
23
|
+
overdueReminderId: ""
|
|
24
|
+
}), F(""), L(y)), N(e);
|
|
25
|
+
}, [O]), G = g((e) => O({ paymentReminderId: e }), [O]), K = g((e) => O({ overdueReminderId: e }), [O]), q = g((e) => F(d(e)), []), J = g((e, t) => {
|
|
26
|
+
let n = d(t);
|
|
27
|
+
L((t) => t.map((t, r) => r === e ? n : t));
|
|
28
|
+
}, []), Y = g(() => {
|
|
29
|
+
L((e) => e.length < 3 ? [...e, ""] : e);
|
|
30
|
+
}, []), X = g(() => L(y), []), Z = g(() => l({
|
|
31
|
+
paymentTermsId: C,
|
|
32
|
+
paymentTermsCustomDate: w,
|
|
33
|
+
paymentTerms: A,
|
|
34
|
+
today: /* @__PURE__ */ new Date()
|
|
25
35
|
}), [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
A,
|
|
37
|
+
w,
|
|
38
|
+
C
|
|
39
|
+
]), Q = g(async () => {
|
|
40
|
+
if (u(P)) try {
|
|
41
|
+
let t = await V.mutateAsync({ body: o({
|
|
42
|
+
daysBefore: Number(P),
|
|
43
|
+
dueDate: Z(),
|
|
44
|
+
messages: D
|
|
45
|
+
}) });
|
|
46
|
+
F(""), O({ paymentReminderId: t.id }), e.success(D.reminderAdded);
|
|
47
|
+
} catch (n) {
|
|
48
|
+
e.error(t(n) ?? D.genericError);
|
|
49
|
+
}
|
|
50
|
+
}, [
|
|
51
|
+
P,
|
|
52
|
+
V,
|
|
53
|
+
Z,
|
|
54
|
+
D,
|
|
55
|
+
O
|
|
56
|
+
]), $ = g(async () => {
|
|
57
|
+
if (i(I)) try {
|
|
58
|
+
let t = await H.mutateAsync({ body: a({
|
|
59
|
+
terms: I,
|
|
60
|
+
dueDate: Z(),
|
|
61
|
+
messages: D
|
|
62
|
+
}) });
|
|
63
|
+
L(y), O({ overdueReminderId: t.id }), e.success(D.reminderAdded);
|
|
64
|
+
} catch (n) {
|
|
65
|
+
e.error(t(n) ?? D.genericError);
|
|
66
|
+
}
|
|
67
|
+
}, [
|
|
68
|
+
H,
|
|
69
|
+
Z,
|
|
70
|
+
D,
|
|
71
|
+
O,
|
|
72
|
+
I
|
|
34
73
|
]);
|
|
74
|
+
return {
|
|
75
|
+
view: _(() => x ? s({
|
|
76
|
+
showReminders: M,
|
|
77
|
+
paymentTermsId: C,
|
|
78
|
+
paymentTermsCustomDate: w,
|
|
79
|
+
paymentReminderId: T,
|
|
80
|
+
overdueReminderId: E,
|
|
81
|
+
paymentReminders: z.data?.data,
|
|
82
|
+
overdueReminders: B.data?.data,
|
|
83
|
+
canCreate: j,
|
|
84
|
+
disabled: S,
|
|
85
|
+
beforeDueInput: P,
|
|
86
|
+
overdueTerms: I,
|
|
87
|
+
isCreatingPaymentReminder: V.isPending,
|
|
88
|
+
isCreatingOverdueReminder: H.isPending,
|
|
89
|
+
today: /* @__PURE__ */ new Date(),
|
|
90
|
+
messages: D
|
|
91
|
+
}) : void 0, [
|
|
92
|
+
P,
|
|
93
|
+
j,
|
|
94
|
+
H.isPending,
|
|
95
|
+
V.isPending,
|
|
96
|
+
S,
|
|
97
|
+
x,
|
|
98
|
+
D,
|
|
99
|
+
E,
|
|
100
|
+
B.data?.data,
|
|
101
|
+
I,
|
|
102
|
+
T,
|
|
103
|
+
z.data?.data,
|
|
104
|
+
w,
|
|
105
|
+
C,
|
|
106
|
+
M
|
|
107
|
+
]),
|
|
108
|
+
reset: U,
|
|
109
|
+
toggle: W,
|
|
110
|
+
selectPaymentReminder: G,
|
|
111
|
+
selectOverdueReminder: K,
|
|
112
|
+
changeBeforeDueInput: q,
|
|
113
|
+
saveBeforeDue: Q,
|
|
114
|
+
changeOverdueTerm: J,
|
|
115
|
+
addOverdueTerm: Y,
|
|
116
|
+
clearOverdueTerms: X,
|
|
117
|
+
saveOverdue: $
|
|
118
|
+
};
|
|
35
119
|
}
|
|
36
120
|
//#endregion
|
|
37
|
-
export {
|
|
121
|
+
export { b as useReceivableReminders };
|