@tesouro/embedded-components-react 0.5.46 → 0.5.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/index.css +56 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +3 -3
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +7 -49
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +46 -36
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +34 -184
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +163 -75
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +75 -21
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +22 -93
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +88 -317
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +322 -12
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -64
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +57 -50
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +52 -214
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +215 -35
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +35 -234
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -21
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -532
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +536 -4
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -42
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -230
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +234 -3
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -11
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +11 -127
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +129 -3
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -47
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +44 -18
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +241 -122
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +125 -211
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +219 -3
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -7
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +5 -98
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +100 -1
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -26
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +27 -0
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +28 -28
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index3.js +12 -8
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -0
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +242 -210
  53. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +4 -4
  54. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  55. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/user/useOrganizationUserNames.js +13 -1
  56. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +137 -0
  57. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  58. package/package.json +1 -1
@@ -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/index87.js";
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.46",
3
+ "version": "0.5.48",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {