@tesouro/embedded-components-react 0.2.327 → 0.2.328

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 (133) hide show
  1. package/dist/index.css +3 -0
  2. package/dist/index.d.ts +59 -59
  3. package/dist/index.js +1 -1
  4. package/dist/lib/BillPayWidget.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +10 -10
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +119 -33
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +50 -21
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +39 -17
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +17 -12
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +10 -10
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +45 -17
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -21
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +9 -24
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +42 -9
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +25 -50
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +49 -5
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +91 -63
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +20 -49
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +52 -7
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -35
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +67 -113
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +46 -53
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +80 -205
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +32 -192
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +117 -62
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +54 -45
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +205 -31
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +184 -143
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +63 -33
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +46 -100
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +32 -7
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +146 -182
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +38 -4
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +102 -24
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +10 -80
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +200 -78
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +2 -1
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +27 -2
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +78 -41
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +132 -1
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +3 -53
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +2 -9
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +43 -16
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +1 -8
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +50 -77
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +8 -145
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +18 -5
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +6 -6
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +78 -7
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +138 -75
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +2 -0
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +6 -6
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -113
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +85 -1
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +2 -24
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +8 -0
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +115 -0
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +1 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +25 -0
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +33 -25
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +13 -12
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +58 -13
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +2 -24
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +22 -2
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +23 -31
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +1 -262
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +15 -2
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +23 -6
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +2 -49
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +41 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +271 -20
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -286
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +9 -2
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +47 -14
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +2 -120
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +22 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +284 -8
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +2 -96
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +16 -2
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +118 -11
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +1 -57
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +10 -2
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +93 -51
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +1 -138
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +12 -1
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +56 -5
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +2 -44
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +53 -1
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +137 -2
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +2 -16
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +7 -2
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +42 -59
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +2 -238
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +2 -202
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +61 -8
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -8
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +2 -91
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +16 -0
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +1 -1
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +67 -4
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +248 -25
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +204 -2
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +6 -3
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +6 -32
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +93 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +1 -105
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +7 -2
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +28 -16
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +2 -10
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +4 -167
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +34 -2
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +2 -14
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +10 -87
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +105 -1
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +2 -0
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +18 -0
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +10 -0
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +170 -0
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +2 -0
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +14 -0
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +89 -0
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -0
  126. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +20 -20
  127. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
  128. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +21 -21
  129. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +142 -102
  130. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  131. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  132. package/package.json +1 -1
  133. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +0 -12
@@ -1,18 +1,45 @@
1
- import { BillQueue as e } from "./index42.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import "../../../shared/feature/dist/index.js";
7
+ import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index43.js";
8
+ import { Payables as r } from "../../../monite-sdk/dist/index438.js";
9
+ import "../../../monite-sdk/dist/index.js";
10
+ import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
+ import "../../../shared/monite-wrapper/feature/dist/index.js";
12
+ import { useEffect as a } from "react";
13
+ import { jsx as o } from "react/jsx-runtime";
2
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js
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
- emptyHeading: "Add your first bill",
11
- nonEmptyHeading: "Add a bill",
12
- createButton: "Add bill",
13
- emailCopiedToast: "Email address copied to clipboard",
14
- emailCopyFailedToast: "Could not copy the email address",
15
- queues: t
16
- };
15
+ var s = (e) => e;
16
+ function c(n) {
17
+ let i = e();
18
+ return a(() => {
19
+ i(t.Mounted);
20
+ }, [i]), /* @__PURE__ */ o(r, { ...n });
21
+ }
22
+ function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, pageTitleComponent: v = s, ...y }) {
23
+ return /* @__PURE__ */ o(i, {
24
+ widgetName: n,
25
+ baseUrl: e,
26
+ widgetToken: t,
27
+ organizationId: r,
28
+ configClient: a,
29
+ gatewayRouting: l,
30
+ linkComponent: u,
31
+ implementation: d,
32
+ uiFramework: f,
33
+ errorFallback: p,
34
+ onError: m,
35
+ finopsThemeColors: h,
36
+ analytics: g,
37
+ disclosuresAcceptance: _,
38
+ children: /* @__PURE__ */ o(c, {
39
+ ...y,
40
+ pageTitleComponent: v
41
+ })
42
+ });
43
+ }
17
44
  //#endregion
18
- export { n as BILLS_TAB_LABELS_EN, t as BILL_QUEUE_LABELS_EN };
45
+ export { l as BillPayWidgetMonite, l as default };
@@ -1,8 +1 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js
2
- var e = {
3
- root: "bill-pay-bills-tab",
4
- uploadTray: "bill-pay-upload-tray",
5
- detailsSheet: "bill-pay-details-sheet"
6
- };
7
- //#endregion
8
- export { e as billsTabTestIds };
1
+ import "./index44.js";
@@ -1,80 +1,53 @@
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 "./index16.js";
11
- import { DEFAULT_BILL_QUEUE as o, billQueueHasScheduledPayment as s, billQueueStatuses as c, billSortField as l } from "./index42.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/index46.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
- };
2
+ var e = {
3
+ Drafts: "drafts",
4
+ Pending: "pending",
5
+ Scheduled: "scheduled",
6
+ Paid: "paid",
7
+ All: "all"
8
+ }, t = {
9
+ [e.Drafts]: ["draft"],
10
+ [e.Pending]: [
11
+ "new",
12
+ "approve_in_progress",
13
+ "waiting_to_be_paid",
14
+ "partially_paid"
15
+ ],
16
+ [e.Scheduled]: [
17
+ "new",
18
+ "approve_in_progress",
19
+ "waiting_to_be_paid",
20
+ "partially_paid"
21
+ ],
22
+ [e.Paid]: ["paid"],
23
+ [e.All]: void 0
24
+ }, n = {
25
+ [e.Drafts]: void 0,
26
+ [e.Pending]: !1,
27
+ [e.Scheduled]: !0,
28
+ [e.Paid]: void 0,
29
+ [e.All]: void 0
30
+ }, r = e.Drafts, i = [
31
+ e.Drafts,
32
+ e.Pending,
33
+ e.Scheduled,
34
+ e.Paid,
35
+ e.All
36
+ ];
37
+ function a(e) {
38
+ let n = t[e];
39
+ return n ? [...n] : void 0;
40
+ }
41
+ function o(e) {
42
+ return n[e];
43
+ }
44
+ var s = {
45
+ vendorLabel: "counterpart_name",
46
+ dueDateLabel: "due_date",
47
+ addedOnLabel: "created_at"
48
+ };
49
+ function c(e) {
50
+ if (e) return s[e];
78
51
  }
79
52
  //#endregion
80
- export { g as useBillsTable };
53
+ export { n as BILL_QUEUE_HAS_SCHEDULED_PAYMENT, i as BILL_QUEUE_ORDER, t as BILL_QUEUE_STATUSES, s as BILL_SORT_FIELDS, e as BillQueue, r as DEFAULT_BILL_QUEUE, o as billQueueHasScheduledPayment, a as billQueueStatuses, c as billSortField };
@@ -1,148 +1,11 @@
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/index45.js";
14
- import "../../ui/dist/index.js";
15
- import { BillCreateDialog as o } from "./index33.js";
16
- import "./index34.js";
17
- import { BillDetailsContainer as s } from "./index37.js";
18
- import "./index38.js";
19
- import { BILL_QUEUE_ORDER as c, BillQueue as l } from "./index42.js";
20
- import { BILLS_TAB_LABELS_EN as u } from "./index44.js";
21
- import { billsTabTestIds as d } from "./index45.js";
22
- import { useBillsTable as f } from "./index46.js";
23
- import { copyTextToClipboard as p } from "./index43.js";
24
- import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
25
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
26
- import { CalendarClockIcon as b, CheckIcon as x, FilePenIcon as S, ListIcon as C, LoaderCircleIcon as w } from "lucide-react";
27
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js
28
- var T = "bills@business-banking.app", E = {
29
- [l.Drafts]: /* @__PURE__ */ v(S, {
30
- className: "ttw:size-4",
31
- "aria-hidden": !0
32
- }),
33
- [l.Pending]: /* @__PURE__ */ v(w, {
34
- className: "ttw:size-4",
35
- "aria-hidden": !0
36
- }),
37
- [l.Scheduled]: /* @__PURE__ */ v(b, {
38
- className: "ttw:size-4",
39
- "aria-hidden": !0
40
- }),
41
- [l.Paid]: /* @__PURE__ */ v(x, {
42
- className: "ttw:size-4",
43
- "aria-hidden": !0
44
- }),
45
- [l.All]: /* @__PURE__ */ v(C, {
46
- className: "ttw:size-4",
47
- "aria-hidden": !0
48
- })
49
- };
50
- function D({ labels: l, onEnqueueFiles: b, openPayableId: x, onOpenPayableHandled: S, poweredByBankName: C }) {
51
- let w = g(() => ({
52
- ...u,
53
- ...l,
54
- queues: {
55
- ...u.queues,
56
- ...l?.queues
57
- }
58
- }), [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) => {
59
- if (t && U) {
60
- A(e), M(!0);
61
- return;
62
- }
63
- P(e), I(!0);
64
- }, [U]), G = f({
65
- enabled: H,
66
- onOpenBill: W
67
- }), K = g(() => c.map((e) => ({
68
- id: e,
69
- label: w.queues[e],
70
- icon: E[e]
71
- })), [w.queues]), q = () => {
72
- I(!1), R(!0);
73
- }, J = g(() => ({
74
- createButton: w.createButton,
75
- addBill: { heading: w.emptyHeading }
76
- }), [w.createButton, w.emptyHeading]), Y = () => {
77
- O(!1), A(void 0), M(!0);
78
- }, X = (e) => {
79
- O(!1), b?.(e);
80
- }, Z = async () => {
81
- await p(T) ? e.success(w.emailCopiedToast) : e.error(w.emailCopyFailedToast);
82
- };
83
- return h(() => {
84
- x && (A(x), M(!0), S?.());
85
- }, [S, x]), /* @__PURE__ */ y("div", {
86
- "data-testid": d.root,
87
- children: [
88
- /* @__PURE__ */ v(a, {
89
- rows: G.rows,
90
- isLoading: G.isLoading || !z,
91
- isError: G.isError,
92
- onRetry: G.onRetry,
93
- sorting: G.sorting,
94
- onSortingChange: G.onSortingChange,
95
- pageSize: G.pageSize,
96
- onPageSizeChange: G.onPageSizeChange,
97
- hasNextPage: G.hasNextPage,
98
- hasPrevPage: G.hasPrevPage,
99
- onNextPage: G.onNextPage,
100
- onPrevPage: G.onPrevPage,
101
- filterTabs: K,
102
- selectedFilterTabId: G.selectedFilterTabId,
103
- onFilterTabChange: G.onFilterTabChange,
104
- searchValue: G.searchValue,
105
- onSearchChange: G.onSearchChange,
106
- isFiltering: G.hasAnyBills,
107
- onCreateClick: U ? () => O(!0) : void 0,
108
- onEnterManually: U ? Y : void 0,
109
- onFilesSelected: U ? X : void 0,
110
- emailAddress: T,
111
- onCopyEmail: Z,
112
- labels: J
113
- }),
114
- U ? /* @__PURE__ */ v(i, {
115
- open: D,
116
- onOpenChange: O,
117
- onFilesSelected: X,
118
- onEnterManually: Y,
119
- emailAddress: T,
120
- onCopyEmail: Z,
121
- labels: { heading: G.hasAnyBills ? w.nonEmptyHeading : w.emptyHeading }
122
- }) : null,
123
- j ? /* @__PURE__ */ v(o, {
124
- open: j,
125
- onOpenChange: M,
126
- payableId: k
127
- }) : null,
128
- F ? /* @__PURE__ */ v(s, {
129
- open: F,
130
- onOpenChange: I,
131
- payableId: N,
132
- onClose: () => I(!1),
133
- onExpand: q,
134
- testId: d.detailsSheet,
135
- poweredByBankName: C
136
- }) : null,
137
- L ? /* @__PURE__ */ v(o, {
138
- open: L,
139
- onOpenChange: R,
140
- payableId: N,
141
- readOnly: !0,
142
- poweredByBankName: C
143
- }) : null
144
- ]
145
- });
2
+ async function e(e) {
3
+ if (!e.trim()) return !1;
4
+ try {
5
+ return await navigator.clipboard.writeText(e), !0;
6
+ } catch {
7
+ return !1;
8
+ }
146
9
  }
147
10
  //#endregion
148
- export { D as BillsTab, D as default };
11
+ export { e as copyTextToClipboard };
@@ -1,5 +1,18 @@
1
- import "./index42.js";
2
- import "./index44.js";
3
- import "./index45.js";
4
- import "./index46.js";
5
- import "./index47.js";
1
+ import { BillQueue as e } from "./index46.js";
2
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js
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
+ emptyHeading: "Add your first bill",
11
+ nonEmptyHeading: "Add a bill",
12
+ createButton: "Add bill",
13
+ emailCopiedToast: "Email address copied to clipboard",
14
+ emailCopyFailedToast: "Could not copy the email address",
15
+ queues: t
16
+ };
17
+ //#endregion
18
+ export { n as BILLS_TAB_LABELS_EN, t as BILL_QUEUE_LABELS_EN };
@@ -1,8 +1,8 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js
2
- var e = (e) => [
3
- "bill-pay",
4
- "upload-queue",
5
- e ?? ""
6
- ];
2
+ var e = {
3
+ root: "bill-pay-bills-tab",
4
+ uploadTray: "bill-pay-upload-tray",
5
+ detailsSheet: "bill-pay-details-sheet"
6
+ };
7
7
  //#endregion
8
- export { e as billPayUploadQueueKey };
8
+ export { e as billsTabTestIds };
@@ -1,9 +1,80 @@
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 "./index46.js";
12
+ import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "react";
1
13
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js
2
- var e = {
3
- uploadingSummary: (e) => `Uploading and scanning ${e} ${e === 1 ? "file" : "files"}`,
4
- completeSummary: (e) => `${e} ${e === 1 ? "upload" : "uploads"} complete`,
5
- readyCaption: (e) => `${e} new ${e === 1 ? "bill" : "bills"} ready`,
6
- failedCaption: (e) => `${e} failed to upload`
7
- };
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
+ }
8
79
  //#endregion
9
- export { e as BILL_UPLOAD_QUEUE_LABELS_EN };
80
+ export { g as useBillsTable };