@tesouro/embedded-components-react 0.2.337 → 0.2.339

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 (66) hide show
  1. package/dist/index.css +4 -0
  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/data-access/dist/index.js +5 -5
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +103 -58
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +74 -37
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +25 -20
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +64 -48
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +4 -3
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +40 -50
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +51 -5
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +5 -71
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +71 -48
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +46 -77
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +78 -33
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +33 -117
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +138 -67
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -200
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +194 -184
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +180 -50
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +64 -12
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +12 -46
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +46 -30
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +26 -158
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +159 -31
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +32 -98
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +102 -11
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +13 -224
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +243 -4
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +4 -29
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +27 -80
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +76 -126
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +137 -3
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -4
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +2 -43
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +45 -1
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +1 -8
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +6 -9
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +9 -92
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +94 -3
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +3 -9
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +7 -20
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +14 -51
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +59 -3
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +3 -110
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +107 -8
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +8 -40
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +40 -5
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +6 -98
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +91 -171
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +179 -4
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +5 -8
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +6 -113
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +115 -1
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +0 -24
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +25 -0
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -0
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +14 -11
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +1 -0
  61. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +26 -26
  62. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/clientRegistry.js +11 -2
  63. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +94 -74
  64. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  65. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  66. package/package.json +1 -1
@@ -2,179 +2,99 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
7
- import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
8
- import "../../../shared/data-access/dist/index.js";
9
- import "../../../shared/ui/dist/index.js";
10
- import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
- import "../../../shared/feature/dist/index.js";
12
- import { AddBillDialog as i } from "../../ui/dist/index10.js";
13
- import { BillsScreen as a } from "../../ui/dist/index60.js";
14
- import "../../ui/dist/index.js";
15
- import { BillCreateDialog as o } from "./index38.js";
16
- import "./index39.js";
17
- import { BillDetailsContainer as s } from "./index42.js";
18
- import "./index43.js";
19
- import "./index49.js";
20
- import "./index50.js";
21
- import { DuplicateBillsContainer as ee } from "./index53.js";
22
- import "./index54.js";
23
- import { BILL_QUEUE_ORDER as c, BillQueue as l } from "./index55.js";
24
- import { BILLS_TAB_LABELS_EN as u } from "./index57.js";
25
- import { billsTabTestIds as d } from "./index58.js";
26
- import { useBillsTable as te } from "./index59.js";
27
- import { copyTextToClipboard as f } from "./index56.js";
5
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
6
+ import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
7
+ import { resolveVendorName as n } from "./index3.js";
8
+ import { usePayablesQuery as r, usePayablesTotalCountQuery as i } from "../../data-access/dist/index13.js";
9
+ import "../../data-access/dist/index.js";
10
+ import { derivePayableStatus as a } from "./index21.js";
11
+ import { DEFAULT_BILL_QUEUE as o, billQueueColumns as s, billQueueHasScheduledPayment as c, billQueueOffersAddPanel as l, billQueueStatuses as u, billSortColumnId as d, billSortField as f } from "./index56.js";
28
12
  import { useCallback as p, useEffect as m, useMemo as h, useState as g } from "react";
29
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
30
- import { CalendarClockIcon as y, CheckIcon as b, FilePenIcon as x, ListIcon as S, LoaderCircleIcon as C } from "lucide-react";
31
13
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js
32
- var w = "bills@business-banking.app", T = {
33
- [l.Drafts]: /* @__PURE__ */ _(x, {
34
- className: "ttw:size-4",
35
- "aria-hidden": !0
36
- }),
37
- [l.Pending]: /* @__PURE__ */ _(C, {
38
- className: "ttw:size-4",
39
- "aria-hidden": !0
40
- }),
41
- [l.Scheduled]: /* @__PURE__ */ _(y, {
42
- className: "ttw:size-4",
43
- "aria-hidden": !0
44
- }),
45
- [l.Paid]: /* @__PURE__ */ _(b, {
46
- className: "ttw:size-4",
47
- "aria-hidden": !0
48
- }),
49
- [l.All]: /* @__PURE__ */ _(S, {
50
- className: "ttw:size-4",
51
- "aria-hidden": !0
52
- })
53
- };
54
- function E({ labels: l, onEnqueueFiles: y, openPayableId: b, onOpenPayableHandled: x, poweredByBankName: S, duplicateBills: C }) {
55
- let E = h(() => ({
56
- ...u,
57
- ...l,
58
- queues: {
59
- ...u.queues,
60
- ...l?.queues
61
- },
62
- queueEmptyStates: c.reduce((e, t) => ({
63
- ...e,
64
- [t]: {
65
- ...u.queueEmptyStates[t],
66
- ...l?.queueEmptyStates?.[t]
67
- }
68
- }), {})
69
- }), [l]), [ne, D] = g(!1), [O, k] = g(), [A, j] = g(!1), [M, N] = g(), [P, F] = g(!1), [I, L] = g(!1), [R, z] = g(!1), { initResponse: B } = r(), V = t(B?.scopes, [n.PayableReadOrg]), H = t(B?.scopes, [n.PayableWriteOrg]), U = !B || V, W = !B || H, G = p((e, t) => {
70
- if (t && W) {
71
- k(e), j(!0);
72
- return;
73
- }
74
- N(e), F(!0);
75
- }, [W]), K = h(() => (C ?? []).filter((e) => e.isPossibleDuplicate).map((e) => e.id), [C]), q = te({
76
- enabled: U,
77
- onOpenBill: G,
78
- duplicateBillIds: K,
79
- duplicateBadgeLabel: E.duplicateBadge
80
- }), J = (e) => !!(e && K.includes(e)), Y = K.length, X = Y === 0 ? void 0 : Y === 1 ? E.duplicateWarningOne : E.duplicateWarningMany(Y), re = h(() => c.map((e) => ({
81
- id: e,
82
- label: E.queues[e],
83
- icon: T[e]
84
- })), [E.queues]), ie = (e) => {
85
- z(!1), N(e), F(!0);
86
- }, ae = () => {
87
- F(!1), L(!0);
88
- }, oe = h(() => ({
89
- createButton: E.createButton,
90
- addBill: { heading: E.nonEmptyHeading }
91
- }), [E.createButton, E.nonEmptyHeading]), Z = () => {
92
- D(!1), k(void 0), j(!0);
93
- }, Q = (e) => {
94
- D(!1), y?.(e);
95
- }, $ = async () => {
96
- await f(w) ? e.success(E.emailCopiedToast) : e.error(E.emailCopyFailedToast);
14
+ var _ = 10, v = [{
15
+ id: "addedOnLabel",
16
+ desc: !0
17
+ }];
18
+ function y({ enabled: y = !0, onOpenBill: b, duplicateBillIds: x, duplicateBadgeLabel: S }) {
19
+ let [C, w] = g(o), [T, E] = g(v), [D, O] = g(_), [k, A] = g(), [j, M] = g(""), [N, P] = g(""), F = p(() => A(void 0), []);
20
+ m(() => {
21
+ let e = setTimeout(() => {
22
+ P(j), F();
23
+ }, 300);
24
+ return () => clearTimeout(e);
25
+ }, [j, F]);
26
+ let I = T[0], L = f(I?.id), R = r({
27
+ limit: D,
28
+ pagination_token: k,
29
+ status__in: u(C),
30
+ has_scheduled_payment: c(C),
31
+ counterpart_name__icontains: N || void 0,
32
+ sort: L,
33
+ order: L ? I?.desc ? "desc" : "asc" : void 0,
34
+ enabled: y
35
+ }), z = R.data?.data.length === 0, B = i({ enabled: y && z }), V = !z || (B.data?.count ?? 1) > 0, H = h(() => new Set(x), [x]), U = h(() => (R.data?.data ?? []).map((r) => {
36
+ let i = a({
37
+ apiStatus: r.status,
38
+ dueDate: r.due_date,
39
+ scheduledPaymentDate: r.scheduled_payment_date
40
+ }), o = r.amount_due ?? r.total_amount, s = (e) => e == null ? "" : t(e / 100, { currencyCode: r.currency ?? "USD" });
41
+ return {
42
+ vendorLabel: n(r),
43
+ dueDateLabel: e(r.due_date),
44
+ scheduledDateLabel: e(r.scheduled_payment_date),
45
+ paidDateLabel: e(r.paid_at?.slice(0, 10)),
46
+ amountDueLabel: s(o),
47
+ amountPaidLabel: s(r.amount_paid),
48
+ amountScheduledLabel: s(r.amount_to_pay ?? o),
49
+ status: i.status,
50
+ statusTone: i.tone,
51
+ addedOnLabel: e(r.created_at?.slice(0, 10)),
52
+ duplicateBadge: H.has(r.id) ? {
53
+ label: S,
54
+ tone: "warning"
55
+ } : void 0,
56
+ onOpen: () => b(r.id, i.status === "draft")
57
+ };
58
+ }), [
59
+ R.data?.data,
60
+ H,
61
+ S,
62
+ b
63
+ ]), W = p((e) => {
64
+ let t = e;
65
+ w(t), E((e) => {
66
+ let n = e[0]?.id;
67
+ return n ? s(t).some((e) => d(e) === n) ? e : v : e;
68
+ }), F();
69
+ }, [F]), G = p((e) => {
70
+ E((t) => typeof e == "function" ? e(t) : e), F();
71
+ }, [F]), K = p((e) => {
72
+ O(e), F();
73
+ }, [F]), q = p(() => A(R.data?.next_pagination_token), [R.data?.next_pagination_token]), J = p(() => A(R.data?.prev_pagination_token), [R.data?.prev_pagination_token]), Y = p(() => {
74
+ R.refetch();
75
+ }, [R.refetch]);
76
+ return {
77
+ rows: U,
78
+ isLoading: R.isFetching || z && B.isLoading,
79
+ isError: R.isError,
80
+ onRetry: Y,
81
+ selectedFilterTabId: C,
82
+ onFilterTabChange: W,
83
+ searchValue: j,
84
+ onSearchChange: M,
85
+ hasAnyBills: V,
86
+ isSearchActive: N.length > 0,
87
+ visibleColumns: s(C),
88
+ showAddPanelWhenEmpty: l(C),
89
+ sorting: T,
90
+ onSortingChange: G,
91
+ pageSize: D,
92
+ onPageSizeChange: K,
93
+ hasNextPage: !!R.data?.next_pagination_token,
94
+ hasPrevPage: !!R.data?.prev_pagination_token,
95
+ onNextPage: q,
96
+ onPrevPage: J
97
97
  };
98
- return m(() => {
99
- b && (k(b), j(!0), x?.());
100
- }, [x, b]), /* @__PURE__ */ v("div", {
101
- "data-testid": d.root,
102
- children: [
103
- /* @__PURE__ */ _(a, {
104
- rows: q.rows,
105
- isLoading: q.isLoading || !B,
106
- isError: q.isError,
107
- onRetry: q.onRetry,
108
- sorting: q.sorting,
109
- onSortingChange: q.onSortingChange,
110
- pageSize: q.pageSize,
111
- onPageSizeChange: q.onPageSizeChange,
112
- hasNextPage: q.hasNextPage,
113
- hasPrevPage: q.hasPrevPage,
114
- onNextPage: q.onNextPage,
115
- onPrevPage: q.onPrevPage,
116
- filterTabs: re,
117
- selectedFilterTabId: q.selectedFilterTabId,
118
- onFilterTabChange: q.onFilterTabChange,
119
- searchValue: q.searchValue,
120
- onSearchChange: q.onSearchChange,
121
- visibleColumns: q.visibleColumns,
122
- isSearchActive: q.isSearchActive,
123
- showAddPanelWhenEmpty: q.showAddPanelWhenEmpty,
124
- emptyState: E.queueEmptyStates[q.selectedFilterTabId],
125
- onCreateClick: W ? () => D(!0) : void 0,
126
- onEnterManually: W ? Z : void 0,
127
- onFilesSelected: W ? Q : void 0,
128
- maxFiles: 10,
129
- emailAddress: w,
130
- onCopyEmail: $,
131
- duplicateWarning: X,
132
- onReviewDuplicates: () => z(!0),
133
- labels: oe
134
- }),
135
- R ? /* @__PURE__ */ _(ee, {
136
- open: R,
137
- onOpenChange: z,
138
- bills: C,
139
- canManageDuplicates: W,
140
- onOpenBill: ie
141
- }) : null,
142
- W ? /* @__PURE__ */ _(i, {
143
- open: ne,
144
- onOpenChange: D,
145
- onFilesSelected: Q,
146
- maxFiles: 10,
147
- onEnterManually: Z,
148
- emailAddress: w,
149
- onCopyEmail: $,
150
- labels: { heading: q.hasAnyBills ? E.nonEmptyHeading : E.emptyHeading }
151
- }) : null,
152
- A ? /* @__PURE__ */ _(o, {
153
- open: A,
154
- onOpenChange: j,
155
- payableId: O,
156
- isPossibleDuplicate: J(O)
157
- }) : null,
158
- P ? /* @__PURE__ */ _(s, {
159
- open: P,
160
- onOpenChange: F,
161
- payableId: M,
162
- onClose: () => F(!1),
163
- onExpand: ae,
164
- isPossibleDuplicate: J(M),
165
- testId: d.detailsSheet,
166
- poweredByBankName: S
167
- }) : null,
168
- I ? /* @__PURE__ */ _(o, {
169
- open: I,
170
- onOpenChange: L,
171
- payableId: M,
172
- readOnly: !0,
173
- poweredByBankName: S,
174
- isPossibleDuplicate: J(M)
175
- }) : null
176
- ]
177
- });
178
98
  }
179
99
  //#endregion
180
- export { E as BillsTab, E as default };
100
+ export { y as useBillsTable };
@@ -1,5 +1,180 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
7
+ import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
8
+ import "../../../shared/data-access/dist/index.js";
9
+ import "../../../shared/ui/dist/index.js";
10
+ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import "../../../shared/feature/dist/index.js";
12
+ import { AddBillDialog as i } from "../../ui/dist/index10.js";
13
+ import { BillsScreen as a } from "../../ui/dist/index60.js";
14
+ import "../../ui/dist/index.js";
15
+ import { BillCreateDialog as o } from "./index39.js";
16
+ import "./index40.js";
17
+ import { BillDetailsContainer as s } from "./index43.js";
18
+ import "./index44.js";
19
+ import "./index50.js";
20
+ import "./index51.js";
21
+ import { DuplicateBillsContainer as ee } from "./index54.js";
1
22
  import "./index55.js";
2
- import "./index57.js";
3
- import "./index58.js";
4
- import "./index59.js";
5
- import "./index60.js";
23
+ import { BILL_QUEUE_ORDER as c, BillQueue as l } from "./index56.js";
24
+ import { BILLS_TAB_LABELS_EN as u } from "./index58.js";
25
+ import { billsTabTestIds as d } from "./index59.js";
26
+ import { useBillsTable as te } from "./index60.js";
27
+ import { copyTextToClipboard as f } from "./index57.js";
28
+ import { useCallback as p, useEffect as m, useMemo as h, useState as g } from "react";
29
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
30
+ import { CalendarClockIcon as y, CheckIcon as b, FilePenIcon as x, ListIcon as S, LoaderCircleIcon as C } from "lucide-react";
31
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js
32
+ var w = "bills@business-banking.app", T = {
33
+ [l.Drafts]: /* @__PURE__ */ _(x, {
34
+ className: "ttw:size-4",
35
+ "aria-hidden": !0
36
+ }),
37
+ [l.Pending]: /* @__PURE__ */ _(C, {
38
+ className: "ttw:size-4",
39
+ "aria-hidden": !0
40
+ }),
41
+ [l.Scheduled]: /* @__PURE__ */ _(y, {
42
+ className: "ttw:size-4",
43
+ "aria-hidden": !0
44
+ }),
45
+ [l.Paid]: /* @__PURE__ */ _(b, {
46
+ className: "ttw:size-4",
47
+ "aria-hidden": !0
48
+ }),
49
+ [l.All]: /* @__PURE__ */ _(S, {
50
+ className: "ttw:size-4",
51
+ "aria-hidden": !0
52
+ })
53
+ };
54
+ function E({ labels: l, onEnqueueFiles: y, openPayableId: b, onOpenPayableHandled: x, poweredByBankName: S, duplicateBills: C }) {
55
+ let E = h(() => ({
56
+ ...u,
57
+ ...l,
58
+ queues: {
59
+ ...u.queues,
60
+ ...l?.queues
61
+ },
62
+ queueEmptyStates: c.reduce((e, t) => ({
63
+ ...e,
64
+ [t]: {
65
+ ...u.queueEmptyStates[t],
66
+ ...l?.queueEmptyStates?.[t]
67
+ }
68
+ }), {})
69
+ }), [l]), [ne, D] = g(!1), [O, k] = g(), [A, j] = g(!1), [M, N] = g(), [P, F] = g(!1), [I, L] = g(!1), [R, z] = g(!1), { initResponse: B } = r(), V = t(B?.scopes, [n.PayableReadOrg]), H = t(B?.scopes, [n.PayableWriteOrg]), U = !B || V, W = !B || H, G = p((e, t) => {
70
+ if (t && W) {
71
+ k(e), j(!0);
72
+ return;
73
+ }
74
+ N(e), F(!0);
75
+ }, [W]), K = h(() => (C ?? []).filter((e) => e.isPossibleDuplicate).map((e) => e.id), [C]), q = te({
76
+ enabled: U,
77
+ onOpenBill: G,
78
+ duplicateBillIds: K,
79
+ duplicateBadgeLabel: E.duplicateBadge
80
+ }), J = (e) => !!(e && K.includes(e)), Y = K.length, X = Y === 0 ? void 0 : Y === 1 ? E.duplicateWarningOne : E.duplicateWarningMany(Y), re = h(() => c.map((e) => ({
81
+ id: e,
82
+ label: E.queues[e],
83
+ icon: T[e]
84
+ })), [E.queues]), ie = (e) => {
85
+ z(!1), N(e), F(!0);
86
+ }, ae = () => {
87
+ F(!1), L(!0);
88
+ }, oe = h(() => ({
89
+ createButton: E.createButton,
90
+ addBill: { heading: E.nonEmptyHeading }
91
+ }), [E.createButton, E.nonEmptyHeading]), Z = () => {
92
+ D(!1), k(void 0), j(!0);
93
+ }, Q = (e) => {
94
+ D(!1), y?.(e);
95
+ }, $ = async () => {
96
+ await f(w) ? e.success(E.emailCopiedToast) : e.error(E.emailCopyFailedToast);
97
+ };
98
+ return m(() => {
99
+ b && (k(b), j(!0), x?.());
100
+ }, [x, b]), /* @__PURE__ */ v("div", {
101
+ "data-testid": d.root,
102
+ children: [
103
+ /* @__PURE__ */ _(a, {
104
+ rows: q.rows,
105
+ isLoading: q.isLoading || !B,
106
+ isError: q.isError,
107
+ onRetry: q.onRetry,
108
+ sorting: q.sorting,
109
+ onSortingChange: q.onSortingChange,
110
+ pageSize: q.pageSize,
111
+ onPageSizeChange: q.onPageSizeChange,
112
+ hasNextPage: q.hasNextPage,
113
+ hasPrevPage: q.hasPrevPage,
114
+ onNextPage: q.onNextPage,
115
+ onPrevPage: q.onPrevPage,
116
+ filterTabs: re,
117
+ selectedFilterTabId: q.selectedFilterTabId,
118
+ onFilterTabChange: q.onFilterTabChange,
119
+ searchValue: q.searchValue,
120
+ onSearchChange: q.onSearchChange,
121
+ visibleColumns: q.visibleColumns,
122
+ isSearchActive: q.isSearchActive,
123
+ showAddPanelWhenEmpty: q.showAddPanelWhenEmpty,
124
+ emptyState: E.queueEmptyStates[q.selectedFilterTabId],
125
+ onCreateClick: W ? () => D(!0) : void 0,
126
+ onEnterManually: W ? Z : void 0,
127
+ onFilesSelected: W ? Q : void 0,
128
+ maxFiles: 10,
129
+ emailAddress: w,
130
+ onCopyEmail: $,
131
+ duplicateWarning: X,
132
+ onReviewDuplicates: () => z(!0),
133
+ labels: oe
134
+ }),
135
+ R ? /* @__PURE__ */ _(ee, {
136
+ open: R,
137
+ onOpenChange: z,
138
+ bills: C,
139
+ canManageDuplicates: W,
140
+ onOpenBill: ie
141
+ }) : null,
142
+ W ? /* @__PURE__ */ _(i, {
143
+ open: ne,
144
+ onOpenChange: D,
145
+ onFilesSelected: Q,
146
+ maxFiles: 10,
147
+ onEnterManually: Z,
148
+ emailAddress: w,
149
+ onCopyEmail: $,
150
+ labels: { heading: q.hasAnyBills ? E.nonEmptyHeading : E.emptyHeading }
151
+ }) : null,
152
+ A ? /* @__PURE__ */ _(o, {
153
+ open: A,
154
+ onOpenChange: j,
155
+ payableId: O,
156
+ isPossibleDuplicate: J(O)
157
+ }) : null,
158
+ P ? /* @__PURE__ */ _(s, {
159
+ open: P,
160
+ onOpenChange: F,
161
+ payableId: M,
162
+ onClose: () => F(!1),
163
+ onExpand: ae,
164
+ isPossibleDuplicate: J(M),
165
+ testId: d.detailsSheet,
166
+ poweredByBankName: S
167
+ }) : null,
168
+ I ? /* @__PURE__ */ _(o, {
169
+ open: I,
170
+ onOpenChange: L,
171
+ payableId: M,
172
+ readOnly: !0,
173
+ poweredByBankName: S,
174
+ isPossibleDuplicate: J(M)
175
+ }) : null
176
+ ]
177
+ });
178
+ }
179
+ //#endregion
180
+ export { E as BillsTab, E as default };
@@ -1,8 +1,5 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js
2
- var e = {
3
- bills: "Bills",
4
- vendors: "Vendors",
5
- settings: "Settings"
6
- };
7
- //#endregion
8
- export { e as DEFAULT_TABS_LABELS };
1
+ import "./index56.js";
2
+ import "./index58.js";
3
+ import "./index59.js";
4
+ import "./index60.js";
5
+ import "./index61.js";
@@ -1,115 +1,8 @@
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 "./index49.js";
20
- import "./index50.js";
21
- import { billsTabTestIds as u } from "./index58.js";
22
- import { BillsTab as d } from "./index60.js";
23
- import "./index61.js";
24
- import { BillPayWidgetAnalyticsEvent as f, WIDGET_NAME as p } from "./index44.js";
25
- import { DEFAULT_TABS_LABELS as m } from "./index62.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
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.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
- showTitle: !1,
66
- onViewAllDocuments: () => P(S.Bills)
67
- })
68
- }];
69
- M && z.push({
70
- id: S.Settings,
71
- label: k.settings,
72
- content: /* @__PURE__ */ b(c, {
73
- labels: w,
74
- componentLabels: T
75
- })
76
- });
77
- let B = z.some((e) => e.id === N) ? N : C.find((e) => z.some((t) => t.id === e)) ?? z[0]?.id ?? "";
78
- return /* @__PURE__ */ x(y, { children: [
79
- /* @__PURE__ */ b(n, {}),
80
- /* @__PURE__ */ b(o, {
81
- labels: i,
82
- tabs: z,
83
- selectedTabId: B,
84
- onTabChange: P
85
- }),
86
- R.isVisible ? /* @__PURE__ */ b(s, {
87
- sections: R.sections,
88
- summaryLabel: R.summaryLabel,
89
- collapsed: R.collapsed,
90
- onToggleCollapsed: R.onToggleCollapsed,
91
- onClose: R.onClose,
92
- testId: u.uploadTray
93
- }) : null
94
- ] });
95
- }
96
- 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 }) {
97
- return /* @__PURE__ */ b(i, {
98
- widgetName: p,
99
- baseUrl: e,
100
- widgetToken: t,
101
- organizationId: n,
102
- configClient: r,
103
- gatewayRouting: a,
104
- linkComponent: o,
105
- implementation: s,
106
- uiFramework: c,
107
- errorFallback: l,
108
- onError: u,
109
- analytics: d,
110
- disclosuresAcceptance: f,
111
- children: /* @__PURE__ */ b(w, { ...m })
112
- });
113
- }
2
+ var e = {
3
+ bills: "Bills",
4
+ vendors: "Vendors",
5
+ settings: "Settings"
6
+ };
114
7
  //#endregion
115
- export { T as BillPayWidgetNative, T as default };
8
+ export { e as DEFAULT_TABS_LABELS };