@tesouro/embedded-components-react 0.5.107 → 0.5.108
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.
- package/README.md +6 -5
- package/dist/index.d.ts +16 -2
- package/dist/lib/CounterpartsWidget.d.ts +16 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +327 -327
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +11 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +78 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +149 -135
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +31 -18
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +125 -121
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +195 -193
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a, RequiredFieldsLegend as o, Separator as s, Sheet as c, SheetContent as l, SheetDescription as ee, SheetHeader as
|
|
2
|
-
import { EmptyState as
|
|
3
|
-
import { ErrorState as
|
|
1
|
+
import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a, RequiredFieldsLegend as o, Separator as s, Sheet as c, SheetContent as l, SheetDescription as ee, SheetHeader as te, SheetTitle as u, Skeleton as d, Typography as f, mergeRequiredFieldsLegendLabels as p } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { EmptyState as ne } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
3
|
+
import { ErrorState as re } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
4
4
|
import "../../../shared/ui/dist/index.js";
|
|
5
|
-
import { COUNTERPART_FORM_SHEET_LABELS_EN as
|
|
6
|
-
import { CounterpartFormFields as
|
|
5
|
+
import { COUNTERPART_FORM_SHEET_LABELS_EN as m } from "../../../shared/counterpart-management/ui/dist/index2.js";
|
|
6
|
+
import { CounterpartFormFields as h } from "../../../shared/counterpart-management/ui/dist/index9.js";
|
|
7
7
|
import "../../../shared/counterpart-management/ui/dist/index.js";
|
|
8
|
-
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { EyeIcon as
|
|
8
|
+
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as g } from "./index2.js";
|
|
9
|
+
import { useEffect as _, useState as v } from "react";
|
|
10
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
+
import { EyeIcon as S, EyeOffIcon as C, MoreVerticalIcon as w, PencilIcon as T, PlusIcon as E, Trash2Icon as D, XIcon as ie } from "lucide-react";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js
|
|
13
13
|
var O = "-";
|
|
14
14
|
function k({ className: e }) {
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ b(d, { className: e ?? "ttw:h-5 ttw:w-24" });
|
|
16
16
|
}
|
|
17
17
|
function A({ label: e, children: t, isLast: n }) {
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ x("div", {
|
|
19
19
|
className: ["ttw:grid ttw:grid-cols-[180px_1fr] ttw:gap-4 ttw:py-3", n ? "" : "ttw:border-b"].join(" "),
|
|
20
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ b(f, {
|
|
21
21
|
variant: "body2",
|
|
22
22
|
className: "ttw:text-muted-foreground",
|
|
23
23
|
children: e
|
|
24
|
-
}), /* @__PURE__ */
|
|
24
|
+
}), /* @__PURE__ */ b("div", {
|
|
25
25
|
className: "ttw:min-w-0 ttw:text-sm",
|
|
26
26
|
children: t
|
|
27
27
|
})]
|
|
@@ -29,53 +29,53 @@ function A({ label: e, children: t, isLast: n }) {
|
|
|
29
29
|
}
|
|
30
30
|
function j({ mode: e, summary: t, labels: n }) {
|
|
31
31
|
let r = e === "customer" ? n.summaryReceived : n.summaryPaid;
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ x("div", {
|
|
33
33
|
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-md ttw:bg-muted ttw:p-5",
|
|
34
34
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ b(f, {
|
|
36
36
|
variant: "body2",
|
|
37
37
|
className: "ttw:text-muted-foreground",
|
|
38
38
|
children: e === "customer" ? n.summaryAmountDue : n.summaryBalanceDue
|
|
39
39
|
}),
|
|
40
|
-
t?.isPrimaryAmountLoading ? /* @__PURE__ */
|
|
40
|
+
t?.isPrimaryAmountLoading ? /* @__PURE__ */ b(k, { className: "ttw:h-9 ttw:w-36" }) : /* @__PURE__ */ b(f, {
|
|
41
41
|
variant: "h3",
|
|
42
42
|
className: "ttw:font-semibold",
|
|
43
43
|
children: t?.primaryAmountLabel ?? O
|
|
44
44
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ x("div", {
|
|
46
46
|
className: "ttw:flex ttw:gap-8",
|
|
47
47
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ x("div", {
|
|
49
49
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ b(f, {
|
|
51
51
|
variant: "caption",
|
|
52
52
|
className: "ttw:text-muted-foreground",
|
|
53
53
|
children: n.summaryBilled
|
|
54
|
-
}), t?.isBilledAmountLoading ? /* @__PURE__ */
|
|
54
|
+
}), t?.isBilledAmountLoading ? /* @__PURE__ */ b(k, {}) : /* @__PURE__ */ b(f, {
|
|
55
55
|
variant: "body1",
|
|
56
56
|
className: "ttw:font-semibold",
|
|
57
57
|
children: t?.billedAmountLabel ?? O
|
|
58
58
|
})]
|
|
59
59
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ x("div", {
|
|
61
61
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
62
|
-
children: [/* @__PURE__ */
|
|
62
|
+
children: [/* @__PURE__ */ b(f, {
|
|
63
63
|
variant: "caption",
|
|
64
64
|
className: "ttw:text-muted-foreground",
|
|
65
65
|
children: r
|
|
66
|
-
}), t?.isReceivedOrPaidAmountLoading ? /* @__PURE__ */
|
|
66
|
+
}), t?.isReceivedOrPaidAmountLoading ? /* @__PURE__ */ b(k, {}) : /* @__PURE__ */ b(f, {
|
|
67
67
|
variant: "body1",
|
|
68
68
|
className: "ttw:font-semibold ttw:text-green-600",
|
|
69
69
|
children: t?.receivedOrPaidAmountLabel ?? O
|
|
70
70
|
})]
|
|
71
71
|
}),
|
|
72
|
-
e === "vendor" && /* @__PURE__ */
|
|
72
|
+
e === "vendor" && /* @__PURE__ */ x("div", {
|
|
73
73
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ b(f, {
|
|
75
75
|
variant: "caption",
|
|
76
76
|
className: "ttw:text-muted-foreground",
|
|
77
77
|
children: n.summaryRejected
|
|
78
|
-
}), t?.isRejectedAmountLoading ? /* @__PURE__ */
|
|
78
|
+
}), t?.isRejectedAmountLoading ? /* @__PURE__ */ b(k, {}) : /* @__PURE__ */ b(f, {
|
|
79
79
|
variant: "body1",
|
|
80
80
|
className: "ttw:font-semibold",
|
|
81
81
|
children: t?.rejectedAmountLabel ?? O
|
|
@@ -89,57 +89,57 @@ function j({ mode: e, summary: t, labels: n }) {
|
|
|
89
89
|
function M({ mode: n, documents: r, labels: i, onViewAll: a }) {
|
|
90
90
|
if (!r || r.length === 0) return null;
|
|
91
91
|
let o = n === "vendor";
|
|
92
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ x("section", {
|
|
93
93
|
className: "ttw:flex ttw:flex-col ttw:border-t ttw:pt-6",
|
|
94
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ x("div", {
|
|
95
95
|
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4 ttw:pb-5",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ x("div", {
|
|
97
97
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ b(f, {
|
|
99
99
|
variant: "body1",
|
|
100
100
|
className: "ttw:font-medium",
|
|
101
101
|
children: n === "customer" ? i.recentCustomerDocumentsHeading : i.recentVendorDocumentsHeading
|
|
102
|
-
}), /* @__PURE__ */
|
|
102
|
+
}), /* @__PURE__ */ b(f, {
|
|
103
103
|
variant: "body2",
|
|
104
104
|
className: "ttw:text-muted-foreground",
|
|
105
105
|
children: n === "customer" ? i.recentCustomerDocumentsDescription : i.recentVendorDocumentsDescription
|
|
106
106
|
})]
|
|
107
|
-
}), a && /* @__PURE__ */
|
|
107
|
+
}), a && /* @__PURE__ */ b(t, {
|
|
108
108
|
variant: "link",
|
|
109
109
|
className: "ttw:h-auto ttw:p-0",
|
|
110
110
|
onClick: a,
|
|
111
111
|
children: i.viewAllDocumentsAction
|
|
112
112
|
})]
|
|
113
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ b("div", {
|
|
114
114
|
className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-md ttw:border ttw:p-4",
|
|
115
115
|
children: r.map((t, n) => {
|
|
116
116
|
let a = o && t.isOverdue;
|
|
117
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ x("div", {
|
|
118
118
|
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ x("div", {
|
|
120
120
|
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
121
|
+
children: [/* @__PURE__ */ x("div", {
|
|
122
122
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ b(f, {
|
|
124
124
|
variant: "h6",
|
|
125
125
|
className: "ttw:font-medium",
|
|
126
126
|
children: t.amountLabel
|
|
127
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ b(f, {
|
|
128
128
|
variant: "body2",
|
|
129
129
|
className: a ? "ttw:text-destructive" : "ttw:text-muted-foreground",
|
|
130
130
|
children: t.dateLabel
|
|
131
131
|
})]
|
|
132
|
-
}), /* @__PURE__ */
|
|
132
|
+
}), /* @__PURE__ */ x("div", {
|
|
133
133
|
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
134
|
-
children: [a && /* @__PURE__ */
|
|
134
|
+
children: [a && /* @__PURE__ */ b(e, {
|
|
135
135
|
variant: "destructive",
|
|
136
136
|
children: i.overdueTag
|
|
137
|
-
}), /* @__PURE__ */
|
|
137
|
+
}), /* @__PURE__ */ b(e, {
|
|
138
138
|
variant: t.statusTone ?? "outline",
|
|
139
139
|
children: t.statusLabel
|
|
140
140
|
})]
|
|
141
141
|
})]
|
|
142
|
-
}), n < r.length - 1 && /* @__PURE__ */
|
|
142
|
+
}), n < r.length - 1 && /* @__PURE__ */ b(s, {})]
|
|
143
143
|
}, t.id);
|
|
144
144
|
})
|
|
145
145
|
})]
|
|
@@ -147,32 +147,32 @@ function M({ mode: n, documents: r, labels: i, onViewAll: a }) {
|
|
|
147
147
|
}
|
|
148
148
|
function N({ mode: e, addressLines: n, canEdit: r, onEditAddress: i, onAddAddress: a, labels: o }) {
|
|
149
149
|
let s = n.length > 0;
|
|
150
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ x("section", {
|
|
151
151
|
className: e === "customer" ? "ttw:flex ttw:flex-col ttw:gap-3 ttw:border-t ttw:pt-6" : "ttw:flex ttw:flex-col",
|
|
152
|
-
children: [e === "customer" && /* @__PURE__ */
|
|
152
|
+
children: [e === "customer" && /* @__PURE__ */ x("div", {
|
|
153
153
|
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ x("div", {
|
|
155
155
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
156
|
-
children: [/* @__PURE__ */
|
|
156
|
+
children: [/* @__PURE__ */ b(f, {
|
|
157
157
|
variant: "body1",
|
|
158
158
|
className: "ttw:font-medium",
|
|
159
159
|
children: o.addressHeading
|
|
160
|
-
}), /* @__PURE__ */
|
|
160
|
+
}), /* @__PURE__ */ b(f, {
|
|
161
161
|
variant: "body2",
|
|
162
162
|
className: "ttw:text-muted-foreground",
|
|
163
163
|
children: o.customerAddressDescription
|
|
164
164
|
})]
|
|
165
|
-
}), r && /* @__PURE__ */
|
|
165
|
+
}), r && /* @__PURE__ */ x(t, {
|
|
166
166
|
type: "button",
|
|
167
167
|
variant: "ghost",
|
|
168
168
|
size: "sm",
|
|
169
169
|
onClick: s ? i : a,
|
|
170
|
-
children: [
|
|
170
|
+
children: [b(s ? T : E, { className: "ttw:size-4" }), s ? o.editAddressAction : o.addAddressAction]
|
|
171
171
|
})]
|
|
172
|
-
}), s ? /* @__PURE__ */
|
|
172
|
+
}), s ? /* @__PURE__ */ b("address", {
|
|
173
173
|
className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:not-italic ttw:text-sm",
|
|
174
|
-
children: n.map((e) => /* @__PURE__ */
|
|
175
|
-
}) : /* @__PURE__ */
|
|
174
|
+
children: n.map((e) => /* @__PURE__ */ b("span", { children: e }, e))
|
|
175
|
+
}) : /* @__PURE__ */ b(f, {
|
|
176
176
|
variant: "body2",
|
|
177
177
|
className: "ttw:text-muted-foreground",
|
|
178
178
|
children: o.noAddress
|
|
@@ -180,87 +180,87 @@ function N({ mode: e, addressLines: n, canEdit: r, onEditAddress: i, onAddAddres
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
function P({ paymentMethod: n, canEdit: r, onAddBankAccount: i, onEditBankAccount: a, onDeleteBankAccount: o, labels: s }) {
|
|
183
|
-
return /* @__PURE__ */
|
|
183
|
+
return /* @__PURE__ */ x("section", {
|
|
184
184
|
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:border-t ttw:pt-6",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
185
|
+
children: [/* @__PURE__ */ x("div", {
|
|
186
186
|
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ x("div", {
|
|
188
188
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ b(f, {
|
|
190
190
|
variant: "body1",
|
|
191
191
|
className: "ttw:font-medium",
|
|
192
192
|
children: s.paymentMethodsHeading
|
|
193
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ b(f, {
|
|
194
194
|
variant: "body2",
|
|
195
195
|
className: "ttw:text-muted-foreground",
|
|
196
196
|
children: s.paymentMethodsDescription
|
|
197
197
|
})]
|
|
198
|
-
}), r && !n && /* @__PURE__ */
|
|
198
|
+
}), r && !n && /* @__PURE__ */ x(t, {
|
|
199
199
|
type: "button",
|
|
200
200
|
variant: "ghost",
|
|
201
201
|
size: "sm",
|
|
202
202
|
onClick: i,
|
|
203
|
-
children: [/* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ b(E, { className: "ttw:size-4" }), s.addPaymentMethodAction]
|
|
204
204
|
})]
|
|
205
|
-
}), n ? /* @__PURE__ */
|
|
205
|
+
}), n ? /* @__PURE__ */ x("div", {
|
|
206
206
|
className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-md ttw:border ttw:p-4",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ x("div", {
|
|
208
208
|
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-3",
|
|
209
|
-
children: [/* @__PURE__ */
|
|
209
|
+
children: [/* @__PURE__ */ x("div", {
|
|
210
210
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ b(f, {
|
|
212
212
|
variant: "body2",
|
|
213
213
|
className: "ttw:font-medium",
|
|
214
214
|
children: n.title
|
|
215
|
-
}), n.isIncomplete && /* @__PURE__ */
|
|
215
|
+
}), n.isIncomplete && /* @__PURE__ */ b(e, {
|
|
216
216
|
variant: "outline",
|
|
217
217
|
children: s.incompletePaymentMethod
|
|
218
218
|
})]
|
|
219
|
-
}), r && /* @__PURE__ */
|
|
219
|
+
}), r && /* @__PURE__ */ x("div", {
|
|
220
220
|
className: "ttw:flex ttw:gap-1",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ b(t, {
|
|
222
222
|
type: "button",
|
|
223
223
|
variant: "ghost",
|
|
224
224
|
size: "icon-sm",
|
|
225
225
|
"aria-label": s.editPaymentMethodAction,
|
|
226
226
|
onClick: () => a?.(n.id),
|
|
227
|
-
children: /* @__PURE__ */
|
|
228
|
-
}), /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ b(T, { className: "ttw:size-4" })
|
|
228
|
+
}), /* @__PURE__ */ b(t, {
|
|
229
229
|
type: "button",
|
|
230
230
|
variant: "ghost",
|
|
231
231
|
size: "icon-sm",
|
|
232
232
|
"aria-label": s.deletePaymentMethodAction,
|
|
233
233
|
onClick: () => o?.(n.id),
|
|
234
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ b(D, { className: "ttw:size-4" })
|
|
235
235
|
})]
|
|
236
236
|
})]
|
|
237
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ x("div", {
|
|
238
238
|
className: "ttw:grid ttw:grid-cols-3 ttw:gap-3 ttw:text-sm",
|
|
239
239
|
children: [
|
|
240
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ x("div", {
|
|
241
241
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ b("span", {
|
|
243
243
|
className: "ttw:text-muted-foreground",
|
|
244
244
|
children: s.accountHolderLabel
|
|
245
|
-
}), /* @__PURE__ */
|
|
245
|
+
}), /* @__PURE__ */ b("span", { children: n.accountHolderLabel || O })]
|
|
246
246
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ x("div", {
|
|
248
248
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
249
|
+
children: [/* @__PURE__ */ b("span", {
|
|
250
250
|
className: "ttw:text-muted-foreground",
|
|
251
251
|
children: s.accountNumberLabel
|
|
252
|
-
}), /* @__PURE__ */
|
|
252
|
+
}), /* @__PURE__ */ b("span", { children: n.accountNumberLabel || O })]
|
|
253
253
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ x("div", {
|
|
255
255
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ b("span", {
|
|
257
257
|
className: "ttw:text-muted-foreground",
|
|
258
258
|
children: s.routingNumberLabel
|
|
259
|
-
}), /* @__PURE__ */
|
|
259
|
+
}), /* @__PURE__ */ b("span", { children: n.routingNumberLabel || O })]
|
|
260
260
|
})
|
|
261
261
|
]
|
|
262
262
|
})]
|
|
263
|
-
}) : /* @__PURE__ */
|
|
263
|
+
}) : /* @__PURE__ */ b(f, {
|
|
264
264
|
variant: "body2",
|
|
265
265
|
className: "ttw:text-muted-foreground",
|
|
266
266
|
children: s.noPaymentMethods
|
|
@@ -269,22 +269,22 @@ function P({ paymentMethod: n, canEdit: r, onAddBankAccount: i, onEditBankAccoun
|
|
|
269
269
|
}
|
|
270
270
|
function F({ mode: e, form: n }) {
|
|
271
271
|
let r = {
|
|
272
|
-
...
|
|
272
|
+
...m.fieldMarkers,
|
|
273
273
|
...n.labels?.fieldMarkers
|
|
274
|
-
}, i =
|
|
275
|
-
return /* @__PURE__ */
|
|
274
|
+
}, i = p(r, n.labels?.requiredFieldsLegend), a = n.labels?.cancelButton ?? m.cancelButton, s = n.labels?.saveButton ?? m.saveButton;
|
|
275
|
+
return /* @__PURE__ */ x("form", {
|
|
276
276
|
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:pt-5",
|
|
277
277
|
onSubmit: (e) => {
|
|
278
278
|
e.preventDefault(), n.onSubmit();
|
|
279
279
|
},
|
|
280
280
|
children: [
|
|
281
|
-
n.errors?.form && /* @__PURE__ */
|
|
281
|
+
n.errors?.form && /* @__PURE__ */ b(f, {
|
|
282
282
|
variant: "body2",
|
|
283
283
|
className: "ttw:text-destructive",
|
|
284
284
|
children: n.errors.form
|
|
285
285
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ b(o, { labels: i }),
|
|
287
|
+
/* @__PURE__ */ b(h, {
|
|
288
288
|
mode: "edit",
|
|
289
289
|
counterpartMode: e,
|
|
290
290
|
values: n.values,
|
|
@@ -295,15 +295,15 @@ function F({ mode: e, form: n }) {
|
|
|
295
295
|
onBankAccountChange: n.onBankAccountChange,
|
|
296
296
|
labels: n.labels
|
|
297
297
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ x("div", {
|
|
299
299
|
className: "ttw:flex ttw:justify-end ttw:gap-2 ttw:border-t ttw:pt-4",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ b(t, {
|
|
301
301
|
type: "button",
|
|
302
302
|
variant: "outline",
|
|
303
303
|
disabled: n.inProgress,
|
|
304
304
|
onClick: n.onCancel,
|
|
305
305
|
children: a
|
|
306
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ b(t, {
|
|
307
307
|
type: "submit",
|
|
308
308
|
disabled: n.inProgress || n.submitDisabled,
|
|
309
309
|
children: s
|
|
@@ -312,211 +312,213 @@ function F({ mode: e, form: n }) {
|
|
|
312
312
|
]
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
|
-
function I({ open: e, onOpenChange: o, privacyResetKey: s, mode:
|
|
316
|
-
let
|
|
317
|
-
...
|
|
318
|
-
...
|
|
319
|
-
}, [
|
|
320
|
-
s ??
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
].join(":"), Z = e && !!
|
|
324
|
-
|
|
315
|
+
function I({ open: e, onOpenChange: o, privacyResetKey: s, mode: d = "customer", counterpart: p, isLoading: m, isError: h, canEdit: E = !0, canDelete: k = !0, onEdit: I, onDelete: L, onClose: R, onEditAddress: z, onAddAddress: B, onAddBankAccount: V, onEditBankAccount: H, onDeleteBankAccount: U, onViewAllDocuments: W, onCreateDocument: G, editForm: K, labels: q }) {
|
|
316
|
+
let J = {
|
|
317
|
+
...g,
|
|
318
|
+
...q
|
|
319
|
+
}, [ae, Y] = v(null), X = [
|
|
320
|
+
s ?? p?.name ?? "",
|
|
321
|
+
p?.taxId ?? "",
|
|
322
|
+
p?.taxIdMasked ?? ""
|
|
323
|
+
].join(":"), Z = e && !!p?.taxId && ae === X;
|
|
324
|
+
_(() => {
|
|
325
325
|
e || Y(null);
|
|
326
326
|
}, [e]);
|
|
327
|
-
let Q =
|
|
328
|
-
return /* @__PURE__ */
|
|
327
|
+
let Q = d === "vendor", oe = Z ? p?.taxId ?? O : p?.taxIdMasked || p?.taxId || O, $ = p?.taxIdHelpText ?? (Q ? J.vendorTaxIdHelp : J.customerTaxIdHelp);
|
|
328
|
+
return /* @__PURE__ */ b(c, {
|
|
329
329
|
open: e,
|
|
330
330
|
onOpenChange: (e) => {
|
|
331
331
|
e || Y(null), o(e);
|
|
332
332
|
},
|
|
333
|
-
children: /* @__PURE__ */
|
|
333
|
+
children: /* @__PURE__ */ x(l, {
|
|
334
334
|
showCloseButton: !1,
|
|
335
335
|
className: "ttw:w-160 ttw:sm:max-w-160 ttw:gap-0 ttw:overflow-y-auto",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
336
|
+
children: [/* @__PURE__ */ x(te, {
|
|
337
337
|
className: "ttw:flex-row ttw:items-start ttw:justify-between ttw:gap-4 ttw:border-b ttw:px-6 ttw:py-6",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ x("div", {
|
|
339
339
|
className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ b(u, {
|
|
341
341
|
className: "ttw:truncate ttw:text-2xl",
|
|
342
|
-
children:
|
|
343
|
-
}), /* @__PURE__ */
|
|
344
|
-
}), /* @__PURE__ */
|
|
342
|
+
children: p?.name ?? J.loadingTitle
|
|
343
|
+
}), /* @__PURE__ */ b(ee, { children: p?.subtitle ?? J.hiddenDescription })]
|
|
344
|
+
}), /* @__PURE__ */ x("div", {
|
|
345
345
|
className: "ttw:flex ttw:gap-2",
|
|
346
|
-
children: [k &&
|
|
346
|
+
children: [k && p && /* @__PURE__ */ x(n, { children: [/* @__PURE__ */ b(a, {
|
|
347
347
|
asChild: !0,
|
|
348
|
-
children: /* @__PURE__ */
|
|
348
|
+
children: /* @__PURE__ */ b(t, {
|
|
349
349
|
type: "button",
|
|
350
350
|
variant: "outline",
|
|
351
351
|
size: "icon",
|
|
352
|
-
"aria-label":
|
|
353
|
-
children: /* @__PURE__ */
|
|
352
|
+
"aria-label": J.openActionsMenu,
|
|
353
|
+
children: /* @__PURE__ */ b(w, { className: "ttw:size-4" })
|
|
354
354
|
})
|
|
355
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ b(r, {
|
|
356
356
|
align: "end",
|
|
357
|
-
children: /* @__PURE__ */
|
|
357
|
+
children: /* @__PURE__ */ x(i, {
|
|
358
358
|
variant: "destructive",
|
|
359
359
|
onClick: L,
|
|
360
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ b(D, { className: "ttw:size-4" }), Q ? J.deleteVendorAction : J.deleteCustomerAction]
|
|
361
361
|
})
|
|
362
|
-
})] }), /* @__PURE__ */
|
|
362
|
+
})] }), /* @__PURE__ */ b(t, {
|
|
363
363
|
type: "button",
|
|
364
364
|
variant: "outline",
|
|
365
365
|
size: "icon",
|
|
366
|
-
"aria-label":
|
|
366
|
+
"aria-label": J.closeAction,
|
|
367
367
|
onClick: () => {
|
|
368
368
|
Y(null), R();
|
|
369
369
|
},
|
|
370
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ b(ie, { className: "ttw:size-4" })
|
|
371
371
|
})]
|
|
372
372
|
})]
|
|
373
|
-
}),
|
|
373
|
+
}), h ? /* @__PURE__ */ b("div", {
|
|
374
374
|
className: "ttw:p-6",
|
|
375
|
-
children: /* @__PURE__ */
|
|
376
|
-
title:
|
|
377
|
-
description:
|
|
375
|
+
children: /* @__PURE__ */ b(re, {
|
|
376
|
+
title: J.errorTitle,
|
|
377
|
+
description: J.errorDescription
|
|
378
378
|
})
|
|
379
|
-
}) :
|
|
379
|
+
}) : m || !p ? /* @__PURE__ */ b("div", {
|
|
380
380
|
className: "ttw:p-6",
|
|
381
|
-
children: /* @__PURE__ */
|
|
382
|
-
}) : /* @__PURE__ */
|
|
381
|
+
children: /* @__PURE__ */ b(ne, { title: J.loadingTitle })
|
|
382
|
+
}) : /* @__PURE__ */ x("main", {
|
|
383
383
|
className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:p-6",
|
|
384
384
|
children: [
|
|
385
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ x("div", {
|
|
386
386
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
388
|
-
mode:
|
|
389
|
-
summary:
|
|
390
|
-
labels:
|
|
391
|
-
}), /* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ b(j, {
|
|
388
|
+
mode: d,
|
|
389
|
+
summary: p.summary,
|
|
390
|
+
labels: J
|
|
391
|
+
}), /* @__PURE__ */ b(t, {
|
|
392
|
+
type: "button",
|
|
392
393
|
className: "ttw:w-fit",
|
|
393
|
-
disabled: !
|
|
394
|
-
|
|
394
|
+
disabled: !G,
|
|
395
|
+
onClick: G,
|
|
396
|
+
children: Q ? J.sendPaymentAction : J.issueInvoiceAction
|
|
395
397
|
})]
|
|
396
398
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
mode:
|
|
399
|
-
documents:
|
|
400
|
-
labels:
|
|
399
|
+
/* @__PURE__ */ b(M, {
|
|
400
|
+
mode: d,
|
|
401
|
+
documents: p.recentDocuments,
|
|
402
|
+
labels: J,
|
|
401
403
|
onViewAll: W
|
|
402
404
|
}),
|
|
403
|
-
|
|
405
|
+
K ? /* @__PURE__ */ x("section", {
|
|
404
406
|
className: "ttw:flex ttw:flex-col",
|
|
405
|
-
children: [/* @__PURE__ */
|
|
407
|
+
children: [/* @__PURE__ */ x("div", {
|
|
406
408
|
className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:border-b ttw:pb-5",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ b(f, {
|
|
408
410
|
variant: "body1",
|
|
409
411
|
className: "ttw:font-medium",
|
|
410
|
-
children: Q ?
|
|
411
|
-
}), /* @__PURE__ */
|
|
412
|
+
children: Q ? J.vendorDetailsHeading : J.customerDetailsHeading
|
|
413
|
+
}), /* @__PURE__ */ b(f, {
|
|
412
414
|
variant: "body2",
|
|
413
415
|
className: "ttw:text-muted-foreground",
|
|
414
|
-
children: Q ?
|
|
416
|
+
children: Q ? J.vendorDetailsDescription : J.customerDetailsDescription
|
|
415
417
|
})]
|
|
416
|
-
}), /* @__PURE__ */
|
|
417
|
-
mode:
|
|
418
|
-
form:
|
|
418
|
+
}), /* @__PURE__ */ b(F, {
|
|
419
|
+
mode: d,
|
|
420
|
+
form: K
|
|
419
421
|
})]
|
|
420
|
-
}) : /* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
+
}) : /* @__PURE__ */ x(y, { children: [
|
|
423
|
+
/* @__PURE__ */ x("section", {
|
|
422
424
|
className: "ttw:flex ttw:flex-col",
|
|
423
425
|
children: [
|
|
424
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ x("div", {
|
|
425
427
|
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3 ttw:border-b ttw:pb-5",
|
|
426
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ x("div", {
|
|
427
429
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ b(f, {
|
|
429
431
|
variant: "body1",
|
|
430
432
|
className: "ttw:font-medium",
|
|
431
|
-
children: Q ?
|
|
432
|
-
}), /* @__PURE__ */
|
|
433
|
+
children: Q ? J.vendorDetailsHeading : J.customerDetailsHeading
|
|
434
|
+
}), /* @__PURE__ */ b(f, {
|
|
433
435
|
variant: "body2",
|
|
434
436
|
className: "ttw:text-muted-foreground",
|
|
435
|
-
children: Q ?
|
|
437
|
+
children: Q ? J.vendorDetailsDescription : J.customerDetailsDescription
|
|
436
438
|
})]
|
|
437
|
-
}), E && /* @__PURE__ */
|
|
439
|
+
}), E && /* @__PURE__ */ x(t, {
|
|
438
440
|
type: "button",
|
|
439
441
|
variant: "ghost",
|
|
440
442
|
size: "sm",
|
|
441
443
|
onClick: I,
|
|
442
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ b(T, { className: "ttw:size-4" }), J.editButton]
|
|
443
445
|
})]
|
|
444
446
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
label:
|
|
447
|
-
children:
|
|
447
|
+
/* @__PURE__ */ b(A, {
|
|
448
|
+
label: J.rowType,
|
|
449
|
+
children: p.entityTypeLabel ?? O
|
|
448
450
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
label:
|
|
451
|
-
children:
|
|
451
|
+
/* @__PURE__ */ b(A, {
|
|
452
|
+
label: J.rowName,
|
|
453
|
+
children: p.name
|
|
452
454
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
label:
|
|
455
|
-
children:
|
|
455
|
+
/* @__PURE__ */ b(A, {
|
|
456
|
+
label: J.rowEmail,
|
|
457
|
+
children: p.email || O
|
|
456
458
|
}),
|
|
457
|
-
!Q && /* @__PURE__ */
|
|
458
|
-
label:
|
|
459
|
-
children:
|
|
459
|
+
!Q && /* @__PURE__ */ b(A, {
|
|
460
|
+
label: J.rowPaymentReminders,
|
|
461
|
+
children: p.remindersLabel ?? O
|
|
460
462
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
label:
|
|
463
|
-
children:
|
|
463
|
+
/* @__PURE__ */ b(A, {
|
|
464
|
+
label: J.rowPhone,
|
|
465
|
+
children: p.phone || O
|
|
464
466
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
label:
|
|
467
|
+
/* @__PURE__ */ b(A, {
|
|
468
|
+
label: p.entityType === "individual" ? J.rowTaxIdSsn : J.rowTaxIdEin,
|
|
467
469
|
isLast: !Q,
|
|
468
|
-
children: /* @__PURE__ */
|
|
470
|
+
children: /* @__PURE__ */ x("div", {
|
|
469
471
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
470
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ x("div", {
|
|
471
473
|
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
472
|
-
children: [/* @__PURE__ */
|
|
474
|
+
children: [/* @__PURE__ */ b("span", {
|
|
473
475
|
className: "ttw:font-medium",
|
|
474
|
-
children:
|
|
475
|
-
}),
|
|
476
|
+
children: oe
|
|
477
|
+
}), p.taxId && /* @__PURE__ */ x(t, {
|
|
476
478
|
type: "button",
|
|
477
479
|
variant: "outline",
|
|
478
480
|
size: "sm",
|
|
479
481
|
onClick: () => {
|
|
480
482
|
Y((e) => e === X ? null : X);
|
|
481
483
|
},
|
|
482
|
-
children: [
|
|
484
|
+
children: [b(Z ? C : S, { className: "ttw:size-4" }), Z ? J.hideTaxId : J.showTaxId]
|
|
483
485
|
})]
|
|
484
|
-
}), $ && /* @__PURE__ */
|
|
486
|
+
}), $ && /* @__PURE__ */ b(f, {
|
|
485
487
|
variant: "body2",
|
|
486
488
|
className: "ttw:text-muted-foreground",
|
|
487
489
|
children: $
|
|
488
490
|
})]
|
|
489
491
|
})
|
|
490
492
|
}),
|
|
491
|
-
Q && /* @__PURE__ */
|
|
492
|
-
label:
|
|
493
|
+
Q && /* @__PURE__ */ b(A, {
|
|
494
|
+
label: J.addressHeading,
|
|
493
495
|
isLast: !0,
|
|
494
|
-
children: /* @__PURE__ */
|
|
495
|
-
mode:
|
|
496
|
-
addressLines:
|
|
496
|
+
children: /* @__PURE__ */ b(N, {
|
|
497
|
+
mode: d,
|
|
498
|
+
addressLines: p.addressLines,
|
|
497
499
|
canEdit: E,
|
|
498
500
|
onEditAddress: z,
|
|
499
501
|
onAddAddress: B,
|
|
500
|
-
labels:
|
|
502
|
+
labels: J
|
|
501
503
|
})
|
|
502
504
|
})
|
|
503
505
|
]
|
|
504
506
|
}),
|
|
505
|
-
!Q && /* @__PURE__ */
|
|
506
|
-
mode:
|
|
507
|
-
addressLines:
|
|
507
|
+
!Q && /* @__PURE__ */ b(N, {
|
|
508
|
+
mode: d,
|
|
509
|
+
addressLines: p.addressLines,
|
|
508
510
|
canEdit: E,
|
|
509
511
|
onEditAddress: z,
|
|
510
512
|
onAddAddress: B,
|
|
511
|
-
labels:
|
|
513
|
+
labels: J
|
|
512
514
|
}),
|
|
513
|
-
Q && /* @__PURE__ */
|
|
514
|
-
paymentMethod:
|
|
515
|
+
Q && /* @__PURE__ */ b(P, {
|
|
516
|
+
paymentMethod: p.paymentMethod,
|
|
515
517
|
canEdit: E,
|
|
516
518
|
onAddBankAccount: V,
|
|
517
519
|
onEditBankAccount: H,
|
|
518
520
|
onDeleteBankAccount: U,
|
|
519
|
-
labels:
|
|
521
|
+
labels: J
|
|
520
522
|
})
|
|
521
523
|
] })
|
|
522
524
|
]
|