@tesouro/embedded-components-react 0.3.1 → 0.3.2
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 +7 -10
- package/dist/experimental/WidgetSuite.d.ts +2 -2
- package/dist/experimental/index.d.ts +2 -2
- package/dist/index.d.ts +1 -23
- package/dist/lib/BankAccountsWidget.d.ts +0 -1
- package/dist/lib/ChartOfAccountsWidget.d.ts +1 -5
- package/dist/lib/CounterpartsWidget.d.ts +0 -9
- package/dist/lib/ExpenseManagementWidget.d.ts +0 -1
- package/dist/lib/ProductsWidget.d.ts +0 -1
- package/dist/lib/ReceivablesWidget.d.ts +0 -1
- package/dist/lib/SettingsWidget.d.ts +0 -1
- package/dist/lib/TagsWidget.d.ts +0 -1
- package/dist/lib/TeamWidget.d.ts +0 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index8.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +64 -65
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankAccountsWidgetUi.js +35 -36
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankingHeader.js +35 -42
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +1 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +4 -7
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +106 -107
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +85 -93
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseManagementWidgetUi/ExpenseManagementWidgetUi.js +4 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseManagementWidgetUi/labels.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/ui/dist/index2.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/ui/dist/index3.js +113 -115
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +150 -155
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +86 -91
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +20 -22
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +25 -26
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/tags-widget/ui/dist/index2.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/tags-widget/ui/dist/index3.js +67 -68
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +239 -241
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -6
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +53 -53
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -214,7 +214,7 @@ A self-contained banking widget for listing Tesouro bank accounts, creating an a
|
|
|
214
214
|
|
|
215
215
|
| Prop | Type | Default | Description |
|
|
216
216
|
| --------------------------- | ------------------------------------------ | -------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
217
|
-
| `isBankingTaglineVisible` | `boolean` | `true` | Shows the banking tagline
|
|
217
|
+
| `isBankingTaglineVisible` | `boolean` | `true` | Shows the banking tagline at the top of the widget. The page heading above it belongs to your page. |
|
|
218
218
|
| `bankLogoSrc` | `string` | `undefined` | Bank logo for the tagline row. Omit and the row shows the bank name alone. |
|
|
219
219
|
| `bankLogoAlt` | `string` | `undefined` | Alt text when `bankLogoSrc` is set. |
|
|
220
220
|
| `depositAgreementUrl` | `string` | `undefined` | Deposit-agreement PDF linked from the create-account legal copy. Omit and the clause naming it is not rendered. |
|
|
@@ -312,7 +312,6 @@ A self-contained widget for managing an organization's customers or vendors with
|
|
|
312
312
|
| -------------------- | ------------------------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
313
313
|
| `counterpartType` | `'customer' \| 'vendor'` | — | Required. Selects receivables/customer copy and queries or payables/vendor copy and queries. |
|
|
314
314
|
| `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Page-size choices shown by the table. |
|
|
315
|
-
| `showTitle` | `boolean` | `true` | Whether to render the screen title row. Pass `false` when the embedding surface already titles this screen; the create action then moves into the search row. |
|
|
316
315
|
| `onViewAllDocuments` | `() => void` | `undefined` | Reveals a "View all" action beside the recent-bills/invoices heading in the details sheet. Omit when the host has no document list to navigate to; the action stays hidden rather than dead. |
|
|
317
316
|
|
|
318
317
|
| Prop | Type | Description |
|
|
@@ -392,17 +391,16 @@ A self-contained widget that renders an organization's chart of accounts: a pagi
|
|
|
392
391
|
|
|
393
392
|
| Prop | Type | Description |
|
|
394
393
|
| ---------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
395
|
-
| `title` | `string` | Overrides the built-in "Chart of accounts" heading. Pass an empty string to suppress it when the host renders its own. |
|
|
396
394
|
| `onEdit` | `(row: LedgerAccountRow) => void` | Overrides the built-in edit flow. Not offered on externally-synced rows (`is_external`), which the API refuses to update. |
|
|
397
395
|
| `onDelete` | `(row: LedgerAccountRow) => void` | Overrides the built-in delete flow. Not offered on externally-synced rows (`is_external`), which the API refuses to delete. |
|
|
398
396
|
| `onAdd` | `() => void` | Overrides the built-in create flow. Omit it to use the widget's own create sheet. |
|
|
399
397
|
|
|
400
|
-
| Prop | Type | Covers
|
|
401
|
-
| --------------- | --------------------------------------- |
|
|
402
|
-
| `screenLabels` | `Partial<ChartOfAccountsLabels>` | Table copy:
|
|
403
|
-
| `formLabels` | `Partial<AccountFormSheetLabels>` | Create/edit sheet: titles, field labels, placeholders, counter, buttons, menu.
|
|
404
|
-
| `deleteLabels` | `Partial<AccountDeleteDialogLabels>` | Delete confirmation: title, message, buttons.
|
|
405
|
-
| `messageLabels` | `Partial<ChartOfAccountsMessageLabels>` | Validation messages, save/delete failure fallbacks, and success toasts.
|
|
398
|
+
| Prop | Type | Covers |
|
|
399
|
+
| --------------- | --------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
400
|
+
| `screenLabels` | `Partial<ChartOfAccountsLabels>` | Table copy: explanatory line, column headers, row actions, sort control, empty/error states. |
|
|
401
|
+
| `formLabels` | `Partial<AccountFormSheetLabels>` | Create/edit sheet: titles, field labels, placeholders, counter, buttons, menu. |
|
|
402
|
+
| `deleteLabels` | `Partial<AccountDeleteDialogLabels>` | Delete confirmation: title, message, buttons. |
|
|
403
|
+
| `messageLabels` | `Partial<ChartOfAccountsMessageLabels>` | Validation messages, save/delete failure fallbacks, and success toasts. |
|
|
406
404
|
|
|
407
405
|
### HelpWidget
|
|
408
406
|
|
|
@@ -584,7 +582,6 @@ A self-contained team management surface for embedded integrators. It lists orga
|
|
|
584
582
|
|
|
585
583
|
| Prop | Type | Description |
|
|
586
584
|
| ------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
587
|
-
| `title` | `string` | Optional page heading rendered above the team table. Omit when the host already provides its own title. |
|
|
588
585
|
| `labels` | `Partial<TeamWidgetLabels>` | Overrides table, detail, invite, edit, and dialog UI copy. |
|
|
589
586
|
| `featureLabels` | `Partial<TeamWidgetFeatureLabels>` | Overrides role display names, validation messages, and deactivate confirmation copy. |
|
|
590
587
|
| `acceptInviteRedirectUri` | `string` | Allowlisted URL invite/resend emails link to. Defaults to `${window.location.origin}/accept-invite`; set it when the host app's registered landing route differs from the widget's same-origin default, or the origin is not on the OIDC redirect-URI allowlist (preview/localhost). |
|
|
@@ -909,8 +909,8 @@ interface WidgetSuiteProps extends WidgetProviderProps {
|
|
|
909
909
|
* heading reads as a fragment of someone else's. Set `false` when the host
|
|
910
910
|
* already renders a heading of its own above the suite.
|
|
911
911
|
*
|
|
912
|
-
*
|
|
913
|
-
*
|
|
912
|
+
* Every section gets one: no widget heads itself any more (embedded ADR
|
|
913
|
+
* 0010), so the suite is the only thing that can name them.
|
|
914
914
|
*/
|
|
915
915
|
showSectionTitle?: boolean;
|
|
916
916
|
}
|
|
@@ -909,8 +909,8 @@ interface WidgetSuiteProps extends WidgetProviderProps {
|
|
|
909
909
|
* heading reads as a fragment of someone else's. Set `false` when the host
|
|
910
910
|
* already renders a heading of its own above the suite.
|
|
911
911
|
*
|
|
912
|
-
*
|
|
913
|
-
*
|
|
912
|
+
* Every section gets one: no widget heads itself any more (embedded ADR
|
|
913
|
+
* 0010), so the suite is the only thing that can name them.
|
|
914
914
|
*/
|
|
915
915
|
showSectionTitle?: boolean;
|
|
916
916
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1483,7 +1483,6 @@ type AcceptDisclosuresWidgetProps = WidgetProviderProps & InnerProps;
|
|
|
1483
1483
|
declare function AcceptDisclosuresWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, ...innerProps }: AcceptDisclosuresWidgetProps): React.JSX.Element;
|
|
1484
1484
|
|
|
1485
1485
|
interface Labels$6 {
|
|
1486
|
-
title: string;
|
|
1487
1486
|
bankingTaglinePrefix: string;
|
|
1488
1487
|
availableBalanceLabel: string;
|
|
1489
1488
|
availableBalanceTooltip: string;
|
|
@@ -2609,8 +2608,6 @@ interface CounterpartMessageLabels {
|
|
|
2609
2608
|
* `*_LABELS_EN` default, so integrators can re-label without forking the UI.
|
|
2610
2609
|
*/
|
|
2611
2610
|
interface CounterpartsScreenLabels {
|
|
2612
|
-
customersTitle: string;
|
|
2613
|
-
vendorsTitle: string;
|
|
2614
2611
|
/** Customer-mode create action. */
|
|
2615
2612
|
createButton: string;
|
|
2616
2613
|
/** Vendor-mode create action — the Bill Pay Figma labels it, not "Create new". */
|
|
@@ -2718,13 +2715,6 @@ interface CounterpartsWidgetOwnProps {
|
|
|
2718
2715
|
/** Selects customer (receivables) or vendor (payables) behavior and copy. */
|
|
2719
2716
|
counterpartType: CounterpartMode;
|
|
2720
2717
|
pageSizeOptions?: number[];
|
|
2721
|
-
/**
|
|
2722
|
-
* Whether to render the screen title row. Defaults to true, which suits a
|
|
2723
|
-
* host page that renders its own title above the widget. Pass false when the
|
|
2724
|
-
* embedding surface already titles this screen; the create action then moves
|
|
2725
|
-
* into the search row.
|
|
2726
|
-
*/
|
|
2727
|
-
showTitle?: boolean;
|
|
2728
2718
|
/**
|
|
2729
2719
|
* Reveals a "View all" action beside the recent-documents heading in the
|
|
2730
2720
|
* details sheet. Omit when the host has nowhere to send the user; the
|
|
@@ -2763,7 +2753,6 @@ type CounterpartsWidgetProps = WidgetProviderProps & CounterpartsWidgetOwnProps;
|
|
|
2763
2753
|
declare function CounterpartsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, ...innerProps }: CounterpartsWidgetProps): React.JSX.Element;
|
|
2764
2754
|
|
|
2765
2755
|
interface Labels$4 {
|
|
2766
|
-
title: string;
|
|
2767
2756
|
description: string;
|
|
2768
2757
|
receiptsTab: string;
|
|
2769
2758
|
matchingTab: string;
|
|
@@ -2971,7 +2960,6 @@ declare function InsightsWidget({ labels, singleInsightLabels, featureLabels, ro
|
|
|
2971
2960
|
*/
|
|
2972
2961
|
interface ChartOfAccountsLabels {
|
|
2973
2962
|
/** Section heading, and the sentence beneath it explaining what the list is. */
|
|
2974
|
-
title: string;
|
|
2975
2963
|
subtitle: string;
|
|
2976
2964
|
columnGlCode: string;
|
|
2977
2965
|
columnName: string;
|
|
@@ -3095,13 +3083,10 @@ interface ChartOfAccountsTableProps {
|
|
|
3095
3083
|
* affordance entirely.
|
|
3096
3084
|
*/
|
|
3097
3085
|
onAdd?: () => void;
|
|
3098
|
-
/** Optional section heading rendered above the table. Omit when the host
|
|
3099
|
-
* already provides its own title. */
|
|
3100
|
-
title?: string;
|
|
3101
3086
|
/** Applied to the empty state's root element. Supplied by the caller, not decided here. */
|
|
3102
3087
|
emptyStateTestId?: string;
|
|
3103
3088
|
}
|
|
3104
|
-
declare function ChartOfAccountsTable({ data, isLoading, isError, sorting, onSortingChange, pageSize, onPageSizeChange, pageSizeOptions, hasNextPage, hasPrevPage, onNextPage, onPrevPage, labels,
|
|
3089
|
+
declare function ChartOfAccountsTable({ data, isLoading, isError, sorting, onSortingChange, pageSize, onPageSizeChange, pageSizeOptions, hasNextPage, hasPrevPage, onNextPage, onPrevPage, labels, emptyStateTestId, onEdit, onDelete, onAdd, }: ChartOfAccountsTableProps): React.JSX.Element;
|
|
3105
3090
|
|
|
3106
3091
|
/**
|
|
3107
3092
|
* Which form the owner has open. Deliberately *not* a prop on
|
|
@@ -3504,7 +3489,6 @@ interface ReceivableStatusBadgeLabels {
|
|
|
3504
3489
|
unknown: string;
|
|
3505
3490
|
}
|
|
3506
3491
|
interface ReceivablesScreenLabels {
|
|
3507
|
-
title: string;
|
|
3508
3492
|
createButton: string;
|
|
3509
3493
|
templateSettingsButton: string;
|
|
3510
3494
|
searchPlaceholder: string;
|
|
@@ -4121,7 +4105,6 @@ interface ProductTypeBadgeLabels {
|
|
|
4121
4105
|
service: string;
|
|
4122
4106
|
}
|
|
4123
4107
|
interface ProductsScreenLabels {
|
|
4124
|
-
title: string;
|
|
4125
4108
|
createButton: string;
|
|
4126
4109
|
manageUnitsButton: string;
|
|
4127
4110
|
columnName: string;
|
|
@@ -4251,7 +4234,6 @@ interface ProfileWidgetProps extends WidgetProviderProps {
|
|
|
4251
4234
|
declare function ProfileWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, ...innerProps }: ProfileWidgetProps): React.JSX.Element;
|
|
4252
4235
|
|
|
4253
4236
|
interface Labels$1 {
|
|
4254
|
-
title: string;
|
|
4255
4237
|
description?: string;
|
|
4256
4238
|
}
|
|
4257
4239
|
|
|
@@ -4368,7 +4350,6 @@ declare function SettingsWidget({ baseUrl, widgetToken, organizationId, configCl
|
|
|
4368
4350
|
* `labels?: Partial<…Labels>` prop merged over the matching `*_LABELS_EN` default.
|
|
4369
4351
|
*/
|
|
4370
4352
|
interface TagsScreenLabels {
|
|
4371
|
-
title: string;
|
|
4372
4353
|
createButton: string;
|
|
4373
4354
|
columnName: string;
|
|
4374
4355
|
columnCategory: string;
|
|
@@ -4685,9 +4666,6 @@ interface FeatureLabels$1 {
|
|
|
4685
4666
|
interface TeamWidgetProps extends WidgetProviderProps {
|
|
4686
4667
|
labels?: Partial<Labels>;
|
|
4687
4668
|
featureLabels?: Partial<FeatureLabels$1>;
|
|
4688
|
-
/** Optional page heading rendered above the widget. Embedders that already
|
|
4689
|
-
* provide their own page title should omit this. */
|
|
4690
|
-
title?: string;
|
|
4691
4669
|
/**
|
|
4692
4670
|
* Absolute URL the accept-invite link in invitation emails points at (sent
|
|
4693
4671
|
* as `redirectUri` on the identity create-user call, for both invite and
|
|
@@ -3,7 +3,6 @@ import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react
|
|
|
3
3
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
4
|
|
|
5
5
|
interface Labels$1 {
|
|
6
|
-
title: string;
|
|
7
6
|
bankingTaglinePrefix: string;
|
|
8
7
|
availableBalanceLabel: string;
|
|
9
8
|
availableBalanceTooltip: string;
|
|
@@ -18,7 +18,6 @@ import { FallbackProps } from 'react-error-boundary';
|
|
|
18
18
|
*/
|
|
19
19
|
interface ChartOfAccountsLabels {
|
|
20
20
|
/** Section heading, and the sentence beneath it explaining what the list is. */
|
|
21
|
-
title: string;
|
|
22
21
|
subtitle: string;
|
|
23
22
|
columnGlCode: string;
|
|
24
23
|
columnName: string;
|
|
@@ -142,13 +141,10 @@ interface ChartOfAccountsTableProps {
|
|
|
142
141
|
* affordance entirely.
|
|
143
142
|
*/
|
|
144
143
|
onAdd?: () => void;
|
|
145
|
-
/** Optional section heading rendered above the table. Omit when the host
|
|
146
|
-
* already provides its own title. */
|
|
147
|
-
title?: string;
|
|
148
144
|
/** Applied to the empty state's root element. Supplied by the caller, not decided here. */
|
|
149
145
|
emptyStateTestId?: string;
|
|
150
146
|
}
|
|
151
|
-
declare function ChartOfAccountsTable({ data, isLoading, isError, sorting, onSortingChange, pageSize, onPageSizeChange, pageSizeOptions, hasNextPage, hasPrevPage, onNextPage, onPrevPage, labels,
|
|
147
|
+
declare function ChartOfAccountsTable({ data, isLoading, isError, sorting, onSortingChange, pageSize, onPageSizeChange, pageSizeOptions, hasNextPage, hasPrevPage, onNextPage, onPrevPage, labels, emptyStateTestId, onEdit, onDelete, onAdd, }: ChartOfAccountsTableProps): React.JSX.Element;
|
|
152
148
|
|
|
153
149
|
/**
|
|
154
150
|
* Which form the owner has open. Deliberately *not* a prop on
|
|
@@ -736,8 +736,6 @@ interface CounterpartMessageLabels {
|
|
|
736
736
|
* `*_LABELS_EN` default, so integrators can re-label without forking the UI.
|
|
737
737
|
*/
|
|
738
738
|
interface CounterpartsScreenLabels {
|
|
739
|
-
customersTitle: string;
|
|
740
|
-
vendorsTitle: string;
|
|
741
739
|
/** Customer-mode create action. */
|
|
742
740
|
createButton: string;
|
|
743
741
|
/** Vendor-mode create action — the Bill Pay Figma labels it, not "Create new". */
|
|
@@ -845,13 +843,6 @@ interface CounterpartsWidgetOwnProps {
|
|
|
845
843
|
/** Selects customer (receivables) or vendor (payables) behavior and copy. */
|
|
846
844
|
counterpartType: CounterpartMode;
|
|
847
845
|
pageSizeOptions?: number[];
|
|
848
|
-
/**
|
|
849
|
-
* Whether to render the screen title row. Defaults to true, which suits a
|
|
850
|
-
* host page that renders its own title above the widget. Pass false when the
|
|
851
|
-
* embedding surface already titles this screen; the create action then moves
|
|
852
|
-
* into the search row.
|
|
853
|
-
*/
|
|
854
|
-
showTitle?: boolean;
|
|
855
846
|
/**
|
|
856
847
|
* Reveals a "View all" action beside the recent-documents heading in the
|
|
857
848
|
* details sheet. Omit when the host has nowhere to send the user; the
|
package/dist/lib/TagsWidget.d.ts
CHANGED
|
@@ -603,7 +603,6 @@ interface WidgetProviderProps extends WidgetProviderBaseProps {
|
|
|
603
603
|
* `labels?: Partial<…Labels>` prop merged over the matching `*_LABELS_EN` default.
|
|
604
604
|
*/
|
|
605
605
|
interface TagsScreenLabels {
|
|
606
|
-
title: string;
|
|
607
606
|
createButton: string;
|
|
608
607
|
columnName: string;
|
|
609
608
|
columnCategory: string;
|
package/dist/lib/TeamWidget.d.ts
CHANGED
|
@@ -831,9 +831,6 @@ interface FeatureLabels {
|
|
|
831
831
|
interface TeamWidgetProps extends WidgetProviderProps {
|
|
832
832
|
labels?: Partial<Labels>;
|
|
833
833
|
featureLabels?: Partial<FeatureLabels>;
|
|
834
|
-
/** Optional page heading rendered above the widget. Embedders that already
|
|
835
|
-
* provide their own page title should omit this. */
|
|
836
|
-
title?: string;
|
|
837
834
|
/**
|
|
838
835
|
* Absolute URL the accept-invite link in invitation emails points at (sent
|
|
839
836
|
* as `redirectUri` on the identity create-user call, for both invite and
|
|
@@ -69,7 +69,6 @@ function v({ labels: v, title: y, bankDisplayName: b, bankLogoSrc: x, bankLogoAl
|
|
|
69
69
|
className: "ttw:space-y-0.5",
|
|
70
70
|
children: [/* @__PURE__ */ m(u, {
|
|
71
71
|
variant: "h2",
|
|
72
|
-
component: "h1",
|
|
73
72
|
className: "ttw:leading-9 ttw:tracking-[-0.75px]",
|
|
74
73
|
children: y
|
|
75
74
|
}), T && b ? /* @__PURE__ */ h("div", {
|
package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js
CHANGED
|
@@ -11,74 +11,74 @@ import { TESOURO_NEW_EMBEDDED_BANK_ACCOUNT_CREATED_SUCCESS_EVENT as ee, emitWidg
|
|
|
11
11
|
import { useWidgetConfig as ne, useWidgetError as re, useWidgetLoading as ie } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
12
12
|
import "../../../shared/feature/dist/index.js";
|
|
13
13
|
import { BankAccountsWidgetAnalyticsEvent as i } from "./index2.js";
|
|
14
|
-
import { copyTextToClipboard as ae, formatAmountLabel as a, formatTotalAvailableBalanceLabel as oe, maskAccountNumber as
|
|
15
|
-
import { DEFAULT_FEATURE_LABELS as
|
|
16
|
-
import { getBankAccountsPermissions as
|
|
17
|
-
import { toAccessRows as
|
|
18
|
-
import { DEFAULT_LABELS as
|
|
14
|
+
import { copyTextToClipboard as ae, formatAmountLabel as a, formatTotalAvailableBalanceLabel as oe, maskAccountNumber as o } from "./index3.js";
|
|
15
|
+
import { DEFAULT_FEATURE_LABELS as se } from "./index4.js";
|
|
16
|
+
import { getBankAccountsPermissions as ce } from "./index5.js";
|
|
17
|
+
import { toAccessRows as le, toOrganizationRoleOptions as ue, toTeamMembers as de } from "./index6.js";
|
|
18
|
+
import { DEFAULT_LABELS as fe } from "../../ui/dist/lib/labels.js";
|
|
19
19
|
import "../../ui/dist/index.js";
|
|
20
|
-
import { useCreateBankAccountMutation as
|
|
21
|
-
import { useGrantBankAccountAccessMutation as
|
|
22
|
-
import { useAllOrganizationUsersQuery as
|
|
20
|
+
import { useCreateBankAccountMutation as pe } from "../../data-access/dist/index3.js";
|
|
21
|
+
import { useGrantBankAccountAccessMutation as me } from "../../data-access/dist/index4.js";
|
|
22
|
+
import { useAllOrganizationUsersQuery as he } from "../../data-access/dist/index5.js";
|
|
23
23
|
import "../../data-access/dist/index.js";
|
|
24
|
-
import { filterRolesForOrganization as
|
|
25
|
-
import { useCallback as
|
|
24
|
+
import { filterRolesForOrganization as ge } from "../../../../shared/util-validation/dist/index6.js";
|
|
25
|
+
import { useCallback as _e, useEffect as s, useMemo as c, useRef as ve, useState as l } from "react";
|
|
26
26
|
import { useControllableState as ye } from "@radix-ui/react-use-controllable-state";
|
|
27
27
|
//#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js
|
|
28
28
|
var u = { nickname: "" };
|
|
29
29
|
function d(e, t) {
|
|
30
30
|
return e !== void 0 && t !== void 0 && e !== t;
|
|
31
31
|
}
|
|
32
|
-
function f({ labels: a, featureLabels:
|
|
33
|
-
let
|
|
34
|
-
...
|
|
32
|
+
function f({ labels: a, featureLabels: o, isBankingTaglineVisible: f = !0, bankLogoSrc: xe, bankLogoAlt: Se, depositAgreementUrl: Ce, selectedAccountId: we, defaultSelectedAccountId: Te, onSelectedAccountIdChange: Ee, "data-testid": De } = {}) {
|
|
33
|
+
let Oe = {
|
|
34
|
+
...fe,
|
|
35
35
|
...a
|
|
36
|
-
},
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
let [
|
|
42
|
-
|
|
43
|
-
let [
|
|
36
|
+
}, p = {
|
|
37
|
+
...se,
|
|
38
|
+
...o
|
|
39
|
+
}, m = r(), { organizationId: h, widgetToken: ke, initResponse: g } = ne(), Ae = ie(), _ = !!re(), v = !!(h && ke), y = c(() => ce(g?.scopes), [g?.scopes]), je = v && y.canRead && !!g, b = g?.userId ?? void 0, [x, Me] = l(h);
|
|
40
|
+
h !== void 0 && h !== x && Me(h);
|
|
41
|
+
let [S, Ne] = l(b);
|
|
42
|
+
b !== void 0 && b !== S && Ne(b);
|
|
43
|
+
let [Pe, C] = ye({
|
|
44
44
|
prop: we,
|
|
45
45
|
defaultProp: Te ?? null,
|
|
46
46
|
onChange: Ee,
|
|
47
47
|
caller: "BankAccountsWidget"
|
|
48
|
-
}),
|
|
49
|
-
organizationId:
|
|
50
|
-
userId:
|
|
51
|
-
}),
|
|
48
|
+
}), w = ve({
|
|
49
|
+
organizationId: x,
|
|
50
|
+
userId: S
|
|
51
|
+
}), Fe = d(w.current.organizationId, x) || d(w.current.userId, S);
|
|
52
52
|
s(() => {
|
|
53
|
-
let e =
|
|
54
|
-
|
|
55
|
-
organizationId:
|
|
56
|
-
userId:
|
|
57
|
-
}, (d(e.organizationId,
|
|
53
|
+
let e = w.current;
|
|
54
|
+
w.current = {
|
|
55
|
+
organizationId: x,
|
|
56
|
+
userId: S
|
|
57
|
+
}, (d(e.organizationId, x) || d(e.userId, S)) && C(null);
|
|
58
58
|
}, [
|
|
59
|
+
x,
|
|
59
60
|
S,
|
|
60
|
-
C
|
|
61
|
-
w
|
|
61
|
+
C
|
|
62
62
|
]);
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
}, [
|
|
63
|
+
let T = Fe ? null : Pe, E = je && !T, D = _e((e) => {
|
|
64
|
+
C(e);
|
|
65
|
+
}, [C]), [O, k] = l(!1), [A, j] = l(u), [M, N] = l([]), [Ie, P] = l(!1), [F, I] = l(), [Le, Re] = l({}), [L, R] = l({});
|
|
66
66
|
s(() => {
|
|
67
|
-
|
|
68
|
-
}, [
|
|
69
|
-
let z = t({ enabled:
|
|
70
|
-
let e = W.data?.data ?? [], t =
|
|
71
|
-
organizationId:
|
|
72
|
-
organizationTypes:
|
|
67
|
+
m(i.Mounted);
|
|
68
|
+
}, [m]);
|
|
69
|
+
let z = t({ enabled: E }), B = pe(), V = me(), H = O, U = he({ enabled: H }), W = n({ enabled: H }), G = c(() => {
|
|
70
|
+
let e = W.data?.data ?? [], t = h ? ge(e, {
|
|
71
|
+
organizationId: h,
|
|
72
|
+
organizationTypes: g?.organizationTypes ?? []
|
|
73
73
|
}) : e;
|
|
74
|
-
return
|
|
74
|
+
return de(U.data?.data ?? [], ue(t));
|
|
75
75
|
}, [
|
|
76
76
|
W.data?.data,
|
|
77
77
|
U.data?.data,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
]), K = U.isLoading || U.isFetchingNextPage || !!U.hasNextPage || W.isResolving, q = !K && !U.isError, J =
|
|
81
|
-
await ae(r) && (e.success(n === "account" ?
|
|
78
|
+
h,
|
|
79
|
+
g?.organizationTypes
|
|
80
|
+
]), K = U.isLoading || U.isFetchingNextPage || !!U.hasNextPage || W.isResolving, q = !K && !U.isError, J = E ? z.data?.data ?? [] : [], Y = [.../* @__PURE__ */ new Set([...G.filter((e) => e.locked).map((e) => e.id), ...M])], X = g?.bankName?.trim() ?? "", ze = g?.vspName?.trim() ?? "", Be = Ce?.trim() || void 0, Z = v && y.canWrite, Q = !z.hasNextPage && !z.isFetchingNextPage, Ve = c(() => Q ? oe(J) : void 0, [J, Q]), He = J.length > 1 && y.canRead && Q, $ = _e(async (t, n, r) => {
|
|
81
|
+
await ae(r) && (e.success(n === "account" ? p.copyAccountNumberToast : p.copyRoutingNumberToast), R((e) => ({
|
|
82
82
|
...e,
|
|
83
83
|
[t]: n
|
|
84
84
|
})), window.setTimeout(() => {
|
|
@@ -87,7 +87,7 @@ function f({ labels: a, featureLabels: se, isBankingTaglineVisible: f = !0, bank
|
|
|
87
87
|
[t]: void 0
|
|
88
88
|
}));
|
|
89
89
|
}, 2e3));
|
|
90
|
-
}, [
|
|
90
|
+
}, [p.copyAccountNumberToast, p.copyRoutingNumberToast]), Ue = c(() => J.map((e) => be(e, p, {
|
|
91
91
|
isAccountNumberVisible: Le[e.id] ?? !1,
|
|
92
92
|
isAccountNumberCopied: L[e.id] === "account",
|
|
93
93
|
isRoutingNumberCopied: L[e.id] === "routing",
|
|
@@ -98,22 +98,22 @@ function f({ labels: a, featureLabels: se, isBankingTaglineVisible: f = !0, bank
|
|
|
98
98
|
onCopyAccountNumber: () => void $(e.id, "account", e.accountNumber),
|
|
99
99
|
onCopyRoutingNumber: () => void $(e.id, "routing", e.routingNumber),
|
|
100
100
|
onSelect: () => {
|
|
101
|
-
|
|
101
|
+
D(e.id), m(i.AccountSelected, { accountId: e.id });
|
|
102
102
|
}
|
|
103
103
|
})), [
|
|
104
104
|
J,
|
|
105
105
|
Le,
|
|
106
106
|
L,
|
|
107
|
-
|
|
107
|
+
p,
|
|
108
108
|
$,
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
D,
|
|
110
|
+
m
|
|
111
111
|
]), We = (t) => {
|
|
112
112
|
V.mutate({
|
|
113
113
|
path: { id: t },
|
|
114
114
|
body: { userIds: Y }
|
|
115
115
|
}, { onSuccess: () => {
|
|
116
|
-
te(ee), e.success(
|
|
116
|
+
te(ee), e.success(p.createSuccessToast), j(u), N([]), I(void 0), P(!1), k(!1);
|
|
117
117
|
} });
|
|
118
118
|
}, Ge = () => {
|
|
119
119
|
if (Z && q) {
|
|
@@ -130,23 +130,22 @@ function f({ labels: a, featureLabels: se, isBankingTaglineVisible: f = !0, bank
|
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
B.mutate({ body: { nickname: A.nickname.trim() } }, { onSuccess: (e) => {
|
|
133
|
-
|
|
133
|
+
m(i.AccountCreated, { accountId: e?.id }), e?.id && (I(e.id), We(e.id));
|
|
134
134
|
} });
|
|
135
135
|
}
|
|
136
136
|
}, Ke = (e, t) => {
|
|
137
137
|
G.find((t) => t.id === e)?.locked || N((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
|
|
138
138
|
}, qe = (e) => {
|
|
139
|
-
e && !Z || (e && (j(u), N([]), I(void 0), P(!1), B.reset(), V.reset()),
|
|
140
|
-
}, Je = B.isPending || V.isPending, Ye =
|
|
139
|
+
e && !Z || (e && (j(u), N([]), I(void 0), P(!1), B.reset(), V.reset()), k(e));
|
|
140
|
+
}, Je = B.isPending || V.isPending, Ye = le(G, {
|
|
141
141
|
selectedUserIds: M,
|
|
142
|
-
disabled: Je || !
|
|
143
|
-
fallbackTooltip:
|
|
142
|
+
disabled: Je || !y.canWrite,
|
|
143
|
+
fallbackTooltip: Oe.teamMemberAccessTooltip,
|
|
144
144
|
onUserToggle: Ke
|
|
145
145
|
});
|
|
146
146
|
return {
|
|
147
147
|
"data-testid": De,
|
|
148
|
-
selectedAccountId:
|
|
149
|
-
title: p.title,
|
|
148
|
+
selectedAccountId: T,
|
|
150
149
|
bankDisplayName: X,
|
|
151
150
|
bankLogoSrc: xe,
|
|
152
151
|
bankLogoAlt: Se,
|
|
@@ -154,10 +153,10 @@ function f({ labels: a, featureLabels: se, isBankingTaglineVisible: f = !0, bank
|
|
|
154
153
|
shouldDisplayAvailableBalance: He,
|
|
155
154
|
isBankingTaglineVisible: f,
|
|
156
155
|
accountCards: Ue,
|
|
157
|
-
shouldDisplayAddAccountCard:
|
|
158
|
-
isLoading: !
|
|
159
|
-
isError:
|
|
160
|
-
isCreateOpen:
|
|
156
|
+
shouldDisplayAddAccountCard: y.canWrite,
|
|
157
|
+
isLoading: !_ && (!v || Ae && !g || E && (z.isLoading || z.isFetchingNextPage || z.hasNextPage)),
|
|
158
|
+
isError: _ || E && z.isError,
|
|
159
|
+
isCreateOpen: O,
|
|
161
160
|
createForm: A,
|
|
162
161
|
legalCopy: {
|
|
163
162
|
bankName: X,
|
|
@@ -178,7 +177,7 @@ function f({ labels: a, featureLabels: se, isBankingTaglineVisible: f = !0, bank
|
|
|
178
177
|
},
|
|
179
178
|
onCreateSubmit: Ge,
|
|
180
179
|
onAddAccountClick: () => qe(!0),
|
|
181
|
-
onSelectAccount:
|
|
180
|
+
onSelectAccount: D
|
|
182
181
|
};
|
|
183
182
|
}
|
|
184
183
|
function be(e, t, n) {
|
|
@@ -187,7 +186,7 @@ function be(e, t, n) {
|
|
|
187
186
|
name: e.nickname?.trim() || t.accountFallback,
|
|
188
187
|
balanceLabel: a(e.balance),
|
|
189
188
|
accountNumberLabel: e.accountNumber,
|
|
190
|
-
maskedAccountNumberLabel:
|
|
189
|
+
maskedAccountNumberLabel: o(e.accountNumber),
|
|
191
190
|
routingNumberLabel: e.routingNumber,
|
|
192
191
|
...n
|
|
193
192
|
};
|
|
@@ -10,8 +10,8 @@ import { AccountCardSkeleton as i, BankingHeader as a } from "./BankingHeader.js
|
|
|
10
10
|
import { CreateAccountDialog as o } from "./CreateAccountDialog.js";
|
|
11
11
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankAccountsWidgetUi.js
|
|
13
|
-
function u({ labels: u, "data-testid": d,
|
|
14
|
-
let
|
|
13
|
+
function u({ labels: u, "data-testid": d, bankDisplayName: f, bankLogoSrc: p, bankLogoAlt: m, availableBalanceLabel: h, shouldDisplayAvailableBalance: g, isBankingTaglineVisible: _, accountCards: v, accountCardTestId: y, shouldDisplayAddAccountCard: b, isLoading: x, isError: S, isCreateOpen: C, createForm: w, legalCopy: T, accessRows: E, isTeamMembersLoading: D, isTeamMembersError: O, isCreateSubmitDisabled: k, isCreateError: A, hasNicknameError: j, isSubmitting: M, isCreateDisabled: N, onCreateOpenChange: P, onCreateFormChange: F, onCreateSubmit: I, onAddAccountClick: L }) {
|
|
14
|
+
let R = {
|
|
15
15
|
...t,
|
|
16
16
|
...u
|
|
17
17
|
};
|
|
@@ -20,52 +20,51 @@ function u({ labels: u, "data-testid": d, title: f, bankDisplayName: p, bankLogo
|
|
|
20
20
|
"data-testid": d,
|
|
21
21
|
children: [
|
|
22
22
|
/* @__PURE__ */ c(o, {
|
|
23
|
-
labels:
|
|
24
|
-
open:
|
|
25
|
-
form:
|
|
26
|
-
legalCopy:
|
|
27
|
-
accessRows:
|
|
28
|
-
isTeamMembersLoading:
|
|
29
|
-
isTeamMembersError:
|
|
30
|
-
isSubmitDisabled:
|
|
31
|
-
isSubmitting:
|
|
32
|
-
isError:
|
|
33
|
-
hasNicknameError:
|
|
34
|
-
onOpenChange:
|
|
35
|
-
onFormChange:
|
|
36
|
-
onSubmit:
|
|
23
|
+
labels: R,
|
|
24
|
+
open: C,
|
|
25
|
+
form: w,
|
|
26
|
+
legalCopy: T,
|
|
27
|
+
accessRows: E,
|
|
28
|
+
isTeamMembersLoading: D,
|
|
29
|
+
isTeamMembersError: O,
|
|
30
|
+
isSubmitDisabled: k,
|
|
31
|
+
isSubmitting: M,
|
|
32
|
+
isError: A,
|
|
33
|
+
hasNicknameError: j,
|
|
34
|
+
onOpenChange: P,
|
|
35
|
+
onFormChange: F,
|
|
36
|
+
onSubmit: I
|
|
37
37
|
}),
|
|
38
38
|
/* @__PURE__ */ c(a, {
|
|
39
|
-
labels:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
isBankingTaglineVisible: v
|
|
39
|
+
labels: R,
|
|
40
|
+
bankDisplayName: f,
|
|
41
|
+
bankLogoSrc: p,
|
|
42
|
+
bankLogoAlt: m,
|
|
43
|
+
availableBalanceLabel: h,
|
|
44
|
+
shouldDisplayAvailableBalance: g,
|
|
45
|
+
isBankingTaglineVisible: _
|
|
47
46
|
}),
|
|
48
|
-
|
|
47
|
+
S ? /* @__PURE__ */ c(e, {
|
|
49
48
|
className: "ttw:mb-4",
|
|
50
|
-
children:
|
|
49
|
+
children: R.errorTitle
|
|
51
50
|
}) : null,
|
|
52
51
|
/* @__PURE__ */ l("div", {
|
|
53
52
|
className: "ttw:flex ttw:flex-wrap ttw:gap-6",
|
|
54
53
|
children: [
|
|
55
|
-
|
|
56
|
-
!
|
|
54
|
+
x ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(i, {}), /* @__PURE__ */ c(i, {})] }) : null,
|
|
55
|
+
!x && v.length === 0 && !b ? /* @__PURE__ */ c("p", {
|
|
57
56
|
className: "ttw:font-medium",
|
|
58
|
-
children:
|
|
57
|
+
children: R.emptyAccountsLabel
|
|
59
58
|
}) : null,
|
|
60
|
-
|
|
61
|
-
labels:
|
|
59
|
+
x ? null : v.map((e) => /* @__PURE__ */ c(n, {
|
|
60
|
+
labels: R,
|
|
62
61
|
card: e,
|
|
63
|
-
testId:
|
|
62
|
+
testId: y
|
|
64
63
|
}, e.id)),
|
|
65
|
-
!
|
|
66
|
-
labels:
|
|
67
|
-
disabled:
|
|
68
|
-
onClick:
|
|
64
|
+
!x && b ? /* @__PURE__ */ c(r, {
|
|
65
|
+
labels: R,
|
|
66
|
+
disabled: N,
|
|
67
|
+
onClick: L
|
|
69
68
|
}) : null
|
|
70
69
|
]
|
|
71
70
|
})
|