@tesouro/embedded-components-react 0.2.332 → 0.2.336

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 (68) hide show
  1. package/dist/index.css +3 -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/feature/dist/index.js +6 -6
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +0 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +43 -31
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +12 -46
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +46 -30
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +26 -149
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +159 -31
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +32 -98
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +102 -10
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +10 -212
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +221 -4
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +4 -29
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +27 -80
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +75 -125
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +132 -3
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +3 -4
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +2 -43
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +45 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +1 -8
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +6 -9
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +9 -92
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +94 -3
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +3 -53
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +107 -8
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +9 -16
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +37 -5
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +6 -78
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +83 -144
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +161 -4
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +5 -8
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +6 -113
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +115 -1
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +0 -24
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +25 -0
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +16 -15
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +4 -0
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +12 -204
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +254 -8
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +6 -4
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +6 -91
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +93 -0
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +2 -7
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +5 -28
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +30 -2
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +2 -7
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +5 -32
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +34 -2
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +2 -12
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +10 -104
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +105 -1
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +2 -18
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +14 -6
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +7 -167
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +170 -2
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +2 -14
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +11 -86
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +89 -2
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +2 -0
  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/dist/packages/shared-ui-shadcn/dist/index.js +1274 -1266
  67. package/package.json +1 -1
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +0 -2
@@ -1,8 +1,40 @@
1
+ import { BillQueue as e } from "./index51.js";
1
2
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js
2
- var e = {
3
- root: "bill-pay-bills-tab",
4
- uploadTray: "bill-pay-upload-tray",
5
- detailsSheet: "bill-pay-details-sheet"
3
+ var t = {
4
+ [e.Drafts]: "Drafts",
5
+ [e.Pending]: "Pending",
6
+ [e.Scheduled]: "Scheduled",
7
+ [e.Paid]: "Paid",
8
+ [e.All]: "All bills"
9
+ }, n = {
10
+ [e.Drafts]: {
11
+ title: "No drafts",
12
+ description: "Bills wait here until someone submits them for approval."
13
+ },
14
+ [e.Pending]: {
15
+ title: "Nothing to act on",
16
+ description: "Every bill has been paid, scheduled, or is still a draft."
17
+ },
18
+ [e.Scheduled]: {
19
+ title: "No scheduled bills",
20
+ description: "Bills appear here once a payment date is set for them."
21
+ },
22
+ [e.Paid]: {
23
+ title: "No paid bills",
24
+ description: "Bills appear here once their payment has gone out."
25
+ },
26
+ [e.All]: {
27
+ title: "No bills",
28
+ description: "Bills appear here as soon as they are added."
29
+ }
30
+ }, r = {
31
+ emptyHeading: "Add your first bill",
32
+ nonEmptyHeading: "Add a bill",
33
+ createButton: "Add bill",
34
+ emailCopiedToast: "Email address copied to clipboard",
35
+ emailCopyFailedToast: "Could not copy the email address",
36
+ queues: t,
37
+ queueEmptyStates: n
6
38
  };
7
39
  //#endregion
8
- export { e as billsTabTestIds };
40
+ export { r as BILLS_TAB_LABELS_EN, n as BILL_QUEUE_EMPTY_STATES_EN, t as BILL_QUEUE_LABELS_EN };
@@ -1,80 +1,8 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
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 "./index20.js";
11
- import { DEFAULT_BILL_QUEUE as o, billQueueHasScheduledPayment as s, billQueueStatuses as c, billSortField as l } from "./index50.js";
12
- import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "react";
13
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js
14
- var m = 10, h = [{
15
- id: "addedOnLabel",
16
- desc: !0
17
- }];
18
- function g({ enabled: g = !0, onOpenBill: _ }) {
19
- let [v, y] = p(o), [b, x] = p(h), [S, C] = p(m), [w, T] = p(), [E, D] = p(""), [O, k] = p(""), A = u(() => T(void 0), []);
20
- d(() => {
21
- let e = setTimeout(() => {
22
- k(E), A();
23
- }, 300);
24
- return () => clearTimeout(e);
25
- }, [E, A]);
26
- let j = b[0], M = l(j?.id), N = r({
27
- limit: S,
28
- pagination_token: w,
29
- status__in: c(v),
30
- has_scheduled_payment: s(v),
31
- counterpart_name__icontains: O || void 0,
32
- sort: M,
33
- order: M ? j?.desc ? "desc" : "asc" : void 0,
34
- enabled: g
35
- }), P = N.data?.data.length === 0, F = i({ enabled: g && P }), I = !P || (F.data?.count ?? 1) > 0, L = f(() => (N.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;
41
- return {
42
- vendorLabel: n(r),
43
- dueDateLabel: e(r.due_date),
44
- amountDueLabel: o == null ? "" : t(o / 100, { currencyCode: r.currency ?? "USD" }),
45
- status: i.status,
46
- statusTone: i.tone,
47
- addedOnLabel: e(r.created_at?.slice(0, 10)),
48
- onOpen: () => _(r.id, i.status === "draft")
49
- };
50
- }), [N.data?.data, _]), R = u((e) => {
51
- y(e), A();
52
- }, [A]), z = u((e) => {
53
- x((t) => typeof e == "function" ? e(t) : e), A();
54
- }, [A]), B = u((e) => {
55
- C(e), A();
56
- }, [A]), V = u(() => T(N.data?.next_pagination_token), [N.data?.next_pagination_token]), H = u(() => T(N.data?.prev_pagination_token), [N.data?.prev_pagination_token]), U = u(() => {
57
- N.refetch();
58
- }, [N.refetch]);
59
- return {
60
- rows: L,
61
- isLoading: N.isLoading || P && F.isLoading,
62
- isError: N.isError,
63
- onRetry: U,
64
- selectedFilterTabId: v,
65
- onFilterTabChange: R,
66
- searchValue: E,
67
- onSearchChange: D,
68
- hasAnyBills: I,
69
- sorting: b,
70
- onSortingChange: z,
71
- pageSize: S,
72
- onPageSizeChange: B,
73
- hasNextPage: !!N.data?.next_pagination_token,
74
- hasPrevPage: !!N.data?.prev_pagination_token,
75
- onNextPage: V,
76
- onPrevPage: H
77
- };
78
- }
2
+ var e = {
3
+ root: "bill-pay-bills-tab",
4
+ uploadTray: "bill-pay-upload-tray",
5
+ detailsSheet: "bill-pay-details-sheet"
6
+ };
79
7
  //#endregion
80
- export { g as useBillsTable };
8
+ export { e as billsTabTestIds };
@@ -2,151 +2,90 @@
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/index53.js";
14
- import "../../ui/dist/index.js";
15
- import { BillCreateDialog as o } from "./index37.js";
16
- import "./index38.js";
17
- import { BillDetailsContainer as s } from "./index41.js";
18
- import "./index42.js";
19
- import "./index48.js";
20
- import "./index49.js";
21
- import { BILL_QUEUE_ORDER as c, BillQueue as l } from "./index50.js";
22
- import { BILLS_TAB_LABELS_EN as u } from "./index52.js";
23
- import { billsTabTestIds as d } from "./index53.js";
24
- import { useBillsTable as f } from "./index54.js";
25
- import { copyTextToClipboard as p } from "./index51.js";
26
- import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
27
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
28
- import { CalendarClockIcon as b, CheckIcon as x, FilePenIcon as S, ListIcon as C, LoaderCircleIcon as w } from "lucide-react";
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 "./index20.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 "./index51.js";
12
+ import { useCallback as p, useEffect as m, useMemo as h, useState as g } from "react";
29
13
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js
30
- var T = "bills@business-banking.app", E = {
31
- [l.Drafts]: /* @__PURE__ */ v(S, {
32
- className: "ttw:size-4",
33
- "aria-hidden": !0
34
- }),
35
- [l.Pending]: /* @__PURE__ */ v(w, {
36
- className: "ttw:size-4",
37
- "aria-hidden": !0
38
- }),
39
- [l.Scheduled]: /* @__PURE__ */ v(b, {
40
- className: "ttw:size-4",
41
- "aria-hidden": !0
42
- }),
43
- [l.Paid]: /* @__PURE__ */ v(x, {
44
- className: "ttw:size-4",
45
- "aria-hidden": !0
46
- }),
47
- [l.All]: /* @__PURE__ */ v(C, {
48
- className: "ttw:size-4",
49
- "aria-hidden": !0
50
- })
51
- };
52
- function D({ labels: l, onEnqueueFiles: b, openPayableId: x, onOpenPayableHandled: S, poweredByBankName: C }) {
53
- let w = g(() => ({
54
- ...u,
55
- ...l,
56
- queues: {
57
- ...u.queues,
58
- ...l?.queues
59
- }
60
- }), [l]), [D, O] = _(!1), [k, A] = _(), [j, M] = _(!1), [N, P] = _(), [F, I] = _(!1), [L, R] = _(!1), { initResponse: z } = r(), B = t(z?.scopes, [n.PayableReadOrg]), V = t(z?.scopes, [n.PayableWriteOrg]), H = !z || B, U = !z || V, W = m((e, t) => {
61
- if (t && U) {
62
- A(e), M(!0);
63
- return;
64
- }
65
- P(e), I(!0);
66
- }, [U]), G = f({
67
- enabled: H,
68
- onOpenBill: W
69
- }), K = g(() => c.map((e) => ({
70
- id: e,
71
- label: w.queues[e],
72
- icon: E[e]
73
- })), [w.queues]), q = () => {
74
- I(!1), R(!0);
75
- }, J = g(() => ({
76
- createButton: w.createButton,
77
- addBill: { heading: w.emptyHeading }
78
- }), [w.createButton, w.emptyHeading]), Y = () => {
79
- O(!1), A(void 0), M(!0);
80
- }, X = (e) => {
81
- O(!1), b?.(e);
82
- }, Z = async () => {
83
- await p(T) ? e.success(w.emailCopiedToast) : e.error(w.emailCopyFailedToast);
14
+ var _ = 10, v = [{
15
+ id: "addedOnLabel",
16
+ desc: !0
17
+ }];
18
+ function y({ enabled: y = !0, onOpenBill: b }) {
19
+ let [x, S] = g(o), [C, w] = g(v), [T, E] = g(_), [D, O] = g(), [k, A] = g(""), [j, M] = g(""), N = p(() => O(void 0), []);
20
+ m(() => {
21
+ let e = setTimeout(() => {
22
+ M(k), N();
23
+ }, 300);
24
+ return () => clearTimeout(e);
25
+ }, [k, N]);
26
+ let P = C[0], F = f(P?.id), I = r({
27
+ limit: T,
28
+ pagination_token: D,
29
+ status__in: u(x),
30
+ has_scheduled_payment: c(x),
31
+ counterpart_name__icontains: j || void 0,
32
+ sort: F,
33
+ order: F ? P?.desc ? "desc" : "asc" : void 0,
34
+ enabled: y
35
+ }), L = I.data?.data.length === 0, R = i({ enabled: y && L }), z = !L || (R.data?.count ?? 1) > 0, B = h(() => (I.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
+ onOpen: () => b(r.id, i.status === "draft")
53
+ };
54
+ }), [I.data?.data, b]), V = p((e) => {
55
+ let t = e;
56
+ S(t), w((e) => {
57
+ let n = e[0]?.id;
58
+ return n ? s(t).some((e) => d(e) === n) ? e : v : e;
59
+ }), N();
60
+ }, [N]), H = p((e) => {
61
+ w((t) => typeof e == "function" ? e(t) : e), N();
62
+ }, [N]), U = p((e) => {
63
+ E(e), N();
64
+ }, [N]), W = p(() => O(I.data?.next_pagination_token), [I.data?.next_pagination_token]), G = p(() => O(I.data?.prev_pagination_token), [I.data?.prev_pagination_token]), K = p(() => {
65
+ I.refetch();
66
+ }, [I.refetch]);
67
+ return {
68
+ rows: B,
69
+ isLoading: I.isFetching || L && R.isLoading,
70
+ isError: I.isError,
71
+ onRetry: K,
72
+ selectedFilterTabId: x,
73
+ onFilterTabChange: V,
74
+ searchValue: k,
75
+ onSearchChange: A,
76
+ hasAnyBills: z,
77
+ isSearchActive: j.length > 0,
78
+ visibleColumns: s(x),
79
+ showAddPanelWhenEmpty: l(x),
80
+ sorting: C,
81
+ onSortingChange: H,
82
+ pageSize: T,
83
+ onPageSizeChange: U,
84
+ hasNextPage: !!I.data?.next_pagination_token,
85
+ hasPrevPage: !!I.data?.prev_pagination_token,
86
+ onNextPage: W,
87
+ onPrevPage: G
84
88
  };
85
- return h(() => {
86
- x && (A(x), M(!0), S?.());
87
- }, [S, x]), /* @__PURE__ */ y("div", {
88
- "data-testid": d.root,
89
- children: [
90
- /* @__PURE__ */ v(a, {
91
- rows: G.rows,
92
- isLoading: G.isLoading || !z,
93
- isError: G.isError,
94
- onRetry: G.onRetry,
95
- sorting: G.sorting,
96
- onSortingChange: G.onSortingChange,
97
- pageSize: G.pageSize,
98
- onPageSizeChange: G.onPageSizeChange,
99
- hasNextPage: G.hasNextPage,
100
- hasPrevPage: G.hasPrevPage,
101
- onNextPage: G.onNextPage,
102
- onPrevPage: G.onPrevPage,
103
- filterTabs: K,
104
- selectedFilterTabId: G.selectedFilterTabId,
105
- onFilterTabChange: G.onFilterTabChange,
106
- searchValue: G.searchValue,
107
- onSearchChange: G.onSearchChange,
108
- isFiltering: G.hasAnyBills,
109
- onCreateClick: U ? () => O(!0) : void 0,
110
- onEnterManually: U ? Y : void 0,
111
- onFilesSelected: U ? X : void 0,
112
- maxFiles: 10,
113
- emailAddress: T,
114
- onCopyEmail: Z,
115
- labels: J
116
- }),
117
- U ? /* @__PURE__ */ v(i, {
118
- open: D,
119
- onOpenChange: O,
120
- onFilesSelected: X,
121
- maxFiles: 10,
122
- onEnterManually: Y,
123
- emailAddress: T,
124
- onCopyEmail: Z,
125
- labels: { heading: G.hasAnyBills ? w.nonEmptyHeading : w.emptyHeading }
126
- }) : null,
127
- j ? /* @__PURE__ */ v(o, {
128
- open: j,
129
- onOpenChange: M,
130
- payableId: k
131
- }) : null,
132
- F ? /* @__PURE__ */ v(s, {
133
- open: F,
134
- onOpenChange: I,
135
- payableId: N,
136
- onClose: () => I(!1),
137
- onExpand: q,
138
- testId: d.detailsSheet,
139
- poweredByBankName: C
140
- }) : null,
141
- L ? /* @__PURE__ */ v(o, {
142
- open: L,
143
- onOpenChange: R,
144
- payableId: N,
145
- readOnly: !0,
146
- poweredByBankName: C
147
- }) : null
148
- ]
149
- });
150
89
  }
151
90
  //#endregion
152
- export { D as BillsTab, D as default };
91
+ export { y as useBillsTable };
@@ -1,5 +1,162 @@
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/index54.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";
1
20
  import "./index50.js";
2
- import "./index52.js";
3
- import "./index53.js";
4
- import "./index54.js";
5
- import "./index55.js";
21
+ import { BILL_QUEUE_ORDER as c, BillQueue as l } from "./index51.js";
22
+ import { BILLS_TAB_LABELS_EN as u } from "./index53.js";
23
+ import { billsTabTestIds as d } from "./index54.js";
24
+ import { useBillsTable as f } from "./index55.js";
25
+ import { copyTextToClipboard as p } from "./index52.js";
26
+ import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
27
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
28
+ import { CalendarClockIcon as b, CheckIcon as x, FilePenIcon as S, ListIcon as C, LoaderCircleIcon as w } from "lucide-react";
29
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js
30
+ var T = "bills@business-banking.app", E = {
31
+ [l.Drafts]: /* @__PURE__ */ v(S, {
32
+ className: "ttw:size-4",
33
+ "aria-hidden": !0
34
+ }),
35
+ [l.Pending]: /* @__PURE__ */ v(w, {
36
+ className: "ttw:size-4",
37
+ "aria-hidden": !0
38
+ }),
39
+ [l.Scheduled]: /* @__PURE__ */ v(b, {
40
+ className: "ttw:size-4",
41
+ "aria-hidden": !0
42
+ }),
43
+ [l.Paid]: /* @__PURE__ */ v(x, {
44
+ className: "ttw:size-4",
45
+ "aria-hidden": !0
46
+ }),
47
+ [l.All]: /* @__PURE__ */ v(C, {
48
+ className: "ttw:size-4",
49
+ "aria-hidden": !0
50
+ })
51
+ };
52
+ function D({ labels: l, onEnqueueFiles: b, openPayableId: x, onOpenPayableHandled: S, poweredByBankName: C }) {
53
+ let w = g(() => ({
54
+ ...u,
55
+ ...l,
56
+ queues: {
57
+ ...u.queues,
58
+ ...l?.queues
59
+ },
60
+ queueEmptyStates: c.reduce((e, t) => ({
61
+ ...e,
62
+ [t]: {
63
+ ...u.queueEmptyStates[t],
64
+ ...l?.queueEmptyStates?.[t]
65
+ }
66
+ }), {})
67
+ }), [l]), [D, O] = _(!1), [k, A] = _(), [j, M] = _(!1), [N, P] = _(), [F, I] = _(!1), [L, R] = _(!1), { initResponse: z } = r(), B = t(z?.scopes, [n.PayableReadOrg]), V = t(z?.scopes, [n.PayableWriteOrg]), H = !z || B, U = !z || V, W = m((e, t) => {
68
+ if (t && U) {
69
+ A(e), M(!0);
70
+ return;
71
+ }
72
+ P(e), I(!0);
73
+ }, [U]), G = f({
74
+ enabled: H,
75
+ onOpenBill: W
76
+ }), K = g(() => c.map((e) => ({
77
+ id: e,
78
+ label: w.queues[e],
79
+ icon: E[e]
80
+ })), [w.queues]), q = () => {
81
+ I(!1), R(!0);
82
+ }, J = g(() => ({
83
+ createButton: w.createButton,
84
+ addBill: { heading: w.nonEmptyHeading }
85
+ }), [w.createButton, w.nonEmptyHeading]), Y = () => {
86
+ O(!1), A(void 0), M(!0);
87
+ }, X = (e) => {
88
+ O(!1), b?.(e);
89
+ }, Z = async () => {
90
+ await p(T) ? e.success(w.emailCopiedToast) : e.error(w.emailCopyFailedToast);
91
+ };
92
+ return h(() => {
93
+ x && (A(x), M(!0), S?.());
94
+ }, [S, x]), /* @__PURE__ */ y("div", {
95
+ "data-testid": d.root,
96
+ children: [
97
+ /* @__PURE__ */ v(a, {
98
+ rows: G.rows,
99
+ isLoading: G.isLoading || !z,
100
+ isError: G.isError,
101
+ onRetry: G.onRetry,
102
+ sorting: G.sorting,
103
+ onSortingChange: G.onSortingChange,
104
+ pageSize: G.pageSize,
105
+ onPageSizeChange: G.onPageSizeChange,
106
+ hasNextPage: G.hasNextPage,
107
+ hasPrevPage: G.hasPrevPage,
108
+ onNextPage: G.onNextPage,
109
+ onPrevPage: G.onPrevPage,
110
+ filterTabs: K,
111
+ selectedFilterTabId: G.selectedFilterTabId,
112
+ onFilterTabChange: G.onFilterTabChange,
113
+ searchValue: G.searchValue,
114
+ onSearchChange: G.onSearchChange,
115
+ visibleColumns: G.visibleColumns,
116
+ isSearchActive: G.isSearchActive,
117
+ showAddPanelWhenEmpty: G.showAddPanelWhenEmpty,
118
+ emptyState: w.queueEmptyStates[G.selectedFilterTabId],
119
+ onCreateClick: U ? () => O(!0) : void 0,
120
+ onEnterManually: U ? Y : void 0,
121
+ onFilesSelected: U ? X : void 0,
122
+ maxFiles: 10,
123
+ emailAddress: T,
124
+ onCopyEmail: Z,
125
+ labels: J
126
+ }),
127
+ U ? /* @__PURE__ */ v(i, {
128
+ open: D,
129
+ onOpenChange: O,
130
+ onFilesSelected: X,
131
+ maxFiles: 10,
132
+ onEnterManually: Y,
133
+ emailAddress: T,
134
+ onCopyEmail: Z,
135
+ labels: { heading: G.hasAnyBills ? w.nonEmptyHeading : w.emptyHeading }
136
+ }) : null,
137
+ j ? /* @__PURE__ */ v(o, {
138
+ open: j,
139
+ onOpenChange: M,
140
+ payableId: k
141
+ }) : null,
142
+ F ? /* @__PURE__ */ v(s, {
143
+ open: F,
144
+ onOpenChange: I,
145
+ payableId: N,
146
+ onClose: () => I(!1),
147
+ onExpand: q,
148
+ testId: d.detailsSheet,
149
+ poweredByBankName: C
150
+ }) : null,
151
+ L ? /* @__PURE__ */ v(o, {
152
+ open: L,
153
+ onOpenChange: R,
154
+ payableId: N,
155
+ readOnly: !0,
156
+ poweredByBankName: C
157
+ }) : null
158
+ ]
159
+ });
160
+ }
161
+ //#endregion
162
+ export { D as BillsTab, D as default };
@@ -1,8 +1,5 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.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 "./index51.js";
2
+ import "./index53.js";
3
+ import "./index54.js";
4
+ import "./index55.js";
5
+ import "./index56.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/index43.js";
15
- import { BillUploadStatusTray as s } from "../../ui/dist/index56.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 "./index48.js";
20
- import "./index49.js";
21
- import { billsTabTestIds as u } from "./index53.js";
22
- import { BillsTab as d } from "./index55.js";
23
- import "./index56.js";
24
- import { BillPayWidgetAnalyticsEvent as f, WIDGET_NAME as p } from "./index43.js";
25
- import { DEFAULT_TABS_LABELS as m } from "./index57.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/index58.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 };