@tesouro/embedded-components-react 0.5.303 → 0.5.305

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 (52) hide show
  1. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +9 -9
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +7 -7
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +10 -9
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +8 -7
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +7 -8
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +8 -28
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +24 -157
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +20 -13
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +13 -34
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +153 -89
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +17 -83
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +23 -3
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +42 -55
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +93 -107
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +77 -185
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +3 -80
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +55 -72
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +111 -113
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +184 -463
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +14 -4
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +78 -11
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +61 -74
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +115 -80
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +449 -216
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +116 -42
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +11 -249
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +85 -23
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +80 -648
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +240 -4
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +44 -40
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +38 -15
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +242 -240
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +25 -3
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +538 -3
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +3 -66
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +42 -1
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +239 -0
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +3 -0
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +5 -0
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +67 -0
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +1 -0
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +227 -38
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +82 -224
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +45 -82
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +4 -47
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index.js +2 -2
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index29.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +2 -2
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillsTab.js +6 -6
  51. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  52. package/package.json +1 -1
@@ -2,251 +2,253 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { buildPayableAuditHistory as e, hasUnattributedAuditRows as t } from "../../../../shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js";
6
- import { hasAnyScope as n } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
7
- import { Scope as r } from "../../../../shared/data-access/dist/lib/scopes.js";
8
- import { useAllLedgerAccountsQuery as ee } from "../../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
9
- import "../../../../shared/data-access/dist/index.js";
10
- import { useWidgetConfig as i } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
- import { useOrganizationUserNames as a } from "../../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
12
- import { useLocalCalendarDay as o } from "../../../../shared/feature/dist/lib/calendar/useLocalCalendarDay.js";
13
- import "../../../../shared/feature/dist/index.js";
14
- import { mergeDecisionDialogCopy as s, mergePaymentHistoryMethodLabels as c } from "../../../util/dist/lib/billDetailLabels.js";
15
- import { formatScheduledDateLabel as l } from "../../../util/dist/lib/formatScheduledDateLabel.js";
16
- import { hasSuspectedPayableDuplicate as u } from "../../../util/dist/lib/payableDuplicates.js";
17
- import { mapPayableToBillDetails as d } from "./index20.js";
18
- import { BillDecisionDialog as f } from "../../../ui/dist/index4.js";
19
- import "../../../ui/dist/index.js";
20
- import { BillDetailsSheet as p } from "../../ui/dist/index34.js";
21
- import { BillDuplicateNotice as m } from "../../ui/dist/index37.js";
22
- import "../../ui/dist/index.js";
23
- import { usePayableApprovalRequestsQuery as h } from "../../data-access/dist/index2.js";
24
- import { usePayableHistoryQuery as te } from "../../data-access/dist/index3.js";
25
- import { useAllPayableLineItemsQuery as ne } from "../../data-access/dist/index4.js";
26
- import { usePayableQuery as re } from "../../data-access/dist/index21.js";
27
- import "../../data-access/dist/index.js";
28
- import { buildPaymentHistory as ie } from "./index2.js";
29
- import { currentApprovalRound as ae } from "./index3.js";
30
- import { canOverrideApprovalPolicy as oe, canReadCounterpartBankAccounts as se } from "./index7.js";
31
- import { usePayableApprovalRoundStart as ce } from "./index11.js";
32
- import { useApprovalPolicyCardView as le } from "./index12.js";
33
- import { resolveApprovalNotices as ue } from "./index13.js";
34
- import { resolveBillRejectionNotice as de } from "./index15.js";
35
- import { useCurrentApprovalRequestId as fe } from "./index16.js";
36
- import { usePayableDetailActions as g } from "./index17.js";
37
- import { useScheduledPayment as pe } from "./index18.js";
38
- import { usePayableAchInstructions as me } from "../../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
39
- import "../../../../shared/counterpart-management/feature/dist/index.js";
40
- import { BILL_DETAILS_LABELS_EN as _ } from "./index39.js";
41
- import { useMemo as v, useRef as he, useState as ge } from "react";
42
- import { Fragment as _e, jsx as y, jsxs as b } from "react/jsx-runtime";
5
+ import { BILL_CREATE_MESSAGE_LABELS_EN as e } from "./index29.js";
6
+ import { calculateTotal as t, displayLineAmount as n, normalizeMoneyOnBlur as r, parseMoneyToMinorUnits as i, parseQuantity as a } from "./index36.js";
7
+ import { validateBillTotals as o } from "./index37.js";
8
+ import { emptyLineItem as s, mapPayableToBillForm as c } from "./index39.js";
9
+ import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
43
10
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js
44
- function x({ open: x, onOpenChange: S, payableId: C, onClose: w, onExpand: T, onEdit: E, testId: D, labels: O, renderPaymentFlows: k }) {
45
- let A = v(() => ({
46
- ..._,
47
- ...O,
48
- sheet: {
49
- ..._.sheet,
50
- ...O?.sheet,
51
- statusBadge: {
52
- ..._.sheet.statusBadge,
53
- ...O?.sheet?.statusBadge
54
- },
55
- approvalPolicy: {
56
- ..._.sheet.approvalPolicy,
57
- ...O?.sheet?.approvalPolicy
58
- },
59
- dueDate: {
60
- ..._.sheet.dueDate,
61
- ...O?.sheet?.dueDate
62
- },
63
- auditHistory: {
64
- ..._.sheet.auditHistory,
65
- ...O?.sheet?.auditHistory
11
+ var m = /^[0-9.,-]+$/;
12
+ function h(e) {
13
+ let t = e.trim().replace(/^\$\s*/, "");
14
+ return t ? m.test(t) ? t : null : "";
15
+ }
16
+ var g = [
17
+ "quantity",
18
+ "price",
19
+ "amount"
20
+ ];
21
+ function _(e) {
22
+ let t = e.trim(), n = /[.,]$/.test(t) ? t.slice(0, -1) : t;
23
+ return t && !n ? null : n;
24
+ }
25
+ function v(e, t, n) {
26
+ if (t === void 0) return;
27
+ let r = _(t);
28
+ if (r !== null) return o(e === "discount" ? r : "", e === "tax" ? r : "", e === "total" ? r : void 0, n)?.[e];
29
+ }
30
+ function y(e, t) {
31
+ let n = {}, r = {
32
+ price: null,
33
+ amount: null
34
+ };
35
+ for (let a of ["price", "amount"]) {
36
+ let o = _(e[a]);
37
+ o !== null && (r[a] = i(o), o && r[a] === null && (n[a] = t.unreadableMoney));
38
+ }
39
+ let o = _(e.quantity);
40
+ if (o !== null) {
41
+ let e = r.price !== null || r.amount !== null;
42
+ a(o) === null && (o || e) && (n.quantity = t.unusableQuantity);
43
+ }
44
+ return n;
45
+ }
46
+ function b(e, t, r) {
47
+ return i(t) === null ? r : n(e, t);
48
+ }
49
+ function x({ payable: n, lineItems: i, labels: a = e } = {}) {
50
+ let o = d(() => c({
51
+ payable: n ?? {},
52
+ lineItems: i ?? []
53
+ }), [n, i]), [m, _] = p(o.values), [x, S] = p(o.lineItems), [C, w] = p(o.discount), [T, E] = p(o.tax), [D, O] = p(o.total || void 0), [ee, k] = p(), A = f(void 0), te = l((e) => {
54
+ k((t) => {
55
+ let n = typeof e == "function" ? e(t) : e;
56
+ return n?.form !== A.current && (A.current = void 0), n;
57
+ });
58
+ }, []), ne = l((e) => {
59
+ A.current = e, k((t) => ({
60
+ ...t,
61
+ form: e
62
+ }));
63
+ }, []), j = l(() => {
64
+ k((e) => {
65
+ if (!e?.form || e.form !== A.current) return e;
66
+ A.current = void 0;
67
+ let t = { ...e };
68
+ return delete t.form, Object.keys(t).length ? t : void 0;
69
+ });
70
+ }, []), [re, M] = p(), [N, P] = p(), [F, I] = p(!1), [L, R] = p(!1), [z, B] = p(!1);
71
+ u(() => {
72
+ F || _(o.values);
73
+ }, [o]), u(() => {
74
+ L || S(o.lineItems);
75
+ }, [o]), u(() => {
76
+ z || (w(o.discount), E(o.tax), O(o.total || void 0));
77
+ }, [o]);
78
+ let ie = l((e) => {
79
+ _((t) => ({
80
+ ...t,
81
+ ...e
82
+ })), I(!0), k((t) => {
83
+ if (!t) return t;
84
+ let n = { ...t };
85
+ for (let t of Object.keys(e)) delete n[t];
86
+ return Object.keys(n).length ? n : void 0;
87
+ }), j();
88
+ }, [j]), V = l((e, t) => {
89
+ M((n) => {
90
+ if (!n?.[e] && !t) return n;
91
+ let r = {
92
+ ...n,
93
+ [e]: t
94
+ };
95
+ return t || delete r[e], Object.keys(r).length ? r : void 0;
96
+ });
97
+ }, []), H = l((e, t) => {
98
+ V(e, v(e, t, a));
99
+ }, [a, V]), U = l(() => {
100
+ O(void 0), H("total", void 0), j();
101
+ }, [H, j]), W = l((e, t = []) => {
102
+ let n = y(e, a);
103
+ P((r) => {
104
+ let i = r?.[e.id], a = { ...i };
105
+ for (let e of [
106
+ "price",
107
+ "amount",
108
+ "quantity"
109
+ ]) n[e] ? a[e] = n[e] : delete a[e];
110
+ t.includes("description") && delete a.description;
111
+ let o = Object.keys(a).length > 0;
112
+ if (!i && !o) return r;
113
+ let s = { ...r };
114
+ return o ? s[e.id] = a : delete s[e.id], Object.keys(s).length ? s : void 0;
115
+ });
116
+ }, [a]), G = l((e, t, n) => {
117
+ P((r) => ({
118
+ ...r,
119
+ [e]: {
120
+ ...r?.[e],
121
+ [t]: n
66
122
  }
67
- },
68
- decisionDialog: s(_.decisionDialog, O?.decisionDialog),
69
- approvalPolicyCopy: {
70
- ..._.approvalPolicyCopy,
71
- ...O?.approvalPolicyCopy
72
- },
73
- history: {
74
- ..._.history,
75
- ...O?.history
76
- },
77
- scheduledRelativeDay: {
78
- ..._.scheduledRelativeDay,
79
- ...O?.scheduledRelativeDay
80
- },
81
- actionSuccess: {
82
- ..._.actionSuccess,
83
- ...O?.actionSuccess
84
- },
85
- paymentHistoryMethodLabels: c(O?.paymentHistoryMethodLabels)
86
- }), [O]), j = re(C), M = ne(C), N = ee(), { initResponse: P } = i(), F = j.data, I = he(null), [ve, ye] = ge(!1), L = fe({
87
- payableId: C,
88
- status: F?.status
89
- }), be = F?.status === "rejected", xe = n(P?.scopes, [r.ApprovalRequestReadOrg]), R = be && xe, z = ce({
90
- payableId: C,
91
- enabled: R
92
- }), B = h(C, { enabled: R }), V = n(P?.scopes, [r.UserReadOrg]), { userNames: H, isError: Se, isResolving: Ce } = a({ enabled: V }), U = v(() => ae(B.data?.data, z.roundStartedAt), [B.data, z.roundStartedAt]), W = v(() => de({
93
- payableStatus: F?.status,
94
- approvalRequests: U,
95
- userNames: H,
96
- payableUpdatedAt: F?.updated_at,
97
- labels: A
98
- }), [
99
- F?.status,
100
- F?.updated_at,
123
+ }));
124
+ }, []), K = l((e, t, n = []) => {
125
+ let r = x.find((t) => t.id === e);
126
+ if (!r) return;
127
+ let i = t(r);
128
+ S(x.map((t) => t.id === e ? i : t)), W(i, n), R(!0), U();
129
+ }, [
130
+ U,
131
+ x,
132
+ W
133
+ ]), q = l((e, t) => {
134
+ let n = { ...t };
135
+ for (let r of g) {
136
+ let i = t[r];
137
+ if (i === void 0) continue;
138
+ let o = h(i);
139
+ if (o === null) {
140
+ G(e, r, a.numbersOnly);
141
+ return;
142
+ }
143
+ n[r] = o;
144
+ }
145
+ K(e, (e) => {
146
+ let t = {
147
+ ...e,
148
+ ...n
149
+ };
150
+ return "amount" in n ? t : {
151
+ ...t,
152
+ amount: b(t.quantity, t.price, t.amount)
153
+ };
154
+ }, Object.keys(n));
155
+ }, [
156
+ K,
157
+ a,
158
+ G
159
+ ]), J = l((e, t) => {
160
+ S((n) => n.map((n) => n.id === e ? {
161
+ ...n,
162
+ [t]: r(n[t])
163
+ } : n));
164
+ }, []), Y = l((e, t) => {
165
+ K(e, (e) => {
166
+ let n = Number.parseFloat(e.quantity), r = String(Math.max(1, (Number.isFinite(n) ? n : 0) + t));
167
+ return {
168
+ ...e,
169
+ quantity: r,
170
+ amount: b(r, e.price, e.amount)
171
+ };
172
+ });
173
+ }, [K]), X = l((e) => {
174
+ P((t) => {
175
+ if (!t?.[e]) return t;
176
+ let n = { ...t };
177
+ return delete n[e], Object.keys(n).length ? n : void 0;
178
+ });
179
+ }, []), Z = l((e) => {
180
+ X(e), S((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), R(!0), U();
181
+ }, [X, U]), ae = l(() => {
182
+ S((e) => [...e, s()]), R(!0), U();
183
+ }, [U]), Q = l((e, t, n) => {
184
+ let r = h(t);
185
+ if (r === null) {
186
+ V(e, a.numbersOnly);
187
+ return;
188
+ }
189
+ n(r), B(!0), U(), H(e, r);
190
+ }, [
101
191
  U,
192
+ a,
102
193
  H,
103
- A
104
- ]), G = le({
105
- payableId: C,
106
- approvalPolicyId: F?.approval_policy_id,
107
- copy: A.approvalPolicyCopy
108
- }), we = oe({
109
- status: F?.status,
110
- scopes: P?.scopes,
111
- arePendingApproversUnknown: G.isLoading,
112
- hasApprovalPolicy: !!F?.approval_policy_id,
113
- hasWaitingRequest: L.hasWaitingRequest
114
- }), K = ue({
115
- isCapabilityUnknown: L.isLoading || G.isLoading,
116
- canApproveNow: !!L.id,
117
- canOverridePolicy: we,
118
- status: F?.status,
119
- hasApprovalPolicy: !!F?.approval_policy_id,
120
- pendingApproverNames: G.pendingApprovers.flatMap((e) => e.names),
121
- labels: A
122
- }), q = pe({
123
- payableId: C,
124
- scheduledPaymentDate: F?.scheduled_payment_date
125
- }), J = se(P?.scopes), Y = me({
126
- counterpartId: F?.counterpart_id,
127
- currency: F?.currency,
128
- currentBankAccountId: F?.counterpart_bank_account_id,
129
- enabled: J
130
- }), { actions: Te, decisionDialog: Ee } = g({
131
- payableId: F ? C : void 0,
132
- status: F?.status,
133
- currentApprovalRequestId: L.id,
134
- hasScheduledPayment: q.hasScheduledPayment,
135
- scheduledPaymentIntentId: q.scheduledPaymentIntentId,
136
- isScheduledPaymentUnknown: q.isResolving,
137
- isPayabilityUnknown: Y.isLoading,
138
- hasApprovalPolicy: !!F?.approval_policy_id,
139
- hasWaitingRequest: L.hasWaitingRequest,
140
- pendingApprovers: G.pendingApprovers,
141
- arePendingApproversUnknown: G.isLoading,
142
- labels: {
143
- edit: A.sheet.editButton,
144
- payBill: A.sheet.payButton,
145
- markAsPaid: A.sheet.markAsPaidButton,
146
- reject: A.sheet.rejectButton,
147
- approve: A.sheet.approveButton,
148
- cancel: A.sheet.cancelButton,
149
- cancelScheduledPayment: A.sheet.cancelScheduledPaymentButton,
150
- reopen: A.sheet.reopenButton,
151
- forceApprove: A.sheet.forceApproveButton,
152
- forceReject: A.sheet.forceRejectButton,
153
- policyOverridesHeading: A.sheet.policyOverridesGroup,
154
- decisionDialog: A.decisionDialog,
155
- actionError: A.actionError,
156
- actionSuccess: A.actionSuccess
157
- },
158
- isMarkAsPaidPending: ve,
159
- onMarkAsPaidSelect: () => I.current?.openMarkAsPaid(),
160
- onPayBillSelect: () => I.current?.openPayBill(),
161
- onEditSelect: E,
162
- onActionSucceeded: (e) => {
163
- e === "reopen" && E?.();
194
+ V
195
+ ]), oe = l((e) => Q("discount", e, w), [Q]), se = l((e) => Q("tax", e, E), [Q]), $ = l(() => w((e) => r(e)), []), ce = l(() => E((e) => r(e)), []), le = l((e) => {
196
+ let t = h(e);
197
+ if (t === null) {
198
+ V("total", a.numbersOnly);
199
+ return;
164
200
  }
165
- }), X = o(), Z = v(() => q.hasScheduledPayment && q.scheduledDate ? l(q.scheduledDate, A.scheduledRelativeDay, X) : void 0, [
166
- q.hasScheduledPayment,
167
- q.scheduledDate,
168
- A.scheduledRelativeDay,
169
- X
170
- ]), De = Z ? A.scheduledSummary(Z.label) : void 0, Oe = u(F) ? /* @__PURE__ */ y(m, { onOpenFullScreen: T }) : void 0, Q = te(C), $ = v(() => e(Q.data?.data ?? [], H, A.history), [
171
- Q.data,
201
+ O(t), B(!0), H("total", t), j();
202
+ }, [
203
+ j,
204
+ a,
172
205
  H,
173
- A.history
174
- ]), ke = V && Se && t(Q.data?.data ?? [], $, H), Ae = v(() => ie({
175
- records: q.paymentRecords,
176
- events: Q.data?.data ?? [],
177
- currencyCode: F?.currency,
178
- labels: A
179
- }), [
180
- q.paymentRecords,
181
- Q.data,
182
- F?.currency,
183
- A
184
- ]), je = v(() => F ? d({
185
- payable: F,
186
- lineItems: M.lineItems,
187
- ledgerAccounts: N.data?.data ?? [],
188
- labels: A,
189
- hasScheduledPayment: q.hasScheduledPayment,
190
- rejection: W,
191
- achInstructions: Y.achInstructions,
192
- achInstructionsReadable: J && !Y.isLoading && !Y.isError
193
- }) : void 0, [
194
- F,
195
- M.lineItems,
196
- N.data,
197
- A,
198
- q.hasScheduledPayment,
199
- W,
200
- Y.achInstructions,
201
- Y.isError,
202
- Y.isLoading,
203
- J
204
- ]), Me = j.isLoading || M.isResolving || N.isResolving || Y.isLoading, Ne = j.isError || M.isError || N.isError;
205
- return /* @__PURE__ */ b(_e, { children: [
206
- /* @__PURE__ */ y(p, {
207
- open: x,
208
- onOpenChange: S,
209
- details: je,
210
- actions: Te,
211
- approvalPolicy: G.view,
212
- showApprovalOverrideNotice: K.showApprovalOverrideNotice,
213
- awaitingApprovalNotice: K.awaitingApprovalNotice,
214
- scheduledSummary: De,
215
- scheduledSummaryDate: Z?.absoluteLabel,
216
- auditHistory: $,
217
- auditHistoryError: Q.isError,
218
- auditHistoryLoading: Q.isLoading || Ce,
219
- auditHistoryNamesError: ke,
220
- paymentHistory: Ae,
221
- paymentHistoryError: q.isError || Q.isError,
222
- paymentHistoryLoading: q.isResolving || Q.isLoading,
223
- isLoading: Me,
224
- isError: Ne,
225
- notice: Oe,
226
- onClose: w,
227
- onExpand: T,
228
- testId: D,
229
- labels: A.sheet
230
- }),
231
- /* @__PURE__ */ y(f, {
232
- ...Ee,
233
- labels: { cancelButton: A.decisionDialog.cancelButton },
234
- testId: D ? `${D}-decision-dialog` : void 0,
235
- confirmTestId: D ? `${D}-decision-confirm` : void 0,
236
- reasonTestId: D ? `${D}-decision-reason` : void 0,
237
- reasonFieldId: D ? `${D}-decision-reason-field` : void 0
238
- }),
239
- k?.({
240
- ref: I,
241
- payable: F,
242
- payableId: C,
243
- isPayBillEnabled: !0,
244
- hasScheduledPayment: q.hasScheduledPayment,
245
- onMissingAchInstructions: T,
246
- onMarkAsPaidPendingChange: ye,
247
- testId: D
248
- })
249
- ] });
206
+ V
207
+ ]), ue = l(() => {
208
+ O((e) => e === void 0 ? e : r(e));
209
+ }, []), de = d(() => x.map((e) => ({
210
+ ...e,
211
+ onChange: (t) => q(e.id, t),
212
+ onBlur: (t) => J(e.id, t),
213
+ onQuantityStep: (t) => Y(e.id, t),
214
+ onRemove: () => Z(e.id)
215
+ })), [
216
+ J,
217
+ x,
218
+ q,
219
+ Z,
220
+ Y
221
+ ]), fe = d(() => t(x, T, C), [
222
+ x,
223
+ T,
224
+ C
225
+ ]);
226
+ return {
227
+ values: m,
228
+ errors: ee,
229
+ setErrors: te,
230
+ setSaveFailureMessage: ne,
231
+ lineItemErrors: N,
232
+ setLineItemErrors: P,
233
+ totalsErrors: re,
234
+ setTotalsErrors: M,
235
+ onChange: ie,
236
+ lineItems: x,
237
+ lineItemRows: de,
238
+ discount: C,
239
+ onDiscountChange: oe,
240
+ onDiscountBlur: $,
241
+ tax: T,
242
+ onTaxChange: se,
243
+ onTaxBlur: ce,
244
+ total: D ?? fe,
245
+ totalOverride: D,
246
+ onTotalChange: le,
247
+ onTotalBlur: ue,
248
+ onAddLineItem: ae,
249
+ isTotalsDirty: z,
250
+ isDirty: F || L || z
251
+ };
250
252
  }
251
253
  //#endregion
252
- export { x as BillDetailsContainer, x as default };
254
+ export { x as useBillForm };
@@ -1,3 +1,25 @@
1
- import "./index20.js";
2
- import "./index39.js";
3
- import "./index40.js";
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js
2
+ var e = {
3
+ dialog: "bill-pay-bill-dialog-dialog",
4
+ vendorSection: "bill-pay-bill-dialog-vendor",
5
+ lineItems: "bill-pay-bill-dialog-line-items",
6
+ documentPanel: "bill-pay-bill-dialog-document",
7
+ duplicateNotice: "bill-pay-bill-dialog-duplicate-notice",
8
+ duplicateRemoveDialog: "bill-pay-bill-dialog-duplicate-remove-dialog",
9
+ duplicateRemoveConfirm: "bill-pay-bill-dialog-duplicate-remove-confirm",
10
+ duplicateCancelRowDialog: "bill-pay-bill-dialog-duplicate-cancel-row-dialog",
11
+ duplicateCancelRowConfirm: "bill-pay-bill-dialog-duplicate-cancel-row-confirm",
12
+ decisionDialog: "bill-pay-bill-decision-dialog",
13
+ decisionConfirm: "bill-pay-bill-decision-confirm",
14
+ decisionReason: "bill-pay-bill-decision-reason",
15
+ deleteDraftDialog: "bill-pay-bill-delete-draft-dialog",
16
+ deleteDraftConfirm: "bill-pay-bill-delete-draft-confirm",
17
+ unsavedDialog: "bill-pay-bill-unsaved-dialog",
18
+ unsavedSaveDraft: "bill-pay-bill-unsaved-save-draft",
19
+ unsavedDiscard: "bill-pay-bill-unsaved-discard",
20
+ unsavedClose: "bill-pay-bill-unsaved-close",
21
+ discardDialog: "bill-pay-bill-discard-dialog",
22
+ discardConfirm: "bill-pay-bill-discard-confirm"
23
+ };
24
+ //#endregion
25
+ export { e as billDialogTestIds };