@tesouro/embedded-components-react 0.2.336 → 0.2.338

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 (132) hide show
  1. package/dist/index.css +22 -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/data-access/dist/index.js +5 -5
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +103 -58
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +74 -37
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +12 -8
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +25 -20
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +64 -48
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +4 -3
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +40 -50
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +51 -5
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +5 -71
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +71 -48
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +46 -77
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +78 -33
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +33 -117
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +138 -67
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -200
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +194 -184
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +180 -50
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +64 -12
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +12 -46
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +46 -30
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +26 -158
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +159 -31
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +32 -98
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +102 -10
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +13 -219
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +243 -4
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +4 -29
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +27 -80
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +76 -125
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +137 -3
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -4
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +2 -43
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +45 -1
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +1 -8
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +6 -9
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +9 -92
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +94 -3
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +3 -110
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +7 -9
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +20 -38
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +57 -6
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +3 -91
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +105 -157
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +11 -5
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +40 -5
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +6 -113
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +100 -1
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +171 -16
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +5 -0
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +8 -0
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +115 -0
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +1 -0
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +25 -0
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +34 -26
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -16
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +18 -2
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +1 -41
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +38 -269
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +272 -1
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -9
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +7 -47
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +49 -2
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +2 -22
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +20 -284
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +286 -2
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +2 -16
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +13 -117
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +120 -2
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +2 -10
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +8 -94
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +96 -2
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +1 -12
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +11 -56
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +57 -1
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +1 -53
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +51 -136
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +141 -1
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +2 -7
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +5 -42
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +44 -2
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +2 -4
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +2 -61
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +63 -2
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +2 -4
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +2 -14
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +16 -2
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +1 -73
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +73 -250
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +251 -12
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +9 -252
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +1 -10
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +6 -4
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +43 -87
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -0
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +14 -2
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +278 -5
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +8 -28
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +8 -2
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +91 -5
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +1 -1
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +15 -9
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +101 -94
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +3 -14
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +28 -8
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +2 -170
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +7 -2
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +32 -12
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -89
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +12 -2
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +106 -0
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +2 -0
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +18 -0
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +10 -0
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +170 -0
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +2 -0
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +14 -0
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +89 -0
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -0
  125. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +26 -26
  126. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/clientRegistry.js +11 -2
  127. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +94 -74
  128. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  129. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  130. package/dist/packages/shared-ui-shadcn/dist/index.js +1378 -1371
  131. package/package.json +1 -1
  132. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +0 -34
@@ -1,4 +1,243 @@
1
- import "./index26.js";
2
- import "./index34.js";
3
- import "./index36.js";
4
- import "./index38.js";
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 { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
+ import { useAllOrganizationUsersQuery as te } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
9
+ import "../../../shared/data-access/dist/index.js";
10
+ import { formatCalendarDate as ne } from "../../../shared/util/dist/lib/formatCalendarDate.js";
11
+ import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
+ import "../../../shared/feature/dist/index.js";
13
+ import { resolveVendor as ie } from "./index3.js";
14
+ import { BillCreateScreen as ae } from "../../ui/dist/index41.js";
15
+ import { BillDecisionDialog as n } from "../../ui/dist/index47.js";
16
+ import { BillDuplicateNotice as oe } from "../../ui/dist/index57.js";
17
+ import { ExtractionNotice as se } from "../../ui/dist/index70.js";
18
+ import "../../ui/dist/index.js";
19
+ import { usePayableHistoryQuery as ce } from "../../data-access/dist/index6.js";
20
+ import { useAllPayableLineItemsQuery as le } from "../../data-access/dist/index7.js";
21
+ import { usePayableQuery as ue } from "../../data-access/dist/index13.js";
22
+ import "../../data-access/dist/index.js";
23
+ import { PayBillFlow as de } from "./index10.js";
24
+ import "./index11.js";
25
+ import { mergeBillCreateScreenCopy as fe } from "./index27.js";
26
+ import { useBillCreateController as pe } from "./index35.js";
27
+ import { useBillForm as me } from "./index37.js";
28
+ import { useApprovalPolicyCardView as he } from "./index15.js";
29
+ import { useCurrentApprovalRequestId as ge } from "./index16.js";
30
+ import { usePayableDetailActions as _e } from "./index18.js";
31
+ import { useScheduledPayment as r } from "./index19.js";
32
+ import { useDraftDelete as ve } from "./index20.js";
33
+ import { buildBillDetailView as ye } from "./index23.js";
34
+ import { buildBillHistory as be } from "./index24.js";
35
+ import { SourceDocumentContainer as xe } from "./index28.js";
36
+ import { useVendorSectionProps as Se } from "./index30.js";
37
+ import { usePaymentInstructionsForm as Ce } from "./index31.js";
38
+ import { billCreateTestIds as i } from "./index38.js";
39
+ import { useCallback as a, useEffect as we, useMemo as o, useRef as Te, useState as s } from "react";
40
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
41
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js
42
+ function Ee(e) {
43
+ return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
44
+ }
45
+ function d({ open: d, onOpenChange: f, payableId: p, readOnly: m = !1, copy: h, poweredByBankName: De, isPossibleDuplicate: Oe }) {
46
+ let g = o(() => fe(h), [h]), [_, v] = s(), [y, b] = s(!1), [ke, x] = s(!1), [Ae, S] = s(!1), [C, w] = s(), T = p ?? C, E = ue(T, { pollWhileOcrProcessing: !0 }), D = le(T), O = ee(), k = E.data, A = me({
47
+ payable: k,
48
+ lineItems: D.lineItems
49
+ }), j = k?.counterpart_id;
50
+ we(() => {
51
+ y || j && (v(j), b(!0));
52
+ }, [y, j]);
53
+ let je = a((e) => {
54
+ b(!0), v(e);
55
+ }, []), M = Se({
56
+ payableId: m ? void 0 : T,
57
+ counterpartId: m ? void 0 : _,
58
+ payableCounterpartId: j,
59
+ onCounterpartChange: je,
60
+ requiredError: A.errors?.vendor
61
+ }), N = pe({
62
+ payableId: p,
63
+ form: A,
64
+ counterpartId: _,
65
+ clearCounterpart: !!(T && y) && !_,
66
+ prepareVendorForSave: M.savePaymentInstructions,
67
+ onPayableCreated: w,
68
+ onSaved: w,
69
+ onDraftSaved: () => f(!1),
70
+ onFinalized: () => f(!1)
71
+ }), P = !!(N.isSavingDraft || N.isFinalizing), F = m ? T : void 0, I = ge({
72
+ payableId: F,
73
+ status: k?.status
74
+ }), L = Te(null), R = r({
75
+ payableId: T,
76
+ scheduledPaymentDate: k?.scheduled_payment_date,
77
+ enabled: m
78
+ }), z = ie(k), B = Ce({
79
+ payableId: F,
80
+ counterpartId: m ? j : void 0,
81
+ saveErrorMessage: g.detail.paymentInstructionsSaveError
82
+ }), { initResponse: V } = re(), H = e(V?.scopes, [t.CounterpartWriteOrg]) && e(V?.scopes, [t.PayableWriteOrg]), { actions: Me, decisionDialog: Ne } = _e({
83
+ payableId: F,
84
+ status: k?.status,
85
+ currentApprovalRequestId: I.id,
86
+ isPolicyApprover: I.isPolicyApprover,
87
+ hasWaitingRequest: I.hasWaitingRequest,
88
+ hasScheduledPayment: R.hasScheduledPayment,
89
+ scheduledPaymentRecordId: R.scheduledPaymentRecordId,
90
+ isScheduledPaymentUnknown: R.isResolving,
91
+ labels: g.actions,
92
+ onPayBillSelect: () => Ee(z) || !H ? L.current?.open() : B.open()
93
+ }), U = ve({
94
+ payableId: T,
95
+ status: k?.status,
96
+ enabled: !m,
97
+ labels: g.deleteDraft,
98
+ onDeleted: () => f(!1)
99
+ }), W = o(() => (O.data?.data ?? []).map((e) => ({
100
+ value: e.id,
101
+ label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
102
+ })), [O.data]), G = ce(F), Pe = e(V?.scopes, [t.UserReadOrg]), K = te({ enabled: m && Pe }), q = o(() => be(G.data?.data ?? [], K.data?.data ?? [], g.history), [
103
+ G.data,
104
+ K.data,
105
+ g.history
106
+ ]), J = he({
107
+ payableId: F,
108
+ approvalPolicyId: k?.approval_policy_id,
109
+ enabled: m,
110
+ copy: g.approvalPolicyCopy
111
+ }), Fe = o(() => m && k ? ye({
112
+ payable: k,
113
+ lineItems: D.lineItems,
114
+ glCodeOptions: W,
115
+ history: q,
116
+ approvalPolicy: J.view,
117
+ labels: g.detail,
118
+ hasScheduledPayment: R.hasScheduledPayment
119
+ }) : void 0, [
120
+ R.hasScheduledPayment,
121
+ J.view,
122
+ g.detail,
123
+ W,
124
+ q,
125
+ D.lineItems,
126
+ k,
127
+ m
128
+ ]), Y = k?.source_of_payable_data === "ocr", X = z?.name, Ie = m ? X ? g.viewTitle(X) : g.readOnlyTitle : Y && X ? g.extractedTitle(X) : g.newTitle, Le = m && k?.created_at ? g.addedOn(ne(k.created_at.slice(0, 10))) : void 0, Z = a(() => {
129
+ let e = A.isDirty || M.hasUnsavedVendorChanges || !!N.stagedFile;
130
+ !m && e && !window.confirm(g.discardConfirm) || f(!1);
131
+ }, [
132
+ N.stagedFile,
133
+ g.discardConfirm,
134
+ A.isDirty,
135
+ f,
136
+ m,
137
+ M.hasUnsavedVendorChanges
138
+ ]), Re = a((e) => {
139
+ if (!P) return e ? f(!0) : Z();
140
+ }, [
141
+ Z,
142
+ P,
143
+ f
144
+ ]), Q = !!Oe && !Ae, $ = !m && Y && !ke, ze = Q || $ ? /* @__PURE__ */ u(c, { children: [Q ? /* @__PURE__ */ l(oe, {
145
+ onNotADuplicate: m ? void 0 : () => S(!0),
146
+ onRemoveBill: m ? void 0 : () => S(!0),
147
+ testId: i.duplicateNotice
148
+ }) : null, $ ? /* @__PURE__ */ l(se, { onDismiss: () => x(!0) }) : null] }) : void 0;
149
+ return /* @__PURE__ */ u(c, { children: [
150
+ /* @__PURE__ */ l(ae, {
151
+ open: d,
152
+ onOpenChange: Re,
153
+ title: Ie,
154
+ subtitle: Le,
155
+ notice: ze,
156
+ vendor: {
157
+ ...M,
158
+ testId: i.vendorSection
159
+ },
160
+ values: A.values,
161
+ errors: A.errors,
162
+ onChange: A.onChange,
163
+ lineItems: {
164
+ items: A.lineItemRows,
165
+ glCodeOptions: W,
166
+ discount: A.discount,
167
+ onDiscountChange: A.onDiscountChange,
168
+ tax: A.tax,
169
+ onTaxChange: A.onTaxChange,
170
+ total: A.total,
171
+ onTotalChange: A.onTotalChange,
172
+ onAddLineItem: A.onAddLineItem,
173
+ errors: A.lineItemErrors,
174
+ testId: i.lineItems
175
+ },
176
+ documentPanel: /* @__PURE__ */ l(xe, {
177
+ payableId: T,
178
+ readOnly: m,
179
+ isDocumentPending: !!T && !k?.file && (E.isLoading || k?.ocr_status === "processing"),
180
+ file: k?.file ? {
181
+ id: k.file.id,
182
+ name: k.file.name,
183
+ url: k.file.url,
184
+ mimetype: k.file.mimetype
185
+ } : void 0,
186
+ staging: {
187
+ stagedFile: N.stagedFile,
188
+ onFileStaged: N.stageFile,
189
+ onClearStagedFile: N.clearStagedFile,
190
+ isSaving: P
191
+ }
192
+ }),
193
+ menuItems: U.menuItems,
194
+ readOnly: m,
195
+ detail: m ? {
196
+ view: Fe,
197
+ actions: Me,
198
+ scheduledSummary: R.hasScheduledPayment && R.scheduledDateLabel ? g.scheduledSummary(R.scheduledDateLabel) : void 0,
199
+ paymentInstructionsForm: j && H ? {
200
+ isOpen: B.isOpen,
201
+ values: B.values,
202
+ errors: B.errors,
203
+ isSaving: B.isSaving,
204
+ onOpen: B.open,
205
+ onCancel: B.close,
206
+ onChange: B.onChange,
207
+ onSave: B.save
208
+ } : void 0,
209
+ isLoading: E.isLoading || D.isResolving || O.isResolving,
210
+ isError: E.isError || D.isError || O.isError
211
+ } : void 0,
212
+ isLineItemsLoading: D.isResolving,
213
+ isSaving: P,
214
+ isSavingDraft: N.isSavingDraft,
215
+ isFinalizing: N.isFinalizing,
216
+ onCancel: Z,
217
+ onSaveDraft: N.saveDraft,
218
+ onFinalize: N.finalize,
219
+ testId: i.dialog
220
+ }),
221
+ /* @__PURE__ */ l(n, {
222
+ ...Ne,
223
+ labels: { cancelButton: g.actions.decisionDialog.cancelButton },
224
+ testId: i.decisionDialog,
225
+ confirmTestId: i.decisionConfirm,
226
+ reasonTestId: i.decisionReason
227
+ }),
228
+ /* @__PURE__ */ l(n, {
229
+ ...U.dialog,
230
+ labels: { cancelButton: g.actions.decisionDialog.cancelButton },
231
+ testId: i.deleteDraftDialog,
232
+ confirmTestId: i.deleteDraftConfirm
233
+ }),
234
+ m && k ? /* @__PURE__ */ l(de, {
235
+ ref: L,
236
+ payable: k,
237
+ poweredByBankName: De,
238
+ labels: g.payBill
239
+ }) : null
240
+ ] });
241
+ }
242
+ //#endregion
243
+ export { d as BillCreateDialog, d as default };
@@ -1,29 +1,4 @@
1
- import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index51.js";
2
- import "../../ui/dist/index.js";
3
- import { APPROVAL_POLICY_RULE_COPY_EN as t } from "./index12.js";
4
- import { BILL_DETAIL_ACTIONS_LABELS_EN as n, SCHEDULED_SUMMARY_LABEL_EN as r } from "./index24.js";
5
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js
6
- var i = {
7
- subtitle: "Accounts payable",
8
- vendorRow: "Vendor",
9
- bankAccountRow: "ACH bank account",
10
- bankAccountValue: (e) => `Account ending in ${e}`,
11
- invoiceNumberRow: "Number",
12
- issueDateRow: "Issue date",
13
- dueDateRow: "Due date",
14
- poNumberRow: "PO number",
15
- notProvided: "Not provided",
16
- glCodeMissing: "GL code not specified",
17
- quantityValue: (e, t) => `${e} x ${t}`,
18
- subtotalRow: "Subtotal",
19
- discountsRow: "Discounts",
20
- taxRow: "Tax",
21
- totalRow: "Total",
22
- actionError: n.actionError,
23
- scheduledSummary: r,
24
- sheet: e,
25
- decisionDialog: n.decisionDialog,
26
- approvalPolicyCopy: t
27
- };
28
- //#endregion
29
- export { i as BILL_DETAILS_LABELS_EN };
1
+ import "./index27.js";
2
+ import "./index35.js";
3
+ import "./index37.js";
4
+ import "./index39.js";
@@ -1,82 +1,29 @@
1
- import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
- import { resolveVendor as t, resolveVendorName as n } from "./index3.js";
3
- import { derivePayableStatus as r } from "./index20.js";
4
- import { formatBillMoney as i } from "./index21.js";
1
+ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index52.js";
2
+ import "../../ui/dist/index.js";
3
+ import { APPROVAL_POLICY_RULE_COPY_EN as t } from "./index12.js";
4
+ import { BILL_DETAIL_ACTIONS_LABELS_EN as n, SCHEDULED_SUMMARY_LABEL_EN as r } from "./index25.js";
5
5
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js
6
- function a({ payable: a, lineItems: o, ledgerAccounts: s, labels: c }) {
7
- let l = a.currency, u = (e) => i(e, l), d = r({
8
- apiStatus: a.status,
9
- dueDate: a.due_date,
10
- scheduledPaymentDate: a.scheduled_payment_date
11
- }), f = t(a), p = n(a), m = e(a.issued_at) || c.notProvided, h = e(a.due_date) || c.notProvided, g = [{
12
- label: c.vendorRow,
13
- value: p || c.notProvided,
14
- secondaryValue: f?.email ?? void 0
15
- }], _ = f?.bank_account?.account_number;
16
- _ && g.push({
17
- label: c.bankAccountRow,
18
- value: c.bankAccountValue(_.slice(-4))
19
- });
20
- let v = [
21
- {
22
- label: c.invoiceNumberRow,
23
- value: a.document_id || c.notProvided
24
- },
25
- {
26
- label: c.issueDateRow,
27
- value: m
28
- },
29
- {
30
- label: c.dueDateRow,
31
- value: h
32
- },
33
- {
34
- label: c.poNumberRow,
35
- value: c.notProvided
36
- }
37
- ], y = new Map(s.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), b = o.map((e) => {
38
- let t = u(e.unit_price);
39
- return {
40
- id: e.id,
41
- description: e.name ?? e.description ?? "",
42
- glCodeLabel: (e.ledger_account_id ? y.get(e.ledger_account_id) : void 0) || c.glCodeMissing,
43
- quantityLabel: e.quantity != null && t ? c.quantityValue(String(e.quantity), t) : "",
44
- amountLabel: u(e.subtotal) ?? ""
45
- };
46
- }), x = [
47
- {
48
- label: c.subtotalRow,
49
- value: a.subtotal
50
- },
51
- {
52
- label: c.discountsRow,
53
- value: a.discount
54
- },
55
- {
56
- label: c.taxRow,
57
- value: a.tax_amount
58
- }
59
- ].map(({ label: e, value: t }) => ({
60
- label: e,
61
- value: u(t)
62
- })).filter((e) => !!e.value), S = u(a.total_amount);
63
- return S && x.push({
64
- label: c.totalRow,
65
- value: S,
66
- emphasis: !0
67
- }), {
68
- title: p,
69
- subtitle: c.subtitle,
70
- status: d.status,
71
- statusTone: d.tone,
72
- amountDueLabel: u(a.amount_due) ?? u(a.total_amount) ?? "",
73
- invoiceDateLabel: m,
74
- dueDateLabel: h,
75
- payToItems: g,
76
- invoiceItems: v,
77
- lineItems: b,
78
- totals: x
79
- };
80
- }
6
+ var i = {
7
+ subtitle: "Accounts payable",
8
+ vendorRow: "Vendor",
9
+ bankAccountRow: "ACH bank account",
10
+ bankAccountValue: (e) => `Account ending in ${e}`,
11
+ invoiceNumberRow: "Number",
12
+ issueDateRow: "Issue date",
13
+ dueDateRow: "Due date",
14
+ poNumberRow: "PO number",
15
+ notProvided: "Not provided",
16
+ glCodeMissing: "GL code not specified",
17
+ quantityValue: (e, t) => `${e} x ${t}`,
18
+ subtotalRow: "Subtotal",
19
+ discountsRow: "Discounts",
20
+ taxRow: "Tax",
21
+ totalRow: "Total",
22
+ actionError: n.actionError,
23
+ scheduledSummary: r,
24
+ sheet: e,
25
+ decisionDialog: n.decisionDialog,
26
+ approvalPolicyCopy: t
27
+ };
81
28
  //#endregion
82
- export { a as mapPayableToBillDetails };
29
+ export { i as BILL_DETAILS_LABELS_EN };
@@ -1,132 +1,83 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAllLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
6
- import "../../../shared/data-access/dist/index.js";
7
- import { resolveVendor as t } from "./index3.js";
8
- import { BillDecisionDialog as n } from "../../ui/dist/index46.js";
9
- import { BillDetailsSheet as r } from "../../ui/dist/index52.js";
10
- import "../../ui/dist/index.js";
11
- import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index7.js";
12
- import { usePayableQuery as a } from "../../data-access/dist/index13.js";
13
- import "../../data-access/dist/index.js";
14
- import { PayBillFlow as o } from "./index10.js";
15
- import "./index11.js";
16
- import { mergeDecisionDialogCopy as s } from "./index24.js";
17
- import { useApprovalPolicyCardView as c } from "./index15.js";
18
- import { useCurrentApprovalRequestId as l } from "./index16.js";
19
- import { usePayableDetailActions as u } from "./index18.js";
20
- import { useScheduledPayment as d } from "./index19.js";
21
- import { BILL_DETAILS_LABELS_EN as f } from "./index40.js";
22
- import { mapPayableToBillDetails as p } from "./index41.js";
23
- import { useMemo as m, useRef as h } from "react";
24
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
1
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
+ import { resolveVendor as t, resolveVendorName as n } from "./index3.js";
3
+ import { derivePayableStatus as r } from "./index21.js";
4
+ import { formatBillMoney as i } from "./index22.js";
25
5
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js
26
- function y(e) {
27
- return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
28
- }
29
- function b({ open: b, onOpenChange: x, payableId: S, onClose: C, onExpand: w, testId: T, labels: E, poweredByBankName: D }) {
30
- let O = m(() => ({
31
- ...f,
32
- ...E,
33
- sheet: {
34
- ...f.sheet,
35
- ...E?.sheet,
36
- statusBadge: {
37
- ...f.sheet.statusBadge,
38
- ...E?.sheet?.statusBadge
39
- },
40
- approvalPolicy: {
41
- ...f.sheet.approvalPolicy,
42
- ...E?.sheet?.approvalPolicy
43
- }
6
+ function a({ payable: a, lineItems: o, ledgerAccounts: s, labels: c, hasScheduledPayment: l }) {
7
+ let u = a.currency, d = (e) => i(e, u), f = r({
8
+ apiStatus: a.status,
9
+ dueDate: a.due_date,
10
+ scheduledPaymentDate: a.scheduled_payment_date,
11
+ hasScheduledPayment: l
12
+ }), p = t(a), m = n(a), h = e(a.issued_at) || c.notProvided, g = e(a.due_date) || c.notProvided, _ = [{
13
+ label: c.vendorRow,
14
+ value: m || c.notProvided,
15
+ secondaryValue: p?.email ?? void 0
16
+ }], v = p?.bank_account?.account_number;
17
+ v && _.push({
18
+ label: c.bankAccountRow,
19
+ value: c.bankAccountValue(v.slice(-4))
20
+ });
21
+ let y = [
22
+ {
23
+ label: c.invoiceNumberRow,
24
+ value: a.document_id || c.notProvided
25
+ },
26
+ {
27
+ label: c.issueDateRow,
28
+ value: h
44
29
  },
45
- decisionDialog: s(f.decisionDialog, E?.decisionDialog),
46
- approvalPolicyCopy: {
47
- ...f.approvalPolicyCopy,
48
- ...E?.approvalPolicyCopy
30
+ {
31
+ label: c.dueDateRow,
32
+ value: g
33
+ },
34
+ {
35
+ label: c.poNumberRow,
36
+ value: c.notProvided
49
37
  }
50
- }), [E]), k = a(S), A = i(S), j = e(), M = k.data, N = h(null), P = l({
51
- payableId: S,
52
- status: M?.status
53
- }), F = c({
54
- payableId: S,
55
- approvalPolicyId: M?.approval_policy_id,
56
- copy: O.approvalPolicyCopy
57
- }), I = d({
58
- payableId: S,
59
- scheduledPaymentDate: M?.scheduled_payment_date
60
- }), { actions: L, decisionDialog: R } = u({
61
- payableId: M ? S : void 0,
62
- status: M?.status,
63
- currentApprovalRequestId: P.id,
64
- isPolicyApprover: P.isPolicyApprover,
65
- hasWaitingRequest: P.hasWaitingRequest,
66
- hasScheduledPayment: I.hasScheduledPayment,
67
- isScheduledPaymentUnknown: I.isResolving,
68
- labels: {
69
- payBill: O.sheet.payButton,
70
- markAsPaid: O.sheet.markAsPaidButton,
71
- reject: O.sheet.rejectButton,
72
- approve: O.sheet.approveButton,
73
- cancel: O.sheet.cancelButton,
74
- reopen: O.sheet.reopenButton,
75
- forceApprove: O.sheet.forceApproveButton,
76
- forceReject: O.sheet.forceRejectButton,
77
- decisionDialog: O.decisionDialog,
78
- actionError: O.actionError
38
+ ], b = new Map(s.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), x = o.map((e) => {
39
+ let t = d(e.unit_price);
40
+ return {
41
+ id: e.id,
42
+ description: e.name ?? e.description ?? "",
43
+ glCodeLabel: (e.ledger_account_id ? b.get(e.ledger_account_id) : void 0) || c.glCodeMissing,
44
+ quantityLabel: e.quantity != null && t ? c.quantityValue(String(e.quantity), t) : "",
45
+ amountLabel: d(e.subtotal) ?? ""
46
+ };
47
+ }), S = [
48
+ {
49
+ label: c.subtotalRow,
50
+ value: a.subtotal
51
+ },
52
+ {
53
+ label: c.discountsRow,
54
+ value: a.discount
79
55
  },
80
- onPayBillSelect: () => {
81
- if (!y(t(M)) && w) {
82
- w();
83
- return;
84
- }
85
- N.current?.open();
56
+ {
57
+ label: c.taxRow,
58
+ value: a.tax_amount
86
59
  }
87
- }), z = I.hasScheduledPayment && I.scheduledDateLabel ? /* @__PURE__ */ _("p", {
88
- className: "ttw:text-sm ttw:text-muted-foreground",
89
- children: O.scheduledSummary(I.scheduledDateLabel)
90
- }) : void 0, B = m(() => M ? p({
91
- payable: M,
92
- lineItems: A.lineItems,
93
- ledgerAccounts: j.data?.data ?? [],
94
- labels: O
95
- }) : void 0, [
96
- M,
97
- A.lineItems,
98
- j.data,
99
- O
100
- ]), V = k.isLoading || A.isResolving || j.isResolving, H = k.isError || A.isError || j.isError;
101
- return /* @__PURE__ */ v(g, { children: [
102
- /* @__PURE__ */ _(r, {
103
- open: b,
104
- onOpenChange: x,
105
- details: B,
106
- actions: L,
107
- approvalPolicy: F.view,
108
- isLoading: V,
109
- isError: H,
110
- notice: z,
111
- onClose: C,
112
- onExpand: w,
113
- testId: T,
114
- labels: O.sheet
115
- }),
116
- /* @__PURE__ */ _(n, {
117
- ...R,
118
- labels: { cancelButton: O.decisionDialog.cancelButton },
119
- testId: T ? `${T}-decision-dialog` : void 0,
120
- confirmTestId: T ? `${T}-decision-confirm` : void 0,
121
- reasonTestId: T ? `${T}-decision-reason` : void 0,
122
- reasonFieldId: T ? `${T}-decision-reason-field` : void 0
123
- }),
124
- M ? /* @__PURE__ */ _(o, {
125
- ref: N,
126
- payable: M,
127
- poweredByBankName: D
128
- }) : null
129
- ] });
60
+ ].map(({ label: e, value: t }) => ({
61
+ label: e,
62
+ value: d(t)
63
+ })).filter((e) => !!e.value), C = d(a.total_amount);
64
+ return C && S.push({
65
+ label: c.totalRow,
66
+ value: C,
67
+ emphasis: !0
68
+ }), {
69
+ title: m,
70
+ subtitle: c.subtitle,
71
+ status: f.status,
72
+ statusTone: f.tone,
73
+ amountDueLabel: d(a.amount_due) ?? d(a.total_amount) ?? "",
74
+ invoiceDateLabel: h,
75
+ dueDateLabel: g,
76
+ payToItems: _,
77
+ invoiceItems: y,
78
+ lineItems: x,
79
+ totals: S
80
+ };
130
81
  }
131
82
  //#endregion
132
- export { b as BillDetailsContainer, b as default };
83
+ export { a as mapPayableToBillDetails };