@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/settings-widget/team/feature/dist/index5.js
CHANGED
|
@@ -6,58 +6,58 @@ import { diffMemberSelection as e, formatMembersCount as t } from "./index4.js";
|
|
|
6
6
|
import { useEffect as n, useRef as r, useState as i } from "react";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js
|
|
8
8
|
function a(a) {
|
|
9
|
-
let { canRead: o, canWrite: s, directory: c, directoryReady: l, assignedAvatarsByGroupId: u, useListQuery: d, useEditMembers: f, useMutations: p, panelLabels: m, drawerLabels: h, countLabels: g, saveFailedMessage: _, deleteFailedMessage: v } = a, y = d(), b = p(),
|
|
9
|
+
let { canRead: o, canWrite: s, directory: c, directoryReady: l, assignedAvatarsByGroupId: u, useListQuery: d, useEditMembers: f, useMutations: p, panelLabels: m, drawerLabels: h, countLabels: g, saveFailedMessage: _, deleteFailedMessage: v } = a, y = d(), b = p(), x = s && !y.isPlaceholderData, [S, C] = i("closed"), [w, T] = i(), [E, D] = i(""), [O, k] = i(""), [A, j] = i([]), [M, N] = i(), [P, F] = i(), [I, L] = i(), R = f(S === "edit" ? w : void 0), z = (R.data?.members?.data ?? []).map((e) => e.id), B = o ? y.data?.data ?? [] : [], V = l && (S !== "edit" || !!R.data), H = r(void 0);
|
|
10
10
|
n(() => {
|
|
11
|
-
|
|
11
|
+
S === "edit" && w && H.current !== w && R.data && l && (H.current = w, j(z.map((e) => c.idToOption.get(e)).filter((e) => !!e)));
|
|
12
12
|
}, [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
S,
|
|
14
|
+
w,
|
|
15
|
+
R.data,
|
|
16
16
|
l,
|
|
17
|
-
|
|
17
|
+
z,
|
|
18
18
|
c
|
|
19
19
|
]);
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
let t =
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
let t =
|
|
29
|
-
if (t &&
|
|
30
|
-
|
|
20
|
+
let U = () => {
|
|
21
|
+
C("closed"), T(void 0), D(""), k(""), j([]), N(void 0), H.current = void 0;
|
|
22
|
+
}, W = () => {
|
|
23
|
+
U(), C("create");
|
|
24
|
+
}, G = (e) => {
|
|
25
|
+
let t = B.find((t) => t.id === e);
|
|
26
|
+
C("edit"), T(e), D(t?.name ?? ""), k(t?.name ?? ""), j([]), N(void 0), H.current = void 0;
|
|
27
|
+
}, K = () => A.map((e) => c.optionToId.get(e)).filter((e) => !!e), q = async () => {
|
|
28
|
+
let t = E.trim();
|
|
29
|
+
if (t && V) {
|
|
30
|
+
N(void 0);
|
|
31
31
|
try {
|
|
32
|
-
if (
|
|
32
|
+
if (S === "create") {
|
|
33
33
|
let e = await b.create(t);
|
|
34
|
-
|
|
35
|
-
let n =
|
|
34
|
+
C("edit"), T(e.id), k(t), H.current = e.id;
|
|
35
|
+
let n = K();
|
|
36
36
|
n.length > 0 && await b.assignMembers(e.id, n);
|
|
37
|
-
} else if (
|
|
38
|
-
t !==
|
|
39
|
-
let n =
|
|
40
|
-
r.length > 0 && await b.assignMembers(
|
|
37
|
+
} else if (S === "edit" && w) {
|
|
38
|
+
t !== O.trim() && await b.rename(w, t);
|
|
39
|
+
let n = z.filter((e) => c.idToOption.has(e)), { toAssign: r, toRemove: i } = e(n, K());
|
|
40
|
+
r.length > 0 && await b.assignMembers(w, r), i.length > 0 && await b.removeMembers(w, i);
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
U();
|
|
43
43
|
} catch {
|
|
44
|
-
|
|
44
|
+
N(_);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
if (
|
|
53
|
-
|
|
47
|
+
}, J = (e) => {
|
|
48
|
+
F(e), L(void 0);
|
|
49
|
+
}, Y = () => {
|
|
50
|
+
F(void 0), L(void 0);
|
|
51
|
+
}, X = async () => {
|
|
52
|
+
if (P) {
|
|
53
|
+
L(void 0);
|
|
54
54
|
try {
|
|
55
|
-
await b.remove(
|
|
55
|
+
await b.remove(P), Y(), w === P && U();
|
|
56
56
|
} catch {
|
|
57
|
-
|
|
57
|
+
L(v);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
},
|
|
60
|
+
}, Z = B.map((e) => {
|
|
61
61
|
let n = typeof e.memberCount == "string" ? Number.parseInt(e.memberCount, 10) : e.memberCount ?? 0, r = Number.isNaN(n) ? 0 : n, i = u?.get(e.id), a = i ? Math.max(0, r - i.length) : 0;
|
|
62
62
|
return {
|
|
63
63
|
key: e.id,
|
|
@@ -65,45 +65,45 @@ function a(a) {
|
|
|
65
65
|
membersLabel: t(e.memberCount, g),
|
|
66
66
|
assignedAvatars: i,
|
|
67
67
|
assignedOverflowLabel: a > 0 ? `+${a}` : void 0,
|
|
68
|
-
onEdit:
|
|
69
|
-
onDelete:
|
|
68
|
+
onEdit: x ? () => G(e.id) : void 0,
|
|
69
|
+
onDelete: x ? () => J(e.id) : void 0
|
|
70
70
|
};
|
|
71
|
-
}),
|
|
71
|
+
}), Q = B.find((e) => e.id === P)?.name ?? "";
|
|
72
72
|
return {
|
|
73
73
|
canRead: o,
|
|
74
74
|
panel: {
|
|
75
|
-
rows:
|
|
76
|
-
isLoading: o && (y.isLoading || y.isComplete === !1),
|
|
75
|
+
rows: Z,
|
|
76
|
+
isLoading: o && (y.isLoading || y.isComplete === !1 && !y.isPlaceholderData),
|
|
77
77
|
isError: y.isError,
|
|
78
|
-
onAddClick:
|
|
78
|
+
onAddClick: x ? W : void 0,
|
|
79
79
|
labels: m
|
|
80
80
|
},
|
|
81
81
|
drawer: {
|
|
82
|
-
open:
|
|
83
|
-
isEditMode:
|
|
84
|
-
name:
|
|
85
|
-
onNameChange:
|
|
82
|
+
open: S !== "closed",
|
|
83
|
+
isEditMode: S === "edit",
|
|
84
|
+
name: E,
|
|
85
|
+
onNameChange: D,
|
|
86
86
|
options: c.options,
|
|
87
|
-
selectedOptions:
|
|
88
|
-
onSelectedOptionsChange: (e) =>
|
|
89
|
-
isSaveDisabled: !
|
|
90
|
-
submitErrorMessage:
|
|
87
|
+
selectedOptions: A,
|
|
88
|
+
onSelectedOptionsChange: (e) => j(Array.isArray(e) ? e : [e]),
|
|
89
|
+
isSaveDisabled: !E.trim() || b.isMutating || !V,
|
|
90
|
+
submitErrorMessage: M,
|
|
91
91
|
onOpenChange: (e) => {
|
|
92
|
-
e ||
|
|
92
|
+
e || U();
|
|
93
93
|
},
|
|
94
|
-
onSubmit:
|
|
95
|
-
onDelete:
|
|
94
|
+
onSubmit: q,
|
|
95
|
+
onDelete: S === "edit" && w ? () => J(w) : void 0,
|
|
96
96
|
labels: h
|
|
97
97
|
},
|
|
98
98
|
deleteDialog: {
|
|
99
|
-
open: !!
|
|
100
|
-
subjectName:
|
|
99
|
+
open: !!P,
|
|
100
|
+
subjectName: Q,
|
|
101
101
|
isConfirming: b.isMutating,
|
|
102
|
-
errorMessage:
|
|
102
|
+
errorMessage: I,
|
|
103
103
|
onOpenChange: (e) => {
|
|
104
|
-
e ||
|
|
104
|
+
e || Y();
|
|
105
105
|
},
|
|
106
|
-
onConfirm:
|
|
106
|
+
onConfirm: X
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
}
|
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { getApprovalPolicies as e } from "../../../../data-access/dist/lib/rest/sdk.gen.js";
|
|
6
6
|
import { deleteApprovalPoliciesIdMutation as t, getApprovalPoliciesOptions as n, patchApprovalPoliciesIdMutation as r, postApprovalPoliciesMutation as i } from "../../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
7
|
-
import {
|
|
8
|
-
import { invalidateAllClients as
|
|
9
|
-
import { useEmbedApi as
|
|
10
|
-
import { getAllPagesNextPaginationTokenParam as
|
|
7
|
+
import { withAuthEpochInfinite as a } from "../../../../data-access/dist/lib/withAuthEpoch.js";
|
|
8
|
+
import { invalidateAllClients as o, setAllClientsQueriesData as s } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
9
|
+
import { useEmbedApi as c } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
+
import { getAllPagesNextPaginationTokenParam as l, isAllPagesResolving as u, useAutoFetchNextPage as d } from "../../../../data-access/dist/lib/allPages.js";
|
|
11
11
|
import "../../../../data-access/dist/index.js";
|
|
12
|
-
import { ApprovalPolicyObjectType as
|
|
13
|
-
import { useMemo as
|
|
14
|
-
import { useInfiniteQuery as
|
|
12
|
+
import { ApprovalPolicyObjectType as f, approvalPoliciesInvalidationKey as p } from "./queryKeys.js";
|
|
13
|
+
import { useMemo as m } from "react";
|
|
14
|
+
import { useInfiniteQuery as h, useMutation as g, useQueryClient as _ } from "@tanstack/react-query";
|
|
15
15
|
//#region ../../libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js
|
|
16
|
-
var
|
|
17
|
-
function
|
|
16
|
+
var v = 100;
|
|
17
|
+
function y(e, t, n) {
|
|
18
18
|
let r = (e) => e && n(e);
|
|
19
|
-
e.setQueriesData({ queryKey: t }, r),
|
|
19
|
+
e.setQueriesData({ queryKey: t }, r), s(t, r);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function b(e, t) {
|
|
22
22
|
return {
|
|
23
23
|
...e,
|
|
24
24
|
pages: e.pages.map((e) => ({
|
|
@@ -27,56 +27,55 @@ function x(e, t) {
|
|
|
27
27
|
}))
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
let { client: i, organizationId:
|
|
30
|
+
function x({ objectType: t = f.Payable, enabled: r = !0 } = {}) {
|
|
31
|
+
let { client: i, organizationId: o, widgetToken: s, authEpoch: p, organizationStatus: g } = c(), _ = o, y = !!(_ && s) && r, b = { "x-organization-id": _ ?? "" }, x = { object_type: t }, S = n({
|
|
32
32
|
client: i,
|
|
33
|
-
headers:
|
|
34
|
-
query:
|
|
35
|
-
}),
|
|
36
|
-
|
|
37
|
-
authEpoch:
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
enabled: b,
|
|
33
|
+
headers: b,
|
|
34
|
+
query: x
|
|
35
|
+
}), C = h({
|
|
36
|
+
...a(S.queryKey, {
|
|
37
|
+
authEpoch: p,
|
|
38
|
+
organizationStatus: g
|
|
39
|
+
}, { suffix: ["all"] }),
|
|
40
|
+
enabled: y,
|
|
42
41
|
initialPageParam: void 0,
|
|
43
42
|
queryFn: async ({ signal: t, pageParam: n }) => {
|
|
44
43
|
let { data: r } = await e({
|
|
45
44
|
client: i,
|
|
46
|
-
headers:
|
|
45
|
+
headers: b,
|
|
47
46
|
query: n ? { pagination_token: n } : {
|
|
48
|
-
...
|
|
49
|
-
limit:
|
|
47
|
+
...x,
|
|
48
|
+
limit: v
|
|
50
49
|
},
|
|
51
50
|
signal: t,
|
|
52
51
|
throwOnError: !0
|
|
53
52
|
});
|
|
54
53
|
return r;
|
|
55
54
|
},
|
|
56
|
-
getNextPageParam:
|
|
55
|
+
getNextPageParam: l
|
|
57
56
|
});
|
|
58
|
-
|
|
59
|
-
let
|
|
57
|
+
d(C, y);
|
|
58
|
+
let w = m(() => C.data ? { data: C.data.pages.flatMap((e) => e.data ?? []) } : void 0, [C.data]);
|
|
60
59
|
return {
|
|
61
|
-
...
|
|
62
|
-
data:
|
|
63
|
-
isResolving:
|
|
60
|
+
...C,
|
|
61
|
+
data: w,
|
|
62
|
+
isResolving: u(C)
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
|
-
function
|
|
67
|
-
let { client: t, organizationId: n } =
|
|
68
|
-
return
|
|
65
|
+
function S({ objectType: e = f.Payable } = {}) {
|
|
66
|
+
let { client: t, organizationId: n } = c(), r = _();
|
|
67
|
+
return g({
|
|
69
68
|
...i({
|
|
70
69
|
client: t,
|
|
71
70
|
headers: { "x-organization-id": n ?? "" }
|
|
72
71
|
}),
|
|
73
72
|
onSuccess: async (i) => {
|
|
74
|
-
|
|
73
|
+
y(r, p({
|
|
75
74
|
client: t,
|
|
76
75
|
organizationId: n,
|
|
77
76
|
objectType: e
|
|
78
77
|
}), (e) => {
|
|
79
|
-
if (e.pages.some((e) => e.data?.some((e) => e.id === i.id))) return
|
|
78
|
+
if (e.pages.some((e) => e.data?.some((e) => e.id === i.id))) return b(e, (e) => e.map((e) => e.id === i.id ? i : e));
|
|
80
79
|
let t = e.pages.length - 1;
|
|
81
80
|
return t < 0 ? e : {
|
|
82
81
|
...e,
|
|
@@ -85,7 +84,7 @@ function C({ objectType: e = p.Payable } = {}) {
|
|
|
85
84
|
data: [...e.data ?? [], i]
|
|
86
85
|
} : e)
|
|
87
86
|
};
|
|
88
|
-
}), await
|
|
87
|
+
}), await o(p({
|
|
89
88
|
client: t,
|
|
90
89
|
organizationId: n,
|
|
91
90
|
objectType: e
|
|
@@ -93,19 +92,19 @@ function C({ objectType: e = p.Payable } = {}) {
|
|
|
93
92
|
}
|
|
94
93
|
});
|
|
95
94
|
}
|
|
96
|
-
function
|
|
97
|
-
let { client: t, organizationId: n } =
|
|
98
|
-
return
|
|
95
|
+
function C({ objectType: e = f.Payable } = {}) {
|
|
96
|
+
let { client: t, organizationId: n } = c(), i = _();
|
|
97
|
+
return g({
|
|
99
98
|
...r({
|
|
100
99
|
client: t,
|
|
101
100
|
headers: { "x-organization-id": n ?? "" }
|
|
102
101
|
}),
|
|
103
102
|
onSuccess: async (r) => {
|
|
104
|
-
|
|
103
|
+
y(i, p({
|
|
105
104
|
client: t,
|
|
106
105
|
organizationId: n,
|
|
107
106
|
objectType: e
|
|
108
|
-
}), (e) =>
|
|
107
|
+
}), (e) => b(e, (e) => e.map((e) => e.id === r.id ? r : e))), await o(p({
|
|
109
108
|
client: t,
|
|
110
109
|
organizationId: n,
|
|
111
110
|
objectType: e
|
|
@@ -113,19 +112,19 @@ function w({ objectType: e = p.Payable } = {}) {
|
|
|
113
112
|
}
|
|
114
113
|
});
|
|
115
114
|
}
|
|
116
|
-
function
|
|
117
|
-
let { client: n, organizationId: r } =
|
|
118
|
-
return
|
|
115
|
+
function w({ objectType: e = f.Payable } = {}) {
|
|
116
|
+
let { client: n, organizationId: r } = c(), i = _();
|
|
117
|
+
return g({
|
|
119
118
|
...t({
|
|
120
119
|
client: n,
|
|
121
120
|
headers: { "x-organization-id": r ?? "" }
|
|
122
121
|
}),
|
|
123
122
|
onSuccess: async (t, a) => {
|
|
124
|
-
|
|
123
|
+
y(i, p({
|
|
125
124
|
client: n,
|
|
126
125
|
organizationId: r,
|
|
127
126
|
objectType: e
|
|
128
|
-
}), (e) =>
|
|
127
|
+
}), (e) => b(e, (e) => e.filter((e) => e.id !== a.path.approval_policy_id))), await o(p({
|
|
129
128
|
client: n,
|
|
130
129
|
organizationId: r,
|
|
131
130
|
objectType: e
|
|
@@ -134,4 +133,4 @@ function T({ objectType: e = p.Payable } = {}) {
|
|
|
134
133
|
});
|
|
135
134
|
}
|
|
136
135
|
//#endregion
|
|
137
|
-
export {
|
|
136
|
+
export { w as useDeleteApprovalPoliciesIdMutation, x as useGetApprovalPoliciesQuery, C as usePatchApprovalPoliciesIdMutation, S as usePostApprovalPoliciesMutation };
|
|
@@ -14,7 +14,7 @@ import { useMemo as d } from "react";
|
|
|
14
14
|
import { useMutation as f, useQuery as p } from "@tanstack/react-query";
|
|
15
15
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js
|
|
16
16
|
function m({ enabled: e, ...t } = {}) {
|
|
17
|
-
let { client: n, organizationId: r, widgetToken: o, authEpoch: l,
|
|
17
|
+
let { client: n, organizationId: r, widgetToken: o, authEpoch: l, organizationStatus: u } = s(), d = !!(r && o) && (e === !0 || e === void 0), f = i({
|
|
18
18
|
query: t,
|
|
19
19
|
client: n,
|
|
20
20
|
headers: c(r)
|
|
@@ -22,13 +22,13 @@ function m({ enabled: e, ...t } = {}) {
|
|
|
22
22
|
return p({
|
|
23
23
|
...a(f, {
|
|
24
24
|
authEpoch: l,
|
|
25
|
-
|
|
25
|
+
organizationStatus: u
|
|
26
26
|
}, { carryWithinOrg: !0 }),
|
|
27
27
|
enabled: d
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
function h(e) {
|
|
31
|
-
let { client: t, organizationId: n, widgetToken: i, authEpoch: o,
|
|
31
|
+
let { client: t, organizationId: n, widgetToken: i, authEpoch: o, organizationStatus: l } = s(), u = !!(n && i && e), d = r({
|
|
32
32
|
client: t,
|
|
33
33
|
headers: c(n),
|
|
34
34
|
path: { counterpart_id: e ?? "" }
|
|
@@ -36,7 +36,7 @@ function h(e) {
|
|
|
36
36
|
return p({
|
|
37
37
|
...a(d, {
|
|
38
38
|
authEpoch: o,
|
|
39
|
-
|
|
39
|
+
organizationStatus: l
|
|
40
40
|
}),
|
|
41
41
|
enabled: u
|
|
42
42
|
});
|
|
@@ -13,7 +13,7 @@ import { counterpartBankAccountsInvalidationKey as l, counterpartInvalidationKey
|
|
|
13
13
|
import { useMutation as d, useQuery as f } from "@tanstack/react-query";
|
|
14
14
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js
|
|
15
15
|
function p(e, { enabled: t = !0 } = {}) {
|
|
16
|
-
let { client: n, organizationId: r, widgetToken: o, authEpoch: l,
|
|
16
|
+
let { client: n, organizationId: r, widgetToken: o, authEpoch: l, organizationStatus: u } = s(), d = !!(t && r && o && e), p = i({
|
|
17
17
|
client: n,
|
|
18
18
|
headers: c(r),
|
|
19
19
|
path: { counterpart_id: e ?? "" }
|
|
@@ -21,7 +21,7 @@ function p(e, { enabled: t = !0 } = {}) {
|
|
|
21
21
|
return f({
|
|
22
22
|
...a(p, {
|
|
23
23
|
authEpoch: l,
|
|
24
|
-
|
|
24
|
+
organizationStatus: u
|
|
25
25
|
}),
|
|
26
26
|
enabled: d
|
|
27
27
|
});
|
|
@@ -13,7 +13,7 @@ import { counterpartAddressesInvalidationKey as s, counterpartInvalidationKey as
|
|
|
13
13
|
import { useMutation as l, useQueries as u, useQuery as d } from "@tanstack/react-query";
|
|
14
14
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js
|
|
15
15
|
function f(e) {
|
|
16
|
-
let { client: t, organizationId: i, widgetToken: s, authEpoch: c,
|
|
16
|
+
let { client: t, organizationId: i, widgetToken: s, authEpoch: c, organizationStatus: l } = a(), u = !!(i && s && e), f = n({
|
|
17
17
|
client: t,
|
|
18
18
|
headers: o(i),
|
|
19
19
|
path: { counterpart_id: e ?? "" }
|
|
@@ -21,13 +21,13 @@ function f(e) {
|
|
|
21
21
|
return d({
|
|
22
22
|
...r(f, {
|
|
23
23
|
authEpoch: c,
|
|
24
|
-
|
|
24
|
+
organizationStatus: l
|
|
25
25
|
}),
|
|
26
26
|
enabled: u
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
function p({ counterpartIds: e, enabled: t }) {
|
|
30
|
-
let { client: i, organizationId: s, widgetToken: c, authEpoch: l,
|
|
30
|
+
let { client: i, organizationId: s, widgetToken: c, authEpoch: l, organizationStatus: d } = a(), f = !!(s && c) && e.length > 0 && (t === !0 || t === void 0);
|
|
31
31
|
return u({ queries: e.map((e) => ({
|
|
32
32
|
...r(n({
|
|
33
33
|
client: i,
|
|
@@ -35,7 +35,7 @@ function p({ counterpartIds: e, enabled: t }) {
|
|
|
35
35
|
path: { counterpart_id: e }
|
|
36
36
|
}), {
|
|
37
37
|
authEpoch: l,
|
|
38
|
-
|
|
38
|
+
organizationStatus: d
|
|
39
39
|
}),
|
|
40
40
|
enabled: f && !!e
|
|
41
41
|
})) });
|
|
@@ -7,20 +7,21 @@ import "../../../ui/dist/index.js";
|
|
|
7
7
|
import { useCounterpartSelector as t } from "./useCounterpartSelector.js";
|
|
8
8
|
import { jsx as n } from "react/jsx-runtime";
|
|
9
9
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js
|
|
10
|
-
function r({ value: r, onValueChange: i, mode: a, limit: o, debounceMs: s, disabled: c,
|
|
11
|
-
let
|
|
10
|
+
function r({ value: r, onValueChange: i, mode: a, limit: o, debounceMs: s, disabled: c, invalid: l, onCreateClick: u, labels: d, typeLabels: f }) {
|
|
11
|
+
let p = t({
|
|
12
12
|
value: r,
|
|
13
13
|
onValueChange: i,
|
|
14
14
|
mode: a,
|
|
15
15
|
limit: o,
|
|
16
16
|
debounceMs: s,
|
|
17
|
-
typeLabels:
|
|
17
|
+
typeLabels: f
|
|
18
18
|
});
|
|
19
19
|
return /* @__PURE__ */ n(e, {
|
|
20
|
-
...
|
|
20
|
+
...p,
|
|
21
21
|
disabled: c,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
invalid: l,
|
|
23
|
+
onCreateClick: u,
|
|
24
|
+
labels: d
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
//#endregion
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js
CHANGED
|
@@ -3,23 +3,23 @@ import { COUNTERPART_SELECTOR_LABELS_EN as c } from "./index2.js";
|
|
|
3
3
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
4
4
|
import { PlusIcon as d, RotateCwIcon as f, SearchIcon as p } from "lucide-react";
|
|
5
5
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js
|
|
6
|
-
function m({ value: m, options: h, searchValue: g, isLoading: _, isError: v, disabled: y,
|
|
7
|
-
let
|
|
6
|
+
function m({ value: m, options: h, searchValue: g, isLoading: _, isError: v, disabled: y, invalid: b, onSearchChange: x, onValueChange: S, onRetry: C, onCreateClick: w, labels: T }) {
|
|
7
|
+
let E = {
|
|
8
8
|
...c,
|
|
9
|
-
...
|
|
10
|
-
},
|
|
9
|
+
...T
|
|
10
|
+
}, D = h.length > 0;
|
|
11
11
|
return /* @__PURE__ */ u("div", {
|
|
12
12
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
13
13
|
children: [
|
|
14
14
|
/* @__PURE__ */ u("div", {
|
|
15
15
|
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
|
|
16
|
-
children: [/* @__PURE__ */ l(n, { children:
|
|
16
|
+
children: [/* @__PURE__ */ l(n, { children: E.fieldLabel }), w ? /* @__PURE__ */ u(e, {
|
|
17
17
|
type: "button",
|
|
18
18
|
variant: "ghost",
|
|
19
19
|
size: "sm",
|
|
20
|
-
onClick:
|
|
20
|
+
onClick: w,
|
|
21
21
|
disabled: y,
|
|
22
|
-
children: [/* @__PURE__ */ l(d, { className: "ttw:size-4" }),
|
|
22
|
+
children: [/* @__PURE__ */ l(d, { className: "ttw:size-4" }), E.createButton]
|
|
23
23
|
}) : null]
|
|
24
24
|
}),
|
|
25
25
|
/* @__PURE__ */ u("div", {
|
|
@@ -27,9 +27,9 @@ function m({ value: m, options: h, searchValue: g, isLoading: _, isError: v, dis
|
|
|
27
27
|
children: [/* @__PURE__ */ l(p, { className: "ttw:pointer-events-none ttw:absolute ttw:left-3 ttw:top-1/2 ttw:size-4 ttw:-translate-y-1/2 ttw:text-muted-foreground" }), /* @__PURE__ */ l(t, {
|
|
28
28
|
className: "ttw:pl-9",
|
|
29
29
|
value: g,
|
|
30
|
-
placeholder:
|
|
30
|
+
placeholder: E.searchPlaceholder,
|
|
31
31
|
disabled: y,
|
|
32
|
-
onChange: (e) =>
|
|
32
|
+
onChange: (e) => x(e.target.value),
|
|
33
33
|
onKeyDown: (e) => {
|
|
34
34
|
e.key === "Enter" && e.preventDefault();
|
|
35
35
|
}
|
|
@@ -37,11 +37,12 @@ function m({ value: m, options: h, searchValue: g, isLoading: _, isError: v, dis
|
|
|
37
37
|
}),
|
|
38
38
|
/* @__PURE__ */ u(r, {
|
|
39
39
|
value: m || void 0,
|
|
40
|
-
onValueChange:
|
|
41
|
-
disabled: y || _ || v || !
|
|
40
|
+
onValueChange: S,
|
|
41
|
+
disabled: y || _ || v || !D,
|
|
42
42
|
children: [/* @__PURE__ */ l(o, {
|
|
43
43
|
className: "ttw:w-full",
|
|
44
|
-
|
|
44
|
+
"aria-invalid": b || void 0,
|
|
45
|
+
children: /* @__PURE__ */ l(s, { placeholder: E.selectPlaceholder })
|
|
45
46
|
}), /* @__PURE__ */ l(i, { children: h.map((e) => /* @__PURE__ */ l(a, {
|
|
46
47
|
value: e.value,
|
|
47
48
|
children: /* @__PURE__ */ u("span", {
|
|
@@ -55,22 +56,22 @@ function m({ value: m, options: h, searchValue: g, isLoading: _, isError: v, dis
|
|
|
55
56
|
}),
|
|
56
57
|
_ ? /* @__PURE__ */ l("p", {
|
|
57
58
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
58
|
-
children:
|
|
59
|
+
children: E.loadingText
|
|
59
60
|
}) : v ? /* @__PURE__ */ u("div", {
|
|
60
61
|
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
61
62
|
children: [/* @__PURE__ */ l("p", {
|
|
62
63
|
className: "ttw:text-sm ttw:text-destructive",
|
|
63
|
-
children:
|
|
64
|
-
}),
|
|
64
|
+
children: E.errorText
|
|
65
|
+
}), C ? /* @__PURE__ */ u(e, {
|
|
65
66
|
type: "button",
|
|
66
67
|
variant: "outline",
|
|
67
68
|
size: "sm",
|
|
68
|
-
onClick:
|
|
69
|
-
children: [/* @__PURE__ */ l(f, { className: "ttw:size-4" }),
|
|
69
|
+
onClick: C,
|
|
70
|
+
children: [/* @__PURE__ */ l(f, { className: "ttw:size-4" }), E.retryButton]
|
|
70
71
|
}) : null]
|
|
71
|
-
}) :
|
|
72
|
+
}) : D ? null : /* @__PURE__ */ l("p", {
|
|
72
73
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
73
|
-
children:
|
|
74
|
+
children: E.emptyText
|
|
74
75
|
})
|
|
75
76
|
]
|
|
76
77
|
});
|