@tesouro/embedded-components-react 0.5.260 → 0.5.262
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 +2 -2
- package/dist/index.d.ts +2 -7
- package/dist/lib/ProductsWidget.d.ts +3 -7
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +5 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +5 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js +104 -93
- package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/data-access/dist/index2.js +23 -17
- package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/feature/dist/index3.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/feature/dist/index4.js +53 -60
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +187 -176
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +11 -3
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -491,9 +491,9 @@ Manages an organization's products and services: a filterable, sortable table wi
|
|
|
491
491
|
| Prop | Type | Default | Description |
|
|
492
492
|
| ------------------------- | ---------------------------------------- | ------------------- | --------------------------------------------------- |
|
|
493
493
|
| `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Rows-per-page choices. |
|
|
494
|
-
| `screenLabels` | `
|
|
494
|
+
| `screenLabels` | `PartialDeep<ProductsScreenLabels>` | English labels | Table/header/filter/empty/error copy. |
|
|
495
495
|
| `formLabels` | `Partial<ProductFormSheetLabels>` | English labels | Create/edit form copy. |
|
|
496
|
-
| `detailsLabels` | `
|
|
496
|
+
| `detailsLabels` | `PartialDeep<ProductDetailsSheetLabels>` | English labels | Details sheet copy. |
|
|
497
497
|
| `deleteLabels` | `Partial<ProductDeleteDialogLabels>` | English labels | Product delete confirmation copy. |
|
|
498
498
|
| `measureUnitsLabels` | `Partial<MeasureUnitsManagerLabels>` | English labels | Measure-units manager copy. |
|
|
499
499
|
| `measureUnitDeleteLabels` | `Partial<MeasureUnitDeleteDialogLabels>` | English labels | Measure-unit delete confirmation copy. |
|
package/dist/index.d.ts
CHANGED
|
@@ -5899,11 +5899,6 @@ type MarketingWidgetProps = WidgetProviderProps & InnerProps;
|
|
|
5899
5899
|
*/
|
|
5900
5900
|
declare function MarketingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: MarketingWidgetProps): React.JSX.Element;
|
|
5901
5901
|
|
|
5902
|
-
/**
|
|
5903
|
-
* Co-located user-facing strings for the products widget UI. Each component
|
|
5904
|
-
* takes a `labels?: Partial<…Labels>` prop merged over the matching
|
|
5905
|
-
* `*_LABELS_EN` default.
|
|
5906
|
-
*/
|
|
5907
5902
|
interface ProductTypeBadgeLabels {
|
|
5908
5903
|
product: string;
|
|
5909
5904
|
service: string;
|
|
@@ -5980,9 +5975,9 @@ interface ProductDeleteDialogLabels {
|
|
|
5980
5975
|
|
|
5981
5976
|
interface ProductsWidgetOwnProps {
|
|
5982
5977
|
pageSizeOptions?: number[];
|
|
5983
|
-
screenLabels?:
|
|
5978
|
+
screenLabels?: PartialDeep<ProductsScreenLabels>;
|
|
5984
5979
|
formLabels?: Partial<ProductFormSheetLabels>;
|
|
5985
|
-
detailsLabels?:
|
|
5980
|
+
detailsLabels?: PartialDeep<ProductDetailsSheetLabels>;
|
|
5986
5981
|
deleteLabels?: Partial<ProductDeleteDialogLabels>;
|
|
5987
5982
|
measureUnitsLabels?: Partial<MeasureUnitsManagerLabels>;
|
|
5988
5983
|
measureUnitDeleteLabels?: Partial<MeasureUnitDeleteDialogLabels>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react';
|
|
3
|
+
import { PartialDeep } from 'type-fest';
|
|
3
4
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
5
|
|
|
5
6
|
type AuthToken = string | undefined;
|
|
@@ -716,11 +717,6 @@ interface ProductMessageLabels {
|
|
|
716
717
|
updateMeasureUnitError: string;
|
|
717
718
|
}
|
|
718
719
|
|
|
719
|
-
/**
|
|
720
|
-
* Co-located user-facing strings for the products widget UI. Each component
|
|
721
|
-
* takes a `labels?: Partial<…Labels>` prop merged over the matching
|
|
722
|
-
* `*_LABELS_EN` default.
|
|
723
|
-
*/
|
|
724
720
|
interface ProductTypeBadgeLabels {
|
|
725
721
|
product: string;
|
|
726
722
|
service: string;
|
|
@@ -797,9 +793,9 @@ interface ProductDeleteDialogLabels {
|
|
|
797
793
|
|
|
798
794
|
interface ProductsWidgetOwnProps {
|
|
799
795
|
pageSizeOptions?: number[];
|
|
800
|
-
screenLabels?:
|
|
796
|
+
screenLabels?: PartialDeep<ProductsScreenLabels>;
|
|
801
797
|
formLabels?: Partial<ProductFormSheetLabels>;
|
|
802
|
-
detailsLabels?:
|
|
798
|
+
detailsLabels?: PartialDeep<ProductDetailsSheetLabels>;
|
|
803
799
|
deleteLabels?: Partial<ProductDeleteDialogLabels>;
|
|
804
800
|
measureUnitsLabels?: Partial<MeasureUnitsManagerLabels>;
|
|
805
801
|
measureUnitDeleteLabels?: Partial<MeasureUnitDeleteDialogLabels>;
|
|
@@ -73,7 +73,11 @@ function w({ labels: e, searchValue: t, onSearchChange: u, typeFilter: d, onType
|
|
|
73
73
|
function T({ products: n, isLoading: r, isError: i, sorting: a, onSortingChange: o, pageSize: s, onPageSizeChange: c, pageSizeOptions: l = S, hasNextPage: x, hasPrevPage: C, onNextPage: T, onPrevPage: E, searchValue: D, onSearchChange: O, typeFilter: k, onTypeFilterChange: A, unitFilter: j, onUnitFilterChange: M, unitOptions: N, isFiltering: P, onCreateClick: F, onManageUnitsClick: I, onRowClick: L, onRetry: R, canCreate: z = !0, canManageUnits: B = !0, isAccessRestricted: V, labels: H, testIds: U }) {
|
|
74
74
|
let W = {
|
|
75
75
|
...f,
|
|
76
|
-
...H
|
|
76
|
+
...H,
|
|
77
|
+
typeBadge: {
|
|
78
|
+
...f.typeBadge,
|
|
79
|
+
...H?.typeBadge
|
|
80
|
+
}
|
|
77
81
|
}, G = [
|
|
78
82
|
{
|
|
79
83
|
accessorKey: "name",
|
|
@@ -25,7 +25,11 @@ function C({ label: e, value: t, isLast: n, emptyValue: r = "—" }) {
|
|
|
25
25
|
function w({ open: S, onOpenChange: w, product: T, isLoading: E, isError: D, onEdit: O, onDelete: k, canEdit: A = !0, canDelete: j = !0, labels: M }) {
|
|
26
26
|
let N = {
|
|
27
27
|
...h,
|
|
28
|
-
...M
|
|
28
|
+
...M,
|
|
29
|
+
typeBadge: {
|
|
30
|
+
...h.typeBadge,
|
|
31
|
+
...M?.typeBadge
|
|
32
|
+
}
|
|
29
33
|
}, P = T?.type !== "service", F = P ? N.typeBadge.product : N.typeBadge.service, I = T ? N.subtitle.replace("{type}", F).replace("{createdAt}", T.createdAtLabel) : N.hiddenDescription;
|
|
30
34
|
return /* @__PURE__ */ _(a, {
|
|
31
35
|
open: S,
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/labels.js
CHANGED
|
@@ -6,7 +6,7 @@ var e = { scenarios: {
|
|
|
6
6
|
},
|
|
7
7
|
profile: {
|
|
8
8
|
label: "Profile",
|
|
9
|
-
blurb: "The Profile section: the signed-in user’s name, phone and email, and on the Business tab the company’s legal name, address
|
|
9
|
+
blurb: "The Profile section: the signed-in user’s name, phone and email, and on the Business tab the company’s legal name, address and phone. The line under the card names the bank from init and links to the host’s contact page."
|
|
10
10
|
},
|
|
11
11
|
legal: {
|
|
12
12
|
label: "Legal",
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js
CHANGED
|
@@ -1,56 +1,66 @@
|
|
|
1
1
|
import { Scope as e } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
2
2
|
import "../../../../shared/data-access/dist/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { AN_ORGANIZATION as t, AN_ORGANIZATION_ROLE as n, AN_ORGANIZATION_USER as r, A_DISCLOSURES_SET as i } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
|
|
4
4
|
import { EMPLOYEE_ROLE as a, ENGINEERING as o, HEADQUARTERS as s, REMOTE as c, SALES as l, SAM as u, TEAM as d, teamId as f } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/team.js";
|
|
5
|
-
import {
|
|
6
|
-
import { offsetPage as
|
|
7
|
-
import { SETTINGS_LABELS as
|
|
5
|
+
import { IDENTITY as p, bodyOf as m, endpoint as h, initRoute as g, json as _, noContent as v, problem as y, wait as b } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
|
|
6
|
+
import { offsetPage as x } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/worlds.js";
|
|
7
|
+
import { SETTINGS_LABELS as S } from "./labels.js";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
var C = "Example Bank", w = "https://example.test/support", T = n, E = [T, a], D = {
|
|
10
|
+
id: r.id,
|
|
11
|
+
organizationId: t.id,
|
|
12
|
+
name: r.name,
|
|
13
|
+
email: r.email,
|
|
14
|
+
phoneNumber: "+12175550142",
|
|
15
|
+
isAuthorizedSigner: !0,
|
|
16
|
+
permissions: [],
|
|
17
|
+
role: T.key,
|
|
18
|
+
status: "ACTIVE"
|
|
12
19
|
}, O = {
|
|
20
|
+
...t,
|
|
21
|
+
phoneNumber: "+12175550100"
|
|
22
|
+
}, k = {
|
|
13
23
|
...i,
|
|
14
24
|
accepted: !0,
|
|
15
25
|
disclosures: (i.disclosures ?? []).map((e) => ({
|
|
16
26
|
...e,
|
|
17
27
|
accepted: !0
|
|
18
28
|
}))
|
|
19
|
-
},
|
|
29
|
+
}, A = {
|
|
20
30
|
tokenParam: "PaginationToken",
|
|
21
31
|
next: "nextPaginationToken",
|
|
22
32
|
prev: "prevPaginationToken"
|
|
23
33
|
};
|
|
24
|
-
function
|
|
34
|
+
function j(e, t) {
|
|
25
35
|
let n = t.has("paginationToken") ? {
|
|
26
|
-
...
|
|
36
|
+
...A,
|
|
27
37
|
tokenParam: "paginationToken"
|
|
28
|
-
} :
|
|
29
|
-
return
|
|
38
|
+
} : A;
|
|
39
|
+
return x(e, t, {
|
|
30
40
|
paging: n,
|
|
31
41
|
defaultLimit: 100
|
|
32
42
|
});
|
|
33
43
|
}
|
|
34
|
-
var
|
|
35
|
-
function
|
|
36
|
-
let
|
|
44
|
+
var M = (e) => `${p}${e}`, N = 500;
|
|
45
|
+
function P({ canWrite: e }) {
|
|
46
|
+
let t = d.map((e) => ({ ...e })), n = {
|
|
37
47
|
departments: [o, l].map((e) => ({ ...e })),
|
|
38
48
|
locations: [s, c].map((e) => ({ ...e }))
|
|
39
|
-
},
|
|
49
|
+
}, r = 0, i = {
|
|
40
50
|
departments: "department",
|
|
41
51
|
locations: "location"
|
|
42
|
-
},
|
|
52
|
+
}, a = (e, n) => t.filter((t) => t[i[e]]?.id === n), p = (e) => (t) => ({
|
|
43
53
|
...t,
|
|
44
|
-
memberCount:
|
|
45
|
-
}),
|
|
46
|
-
let
|
|
54
|
+
memberCount: a(e, t.id).length
|
|
55
|
+
}), g = () => y(403, "Forbidden", "This token cannot change the team."), x = (t, n, r) => h(t, M(n), async (t, n) => e ? (await b(N), r(t, n)) : g()), S = (e) => !e || e === "ALL" ? t : t.filter((t) => t.status === e), C = (e) => {
|
|
56
|
+
let s = `/${e}`;
|
|
47
57
|
return [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
let i =
|
|
51
|
-
return i ?
|
|
58
|
+
h("GET", M(s), ({ query: t }) => _(j(n[e].map(p(e)), t))),
|
|
59
|
+
h("GET", M(`${s}/:id`), ({ query: t }, { id: r }) => {
|
|
60
|
+
let i = n[e].find((e) => e.id === r);
|
|
61
|
+
return i ? _({
|
|
52
62
|
...i,
|
|
53
|
-
members:
|
|
63
|
+
members: j(a(e, r).map((e) => ({
|
|
54
64
|
id: e.id,
|
|
55
65
|
name: e.name,
|
|
56
66
|
email: e.email,
|
|
@@ -59,26 +69,26 @@ function N({ canWrite: e }) {
|
|
|
59
69
|
createdDateTime: e.createdDateTime,
|
|
60
70
|
lastLoggedInDateTime: e.lastLoggedInDateTime
|
|
61
71
|
})), t)
|
|
62
|
-
}) :
|
|
72
|
+
}) : y(404, "Not Found", "No such group.");
|
|
63
73
|
}),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
let
|
|
74
|
+
x("POST", s, (t) => {
|
|
75
|
+
r += 1;
|
|
76
|
+
let i = {
|
|
67
77
|
...o,
|
|
68
|
-
id: f(20 +
|
|
69
|
-
name:
|
|
78
|
+
id: f(20 + r),
|
|
79
|
+
name: m(t)?.name ?? "New group",
|
|
70
80
|
memberCount: 0
|
|
71
81
|
};
|
|
72
|
-
return
|
|
82
|
+
return n[e] = [...n[e], i], _(i, 201);
|
|
73
83
|
}),
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
x("PUT", `${s}/:id`, (t, { id: n }) => w(e, t, n)),
|
|
85
|
+
x("DELETE", `${s}/:id`, (r, { id: a }) => (n[e] = n[e].filter((e) => e.id !== a), t = t.map((t) => t[i[e]]?.id === a ? {
|
|
76
86
|
...t,
|
|
77
|
-
[
|
|
78
|
-
} : t),
|
|
79
|
-
|
|
80
|
-
let o =
|
|
81
|
-
return !o || !s?.userIds || (
|
|
87
|
+
[i[e]]: null
|
|
88
|
+
} : t), v())),
|
|
89
|
+
x("POST", `${s}/:id/members`, (r, { id: a }) => {
|
|
90
|
+
let o = n[e].find((e) => e.id === a), s = m(r);
|
|
91
|
+
return !o || !s?.userIds || (t = t.map((t) => {
|
|
82
92
|
if (!s.userIds?.includes(t.id)) return t;
|
|
83
93
|
let n = s.type === "REMOVE" ? null : {
|
|
84
94
|
id: o.id,
|
|
@@ -86,45 +96,45 @@ function N({ canWrite: e }) {
|
|
|
86
96
|
};
|
|
87
97
|
return {
|
|
88
98
|
...t,
|
|
89
|
-
[
|
|
99
|
+
[i[e]]: n
|
|
90
100
|
};
|
|
91
|
-
})),
|
|
101
|
+
})), v();
|
|
92
102
|
})
|
|
93
103
|
];
|
|
94
|
-
},
|
|
95
|
-
let o =
|
|
96
|
-
|
|
104
|
+
}, w = (e, r, a) => {
|
|
105
|
+
let o = m(r)?.name;
|
|
106
|
+
n[e] = n[e].map((e) => e.id === a && o ? {
|
|
97
107
|
...e,
|
|
98
108
|
name: o
|
|
99
|
-
} : e),
|
|
109
|
+
} : e), t = t.map((t) => t[i[e]]?.id === a && o ? {
|
|
100
110
|
...t,
|
|
101
|
-
[
|
|
102
|
-
id:
|
|
111
|
+
[i[e]]: {
|
|
112
|
+
id: a,
|
|
103
113
|
name: o
|
|
104
114
|
}
|
|
105
115
|
} : t);
|
|
106
|
-
let s =
|
|
107
|
-
return s ?
|
|
116
|
+
let s = n[e].find((e) => e.id === a);
|
|
117
|
+
return s ? _(p(e)(s)) : y(404, "Not Found", "");
|
|
108
118
|
};
|
|
109
119
|
return [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
let
|
|
120
|
+
h("GET", M("/users/me"), () => _(D)),
|
|
121
|
+
h("GET", M("/organizations/:id"), () => _(O)),
|
|
122
|
+
h("GET", M("/disclosures"), () => _(k)),
|
|
123
|
+
h("GET", M("/users"), ({ query: e }) => _(j(S(e.get("Status")), e))),
|
|
124
|
+
h("GET", M("/roles"), ({ query: e }) => _(j(E, e))),
|
|
125
|
+
h("GET", M("/roles/:id/permissions"), () => _({ data: [] })),
|
|
126
|
+
x("POST", "/users", (e) => {
|
|
127
|
+
let n = m(e), i = t.find((e) => e.email === n.email), a = i ?? {
|
|
118
128
|
...u,
|
|
119
|
-
id: f(30 + (
|
|
120
|
-
name:
|
|
121
|
-
email:
|
|
122
|
-
jobTitle:
|
|
123
|
-
reportingManagerUserId:
|
|
129
|
+
id: f(30 + (r += 1)),
|
|
130
|
+
name: n.name || "New member",
|
|
131
|
+
email: n.email || "new.member@example.test",
|
|
132
|
+
jobTitle: n.jobTitle ?? null,
|
|
133
|
+
reportingManagerUserId: n.reportingManagerUserId ?? null,
|
|
124
134
|
role: null,
|
|
125
135
|
createdDateTime: (/* @__PURE__ */ new Date()).toISOString()
|
|
126
136
|
};
|
|
127
|
-
return
|
|
137
|
+
return i || (t = [...t, a]), _({
|
|
128
138
|
id: a.id,
|
|
129
139
|
createdAt: a.createdDateTime,
|
|
130
140
|
email: a.email,
|
|
@@ -135,56 +145,57 @@ function N({ canWrite: e }) {
|
|
|
135
145
|
status: a.status
|
|
136
146
|
}, 201);
|
|
137
147
|
}),
|
|
138
|
-
|
|
139
|
-
let r =
|
|
140
|
-
|
|
148
|
+
x("PATCH", "/users/:id", (e, { id: n }) => {
|
|
149
|
+
let r = m(e);
|
|
150
|
+
t = t.map((e) => e.id === n ? {
|
|
141
151
|
...e,
|
|
142
152
|
...r,
|
|
143
|
-
id:
|
|
153
|
+
id: n
|
|
144
154
|
} : e);
|
|
145
|
-
let i =
|
|
146
|
-
return i ?
|
|
155
|
+
let i = t.find((e) => e.id === n);
|
|
156
|
+
return i ? _(i) : y(404, "Not Found", "No such user.");
|
|
147
157
|
}),
|
|
148
|
-
|
|
158
|
+
x("POST", "/users/:id/disable", (e, { id: n }) => (t = t.map((e) => e.id === n ? {
|
|
149
159
|
...e,
|
|
150
160
|
status: "INACTIVE"
|
|
151
|
-
} : e),
|
|
152
|
-
userId:
|
|
161
|
+
} : e), _({
|
|
162
|
+
userId: n,
|
|
153
163
|
isEnabled: !1
|
|
154
164
|
}))),
|
|
155
|
-
|
|
156
|
-
let r = E.find((e) => e.id ===
|
|
157
|
-
return r && i?.userIds && (
|
|
165
|
+
x("POST", "/roles/:id/members", (e, { id: n }) => {
|
|
166
|
+
let r = E.find((e) => e.id === n), i = m(e);
|
|
167
|
+
return r && i?.userIds && (t = t.map((e) => i.userIds?.includes(e.id) ? {
|
|
158
168
|
...e,
|
|
159
169
|
role: i.type === "REMOVE" ? null : r.key
|
|
160
|
-
} : e)),
|
|
170
|
+
} : e)), v();
|
|
161
171
|
}),
|
|
162
|
-
...
|
|
163
|
-
...
|
|
172
|
+
...C("departments"),
|
|
173
|
+
...C("locations")
|
|
164
174
|
];
|
|
165
175
|
}
|
|
166
|
-
var
|
|
176
|
+
var F = [
|
|
167
177
|
e.UserReadOrg,
|
|
168
178
|
e.RoleReadOrg,
|
|
169
|
-
e.UserWriteOrg
|
|
170
|
-
|
|
179
|
+
e.UserWriteOrg,
|
|
180
|
+
e.OrganizationReadOrg
|
|
181
|
+
], I = [e.UserReadOrg, e.RoleReadOrg], L = (t, n, r) => ({
|
|
171
182
|
key: t,
|
|
172
|
-
...
|
|
173
|
-
routes: () => [
|
|
183
|
+
...S.scenarios[t],
|
|
184
|
+
routes: () => [g(n, { bankName: C }), ...P({ canWrite: n.includes(e.UserWriteOrg) })],
|
|
174
185
|
props: {
|
|
175
|
-
profileContactUrl:
|
|
186
|
+
profileContactUrl: w,
|
|
176
187
|
...r
|
|
177
188
|
}
|
|
178
|
-
}),
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
189
|
+
}), R = [
|
|
190
|
+
L("team", F, { defaultSelectedSection: "team" }),
|
|
191
|
+
L("profile", F, { defaultSelectedSection: "profile" }),
|
|
192
|
+
L("legal", F, { defaultSelectedSection: "legal" }),
|
|
193
|
+
L("help", F, {
|
|
183
194
|
defaultSelectedSection: "help",
|
|
184
|
-
helpContactUrl:
|
|
195
|
+
helpContactUrl: w
|
|
185
196
|
}),
|
|
186
|
-
|
|
187
|
-
|
|
197
|
+
L("read-only-team", I, { defaultSelectedSection: "team" }),
|
|
198
|
+
L("no-team", [], { defaultSelectedSection: "team" })
|
|
188
199
|
];
|
|
189
200
|
//#endregion
|
|
190
|
-
export {
|
|
201
|
+
export { R as settingsScenarios };
|
|
@@ -2,27 +2,33 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { withAuthEpoch as
|
|
7
|
-
import { useEmbedApi as
|
|
8
|
-
import { organizationHeaders as
|
|
9
|
-
import { useCurrentUserQuery as i } from "../../../../shared/data-access/dist/lib/useCurrentUserQuery.js";
|
|
5
|
+
import { getMeOptions as e, getOrganizationOptions as t } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
|
+
import { withAuthEpoch as n } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
7
|
+
import { useEmbedApi as r } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { organizationHeaders as i } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
10
9
|
import "../../../../shared/data-access/dist/index.js";
|
|
11
10
|
import { useQuery as a } from "@tanstack/react-query";
|
|
12
11
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/profile/data-access/dist/index2.js
|
|
13
|
-
function o({ enabled: o } = {}) {
|
|
14
|
-
let { client:
|
|
12
|
+
function o({ enabled: o, readOrganization: s = !0 } = {}) {
|
|
13
|
+
let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = r(), p = !!(l && u) && (o === !0 || o === void 0), m = i(l), h = {
|
|
14
|
+
authEpoch: d,
|
|
15
|
+
organizationStatus: f
|
|
16
|
+
};
|
|
15
17
|
return {
|
|
16
|
-
userQuery:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
userQuery: a({
|
|
19
|
+
...n(e({
|
|
20
|
+
client: c,
|
|
21
|
+
headers: m
|
|
22
|
+
}), h),
|
|
23
|
+
enabled: p
|
|
24
|
+
}),
|
|
25
|
+
organizationQuery: a({
|
|
26
|
+
...n(t({
|
|
27
|
+
client: c,
|
|
28
|
+
path: { organizationId: l ?? "" },
|
|
29
|
+
headers: m
|
|
30
|
+
}), h),
|
|
31
|
+
enabled: p && s
|
|
26
32
|
})
|
|
27
33
|
};
|
|
28
34
|
}
|
package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/feature/dist/index4.js
CHANGED
|
@@ -3,120 +3,113 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { formatPhoneDisplay as e } from "../../../../shared/util/dist/lib/formatPhoneDisplay.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
6
|
+
import { hasAnyScope as t } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
+
import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
9
|
+
import { useAnalyticsTrack as r } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
10
|
+
import { WidgetProvider as i } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
11
|
+
import { useWidgetConfig as a } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
12
|
import "../../../../shared/feature/dist/index.js";
|
|
10
|
-
import { DEFAULT_FEATURE_LABELS as
|
|
11
|
-
import { ProfileWidgetAnalyticsEvent as
|
|
12
|
-
import { useProfileQuery as
|
|
13
|
+
import { DEFAULT_FEATURE_LABELS as o } from "./index3.js";
|
|
14
|
+
import { ProfileWidgetAnalyticsEvent as s, WIDGET_NAME as c } from "./index2.js";
|
|
15
|
+
import { useProfileQuery as l } from "../../data-access/dist/index2.js";
|
|
13
16
|
import "../../data-access/dist/index.js";
|
|
14
|
-
import { ProfileCard as
|
|
17
|
+
import { ProfileCard as u } from "../../ui/dist/index3.js";
|
|
15
18
|
import "../../ui/dist/index.js";
|
|
16
|
-
import { useCallback as
|
|
17
|
-
import { jsx as
|
|
19
|
+
import { useCallback as d, useEffect as f, useState as p } from "react";
|
|
20
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
18
21
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/profile/feature/dist/index4.js
|
|
19
|
-
var
|
|
22
|
+
var h = {
|
|
20
23
|
Personal: "personal",
|
|
21
24
|
Business: "business"
|
|
22
25
|
};
|
|
23
|
-
function
|
|
26
|
+
function g(e, t) {
|
|
24
27
|
return e?.trim() ? e : t;
|
|
25
28
|
}
|
|
26
|
-
function
|
|
27
|
-
return [e?.first_name, e?.last_name].filter((e) => !!e?.trim()).join(" ");
|
|
28
|
-
}
|
|
29
|
-
function g(e) {
|
|
29
|
+
function _(e) {
|
|
30
30
|
if (!e) return "";
|
|
31
|
-
let t = [e.
|
|
31
|
+
let t = [e.address1, e.address2].filter((e) => !!e?.trim()).join(" "), n = [e.stateOrProvince, e.postalCode].filter((e) => !!e?.trim()).join(" ");
|
|
32
32
|
return [
|
|
33
33
|
t,
|
|
34
34
|
e.city,
|
|
35
35
|
n
|
|
36
36
|
].filter((e) => !!e?.trim()).join(", ");
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return e ? e.type === "organization" ? e.organization.legal_name : [e.individual.first_name, e.individual.last_name].filter((e) => !!e?.trim()).join(" ") : "";
|
|
40
|
-
}
|
|
41
|
-
function v({ labels: n, featureLabels: o, contactUrl: v }) {
|
|
38
|
+
function v({ labels: i, featureLabels: c, contactUrl: v }) {
|
|
42
39
|
let y = {
|
|
43
|
-
...
|
|
44
|
-
...
|
|
45
|
-
}, b =
|
|
46
|
-
|
|
47
|
-
b(
|
|
40
|
+
...o,
|
|
41
|
+
...c
|
|
42
|
+
}, b = r();
|
|
43
|
+
f(() => {
|
|
44
|
+
b(s.Mounted);
|
|
48
45
|
}, [b]);
|
|
49
|
-
let [x, S] =
|
|
50
|
-
(e ===
|
|
51
|
-
}, []), { initResponse: w } =
|
|
46
|
+
let [x, S] = p(h.Personal), C = d((e) => {
|
|
47
|
+
(e === h.Personal || e === h.Business) && S(e);
|
|
48
|
+
}, []), { initResponse: w } = a(), T = w?.bankName ?? void 0, E = t(w?.scopes, [n.OrganizationReadOrg]), { userQuery: D, organizationQuery: O } = l({ readOrganization: E }), k = D.data, A = O.data, j = !E || x === h.Personal, M = j ? D : O, N = M.isLoading, P = M.isError, F = y.emptyValue, I = g(k?.name, F), L = g(A?.legalName, F), R = j ? [
|
|
52
49
|
{
|
|
53
50
|
label: y.nameLabel,
|
|
54
|
-
value:
|
|
51
|
+
value: I
|
|
55
52
|
},
|
|
56
53
|
{
|
|
57
54
|
label: y.phoneLabel,
|
|
58
|
-
value: e(
|
|
55
|
+
value: e(k?.phoneNumber, F)
|
|
59
56
|
},
|
|
60
57
|
{
|
|
61
58
|
label: y.emailLabel,
|
|
62
|
-
value:
|
|
59
|
+
value: g(k?.email, F)
|
|
63
60
|
}
|
|
64
61
|
] : [
|
|
65
62
|
{
|
|
66
63
|
label: y.legalNameLabel,
|
|
67
|
-
value:
|
|
64
|
+
value: L
|
|
68
65
|
},
|
|
69
66
|
{
|
|
70
67
|
label: y.companyAddressLabel,
|
|
71
|
-
value:
|
|
68
|
+
value: g(_(A?.address), F)
|
|
72
69
|
},
|
|
73
70
|
{
|
|
74
71
|
label: y.companyPhoneLabel,
|
|
75
|
-
value: e(
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
label: y.companyEmailLabel,
|
|
79
|
-
value: m(j?.email, P)
|
|
72
|
+
value: e(A?.phoneNumber, F)
|
|
80
73
|
}
|
|
81
74
|
];
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
labels:
|
|
75
|
+
return /* @__PURE__ */ m(u, {
|
|
76
|
+
labels: i,
|
|
84
77
|
tabs: [{
|
|
85
|
-
id:
|
|
78
|
+
id: h.Personal,
|
|
86
79
|
label: y.personalTab
|
|
87
|
-
}, {
|
|
88
|
-
id:
|
|
80
|
+
}, ...E ? [{
|
|
81
|
+
id: h.Business,
|
|
89
82
|
label: y.businessTab
|
|
90
|
-
}],
|
|
91
|
-
activeTabId:
|
|
83
|
+
}] : []],
|
|
84
|
+
activeTabId: j ? h.Personal : h.Business,
|
|
92
85
|
onTabChange: C,
|
|
93
|
-
bannerTone:
|
|
94
|
-
title:
|
|
86
|
+
bannerTone: j ? "primary" : "secondary",
|
|
87
|
+
title: j ? I : L,
|
|
95
88
|
subtitle: y.subtitle,
|
|
96
89
|
bankName: T,
|
|
97
90
|
contactUrl: v,
|
|
98
|
-
fields:
|
|
99
|
-
isLoading:
|
|
100
|
-
isError:
|
|
91
|
+
fields: R,
|
|
92
|
+
isLoading: N,
|
|
93
|
+
isError: P
|
|
101
94
|
});
|
|
102
95
|
}
|
|
103
|
-
function y({ baseUrl: e, widgetToken: t, organizationId:
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
widgetName:
|
|
96
|
+
function y({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: h, ...g }) {
|
|
97
|
+
return /* @__PURE__ */ m(i, {
|
|
98
|
+
widgetName: c,
|
|
106
99
|
baseUrl: e,
|
|
107
100
|
widgetToken: t,
|
|
108
|
-
organizationId:
|
|
109
|
-
configClient:
|
|
101
|
+
organizationId: n,
|
|
102
|
+
configClient: r,
|
|
110
103
|
gatewayRouting: a,
|
|
111
|
-
linkComponent:
|
|
112
|
-
implementation:
|
|
104
|
+
linkComponent: o,
|
|
105
|
+
implementation: s,
|
|
113
106
|
uiFramework: l,
|
|
114
107
|
errorFallback: u,
|
|
115
108
|
onError: d,
|
|
116
|
-
analytics:
|
|
117
|
-
disclosuresAcceptance:
|
|
109
|
+
analytics: f,
|
|
110
|
+
disclosuresAcceptance: p,
|
|
118
111
|
providerLabels: h,
|
|
119
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ m(v, { ...g })
|
|
120
113
|
});
|
|
121
114
|
}
|
|
122
115
|
//#endregion
|