@tesouro/embedded-components-react 0.11.226 → 0.11.228
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/bill-detail/ui/dist/index31.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index8.js +55 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index9.js +36 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +19 -185
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +10 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index12.js +186 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index13.js +35 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +15 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +76 -294
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +51 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +277 -456
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +29 -326
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +524 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +359 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index21.js +4 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index22.js +5 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index23.js +38 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index24.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index15.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index16.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index17.js +221 -200
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +14 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index11.js +1 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +13 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +52 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +2 -74
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +73 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +77 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +2 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +0 -6
|
@@ -1,85 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useLocalCalendarDay as e } from "../../../../shared/feature/dist/lib/calendar/useLocalCalendarDay.js";
|
|
6
|
+
import "../../../../shared/feature/dist/index.js";
|
|
7
|
+
import { billSummaryQueries as t, buildBillSummaryCardsView as n, overdueBillSummaryQueries as r, readBillTotals as i } from "./index12.js";
|
|
8
|
+
import { usePayablesAnalyticsQueries as a } from "../../data-access/dist/index6.js";
|
|
9
|
+
import "../../data-access/dist/index.js";
|
|
10
|
+
import { useMemo as o } from "react";
|
|
2
11
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index13.js
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
}
|
|
12
|
+
var s = t();
|
|
13
|
+
function c({ enabled: t, labels: c, selectedCard: l }) {
|
|
14
|
+
let u = e(), d = o(() => u ? r(u) : [], [u]), f = a({
|
|
15
|
+
queries: s,
|
|
16
|
+
enabled: t
|
|
17
|
+
}), p = a({
|
|
18
|
+
queries: d,
|
|
19
|
+
enabled: t
|
|
20
|
+
}), m = !u || [...f, ...p].some((e) => e.isPending);
|
|
21
|
+
return o(() => {
|
|
22
|
+
if (t) return m ? { kind: "loading" } : n({
|
|
23
|
+
totals: i(f),
|
|
24
|
+
overdue: i(p),
|
|
25
|
+
labels: c,
|
|
26
|
+
selectedCard: l
|
|
27
|
+
});
|
|
28
|
+
}, [
|
|
29
|
+
t,
|
|
30
|
+
m,
|
|
31
|
+
c,
|
|
32
|
+
p,
|
|
33
|
+
f,
|
|
34
|
+
l
|
|
35
|
+
]);
|
|
84
36
|
}
|
|
85
|
-
export {
|
|
37
|
+
export { c as useBillSummaryCards };
|
|
@@ -1,52 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BillsDatePreset as t } from "./index13.js";
|
|
1
|
+
import { BanIcon as e, Trash2Icon as t } from "lucide-react";
|
|
3
2
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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: "Created"
|
|
34
|
-
},
|
|
35
|
-
dateChip: (e, t) => `${e}: ${t}`,
|
|
36
|
-
statusChip: (e) => `Status: ${e}`,
|
|
37
|
-
vendorChip: (e) => `Vendor: ${e}`,
|
|
38
|
-
amountChip: (e) => `Amount: ${e}`,
|
|
39
|
-
attachmentChipHas: "Has attachment",
|
|
40
|
-
attachmentChipNone: "No attachment",
|
|
41
|
-
pastDue: "Past due",
|
|
42
|
-
scheduledStatus: "Scheduled",
|
|
43
|
-
valueList: (e) => e.join(", "),
|
|
44
|
-
moreValues: (e) => `+${e}`,
|
|
45
|
-
amountAtLeast: (e) => `${e} or more`,
|
|
46
|
-
amountAtMost: (e) => `${e} or less`,
|
|
47
|
-
amountBetween: (e, t) => `${e} - ${t}`,
|
|
48
|
-
dateRange: (e, t) => `${e} - ${t}`,
|
|
49
|
-
dateFrom: (e) => `From ${e}`,
|
|
50
|
-
dateTo: (e) => `Until ${e}`
|
|
51
|
-
};
|
|
52
|
-
export { n as BILLS_FILTER_LABELS_EN };
|
|
3
|
+
function n(n, r) {
|
|
4
|
+
return {
|
|
5
|
+
title: n.title,
|
|
6
|
+
description: n.description,
|
|
7
|
+
confirmButton: n.confirmButton,
|
|
8
|
+
presentation: {
|
|
9
|
+
alignment: "center",
|
|
10
|
+
icon: r === "delete" ? t : e,
|
|
11
|
+
tone: r === "confirm" ? "default" : "destructive",
|
|
12
|
+
actionWidth: "equal"
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export { n as duplicateRemovalPrompt };
|
|
@@ -1,303 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { formatMoneyExact as e } from "../../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
6
|
-
import "../../../../shared/util/dist/index.js";
|
|
7
|
-
import "../../../util/dist/index.js";
|
|
8
|
-
import { billStatusFilterApiValues as t } from "./index4.js";
|
|
9
|
-
import { BillSummaryCard as n, billSummaryCardFilter as r } from "./index10.js";
|
|
10
|
-
import { BillsDatePreset as i, resolveDatePreset as a } from "./index13.js";
|
|
11
|
-
import { BILLS_FILTER_LABELS_EN as o } from "./index14.js";
|
|
12
|
-
import { BillsFilterField as s } from "../../ui/dist/index12.js";
|
|
13
|
-
import "../../ui/dist/index.js";
|
|
14
|
-
import { getCounterpartName as c } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
15
|
-
import { useCounterpartsQuery as l } from "../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
16
|
-
import "../../../../shared/counterpart-management/feature/dist/index.js";
|
|
17
|
-
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
18
|
-
import { format as h, formatISO as g } from "date-fns";
|
|
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";
|
|
19
2
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
[i.ThisWeek]: "current",
|
|
34
|
-
[i.ThisMonth]: "current",
|
|
35
|
-
[i.ThisQuarter]: "current",
|
|
36
|
-
[i.ThisYear]: "current",
|
|
37
|
-
[i.Yesterday]: "past",
|
|
38
|
-
[i.LastWeek]: "past",
|
|
39
|
-
[i.LastMonth]: "past",
|
|
40
|
-
[i.Last30Days]: "past",
|
|
41
|
-
[i.Last90Days]: "past",
|
|
42
|
-
[i.LastQuarter]: "past",
|
|
43
|
-
[i.LastYear]: "past"
|
|
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"
|
|
44
16
|
};
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
...j?.dateFieldNames
|
|
75
|
-
}
|
|
76
|
-
}), [j]), [N, P] = m(() => w(ne)), F = i.length > 0 && !N.summaryCard, I = F ? i : v, L = u((e) => {
|
|
77
|
-
e !== N.summaryCard && k?.(e);
|
|
78
|
-
}, [k, N.summaryCard]), [R, z] = m({}), [B, V] = m(""), [H, U] = m(""), W = u((e) => {
|
|
79
|
-
P((t) => ({
|
|
80
|
-
...t,
|
|
81
|
-
...e
|
|
82
|
-
})), O?.();
|
|
83
|
-
}, [O]);
|
|
84
|
-
d(() => {
|
|
85
|
-
E || P((e) => e.vendorIds.length === 0 ? e : (O?.(), {
|
|
86
|
-
...e,
|
|
87
|
-
vendorIds: []
|
|
88
|
-
}));
|
|
89
|
-
}, [E, O]), d(() => {
|
|
90
|
-
P((e) => {
|
|
91
|
-
let t = e.statuses.filter((e) => I.includes(e));
|
|
92
|
-
return t.length === e.statuses.length ? e : (O?.(), {
|
|
93
|
-
...e,
|
|
94
|
-
statuses: t
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
}, [I, O]);
|
|
98
|
-
let G = f(() => N.statuses.filter((e) => I.includes(e)), [N.statuses, I]), K = N.summaryCard === n.Overdue ? A : void 0, q = p(K);
|
|
99
|
-
d(() => {
|
|
100
|
-
let e = q.current;
|
|
101
|
-
q.current = K, e && K && e !== K && O?.();
|
|
102
|
-
}, [K, O]), d(() => {
|
|
103
|
-
let e = setTimeout(() => U(B.trim()), b);
|
|
104
|
-
return () => clearTimeout(e);
|
|
105
|
-
}, [B]);
|
|
106
|
-
let J = l({
|
|
107
|
-
enabled: E && !D,
|
|
108
|
-
is_vendor: !0,
|
|
109
|
-
sort: "counterpart_name",
|
|
110
|
-
order: "asc",
|
|
111
|
-
limit: y,
|
|
112
|
-
counterpart_name__icontains: H || void 0
|
|
113
|
-
}), Y = f(() => (J.data?.data ?? []).map((e) => ({
|
|
114
|
-
value: e.id,
|
|
115
|
-
label: c(e)
|
|
116
|
-
})), [J.data?.data]), X = f(() => i.map((e) => ({
|
|
117
|
-
value: e,
|
|
118
|
-
label: M.statuses[e]
|
|
119
|
-
})), [i, M.statuses]), re = f(() => Object.entries(te).map(([e, t]) => ({
|
|
120
|
-
value: e,
|
|
121
|
-
label: M.presets[e],
|
|
122
|
-
group: t === "current" ? M.presetGroupCurrent : M.presetGroupPast
|
|
123
|
-
})), [
|
|
124
|
-
M.presetGroupCurrent,
|
|
125
|
-
M.presetGroupPast,
|
|
126
|
-
M.presets
|
|
127
|
-
]), ie = f(() => {
|
|
128
|
-
let e = {}, n = ee[N.dateField], i = (e) => Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
129
|
-
if (N.dateFrom && (e[`${n}__gte`] = n === "created_at" ? new Date(i(N.dateFrom)).toISOString() : g(N.dateFrom, { representation: "date" })), N.dateTo && (n === "created_at" ? e.created_at__lt = new Date(i(N.dateTo) + C).toISOString() : e[`${n}__lte`] = g(N.dateTo, { representation: "date" })), G.length > 0 && (e.status__in = t(G)), N.amountMode !== "any") {
|
|
130
|
-
let t = "total_amount__gte", n = "total_amount__lte", r = T(N.amountMin), i = T(N.amountMax);
|
|
131
|
-
N.amountMode === "exact" ? r !== void 0 && (e[t] = r, e[n] = r) : (r !== void 0 && (e[t] = r), i !== void 0 && (e[n] = i));
|
|
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
|
+
};
|
|
132
46
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
]), Z = f(() => {
|
|
139
|
-
let t = [], i = (e) => h(e, x), a = (e, t, n) => {
|
|
140
|
-
let r = t(M.valueList(n));
|
|
141
|
-
return n.length <= S ? {
|
|
142
|
-
key: e,
|
|
143
|
-
label: r
|
|
144
|
-
} : {
|
|
145
|
-
key: e,
|
|
146
|
-
label: t(M.valueList([...n.slice(0, S), M.moreValues(n.length - S)])),
|
|
147
|
-
fullLabel: r
|
|
47
|
+
case h.LastWeek: {
|
|
48
|
+
let e = c(p(v, 1));
|
|
49
|
+
return {
|
|
50
|
+
from: e,
|
|
51
|
+
to: r(e)
|
|
148
52
|
};
|
|
149
|
-
};
|
|
150
|
-
if (N.summaryCard) {
|
|
151
|
-
let { statuses: e } = r(N.summaryCard, A);
|
|
152
|
-
t.push(N.summaryCard === n.Overdue ? {
|
|
153
|
-
key: _.SummaryCard,
|
|
154
|
-
label: M.dateChip(M.dateFieldNames[s.DueDate], M.pastDue)
|
|
155
|
-
} : a(_.SummaryCard, M.statusChip, e ? e.map((e) => M.statuses[e]) : [M.scheduledStatus]));
|
|
156
53
|
}
|
|
157
|
-
|
|
158
|
-
let e = (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
54
|
+
case h.LastMonth: {
|
|
55
|
+
let e = o(d(v, 1));
|
|
56
|
+
return {
|
|
57
|
+
from: e,
|
|
58
|
+
to: t(e)
|
|
59
|
+
};
|
|
163
60
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
+
};
|
|
173
75
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
N,
|
|
181
|
-
G,
|
|
182
|
-
A,
|
|
183
|
-
R
|
|
184
|
-
]), ae = u((e) => {
|
|
185
|
-
switch (e) {
|
|
186
|
-
case _.SummaryCard:
|
|
187
|
-
L(null), W({ summaryCard: null });
|
|
188
|
-
break;
|
|
189
|
-
case _.Date:
|
|
190
|
-
W({
|
|
191
|
-
datePreset: void 0,
|
|
192
|
-
dateFrom: void 0,
|
|
193
|
-
dateTo: void 0
|
|
194
|
-
});
|
|
195
|
-
break;
|
|
196
|
-
case _.Status:
|
|
197
|
-
W({ statuses: [] });
|
|
198
|
-
break;
|
|
199
|
-
case _.Vendor:
|
|
200
|
-
W({ vendorIds: [] });
|
|
201
|
-
break;
|
|
202
|
-
case _.Amount:
|
|
203
|
-
W({
|
|
204
|
-
amountMode: "any",
|
|
205
|
-
amountMin: "",
|
|
206
|
-
amountMax: ""
|
|
207
|
-
});
|
|
208
|
-
break;
|
|
209
|
-
case _.Attachment: W({ hasFile: void 0 });
|
|
76
|
+
case h.LastYear: {
|
|
77
|
+
let e = l(m(v, 1));
|
|
78
|
+
return {
|
|
79
|
+
from: e,
|
|
80
|
+
to: i(e)
|
|
81
|
+
};
|
|
210
82
|
}
|
|
211
|
-
}
|
|
212
|
-
L(null), P(w()), O?.();
|
|
213
|
-
}, [O, L]), $ = u((e) => {
|
|
214
|
-
P((t) => t.summaryCard === e ? t : {
|
|
215
|
-
...t,
|
|
216
|
-
summaryCard: e
|
|
217
|
-
}), O?.();
|
|
218
|
-
}, [O]), oe = u((e) => {
|
|
219
|
-
L(e), $(e);
|
|
220
|
-
}, [$, L]), se = u((e) => {
|
|
221
|
-
z((t) => ({
|
|
222
|
-
...t,
|
|
223
|
-
[e.id]: e.name
|
|
224
|
-
})), L(null), P({
|
|
225
|
-
...w(),
|
|
226
|
-
vendorIds: [e.id]
|
|
227
|
-
}), O?.();
|
|
228
|
-
}, [O, L]), ce = u((e) => {
|
|
229
|
-
z((t) => {
|
|
230
|
-
let n = { ...t };
|
|
231
|
-
for (let t of Y) e.includes(t.value) && (n[t.value] = t.label);
|
|
232
|
-
return n;
|
|
233
|
-
}), W({ vendorIds: e });
|
|
234
|
-
}, [W, Y]);
|
|
235
|
-
return {
|
|
236
|
-
filterBarProps: {
|
|
237
|
-
fields: [...f(() => [
|
|
238
|
-
...E ? [s.Vendor] : [],
|
|
239
|
-
s.IssueDate,
|
|
240
|
-
s.DueDate,
|
|
241
|
-
...F ? [s.Status] : [],
|
|
242
|
-
s.TotalAmount,
|
|
243
|
-
s.AddedOn,
|
|
244
|
-
s.Attachment
|
|
245
|
-
], [F, E])],
|
|
246
|
-
activeFilterCount: Z.length,
|
|
247
|
-
chips: Z,
|
|
248
|
-
onRemoveChip: ae,
|
|
249
|
-
onClearAll: Q,
|
|
250
|
-
dateField: N.dateField,
|
|
251
|
-
onDateFieldChange: (e) => {
|
|
252
|
-
let t = !!(N.dateFrom || N.dateTo);
|
|
253
|
-
P((t) => ({
|
|
254
|
-
...t,
|
|
255
|
-
dateField: e
|
|
256
|
-
})), t && O?.();
|
|
257
|
-
},
|
|
258
|
-
datePresets: re,
|
|
259
|
-
selectedDatePreset: N.datePreset,
|
|
260
|
-
dateFrom: N.dateFrom,
|
|
261
|
-
dateTo: N.dateTo,
|
|
262
|
-
onDateRangeChange: ({ from: e, to: t }) => W({
|
|
263
|
-
datePreset: void 0,
|
|
264
|
-
dateFrom: e,
|
|
265
|
-
dateTo: t
|
|
266
|
-
}),
|
|
267
|
-
onDatePresetChange: (e) => {
|
|
268
|
-
let t = /* @__PURE__ */ new Date(), n = N.dateField === s.AddedOn ? new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()) : t, { from: r, to: i } = a(e, n);
|
|
269
|
-
W({
|
|
270
|
-
datePreset: e,
|
|
271
|
-
dateFrom: r,
|
|
272
|
-
dateTo: i
|
|
273
|
-
});
|
|
274
|
-
},
|
|
275
|
-
statusOptions: X,
|
|
276
|
-
selectedStatuses: G,
|
|
277
|
-
onStatusChange: (e) => W({ statuses: e }),
|
|
278
|
-
amountMode: N.amountMode,
|
|
279
|
-
onAmountModeChange: (e) => W({ amountMode: e }),
|
|
280
|
-
amountMin: N.amountMin,
|
|
281
|
-
amountMax: N.amountMax,
|
|
282
|
-
onAmountMinChange: (e) => W({ amountMin: e }),
|
|
283
|
-
onAmountMaxChange: (e) => W({ amountMax: e }),
|
|
284
|
-
vendorOptions: Y,
|
|
285
|
-
selectedVendors: N.vendorIds,
|
|
286
|
-
onVendorChange: ce,
|
|
287
|
-
vendorSearchValue: B,
|
|
288
|
-
onVendorSearchChange: V,
|
|
289
|
-
isVendorLoading: J.isLoading || D,
|
|
290
|
-
isVendorError: J.isError,
|
|
291
|
-
hasAttachment: N.hasFile,
|
|
292
|
-
onHasAttachmentChange: (e) => W({ hasFile: e })
|
|
293
|
-
},
|
|
294
|
-
query: ie,
|
|
295
|
-
isFilterActive: Z.length > 0,
|
|
296
|
-
clearAll: Q,
|
|
297
|
-
filterByVendor: se,
|
|
298
|
-
summaryCard: N.summaryCard,
|
|
299
|
-
selectSummaryCard: oe,
|
|
300
|
-
applySummaryCard: $
|
|
301
|
-
};
|
|
83
|
+
}
|
|
302
84
|
}
|
|
303
|
-
export {
|
|
85
|
+
export { h as BillsDatePreset, g as resolveDatePreset };
|
|
@@ -1,35 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { resolveVendorName as e } from "../../../util/dist/lib/resolveVendor.js";
|
|
6
|
-
import "../../../util/dist/index.js";
|
|
7
|
-
import { getCounterpartName as t } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
8
|
-
import { useCounterpartsByIdsQuery as n } from "../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
9
|
-
import "../../../../shared/counterpart-management/feature/dist/index.js";
|
|
10
|
-
import { useMemo as r } from "react";
|
|
1
|
+
import { BillStatusFilter as e } from "./index4.js";
|
|
2
|
+
import { BillsDatePreset as t } from "./index15.js";
|
|
11
3
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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: "Created"
|
|
34
|
+
},
|
|
35
|
+
dateChip: (e, t) => `${e}: ${t}`,
|
|
36
|
+
statusChip: (e) => `Status: ${e}`,
|
|
37
|
+
vendorChip: (e) => `Vendor: ${e}`,
|
|
38
|
+
amountChip: (e) => `Amount: ${e}`,
|
|
39
|
+
attachmentChipHas: "Has attachment",
|
|
40
|
+
attachmentChipNone: "No attachment",
|
|
41
|
+
pastDue: "Past due",
|
|
42
|
+
scheduledStatus: "Scheduled",
|
|
43
|
+
valueList: (e) => e.join(", "),
|
|
44
|
+
moreValues: (e) => `+${e}`,
|
|
45
|
+
amountAtLeast: (e) => `${e} or more`,
|
|
46
|
+
amountAtMost: (e) => `${e} or less`,
|
|
47
|
+
amountBetween: (e, t) => `${e} - ${t}`,
|
|
48
|
+
dateRange: (e, t) => `${e} - ${t}`,
|
|
49
|
+
dateFrom: (e) => `From ${e}`,
|
|
50
|
+
dateTo: (e) => `Until ${e}`
|
|
51
|
+
};
|
|
52
|
+
export { n as BILLS_FILTER_LABELS_EN };
|