@tesouro/embedded-components-react 0.5.93 → 0.5.95
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/bill-pay-widget/feature/dist/index46.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index2.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/{expense-requirements-widget → shared/expense-requirements}/data-access/dist/index3.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/{expense-requirements-widget → shared/expense-requirements}/feature/dist/lib/ExpenseRequirementsWidget.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/{expense-requirements-widget → shared/expense-requirements}/feature/dist/lib/analytics/events.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/{expense-requirements-widget → shared/expense-requirements}/feature/dist/lib/useTransactionValidations.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/{expense-requirements-widget → shared/expense-requirements}/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/{expense-requirements-widget → shared/expense-requirements}/ui/dist/index3.js +2 -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/util/dist/lib/auditHistory/buildPayableAuditHistory.js +34 -57
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/data-access/dist/index2.js +0 -10
- /package/dist/libs/tesouro-embedded-components-react/{expense-requirements-widget → shared/expense-requirements}/data-access/dist/index.js +0 -0
- /package/dist/libs/tesouro-embedded-components-react/{expense-requirements-widget → shared/expense-requirements}/feature/dist/index.js +0 -0
- /package/dist/libs/tesouro-embedded-components-react/{expense-requirements-widget → shared/expense-requirements}/ui/dist/index.js +0 -0
|
@@ -21,12 +21,10 @@ var t = {
|
|
|
21
21
|
submittedForReview: "Finalized and submitted for review",
|
|
22
22
|
approvalRequested: "Approval requested",
|
|
23
23
|
approved: "Approved",
|
|
24
|
-
approvedCount: (e, t) => `Approved (${e} of ${t})`,
|
|
25
24
|
approvedAutomatically: "Approved automatically",
|
|
26
25
|
rejected: "Rejected",
|
|
27
26
|
policyOverrideApproved: "Policy override: Approved",
|
|
28
27
|
policyOverrideRejected: "Policy override: Rejected",
|
|
29
|
-
actorWithReason: (e, t) => `${e}: "${t}"`,
|
|
30
28
|
quotedReason: (e) => `"${e}"`,
|
|
31
29
|
cancelled: "Cancelled",
|
|
32
30
|
reopened: "Re-opened for edit",
|
|
@@ -11,8 +11,8 @@ import { ExpenseApprovalPoliciesWidget as r } from "./index6.js";
|
|
|
11
11
|
import { UploadReceiptWidget as i } from "./index7.js";
|
|
12
12
|
import { ReceiptMatchPane as a } from "./index11.js";
|
|
13
13
|
import { ExpenseManagementWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "./index12.js";
|
|
14
|
-
import { ExpenseRequirementsWidget as c } from "../../../expense-requirements
|
|
15
|
-
import "../../../expense-requirements
|
|
14
|
+
import { ExpenseRequirementsWidget as c } from "../../../shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js";
|
|
15
|
+
import "../../../shared/expense-requirements/feature/dist/index.js";
|
|
16
16
|
import { useEffect as l } from "react";
|
|
17
17
|
import { jsx as u } from "react/jsx-runtime";
|
|
18
18
|
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { Tabs as e, TabsContent as t, TabsList as n, TabsTrigger as r } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { ExpenseApprovalPoliciesWidget as i } from "../../../expense-management-widget/feature/dist/index6.js";
|
|
7
|
-
import { ExpenseRequirementsWidget as a } from "../../../expense-requirements
|
|
8
|
-
import "../../../expense-requirements
|
|
7
|
+
import { ExpenseRequirementsWidget as a } from "../../../shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js";
|
|
8
|
+
import "../../../shared/expense-requirements/feature/dist/index.js";
|
|
9
9
|
import "../../../expense-management-widget/feature/dist/index.js";
|
|
10
10
|
import { useState as o } from "react";
|
|
11
11
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { organizationHeaders as e } from "../../../data-access/dist/lib/organizationHeaders.js";
|
|
2
|
+
import { getTransactionsValidationsQueryKey as t } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
3
|
+
import "../../../data-access/dist/index.js";
|
|
4
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index2.js
|
|
5
|
+
var n = ({ client: n, organizationId: r }) => t({
|
|
6
|
+
client: n,
|
|
7
|
+
headers: e(r)
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as transactionsValidationsInvalidationKey };
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { invalidateAllClients as e } from "../../../
|
|
6
|
-
import { useEmbedApi as t } from "../../../
|
|
7
|
-
import { getTransactionsValidationsOptions as n, putTransactionsValidationsMutation as r } from "../../../
|
|
8
|
-
import { withAuthEpoch as i } from "../../../
|
|
9
|
-
import "../../../
|
|
5
|
+
import { invalidateAllClients as e } from "../../../data-access/dist/lib/clientRegistry.js";
|
|
6
|
+
import { useEmbedApi as t } from "../../../data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
+
import { getTransactionsValidationsOptions as n, putTransactionsValidationsMutation as r } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
8
|
+
import { withAuthEpoch as i } from "../../../data-access/dist/lib/withAuthEpoch.js";
|
|
9
|
+
import "../../../data-access/dist/index.js";
|
|
10
10
|
import { transactionsValidationsInvalidationKey as a } from "./index2.js";
|
|
11
11
|
import { useMutation as o, useQuery as s } from "@tanstack/react-query";
|
|
12
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-requirements
|
|
12
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index3.js
|
|
13
13
|
function c() {
|
|
14
14
|
let { client: e, organizationId: r, widgetToken: a, authEpoch: o } = t(), c = !!(r && a), l = n({
|
|
15
15
|
client: e,
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Button as e, toast as t } from "
|
|
6
|
-
import { EmbeddedToaster as n } from "../../../../
|
|
7
|
-
import "../../../../
|
|
8
|
-
import { useAnalyticsTrack as r } from "../../../../
|
|
9
|
-
import { WidgetProvider as i } from "../../../../
|
|
10
|
-
import "../../../../
|
|
5
|
+
import { Button as e, toast as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { EmbeddedToaster as n } from "../../../../ui/dist/lib/EmbeddedToaster.js";
|
|
7
|
+
import "../../../../ui/dist/index.js";
|
|
8
|
+
import { useAnalyticsTrack as r } from "../../../../feature/dist/lib/analytics/hooks.js";
|
|
9
|
+
import { WidgetProvider as i } from "../../../../feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
10
|
+
import "../../../../feature/dist/index.js";
|
|
11
11
|
import { FIELDS_WITH_THRESHOLD as a, FIELD_KEYS as o, useTransactionValidations as s } from "./useTransactionValidations.js";
|
|
12
12
|
import { ExpenseRequirementsAnalyticsEvent as c, WIDGET_NAME as l } from "./analytics/events.js";
|
|
13
13
|
import { ExpenseRequirementsWidgetLabels as u, FieldConfigLabels as d } from "../../../ui/dist/index2.js";
|
|
@@ -16,7 +16,7 @@ import "../../../ui/dist/index.js";
|
|
|
16
16
|
import { useEffect as p } from "react";
|
|
17
17
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
18
18
|
import { FileText as _, ReceiptText as v } from "lucide-react";
|
|
19
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-requirements
|
|
19
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js
|
|
20
20
|
var y = {
|
|
21
21
|
receipt_id: /* @__PURE__ */ h(v, { size: 20 }),
|
|
22
22
|
description: /* @__PURE__ */ h(_, { size: 20 })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-requirements
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/analytics/events.js
|
|
2
2
|
var e = { Mounted: "expense_requirements.mounted" }, t = "expense_requirements";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as ExpenseRequirementsAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useEmbedApi as e } from "../../../../
|
|
2
|
-
import "../../../../
|
|
1
|
+
import { useEmbedApi as e } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
2
|
+
import "../../../../data-access/dist/index.js";
|
|
3
3
|
import { useGetTransactionsValidationsQuery as t, usePutTransactionsValidationsMutation as n } from "../../../data-access/dist/index3.js";
|
|
4
4
|
import "../../../data-access/dist/index.js";
|
|
5
5
|
import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
6
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-requirements
|
|
6
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/useTransactionValidations.js
|
|
7
7
|
var s = ["receipt_id", "description"], c = /* @__PURE__ */ new Set(["receipt_id", "description"]), l = {
|
|
8
8
|
receipt_id: {
|
|
9
9
|
required: !1,
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Input as e, Switch as t } from "
|
|
5
|
+
import { Input as e, Switch as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { RequirementCardLabels as n } from "./index2.js";
|
|
7
7
|
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
8
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-requirements
|
|
8
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/expense-requirements/ui/dist/index3.js
|
|
9
9
|
function o({ label: o, icon: s, required: c, onChange: l, disabled: u, amount: d, onAmountChange: f }) {
|
|
10
10
|
return /* @__PURE__ */ a("div", {
|
|
11
11
|
className: "ttw:border ttw:border-border ttw:rounded-lg ttw:p-4",
|
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.95", n = "69ab276658b470febd2fd78bf87c47b630d6120f", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -13,62 +13,54 @@ function o(e) {
|
|
|
13
13
|
function s(e, t) {
|
|
14
14
|
return e === void 0 ? void 0 : t.paid(t.formatAmount(e));
|
|
15
15
|
}
|
|
16
|
-
function c(e, t
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
16
|
+
function c(e, t) {
|
|
17
|
+
let a = e.action, o = e.approval_source === "force", s = i(e.reject_reason), c = s ? t.quotedReason(s) : void 0;
|
|
18
|
+
if (n.has(a)) return {
|
|
19
|
+
title: o ? t.policyOverrideApproved : t.approved,
|
|
20
|
+
meta: c
|
|
21
|
+
};
|
|
22
|
+
if (r.has(a)) return {
|
|
23
|
+
title: o ? t.policyOverrideRejected : t.rejected,
|
|
24
|
+
meta: c
|
|
33
25
|
};
|
|
34
26
|
}
|
|
35
|
-
function
|
|
36
|
-
let
|
|
27
|
+
function l(e, t, n, r) {
|
|
28
|
+
let l = e.event_data ?? {};
|
|
37
29
|
switch (e.event_type) {
|
|
38
30
|
case "payable_created": return {
|
|
39
31
|
title: t.billCreated,
|
|
40
|
-
meta: a(
|
|
32
|
+
meta: a(l, t)
|
|
41
33
|
};
|
|
42
34
|
case "payable_updated": return { title: t.billDetailsUpdated };
|
|
43
35
|
case "submitted_for_approval": return { title: t.submittedForReview };
|
|
44
36
|
case "approval_requested": return {
|
|
45
37
|
title: t.approvalRequested,
|
|
46
|
-
meta: i(
|
|
38
|
+
meta: i(l.approval_policy_name)
|
|
47
39
|
};
|
|
48
|
-
case "approval_action": return l
|
|
40
|
+
case "approval_action": return c(l, t);
|
|
49
41
|
case "auto_approved": return {
|
|
50
42
|
title: t.approvedAutomatically,
|
|
51
|
-
meta: i(
|
|
43
|
+
meta: i(l.approval_policy_name)
|
|
52
44
|
};
|
|
53
|
-
case "status_changed": return
|
|
45
|
+
case "status_changed": return l.new_status === "canceled" ? { title: t.cancelled } : void 0;
|
|
54
46
|
case "reopened": return { title: t.reopened };
|
|
55
47
|
case "marked_as_paid": return {
|
|
56
|
-
title: o(
|
|
48
|
+
title: o(l) ? t.paymentReleased : t.billMarkedAsFullyPaid,
|
|
57
49
|
meta: s(n.paidIncrement, t)
|
|
58
50
|
};
|
|
59
51
|
case "marked_as_partially_paid": return {
|
|
60
|
-
title: o(
|
|
52
|
+
title: o(l) ? t.paymentReleased : t.billMarkedAsPartiallyPaid,
|
|
61
53
|
meta: s(n.paidIncrement, t)
|
|
62
54
|
};
|
|
63
55
|
case "payment_reverted": return { title: t.paymentReverted };
|
|
64
56
|
case "deleted": return { title: t.draftDeleted };
|
|
65
57
|
case "file_attached": return {
|
|
66
58
|
title: t.fileAttached,
|
|
67
|
-
meta: i(
|
|
59
|
+
meta: i(l.file_name)
|
|
68
60
|
};
|
|
69
61
|
case "file_detached": return {
|
|
70
62
|
title: t.fileRemoved,
|
|
71
|
-
meta: i(
|
|
63
|
+
meta: i(l.file_name)
|
|
72
64
|
};
|
|
73
65
|
case "credit_note_linked": return { title: t.creditNoteLinked };
|
|
74
66
|
case "credit_note_unlinked": return { title: t.creditNoteUnlinked };
|
|
@@ -87,55 +79,40 @@ function u(e, t, n, r) {
|
|
|
87
79
|
default: return;
|
|
88
80
|
}
|
|
89
81
|
}
|
|
90
|
-
function
|
|
91
|
-
let t = /* @__PURE__ */ new Map(),
|
|
92
|
-
for (let e of
|
|
93
|
-
let
|
|
82
|
+
function u(e) {
|
|
83
|
+
let t = /* @__PURE__ */ new Map(), n = 0, r = [...e].sort((e, t) => Date.parse(e.timestamp) - Date.parse(t.timestamp));
|
|
84
|
+
for (let e of r) {
|
|
85
|
+
let r = e.event_data ?? {};
|
|
94
86
|
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
87
|
case "marked_as_paid":
|
|
111
88
|
case "marked_as_partially_paid":
|
|
112
89
|
case "payment_reverted": {
|
|
113
|
-
let
|
|
114
|
-
if (typeof
|
|
115
|
-
let
|
|
116
|
-
|
|
90
|
+
let i = r.amount_paid;
|
|
91
|
+
if (typeof i != "number") break;
|
|
92
|
+
let a = i - n;
|
|
93
|
+
n = i, e.event_type !== "payment_reverted" && t.set(e.id, { paidIncrement: a > 0 ? a : i });
|
|
117
94
|
break;
|
|
118
95
|
}
|
|
119
96
|
}
|
|
120
97
|
}
|
|
121
98
|
return t;
|
|
122
99
|
}
|
|
123
|
-
function
|
|
124
|
-
let i =
|
|
100
|
+
function d(e, n, r) {
|
|
101
|
+
let i = u(e);
|
|
125
102
|
return e.flatMap((e) => {
|
|
126
|
-
let a =
|
|
103
|
+
let a = l(e, r, i.get(e.id) ?? {}, n);
|
|
127
104
|
return a ? [{
|
|
128
105
|
id: e.id,
|
|
129
106
|
dateLabel: r.dateLabel(e.timestamp),
|
|
130
107
|
timeLabel: r.timeLabel(e.timestamp),
|
|
131
|
-
title:
|
|
108
|
+
title: t(a.title, e, n, r),
|
|
132
109
|
meta: a.meta
|
|
133
110
|
}] : [];
|
|
134
111
|
});
|
|
135
112
|
}
|
|
136
|
-
function
|
|
113
|
+
function f(t, n, r) {
|
|
137
114
|
let i = new Set(n.map((e) => e.id));
|
|
138
115
|
return t.some((t) => i.has(t.id) && t.recorded_by === "user" && !!t.entity_user_id && !e(t, r));
|
|
139
116
|
}
|
|
140
117
|
//#endregion
|
|
141
|
-
export {
|
|
118
|
+
export { d as buildPayableAuditHistory, f as hasUnattributedAuditRows };
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { organizationHeaders as e } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
2
|
-
import { getTransactionsValidationsQueryKey as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
3
|
-
import "../../../shared/data-access/dist/index.js";
|
|
4
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-requirements-widget/data-access/dist/index2.js
|
|
5
|
-
var n = ({ client: n, organizationId: r }) => t({
|
|
6
|
-
client: n,
|
|
7
|
-
headers: e(r)
|
|
8
|
-
});
|
|
9
|
-
//#endregion
|
|
10
|
-
export { n as transactionsValidationsInvalidationKey };
|
|
File without changes
|
|
File without changes
|