@tesouro/embedded-components-react 0.3.22 → 0.3.23
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.
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +31 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +42 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +158 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +33 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +45 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +4 -64
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +13 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +14 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +56 -123
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +18 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +15 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +61 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +130 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +20 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +38 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +48 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +5 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +71 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +48 -139
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +91 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +22 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +34 -22
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +144 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +63 -209
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +21 -103
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +209 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +211 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +104 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +12 -165
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +47 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +29 -99
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +64 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +166 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +34 -243
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +104 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +12 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +259 -81
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +4 -145
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +33 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +82 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +155 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +43 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +1 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +8 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +85 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +3 -59
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +19 -120
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +56 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +3 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +3 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +116 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +8 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +43 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +19 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +27 -249
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +82 -109
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +47 -206
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +253 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +111 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +6 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +197 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +6 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +114 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +3 -162
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +123 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -170
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +7 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +163 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +89 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
- package/package.json +1 -1
|
@@ -1,50 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { BillColumn as e } from "../../ui/dist/index63.js";
|
|
2
|
+
import "../../ui/dist/index.js";
|
|
3
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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}`
|
|
4
|
+
var t = {
|
|
5
|
+
root: "bill-pay-bills-tab",
|
|
6
|
+
uploadTray: "bill-pay-upload-tray",
|
|
7
|
+
detailsSheet: "bill-pay-details-sheet"
|
|
8
|
+
}, n = {
|
|
9
|
+
[e.Vendor]: "bill-pay-bills-cell-vendor",
|
|
10
|
+
[e.IssueDate]: "bill-pay-bills-cell-issue-date",
|
|
11
|
+
[e.DueDate]: "bill-pay-bills-cell-due-date",
|
|
12
|
+
[e.ScheduledDate]: "bill-pay-bills-cell-scheduled-date",
|
|
13
|
+
[e.PaidDate]: "bill-pay-bills-cell-paid-date",
|
|
14
|
+
[e.Status]: "bill-pay-bills-cell-status",
|
|
15
|
+
[e.AmountDue]: "bill-pay-bills-cell-amount-due",
|
|
16
|
+
[e.AmountScheduled]: "bill-pay-bills-cell-amount-scheduled",
|
|
17
|
+
[e.AmountPaid]: "bill-pay-bills-cell-amount-paid",
|
|
18
|
+
[e.TotalAmount]: "bill-pay-bills-cell-total-amount",
|
|
19
|
+
[e.AddedOn]: "bill-pay-bills-cell-added-on"
|
|
48
20
|
};
|
|
49
21
|
//#endregion
|
|
50
|
-
export { n as
|
|
22
|
+
export { t as billsTabTestIds, n as billsTableCellTestIds };
|
|
@@ -1,253 +1,31 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { formatMoneyExact as e } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
6
|
-
import { BillsFilterField as t } from "../../ui/dist/index60.js";
|
|
7
|
-
import "../../ui/dist/index.js";
|
|
8
|
-
import "../../data-access/dist/index.js";
|
|
9
|
-
import { getCounterpartName as n } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
10
|
-
import { useCounterpartsQuery as r } from "../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
11
|
-
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
12
|
-
import { BILL_STATUS_FILTER_ORDER as i, billStatusFilterApiValues as a } from "./index62.js";
|
|
13
|
-
import { BillsDatePreset as o, resolveDatePreset as s } from "./index63.js";
|
|
14
|
-
import { BILLS_FILTER_LABELS_EN as c } from "./index64.js";
|
|
15
|
-
import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
|
|
16
|
-
import { format as p, formatISO as m } from "date-fns";
|
|
17
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
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"]
|
|
41
26
|
};
|
|
42
|
-
function
|
|
43
|
-
return
|
|
44
|
-
dateField: t.DueDate,
|
|
45
|
-
statuses: [],
|
|
46
|
-
amountMode: "any",
|
|
47
|
-
amountMin: "",
|
|
48
|
-
amountMax: "",
|
|
49
|
-
vendorIds: []
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function C(e) {
|
|
53
|
-
let t = Number.parseFloat(e);
|
|
54
|
-
return Number.isFinite(t) ? Math.round(t * 100) : void 0;
|
|
55
|
-
}
|
|
56
|
-
function w({ offersStatusFilter: o = !1, offersVendorFilter: w = !0, isVendorFilterPaused: T = !1, onFiltersChange: E, labels: D } = {}) {
|
|
57
|
-
let O = d(() => ({
|
|
58
|
-
...c,
|
|
59
|
-
...D,
|
|
60
|
-
presets: {
|
|
61
|
-
...c.presets,
|
|
62
|
-
...D?.presets
|
|
63
|
-
},
|
|
64
|
-
statuses: {
|
|
65
|
-
...c.statuses,
|
|
66
|
-
...D?.statuses
|
|
67
|
-
},
|
|
68
|
-
dateFieldNames: {
|
|
69
|
-
...c.dateFieldNames,
|
|
70
|
-
...D?.dateFieldNames
|
|
71
|
-
}
|
|
72
|
-
}), [D]), [k, A] = f(S), [j, M] = f({}), [N, P] = f(""), [F, I] = f(""), L = l((e) => {
|
|
73
|
-
A((t) => ({
|
|
74
|
-
...t,
|
|
75
|
-
...e
|
|
76
|
-
})), E?.();
|
|
77
|
-
}, [E]);
|
|
78
|
-
u(() => {
|
|
79
|
-
w || A((e) => e.vendorIds.length === 0 ? e : (E?.(), {
|
|
80
|
-
...e,
|
|
81
|
-
vendorIds: []
|
|
82
|
-
}));
|
|
83
|
-
}, [w, E]), u(() => {
|
|
84
|
-
o || A((e) => e.statuses.length === 0 ? e : (E?.(), {
|
|
85
|
-
...e,
|
|
86
|
-
statuses: []
|
|
87
|
-
}));
|
|
88
|
-
}, [o, E]), u(() => {
|
|
89
|
-
let e = setTimeout(() => I(N.trim()), _);
|
|
90
|
-
return () => clearTimeout(e);
|
|
91
|
-
}, [N]);
|
|
92
|
-
let R = r({
|
|
93
|
-
enabled: w && !T,
|
|
94
|
-
is_vendor: !0,
|
|
95
|
-
sort: "counterpart_name",
|
|
96
|
-
order: "asc",
|
|
97
|
-
limit: g,
|
|
98
|
-
counterpart_name__icontains: F || void 0
|
|
99
|
-
}), z = d(() => (R.data?.data ?? []).map((e) => ({
|
|
100
|
-
value: e.id,
|
|
101
|
-
label: n(e)
|
|
102
|
-
})), [R.data?.data]), B = d(() => i.map((e) => ({
|
|
103
|
-
value: e,
|
|
104
|
-
label: O.statuses[e]
|
|
105
|
-
})), [O.statuses]), V = d(() => Object.entries(x).map(([e, t]) => ({
|
|
106
|
-
value: e,
|
|
107
|
-
label: O.presets[e],
|
|
108
|
-
group: t === "current" ? O.presetGroupCurrent : O.presetGroupPast
|
|
109
|
-
})), [
|
|
110
|
-
O.presetGroupCurrent,
|
|
111
|
-
O.presetGroupPast,
|
|
112
|
-
O.presets
|
|
113
|
-
]), H = d(() => {
|
|
114
|
-
let e = {}, t = b[k.dateField], n = (e) => Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
115
|
-
if (k.dateFrom && (e[`${t}__gte`] = t === "created_at" ? new Date(n(k.dateFrom)).toISOString() : m(k.dateFrom, { representation: "date" })), k.dateTo && (t === "created_at" ? e.created_at__lt = new Date(n(k.dateTo) + y).toISOString() : e[`${t}__lte`] = m(k.dateTo, { representation: "date" })), k.statuses.length > 0 && (e.status__in = a(k.statuses)), k.amountMode !== "any") {
|
|
116
|
-
let t = "total_amount__gte", n = "total_amount__lte", r = C(k.amountMin), i = C(k.amountMax);
|
|
117
|
-
k.amountMode === "exact" ? r !== void 0 && (e[t] = r, e[n] = r) : (r !== void 0 && (e[t] = r), i !== void 0 && (e[n] = i));
|
|
118
|
-
}
|
|
119
|
-
return k.vendorIds.length > 0 && (e.counterpart_id__in = [...k.vendorIds]), k.hasFile !== void 0 && (e.has_file = k.hasFile), e;
|
|
120
|
-
}, [k]), U = d(() => {
|
|
121
|
-
let t = [], n = (e) => p(e, v), r = (e) => {
|
|
122
|
-
let [t, ...n] = e;
|
|
123
|
-
return t ? n.length === 0 ? t : O.moreSelected(t, n.length) : "";
|
|
124
|
-
};
|
|
125
|
-
if (k.dateFrom || k.dateTo) {
|
|
126
|
-
let e = (k.datePreset ? O.presets[k.datePreset] : void 0) ?? (k.dateFrom && k.dateTo ? O.dateRange(n(k.dateFrom), n(k.dateTo)) : k.dateFrom ? O.dateFrom(n(k.dateFrom)) : O.dateTo(n(k.dateTo)));
|
|
127
|
-
t.push({
|
|
128
|
-
key: h.Date,
|
|
129
|
-
label: O.dateChip(O.dateFieldNames[k.dateField], e)
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
if (k.statuses.length > 0 && t.push({
|
|
133
|
-
key: h.Status,
|
|
134
|
-
label: O.statusChip(r(k.statuses.map((e) => O.statuses[e] ?? e)))
|
|
135
|
-
}), k.vendorIds.length > 0 && t.push({
|
|
136
|
-
key: h.Vendor,
|
|
137
|
-
label: O.vendorChip(r(k.vendorIds.map((e) => j[e] ?? e)))
|
|
138
|
-
}), k.amountMode !== "any") {
|
|
139
|
-
let n = (t) => {
|
|
140
|
-
let n = Number.parseFloat(t);
|
|
141
|
-
return Number.isFinite(n) ? e(n, { currencyCode: "USD" }) : "";
|
|
142
|
-
}, r = n(k.amountMin), i = n(k.amountMax), a = k.amountMode === "exact" ? r : r && i ? O.amountBetween(r, i) : r ? O.amountAtLeast(r) : i ? O.amountAtMost(i) : "";
|
|
143
|
-
a && t.push({
|
|
144
|
-
key: h.Amount,
|
|
145
|
-
label: O.amountChip(a)
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
return k.hasFile !== void 0 && t.push({
|
|
149
|
-
key: h.Attachment,
|
|
150
|
-
label: k.hasFile ? O.attachmentChipHas : O.attachmentChipNone
|
|
151
|
-
}), t;
|
|
152
|
-
}, [
|
|
153
|
-
O,
|
|
154
|
-
k,
|
|
155
|
-
j
|
|
156
|
-
]), W = l((e) => {
|
|
157
|
-
switch (e) {
|
|
158
|
-
case h.Date:
|
|
159
|
-
L({
|
|
160
|
-
datePreset: void 0,
|
|
161
|
-
dateFrom: void 0,
|
|
162
|
-
dateTo: void 0
|
|
163
|
-
});
|
|
164
|
-
break;
|
|
165
|
-
case h.Status:
|
|
166
|
-
L({ statuses: [] });
|
|
167
|
-
break;
|
|
168
|
-
case h.Vendor:
|
|
169
|
-
L({ vendorIds: [] });
|
|
170
|
-
break;
|
|
171
|
-
case h.Amount:
|
|
172
|
-
L({
|
|
173
|
-
amountMode: "any",
|
|
174
|
-
amountMin: "",
|
|
175
|
-
amountMax: ""
|
|
176
|
-
});
|
|
177
|
-
break;
|
|
178
|
-
case h.Attachment: L({ hasFile: void 0 });
|
|
179
|
-
}
|
|
180
|
-
}, [L]), G = l(() => {
|
|
181
|
-
A(S()), E?.();
|
|
182
|
-
}, [E]), K = l((e) => {
|
|
183
|
-
M((t) => {
|
|
184
|
-
let n = { ...t };
|
|
185
|
-
for (let t of z) e.includes(t.value) && (n[t.value] = t.label);
|
|
186
|
-
return n;
|
|
187
|
-
}), L({ vendorIds: e });
|
|
188
|
-
}, [L, z]);
|
|
189
|
-
return {
|
|
190
|
-
filterBarProps: {
|
|
191
|
-
fields: [...d(() => [
|
|
192
|
-
...w ? [t.Vendor] : [],
|
|
193
|
-
t.IssueDate,
|
|
194
|
-
t.DueDate,
|
|
195
|
-
...o ? [t.Status] : [],
|
|
196
|
-
t.TotalAmount,
|
|
197
|
-
t.AddedOn,
|
|
198
|
-
t.Attachment
|
|
199
|
-
], [o, w])],
|
|
200
|
-
activeFilterCount: U.length,
|
|
201
|
-
chips: U,
|
|
202
|
-
onRemoveChip: W,
|
|
203
|
-
onClearAll: G,
|
|
204
|
-
dateField: k.dateField,
|
|
205
|
-
onDateFieldChange: (e) => {
|
|
206
|
-
let t = !!(k.dateFrom || k.dateTo);
|
|
207
|
-
A((t) => ({
|
|
208
|
-
...t,
|
|
209
|
-
dateField: e
|
|
210
|
-
})), t && E?.();
|
|
211
|
-
},
|
|
212
|
-
datePresets: V,
|
|
213
|
-
selectedDatePreset: k.datePreset,
|
|
214
|
-
dateFrom: k.dateFrom,
|
|
215
|
-
dateTo: k.dateTo,
|
|
216
|
-
onDateRangeChange: ({ from: e, to: t }) => L({
|
|
217
|
-
datePreset: void 0,
|
|
218
|
-
dateFrom: e,
|
|
219
|
-
dateTo: t
|
|
220
|
-
}),
|
|
221
|
-
onDatePresetChange: (e) => {
|
|
222
|
-
let n = /* @__PURE__ */ new Date(), r = k.dateField === t.AddedOn ? new Date(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()) : n, { from: i, to: a } = s(e, r);
|
|
223
|
-
L({
|
|
224
|
-
datePreset: e,
|
|
225
|
-
dateFrom: i,
|
|
226
|
-
dateTo: a
|
|
227
|
-
});
|
|
228
|
-
},
|
|
229
|
-
statusOptions: B,
|
|
230
|
-
selectedStatuses: k.statuses,
|
|
231
|
-
onStatusChange: (e) => L({ statuses: e }),
|
|
232
|
-
amountMode: k.amountMode,
|
|
233
|
-
onAmountModeChange: (e) => L({ amountMode: e }),
|
|
234
|
-
amountMin: k.amountMin,
|
|
235
|
-
amountMax: k.amountMax,
|
|
236
|
-
onAmountMinChange: (e) => L({ amountMin: e }),
|
|
237
|
-
onAmountMaxChange: (e) => L({ amountMax: e }),
|
|
238
|
-
vendorOptions: z,
|
|
239
|
-
selectedVendors: k.vendorIds,
|
|
240
|
-
onVendorChange: K,
|
|
241
|
-
vendorSearchValue: N,
|
|
242
|
-
onVendorSearchChange: P,
|
|
243
|
-
isVendorLoading: R.isLoading || T,
|
|
244
|
-
isVendorError: R.isError,
|
|
245
|
-
hasAttachment: k.hasFile,
|
|
246
|
-
onHasAttachmentChange: (e) => L({ hasFile: e })
|
|
247
|
-
},
|
|
248
|
-
query: H,
|
|
249
|
-
isFilterActive: U.length > 0
|
|
250
|
-
};
|
|
27
|
+
function r(e) {
|
|
28
|
+
return e.flatMap((e) => n[e] ?? [e]);
|
|
251
29
|
}
|
|
252
30
|
//#endregion
|
|
253
|
-
export {
|
|
31
|
+
export { t as BILL_STATUS_FILTER_ORDER, e as BillStatusFilter, r as billStatusFilterApiValues };
|
|
@@ -1,113 +1,86 @@
|
|
|
1
|
-
|
|
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 { BillQueue as o, DEFAULT_BILL_QUEUE as s, billQueueColumns as c, billQueueHasScheduledPayment as l, billQueueOffersAddPanel as u, billQueueStatuses as d, billSortColumnId as f, billSortField as p } from "./index58.js";
|
|
12
|
-
import { useBillsFilters as m } from "./index65.js";
|
|
13
|
-
import { useCallback as h, useEffect as g, useMemo as _, useState as v } from "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";
|
|
14
2
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
limit: N,
|
|
36
|
-
pagination_token: F,
|
|
37
|
-
status__in: d(k) ?? H.query.status__in,
|
|
38
|
-
has_scheduled_payment: l(k),
|
|
39
|
-
counterpart_name__icontains: z || void 0,
|
|
40
|
-
sort: W,
|
|
41
|
-
order: W ? U?.desc ? "desc" : "asc" : void 0,
|
|
42
|
-
enabled: x
|
|
43
|
-
}), K = G.data?.data.length === 0, q = i({ enabled: x && K }), J = !K || (q.data?.count ?? 1) > 0, Y = _(() => new Set(E), [E]), X = _(() => (G.data?.data ?? []).map((r) => {
|
|
44
|
-
let i = a({
|
|
45
|
-
apiStatus: r.status,
|
|
46
|
-
dueDate: r.due_date,
|
|
47
|
-
scheduledPaymentDate: r.scheduled_payment_date
|
|
48
|
-
}), o = r.amount_due ?? r.total_amount, s = (e) => e == null ? "" : t(e / 100, { currencyCode: r.currency ?? "USD" });
|
|
49
|
-
return {
|
|
50
|
-
vendorLabel: n(r),
|
|
51
|
-
issueDateLabel: e(r.issued_at),
|
|
52
|
-
dueDateLabel: e(r.due_date),
|
|
53
|
-
scheduledDateLabel: e(r.scheduled_payment_date),
|
|
54
|
-
paidDateLabel: e(r.paid_at?.slice(0, 10)),
|
|
55
|
-
amountDueLabel: s(o),
|
|
56
|
-
amountPaidLabel: s(r.amount_paid),
|
|
57
|
-
amountScheduledLabel: s(r.amount_to_pay ?? o),
|
|
58
|
-
totalAmountLabel: s(r.total_amount),
|
|
59
|
-
attachment: r.file_id ? { label: O } : void 0,
|
|
60
|
-
status: i.status,
|
|
61
|
-
statusTone: i.tone,
|
|
62
|
-
addedOnLabel: e(r.created_at?.slice(0, 10)),
|
|
63
|
-
duplicateBadge: Y.has(r.id) ? {
|
|
64
|
-
label: D,
|
|
65
|
-
tone: "warning"
|
|
66
|
-
} : void 0,
|
|
67
|
-
onOpen: () => T(r.id, i.status === "draft")
|
|
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"
|
|
16
|
+
};
|
|
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)
|
|
68
23
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
+
};
|
|
46
|
+
}
|
|
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
|
+
}
|
|
111
84
|
}
|
|
112
85
|
//#endregion
|
|
113
|
-
export {
|
|
86
|
+
export { h as BillsDatePreset, g as resolveDatePreset };
|