@tesouro/embedded-components-react 0.11.49 → 0.11.51
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 +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/lib/BillPayWidget.d.ts +10 -0
- package/dist/libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/BalancesWidget.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +99 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +61 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +66 -60
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/WidgetContainer/WidgetContainer.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/WidgetFrame/WidgetFrame.js +19 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -486,6 +486,7 @@ A bill pay widget with Tesouro widget auth and theming: a Bills tab for uploadin
|
|
|
486
486
|
| Prop | Type | Default | Description |
|
|
487
487
|
| ------------------- | ---------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
488
488
|
| `initialTab` | `'bills' \| 'vendors'` | `'bills'` | Tab to open on initial mount. |
|
|
489
|
+
| `initialView` | `'create'` | `undefined` | Opens the Bills tab's "Add a bill" dialog once on arrival, when the user can create bills. Closing it does not reopen it. Ignored when `initialTab` is `'vendors'`. |
|
|
489
490
|
| `poweredByBankName` | `string` | `undefined` | Bank shown as "Powered by {bank}" next to the source account when paying a bill. Omit it to hide the badge. |
|
|
490
491
|
| `onSettingsClick` | `() => void` | `undefined` | Opens your bill pay settings surface from a cog beside the bill list's "Add bill" button. The cog renders only when this is supplied and the user's scopes reach that surface. |
|
|
491
492
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5233,6 +5233,16 @@ type BillPayWidgetTabId = (typeof TabId)[keyof typeof TabId];
|
|
|
5233
5233
|
interface BillPayWidgetProps extends WidgetProviderProps {
|
|
5234
5234
|
/** Tab to open on initial mount. */
|
|
5235
5235
|
initialTab?: BillPayWidgetTabId;
|
|
5236
|
+
/**
|
|
5237
|
+
* Opens the Bills tab's Add a bill dialog on arrival, for a host deep link
|
|
5238
|
+
* such as `?create=1` (EMBD-7011). Named like `ReceivablesWidget`'s
|
|
5239
|
+
* `initialView`. Read once, when the user's scopes first resolve: a user
|
|
5240
|
+
* without bill-create permission, or an `initialTab` of `vendors`, lands on
|
|
5241
|
+
* the tab with nothing open. Not controlled, so closing the dialog does not
|
|
5242
|
+
* reopen it. The widget reads no router, so whether the URL keeps the
|
|
5243
|
+
* param is the host's call.
|
|
5244
|
+
*/
|
|
5245
|
+
initialView?: 'create';
|
|
5236
5246
|
/** Bank shown as "Powered by {bank}" next to the source account when paying; omitted hides the badge. */
|
|
5237
5247
|
poweredByBankName?: string;
|
|
5238
5248
|
/**
|
|
@@ -614,6 +614,16 @@ type BillPayWidgetTabId = (typeof TabId)[keyof typeof TabId];
|
|
|
614
614
|
interface BillPayWidgetProps extends WidgetProviderProps {
|
|
615
615
|
/** Tab to open on initial mount. */
|
|
616
616
|
initialTab?: BillPayWidgetTabId;
|
|
617
|
+
/**
|
|
618
|
+
* Opens the Bills tab's Add a bill dialog on arrival, for a host deep link
|
|
619
|
+
* such as `?create=1` (EMBD-7011). Named like `ReceivablesWidget`'s
|
|
620
|
+
* `initialView`. Read once, when the user's scopes first resolve: a user
|
|
621
|
+
* without bill-create permission, or an `initialTab` of `vendors`, lands on
|
|
622
|
+
* the tab with nothing open. Not controlled, so closing the dialog does not
|
|
623
|
+
* reopen it. The widget reads no router, so whether the URL keeps the
|
|
624
|
+
* param is the host's call.
|
|
625
|
+
*/
|
|
626
|
+
initialView?: 'create';
|
|
617
627
|
/** Bank shown as "Powered by {bank}" next to the source account when paying; omitted hides the badge. */
|
|
618
628
|
poweredByBankName?: string;
|
|
619
629
|
/**
|
|
@@ -16,7 +16,6 @@ var _ = ({ accountRows: _, children: v, isLoading: y, isError: b, onRetry: x, to
|
|
|
16
16
|
return /* @__PURE__ */ f(s, {
|
|
17
17
|
icon: /* @__PURE__ */ f(g, {}),
|
|
18
18
|
title: k.widgetTitle,
|
|
19
|
-
showHeaderDivider: !1,
|
|
20
19
|
children: y ? /* @__PURE__ */ f(u, {
|
|
21
20
|
isLoading: !0,
|
|
22
21
|
loadingLabel: k.loadingLabel,
|
|
@@ -73,10 +73,10 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
|
|
|
73
73
|
...g?.queueEmptyStates?.[t]
|
|
74
74
|
}
|
|
75
75
|
}), {})
|
|
76
|
-
}), [g]), [he, S] = p(!1), [C, w] = p(s.AllBills), { initResponse: T } = te(), E = ne(),
|
|
76
|
+
}), [g]), [he, S] = p(!1), [C, w] = p(s.AllBills), { initResponse: T } = te(), E = ne(), ge = t(T?.scopes, [n.PayableReadOrg]), D = t(T?.scopes, [n.PayableWriteOrg]), O = !T || ge, k = !T || D, A = T && !E ? t(T.scopes, [n.PayablePayOrg]) : void 0, j = t(T?.scopes, [n.CounterpartReadOrg]), M = g?.screen?.statusBadge, N = f(() => ({
|
|
77
77
|
...re,
|
|
78
|
-
...
|
|
79
|
-
}), [
|
|
78
|
+
...M
|
|
79
|
+
}), [M]), P = f(() => ({
|
|
80
80
|
menuTrigger: x.duplicateMenuTrigger,
|
|
81
81
|
notDuplicateAction: x.duplicateNotDuplicateAction,
|
|
82
82
|
notDuplicateConfirmTitle: x.duplicateNotDuplicateConfirmTitle,
|
|
@@ -106,7 +106,7 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
|
|
|
106
106
|
showMore: x.duplicateShowMore,
|
|
107
107
|
showLess: x.duplicateShowLess,
|
|
108
108
|
statusSummary: x.duplicateStatusSummary,
|
|
109
|
-
statusLabels:
|
|
109
|
+
statusLabels: N,
|
|
110
110
|
pageInfo: x.duplicatePageInfo
|
|
111
111
|
}), [
|
|
112
112
|
x.duplicateMenuTrigger,
|
|
@@ -138,155 +138,158 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
|
|
|
138
138
|
x.duplicateShowMore,
|
|
139
139
|
x.duplicateShowLess,
|
|
140
140
|
x.duplicateStatusSummary,
|
|
141
|
-
|
|
141
|
+
N,
|
|
142
142
|
x.duplicatePageInfo
|
|
143
|
-
]),
|
|
143
|
+
]), F = t(T?.scopes, [n.MailboxReadOrg]), { mailboxAddress: I } = ee({
|
|
144
144
|
relatedObjectType: "payable",
|
|
145
|
-
enabled:
|
|
146
|
-
}),
|
|
147
|
-
enabled:
|
|
148
|
-
canPay:
|
|
149
|
-
canReadVendors:
|
|
145
|
+
enabled: F && !E
|
|
146
|
+
}), L = F ? I : void 0, R = c({
|
|
147
|
+
enabled: O,
|
|
148
|
+
canPay: A,
|
|
149
|
+
canReadVendors: j,
|
|
150
150
|
isVendorFilterPaused: E,
|
|
151
151
|
filterLabels: x.filters,
|
|
152
152
|
onOpenBill: _ ?? fe,
|
|
153
153
|
duplicateRowNote: x.duplicateRowNote,
|
|
154
154
|
attachmentLabel: x.attachmentIndicator,
|
|
155
|
-
duplicateGroupLabels:
|
|
156
|
-
canManageDuplicates:
|
|
155
|
+
duplicateGroupLabels: P,
|
|
156
|
+
canManageDuplicates: k,
|
|
157
157
|
duplicateView: C,
|
|
158
158
|
scheduledRelativeDayLabels: x.scheduledRelativeDay
|
|
159
|
-
}),
|
|
160
|
-
enabled:
|
|
161
|
-
canPay:
|
|
162
|
-
}),
|
|
159
|
+
}), z = l({ enabled: O }), B = C === s.PossibleDuplicates, _e = se(z, x), V = le({
|
|
160
|
+
enabled: O,
|
|
161
|
+
canPay: A
|
|
162
|
+
}), H = !z.isError && z.count > 0, ve = f(() => [...i.map((e) => ({
|
|
163
163
|
id: e,
|
|
164
164
|
label: x.queues[e],
|
|
165
|
-
badge: u(
|
|
165
|
+
badge: u(V[e])
|
|
166
166
|
})), {
|
|
167
167
|
id: a,
|
|
168
168
|
label: x.duplicatesTab,
|
|
169
|
-
badge:
|
|
170
|
-
tone:
|
|
169
|
+
badge: z.isError ? void 0 : u(z.count),
|
|
170
|
+
tone: H ? "warning" : void 0,
|
|
171
171
|
startsGroup: !0
|
|
172
172
|
}], [
|
|
173
173
|
x.queues,
|
|
174
174
|
x.duplicatesTab,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
]), { clearQueryConstraints:
|
|
180
|
-
|
|
181
|
-
}, [
|
|
182
|
-
e === "duplicates" ?
|
|
183
|
-
}, [
|
|
184
|
-
...
|
|
175
|
+
V,
|
|
176
|
+
z.isError,
|
|
177
|
+
z.count,
|
|
178
|
+
H
|
|
179
|
+
]), { clearQueryConstraints: U, onFilterTabChange: W } = R, G = d(() => {
|
|
180
|
+
U(), w(s.PossibleDuplicates);
|
|
181
|
+
}, [U]), K = d((e) => {
|
|
182
|
+
e === "duplicates" ? G() : (w(s.AllBills), W(e));
|
|
183
|
+
}, [W, G]), q = g?.screen, ye = f(() => ({
|
|
184
|
+
...q,
|
|
185
185
|
createButton: x.createButton,
|
|
186
186
|
settingsButton: x.settingsButton,
|
|
187
187
|
addBill: {
|
|
188
|
-
...
|
|
188
|
+
...q?.addBill,
|
|
189
189
|
heading: x.nonEmptyHeading
|
|
190
190
|
},
|
|
191
|
-
...
|
|
191
|
+
...B ? {
|
|
192
192
|
columnAddedOn: x.duplicateColumnCreated,
|
|
193
193
|
columnAmountDue: x.duplicateColumnAmount
|
|
194
194
|
} : {}
|
|
195
195
|
}), [
|
|
196
|
-
|
|
196
|
+
B,
|
|
197
197
|
x.duplicateColumnCreated,
|
|
198
198
|
x.duplicateColumnAmount,
|
|
199
|
-
|
|
199
|
+
q,
|
|
200
200
|
x.createButton,
|
|
201
201
|
x.settingsButton,
|
|
202
202
|
x.nonEmptyHeading
|
|
203
|
-
]),
|
|
204
|
-
...
|
|
203
|
+
]), be = f(() => ({
|
|
204
|
+
...R.filterBarProps,
|
|
205
205
|
labels: x.filterBar
|
|
206
|
-
}), [
|
|
206
|
+
}), [R.filterBarProps, x.filterBar]), J = () => {
|
|
207
207
|
S(!1), v?.();
|
|
208
|
-
},
|
|
208
|
+
}, Y = (e) => {
|
|
209
209
|
S(!1), y?.(e);
|
|
210
|
-
},
|
|
211
|
-
emailAddress:
|
|
210
|
+
}, X = L ? {
|
|
211
|
+
emailAddress: L,
|
|
212
212
|
onCopyEmail: async () => {
|
|
213
|
-
|
|
213
|
+
L && (await oe(L) ? e.success(x.emailCopiedToast) : e.error(x.emailCopyFailedToast));
|
|
214
214
|
}
|
|
215
215
|
} : {
|
|
216
216
|
emailAddress: void 0,
|
|
217
217
|
onCopyEmail: void 0
|
|
218
|
-
}, { showVendorBills:
|
|
219
|
-
w(s.AllBills),
|
|
220
|
-
}, [
|
|
221
|
-
return ue(me, () => ({
|
|
218
|
+
}, { showVendorBills: Z } = R, Q = d((e) => {
|
|
219
|
+
w(s.AllBills), Z(e);
|
|
220
|
+
}, [Z]), $ = d(() => S(!0), []);
|
|
221
|
+
return ue(me, () => ({
|
|
222
|
+
showVendorBills: Q,
|
|
223
|
+
openAddBill: $
|
|
224
|
+
}), [Q, $]), /* @__PURE__ */ de(m, { children: [
|
|
222
225
|
/* @__PURE__ */ h(ae, {
|
|
223
|
-
rows:
|
|
224
|
-
isLoading:
|
|
225
|
-
isError:
|
|
226
|
-
onRetry:
|
|
227
|
-
sorting:
|
|
228
|
-
onSortingChange:
|
|
229
|
-
pageSize:
|
|
230
|
-
onPageSizeChange:
|
|
231
|
-
pageSizeOptions:
|
|
232
|
-
hasNextPage:
|
|
233
|
-
hasPrevPage:
|
|
234
|
-
onNextPage:
|
|
235
|
-
onPrevPage:
|
|
236
|
-
filterTabs:
|
|
237
|
-
selectedFilterTabId:
|
|
238
|
-
onFilterTabChange:
|
|
239
|
-
searchValue:
|
|
240
|
-
onSearchChange:
|
|
241
|
-
filters:
|
|
242
|
-
visibleColumns:
|
|
243
|
-
keepsColumnOrder:
|
|
244
|
-
isSortable:
|
|
245
|
-
pageInfo:
|
|
226
|
+
rows: R.rows,
|
|
227
|
+
isLoading: R.isLoading || !T,
|
|
228
|
+
isError: R.isError,
|
|
229
|
+
onRetry: R.onRetry,
|
|
230
|
+
sorting: R.sorting,
|
|
231
|
+
onSortingChange: R.onSortingChange,
|
|
232
|
+
pageSize: R.pageSize,
|
|
233
|
+
onPageSizeChange: R.onPageSizeChange,
|
|
234
|
+
pageSizeOptions: R.pageSizeOptions,
|
|
235
|
+
hasNextPage: R.hasNextPage,
|
|
236
|
+
hasPrevPage: R.hasPrevPage,
|
|
237
|
+
onNextPage: R.onNextPage,
|
|
238
|
+
onPrevPage: R.onPrevPage,
|
|
239
|
+
filterTabs: ve,
|
|
240
|
+
selectedFilterTabId: B ? a : R.selectedFilterTabId,
|
|
241
|
+
onFilterTabChange: K,
|
|
242
|
+
searchValue: R.searchValue,
|
|
243
|
+
onSearchChange: R.onSearchChange,
|
|
244
|
+
filters: be,
|
|
245
|
+
visibleColumns: R.visibleColumns,
|
|
246
|
+
keepsColumnOrder: R.keepsColumnOrder,
|
|
247
|
+
isSortable: R.isSortable,
|
|
248
|
+
pageInfo: R.pageInfo,
|
|
246
249
|
cellTestIds: ce,
|
|
247
|
-
isSearchActive:
|
|
248
|
-
showAddPanelWhenEmpty:
|
|
249
|
-
emptyState:
|
|
250
|
-
onCreateClick:
|
|
250
|
+
isSearchActive: R.isSearchActive,
|
|
251
|
+
showAddPanelWhenEmpty: R.showAddPanelWhenEmpty,
|
|
252
|
+
emptyState: B ? x.duplicatesEmptyState : x.queueEmptyStates[R.selectedFilterTabId],
|
|
253
|
+
onCreateClick: k ? () => S(!0) : void 0,
|
|
251
254
|
onSettingsClick: pe,
|
|
252
|
-
onEnterManually:
|
|
253
|
-
onFilesSelected:
|
|
255
|
+
onEnterManually: k ? J : void 0,
|
|
256
|
+
onFilesSelected: k ? Y : void 0,
|
|
254
257
|
maxFiles: b,
|
|
255
|
-
...
|
|
256
|
-
duplicateWarning:
|
|
257
|
-
duplicateReviewControl:
|
|
258
|
+
...X,
|
|
259
|
+
duplicateWarning: _e,
|
|
260
|
+
duplicateReviewControl: B ? void 0 : {
|
|
258
261
|
reviewLabel: x.duplicateReviewButton,
|
|
259
|
-
onReview:
|
|
262
|
+
onReview: G
|
|
260
263
|
},
|
|
261
|
-
labels:
|
|
264
|
+
labels: ye
|
|
262
265
|
}),
|
|
263
266
|
/* @__PURE__ */ h(r, {
|
|
264
|
-
open:
|
|
265
|
-
copy:
|
|
266
|
-
onConfirm:
|
|
267
|
-
onCancel:
|
|
268
|
-
isPending:
|
|
269
|
-
labels: { cancelButton:
|
|
267
|
+
open: R.cancelConfirmation.open,
|
|
268
|
+
copy: R.cancelConfirmation.copy,
|
|
269
|
+
onConfirm: R.cancelConfirmation.onConfirm,
|
|
270
|
+
onCancel: R.cancelConfirmation.onCancel,
|
|
271
|
+
isPending: R.cancelConfirmation.isPending,
|
|
272
|
+
labels: { cancelButton: R.cancelConfirmation.cancelButtonLabel }
|
|
270
273
|
}),
|
|
271
274
|
/* @__PURE__ */ h(r, {
|
|
272
|
-
open:
|
|
273
|
-
copy:
|
|
274
|
-
onConfirm:
|
|
275
|
-
onCancel:
|
|
276
|
-
isPending:
|
|
277
|
-
labels: { cancelButton:
|
|
275
|
+
open: R.keepConfirmation.open,
|
|
276
|
+
copy: R.keepConfirmation.copy,
|
|
277
|
+
onConfirm: R.keepConfirmation.onConfirm,
|
|
278
|
+
onCancel: R.keepConfirmation.onCancel,
|
|
279
|
+
isPending: R.keepConfirmation.isPending,
|
|
280
|
+
labels: { cancelButton: R.keepConfirmation.cancelButtonLabel }
|
|
278
281
|
}),
|
|
279
|
-
|
|
282
|
+
k ? /* @__PURE__ */ h(ie, {
|
|
280
283
|
open: he,
|
|
281
284
|
onOpenChange: S,
|
|
282
|
-
onFilesSelected:
|
|
285
|
+
onFilesSelected: Y,
|
|
283
286
|
maxFiles: b,
|
|
284
|
-
onEnterManually:
|
|
285
|
-
...
|
|
287
|
+
onEnterManually: J,
|
|
288
|
+
...X,
|
|
286
289
|
dialogLabels: g?.addBillDialog?.dialog,
|
|
287
290
|
labels: {
|
|
288
291
|
...g?.addBillDialog?.panel,
|
|
289
|
-
heading:
|
|
292
|
+
heading: R.hasAnyBills ? x.nonEmptyHeading : x.emptyHeading
|
|
290
293
|
}
|
|
291
294
|
}) : null
|
|
292
295
|
] });
|
|
@@ -11,83 +11,87 @@ import { EmbeddedToaster as r } from "../../../../../shared/ui/dist/lib/Embedded
|
|
|
11
11
|
import "../../../../../shared/ui/dist/index.js";
|
|
12
12
|
import { useAnalyticsTrack as i } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
13
13
|
import { WidgetProvider as a } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
14
|
-
import { useWidgetConfig as o } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
14
|
+
import { useWidgetConfig as o, useWidgetInitStaleForToken as s } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
15
|
import "../../../../../shared/feature/dist/index.js";
|
|
16
|
-
import { BillPayWidgetAnalyticsEvent as
|
|
17
|
-
import { BillPayWidgetUi as
|
|
16
|
+
import { BillPayWidgetAnalyticsEvent as c, WIDGET_NAME as l } from "../analytics/events.js";
|
|
17
|
+
import { BillPayWidgetUi as u } from "../../../../ui/dist/index14.js";
|
|
18
18
|
import "../../../../ui/dist/index.js";
|
|
19
|
-
import { BillUploadWidget as
|
|
19
|
+
import { BillUploadWidget as d } from "../../../../bill-upload/feature/dist/index8.js";
|
|
20
20
|
import "../../../../bill-upload/feature/dist/index.js";
|
|
21
|
-
import { BillsTab as
|
|
22
|
-
import { BILL_PAY_WIDGET_LABELS_EN as
|
|
23
|
-
import { CounterpartsWidget as
|
|
21
|
+
import { BillsTab as f } from "./BillsTab.js";
|
|
22
|
+
import { BILL_PAY_WIDGET_LABELS_EN as p } from "./labels.js";
|
|
23
|
+
import { CounterpartsWidget as m } from "../../../../../counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js";
|
|
24
24
|
import "../../../../../counterparts-widget/feature/dist/index.js";
|
|
25
|
-
import { useCallback as
|
|
26
|
-
import { Fragment as
|
|
25
|
+
import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
|
|
26
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
27
27
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js
|
|
28
|
-
var
|
|
28
|
+
var C = {
|
|
29
29
|
Bills: "bills",
|
|
30
30
|
Vendors: "vendors"
|
|
31
|
-
},
|
|
32
|
-
function
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
}, []),
|
|
40
|
-
|
|
41
|
-
}, []),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
31
|
+
}, w = [C.Bills, C.Vendors];
|
|
32
|
+
function T({ labels: a, initialTab: l = C.Bills, initialView: T, poweredByBankName: E, onSettingsClick: D }) {
|
|
33
|
+
let O = i();
|
|
34
|
+
g(() => {
|
|
35
|
+
O(c.Mounted);
|
|
36
|
+
}, [O]);
|
|
37
|
+
let k = _(() => e(p, a), [a]), { initResponse: A } = o(), j = t(A?.scopes, [n.PayableReadOrg]), M = t(A?.scopes, [n.PayableWriteOrg]), N = t(A?.scopes, [n.ApprovalPolicyWriteOrg]) && t(A?.scopes, [n.PayableWriteOrg]) && t(A?.scopes, [n.RoleReadOrg]) && t(A?.scopes, [n.UserReadOrg]), [P, F] = y(l), [I, L] = y(), R = h((e) => {
|
|
38
|
+
F(C.Bills), L(e);
|
|
39
|
+
}, []), z = v(null), B = h((e) => z.current?.enqueue(e), []), [V, H] = y(), U = h((e) => {
|
|
40
|
+
F(C.Bills), H(e);
|
|
41
|
+
}, []), W = s(), [G, K] = y(T === "create"), [q, J] = y(!1);
|
|
42
|
+
G && A && !W && (K(!1), M && P === C.Bills && J(!0));
|
|
43
|
+
let Y = [{
|
|
44
|
+
id: C.Bills,
|
|
45
|
+
label: k.tabs.bills,
|
|
46
|
+
content: /* @__PURE__ */ x(f, {
|
|
47
|
+
labels: k,
|
|
48
|
+
onEnqueueFiles: B,
|
|
49
|
+
openPayableId: I,
|
|
50
|
+
onOpenPayableHandled: () => L(void 0),
|
|
51
|
+
vendorIntent: V,
|
|
52
|
+
onVendorIntentHandled: () => H(void 0),
|
|
53
|
+
openAddBill: q,
|
|
54
|
+
onOpenAddBillHandled: () => J(!1),
|
|
55
|
+
poweredByBankName: E,
|
|
56
|
+
onSettingsClick: D && N ? D : void 0
|
|
53
57
|
})
|
|
54
58
|
}, {
|
|
55
|
-
id:
|
|
56
|
-
label:
|
|
57
|
-
content: /* @__PURE__ */
|
|
58
|
-
...
|
|
59
|
+
id: C.Vendors,
|
|
60
|
+
label: k.tabs.vendors,
|
|
61
|
+
content: /* @__PURE__ */ x(m, {
|
|
62
|
+
...k.vendors,
|
|
59
63
|
counterpartType: "vendor",
|
|
60
64
|
passThrough: !0,
|
|
61
|
-
onViewAllDocuments:
|
|
65
|
+
onViewAllDocuments: j ? (e) => U({
|
|
62
66
|
vendorId: e.id,
|
|
63
67
|
vendorName: e.name,
|
|
64
68
|
action: "viewBills"
|
|
65
69
|
}) : void 0,
|
|
66
|
-
onCreateDocument:
|
|
70
|
+
onCreateDocument: M ? (e) => U({
|
|
67
71
|
vendorId: e.id,
|
|
68
72
|
vendorName: e.name,
|
|
69
73
|
action: "createBill"
|
|
70
74
|
}) : void 0
|
|
71
75
|
})
|
|
72
|
-
}],
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
labels:
|
|
77
|
-
tabs:
|
|
78
|
-
selectedTabId:
|
|
79
|
-
onTabChange:
|
|
76
|
+
}], X = Y.some((e) => e.id === P) ? P : w.find((e) => Y.some((t) => t.id === e)) ?? Y[0]?.id ?? "";
|
|
77
|
+
return /* @__PURE__ */ S(b, { children: [
|
|
78
|
+
/* @__PURE__ */ x(r, {}),
|
|
79
|
+
/* @__PURE__ */ x(u, {
|
|
80
|
+
labels: k.widget,
|
|
81
|
+
tabs: Y,
|
|
82
|
+
selectedTabId: X,
|
|
83
|
+
onTabChange: F
|
|
80
84
|
}),
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
ref:
|
|
83
|
-
onOpenBill:
|
|
84
|
-
labels:
|
|
85
|
+
/* @__PURE__ */ x(d, {
|
|
86
|
+
ref: z,
|
|
87
|
+
onOpenBill: R,
|
|
88
|
+
labels: k.billUpload
|
|
85
89
|
})
|
|
86
90
|
] });
|
|
87
91
|
}
|
|
88
|
-
function
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
widgetName:
|
|
92
|
+
function E({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, uiFramework: s, errorFallback: c, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
|
|
93
|
+
return /* @__PURE__ */ x(a, {
|
|
94
|
+
widgetName: l,
|
|
91
95
|
baseUrl: e,
|
|
92
96
|
widgetToken: t,
|
|
93
97
|
organizationId: n,
|
|
@@ -95,13 +99,13 @@ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
|
|
|
95
99
|
gatewayRouting: i,
|
|
96
100
|
linkComponent: o,
|
|
97
101
|
uiFramework: s,
|
|
98
|
-
errorFallback:
|
|
102
|
+
errorFallback: c,
|
|
99
103
|
onError: u,
|
|
100
104
|
analytics: d,
|
|
101
105
|
disclosuresAcceptance: f,
|
|
102
106
|
providerLabels: p,
|
|
103
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ x(T, { ...m })
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
|
-
var
|
|
107
|
-
export {
|
|
110
|
+
var D = E;
|
|
111
|
+
export { D as BillPayWidget, D as default, E as BillPayWidgetWithLabels };
|
|
@@ -18,22 +18,22 @@ import "../../../../pay-bill/feature/dist/index.js";
|
|
|
18
18
|
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
19
19
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
20
20
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js
|
|
21
|
-
function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandled: v, vendorIntent: y, onVendorIntentHandled: b,
|
|
22
|
-
let
|
|
23
|
-
create:
|
|
24
|
-
details:
|
|
25
|
-
view:
|
|
26
|
-
}[
|
|
21
|
+
function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandled: v, vendorIntent: y, onVendorIntentHandled: b, openAddBill: x, onOpenAddBillHandled: S, poweredByBankName: C, onSettingsClick: w }) {
|
|
22
|
+
let T = d(null), [E, D] = f(), [O, k] = f(), [A, j] = f(!1), [M, N] = f(), [P, F] = f(!1), [I, L] = f(!1), [R, z] = f(null), B = !R || {
|
|
23
|
+
create: A,
|
|
24
|
+
details: P,
|
|
25
|
+
view: I
|
|
26
|
+
}[R.surface];
|
|
27
27
|
l(() => {
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
let
|
|
28
|
+
B || z(null);
|
|
29
|
+
}, [B]);
|
|
30
|
+
let V = h?.payBill, H = u(() => {
|
|
31
31
|
let e = (e) => (t) => /* @__PURE__ */ p(s, {
|
|
32
32
|
...t,
|
|
33
|
-
poweredByBankName:
|
|
34
|
-
labels:
|
|
35
|
-
openFlow:
|
|
36
|
-
onOpenFlowChange: (t) =>
|
|
33
|
+
poweredByBankName: C,
|
|
34
|
+
labels: V,
|
|
35
|
+
openFlow: R?.surface === e ? R.flow : null,
|
|
36
|
+
onOpenFlowChange: (t) => z(t ? {
|
|
37
37
|
surface: e,
|
|
38
38
|
flow: t
|
|
39
39
|
} : null)
|
|
@@ -44,77 +44,83 @@ function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandle
|
|
|
44
44
|
view: e("view")
|
|
45
45
|
};
|
|
46
46
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]), { initResponse:
|
|
51
|
-
t &&
|
|
52
|
-
}, [
|
|
53
|
-
|
|
54
|
-
}, G = () => {
|
|
55
|
-
N(!1), F(!0);
|
|
56
|
-
}, K = () => {
|
|
57
|
-
F(!1), N(!0);
|
|
47
|
+
R,
|
|
48
|
+
C,
|
|
49
|
+
V
|
|
50
|
+
]), { initResponse: U } = n(), W = !U || e(U.scopes, [t.PayableWriteOrg]), G = c((e, t) => {
|
|
51
|
+
t && W ? (D(e), k(void 0), j(!0)) : (N(e), L(!0));
|
|
52
|
+
}, [W]), K = (e, t) => {
|
|
53
|
+
j(!1), L(!1), G(e, t);
|
|
58
54
|
}, q = () => {
|
|
59
|
-
|
|
60
|
-
}, J =
|
|
61
|
-
|
|
55
|
+
F(!1), L(!0);
|
|
56
|
+
}, J = () => {
|
|
57
|
+
L(!1), F(!0);
|
|
58
|
+
}, Y = () => {
|
|
59
|
+
F(!1), L(!1), D(M), k(void 0), j(!0);
|
|
60
|
+
}, X = c((e) => {
|
|
61
|
+
D(void 0), k(e), j(!0);
|
|
62
62
|
}, []);
|
|
63
63
|
return l(() => {
|
|
64
|
-
_ && (
|
|
64
|
+
_ && (D(_), k(void 0), j(!0), v?.());
|
|
65
65
|
}, [v, _]), l(() => {
|
|
66
|
-
y && (y.action === "createBill" ?
|
|
66
|
+
y && (y.action === "createBill" ? W && X(y.vendorId) : T.current?.showVendorBills({
|
|
67
67
|
id: y.vendorId,
|
|
68
68
|
name: y.vendorName
|
|
69
69
|
}), b?.());
|
|
70
70
|
}, [
|
|
71
|
-
|
|
71
|
+
W,
|
|
72
72
|
b,
|
|
73
|
-
|
|
73
|
+
X,
|
|
74
74
|
y
|
|
75
|
+
]), l(() => {
|
|
76
|
+
x && (W && T.current?.openAddBill(), S?.());
|
|
77
|
+
}, [
|
|
78
|
+
W,
|
|
79
|
+
S,
|
|
80
|
+
x
|
|
75
81
|
]), /* @__PURE__ */ m("div", {
|
|
76
82
|
"data-testid": r.root,
|
|
77
83
|
children: [
|
|
78
84
|
/* @__PURE__ */ p(o, {
|
|
79
|
-
ref:
|
|
85
|
+
ref: T,
|
|
80
86
|
labels: h?.billsList,
|
|
81
|
-
onOpenBill:
|
|
82
|
-
onEnterManually: () =>
|
|
87
|
+
onOpenBill: G,
|
|
88
|
+
onEnterManually: () => X(),
|
|
83
89
|
onFilesSelected: g,
|
|
84
90
|
maxFiles: 10,
|
|
85
|
-
onSettingsClick:
|
|
91
|
+
onSettingsClick: w
|
|
86
92
|
}),
|
|
87
|
-
|
|
88
|
-
open:
|
|
89
|
-
onOpenChange:
|
|
90
|
-
payableId:
|
|
91
|
-
initialCounterpartId:
|
|
92
|
-
onOpenBill:
|
|
93
|
-
renderPaymentFlows:
|
|
93
|
+
A ? /* @__PURE__ */ p(a, {
|
|
94
|
+
open: A,
|
|
95
|
+
onOpenChange: j,
|
|
96
|
+
payableId: E,
|
|
97
|
+
initialCounterpartId: O,
|
|
98
|
+
onOpenBill: K,
|
|
99
|
+
renderPaymentFlows: H.create,
|
|
94
100
|
copy: h?.billDialog
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
open:
|
|
98
|
-
onOpenChange:
|
|
99
|
-
payableId:
|
|
100
|
-
onClose: () =>
|
|
101
|
-
onExpand:
|
|
102
|
-
onEdit:
|
|
101
|
+
}, E) : null,
|
|
102
|
+
P ? /* @__PURE__ */ p(i, {
|
|
103
|
+
open: P,
|
|
104
|
+
onOpenChange: F,
|
|
105
|
+
payableId: M,
|
|
106
|
+
onClose: () => F(!1),
|
|
107
|
+
onExpand: q,
|
|
108
|
+
onEdit: Y,
|
|
103
109
|
testId: r.detailsSheet,
|
|
104
|
-
renderPaymentFlows:
|
|
110
|
+
renderPaymentFlows: H.details,
|
|
105
111
|
labels: h?.billDetails
|
|
106
112
|
}) : null,
|
|
107
|
-
|
|
108
|
-
open:
|
|
109
|
-
onOpenChange:
|
|
110
|
-
payableId:
|
|
113
|
+
I ? /* @__PURE__ */ p(a, {
|
|
114
|
+
open: I,
|
|
115
|
+
onOpenChange: L,
|
|
116
|
+
payableId: M,
|
|
111
117
|
readOnly: !0,
|
|
112
|
-
onCollapse:
|
|
113
|
-
onEdit:
|
|
114
|
-
onOpenBill:
|
|
115
|
-
renderPaymentFlows:
|
|
118
|
+
onCollapse: J,
|
|
119
|
+
onEdit: Y,
|
|
120
|
+
onOpenBill: K,
|
|
121
|
+
renderPaymentFlows: H.view,
|
|
116
122
|
copy: h?.billDialog
|
|
117
|
-
},
|
|
123
|
+
}, M) : null
|
|
118
124
|
]
|
|
119
125
|
});
|
|
120
126
|
}
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.51", n = "59f22e2b26e5eed43999fe12de6f97f988ab714b", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { WidgetFrame as e } from "../WidgetFrame/WidgetFrame.js";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
// ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/WidgetContainer/WidgetContainer.js
|
|
4
|
-
function n({ icon: n, title: r, children: i
|
|
4
|
+
function n({ icon: n, title: r, children: i }) {
|
|
5
5
|
return /* @__PURE__ */ t(e, {
|
|
6
6
|
icon: n,
|
|
7
7
|
title: r,
|
|
8
|
-
showHeaderDivider: a,
|
|
9
8
|
children: i
|
|
10
9
|
});
|
|
11
10
|
}
|
package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/WidgetFrame/WidgetFrame.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Typography as e, cn as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
3
|
// ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/WidgetFrame/WidgetFrame.js
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
return /* @__PURE__ */
|
|
4
|
+
function i({ title: i, icon: a, action: o, bodyClassName: s, className: c, children: l, ...u }) {
|
|
5
|
+
let d = i !== void 0 || o != null;
|
|
6
|
+
return /* @__PURE__ */ r("div", {
|
|
7
7
|
"data-slot": "widget-frame",
|
|
8
|
-
className:
|
|
9
|
-
...
|
|
10
|
-
children: [
|
|
8
|
+
className: t("ttw:@container/widget ttw:flex ttw:w-full ttw:flex-col ttw:overflow-hidden ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:text-card-foreground", c),
|
|
9
|
+
...u,
|
|
10
|
+
children: [d ? /* @__PURE__ */ r("div", {
|
|
11
11
|
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3 ttw:px-4 ttw:py-3",
|
|
12
|
-
children: [
|
|
12
|
+
children: [i === void 0 ? null : /* @__PURE__ */ r("div", {
|
|
13
13
|
className: "ttw:flex ttw:min-w-0 ttw:items-center ttw:gap-2",
|
|
14
|
-
children: [
|
|
14
|
+
children: [a ? /* @__PURE__ */ n("span", {
|
|
15
15
|
"aria-hidden": !0,
|
|
16
16
|
className: "ttw:flex ttw:shrink-0 ttw:items-center ttw:text-primary ttw:[&>svg]:size-5 ttw:[&>svg]:text-primary",
|
|
17
|
-
children:
|
|
18
|
-
}) : null, /* @__PURE__ */
|
|
17
|
+
children: a
|
|
18
|
+
}) : null, /* @__PURE__ */ n(e, {
|
|
19
19
|
component: "h2",
|
|
20
20
|
variant: "h6",
|
|
21
21
|
className: "ttw:min-w-0 ttw:font-semibold ttw:text-foreground",
|
|
22
|
-
children:
|
|
22
|
+
children: i
|
|
23
23
|
})]
|
|
24
|
-
}),
|
|
24
|
+
}), o == null ? null : /* @__PURE__ */ n("div", {
|
|
25
25
|
className: "ttw:ml-auto ttw:flex ttw:shrink-0 ttw:items-center ttw:justify-end ttw:gap-2",
|
|
26
|
-
children:
|
|
26
|
+
children: o
|
|
27
27
|
})]
|
|
28
|
-
})
|
|
29
|
-
className:
|
|
30
|
-
children:
|
|
28
|
+
}) : null, /* @__PURE__ */ n("div", {
|
|
29
|
+
className: t("ttw:flex ttw:flex-col ttw:p-4", s),
|
|
30
|
+
children: l
|
|
31
31
|
})]
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
export {
|
|
34
|
+
export { i as WidgetFrame };
|