@tesouro/embedded-components-react 0.5.235 → 0.5.236

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.
Files changed (77) hide show
  1. package/README.md +3 -0
  2. package/dist/index.d.ts +110 -1
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +110 -1
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +3 -3
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +210 -208
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +98 -40
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +159 -39
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +53 -77
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +99 -132
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index36.js +40 -341
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index37.js +43 -0
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index38.js +92 -0
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index39.js +146 -0
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index40.js +354 -0
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +28 -24
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +2 -37
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +9 -214
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +27 -159
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +233 -14
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +34 -22
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +214 -2
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +153 -87
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +16 -3
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +22 -21
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +2 -51
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +30 -15
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +90 -14
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +3 -10
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +20 -69
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +51 -33
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +16 -17
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +8 -14
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +70 -30
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +33 -14
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +17 -25
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +12 -83
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +9 -121
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +28 -401
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +16 -2
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +22 -42
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +80 -65
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +383 -473
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +2 -106
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +48 -0
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +72 -2
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +498 -4
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +106 -1
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +141 -93
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +2 -28
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +4 -236
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +0 -2
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +90 -239
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +24 -89
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +231 -54
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -353
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +249 -0
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +93 -0
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +3 -40
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +59 -0
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +353 -0
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +18 -2
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +121 -9
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +100 -27
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +38 -233
  75. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  76. package/package.json +1 -1
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +0 -100
@@ -1,44 +1,102 @@
1
- import { formatMoney as e, getStatusTone as t } from "./index13.js";
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";
2
2
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js
3
- var n = [
4
- "draft",
5
- "issued",
6
- "overdue",
7
- "partially_paid",
8
- "paid",
9
- "recurring",
10
- "canceled",
11
- "uncollectible"
12
- ];
13
- function r(e) {
14
- let t = n.indexOf(e);
15
- return t === -1 ? n.length : t;
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
+ }, g = {
17
+ [h.Today]: "current",
18
+ [h.ThisWeek]: "current",
19
+ [h.ThisMonth]: "current",
20
+ [h.ThisQuarter]: "current",
21
+ [h.ThisYear]: "current",
22
+ [h.Yesterday]: "past",
23
+ [h.LastWeek]: "past",
24
+ [h.LastMonth]: "past",
25
+ [h.Last30Days]: "past",
26
+ [h.Last90Days]: "past",
27
+ [h.LastQuarter]: "past",
28
+ [h.LastYear]: "past"
29
+ };
30
+ function _(e) {
31
+ return e in g;
16
32
  }
17
- function i({ counts: n, amounts: i, statusFilter: a, statusLabels: o, fallback: s }) {
18
- let c = new Map(Object.entries(o)), l = new Map(i.map((e) => [e.dimension_value, e.metric_value])), u = n.flatMap((e) => e.dimension_value ? [{
19
- status: e.dimension_value,
20
- count: e.metric_value
21
- }] : []), d = u.filter(({ status: e }) => e !== "recurring").reduce((e, { count: t }) => e + t, 0);
22
- return {
23
- kind: "ready",
24
- all: {
25
- value: "all",
26
- countLabel: String(d),
27
- selected: a === "all"
28
- },
29
- statuses: [...u].sort((e, t) => r(e.status) - r(t.status)).map(({ status: n, count: r }) => ({
30
- value: n,
31
- statusLabel: c.get(n) ?? o.unknown,
32
- statusTone: t(n),
33
- countLabel: String(r),
34
- amountLabel: e({
35
- amount: l.get(n) ?? 0,
36
- currency: "USD",
37
- fallback: s
38
- }),
39
- selected: a === n
40
- }))
41
- };
33
+ function v(g, _ = /* @__PURE__ */ new Date()) {
34
+ let v = a(_);
35
+ switch (g) {
36
+ case h.Today: return {
37
+ from: v,
38
+ to: e(v)
39
+ };
40
+ case h.ThisWeek: return {
41
+ from: c(v),
42
+ to: r(v)
43
+ };
44
+ case h.ThisMonth: return {
45
+ from: o(v),
46
+ to: t(v)
47
+ };
48
+ case h.ThisQuarter: return {
49
+ from: s(v),
50
+ to: n(v)
51
+ };
52
+ case h.ThisYear: return {
53
+ from: l(v),
54
+ to: i(v)
55
+ };
56
+ case h.Yesterday: {
57
+ let t = u(v, 1);
58
+ return {
59
+ from: t,
60
+ to: e(t)
61
+ };
62
+ }
63
+ case h.LastWeek: {
64
+ let e = c(p(v, 1));
65
+ return {
66
+ from: e,
67
+ to: r(e)
68
+ };
69
+ }
70
+ case h.LastMonth: {
71
+ let e = o(d(v, 1));
72
+ return {
73
+ from: e,
74
+ to: t(e)
75
+ };
76
+ }
77
+ case h.Last30Days: return {
78
+ from: u(v, 30),
79
+ to: v
80
+ };
81
+ case h.Last90Days: return {
82
+ from: u(v, 90),
83
+ to: v
84
+ };
85
+ case h.LastQuarter: {
86
+ let e = s(f(v, 1));
87
+ return {
88
+ from: e,
89
+ to: n(e)
90
+ };
91
+ }
92
+ case h.LastYear: {
93
+ let e = l(m(v, 1));
94
+ return {
95
+ from: e,
96
+ to: i(e)
97
+ };
98
+ }
99
+ }
42
100
  }
43
101
  //#endregion
44
- export { i as buildReceivableStatusCardsView };
102
+ export { g as INVOICES_DATE_PRESET_GROUPS, h as InvoicesDatePreset, _ as isInvoicesDatePreset, v as resolveInvoicesDatePreset };
@@ -1,43 +1,163 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useReceivablesAnalyticsQuery as e } from "../../data-access/dist/index13.js";
6
- import "../../data-access/dist/index.js";
7
- import { buildReceivableStatusCardsView as t } from "./index32.js";
8
- import { useMemo as n } from "react";
1
+ import { InvoicesFilterField as e } from "../../ui/dist/index3.js";
2
+ import "../../ui/dist/index.js";
3
+ import { INVOICES_DATE_PRESET_GROUPS as t } from "./index32.js";
4
+ import { addDays as n, formatISO as r, startOfDay as i } from "date-fns";
9
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js
10
- function r({ enabled: r, statusFilter: i, messages: a, statusLabels: o }) {
11
- let s = e({
12
- enabled: r,
13
- dimension: "status",
14
- metric: "id",
15
- aggregation_function: "count",
16
- type: "invoice"
17
- }), c = e({
18
- enabled: r,
19
- dimension: "status",
20
- metric: "total_amount",
21
- aggregation_function: "summary",
22
- type: "invoice"
23
- }), l = s.data?.data, u = c.data?.data, d = s.isPending || c.isPending;
24
- return n(() => {
25
- if (r) return d ? { kind: "loading" } : t({
26
- counts: l ?? [],
27
- amounts: u ?? [],
28
- statusFilter: i,
29
- statusLabels: o,
30
- fallback: a.notAvailable
6
+ var a = [
7
+ "draft",
8
+ "issued",
9
+ "overdue",
10
+ "partially_paid",
11
+ "paid",
12
+ "uncollectible",
13
+ "canceled",
14
+ "recurring"
15
+ ], o = [
16
+ "draft",
17
+ "issued",
18
+ "overdue",
19
+ "partially_paid",
20
+ "paid",
21
+ "uncollectible"
22
+ ], s = [
23
+ e.DueDate,
24
+ e.CreatedAt,
25
+ e.IssueDate,
26
+ e.Status,
27
+ e.Amount,
28
+ e.Customer
29
+ ], c = {
30
+ dueDate: "due_date",
31
+ createdAt: "created_at",
32
+ issueDate: "issue_date"
33
+ }, l = {
34
+ Status: "status",
35
+ Customer: "customer",
36
+ Counterpart: "counterpart",
37
+ Amount: "amount",
38
+ Search: "search"
39
+ }, u = "date_";
40
+ function d(e) {
41
+ return {
42
+ dateRanges: {},
43
+ statuses: [],
44
+ amountMode: "any",
45
+ amountMin: "",
46
+ amountMax: "",
47
+ customerName: "",
48
+ customerId: e
49
+ };
50
+ }
51
+ function f(e) {
52
+ return !!(e?.from || e?.to || e?.preset);
53
+ }
54
+ function p(e) {
55
+ return Object.entries(e.dateRanges);
56
+ }
57
+ function m(e) {
58
+ let t = Number.parseFloat(e);
59
+ return Number.isNaN(t) ? void 0 : Math.round(t * 100);
60
+ }
61
+ function h(e) {
62
+ let t = {};
63
+ for (let [a, o] of p(e)) {
64
+ let e = c[a];
65
+ if (e === "due_date") {
66
+ o?.from && (t.due_date__gte = r(o.from, { representation: "date" })), o?.to && (t.due_date__lte = r(o.to, { representation: "date" }));
67
+ continue;
68
+ }
69
+ o?.from && (t[`${e}__gte`] = i(o.from).toISOString()), o?.to && (t[`${e}__lt`] = n(i(o.to), 1).toISOString());
70
+ }
71
+ if (t.status__in = e.statuses.length > 0 ? e.statuses : o, e.customerName && (t.counterpart_name__icontains = e.customerName), e.customerId && (t.counterpart_id = e.customerId), e.amountMode !== "any") {
72
+ let n = m(e.amountMin), r = m(e.amountMax);
73
+ e.amountMode === "exact" ? n !== void 0 && (t.total_amount__gte = n, t.total_amount__lte = n) : (n !== void 0 && (t.total_amount__gte = n), r !== void 0 && (t.total_amount__lte = r));
74
+ }
75
+ return t;
76
+ }
77
+ function g(e, t) {
78
+ return [
79
+ Object.values(e.dateRanges).some(f),
80
+ e.statuses.length > 0,
81
+ !!e.customerName,
82
+ !!e.customerId,
83
+ e.amountMode !== "any",
84
+ !!t
85
+ ].filter(Boolean).length;
86
+ }
87
+ function _({ state: e, search: t, counterpartName: n, labels: r, statusLabels: i }) {
88
+ let a = [], o = new Map(Object.entries(i));
89
+ for (let [t, n] of p(e)) {
90
+ if (!f(n)) continue;
91
+ let e = n?.preset && n.preset in r.presets ? r.presets[n.preset] : void 0;
92
+ a.push({
93
+ key: `${u}${t}`,
94
+ label: r.dateChip(r.dateFieldNames[t], e ?? r.customRange)
95
+ });
96
+ }
97
+ if (e.statuses.length > 0) {
98
+ let [t, ...n] = e.statuses.map((e) => o.get(e) ?? e);
99
+ a.push({
100
+ key: l.Status,
101
+ label: r.statusChip(n.length === 0 ? t : r.moreSelected(t, n.length))
31
102
  });
32
- }, [
33
- u,
34
- l,
35
- r,
36
- d,
37
- a.notAvailable,
38
- i,
39
- o
40
- ]);
103
+ }
104
+ return e.customerName && a.push({
105
+ key: l.Customer,
106
+ label: r.customerChip(e.customerName)
107
+ }), e.customerId && a.push({
108
+ key: l.Counterpart,
109
+ label: r.customerChip(n || e.customerId)
110
+ }), e.amountMode !== "any" && a.push({
111
+ key: l.Amount,
112
+ label: r.amountChip
113
+ }), t && a.push({
114
+ key: l.Search,
115
+ label: r.searchChip(t)
116
+ }), a;
117
+ }
118
+ function v(e, t) {
119
+ if (t.startsWith(u)) {
120
+ let n = t.slice(5), r = { ...e.dateRanges };
121
+ return delete r[n], {
122
+ ...e,
123
+ dateRanges: r
124
+ };
125
+ }
126
+ switch (t) {
127
+ case l.Status: return {
128
+ ...e,
129
+ statuses: []
130
+ };
131
+ case l.Customer: return {
132
+ ...e,
133
+ customerName: ""
134
+ };
135
+ case l.Counterpart: return {
136
+ ...e,
137
+ customerId: void 0
138
+ };
139
+ case l.Amount: return {
140
+ ...e,
141
+ amountMode: "any",
142
+ amountMin: "",
143
+ amountMax: ""
144
+ };
145
+ default: return e;
146
+ }
147
+ }
148
+ function y(e, t) {
149
+ return a.map((n) => ({
150
+ value: n,
151
+ label: e[n],
152
+ description: t.statusDescriptions[n]
153
+ }));
154
+ }
155
+ function b(e) {
156
+ return Object.entries(t).map(([t, n]) => ({
157
+ value: t,
158
+ label: e.presets[t],
159
+ group: n === "current" ? e.presetGroupCurrent : e.presetGroupPast
160
+ }));
41
161
  }
42
162
  //#endregion
43
- export { r as useReceivableStatusCards };
163
+ export { s as INVOICES_FILTER_FIELDS, o as INVOICE_DEFAULT_STATUSES, a as INVOICE_FILTER_STATUSES, l as InvoicesFilterChipKey, b as buildInvoicesDatePresetOptions, _ as buildInvoicesFilterChips, h as buildInvoicesFilterQuery, y as buildInvoicesStatusOptions, v as clearInvoicesFilter, g as countActiveInvoiceFilters, d as emptyInvoicesFilterState };
@@ -1,82 +1,58 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { buildReceivableRows as e, statusFilterOptions as t, typeForTab as n } from "./index13.js";
6
- import { useReceivablesQuery as r } from "../../data-access/dist/index11.js";
7
- import "../../data-access/dist/index.js";
8
- import { useReceivableStatusCards as i } from "./index33.js";
9
- import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
1
+ import { InvoicesDatePreset as e } from "./index32.js";
10
2
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js
11
- var l = [];
12
- function u({ activeTab: u, messages: f, statusLabels: p }) {
13
- let [m, h] = c([]), [g, _] = c(10), [v, y] = c(), [b, x] = c(""), [S, C] = c(""), [w, T] = c("all");
14
- o(() => {
15
- y(void 0), T("all");
16
- }, [u]), o(() => {
17
- let e = setTimeout(() => {
18
- C(b), y(void 0);
19
- }, 300);
20
- return () => clearTimeout(e);
21
- }, [b]);
22
- let E = m[0]?.id, D = E ? d[E] : void 0, O = m[0] ? m[0].desc ? "desc" : "asc" : void 0, k = r({
23
- type: n(u),
24
- limit: g,
25
- pagination_token: v,
26
- search_text: S || void 0,
27
- status: w === "all" ? void 0 : w,
28
- ...D ? {
29
- sort: D,
30
- order: O
31
- } : {}
32
- }), A = i({
33
- enabled: u === "invoices",
34
- statusFilter: w,
35
- messages: f,
36
- statusLabels: p
37
- }), j = k.data?.data ?? l, M = s(() => new Map(j.map((e) => [e.id, e])), [j]), N = a((e) => M.get(e), [M]), P = s(() => e({
38
- receivables: j,
39
- messages: f
40
- }), [f, j]), F = !!S || w !== "all", I = a((e) => {
41
- let t = typeof e == "function" ? e(m) : e;
42
- h(t), y(void 0);
43
- }, [m]), L = a((e) => {
44
- _(e), y(void 0);
45
- }, []), R = a((e) => {
46
- T(e), y(void 0);
47
- }, []), z = a(() => y(k.data?.next_pagination_token ?? void 0), [k.data?.next_pagination_token]), B = a(() => y(k.data?.prev_pagination_token ?? void 0), [k.data?.prev_pagination_token]), V = a(() => {
48
- k.refetch();
49
- }, [k]);
3
+ var t = {
4
+ presets: {
5
+ [e.Today]: "Today",
6
+ [e.ThisWeek]: "This week",
7
+ [e.ThisMonth]: "This month",
8
+ [e.ThisQuarter]: "This quarter",
9
+ [e.ThisYear]: "This year",
10
+ [e.Yesterday]: "Yesterday",
11
+ [e.LastWeek]: "Last week",
12
+ [e.LastMonth]: "Last month",
13
+ [e.Last30Days]: "Last 30 days",
14
+ [e.Last90Days]: "Last 90 days",
15
+ [e.LastQuarter]: "Last quarter",
16
+ [e.LastYear]: "Last year"
17
+ },
18
+ presetGroupCurrent: "Current",
19
+ presetGroupPast: "Past",
20
+ dateFieldNames: {
21
+ dueDate: "Due date",
22
+ createdAt: "Created on",
23
+ issueDate: "Issue date"
24
+ },
25
+ customRange: "Custom range",
26
+ statusDescriptions: {
27
+ draft: "Created but not yet sent",
28
+ overdue: "Past due date",
29
+ partially_paid: "Some payment received",
30
+ paid: "Fully paid"
31
+ },
32
+ dateChip: (e, t) => `${e}: ${t}`,
33
+ statusChip: (e) => `Status: ${e}`,
34
+ moreSelected: (e, t) => `${e} + ${t} more`,
35
+ customerChip: (e) => `Customer: ${e}`,
36
+ amountChip: "Amount",
37
+ searchChip: (e) => `Search: ${e}`
38
+ };
39
+ function n(e) {
50
40
  return {
51
- rows: P,
52
- isLoading: k.isLoading,
53
- isError: k.isError,
54
- sorting: m,
55
- onSortingChange: I,
56
- pageSize: g,
57
- onPageSizeChange: L,
58
- hasNextPage: !!k.data?.next_pagination_token,
59
- hasPrevPage: !!k.data?.prev_pagination_token,
60
- onNextPage: z,
61
- onPrevPage: B,
62
- searchValue: b,
63
- onSearchChange: x,
64
- statusFilter: w,
65
- statusOptions: t(w),
66
- onStatusFilterChange: R,
67
- statusCards: A,
68
- isFiltering: F,
69
- onRetry: V,
70
- getReceivableById: N
41
+ ...t,
42
+ ...e,
43
+ presets: {
44
+ ...t.presets,
45
+ ...e?.presets
46
+ },
47
+ dateFieldNames: {
48
+ ...t.dateFieldNames,
49
+ ...e?.dateFieldNames
50
+ },
51
+ statusDescriptions: {
52
+ ...t.statusDescriptions,
53
+ ...e?.statusDescriptions
54
+ }
71
55
  };
72
56
  }
73
- var d = {
74
- documentLabel: "document_id",
75
- customerLabel: "counterpart_name",
76
- status: "status",
77
- issueDateLabel: "issue_date",
78
- dueDateLabel: "due_date",
79
- totalLabel: "total_amount"
80
- };
81
57
  //#endregion
82
- export { u as useReceivablesTable };
58
+ export { t as INVOICES_FILTER_LABELS_EN, n as mergeInvoicesFilterLabels };