@tesouro/embedded-components-react 0.5.76 → 0.5.78

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.
@@ -1,16 +1,18 @@
1
- import { DISCARD_CHANGES_DIALOG_LABELS_EN as e } from "../../ui/dist/index66.js";
2
- import { BILL_REJECTED_BANNER_LABELS_EN as t } from "../../ui/dist/index74.js";
3
- import { UNSAVED_BILL_DIALOG_LABELS_EN as n } from "../../ui/dist/index111.js";
1
+ import { ACH_FIELD_GROUP_LABELS_EN as e } from "../../../shared/counterpart-management/ui/dist/index2.js";
2
+ import "../../../shared/counterpart-management/ui/dist/index.js";
3
+ import { DISCARD_CHANGES_DIALOG_LABELS_EN as t } from "../../ui/dist/index66.js";
4
+ import { BILL_REJECTED_BANNER_LABELS_EN as n } from "../../ui/dist/index74.js";
5
+ import { UNSAVED_BILL_DIALOG_LABELS_EN as r } from "../../ui/dist/index111.js";
4
6
  import "../../ui/dist/index.js";
5
- import { PAY_BILL_FLOW_LABELS_EN as r, mergePayBillFlowLabels as i } from "./index25.js";
6
- import { MARK_AS_PAID_FLOW_LABELS_EN as a, mergeMarkAsPaidFlowLabels as o } from "./index15.js";
7
+ import { PAY_BILL_FLOW_LABELS_EN as i, mergePayBillFlowLabels as a } from "./index25.js";
8
+ import { MARK_AS_PAID_FLOW_LABELS_EN as o, mergeMarkAsPaidFlowLabels as s } from "./index15.js";
7
9
  import "./index18.js";
8
- import { APPROVAL_POLICY_RULE_COPY_EN as s } from "./index29.js";
9
- import { AWAITING_APPROVAL_LABEL_EN as c, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as l, BILL_DETAIL_ACTIONS_LABELS_EN as u, PAYMENT_HISTORY_LABELS_EN as d, SCHEDULED_STATUS_BADGE_LABEL_EN as f, SCHEDULED_SUMMARY_LABEL_EN as p, mergeBillDetailActionsLabels as m, mergePaymentHistoryMethodLabels as h } from "./index45.js";
10
- import { PAYABLE_AUDIT_HISTORY_LABELS_EN as g } from "./index46.js";
11
- import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as _ } from "./index47.js";
10
+ import { APPROVAL_POLICY_RULE_COPY_EN as c } from "./index29.js";
11
+ import { AWAITING_APPROVAL_LABEL_EN as l, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as u, BILL_DETAIL_ACTIONS_LABELS_EN as d, PAYMENT_HISTORY_LABELS_EN as f, SCHEDULED_STATUS_BADGE_LABEL_EN as p, SCHEDULED_SUMMARY_LABEL_EN as m, mergeBillDetailActionsLabels as h, mergePaymentHistoryMethodLabels as g } from "./index45.js";
12
+ import { PAYABLE_AUDIT_HISTORY_LABELS_EN as _ } from "./index46.js";
13
+ import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as v } from "./index47.js";
12
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js
13
- var v = {
15
+ var y = {
14
16
  unmappedValidationError: (e, t) => `${e}: ${t}`,
15
17
  unknownValidationField: "(unknown field)",
16
18
  requiredField: "This field is required.",
@@ -32,7 +34,7 @@ var v = {
32
34
  totalNotGreaterThanZero: "Total amount must be greater than $0.",
33
35
  poNumberTooLong: "PO number must be 255 characters or fewer.",
34
36
  dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
35
- }, y = {
37
+ }, b = {
36
38
  paymentInstructionsValue: (e) => `Account ending in ${e}`,
37
39
  noMethod: "No payment method on file",
38
40
  paymentMethodLoading: "Loading payment method...",
@@ -41,14 +43,14 @@ var v = {
41
43
  vendorDetailsFailed: "We could not load this vendor. Try again.",
42
44
  pendingVendorDescription: "Will be created when submitted",
43
45
  bankAccountSaveFailed: "We could not save these payment instructions. Try again."
44
- }, b = {
46
+ }, x = {
45
47
  attachFailed: "We could not attach that file. Try again.",
46
48
  deleteFailed: "We could not remove that document. Try again.",
47
49
  noDocument: "No document attached to this bill.",
48
50
  pendingDeletionNotice: "This document will be removed when you save this bill.",
49
- preview: _
50
- }, x = {
51
- ...d,
51
+ preview: v
52
+ }, S = {
53
+ ...f,
52
54
  notProvided: "Not provided",
53
55
  paymentInstructionsValue: (e) => `Account ending in ${e}`,
54
56
  paymentInstructionsNotSet: "Not set",
@@ -69,24 +71,24 @@ var v = {
69
71
  rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
70
72
  rejectedOn: (e) => `Rejected on ${e}`,
71
73
  rejectionMessage: (e) => `"${e}"`
72
- }, S = {
74
+ }, C = {
73
75
  newTitle: "New bill",
74
76
  extractedTitle: (e) => `Bill from ${e}`,
75
77
  viewTitle: (e) => `Bill from ${e}`,
76
78
  readOnlyTitle: "Bill details",
77
79
  addedOn: (e) => `Added on ${e}`,
78
- unsavedChanges: n,
79
- discardChanges: e,
80
- scheduledSummary: p,
81
- scheduledStatusBadge: f,
82
- awaitingApprovalNotice: c,
83
- awaitingApprovalUnknownNotice: l,
84
- actions: u,
85
- detail: x,
86
- history: g,
87
- payBill: r,
88
- markAsPaid: a,
89
- approvalPolicyCopy: s,
80
+ unsavedChanges: r,
81
+ discardChanges: t,
82
+ scheduledSummary: m,
83
+ scheduledStatusBadge: p,
84
+ awaitingApprovalNotice: l,
85
+ awaitingApprovalUnknownNotice: u,
86
+ actions: d,
87
+ detail: S,
88
+ history: _,
89
+ payBill: i,
90
+ markAsPaid: o,
91
+ approvalPolicyCopy: c,
90
92
  deleteDraft: {
91
93
  menuItem: "Delete draft",
92
94
  dialog: {
@@ -101,50 +103,50 @@ var v = {
101
103
  noAccess: "You don't have access to GL codes",
102
104
  empty: "No GL codes set up yet"
103
105
  },
104
- rejectedBanner: t
106
+ rejectedBanner: n
105
107
  };
106
- function C(e) {
108
+ function w(e) {
107
109
  return {
108
- ...S,
110
+ ...C,
109
111
  ...e,
110
- actions: m(e?.actions),
112
+ actions: h(e?.actions),
111
113
  detail: {
112
- ...S.detail,
114
+ ...C.detail,
113
115
  ...e?.detail,
114
- paymentHistoryMethodLabels: h(e?.detail?.paymentHistoryMethodLabels)
116
+ paymentHistoryMethodLabels: g(e?.detail?.paymentHistoryMethodLabels)
115
117
  },
116
118
  history: {
117
- ...S.history,
119
+ ...C.history,
118
120
  ...e?.history
119
121
  },
120
- payBill: i(e?.payBill),
121
- markAsPaid: o(e?.markAsPaid),
122
+ payBill: a(e?.payBill),
123
+ markAsPaid: s(e?.markAsPaid),
122
124
  lineItemsGlCodeUnavailable: {
123
- ...S.lineItemsGlCodeUnavailable,
125
+ ...C.lineItemsGlCodeUnavailable,
124
126
  ...e?.lineItemsGlCodeUnavailable
125
127
  },
126
128
  unsavedChanges: {
127
- ...S.unsavedChanges,
129
+ ...C.unsavedChanges,
128
130
  ...e?.unsavedChanges
129
131
  },
130
132
  discardChanges: {
131
- ...S.discardChanges,
133
+ ...C.discardChanges,
132
134
  ...e?.discardChanges
133
135
  },
134
136
  rejectedBanner: {
135
- ...S.rejectedBanner,
137
+ ...C.rejectedBanner,
136
138
  ...e?.rejectedBanner
137
139
  },
138
140
  approvalPolicyCopy: {
139
- ...S.approvalPolicyCopy,
141
+ ...C.approvalPolicyCopy,
140
142
  ...e?.approvalPolicyCopy
141
143
  },
142
144
  deleteDraft: {
143
- ...S.deleteDraft,
145
+ ...C.deleteDraft,
144
146
  ...e?.deleteDraft,
145
147
  dialog: (() => {
146
148
  let t = {
147
- ...S.deleteDraft.dialog,
149
+ ...C.deleteDraft.dialog,
148
150
  ...e?.deleteDraft?.dialog
149
151
  };
150
152
  return delete t.reason, t;
@@ -152,7 +154,7 @@ function C(e) {
152
154
  }
153
155
  };
154
156
  }
155
- var w = {
157
+ var T = {
156
158
  createTitle: "New vendor",
157
159
  editTitle: "Edit vendor",
158
160
  switchVendorFieldLabel: "Switch to a different vendor",
@@ -161,7 +163,25 @@ var w = {
161
163
  cancel: "Cancel",
162
164
  save: "Save",
163
165
  cancelAriaLabel: "Cancel vendor",
164
- saveAriaLabel: "Save vendor"
166
+ saveAriaLabel: "Save vendor",
167
+ paymentInstructionsHeading: "Payment instructions",
168
+ paymentInstructionsDescription: "How and where will the money be sent. This information is required to send a payment.",
169
+ paymentInstructionsExtracted: "We read these from the bill. Check them before saving.",
170
+ ach: e
165
171
  };
172
+ function E(e) {
173
+ return {
174
+ ...T,
175
+ ...e,
176
+ ach: {
177
+ ...T.ach,
178
+ ...e?.ach,
179
+ fieldMarkers: {
180
+ ...T.ach.fieldMarkers,
181
+ ...e?.ach?.fieldMarkers
182
+ }
183
+ }
184
+ };
185
+ }
166
186
  //#endregion
167
- export { v as BILL_CREATE_MESSAGE_LABELS_EN, S as BILL_CREATE_SCREEN_LABELS_EN, x as BILL_DETAIL_VIEW_LABELS_EN, b as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, w as VENDOR_INLINE_FORM_LABELS_EN, y as VENDOR_SECTION_PROPS_LABELS_EN, C as mergeBillCreateScreenCopy };
187
+ export { y as BILL_CREATE_MESSAGE_LABELS_EN, C as BILL_CREATE_SCREEN_LABELS_EN, S as BILL_DETAIL_VIEW_LABELS_EN, x as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, T as VENDOR_INLINE_FORM_LABELS_EN, b as VENDOR_SECTION_PROPS_LABELS_EN, w as mergeBillCreateScreenCopy, E as mergeVendorInlineFormLabels };
@@ -6,21 +6,30 @@ function t(t) {
6
6
  let n = e(t);
7
7
  return n.length === 2 ? n.toUpperCase() : "";
8
8
  }
9
- function n(n) {
10
- if (!n) return;
11
- let r = {
12
- legalName: e(n.name),
13
- email: e(n.email),
14
- phone: e(n.phone),
9
+ function n(t) {
10
+ let n = e(t.bank_account?.routing_number), r = e(t.bank_account?.account_number);
11
+ if (!(!n && !r)) return {
12
+ accountHolderName: e(t.bank_account?.account_holder_name) || e(t.name),
13
+ routingNumber: n,
14
+ accountNumber: r
15
+ };
16
+ }
17
+ function r(r) {
18
+ if (!r) return;
19
+ let i = {
20
+ legalName: e(r.name),
21
+ email: e(r.email),
22
+ phone: e(r.phone),
15
23
  address: {
16
- line1: e(n.address?.line1),
17
- line2: e(n.address?.line2),
18
- city: e(n.address?.city),
19
- state: t(n.address?.state),
20
- postalCode: e(n.address?.postal_code)
21
- }
24
+ line1: e(r.address?.line1),
25
+ line2: e(r.address?.line2),
26
+ city: e(r.address?.city),
27
+ state: t(r.address?.state),
28
+ postalCode: e(r.address?.postal_code)
29
+ },
30
+ bankAccount: n(r)
22
31
  };
23
- return r.legalName || r.email || r.phone || Object.values(r.address).some(Boolean) ? r : void 0;
32
+ return i.legalName || i.email || i.phone || Object.values(i.address).some(Boolean) || i.bankAccount ? i : void 0;
24
33
  }
25
34
  //#endregion
26
- export { n as buildVendorPrefill };
35
+ export { r as buildVendorPrefill };
@@ -4,39 +4,38 @@
4
4
  "use client";
5
5
  import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import { getStateOptions as t } from "../../../shared/util/dist/lib/usStates.js";
7
- import { CounterpartFormFields as n, useFocusFirstInvalidField as r } from "../../../shared/counterpart-management/ui/dist/index9.js";
8
- import { VendorSearchCombobox as i } from "../../ui/dist/index50.js";
7
+ import { AchFieldGroup as n } from "../../../shared/counterpart-management/ui/dist/index5.js";
8
+ import { CounterpartFormFields as r, useFocusFirstInvalidField as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
9
+ import "../../../shared/counterpart-management/ui/dist/index.js";
10
+ import { VendorSearchCombobox as a } from "../../ui/dist/index50.js";
9
11
  import "../../ui/dist/index.js";
10
12
  import "../../../shared/counterpart-management/feature/dist/index.js";
11
- import { VENDOR_INLINE_FORM_LABELS_EN as a } from "./index48.js";
12
- import { useMemo as o } from "react";
13
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
13
+ import { mergeVendorInlineFormLabels as o } from "./index48.js";
14
+ import { useMemo as s } from "react";
15
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
14
16
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js
15
- function l({ mode: l, values: u, errors: d, onChange: f, onAddressChange: p, sectionsToExpand: m, onAddressExpand: h, onCancel: g, onSave: _, isSaving: v = !1, search: y, labels: b }) {
16
- let x = {
17
- ...a,
18
- ...b
19
- }, S = o(() => t(), []), C = r(d ?? {});
20
- return /* @__PURE__ */ c("div", {
21
- ref: C,
17
+ function u({ mode: u, values: d, errors: f, onChange: p, onAddressChange: m, sectionsToExpand: h, onAddressExpand: g, onCancel: _, onSave: v, isSaving: y = !1, search: b, paymentInstructions: x, labels: S }) {
18
+ let C = s(() => o(S), [S]), w = s(() => t(), []), T = i(f ?? {});
19
+ return /* @__PURE__ */ l("div", {
20
+ ref: T,
22
21
  className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
23
22
  children: [
24
- /* @__PURE__ */ s("p", {
23
+ /* @__PURE__ */ c("p", {
25
24
  className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
26
- children: l === "edit" ? x.editTitle : x.createTitle
25
+ children: u === "edit" ? C.editTitle : C.createTitle
27
26
  }),
28
- l === "edit" && y ? /* @__PURE__ */ s(i, {
29
- ...y,
30
- labels: { fieldLabel: x.switchVendorFieldLabel }
27
+ u === "edit" && b ? /* @__PURE__ */ c(a, {
28
+ ...b,
29
+ labels: { fieldLabel: C.switchVendorFieldLabel }
31
30
  }) : null,
32
- /* @__PURE__ */ s(n, {
33
- mode: l,
31
+ /* @__PURE__ */ c(r, {
32
+ mode: u,
34
33
  counterpartMode: "vendor",
35
- values: u,
36
- errors: d,
37
- stateOptions: S,
38
- onChange: f,
39
- onAddressChange: p,
34
+ values: d,
35
+ errors: f,
36
+ stateOptions: w,
37
+ onChange: p,
38
+ onAddressChange: m,
40
39
  sections: {
41
40
  entityType: !0,
42
41
  profileHeading: !1,
@@ -45,30 +44,49 @@ function l({ mode: l, values: u, errors: d, onChange: f, onAddressChange: p, sec
45
44
  address: "collapsible",
46
45
  bankAccount: !1
47
46
  },
48
- sectionsToExpand: m,
49
- onAddressExpand: h,
50
- labels: { businessNameLabel: x.nameLabel }
47
+ sectionsToExpand: h,
48
+ onAddressExpand: g,
49
+ labels: { businessNameLabel: C.nameLabel }
51
50
  }),
52
- /* @__PURE__ */ c("div", {
51
+ x ? /* @__PURE__ */ l("div", {
52
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
53
+ children: [/* @__PURE__ */ l("div", {
54
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
55
+ children: [/* @__PURE__ */ c("p", {
56
+ className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
57
+ children: C.paymentInstructionsHeading
58
+ }), /* @__PURE__ */ c("p", {
59
+ className: "ttw:text-sm ttw:text-muted-foreground",
60
+ children: x.isExtracted ? C.paymentInstructionsExtracted : C.paymentInstructionsDescription
61
+ })]
62
+ }), /* @__PURE__ */ c(n, {
63
+ idPrefix: "vendor-inline-ach",
64
+ values: x.values,
65
+ errors: x.errors,
66
+ onChange: x.onChange,
67
+ labels: C.ach
68
+ })]
69
+ }) : null,
70
+ /* @__PURE__ */ l("div", {
53
71
  className: "ttw:flex ttw:justify-end ttw:gap-2",
54
- children: [/* @__PURE__ */ s(e, {
72
+ children: [/* @__PURE__ */ c(e, {
55
73
  type: "button",
56
74
  variant: "outline",
57
- onClick: g,
58
- "aria-label": x.cancelAriaLabel,
59
- disabled: v,
60
- children: x.cancel
61
- }), _ ? /* @__PURE__ */ s(e, {
62
- type: "button",
63
75
  onClick: _,
64
- "aria-label": x.saveAriaLabel,
65
- loading: v,
66
- disabled: v,
67
- children: x.save
76
+ "aria-label": C.cancelAriaLabel,
77
+ disabled: y,
78
+ children: C.cancel
79
+ }), v ? /* @__PURE__ */ c(e, {
80
+ type: "button",
81
+ onClick: v,
82
+ "aria-label": C.saveAriaLabel,
83
+ loading: y,
84
+ disabled: y,
85
+ children: C.save
68
86
  }) : null]
69
87
  })
70
88
  ]
71
89
  });
72
90
  }
73
91
  //#endregion
74
- export { l as VendorInlineForm, l as default };
92
+ export { u as VendorInlineForm, u as default };