@tesouro/embedded-components-react 0.5.225 → 0.5.227
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 +21 -21
- package/dist/index.d.ts +23 -2
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +23 -2
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index3.js +41 -39
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +150 -147
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +46 -51
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +130 -128
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +31 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +36 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index2.js +6 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index8.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +154 -150
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +151 -149
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index3.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index15.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index17.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index18.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index19.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index8.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index9.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index24.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index27.js +89 -87
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +133 -130
- package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js +36 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +50 -36
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +40 -39
- 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/index12.js +51 -32
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +20 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +17 -202
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +220 -31
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +32 -145
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -44
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +145 -117
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +46 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +113 -87
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +58 -116
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +98 -225
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +111 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +225 -462
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +34 -41
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +627 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +39 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -112
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +75 -310
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +124 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +324 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +20 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +56 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +33 -29
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +184 -162
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +78 -69
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +209 -207
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index4.js +10 -5
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index5.js +10 -5
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index6.js +11 -6
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index14.js +30 -28
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index17.js +28 -26
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index18.js +37 -34
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index21.js +28 -26
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index22.js +37 -34
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +294 -292
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js +58 -58
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +47 -48
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +20 -19
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -39
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/EmbedApiContext.js +14 -13
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/allPages.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js +16 -15
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js +28 -29
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organizationStatus.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +26 -27
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +210 -199
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +60 -52
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js +31 -32
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useRolePermissionsQueries.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useCurrentUserQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useGetUserDataQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMailboxAddress.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMyEntityQuery.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js +33 -34
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js +33 -22
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +43 -32
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +138 -127
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/deriveOrganizationStatus.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useWidgetFetch.js +1 -1
- 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/data-access/dist/index10.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index2.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js +60 -58
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js
CHANGED
|
@@ -2,100 +2,126 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "../../../shared/
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
10
|
-
import { useCreateEntityBankAccountMutation as r, usePaymentAccountsQuery as i } from "../../data-access/dist/index3.js";
|
|
11
|
-
import "../../data-access/dist/index.js";
|
|
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";
|
|
5
|
+
import { getCounterpartEmail as e } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
6
|
+
import { useCounterpartQuery as t } from "../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
7
|
+
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
8
|
+
import { applyRecurrenceEmailDraft as n, buildRecurrenceEmailView as r, buildRecurrenceView as i, clearRecurrenceRecipients as a, createRecurrenceEmailDraft as o, selectRecurrenceDate as s, selectRecurrenceDayOfWeek as c, selectRecurrenceEndMode as l, selectRecurrenceFrequency as u, selectRecurrenceIssueMode as d, shouldOpenRecurrenceEmail as f } from "./index8.js";
|
|
9
|
+
import { useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
14
10
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
var v = [
|
|
12
|
+
"recurrenceStartDate",
|
|
13
|
+
"recurrenceEndDate",
|
|
14
|
+
"recurrenceIssueMode",
|
|
15
|
+
"recurrenceDayOfWeek",
|
|
16
|
+
"recurrenceEndMode",
|
|
17
|
+
"recurrenceMaxOccurrences"
|
|
18
|
+
], y = [
|
|
19
|
+
"recurrenceSubject",
|
|
20
|
+
"recurrenceBody",
|
|
21
|
+
"recurrenceRecipientsTo",
|
|
22
|
+
"recurrenceRecipientsCc",
|
|
23
|
+
"recurrenceRecipientsBcc"
|
|
24
|
+
];
|
|
25
|
+
function b({ values: b, errors: x, lockSchedule: S, messages: C, onChange: w, onClearErrors: T, onRevalidateErrors: E }) {
|
|
26
|
+
let D = t(b.customerId || void 0), O = D.data ? e(D.data).trim() : "", [k, A] = _(!1), [j, M] = _(b), [N, P] = _(null), F = h(() => N ?? o(j, O), [
|
|
27
|
+
O,
|
|
28
|
+
N,
|
|
29
|
+
j
|
|
30
|
+
]), I = g(O);
|
|
31
|
+
m(() => {
|
|
32
|
+
let e = I.current;
|
|
33
|
+
I.current = O, e && e !== O && w(a);
|
|
34
|
+
}, [O, w]);
|
|
35
|
+
let L = p((e) => {
|
|
36
|
+
M(e), P(null), A(!0);
|
|
22
37
|
}, []);
|
|
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
|
-
});
|
|
30
|
-
}, [
|
|
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 ?? ""));
|
|
55
|
-
} catch (n) {
|
|
56
|
-
e.error(t(n) ?? y.bankAccountCreateFailed);
|
|
57
|
-
}
|
|
58
|
-
}, [
|
|
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
|
|
71
|
-
]);
|
|
72
38
|
return {
|
|
73
|
-
view:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
canAddAccount: S.canAddAccount,
|
|
79
|
-
formValues: k,
|
|
80
|
-
formErrors: j,
|
|
81
|
-
isSaving: E.isPending
|
|
39
|
+
view: h(() => i({
|
|
40
|
+
fields: b,
|
|
41
|
+
errors: x,
|
|
42
|
+
lockSchedule: S,
|
|
43
|
+
messages: C
|
|
82
44
|
}), [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
45
|
+
x,
|
|
46
|
+
S,
|
|
47
|
+
C,
|
|
48
|
+
b
|
|
49
|
+
]),
|
|
50
|
+
emailView: h(() => r({
|
|
51
|
+
open: k,
|
|
52
|
+
ready: !D.isLoading,
|
|
53
|
+
draft: F,
|
|
54
|
+
messages: C
|
|
55
|
+
}), [
|
|
56
|
+
D.isLoading,
|
|
57
|
+
F,
|
|
86
58
|
k,
|
|
87
|
-
|
|
59
|
+
C
|
|
60
|
+
]),
|
|
61
|
+
changeFrequency: p((e) => {
|
|
62
|
+
T(v), w((t) => u(t, e));
|
|
63
|
+
}, [w, T]),
|
|
64
|
+
changeMonthDay: p((e) => {
|
|
65
|
+
E(["recurrenceIssueMode"]), w((t) => d(t, e, { lockSchedule: S }));
|
|
66
|
+
}, [
|
|
67
|
+
S,
|
|
68
|
+
w,
|
|
69
|
+
E
|
|
70
|
+
]),
|
|
71
|
+
changeWeekday: p((e) => {
|
|
72
|
+
S || (T(["recurrenceStartDate"]), E(["recurrenceDayOfWeek"]), w((t) => c(t, e, { lockSchedule: S })));
|
|
73
|
+
}, [
|
|
74
|
+
S,
|
|
75
|
+
w,
|
|
76
|
+
T,
|
|
77
|
+
E
|
|
78
|
+
]),
|
|
79
|
+
changeStartDate: p((e) => {
|
|
80
|
+
E(["recurrenceStartDate"]), w((t) => s(t, "recurrenceStartDate", e));
|
|
81
|
+
}, [w, E]),
|
|
82
|
+
changeEndDate: p((e) => {
|
|
83
|
+
E(["recurrenceEndDate"]), w((t) => s(t, "recurrenceEndDate", e));
|
|
84
|
+
}, [w, E]),
|
|
85
|
+
changeEndMode: p((e) => {
|
|
86
|
+
E(["recurrenceEndMode"]), w((t) => l(t, e));
|
|
87
|
+
}, [w, E]),
|
|
88
|
+
changeMaxOccurrences: p((e) => {
|
|
89
|
+
E(["recurrenceMaxOccurrences"]), w((t) => ({
|
|
90
|
+
...t,
|
|
91
|
+
recurrenceMaxOccurrences: e
|
|
92
|
+
}));
|
|
93
|
+
}, [w, E]),
|
|
94
|
+
changeCreationMode: p((e) => {
|
|
95
|
+
let t = {
|
|
96
|
+
...b,
|
|
97
|
+
recurrenceAutomationLevel: e
|
|
98
|
+
};
|
|
99
|
+
w((t) => ({
|
|
100
|
+
...t,
|
|
101
|
+
recurrenceAutomationLevel: e
|
|
102
|
+
})), f(t, e) && L(t);
|
|
103
|
+
}, [
|
|
104
|
+
w,
|
|
105
|
+
L,
|
|
106
|
+
b
|
|
107
|
+
]),
|
|
108
|
+
setUpEmail: p(() => L(b), [L, b]),
|
|
109
|
+
changeEmailOpen: A,
|
|
110
|
+
changeEmail: p((e, t) => P((n) => ({
|
|
111
|
+
...n ?? F,
|
|
112
|
+
[e]: t
|
|
113
|
+
})), [F]),
|
|
114
|
+
saveEmail: p(() => {
|
|
115
|
+
w((e) => n(e, F)), T(y), A(!1);
|
|
116
|
+
}, [
|
|
117
|
+
F,
|
|
88
118
|
w,
|
|
89
|
-
|
|
90
|
-
S.canAddAccount
|
|
119
|
+
T
|
|
91
120
|
]),
|
|
92
|
-
reset:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
cancelAddAccount: L,
|
|
96
|
-
updateAccountForm: R,
|
|
97
|
-
saveAccount: z
|
|
121
|
+
reset: p(() => {
|
|
122
|
+
A(!1), I.current = "";
|
|
123
|
+
}, [])
|
|
98
124
|
};
|
|
99
125
|
}
|
|
100
126
|
//#endregion
|
|
101
|
-
export {
|
|
127
|
+
export { b as useReceivableRecurrence };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js
CHANGED
|
@@ -1,121 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"use client";
|
|
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 "./index14.js";
|
|
12
|
-
import { useCreateOverdueReminderMutation as f, useCreatePaymentReminderMutation as p, useOverdueRemindersQuery as m, usePaymentRemindersQuery as h } from "../../data-access/dist/index11.js";
|
|
13
|
-
import "../../data-access/dist/index.js";
|
|
14
|
-
import { useCallback as g, useMemo as _, useState as v } from "react";
|
|
1
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
3
|
+
import "../../../shared/data-access/dist/index.js";
|
|
15
4
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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()
|
|
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
|
-
}
|
|
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
|
|
73
|
-
]);
|
|
5
|
+
var n = {
|
|
6
|
+
routingNumber: "",
|
|
7
|
+
accountNumber: "",
|
|
8
|
+
accountHolderName: "",
|
|
9
|
+
displayName: ""
|
|
10
|
+
};
|
|
11
|
+
function r(n) {
|
|
12
|
+
let r = new Set(n ?? []);
|
|
74
13
|
return {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
14
|
+
canReadEmbedded: e(r, [t.BankAccountReadOrg]),
|
|
15
|
+
canReadExternal: e(r, [t.ExternalBankAccountReadOrg]),
|
|
16
|
+
canAddAccount: e(r, [t.BankAccountWriteOrg])
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function i(e, t) {
|
|
20
|
+
return [e.displayName || t.bankAccountFallbackName, e.accountNumberLast4].filter(Boolean).join(" - ");
|
|
21
|
+
}
|
|
22
|
+
function a(e, t, n) {
|
|
23
|
+
switch (e) {
|
|
24
|
+
case "INTERNAL": return t ? n.bankAccountPoweredBy.replace("{embeddedBankName}", t) : void 0;
|
|
25
|
+
case "EXTERNAL": return n.bankAccountLinked;
|
|
26
|
+
default: return;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function o({ accounts: e, embeddedBankName: t, messages: n }) {
|
|
30
|
+
return e.map((e) => ({
|
|
31
|
+
value: e.id,
|
|
32
|
+
label: i(e, n),
|
|
33
|
+
sourceLabel: a(e.type, t, n)
|
|
34
|
+
})).sort((e, t) => e.label.localeCompare(t.label));
|
|
35
|
+
}
|
|
36
|
+
function s({ options: e, isLoading: t, selectedId: n, isAddingAccount: r, canAddAccount: i, formValues: a, formErrors: o, isSaving: s }) {
|
|
37
|
+
return t ? { kind: "loading" } : e.length > 0 && !r ? {
|
|
38
|
+
kind: "picker",
|
|
39
|
+
options: e,
|
|
40
|
+
selected: e.find((e) => e.value === n),
|
|
41
|
+
canAddAccount: i
|
|
42
|
+
} : i ? {
|
|
43
|
+
kind: "form",
|
|
44
|
+
values: a,
|
|
45
|
+
errors: o,
|
|
46
|
+
canCancel: e.length > 0,
|
|
47
|
+
isSaving: s
|
|
48
|
+
} : { kind: "restricted" };
|
|
49
|
+
}
|
|
50
|
+
function c(e, t) {
|
|
51
|
+
let n = {}, r = e.accountHolderName.trim(), i = e.accountNumber.trim(), a = e.routingNumber.trim();
|
|
52
|
+
return r ? r.length > 255 && (n.accountHolderName = t.bankAccountHolderNameTooLong) : n.accountHolderName = t.bankAccountHolderNameRequired, i ? /^\d+$/.test(i) ? i.length < 4 ? n.accountNumber = t.bankAccountNumberTooShort : i.length > 17 && (n.accountNumber = t.bankAccountNumberTooLong) : n.accountNumber = t.bankAccountNumberDigitsOnly : n.accountNumber = t.bankAccountNumberRequired, a ? /^\d{9}$/.test(a) || (n.routingNumber = t.bankAccountRoutingNumberInvalid) : n.routingNumber = t.bankAccountRoutingNumberRequired, e.displayName.length > 200 && (n.displayName = t.bankAccountNicknameTooLong), n;
|
|
53
|
+
}
|
|
54
|
+
function l(e) {
|
|
55
|
+
return {
|
|
56
|
+
display_name: e.displayName || void 0,
|
|
57
|
+
account_holder_name: e.accountHolderName.trim() || void 0,
|
|
58
|
+
account_number: e.accountNumber.trim() || void 0,
|
|
59
|
+
routing_number: e.routingNumber.trim() || void 0
|
|
118
60
|
};
|
|
119
61
|
}
|
|
120
62
|
//#endregion
|
|
121
|
-
export {
|
|
63
|
+
export { n as EMPTY_BANK_ACCOUNT_FORM_VALUES, l as bankAccountFormToPayload, s as buildBankAccountSectionView, o as buildPaymentAccountOptions, r as getBankAccountPermissions, i as getPaymentAccountLineLabel, a as getPaymentAccountSourceLabel, c as validateBankAccountForm };
|