@tesouro/embedded-components-react 0.5.255 → 0.5.257
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/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +71 -65
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -14,83 +14,83 @@ import { useReceivableStatusCards as c } from "./useReceivableStatusCards.js";
|
|
|
14
14
|
import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
|
|
15
15
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js
|
|
16
16
|
var p = [];
|
|
17
|
-
function m({ activeTab: m, initialCounterpartId: g, messages: _, statusLabels:
|
|
18
|
-
let [
|
|
17
|
+
function m({ activeTab: m, initialCounterpartId: g, messages: _, statusLabels: y, filterLabels: b, enabled: x = !0, visible: S = x }) {
|
|
18
|
+
let [C, w] = f(() => v(m)), [T, E] = f(10), [D, O] = f(), [k, A] = f(""), [j, M] = f(""), [N, P] = f("all"), F = m === "invoices", I = l(() => O(void 0), []), L = o({
|
|
19
19
|
initialCounterpartId: g,
|
|
20
|
-
search:
|
|
21
|
-
onSearchChange:
|
|
22
|
-
onFiltersChange:
|
|
23
|
-
statusLabels:
|
|
24
|
-
labels:
|
|
25
|
-
}),
|
|
20
|
+
search: k,
|
|
21
|
+
onSearchChange: A,
|
|
22
|
+
onFiltersChange: I,
|
|
23
|
+
statusLabels: y,
|
|
24
|
+
labels: b
|
|
25
|
+
}), R = L.reset;
|
|
26
26
|
u(() => {
|
|
27
|
-
|
|
28
|
-
}, [m,
|
|
27
|
+
w(v(m)), O(void 0), P("all"), A(""), M(""), R();
|
|
28
|
+
}, [m, R]), u(() => {
|
|
29
29
|
let e = setTimeout(() => {
|
|
30
|
-
|
|
30
|
+
M(k), O(void 0);
|
|
31
31
|
}, 300);
|
|
32
32
|
return () => clearTimeout(e);
|
|
33
|
-
}, [
|
|
34
|
-
let
|
|
35
|
-
enabled:
|
|
33
|
+
}, [k]);
|
|
34
|
+
let z = C[0]?.id, B = z ? h[z] : void 0, V = C[0] ? C[0].desc ? "desc" : "asc" : void 0, H = i({
|
|
35
|
+
enabled: x,
|
|
36
36
|
type: r(m),
|
|
37
|
-
limit:
|
|
38
|
-
pagination_token:
|
|
39
|
-
search_text:
|
|
40
|
-
...
|
|
41
|
-
...
|
|
42
|
-
sort:
|
|
43
|
-
order:
|
|
37
|
+
limit: T,
|
|
38
|
+
pagination_token: D,
|
|
39
|
+
search_text: j || void 0,
|
|
40
|
+
...F ? L.query : { status: N === "all" ? void 0 : N },
|
|
41
|
+
...B ? {
|
|
42
|
+
sort: B,
|
|
43
|
+
order: V
|
|
44
44
|
} : {}
|
|
45
|
-
}),
|
|
46
|
-
enabled:
|
|
47
|
-
visible:
|
|
48
|
-
statusFilter:
|
|
45
|
+
}), U = c({
|
|
46
|
+
enabled: x && F,
|
|
47
|
+
visible: S && F,
|
|
48
|
+
statusFilter: L.cardStatus,
|
|
49
49
|
messages: _,
|
|
50
|
-
statusLabels:
|
|
51
|
-
}),
|
|
52
|
-
receivables:
|
|
50
|
+
statusLabels: y
|
|
51
|
+
}), W = H.data?.data ?? p, G = d(() => new Map(W.map((e) => [e.id, e])), [W]), K = l((e) => G.get(e), [G]), { initResponse: q } = e(), J = a(q?.scopes), Y = s(W), X = d(() => t({
|
|
52
|
+
receivables: W,
|
|
53
53
|
messages: _,
|
|
54
|
-
canRecordPayment:
|
|
55
|
-
customerNames:
|
|
54
|
+
canRecordPayment: J,
|
|
55
|
+
customerNames: Y
|
|
56
56
|
}), [
|
|
57
|
-
q,
|
|
58
57
|
J,
|
|
58
|
+
Y,
|
|
59
59
|
_,
|
|
60
|
-
|
|
61
|
-
]),
|
|
62
|
-
let t = typeof e == "function" ? e(
|
|
63
|
-
|
|
64
|
-
}, [
|
|
65
|
-
|
|
66
|
-
}, []),
|
|
67
|
-
|
|
68
|
-
}, []),
|
|
69
|
-
|
|
70
|
-
}, [
|
|
60
|
+
W
|
|
61
|
+
]), Z = F ? L.isFiltering : !!j || N !== "all", Q = l((e) => {
|
|
62
|
+
let t = typeof e == "function" ? e(C) : e;
|
|
63
|
+
w(t[0] && Object.hasOwn(h, t[0].id) ? t : v(m)), O(void 0);
|
|
64
|
+
}, [m, C]), $ = l((e) => {
|
|
65
|
+
E(e), O(void 0);
|
|
66
|
+
}, []), ee = l((e) => {
|
|
67
|
+
P(e), O(void 0);
|
|
68
|
+
}, []), te = l(() => O(H.data?.next_pagination_token ?? void 0), [H.data?.next_pagination_token]), ne = l(() => O(H.data?.prev_pagination_token ?? void 0), [H.data?.prev_pagination_token]), re = l(() => {
|
|
69
|
+
H.refetch();
|
|
70
|
+
}, [H]);
|
|
71
71
|
return {
|
|
72
|
-
rows:
|
|
73
|
-
isLoading:
|
|
74
|
-
isError:
|
|
75
|
-
sorting:
|
|
76
|
-
onSortingChange:
|
|
77
|
-
pageSize:
|
|
78
|
-
onPageSizeChange:
|
|
79
|
-
hasNextPage: !!
|
|
80
|
-
hasPrevPage: !!
|
|
81
|
-
onNextPage:
|
|
82
|
-
onPrevPage:
|
|
83
|
-
searchValue:
|
|
84
|
-
onSearchChange:
|
|
85
|
-
statusFilter:
|
|
86
|
-
statusOptions: n(
|
|
87
|
-
onStatusFilterChange:
|
|
88
|
-
statusCards:
|
|
89
|
-
onStatusCardSelect:
|
|
90
|
-
invoicesFilterBar:
|
|
91
|
-
isFiltering:
|
|
92
|
-
onRetry:
|
|
93
|
-
getReceivableById:
|
|
72
|
+
rows: X,
|
|
73
|
+
isLoading: H.isLoading,
|
|
74
|
+
isError: H.isError,
|
|
75
|
+
sorting: C,
|
|
76
|
+
onSortingChange: Q,
|
|
77
|
+
pageSize: T,
|
|
78
|
+
onPageSizeChange: $,
|
|
79
|
+
hasNextPage: !!H.data?.next_pagination_token,
|
|
80
|
+
hasPrevPage: !!H.data?.prev_pagination_token,
|
|
81
|
+
onNextPage: te,
|
|
82
|
+
onPrevPage: ne,
|
|
83
|
+
searchValue: k,
|
|
84
|
+
onSearchChange: A,
|
|
85
|
+
statusFilter: N,
|
|
86
|
+
statusOptions: n(N),
|
|
87
|
+
onStatusFilterChange: ee,
|
|
88
|
+
statusCards: U,
|
|
89
|
+
onStatusCardSelect: L.selectStatusCard,
|
|
90
|
+
invoicesFilterBar: F ? L.filterBar : void 0,
|
|
91
|
+
isFiltering: Z,
|
|
92
|
+
onRetry: re,
|
|
93
|
+
getReceivableById: K
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
var h = {
|
|
@@ -99,6 +99,12 @@ var h = {
|
|
|
99
99
|
issueDateLabel: "issue_date",
|
|
100
100
|
dueDateLabel: "due_date",
|
|
101
101
|
totalLabel: "total_amount"
|
|
102
|
-
}
|
|
102
|
+
}, g = [{
|
|
103
|
+
id: "dueDateLabel",
|
|
104
|
+
desc: !0
|
|
105
|
+
}], _ = [];
|
|
106
|
+
function v(e) {
|
|
107
|
+
return e === "invoices" ? g : _;
|
|
108
|
+
}
|
|
103
109
|
//#endregion
|
|
104
110
|
export { m as useReceivablesTable };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.257", n = "4fb4a587e4354567fdfb9440678a653d35260237", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|