@tesouro/embedded-components-react 0.3.13 → 0.3.14

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 (52) hide show
  1. package/dist/index.d.ts +30 -30
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +2 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +23 -205
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +200 -185
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +199 -50
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +105 -13
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +12 -46
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +46 -30
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +26 -158
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +162 -31
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +32 -98
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +102 -13
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +13 -242
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +247 -4
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +4 -30
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +28 -82
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +76 -137
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +145 -3
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +3 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +2 -43
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +45 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +1 -8
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +6 -9
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +9 -92
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +94 -3
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +3 -9
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -20
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +14 -51
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +59 -3
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +3 -110
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +107 -8
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +8 -40
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -15
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +18 -98
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +92 -173
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +180 -4
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +5 -8
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +6 -112
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +114 -1
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +0 -24
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +25 -0
  45. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +9 -9
  46. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +6 -3
  47. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +1 -0
  48. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +1028 -1019
  50. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  52. package/package.json +1 -1
@@ -1 +1,114 @@
1
- import "./index65.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
7
+ import "../../../shared/data-access/dist/index.js";
8
+ import { EmbeddedToaster as n } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
9
+ import "../../../shared/ui/dist/index.js";
10
+ import { useAnalyticsTrack as r } from "../../../shared/feature/dist/lib/analytics/hooks.js";
11
+ import { WidgetProvider as i } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
12
+ import { useWidgetConfig as a } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
+ import "../../../shared/feature/dist/index.js";
14
+ import { BillPayWidgetUi as o } from "../../ui/dist/index44.js";
15
+ import { BillUploadStatusTray as s } from "../../ui/dist/index63.js";
16
+ import "../../ui/dist/index.js";
17
+ import { ApprovalPoliciesSettings as c } from "../../../shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js";
18
+ import "../../../shared/approval-policy/feature/dist/index.js";
19
+ import { useBillUploadQueue as l } from "./index52.js";
20
+ import "./index53.js";
21
+ import { billsTabTestIds as u } from "./index61.js";
22
+ import { BillsTab as d } from "./index63.js";
23
+ import "./index64.js";
24
+ import { BillPayWidgetAnalyticsEvent as f, WIDGET_NAME as p } from "./index47.js";
25
+ import { DEFAULT_TABS_LABELS as m } from "./index65.js";
26
+ import { CounterpartsWidget as h } from "../../../counterparts-widget/feature/dist/index8.js";
27
+ import "../../../counterparts-widget/feature/dist/index.js";
28
+ import { useCallback as g, useEffect as _, useState as v } from "react";
29
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
30
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js
31
+ var S = {
32
+ Bills: "bills",
33
+ Vendors: "vendors",
34
+ Settings: "settings"
35
+ }, C = [
36
+ S.Bills,
37
+ S.Vendors,
38
+ S.Settings
39
+ ];
40
+ function w({ labels: i, tabsLabels: p, approvalPolicyLabels: w, approvalPolicyComponentLabels: T, vendorLabels: E, poweredByBankName: D }) {
41
+ let O = r();
42
+ _(() => {
43
+ O(f.Mounted);
44
+ }, [O]);
45
+ let k = {
46
+ ...m,
47
+ ...p
48
+ }, { initResponse: A } = a(), j = e(A?.scopes, [t.ApprovalPolicyWriteOrg]), M = !A || j, [N, P] = v(S.Bills), [F, I] = v(), L = g((e) => {
49
+ P(S.Bills), I(e);
50
+ }, []), R = l({ onOpenBill: L }), z = [{
51
+ id: S.Bills,
52
+ label: k.bills,
53
+ content: /* @__PURE__ */ b(d, {
54
+ onEnqueueFiles: R.enqueue,
55
+ openPayableId: F,
56
+ onOpenPayableHandled: () => I(void 0),
57
+ poweredByBankName: D
58
+ })
59
+ }, {
60
+ id: S.Vendors,
61
+ label: k.vendors,
62
+ content: /* @__PURE__ */ b(h, {
63
+ ...E,
64
+ counterpartType: "vendor",
65
+ onViewAllDocuments: () => P(S.Bills)
66
+ })
67
+ }];
68
+ M && z.push({
69
+ id: S.Settings,
70
+ label: k.settings,
71
+ content: /* @__PURE__ */ b(c, {
72
+ labels: w,
73
+ componentLabels: T
74
+ })
75
+ });
76
+ let B = z.some((e) => e.id === N) ? N : C.find((e) => z.some((t) => t.id === e)) ?? z[0]?.id ?? "";
77
+ return /* @__PURE__ */ x(y, { children: [
78
+ /* @__PURE__ */ b(n, {}),
79
+ /* @__PURE__ */ b(o, {
80
+ labels: i,
81
+ tabs: z,
82
+ selectedTabId: B,
83
+ onTabChange: P
84
+ }),
85
+ R.isVisible ? /* @__PURE__ */ b(s, {
86
+ sections: R.sections,
87
+ summaryLabel: R.summaryLabel,
88
+ collapsed: R.collapsed,
89
+ onToggleCollapsed: R.onToggleCollapsed,
90
+ onClose: R.onClose,
91
+ testId: u.uploadTray
92
+ }) : null
93
+ ] });
94
+ }
95
+ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, ...m }) {
96
+ return /* @__PURE__ */ b(i, {
97
+ widgetName: p,
98
+ baseUrl: e,
99
+ widgetToken: t,
100
+ organizationId: n,
101
+ configClient: r,
102
+ gatewayRouting: a,
103
+ linkComponent: o,
104
+ implementation: s,
105
+ uiFramework: c,
106
+ errorFallback: l,
107
+ onError: u,
108
+ analytics: d,
109
+ disclosuresAcceptance: f,
110
+ children: /* @__PURE__ */ b(w, { ...m })
111
+ });
112
+ }
113
+ //#endregion
114
+ export { T as BillPayWidgetNative, T as default };
@@ -1,25 +1 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { Implementation as e } from "../../../shared/feature/dist/lib/WidgetProvider/types.js";
6
- import { useWidgetConfig as t } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
7
- import "../../../shared/feature/dist/index.js";
8
- import { BillPayWidgetMonite as n } from "./index47.js";
9
- import "./index48.js";
10
- import { BillPayWidgetNative as r } from "./index65.js";
11
1
  import "./index66.js";
12
- import { jsx as i } from "react/jsx-runtime";
13
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js
14
- function a({ implementation: a, ...o }) {
15
- let s = t().implementation, c = a ?? s ?? e.Monite;
16
- return c === e.Native ? /* @__PURE__ */ i(r, {
17
- implementation: c,
18
- ...o
19
- }) : /* @__PURE__ */ i(n, {
20
- implementation: c,
21
- ...o
22
- });
23
- }
24
- //#endregion
25
- export { a as BillPayWidget, a as default };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Implementation as e } from "../../../shared/feature/dist/lib/WidgetProvider/types.js";
6
+ import { useWidgetConfig as t } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
7
+ import "../../../shared/feature/dist/index.js";
8
+ import { BillPayWidgetMonite as n } from "./index48.js";
9
+ import "./index49.js";
10
+ import { BillPayWidgetNative as r } from "./index66.js";
11
+ import "./index67.js";
12
+ import { jsx as i } from "react/jsx-runtime";
13
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js
14
+ function a({ implementation: a, ...o }) {
15
+ let s = t().implementation, c = a ?? s ?? e.Monite;
16
+ return c === e.Native ? /* @__PURE__ */ i(r, {
17
+ implementation: c,
18
+ ...o
19
+ }) : /* @__PURE__ */ i(n, {
20
+ implementation: c,
21
+ ...o
22
+ });
23
+ }
24
+ //#endregion
25
+ export { a as BillPayWidget, a as default };
@@ -8,15 +8,15 @@ import "../../ui/dist/index.js";
8
8
  import { COUNTERPART_MESSAGE_LABELS_EN as s } from "./lib/labels.js";
9
9
  import { buildAnalyticsMap as c, buildCounterpartRows as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as d, formatCounterpartDate as f, formatMoney as p, getAchInstructions as m, getCounterpartEmail as h, getCounterpartName as g, getPayableAchInstructions as _, hasAchFormValues as v, hasSelectedText as y, resolveCounterpartBankAccountWrite as b, validateAchFormValues as x } from "./lib/helpers.js";
10
10
  import { useCounterpartsQuery as S } from "../../data-access/dist/index3.js";
11
- import { useCreateCounterpartBankAccountMutation as C, useUpdateCounterpartBankAccountMutation as w } from "../../data-access/dist/index5.js";
12
- import { useCounterpartAddressesForRowsQuery as T, useCounterpartAddressesQuery as E } from "../../data-access/dist/index7.js";
11
+ import { useCounterpartBankAccountsQuery as C, useCreateCounterpartBankAccountMutation as w, useUpdateCounterpartBankAccountMutation as T } from "../../data-access/dist/index5.js";
12
+ import { useCounterpartAddressesForRowsQuery as E, useCounterpartAddressesQuery as D } from "../../data-access/dist/index7.js";
13
13
  import "../../data-access/dist/index.js";
14
- import { useAddressForm as D } from "./lib/useAddressForm.js";
15
- import { useCounterpartDetails as O } from "./lib/useCounterpartDetails.js";
16
- import { useCounterpartForm as k } from "./lib/useCounterpartForm.js";
14
+ import { useAddressForm as O } from "./lib/useAddressForm.js";
15
+ import { useCounterpartDetails as k } from "./lib/useCounterpartDetails.js";
16
+ import { useCounterpartForm as A } from "./lib/useCounterpartForm.js";
17
17
  import "./lib/useCounterpartSelector.js";
18
- import { CounterpartSelector as A } from "./lib/CounterpartSelector.js";
19
- import { useDeleteController as j } from "./lib/useDeleteController.js";
18
+ import { CounterpartSelector as j } from "./lib/CounterpartSelector.js";
19
+ import { useDeleteController as M } from "./lib/useDeleteController.js";
20
20
  import "./lib/useSubEntityForm.js";
21
- import { useBankAccountForm as M } from "./lib/subEntityForms.js";
22
- export { e as AchFieldGroup, a as AddressFormSheet, i as BankAccountFormSheet, s as COUNTERPART_MESSAGE_LABELS_EN, o as ConfirmDeleteDialog, t as CounterpartFormFields, n as CounterpartFormSheet, A as CounterpartSelector, c as buildAnalyticsMap, l as buildCounterpartRows, u as counterpartFormBankAccountToCreatePayload, d as counterpartFormBankAccountToUpdatePayload, f as formatCounterpartDate, p as formatMoney, m as getAchInstructions, h as getCounterpartEmail, g as getCounterpartName, _ as getPayableAchInstructions, v as hasAchFormValues, y as hasSelectedText, b as resolveCounterpartBankAccountWrite, D as useAddressForm, M as useBankAccountForm, T as useCounterpartAddressesForRowsQuery, E as useCounterpartAddressesQuery, O as useCounterpartDetails, k as useCounterpartForm, S as useCounterpartsQuery, C as useCreateCounterpartBankAccountMutation, j as useDeleteController, r as useFocusFirstInvalidField, w as useUpdateCounterpartBankAccountMutation, x as validateAchFormValues };
21
+ import { useBankAccountForm as N } from "./lib/subEntityForms.js";
22
+ export { e as AchFieldGroup, a as AddressFormSheet, i as BankAccountFormSheet, s as COUNTERPART_MESSAGE_LABELS_EN, o as ConfirmDeleteDialog, t as CounterpartFormFields, n as CounterpartFormSheet, j as CounterpartSelector, c as buildAnalyticsMap, l as buildCounterpartRows, u as counterpartFormBankAccountToCreatePayload, d as counterpartFormBankAccountToUpdatePayload, f as formatCounterpartDate, p as formatMoney, m as getAchInstructions, h as getCounterpartEmail, g as getCounterpartName, _ as getPayableAchInstructions, v as hasAchFormValues, y as hasSelectedText, b as resolveCounterpartBankAccountWrite, O as useAddressForm, N as useBankAccountForm, E as useCounterpartAddressesForRowsQuery, D as useCounterpartAddressesQuery, C as useCounterpartBankAccountsQuery, k as useCounterpartDetails, A as useCounterpartForm, S as useCounterpartsQuery, w as useCreateCounterpartBankAccountMutation, M as useDeleteController, r as useFocusFirstInvalidField, T as useUpdateCounterpartBankAccountMutation, x as validateAchFormValues };
@@ -268,14 +268,14 @@ function N(e) {
268
268
  function P(e) {
269
269
  return N(e.bankAccount);
270
270
  }
271
- function F(e) {
271
+ function F(e, t = {}) {
272
272
  return {
273
273
  account_holder_name: e.accountHolderName.trim() || void 0,
274
274
  account_number: e.accountNumber.trim() || void 0,
275
275
  routing_number: e.routingNumber.trim() || void 0,
276
276
  country: "US",
277
277
  currency: "USD",
278
- is_default_for_currency: !0
278
+ is_default_for_currency: t.isDefaultForCurrency ?? !0
279
279
  };
280
280
  }
281
281
  function I(e, t = {}) {
@@ -309,7 +309,10 @@ function R(e, t) {
309
309
  kind: "update",
310
310
  bankAccountId: n.id,
311
311
  includeAchDefaults: !0
312
- } : { kind: "create" };
312
+ } : {
313
+ kind: "create",
314
+ isDefaultForCurrency: !(e ?? []).some((e) => e.currency === "USD" && e.is_default_for_currency)
315
+ };
313
316
  }
314
317
  function z() {
315
318
  return {
@@ -27,6 +27,7 @@ function o({ selectedId: o, enabled: s = !0 }) {
27
27
  isOrganization: d,
28
28
  isLoading: l.isLoading,
29
29
  isBankAccountsLoading: m.isLoading,
30
+ isBankAccountsFetching: m.isFetching,
30
31
  isError: l.isError,
31
32
  isBankAccountsError: m.isError,
32
33
  primaryAddress: g,
@@ -113,7 +113,7 @@ function D({ view: r, setView: D, selectedId: O, setSelectedId: k, messages: A,
113
113
  body: a(U.bankAccount, { includeAchDefaults: r.includeAchDefaults })
114
114
  }) : r?.kind === "create" ? z.mutateAsync({
115
115
  path: { counterpart_id: O },
116
- body: i(U.bankAccount)
116
+ body: i(U.bankAccount, { isDefaultForCurrency: r.isDefaultForCurrency })
117
117
  }) : void 0, [c, l] = await Promise.allSettled([e, o]);
118
118
  if (r?.kind === "create" && l.status === "fulfilled" && X(l.value?.id), c.status === "rejected") throw c.reason;
119
119
  if (l.status === "rejected") throw l.reason;