@tesouro/embedded-components-react 0.11.202 → 0.11.205
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/quick-view-widget/accounts/feature/dist/lib/AccountsQuickViewWidget/AccountsQuickViewWidgetFeature.js +70 -59
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/accounts/ui/dist/index3.js +17 -16
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/bills/feature/dist/lib/BillsQuickViewWidget/BillsQuickViewWidgetFeature.js +49 -41
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/bills/ui/dist/index3.js +19 -18
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/CardsQuickViewWidgetFeature.js +53 -45
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index3.js +18 -17
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/invoices/feature/dist/lib/InvoicesQuickViewWidget/InvoicesQuickViewWidgetFeature.js +55 -45
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/invoices/ui/dist/index3.js +20 -18
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/quick-view/ui/dist/index3.js +98 -66
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +23 -22
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/formatCompactAmount.js +14 -0
- package/package.json +1 -1
|
@@ -3,74 +3,85 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { amountOutputToMajorUnits as e, minorExponentForCurrency as t } from "../../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
6
|
-
import {
|
|
6
|
+
import { formatCompactAmount as n } from "../../../../../../shared/util/dist/lib/formatCompactAmount.js";
|
|
7
|
+
import { formatMoneyExact as r } from "../../../../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
7
8
|
import "../../../../../../shared/util/dist/index.js";
|
|
8
|
-
import { isOrganizationOnItsWay as
|
|
9
|
-
import { useEmbedApi as
|
|
10
|
-
import { Scope as
|
|
9
|
+
import { isOrganizationOnItsWay as i } from "../../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
10
|
+
import { useEmbedApi as a } from "../../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
11
|
+
import { Scope as o } from "../../../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
12
|
import "../../../../../../shared/data-access/dist/index.js";
|
|
12
|
-
import { useAnalyticsTrack as
|
|
13
|
-
import { WidgetProvider as
|
|
14
|
-
import { useRefetchWidget as
|
|
13
|
+
import { useAnalyticsTrack as s } from "../../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
14
|
+
import { WidgetProvider as c } from "../../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
15
|
+
import { useRefetchWidget as l, useWidgetConfig as u, useWidgetError as d, useWidgetLoading as f } from "../../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
16
|
import "../../../../../../shared/feature/dist/index.js";
|
|
16
|
-
import { AccountsQuickViewTile as
|
|
17
|
+
import { AccountsQuickViewTile as p } from "../../../../ui/dist/index3.js";
|
|
17
18
|
import "../../../../ui/dist/index.js";
|
|
18
|
-
import { ACCOUNTS_QUICK_VIEW_WIDGET_LABELS_EN as
|
|
19
|
-
import { useAccountsBalanceSummary as
|
|
20
|
-
import { AccountsQuickViewWidgetAnalyticsEvent as
|
|
21
|
-
import { accountsQuickViewWidgetTestIds as
|
|
22
|
-
import { useCallback as
|
|
23
|
-
import { jsx as
|
|
19
|
+
import { ACCOUNTS_QUICK_VIEW_WIDGET_LABELS_EN as m } from "./labels.js";
|
|
20
|
+
import { useAccountsBalanceSummary as h } from "../accountsBalanceSummary/useAccountsBalanceSummary.js";
|
|
21
|
+
import { AccountsQuickViewWidgetAnalyticsEvent as g, WIDGET_NAME as _ } from "../analytics/events.js";
|
|
22
|
+
import { accountsQuickViewWidgetTestIds as v } from "./testIds.js";
|
|
23
|
+
import { useCallback as y, useEffect as b, useMemo as x } from "react";
|
|
24
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
24
25
|
// ../../libs/tesouro-embedded-components-react/quick-view-widget/accounts/feature/dist/lib/AccountsQuickViewWidget/AccountsQuickViewWidgetFeature.js
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
...
|
|
28
|
-
...
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
let { initResponse:
|
|
34
|
-
enabled:
|
|
35
|
-
organizationId:
|
|
36
|
-
}),
|
|
37
|
-
|
|
26
|
+
function C({ labels: c, onViewAccountsClick: _, className: C, style: w }) {
|
|
27
|
+
let T = {
|
|
28
|
+
...m,
|
|
29
|
+
...c
|
|
30
|
+
}, E = s();
|
|
31
|
+
b(() => {
|
|
32
|
+
E(g.Mounted);
|
|
33
|
+
}, [E]);
|
|
34
|
+
let { initResponse: D } = u(), O = f(), k = d(), A = l(), { organizationId: j, organizationStatus: M } = a(), N = i(M), P = D?.scopes?.includes(o.BankAccountReadOrg) ?? !1, { summary: F, accountsLoaded: I, isLoading: L, isError: R, isResolving: z, refetch: B } = h({
|
|
35
|
+
enabled: P,
|
|
36
|
+
organizationId: j
|
|
37
|
+
}), V = O && !D || N && !I || L || z, H = !!k && !I || R, U = F?.accountCount ?? 0, W = y(() => {
|
|
38
|
+
A(), P && j && B();
|
|
38
39
|
}, [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
]),
|
|
44
|
-
if (!
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
currencyCode:
|
|
40
|
+
A,
|
|
41
|
+
B,
|
|
42
|
+
P,
|
|
43
|
+
j
|
|
44
|
+
]), G = x(() => {
|
|
45
|
+
if (!F) return {
|
|
46
|
+
shown: "",
|
|
47
|
+
exact: void 0
|
|
48
|
+
};
|
|
49
|
+
let { currencyCode: i, minorTotal: a } = F, o = e({
|
|
50
|
+
value: a,
|
|
51
|
+
currencyCode: i
|
|
52
|
+
}), s = t(i), c = r(o, {
|
|
53
|
+
currencyCode: i,
|
|
51
54
|
includeSpaceAfterCurrencySymbol: !1,
|
|
52
|
-
minimumFractionDigits:
|
|
53
|
-
maximumFractionDigits:
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
minimumFractionDigits: s,
|
|
56
|
+
maximumFractionDigits: s
|
|
57
|
+
}), l = n(o, i);
|
|
58
|
+
return l ? {
|
|
59
|
+
shown: l,
|
|
60
|
+
exact: c
|
|
61
|
+
} : {
|
|
62
|
+
shown: c,
|
|
63
|
+
exact: void 0
|
|
64
|
+
};
|
|
65
|
+
}, [F]), K = F && F.summedAccountCount < F.accountCount ? T.accountCountInCurrency(F.summedAccountCount, F.accountCount, F.currencyCode) : T.accountCount(U);
|
|
66
|
+
return D && !P || !V && !H && U === 0 ? null : /* @__PURE__ */ S(p, {
|
|
67
|
+
value: G.shown,
|
|
68
|
+
exactValue: G.exact,
|
|
69
|
+
subtext: K,
|
|
70
|
+
onClick: _,
|
|
71
|
+
isLoading: V,
|
|
72
|
+
isError: H,
|
|
73
|
+
onRetry: H ? W : void 0,
|
|
74
|
+
labels: T,
|
|
75
|
+
testIds: v,
|
|
76
|
+
className: C,
|
|
77
|
+
style: w
|
|
67
78
|
});
|
|
68
79
|
}
|
|
69
|
-
function
|
|
70
|
-
return /* @__PURE__ */
|
|
80
|
+
function w({ labels: e, onViewAccountsClick: t, className: n, style: r, ...i }) {
|
|
81
|
+
return /* @__PURE__ */ S(c, {
|
|
71
82
|
...i,
|
|
72
|
-
widgetName:
|
|
73
|
-
children: /* @__PURE__ */
|
|
83
|
+
widgetName: _,
|
|
84
|
+
children: /* @__PURE__ */ S(C, {
|
|
74
85
|
labels: e,
|
|
75
86
|
onViewAccountsClick: t,
|
|
76
87
|
className: n,
|
|
@@ -78,4 +89,4 @@ function C({ labels: e, onViewAccountsClick: t, className: n, style: r, ...i })
|
|
|
78
89
|
})
|
|
79
90
|
});
|
|
80
91
|
}
|
|
81
|
-
export {
|
|
92
|
+
export { w as AccountsQuickViewWidget, C as AccountsQuickViewWidgetWithContext };
|
package/dist/libs/tesouro-embedded-components-react/quick-view-widget/accounts/ui/dist/index3.js
CHANGED
|
@@ -3,28 +3,29 @@ import { QuickViewTile as t } from "../../../../shared/quick-view/ui/dist/index3
|
|
|
3
3
|
import "../../../../shared/quick-view/ui/dist/index.js";
|
|
4
4
|
import { jsx as n } from "react/jsx-runtime";
|
|
5
5
|
// ../../libs/tesouro-embedded-components-react/quick-view-widget/accounts/ui/dist/index3.js
|
|
6
|
-
function r({ value: r,
|
|
7
|
-
let
|
|
6
|
+
function r({ value: r, exactValue: i, subtext: a, onClick: o, isLoading: s, isError: c, onRetry: l, labels: u, testIds: d, className: f, style: p }) {
|
|
7
|
+
let m = {
|
|
8
8
|
...e,
|
|
9
|
-
...
|
|
9
|
+
...u
|
|
10
10
|
};
|
|
11
11
|
return /* @__PURE__ */ n(t, {
|
|
12
|
-
title:
|
|
12
|
+
title: m.title,
|
|
13
13
|
value: r,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
exactValue: i,
|
|
15
|
+
subtext: a,
|
|
16
|
+
linkText: m.viewAccounts,
|
|
17
|
+
onClick: o,
|
|
18
|
+
isLoading: s,
|
|
19
|
+
isError: c,
|
|
20
|
+
onRetry: l,
|
|
20
21
|
labels: {
|
|
21
|
-
loadingLabel:
|
|
22
|
-
loadErrorTitle:
|
|
23
|
-
loadErrorRetry:
|
|
22
|
+
loadingLabel: m.loadingLabel,
|
|
23
|
+
loadErrorTitle: m.loadErrorTitle,
|
|
24
|
+
loadErrorRetry: m.loadErrorRetry
|
|
24
25
|
},
|
|
25
|
-
testIds:
|
|
26
|
-
className:
|
|
27
|
-
style:
|
|
26
|
+
testIds: d,
|
|
27
|
+
className: f,
|
|
28
|
+
style: p
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
export { r as AccountsQuickViewTile };
|
|
@@ -3,33 +3,40 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { amountOutputToMajorUnits as e } from "../../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
6
|
-
import {
|
|
6
|
+
import { formatCompactAmount as t } from "../../../../../../shared/util/dist/lib/formatCompactAmount.js";
|
|
7
|
+
import { formatMoneyExact as n } from "../../../../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
7
8
|
import "../../../../../../shared/util/dist/index.js";
|
|
8
|
-
import { OrganizationStatus as
|
|
9
|
-
import { useEmbedApi as
|
|
10
|
-
import { Scope as
|
|
9
|
+
import { OrganizationStatus as r, isOrganizationOnItsWay as i } from "../../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
10
|
+
import { useEmbedApi as a } from "../../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
11
|
+
import { Scope as o } from "../../../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
12
|
import "../../../../../../shared/data-access/dist/index.js";
|
|
12
|
-
import { useAnalyticsTrack as
|
|
13
|
-
import { WidgetProvider as
|
|
14
|
-
import { useRefetchWidget as
|
|
13
|
+
import { useAnalyticsTrack as s } from "../../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
14
|
+
import { WidgetProvider as c } from "../../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
15
|
+
import { useRefetchWidget as l, useWidgetConfig as u, useWidgetError as d, useWidgetLoading as f } from "../../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
16
|
import "../../../../../../shared/feature/dist/index.js";
|
|
16
|
-
import { BillsQuickViewTile as
|
|
17
|
+
import { BillsQuickViewTile as p } from "../../../../ui/dist/index3.js";
|
|
17
18
|
import "../../../../ui/dist/index.js";
|
|
18
|
-
import { BILLS_QUICK_VIEW_WIDGET_LABELS_EN as
|
|
19
|
-
import { BillsQuickViewWidgetAnalyticsEvent as
|
|
20
|
-
import { billsQuickViewWidgetTestIds as
|
|
21
|
-
import { useOpenBillsSummary as
|
|
22
|
-
import { useCallback as
|
|
23
|
-
import { jsx as
|
|
19
|
+
import { BILLS_QUICK_VIEW_WIDGET_LABELS_EN as m } from "./labels.js";
|
|
20
|
+
import { BillsQuickViewWidgetAnalyticsEvent as h, WIDGET_NAME as g } from "../analytics/events.js";
|
|
21
|
+
import { billsQuickViewWidgetTestIds as _ } from "./testIds.js";
|
|
22
|
+
import { useOpenBillsSummary as v } from "./useOpenBillsSummary.js";
|
|
23
|
+
import { useCallback as y, useEffect as b } from "react";
|
|
24
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
24
25
|
// ../../libs/tesouro-embedded-components-react/quick-view-widget/bills/feature/dist/lib/BillsQuickViewWidget/BillsQuickViewWidgetFeature.js
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
var S = (r) => {
|
|
27
|
+
let i = e({
|
|
28
|
+
value: r,
|
|
29
|
+
currencyCode: "USD"
|
|
30
|
+
}), a = n(i, {
|
|
31
|
+
currencyCode: "USD",
|
|
32
|
+
includeSpaceAfterCurrencySymbol: !1
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
shown: t(i, "USD") ?? a,
|
|
36
|
+
exact: a
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
function C(e, t, n) {
|
|
33
40
|
let r = (e, t = "viewBills") => ({
|
|
34
41
|
subtext: e,
|
|
35
42
|
description: e,
|
|
@@ -46,15 +53,15 @@ function S(e, t, n) {
|
|
|
46
53
|
callToAction: "viewBills"
|
|
47
54
|
};
|
|
48
55
|
}
|
|
49
|
-
function
|
|
56
|
+
function w({ labels: e, onViewBillsClick: t, onAddBillClick: n, className: c, style: g }) {
|
|
50
57
|
let w = {
|
|
51
|
-
...
|
|
58
|
+
...m,
|
|
52
59
|
...e
|
|
53
|
-
}, T =
|
|
54
|
-
|
|
55
|
-
T(
|
|
60
|
+
}, T = s();
|
|
61
|
+
b(() => {
|
|
62
|
+
T(h.Mounted);
|
|
56
63
|
}, [T]);
|
|
57
|
-
let { initResponse: E } =
|
|
64
|
+
let { initResponse: E } = u(), D = f(), O = d(), k = l(), { organizationId: A, organizationStatus: j } = a(), M = i(j), N = E?.scopes?.includes(o.PayableReadOrg) ?? !1, P = E?.scopes?.includes(o.PayableWriteOrg) ?? !1, { data: F, isLoading: I, isError: L, refetch: R } = v({ enabled: N }), z = D && !E || M && F === void 0 || I, B = (!!O || L) && F === void 0, V = y(() => {
|
|
58
65
|
k(), N && A && R();
|
|
59
66
|
}, [
|
|
60
67
|
k,
|
|
@@ -62,17 +69,18 @@ function C({ labels: e, onViewBillsClick: t, onAddBillClick: s, className: h, st
|
|
|
62
69
|
N,
|
|
63
70
|
A
|
|
64
71
|
]);
|
|
65
|
-
if (E && (!N || j ===
|
|
66
|
-
let H = F ?
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
value: H,
|
|
72
|
+
if (E && (!N || j === r.None)) return null;
|
|
73
|
+
let H = F ? S(F.openAmountDue) : void 0, U = F ? C(F, w, P) : void 0, W = U?.callToAction === "addBill" ? n : t;
|
|
74
|
+
return /* @__PURE__ */ x(p, {
|
|
75
|
+
value: H?.shown ?? "",
|
|
76
|
+
exactValue: H && H.shown !== H.exact ? H.exact : void 0,
|
|
69
77
|
subtext: U?.subtext,
|
|
70
78
|
subtextTone: U?.subtextTone,
|
|
71
79
|
linkText: w[U?.callToAction ?? "viewBills"],
|
|
72
80
|
onClick: W,
|
|
73
81
|
ariaLabel: U ? w.accessibleName({
|
|
74
82
|
title: w.accessibleTitle,
|
|
75
|
-
value: H,
|
|
83
|
+
value: H?.exact ?? "",
|
|
76
84
|
detail: U.description,
|
|
77
85
|
action: w[U.callToAction]
|
|
78
86
|
}) : void 0,
|
|
@@ -80,16 +88,16 @@ function C({ labels: e, onViewBillsClick: t, onAddBillClick: s, className: h, st
|
|
|
80
88
|
isError: B,
|
|
81
89
|
onRetry: B ? V : void 0,
|
|
82
90
|
labels: w,
|
|
83
|
-
testIds:
|
|
84
|
-
className:
|
|
85
|
-
style:
|
|
91
|
+
testIds: _,
|
|
92
|
+
className: c,
|
|
93
|
+
style: g
|
|
86
94
|
});
|
|
87
95
|
}
|
|
88
|
-
function
|
|
89
|
-
return /* @__PURE__ */
|
|
96
|
+
function T({ labels: e, onViewBillsClick: t, onAddBillClick: n, className: r, style: i, ...a }) {
|
|
97
|
+
return /* @__PURE__ */ x(c, {
|
|
90
98
|
...a,
|
|
91
|
-
widgetName:
|
|
92
|
-
children: /* @__PURE__ */
|
|
99
|
+
widgetName: g,
|
|
100
|
+
children: /* @__PURE__ */ x(w, {
|
|
93
101
|
labels: e,
|
|
94
102
|
onViewBillsClick: t,
|
|
95
103
|
onAddBillClick: n,
|
|
@@ -98,4 +106,4 @@ function w({ labels: e, onViewBillsClick: t, onAddBillClick: n, className: r, st
|
|
|
98
106
|
})
|
|
99
107
|
});
|
|
100
108
|
}
|
|
101
|
-
export {
|
|
109
|
+
export { T as BillsQuickViewWidget, w as BillsQuickViewWidgetWithContext };
|
package/dist/libs/tesouro-embedded-components-react/quick-view-widget/bills/ui/dist/index3.js
CHANGED
|
@@ -3,30 +3,31 @@ import "../../../../shared/quick-view/ui/dist/index.js";
|
|
|
3
3
|
import { BILLS_QUICK_VIEW_TILE_LABELS_EN as t } from "./index2.js";
|
|
4
4
|
import { jsx as n } from "react/jsx-runtime";
|
|
5
5
|
// ../../libs/tesouro-embedded-components-react/quick-view-widget/bills/ui/dist/index3.js
|
|
6
|
-
function r({ value: r,
|
|
7
|
-
let
|
|
6
|
+
function r({ value: r, exactValue: i, subtext: a, subtextTone: o, linkText: s, onClick: c, ariaLabel: l, isLoading: u, isError: d, onRetry: f, labels: p, testIds: m, className: h, style: g }) {
|
|
7
|
+
let _ = {
|
|
8
8
|
...t,
|
|
9
|
-
...
|
|
9
|
+
...p
|
|
10
10
|
};
|
|
11
11
|
return /* @__PURE__ */ n(e, {
|
|
12
|
-
title:
|
|
12
|
+
title: _.title,
|
|
13
13
|
value: r,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
exactValue: i,
|
|
15
|
+
subtext: a,
|
|
16
|
+
subtextTone: o,
|
|
17
|
+
linkText: s,
|
|
18
|
+
onClick: c,
|
|
19
|
+
ariaLabel: l,
|
|
20
|
+
isLoading: u,
|
|
21
|
+
isError: d,
|
|
22
|
+
onRetry: f,
|
|
22
23
|
labels: {
|
|
23
|
-
loadingLabel:
|
|
24
|
-
loadErrorTitle:
|
|
25
|
-
loadErrorRetry:
|
|
24
|
+
loadingLabel: _.loadingLabel,
|
|
25
|
+
loadErrorTitle: _.loadErrorTitle,
|
|
26
|
+
loadErrorRetry: _.loadErrorRetry
|
|
26
27
|
},
|
|
27
|
-
testIds:
|
|
28
|
-
className:
|
|
29
|
-
style:
|
|
28
|
+
testIds: m,
|
|
29
|
+
className: h,
|
|
30
|
+
style: g
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
export { r as BillsQuickViewTile };
|
|
@@ -4,37 +4,44 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { amountOutputToMajorUnits as e } from "../../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
6
6
|
import { formatAccountingAmount as t } from "../../../../../../shared/util/dist/lib/formatAccountingAmount.js";
|
|
7
|
+
import { formatCompactAmount as n } from "../../../../../../shared/util/dist/lib/formatCompactAmount.js";
|
|
7
8
|
import "../../../../../../shared/util/dist/index.js";
|
|
8
|
-
import { OrganizationStatus as
|
|
9
|
-
import { useEmbedApi as
|
|
10
|
-
import { Scope as
|
|
9
|
+
import { OrganizationStatus as r, isOrganizationOnItsWay as i } from "../../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
10
|
+
import { useEmbedApi as a } from "../../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
11
|
+
import { Scope as o } from "../../../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
12
|
import "../../../../../../shared/data-access/dist/index.js";
|
|
12
|
-
import { useAnalyticsTrack as
|
|
13
|
-
import { WidgetProvider as
|
|
14
|
-
import { useRefetchWidget as
|
|
13
|
+
import { useAnalyticsTrack as s } from "../../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
14
|
+
import { WidgetProvider as c } from "../../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
15
|
+
import { useRefetchWidget as l, useWidgetConfig as u, useWidgetError as d, useWidgetLoading as f } from "../../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
16
|
import "../../../../../../shared/feature/dist/index.js";
|
|
16
|
-
import { CardsQuickViewTile as
|
|
17
|
+
import { CardsQuickViewTile as p } from "../../../../ui/dist/index3.js";
|
|
17
18
|
import "../../../../ui/dist/index.js";
|
|
18
|
-
import { CARDS_QUICK_VIEW_WIDGET_LABELS_EN as
|
|
19
|
-
import { CardsQuickViewWidgetAnalyticsEvent as
|
|
20
|
-
import { cardsQuickViewWidgetTestIds as
|
|
21
|
-
import { useCardSpendSummary as
|
|
22
|
-
import { useCallback as
|
|
23
|
-
import { jsx as
|
|
19
|
+
import { CARDS_QUICK_VIEW_WIDGET_LABELS_EN as m } from "./labels.js";
|
|
20
|
+
import { CardsQuickViewWidgetAnalyticsEvent as h, WIDGET_NAME as g } from "../analytics/events.js";
|
|
21
|
+
import { cardsQuickViewWidgetTestIds as _ } from "./testIds.js";
|
|
22
|
+
import { useCardSpendSummary as v } from "./useCardSpendSummary.js";
|
|
23
|
+
import { useCallback as y, useEffect as b } from "react";
|
|
24
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
24
25
|
// ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/CardsQuickViewWidgetFeature.js
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
...
|
|
26
|
+
var S = (r) => {
|
|
27
|
+
let i = e({
|
|
28
|
+
value: r,
|
|
29
|
+
currencyCode: "USD"
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
...t(i, "USD"),
|
|
33
|
+
compact: n(i, "USD")
|
|
34
|
+
};
|
|
35
|
+
}, C = (e) => Number(e.slice(5, 7)) - 1;
|
|
36
|
+
function w({ labels: e, onViewCardsClick: t, className: n, style: c }) {
|
|
37
|
+
let g = {
|
|
38
|
+
...m,
|
|
32
39
|
...e
|
|
33
|
-
}, w =
|
|
34
|
-
|
|
35
|
-
w(
|
|
40
|
+
}, w = s();
|
|
41
|
+
b(() => {
|
|
42
|
+
w(h.Mounted);
|
|
36
43
|
}, [w]);
|
|
37
|
-
let { initResponse: T } =
|
|
44
|
+
let { initResponse: T } = u(), E = f(), D = d(), O = l(), { organizationId: k, organizationStatus: A } = a(), j = i(A), M = T?.scopes?.includes(o.DebitCardReadOrg) ?? !1, { data: N, today: P, isLoading: F, isError: I, refetch: L } = v({ enabled: M }), R = E && !T || j && N === void 0 || F, z = (!!D || I) && N === void 0, B = y(() => {
|
|
38
45
|
O(), M && k && L();
|
|
39
46
|
}, [
|
|
40
47
|
O,
|
|
@@ -42,34 +49,35 @@ function C({ labels: e, onViewCardsClick: t, className: s, style: h }) {
|
|
|
42
49
|
M,
|
|
43
50
|
k
|
|
44
51
|
]);
|
|
45
|
-
if (T && (!M || A ===
|
|
46
|
-
let V = P === void 0 ? void 0 :
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
title: V === void 0 ? void 0 :
|
|
49
|
-
value:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
if (T && (!M || A === r.None)) return null;
|
|
53
|
+
let V = P === void 0 ? void 0 : C(P), H = N ? S(N.spendAmount) : void 0, U = H?.text ?? "", W = H?.compact ?? U, G = N ? N.hasCards ? g.cardCount(N.cardCount) : g.noCardsYet : void 0;
|
|
54
|
+
return /* @__PURE__ */ x(p, {
|
|
55
|
+
title: V === void 0 ? void 0 : g.titleForMonth(V),
|
|
56
|
+
value: W,
|
|
57
|
+
exactValue: H?.compact ? U : void 0,
|
|
58
|
+
subtext: G,
|
|
59
|
+
linkText: g.viewCards,
|
|
52
60
|
onClick: t,
|
|
53
|
-
ariaLabel: N &&
|
|
54
|
-
title:
|
|
55
|
-
value: H?.isNegative ?
|
|
56
|
-
detail:
|
|
57
|
-
action:
|
|
61
|
+
ariaLabel: N && G && V !== void 0 ? g.accessibleName({
|
|
62
|
+
title: g.accessibleTitleForMonth(V),
|
|
63
|
+
value: H?.isNegative ? g.negativeAmount(H.magnitude) : U,
|
|
64
|
+
detail: G,
|
|
65
|
+
action: g.viewCards
|
|
58
66
|
}) : void 0,
|
|
59
67
|
isLoading: R,
|
|
60
68
|
isError: z,
|
|
61
69
|
onRetry: z ? B : void 0,
|
|
62
|
-
labels:
|
|
63
|
-
testIds:
|
|
64
|
-
className:
|
|
65
|
-
style:
|
|
70
|
+
labels: g,
|
|
71
|
+
testIds: _,
|
|
72
|
+
className: n,
|
|
73
|
+
style: c
|
|
66
74
|
});
|
|
67
75
|
}
|
|
68
|
-
function
|
|
69
|
-
return /* @__PURE__ */
|
|
76
|
+
function T({ labels: e, onViewCardsClick: t, className: n, style: r, ...i }) {
|
|
77
|
+
return /* @__PURE__ */ x(c, {
|
|
70
78
|
...i,
|
|
71
|
-
widgetName:
|
|
72
|
-
children: /* @__PURE__ */
|
|
79
|
+
widgetName: g,
|
|
80
|
+
children: /* @__PURE__ */ x(w, {
|
|
73
81
|
labels: e,
|
|
74
82
|
onViewCardsClick: t,
|
|
75
83
|
className: n,
|
|
@@ -77,4 +85,4 @@ function w({ labels: e, onViewCardsClick: t, className: n, style: r, ...i }) {
|
|
|
77
85
|
})
|
|
78
86
|
});
|
|
79
87
|
}
|
|
80
|
-
export {
|
|
88
|
+
export { T as CardsQuickViewWidget, w as CardsQuickViewWidgetWithContext };
|
package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index3.js
CHANGED
|
@@ -3,29 +3,30 @@ import "../../../../shared/quick-view/ui/dist/index.js";
|
|
|
3
3
|
import { CARDS_QUICK_VIEW_TILE_LABELS_EN as t } from "./index2.js";
|
|
4
4
|
import { jsx as n } from "react/jsx-runtime";
|
|
5
5
|
// ../../libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index3.js
|
|
6
|
-
function r({ title: r, value: i,
|
|
7
|
-
let
|
|
6
|
+
function r({ title: r, value: i, exactValue: a, subtext: o, linkText: s, onClick: c, ariaLabel: l, isLoading: u, isError: d, onRetry: f, labels: p, testIds: m, className: h, style: g }) {
|
|
7
|
+
let _ = {
|
|
8
8
|
...t,
|
|
9
|
-
...
|
|
9
|
+
...p
|
|
10
10
|
};
|
|
11
11
|
return /* @__PURE__ */ n(e, {
|
|
12
|
-
title: r ??
|
|
12
|
+
title: r ?? _.title,
|
|
13
13
|
value: i,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
exactValue: a,
|
|
15
|
+
subtext: o,
|
|
16
|
+
linkText: s,
|
|
17
|
+
onClick: c,
|
|
18
|
+
ariaLabel: l,
|
|
19
|
+
isLoading: u,
|
|
20
|
+
isError: d,
|
|
21
|
+
onRetry: f,
|
|
21
22
|
labels: {
|
|
22
|
-
loadingLabel:
|
|
23
|
-
loadErrorTitle:
|
|
24
|
-
loadErrorRetry:
|
|
23
|
+
loadingLabel: _.loadingLabel,
|
|
24
|
+
loadErrorTitle: _.loadErrorTitle,
|
|
25
|
+
loadErrorRetry: _.loadErrorRetry
|
|
25
26
|
},
|
|
26
|
-
testIds:
|
|
27
|
-
className:
|
|
28
|
-
style:
|
|
27
|
+
testIds: m,
|
|
28
|
+
className: h,
|
|
29
|
+
style: g
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
32
|
export { r as CardsQuickViewTile };
|
|
@@ -3,34 +3,41 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { amountOutputToMajorUnits as e } from "../../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
6
|
-
import {
|
|
6
|
+
import { formatCompactAmount as t } from "../../../../../../shared/util/dist/lib/formatCompactAmount.js";
|
|
7
|
+
import { formatMoneyExact as n } from "../../../../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
7
8
|
import "../../../../../../shared/util/dist/index.js";
|
|
8
|
-
import { OrganizationStatus as
|
|
9
|
-
import { useEmbedApi as
|
|
10
|
-
import { Scope as
|
|
9
|
+
import { OrganizationStatus as r, isOrganizationOnItsWay as i } from "../../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
10
|
+
import { useEmbedApi as a } from "../../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
11
|
+
import { Scope as o } from "../../../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
12
|
import "../../../../../../shared/data-access/dist/index.js";
|
|
12
|
-
import { useAnalyticsTrack as
|
|
13
|
-
import { WidgetProvider as
|
|
14
|
-
import { useRefetchWidget as
|
|
13
|
+
import { useAnalyticsTrack as s } from "../../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
14
|
+
import { WidgetProvider as c } from "../../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
15
|
+
import { useRefetchWidget as l, useWidgetConfig as u, useWidgetError as d, useWidgetLoading as f } from "../../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
16
|
import "../../../../../../shared/feature/dist/index.js";
|
|
16
|
-
import { InvoicesQuickViewTile as
|
|
17
|
+
import { InvoicesQuickViewTile as p } from "../../../../ui/dist/index3.js";
|
|
17
18
|
import "../../../../ui/dist/index.js";
|
|
18
|
-
import { INVOICES_QUICK_VIEW_WIDGET_LABELS_EN as
|
|
19
|
-
import { InvoicesQuickViewWidgetAnalyticsEvent as
|
|
20
|
-
import { invoicesQuickViewWidgetTestIds as
|
|
19
|
+
import { INVOICES_QUICK_VIEW_WIDGET_LABELS_EN as m } from "./labels.js";
|
|
20
|
+
import { InvoicesQuickViewWidgetAnalyticsEvent as h, WIDGET_NAME as g } from "../analytics/events.js";
|
|
21
|
+
import { invoicesQuickViewWidgetTestIds as _ } from "./testIds.js";
|
|
21
22
|
import "./summarizeOpenInvoices.js";
|
|
22
|
-
import { useOpenInvoicesSummary as
|
|
23
|
-
import { useCallback as
|
|
24
|
-
import { jsx as
|
|
23
|
+
import { useOpenInvoicesSummary as v } from "./useOpenInvoicesSummary.js";
|
|
24
|
+
import { useCallback as y, useEffect as b } from "react";
|
|
25
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
25
26
|
// ../../libs/tesouro-embedded-components-react/quick-view-widget/invoices/feature/dist/lib/InvoicesQuickViewWidget/InvoicesQuickViewWidgetFeature.js
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
var S = (r) => {
|
|
28
|
+
let i = e({
|
|
29
|
+
value: r,
|
|
30
|
+
currencyCode: "USD"
|
|
31
|
+
}), a = n(i, {
|
|
32
|
+
currencyCode: "USD",
|
|
33
|
+
includeSpaceAfterCurrencySymbol: !1
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
shown: t(i, "USD") ?? a,
|
|
37
|
+
exact: a
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
function C(e, t, n) {
|
|
34
41
|
let r = (e, t = "viewInvoices") => ({
|
|
35
42
|
subtext: e,
|
|
36
43
|
description: e,
|
|
@@ -41,28 +48,29 @@ function S(e, t, n) {
|
|
|
41
48
|
if (!e.hasOpenInvoices) return r(t.noOpenInvoices);
|
|
42
49
|
if (e.openCount === 0) return r(t.noOpenInvoicesInCurrency("USD"));
|
|
43
50
|
if (e.overdueCount > 0) {
|
|
44
|
-
let n =
|
|
51
|
+
let n = S(e.overdueAmountDue), r = t.overdueInvoiceCount(e.overdueCount);
|
|
45
52
|
return {
|
|
46
53
|
subtext: [{
|
|
47
|
-
text: t.overdueAmount(n),
|
|
54
|
+
text: t.overdueAmount(n.shown),
|
|
48
55
|
tone: "destructive"
|
|
49
|
-
}, { text:
|
|
50
|
-
description: t.overdueDescription(n, e.overdueCount),
|
|
56
|
+
}, { text: r }],
|
|
57
|
+
description: t.overdueDescription(n.exact, e.overdueCount),
|
|
58
|
+
exactSubtext: n.shown === n.exact ? void 0 : `${t.overdueAmount(n.exact)}${r}`,
|
|
51
59
|
subtextTone: "muted",
|
|
52
60
|
callToAction: "viewInvoices"
|
|
53
61
|
};
|
|
54
62
|
}
|
|
55
63
|
return r(t.openInvoiceCount(e.openCount));
|
|
56
64
|
}
|
|
57
|
-
function
|
|
65
|
+
function w({ labels: e, onViewInvoicesClick: t, onCreateInvoiceClick: n, className: c, style: g }) {
|
|
58
66
|
let w = {
|
|
59
|
-
...
|
|
67
|
+
...m,
|
|
60
68
|
...e
|
|
61
|
-
}, T =
|
|
62
|
-
|
|
63
|
-
T(
|
|
69
|
+
}, T = s();
|
|
70
|
+
b(() => {
|
|
71
|
+
T(h.Mounted);
|
|
64
72
|
}, [T]);
|
|
65
|
-
let { initResponse: E } =
|
|
73
|
+
let { initResponse: E } = u(), D = f(), O = d(), k = l(), { organizationId: A, organizationStatus: j } = a(), M = i(j), N = E?.scopes?.includes(o.InvoiceReadOrg) ?? !1, P = E?.scopes?.includes(o.InvoiceWriteOrg) ?? !1, { data: F, isLoading: I, isError: L, refetch: R } = v({ enabled: N }), z = D && !E || M && F === void 0 || I, B = (!!O || L) && F === void 0, V = y(() => {
|
|
66
74
|
k(), N && A && R();
|
|
67
75
|
}, [
|
|
68
76
|
k,
|
|
@@ -70,17 +78,19 @@ function C({ labels: e, onViewInvoicesClick: t, onCreateInvoiceClick: s, classNa
|
|
|
70
78
|
N,
|
|
71
79
|
A
|
|
72
80
|
]);
|
|
73
|
-
if (E && (!N || j ===
|
|
74
|
-
let H = F ?
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
value: H,
|
|
81
|
+
if (E && (!N || j === r.None)) return null;
|
|
82
|
+
let H = F ? S(F.openAmountDue) : void 0, U = F ? C(F, w, P) : void 0, W = U?.callToAction === "sendFirstInvoice" ? n : t;
|
|
83
|
+
return /* @__PURE__ */ x(p, {
|
|
84
|
+
value: H?.shown ?? "",
|
|
85
|
+
exactValue: H && H.shown !== H.exact ? H.exact : void 0,
|
|
77
86
|
subtext: U?.subtext,
|
|
87
|
+
exactSubtext: U?.exactSubtext,
|
|
78
88
|
subtextTone: U?.subtextTone,
|
|
79
89
|
linkText: w[U?.callToAction ?? "viewInvoices"],
|
|
80
90
|
onClick: W,
|
|
81
91
|
ariaLabel: U ? w.accessibleName({
|
|
82
92
|
title: w.title,
|
|
83
|
-
value: H,
|
|
93
|
+
value: H?.exact ?? "",
|
|
84
94
|
detail: U.description,
|
|
85
95
|
action: w[U.callToAction]
|
|
86
96
|
}) : void 0,
|
|
@@ -88,16 +98,16 @@ function C({ labels: e, onViewInvoicesClick: t, onCreateInvoiceClick: s, classNa
|
|
|
88
98
|
isError: B,
|
|
89
99
|
onRetry: B ? V : void 0,
|
|
90
100
|
labels: w,
|
|
91
|
-
testIds:
|
|
92
|
-
className:
|
|
93
|
-
style:
|
|
101
|
+
testIds: _,
|
|
102
|
+
className: c,
|
|
103
|
+
style: g
|
|
94
104
|
});
|
|
95
105
|
}
|
|
96
|
-
function
|
|
97
|
-
return /* @__PURE__ */
|
|
106
|
+
function T({ labels: e, onViewInvoicesClick: t, onCreateInvoiceClick: n, className: r, style: i, ...a }) {
|
|
107
|
+
return /* @__PURE__ */ x(c, {
|
|
98
108
|
...a,
|
|
99
|
-
widgetName:
|
|
100
|
-
children: /* @__PURE__ */
|
|
109
|
+
widgetName: g,
|
|
110
|
+
children: /* @__PURE__ */ x(w, {
|
|
101
111
|
labels: e,
|
|
102
112
|
onViewInvoicesClick: t,
|
|
103
113
|
onCreateInvoiceClick: n,
|
|
@@ -106,4 +116,4 @@ function w({ labels: e, onViewInvoicesClick: t, onCreateInvoiceClick: n, classNa
|
|
|
106
116
|
})
|
|
107
117
|
});
|
|
108
118
|
}
|
|
109
|
-
export {
|
|
119
|
+
export { T as InvoicesQuickViewWidget, w as InvoicesQuickViewWidgetWithContext };
|
package/dist/libs/tesouro-embedded-components-react/quick-view-widget/invoices/ui/dist/index3.js
CHANGED
|
@@ -3,30 +3,32 @@ import "../../../../shared/quick-view/ui/dist/index.js";
|
|
|
3
3
|
import { INVOICES_QUICK_VIEW_TILE_LABELS_EN as t } from "./index2.js";
|
|
4
4
|
import { jsx as n } from "react/jsx-runtime";
|
|
5
5
|
// ../../libs/tesouro-embedded-components-react/quick-view-widget/invoices/ui/dist/index3.js
|
|
6
|
-
function r({ value: r,
|
|
7
|
-
let
|
|
6
|
+
function r({ value: r, exactValue: i, exactSubtext: a, subtext: o, subtextTone: s, linkText: c, onClick: l, ariaLabel: u, isLoading: d, isError: f, onRetry: p, labels: m, testIds: h, className: g, style: _ }) {
|
|
7
|
+
let v = {
|
|
8
8
|
...t,
|
|
9
|
-
...
|
|
9
|
+
...m
|
|
10
10
|
};
|
|
11
11
|
return /* @__PURE__ */ n(e, {
|
|
12
|
-
title:
|
|
12
|
+
title: v.title,
|
|
13
13
|
value: r,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
exactValue: i,
|
|
15
|
+
exactSubtext: a,
|
|
16
|
+
subtext: o,
|
|
17
|
+
subtextTone: s,
|
|
18
|
+
linkText: c,
|
|
19
|
+
onClick: l,
|
|
20
|
+
ariaLabel: u,
|
|
21
|
+
isLoading: d,
|
|
22
|
+
isError: f,
|
|
23
|
+
onRetry: p,
|
|
22
24
|
labels: {
|
|
23
|
-
loadingLabel:
|
|
24
|
-
loadErrorTitle:
|
|
25
|
-
loadErrorRetry:
|
|
25
|
+
loadingLabel: v.loadingLabel,
|
|
26
|
+
loadErrorTitle: v.loadErrorTitle,
|
|
27
|
+
loadErrorRetry: v.loadErrorRetry
|
|
26
28
|
},
|
|
27
|
-
testIds:
|
|
28
|
-
className:
|
|
29
|
-
style:
|
|
29
|
+
testIds: h,
|
|
30
|
+
className: g,
|
|
31
|
+
style: _
|
|
30
32
|
});
|
|
31
33
|
}
|
|
32
34
|
export { r as InvoicesQuickViewTile };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.205", n = "e74d917ec3dd44935a438e2d00fe7929fa4843e5", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -1,51 +1,60 @@
|
|
|
1
|
-
import { DisplayAmount as e, Skeleton as t,
|
|
2
|
-
import { ErrorState as
|
|
1
|
+
import { DisplayAmount as e, Skeleton as t, Tooltip as n, TooltipContent as r, TooltipProvider as i, TooltipTrigger as a, Typography as o, cn as s } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { ErrorState as c } from "../../../ui/dist/lib/ErrorState/ErrorState.js";
|
|
3
3
|
import "../../../ui/dist/index.js";
|
|
4
|
-
import { QUICK_VIEW_TILE_LABELS_EN as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { ChevronRight as
|
|
4
|
+
import { QUICK_VIEW_TILE_LABELS_EN as l } from "./index2.js";
|
|
5
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronRight as p } from "lucide-react";
|
|
7
7
|
// ../../libs/tesouro-embedded-components-react/shared/quick-view/ui/dist/index3.js
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
var m = "ttw:flex ttw:w-[320px] ttw:min-w-0 ttw:max-w-full ttw:flex-col ttw:gap-1 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-left ttw:text-card-foreground", h = "ttw:focus-visible:outline-none ttw:focus-visible:ring-2 ttw:focus-visible:ring-ring ttw:focus-visible:ring-offset-2";
|
|
9
|
+
function g({ "aria-describedby": e, ...t }) {
|
|
10
|
+
return /* @__PURE__ */ d("button", {
|
|
11
|
+
type: "button",
|
|
12
|
+
...t
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function _({ "aria-describedby": e, ...t }) {
|
|
16
|
+
return /* @__PURE__ */ d("div", { ...t });
|
|
17
|
+
}
|
|
18
|
+
function v({ title: v, value: y, subtext: b, subtextTone: x = "muted", exactValue: S, exactSubtext: C, linkText: w, onClick: T, ariaLabel: E, isLoading: D = !1, isError: O = !1, onRetry: k, labels: A, testIds: j, className: M, style: N }) {
|
|
19
|
+
let P = {
|
|
20
|
+
...l,
|
|
21
|
+
...A
|
|
22
|
+
}, F = typeof b == "string" ? b ? [{
|
|
23
|
+
text: b,
|
|
24
|
+
tone: x
|
|
25
|
+
}] : [] : b ?? [], I = !!T && !D && !O, L = /* @__PURE__ */ f("span", {
|
|
17
26
|
className: "ttw:flex ttw:min-w-0 ttw:items-center ttw:justify-between ttw:gap-2",
|
|
18
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ d(o, {
|
|
19
28
|
component: "span",
|
|
20
29
|
variant: "body2",
|
|
21
30
|
color: "muted",
|
|
22
31
|
className: "ttw:min-w-0 ttw:break-words ttw:font-semibold",
|
|
23
|
-
children:
|
|
24
|
-
}),
|
|
32
|
+
children: v
|
|
33
|
+
}), I ? /* @__PURE__ */ d(p, {
|
|
25
34
|
className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
|
|
26
35
|
"aria-hidden": !0
|
|
27
36
|
}) : null]
|
|
28
37
|
});
|
|
29
|
-
if (
|
|
30
|
-
className:
|
|
31
|
-
style:
|
|
32
|
-
"data-testid":
|
|
33
|
-
children: [
|
|
38
|
+
if (D) return /* @__PURE__ */ f("div", {
|
|
39
|
+
className: s(m, M),
|
|
40
|
+
style: N,
|
|
41
|
+
"data-testid": j?.tile,
|
|
42
|
+
children: [L, /* @__PURE__ */ f("div", {
|
|
34
43
|
role: "status",
|
|
35
44
|
"aria-busy": !0,
|
|
36
45
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
37
46
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ d("span", {
|
|
39
48
|
className: "ttw:sr-only",
|
|
40
|
-
children:
|
|
49
|
+
children: P.loadingLabel
|
|
41
50
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
"data-testid":
|
|
51
|
+
/* @__PURE__ */ d(t, {
|
|
52
|
+
"data-testid": j?.skeleton,
|
|
44
53
|
height: 36,
|
|
45
54
|
width: "60%",
|
|
46
55
|
className: "ttw:rounded-md"
|
|
47
56
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ d(t, {
|
|
49
58
|
height: 16,
|
|
50
59
|
width: "30%",
|
|
51
60
|
className: "ttw:rounded-md"
|
|
@@ -53,53 +62,76 @@ function d({ title: d, value: f, subtext: p, subtextTone: m = "muted", linkText:
|
|
|
53
62
|
]
|
|
54
63
|
})]
|
|
55
64
|
});
|
|
56
|
-
if (
|
|
57
|
-
className:
|
|
58
|
-
style:
|
|
59
|
-
"data-testid":
|
|
60
|
-
children: [
|
|
61
|
-
title:
|
|
62
|
-
retryLabel:
|
|
63
|
-
onRetry:
|
|
65
|
+
if (O) return /* @__PURE__ */ f("div", {
|
|
66
|
+
className: s(m, M),
|
|
67
|
+
style: N,
|
|
68
|
+
"data-testid": j?.tile,
|
|
69
|
+
children: [L, /* @__PURE__ */ d(c, {
|
|
70
|
+
title: P.loadErrorTitle,
|
|
71
|
+
retryLabel: P.loadErrorRetry,
|
|
72
|
+
onRetry: k,
|
|
64
73
|
className: "ttw:px-0 ttw:py-4",
|
|
65
|
-
testId:
|
|
74
|
+
testId: j?.error
|
|
66
75
|
})]
|
|
67
76
|
});
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
/* @__PURE__ */
|
|
77
|
+
let R = /* @__PURE__ */ f(u, { children: [
|
|
78
|
+
L,
|
|
79
|
+
S ? /* @__PURE__ */ d("span", {
|
|
80
|
+
className: "ttw:sr-only",
|
|
81
|
+
children: S
|
|
82
|
+
}) : null,
|
|
83
|
+
/* @__PURE__ */ d(e, {
|
|
71
84
|
component: "span",
|
|
85
|
+
"aria-hidden": S ? !0 : void 0,
|
|
72
86
|
className: "ttw:block ttw:min-w-0 ttw:break-words ttw:leading-tight ttw:tracking-tight ttw:text-foreground",
|
|
73
|
-
children:
|
|
87
|
+
children: y
|
|
74
88
|
}),
|
|
75
|
-
|
|
89
|
+
F.length > 0 ? /* @__PURE__ */ f("span", {
|
|
76
90
|
className: "ttw:block ttw:min-w-0 ttw:break-words ttw:text-sm ttw:leading-6",
|
|
77
|
-
children:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
children: e
|
|
83
|
-
|
|
91
|
+
children: [C ? /* @__PURE__ */ d("span", {
|
|
92
|
+
className: "ttw:sr-only",
|
|
93
|
+
children: C
|
|
94
|
+
}) : null, /* @__PURE__ */ d("span", {
|
|
95
|
+
"aria-hidden": C ? !0 : void 0,
|
|
96
|
+
children: F.map(({ text: e, tone: t = "muted" }, n) => /* @__PURE__ */ d(o, {
|
|
97
|
+
component: "span",
|
|
98
|
+
variant: "body2",
|
|
99
|
+
color: t,
|
|
100
|
+
className: s(t !== "muted" && "ttw:font-medium"),
|
|
101
|
+
children: e
|
|
102
|
+
}, n))
|
|
103
|
+
})]
|
|
84
104
|
}) : null,
|
|
85
|
-
|
|
105
|
+
I && w ? /* @__PURE__ */ d("span", {
|
|
86
106
|
className: "ttw:mt-3 ttw:min-w-0 ttw:break-words ttw:text-sm ttw:font-medium ttw:text-primary ttw:group-hover:underline",
|
|
87
|
-
children:
|
|
107
|
+
children: w
|
|
88
108
|
}) : null
|
|
89
|
-
] });
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"data-testid":
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
] }), z = !!(S || C);
|
|
110
|
+
return ((e) => z ? /* @__PURE__ */ d(i, { children: /* @__PURE__ */ f(n, { children: [/* @__PURE__ */ d(a, {
|
|
111
|
+
asChild: !0,
|
|
112
|
+
children: e
|
|
113
|
+
}), /* @__PURE__ */ f(r, {
|
|
114
|
+
"data-testid": j?.exactTooltip,
|
|
115
|
+
children: [S ? /* @__PURE__ */ d("span", {
|
|
116
|
+
className: "ttw:block",
|
|
117
|
+
children: S
|
|
118
|
+
}) : null, C ? /* @__PURE__ */ d("span", {
|
|
119
|
+
className: "ttw:block",
|
|
120
|
+
children: C
|
|
121
|
+
}) : null]
|
|
122
|
+
})] }) }) : e)(I ? /* @__PURE__ */ d(g, {
|
|
123
|
+
onClick: T,
|
|
124
|
+
"aria-label": E,
|
|
125
|
+
"data-testid": j?.tile,
|
|
126
|
+
style: N,
|
|
127
|
+
className: s(m, "ttw:group ttw:cursor-pointer ttw:transition-colors ttw:hover:bg-accent/40", h, M),
|
|
128
|
+
children: R
|
|
129
|
+
}) : /* @__PURE__ */ d(_, {
|
|
130
|
+
tabIndex: z ? 0 : void 0,
|
|
131
|
+
className: s(m, z && h, M),
|
|
132
|
+
style: N,
|
|
133
|
+
"data-testid": j?.tile,
|
|
134
|
+
children: R
|
|
135
|
+
}));
|
|
104
136
|
}
|
|
105
|
-
export {
|
|
137
|
+
export { v as QuickViewTile };
|
|
@@ -8,29 +8,30 @@ import { formatCalendarDate as l } from "./lib/formatCalendarDate.js";
|
|
|
8
8
|
import { formatTimestampDate as u } from "./lib/formatTimestampDate.js";
|
|
9
9
|
import { formatRejectionDate as d } from "./lib/formatRejectionDate.js";
|
|
10
10
|
import { formatAccountingAmount as f } from "./lib/formatAccountingAmount.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
11
|
+
import { formatCompactAmount as p } from "./lib/formatCompactAmount.js";
|
|
12
|
+
import { currencySymbolForCode as m, formatMoneyExact as h } from "./lib/formatMoneyExact.js";
|
|
13
|
+
import { formatPhoneDisplay as g } from "./lib/formatPhoneDisplay.js";
|
|
14
|
+
import { getInitials as _ } from "./lib/getInitials.js";
|
|
15
|
+
import { isValidAchAccountNumber as v } from "./lib/isValidAchAccountNumber.js";
|
|
16
|
+
import { mergeLabelTree as y } from "./lib/mergeLabelTree.js";
|
|
17
|
+
import { normalizeAmountOutputCurrencyCode as b } from "./lib/normalizeAmountOutputCurrencyCode.js";
|
|
18
|
+
import { parseAmountOutputMajorUnits as x } from "./lib/parseAmountOutputMajorUnits.js";
|
|
19
|
+
import { getRelativeCalendarDay as S } from "./lib/relativeCalendarDay.js";
|
|
20
|
+
import { parseDecimalAmountToMinorUnits as C } from "./lib/parseDecimalAmountToMinorUnits.js";
|
|
21
|
+
import { sumAmountOutputsMajorUnits as w } from "./lib/sumAmountOutputsMajorUnits.js";
|
|
22
|
+
import { US_STATE_NAMES_EN as T, getStateOptions as E, isStateValid as D } from "./lib/usStates.js";
|
|
23
|
+
import { createWidgetTokenManager as O } from "./lib/widgetTokenManager.js";
|
|
24
|
+
import { TESOURO_NEW_EMBEDDED_BANK_ACCOUNT_CREATED_SUCCESS_EVENT as k, TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as A, emitWidgetDomEvent as j } from "./lib/widgetDomEvents.js";
|
|
25
|
+
import { extractApiErrorMessage as M } from "./lib/apiErrors.js";
|
|
26
|
+
import { parseApiValidationErrors as N } from "./lib/apiValidationErrors.js";
|
|
26
27
|
import "./lib/auditHistory/auditHistoryActor.js";
|
|
27
|
-
import { buildReceivableAuditHistory as
|
|
28
|
-
import { buildPayableAuditHistory as
|
|
28
|
+
import { buildReceivableAuditHistory as P } from "./lib/auditHistory/buildReceivableAuditHistory.js";
|
|
29
|
+
import { buildPayableAuditHistory as F, hasUnattributedAuditRows as I } from "./lib/auditHistory/buildPayableAuditHistory.js";
|
|
29
30
|
import "./lib/theme/color.js";
|
|
30
|
-
import { THEME_TOKEN_NAMES as
|
|
31
|
+
import { THEME_TOKEN_NAMES as L } from "./lib/theme/themeTokens.js";
|
|
31
32
|
import "./lib/theme/toneColors.js";
|
|
32
|
-
import { createTheme as
|
|
33
|
+
import { createTheme as R, isThemeDevelopmentBuild as z, readThemeTokens as B, reportThemeIssues as V, themeIssues as H, themeToCss as U } from "./lib/theme/createTheme.js";
|
|
33
34
|
import "./lib/theme/index.js";
|
|
34
|
-
import { configureCsp as
|
|
35
|
-
import { resolvePdfWorkerSrc as
|
|
36
|
-
export { i as DATE_DISPLAY_LOCALE, a as DATE_DISPLAY_OPTIONS,
|
|
35
|
+
import { configureCsp as W, installStyleNonce as G } from "./lib/csp.js";
|
|
36
|
+
import { resolvePdfWorkerSrc as K } from "./lib/pdfWorkerSrc.js";
|
|
37
|
+
export { i as DATE_DISPLAY_LOCALE, a as DATE_DISPLAY_OPTIONS, k as TESOURO_NEW_EMBEDDED_BANK_ACCOUNT_CREATED_SUCCESS_EVENT, A as TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT, L as THEME_TOKEN_NAMES, T as US_STATE_NAMES_EN, n as amountOutputToMajorUnits, F as buildPayableAuditHistory, P as buildReceivableAuditHistory, e as coerceAmountValueToMinorUnits, W as configureCsp, t as createCurrencyFormatter, R as createTheme, O as createWidgetTokenManager, m as currencySymbolForCode, j as emitWidgetDomEvent, M as extractApiErrorMessage, f as formatAccountingAmount, l as formatCalendarDate, p as formatCompactAmount, h as formatMoneyExact, g as formatPhoneDisplay, d as formatRejectionDate, u as formatTimestampDate, _ as getInitials, S as getRelativeCalendarDay, E as getStateOptions, I as hasUnattributedAuditRows, G as installStyleNonce, D as isStateValid, z as isThemeDevelopmentBuild, v as isValidAchAccountNumber, y as mergeLabelTree, r as minorExponentForCurrency, b as normalizeAmountOutputCurrencyCode, x as parseAmountOutputMajorUnits, N as parseApiValidationErrors, o as parseCalendarDate, s as parseDateOrTimestamp, C as parseDecimalAmountToMinorUnits, B as readThemeTokens, V as reportThemeIssues, c as resolveDueDateDisplay, K as resolvePdfWorkerSrc, w as sumAmountOutputsMajorUnits, H as themeIssues, U as themeToCss };
|
package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/formatCompactAmount.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createCurrencyFormatter as e } from "./createCurrencyFormatter.js";
|
|
2
|
+
// ../../libs/tesouro-embedded-components-react/shared/util/dist/lib/formatCompactAmount.js
|
|
3
|
+
var t = {
|
|
4
|
+
notation: "compact",
|
|
5
|
+
minimumFractionDigits: 2,
|
|
6
|
+
maximumFractionDigits: 2,
|
|
7
|
+
roundingMode: "trunc"
|
|
8
|
+
};
|
|
9
|
+
function n(n, r) {
|
|
10
|
+
if (!Number.isFinite(n) || Math.abs(n) < 1e6) return;
|
|
11
|
+
let i = e(r, t, "en-US").format(Math.abs(n));
|
|
12
|
+
return n < 0 ? `(${i})` : i;
|
|
13
|
+
}
|
|
14
|
+
export { n as formatCompactAmount };
|