@tesouro/embedded-components-react 0.11.200 → 0.11.202

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.
@@ -16,93 +16,96 @@ 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 { BillSummaryCard as d } from "../../../../bills-list/feature/dist/index10.js";
19
+ import { BillQueue as d } from "../../../../bills-list/feature/dist/index5.js";
20
+ import { BillSummaryCard as f } from "../../../../bills-list/feature/dist/index10.js";
20
21
  import "../../../../bills-list/feature/dist/index.js";
21
- import { BillUploadWidget as f } from "../../../../bill-upload/feature/dist/index8.js";
22
+ import { BillUploadWidget as p } from "../../../../bill-upload/feature/dist/index8.js";
22
23
  import "../../../../bill-upload/feature/dist/index.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
+ import { BillsTab as m } from "./BillsTab.js";
25
+ import { BILL_PAY_WIDGET_LABELS_EN as h } from "./labels.js";
26
+ import { CounterpartsWidget as g } from "../../../../../counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js";
26
27
  import "../../../../../counterparts-widget/feature/dist/index.js";
27
- import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
28
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
28
+ import { useCallback as _, useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
29
+ import { Fragment as ee, jsx as S, jsxs as te } from "react/jsx-runtime";
29
30
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js
30
31
  var C = {
31
32
  Bills: "bills",
32
33
  Vendors: "vendors"
33
34
  }, w = [C.Bills, C.Vendors];
34
- function te(e) {
35
+ function ne(e) {
35
36
  return w.includes(e);
36
37
  }
37
- function T({ labels: a, initialTab: l = C.Bills, selectedTab: d, onTabChange: T, initialView: E, poweredByBankName: D, onSettingsClick: O, selectedSummaryCard: k, onSummaryCardChange: A }) {
38
- let j = i();
39
- g(() => {
40
- j(c.Mounted);
41
- }, [j]);
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));
38
+ function T({ labels: a, initialTab: l = C.Bills, selectedTab: d, onTabChange: f, initialView: T, poweredByBankName: E, onSettingsClick: D, selectedSummaryCard: O, onSummaryCardChange: k, selectedBillsView: A, onBillsViewChange: j }) {
39
+ let M = i();
40
+ v(() => {
41
+ M(c.Mounted);
42
+ }, [M]);
43
+ let N = y(() => e(h, a), [a]), { initResponse: P } = o(), F = t(P?.scopes, [n.PayableReadOrg]), I = t(P?.scopes, [n.PayableWriteOrg]), L = t(P?.scopes, [n.ApprovalPolicyWriteOrg]) && t(P?.scopes, [n.PayableWriteOrg]) && t(P?.scopes, [n.RoleReadOrg]) && t(P?.scopes, [n.UserReadOrg]), [R, z] = x(l), B = d ?? R, V = _((e) => {
44
+ ne(e) && (z(e), f?.(e));
45
+ }, [f]), [H, U] = x(null), [W, G] = x(), K = _((e) => {
46
+ V(C.Bills), G(e);
47
+ }, [V]), q = b(null), J = _((e) => q.current?.enqueue(e), []), [Y, X] = x(), Z = _((e) => {
48
+ V(C.Bills), X(e);
49
+ }, [V]), re = s(), [ie, ae] = x(T === "create"), [oe, Q] = x(!1);
50
+ ie && P && !re && (ae(!1), I && B === C.Bills && Q(!0));
50
51
  let $ = [{
51
52
  id: C.Bills,
52
- label: M.tabs.bills,
53
- content: /* @__PURE__ */ x(p, {
54
- labels: M,
55
- onEnqueueFiles: K,
56
- openPayableId: H,
57
- onOpenPayableHandled: () => U(void 0),
58
- vendorIntent: q,
59
- onVendorIntentHandled: () => J(void 0),
60
- openAddBill: ie,
53
+ label: N.tabs.bills,
54
+ content: /* @__PURE__ */ S(m, {
55
+ labels: N,
56
+ onEnqueueFiles: J,
57
+ openPayableId: W,
58
+ onOpenPayableHandled: () => G(void 0),
59
+ vendorIntent: Y,
60
+ onVendorIntentHandled: () => X(void 0),
61
+ openAddBill: oe,
61
62
  onOpenAddBillHandled: () => Q(!1),
62
- poweredByBankName: D,
63
- headerActionContainer: B,
64
- selectedSummaryCard: k,
65
- onSummaryCardChange: A
63
+ poweredByBankName: E,
64
+ headerActionContainer: H,
65
+ selectedSummaryCard: O,
66
+ onSummaryCardChange: k,
67
+ selectedQueue: A,
68
+ onQueueChange: j
66
69
  })
67
70
  }, {
68
71
  id: C.Vendors,
69
- label: M.tabs.vendors,
70
- content: /* @__PURE__ */ x(ee, {
71
- ...M.vendors,
72
+ label: N.tabs.vendors,
73
+ content: /* @__PURE__ */ S(g, {
74
+ ...N.vendors,
72
75
  counterpartType: "vendor",
73
76
  passThrough: !0,
74
- headerActionContainer: B,
75
- onViewAllDocuments: ne ? (e) => Y({
77
+ headerActionContainer: H,
78
+ onViewAllDocuments: F ? (e) => Z({
76
79
  vendorId: e.id,
77
80
  vendorName: e.name,
78
81
  action: "viewBills"
79
82
  }) : void 0,
80
- onCreateDocument: P ? (e) => Y({
83
+ onCreateDocument: I ? (e) => Z({
81
84
  vendorId: e.id,
82
85
  vendorName: e.name,
83
86
  action: "createBill"
84
87
  }) : void 0
85
88
  })
86
- }], ae = $.some((e) => e.id === R) ? R : w.find((e) => $.some((t) => t.id === e)) ?? $[0]?.id ?? "";
87
- return /* @__PURE__ */ S(b, { children: [
88
- /* @__PURE__ */ x(r, {}),
89
- /* @__PURE__ */ x(u, {
90
- labels: M.widget,
89
+ }], se = $.some((e) => e.id === B) ? B : w.find((e) => $.some((t) => t.id === e)) ?? $[0]?.id ?? "";
90
+ return /* @__PURE__ */ te(ee, { children: [
91
+ /* @__PURE__ */ S(r, {}),
92
+ /* @__PURE__ */ S(u, {
93
+ labels: N.widget,
91
94
  tabs: $,
92
- selectedTabId: ae,
93
- onTabChange: z,
94
- onSettingsClick: O && F ? O : void 0,
95
- actionContainerRef: V
95
+ selectedTabId: se,
96
+ onTabChange: V,
97
+ onSettingsClick: D && L ? D : void 0,
98
+ actionContainerRef: U
96
99
  }),
97
- /* @__PURE__ */ x(f, {
98
- ref: G,
99
- onOpenBill: W,
100
- labels: M.billUpload
100
+ /* @__PURE__ */ S(p, {
101
+ ref: q,
102
+ onOpenBill: K,
103
+ labels: N.billUpload
101
104
  })
102
105
  ] });
103
106
  }
104
107
  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 }) {
105
- return /* @__PURE__ */ x(a, {
108
+ return /* @__PURE__ */ S(a, {
106
109
  widgetName: l,
107
110
  baseUrl: e,
108
111
  widgetToken: t,
@@ -116,8 +119,8 @@ function E({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
116
119
  analytics: d,
117
120
  disclosuresAcceptance: f,
118
121
  providerLabels: p,
119
- children: /* @__PURE__ */ x(T, { ...m })
122
+ children: /* @__PURE__ */ S(T, { ...m })
120
123
  });
121
124
  }
122
125
  var D = E;
123
- export { D as BillPayWidget, D as default, E as BillPayWidgetWithLabels, d as BillSummaryCard };
126
+ export { D as BillPayWidget, D as default, E as BillPayWidgetWithLabels, f as BillSummaryCard, d as BillsView };
@@ -18,22 +18,22 @@ 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, 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];
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: ee, selectedQueue: E, onQueueChange: D }) {
22
+ let O = d(null), [k, A] = f(), [j, M] = f(), [N, P] = f(!1), [F, I] = f(), [L, R] = f(!1), [z, B] = f(!1), [V, H] = f(null), U = !V || {
23
+ create: N,
24
+ details: L,
25
+ view: z
26
+ }[V.surface];
27
27
  l(() => {
28
- H || V(null);
29
- }, [H]);
30
- let U = h?.payBill, W = u(() => {
28
+ U || H(null);
29
+ }, [U]);
30
+ let W = h?.payBill, G = u(() => {
31
31
  let e = (e) => (t) => /* @__PURE__ */ p(s, {
32
32
  ...t,
33
33
  poweredByBankName: C,
34
- labels: U,
35
- openFlow: B?.surface === e ? B.flow : null,
36
- onOpenFlowChange: (t) => V(t ? {
34
+ labels: W,
35
+ openFlow: V?.surface === e ? V.flow : null,
36
+ onOpenFlowChange: (t) => H(t ? {
37
37
  surface: e,
38
38
  flow: t
39
39
  } : null)
@@ -44,85 +44,87 @@ function h({ labels: h, onEnqueueFiles: g, openPayableId: _, onOpenPayableHandle
44
44
  view: e("view")
45
45
  };
46
46
  }, [
47
- B,
47
+ V,
48
48
  C,
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);
54
- }, Y = () => {
55
- L(!1), z(!0);
49
+ W
50
+ ]), { initResponse: K } = n(), q = !K || e(K.scopes, [t.PayableWriteOrg]), J = c((e, t) => {
51
+ t && q ? (A(e), M(void 0), P(!0)) : (I(e), B(!0));
52
+ }, [q]), Y = (e, t) => {
53
+ P(!1), B(!1), J(e, t);
56
54
  }, X = () => {
57
- z(!1), L(!0);
55
+ R(!1), B(!0);
58
56
  }, 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);
57
+ B(!1), R(!0);
58
+ }, Q = () => {
59
+ R(!1), B(!1), A(F), M(void 0), P(!0);
60
+ }, $ = c((e) => {
61
+ A(void 0), M(e), P(!0);
62
62
  }, []);
63
63
  return l(() => {
64
- _ && (k(_), j(void 0), N(!0), v?.());
64
+ _ && (A(_), M(void 0), P(!0), v?.());
65
65
  }, [v, _]), l(() => {
66
- y && (y.action === "createBill" ? K && Q(y.vendorId) : D.current?.showVendorBills({
66
+ y && (y.action === "createBill" ? q && $(y.vendorId) : O.current?.showVendorBills({
67
67
  id: y.vendorId,
68
68
  name: y.vendorName
69
69
  }), b?.());
70
70
  }, [
71
- K,
71
+ q,
72
72
  b,
73
- Q,
73
+ $,
74
74
  y
75
75
  ]), l(() => {
76
- x && (K && D.current?.openAddBill(), S?.());
76
+ x && (q && O.current?.openAddBill(), S?.());
77
77
  }, [
78
- K,
78
+ q,
79
79
  S,
80
80
  x
81
81
  ]), /* @__PURE__ */ m("div", {
82
82
  "data-testid": r.root,
83
83
  children: [
84
84
  /* @__PURE__ */ p(i, {
85
- ref: D,
85
+ ref: O,
86
86
  labels: h?.billsList,
87
- onOpenBill: q,
88
- onEnterManually: () => Q(),
87
+ onOpenBill: J,
88
+ onEnterManually: () => $(),
89
89
  onFilesSelected: g,
90
90
  maxFiles: 10,
91
91
  headerActionContainer: w,
92
92
  selectedSummaryCard: T,
93
- onSummaryCardChange: E
93
+ onSummaryCardChange: ee,
94
+ selectedQueue: E,
95
+ onQueueChange: D
94
96
  }),
95
- M ? /* @__PURE__ */ p(o, {
96
- open: M,
97
- onOpenChange: N,
98
- payableId: O,
99
- initialCounterpartId: A,
100
- onOpenBill: J,
101
- renderPaymentFlows: W.create,
97
+ N ? /* @__PURE__ */ p(o, {
98
+ open: N,
99
+ onOpenChange: P,
100
+ payableId: k,
101
+ initialCounterpartId: j,
102
+ onOpenBill: Y,
103
+ renderPaymentFlows: G.create,
102
104
  copy: h?.billDialog
103
- }, O) : null,
104
- I ? /* @__PURE__ */ p(a, {
105
- open: I,
106
- onOpenChange: L,
107
- payableId: P,
108
- onClose: () => L(!1),
109
- onExpand: Y,
110
- onEdit: Z,
105
+ }, k) : null,
106
+ L ? /* @__PURE__ */ p(a, {
107
+ open: L,
108
+ onOpenChange: R,
109
+ payableId: F,
110
+ onClose: () => R(!1),
111
+ onExpand: X,
112
+ onEdit: Q,
111
113
  testId: r.detailsSheet,
112
- renderPaymentFlows: W.details,
114
+ renderPaymentFlows: G.details,
113
115
  labels: h?.billDetails
114
116
  }) : null,
115
- R ? /* @__PURE__ */ p(o, {
116
- open: R,
117
- onOpenChange: z,
118
- payableId: P,
117
+ z ? /* @__PURE__ */ p(o, {
118
+ open: z,
119
+ onOpenChange: B,
120
+ payableId: F,
119
121
  readOnly: !0,
120
- onCollapse: X,
121
- onEdit: Z,
122
- onOpenBill: J,
123
- renderPaymentFlows: W.view,
122
+ onCollapse: Z,
123
+ onEdit: Q,
124
+ onOpenBill: Y,
125
+ renderPaymentFlows: G.view,
124
126
  copy: h?.billDialog
125
- }, P) : null
127
+ }, F) : null
126
128
  ]
127
129
  });
128
130
  }
@@ -1,2 +1,3 @@
1
+ import "../../../../bills-list/feature/dist/index5.js";
1
2
  import "../../../../bills-list/feature/dist/index10.js";
2
3
  import "./BillPayWidget.js";
@@ -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.200", n = "1554d623a57193104684e3c1df881e1c47493d98", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.202", n = "d933bf53ea81d7279ad8f9536a723b6d196c6444", 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.11.200",
3
+ "version": "0.11.202",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [