@tesouro/embedded-components-react 0.5.113 → 0.5.114

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 (33) 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/data-access/dist/index.js +3 -3
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +57 -36
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +15 -11
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +10 -10
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +5 -5
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -124
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -47
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +44 -18
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +19 -83
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +28 -47
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +76 -252
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +48 -136
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +246 -218
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +138 -4
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +212 -5
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +3 -112
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +7 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +104 -18
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +1 -0
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index89.js +27 -0
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +231 -228
  28. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +24 -24
  29. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +143 -154
  30. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +79 -87
  31. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  32. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  33. package/package.json +1 -1
@@ -1,138 +1,50 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
- import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
7
- import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
8
- import { hasSuspectedPayableDuplicate as r } from "../../data-access/dist/index7.js";
9
- import { usePayablesQuery as i, usePayablesTotalCountQuery as a } from "../../data-access/dist/index17.js";
10
- import "../../data-access/dist/index.js";
11
- import { derivePayableStatus as o } from "./index7.js";
12
- import { resolveVendorName as ee } from "./index8.js";
13
- import { isEditablePayableStatus as s } from "./index19.js";
14
- import { BillQueue as c, DEFAULT_BILL_QUEUE as l, billQueueColumns as u, billQueueHasScheduledPayment as te, billQueueOffersAddPanel as d, billQueueStatuses as f, billSortColumnId as ne, billSortField as p } from "./index72.js";
15
- import { useBillsFilters as m } from "./index80.js";
16
- import { useCallback as h, useEffect as g, useMemo as _, useState as v } from "react";
1
+ import { BillStatusFilter as e } from "./index79.js";
2
+ import { BillsDatePreset as t } from "./index80.js";
17
3
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js
18
- var y = 10, b = [{
19
- id: "addedOnLabel",
20
- desc: !0
21
- }];
22
- function x({ enabled: x = !0, canReadVendors: S = !0, isVendorFilterPaused: C = !1, filterLabels: re, onOpenBill: w, duplicateRowNote: T, attachmentLabel: E }) {
23
- let [D, ie] = v(l), [O, k] = v(b), [A, j] = v(y), [M, N] = v(), [P, F] = v(""), [I, L] = v(""), R = h(() => N(void 0), []);
24
- g(() => {
25
- let e = setTimeout(() => {
26
- L(P), R();
27
- }, 300);
28
- return () => clearTimeout(e);
29
- }, [P, R]);
30
- let z = m({
31
- offersStatusFilter: D === c.All,
32
- offersVendorFilter: S,
33
- isVendorFilterPaused: C,
34
- labels: re,
35
- onFiltersChange: R
36
- }), { filterByVendor: B } = z, V = O[0], H = p(V?.id), U = H ? V?.desc ? "desc" : "asc" : void 0, W = _(() => ({
37
- ...z.query,
38
- limit: A,
39
- pagination_token: M,
40
- status__in: f(D) ?? z.query.status__in,
41
- has_scheduled_payment: te(D),
42
- counterpart_name__icontains: I || void 0,
43
- sort: H,
44
- order: U
45
- }), [
46
- z.query,
47
- A,
48
- M,
49
- D,
50
- I,
51
- H,
52
- U
53
- ]), { organizationId: G } = e(), K = JSON.stringify([G, W]), q = i({
54
- ...W,
55
- enabled: x,
56
- pollWhileOcrProcessing: !0
57
- }), [J, ae] = v(K);
58
- g(() => {
59
- q.isFetching || ae(K);
60
- }, [q.isFetching, K]);
61
- let Y = q.data?.data.length, X = Y === 0, Z = a({ enabled: x && X }), oe = !X || (Z.data?.count ?? 1) > 0, Q = _(() => (q.data?.data ?? []).filter((e) => e.ocr_status !== "processing").map((e) => {
62
- let i = o({
63
- apiStatus: e.status,
64
- dueDate: e.due_date,
65
- scheduledPaymentDate: e.scheduled_payment_date
66
- }), a = e.amount_due ?? e.total_amount, l = e.status === "partially_paid" || e.status === "paid", u = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" });
67
- return {
68
- rowKey: e.id,
69
- vendorLabel: ee(e),
70
- issueDateLabel: t(e.issued_at),
71
- dueDateLabel: t(e.due_date),
72
- dueDateTone: i.isOverdue ? "danger" : "default",
73
- scheduledDateLabel: t(e.scheduled_payment_date),
74
- scheduledDateIsGap: D === c.Scheduled,
75
- paidDateLabel: t(e.paid_at?.slice(0, 10)),
76
- amountDueLabel: u(a),
77
- amountPaidLabel: l ? u(e.amount_paid) : "",
78
- amountPaidIsGap: D === c.Paid,
79
- amountScheduledLabel: u(e.amount_to_pay ?? a),
80
- totalAmountLabel: u(e.total_amount),
81
- attachment: e.file_id ? { label: E } : void 0,
82
- status: i.status,
83
- statusTone: i.tone,
84
- addedOnLabel: t(e.created_at?.slice(0, 10)),
85
- ...r(e) ? {
86
- rowTone: "warning",
87
- rowNote: T
88
- } : {},
89
- onOpen: () => w(e.id, s(e.status))
90
- };
91
- }), [
92
- q.data?.data,
93
- T,
94
- E,
95
- w,
96
- D
97
- ]), $ = h((e) => {
98
- let t = e;
99
- ie(t), k((e) => {
100
- let n = e[0]?.id;
101
- return n ? u(t).some((e) => ne(e) === n) ? e : b : e;
102
- }), R();
103
- }, [R]), se = h((e) => {
104
- $(c.All), F(""), B(e);
105
- }, [B, $]), ce = h((e) => {
106
- k((t) => typeof e == "function" ? e(t) : e), R();
107
- }, [R]), le = h((e) => {
108
- j(e), R();
109
- }, [R]), ue = h(() => N(q.data?.next_pagination_token ?? void 0), [q.data?.next_pagination_token]), de = h(() => N(q.data?.prev_pagination_token ?? void 0), [q.data?.prev_pagination_token]), fe = h(() => {
110
- q.refetch();
111
- }, [q.refetch]);
112
- return {
113
- rows: Q,
114
- isLoading: q.isLoading || K !== J || X && Z.isLoading || (Y ?? 0) > 0 && Q.length === 0,
115
- isError: q.isError,
116
- onRetry: fe,
117
- selectedFilterTabId: D,
118
- onFilterTabChange: $,
119
- showVendorBills: se,
120
- searchValue: P,
121
- onSearchChange: F,
122
- hasAnyBills: oe,
123
- isSearchActive: I.length > 0 || z.isFilterActive,
124
- filterBarProps: z.filterBarProps,
125
- visibleColumns: u(D),
126
- showAddPanelWhenEmpty: d(D),
127
- sorting: O,
128
- onSortingChange: ce,
129
- pageSize: A,
130
- onPageSizeChange: le,
131
- hasNextPage: !!q.data?.next_pagination_token,
132
- hasPrevPage: !!q.data?.prev_pagination_token,
133
- onNextPage: ue,
134
- onPrevPage: de
135
- };
136
- }
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.ReadyToSubmit]: "Ready to submit",
24
+ [e.PendingApproval]: "Pending review",
25
+ [e.ReadyToPay]: "Ready to pay",
26
+ [e.Paid]: "Paid",
27
+ [e.Canceled]: "Cancelled",
28
+ [e.Rejected]: "Rejected"
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
+ };
137
49
  //#endregion
138
- export { x as useBillsTable };
50
+ export { n as BILLS_FILTER_LABELS_EN };