@tesouro/embedded-components-react 0.11.188 → 0.11.190
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/README.md +12 -8
- package/dist/fixtures/index.d.ts +13 -46
- package/dist/index.css +3 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +40 -39
- package/dist/lib/BankAccountsWidget.d.ts +2 -0
- package/dist/lib/BillPayWidget.d.ts +16 -1
- package/dist/lib/BillPayWidget.js +3 -1
- package/dist/lib/WidgetSuite.d.ts +2 -0
- package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/BalanceHistoryWidgetFeature.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/lib/BalancesWidget/BalancesWidgetContext.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index2.js +17 -14
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/formatters.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/labels.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +76 -58
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +180 -180
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +62 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +32 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +20 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +101 -58
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +19 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +169 -138
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +227 -204
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +208 -204
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index21.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index23.js +212 -212
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index9.js +9 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +43 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +66 -64
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/index.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +21 -21
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +20 -20
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +77 -77
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +129 -122
- package/dist/packages/shared-ui-shadcn/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -5,27 +5,29 @@
|
|
|
5
5
|
import { formatMoneyExact as e } from "../../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
6
6
|
import "../../../../shared/util/dist/index.js";
|
|
7
7
|
import "../../../util/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "../../../../shared/counterpart-management/feature/dist/index.js";
|
|
11
|
-
import { BILL_STATUS_FILTER_ORDER as r, billStatusFilterApiValues as i } from "./index4.js";
|
|
12
|
-
import { BillsFilterField as a } from "../../ui/dist/index12.js";
|
|
8
|
+
import { BILL_STATUS_FILTER_ORDER as t, billStatusFilterApiValues as n } from "./index4.js";
|
|
9
|
+
import { BillsFilterField as r } from "../../ui/dist/index12.js";
|
|
13
10
|
import "../../ui/dist/index.js";
|
|
11
|
+
import { BillSummaryCard as i, billSummaryCardFilter as a } from "./index10.js";
|
|
14
12
|
import { BillsDatePreset as o, resolveDatePreset as s } from "./index13.js";
|
|
15
13
|
import { BILLS_FILTER_LABELS_EN as c } from "./index14.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
14
|
+
import { getCounterpartName as l } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
15
|
+
import { useCounterpartsQuery as u } from "../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
16
|
+
import "../../../../shared/counterpart-management/feature/dist/index.js";
|
|
17
|
+
import { useCallback as d, useEffect as f, useMemo as p, useRef as ee, useState as m } from "react";
|
|
18
|
+
import { format as h, formatISO as g } from "date-fns";
|
|
18
19
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js
|
|
19
|
-
var
|
|
20
|
+
var _ = {
|
|
21
|
+
SummaryCard: "summary_card",
|
|
20
22
|
Date: "date",
|
|
21
23
|
Status: "status",
|
|
22
24
|
Amount: "amount",
|
|
23
25
|
Vendor: "vendor",
|
|
24
26
|
Attachment: "attachment"
|
|
25
|
-
},
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
27
|
+
}, v = 50, te = 300, ne = "MMM d, yyyy", y = 864e5, b = {
|
|
28
|
+
[r.IssueDate]: "issued_at",
|
|
29
|
+
[r.DueDate]: "due_date",
|
|
30
|
+
[r.AddedOn]: "created_at"
|
|
29
31
|
}, x = {
|
|
30
32
|
[o.Today]: "current",
|
|
31
33
|
[o.ThisWeek]: "current",
|
|
@@ -40,9 +42,10 @@ var h = {
|
|
|
40
42
|
[o.LastQuarter]: "past",
|
|
41
43
|
[o.LastYear]: "past"
|
|
42
44
|
};
|
|
43
|
-
function S() {
|
|
45
|
+
function S(e = null) {
|
|
44
46
|
return {
|
|
45
|
-
|
|
47
|
+
summaryCard: e,
|
|
48
|
+
dateField: r.DueDate,
|
|
46
49
|
statuses: [],
|
|
47
50
|
amountMode: "any",
|
|
48
51
|
amountMin: "",
|
|
@@ -54,210 +57,238 @@ function C(e) {
|
|
|
54
57
|
let t = Number.parseFloat(e);
|
|
55
58
|
return Number.isFinite(t) ? Math.round(t * 100) : void 0;
|
|
56
59
|
}
|
|
57
|
-
function w({ offersStatusFilter: o = !1, offersVendorFilter: w = !0, isVendorFilterPaused: T = !1, onFiltersChange: E,
|
|
58
|
-
let
|
|
60
|
+
function w({ offersStatusFilter: o = !1, offersVendorFilter: w = !0, isVendorFilterPaused: T = !1, onFiltersChange: E, initialSummaryCard: D = null, onSummaryCardChange: O, today: k, labels: A } = {}) {
|
|
61
|
+
let j = p(() => ({
|
|
59
62
|
...c,
|
|
60
|
-
...
|
|
63
|
+
...A,
|
|
61
64
|
presets: {
|
|
62
65
|
...c.presets,
|
|
63
|
-
...
|
|
66
|
+
...A?.presets
|
|
64
67
|
},
|
|
65
68
|
statuses: {
|
|
66
69
|
...c.statuses,
|
|
67
|
-
...
|
|
70
|
+
...A?.statuses
|
|
68
71
|
},
|
|
69
72
|
dateFieldNames: {
|
|
70
73
|
...c.dateFieldNames,
|
|
71
|
-
...
|
|
74
|
+
...A?.dateFieldNames
|
|
72
75
|
}
|
|
73
|
-
}), [
|
|
74
|
-
|
|
76
|
+
}), [A]), [M, N] = m(() => S(D)), P = o && !M.summaryCard, F = d((e) => {
|
|
77
|
+
e !== M.summaryCard && O?.(e);
|
|
78
|
+
}, [O, M.summaryCard]), [I, L] = m({}), [R, z] = m(""), [B, V] = m(""), H = d((e) => {
|
|
79
|
+
N((t) => ({
|
|
75
80
|
...t,
|
|
76
81
|
...e
|
|
77
82
|
})), E?.();
|
|
78
83
|
}, [E]);
|
|
79
|
-
|
|
80
|
-
w ||
|
|
84
|
+
f(() => {
|
|
85
|
+
w || N((e) => e.vendorIds.length === 0 ? e : (E?.(), {
|
|
81
86
|
...e,
|
|
82
87
|
vendorIds: []
|
|
83
88
|
}));
|
|
84
|
-
}, [w, E]),
|
|
85
|
-
|
|
89
|
+
}, [w, E]), f(() => {
|
|
90
|
+
P || N((e) => e.statuses.length === 0 ? e : (E?.(), {
|
|
86
91
|
...e,
|
|
87
92
|
statuses: []
|
|
88
93
|
}));
|
|
89
|
-
}, [
|
|
90
|
-
|
|
94
|
+
}, [P, E]);
|
|
95
|
+
let U = M.summaryCard === i.Overdue ? k : void 0, W = ee(U);
|
|
96
|
+
f(() => {
|
|
97
|
+
let e = W.current;
|
|
98
|
+
W.current = U, e && U && e !== U && E?.();
|
|
99
|
+
}, [U, E]), f(() => {
|
|
100
|
+
let e = setTimeout(() => V(R.trim()), te);
|
|
91
101
|
return () => clearTimeout(e);
|
|
92
|
-
}, [
|
|
93
|
-
let
|
|
102
|
+
}, [R]);
|
|
103
|
+
let G = u({
|
|
94
104
|
enabled: w && !T,
|
|
95
105
|
is_vendor: !0,
|
|
96
106
|
sort: "counterpart_name",
|
|
97
107
|
order: "asc",
|
|
98
|
-
limit:
|
|
99
|
-
counterpart_name__icontains:
|
|
100
|
-
}),
|
|
108
|
+
limit: v,
|
|
109
|
+
counterpart_name__icontains: B || void 0
|
|
110
|
+
}), K = p(() => (G.data?.data ?? []).map((e) => ({
|
|
101
111
|
value: e.id,
|
|
102
|
-
label:
|
|
103
|
-
})), [
|
|
112
|
+
label: l(e)
|
|
113
|
+
})), [G.data?.data]), q = p(() => t.map((e) => ({
|
|
104
114
|
value: e,
|
|
105
|
-
label:
|
|
106
|
-
})), [
|
|
115
|
+
label: j.statuses[e]
|
|
116
|
+
})), [j.statuses]), J = p(() => Object.entries(x).map(([e, t]) => ({
|
|
107
117
|
value: e,
|
|
108
|
-
label:
|
|
109
|
-
group: t === "current" ?
|
|
118
|
+
label: j.presets[e],
|
|
119
|
+
group: t === "current" ? j.presetGroupCurrent : j.presetGroupPast
|
|
110
120
|
})), [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
]),
|
|
115
|
-
let e = {}, t = b[
|
|
116
|
-
if (
|
|
117
|
-
let t = "total_amount__gte", n = "total_amount__lte", r = C(
|
|
118
|
-
|
|
121
|
+
j.presetGroupCurrent,
|
|
122
|
+
j.presetGroupPast,
|
|
123
|
+
j.presets
|
|
124
|
+
]), Y = p(() => {
|
|
125
|
+
let e = {}, t = b[M.dateField], r = (e) => Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
126
|
+
if (M.dateFrom && (e[`${t}__gte`] = t === "created_at" ? new Date(r(M.dateFrom)).toISOString() : g(M.dateFrom, { representation: "date" })), M.dateTo && (t === "created_at" ? e.created_at__lt = new Date(r(M.dateTo) + y).toISOString() : e[`${t}__lte`] = g(M.dateTo, { representation: "date" })), M.statuses.length > 0 && (e.status__in = n(M.statuses)), M.amountMode !== "any") {
|
|
127
|
+
let t = "total_amount__gte", n = "total_amount__lte", r = C(M.amountMin), i = C(M.amountMax);
|
|
128
|
+
M.amountMode === "exact" ? r !== void 0 && (e[t] = r, e[n] = r) : (r !== void 0 && (e[t] = r), i !== void 0 && (e[n] = i));
|
|
119
129
|
}
|
|
120
|
-
return
|
|
121
|
-
}, [k]),
|
|
122
|
-
let t = [], n = (e) =>
|
|
130
|
+
return M.vendorIds.length > 0 && (e.counterpart_id__in = [...M.vendorIds]), M.hasFile !== void 0 && (e.has_file = M.hasFile), M.summaryCard && Object.assign(e, a(M.summaryCard, k).query), e;
|
|
131
|
+
}, [M, k]), X = p(() => {
|
|
132
|
+
let t = [], n = (e) => h(e, ne), o = (e) => {
|
|
123
133
|
let [t, ...n] = e;
|
|
124
|
-
return t ? n.length === 0 ? t :
|
|
134
|
+
return t ? n.length === 0 ? t : j.moreSelected(t, n.length) : "";
|
|
125
135
|
};
|
|
126
|
-
if (
|
|
127
|
-
let
|
|
136
|
+
if (M.summaryCard) {
|
|
137
|
+
let { statuses: e } = a(M.summaryCard, k);
|
|
138
|
+
t.push({
|
|
139
|
+
key: _.SummaryCard,
|
|
140
|
+
label: M.summaryCard === i.Overdue ? j.dateChip(j.dateFieldNames[r.DueDate], j.pastDue) : j.statusChip(e ? o(e.map((e) => j.statuses[e])) : j.scheduledStatus)
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (M.dateFrom || M.dateTo) {
|
|
144
|
+
let e = (M.datePreset ? j.presets[M.datePreset] : void 0) ?? (M.dateFrom && M.dateTo ? j.dateRange(n(M.dateFrom), n(M.dateTo)) : M.dateFrom ? j.dateFrom(n(M.dateFrom)) : j.dateTo(n(M.dateTo)));
|
|
128
145
|
t.push({
|
|
129
|
-
key:
|
|
130
|
-
label:
|
|
146
|
+
key: _.Date,
|
|
147
|
+
label: j.dateChip(j.dateFieldNames[M.dateField], e)
|
|
131
148
|
});
|
|
132
149
|
}
|
|
133
|
-
if (
|
|
134
|
-
key:
|
|
135
|
-
label:
|
|
136
|
-
}),
|
|
137
|
-
key:
|
|
138
|
-
label:
|
|
139
|
-
}),
|
|
150
|
+
if (M.statuses.length > 0 && t.push({
|
|
151
|
+
key: _.Status,
|
|
152
|
+
label: j.statusChip(o(M.statuses.map((e) => j.statuses[e] ?? e)))
|
|
153
|
+
}), M.vendorIds.length > 0 && t.push({
|
|
154
|
+
key: _.Vendor,
|
|
155
|
+
label: j.vendorChip(o(M.vendorIds.map((e) => I[e] ?? e)))
|
|
156
|
+
}), M.amountMode !== "any") {
|
|
140
157
|
let n = (t) => {
|
|
141
158
|
let n = Number.parseFloat(t);
|
|
142
159
|
return Number.isFinite(n) ? e(n, { currencyCode: "USD" }) : "";
|
|
143
|
-
}, r = n(
|
|
160
|
+
}, r = n(M.amountMin), i = n(M.amountMax), a = M.amountMode === "exact" ? r : r && i ? j.amountBetween(r, i) : r ? j.amountAtLeast(r) : i ? j.amountAtMost(i) : "";
|
|
144
161
|
a && t.push({
|
|
145
|
-
key:
|
|
146
|
-
label:
|
|
162
|
+
key: _.Amount,
|
|
163
|
+
label: j.amountChip(a)
|
|
147
164
|
});
|
|
148
165
|
}
|
|
149
|
-
return
|
|
150
|
-
key:
|
|
151
|
-
label:
|
|
166
|
+
return M.hasFile !== void 0 && t.push({
|
|
167
|
+
key: _.Attachment,
|
|
168
|
+
label: M.hasFile ? j.attachmentChipHas : j.attachmentChipNone
|
|
152
169
|
}), t;
|
|
153
170
|
}, [
|
|
154
|
-
|
|
171
|
+
j,
|
|
172
|
+
M,
|
|
155
173
|
k,
|
|
156
|
-
|
|
157
|
-
]),
|
|
174
|
+
I
|
|
175
|
+
]), Z = d((e) => {
|
|
158
176
|
switch (e) {
|
|
159
|
-
case
|
|
160
|
-
|
|
177
|
+
case _.SummaryCard:
|
|
178
|
+
F(null), H({ summaryCard: null });
|
|
179
|
+
break;
|
|
180
|
+
case _.Date:
|
|
181
|
+
H({
|
|
161
182
|
datePreset: void 0,
|
|
162
183
|
dateFrom: void 0,
|
|
163
184
|
dateTo: void 0
|
|
164
185
|
});
|
|
165
186
|
break;
|
|
166
|
-
case
|
|
167
|
-
|
|
187
|
+
case _.Status:
|
|
188
|
+
H({ statuses: [] });
|
|
168
189
|
break;
|
|
169
|
-
case
|
|
170
|
-
|
|
190
|
+
case _.Vendor:
|
|
191
|
+
H({ vendorIds: [] });
|
|
171
192
|
break;
|
|
172
|
-
case
|
|
173
|
-
|
|
193
|
+
case _.Amount:
|
|
194
|
+
H({
|
|
174
195
|
amountMode: "any",
|
|
175
196
|
amountMin: "",
|
|
176
197
|
amountMax: ""
|
|
177
198
|
});
|
|
178
199
|
break;
|
|
179
|
-
case
|
|
200
|
+
case _.Attachment: H({ hasFile: void 0 });
|
|
180
201
|
}
|
|
181
|
-
}, [
|
|
182
|
-
|
|
183
|
-
}, [E]),
|
|
184
|
-
|
|
202
|
+
}, [F, H]), Q = d(() => {
|
|
203
|
+
F(null), N(S()), E?.();
|
|
204
|
+
}, [E, F]), $ = d((e) => {
|
|
205
|
+
N((t) => t.summaryCard === e ? t : {
|
|
206
|
+
...t,
|
|
207
|
+
summaryCard: e
|
|
208
|
+
}), E?.();
|
|
209
|
+
}, [E]), re = d((e) => {
|
|
210
|
+
F(e), $(e);
|
|
211
|
+
}, [$, F]), ie = d((e) => {
|
|
212
|
+
L((t) => ({
|
|
185
213
|
...t,
|
|
186
214
|
[e.id]: e.name
|
|
187
|
-
})),
|
|
215
|
+
})), F(null), N({
|
|
188
216
|
...S(),
|
|
189
217
|
vendorIds: [e.id]
|
|
190
218
|
}), E?.();
|
|
191
|
-
}, [E]),
|
|
192
|
-
|
|
219
|
+
}, [E, F]), ae = d((e) => {
|
|
220
|
+
L((t) => {
|
|
193
221
|
let n = { ...t };
|
|
194
|
-
for (let t of
|
|
222
|
+
for (let t of K) e.includes(t.value) && (n[t.value] = t.label);
|
|
195
223
|
return n;
|
|
196
|
-
}),
|
|
197
|
-
}, [
|
|
224
|
+
}), H({ vendorIds: e });
|
|
225
|
+
}, [H, K]);
|
|
198
226
|
return {
|
|
199
227
|
filterBarProps: {
|
|
200
|
-
fields: [...
|
|
201
|
-
...w ? [
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
...
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
], [
|
|
209
|
-
activeFilterCount:
|
|
210
|
-
chips:
|
|
211
|
-
onRemoveChip:
|
|
212
|
-
onClearAll:
|
|
213
|
-
dateField:
|
|
228
|
+
fields: [...p(() => [
|
|
229
|
+
...w ? [r.Vendor] : [],
|
|
230
|
+
r.IssueDate,
|
|
231
|
+
r.DueDate,
|
|
232
|
+
...P ? [r.Status] : [],
|
|
233
|
+
r.TotalAmount,
|
|
234
|
+
r.AddedOn,
|
|
235
|
+
r.Attachment
|
|
236
|
+
], [P, w])],
|
|
237
|
+
activeFilterCount: X.length,
|
|
238
|
+
chips: X,
|
|
239
|
+
onRemoveChip: Z,
|
|
240
|
+
onClearAll: Q,
|
|
241
|
+
dateField: M.dateField,
|
|
214
242
|
onDateFieldChange: (e) => {
|
|
215
|
-
let t = !!(
|
|
216
|
-
|
|
243
|
+
let t = !!(M.dateFrom || M.dateTo);
|
|
244
|
+
N((t) => ({
|
|
217
245
|
...t,
|
|
218
246
|
dateField: e
|
|
219
247
|
})), t && E?.();
|
|
220
248
|
},
|
|
221
|
-
datePresets:
|
|
222
|
-
selectedDatePreset:
|
|
223
|
-
dateFrom:
|
|
224
|
-
dateTo:
|
|
225
|
-
onDateRangeChange: ({ from: e, to: t }) =>
|
|
249
|
+
datePresets: J,
|
|
250
|
+
selectedDatePreset: M.datePreset,
|
|
251
|
+
dateFrom: M.dateFrom,
|
|
252
|
+
dateTo: M.dateTo,
|
|
253
|
+
onDateRangeChange: ({ from: e, to: t }) => H({
|
|
226
254
|
datePreset: void 0,
|
|
227
255
|
dateFrom: e,
|
|
228
256
|
dateTo: t
|
|
229
257
|
}),
|
|
230
258
|
onDatePresetChange: (e) => {
|
|
231
|
-
let t = /* @__PURE__ */ new Date(), n =
|
|
232
|
-
|
|
259
|
+
let t = /* @__PURE__ */ new Date(), n = M.dateField === r.AddedOn ? new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()) : t, { from: i, to: a } = s(e, n);
|
|
260
|
+
H({
|
|
233
261
|
datePreset: e,
|
|
234
|
-
dateFrom:
|
|
235
|
-
dateTo:
|
|
262
|
+
dateFrom: i,
|
|
263
|
+
dateTo: a
|
|
236
264
|
});
|
|
237
265
|
},
|
|
238
|
-
statusOptions:
|
|
239
|
-
selectedStatuses:
|
|
240
|
-
onStatusChange: (e) =>
|
|
241
|
-
amountMode:
|
|
242
|
-
onAmountModeChange: (e) =>
|
|
243
|
-
amountMin:
|
|
244
|
-
amountMax:
|
|
245
|
-
onAmountMinChange: (e) =>
|
|
246
|
-
onAmountMaxChange: (e) =>
|
|
247
|
-
vendorOptions:
|
|
248
|
-
selectedVendors:
|
|
249
|
-
onVendorChange:
|
|
250
|
-
vendorSearchValue:
|
|
251
|
-
onVendorSearchChange:
|
|
252
|
-
isVendorLoading:
|
|
253
|
-
isVendorError:
|
|
254
|
-
hasAttachment:
|
|
255
|
-
onHasAttachmentChange: (e) =>
|
|
266
|
+
statusOptions: q,
|
|
267
|
+
selectedStatuses: M.statuses,
|
|
268
|
+
onStatusChange: (e) => H({ statuses: e }),
|
|
269
|
+
amountMode: M.amountMode,
|
|
270
|
+
onAmountModeChange: (e) => H({ amountMode: e }),
|
|
271
|
+
amountMin: M.amountMin,
|
|
272
|
+
amountMax: M.amountMax,
|
|
273
|
+
onAmountMinChange: (e) => H({ amountMin: e }),
|
|
274
|
+
onAmountMaxChange: (e) => H({ amountMax: e }),
|
|
275
|
+
vendorOptions: K,
|
|
276
|
+
selectedVendors: M.vendorIds,
|
|
277
|
+
onVendorChange: ae,
|
|
278
|
+
vendorSearchValue: R,
|
|
279
|
+
onVendorSearchChange: z,
|
|
280
|
+
isVendorLoading: G.isLoading || T,
|
|
281
|
+
isVendorError: G.isError,
|
|
282
|
+
hasAttachment: M.hasFile,
|
|
283
|
+
onHasAttachmentChange: (e) => H({ hasFile: e })
|
|
256
284
|
},
|
|
257
|
-
query:
|
|
258
|
-
isFilterActive:
|
|
259
|
-
clearAll:
|
|
260
|
-
filterByVendor:
|
|
285
|
+
query: Y,
|
|
286
|
+
isFilterActive: X.length > 0,
|
|
287
|
+
clearAll: Q,
|
|
288
|
+
filterByVendor: ie,
|
|
289
|
+
summaryCard: M.summaryCard,
|
|
290
|
+
selectSummaryCard: re,
|
|
291
|
+
applySummaryCard: $
|
|
261
292
|
};
|
|
262
293
|
}
|
|
263
|
-
export {
|
|
294
|
+
export { _ as BillsFilterChipKey, w as useBillsFilters };
|