@tesouro/embedded-components-react 0.3.42 → 0.3.44
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 +18 -2
- package/dist/experimental/index.d.ts +1 -975
- package/dist/experimental/index.js +0 -6
- package/dist/index.d.ts +1730 -1425
- package/dist/index.js +65 -61
- package/dist/lib/WidgetProvider.js +7 -7
- package/dist/lib/WidgetSuite.d.ts +2081 -0
- package/dist/lib/WidgetSuite.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +60 -60
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankAccountsWidgetUi.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +45 -45
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +118 -118
- 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/index.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index10.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index11.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index12.js +19 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index13.js +16 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index14.js +21 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index15.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +116 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +46 -23
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +20 -88
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +31 -34
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +12 -132
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +11 -137
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index9.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/ui/dist/index3.js +12 -12
- package/package.json +1 -1
- package/dist/experimental/WidgetSuite.d.ts +0 -976
- package/dist/experimental/WidgetSuite.js +0 -6
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { WidgetSuiteShell as e } from "../../ui/dist/index3.js";
|
|
6
|
+
import { SectionPageTitle as t } from "../../ui/dist/index4.js";
|
|
7
|
+
import "../../ui/dist/index.js";
|
|
8
|
+
import { resolveWidgetSuiteLabels as n } from "./index4.js";
|
|
9
|
+
import { WIDGET_SUITE_DEFAULT_SECTIONS as r, WidgetSuiteSectionId as i } from "./index5.js";
|
|
10
|
+
import { WidgetSuiteProvider as a, useWidgetSuiteProvider as o } from "./index6.js";
|
|
11
|
+
import { hasAnyScope as s } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
12
|
+
import "../../../shared/data-access/dist/index.js";
|
|
13
|
+
import { ErrorState as c } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
14
|
+
import "../../../shared/ui/dist/index.js";
|
|
15
|
+
import { useAnalyticsTrack as l } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
16
|
+
import { WidgetProvider as u } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
17
|
+
import { useRefetchWidget as d, useWidgetConfig as f, useWidgetError as p, useWidgetInitStaleForToken as m } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
18
|
+
import "../../../shared/feature/dist/index.js";
|
|
19
|
+
import { WIDGET_SUITE_SECTIONS as h } from "./index15.js";
|
|
20
|
+
import { WIDGET_NAME as g, WidgetSuiteAnalyticsEvent as _ } from "./index2.js";
|
|
21
|
+
import { needsDisclosureAcceptance as v } from "./index3.js";
|
|
22
|
+
import { AcceptDisclosuresWidget as y } from "../../../accept-disclosures-widget/feature/dist/index5.js";
|
|
23
|
+
import "../../../accept-disclosures-widget/feature/dist/index.js";
|
|
24
|
+
import { useCallback as b, useEffect as x, useMemo as S, useState as C } from "react";
|
|
25
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
26
|
+
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js
|
|
27
|
+
var D = {
|
|
28
|
+
initFailed: "widget-suite-init-failed",
|
|
29
|
+
disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed"
|
|
30
|
+
};
|
|
31
|
+
function O({ showSectionTitle: n = !0 }) {
|
|
32
|
+
let { availableSections: r, activeSection: a, labels: s, navigate: l } = o(), { initResponse: u } = f(), g = p(), _ = m(), S = d(), O = b((e) => l(e), [l]), [k, A] = C(!1), j = b(() => A(!0), []), M = v(u), N = s.disclosure;
|
|
33
|
+
x(() => {
|
|
34
|
+
!M && k && A(!1);
|
|
35
|
+
}, [k, M]);
|
|
36
|
+
let P = !!(u && _);
|
|
37
|
+
if (!u && !g || P && !g) return /* @__PURE__ */ T(e, {
|
|
38
|
+
isLoading: !0,
|
|
39
|
+
sections: [],
|
|
40
|
+
selectedSectionId: "",
|
|
41
|
+
onSectionChange: O,
|
|
42
|
+
labels: s.shell
|
|
43
|
+
});
|
|
44
|
+
if ((!u || P) && g) return /* @__PURE__ */ T(c, {
|
|
45
|
+
title: N.initFailedState.title,
|
|
46
|
+
description: N.initFailedState.body,
|
|
47
|
+
retryLabel: N.initFailedState.retryButton,
|
|
48
|
+
onRetry: S,
|
|
49
|
+
testId: D.initFailed
|
|
50
|
+
});
|
|
51
|
+
if (M) return k && g ? /* @__PURE__ */ T(c, {
|
|
52
|
+
title: N.refreshFailedState.title,
|
|
53
|
+
description: N.refreshFailedState.body,
|
|
54
|
+
retryLabel: N.refreshFailedState.retryButton,
|
|
55
|
+
onRetry: S,
|
|
56
|
+
testId: D.disclosuresRefreshFailed
|
|
57
|
+
}) : /* @__PURE__ */ T(y, { onAccepted: j });
|
|
58
|
+
let F = u?.bankName?.trim(), I = F ? s.sectionTitle.bankTagline.replaceAll("{bankName}", F) : void 0, L = r.map((e) => {
|
|
59
|
+
let { Content: r } = h[e], a = s.menu[e], o = e === i.Accounts ? void 0 : I;
|
|
60
|
+
return {
|
|
61
|
+
id: e,
|
|
62
|
+
label: a,
|
|
63
|
+
content: n ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(t, {
|
|
64
|
+
title: a,
|
|
65
|
+
bankTagline: o
|
|
66
|
+
}), /* @__PURE__ */ T(r, {})] }) : /* @__PURE__ */ T(r, {})
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ T(e, {
|
|
70
|
+
sections: L,
|
|
71
|
+
selectedSectionId: a ?? "",
|
|
72
|
+
onSectionChange: O,
|
|
73
|
+
labels: s.shell
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function k({ sections: e = r, section: t, defaultSection: i, onSectionChange: o, labels: c, ...u }) {
|
|
77
|
+
let d = l();
|
|
78
|
+
x(() => {
|
|
79
|
+
d(_.Mounted);
|
|
80
|
+
}, [d]);
|
|
81
|
+
let { initResponse: p } = f(), m = p?.scopes, g = S(() => n(c), [c]), v = e.filter((e) => {
|
|
82
|
+
let t = h[e];
|
|
83
|
+
return !!t && (!t.anyOfScopes || s(m, t.anyOfScopes));
|
|
84
|
+
});
|
|
85
|
+
return /* @__PURE__ */ T(a, {
|
|
86
|
+
sections: e,
|
|
87
|
+
availableSections: v,
|
|
88
|
+
grantedScopes: m,
|
|
89
|
+
labels: g,
|
|
90
|
+
section: t,
|
|
91
|
+
defaultSection: i,
|
|
92
|
+
onSectionChange: o,
|
|
93
|
+
children: /* @__PURE__ */ T(O, { ...u })
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function A({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
|
|
97
|
+
return /* @__PURE__ */ T(u, {
|
|
98
|
+
widgetName: g,
|
|
99
|
+
baseUrl: e,
|
|
100
|
+
widgetToken: t,
|
|
101
|
+
organizationId: n,
|
|
102
|
+
configClient: r,
|
|
103
|
+
gatewayRouting: i,
|
|
104
|
+
linkComponent: a,
|
|
105
|
+
implementation: o,
|
|
106
|
+
uiFramework: s,
|
|
107
|
+
errorFallback: c,
|
|
108
|
+
onError: l,
|
|
109
|
+
analytics: d,
|
|
110
|
+
disclosuresAcceptance: f,
|
|
111
|
+
providerLabels: p,
|
|
112
|
+
children: /* @__PURE__ */ T(k, { ...m })
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
export { D as WIDGET_SUITE_TEST_IDS, A as WidgetSuite, A as default };
|
|
@@ -1,28 +1,51 @@
|
|
|
1
|
+
import { WIDGET_SUITE_SHELL_LABELS_EN as e } from "../../ui/dist/index2.js";
|
|
2
|
+
import "../../ui/dist/index.js";
|
|
1
3
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
debitCards: { title: "Debit cards" },
|
|
14
|
-
expensePlaceholders: { expensesUnavailable: "Expenses are not available in this suite yet." }
|
|
15
|
-
}, r = {
|
|
16
|
-
initFailedState: {
|
|
17
|
-
title: "We couldn't load this page",
|
|
18
|
-
body: "Please try again.",
|
|
19
|
-
retryButton: "Try again"
|
|
4
|
+
var t = {
|
|
5
|
+
shell: e,
|
|
6
|
+
menu: {
|
|
7
|
+
dashboard: "Dashboard",
|
|
8
|
+
accounts: "Accounts",
|
|
9
|
+
cards: "Cards",
|
|
10
|
+
transfers: "Transfers",
|
|
11
|
+
"bill-pay": "Bill Pay",
|
|
12
|
+
invoicing: "Invoicing",
|
|
13
|
+
expenses: "Expenses",
|
|
14
|
+
settings: "Settings"
|
|
20
15
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
sectionTitle: { bankTagline: "Business Banking provided by {bankName}" },
|
|
17
|
+
disclosure: {
|
|
18
|
+
initFailedState: {
|
|
19
|
+
title: "We couldn't load this page",
|
|
20
|
+
body: "Please try again.",
|
|
21
|
+
retryButton: "Try again"
|
|
22
|
+
},
|
|
23
|
+
refreshFailedState: {
|
|
24
|
+
title: "We couldn't finish loading this page",
|
|
25
|
+
body: "Your disclosure acceptance was saved, so you won't need to accept again.",
|
|
26
|
+
retryButton: "Try again"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
sections: {
|
|
30
|
+
dashboard: {},
|
|
31
|
+
cards: {
|
|
32
|
+
creditCards: { labels: { title: "Credit cards" } },
|
|
33
|
+
debitCards: { labels: { title: "Debit cards" } }
|
|
34
|
+
},
|
|
35
|
+
expenses: { expensesUnavailable: "Expenses are not available in this suite yet." }
|
|
25
36
|
}
|
|
26
37
|
};
|
|
38
|
+
function n(e) {
|
|
39
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
40
|
+
}
|
|
41
|
+
function r(e, t) {
|
|
42
|
+
if (!n(e) || !n(t)) return t === void 0 ? e : t;
|
|
43
|
+
let i = { ...e };
|
|
44
|
+
for (let [a, o] of Object.entries(t)) o !== void 0 && (i[a] = n(e[a]) ? r(e[a], o) : o);
|
|
45
|
+
return i;
|
|
46
|
+
}
|
|
47
|
+
function i(e) {
|
|
48
|
+
return r(t, e);
|
|
49
|
+
}
|
|
27
50
|
//#endregion
|
|
28
|
-
export {
|
|
51
|
+
export { t as WIDGET_SUITE_LABELS_EN, i as resolveWidgetSuiteLabels };
|
|
@@ -1,90 +1,22 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { useCallback as e, useMemo as t } from "react";
|
|
6
|
-
import { useControllableState as n } from "@radix-ui/react-use-controllable-state";
|
|
7
1
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
defaultProp: a?.section ?? o[0],
|
|
28
|
-
caller: r
|
|
29
|
-
}), [l, u] = n({
|
|
30
|
-
prop: i?.accounts?.accountId,
|
|
31
|
-
defaultProp: a?.accounts?.accountId ?? null,
|
|
32
|
-
caller: r
|
|
33
|
-
}), [d, f] = n({
|
|
34
|
-
prop: i?.creditCards?.cardId,
|
|
35
|
-
defaultProp: a?.creditCards?.cardId ?? null,
|
|
36
|
-
caller: r
|
|
37
|
-
}), [p, m] = n({
|
|
38
|
-
prop: i?.debitCards?.cardId,
|
|
39
|
-
defaultProp: a?.debitCards?.cardId ?? null,
|
|
40
|
-
caller: r
|
|
41
|
-
}), [h, g] = n({
|
|
42
|
-
prop: i?.creditCards?.pagination,
|
|
43
|
-
defaultProp: a?.creditCards?.pagination,
|
|
44
|
-
caller: r
|
|
45
|
-
}), [_, v] = n({
|
|
46
|
-
prop: i?.debitCards?.pagination,
|
|
47
|
-
defaultProp: a?.debitCards?.pagination,
|
|
48
|
-
caller: r
|
|
49
|
-
}), [y, b] = n({
|
|
50
|
-
prop: i?.settings?.section,
|
|
51
|
-
defaultProp: a?.settings?.section,
|
|
52
|
-
caller: r
|
|
53
|
-
}), x = e((e) => {
|
|
54
|
-
"section" in e && c(e.section), e.accounts && "accountId" in e.accounts && u(e.accounts.accountId ?? null), e.creditCards && ("cardId" in e.creditCards && f(e.creditCards.cardId ?? null), "pagination" in e.creditCards && g(e.creditCards.pagination)), e.debitCards && ("cardId" in e.debitCards && m(e.debitCards.cardId ?? null), "pagination" in e.debitCards && v(e.debitCards.pagination)), e.settings && "section" in e.settings && b(e.settings.section);
|
|
55
|
-
}, [
|
|
56
|
-
u,
|
|
57
|
-
f,
|
|
58
|
-
g,
|
|
59
|
-
m,
|
|
60
|
-
v,
|
|
61
|
-
c,
|
|
62
|
-
b
|
|
63
|
-
]);
|
|
64
|
-
return {
|
|
65
|
-
resolvedSelection: t(() => ({
|
|
66
|
-
section: s,
|
|
67
|
-
accounts: { accountId: l },
|
|
68
|
-
creditCards: {
|
|
69
|
-
cardId: d,
|
|
70
|
-
pagination: h
|
|
71
|
-
},
|
|
72
|
-
debitCards: {
|
|
73
|
-
cardId: p,
|
|
74
|
-
pagination: _
|
|
75
|
-
},
|
|
76
|
-
settings: { section: y }
|
|
77
|
-
}), [
|
|
78
|
-
l,
|
|
79
|
-
d,
|
|
80
|
-
h,
|
|
81
|
-
p,
|
|
82
|
-
_,
|
|
83
|
-
s,
|
|
84
|
-
y
|
|
85
|
-
]),
|
|
86
|
-
applyPatch: x
|
|
87
|
-
};
|
|
88
|
-
}
|
|
2
|
+
var e = {
|
|
3
|
+
Dashboard: "dashboard",
|
|
4
|
+
Accounts: "accounts",
|
|
5
|
+
Cards: "cards",
|
|
6
|
+
Transfers: "transfers",
|
|
7
|
+
BillPay: "bill-pay",
|
|
8
|
+
Invoicing: "invoicing",
|
|
9
|
+
Expenses: "expenses",
|
|
10
|
+
Settings: "settings"
|
|
11
|
+
}, t = [
|
|
12
|
+
e.Dashboard,
|
|
13
|
+
e.Accounts,
|
|
14
|
+
e.Cards,
|
|
15
|
+
e.Transfers,
|
|
16
|
+
e.BillPay,
|
|
17
|
+
e.Invoicing,
|
|
18
|
+
e.Expenses,
|
|
19
|
+
e.Settings
|
|
20
|
+
];
|
|
89
21
|
//#endregion
|
|
90
|
-
export {
|
|
22
|
+
export { t as WIDGET_SUITE_DEFAULT_SECTIONS, e as WidgetSuiteSectionId };
|
|
@@ -2,46 +2,43 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { createContext as
|
|
7
|
-
import { jsx as
|
|
5
|
+
import { WidgetSuiteSectionId as e } from "./index5.js";
|
|
6
|
+
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useState as a } from "react";
|
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
+
import { useControllableState as s } from "@radix-ui/react-use-controllable-state";
|
|
8
9
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
g,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
p
|
|
26
|
-
]);
|
|
27
|
-
return /* @__PURE__ */ a(o.Provider, {
|
|
10
|
+
var c = t(null);
|
|
11
|
+
function l({ sections: t, availableSections: r, grantedScopes: l, labels: u, section: d, defaultSection: f, onSectionChange: p, children: m }) {
|
|
12
|
+
let [h, g] = s({
|
|
13
|
+
prop: d,
|
|
14
|
+
defaultProp: f ?? t[0],
|
|
15
|
+
caller: "WidgetSuite"
|
|
16
|
+
}), _ = h && r.includes(h) ? h : r.at(0), [v, y] = a(null);
|
|
17
|
+
i(() => {
|
|
18
|
+
_ !== e.Accounts && y(null);
|
|
19
|
+
}, [_]);
|
|
20
|
+
let b = n((e) => {
|
|
21
|
+
g(e), p?.(e);
|
|
22
|
+
}, [p, g]), x = n((t) => {
|
|
23
|
+
y(t), g(e.Accounts), p?.(e.Accounts);
|
|
24
|
+
}, [p, g]);
|
|
25
|
+
return /* @__PURE__ */ o(c.Provider, {
|
|
28
26
|
value: {
|
|
29
|
-
availableSections:
|
|
30
|
-
activeSection:
|
|
31
|
-
grantedScopes:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
navigate: _
|
|
27
|
+
availableSections: r,
|
|
28
|
+
activeSection: _,
|
|
29
|
+
grantedScopes: l,
|
|
30
|
+
labels: u,
|
|
31
|
+
arrivingAccountId: v,
|
|
32
|
+
navigate: b,
|
|
33
|
+
openAccount: x
|
|
37
34
|
},
|
|
38
|
-
children:
|
|
35
|
+
children: m
|
|
39
36
|
});
|
|
40
37
|
}
|
|
41
|
-
function
|
|
42
|
-
let e =
|
|
38
|
+
function u() {
|
|
39
|
+
let e = r(c);
|
|
43
40
|
if (!e) throw Error("useWidgetSuiteProvider must be called inside a section rendered by WidgetSuite.");
|
|
44
41
|
return e;
|
|
45
42
|
}
|
|
46
43
|
//#endregion
|
|
47
|
-
export {
|
|
44
|
+
export { l as WidgetSuiteProvider, u as useWidgetSuiteProvider };
|
|
@@ -2,143 +2,23 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { useWidgetSuiteProvider as e } from "./index6.js";
|
|
6
6
|
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
7
7
|
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import "../../../shared/feature/dist/index.js";
|
|
10
|
-
import { BankAccountsWidget as r } from "../../../bank-accounts-widget/feature/dist/index8.js";
|
|
8
|
+
import { BankAccountsWidget as n } from "../../../bank-accounts-widget/feature/dist/index8.js";
|
|
11
9
|
import "../../../bank-accounts-widget/feature/dist/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import "../../../bill-pay-widget/feature/dist/index.js";
|
|
14
|
-
import { CardsWidget as a } from "../../../cards-widget/feature/dist/index9.js";
|
|
15
|
-
import "../../../cards-widget/feature/dist/index.js";
|
|
16
|
-
import { BalancesWidget as o } from "../../../balances-widget/feature/dist/index6.js";
|
|
17
|
-
import "../../../balances-widget/feature/dist/index.js";
|
|
18
|
-
import { InsightsWidget as s } from "../../../insights-widget/feature/dist/index12.js";
|
|
19
|
-
import "../../../insights-widget/feature/dist/index.js";
|
|
20
|
-
import { InvoicingWidget as c } from "../../../invoicing-widget/feature/dist/index3.js";
|
|
21
|
-
import "../../../invoicing-widget/feature/dist/index.js";
|
|
22
|
-
import { SettingsWidget as l } from "../../../settings-widget/feature/dist/index6.js";
|
|
23
|
-
import "../../../settings-widget/feature/dist/index.js";
|
|
24
|
-
import { TransfersWidget as u } from "../../../transfers-widget/feature/dist/index7.js";
|
|
25
|
-
import "../../../transfers-widget/feature/dist/index.js";
|
|
26
|
-
import { useWidgetSuiteProvider as d } from "./index6.js";
|
|
27
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
28
11
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Accounts: "accounts",
|
|
35
|
-
Cards: "cards",
|
|
36
|
-
Transfers: "transfers",
|
|
37
|
-
BillPay: "bill-pay",
|
|
38
|
-
Invoicing: "invoicing",
|
|
39
|
-
Expenses: "expenses",
|
|
40
|
-
Settings: "settings"
|
|
41
|
-
}, g = [
|
|
42
|
-
h.Dashboard,
|
|
43
|
-
h.Accounts,
|
|
44
|
-
h.Cards,
|
|
45
|
-
h.Transfers,
|
|
46
|
-
h.BillPay,
|
|
47
|
-
h.Invoicing,
|
|
48
|
-
h.Expenses,
|
|
49
|
-
h.Settings
|
|
50
|
-
];
|
|
51
|
-
function _() {
|
|
52
|
-
let { grantedScopes: n, availableSections: r, navigate: i } = d(), a = e(n, [t.BankAccountReadOrg]), c = r.includes(h.Accounts), l = r.includes(h.Transfers);
|
|
53
|
-
return /* @__PURE__ */ p("div", {
|
|
54
|
-
className: a ? "ttw:grid ttw:gap-4 ttw:md:grid-cols-2" : "ttw:grid ttw:gap-4",
|
|
55
|
-
children: [a && /* @__PURE__ */ f(o, {
|
|
56
|
-
onViewAllAccountsClick: c ? () => i({ section: h.Accounts }) : void 0,
|
|
57
|
-
onBalanceRowClick: c ? (e) => i({
|
|
58
|
-
section: h.Accounts,
|
|
59
|
-
accounts: { accountId: e }
|
|
60
|
-
}) : void 0
|
|
61
|
-
}), /* @__PURE__ */ f(s, { onLinkExternalAccountClick: l ? () => i({ section: h.Transfers }) : void 0 })]
|
|
12
|
+
function i() {
|
|
13
|
+
let { arrivingAccountId: t, labels: i } = e();
|
|
14
|
+
return /* @__PURE__ */ r(n, {
|
|
15
|
+
defaultSelectedAccountId: t,
|
|
16
|
+
...i.sections.accounts
|
|
62
17
|
});
|
|
63
18
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
selectedAccountId: e.accounts.accountId,
|
|
68
|
-
onSelectedAccountIdChange: (e) => t({ accounts: { accountId: e } })
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function y() {
|
|
72
|
-
let { grantedScopes: r, contentLabels: i, resolvedSelection: o, selection: s, defaultSelection: c, navigate: l } = d();
|
|
73
|
-
return /* @__PURE__ */ p("div", {
|
|
74
|
-
className: "ttw:grid ttw:gap-8",
|
|
75
|
-
children: [e(r, [t.CreditCardReadOrg]) && /* @__PURE__ */ f(a, {
|
|
76
|
-
cardProgram: n.Credit,
|
|
77
|
-
labels: i.creditCards,
|
|
78
|
-
selectedCardId: o.creditCards.cardId,
|
|
79
|
-
onSelectedCardIdChange: (e) => l({ creditCards: { cardId: e } }),
|
|
80
|
-
pagination: s?.creditCards?.pagination,
|
|
81
|
-
defaultPagination: c?.creditCards?.pagination,
|
|
82
|
-
onPaginationChange: (e) => l({ creditCards: { pagination: e } })
|
|
83
|
-
}), e(r, [t.DebitCardReadOrg]) && /* @__PURE__ */ f(a, {
|
|
84
|
-
cardProgram: n.Debit,
|
|
85
|
-
labels: i.debitCards,
|
|
86
|
-
selectedCardId: o.debitCards.cardId,
|
|
87
|
-
onSelectedCardIdChange: (e) => l({ debitCards: { cardId: e } }),
|
|
88
|
-
pagination: s?.debitCards?.pagination,
|
|
89
|
-
defaultPagination: c?.debitCards?.pagination,
|
|
90
|
-
onPaginationChange: (e) => l({ debitCards: { pagination: e } })
|
|
91
|
-
})]
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function b() {
|
|
95
|
-
return /* @__PURE__ */ f(u, {});
|
|
96
|
-
}
|
|
97
|
-
function x() {
|
|
98
|
-
return /* @__PURE__ */ f(i, {});
|
|
99
|
-
}
|
|
100
|
-
function S() {
|
|
101
|
-
return /* @__PURE__ */ f(c, {});
|
|
102
|
-
}
|
|
103
|
-
function C() {
|
|
104
|
-
let { contentLabels: e } = d();
|
|
105
|
-
return /* @__PURE__ */ f(m, { children: e.expensePlaceholders.expensesUnavailable });
|
|
106
|
-
}
|
|
107
|
-
function w() {
|
|
108
|
-
let { selection: e, resolvedSelection: t, navigate: n } = d();
|
|
109
|
-
return /* @__PURE__ */ f(l, {
|
|
110
|
-
selectedSection: e?.settings?.section,
|
|
111
|
-
defaultSelectedSection: t.settings.section,
|
|
112
|
-
onSelectedSectionChange: (e) => n({ settings: { section: e } })
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
var T = {
|
|
116
|
-
[h.Dashboard]: { Content: _ },
|
|
117
|
-
[h.Accounts]: {
|
|
118
|
-
anyOfScopes: [t.BankAccountReadOrg, t.ExternalBankAccountReadOrg],
|
|
119
|
-
Content: v
|
|
120
|
-
},
|
|
121
|
-
[h.Cards]: {
|
|
122
|
-
anyOfScopes: [t.CreditCardReadOrg, t.DebitCardReadOrg],
|
|
123
|
-
Content: y
|
|
124
|
-
},
|
|
125
|
-
[h.Transfers]: {
|
|
126
|
-
anyOfScopes: [t.BankAccountReadOrg],
|
|
127
|
-
Content: b
|
|
128
|
-
},
|
|
129
|
-
[h.BillPay]: {
|
|
130
|
-
anyOfScopes: [t.PayableReadOrg],
|
|
131
|
-
Content: x
|
|
132
|
-
},
|
|
133
|
-
[h.Invoicing]: {
|
|
134
|
-
anyOfScopes: [t.InvoiceReadOrg],
|
|
135
|
-
Content: S
|
|
136
|
-
},
|
|
137
|
-
[h.Expenses]: {
|
|
138
|
-
anyOfScopes: [t.ExpenseReadOrg, t.ExpenseReadSelf],
|
|
139
|
-
Content: C
|
|
140
|
-
},
|
|
141
|
-
[h.Settings]: { Content: w }
|
|
19
|
+
var a = {
|
|
20
|
+
anyOfScopes: [t.BankAccountReadOrg, t.ExternalBankAccountReadOrg],
|
|
21
|
+
Content: i
|
|
142
22
|
};
|
|
143
23
|
//#endregion
|
|
144
|
-
export {
|
|
24
|
+
export { i as AccountsSection, a as accountsSection };
|