@tesouro/embedded-components-react 0.11.189 → 0.11.191

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 (38) hide show
  1. package/README.md +12 -8
  2. package/dist/index.d.ts +16 -1
  3. package/dist/index.js +40 -39
  4. package/dist/lib/BillPayWidget.d.ts +16 -1
  5. package/dist/lib/BillPayWidget.js +3 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +4 -4
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +8 -8
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +180 -180
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +62 -62
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +32 -32
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +7 -7
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +20 -20
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +5 -5
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +16 -16
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +7 -7
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +3 -1
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +101 -58
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +19 -17
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +2 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +169 -138
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +227 -204
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +208 -204
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +1 -0
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index21.js +10 -10
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index23.js +212 -212
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index9.js +9 -5
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +3 -1
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +43 -39
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +66 -64
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/index.js +1 -0
  32. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +9 -9
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +5 -5
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +21 -21
  35. package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +4 -4
  36. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  37. package/dist/packages/shared-ui-shadcn/dist/index.js +1 -1
  38. package/package.json +1 -1
@@ -5,23 +5,27 @@ import { BILL_SUMMARY_CARDS_LABELS_EN as i } from "./index8.js";
5
5
  import { jsx as a } from "react/jsx-runtime";
6
6
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index9.js
7
7
  var o = 4;
8
- function s({ view: s, labels: c }) {
9
- let l = {
8
+ function s({ view: s, labels: c, onSelect: l }) {
9
+ let u = {
10
10
  ...i,
11
11
  ...c
12
12
  };
13
13
  return /* @__PURE__ */ a(r, {
14
14
  isLoading: s.kind === "loading",
15
- loadingLabel: l.loading,
15
+ loadingLabel: u.loading,
16
16
  children: /* @__PURE__ */ a(n, {
17
- "aria-label": l.group,
17
+ "aria-label": u.group,
18
18
  children: s.kind === "loading" ? Array.from({ length: o }).map((t, n) => /* @__PURE__ */ a(e, { className: "ttw:h-28 ttw:rounded-lg" }, n)) : s.cards.map((e) => /* @__PURE__ */ a(t, {
19
19
  label: e.label,
20
20
  labelTone: e.labelTone,
21
21
  amount: e.amountLabel,
22
22
  caption: e.captionLabel,
23
23
  description: e.description,
24
- labels: { info: l.info }
24
+ labels: { info: u.info },
25
+ ...l ? {
26
+ selected: e.selected,
27
+ onClick: () => l(e.id)
28
+ } : {}
25
29
  }, e.id))
26
30
  })
27
31
  });
@@ -1,2 +1,4 @@
1
- export { BillPayWidget } from "./lib/BillPayWidget/BillPayWidget.js";
1
+ import { BillSummaryCard as e } from "../../bills-list/feature/dist/index10.js";
2
+ import { BillPayWidget as t } from "./lib/BillPayWidget/BillPayWidget.js";
2
3
  import "./lib/BillPayWidget/index.js";
4
+ export { t as BillPayWidget, e as BillSummaryCard };
@@ -16,11 +16,13 @@ import "../../../../../shared/feature/dist/index.js";
16
16
  import { BillPayWidgetAnalyticsEvent as c, WIDGET_NAME as l } from "../analytics/events.js";
17
17
  import { BillPayWidgetUi as u } from "../../../../ui/dist/index14.js";
18
18
  import "../../../../ui/dist/index.js";
19
- import { BillUploadWidget as d } from "../../../../bill-upload/feature/dist/index8.js";
19
+ import { BillSummaryCard as d } from "../../../../bills-list/feature/dist/index10.js";
20
+ import "../../../../bills-list/feature/dist/index.js";
21
+ import { BillUploadWidget as f } from "../../../../bill-upload/feature/dist/index8.js";
20
22
  import "../../../../bill-upload/feature/dist/index.js";
21
- import { BillsTab as f } from "./BillsTab.js";
22
- import { BILL_PAY_WIDGET_LABELS_EN as p } from "./labels.js";
23
- import { CounterpartsWidget as m } from "../../../../../counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js";
23
+ import { BillsTab as p } from "./BillsTab.js";
24
+ import { BILL_PAY_WIDGET_LABELS_EN as m } from "./labels.js";
25
+ import { CounterpartsWidget as ee } from "../../../../../counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js";
24
26
  import "../../../../../counterparts-widget/feature/dist/index.js";
25
27
  import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
26
28
  import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
@@ -29,75 +31,77 @@ var C = {
29
31
  Bills: "bills",
30
32
  Vendors: "vendors"
31
33
  }, w = [C.Bills, C.Vendors];
32
- function T(e) {
34
+ function te(e) {
33
35
  return w.includes(e);
34
36
  }
35
- function E({ labels: a, initialTab: l = C.Bills, selectedTab: E, onTabChange: D, initialView: O, poweredByBankName: k, onSettingsClick: A }) {
37
+ function T({ labels: a, initialTab: l = C.Bills, selectedTab: d, onTabChange: T, initialView: E, poweredByBankName: D, onSettingsClick: O, selectedSummaryCard: k, onSummaryCardChange: A }) {
36
38
  let j = i();
37
39
  g(() => {
38
40
  j(c.Mounted);
39
41
  }, [j]);
40
- let M = _(() => e(p, a), [a]), { initResponse: N } = o(), P = t(N?.scopes, [n.PayableReadOrg]), F = t(N?.scopes, [n.PayableWriteOrg]), I = t(N?.scopes, [n.ApprovalPolicyWriteOrg]) && t(N?.scopes, [n.PayableWriteOrg]) && t(N?.scopes, [n.RoleReadOrg]) && t(N?.scopes, [n.UserReadOrg]), [ee, te] = y(l), L = E ?? ee, R = h((e) => {
41
- T(e) && (te(e), D?.(e));
42
- }, [D]), [z, B] = y(null), [V, H] = y(), U = h((e) => {
43
- R(C.Bills), H(e);
44
- }, [R]), W = v(null), G = h((e) => W.current?.enqueue(e), []), [K, q] = y(), J = h((e) => {
45
- R(C.Bills), q(e);
46
- }, [R]), Y = s(), [X, Z] = y(O === "create"), [ne, Q] = y(!1);
47
- X && N && !Y && (Z(!1), F && L === C.Bills && Q(!0));
42
+ let M = _(() => e(m, a), [a]), { initResponse: N } = o(), ne = t(N?.scopes, [n.PayableReadOrg]), P = t(N?.scopes, [n.PayableWriteOrg]), F = t(N?.scopes, [n.ApprovalPolicyWriteOrg]) && t(N?.scopes, [n.PayableWriteOrg]) && t(N?.scopes, [n.RoleReadOrg]) && t(N?.scopes, [n.UserReadOrg]), [I, L] = y(l), R = d ?? I, z = h((e) => {
43
+ te(e) && (L(e), T?.(e));
44
+ }, [T]), [B, V] = y(null), [H, U] = y(), W = h((e) => {
45
+ z(C.Bills), U(e);
46
+ }, [z]), G = v(null), K = h((e) => G.current?.enqueue(e), []), [q, J] = y(), Y = h((e) => {
47
+ z(C.Bills), J(e);
48
+ }, [z]), X = s(), [Z, re] = y(E === "create"), [ie, Q] = y(!1);
49
+ Z && N && !X && (re(!1), P && R === C.Bills && Q(!0));
48
50
  let $ = [{
49
51
  id: C.Bills,
50
52
  label: M.tabs.bills,
51
- content: /* @__PURE__ */ x(f, {
53
+ content: /* @__PURE__ */ x(p, {
52
54
  labels: M,
53
- onEnqueueFiles: G,
54
- openPayableId: V,
55
- onOpenPayableHandled: () => H(void 0),
56
- vendorIntent: K,
57
- onVendorIntentHandled: () => q(void 0),
58
- openAddBill: ne,
55
+ onEnqueueFiles: K,
56
+ openPayableId: H,
57
+ onOpenPayableHandled: () => U(void 0),
58
+ vendorIntent: q,
59
+ onVendorIntentHandled: () => J(void 0),
60
+ openAddBill: ie,
59
61
  onOpenAddBillHandled: () => Q(!1),
60
- poweredByBankName: k,
61
- headerActionContainer: z
62
+ poweredByBankName: D,
63
+ headerActionContainer: B,
64
+ selectedSummaryCard: k,
65
+ onSummaryCardChange: A
62
66
  })
63
67
  }, {
64
68
  id: C.Vendors,
65
69
  label: M.tabs.vendors,
66
- content: /* @__PURE__ */ x(m, {
70
+ content: /* @__PURE__ */ x(ee, {
67
71
  ...M.vendors,
68
72
  counterpartType: "vendor",
69
73
  passThrough: !0,
70
- headerActionContainer: z,
71
- onViewAllDocuments: P ? (e) => J({
74
+ headerActionContainer: B,
75
+ onViewAllDocuments: ne ? (e) => Y({
72
76
  vendorId: e.id,
73
77
  vendorName: e.name,
74
78
  action: "viewBills"
75
79
  }) : void 0,
76
- onCreateDocument: F ? (e) => J({
80
+ onCreateDocument: P ? (e) => Y({
77
81
  vendorId: e.id,
78
82
  vendorName: e.name,
79
83
  action: "createBill"
80
84
  }) : void 0
81
85
  })
82
- }], re = $.some((e) => e.id === L) ? L : w.find((e) => $.some((t) => t.id === e)) ?? $[0]?.id ?? "";
86
+ }], ae = $.some((e) => e.id === R) ? R : w.find((e) => $.some((t) => t.id === e)) ?? $[0]?.id ?? "";
83
87
  return /* @__PURE__ */ S(b, { children: [
84
88
  /* @__PURE__ */ x(r, {}),
85
89
  /* @__PURE__ */ x(u, {
86
90
  labels: M.widget,
87
91
  tabs: $,
88
- selectedTabId: re,
89
- onTabChange: R,
90
- onSettingsClick: A && I ? A : void 0,
91
- actionContainerRef: B
92
+ selectedTabId: ae,
93
+ onTabChange: z,
94
+ onSettingsClick: O && F ? O : void 0,
95
+ actionContainerRef: V
92
96
  }),
93
- /* @__PURE__ */ x(d, {
94
- ref: W,
95
- onOpenBill: U,
97
+ /* @__PURE__ */ x(f, {
98
+ ref: G,
99
+ onOpenBill: W,
96
100
  labels: M.billUpload
97
101
  })
98
102
  ] });
99
103
  }
100
- function D({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, uiFramework: s, errorFallback: c, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
104
+ function E({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, uiFramework: s, errorFallback: c, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
101
105
  return /* @__PURE__ */ x(a, {
102
106
  widgetName: l,
103
107
  baseUrl: e,
@@ -112,8 +116,8 @@ function D({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
112
116
  analytics: d,
113
117
  disclosuresAcceptance: f,
114
118
  providerLabels: p,
115
- children: /* @__PURE__ */ x(E, { ...m })
119
+ children: /* @__PURE__ */ x(T, { ...m })
116
120
  });
117
121
  }
118
- var O = D;
119
- export { O as BillPayWidget, O as default, D as BillPayWidgetWithLabels };
122
+ var D = E;
123
+ export { D as BillPayWidget, D as default, E as BillPayWidgetWithLabels, d as BillSummaryCard };
@@ -8,32 +8,32 @@ import "../../../../../shared/data-access/dist/index.js";
8
8
  import { useWidgetConfig as n } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
9
  import "../../../../../shared/feature/dist/index.js";
10
10
  import { billsTabTestIds as r } from "./testIds.js";
11
- import { BillDetailsWidget as i, BillDialogWidget as a } from "../../../../bill-detail/feature/dist/index51.js";
11
+ import { BillsListWidget as i } from "../../../../bills-list/feature/dist/index21.js";
12
+ import "../../../../bills-list/feature/dist/index.js";
13
+ import { BillDetailsWidget as a, BillDialogWidget as o } from "../../../../bill-detail/feature/dist/index51.js";
12
14
  import "../../../../bill-detail/feature/dist/index.js";
13
15
  import "../../../../bill-upload/feature/dist/index.js";
14
- import { BillsListWidget as o } from "../../../../bills-list/feature/dist/index21.js";
15
- import "../../../../bills-list/feature/dist/index.js";
16
16
  import { PayBillWidget as s } from "../../../../pay-bill/feature/dist/index14.js";
17
17
  import "../../../../pay-bill/feature/dist/index.js";
18
18
  import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
19
19
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
20
20
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js
21
- function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandled: v, vendorIntent: y, onVendorIntentHandled: b, openAddBill: x, onOpenAddBillHandled: S, poweredByBankName: C, headerActionContainer: w }) {
22
- let T = d(null), [E, D] = f(), [O, k] = f(), [A, j] = f(!1), [M, N] = f(), [P, F] = f(!1), [I, L] = f(!1), [R, z] = f(null), B = !R || {
23
- create: A,
24
- details: P,
25
- view: I
26
- }[R.surface];
21
+ function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandled: v, vendorIntent: y, onVendorIntentHandled: b, openAddBill: x, onOpenAddBillHandled: S, poweredByBankName: C, headerActionContainer: w, selectedSummaryCard: T, onSummaryCardChange: E }) {
22
+ let D = d(null), [O, k] = f(), [A, j] = f(), [M, N] = f(!1), [P, F] = f(), [I, L] = f(!1), [R, z] = f(!1), [B, V] = f(null), H = !B || {
23
+ create: M,
24
+ details: I,
25
+ view: R
26
+ }[B.surface];
27
27
  l(() => {
28
- B || z(null);
29
- }, [B]);
30
- let V = h?.payBill, H = u(() => {
28
+ H || V(null);
29
+ }, [H]);
30
+ let U = h?.payBill, W = u(() => {
31
31
  let e = (e) => (t) => /* @__PURE__ */ p(s, {
32
32
  ...t,
33
33
  poweredByBankName: C,
34
- labels: V,
35
- openFlow: R?.surface === e ? R.flow : null,
36
- onOpenFlowChange: (t) => z(t ? {
34
+ labels: U,
35
+ openFlow: B?.surface === e ? B.flow : null,
36
+ onOpenFlowChange: (t) => V(t ? {
37
37
  surface: e,
38
38
  flow: t
39
39
  } : null)
@@ -44,83 +44,85 @@ function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandle
44
44
  view: e("view")
45
45
  };
46
46
  }, [
47
- R,
47
+ B,
48
48
  C,
49
- V
50
- ]), { initResponse: U } = n(), W = !U || e(U.scopes, [t.PayableWriteOrg]), G = c((e, t) => {
51
- t && W ? (D(e), k(void 0), j(!0)) : (N(e), L(!0));
52
- }, [W]), K = (e, t) => {
53
- j(!1), L(!1), G(e, t);
54
- }, q = () => {
55
- F(!1), L(!0);
56
- }, J = () => {
57
- L(!1), F(!0);
49
+ U
50
+ ]), { initResponse: G } = n(), K = !G || e(G.scopes, [t.PayableWriteOrg]), q = c((e, t) => {
51
+ t && K ? (k(e), j(void 0), N(!0)) : (F(e), z(!0));
52
+ }, [K]), J = (e, t) => {
53
+ N(!1), z(!1), q(e, t);
58
54
  }, Y = () => {
59
- F(!1), L(!1), D(M), k(void 0), j(!0);
60
- }, X = c((e) => {
61
- D(void 0), k(e), j(!0);
55
+ L(!1), z(!0);
56
+ }, X = () => {
57
+ z(!1), L(!0);
58
+ }, Z = () => {
59
+ L(!1), z(!1), k(P), j(void 0), N(!0);
60
+ }, Q = c((e) => {
61
+ k(void 0), j(e), N(!0);
62
62
  }, []);
63
63
  return l(() => {
64
- _ && (D(_), k(void 0), j(!0), v?.());
64
+ _ && (k(_), j(void 0), N(!0), v?.());
65
65
  }, [v, _]), l(() => {
66
- y && (y.action === "createBill" ? W && X(y.vendorId) : T.current?.showVendorBills({
66
+ y && (y.action === "createBill" ? K && Q(y.vendorId) : D.current?.showVendorBills({
67
67
  id: y.vendorId,
68
68
  name: y.vendorName
69
69
  }), b?.());
70
70
  }, [
71
- W,
71
+ K,
72
72
  b,
73
- X,
73
+ Q,
74
74
  y
75
75
  ]), l(() => {
76
- x && (W && T.current?.openAddBill(), S?.());
76
+ x && (K && D.current?.openAddBill(), S?.());
77
77
  }, [
78
- W,
78
+ K,
79
79
  S,
80
80
  x
81
81
  ]), /* @__PURE__ */ m("div", {
82
82
  "data-testid": r.root,
83
83
  children: [
84
- /* @__PURE__ */ p(o, {
85
- ref: T,
84
+ /* @__PURE__ */ p(i, {
85
+ ref: D,
86
86
  labels: h?.billsList,
87
- onOpenBill: G,
88
- onEnterManually: () => X(),
87
+ onOpenBill: q,
88
+ onEnterManually: () => Q(),
89
89
  onFilesSelected: g,
90
90
  maxFiles: 10,
91
- headerActionContainer: w
91
+ headerActionContainer: w,
92
+ selectedSummaryCard: T,
93
+ onSummaryCardChange: E
92
94
  }),
93
- A ? /* @__PURE__ */ p(a, {
94
- open: A,
95
- onOpenChange: j,
96
- payableId: E,
97
- initialCounterpartId: O,
98
- onOpenBill: K,
99
- renderPaymentFlows: H.create,
95
+ M ? /* @__PURE__ */ p(o, {
96
+ open: M,
97
+ onOpenChange: N,
98
+ payableId: O,
99
+ initialCounterpartId: A,
100
+ onOpenBill: J,
101
+ renderPaymentFlows: W.create,
100
102
  copy: h?.billDialog
101
- }, E) : null,
102
- P ? /* @__PURE__ */ p(i, {
103
- open: P,
104
- onOpenChange: F,
105
- payableId: M,
106
- onClose: () => F(!1),
107
- onExpand: q,
108
- onEdit: Y,
109
- testId: r.detailsSheet,
110
- renderPaymentFlows: H.details,
111
- labels: h?.billDetails
112
- }) : null,
103
+ }, O) : null,
113
104
  I ? /* @__PURE__ */ p(a, {
114
105
  open: I,
115
106
  onOpenChange: L,
116
- payableId: M,
107
+ payableId: P,
108
+ onClose: () => L(!1),
109
+ onExpand: Y,
110
+ onEdit: Z,
111
+ testId: r.detailsSheet,
112
+ renderPaymentFlows: W.details,
113
+ labels: h?.billDetails
114
+ }) : null,
115
+ R ? /* @__PURE__ */ p(o, {
116
+ open: R,
117
+ onOpenChange: z,
118
+ payableId: P,
117
119
  readOnly: !0,
118
- onCollapse: J,
119
- onEdit: Y,
120
- onOpenBill: K,
121
- renderPaymentFlows: H.view,
120
+ onCollapse: X,
121
+ onEdit: Z,
122
+ onOpenBill: J,
123
+ renderPaymentFlows: W.view,
122
124
  copy: h?.billDialog
123
- }, M) : null
125
+ }, P) : null
124
126
  ]
125
127
  });
126
128
  }
@@ -1 +1,2 @@
1
+ import "../../../../bills-list/feature/dist/index10.js";
1
2
  import "./BillPayWidget.js";
@@ -1,7 +1,7 @@
1
- import { derivePayableStatus as e, isPayableApiStatus as t } from "../../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
2
- import { receivableFilledTone as n } from "../../../../../shared/document-status/util/dist/lib/receivableFilledTone.js";
3
- import { BILL_STATUS_BADGE_LABELS_EN as r } from "../../../../../shared/document-status/ui/dist/index2.js";
4
- import { RECEIVABLE_STATUS_BADGE_LABELS_EN as i } from "../../../../../shared/document-status/ui/dist/index6.js";
1
+ import { BILL_STATUS_BADGE_LABELS_EN as e } from "../../../../../shared/document-status/ui/dist/index2.js";
2
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as t } from "../../../../../shared/document-status/ui/dist/index6.js";
3
+ import { derivePayableStatus as n, isPayableApiStatus as r } from "../../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
4
+ import { receivableFilledTone as i } from "../../../../../shared/document-status/util/dist/lib/receivableFilledTone.js";
5
5
  import "../../../../../shared/document-status/ui/dist/index.js";
6
6
  import { formatMoney as a, isAchCompatibleBankAccount as o } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
7
7
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
@@ -16,23 +16,23 @@ function s(e) {
16
16
  function c(a, o, s, c) {
17
17
  if (a === "invoice") {
18
18
  let e = {
19
- ...i,
19
+ ...t,
20
20
  ...c.invoiceStatusBadge
21
21
  };
22
22
  return {
23
23
  status: {
24
24
  kind: "invoice",
25
25
  label: o && Object.hasOwn(e, o) ? e[o] : e.unknown,
26
- tone: n(o)
26
+ tone: i(o)
27
27
  },
28
28
  isOverdue: !1
29
29
  };
30
30
  }
31
31
  let l = {
32
- ...r,
32
+ ...e,
33
33
  ...c.billStatusBadge
34
34
  };
35
- if (!t(o)) return {
35
+ if (!r(o)) return {
36
36
  status: {
37
37
  kind: "bill",
38
38
  label: l.unknown,
@@ -40,7 +40,7 @@ function c(a, o, s, c) {
40
40
  },
41
41
  isOverdue: !1
42
42
  };
43
- let u = e({
43
+ let u = n({
44
44
  apiStatus: o,
45
45
  dueDate: s
46
46
  });
@@ -1,11 +1,11 @@
1
1
  import "../../../util/dist/lib/apiErrors.js";
2
2
  import "../../../util/dist/index.js";
3
+ import { COUNTERPART_MESSAGE_LABELS_EN as e } from "./lib/labels.js";
3
4
  import "../../ui/dist/index5.js";
4
- import { CounterpartFormFields as e, CounterpartFormSheet as t, useFocusFirstInvalidField as n } from "../../ui/dist/index10.js";
5
- import { BankAccountFormSheet as r } from "../../ui/dist/index11.js";
6
- import { ConfirmDeleteDialog as i } from "../../ui/dist/index13.js";
5
+ import { CounterpartFormFields as t, CounterpartFormSheet as n, useFocusFirstInvalidField as r } from "../../ui/dist/index10.js";
6
+ import { BankAccountFormSheet as i } from "../../ui/dist/index11.js";
7
+ import { ConfirmDeleteDialog as a } from "../../ui/dist/index13.js";
7
8
  import "../../ui/dist/index.js";
8
- import { COUNTERPART_MESSAGE_LABELS_EN as a } from "./lib/labels.js";
9
9
  import { bankAccountToAchFormValues as o, buildAnalyticsMap as s, buildCounterpartFormTaxIdField as c, buildCounterpartRows as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as d, counterpartToFormValues as f, emptyCounterpartFormValues as p, formatMoney as m, getAchInstructions as h, getCounterpartEmail as g, getCounterpartName as _, getPayableAchInstructions as v, hasCounterpartFormErrors as y, hasSelectedText as b, isAchCompatibleBankAccount as x, resolveCounterpartBankAccountWrite as S, validateAchFormValues as C, validateCounterpartForm as w } from "./lib/helpers.js";
10
10
  import { useCounterpartQuery as T, useCounterpartsByIdsQuery as E, useCounterpartsQuery as D, useCreateCounterpartMutation as O } from "../../data-access/dist/index3.js";
11
11
  import { useCreateCounterpartBankAccountMutation as k, useUpdateCounterpartBankAccountMutation as A } from "../../data-access/dist/index4.js";
@@ -18,4 +18,4 @@ import { useCounterpartForm as F } from "./lib/useCounterpartForm.js";
18
18
  import { useDeleteController as I } from "./lib/useDeleteController.js";
19
19
  import "./lib/useSubEntityForm.js";
20
20
  import { useBankAccountForm as L } from "./lib/subEntityForms.js";
21
- export { r as BankAccountFormSheet, a as COUNTERPART_MESSAGE_LABELS_EN, i as ConfirmDeleteDialog, e as CounterpartFormFields, t as CounterpartFormSheet, o as bankAccountToAchFormValues, s as buildAnalyticsMap, c as buildCounterpartFormTaxIdField, l as buildCounterpartRows, u as counterpartFormBankAccountToCreatePayload, d as counterpartFormBankAccountToUpdatePayload, f as counterpartToFormValues, p as emptyCounterpartFormValues, m as formatMoney, h as getAchInstructions, g as getCounterpartEmail, _ as getCounterpartName, v as getPayableAchInstructions, y as hasCounterpartFormErrors, b as hasSelectedText, x as isAchCompatibleBankAccount, S as resolveCounterpartBankAccountWrite, L as useBankAccountForm, j as useCounterpartAddressesForRowsQuery, M as useCounterpartAddressesQuery, N as useCounterpartDetails, F as useCounterpartForm, T as useCounterpartQuery, E as useCounterpartsByIdsQuery, D as useCounterpartsQuery, k as useCreateCounterpartBankAccountMutation, O as useCreateCounterpartMutation, I as useDeleteController, n as useFocusFirstInvalidField, P as usePayableAchInstructions, A as useUpdateCounterpartBankAccountMutation, C as validateAchFormValues, w as validateCounterpartForm };
21
+ export { i as BankAccountFormSheet, e as COUNTERPART_MESSAGE_LABELS_EN, a as ConfirmDeleteDialog, t as CounterpartFormFields, n as CounterpartFormSheet, o as bankAccountToAchFormValues, s as buildAnalyticsMap, c as buildCounterpartFormTaxIdField, l as buildCounterpartRows, u as counterpartFormBankAccountToCreatePayload, d as counterpartFormBankAccountToUpdatePayload, f as counterpartToFormValues, p as emptyCounterpartFormValues, m as formatMoney, h as getAchInstructions, g as getCounterpartEmail, _ as getCounterpartName, v as getPayableAchInstructions, y as hasCounterpartFormErrors, b as hasSelectedText, x as isAchCompatibleBankAccount, S as resolveCounterpartBankAccountWrite, L as useBankAccountForm, j as useCounterpartAddressesForRowsQuery, M as useCounterpartAddressesQuery, N as useCounterpartDetails, F as useCounterpartForm, T as useCounterpartQuery, E as useCounterpartsByIdsQuery, D as useCounterpartsQuery, k as useCreateCounterpartBankAccountMutation, O as useCreateCounterpartMutation, I as useDeleteController, r as useFocusFirstInvalidField, P as usePayableAchInstructions, A as useUpdateCounterpartBankAccountMutation, C as validateAchFormValues, w as validateCounterpartForm };
@@ -2,10 +2,10 @@ import { formatMoneyExact as e } from "../../../../util/dist/lib/formatMoneyExac
2
2
  import { isValidAchAccountNumber as t } from "../../../../util/dist/lib/isValidAchAccountNumber.js";
3
3
  import { US_STATE_NAMES_EN as n } from "../../../../util/dist/lib/usStates.js";
4
4
  import "../../../../util/dist/index.js";
5
- import { COUNTERPART_FORM_SHEET_LABELS_EN as r } from "../../../ui/dist/index2.js";
6
- import { EMPTY_ADDRESS_FORM_VALUES as i } from "../../../ui/dist/index6.js";
5
+ import { COUNTERPART_MESSAGE_LABELS_EN as r } from "./labels.js";
6
+ import { COUNTERPART_FORM_SHEET_LABELS_EN as i } from "../../../ui/dist/index2.js";
7
+ import { EMPTY_ADDRESS_FORM_VALUES as a } from "../../../ui/dist/index6.js";
7
8
  import "../../../ui/dist/index.js";
8
- import { COUNTERPART_MESSAGE_LABELS_EN as a } from "./labels.js";
9
9
  // ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js
10
10
  function o(e) {
11
11
  try {
@@ -176,7 +176,7 @@ function O(e = "organization", t) {
176
176
  phone: "",
177
177
  taxId: "",
178
178
  remindersEnabled: t === "customer",
179
- address: { ...i },
179
+ address: { ...a },
180
180
  bankAccount: {
181
181
  accountHolderName: "",
182
182
  routingNumber: "",
@@ -253,14 +253,14 @@ function N(e, t) {
253
253
  };
254
254
  }
255
255
  function P(e, t, n) {
256
- let i = {
257
- ...r,
256
+ let r = {
257
+ ...i,
258
258
  ...n
259
259
  }, a = e === "individual";
260
260
  return {
261
- label: a ? n?.taxIdSsnLabel ?? n?.taxIdLabel ?? i.taxIdSsnLabel : n?.taxIdEinLabel ?? n?.taxIdLabel ?? i.taxIdEinLabel,
262
- placeholder: a ? i.taxIdSsnPlaceholder : i.taxIdEinPlaceholder,
263
- description: t === "vendor" ? i.vendorTaxIdHelp : i.customerTaxIdHelp
261
+ label: a ? n?.taxIdSsnLabel ?? n?.taxIdLabel ?? r.taxIdSsnLabel : n?.taxIdEinLabel ?? n?.taxIdLabel ?? r.taxIdEinLabel,
262
+ placeholder: a ? r.taxIdSsnPlaceholder : r.taxIdEinPlaceholder,
263
+ description: t === "vendor" ? r.vendorTaxIdHelp : r.customerTaxIdHelp
264
264
  };
265
265
  }
266
266
  function F(e) {
@@ -357,9 +357,9 @@ function J(e) {
357
357
  let t = [...e].map(Number);
358
358
  return (3 * (t[0] + t[3] + t[6]) + 7 * (t[1] + t[4] + t[7]) + (t[2] + t[5] + t[8])) % 10 == 0;
359
359
  }
360
- function Y(e, n = a) {
361
- let r = {}, i = e.accountHolderName.trim(), o = e.routingNumber.trim(), s = e.accountNumber.trim();
362
- return i.length === 0 && (r.accountHolderName = n.accountHolderNameRequired), o.length !== 0 && J(o) || (r.routingNumber = n.routingNumberInvalid), t(s) || (r.accountNumber = n.accountNumberInvalid), r;
360
+ function Y(e, n = r) {
361
+ let i = {}, a = e.accountHolderName.trim(), o = e.routingNumber.trim(), s = e.accountNumber.trim();
362
+ return a.length === 0 && (i.accountHolderName = n.accountHolderNameRequired), o.length !== 0 && J(o) || (i.routingNumber = n.routingNumberInvalid), t(s) || (i.accountNumber = n.accountNumberInvalid), i;
363
363
  }
364
364
  function X(e) {
365
365
  let t = (/^(\+?[\d\s().-]+?)\s*(?:(?:x|ext\.?)\s*\d+)?$/i.exec(e)?.[1])?.replace(/\D/g, "").length ?? 0;
@@ -368,21 +368,21 @@ function X(e) {
368
368
  function Z(e) {
369
369
  return /^[\d\s-]+$/.test(e) && e.replace(/\D/g, "").length === 9;
370
370
  }
371
- function Q(e, t = a, n = "customer", r = !1) {
372
- let i = {};
373
- e.entityType === "organization" ? e.legalName.trim().length === 0 && (i.legalName = t.legalNameRequired) : (e.firstName.trim().length === 0 && (i.firstName = t.firstNameRequired), e.lastName.trim().length === 0 && (i.lastName = t.lastNameRequired)), e.email.trim().length === 0 ? i.email = t.emailRequired : G(e.email.trim()) || (i.email = t.emailInvalid);
371
+ function Q(e, t = r, n = "customer", i = !1) {
372
+ let a = {};
373
+ e.entityType === "organization" ? e.legalName.trim().length === 0 && (a.legalName = t.legalNameRequired) : (e.firstName.trim().length === 0 && (a.firstName = t.firstNameRequired), e.lastName.trim().length === 0 && (a.lastName = t.lastNameRequired)), e.email.trim().length === 0 ? a.email = t.emailRequired : G(e.email.trim()) || (a.email = t.emailInvalid);
374
374
  let o = e.phone.trim();
375
- o && !X(o) && (i.phone = t.phoneInvalid);
375
+ o && !X(o) && (a.phone = t.phoneInvalid);
376
376
  let s = e.taxId.trim();
377
- if (s && !Z(s) && (i.taxId = t.taxIdInvalid), n === "vendor" || A(e.address)) {
377
+ if (s && !Z(s) && (a.taxId = t.taxIdInvalid), n === "vendor" || A(e.address)) {
378
378
  let n = K(e.address, t);
379
- q(n) && (i.address = n);
379
+ q(n) && (a.address = n);
380
380
  }
381
- if (n === "vendor" && (r || L(e))) {
381
+ if (n === "vendor" && (i || L(e))) {
382
382
  let n = Y(e.bankAccount, t);
383
- q(n) && (i.bankAccount = n);
383
+ q(n) && (a.bankAccount = n);
384
384
  }
385
- return i;
385
+ return a;
386
386
  }
387
387
  function $(e, t, n) {
388
388
  if (!n) return e;
@@ -1,6 +1,6 @@
1
1
  import { Badge as e, cn as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { receivableFilledTone as n } from "../../util/dist/lib/receivableFilledTone.js";
3
- import { RECEIVABLE_STATUS_BADGE_LABELS_EN as r } from "./index6.js";
2
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as n } from "./index6.js";
3
+ import { receivableFilledTone as r } from "../../util/dist/lib/receivableFilledTone.js";
4
4
  import { jsxs as i } from "react/jsx-runtime";
5
5
  // ../../libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js
6
6
  var a = {
@@ -19,12 +19,12 @@ var a = {
19
19
  };
20
20
  function s({ status: s, label: c, tone: l = "neutral", variant: u = "outline", filledTone: d, labels: f, icon: p }) {
21
21
  let m = {
22
- ...r,
22
+ ...n,
23
23
  ...f
24
24
  }, h = c ?? (s && Object.hasOwn(m, s) ? m[s] : void 0) ?? m.unknown;
25
25
  return /* @__PURE__ */ i(e, {
26
26
  variant: "outline",
27
- className: t(p && "ttw:gap-1", u === "filled" ? ["ttw:border-transparent", o[d ?? n(s)]] : a[l]),
27
+ className: t(p && "ttw:gap-1", u === "filled" ? ["ttw:border-transparent", o[d ?? r(s)]] : a[l]),
28
28
  children: [p, h]
29
29
  });
30
30
  }
@@ -1,5 +1,5 @@
1
1
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.11.189", n = "d37ca11d9eadf9053f52ee31b7a62f76e0d97a7e", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.191", n = "7caff5afe4c93191d1262c805fe83df063dcbe01", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -13335,7 +13335,7 @@ function dw({ label: e, labelTone: t = "default", amount: r, caption: i, descrip
13335
13335
  m(!h.current), h.current = !1, r?.(e);
13336
13336
  },
13337
13337
  onBlur: (e) => {
13338
- m(!1), i?.(e);
13338
+ h.current = !1, m(!1), i?.(e);
13339
13339
  },
13340
13340
  onKeyDown: (e) => {
13341
13341
  e.key === "Escape" && m(!1), s?.(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.11.189",
3
+ "version": "0.11.191",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [