@tesouro/embedded-components-react 0.4.14 → 0.4.16

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 (125) hide show
  1. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +5 -4
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +47 -21
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +20 -77
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +75 -24
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +36 -0
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +2 -2
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +2 -2
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +64 -48
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +10 -2
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +141 -118
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +93 -93
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +83 -67
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +235 -218
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +5 -5
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +9 -6
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +17 -17
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +2 -2
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +39 -39
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +2 -10
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +8 -50
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +52 -2
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +2 -0
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +26 -49
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +19 -306
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +154 -2
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +2 -9
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +60 -45
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +251 -1
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +2 -18
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +7 -48
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +49 -2
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -23
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +15 -337
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +50 -2
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +2 -16
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +21 -118
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +340 -2
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +2 -12
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +10 -97
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +99 -2
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +1 -12
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +11 -57
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +58 -1
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +1 -54
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +52 -10
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +10 -179
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +181 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -4
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +2 -39
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +41 -2
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -7
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +5 -90
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +92 -2
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -4
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +2 -14
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +16 -2
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -87
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +83 -291
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +292 -9
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +13 -1
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +1 -8
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +6 -37
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +39 -2
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +2 -39
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +36 -9
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +10 -199
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +201 -3
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +3 -17
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +15 -345
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +345 -8
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +6 -4
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +6 -91
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +93 -0
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +2 -127
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +124 -25
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +26 -87
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +89 -2
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +2 -7
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -28
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +30 -2
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -7
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +5 -32
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +34 -2
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +2 -12
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +10 -104
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +105 -1
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +2 -17
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +15 -123
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +125 -2
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +2 -18
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +14 -6
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +7 -167
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +170 -2
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +2 -14
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +11 -105
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +108 -2
  107. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index3.js +15 -3
  108. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +63 -65
  109. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +4 -2
  110. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +6 -5
  111. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +1 -1
  112. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js +8 -8
  113. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +4 -4
  114. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +5 -5
  115. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +19 -19
  116. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +39 -33
  117. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +15 -15
  118. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +9 -9
  119. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +7 -7
  120. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +37 -37
  121. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +15 -15
  122. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +7 -7
  123. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  124. package/package.json +1 -1
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +0 -2
@@ -2,15 +2,15 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { buildBankAccountItems as e, buildCounterpartDetailsView as t } from "./helpers.js";
6
- import { useCounterpartQuery as n } from "../../../data-access/dist/index3.js";
7
- import { useCounterpartBankAccountsQuery as r } from "../../../data-access/dist/index5.js";
8
- import { useCounterpartAddressesQuery as i } from "../../../data-access/dist/index7.js";
5
+ import { useCounterpartQuery as e } from "../../../data-access/dist/index3.js";
6
+ import { useCounterpartBankAccountsQuery as t } from "../../../data-access/dist/index5.js";
7
+ import { useCounterpartAddressesQuery as n } from "../../../data-access/dist/index7.js";
9
8
  import "../../../data-access/dist/index.js";
9
+ import { buildBankAccountItems as r, buildCounterpartDetailsView as i } from "./helpers.js";
10
10
  import { useMemo as a } from "react";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js
12
12
  function o({ selectedId: o, enabled: s = !0 }) {
13
- let c = s ? o : void 0, l = n(c), u = l.data, d = u?.type === "organization", f = c ?? null, p = i(f), m = r(f), h = p.data?.data, g = a(() => {
13
+ let c = s ? o : void 0, l = e(c), u = l.data, d = u?.type === "organization", f = c ?? null, p = n(f), m = t(f), h = p.data?.data, g = a(() => {
14
14
  if (!(!h || h.length === 0)) {
15
15
  if (u?.default_billing_address_id) {
16
16
  let e = h.find((e) => e.id === u.default_billing_address_id);
@@ -18,10 +18,10 @@ function o({ selectedId: o, enabled: s = !0 }) {
18
18
  }
19
19
  return h[0];
20
20
  }
21
- }, [h, u?.default_billing_address_id]), _ = a(() => u ? t({
21
+ }, [h, u?.default_billing_address_id]), _ = a(() => u ? i({
22
22
  counterpart: u,
23
23
  primaryAddress: g
24
- }) : void 0, [u, g]), v = a(() => e(m.data?.data), [m.data]);
24
+ }) : void 0, [u, g]), v = a(() => r(m.data?.data), [m.data]);
25
25
  return {
26
26
  counterpart: u,
27
27
  isOrganization: d,
@@ -3,16 +3,16 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { extractApiErrorMessage as e } from "../../../../util/dist/lib/apiErrors.js";
6
- import { addressFormToCreatePayload as t, addressFormToUpdatePayload as n, addressResponseToFormValues as r, counterpartFormBankAccountToCreatePayload as i, counterpartFormBankAccountToUpdatePayload as a, counterpartFormToCreatePayload as o, counterpartFormToUpdatePayload as s, counterpartToFormValues as c, emptyCounterpartFormValues as l, getAchInstructions as u, hasCounterpartFormAddressValues as d, hasCounterpartFormBankAccountValues as f, hasCounterpartFormErrors as p, resolveCounterpartBankAccountWrite as m, validateCounterpartForm as h } from "./helpers.js";
7
- import { useCreateCounterpartMutation as g, useUpdateCounterpartMutation as _ } from "../../../data-access/dist/index3.js";
8
- import { useCreateCounterpartBankAccountMutation as v, useUpdateCounterpartBankAccountMutation as y } from "../../../data-access/dist/index5.js";
9
- import { useCreateCounterpartAddressMutation as b, useUpdateCounterpartAddressMutation as x } from "../../../data-access/dist/index7.js";
6
+ import { useCreateCounterpartMutation as t, useUpdateCounterpartMutation as n } from "../../../data-access/dist/index3.js";
7
+ import { useCreateCounterpartBankAccountMutation as r, useUpdateCounterpartBankAccountMutation as i } from "../../../data-access/dist/index5.js";
8
+ import { useCreateCounterpartAddressMutation as a, useUpdateCounterpartAddressMutation as o } from "../../../data-access/dist/index7.js";
10
9
  import "../../../data-access/dist/index.js";
10
+ import { addressFormToCreatePayload as s, addressFormToUpdatePayload as c, addressResponseToFormValues as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as d, counterpartFormToCreatePayload as f, counterpartFormToUpdatePayload as p, counterpartToFormValues as m, emptyCounterpartFormValues as h, getAchInstructions as g, hasCounterpartFormAddressValues as _, hasCounterpartFormBankAccountValues as v, hasCounterpartFormErrors as y, resolveCounterpartBankAccountWrite as b, validateCounterpartForm as x } from "./helpers.js";
11
11
  import { useCallback as S, useState as C } from "react";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js
13
13
  function w(e, t) {
14
- if (!t) return d(e);
15
- let n = r(t);
14
+ if (!t) return _(e);
15
+ let n = l(t);
16
16
  return e.address.line1.trim() !== n.line1.trim() || e.address.line2.trim() !== n.line2.trim() || e.address.city.trim() !== n.city.trim() || e.address.state.trim() !== n.state.trim() || e.address.postalCode.trim() !== n.postalCode.trim();
17
17
  }
18
18
  function T(e) {
@@ -23,28 +23,28 @@ function T(e) {
23
23
  };
24
24
  }
25
25
  function E(e, t) {
26
- if (!t) return f(e);
26
+ if (!t) return v(e);
27
27
  let n = T(t);
28
28
  return e.bankAccount.accountHolderName.trim() !== n.accountHolderName.trim() || e.bankAccount.routingNumber.trim() !== n.routingNumber.trim() || e.bankAccount.accountNumber.trim() !== n.accountNumber.trim();
29
29
  }
30
- function D({ view: r, setView: D, selectedId: O, setSelectedId: k, messages: A, counterpartType: j, counterpart: M, primaryAddress: N, bankAccounts: P, isBankAccountsLoading: F, isBankAccountsError: I }) {
31
- let L = g(), R = b(), z = v(), B = _(), V = x(), H = y(), [U, W] = C(() => l()), [G, K] = C({}), [q, J] = C({
30
+ function D({ view: l, setView: D, selectedId: O, setSelectedId: k, messages: A, counterpartType: j, counterpart: M, primaryAddress: N, bankAccounts: P, isBankAccountsLoading: F, isBankAccountsError: I }) {
31
+ let L = t(), R = a(), z = r(), B = n(), V = o(), H = i(), [U, W] = C(() => h()), [G, K] = C({}), [q, J] = C({
32
32
  address: !1,
33
33
  bankAccount: !1
34
34
  }), [Y, X] = C(), [Z, Q] = C(), $ = L.isPending || R.isPending || z.isPending || H.isPending || B.isPending || V.isPending, ee = S(() => {
35
35
  k(void 0), Q(void 0), X(void 0), J({
36
36
  address: j === "vendor",
37
37
  bankAccount: !1
38
- }), W(l("organization", j)), K({}), D("create");
38
+ }), W(h("organization", j)), K({}), D("create");
39
39
  }, [
40
40
  j,
41
41
  k,
42
42
  D
43
43
  ]), te = S(() => {
44
44
  if (!M || j === "vendor" && (F || I)) return;
45
- let e = u(P), t = c(M, N);
45
+ let e = g(P), t = m(M, N);
46
46
  Q(void 0), X(e?.id), J({
47
- address: d(t),
47
+ address: _(t),
48
48
  bankAccount: !1
49
49
  }), W({
50
50
  ...t,
@@ -77,11 +77,11 @@ function D({ view: r, setView: D, selectedId: O, setSelectedId: k, messages: A,
77
77
  openEdit: te,
78
78
  close: ne,
79
79
  submit: S(async () => {
80
- let c = r === "edit" ? "edit" : "create", l = h(U, c, A, j, c === "edit" && j === "vendor" && !!Y);
81
- if (p(l)) {
82
- K(l), J((e) => ({
83
- address: e.address || !!l.address,
84
- bankAccount: e.bankAccount || !!l.bankAccount
80
+ let t = l === "edit" ? "edit" : "create", n = x(U, t, A, j, t === "edit" && j === "vendor" && !!Y);
81
+ if (y(n)) {
82
+ K(n), J((e) => ({
83
+ address: e.address || !!n.address,
84
+ bankAccount: e.bankAccount || !!n.bankAccount
85
85
  }));
86
86
  return;
87
87
  }
@@ -89,44 +89,44 @@ function D({ view: r, setView: D, selectedId: O, setSelectedId: k, messages: A,
89
89
  address: !1,
90
90
  bankAccount: !1
91
91
  });
92
- let g = Z;
92
+ let r = Z;
93
93
  try {
94
- if (r === "edit" && O) {
94
+ if (l === "edit" && O) {
95
95
  Q(void 0), await B.mutateAsync({
96
96
  path: { counterpart_id: O },
97
- body: s(U, j)
97
+ body: p(U, j)
98
98
  });
99
99
  let e = N ? w(U, N) ? V.mutateAsync({
100
100
  path: {
101
101
  counterpart_id: O,
102
102
  address_id: N.id
103
103
  },
104
- body: n(U.address)
105
- }) : void 0 : d(U) ? R.mutateAsync({
104
+ body: c(U.address)
105
+ }) : void 0 : _(U) ? R.mutateAsync({
106
106
  path: { counterpart_id: O },
107
- body: t(U.address)
108
- }) : void 0, r = j === "vendor" && E(U, u(P)) ? m(P, Y) : void 0, o = r?.kind === "update" ? H.mutateAsync({
107
+ body: s(U.address)
108
+ }) : void 0, t = j === "vendor" && E(U, g(P)) ? b(P, Y) : void 0, n = t?.kind === "update" ? H.mutateAsync({
109
109
  path: {
110
110
  counterpart_id: O,
111
- bank_account_id: r.bankAccountId
111
+ bank_account_id: t.bankAccountId
112
112
  },
113
- body: a(U.bankAccount, { includeAchDefaults: r.includeAchDefaults })
114
- }) : r?.kind === "create" ? z.mutateAsync({
113
+ body: d(U.bankAccount, { includeAchDefaults: t.includeAchDefaults })
114
+ }) : t?.kind === "create" ? z.mutateAsync({
115
115
  path: { counterpart_id: O },
116
- body: i(U.bankAccount, { isDefaultForCurrency: r.isDefaultForCurrency })
117
- }) : void 0, [c, l] = await Promise.allSettled([e, o]);
118
- if (r?.kind === "create" && l.status === "fulfilled" && X(l.value?.id), c.status === "rejected") throw c.reason;
119
- if (l.status === "rejected") throw l.reason;
116
+ body: u(U.bankAccount, { isDefaultForCurrency: t.isDefaultForCurrency })
117
+ }) : void 0, [r, i] = await Promise.allSettled([e, n]);
118
+ if (t?.kind === "create" && i.status === "fulfilled" && X(i.value?.id), r.status === "rejected") throw r.reason;
119
+ if (i.status === "rejected") throw i.reason;
120
120
  D("none");
121
- } else g ||= (await L.mutateAsync({ body: o(U, j) }))?.id, g && j === "vendor" && f(U) && (Q(g), await z.mutateAsync({
122
- path: { counterpart_id: g },
123
- body: i(U.bankAccount)
124
- })), Q(void 0), D("none"), g && k(g);
121
+ } else r ||= (await L.mutateAsync({ body: f(U, j) }))?.id, r && j === "vendor" && v(U) && (Q(r), await z.mutateAsync({
122
+ path: { counterpart_id: r },
123
+ body: u(U.bankAccount)
124
+ })), Q(void 0), D("none"), r && k(r);
125
125
  } catch (t) {
126
- g && (Q(g), k(g)), K({ form: e(t) ?? A.genericError });
126
+ r && (Q(r), k(r)), K({ form: e(t) ?? A.genericError });
127
127
  }
128
128
  }, [
129
- r,
129
+ l,
130
130
  U,
131
131
  O,
132
132
  Z,
@@ -2,44 +2,44 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { COUNTERPART_TYPE_BADGE_LABELS_EN as e } from "../../../ui/dist/index2.js";
6
- import "../../../ui/dist/index.js";
7
- import { getCounterpartName as t } from "./helpers.js";
8
- import { useCounterpartsQuery as n } from "../../../data-access/dist/index3.js";
5
+ import { useCounterpartsQuery as e } from "../../../data-access/dist/index3.js";
9
6
  import "../../../data-access/dist/index.js";
7
+ import { COUNTERPART_TYPE_BADGE_LABELS_EN as t } from "../../../ui/dist/index2.js";
8
+ import "../../../ui/dist/index.js";
9
+ import { getCounterpartName as n } from "./helpers.js";
10
10
  import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js
12
12
  var s = 25, c = 300;
13
- function l(n, r) {
13
+ function l(e, r) {
14
14
  let i = {
15
- ...e,
15
+ ...t,
16
16
  ...r
17
17
  };
18
- return (n ?? []).map((e) => ({
18
+ return (e ?? []).map((e) => ({
19
19
  value: e.id,
20
- label: t(e),
20
+ label: n(e),
21
21
  supportingLabel: e.type === "organization" ? i.organization : i.individual
22
22
  }));
23
23
  }
24
- function u({ value: e, onValueChange: t, mode: u = "customer", limit: d = s, debounceMs: f = c, typeLabels: p } = {}) {
25
- let [m, h] = o(e ?? ""), [g, _] = o(""), [v, y] = o("");
24
+ function u({ value: t, onValueChange: n, mode: u = "customer", limit: d = s, debounceMs: f = c, typeLabels: p } = {}) {
25
+ let [m, h] = o(t ?? ""), [g, _] = o(""), [v, y] = o("");
26
26
  i(() => {
27
- h(e ?? "");
28
- }, [e]), i(() => {
27
+ h(t ?? "");
28
+ }, [t]), i(() => {
29
29
  let e = setTimeout(() => {
30
30
  y(g.trim());
31
31
  }, f);
32
32
  return () => clearTimeout(e);
33
33
  }, [f, g]);
34
- let b = n({
34
+ let b = e({
35
35
  sort: "counterpart_name",
36
36
  order: "asc",
37
37
  limit: d,
38
38
  counterpart_name__icontains: v || void 0,
39
39
  ...u === "customer" ? { is_customer: !0 } : { is_vendor: !0 }
40
40
  }), x = a(() => l(b.data?.data, p), [b.data, p]), S = r((e) => {
41
- h(e), t?.(e);
42
- }, [t]), C = r(() => {
41
+ h(e), n?.(e);
42
+ }, [n]), C = r(() => {
43
43
  b.refetch();
44
44
  }, [b]);
45
45
  return {
@@ -2,16 +2,16 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { getPayableAchInstructions as e } from "./helpers.js";
6
- import { useCounterpartBankAccountsQuery as t } from "../../../data-access/dist/index5.js";
5
+ import { useCounterpartBankAccountsQuery as e } from "../../../data-access/dist/index5.js";
7
6
  import "../../../data-access/dist/index.js";
7
+ import { getPayableAchInstructions as t } from "./helpers.js";
8
8
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js
9
- function n({ counterpartId: n, currency: r, enabled: i = !0 } = {}) {
10
- let a = t(n, { enabled: i });
9
+ function n({ counterpartId: n, currency: r, currentBankAccountId: i, enabled: a = !0 } = {}) {
10
+ let o = e(n, { enabled: a });
11
11
  return {
12
- achInstructions: e(a.data?.data, r ?? void 0),
13
- isLoading: a.isLoading,
14
- isError: a.isError
12
+ achInstructions: t(o.data?.data, r ?? void 0, i ?? void 0),
13
+ isLoading: o.isLoading,
14
+ isError: o.isError
15
15
  };
16
16
  }
17
17
  //#endregion
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.4.14", n = "781f727543468571a818be891ac48d7daa079a14", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.4.16", n = "5e5e363c58ea4925cb54e59e4954ff26bdead369", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.4.14",
3
+ "version": "0.4.16",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {
@@ -1,2 +0,0 @@
1
- import "./index72.js";
2
- import "./index74.js";