@tesouro/embedded-components-react 0.2.336 → 0.2.337

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 (96) 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/feature/dist/index.js +6 -2
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +1 -0
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +185 -180
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +98 -97
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +6 -107
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +19 -8
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +57 -38
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +3 -8
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +107 -88
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +8 -159
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +43 -5
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +4 -4
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +93 -108
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +180 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -24
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +8 -0
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +115 -0
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +1 -0
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +25 -0
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +34 -26
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -16
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +18 -2
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +1 -41
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +38 -269
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +272 -1
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -9
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +7 -47
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +49 -2
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +2 -22
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +20 -284
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +286 -2
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +2 -16
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +13 -117
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +120 -2
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +2 -10
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +8 -94
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +96 -2
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +1 -12
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +11 -56
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +57 -1
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +1 -53
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +51 -136
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +141 -1
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +2 -7
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +5 -42
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +44 -2
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +2 -4
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +2 -61
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +63 -2
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +2 -4
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +2 -14
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +16 -2
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +1 -73
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +72 -250
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +251 -12
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +9 -252
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +1 -10
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +6 -4
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +43 -87
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -0
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +14 -2
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +278 -5
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +8 -28
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +8 -2
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +91 -5
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +1 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +15 -9
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +101 -94
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +3 -14
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +28 -8
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +2 -170
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +7 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +32 -12
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -89
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +12 -2
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +106 -0
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +2 -0
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +18 -0
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +10 -0
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +170 -0
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +2 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +14 -0
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +89 -0
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -0
  92. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  94. package/dist/packages/shared-ui-shadcn/dist/index.js +1378 -1371
  95. package/package.json +1 -1
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +0 -34
@@ -5,128 +5,129 @@
5
5
  import { useAllLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
6
6
  import "../../../shared/data-access/dist/index.js";
7
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";
8
+ import { BillDecisionDialog as n } from "../../ui/dist/index47.js";
9
+ import { BillDetailsSheet as r } from "../../ui/dist/index53.js";
10
+ import { BillDuplicateNotice as i } from "../../ui/dist/index57.js";
10
11
  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";
12
+ import { useAllPayableLineItemsQuery as a } from "../../data-access/dist/index7.js";
13
+ import { usePayableQuery as o } from "../../data-access/dist/index13.js";
13
14
  import "../../data-access/dist/index.js";
14
- import { PayBillFlow as o } from "./index10.js";
15
+ import { PayBillFlow as s } from "./index10.js";
15
16
  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";
17
+ import { mergeDecisionDialogCopy as c } from "./index24.js";
18
+ import { useApprovalPolicyCardView as l } from "./index15.js";
19
+ import { useCurrentApprovalRequestId as u } from "./index16.js";
20
+ import { usePayableDetailActions as d } from "./index18.js";
21
+ import { useScheduledPayment as f } from "./index19.js";
22
+ import { BILL_DETAILS_LABELS_EN as p } from "./index40.js";
23
+ import { mapPayableToBillDetails as m } from "./index41.js";
24
+ import { useMemo as h, useRef as g } from "react";
25
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
25
26
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js
26
- function y(e) {
27
+ function b(e) {
27
28
  return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
28
29
  }
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,
30
+ function x({ open: x, onOpenChange: S, payableId: C, onClose: w, onExpand: T, testId: E, labels: D, poweredByBankName: O, isPossibleDuplicate: k }) {
31
+ let A = h(() => ({
32
+ ...p,
33
+ ...D,
33
34
  sheet: {
34
- ...f.sheet,
35
- ...E?.sheet,
35
+ ...p.sheet,
36
+ ...D?.sheet,
36
37
  statusBadge: {
37
- ...f.sheet.statusBadge,
38
- ...E?.sheet?.statusBadge
38
+ ...p.sheet.statusBadge,
39
+ ...D?.sheet?.statusBadge
39
40
  },
40
41
  approvalPolicy: {
41
- ...f.sheet.approvalPolicy,
42
- ...E?.sheet?.approvalPolicy
42
+ ...p.sheet.approvalPolicy,
43
+ ...D?.sheet?.approvalPolicy
43
44
  }
44
45
  },
45
- decisionDialog: s(f.decisionDialog, E?.decisionDialog),
46
+ decisionDialog: c(p.decisionDialog, D?.decisionDialog),
46
47
  approvalPolicyCopy: {
47
- ...f.approvalPolicyCopy,
48
- ...E?.approvalPolicyCopy
48
+ ...p.approvalPolicyCopy,
49
+ ...D?.approvalPolicyCopy
49
50
  }
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,
51
+ }), [D]), j = o(C), M = a(C), N = e(), P = j.data, F = g(null), I = u({
52
+ payableId: C,
53
+ status: P?.status
54
+ }), L = l({
55
+ payableId: C,
56
+ approvalPolicyId: P?.approval_policy_id,
57
+ copy: A.approvalPolicyCopy
58
+ }), R = f({
59
+ payableId: C,
60
+ scheduledPaymentDate: P?.scheduled_payment_date
61
+ }), { actions: z, decisionDialog: B } = d({
62
+ payableId: P ? C : void 0,
63
+ status: P?.status,
64
+ currentApprovalRequestId: I.id,
65
+ isPolicyApprover: I.isPolicyApprover,
66
+ hasWaitingRequest: I.hasWaitingRequest,
67
+ hasScheduledPayment: R.hasScheduledPayment,
68
+ isScheduledPaymentUnknown: R.isResolving,
68
69
  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
70
+ payBill: A.sheet.payButton,
71
+ markAsPaid: A.sheet.markAsPaidButton,
72
+ reject: A.sheet.rejectButton,
73
+ approve: A.sheet.approveButton,
74
+ cancel: A.sheet.cancelButton,
75
+ reopen: A.sheet.reopenButton,
76
+ forceApprove: A.sheet.forceApproveButton,
77
+ forceReject: A.sheet.forceRejectButton,
78
+ decisionDialog: A.decisionDialog,
79
+ actionError: A.actionError
79
80
  },
80
81
  onPayBillSelect: () => {
81
- if (!y(t(M)) && w) {
82
- w();
82
+ if (!b(t(P)) && T) {
83
+ T();
83
84
  return;
84
85
  }
85
- N.current?.open();
86
+ F.current?.open();
86
87
  }
87
- }), z = I.hasScheduledPayment && I.scheduledDateLabel ? /* @__PURE__ */ _("p", {
88
+ }), V = R.hasScheduledPayment && R.scheduledDateLabel ? /* @__PURE__ */ v("p", {
88
89
  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
90
+ children: A.scheduledSummary(R.scheduledDateLabel)
91
+ }) : void 0, H = k ? /* @__PURE__ */ v(i, {}) : void 0, U = H || V ? /* @__PURE__ */ y(_, { children: [H, V] }) : void 0, W = h(() => P ? m({
92
+ payable: P,
93
+ lineItems: M.lineItems,
94
+ ledgerAccounts: N.data?.data ?? [],
95
+ labels: A
95
96
  }) : 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
97
+ P,
98
+ M.lineItems,
99
+ N.data,
100
+ A
101
+ ]), G = j.isLoading || M.isResolving || N.isResolving, K = j.isError || M.isError || N.isError;
102
+ return /* @__PURE__ */ y(_, { children: [
103
+ /* @__PURE__ */ v(r, {
104
+ open: x,
105
+ onOpenChange: S,
106
+ details: W,
107
+ actions: z,
108
+ approvalPolicy: L.view,
109
+ isLoading: G,
110
+ isError: K,
111
+ notice: U,
112
+ onClose: w,
113
+ onExpand: T,
114
+ testId: E,
115
+ labels: A.sheet
115
116
  }),
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
117
+ /* @__PURE__ */ v(n, {
118
+ ...B,
119
+ labels: { cancelButton: A.decisionDialog.cancelButton },
120
+ testId: E ? `${E}-decision-dialog` : void 0,
121
+ confirmTestId: E ? `${E}-decision-confirm` : void 0,
122
+ reasonTestId: E ? `${E}-decision-reason` : void 0,
123
+ reasonFieldId: E ? `${E}-decision-reason-field` : void 0
123
124
  }),
124
- M ? /* @__PURE__ */ _(o, {
125
- ref: N,
126
- payable: M,
127
- poweredByBankName: D
125
+ P ? /* @__PURE__ */ v(s, {
126
+ ref: F,
127
+ payable: P,
128
+ poweredByBankName: O
128
129
  }) : null
129
130
  ] });
130
131
  }
131
132
  //#endregion
132
- export { b as BillDetailsContainer, b as default };
133
+ export { x as BillDetailsContainer, x as default };
@@ -1,110 +1,9 @@
1
- import { BillColumn as e } from "../../ui/dist/index53.js";
2
- import "../../ui/dist/index.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js
4
- var t = {
5
- Drafts: "drafts",
6
- Pending: "pending",
7
- Scheduled: "scheduled",
8
- Paid: "paid",
9
- All: "all"
10
- }, n = {
11
- [t.Drafts]: ["draft"],
12
- [t.Pending]: [
13
- "new",
14
- "approve_in_progress",
15
- "waiting_to_be_paid",
16
- "partially_paid"
17
- ],
18
- [t.Scheduled]: [
19
- "new",
20
- "approve_in_progress",
21
- "waiting_to_be_paid",
22
- "partially_paid"
23
- ],
24
- [t.Paid]: ["paid"],
25
- [t.All]: void 0
26
- }, r = {
27
- [t.Drafts]: void 0,
28
- [t.Pending]: !1,
29
- [t.Scheduled]: !0,
30
- [t.Paid]: void 0,
31
- [t.All]: void 0
2
+ var e = {
3
+ duplicateBadge: "Duplicate?",
4
+ existingBadge: "Existing",
5
+ selectRow: ({ vendorLabel: e, designation: t, invoiceNumberLabel: n, addedOnLabel: r }) => `Select bill — ${e}, ${t}, invoice ${n}, added ${r}`,
6
+ openRow: ({ vendorLabel: e, designation: t, invoiceNumberLabel: n, addedOnLabel: r }) => `View bill — ${e}, ${t}, invoice ${n}, added ${r}`
32
7
  };
33
- function i(e) {
34
- return e === t.Pending || e === t.Drafts;
35
- }
36
- var a = t.Pending, o = [
37
- t.Pending,
38
- t.Drafts,
39
- t.Scheduled,
40
- t.Paid,
41
- t.All
42
- ], s = {
43
- [t.Drafts]: [
44
- e.Vendor,
45
- e.DueDate,
46
- e.Status,
47
- e.AmountDue,
48
- e.AddedOn
49
- ],
50
- [t.Pending]: [
51
- e.Vendor,
52
- e.DueDate,
53
- e.Status,
54
- e.AmountDue,
55
- e.AddedOn
56
- ],
57
- [t.Scheduled]: [
58
- e.Vendor,
59
- e.DueDate,
60
- e.ScheduledDate,
61
- e.Status,
62
- e.AmountScheduled,
63
- e.AddedOn
64
- ],
65
- [t.Paid]: [
66
- e.Vendor,
67
- e.PaidDate,
68
- e.Status,
69
- e.AmountPaid,
70
- e.AddedOn
71
- ],
72
- [t.All]: [
73
- e.Vendor,
74
- e.DueDate,
75
- e.ScheduledDate,
76
- e.Status,
77
- e.AmountDue,
78
- e.AmountPaid,
79
- e.AddedOn
80
- ]
81
- };
82
- function c(e) {
83
- return s[e];
84
- }
85
- function l(e) {
86
- let t = n[e];
87
- return t ? [...t] : void 0;
88
- }
89
- function u(e) {
90
- return r[e];
91
- }
92
- var d = {
93
- vendorLabel: "counterpart_name",
94
- dueDateLabel: "due_date",
95
- scheduledDateLabel: "scheduled_payment_date",
96
- addedOnLabel: "created_at"
97
- }, f = {
98
- [e.Vendor]: "vendorLabel",
99
- [e.DueDate]: "dueDateLabel",
100
- [e.ScheduledDate]: "scheduledDateLabel",
101
- [e.AddedOn]: "addedOnLabel"
102
- };
103
- function p(e) {
104
- return f[e];
105
- }
106
- function m(e) {
107
- if (e) return d[e];
108
- }
109
8
  //#endregion
110
- export { s as BILL_QUEUE_COLUMNS, r as BILL_QUEUE_HAS_SCHEDULED_PAYMENT, o as BILL_QUEUE_ORDER, n as BILL_QUEUE_STATUSES, d as BILL_SORT_FIELDS, t as BillQueue, a as DEFAULT_BILL_QUEUE, c as billQueueColumns, u as billQueueHasScheduledPayment, i as billQueueOffersAddPanel, l as billQueueStatuses, p as billSortColumnId, m as billSortField };
9
+ export { e as DUPLICATE_BILLS_LABELS_EN };
@@ -1,11 +1,22 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useCallback as e, useMemo as t, useState as n } from "react";
1
6
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js
2
- async function e(e) {
3
- if (!e.trim()) return !1;
4
- try {
5
- return await navigator.clipboard.writeText(e), !0;
6
- } catch {
7
- return !1;
8
- }
7
+ function r({ rowIds: r }) {
8
+ let [i, a] = n([]), o = e((e) => {
9
+ a((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
10
+ }, []), s = t(() => r.filter((e) => i.includes(e)), [r, i]), c = r.length > 0 && s.length === r.length, l = e(() => {
11
+ a(c ? [] : [...r]);
12
+ }, [c, r]);
13
+ return {
14
+ selectedIds: s,
15
+ isSelected: e((e) => i.includes(e), [i]),
16
+ toggleRow: o,
17
+ toggleAllRows: l,
18
+ selectAllChecked: c ? !0 : s.length > 0 && "indeterminate"
19
+ };
9
20
  }
10
21
  //#endregion
11
- export { e as copyTextToClipboard };
22
+ export { r as useDuplicateBillsSelection };
@@ -1,40 +1,59 @@
1
- import { BillQueue as e } from "./index51.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { DuplicateBillsDialog as e } from "../../ui/dist/index67.js";
6
+ import "../../ui/dist/index.js";
7
+ import { DUPLICATE_BILLS_LABELS_EN as t } from "./index51.js";
8
+ import { useDuplicateBillsSelection as n } from "./index52.js";
9
+ import { useMemo as r } from "react";
10
+ import { jsx as i } from "react/jsx-runtime";
2
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js
3
- var t = {
4
- [e.Drafts]: "Drafts",
5
- [e.Pending]: "Pending",
6
- [e.Scheduled]: "Scheduled",
7
- [e.Paid]: "Paid",
8
- [e.All]: "All bills"
9
- }, n = {
10
- [e.Drafts]: {
11
- title: "No drafts",
12
- description: "Bills wait here until someone submits them for approval."
13
- },
14
- [e.Pending]: {
15
- title: "Nothing to act on",
16
- description: "Every bill has been paid, scheduled, or is still a draft."
17
- },
18
- [e.Scheduled]: {
19
- title: "No scheduled bills",
20
- description: "Bills appear here once a payment date is set for them."
21
- },
22
- [e.Paid]: {
23
- title: "No paid bills",
24
- description: "Bills appear here once their payment has gone out."
25
- },
26
- [e.All]: {
27
- title: "No bills",
28
- description: "Bills appear here as soon as they are added."
29
- }
30
- }, r = {
31
- emptyHeading: "Add your first bill",
32
- nonEmptyHeading: "Add a bill",
33
- createButton: "Add bill",
34
- emailCopiedToast: "Email address copied to clipboard",
35
- emailCopyFailedToast: "Could not copy the email address",
36
- queues: t,
37
- queueEmptyStates: n
38
- };
12
+ var a = [];
13
+ function o({ open: o, onOpenChange: s, bills: c = a, canManageDuplicates: l = !0, onOpenBill: u, labels: d, dialogLabels: f }) {
14
+ let p = r(() => ({
15
+ ...t,
16
+ ...d
17
+ }), [d]), m = r(() => c.map((e) => e.id), [c]), { selectedIds: h, isSelected: g, toggleRow: _, toggleAllRows: v, selectAllChecked: y } = n({ rowIds: m }), b = r(() => c.map((e) => {
18
+ let t = e.isPossibleDuplicate ? p.duplicateBadge : p.existingBadge, n = {
19
+ vendorLabel: e.vendorLabel,
20
+ designation: t,
21
+ invoiceNumberLabel: e.invoiceNumberLabel,
22
+ addedOnLabel: e.addedOnLabel
23
+ };
24
+ return {
25
+ ...e,
26
+ duplicateBadge: {
27
+ label: t,
28
+ tone: e.isPossibleDuplicate ? "warning" : "success"
29
+ },
30
+ selectLabel: p.selectRow(n),
31
+ openLabel: p.openRow(n),
32
+ isSelected: g(e.id),
33
+ onToggleSelected: () => _(e.id),
34
+ onOpen: () => u?.(e.id)
35
+ };
36
+ }), [
37
+ c,
38
+ g,
39
+ p,
40
+ _,
41
+ u
42
+ ]), x = () => {
43
+ if (h.length === 0) throw Error("Duplicate review action taken with no bills selected — keep and cancel both need a subject.");
44
+ s(!1);
45
+ };
46
+ return /* @__PURE__ */ i(e, {
47
+ open: o,
48
+ onOpenChange: s,
49
+ rows: b,
50
+ selectAllChecked: y,
51
+ onToggleAllRows: v,
52
+ onKeepSelected: l ? x : void 0,
53
+ onCancelDuplicates: l ? x : void 0,
54
+ isActionDisabled: h.length === 0,
55
+ labels: f
56
+ });
57
+ }
39
58
  //#endregion
40
- export { r as BILLS_TAB_LABELS_EN, n as BILL_QUEUE_EMPTY_STATES_EN, t as BILL_QUEUE_LABELS_EN };
59
+ export { o as DuplicateBillsContainer, o as default };
@@ -1,8 +1,3 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js
2
- var e = {
3
- root: "bill-pay-bills-tab",
4
- uploadTray: "bill-pay-upload-tray",
5
- detailsSheet: "bill-pay-details-sheet"
6
- };
7
- //#endregion
8
- export { e as billsTabTestIds };
1
+ import "./index51.js";
2
+ import "./index52.js";
3
+ import "./index53.js";