@tesouro/embedded-components-react 0.5.204 → 0.5.205

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.
Files changed (44) hide show
  1. package/README.md +15 -14
  2. package/dist/index.d.ts +38 -0
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +38 -0
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +7 -7
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +26 -23
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +79 -2
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +53 -42
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +81 -283
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +47 -70
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +303 -99
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +68 -230
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +115 -0
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +253 -0
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +34 -19
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +14 -0
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +10 -9
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +18 -1
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +0 -3
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +0 -7
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +10 -0
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +1 -264
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +259 -67
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +61 -412
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +407 -89
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +73 -60
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +80 -331
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +20 -0
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +344 -0
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +183 -137
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +157 -20
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +24 -1
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +1 -3
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +1 -1
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +3 -18
  39. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +38 -38
  40. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +213 -202
  41. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +136 -116
  42. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  43. package/dist/packages/shared-ui-shadcn/dist/index.js +1763 -1749
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -569,20 +569,21 @@ A self-contained native widget for listing, creating, editing, and acting on cus
569
569
  | `onReceivableOpened` | `(id: string, type: ReceivableDocumentType) => void` | `undefined` | Called when the user opens a row's detail sheet. |
570
570
  | `onTemplateSettingsClick` | `() => void` | `undefined` | Shows a template settings action in the header and calls this handler when selected. |
571
571
 
572
- | Prop | Type | Default | Description |
573
- | -------------------------- | ---------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------- |
574
- | `screenLabels` | `Partial<ReceivablesScreenLabels>` | English defaults | Overrides table, tab, filter, empty, error, action, and status badge copy. |
575
- | `formLabels` | `Partial<ReceivableFormSheetLabels>` | English defaults | Overrides create/edit form labels and button copy. |
576
- | `detailsLabels` | `Partial<ReceivableDetailsSheetLabels>` | English defaults | Overrides detail sheet headings, actions, empty copy, and status badge copy. |
577
- | `sendLabels` | `Partial<ReceivableSendDialogLabels>` | English defaults | Overrides send-email dialog labels and buttons. |
578
- | `paymentLabels` | `Partial<ReceivablePaymentDialogLabels>` | English defaults | Overrides manual payment dialog labels and buttons. |
579
- | `actionLabels` | `Partial<ReceivableActionDialogLabels>` | English defaults | Overrides generic confirmation dialog buttons. Action-specific title and body copy come from `messageLabels`. |
580
- | `counterpartFormLabels` | `Partial<CounterpartFormSheetLabels>` | English defaults | Overrides inline customer creation copy from the shared counterpart-management flow. |
581
- | `measureUnitsLabels` | `Partial<MeasureUnitsManagerLabels>` | English defaults | Overrides copy of the measure-unit manager opened from a line item's unit select. |
582
- | `measureUnitDeleteLabels` | `Partial<MeasureUnitDeleteDialogLabels>` | English defaults | Overrides measure-unit delete confirmation copy. |
583
- | `messageLabels` | `Partial<ReceivableMessageLabels>` | English defaults | Overrides validation, fallback, summary, activity, and action-confirmation messages generated by the feature layer. |
584
- | `productMessageLabels` | `Partial<ProductMessageLabels>` | English defaults | Overrides product flow validation and error messages. |
585
- | `counterpartMessageLabels` | `Partial<CounterpartMessageLabels>` | English defaults | Overrides customer flow validation and error messages. |
572
+ | Prop | Type | Default | Description |
573
+ | -------------------------- | ---------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
574
+ | `embeddedBankName` | `string` | `undefined` | Display name of the sponsor bank powering embedded bank accounts (e.g. `"Zenith Bank"`). Shown next to embedded accounts in the invoice payment-account picker as "Powered by {embeddedBankName}"; omitted when unset. |
575
+ | `screenLabels` | `Partial<ReceivablesScreenLabels>` | English defaults | Overrides table, tab, filter, empty, error, action, and status badge copy. |
576
+ | `formLabels` | `Partial<ReceivableFormSheetLabels>` | English defaults | Overrides create/edit form labels and button copy. |
577
+ | `detailsLabels` | `Partial<ReceivableDetailsSheetLabels>` | English defaults | Overrides detail sheet headings, actions, empty copy, and status badge copy. |
578
+ | `sendLabels` | `Partial<ReceivableSendDialogLabels>` | English defaults | Overrides send-email dialog labels and buttons. |
579
+ | `paymentLabels` | `Partial<ReceivablePaymentDialogLabels>` | English defaults | Overrides manual payment dialog labels and buttons. |
580
+ | `actionLabels` | `Partial<ReceivableActionDialogLabels>` | English defaults | Overrides generic confirmation dialog buttons. Action-specific title and body copy come from `messageLabels`. |
581
+ | `counterpartFormLabels` | `Partial<CounterpartFormSheetLabels>` | English defaults | Overrides inline customer creation copy from the shared counterpart-management flow. |
582
+ | `measureUnitsLabels` | `Partial<MeasureUnitsManagerLabels>` | English defaults | Overrides copy of the measure-unit manager opened from a line item's unit select. |
583
+ | `measureUnitDeleteLabels` | `Partial<MeasureUnitDeleteDialogLabels>` | English defaults | Overrides measure-unit delete confirmation copy. |
584
+ | `messageLabels` | `Partial<ReceivableMessageLabels>` | English defaults | Overrides validation, fallback, summary, activity, and action-confirmation messages generated by the feature layer. |
585
+ | `productMessageLabels` | `Partial<ProductMessageLabels>` | English defaults | Overrides product flow validation and error messages. |
586
+ | `counterpartMessageLabels` | `Partial<CounterpartMessageLabels>` | English defaults | Overrides customer flow validation and error messages. |
586
587
 
587
588
  ### SettingsWidget
588
589
 
package/dist/index.d.ts CHANGED
@@ -4937,6 +4937,26 @@ interface ReceivableFormSheetLabels {
4937
4937
  closingNoteLabel: string;
4938
4938
  closingNotePlaceholder: string;
4939
4939
  closingNoteDescription: string;
4940
+ bankAccountHeading: string;
4941
+ bankAccountDescription: string;
4942
+ bankAccountLabel: string;
4943
+ bankAccountHint: string;
4944
+ bankAccountSelectorLabel: string;
4945
+ bankAccountPlaceholder: string;
4946
+ bankAccountAddOption: string;
4947
+ bankAccountFormHeading: string;
4948
+ bankAccountRoutingNumberLabel: string;
4949
+ bankAccountRoutingNumberPlaceholder: string;
4950
+ bankAccountAccountNumberLabel: string;
4951
+ bankAccountAccountNumberPlaceholder: string;
4952
+ bankAccountHolderNameLabel: string;
4953
+ bankAccountHolderNamePlaceholder: string;
4954
+ bankAccountNicknameLabel: string;
4955
+ bankAccountNicknamePlaceholder: string;
4956
+ bankAccountCancelButton: string;
4957
+ bankAccountSaveButton: string;
4958
+ bankAccountRestrictedTitle: string;
4959
+ bankAccountRestrictedDescription: string;
4940
4960
  attachmentsHeading: string;
4941
4961
  attachmentsDescription: string;
4942
4962
  attachmentsDropPrompt: string;
@@ -5020,6 +5040,22 @@ interface ReceivableMessageLabels {
5020
5040
  paymentAmountInvalid: string;
5021
5041
  genericError: string;
5022
5042
  lineItemsLoading: string;
5043
+ bankAccountFallbackName: string;
5044
+ /** `{embeddedBankName}` is replaced with the host's bank name. */
5045
+ bankAccountPoweredBy: string;
5046
+ bankAccountLinked: string;
5047
+ bankAccountHolderNameRequired: string;
5048
+ bankAccountHolderNameTooLong: string;
5049
+ bankAccountNumberRequired: string;
5050
+ bankAccountNumberDigitsOnly: string;
5051
+ bankAccountNumberTooShort: string;
5052
+ bankAccountNumberTooLong: string;
5053
+ bankAccountRoutingNumberRequired: string;
5054
+ bankAccountRoutingNumberInvalid: string;
5055
+ bankAccountNicknameTooLong: string;
5056
+ /** `{name}` is replaced with the new account's nickname. */
5057
+ bankAccountCreated: string;
5058
+ bankAccountCreateFailed: string;
5023
5059
  untitledDocument: string;
5024
5060
  unknownCustomer: string;
5025
5061
  notAvailable: string;
@@ -5083,6 +5119,8 @@ interface ReceivableMessageLabels {
5083
5119
 
5084
5120
  interface ReceivablesWidgetOwnProps {
5085
5121
  defaultTab?: ReceivablesWidgetTab;
5122
+ /** Sponsor bank shown as "Powered by {bank}" beside embedded accounts. */
5123
+ embeddedBankName?: string;
5086
5124
  enabledTabs?: ReceivablesWidgetTab[];
5087
5125
  pageSizeOptions?: number[];
5088
5126
  onReceivableCreated?: (id: string, type: ReceivableDocumentType) => void;
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import { InsightsWidget as L } from "./libs/tesouro-embedded-components-react/in
27
27
  import { UploadReceiptWidget as R } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index2.js";
28
28
  import { ExpenseManagementWidget as z } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index21.js";
29
29
  import { InvoicingWidget as B } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js";
30
- import { ReceivablesWidget as V } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js";
30
+ import { ReceivablesWidget as V } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js";
31
31
  import { SettingsSection as H } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index4.js";
32
32
  import { HELP_FAQ_EN as U } from "./libs/tesouro-embedded-components-react/settings-widget/help/ui/contract/dist/index3.js";
33
33
  import { SettingsWidget as W } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js";
@@ -981,6 +981,26 @@ interface ReceivableFormSheetLabels {
981
981
  closingNoteLabel: string;
982
982
  closingNotePlaceholder: string;
983
983
  closingNoteDescription: string;
984
+ bankAccountHeading: string;
985
+ bankAccountDescription: string;
986
+ bankAccountLabel: string;
987
+ bankAccountHint: string;
988
+ bankAccountSelectorLabel: string;
989
+ bankAccountPlaceholder: string;
990
+ bankAccountAddOption: string;
991
+ bankAccountFormHeading: string;
992
+ bankAccountRoutingNumberLabel: string;
993
+ bankAccountRoutingNumberPlaceholder: string;
994
+ bankAccountAccountNumberLabel: string;
995
+ bankAccountAccountNumberPlaceholder: string;
996
+ bankAccountHolderNameLabel: string;
997
+ bankAccountHolderNamePlaceholder: string;
998
+ bankAccountNicknameLabel: string;
999
+ bankAccountNicknamePlaceholder: string;
1000
+ bankAccountCancelButton: string;
1001
+ bankAccountSaveButton: string;
1002
+ bankAccountRestrictedTitle: string;
1003
+ bankAccountRestrictedDescription: string;
984
1004
  attachmentsHeading: string;
985
1005
  attachmentsDescription: string;
986
1006
  attachmentsDropPrompt: string;
@@ -1064,6 +1084,22 @@ interface ReceivableMessageLabels {
1064
1084
  paymentAmountInvalid: string;
1065
1085
  genericError: string;
1066
1086
  lineItemsLoading: string;
1087
+ bankAccountFallbackName: string;
1088
+ /** `{embeddedBankName}` is replaced with the host's bank name. */
1089
+ bankAccountPoweredBy: string;
1090
+ bankAccountLinked: string;
1091
+ bankAccountHolderNameRequired: string;
1092
+ bankAccountHolderNameTooLong: string;
1093
+ bankAccountNumberRequired: string;
1094
+ bankAccountNumberDigitsOnly: string;
1095
+ bankAccountNumberTooShort: string;
1096
+ bankAccountNumberTooLong: string;
1097
+ bankAccountRoutingNumberRequired: string;
1098
+ bankAccountRoutingNumberInvalid: string;
1099
+ bankAccountNicknameTooLong: string;
1100
+ /** `{name}` is replaced with the new account's nickname. */
1101
+ bankAccountCreated: string;
1102
+ bankAccountCreateFailed: string;
1067
1103
  untitledDocument: string;
1068
1104
  unknownCustomer: string;
1069
1105
  notAvailable: string;
@@ -1127,6 +1163,8 @@ interface ReceivableMessageLabels {
1127
1163
 
1128
1164
  interface ReceivablesWidgetOwnProps {
1129
1165
  defaultTab?: ReceivablesWidgetTab;
1166
+ /** Sponsor bank shown as "Powered by {bank}" beside embedded accounts. */
1167
+ embeddedBankName?: string;
1130
1168
  enabledTabs?: ReceivablesWidgetTab[];
1131
1169
  pageSizeOptions?: number[];
1132
1170
  onReceivableCreated?: (id: string, type: ReceivableDocumentType) => void;
@@ -1,3 +1,3 @@
1
- import { ReceivablesWidget as e } from "../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js";
1
+ import { ReceivablesWidget as e } from "../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js";
2
2
  import "../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js";
3
3
  export { e as ReceivablesWidget };
@@ -1,13 +1,13 @@
1
1
  import { usePaymentTermsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
2
2
  import "../../../shared/data-access/dist/index.js";
3
3
  import "./index2.js";
4
- import "./index3.js";
5
- import { useDeleteReceivableAttachmentMutation as t, useUploadReceivableAttachmentMutation as n } from "./index4.js";
6
- import { useSendReceivableEmailMutation as r } from "./index5.js";
7
- import { useAcceptReceivableMutation as i, useCancelReceivableMutation as a, useCloneReceivableMutation as o, useCreateReceivableMutation as s, useDeclineReceivableMutation as c, useDeleteReceivableMutation as l, useIssueReceivableMutation as u, useUpdateReceivableMutation as d } from "./index6.js";
4
+ import { useCreateEntityBankAccountMutation as t, usePaymentAccountsQuery as n } from "./index3.js";
5
+ import { useDeleteReceivableAttachmentMutation as r, useUploadReceivableAttachmentMutation as i } from "./index4.js";
6
+ import { useSendReceivableEmailMutation as a } from "./index5.js";
7
+ import { useAcceptReceivableMutation as o, useCancelReceivableMutation as s, useCloneReceivableMutation as c, useCreateReceivableMutation as l, useDeclineReceivableMutation as u, useDeleteReceivableMutation as d, useIssueReceivableMutation as f, useUpdateReceivableMutation as p } from "./index6.js";
8
8
  import "./index7.js";
9
- import { useMarkReceivablePaidMutation as f, useMarkReceivablePartiallyPaidMutation as p, useMarkReceivableUncollectibleMutation as m } from "./index8.js";
10
- import { useReceivableHistoryQuery as h, useReceivableMailsQuery as g, useReceivablePdfLinkQuery as _, useReceivableQuery as v, useReceivablesQuery as y } from "./index9.js";
9
+ import { useMarkReceivablePaidMutation as m, useMarkReceivablePartiallyPaidMutation as h, useMarkReceivableUncollectibleMutation as g } from "./index8.js";
10
+ import { useReceivableHistoryQuery as _, useReceivableMailsQuery as v, useReceivablePdfLinkQuery as y, useReceivableQuery as b, useReceivablesQuery as x } from "./index9.js";
11
11
  import "./index10.js";
12
12
  import "./index11.js";
13
- export { i as useAcceptReceivableMutation, a as useCancelReceivableMutation, o as useCloneReceivableMutation, s as useCreateReceivableMutation, c as useDeclineReceivableMutation, t as useDeleteReceivableAttachmentMutation, l as useDeleteReceivableMutation, u as useIssueReceivableMutation, f as useMarkReceivablePaidMutation, p as useMarkReceivablePartiallyPaidMutation, m as useMarkReceivableUncollectibleMutation, e as usePaymentTermsQuery, h as useReceivableHistoryQuery, g as useReceivableMailsQuery, _ as useReceivablePdfLinkQuery, v as useReceivableQuery, y as useReceivablesQuery, r as useSendReceivableEmailMutation, d as useUpdateReceivableMutation, n as useUploadReceivableAttachmentMutation };
13
+ export { o as useAcceptReceivableMutation, s as useCancelReceivableMutation, c as useCloneReceivableMutation, t as useCreateEntityBankAccountMutation, l as useCreateReceivableMutation, u as useDeclineReceivableMutation, r as useDeleteReceivableAttachmentMutation, d as useDeleteReceivableMutation, f as useIssueReceivableMutation, m as useMarkReceivablePaidMutation, h as useMarkReceivablePartiallyPaidMutation, g as useMarkReceivableUncollectibleMutation, n as usePaymentAccountsQuery, e as usePaymentTermsQuery, _ as useReceivableHistoryQuery, v as useReceivableMailsQuery, y as useReceivablePdfLinkQuery, b as useReceivableQuery, x as useReceivablesQuery, a as useSendReceivableEmailMutation, p as useUpdateReceivableMutation, i as useUploadReceivableAttachmentMutation };
@@ -1,48 +1,51 @@
1
- import { getAnalyticsReceivablesQueryKey as e, getFilesQueryKey as t, getPaymentRecordsQueryKey as n, getReceivablesIdHistoryQueryKey as r, getReceivablesIdMailsQueryKey as i, getReceivablesIdPdfLinkQueryKey as a, getReceivablesIdQueryKey as o, getReceivablesQueryKey as s } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
2
- import { organizationHeaders as c } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
1
+ import { getAnalyticsReceivablesQueryKey as e, getBankDetailsQueryKey as t, getFilesQueryKey as n, getPaymentRecordsQueryKey as r, getReceivablesIdHistoryQueryKey as i, getReceivablesIdMailsQueryKey as a, getReceivablesIdPdfLinkQueryKey as o, getReceivablesIdQueryKey as s, getReceivablesQueryKey as c } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
2
+ import { organizationHeaders as l } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
3
3
  import "../../../shared/data-access/dist/index.js";
4
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js
5
- var l = ({ client: e, organizationId: t }) => {
6
- let [n] = s({
5
+ var u = ({ client: e, organizationId: t }) => {
6
+ let [n] = c({
7
7
  client: e,
8
- headers: c(t)
8
+ headers: l(t)
9
9
  }), r = { ...n };
10
10
  return delete r.query, [r];
11
- }, u = ({ client: e, organizationId: t, receivableId: n }) => o({
11
+ }, d = ({ client: e, organizationId: t, receivableId: n }) => s({
12
12
  client: e,
13
- headers: c(t),
14
- path: { receivable_id: n }
15
- }), d = ({ client: e, organizationId: t, receivableId: n }) => r({
16
- client: e,
17
- headers: c(t),
13
+ headers: l(t),
18
14
  path: { receivable_id: n }
19
15
  }), f = ({ client: e, organizationId: t, receivableId: n }) => i({
20
16
  client: e,
21
- headers: c(t),
17
+ headers: l(t),
22
18
  path: { receivable_id: n }
23
19
  }), p = ({ client: e, organizationId: t, receivableId: n }) => a({
24
20
  client: e,
25
- headers: c(t),
21
+ headers: l(t),
22
+ path: { receivable_id: n }
23
+ }), m = ({ client: e, organizationId: t, receivableId: n }) => o({
24
+ client: e,
25
+ headers: l(t),
26
26
  path: { receivable_id: n }
27
- }), m = ({ client: e, organizationId: n }) => {
28
- let [r] = t({
27
+ }), h = ({ client: e, organizationId: n }) => t({
28
+ client: e,
29
+ headers: l(n)
30
+ }), g = ({ client: e, organizationId: t }) => {
31
+ let [r] = n({
29
32
  client: e,
30
- headers: c(n)
33
+ headers: l(t)
31
34
  }), i = { ...r };
32
35
  return delete i.query, [i];
33
- }, h = ({ client: e, organizationId: t }) => {
34
- let [r] = n({
36
+ }, _ = ({ client: e, organizationId: t }) => {
37
+ let [n] = r({
35
38
  client: e,
36
- headers: c(t)
37
- }), i = { ...r };
39
+ headers: l(t)
40
+ }), i = { ...n };
38
41
  return delete i.query, [i];
39
- }, g = ({ client: t, organizationId: n }) => {
42
+ }, v = ({ client: t, organizationId: n }) => {
40
43
  let [r] = e({
41
44
  client: t,
42
- headers: c(n),
45
+ headers: l(n),
43
46
  query: {}
44
47
  }), i = { ...r };
45
48
  return delete i.query, [i];
46
49
  };
47
50
  //#endregion
48
- export { h as paymentRecordsInvalidationKey, m as receivableAttachmentsInvalidationKey, d as receivableHistoryInvalidationKey, u as receivableInvalidationKey, f as receivableMailsInvalidationKey, p as receivablePdfInvalidationKey, g as receivablesAnalyticsInvalidationKey, l as receivablesInvalidationKey };
51
+ export { h as entityBankAccountsInvalidationKey, _ as paymentRecordsInvalidationKey, g as receivableAttachmentsInvalidationKey, f as receivableHistoryInvalidationKey, d as receivableInvalidationKey, p as receivableMailsInvalidationKey, m as receivablePdfInvalidationKey, v as receivablesAnalyticsInvalidationKey, u as receivablesInvalidationKey };
@@ -2,6 +2,83 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
+ import { postBankDetails as e } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
+ import { getBankDetailsOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpoch as n } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import { invalidateAllClients as r } from "../../../shared/data-access/dist/lib/clientRegistry.js";
9
+ import { useEmbedApi as i } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
10
+ import { organizationHeaders as a } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
11
+ import { useAllBankAccountsQuery as o } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
12
+ import { useAllExternalBankAccountsQuery as s } from "../../../shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js";
5
13
  import "../../../shared/data-access/dist/index.js";
6
- import "react";
7
- import "@tanstack/react-query";
14
+ import { entityBankAccountsInvalidationKey as c } from "./index2.js";
15
+ import { useMemo as l } from "react";
16
+ import { useMutation as u, useQuery as d } from "@tanstack/react-query";
17
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js
18
+ function f({ enabled: e = !0 } = {}) {
19
+ let { client: r, organizationId: o, widgetToken: s, authEpoch: c, organizationPending: l } = i(), u = t({
20
+ client: r,
21
+ headers: a(o)
22
+ });
23
+ return d({
24
+ ...n(u, {
25
+ authEpoch: c,
26
+ organizationPending: l
27
+ }),
28
+ enabled: e && !!(o && s)
29
+ });
30
+ }
31
+ function p() {
32
+ let { client: t, organizationId: n } = i();
33
+ return u({
34
+ mutationFn: async ({ body: r }) => {
35
+ let { data: i } = await e({
36
+ client: t,
37
+ headers: a(n),
38
+ body: r,
39
+ throwOnError: !0
40
+ });
41
+ return i;
42
+ },
43
+ onSuccess: async () => {
44
+ await r(c({
45
+ client: t,
46
+ organizationId: n
47
+ }));
48
+ }
49
+ });
50
+ }
51
+ var m = (e) => e ? e.slice(-4) : null;
52
+ function h({ enabled: e = !0, canReadEmbedded: t = !1, canReadExternal: n = !1 } = {}) {
53
+ let { organizationId: r, widgetToken: a, organizationPending: c } = i(), u = e && !!(a && (r || c)), d = u && t, p = u && n, h = f({ enabled: e }), g = o({ enabled: d }), _ = s({ enabled: p }), v = u ? h.data?.data : void 0, y = d ? g.data?.data : void 0, b = p ? _.data?.data : void 0, x = l(() => [
54
+ ...(v ?? []).map((e) => ({
55
+ id: e.id,
56
+ type: "BANK_DETAILS",
57
+ displayName: e.display_name ?? null,
58
+ accountNumberLast4: m(e.account_number) ?? e.account_number_last4 ?? null
59
+ })),
60
+ ...(y ?? []).filter((e) => e.status === "ACTIVE").map((e) => ({
61
+ id: e.id,
62
+ type: "INTERNAL",
63
+ displayName: e.nickname ?? null,
64
+ accountNumberLast4: m(e.accountNumber)
65
+ })),
66
+ ...(b ?? []).filter((e) => e.accountStatus === "ACTIVE" && e.verificationStatus === "VERIFIED").map((e) => ({
67
+ id: e.id,
68
+ type: "EXTERNAL",
69
+ displayName: e.nickname || e.nameOnAccount || null,
70
+ accountNumberLast4: m(e.accountNumber)
71
+ }))
72
+ ], [
73
+ v,
74
+ y,
75
+ b
76
+ ]), S = u && h.isLoading || d && g.isLoading || p && _.isLoading;
77
+ return {
78
+ paymentAccounts: x,
79
+ isLoading: S,
80
+ isIncomplete: S || u && c || u && (h.isFetching || h.isError) || d && (g.isFetching || g.isError || g.hasNextPage) || p && (_.isFetching || _.isError || _.hasNextPage) || !!(u && h.data?.next_pagination_token)
81
+ };
82
+ }
83
+ //#endregion
84
+ export { p as useCreateEntityBankAccountMutation, f as useEntityBankAccountsQuery, h as usePaymentAccountsQuery };
@@ -1,3 +1,3 @@
1
1
  import { InvoicingWidget as e } from "./index3.js";
2
- import { ReceivablesWidget as t } from "./index17.js";
2
+ import { ReceivablesWidget as t } from "./index19.js";
3
3
  export { e as InvoicingWidget, t as ReceivablesWidget };
@@ -1,52 +1,63 @@
1
- import { parseQuantity as e, priceInputToMinorUnits as t } from "./index6.js";
1
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
2
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
3
+ import "../../../shared/data-access/dist/index.js";
2
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js
3
- var n = 1e4;
4
- function r({ lineItems: n, currency: r, taxRate: i }) {
5
- let a = i ? i / 100 : 0, o = 0, s = 0;
6
- for (let i of n) {
7
- let n = Math.round(t(i.price, r) * e(i.quantity));
8
- i.taxable ? o += n : s += n;
9
- }
5
+ var n = {
6
+ routingNumber: "",
7
+ accountNumber: "",
8
+ accountHolderName: "",
9
+ displayName: ""
10
+ };
11
+ function r(n) {
12
+ let r = new Set(n ?? []);
10
13
  return {
11
- taxableItemsSubtotal: o,
12
- nonTaxableItemsSubtotal: s,
13
- subtotal: o + s,
14
- rate: a
14
+ canReadEmbedded: e(r, [t.BankAccountReadOrg]),
15
+ canReadExternal: e(r, [t.ExternalBankAccountReadOrg]),
16
+ canAddAccount: e(r, [t.BankAccountWriteOrg])
15
17
  };
16
18
  }
17
- function i({ discount: e, subtotal: t }) {
18
- if (!e) return 0;
19
- let r = e.value ?? (e.type === "amount" ? e.amount : Math.round(t * e.amount / n));
20
- return Math.min(Math.max(r, 0), t);
19
+ function i(e, t) {
20
+ return [e.displayName || t.bankAccountFallbackName, e.accountNumberLast4].filter(Boolean).join(" - ");
21
21
  }
22
- function a({ taxableItemsSubtotal: e, nonTaxableItemsSubtotal: t, discountAmount: n }) {
23
- let r = e + t, i = r > 0 ? Math.round(e / r * n) : 0;
24
- return {
25
- taxableSubtotal: e - i,
26
- nonTaxableSubtotal: t - (n - i)
27
- };
22
+ function a(e, t, n) {
23
+ switch (e) {
24
+ case "INTERNAL": return t ? n.bankAccountPoweredBy.replace("{embeddedBankName}", t) : void 0;
25
+ case "EXTERNAL": return n.bankAccountLinked;
26
+ default: return;
27
+ }
28
+ }
29
+ function o({ accounts: e, embeddedBankName: t, messages: n }) {
30
+ return e.map((e) => ({
31
+ value: e.id,
32
+ label: i(e, n),
33
+ sourceLabel: a(e.type, t, n)
34
+ })).sort((e, t) => e.label.localeCompare(t.label));
35
+ }
36
+ function s({ options: e, isLoading: t, selectedId: n, isAddingAccount: r, canAddAccount: i, formValues: a, formErrors: o, isSaving: s }) {
37
+ return t ? { kind: "loading" } : e.length > 0 && !r ? {
38
+ kind: "picker",
39
+ options: e,
40
+ selected: e.find((e) => e.value === n),
41
+ canAddAccount: i
42
+ } : i ? {
43
+ kind: "form",
44
+ values: a,
45
+ errors: o,
46
+ canCancel: e.length > 0,
47
+ isSaving: s
48
+ } : { kind: "restricted" };
49
+ }
50
+ function c(e, t) {
51
+ let n = {}, r = e.accountHolderName.trim(), i = e.accountNumber.trim(), a = e.routingNumber.trim();
52
+ return r ? r.length > 255 && (n.accountHolderName = t.bankAccountHolderNameTooLong) : n.accountHolderName = t.bankAccountHolderNameRequired, i ? /^\d+$/.test(i) ? i.length < 4 ? n.accountNumber = t.bankAccountNumberTooShort : i.length > 17 && (n.accountNumber = t.bankAccountNumberTooLong) : n.accountNumber = t.bankAccountNumberDigitsOnly : n.accountNumber = t.bankAccountNumberRequired, a ? /^\d{9}$/.test(a) || (n.routingNumber = t.bankAccountRoutingNumberInvalid) : n.routingNumber = t.bankAccountRoutingNumberRequired, e.displayName.length > 200 && (n.displayName = t.bankAccountNicknameTooLong), n;
28
53
  }
29
- function o({ lineItems: e, currency: t, taxRate: n, discount: o }) {
30
- let s = r({
31
- lineItems: e,
32
- currency: t,
33
- taxRate: n
34
- }), c = i({
35
- discount: o,
36
- subtotal: s.subtotal
37
- }), { taxableSubtotal: l, nonTaxableSubtotal: u } = a({
38
- ...s,
39
- discountAmount: c
40
- }), d = s.rate ? Math.round(l * s.rate) : 0, f = s.subtotal - c;
54
+ function l(e) {
41
55
  return {
42
- ...s,
43
- discountAmount: c,
44
- discountedSubtotal: f,
45
- taxableSubtotal: l,
46
- nonTaxableSubtotal: u,
47
- totalTaxes: d,
48
- total: f + d
56
+ display_name: e.displayName || void 0,
57
+ account_holder_name: e.accountHolderName.trim() || void 0,
58
+ account_number: e.accountNumber.trim() || void 0,
59
+ routing_number: e.routingNumber.trim() || void 0
49
60
  };
50
61
  }
51
62
  //#endregion
52
- export { a as allocateDiscount, o as calculateInvoiceTotals, r as calculateItemsSubtotals, i as resolveDiscountAmount };
63
+ export { n as EMPTY_BANK_ACCOUNT_FORM_VALUES, l as bankAccountFormToPayload, s as buildBankAccountSectionView, o as buildPaymentAccountOptions, r as getBankAccountPermissions, i as getPaymentAccountLineLabel, a as getPaymentAccountSourceLabel, c as validateBankAccountForm };