@tesouro/embedded-components-react 0.11.183 → 0.11.187

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 (45) hide show
  1. package/dist/index.css +8 -0
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index.js +3 -2
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index6.js +31 -4
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index7.js +5 -0
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +4 -4
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +143 -12
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +33 -83
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index12.js +15 -48
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index13.js +76 -254
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +48 -34
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +241 -438
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +29 -298
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +460 -4
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +327 -4
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +3 -37
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +5 -1
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index21.js +38 -0
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index22.js +1 -0
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index5.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +30 -2
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index.js +7 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index10.js +2 -200
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index11.js +38 -3
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index12.js +10 -2
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index13.js +196 -11
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index14.js +1 -0
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index15.js +2 -2
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index16.js +9 -15
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +2 -54
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index19.js +20 -16
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +2 -460
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index21.js +54 -2
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index22.js +17 -0
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index23.js +463 -0
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index24.js +3 -0
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index8.js +5 -36
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index9.js +28 -10
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/queryKeys.js +8 -5
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/billPay.js +11 -9
  42. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/DashboardSection.js +7 -8
  44. package/dist/packages/shared-ui-shadcn/dist/index.js +3623 -3539
  45. package/package.json +1 -1
package/dist/index.css CHANGED
@@ -445,6 +445,9 @@
445
445
  .ttw\:col-start-2 {
446
446
  grid-column-start: 2;
447
447
  }
448
+ .ttw\:-m-1 {
449
+ margin: calc(var(--ttw-spacing) * -1);
450
+ }
448
451
  .ttw\:m-0 {
449
452
  margin: 0px;
450
453
  }
@@ -6288,6 +6291,11 @@
6288
6291
  grid-template-columns: repeat(4, minmax(0, 1fr));
6289
6292
  }
6290
6293
  }
6294
+ @container (width >= 768px) {
6295
+ .ttw\:\@3xl\:flex-row {
6296
+ flex-direction: row;
6297
+ }
6298
+ }
6291
6299
  @container line-item (width >= 896px) {
6292
6300
  .ttw\:\@4xl\/line-item\:col-span-2 {
6293
6301
  grid-column: span 2 / span 2;
@@ -2,5 +2,6 @@ import { useFirstPayablesPagesQuery as e } from "./index2.js";
2
2
  import { usePayablesCountQueries as t } from "./index3.js";
3
3
  import { usePayablesQuery as n } from "./index4.js";
4
4
  import { usePayablesTotalCountQuery as r } from "./index5.js";
5
- import "./index6.js";
6
- export { e as useFirstPayablesPagesQuery, t as usePayablesCountQueries, n as usePayablesQuery, r as usePayablesTotalCountQuery };
5
+ import { usePayablesAnalyticsQueries as i } from "./index6.js";
6
+ import "./index7.js";
7
+ export { e as useFirstPayablesPagesQuery, i as usePayablesAnalyticsQueries, t as usePayablesCountQueries, n as usePayablesQuery, r as usePayablesTotalCountQuery };
@@ -1,4 +1,31 @@
1
- import "./index2.js";
2
- import "./index3.js";
3
- import "./index4.js";
4
- import "./index5.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { getAnalyticsPayablesOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
+ import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
+ import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
+ import { organizationHeaders as r } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
+ import { useMemo as i } from "react";
11
+ import { useQueries as a } from "@tanstack/react-query";
12
+ // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index6.js
13
+ function o({ queries: o, enabled: s }) {
14
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = n(), p = r(l), m = !!(l && u) && (s === !0 || s === void 0), h = a({ queries: o.map((n) => ({
15
+ ...t(e({
16
+ client: c,
17
+ headers: p,
18
+ query: n
19
+ }), {
20
+ authEpoch: d,
21
+ organizationStatus: f
22
+ }),
23
+ enabled: m
24
+ })) });
25
+ return i(() => h.map((e) => ({
26
+ points: e.data?.data,
27
+ isPending: e.isPending,
28
+ isError: e.isError
29
+ })), [h]);
30
+ }
31
+ export { o as usePayablesAnalyticsQueries };
@@ -0,0 +1,5 @@
1
+ import "./index2.js";
2
+ import "./index3.js";
3
+ import "./index4.js";
4
+ import "./index5.js";
5
+ import "./index6.js";
@@ -1,7 +1,7 @@
1
1
  import "./index5.js";
2
2
  import "./index7.js";
3
- import "./index15.js";
4
- import "./index16.js";
5
3
  import "./index17.js";
6
- export { BillsListWidget } from "./index19.js";
7
- import "./index20.js";
4
+ import "./index18.js";
5
+ import "./index19.js";
6
+ export { BillsListWidget } from "./index21.js";
7
+ import "./index22.js";
@@ -1,16 +1,147 @@
1
- import { BanIcon as e, Trash2Icon as t } from "lucide-react";
1
+ import { amountOutputToMajorUnits as e } from "../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
2
+ import { formatMoneyExact as t } from "../../../../shared/util/dist/lib/formatMoneyExact.js";
3
+ import "../../../../shared/util/dist/index.js";
4
+ import "../../../util/dist/index.js";
2
5
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js
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"
6
+ var n = {
7
+ TotalUnpaid: "total_unpaid",
8
+ Overdue: "overdue",
9
+ Scheduled: "scheduled",
10
+ NotSubmitted: "not_submitted"
11
+ }, r = {
12
+ Scheduled: "scheduled",
13
+ ReadyToPay: "ready_to_pay",
14
+ ReadyToSubmit: "ready_to_submit",
15
+ PendingApproval: "pending_approval",
16
+ Rejected: "rejected",
17
+ Draft: "draft"
18
+ }, i = Object.values(r), a = [
19
+ "draft",
20
+ "new",
21
+ "approve_in_progress",
22
+ "waiting_to_be_paid",
23
+ "partially_paid",
24
+ "rejected"
25
+ ], o = {
26
+ draft: r.Draft,
27
+ new: r.ReadyToSubmit,
28
+ approve_in_progress: r.PendingApproval,
29
+ waiting_to_be_paid: r.ReadyToPay,
30
+ partially_paid: r.ReadyToPay,
31
+ rejected: r.Rejected
32
+ }, s = [
33
+ r.Draft,
34
+ r.ReadyToSubmit,
35
+ r.Rejected
36
+ ], c = {
37
+ metric: "id",
38
+ aggregation_function: "count"
39
+ }, l = {
40
+ metric: "amount_due",
41
+ aggregation_function: "summary"
42
+ };
43
+ function u(e = {}) {
44
+ let t = {
45
+ ...e,
46
+ currency: "USD",
47
+ status__in: [...a],
48
+ has_scheduled_payment: !1,
49
+ dimension: "status"
50
+ }, n = {
51
+ ...e,
52
+ currency: "USD",
53
+ status__in: [...a],
54
+ has_scheduled_payment: !0
55
+ };
56
+ return [
57
+ {
58
+ ...t,
59
+ ...c
60
+ },
61
+ {
62
+ ...t,
63
+ ...l
64
+ },
65
+ {
66
+ ...n,
67
+ ...c
68
+ },
69
+ {
70
+ ...n,
71
+ ...l
72
+ }
73
+ ];
74
+ }
75
+ function d(e) {
76
+ return u({ due_date__lt: e });
77
+ }
78
+ var f = () => Object.fromEntries(i.map((e) => [e, 0]));
79
+ function p(e) {
80
+ if (e.length < 4 || e.some((e) => e.isError)) return null;
81
+ let [t, n, r, i] = e, a = (e = []) => {
82
+ let t = f();
83
+ for (let n of e) {
84
+ let e = o[n.dimension_value ?? ""];
85
+ e && (t[e] += n.metric_value);
13
86
  }
87
+ return t;
88
+ }, s = a(t.points), c = a(n.points);
89
+ return s.scheduled = r.points?.[0]?.metric_value ?? 0, c.scheduled = i.points?.[0]?.metric_value ?? 0, {
90
+ counts: s,
91
+ amounts: c
92
+ };
93
+ }
94
+ var m = (e, t = i) => t.reduce((t, n) => t + e[n], 0), h = (n) => t(e({
95
+ value: n,
96
+ currencyCode: "USD"
97
+ }), {
98
+ currencyCode: "USD",
99
+ includeSpaceAfterCurrencySymbol: !1,
100
+ minimumFractionDigits: 2,
101
+ maximumFractionDigits: 2
102
+ });
103
+ function g({ totals: e, overdue: t, labels: a }) {
104
+ let o = (e, t, n, r, i) => {
105
+ if (!n) return {
106
+ id: e,
107
+ label: t,
108
+ amountLabel: a.unavailable
109
+ };
110
+ let o = m(n.counts, r), s = a.billCount(o);
111
+ return {
112
+ id: e,
113
+ label: t,
114
+ amountLabel: h(m(n.amounts, r)),
115
+ captionLabel: s,
116
+ description: o > 0 ? i(o, s) : void 0
117
+ };
118
+ }, c = (e, t) => (n, r) => a.statusBreakdown({
119
+ billCount: r,
120
+ statuses: i.filter((n) => t.includes(n) && (e?.counts[n] ?? 0) > 0).map((t) => a.statusCount[t](e?.counts[t] ?? 0))
121
+ });
122
+ return {
123
+ kind: "ready",
124
+ cards: [
125
+ o(n.TotalUnpaid, a.totalUnpaid, e, i, (n, r) => {
126
+ let i = e?.counts ?? f(), o = [
127
+ [m(i, s), a.stageCount.notSubmitted],
128
+ [i.pending_approval, a.stageCount.inApproval],
129
+ [i.ready_to_pay, a.stageCount.readyToPay],
130
+ [i.scheduled, a.stageCount.scheduled]
131
+ ];
132
+ return a.totalUnpaidDescription({
133
+ billCount: r,
134
+ stages: o.filter(([e]) => e > 0).map(([e, t]) => t(e)),
135
+ overdueCount: t ? m(t.counts) : void 0
136
+ });
137
+ }),
138
+ {
139
+ ...o(n.Overdue, a.overdue, t, i, c(t, i)),
140
+ labelTone: "destructive"
141
+ },
142
+ o(n.Scheduled, a.scheduled, e, [r.Scheduled], (e, t) => a.scheduledDescription(t)),
143
+ o(n.NotSubmitted, a.notSubmitted, e, s, c(e, s))
144
+ ]
14
145
  };
15
146
  }
16
- export { n as duplicateRemovalPrompt };
147
+ export { n as BillSummaryCard, r as BillSummaryStatus, a as UNPAID_PAYABLE_STATUSES, u as billSummaryQueries, g as buildBillSummaryCardsView, d as overdueBillSummaryQueries, p as readBillTotals };
@@ -1,85 +1,35 @@
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";
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 { usePayablesAnalyticsQueries as t } from "../../data-access/dist/index6.js";
8
+ import "../../data-access/dist/index.js";
9
+ import { billSummaryQueries as n, buildBillSummaryCardsView as r, overdueBillSummaryQueries as i, readBillTotals as a } from "./index10.js";
10
+ import { useMemo as o } from "react";
2
11
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js
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
- };
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
- };
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 = n();
13
+ function c({ enabled: n, labels: c }) {
14
+ let l = e(), u = o(() => l ? i(l) : [], [l]), d = t({
15
+ queries: s,
16
+ enabled: n
17
+ }), f = t({
18
+ queries: u,
19
+ enabled: n
20
+ }), p = !l || [...d, ...f].some((e) => e.isPending);
21
+ return o(() => {
22
+ if (n) return p ? { kind: "loading" } : r({
23
+ totals: a(d),
24
+ overdue: a(f),
25
+ labels: c
26
+ });
27
+ }, [
28
+ n,
29
+ p,
30
+ c,
31
+ f,
32
+ d
33
+ ]);
84
34
  }
85
- export { h as BillsDatePreset, g as resolveDatePreset };
35
+ export { c as useBillSummaryCards };
@@ -1,49 +1,16 @@
1
- import { BillStatusFilter as e } from "./index4.js";
2
- import { BillsDatePreset as t } from "./index11.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/index12.js
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: "Added on"
34
- },
35
- dateChip: (e, t) => `${e}: ${t}`,
36
- statusChip: (e) => `Status: ${e}`,
37
- vendorChip: (e) => `Vendor: ${e}`,
38
- amountChip: (e) => `Total amount: ${e}`,
39
- attachmentChipHas: "Has attachment",
40
- attachmentChipNone: "No attachment",
41
- moreSelected: (e, t) => `${e} + ${t} more`,
42
- amountAtLeast: (e) => `${e} or more`,
43
- amountAtMost: (e) => `${e} or less`,
44
- amountBetween: (e, t) => `${e} - ${t}`,
45
- dateRange: (e, t) => `${e} - ${t}`,
46
- dateFrom: (e) => `From ${e}`,
47
- dateTo: (e) => `Until ${e}`
48
- };
49
- 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 };