@tesouro/embedded-components-react 0.5.27 → 0.5.29
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.css +18 -6
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +2 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +52 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +15 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +57 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +68 -207
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +278 -175
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +13 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +47 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +53 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +204 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +32 -202
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +234 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +21 -240
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +532 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -436
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +42 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +230 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -233
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +11 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +127 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -129
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +46 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +122 -241
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +206 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -213
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +113 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -115
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +24 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +39 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +123 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +2 -170
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index104.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index105.js +7 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index106.js +158 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index107.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index108.js +11 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index109.js +100 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index111.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index112.js +52 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index113.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +20 -22
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +4 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +103 -146
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +93 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +15 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +43 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +55 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +33 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +2 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +2 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +34 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +34 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +2 -201
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +39 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +3 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +187 -350
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +3 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +13 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +356 -85
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +87 -119
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +2 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +125 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +25 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +90 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +26 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +4 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +30 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +9 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +85 -104
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index128.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index186.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index197.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index495.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +291 -351
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js +13 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js +30 -30
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +92 -87
- 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/index8.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +0 -28
|
@@ -2,252 +2,133 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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 ee } from "../../data-access/dist/index7.js";
|
|
9
|
+
import { usePayablesQuery as r, usePayablesTotalCountQuery as i } from "../../data-access/dist/index17.js";
|
|
7
10
|
import "../../data-access/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
10
|
-
import {
|
|
11
|
-
import "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { BILLS_FILTER_LABELS_EN as c } from "./index80.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";
|
|
11
|
+
import { derivePayableStatus as te } from "./index7.js";
|
|
12
|
+
import { resolveVendorName as a } from "./index8.js";
|
|
13
|
+
import { isEditablePayableStatus as ne } from "./index19.js";
|
|
14
|
+
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 "./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";
|
|
17
17
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, x = {
|
|
29
|
-
[o.Today]: "current",
|
|
30
|
-
[o.ThisWeek]: "current",
|
|
31
|
-
[o.ThisMonth]: "current",
|
|
32
|
-
[o.ThisQuarter]: "current",
|
|
33
|
-
[o.ThisYear]: "current",
|
|
34
|
-
[o.Yesterday]: "past",
|
|
35
|
-
[o.LastWeek]: "past",
|
|
36
|
-
[o.LastMonth]: "past",
|
|
37
|
-
[o.Last30Days]: "past",
|
|
38
|
-
[o.Last90Days]: "past",
|
|
39
|
-
[o.LastQuarter]: "past",
|
|
40
|
-
[o.LastYear]: "past"
|
|
41
|
-
};
|
|
42
|
-
function S() {
|
|
43
|
-
return {
|
|
44
|
-
dateField: n.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()), _);
|
|
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: w, onOpenBill: T, duplicateRowNote: E, attachmentLabel: D }) {
|
|
23
|
+
let [O, k] = v(s), [A, j] = v(b), [M, N] = v(y), [P, F] = v(), [I, L] = v(""), [R, z] = v(""), B = h(() => F(void 0), []);
|
|
24
|
+
g(() => {
|
|
25
|
+
let e = setTimeout(() => {
|
|
26
|
+
z(I), B();
|
|
27
|
+
}, 300);
|
|
90
28
|
return () => clearTimeout(e);
|
|
91
|
-
}, [
|
|
92
|
-
let
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
}, [
|
|
29
|
+
}, [I, B]);
|
|
30
|
+
let V = m({
|
|
31
|
+
offersStatusFilter: O === o.All,
|
|
32
|
+
offersVendorFilter: S,
|
|
33
|
+
isVendorFilterPaused: C,
|
|
34
|
+
labels: w,
|
|
35
|
+
onFiltersChange: B
|
|
36
|
+
}), H = A[0], U = p(H?.id), W = U ? H?.desc ? "desc" : "asc" : void 0, G = _(() => ({
|
|
37
|
+
...V.query,
|
|
38
|
+
limit: M,
|
|
39
|
+
pagination_token: P,
|
|
40
|
+
status__in: d(O) ?? V.query.status__in,
|
|
41
|
+
has_scheduled_payment: l(O),
|
|
42
|
+
counterpart_name__icontains: R || void 0,
|
|
43
|
+
sort: U,
|
|
44
|
+
order: W
|
|
45
|
+
}), [
|
|
46
|
+
V.query,
|
|
47
|
+
M,
|
|
48
|
+
P,
|
|
153
49
|
O,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
50
|
+
R,
|
|
51
|
+
U,
|
|
52
|
+
W
|
|
53
|
+
]), { organizationId: K } = e(), q = JSON.stringify([K, G]), J = r({
|
|
54
|
+
...G,
|
|
55
|
+
enabled: x
|
|
56
|
+
}), [Y, X] = v(q);
|
|
57
|
+
g(() => {
|
|
58
|
+
J.isFetching || X(q);
|
|
59
|
+
}, [J.isFetching, q]);
|
|
60
|
+
let Z = J.data?.data.length === 0, Q = i({ enabled: x && Z }), re = !Z || (Q.data?.count ?? 1) > 0, ie = _(() => (J.data?.data ?? []).map((e) => {
|
|
61
|
+
let r = te({
|
|
62
|
+
apiStatus: e.status,
|
|
63
|
+
dueDate: e.due_date,
|
|
64
|
+
scheduledPaymentDate: e.scheduled_payment_date
|
|
65
|
+
}), i = e.amount_due ?? e.total_amount, s = e.status === "partially_paid" || e.status === "paid", c = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" });
|
|
66
|
+
return {
|
|
67
|
+
rowKey: e.id,
|
|
68
|
+
vendorLabel: a(e),
|
|
69
|
+
issueDateLabel: t(e.issued_at),
|
|
70
|
+
dueDateLabel: t(e.due_date),
|
|
71
|
+
dueDateTone: r.isOverdue ? "danger" : "default",
|
|
72
|
+
scheduledDateLabel: t(e.scheduled_payment_date),
|
|
73
|
+
scheduledDateIsGap: O === o.Scheduled,
|
|
74
|
+
paidDateLabel: t(e.paid_at?.slice(0, 10)),
|
|
75
|
+
amountDueLabel: c(i),
|
|
76
|
+
amountPaidLabel: s ? c(e.amount_paid) : "",
|
|
77
|
+
amountPaidIsGap: O === o.Paid,
|
|
78
|
+
amountScheduledLabel: c(e.amount_to_pay ?? i),
|
|
79
|
+
totalAmountLabel: c(e.total_amount),
|
|
80
|
+
attachment: e.file_id ? { label: D } : void 0,
|
|
81
|
+
status: r.status,
|
|
82
|
+
statusTone: r.tone,
|
|
83
|
+
addedOnLabel: t(e.created_at?.slice(0, 10)),
|
|
84
|
+
...ee(e) ? {
|
|
85
|
+
rowTone: "warning",
|
|
86
|
+
rowNote: E
|
|
87
|
+
} : {},
|
|
88
|
+
onOpen: () => T(e.id, ne(e.status))
|
|
89
|
+
};
|
|
90
|
+
}), [
|
|
91
|
+
J.data?.data,
|
|
92
|
+
E,
|
|
93
|
+
D,
|
|
94
|
+
T,
|
|
95
|
+
O
|
|
96
|
+
]), ae = h((e) => {
|
|
97
|
+
let t = e;
|
|
98
|
+
k(t), j((e) => {
|
|
99
|
+
let n = e[0]?.id;
|
|
100
|
+
return n ? c(t).some((e) => f(e) === n) ? e : b : e;
|
|
101
|
+
}), B();
|
|
102
|
+
}, [B]), oe = h((e) => {
|
|
103
|
+
j((t) => typeof e == "function" ? e(t) : e), B();
|
|
104
|
+
}, [B]), $ = h((e) => {
|
|
105
|
+
N(e), B();
|
|
106
|
+
}, [B]), se = h(() => F(J.data?.next_pagination_token ?? void 0), [J.data?.next_pagination_token]), ce = h(() => F(J.data?.prev_pagination_token ?? void 0), [J.data?.prev_pagination_token]), le = h(() => {
|
|
107
|
+
J.refetch();
|
|
108
|
+
}, [J.refetch]);
|
|
189
109
|
return {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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 t = /* @__PURE__ */ new Date(), r = k.dateField === n.AddedOn ? new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()) : t, { 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
|
|
110
|
+
rows: ie,
|
|
111
|
+
isLoading: J.isLoading || q !== Y || Z && Q.isLoading,
|
|
112
|
+
isError: J.isError,
|
|
113
|
+
onRetry: le,
|
|
114
|
+
selectedFilterTabId: O,
|
|
115
|
+
onFilterTabChange: ae,
|
|
116
|
+
searchValue: I,
|
|
117
|
+
onSearchChange: L,
|
|
118
|
+
hasAnyBills: re,
|
|
119
|
+
isSearchActive: R.length > 0 || V.isFilterActive,
|
|
120
|
+
filterBarProps: V.filterBarProps,
|
|
121
|
+
visibleColumns: c(O),
|
|
122
|
+
showAddPanelWhenEmpty: u(O),
|
|
123
|
+
sorting: A,
|
|
124
|
+
onSortingChange: oe,
|
|
125
|
+
pageSize: M,
|
|
126
|
+
onPageSizeChange: $,
|
|
127
|
+
hasNextPage: !!J.data?.next_pagination_token,
|
|
128
|
+
hasPrevPage: !!J.data?.prev_pagination_token,
|
|
129
|
+
onNextPage: se,
|
|
130
|
+
onPrevPage: ce
|
|
250
131
|
};
|
|
251
132
|
}
|
|
252
133
|
//#endregion
|
|
253
|
-
export {
|
|
134
|
+
export { x as useBillsTable };
|