@tesouro/embedded-components-react 0.9.24 → 0.9.26

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 (118) hide show
  1. package/README.md +13 -0
  2. package/dist/index.css +93 -55
  3. package/dist/index.d.ts +53 -3
  4. package/dist/index.js +9 -7
  5. package/dist/lib/AccountsQuickViewWidget.d.ts +650 -0
  6. package/dist/lib/AccountsQuickViewWidget.js +4 -0
  7. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/data-access/dist/index.js +2 -0
  8. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/data-access/dist/index2.js +21 -0
  9. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/index.js +3 -0
  10. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/AccountsQuickViewWidget/AccountsQuickViewWidgetFeature.js +82 -0
  11. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/AccountsQuickViewWidget/labels.js +10 -0
  12. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/AccountsQuickViewWidget/testIds.js +8 -0
  13. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/accountsBalanceSummary/summarizeAccountBalances.js +22 -0
  14. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/accountsBalanceSummary/useAccountsBalanceSummary.js +27 -0
  15. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/feature/dist/lib/analytics/events.js +4 -0
  16. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index.js +3 -0
  17. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index2.js +10 -0
  18. package/dist/libs/tesouro-embedded-components-react/accounts-quick-view-widget/ui/dist/index3.js +31 -0
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +14 -8
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +59 -7
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +10 -65
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +9 -10
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +7 -8
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +9 -7
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +29 -11
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +24 -24
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +14 -22
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +155 -14
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +13 -157
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +18 -12
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +32 -15
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +99 -39
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +69 -85
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +3 -85
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +57 -4
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +114 -57
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +190 -111
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +75 -187
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +35 -15
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +67 -75
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +111 -69
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +461 -108
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +102 -452
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +12 -116
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +85 -12
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +67 -73
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +231 -73
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +38 -232
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +245 -38
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +169 -38
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +21 -252
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +534 -23
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +4 -542
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +43 -4
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +236 -39
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +3 -240
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +6 -3
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +63 -4
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +1 -65
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +82 -225
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +45 -83
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +4 -47
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +13 -4
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +8 -13
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +1 -1
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +1 -1
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +1 -1
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +1 -1
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +2 -2
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index36.js +5 -5
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +138 -155
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +1 -1
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index3.js +2 -2
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +48 -43
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +219 -207
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index4.js +13 -13
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index6.js +5 -4
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +6 -6
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +1 -5
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +278 -322
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +1 -1
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/labels.js +1 -1
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +18 -16
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +2 -41
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index11.js +4 -2
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +39 -9
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +2 -78
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +11 -0
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +78 -2
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -4
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +25 -26
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +4 -2
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +28 -5
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +2 -34
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +7 -2
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +34 -0
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -0
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index6.js +31 -15
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +1 -54
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index8.js +18 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +52 -2
  110. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  111. package/dist/libs/tesouro-embedded-components-react/shared/quick-view/ui/dist/index.js +3 -0
  112. package/dist/libs/tesouro-embedded-components-react/shared/quick-view/ui/dist/index2.js +8 -0
  113. package/dist/libs/tesouro-embedded-components-react/shared/quick-view/ui/dist/index3.js +100 -0
  114. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/theme/themeTokens.js +1 -1
  115. package/dist/packages/shared-ui-shadcn/dist/index.js +4696 -4681
  116. package/package.json +1 -1
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +0 -1
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +0 -29
@@ -1,542 +1,4 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { formatCalendarDate as e } from "../../../../shared/util/dist/lib/formatCalendarDate.js";
6
- import "../../../../shared/util/dist/index.js";
7
- import { hasAnyScope as t } from "../../../../shared/data-access/dist/lib/hasAnyScope.js";
8
- import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
9
- import { useAllLedgerAccountsQuery as ee } from "../../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
10
- import "../../../../shared/data-access/dist/index.js";
11
- import { useWidgetConfig as te } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
- import { useOrganizationUserNames as ne } from "../../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
13
- import "../../../../shared/feature/dist/index.js";
14
- import { isEditablePayableStatus as re } from "../../../util/dist/lib/isEditablePayableStatus.js";
15
- import { resolveVendor as ie } from "../../../util/dist/lib/resolveVendor.js";
16
- import "../../../util/dist/index.js";
17
- import { formatGlCodeLabel as ae, resolveGlCodeAvailability as oe } from "./index13.js";
18
- import { hasUnpaidBalance as se } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
19
- import { BillDecisionDialog as r } from "../../../ui/dist/index4.js";
20
- import "../../../ui/dist/index.js";
21
- import { BillDialogScreen as ce } from "../../ui/dist/index31.js";
22
- import { BillDuplicateNotice as le } from "../../ui/dist/index37.js";
23
- import { BillRejectedBanner as ue } from "../../ui/dist/index40.js";
24
- import { DiscardChangesDialog as de } from "../../ui/dist/index43.js";
25
- import { ExtractionNotice as fe } from "../../ui/dist/index46.js";
26
- import { UnsavedBillDialog as pe } from "../../ui/dist/index52.js";
27
- import "../../ui/dist/index.js";
28
- import { BILL_CREATE_MESSAGE_LABELS_EN as me, mergeBillDialogCopy as he } from "./index29.js";
29
- import { useAllPayableLineItemsQuery as ge } from "../../data-access/dist/index4.js";
30
- import { usePayableQuery as _e } from "../../data-access/dist/index21.js";
31
- import "../../data-access/dist/index.js";
32
- import { useBillCreateController as ve } from "./index38.js";
33
- import { useBillForm as ye } from "./index40.js";
34
- import { buildPaymentHistory as be } from "./index2.js";
35
- import { usePayableDuplicateReview as xe } from "./index5.js";
36
- import { canOverrideApprovalPolicy as Se, canReadCounterpartBankAccounts as Ce } from "./index6.js";
37
- import { useApprovalPolicyCardView as we } from "./index12.js";
38
- import { resolveApprovalNotices as Te } from "./index14.js";
39
- import { resolvePaymentInstructionsGestures as Ee } from "./index15.js";
40
- import { useBillRejectionNotice as De } from "./index17.js";
41
- import { useCurrentApprovalRequestId as Oe } from "./index18.js";
42
- import { usePayableAuditHistory as ke } from "./index19.js";
43
- import { usePayableDetailActions as Ae } from "./index20.js";
44
- import { useScheduledDateLabel as je } from "./index21.js";
45
- import { useScheduledPayment as Me } from "./index22.js";
46
- import { useDraftDelete as Ne } from "./index23.js";
47
- import { buildBillDetailView as Pe } from "./index25.js";
48
- import { resolveEditorDismissal as Fe } from "./index26.js";
49
- import { SourceDocumentContainer as Ie } from "./index30.js";
50
- import { usePayableAchInstructions as Le } from "../../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
51
- import "../../../../shared/counterpart-management/feature/dist/index.js";
52
- import { useVendorSectionProps as Re } from "./index33.js";
53
- import { usePayToSave as ze } from "./index34.js";
54
- import { billDialogTestIds as i } from "./index41.js";
55
- import { useCallback as a, useEffect as Be, useMemo as o, useRef as Ve, useState as s } from "react";
56
- import { Fragment as He, jsx as c, jsxs as Ue } from "react/jsx-runtime";
57
- import { Trash2Icon as We } from "lucide-react";
58
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js
59
- function l({ open: l, onOpenChange: u, payableId: d, initialCounterpartId: Ge, readOnly: f = !1, copy: p, onCollapse: m, onEdit: Ke, onOpenBill: h, renderPaymentFlows: qe }) {
60
- let g = o(() => he(p), [p]), _ = p?.messages, v = o(() => ({
61
- ...me,
62
- ..._
63
- }), [_]), Je = d ? void 0 : Ge, [Ye, Xe] = s(Je), [y, Ze] = s(!!Je), [Qe, $e] = s(!1), [b, x] = s(!1), [et, tt] = s(), S = a((e) => {
64
- tt(() => e);
65
- }, []), [nt, rt] = s(), C = d ?? nt, w = _e(C, { pollWhileOcrProcessing: !0 }), T = ge(C), { initResponse: E } = te(), it = !!E, at = t(E?.scopes, [n.AccountingConfigReadOrg]), D = ee({ enabled: at }), O = w.data, k = !C || !!O, A = !f && k && !!C && O?.status !== "draft", ot = !f && !!O && !re(O?.status), j = f || ot, M = ye({
66
- payable: O,
67
- lineItems: T.lineItems,
68
- labels: v
69
- }), N = O?.counterpart_id ?? void 0;
70
- Be(() => {
71
- y || N && (Xe(N), Ze(!0));
72
- }, [y, N]);
73
- let st = a((e) => {
74
- Ze(!0), Xe(e);
75
- }, []), P = Me({
76
- payableId: C,
77
- scheduledPaymentDate: O?.scheduled_payment_date,
78
- enabled: f || A
79
- }), F = je({
80
- hasScheduledPayment: P.hasScheduledPayment,
81
- scheduledDate: P.scheduledDate,
82
- labels: g.scheduledRelativeDay
83
- }), I = Ce(E?.scopes), ct = t(E?.scopes, [n.PayableWriteOrg]), lt = t(E?.scopes, [n.CounterpartWriteOrg]) && ct, L = lt && se(O?.status) && !P.hasScheduledPayment && !P.isResolving, ut = L && I, dt = L || lt && O?.status === "rejected", ft = !f && k && (!C || O?.status === "draft") && !P.hasScheduledPayment && !P.isResolving, R = Re({
84
- payableId: C,
85
- counterpartId: f ? N : Ye,
86
- payableCounterpartId: N,
87
- isVendorKnown: f ? !!O : k,
88
- onCounterpartChange: st,
89
- requiredError: M.errors?.vendor,
90
- payableCounterpartBankAccountId: O?.counterpart_bank_account_id ?? void 0,
91
- extractedVendor: O?.counterpart_raw_data ?? void 0,
92
- readOnly: f,
93
- canEditVendor: !f || ut,
94
- canEditPaymentInstructions: !f || L,
95
- canAddPaymentInstructions: !f || dt,
96
- confirmDiscard: S,
97
- labels: p?.vendorSection
98
- }), pt = R.activePayToOperation === "missingInstructions" ? ft || dt : R.activePayToOperation === "existingInstructions" ? ft || L : R.activePayToOperation === "vendor" && f ? ut : !1, mt = !!(C && y) && !Ye, z = w.refetch, ht = a(async () => {
99
- let { data: e } = await z();
100
- return e?.status ?? void 0;
101
- }, [z]), { vendorWithInlineSave: B, isSavingPayToEdits: gt } = ze({
102
- vendor: R,
103
- payableId: C,
104
- linkedCounterpartId: O?.counterpart_id,
105
- linkedBankAccountId: O?.counterpart_bank_account_id,
106
- canSavePayToEdits: pt,
107
- readOnly: f,
108
- refreshPayable: z,
109
- labels: g.detail
110
- }), _t = o(() => A ? {
111
- ..._,
112
- draftSaved: v.submittedSaved
113
- } : _, [
114
- A,
115
- _,
116
- v.submittedSaved
117
- ]), V = ve({
118
- payableId: d,
119
- form: M,
120
- labels: _t,
121
- counterpartId: Ye,
122
- isVendorPending: R.mode === "creating" || R.isPendingVendor,
123
- onVendorIncomplete: R.revealIncompleteVendor,
124
- clearCounterpart: mt,
125
- prepareVendorForSave: R.prepareVendorForSave,
126
- onPayableCreated: rt,
127
- onSaved: rt,
128
- onDraftSaved: () => u(!1),
129
- onFinalized: () => u(!1),
130
- readSavedStatus: A ? ht : void 0
131
- }), vt = !!(V.isSavingDraft || V.isFinalizing || R.isVendorSavePending), H = f ? C : void 0, U = Oe({
132
- payableId: H,
133
- status: O?.status
134
- }), W = Ve(null), [yt, bt] = s(!1), xt = ie(O), G = Le({
135
- counterpartId: f ? N : void 0,
136
- currency: O?.currency,
137
- currentBankAccountId: f ? O?.counterpart_bank_account_id ?? void 0 : void 0,
138
- enabled: I && f
139
- }), K = we({
140
- payableId: H,
141
- approvalPolicyId: O?.approval_policy_id,
142
- enabled: f,
143
- copy: g.approvalPolicyCopy
144
- }), St = Se({
145
- status: O?.status,
146
- scopes: E?.scopes,
147
- arePendingApproversUnknown: K.isLoading,
148
- hasApprovalPolicy: !!O?.approval_policy_id,
149
- hasWaitingRequest: U.hasWaitingRequest
150
- }), Ct = Te({
151
- isCapabilityUnknown: U.isLoading || K.isLoading,
152
- canApproveNow: !!U.id,
153
- canOverridePolicy: St,
154
- status: O?.status,
155
- hasApprovalPolicy: !!O?.approval_policy_id,
156
- pendingApproverNames: K.pendingApprovers.flatMap((e) => e.names),
157
- labels: g
158
- }), wt = f || A ? C : void 0, Tt = f ? Ke : void 0, q = a((e) => {
159
- let t = () => {
160
- R.discardPayToEdits(), e?.();
161
- };
162
- R.hasUnsavedVendorChanges ? S(t) : t();
163
- }, [S, R]), { actions: Et, decisionDialog: Dt, isActionPending: Ot } = Ae({
164
- payableId: wt,
165
- status: O?.status,
166
- currentApprovalRequestId: U.id,
167
- arePendingApproversUnknown: K.isLoading,
168
- hasScheduledPayment: P.hasScheduledPayment,
169
- scheduledPaymentIntentId: P.scheduledPaymentIntentId,
170
- isScheduledPaymentUnknown: P.isResolving,
171
- isPayabilityUnknown: G.isLoading,
172
- hasApprovalPolicy: !!O?.approval_policy_id,
173
- hasWaitingRequest: U.hasWaitingRequest,
174
- pendingApprovers: K.pendingApprovers,
175
- labels: g.actions,
176
- isMarkAsPaidPending: yt,
177
- onMarkAsPaidSelect: () => W.current?.openMarkAsPaid(),
178
- onPayBillSelect: () => q(() => W.current?.openPayBill()),
179
- onEditSelect: Tt,
180
- onActionSucceeded: (e) => {
181
- if (e === "reopen") {
182
- Tt?.();
183
- return;
184
- }
185
- A && u(!1);
186
- }
187
- }), kt = Ne({
188
- payableId: C,
189
- status: O?.status,
190
- enabled: !f,
191
- labels: g.deleteDraft,
192
- onDeleted: () => u(!1)
193
- }), At = vt || Ot, jt = O?.ocr_status === "processing", Mt = w.isLoading || T.isResolving || jt, Nt = w.isLoading || T.isResolving || D.isResolving || G.isLoading, Pt = w.isError || T.isError || D.isError, Ft = o(() => [...kt.menuItems, ...A || f && !Nt && !Pt ? Et.menu.map((e) => ({
194
- id: e.id,
195
- label: e.label,
196
- onSelect: e.onSelect,
197
- disabled: e.disabled,
198
- icon: e.icon,
199
- sectionHeading: e.sectionHeading
200
- })) : []], [
201
- Et.menu,
202
- kt.menuItems,
203
- A,
204
- f,
205
- Nt,
206
- Pt
207
- ]), J = o(() => (D.data?.data ?? []).map((e) => ({
208
- value: e.id,
209
- label: ae(e)
210
- })), [D.data]), { unavailableMessage: It, disabled: Lt, rosterAvailable: Rt } = oe({
211
- isInitResolved: it,
212
- canReadGlCodes: at,
213
- isResolving: D.isResolving,
214
- isError: D.isError,
215
- optionCount: J.length,
216
- labels: g.lineItemsGlCodeUnavailable
217
- }), zt = O?.status === "rejected" || !f && A, Bt = t(E?.scopes, [n.ApprovalRequestReadOrg]), Vt = zt && Bt, Ht = t(E?.scopes, [n.UserReadOrg]), { userNames: Ut, isError: Wt, isResolving: Gt } = ne({ enabled: (f || zt) && Ht }), { historyQuery: Y, rows: Kt, namesError: qt } = ke({
218
- payableId: H,
219
- userNames: Ut,
220
- isRosterError: Ht && Wt,
221
- labels: g.history
222
- }), X = De({
223
- payableId: C,
224
- payableStatus: O?.status,
225
- payableUpdatedAt: O?.updated_at,
226
- enabled: Vt,
227
- userNames: Ut,
228
- labels: g.detail
229
- }), Jt = o(() => be({
230
- records: P.paymentRecords,
231
- events: Y.data?.data ?? [],
232
- currencyCode: O?.currency,
233
- labels: g.detail
234
- }), [
235
- P.paymentRecords,
236
- Y.data,
237
- O?.currency,
238
- g.detail
239
- ]), Yt = o(() => {
240
- if (!f || !O) return;
241
- let e = Pe({
242
- payable: O,
243
- lineItems: T.lineItems,
244
- glCodeOptions: J,
245
- glCodeRosterAvailable: Rt,
246
- history: Kt,
247
- paymentHistory: Jt,
248
- approvalPolicy: K.view,
249
- labels: g.detail,
250
- hasScheduledPayment: P.hasScheduledPayment,
251
- rejection: X,
252
- payableAchInstructions: G.achInstructions,
253
- payableAchInstructionsReadable: I && !G.isError
254
- });
255
- return R.mode === "resolved" && R.summary ? {
256
- ...e,
257
- payTo: R.summary
258
- } : e;
259
- }, [
260
- P.hasScheduledPayment,
261
- K.view,
262
- I,
263
- g.detail,
264
- J,
265
- Rt,
266
- Kt,
267
- T.lineItems,
268
- O,
269
- G.achInstructions,
270
- G.isError,
271
- Jt,
272
- f,
273
- X,
274
- R.mode,
275
- R.summary
276
- ]), Xt = O?.source_of_payable_data === "ocr", Z = xt?.name, Zt = f ? Z ? g.viewTitle(Z) : g.readOnlyTitle : Z && (Xt || A) ? g.extractedTitle(Z) : g.newTitle, Qt = f && O?.created_at ? g.addedOn(e(O.created_at.slice(0, 10))) : void 0, Q = M.isDirty || R.hasUnsavedVendorChanges || !!V.stagedFile || V.isFileDeletionPending, $t = a(() => {
277
- if (f && R.isEditingPayTo) {
278
- q(() => u(!1));
279
- return;
280
- }
281
- switch (Fe({
282
- isUnsavedPromptOpen: b,
283
- isLocked: j,
284
- isDirty: Q
285
- })) {
286
- case "dismiss-prompt":
287
- x(!1);
288
- return;
289
- case "prompt":
290
- x(!0);
291
- return;
292
- default: u(!1);
293
- }
294
- }, [
295
- Q,
296
- j,
297
- b,
298
- q,
299
- u,
300
- f,
301
- R.isEditingPayTo
302
- ]), en = a((e, t) => {
303
- if (!h) return;
304
- let n = () => h(e, t);
305
- if (f && R.isEditingPayTo) {
306
- q(n);
307
- return;
308
- }
309
- !j && Q ? S(n) : n();
310
- }, [
311
- S,
312
- Q,
313
- j,
314
- q,
315
- h,
316
- f,
317
- R.isEditingPayTo
318
- ]), tn = a(() => {
319
- if (R.isEditingPayTo) {
320
- q(m);
321
- return;
322
- }
323
- m?.();
324
- }, [
325
- q,
326
- m,
327
- R.isEditingPayTo
328
- ]), nn = a(() => {
329
- x(!1), u(!1);
330
- }, [u]), rn = Mt || R.mode === "creating", an = a(async () => {
331
- if (rn) return;
332
- let e = await V.saveDraft();
333
- x(!1), e && u(!1);
334
- }, [
335
- V,
336
- rn,
337
- u
338
- ]), $ = xe({
339
- payable: O,
340
- onOpenPayable: h ? en : void 0,
341
- onRemoved: () => u(!1),
342
- canManage: ct
343
- }), on = a((e) => {
344
- if (!(At || $.isBusy)) return e ? u(!0) : $t();
345
- }, [
346
- $.isBusy,
347
- At,
348
- $t,
349
- u
350
- ]), sn = $.isPossibleDuplicate, cn = !f && Xt && !Qe, ln = !f && !!X, un = ln || sn || cn ? /* @__PURE__ */ Ue(He, { children: [
351
- ln && X ? /* @__PURE__ */ c(ue, {
352
- ...X,
353
- labels: g.rejectedBanner
354
- }) : null,
355
- sn ? /* @__PURE__ */ c(le, {
356
- onNotADuplicate: $.onNotADuplicate,
357
- onRemoveBill: $.onRemoveBill,
358
- isActionDisabled: $.isBusy,
359
- rows: $.rows,
360
- collapsedRowCount: $.collapsedRowCount,
361
- showMoreLabel: $.showMoreLabel,
362
- labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
363
- testId: i.duplicateNotice
364
- }) : null,
365
- cn ? /* @__PURE__ */ c(fe, {
366
- onDismiss: () => $e(!0),
367
- labels: p?.extractionNotice
368
- }) : null
369
- ] }) : void 0;
370
- return /* @__PURE__ */ Ue(He, { children: [
371
- /* @__PURE__ */ c(ce, {
372
- open: l,
373
- onOpenChange: on,
374
- title: Zt,
375
- subtitle: Qt,
376
- notice: un,
377
- vendor: {
378
- ...B,
379
- testId: i.vendorSection
380
- },
381
- values: M.values,
382
- errors: M.errors,
383
- onChange: M.onChange,
384
- lineItems: {
385
- items: M.lineItemRows,
386
- glCodeOptions: J,
387
- glCodeDisabled: Lt,
388
- glCodeUnavailableMessage: It,
389
- discount: M.discount,
390
- onDiscountChange: M.onDiscountChange,
391
- onDiscountBlur: M.onDiscountBlur,
392
- tax: M.tax,
393
- onTaxChange: M.onTaxChange,
394
- onTaxBlur: M.onTaxBlur,
395
- total: M.total,
396
- onTotalChange: M.onTotalChange,
397
- onTotalBlur: M.onTotalBlur,
398
- onAddLineItem: M.onAddLineItem,
399
- errors: M.lineItemErrors,
400
- totalsErrors: M.totalsErrors,
401
- testId: i.lineItems
402
- },
403
- documentPanel: /* @__PURE__ */ c(Ie, {
404
- payableId: C,
405
- readOnly: j,
406
- isDocumentPending: !!C && !O?.file && (w.isLoading || O?.ocr_status === "processing"),
407
- file: O?.file ? {
408
- id: O.file.id,
409
- name: O.file.name,
410
- url: O.file.url,
411
- mimetype: O.file.mimetype
412
- } : void 0,
413
- staging: {
414
- stagedFile: V.stagedFile,
415
- onFileStaged: V.stageFile,
416
- onClearStagedFile: V.clearStagedFile,
417
- isSaving: vt
418
- },
419
- deletion: {
420
- isPending: V.isFileDeletionPending,
421
- onRequest: V.requestFileDeletion,
422
- onDetachNow: V.detachFileNow,
423
- isDeleting: V.isDeletingFile,
424
- hasFailed: V.hasFileDeletionFailed
425
- },
426
- labels: p?.sourceDocument
427
- }),
428
- menuItems: Ft,
429
- readOnly: j,
430
- detail: f ? {
431
- view: Yt,
432
- actions: Et,
433
- scheduledSummary: F ? g.scheduledSummary(F.label) : void 0,
434
- scheduledSummaryDate: F?.absoluteLabel,
435
- scheduledStatusLabel: F ? g.scheduledStatusBadge(F.label) : void 0,
436
- ...Ct,
437
- payTo: {
438
- onEdit: B.mode === "resolved" ? B.onEdit : void 0,
439
- paymentInstructions: O?.status === "paid" || O?.status === "canceled" ? void 0 : Ee(B.paymentInstructionsEditor, !!Yt?.payTo.hasPaymentInstructions),
440
- detailsWarning: B.detailsWarning,
441
- editForm: B.mode === "creating" ? B.newVendorForm : void 0
442
- },
443
- isLoading: Nt,
444
- isError: Pt,
445
- paymentHistoryError: P.isError || Y.isError,
446
- paymentHistoryLoading: P.isResolving || Y.isLoading,
447
- historyError: Y.isError,
448
- historyLoading: Y.isLoading || Gt,
449
- historyNamesError: qt
450
- } : void 0,
451
- isLineItemsLoading: Mt,
452
- isSaving: At || gt,
453
- isSavingDraft: V.isSavingDraft,
454
- isSubmitting: V.isFinalizing,
455
- onCancel: $t,
456
- onCollapse: f ? tn : void 0,
457
- onSaveDraft: V.saveDraft,
458
- onFinalize: V.finalize,
459
- scrollToErrorToken: V.scrollToErrorToken,
460
- showSubmit: !j && k,
461
- testId: i.dialog,
462
- labels: p?.screen
463
- }),
464
- /* @__PURE__ */ c(pe, {
465
- open: b,
466
- onSaveDraft: an,
467
- onDiscard: nn,
468
- onCancel: () => x(!1),
469
- isSaving: V.isSavingDraft,
470
- isSaveDraftDisabled: rn,
471
- labels: g.unsavedChanges,
472
- testId: i.unsavedDialog,
473
- saveDraftTestId: i.unsavedSaveDraft,
474
- discardTestId: i.unsavedDiscard,
475
- closeTestId: i.unsavedClose
476
- }),
477
- /* @__PURE__ */ c(de, {
478
- open: !!et,
479
- onDiscard: () => {
480
- let e = et;
481
- tt(void 0), e?.();
482
- },
483
- onKeepEditing: () => tt(void 0),
484
- labels: g.discardChanges,
485
- testId: i.discardDialog,
486
- discardTestId: i.discardConfirm
487
- }),
488
- /* @__PURE__ */ c(r, {
489
- ...Dt,
490
- labels: { cancelButton: g.actions.decisionDialog.cancelButton },
491
- testId: i.decisionDialog,
492
- confirmTestId: i.decisionConfirm,
493
- reasonTestId: i.decisionReason
494
- }),
495
- /* @__PURE__ */ c(r, {
496
- ...kt.dialog,
497
- labels: { cancelButton: g.actions.decisionDialog.cancelButton },
498
- testId: i.deleteDraftDialog,
499
- confirmTestId: i.deleteDraftConfirm
500
- }),
501
- /* @__PURE__ */ c(r, {
502
- open: $.removeConfirmation.open,
503
- copy: $.removeConfirmation.copy,
504
- onConfirm: $.removeConfirmation.onConfirm,
505
- onCancel: $.removeConfirmation.onCancel,
506
- isPending: $.removeConfirmation.isPending,
507
- confirmIcon: /* @__PURE__ */ c(We, {}),
508
- labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
509
- testId: i.duplicateRemoveDialog,
510
- confirmTestId: i.duplicateRemoveConfirm
511
- }),
512
- /* @__PURE__ */ c(r, {
513
- open: $.cancelRowConfirmation.open,
514
- copy: $.cancelRowConfirmation.copy,
515
- onConfirm: $.cancelRowConfirmation.onConfirm,
516
- onCancel: $.cancelRowConfirmation.onCancel,
517
- isPending: $.cancelRowConfirmation.isPending,
518
- labels: { cancelButton: $.cancelRowConfirmation.cancelButtonLabel },
519
- testId: i.duplicateCancelRowDialog,
520
- confirmTestId: i.duplicateCancelRowConfirm
521
- }),
522
- /* @__PURE__ */ c(r, {
523
- open: $.keepRowConfirmation.open,
524
- copy: $.keepRowConfirmation.copy,
525
- onConfirm: $.keepRowConfirmation.onConfirm,
526
- onCancel: $.keepRowConfirmation.onCancel,
527
- isPending: $.keepRowConfirmation.isPending,
528
- labels: { cancelButton: $.keepRowConfirmation.cancelButtonLabel }
529
- }),
530
- qe?.({
531
- ref: W,
532
- payable: O,
533
- payableId: H,
534
- isPayBillEnabled: f,
535
- hasScheduledPayment: P.hasScheduledPayment,
536
- onMissingAchInstructions: lt ? R.openPaymentInstructions : void 0,
537
- onMarkAsPaidPendingChange: bt
538
- })
539
- ] });
540
- }
541
- //#endregion
542
- export { l as BillDialog, l as default };
1
+ import "./index28.js";
2
+ import "./index37.js";
3
+ import "./index39.js";
4
+ import "./index41.js";
@@ -1,4 +1,43 @@
1
- import "./index29.js";
2
- import "./index38.js";
3
- import "./index40.js";
4
- import "./index42.js";
1
+ import { AWAITING_APPROVAL_LABEL_EN as e, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as t, BILL_DETAIL_ACTIONS_LABELS_EN as n, PAYMENT_HISTORY_LABELS_EN as r, SCHEDULED_RELATIVE_DAY_LABELS_EN as i, SCHEDULED_STATUS_BADGE_LABEL_EN as a, SCHEDULED_SUMMARY_LABEL_EN as o } from "../../../util/dist/lib/billDetailLabels.js";
2
+ import "../../../util/dist/index.js";
3
+ import { APPROVAL_POLICY_RULE_COPY_EN as s } from "./index6.js";
4
+ import { PAYABLE_AUDIT_HISTORY_LABELS_EN as c } from "./index26.js";
5
+ import { BILL_DETAILS_SHEET_LABELS_EN as l } from "../../ui/dist/index33.js";
6
+ import "../../ui/dist/index.js";
7
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js
8
+ var u = {
9
+ subtitle: "Accounts payable",
10
+ vendorRow: "Vendor",
11
+ bankAccountRow: "ACH bank account",
12
+ bankAccountValue: (e) => `Account ending in ${e}`,
13
+ ...r,
14
+ invoiceNumberRow: "Number",
15
+ issueDateRow: "Issue date",
16
+ dueDateRow: "Due date",
17
+ poNumberRow: "PO number",
18
+ notProvided: "Not provided",
19
+ glCodeMissing: "GL code not specified",
20
+ quantityValue: (e, t) => `${e} x ${t}`,
21
+ quantityOnlyValue: (e) => e,
22
+ subtotalRow: "Subtotal",
23
+ discountsRow: "Discounts",
24
+ taxRow: "Tax",
25
+ totalRow: "Total",
26
+ actionError: n.actionError,
27
+ actionSuccess: n.actionSuccess,
28
+ scheduledRelativeDay: i,
29
+ scheduledSummary: o,
30
+ scheduledStatusBadge: a,
31
+ awaitingApprovalNotice: e,
32
+ awaitingApprovalUnknownNotice: t,
33
+ paidOnLabel: (e) => `Paid on ${e}`,
34
+ rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
35
+ rejectedOn: (e) => `Rejected on ${e}`,
36
+ rejectionMessage: (e) => `"${e}"`,
37
+ sheet: l,
38
+ history: c,
39
+ decisionDialog: n.decisionDialog,
40
+ approvalPolicyCopy: s
41
+ };
42
+ //#endregion
43
+ export { u as BILL_DETAILS_LABELS_EN };