@tesouro/embedded-components-react 0.5.45 → 0.5.47
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 +7 -5
- package/dist/index.d.ts +54 -24
- package/dist/index.js +1 -1
- package/dist/lib/BankAccountOnboardingWidget.d.ts +15 -1
- package/dist/lib/BillPayWidget.d.ts +16 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/SettingsWidget.d.ts +1 -0
- package/dist/lib/WidgetSuite.d.ts +1 -0
- package/dist/lib/monite-sdk.d.ts +2 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +12 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +233 -211
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +7 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +46 -36
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +34 -184
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +163 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +75 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +22 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +88 -317
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +322 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -59
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +57 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +52 -208
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +215 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +35 -234
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -532
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +536 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -42
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -230
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +234 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +11 -127
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +129 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +44 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +241 -122
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +126 -206
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +219 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +5 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +100 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +28 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +163 -151
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +77 -77
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js +17 -10
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index382.js +10 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index394.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +23 -23
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +27 -29
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +29 -28
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +4 -4
- 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/feature/dist/lib/user/useOrganizationUserNames.js +13 -1
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +137 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
- package/package.json +1 -1
|
@@ -15,12 +15,12 @@ import "../../../ui/dist/index.js";
|
|
|
15
15
|
import { useMemo as c } from "react";
|
|
16
16
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
17
17
|
//#region ../../libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js
|
|
18
|
-
function d({ labels: d, componentLabels: f, headingComponent: p = "h3" } = {}) {
|
|
19
|
-
let
|
|
18
|
+
function d({ labels: d, componentLabels: f, headingComponent: p = "h3", showHeaderTitle: m = !0 } = {}) {
|
|
19
|
+
let h = c(() => ({
|
|
20
20
|
...n,
|
|
21
21
|
...d
|
|
22
|
-
}), [d]),
|
|
23
|
-
labels:
|
|
22
|
+
}), [d]), g = i({
|
|
23
|
+
labels: h,
|
|
24
24
|
componentLabels: f
|
|
25
25
|
});
|
|
26
26
|
return /* @__PURE__ */ u("div", {
|
|
@@ -29,31 +29,32 @@ function d({ labels: d, componentLabels: f, headingComponent: p = "h3" } = {}) {
|
|
|
29
29
|
/* @__PURE__ */ l(a, {
|
|
30
30
|
labels: f?.header,
|
|
31
31
|
headingComponent: p,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
showTitle: m,
|
|
33
|
+
onAddRule: g.items.length > 0 && !g.isError ? g.onAddRule : void 0,
|
|
34
|
+
addRuleDisabled: g.isBusy || g.editingId !== null || g.addRuleDisabledReason !== void 0,
|
|
35
|
+
addRuleDisabledReason: g.addRuleDisabledReason,
|
|
35
36
|
testIds: {
|
|
36
37
|
addRuleButton: r.addRuleButton,
|
|
37
38
|
addRuleBlocked: r.addRuleBlocked
|
|
38
39
|
}
|
|
39
40
|
}),
|
|
40
|
-
|
|
41
|
-
title:
|
|
42
|
-
description:
|
|
43
|
-
retryLabel:
|
|
44
|
-
onRetry:
|
|
41
|
+
g.isError ? /* @__PURE__ */ l(t, {
|
|
42
|
+
title: h.loadErrorTitle,
|
|
43
|
+
description: h.loadErrorDescription,
|
|
44
|
+
retryLabel: h.loadErrorRetry,
|
|
45
|
+
onRetry: g.onRetry
|
|
45
46
|
}) : /* @__PURE__ */ l(s, {
|
|
46
|
-
items:
|
|
47
|
-
editingId:
|
|
48
|
-
onAddRule:
|
|
49
|
-
gaps:
|
|
50
|
-
onSelectGap:
|
|
51
|
-
unlistedPoliciesHeading:
|
|
52
|
-
unlistedPoliciesBlockAmounts:
|
|
53
|
-
unlistedPoliciesStillApply:
|
|
54
|
-
createRuleDisabledReason:
|
|
55
|
-
isLoading:
|
|
56
|
-
disabled:
|
|
47
|
+
items: g.items,
|
|
48
|
+
editingId: g.editingId,
|
|
49
|
+
onAddRule: g.onAddRule,
|
|
50
|
+
gaps: g.gaps,
|
|
51
|
+
onSelectGap: g.onSelectGap,
|
|
52
|
+
unlistedPoliciesHeading: g.unlistedPoliciesHeading,
|
|
53
|
+
unlistedPoliciesBlockAmounts: g.unlistedPoliciesBlockAmounts,
|
|
54
|
+
unlistedPoliciesStillApply: g.unlistedPoliciesStillApply,
|
|
55
|
+
createRuleDisabledReason: g.addRuleDisabledReason,
|
|
56
|
+
isLoading: g.isLoading,
|
|
57
|
+
disabled: g.isBusy,
|
|
57
58
|
labels: f?.list,
|
|
58
59
|
testIds: {
|
|
59
60
|
root: r.list,
|
|
@@ -68,11 +69,11 @@ function d({ labels: d, componentLabels: f, headingComponent: p = "h3" } = {}) {
|
|
|
68
69
|
}
|
|
69
70
|
}),
|
|
70
71
|
/* @__PURE__ */ l(o, {
|
|
71
|
-
open:
|
|
72
|
-
onOpenChange:
|
|
73
|
-
onConfirm:
|
|
74
|
-
onCancel:
|
|
75
|
-
isDeleting:
|
|
72
|
+
open: g.deleteDialog.open,
|
|
73
|
+
onOpenChange: g.deleteDialog.onOpenChange,
|
|
74
|
+
onConfirm: g.deleteDialog.onConfirm,
|
|
75
|
+
onCancel: g.deleteDialog.onCancel,
|
|
76
|
+
isDeleting: g.deleteDialog.isDeleting,
|
|
76
77
|
labels: f?.deleteDialog,
|
|
77
78
|
testIds: {
|
|
78
79
|
root: r.deleteDialog,
|
package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js
CHANGED
|
@@ -4,45 +4,45 @@ import { useMemo as s } from "react";
|
|
|
4
4
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
5
|
import { Plus as u } from "lucide-react";
|
|
6
6
|
//#region ../../libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js
|
|
7
|
-
var d = ({ onAddRule: d, addRuleDisabled: f, addRuleDisabledReason: p, labels: m, headingComponent: h = "h2",
|
|
8
|
-
let
|
|
7
|
+
var d = ({ onAddRule: d, addRuleDisabled: f, addRuleDisabledReason: p, labels: m, headingComponent: h = "h2", showTitle: g = !0, testIds: _ }) => {
|
|
8
|
+
let v = s(() => ({
|
|
9
9
|
...o,
|
|
10
10
|
...m
|
|
11
|
-
}), [m]),
|
|
11
|
+
}), [m]), y = d ? /* @__PURE__ */ l(e, {
|
|
12
12
|
type: "button",
|
|
13
13
|
variant: "outline",
|
|
14
14
|
size: "sm",
|
|
15
15
|
onClick: d,
|
|
16
16
|
disabled: f,
|
|
17
|
-
"data-testid":
|
|
17
|
+
"data-testid": _?.addRuleButton,
|
|
18
18
|
className: "ttw:shrink-0",
|
|
19
|
-
children: [/* @__PURE__ */ c(u, {}),
|
|
19
|
+
children: [/* @__PURE__ */ c(u, {}), v.AddRule]
|
|
20
20
|
}) : null;
|
|
21
21
|
return /* @__PURE__ */ l("div", {
|
|
22
22
|
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
|
|
23
23
|
children: [/* @__PURE__ */ l("div", {
|
|
24
24
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
25
|
-
children: [/* @__PURE__ */ c(a, {
|
|
25
|
+
children: [g ? /* @__PURE__ */ c(a, {
|
|
26
26
|
variant: "h3",
|
|
27
27
|
component: h,
|
|
28
|
-
children:
|
|
29
|
-
}), /* @__PURE__ */ c(a, {
|
|
28
|
+
children: v.Title
|
|
29
|
+
}) : null, /* @__PURE__ */ c(a, {
|
|
30
30
|
variant: "body2",
|
|
31
31
|
color: "muted",
|
|
32
|
-
children:
|
|
32
|
+
children: v.Description
|
|
33
33
|
})]
|
|
34
|
-
}),
|
|
34
|
+
}), y && f && p ? /* @__PURE__ */ c(r, { children: /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(i, {
|
|
35
35
|
asChild: !0,
|
|
36
36
|
children: /* @__PURE__ */ c("span", {
|
|
37
37
|
tabIndex: 0,
|
|
38
38
|
className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-not-allowed ttw:rounded-md",
|
|
39
|
-
"data-testid":
|
|
40
|
-
children:
|
|
39
|
+
"data-testid": _?.addRuleBlocked,
|
|
40
|
+
children: y
|
|
41
41
|
})
|
|
42
42
|
}), /* @__PURE__ */ c(n, {
|
|
43
43
|
side: "top",
|
|
44
44
|
children: p
|
|
45
|
-
})] }) }) :
|
|
45
|
+
})] }) }) : y]
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
//#endregion
|
|
@@ -14,8 +14,8 @@ import { RefreshingRootWidgetProvider as m } from "./lib/WidgetProvider/Refreshi
|
|
|
14
14
|
import { useDisclosuresAcceptanceSurface as h, useOwnWidgetConfig as g, useRefetchWidget as _, useWidgetConfig as v, useWidgetError as y, useWidgetInitStaleForToken as b, useWidgetLoading as x } from "./lib/WidgetProvider/hooks.js";
|
|
15
15
|
import "./lib/WidgetProvider/index.js";
|
|
16
16
|
import { getNaicsOptions as S } from "./lib/naicsCodeMap.js";
|
|
17
|
-
import "./lib/user/useOrganizationUserNames.js";
|
|
18
|
-
import { CardProgram as
|
|
19
|
-
import { CARD_STATUS_LABELS_EN as
|
|
17
|
+
import { useOrganizationUserNames as C } from "./lib/user/useOrganizationUserNames.js";
|
|
18
|
+
import { CardProgram as w } from "./lib/card/cardProgram.js";
|
|
19
|
+
import { CARD_STATUS_LABELS_EN as T, CARD_STATUS_TONE as E, CARD_TYPE_LABELS_EN as D } from "./lib/card/cardPresentation.js";
|
|
20
20
|
import "./lib/analytics/index.js";
|
|
21
|
-
export {
|
|
21
|
+
export { T as CARD_STATUS_LABELS_EN, E as CARD_STATUS_TONE, D as CARD_TYPE_LABELS_EN, w as CardProgram, t as Implementation, m as RefreshingRootWidgetProvider, s as RootWidgetProvider, u as WidgetProvider, d as WidgetTokenRefreshProvider, e as cloneEmbeddedClient, n as getGlobalWidgetConfig, a as getGlobalWidgetInitState, S as getNaicsOptions, r as setGlobalWidgetConfig, o as subscribeToGlobalWidgetInitState, i as updateGlobalWidgetConfig, c as useAnalyticsCaptureException, l as useAnalyticsTrack, h as useDisclosuresAcceptanceSurface, f as useOptionalWidgetToken, C as useOrganizationUserNames, g as useOwnWidgetConfig, _ as useRefetchWidget, v as useWidgetConfig, y as useWidgetError, b as useWidgetInitStaleForToken, x as useWidgetLoading, p as useWidgetToken };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.47", n = "785e2bd58161d610aed5483b8f00f53c3713758a", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -2,5 +2,17 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
+
import { useAllOrganizationUsersQuery as e } from "../../../../data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
5
6
|
import "../../../../data-access/dist/index.js";
|
|
6
|
-
import "react";
|
|
7
|
+
import { useMemo as t } from "react";
|
|
8
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/user/useOrganizationUserNames.js
|
|
9
|
+
function n({ enabled: n } = {}) {
|
|
10
|
+
let r = e({ enabled: n });
|
|
11
|
+
return {
|
|
12
|
+
userNames: t(() => new Map((r.data?.data ?? []).filter((e) => !!e.name).map((e) => [e.id, e.name])), [r.data]),
|
|
13
|
+
isResolving: r.isResolving,
|
|
14
|
+
isError: r.isError
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as useOrganizationUserNames };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { resolveAuditActorName as e, withAuditActor as t } from "./auditHistoryActor.js";
|
|
2
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js
|
|
3
|
+
var n = /* @__PURE__ */ new Set(["approve", "approved"]), r = /* @__PURE__ */ new Set(["reject", "rejected"]);
|
|
4
|
+
function i(e) {
|
|
5
|
+
return typeof e == "string" && e ? e : void 0;
|
|
6
|
+
}
|
|
7
|
+
function a(e, t) {
|
|
8
|
+
return e.payable_source === "email" ? t.createdFromEmail : e.source_of_payable_data === "ocr" ? t.createdFromUpload : t.createdManually;
|
|
9
|
+
}
|
|
10
|
+
function o(e) {
|
|
11
|
+
return e.is_external === !1 || e.is_external !== !0 && !!e.payment_intent_id;
|
|
12
|
+
}
|
|
13
|
+
function s(e, t) {
|
|
14
|
+
return e === void 0 ? void 0 : t.paid(t.formatAmount(e));
|
|
15
|
+
}
|
|
16
|
+
function c(e, t, n) {
|
|
17
|
+
return e && t ? n.actorWithReason(e, t) : t ? n.quotedReason(t) : e;
|
|
18
|
+
}
|
|
19
|
+
function l(t, a, o, s, l) {
|
|
20
|
+
let u = a.action, d = a.approval_source === "force", f = e(t, s), p = i(a.reject_reason);
|
|
21
|
+
if (n.has(u)) {
|
|
22
|
+
let e = l.approved;
|
|
23
|
+
return d ? e = l.policyOverrideApproved : o?.required && (e = l.approvedCount(o.approved, o.required)), {
|
|
24
|
+
title: e,
|
|
25
|
+
meta: c(f, p, l),
|
|
26
|
+
actorInMeta: !0
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (r.has(u)) return {
|
|
30
|
+
title: d ? l.policyOverrideRejected : l.rejected,
|
|
31
|
+
meta: c(f, p, l),
|
|
32
|
+
actorInMeta: !0
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function u(e, t, n, r) {
|
|
36
|
+
let c = e.event_data ?? {};
|
|
37
|
+
switch (e.event_type) {
|
|
38
|
+
case "payable_created": return {
|
|
39
|
+
title: t.billCreated,
|
|
40
|
+
meta: a(c, t)
|
|
41
|
+
};
|
|
42
|
+
case "payable_updated": return { title: t.billDetailsUpdated };
|
|
43
|
+
case "submitted_for_approval": return { title: t.submittedForReview };
|
|
44
|
+
case "approval_requested": return {
|
|
45
|
+
title: t.approvalRequested,
|
|
46
|
+
meta: i(c.approval_policy_name)
|
|
47
|
+
};
|
|
48
|
+
case "approval_action": return l(e, c, n.approval, r, t);
|
|
49
|
+
case "auto_approved": return {
|
|
50
|
+
title: t.approvedAutomatically,
|
|
51
|
+
meta: i(c.approval_policy_name)
|
|
52
|
+
};
|
|
53
|
+
case "status_changed": return c.new_status === "canceled" ? { title: t.cancelled } : void 0;
|
|
54
|
+
case "reopened": return { title: t.reopened };
|
|
55
|
+
case "marked_as_paid": return {
|
|
56
|
+
title: o(c) ? t.paymentReleased : t.billMarkedAsFullyPaid,
|
|
57
|
+
meta: s(n.paidIncrement, t)
|
|
58
|
+
};
|
|
59
|
+
case "marked_as_partially_paid": return {
|
|
60
|
+
title: o(c) ? t.paymentReleased : t.billMarkedAsPartiallyPaid,
|
|
61
|
+
meta: s(n.paidIncrement, t)
|
|
62
|
+
};
|
|
63
|
+
case "payment_reverted": return { title: t.paymentReverted };
|
|
64
|
+
case "deleted": return { title: t.draftDeleted };
|
|
65
|
+
case "file_attached": return {
|
|
66
|
+
title: t.fileAttached,
|
|
67
|
+
meta: i(c.file_name)
|
|
68
|
+
};
|
|
69
|
+
case "file_detached": return {
|
|
70
|
+
title: t.fileRemoved,
|
|
71
|
+
meta: i(c.file_name)
|
|
72
|
+
};
|
|
73
|
+
case "credit_note_linked": return { title: t.creditNoteLinked };
|
|
74
|
+
case "credit_note_unlinked": return { title: t.creditNoteUnlinked };
|
|
75
|
+
case "line_item_added": return {
|
|
76
|
+
title: t.lineItemsUpdated,
|
|
77
|
+
meta: t.lineItemAdded
|
|
78
|
+
};
|
|
79
|
+
case "line_item_updated": return {
|
|
80
|
+
title: t.lineItemsUpdated,
|
|
81
|
+
meta: t.lineItemUpdated
|
|
82
|
+
};
|
|
83
|
+
case "line_item_removed": return {
|
|
84
|
+
title: t.lineItemsUpdated,
|
|
85
|
+
meta: t.lineItemRemoved
|
|
86
|
+
};
|
|
87
|
+
default: return;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function d(e) {
|
|
91
|
+
let t = /* @__PURE__ */ new Map(), r = 0, i, a = 0, o = [...e].sort((e, t) => Date.parse(e.timestamp) - Date.parse(t.timestamp));
|
|
92
|
+
for (let e of o) {
|
|
93
|
+
let o = e.event_data ?? {};
|
|
94
|
+
switch (e.event_type) {
|
|
95
|
+
case "submitted_for_approval":
|
|
96
|
+
r = 0, i = void 0;
|
|
97
|
+
break;
|
|
98
|
+
case "approval_requested": {
|
|
99
|
+
r = 0;
|
|
100
|
+
let e = o.required_approval_count;
|
|
101
|
+
i = typeof e == "number" && e > 0 ? e : void 0;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
case "approval_action":
|
|
105
|
+
n.has(o.action) && o.approval_source !== "force" && (r += 1, t.set(e.id, { approval: {
|
|
106
|
+
approved: r,
|
|
107
|
+
required: i
|
|
108
|
+
} }));
|
|
109
|
+
break;
|
|
110
|
+
case "marked_as_paid":
|
|
111
|
+
case "marked_as_partially_paid":
|
|
112
|
+
case "payment_reverted": {
|
|
113
|
+
let n = o.amount_paid;
|
|
114
|
+
if (typeof n != "number") break;
|
|
115
|
+
let r = n - a;
|
|
116
|
+
a = n, e.event_type !== "payment_reverted" && t.set(e.id, { paidIncrement: r > 0 ? r : n });
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return t;
|
|
122
|
+
}
|
|
123
|
+
function f(e, n, r) {
|
|
124
|
+
let i = d(e);
|
|
125
|
+
return e.flatMap((e) => {
|
|
126
|
+
let a = u(e, r, i.get(e.id) ?? {}, n);
|
|
127
|
+
return a ? [{
|
|
128
|
+
id: e.id,
|
|
129
|
+
dateLabel: r.dateLabel(e.timestamp),
|
|
130
|
+
timeLabel: r.timeLabel(e.timestamp),
|
|
131
|
+
title: a.actorInMeta ? a.title : t(a.title, e, n, r),
|
|
132
|
+
meta: a.meta
|
|
133
|
+
}] : [];
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
export { f as buildPayableAuditHistory };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { Scope as e } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
6
6
|
import "../../../shared/data-access/dist/index.js";
|
|
7
|
-
import { BillPayWidget as t } from "../../../bill-pay-widget/feature/dist/
|
|
7
|
+
import { BillPayWidget as t } from "../../../bill-pay-widget/feature/dist/index88.js";
|
|
8
8
|
import "../../../bill-pay-widget/feature/dist/index.js";
|
|
9
9
|
import { jsx as n } from "react/jsx-runtime";
|
|
10
10
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js
|