@tesouro/embedded-components-react 0.11.65 → 0.11.68
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 +28 -28
- package/dist/index.css +6 -27
- package/dist/index.d.ts +29 -41
- package/dist/lib/CardDetailsWidget.d.ts +1 -1
- package/dist/lib/CounterpartsWidget.d.ts +26 -39
- package/dist/lib/CounterpartsWidgetPublic.d.ts +26 -39
- package/dist/lib/CreditCardsWidget.d.ts +2 -2
- package/dist/lib/CustomersWidget.d.ts +26 -39
- package/dist/lib/DebitCardsWidget.d.ts +2 -2
- package/dist/lib/ReceivablesWidget.d.ts +14 -4
- package/dist/lib/WidgetSuite.d.ts +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +37 -39
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +72 -73
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +16 -22
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +8 -12
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +93 -110
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +52 -52
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +72 -107
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +27 -27
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +112 -145
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +13 -16
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +3 -122
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +44 -65
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +157 -134
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +18 -14
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +362 -55
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +16 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +2 -66
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +48 -46
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +138 -149
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +19 -20
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +21 -27
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index3.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +30 -63
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +0 -211
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -509
|
@@ -3,91 +3,90 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { Alert as e, AlertDescription as t, Badge as n, Button as r, DescriptionList as i, Heading as a, Skeleton as o, cn as s } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { ErrorState as
|
|
8
|
-
import { LoadingRegion as
|
|
9
|
-
import { InlineErrorAlert as
|
|
6
|
+
import { EmptyState as ee } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
7
|
+
import { ErrorState as c } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
8
|
+
import { LoadingRegion as l } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
|
|
9
|
+
import { InlineErrorAlert as u } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
10
10
|
import "../../../../../shared/ui/dist/index.js";
|
|
11
|
-
import { CardDetailsHeader as
|
|
12
|
-
import { CARD_FACE_WIDTH_CLASS_NAME as
|
|
13
|
-
import { CardFace as
|
|
14
|
-
import { resolveCardDetailsPanelLabels as
|
|
15
|
-
import { CardCredentialsFace as
|
|
16
|
-
import { CardFaceFlip as
|
|
17
|
-
import { CopyableValue as
|
|
18
|
-
import { NicknameEditor as
|
|
19
|
-
import { useMemo as
|
|
20
|
-
import { jsx as
|
|
21
|
-
import { CircleAlertIcon as
|
|
11
|
+
import { CardDetailsHeader as d } from "./CardDetailsHeader.js";
|
|
12
|
+
import { CARD_FACE_WIDTH_CLASS_NAME as f } from "./cardFaceSurface.js";
|
|
13
|
+
import { CardFace as te } from "./CardFace.js";
|
|
14
|
+
import { resolveCardDetailsPanelLabels as ne } from "./labels.js";
|
|
15
|
+
import { CardCredentialsFace as re } from "./CardCredentialsFace.js";
|
|
16
|
+
import { CardFaceFlip as ie } from "./CardFaceFlip.js";
|
|
17
|
+
import { CopyableValue as p } from "./CopyableValue.js";
|
|
18
|
+
import { NicknameEditor as ae } from "./NicknameEditor.js";
|
|
19
|
+
import { useMemo as oe } from "react";
|
|
20
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
21
|
+
import { CircleAlertIcon as g, CreditCardIcon as _ } from "lucide-react";
|
|
22
22
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
|
|
23
|
-
function
|
|
24
|
-
let V =
|
|
23
|
+
function v({ labels: v, state: y, nickname: se, statusLabel: ce, statusTone: le, formFactorLabel: ue, cardMenu: de, onClose: fe, cardArtSrc: pe, bankLogoSrc: me, bankLogoAlt: he, cardholderName: ge, maskedCardNumber: _e, cardFaceStatusLabel: ve, billingAddress: b, allowedCategories: x, spendLimitLabels: S, perTransactionMaxLabel: C, onCopy: w, onEditNickname: T, nicknameEditState: E = "closed", nicknameDraft: D, onNicknameDraftChange: O, onSaveNickname: k, onCancelNicknameEdit: A, isNicknameSaveDisabled: j, onActivate: M, onViewCard: N, onHideCard: P, revealState: F = "hidden", revealedCardNumber: ye, revealedExpirationDate: be, revealedSecurityCode: xe, isLocked: I, lockState: L = "idle", onLockCard: R, onUnlockCard: z, onRetry: Se, testIds: B, className: Ce }) {
|
|
24
|
+
let V = oe(() => ne(v), [v]), H = b?.addressLine1, U = b?.addressLine2, W = b?.cityState, G = b?.postalCode, we = !!(H || U || W || G), Te = !!x?.length, Ee = !!S?.length, De = !!C, K = F === "revealed", q = K ? P : N, J = !!(R || z), Y = I ? z : R, Oe = V.fields.copiedLabel, X = [
|
|
25
25
|
H,
|
|
26
26
|
U,
|
|
27
27
|
W,
|
|
28
28
|
G
|
|
29
|
-
].filter((e) => !!e), Z =
|
|
29
|
+
].filter((e) => !!e), Z = we ? [{
|
|
30
30
|
label: V.fields.billingAddress,
|
|
31
|
-
value: /* @__PURE__ */ p
|
|
31
|
+
value: /* @__PURE__ */ m(p, {
|
|
32
32
|
copyLabel: V.fields.copyBillingAddressAriaLabel,
|
|
33
|
-
copiedLabel:
|
|
33
|
+
copiedLabel: Oe,
|
|
34
34
|
onCopy: w ? () => w(X.join("\n")) : void 0,
|
|
35
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ m("span", {
|
|
36
36
|
className: "ttw:flex ttw:flex-col",
|
|
37
|
-
children: X.map((e, t) => /* @__PURE__ */
|
|
37
|
+
children: X.map((e, t) => /* @__PURE__ */ m("span", { children: e }, t))
|
|
38
38
|
})
|
|
39
39
|
})
|
|
40
40
|
}] : [], Q = [
|
|
41
|
-
...
|
|
41
|
+
...Te ? [{
|
|
42
42
|
label: V.fields.allowedCategories,
|
|
43
|
-
value: /* @__PURE__ */
|
|
43
|
+
value: /* @__PURE__ */ m("span", {
|
|
44
44
|
className: "ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
45
|
-
children: x?.map((e) => /* @__PURE__ */
|
|
45
|
+
children: x?.map((e) => /* @__PURE__ */ m(n, {
|
|
46
46
|
tone: "neutral",
|
|
47
47
|
children: e
|
|
48
48
|
}, e))
|
|
49
49
|
})
|
|
50
50
|
}] : [],
|
|
51
|
-
...
|
|
51
|
+
...Ee ? [{
|
|
52
52
|
label: V.fields.spendLimit,
|
|
53
|
-
value: /* @__PURE__ */
|
|
53
|
+
value: /* @__PURE__ */ m("span", {
|
|
54
54
|
className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:tabular-nums",
|
|
55
|
-
children: S?.map((e, t) => /* @__PURE__ */
|
|
55
|
+
children: S?.map((e, t) => /* @__PURE__ */ m("span", { children: e }, `${e}-${t}`))
|
|
56
56
|
})
|
|
57
57
|
}] : [],
|
|
58
|
-
...
|
|
58
|
+
...De ? [{
|
|
59
59
|
label: V.fields.perTransactionMax,
|
|
60
|
-
value: /* @__PURE__ */
|
|
60
|
+
value: /* @__PURE__ */ m("span", {
|
|
61
61
|
className: "ttw:tabular-nums",
|
|
62
62
|
children: C
|
|
63
63
|
})
|
|
64
64
|
}] : []
|
|
65
|
-
], $ = /* @__PURE__ */
|
|
65
|
+
], $ = /* @__PURE__ */ m(te, {
|
|
66
66
|
cardArtSrc: pe,
|
|
67
67
|
bankLogoSrc: me,
|
|
68
68
|
bankLogoAlt: he ?? V.cardFace.bankLogoAlt,
|
|
69
69
|
cardholderName: ge ?? "",
|
|
70
70
|
maskedCardNumber: _e ?? "",
|
|
71
|
-
|
|
72
|
-
statusLabel: ye,
|
|
71
|
+
statusLabel: ve,
|
|
73
72
|
isLocked: I,
|
|
74
73
|
lockedLabel: V.lock.cardFaceLabel,
|
|
75
74
|
testIds: B?.cardFace
|
|
76
75
|
});
|
|
77
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ h("div", {
|
|
78
77
|
"data-testid": B?.root,
|
|
79
|
-
className: s("ttw:@container/card-details ttw:flex ttw:w-full ttw:max-w-[720px] ttw:flex-col",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
78
|
+
className: s("ttw:@container/card-details ttw:flex ttw:w-full ttw:max-w-[720px] ttw:flex-col", Ce),
|
|
79
|
+
children: [/* @__PURE__ */ m(d, {
|
|
81
80
|
testIds: B?.header,
|
|
82
81
|
labels: V.header,
|
|
83
|
-
title:
|
|
84
|
-
isTitlePending:
|
|
85
|
-
statusLabel:
|
|
82
|
+
title: y === "loaded" ? se ?? V.header.untitledCard : void 0,
|
|
83
|
+
isTitlePending: y === "loading",
|
|
84
|
+
statusLabel: y === "loaded" ? ce : void 0,
|
|
86
85
|
statusTone: le,
|
|
87
|
-
formFactorLabel:
|
|
88
|
-
cardMenu:
|
|
86
|
+
formFactorLabel: y === "loaded" ? ue : void 0,
|
|
87
|
+
cardMenu: y === "loaded" ? de : void 0,
|
|
89
88
|
onClose: fe,
|
|
90
|
-
titleAction:
|
|
89
|
+
titleAction: y === "loaded" && T && E === "closed" ? /* @__PURE__ */ m(r, {
|
|
91
90
|
type: "button",
|
|
92
91
|
variant: "link",
|
|
93
92
|
size: "sm",
|
|
@@ -96,27 +95,27 @@ function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le,
|
|
|
96
95
|
onClick: T,
|
|
97
96
|
children: V.nickname.edit
|
|
98
97
|
}) : void 0
|
|
99
|
-
}), /* @__PURE__ */
|
|
98
|
+
}), /* @__PURE__ */ m("div", {
|
|
100
99
|
className: "ttw:px-4 ttw:pb-6 ttw:@md/card-details:px-6",
|
|
101
|
-
children:
|
|
100
|
+
children: y === "loading" ? /* @__PURE__ */ h(l, {
|
|
102
101
|
isLoading: !0,
|
|
103
102
|
loadingLabel: V.status.loadingAriaLabel,
|
|
104
103
|
"data-testid": B?.loading,
|
|
105
104
|
className: "ttw:space-y-4",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
-
}) :
|
|
105
|
+
children: [/* @__PURE__ */ m(o, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ m(o, { className: "ttw:h-64 ttw:w-full ttw:rounded-lg" })]
|
|
106
|
+
}) : y === "error" ? /* @__PURE__ */ m(c, {
|
|
108
107
|
title: V.status.errorTitle,
|
|
109
108
|
description: V.status.errorDescription,
|
|
110
109
|
retryLabel: V.status.errorRetry,
|
|
111
|
-
onRetry:
|
|
112
|
-
}) :
|
|
113
|
-
icon: /* @__PURE__ */
|
|
110
|
+
onRetry: Se
|
|
111
|
+
}) : y === "notFound" ? /* @__PURE__ */ m(ee, {
|
|
112
|
+
icon: /* @__PURE__ */ m(_, {}),
|
|
114
113
|
title: V.status.notFoundTitle,
|
|
115
114
|
description: V.status.notFoundDescription
|
|
116
|
-
}) : /* @__PURE__ */
|
|
115
|
+
}) : /* @__PURE__ */ h("div", {
|
|
117
116
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
118
117
|
children: [
|
|
119
|
-
T && E !== "closed" ? /* @__PURE__ */
|
|
118
|
+
T && E !== "closed" ? /* @__PURE__ */ m(ae, {
|
|
120
119
|
labels: V.nickname,
|
|
121
120
|
editState: E,
|
|
122
121
|
onEdit: T,
|
|
@@ -126,34 +125,34 @@ function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le,
|
|
|
126
125
|
onCancel: A,
|
|
127
126
|
isSaveDisabled: j
|
|
128
127
|
}) : null,
|
|
129
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ h("div", {
|
|
130
129
|
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:@xl/card-details:flex-row ttw:@xl/card-details:items-start",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
130
|
+
children: [/* @__PURE__ */ m("div", {
|
|
132
131
|
className: "ttw:flex ttw:justify-center ttw:rounded-lg ttw:bg-muted ttw:p-4 ttw:@xl/card-details:shrink-0",
|
|
133
|
-
children: /* @__PURE__ */
|
|
134
|
-
className: s("ttw:flex ttw:flex-col ttw:gap-2",
|
|
132
|
+
children: /* @__PURE__ */ h("div", {
|
|
133
|
+
className: s("ttw:flex ttw:flex-col ttw:gap-2", f),
|
|
135
134
|
children: [
|
|
136
|
-
N ? /* @__PURE__ */
|
|
135
|
+
N ? /* @__PURE__ */ m(ie, {
|
|
137
136
|
testIds: B?.cardFaceFlip,
|
|
138
137
|
isFlipped: K,
|
|
139
138
|
front: $,
|
|
140
|
-
back: /* @__PURE__ */
|
|
139
|
+
back: /* @__PURE__ */ m(re, {
|
|
141
140
|
labels: V.credentials,
|
|
142
|
-
cardNumber:
|
|
143
|
-
expirationDate:
|
|
144
|
-
securityCode:
|
|
141
|
+
cardNumber: ye,
|
|
142
|
+
expirationDate: be,
|
|
143
|
+
securityCode: xe,
|
|
145
144
|
isLocked: I,
|
|
146
145
|
onCopy: w,
|
|
147
146
|
testIds: B?.credentialsFace
|
|
148
147
|
})
|
|
149
148
|
}) : $,
|
|
150
|
-
M ? /* @__PURE__ */
|
|
149
|
+
M ? /* @__PURE__ */ m(r, {
|
|
151
150
|
type: "button",
|
|
152
151
|
className: "ttw:mt-2 ttw:w-full",
|
|
153
152
|
onClick: M,
|
|
154
153
|
children: V.actions.activateCard
|
|
155
154
|
}) : null,
|
|
156
|
-
N ? /* @__PURE__ */
|
|
155
|
+
N ? /* @__PURE__ */ m(r, {
|
|
157
156
|
type: "button",
|
|
158
157
|
variant: "ghost",
|
|
159
158
|
className: "ttw:w-full",
|
|
@@ -162,7 +161,7 @@ function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le,
|
|
|
162
161
|
onClick: q,
|
|
163
162
|
children: K ? V.actions.hideCard : V.actions.viewCard
|
|
164
163
|
}) : null,
|
|
165
|
-
J ? /* @__PURE__ */
|
|
164
|
+
J ? /* @__PURE__ */ m(r, {
|
|
166
165
|
type: "button",
|
|
167
166
|
variant: "outline",
|
|
168
167
|
className: "ttw:w-full",
|
|
@@ -171,30 +170,30 @@ function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le,
|
|
|
171
170
|
onClick: Y,
|
|
172
171
|
children: I ? V.lock.unlockCard : V.lock.lockCard
|
|
173
172
|
}) : null,
|
|
174
|
-
I ? /* @__PURE__ */
|
|
173
|
+
I ? /* @__PURE__ */ h(e, {
|
|
175
174
|
variant: "destructive",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ m(g, { "aria-hidden": "true" }), /* @__PURE__ */ m(t, { children: J ? V.lock.lockedDescription : V.lock.lockedDescriptionWithoutUnlock })]
|
|
177
176
|
}) : null,
|
|
178
|
-
L === "errored" ? /* @__PURE__ */
|
|
179
|
-
F === "errored" ? /* @__PURE__ */
|
|
177
|
+
L === "errored" ? /* @__PURE__ */ m(u, { children: V.lock.errorDescription }) : null,
|
|
178
|
+
F === "errored" ? /* @__PURE__ */ m(u, { children: V.credentials.errorDescription }) : null
|
|
180
179
|
]
|
|
181
180
|
})
|
|
182
|
-
}), Z.length > 0 ? /* @__PURE__ */
|
|
181
|
+
}), Z.length > 0 ? /* @__PURE__ */ m("div", {
|
|
183
182
|
className: "ttw:min-w-0 ttw:flex-1",
|
|
184
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ m(i, { items: Z })
|
|
185
184
|
}) : null]
|
|
186
185
|
}),
|
|
187
|
-
Q.length > 0 ? /* @__PURE__ */
|
|
186
|
+
Q.length > 0 ? /* @__PURE__ */ h("section", {
|
|
188
187
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ m(a, {
|
|
190
189
|
variant: "card",
|
|
191
190
|
level: 3,
|
|
192
191
|
children: V.fields.cardControlsHeading
|
|
193
|
-
}), /* @__PURE__ */
|
|
192
|
+
}), /* @__PURE__ */ m(i, { items: Q })]
|
|
194
193
|
}) : null
|
|
195
194
|
]
|
|
196
195
|
})
|
|
197
196
|
})]
|
|
198
197
|
});
|
|
199
198
|
}
|
|
200
|
-
export {
|
|
199
|
+
export { v as CardDetailsPanel };
|
|
@@ -4,13 +4,13 @@ import { CardFaceGlow as r } from "./CardFaceGlow.js";
|
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
import { LockIcon as o } from "lucide-react";
|
|
6
6
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js
|
|
7
|
-
function s({ cardArtSrc: s, bankLogoSrc: c, bankLogoAlt: l, cardholderName: u, maskedCardNumber: d,
|
|
7
|
+
function s({ cardArtSrc: s, bankLogoSrc: c, bankLogoAlt: l, cardholderName: u, maskedCardNumber: d, statusLabel: f, isLocked: p, lockedLabel: m, testIds: h, className: g }) {
|
|
8
8
|
return /* @__PURE__ */ a("div", {
|
|
9
|
-
"data-testid":
|
|
10
|
-
className: e(n, "ttw:justify-between",
|
|
9
|
+
"data-testid": h?.root,
|
|
10
|
+
className: e(n, "ttw:justify-between", g),
|
|
11
11
|
children: [
|
|
12
12
|
s ? /* @__PURE__ */ i("img", {
|
|
13
|
-
"data-testid":
|
|
13
|
+
"data-testid": h?.cardArt,
|
|
14
14
|
src: s,
|
|
15
15
|
alt: "",
|
|
16
16
|
"aria-hidden": "true",
|
|
@@ -25,37 +25,31 @@ function s({ cardArtSrc: s, bankLogoSrc: c, bankLogoAlt: l, cardholderName: u, m
|
|
|
25
25
|
alt: l,
|
|
26
26
|
className: "ttw:relative ttw:h-8 ttw:w-auto ttw:max-w-[60%] ttw:object-contain ttw:object-left"
|
|
27
27
|
}) : /* @__PURE__ */ i("span", { className: "ttw:relative ttw:h-8" }),
|
|
28
|
-
|
|
29
|
-
"data-testid":
|
|
28
|
+
p ? /* @__PURE__ */ i("div", {
|
|
29
|
+
"data-testid": h?.lockedOverlay,
|
|
30
30
|
className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center ttw:bg-black/55",
|
|
31
|
-
children:
|
|
31
|
+
children: m ? /* @__PURE__ */ a("span", {
|
|
32
32
|
className: e(t, "ttw:inline-flex ttw:items-center ttw:gap-1.5"),
|
|
33
33
|
children: [/* @__PURE__ */ i(o, {
|
|
34
34
|
className: "ttw:size-3.5",
|
|
35
35
|
"aria-hidden": "true"
|
|
36
|
-
}),
|
|
36
|
+
}), m]
|
|
37
37
|
}) : null
|
|
38
|
-
}) :
|
|
38
|
+
}) : f ? /* @__PURE__ */ i("div", {
|
|
39
39
|
className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center",
|
|
40
40
|
children: /* @__PURE__ */ i("span", {
|
|
41
41
|
className: t,
|
|
42
|
-
children:
|
|
42
|
+
children: f
|
|
43
43
|
})
|
|
44
44
|
}) : null,
|
|
45
45
|
/* @__PURE__ */ a("div", {
|
|
46
|
-
className: "ttw:relative ttw:
|
|
47
|
-
children: [/* @__PURE__ */
|
|
48
|
-
className: "ttw:
|
|
49
|
-
children:
|
|
50
|
-
className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
|
|
51
|
-
children: u
|
|
52
|
-
}), /* @__PURE__ */ i("p", {
|
|
53
|
-
className: "ttw:mt-1 ttw:truncate ttw:text-lg ttw:tracking-wide ttw:text-white/90",
|
|
54
|
-
children: d
|
|
55
|
-
})]
|
|
46
|
+
className: "ttw:relative ttw:min-w-0",
|
|
47
|
+
children: [/* @__PURE__ */ i("p", {
|
|
48
|
+
className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
|
|
49
|
+
children: u
|
|
56
50
|
}), /* @__PURE__ */ i("p", {
|
|
57
|
-
className: "ttw:
|
|
58
|
-
children:
|
|
51
|
+
className: "ttw:mt-1 ttw:truncate ttw:text-lg ttw:tracking-wide ttw:text-white/90",
|
|
52
|
+
children: d
|
|
59
53
|
})]
|
|
60
54
|
})
|
|
61
55
|
]
|
|
@@ -38,17 +38,13 @@ function p({ counterpartId: p, counterpartType: m, onClose: h, onViewAllDocument
|
|
|
38
38
|
setView: D,
|
|
39
39
|
details: O,
|
|
40
40
|
messages: w
|
|
41
|
-
}), {
|
|
42
|
-
j(), M(),
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
N
|
|
47
|
-
|
|
48
|
-
F !== p && (I(p), P());
|
|
49
|
-
let L = c(() => {
|
|
50
|
-
P(), h();
|
|
51
|
-
}, [P, h]);
|
|
41
|
+
}), { close: j } = A.bank.form, { close: M } = A.del, N = c(() => {
|
|
42
|
+
j(), M(), D("none");
|
|
43
|
+
}, [j, M]), [P, F] = u(p);
|
|
44
|
+
P !== p && (F(p), N());
|
|
45
|
+
let I = c(() => {
|
|
46
|
+
N(), h();
|
|
47
|
+
}, [N, h]);
|
|
52
48
|
return /* @__PURE__ */ d(a, {
|
|
53
49
|
counterpartType: m,
|
|
54
50
|
open: S.canRead && p !== void 0,
|
|
@@ -60,7 +56,7 @@ function p({ counterpartId: p, counterpartType: m, onClose: h, onViewAllDocument
|
|
|
60
56
|
stateOptions: T,
|
|
61
57
|
canEdit: S.canUpdate,
|
|
62
58
|
canDelete: !1,
|
|
63
|
-
onClose:
|
|
59
|
+
onClose: I,
|
|
64
60
|
onViewAllDocuments: g,
|
|
65
61
|
onCreateDocument: _,
|
|
66
62
|
detailsLabels: v,
|
|
@@ -2,135 +2,118 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { CounterpartFormSheet as e } from "../../../../../shared/counterpart-management/ui/dist/index10.js";
|
|
6
|
+
import { BankAccountFormSheet as t } from "../../../../../shared/counterpart-management/ui/dist/index11.js";
|
|
7
|
+
import { ConfirmDeleteDialog as n } from "../../../../../shared/counterpart-management/ui/dist/index13.js";
|
|
8
|
+
import { buildCounterpartFormTaxIdField as r } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
7
9
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { CounterpartDetailsSheet as c } from "../../../../ui/dist/index7.js";
|
|
10
|
+
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as i } from "../../../../ui/dist/index2.js";
|
|
11
|
+
import { CounterpartDetailsSheet as a } from "../../../../ui/dist/index5.js";
|
|
11
12
|
import "../../../../ui/dist/index.js";
|
|
12
|
-
import { useMemo as
|
|
13
|
-
import { Fragment as
|
|
13
|
+
import { useMemo as o } from "react";
|
|
14
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
14
15
|
// ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js
|
|
15
|
-
function
|
|
16
|
-
let { form:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
j.errors,
|
|
24
|
-
j.values,
|
|
25
|
-
V,
|
|
26
|
-
g
|
|
27
|
-
]), G = l(() => h && v ? {
|
|
28
|
-
id: h,
|
|
29
|
-
name: v.name
|
|
30
|
-
} : void 0, [v, h]);
|
|
31
|
-
return /* @__PURE__ */ f(u, { children: [
|
|
32
|
-
/* @__PURE__ */ d(c, {
|
|
33
|
-
open: m,
|
|
16
|
+
function u({ counterpartType: u, open: d, selectedId: f, view: p, details: m, detailsSheetView: h, actions: g, stateOptions: _, canEdit: v, canDelete: y, onClose: b, onViewAllDocuments: x, onCreateDocument: S, formLabels: C, detailsLabels: w, bankAccountLabels: T, deleteLabels: E }) {
|
|
17
|
+
let { form: D, bank: O, del: k } = g, A = !m.isAddressesLoading && !m.isAddressesFetching && !m.isAddressesError, j = !m.isLoading && !m.isFetching && !m.isError, M = A && j, N = !m.isBankAccountsLoading && !m.isBankAccountsFetching && !m.isBankAccountsError, P = p === "edit", F = w?.reloadFailed ?? i.reloadFailed, I = m.isError || m.isAddressesError, L = o(() => f && h ? {
|
|
18
|
+
id: f,
|
|
19
|
+
name: h.name
|
|
20
|
+
} : void 0, [h, f]);
|
|
21
|
+
return /* @__PURE__ */ l(s, { children: [
|
|
22
|
+
/* @__PURE__ */ c(a, {
|
|
23
|
+
open: d && !P,
|
|
34
24
|
onOpenChange: (e) => {
|
|
35
|
-
e ||
|
|
25
|
+
e || b();
|
|
36
26
|
},
|
|
37
|
-
privacyResetKey:
|
|
38
|
-
mode:
|
|
39
|
-
counterpart:
|
|
40
|
-
isLoading:
|
|
41
|
-
isError:
|
|
42
|
-
canEdit:
|
|
43
|
-
canEditProfile:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
onEditBankAccount: M.form.openEdit,
|
|
54
|
-
onViewAllDocuments: w && G ? () => w(G) : void 0,
|
|
55
|
-
onCreateDocument: T && G ? () => T(G) : void 0,
|
|
56
|
-
onDeleteBankAccount: (e) => P.requestDelete({
|
|
27
|
+
privacyResetKey: f,
|
|
28
|
+
mode: u,
|
|
29
|
+
counterpart: h,
|
|
30
|
+
isLoading: m.isLoading,
|
|
31
|
+
isError: m.isError,
|
|
32
|
+
canEdit: v,
|
|
33
|
+
canEditProfile: v && M,
|
|
34
|
+
canEditPaymentMethod: v && N,
|
|
35
|
+
canDelete: y,
|
|
36
|
+
onEdit: g.handleEditProfile,
|
|
37
|
+
onDelete: k.requestDeleteCounterpart,
|
|
38
|
+
onAddBankAccount: O.form.openCreate,
|
|
39
|
+
onEditBankAccount: O.form.openEdit,
|
|
40
|
+
onViewAllDocuments: x && L ? () => x(L) : void 0,
|
|
41
|
+
onCreateDocument: S && L ? () => S(L) : void 0,
|
|
42
|
+
onDeleteBankAccount: (e) => k.requestDelete({
|
|
57
43
|
kind: "bankAccount",
|
|
58
44
|
id: e,
|
|
59
|
-
label:
|
|
45
|
+
label: m.bankItems.find((t) => t.id === e)?.primary ?? ""
|
|
60
46
|
}),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
onFieldChange: (e, t) => j.setValues((r) => ({
|
|
68
|
-
...r,
|
|
69
|
-
[n[e]]: t
|
|
70
|
-
})),
|
|
71
|
-
onRemindersChange: (e) => j.setValues((t) => ({
|
|
72
|
-
...t,
|
|
73
|
-
remindersEnabled: e
|
|
74
|
-
})),
|
|
75
|
-
onAddressChange: (e) => j.setValues((t) => ({
|
|
76
|
-
...t,
|
|
77
|
-
address: {
|
|
78
|
-
...t.address,
|
|
79
|
-
...e
|
|
80
|
-
}
|
|
81
|
-
})),
|
|
82
|
-
onSubmit: j.submit,
|
|
83
|
-
onCancel: j.close
|
|
47
|
+
labels: w
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ c(e, {
|
|
50
|
+
open: d && P,
|
|
51
|
+
onOpenChange: (e) => {
|
|
52
|
+
e || D.close();
|
|
84
53
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
54
|
+
mode: "edit",
|
|
55
|
+
counterpartMode: u,
|
|
56
|
+
values: D.values,
|
|
57
|
+
errors: I ? {
|
|
58
|
+
...D.errors,
|
|
59
|
+
form: F
|
|
60
|
+
} : D.errors,
|
|
61
|
+
stateOptions: _,
|
|
62
|
+
taxIdField: r(D.values.entityType, u, C),
|
|
63
|
+
inProgress: D.isSubmitting,
|
|
64
|
+
onChange: (e) => D.setValues((t) => ({
|
|
65
|
+
...t,
|
|
66
|
+
...e
|
|
67
|
+
})),
|
|
68
|
+
onAddressChange: (e) => D.setValues((t) => ({
|
|
69
|
+
...t,
|
|
70
|
+
address: {
|
|
71
|
+
...t.address,
|
|
96
72
|
...e
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
73
|
+
}
|
|
74
|
+
})),
|
|
75
|
+
onSubmit: () => {
|
|
76
|
+
M && D.submit();
|
|
77
|
+
},
|
|
78
|
+
onCancel: D.close,
|
|
79
|
+
labels: C
|
|
102
80
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
open:
|
|
81
|
+
/* @__PURE__ */ c(t, {
|
|
82
|
+
open: O.form.sheet.open,
|
|
105
83
|
onOpenChange: (e) => {
|
|
106
|
-
e ||
|
|
84
|
+
e || O.form.close();
|
|
107
85
|
},
|
|
108
|
-
mode:
|
|
109
|
-
values:
|
|
110
|
-
errors:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
86
|
+
mode: O.form.sheet.mode,
|
|
87
|
+
values: O.form.values,
|
|
88
|
+
errors: m.isBankAccountsError ? {
|
|
89
|
+
...O.form.errors,
|
|
90
|
+
form: F
|
|
91
|
+
} : O.form.errors,
|
|
92
|
+
highlightedFields: O.highlightedFields,
|
|
93
|
+
inProgress: O.inProgress,
|
|
94
|
+
onChange: (e) => O.form.setValues((t) => ({
|
|
115
95
|
...t,
|
|
116
96
|
...e
|
|
117
97
|
})),
|
|
118
|
-
onSubmit:
|
|
119
|
-
|
|
120
|
-
|
|
98
|
+
onSubmit: () => {
|
|
99
|
+
N && g.submitBankAccount();
|
|
100
|
+
},
|
|
101
|
+
onCancel: O.form.close,
|
|
102
|
+
labels: T
|
|
121
103
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
open:
|
|
104
|
+
/* @__PURE__ */ c(n, {
|
|
105
|
+
open: k.target !== null,
|
|
124
106
|
onOpenChange: (e) => {
|
|
125
|
-
e ||
|
|
107
|
+
e || k.close();
|
|
126
108
|
},
|
|
127
|
-
title:
|
|
128
|
-
message:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
109
|
+
title: k.dialogTitle,
|
|
110
|
+
message: k.dialogMessage,
|
|
111
|
+
confirmLabel: k.confirmLabel,
|
|
112
|
+
isDeleting: k.isDeleting,
|
|
113
|
+
onConfirm: k.confirm,
|
|
114
|
+
onCancel: k.close,
|
|
115
|
+
labels: E
|
|
133
116
|
})
|
|
134
117
|
] });
|
|
135
118
|
}
|
|
136
|
-
export {
|
|
119
|
+
export { u as CounterpartDetailsPanel };
|