@tesouro/embedded-components-react 0.9.24 → 0.9.26
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/README.md +13 -0
- package/dist/index.css +93 -55
- package/dist/index.d.ts +53 -3
- package/dist/index.js +9 -7
- package/dist/lib/AccountsQuickViewWidget.d.ts +650 -0
- package/dist/lib/AccountsQuickViewWidget.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/data-access/dist/index.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/data-access/dist/index2.js +21 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/AccountsQuickViewWidget/AccountsQuickViewWidgetFeature.js +82 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/AccountsQuickViewWidget/labels.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/AccountsQuickViewWidget/testIds.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/accountsBalanceSummary/summarizeAccountBalances.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/accountsBalanceSummary/useAccountsBalanceSummary.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/analytics/events.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index2.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index3.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +14 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +59 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +10 -65
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +9 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +9 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +29 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +24 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +14 -22
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +155 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +13 -157
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +18 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +32 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +99 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +69 -85
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +3 -85
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +57 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +114 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +190 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +75 -187
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +35 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +67 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +111 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +461 -108
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +102 -452
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +12 -116
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +85 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +67 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +231 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +38 -232
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +245 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +169 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +21 -252
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +534 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +4 -542
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +43 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +236 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +3 -240
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +63 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +1 -65
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +82 -225
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +45 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +4 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +8 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index36.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +138 -155
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +48 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +219 -207
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index4.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index6.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +1 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +278 -322
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +18 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +2 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index11.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +39 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +2 -78
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +78 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +25 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +28 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +2 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +7 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +34 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index6.js +31 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +1 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index8.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +52 -2
- 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/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/shared/quick-view/ui/dist/index2.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/shared/quick-view/ui/dist/index3.js +100 -0
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/theme/themeTokens.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +4696 -4681
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +0 -29
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { amountOutputToMajorUnits as e, minorExponentForCurrency as t } from "../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
6
|
+
import { formatMoneyExact as n } from "../../../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
7
|
+
import "../../../../../shared/util/dist/index.js";
|
|
8
|
+
import { isOrganizationOnItsWay as r } from "../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
9
|
+
import { useEmbedApi as i } from "../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
+
import { Scope as a } from "../../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
|
+
import "../../../../../shared/data-access/dist/index.js";
|
|
12
|
+
import { useAnalyticsTrack as o } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
13
|
+
import { WidgetProvider as s } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
14
|
+
import { useRefetchWidget as c, useWidgetConfig as l, useWidgetError as u, useWidgetLoading as d } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
|
+
import "../../../../../shared/feature/dist/index.js";
|
|
16
|
+
import { AccountsQuickViewTile as f } from "../../../../ui/dist/index3.js";
|
|
17
|
+
import "../../../../ui/dist/index.js";
|
|
18
|
+
import { ACCOUNTS_QUICK_VIEW_WIDGET_LABELS_EN as p } from "./labels.js";
|
|
19
|
+
import { useAccountsBalanceSummary as m } from "../accountsBalanceSummary/useAccountsBalanceSummary.js";
|
|
20
|
+
import { AccountsQuickViewWidgetAnalyticsEvent as h, WIDGET_NAME as g } from "../analytics/events.js";
|
|
21
|
+
import { accountsQuickViewWidgetTestIds as _ } from "./testIds.js";
|
|
22
|
+
import { useCallback as v, useEffect as y, useMemo as b } from "react";
|
|
23
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
24
|
+
//#region ../../libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/AccountsQuickViewWidget/AccountsQuickViewWidgetFeature.js
|
|
25
|
+
function S({ labels: s, onTileClick: g, className: S, style: C }) {
|
|
26
|
+
let w = {
|
|
27
|
+
...p,
|
|
28
|
+
...s
|
|
29
|
+
}, T = o();
|
|
30
|
+
y(() => {
|
|
31
|
+
T(h.Mounted);
|
|
32
|
+
}, [T]);
|
|
33
|
+
let { initResponse: E } = l(), D = d(), O = u(), k = c(), { organizationId: A, organizationStatus: j } = i(), M = r(j), N = E?.scopes?.includes(a.BankAccountReadOrg) ?? !1, { summary: P, accountsLoaded: F, isLoading: I, isError: L, isResolving: R, refetch: z } = m({
|
|
34
|
+
enabled: N,
|
|
35
|
+
organizationId: A
|
|
36
|
+
}), B = D && !E || M && !F || I || R, V = !!O && !F || L, H = P?.accountCount ?? 0, U = v(() => {
|
|
37
|
+
k(), N && A && z();
|
|
38
|
+
}, [
|
|
39
|
+
k,
|
|
40
|
+
z,
|
|
41
|
+
N,
|
|
42
|
+
A
|
|
43
|
+
]), W = b(() => {
|
|
44
|
+
if (!P) return "";
|
|
45
|
+
let { currencyCode: r, minorTotal: i } = P, a = e({
|
|
46
|
+
value: i,
|
|
47
|
+
currencyCode: r
|
|
48
|
+
}), o = t(r);
|
|
49
|
+
return n(a, {
|
|
50
|
+
currencyCode: r,
|
|
51
|
+
includeSpaceAfterCurrencySymbol: !1,
|
|
52
|
+
minimumFractionDigits: o,
|
|
53
|
+
maximumFractionDigits: o
|
|
54
|
+
});
|
|
55
|
+
}, [P]), G = P && P.summedAccountCount < P.accountCount ? w.accountCountInCurrency(P.summedAccountCount, P.accountCount, P.currencyCode) : w.accountCount(H);
|
|
56
|
+
return E && !N || !B && !V && H === 0 ? null : /* @__PURE__ */ x(f, {
|
|
57
|
+
value: W,
|
|
58
|
+
subtext: G,
|
|
59
|
+
onClick: g,
|
|
60
|
+
isLoading: B,
|
|
61
|
+
isError: V,
|
|
62
|
+
onRetry: V ? U : void 0,
|
|
63
|
+
labels: w,
|
|
64
|
+
testIds: _,
|
|
65
|
+
className: S,
|
|
66
|
+
style: C
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function C({ labels: e, onTileClick: t, className: n, style: r, ...i }) {
|
|
70
|
+
return /* @__PURE__ */ x(s, {
|
|
71
|
+
...i,
|
|
72
|
+
widgetName: g,
|
|
73
|
+
children: /* @__PURE__ */ x(S, {
|
|
74
|
+
labels: e,
|
|
75
|
+
onTileClick: t,
|
|
76
|
+
className: n,
|
|
77
|
+
style: r
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { C as AccountsQuickViewWidget, S as AccountsQuickViewWidgetWithContext };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ACCOUNTS_QUICK_VIEW_TILE_LABELS_EN as e } from "../../../../ui/dist/index2.js";
|
|
2
|
+
import "../../../../ui/dist/index.js";
|
|
3
|
+
//#region ../../libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/AccountsQuickViewWidget/labels.js
|
|
4
|
+
var t = {
|
|
5
|
+
...e,
|
|
6
|
+
accountCount: (e) => `${e.toLocaleString("en-US")} ${e === 1 ? "account" : "accounts"}`,
|
|
7
|
+
accountCountInCurrency: (e, t, n) => `${e.toLocaleString("en-US")} of ${t.toLocaleString("en-US")} accounts, ${n} only`
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as ACCOUNTS_QUICK_VIEW_WIDGET_LABELS_EN };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/AccountsQuickViewWidget/testIds.js
|
|
2
|
+
var e = {
|
|
3
|
+
tile: "accounts-quick-view-widget-tile",
|
|
4
|
+
skeleton: "accounts-quick-view-widget-skeleton",
|
|
5
|
+
error: "accounts-quick-view-widget-error"
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as accountsQuickViewWidgetTestIds };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { normalizeAmountOutputCurrencyCode as e } from "../../../../../shared/util/dist/lib/normalizeAmountOutputCurrencyCode.js";
|
|
2
|
+
import "../../../../../shared/util/dist/index.js";
|
|
3
|
+
//#region ../../libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/accountsBalanceSummary/summarizeAccountBalances.js
|
|
4
|
+
function t(t) {
|
|
5
|
+
if (!t.length) return;
|
|
6
|
+
let n = e(t[0]?.balance?.currencyCode), r = 0, i = 0;
|
|
7
|
+
for (let a of t) {
|
|
8
|
+
let t = a.balance;
|
|
9
|
+
if (e(t?.currencyCode) !== n) continue;
|
|
10
|
+
i += 1;
|
|
11
|
+
let o = Number(t?.value ?? 0);
|
|
12
|
+
Number.isFinite(o) && (r += o);
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
accountCount: t.length,
|
|
16
|
+
currencyCode: n,
|
|
17
|
+
minorTotal: r,
|
|
18
|
+
summedAccountCount: i
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as summarizeAccountBalances };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { summarizeAccountBalances as e } from "./summarizeAccountBalances.js";
|
|
6
|
+
import { useQuickViewBankAccountsQuery as t } from "../../../../data-access/dist/index2.js";
|
|
7
|
+
import "../../../../data-access/dist/index.js";
|
|
8
|
+
import { useMemo as n, useState as r } from "react";
|
|
9
|
+
//#region ../../libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/accountsBalanceSummary/useAccountsBalanceSummary.js
|
|
10
|
+
function i({ enabled: i, organizationId: a } = {}) {
|
|
11
|
+
let { accounts: o, isLoading: s, isError: c, isPlaceholderData: l, isResolving: u, refetch: d } = t({ enabled: i }), f = n(() => o ? e(o) : void 0, [o]), p = o !== void 0 && !u && !c, [m, h] = r();
|
|
12
|
+
p && (m === void 0 || m.summary !== f || m.organizationId !== a) && h({
|
|
13
|
+
summary: f,
|
|
14
|
+
organizationId: a
|
|
15
|
+
});
|
|
16
|
+
let g = l && m !== void 0 && m.organizationId === a;
|
|
17
|
+
return {
|
|
18
|
+
summary: g ? m.summary : f,
|
|
19
|
+
accountsLoaded: o !== void 0,
|
|
20
|
+
isLoading: s,
|
|
21
|
+
isError: c,
|
|
22
|
+
isResolving: !g && u,
|
|
23
|
+
refetch: d
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { i as useAccountsBalanceSummary };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/analytics/events.js
|
|
2
|
+
var e = { Mounted: "accounts_quick_view_widget.mounted" }, t = "accounts_quick_view_widget";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as AccountsQuickViewWidgetAnalyticsEvent, t as WIDGET_NAME };
|
package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index2.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index2.js
|
|
2
|
+
var e = {
|
|
3
|
+
title: "Total available balance",
|
|
4
|
+
viewAccounts: "View accounts",
|
|
5
|
+
loadingLabel: "Loading accounts",
|
|
6
|
+
loadErrorTitle: "Could not load accounts",
|
|
7
|
+
loadErrorRetry: "Retry"
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { e as ACCOUNTS_QUICK_VIEW_TILE_LABELS_EN };
|
package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index3.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ACCOUNTS_QUICK_VIEW_TILE_LABELS_EN as e } from "./index2.js";
|
|
2
|
+
import { QuickViewTile as t } from "../../../shared/quick-view/ui/dist/index3.js";
|
|
3
|
+
import "../../../shared/quick-view/ui/dist/index.js";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region ../../libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index3.js
|
|
6
|
+
function r({ value: r, subtext: i, onClick: a, isLoading: o, isError: s, onRetry: c, labels: l, testIds: u, className: d, style: f }) {
|
|
7
|
+
let p = {
|
|
8
|
+
...e,
|
|
9
|
+
...l
|
|
10
|
+
};
|
|
11
|
+
return /* @__PURE__ */ n(t, {
|
|
12
|
+
title: p.title,
|
|
13
|
+
value: r,
|
|
14
|
+
subtext: i,
|
|
15
|
+
linkText: p.viewAccounts,
|
|
16
|
+
onClick: a,
|
|
17
|
+
isLoading: o,
|
|
18
|
+
isError: s,
|
|
19
|
+
onRetry: c,
|
|
20
|
+
labels: {
|
|
21
|
+
loadingLabel: p.loadingLabel,
|
|
22
|
+
loadErrorTitle: p.loadErrorTitle,
|
|
23
|
+
loadErrorRetry: p.loadErrorRetry
|
|
24
|
+
},
|
|
25
|
+
testIds: u,
|
|
26
|
+
className: d,
|
|
27
|
+
style: f
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { r as AccountsQuickViewTile };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
1
|
+
import "./index23.js";
|
|
2
|
+
import "./index28.js";
|
|
3
|
+
import "./index37.js";
|
|
4
|
+
import "./index39.js";
|
|
5
|
+
import "./index41.js";
|
|
5
6
|
import "./index42.js";
|
|
6
7
|
import "./index43.js";
|
|
7
8
|
import "./index44.js";
|
|
8
9
|
import "./index45.js";
|
|
9
|
-
import "./
|
|
10
|
-
import
|
|
11
|
-
import "./index49.js";
|
|
10
|
+
import { BillDetailsWidget as e, BillDialogWidget as t } from "./index47.js";
|
|
11
|
+
import "./index48.js";
|
|
12
12
|
export { e as BillDetailsWidget, t as BillDialogWidget };
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { usePayableHistoryQuery as e } from "../../data-access/dist/index3.js";
|
|
6
|
+
import "../../data-access/dist/index.js";
|
|
1
7
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
var t = "submitted_for_approval";
|
|
9
|
+
function n({ payableId: n, enabled: r = !0 }) {
|
|
10
|
+
let i = e(n, { enabled: r });
|
|
11
|
+
return {
|
|
12
|
+
roundStartedAt: (i.data?.data ?? []).reduce((e, n) => n.event_type === t ? n.timestamp : e, void 0),
|
|
13
|
+
isLoading: i.isLoading
|
|
14
|
+
};
|
|
9
15
|
}
|
|
10
16
|
//#endregion
|
|
11
|
-
export {
|
|
17
|
+
export { n as usePayableApprovalRoundStart };
|
|
@@ -2,16 +2,68 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
+
import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
+
import { useAllOrganizationRolesQuery as n } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
8
|
+
import { useAllOrganizationUsersQuery as r } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
9
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
10
|
+
import { useWidgetConfig as i } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
+
import "../../../../shared/feature/dist/index.js";
|
|
12
|
+
import { useGetApprovalPoliciesQuery as a } from "../../../../shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js";
|
|
13
|
+
import "../../../../shared/approval-policy/data-access/dist/index.js";
|
|
14
|
+
import { buildApprovalPolicyCardView as o } from "./index6.js";
|
|
15
|
+
import { usePayableApprovalRequestsQuery as s } from "../../data-access/dist/index2.js";
|
|
6
16
|
import "../../data-access/dist/index.js";
|
|
17
|
+
import { currentApprovalRound as c } from "./index7.js";
|
|
18
|
+
import { buildPendingApproverGroups as l } from "./index8.js";
|
|
19
|
+
import { buildPendingApproverGroupsFromCardView as u } from "./index9.js";
|
|
20
|
+
import { usePayableApprovalRoundStart as d } from "./index10.js";
|
|
21
|
+
import { useMemo as f } from "react";
|
|
7
22
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
23
|
+
function p({ payableId: p, approvalPolicyId: m, enabled: h = !0, copy: g }) {
|
|
24
|
+
let _ = h && !!m, { initResponse: v } = i(), y = e(v?.scopes, [t.ApprovalPolicyReadOrg]), b = e(v?.scopes, [t.ApprovalRequestReadOrg]), x = e(v?.scopes, [t.RoleReadOrg]), S = e(v?.scopes, [t.UserReadOrg]), C = a({ enabled: _ && y }), w = n({ enabled: _ && x }), T = r({ enabled: _ && S }), E = s(p, { enabled: _ && b }), { roundStartedAt: D } = d({
|
|
25
|
+
payableId: p,
|
|
26
|
+
enabled: _ && b
|
|
27
|
+
}), O = f(() => {
|
|
28
|
+
let e = /* @__PURE__ */ new Map();
|
|
29
|
+
for (let t of w.data?.data ?? []) e.set(t.id, {
|
|
30
|
+
label: t.name,
|
|
31
|
+
kind: "role"
|
|
32
|
+
});
|
|
33
|
+
for (let t of T.data?.data ?? []) e.set(t.id, {
|
|
34
|
+
label: t.name,
|
|
35
|
+
kind: "user"
|
|
36
|
+
});
|
|
37
|
+
return e;
|
|
38
|
+
}, [w.data, T.data]), k = f(() => c(E.data?.data, D), [E.data, D]), A = f(() => new Set(k.flatMap((e) => e.approved_by ?? [])), [k]), j = f(() => new Set(k.filter((e) => (e.approved_by ?? []).length > 0).flatMap((e) => e.role_ids ?? [])), [k]), M = f(() => m ? C.data?.data.find((e) => e.id === m) : void 0, [C.data, m]), N = f(() => _ && M ? o({
|
|
39
|
+
policy: M,
|
|
40
|
+
lookup: O,
|
|
41
|
+
approvedUserIds: A,
|
|
42
|
+
approvedRoleIds: j,
|
|
43
|
+
copy: g
|
|
44
|
+
}) : void 0, [
|
|
45
|
+
_,
|
|
46
|
+
M,
|
|
47
|
+
O,
|
|
48
|
+
A,
|
|
49
|
+
j,
|
|
50
|
+
g
|
|
51
|
+
]);
|
|
11
52
|
return {
|
|
12
|
-
|
|
13
|
-
|
|
53
|
+
view: N,
|
|
54
|
+
pendingApprovers: f(() => _ ? N ? u(N) : l({
|
|
55
|
+
requestsNewestFirst: E.data?.data,
|
|
56
|
+
roundStartedAt: D,
|
|
57
|
+
lookup: O
|
|
58
|
+
}) : [], [
|
|
59
|
+
_,
|
|
60
|
+
N,
|
|
61
|
+
E.data,
|
|
62
|
+
D,
|
|
63
|
+
O
|
|
64
|
+
]),
|
|
65
|
+
isLoading: !!m && (!h || C.isResolving || w.isResolving || T.isResolving || E.isLoading || E.isError || !b)
|
|
14
66
|
};
|
|
15
67
|
}
|
|
16
68
|
//#endregion
|
|
17
|
-
export {
|
|
69
|
+
export { p as useApprovalPolicyCardView };
|
|
@@ -1,69 +1,14 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
-
import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
-
import { useAllOrganizationRolesQuery as n } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
8
|
-
import { useAllOrganizationUsersQuery as r } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
9
|
-
import "../../../../shared/data-access/dist/index.js";
|
|
10
|
-
import { useWidgetConfig as i } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
-
import "../../../../shared/feature/dist/index.js";
|
|
12
|
-
import { useGetApprovalPoliciesQuery as a } from "../../../../shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js";
|
|
13
|
-
import "../../../../shared/approval-policy/data-access/dist/index.js";
|
|
14
|
-
import { buildApprovalPolicyCardView as o } from "./index7.js";
|
|
15
|
-
import { usePayableApprovalRequestsQuery as s } from "../../data-access/dist/index2.js";
|
|
16
|
-
import "../../data-access/dist/index.js";
|
|
17
|
-
import { currentApprovalRound as c } from "./index8.js";
|
|
18
|
-
import { buildPendingApproverGroups as l } from "./index9.js";
|
|
19
|
-
import { buildPendingApproverGroupsFromCardView as u } from "./index10.js";
|
|
20
|
-
import { usePayableApprovalRoundStart as d } from "./index11.js";
|
|
21
|
-
import { useMemo as f } from "react";
|
|
22
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
for (let t of T.data?.data ?? []) e.set(t.id, {
|
|
34
|
-
label: t.name,
|
|
35
|
-
kind: "user"
|
|
36
|
-
});
|
|
37
|
-
return e;
|
|
38
|
-
}, [w.data, T.data]), k = f(() => c(E.data?.data, D), [E.data, D]), A = f(() => new Set(k.flatMap((e) => e.approved_by ?? [])), [k]), j = f(() => new Set(k.filter((e) => (e.approved_by ?? []).length > 0).flatMap((e) => e.role_ids ?? [])), [k]), M = f(() => m ? C.data?.data.find((e) => e.id === m) : void 0, [C.data, m]), N = f(() => _ && M ? o({
|
|
39
|
-
policy: M,
|
|
40
|
-
lookup: O,
|
|
41
|
-
approvedUserIds: A,
|
|
42
|
-
approvedRoleIds: j,
|
|
43
|
-
copy: g
|
|
44
|
-
}) : void 0, [
|
|
45
|
-
_,
|
|
46
|
-
M,
|
|
47
|
-
O,
|
|
48
|
-
A,
|
|
49
|
-
j,
|
|
50
|
-
g
|
|
51
|
-
]);
|
|
52
|
-
return {
|
|
53
|
-
view: N,
|
|
54
|
-
pendingApprovers: f(() => _ ? N ? u(N) : l({
|
|
55
|
-
requestsNewestFirst: E.data?.data,
|
|
56
|
-
roundStartedAt: D,
|
|
57
|
-
lookup: O
|
|
58
|
-
}) : [], [
|
|
59
|
-
_,
|
|
60
|
-
N,
|
|
61
|
-
E.data,
|
|
62
|
-
D,
|
|
63
|
-
O
|
|
64
|
-
]),
|
|
65
|
-
isLoading: !!m && (!h || C.isResolving || w.isResolving || T.isResolving || E.isLoading || E.isError || !b)
|
|
2
|
+
function e(e) {
|
|
3
|
+
return [e.nominal_code, e.name].filter(Boolean).join(" — ");
|
|
4
|
+
}
|
|
5
|
+
function t({ isInitResolved: e, canReadGlCodes: t, isResolving: n, isError: r, optionCount: i, labels: a }) {
|
|
6
|
+
let o;
|
|
7
|
+
return e ? t ? r ? o = a.loadError : !n && i === 0 && (o = a.empty) : o = a.noAccess : o = void 0, {
|
|
8
|
+
unavailableMessage: o,
|
|
9
|
+
disabled: !e || !!o || n,
|
|
10
|
+
rosterAvailable: t && !n && !r
|
|
66
11
|
};
|
|
67
12
|
}
|
|
68
13
|
//#endregion
|
|
69
|
-
export {
|
|
14
|
+
export { e as formatGlCodeLabel, t as resolveGlCodeAvailability };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js
|
|
2
|
-
function e(e) {
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
let
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
rosterAvailable: t && !n && !r
|
|
2
|
+
function e({ isCapabilityUnknown: e, canApproveNow: t, canOverridePolicy: n, status: r, hasApprovalPolicy: i, pendingApproverNames: a, labels: o }) {
|
|
3
|
+
if (e) return { showApprovalOverrideNotice: !1 };
|
|
4
|
+
if (n) return { showApprovalOverrideNotice: !t };
|
|
5
|
+
if (t || r !== "approve_in_progress" || !i) return { showApprovalOverrideNotice: !1 };
|
|
6
|
+
let s = [...new Set(a)];
|
|
7
|
+
return {
|
|
8
|
+
showApprovalOverrideNotice: !1,
|
|
9
|
+
awaitingApprovalNotice: s.length ? o.awaitingApprovalNotice(s) : o.awaitingApprovalUnknownNotice
|
|
11
10
|
};
|
|
12
11
|
}
|
|
13
12
|
//#endregion
|
|
14
|
-
export { e as
|
|
13
|
+
export { e as resolveApprovalNotices };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js
|
|
2
|
-
function e(
|
|
3
|
-
if (e) return
|
|
4
|
-
|
|
5
|
-
if (t || r !== "approve_in_progress" || !i) return { showApprovalOverrideNotice: !1 };
|
|
6
|
-
let s = [...new Set(a)];
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
if (!e) return;
|
|
4
|
+
let { onOpen: n, canEditExisting: r, ...i } = e;
|
|
7
5
|
return {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
...i,
|
|
7
|
+
onEditExisting: t && r ? n : void 0,
|
|
8
|
+
onAdd: t ? void 0 : n
|
|
10
9
|
};
|
|
11
10
|
}
|
|
12
11
|
//#endregion
|
|
13
|
-
export { e as
|
|
12
|
+
export { e as resolvePaymentInstructionsGestures };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { formatRejectionDate as e } from "../../../../shared/util/dist/lib/formatRejectionDate.js";
|
|
2
|
+
import "../../../../shared/util/dist/index.js";
|
|
1
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
function t({ payableStatus: t, approvalRequests: n, userNames: r, payableUpdatedAt: i, labels: a, now: o }) {
|
|
5
|
+
let s = n.find((e) => e.status === "rejected");
|
|
6
|
+
if (!s) return t !== "rejected" || !i ? void 0 : { actorLabel: a.rejectedOn(e(i, o)) };
|
|
7
|
+
let c = s.rejected_by ? r.get(s.rejected_by) : void 0, l = e(s.updated_at, o);
|
|
5
8
|
return {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
onAdd: t ? void 0 : n
|
|
9
|
+
actorLabel: c ? a.rejectedByOn(c, l) : a.rejectedOn(l),
|
|
10
|
+
message: s.reject_reason ? a.rejectionMessage(s.reject_reason) : void 0
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
13
|
//#endregion
|
|
12
|
-
export {
|
|
14
|
+
export { t as resolveBillRejectionNotice };
|
|
@@ -1,14 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { usePayableApprovalRequestsQuery as e } from "../../data-access/dist/index2.js";
|
|
6
|
+
import "../../data-access/dist/index.js";
|
|
7
|
+
import { currentApprovalRound as t } from "./index7.js";
|
|
8
|
+
import { usePayableApprovalRoundStart as n } from "./index10.js";
|
|
9
|
+
import { resolveBillRejectionNotice as r } from "./index15.js";
|
|
10
|
+
import { useMemo as i } from "react";
|
|
3
11
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
function a({ payableId: a, payableStatus: o, payableUpdatedAt: s, enabled: c, userNames: l, labels: u }) {
|
|
13
|
+
let d = n({
|
|
14
|
+
payableId: a,
|
|
15
|
+
enabled: c
|
|
16
|
+
}), f = e(a, { enabled: c }), p = i(() => t(f.data?.data, d.roundStartedAt), [f.data, d.roundStartedAt]);
|
|
17
|
+
return i(() => r({
|
|
18
|
+
payableStatus: o,
|
|
19
|
+
approvalRequests: p,
|
|
20
|
+
userNames: l,
|
|
21
|
+
payableUpdatedAt: s,
|
|
22
|
+
labels: u
|
|
23
|
+
}), [
|
|
24
|
+
o,
|
|
25
|
+
s,
|
|
26
|
+
p,
|
|
27
|
+
l,
|
|
28
|
+
u
|
|
29
|
+
]);
|
|
12
30
|
}
|
|
13
31
|
//#endregion
|
|
14
|
-
export {
|
|
32
|
+
export { a as useBillRejectionNotice };
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
+
import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
8
|
+
import { useWidgetConfig as n } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
|
+
import "../../../../shared/feature/dist/index.js";
|
|
10
|
+
import { usePayableApprovalRequestsQuery as r } from "../../data-access/dist/index2.js";
|
|
6
11
|
import "../../data-access/dist/index.js";
|
|
7
|
-
import { currentApprovalRound as
|
|
8
|
-
import { usePayableApprovalRoundStart as
|
|
9
|
-
import { resolveBillRejectionNotice as r } from "./index16.js";
|
|
10
|
-
import { useMemo as i } from "react";
|
|
12
|
+
import { currentApprovalRound as i } from "./index7.js";
|
|
13
|
+
import { usePayableApprovalRoundStart as a } from "./index10.js";
|
|
11
14
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
payableId:
|
|
15
|
-
enabled:
|
|
16
|
-
}), f =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
l,
|
|
28
|
-
u
|
|
29
|
-
]);
|
|
15
|
+
function o({ payableId: o, status: s }) {
|
|
16
|
+
let { initResponse: c } = n(), l = e(c?.scopes, [t.ApprovalRequestReadOrg]), u = s === "approve_in_progress" && l, { roundStartedAt: d } = a({
|
|
17
|
+
payableId: o,
|
|
18
|
+
enabled: u
|
|
19
|
+
}), f = c?.userId ?? void 0, p = (e) => e.caller_is_policy_approver ?? !!(f && e.user_ids.includes(f)), m = r(o, {
|
|
20
|
+
enabled: u,
|
|
21
|
+
hasAwaitedRequest: u ? (e) => i(e, d).some(p) : void 0,
|
|
22
|
+
currentRoundStartedAt: d
|
|
23
|
+
}), h = u ? i(m.data?.data, d) : [], g = h.some(p), _ = h.filter((e) => e.status === "waiting");
|
|
24
|
+
return {
|
|
25
|
+
id: _.filter(p).find((e) => !(f && (e.approved_by ?? []).includes(f)))?.id,
|
|
26
|
+
isPolicyApprover: g,
|
|
27
|
+
hasWaitingRequest: _.length > 0,
|
|
28
|
+
isLoading: m.isLoading
|
|
29
|
+
};
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
|
-
export {
|
|
32
|
+
export { o as useCurrentApprovalRequestId };
|