@tesouro/embedded-components-react 0.3.12 → 0.3.14
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/dist/index.d.ts +42 -30
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/CardsWidget.d.ts +12 -0
- package/dist/lib/CreateCardWidget.d.ts +12 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +23 -205
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +200 -185
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +199 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +105 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +12 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +46 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +26 -158
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +162 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +32 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +102 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +13 -242
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +247 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +4 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +28 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +76 -137
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +145 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +2 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +45 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +6 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +9 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +14 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +59 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +3 -110
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +107 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +8 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +18 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +92 -173
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +180 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +5 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +6 -112
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +114 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index5.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index5.js +19 -12
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index6.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index4.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index5.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index6.js +22 -37
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +167 -110
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +111 -104
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +144 -128
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +1028 -1019
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js +20 -18
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1,114 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
+
import "../../../shared/data-access/dist/index.js";
|
|
8
|
+
import { EmbeddedToaster as n } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
9
|
+
import "../../../shared/ui/dist/index.js";
|
|
10
|
+
import { useAnalyticsTrack as r } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
11
|
+
import { WidgetProvider as i } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
12
|
+
import { useWidgetConfig as a } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
13
|
+
import "../../../shared/feature/dist/index.js";
|
|
14
|
+
import { BillPayWidgetUi as o } from "../../ui/dist/index44.js";
|
|
15
|
+
import { BillUploadStatusTray as s } from "../../ui/dist/index63.js";
|
|
16
|
+
import "../../ui/dist/index.js";
|
|
17
|
+
import { ApprovalPoliciesSettings as c } from "../../../shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js";
|
|
18
|
+
import "../../../shared/approval-policy/feature/dist/index.js";
|
|
19
|
+
import { useBillUploadQueue as l } from "./index52.js";
|
|
20
|
+
import "./index53.js";
|
|
21
|
+
import { billsTabTestIds as u } from "./index61.js";
|
|
22
|
+
import { BillsTab as d } from "./index63.js";
|
|
23
|
+
import "./index64.js";
|
|
24
|
+
import { BillPayWidgetAnalyticsEvent as f, WIDGET_NAME as p } from "./index47.js";
|
|
25
|
+
import { DEFAULT_TABS_LABELS as m } from "./index65.js";
|
|
26
|
+
import { CounterpartsWidget as h } from "../../../counterparts-widget/feature/dist/index8.js";
|
|
27
|
+
import "../../../counterparts-widget/feature/dist/index.js";
|
|
28
|
+
import { useCallback as g, useEffect as _, useState as v } from "react";
|
|
29
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
30
|
+
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js
|
|
31
|
+
var S = {
|
|
32
|
+
Bills: "bills",
|
|
33
|
+
Vendors: "vendors",
|
|
34
|
+
Settings: "settings"
|
|
35
|
+
}, C = [
|
|
36
|
+
S.Bills,
|
|
37
|
+
S.Vendors,
|
|
38
|
+
S.Settings
|
|
39
|
+
];
|
|
40
|
+
function w({ labels: i, tabsLabels: p, approvalPolicyLabels: w, approvalPolicyComponentLabels: T, vendorLabels: E, poweredByBankName: D }) {
|
|
41
|
+
let O = r();
|
|
42
|
+
_(() => {
|
|
43
|
+
O(f.Mounted);
|
|
44
|
+
}, [O]);
|
|
45
|
+
let k = {
|
|
46
|
+
...m,
|
|
47
|
+
...p
|
|
48
|
+
}, { initResponse: A } = a(), j = e(A?.scopes, [t.ApprovalPolicyWriteOrg]), M = !A || j, [N, P] = v(S.Bills), [F, I] = v(), L = g((e) => {
|
|
49
|
+
P(S.Bills), I(e);
|
|
50
|
+
}, []), R = l({ onOpenBill: L }), z = [{
|
|
51
|
+
id: S.Bills,
|
|
52
|
+
label: k.bills,
|
|
53
|
+
content: /* @__PURE__ */ b(d, {
|
|
54
|
+
onEnqueueFiles: R.enqueue,
|
|
55
|
+
openPayableId: F,
|
|
56
|
+
onOpenPayableHandled: () => I(void 0),
|
|
57
|
+
poweredByBankName: D
|
|
58
|
+
})
|
|
59
|
+
}, {
|
|
60
|
+
id: S.Vendors,
|
|
61
|
+
label: k.vendors,
|
|
62
|
+
content: /* @__PURE__ */ b(h, {
|
|
63
|
+
...E,
|
|
64
|
+
counterpartType: "vendor",
|
|
65
|
+
onViewAllDocuments: () => P(S.Bills)
|
|
66
|
+
})
|
|
67
|
+
}];
|
|
68
|
+
M && z.push({
|
|
69
|
+
id: S.Settings,
|
|
70
|
+
label: k.settings,
|
|
71
|
+
content: /* @__PURE__ */ b(c, {
|
|
72
|
+
labels: w,
|
|
73
|
+
componentLabels: T
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
let B = z.some((e) => e.id === N) ? N : C.find((e) => z.some((t) => t.id === e)) ?? z[0]?.id ?? "";
|
|
77
|
+
return /* @__PURE__ */ x(y, { children: [
|
|
78
|
+
/* @__PURE__ */ b(n, {}),
|
|
79
|
+
/* @__PURE__ */ b(o, {
|
|
80
|
+
labels: i,
|
|
81
|
+
tabs: z,
|
|
82
|
+
selectedTabId: B,
|
|
83
|
+
onTabChange: P
|
|
84
|
+
}),
|
|
85
|
+
R.isVisible ? /* @__PURE__ */ b(s, {
|
|
86
|
+
sections: R.sections,
|
|
87
|
+
summaryLabel: R.summaryLabel,
|
|
88
|
+
collapsed: R.collapsed,
|
|
89
|
+
onToggleCollapsed: R.onToggleCollapsed,
|
|
90
|
+
onClose: R.onClose,
|
|
91
|
+
testId: u.uploadTray
|
|
92
|
+
}) : null
|
|
93
|
+
] });
|
|
94
|
+
}
|
|
95
|
+
function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, ...m }) {
|
|
96
|
+
return /* @__PURE__ */ b(i, {
|
|
97
|
+
widgetName: p,
|
|
98
|
+
baseUrl: e,
|
|
99
|
+
widgetToken: t,
|
|
100
|
+
organizationId: n,
|
|
101
|
+
configClient: r,
|
|
102
|
+
gatewayRouting: a,
|
|
103
|
+
linkComponent: o,
|
|
104
|
+
implementation: s,
|
|
105
|
+
uiFramework: c,
|
|
106
|
+
errorFallback: l,
|
|
107
|
+
onError: u,
|
|
108
|
+
analytics: d,
|
|
109
|
+
disclosuresAcceptance: f,
|
|
110
|
+
children: /* @__PURE__ */ b(w, { ...m })
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { T as BillPayWidgetNative, T as default };
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { Implementation as e } from "../../../shared/feature/dist/lib/WidgetProvider/types.js";
|
|
6
|
-
import { useWidgetConfig as t } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
7
|
-
import "../../../shared/feature/dist/index.js";
|
|
8
|
-
import { BillPayWidgetMonite as n } from "./index47.js";
|
|
9
|
-
import "./index48.js";
|
|
10
|
-
import { BillPayWidgetNative as r } from "./index65.js";
|
|
11
1
|
import "./index66.js";
|
|
12
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
13
|
-
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js
|
|
14
|
-
function a({ implementation: a, ...o }) {
|
|
15
|
-
let s = t().implementation, c = a ?? s ?? e.Monite;
|
|
16
|
-
return c === e.Native ? /* @__PURE__ */ i(r, {
|
|
17
|
-
implementation: c,
|
|
18
|
-
...o
|
|
19
|
-
}) : /* @__PURE__ */ i(n, {
|
|
20
|
-
implementation: c,
|
|
21
|
-
...o
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { a as BillPayWidget, a as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { Implementation as e } from "../../../shared/feature/dist/lib/WidgetProvider/types.js";
|
|
6
|
+
import { useWidgetConfig as t } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
7
|
+
import "../../../shared/feature/dist/index.js";
|
|
8
|
+
import { BillPayWidgetMonite as n } from "./index48.js";
|
|
9
|
+
import "./index49.js";
|
|
10
|
+
import { BillPayWidgetNative as r } from "./index66.js";
|
|
11
|
+
import "./index67.js";
|
|
12
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
13
|
+
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js
|
|
14
|
+
function a({ implementation: a, ...o }) {
|
|
15
|
+
let s = t().implementation, c = a ?? s ?? e.Monite;
|
|
16
|
+
return c === e.Native ? /* @__PURE__ */ i(r, {
|
|
17
|
+
implementation: c,
|
|
18
|
+
...o
|
|
19
|
+
}) : /* @__PURE__ */ i(n, {
|
|
20
|
+
implementation: c,
|
|
21
|
+
...o
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { a as BillPayWidget, a as default };
|
|
@@ -17,7 +17,6 @@ var r = {
|
|
|
17
17
|
}
|
|
18
18
|
}, i = [t.BankAccountReadOrg], a = {
|
|
19
19
|
users: [t.UserReadOrg],
|
|
20
|
-
roles: [t.RoleReadOrg],
|
|
21
20
|
funding: i
|
|
22
21
|
};
|
|
23
22
|
function o({ cardProgram: t, scopes: o }) {
|
|
@@ -27,7 +26,7 @@ function o({ cardProgram: t, scopes: o }) {
|
|
|
27
26
|
canActivate: e(s, c.activate),
|
|
28
27
|
canCreate: e(s, c.create),
|
|
29
28
|
canReadFundingAccounts: t === n.Debit && e(s, i),
|
|
30
|
-
canComposeDebitCreate: t === n.Debit && e(s, a.users) && e(s, a.
|
|
29
|
+
canComposeDebitCreate: t === n.Debit && e(s, a.users) && e(s, a.funding)
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
32
|
//#endregion
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCreateCard as e } from "./index2.js";
|
|
2
2
|
import "./index3.js";
|
|
3
3
|
import { useCreateDebitCardMutation as t } from "./index4.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { useManageDebitCardAccessMutation as n } from "./index5.js";
|
|
5
|
+
import { useCreateCardOrganizationQuery as r } from "./index6.js";
|
|
6
|
+
export { e as useCreateCard, r as useCreateCardOrganizationQuery, t as useCreateDebitCardMutation, n as useManageDebitCardAccessMutation };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index5.js
CHANGED
|
@@ -2,21 +2,28 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { invalidateAllClients as e } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
6
|
+
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
+
import { organizationHeaders as n } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
8
|
+
import { manageDebitCardAccessMutation as r } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
8
9
|
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import {
|
|
10
|
+
import { debitCardsInvalidationKey as i } from "./index3.js";
|
|
11
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
10
12
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index5.js
|
|
11
|
-
function
|
|
12
|
-
let { client:
|
|
13
|
-
client:
|
|
14
|
-
|
|
13
|
+
function o() {
|
|
14
|
+
let { client: o, organizationId: s } = t(), c = n(s), l = r({
|
|
15
|
+
client: o,
|
|
16
|
+
headers: c
|
|
15
17
|
});
|
|
16
|
-
return
|
|
17
|
-
...
|
|
18
|
-
|
|
18
|
+
return a({
|
|
19
|
+
...l,
|
|
20
|
+
onSuccess: async (...t) => {
|
|
21
|
+
await e(i({
|
|
22
|
+
client: o,
|
|
23
|
+
organizationId: s
|
|
24
|
+
})), await l.onSuccess?.(...t);
|
|
25
|
+
}
|
|
19
26
|
});
|
|
20
27
|
}
|
|
21
28
|
//#endregion
|
|
22
|
-
export {
|
|
29
|
+
export { o as useManageDebitCardAccessMutation };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index6.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { getOrganizationOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
7
|
+
import { withAuthEpoch as n } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import { useQuery as r } from "@tanstack/react-query";
|
|
10
|
+
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/data-access/dist/index6.js
|
|
11
|
+
function i({ enabled: i } = {}) {
|
|
12
|
+
let { client: a, organizationId: o, widgetToken: s, authEpoch: c } = e(), l = t({
|
|
13
|
+
client: a,
|
|
14
|
+
path: { organizationId: o ?? "" }
|
|
15
|
+
});
|
|
16
|
+
return r({
|
|
17
|
+
...n(l, c),
|
|
18
|
+
enabled: !!(o && s) && (i === !0 || i === void 0)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { i as useCreateCardOrganizationQuery };
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index4.js
CHANGED
|
@@ -3,7 +3,10 @@ var e = {
|
|
|
3
3
|
toast: {
|
|
4
4
|
creating: "Creating your card…",
|
|
5
5
|
success: "Card created successfully.",
|
|
6
|
-
error: "We could not create this card. Please try again."
|
|
6
|
+
error: "We could not create this card. Please try again.",
|
|
7
|
+
companyAdminAccessWarning: "Card created, but some admins could not be granted access to it.",
|
|
8
|
+
debitCardIssuersError: "We could not load the list of admins to grant access to this card.",
|
|
9
|
+
retry: "Retry"
|
|
7
10
|
},
|
|
8
11
|
untitledFundingAccount: "Bank account",
|
|
9
12
|
success: {
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index6.js
CHANGED
|
@@ -3,50 +3,35 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { Scope as e } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useRolePermissionsQueries as n } from "../../../shared/data-access/dist/lib/role/useRolePermissionsQueries.js";
|
|
8
|
-
import { useAllOrganizationUsersQuery as r } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
6
|
+
import { useAllOrganizationUsersQuery as t } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
9
7
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import { useCallback as
|
|
8
|
+
import { useCallback as n, useMemo as r } from "react";
|
|
11
9
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index6.js
|
|
12
|
-
var
|
|
13
|
-
function
|
|
10
|
+
var i = e.DebitCardReadOrg;
|
|
11
|
+
function a(e) {
|
|
14
12
|
let t = e.name?.trim(), n = e.email?.trim();
|
|
15
13
|
return t && n ? `${t} (${n})` : t || n || e.id;
|
|
16
14
|
}
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
let r = t.get(e.role?.trim().toLowerCase() ?? "");
|
|
26
|
-
return !!(r && n(r.id));
|
|
27
|
-
}).sort((e, t) => e.name.localeCompare(t.name)).map((e) => ({
|
|
28
|
-
value: e.id,
|
|
29
|
-
label: s(e)
|
|
30
|
-
}));
|
|
31
|
-
}, [
|
|
15
|
+
function o({ enabled: e = !0 } = {}) {
|
|
16
|
+
let o = t({
|
|
17
|
+
enabled: e,
|
|
18
|
+
permissions: [i]
|
|
19
|
+
}), s = o.data?.data, c = r(() => !e || o.isResolving ? [] : [...s ?? []].sort((e, t) => e.name.localeCompare(t.name)).map((e) => ({
|
|
20
|
+
value: e.id,
|
|
21
|
+
label: a(e)
|
|
22
|
+
})), [
|
|
32
23
|
e,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
m(), h(), g();
|
|
39
|
-
}, [
|
|
40
|
-
g,
|
|
41
|
-
h,
|
|
42
|
-
m
|
|
43
|
-
]);
|
|
24
|
+
s,
|
|
25
|
+
o.isResolving
|
|
26
|
+
]), l = o.refetch, u = n(() => {
|
|
27
|
+
l();
|
|
28
|
+
}, [l]);
|
|
44
29
|
return {
|
|
45
|
-
options:
|
|
46
|
-
isResolving:
|
|
47
|
-
isError: e &&
|
|
48
|
-
refetch:
|
|
30
|
+
options: c,
|
|
31
|
+
isResolving: e && o.isResolving,
|
|
32
|
+
isError: e && o.isError,
|
|
33
|
+
refetch: u
|
|
49
34
|
};
|
|
50
35
|
}
|
|
51
36
|
//#endregion
|
|
52
|
-
export {
|
|
37
|
+
export { i as CARDHOLDER_PERMISSION_KEY, a as formatCardholderOptionLabel, o as useCreateCardCardholderOptions };
|