@tesouro/embedded-components-react 0.3.19 → 0.3.20

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 (58) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +4 -4
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +14 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +4 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +3 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +28 -97
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +81 -176
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +50 -4
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +250 -5
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +106 -107
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +209 -1
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +3 -24
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +8 -0
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +114 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +1 -0
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +25 -0
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +21 -17
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +2 -0
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +36 -11
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +10 -283
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +199 -8
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +3 -8
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +14 -91
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +314 -0
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +10 -2
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +4 -14
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +85 -105
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +2 -7
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +16 -28
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +113 -2
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +2 -7
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +5 -32
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +30 -2
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +2 -12
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +5 -104
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +34 -2
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +2 -18
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +9 -7
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +81 -145
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +15 -11
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +8 -87
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +170 -2
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -0
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +14 -0
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +89 -0
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -0
  54. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  55. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  56. package/dist/packages/shared-ui-shadcn/dist/index.js +16 -11
  57. package/package.json +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +0 -2
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import "./lib/AcceptDisclosuresWidget.js";
16
16
  import { BankAccountsWidget as C } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
17
17
  import "./lib/BankAccountsWidget.js";
18
18
  import { CounterpartsWidget as w } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
19
- import { BillPayWidget as T } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js";
19
+ import { BillPayWidget as T } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js";
20
20
  import "./lib/BillPayWidget.js";
21
21
  import { CardDetailsWidget as E } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js";
22
22
  import { CardFormatValue as D } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
@@ -1,3 +1,3 @@
1
- import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js";
1
+ import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js";
2
2
  import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
3
3
  export { e as BillPayWidget };
@@ -20,8 +20,8 @@ import "./index56.js";
20
20
  import "./index57.js";
21
21
  import "./index58.js";
22
22
  import "./index60.js";
23
- import "./index62.js";
24
- import "./index63.js";
25
- import "./index64.js";
26
- import { BillPayWidget as e } from "./index68.js";
23
+ import "./index66.js";
24
+ import "./index67.js";
25
+ import "./index68.js";
26
+ import { BillPayWidget as e } from "./index72.js";
27
27
  export { e as BillPayWidget };
@@ -5,8 +5,8 @@
5
5
  import { resolveAmountDueMinorUnits as e } from "./index2.js";
6
6
  import { resolveVendor as t } from "./index3.js";
7
7
  import { payBillFlowTestIds as n } from "./index4.js";
8
- import { ReviewTransactionDialog as r } from "../../ui/dist/index76.js";
9
- import { SchedulePaymentDialog as i } from "../../ui/dist/index80.js";
8
+ import { ReviewTransactionDialog as r } from "../../ui/dist/index80.js";
9
+ import { SchedulePaymentDialog as i } from "../../ui/dist/index84.js";
10
10
  import "../../ui/dist/index.js";
11
11
  import { usePayBillFlow as a } from "./index9.js";
12
12
  import { useImperativeHandle as o } from "react";
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { SourceDocumentPanel as e } from "../../ui/dist/index83.js";
5
+ import { SourceDocumentPanel as e } from "../../ui/dist/index87.js";
6
6
  import "../../ui/dist/index.js";
7
7
  import { useAttachPayableFileMutation as t, useDeletePayableFileMutation as n } from "../../data-access/dist/index10.js";
8
8
  import "../../data-access/dist/index.js";
@@ -14,7 +14,7 @@ import { resolveVendor as ie } from "./index3.js";
14
14
  import { BillCreateScreen as ae } from "../../ui/dist/index41.js";
15
15
  import { BillDecisionDialog as n } from "../../ui/dist/index47.js";
16
16
  import { BillDuplicateNotice as oe } from "../../ui/dist/index57.js";
17
- import { ExtractionNotice as se } from "../../ui/dist/index70.js";
17
+ import { ExtractionNotice as se } from "../../ui/dist/index74.js";
18
18
  import "../../ui/dist/index.js";
19
19
  import { usePayableHistoryQuery as ce } from "../../data-access/dist/index6.js";
20
20
  import { useAllPayableLineItemsQuery as le } from "../../data-access/dist/index7.js";
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { DuplicateBillsDialog as e } from "../../ui/dist/index67.js";
5
+ import { DuplicateBillsDialog as e } from "../../ui/dist/index71.js";
6
6
  import "../../ui/dist/index.js";
7
7
  import { DUPLICATE_BILLS_LABELS_EN as t } from "./index54.js";
8
8
  import { useDuplicateBillsSelection as n } from "./index55.js";
@@ -1,4 +1,4 @@
1
- import { BillColumn as e } from "../../ui/dist/index59.js";
1
+ import { BillColumn as e } from "../../ui/dist/index63.js";
2
2
  import "../../ui/dist/index.js";
3
3
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js
4
4
  var t = {
@@ -42,40 +42,51 @@ var a = t.Pending, o = [
42
42
  ], s = {
43
43
  [t.Drafts]: [
44
44
  e.Vendor,
45
+ e.IssueDate,
45
46
  e.DueDate,
46
47
  e.Status,
47
48
  e.AmountDue,
49
+ e.TotalAmount,
48
50
  e.AddedOn
49
51
  ],
50
52
  [t.Pending]: [
51
53
  e.Vendor,
54
+ e.IssueDate,
52
55
  e.DueDate,
53
56
  e.Status,
54
57
  e.AmountDue,
58
+ e.TotalAmount,
55
59
  e.AddedOn
56
60
  ],
57
61
  [t.Scheduled]: [
58
62
  e.Vendor,
63
+ e.IssueDate,
59
64
  e.DueDate,
60
65
  e.ScheduledDate,
61
66
  e.Status,
62
67
  e.AmountScheduled,
68
+ e.TotalAmount,
63
69
  e.AddedOn
64
70
  ],
65
71
  [t.Paid]: [
66
72
  e.Vendor,
73
+ e.IssueDate,
74
+ e.DueDate,
67
75
  e.PaidDate,
68
76
  e.Status,
69
77
  e.AmountPaid,
78
+ e.TotalAmount,
70
79
  e.AddedOn
71
80
  ],
72
81
  [t.All]: [
73
82
  e.Vendor,
83
+ e.IssueDate,
74
84
  e.DueDate,
75
85
  e.ScheduledDate,
76
86
  e.Status,
77
87
  e.AmountDue,
78
88
  e.AmountPaid,
89
+ e.TotalAmount,
79
90
  e.AddedOn
80
91
  ]
81
92
  };
@@ -91,11 +102,13 @@ function u(e) {
91
102
  }
92
103
  var d = {
93
104
  vendorLabel: "counterpart_name",
105
+ issueDateLabel: "issued_at",
94
106
  dueDateLabel: "due_date",
95
107
  scheduledDateLabel: "scheduled_payment_date",
96
108
  addedOnLabel: "created_at"
97
109
  }, f = {
98
110
  [e.Vendor]: "vendorLabel",
111
+ [e.IssueDate]: "issueDateLabel",
99
112
  [e.DueDate]: "dueDateLabel",
100
113
  [e.ScheduledDate]: "scheduledDateLabel",
101
114
  [e.AddedOn]: "addedOnLabel"
@@ -31,13 +31,16 @@ var t = {
31
31
  duplicateWarningOne: "1 possible duplicate bill found",
32
32
  duplicateWarningMany: (e) => `${e} possible duplicate bills found`,
33
33
  duplicateBadge: "Duplicate?",
34
+ attachmentIndicator: "Has an attachment",
34
35
  emptyHeading: "Add your first bill",
35
36
  nonEmptyHeading: "Add a bill",
36
37
  createButton: "Add bill",
37
38
  emailCopiedToast: "Email address copied to clipboard",
38
39
  emailCopyFailedToast: "Could not copy the email address",
39
40
  queues: t,
40
- queueEmptyStates: n
41
+ queueEmptyStates: n,
42
+ filters: {},
43
+ filterBar: {}
41
44
  };
42
45
  //#endregion
43
46
  export { r as BILLS_TAB_LABELS_EN, n as BILL_QUEUE_EMPTY_STATES_EN, t as BILL_QUEUE_LABELS_EN };
@@ -1,4 +1,4 @@
1
- import { BillColumn as e } from "../../ui/dist/index59.js";
1
+ import { BillColumn as e } from "../../ui/dist/index63.js";
2
2
  import "../../ui/dist/index.js";
3
3
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js
4
4
  var t = {
@@ -7,6 +7,7 @@ var t = {
7
7
  detailsSheet: "bill-pay-details-sheet"
8
8
  }, n = {
9
9
  [e.Vendor]: "bill-pay-bills-cell-vendor",
10
+ [e.IssueDate]: "bill-pay-bills-cell-issue-date",
10
11
  [e.DueDate]: "bill-pay-bills-cell-due-date",
11
12
  [e.ScheduledDate]: "bill-pay-bills-cell-scheduled-date",
12
13
  [e.PaidDate]: "bill-pay-bills-cell-paid-date",
@@ -14,6 +15,7 @@ var t = {
14
15
  [e.AmountDue]: "bill-pay-bills-cell-amount-due",
15
16
  [e.AmountScheduled]: "bill-pay-bills-cell-amount-scheduled",
16
17
  [e.AmountPaid]: "bill-pay-bills-cell-amount-paid",
18
+ [e.TotalAmount]: "bill-pay-bills-cell-total-amount",
17
19
  [e.AddedOn]: "bill-pay-bills-cell-added-on"
18
20
  };
19
21
  //#endregion
@@ -1,100 +1,31 @@
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 "./index22.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 "./index58.js";
12
- import { useCallback as p, useEffect as m, useMemo as h, useState as g } from "react";
13
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js
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 ?? void 0), [R.data?.next_pagination_token]), J = p(() => A(R.data?.prev_pagination_token ?? void 0), [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
- };
2
+ var e = {
3
+ Draft: "draft",
4
+ PendingApproval: "pending_approval",
5
+ ReadyToPay: "ready_to_pay",
6
+ PartiallyPaid: "partially_paid",
7
+ Paid: "paid",
8
+ Rejected: "rejected",
9
+ Canceled: "canceled"
10
+ }, t = [
11
+ e.Draft,
12
+ e.PendingApproval,
13
+ e.ReadyToPay,
14
+ e.PartiallyPaid,
15
+ e.Paid,
16
+ e.Rejected,
17
+ e.Canceled
18
+ ], n = {
19
+ [e.Draft]: ["draft"],
20
+ [e.PendingApproval]: ["new", "approve_in_progress"],
21
+ [e.ReadyToPay]: ["waiting_to_be_paid"],
22
+ [e.PartiallyPaid]: ["partially_paid"],
23
+ [e.Paid]: ["paid"],
24
+ [e.Rejected]: ["rejected"],
25
+ [e.Canceled]: ["canceled"]
26
+ };
27
+ function r(e) {
28
+ return e.flatMap((e) => n[e] ?? [e]);
98
29
  }
99
30
  //#endregion
100
- export { y as useBillsTable };
31
+ export { t as BILL_STATUS_FILTER_ORDER, e as BillStatusFilter, r as billStatusFilterApiValues };
@@ -1,181 +1,86 @@
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 "./index41.js";
16
- import "./index42.js";
17
- import { BillDetailsContainer as ee } from "./index45.js";
18
- import "./index46.js";
19
- import "./index52.js";
20
- import "./index53.js";
21
- import { DuplicateBillsContainer as s } from "./index56.js";
22
- import "./index57.js";
23
- import { BILL_QUEUE_ORDER as c, BillQueue as l } from "./index58.js";
24
- import { BILLS_TAB_LABELS_EN as u } from "./index60.js";
25
- import { useBillsTable as d } from "./index62.js";
26
- import { copyTextToClipboard as f } from "./index59.js";
27
- import { billsTabTestIds as p, billsTableCellTestIds as te } from "./index61.js";
28
- import { useCallback as ne, 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";
1
+ import { endOfDay as e, endOfMonth as t, endOfQuarter as n, endOfWeek as r, endOfYear as i, startOfDay as a, startOfMonth as o, startOfQuarter as s, startOfWeek as c, startOfYear as l, subDays as u, subMonths as d, subQuarters as f, subWeeks as p, subYears as m } from "date-fns";
31
2
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.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
- })
3
+ var h = {
4
+ Today: "today",
5
+ ThisWeek: "this_week",
6
+ ThisMonth: "this_month",
7
+ ThisQuarter: "this_quarter",
8
+ ThisYear: "this_year",
9
+ Yesterday: "yesterday",
10
+ LastWeek: "last_week",
11
+ LastMonth: "last_month",
12
+ Last30Days: "last_30_days",
13
+ Last90Days: "last_90_days",
14
+ LastQuarter: "last_quarter",
15
+ LastYear: "last_year"
53
16
  };
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]), [D, O] = g(!1), [k, A] = g(), [j, M] = g(!1), [N, P] = g(), [F, I] = g(!1), [L, R] = g(!1), [z, B] = g(!1), { initResponse: V } = r(), H = t(V?.scopes, [n.PayableReadOrg]), U = t(V?.scopes, [n.PayableWriteOrg]), W = !V || H, G = !V || U, K = ne((e, t) => {
70
- if (t && G) {
71
- A(e), M(!0);
72
- return;
17
+ function g(g, _ = /* @__PURE__ */ new Date()) {
18
+ let v = a(_);
19
+ switch (g) {
20
+ case h.Today: return {
21
+ from: v,
22
+ to: e(v)
23
+ };
24
+ case h.ThisWeek: return {
25
+ from: c(v),
26
+ to: r(v)
27
+ };
28
+ case h.ThisMonth: return {
29
+ from: o(v),
30
+ to: t(v)
31
+ };
32
+ case h.ThisQuarter: return {
33
+ from: s(v),
34
+ to: n(v)
35
+ };
36
+ case h.ThisYear: return {
37
+ from: l(v),
38
+ to: i(v)
39
+ };
40
+ case h.Yesterday: {
41
+ let t = u(v, 1);
42
+ return {
43
+ from: t,
44
+ to: e(t)
45
+ };
73
46
  }
74
- P(e), I(!0);
75
- }, [G]), q = h(() => (C ?? []).filter((e) => e.isPossibleDuplicate).map((e) => e.id), [C]), J = d({
76
- enabled: W,
77
- onOpenBill: K,
78
- duplicateBillIds: q,
79
- duplicateBadgeLabel: E.duplicateBadge
80
- }), Y = (e) => !!(e && q.includes(e)), X = q.length, re = X === 0 ? void 0 : X === 1 ? E.duplicateWarningOne : E.duplicateWarningMany(X), ie = h(() => c.map((e) => ({
81
- id: e,
82
- label: E.queues[e],
83
- icon: T[e]
84
- })), [E.queues]), ae = (e) => {
85
- B(!1), P(e), I(!0);
86
- }, oe = () => {
87
- I(!1), R(!0);
88
- }, se = h(() => ({
89
- createButton: E.createButton,
90
- addBill: { heading: E.nonEmptyHeading }
91
- }), [E.createButton, E.nonEmptyHeading]), Z = () => {
92
- O(!1), A(void 0), M(!0);
93
- }, Q = (e) => {
94
- O(!1), y?.(e);
95
- }, $ = async () => {
96
- await f(w) ? e.success(E.emailCopiedToast) : e.error(E.emailCopyFailedToast);
97
- };
98
- return m(() => {
99
- b && (A(b), M(!0), x?.());
100
- }, [x, b]), /* @__PURE__ */ v("div", {
101
- "data-testid": p.root,
102
- children: [
103
- /* @__PURE__ */ _(a, {
104
- rows: J.rows,
105
- isLoading: J.isLoading || !V,
106
- isError: J.isError,
107
- onRetry: J.onRetry,
108
- sorting: J.sorting,
109
- onSortingChange: J.onSortingChange,
110
- pageSize: J.pageSize,
111
- onPageSizeChange: J.onPageSizeChange,
112
- hasNextPage: J.hasNextPage,
113
- hasPrevPage: J.hasPrevPage,
114
- onNextPage: J.onNextPage,
115
- onPrevPage: J.onPrevPage,
116
- filterTabs: ie,
117
- selectedFilterTabId: J.selectedFilterTabId,
118
- onFilterTabChange: J.onFilterTabChange,
119
- searchValue: J.searchValue,
120
- onSearchChange: J.onSearchChange,
121
- visibleColumns: J.visibleColumns,
122
- cellTestIds: te,
123
- isSearchActive: J.isSearchActive,
124
- showAddPanelWhenEmpty: J.showAddPanelWhenEmpty,
125
- emptyState: E.queueEmptyStates[J.selectedFilterTabId],
126
- onCreateClick: G ? () => O(!0) : void 0,
127
- onEnterManually: G ? Z : void 0,
128
- onFilesSelected: G ? Q : void 0,
129
- maxFiles: 10,
130
- emailAddress: w,
131
- onCopyEmail: $,
132
- duplicateWarning: re,
133
- onReviewDuplicates: () => B(!0),
134
- labels: se
135
- }),
136
- z ? /* @__PURE__ */ _(s, {
137
- open: z,
138
- onOpenChange: B,
139
- bills: C,
140
- canManageDuplicates: G,
141
- onOpenBill: ae
142
- }) : null,
143
- G ? /* @__PURE__ */ _(i, {
144
- open: D,
145
- onOpenChange: O,
146
- onFilesSelected: Q,
147
- maxFiles: 10,
148
- onEnterManually: Z,
149
- emailAddress: w,
150
- onCopyEmail: $,
151
- labels: { heading: J.hasAnyBills ? E.nonEmptyHeading : E.emptyHeading }
152
- }) : null,
153
- j ? /* @__PURE__ */ _(o, {
154
- open: j,
155
- onOpenChange: M,
156
- payableId: k,
157
- isPossibleDuplicate: Y(k)
158
- }) : null,
159
- F ? /* @__PURE__ */ _(ee, {
160
- open: F,
161
- onOpenChange: I,
162
- payableId: N,
163
- onClose: () => I(!1),
164
- onExpand: oe,
165
- isPossibleDuplicate: Y(N),
166
- testId: p.detailsSheet,
167
- poweredByBankName: S
168
- }) : null,
169
- L ? /* @__PURE__ */ _(o, {
170
- open: L,
171
- onOpenChange: R,
172
- payableId: N,
173
- readOnly: !0,
174
- poweredByBankName: S,
175
- isPossibleDuplicate: Y(N)
176
- }) : null
177
- ]
178
- });
47
+ case h.LastWeek: {
48
+ let e = c(p(v, 1));
49
+ return {
50
+ from: e,
51
+ to: r(e)
52
+ };
53
+ }
54
+ case h.LastMonth: {
55
+ let e = o(d(v, 1));
56
+ return {
57
+ from: e,
58
+ to: t(e)
59
+ };
60
+ }
61
+ case h.Last30Days: return {
62
+ from: u(v, 29),
63
+ to: e(v)
64
+ };
65
+ case h.Last90Days: return {
66
+ from: u(v, 89),
67
+ to: e(v)
68
+ };
69
+ case h.LastQuarter: {
70
+ let e = s(f(v, 1));
71
+ return {
72
+ from: e,
73
+ to: n(e)
74
+ };
75
+ }
76
+ case h.LastYear: {
77
+ let e = l(m(v, 1));
78
+ return {
79
+ from: e,
80
+ to: i(e)
81
+ };
82
+ }
83
+ }
179
84
  }
180
85
  //#endregion
181
- export { E as BillsTab, E as default };
86
+ export { h as BillsDatePreset, g as resolveDatePreset };
@@ -1,4 +1,50 @@
1
- import "./index58.js";
2
- import "./index60.js";
3
- import "./index62.js";
4
- import "./index63.js";
1
+ import { BillStatusFilter as e } from "./index62.js";
2
+ import { BillsDatePreset as t } from "./index63.js";
3
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js
4
+ var n = {
5
+ presets: {
6
+ [t.Today]: "Today",
7
+ [t.ThisWeek]: "This week",
8
+ [t.ThisMonth]: "This month",
9
+ [t.ThisQuarter]: "This quarter",
10
+ [t.ThisYear]: "This year",
11
+ [t.Yesterday]: "Yesterday",
12
+ [t.LastWeek]: "Last week",
13
+ [t.LastMonth]: "Last month",
14
+ [t.Last30Days]: "Last 30 days",
15
+ [t.Last90Days]: "Last 90 days",
16
+ [t.LastQuarter]: "Last quarter",
17
+ [t.LastYear]: "Last year"
18
+ },
19
+ presetGroupCurrent: "Current",
20
+ presetGroupPast: "Past",
21
+ statuses: {
22
+ [e.Draft]: "Draft",
23
+ [e.PendingApproval]: "Pending approval",
24
+ [e.ReadyToPay]: "Ready to pay",
25
+ [e.PartiallyPaid]: "Partially paid",
26
+ [e.Paid]: "Paid",
27
+ [e.Rejected]: "Rejected",
28
+ [e.Canceled]: "Canceled"
29
+ },
30
+ dateFieldNames: {
31
+ issueDate: "Issue date",
32
+ dueDate: "Due date",
33
+ addedOn: "Added on"
34
+ },
35
+ dateChip: (e, t) => `${e}: ${t}`,
36
+ statusChip: (e) => `Status: ${e}`,
37
+ vendorChip: (e) => `Vendor: ${e}`,
38
+ amountChip: (e) => `Total amount: ${e}`,
39
+ attachmentChipHas: "Has attachment",
40
+ attachmentChipNone: "No attachment",
41
+ moreSelected: (e, t) => `${e} + ${t} more`,
42
+ amountAtLeast: (e) => `${e} or more`,
43
+ amountAtMost: (e) => `${e} or less`,
44
+ amountBetween: (e, t) => `${e} - ${t}`,
45
+ dateRange: (e, t) => `${e} - ${t}`,
46
+ dateFrom: (e) => `From ${e}`,
47
+ dateTo: (e) => `Until ${e}`
48
+ };
49
+ //#endregion
50
+ export { n as BILLS_FILTER_LABELS_EN };