@tesouro/embedded-components-react 0.7.26 → 0.7.29
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/dist/index.d.ts +1 -12
- package/dist/lib/CounterpartsWidget.d.ts +1 -12
- package/dist/lib/CounterpartsWidgetPublic.d.ts +1 -12
- package/dist/lib/CustomersWidget.d.ts +0 -2
- package/dist/lib/ReceivablesWidget.d.ts +0 -2
- package/dist/lib/monite-sdk.d.ts +224 -236
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +59 -38
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +137 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +86 -182
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +116 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +51 -108
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useRebaseOnRefresh.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +40 -39
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +2 -65
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +37 -181
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +193 -502
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +520 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index143.js +9 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index20.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index286.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index53.js +1 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +31 -55
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +98 -163
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +37 -32
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +86 -93
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +42 -173
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +3 -12
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +117 -125
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a, Separator as o, Sheet as s, SheetContent as c, SheetDescription as l, SheetHeader as u, SheetTitle as d, Skeleton as f, Spinner as ee, Typography as p, cn as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { COUNTERPART_DETAILS_SHEET_LABELS_EN as h } from "./index2.js";
|
|
3
|
+
import { CounterpartAddressForm as g } from "./index5.js";
|
|
4
|
+
import { CounterpartEditForm as te } from "./index6.js";
|
|
5
|
+
import { useEffect as ne, useState as re } from "react";
|
|
6
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
7
|
+
import { EyeIcon as ie, EyeOffIcon as ae, MoreVerticalIcon as oe, PencilIcon as b, PlusIcon as x, SearchXIcon as se, Trash2Icon as S, XIcon as ce } from "lucide-react";
|
|
8
|
+
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js
|
|
9
|
+
var C = "-", w = {
|
|
10
|
+
billNeutral: "ttw:border-border ttw:bg-muted ttw:text-foreground ttw:hover:bg-muted",
|
|
11
|
+
billAccent: "ttw:border-violet-100 ttw:bg-violet-100 ttw:text-violet-700 ttw:hover:bg-violet-100",
|
|
12
|
+
billInfo: "ttw:border-blue-100 ttw:bg-blue-100 ttw:text-blue-700 ttw:hover:bg-blue-100",
|
|
13
|
+
billSuccess: "ttw:border-green-100 ttw:bg-green-100 ttw:text-green-700 ttw:hover:bg-green-100",
|
|
14
|
+
billSettled: "ttw:border-border ttw:bg-background ttw:text-green-900 ttw:hover:bg-background",
|
|
15
|
+
billDanger: "ttw:border-destructive/20 ttw:bg-destructive/20 ttw:text-destructive ttw:hover:bg-destructive/20",
|
|
16
|
+
invoiceNeutral: "ttw:border-transparent ttw:bg-muted ttw:text-muted-foreground",
|
|
17
|
+
invoiceCyan: "ttw:border-transparent ttw:bg-cyan-100 ttw:text-cyan-700",
|
|
18
|
+
invoiceSuccess: "ttw:border-transparent ttw:bg-green-100 ttw:text-green-700",
|
|
19
|
+
invoicePurple: "ttw:border-transparent ttw:bg-purple-100 ttw:text-purple-700",
|
|
20
|
+
invoiceOrange: "ttw:border-transparent ttw:bg-orange-100 ttw:text-orange-700",
|
|
21
|
+
invoiceDanger: "ttw:border-transparent ttw:bg-destructive/10 ttw:text-destructive"
|
|
22
|
+
};
|
|
23
|
+
function T({ label: t, tone: n }) {
|
|
24
|
+
return /* @__PURE__ */ v(e, {
|
|
25
|
+
variant: "outline",
|
|
26
|
+
className: w[n],
|
|
27
|
+
children: t
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function E({ className: e }) {
|
|
31
|
+
return /* @__PURE__ */ v(f, { className: e ?? "ttw:h-5 ttw:w-24" });
|
|
32
|
+
}
|
|
33
|
+
function D({ label: e, children: t, isLast: n }) {
|
|
34
|
+
return /* @__PURE__ */ y("div", {
|
|
35
|
+
className: ["ttw:grid ttw:grid-cols-[180px_1fr] ttw:gap-4 ttw:py-3", n ? "" : "ttw:border-b ttw:border-border"].join(" "),
|
|
36
|
+
children: [/* @__PURE__ */ v(p, {
|
|
37
|
+
variant: "body2",
|
|
38
|
+
className: "ttw:text-muted-foreground",
|
|
39
|
+
children: e
|
|
40
|
+
}), /* @__PURE__ */ v("div", {
|
|
41
|
+
className: "ttw:min-w-0 ttw:text-sm",
|
|
42
|
+
children: t
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function O({ mode: e, summary: t, labels: n }) {
|
|
47
|
+
let r = e === "customer" ? n.summaryReceived : n.summaryPaid;
|
|
48
|
+
return /* @__PURE__ */ y("div", {
|
|
49
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-md ttw:bg-muted ttw:p-5",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ v(p, {
|
|
52
|
+
variant: "body2",
|
|
53
|
+
className: "ttw:text-muted-foreground",
|
|
54
|
+
children: e === "customer" ? n.summaryAmountDue : n.summaryBalanceDue
|
|
55
|
+
}),
|
|
56
|
+
t?.isPrimaryAmountLoading ? /* @__PURE__ */ v(E, { className: "ttw:h-9 ttw:w-36" }) : /* @__PURE__ */ v("p", {
|
|
57
|
+
className: "ttw:text-[2rem] ttw:leading-tight ttw:font-semibold ttw:tracking-tight",
|
|
58
|
+
children: t?.primaryAmountLabel ?? C
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ y("div", {
|
|
61
|
+
className: "ttw:flex ttw:gap-8",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ y("div", {
|
|
64
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
65
|
+
children: [/* @__PURE__ */ v(p, {
|
|
66
|
+
variant: "caption",
|
|
67
|
+
className: "ttw:text-muted-foreground",
|
|
68
|
+
children: n.summaryBilled
|
|
69
|
+
}), t?.isBilledAmountLoading ? /* @__PURE__ */ v(E, {}) : /* @__PURE__ */ v(p, {
|
|
70
|
+
variant: "body1",
|
|
71
|
+
className: "ttw:font-semibold",
|
|
72
|
+
children: t?.billedAmountLabel ?? C
|
|
73
|
+
})]
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ y("div", {
|
|
76
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
77
|
+
children: [/* @__PURE__ */ v(p, {
|
|
78
|
+
variant: "caption",
|
|
79
|
+
className: "ttw:text-muted-foreground",
|
|
80
|
+
children: r
|
|
81
|
+
}), t?.isReceivedOrPaidAmountLoading ? /* @__PURE__ */ v(E, {}) : /* @__PURE__ */ v(p, {
|
|
82
|
+
variant: "body1",
|
|
83
|
+
className: "ttw:font-semibold ttw:text-green-600",
|
|
84
|
+
children: t?.receivedOrPaidAmountLabel ?? C
|
|
85
|
+
})]
|
|
86
|
+
}),
|
|
87
|
+
e === "vendor" && /* @__PURE__ */ y("div", {
|
|
88
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
89
|
+
children: [/* @__PURE__ */ v(p, {
|
|
90
|
+
variant: "caption",
|
|
91
|
+
className: "ttw:text-muted-foreground",
|
|
92
|
+
children: n.summaryRejected
|
|
93
|
+
}), t?.isRejectedAmountLoading ? /* @__PURE__ */ v(E, {}) : /* @__PURE__ */ v(p, {
|
|
94
|
+
variant: "body1",
|
|
95
|
+
className: "ttw:font-semibold",
|
|
96
|
+
children: t?.rejectedAmountLabel ?? C
|
|
97
|
+
})]
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function le({ mode: e, documents: n, labels: r, onViewAll: i }) {
|
|
105
|
+
if (!n || n.length === 0) return null;
|
|
106
|
+
let a = e === "vendor";
|
|
107
|
+
return /* @__PURE__ */ y("section", {
|
|
108
|
+
className: "ttw:flex ttw:flex-col ttw:border-t ttw:border-border ttw:pt-6",
|
|
109
|
+
children: [/* @__PURE__ */ y("div", {
|
|
110
|
+
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4 ttw:pb-5",
|
|
111
|
+
children: [/* @__PURE__ */ y("div", {
|
|
112
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
113
|
+
children: [/* @__PURE__ */ v(p, {
|
|
114
|
+
variant: "body1",
|
|
115
|
+
className: "ttw:font-medium",
|
|
116
|
+
children: e === "customer" ? r.recentCustomerDocumentsHeading : r.recentVendorDocumentsHeading
|
|
117
|
+
}), /* @__PURE__ */ v(p, {
|
|
118
|
+
variant: "body2",
|
|
119
|
+
className: "ttw:text-muted-foreground",
|
|
120
|
+
children: e === "customer" ? r.recentCustomerDocumentsDescription : r.recentVendorDocumentsDescription
|
|
121
|
+
})]
|
|
122
|
+
}), i && /* @__PURE__ */ v(t, {
|
|
123
|
+
variant: "link",
|
|
124
|
+
className: "ttw:h-auto ttw:p-0",
|
|
125
|
+
onClick: i,
|
|
126
|
+
children: r.viewAllDocumentsAction
|
|
127
|
+
})]
|
|
128
|
+
}), /* @__PURE__ */ v("div", {
|
|
129
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-md ttw:border ttw:border-border ttw:p-4",
|
|
130
|
+
children: n.map((e, t) => {
|
|
131
|
+
let i = a && e.isOverdue;
|
|
132
|
+
return /* @__PURE__ */ y("div", {
|
|
133
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
134
|
+
children: [/* @__PURE__ */ y("div", {
|
|
135
|
+
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
|
|
136
|
+
children: [/* @__PURE__ */ y("div", {
|
|
137
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
138
|
+
children: [/* @__PURE__ */ v(p, {
|
|
139
|
+
variant: "h6",
|
|
140
|
+
className: "ttw:font-medium",
|
|
141
|
+
children: e.amountLabel
|
|
142
|
+
}), /* @__PURE__ */ v(p, {
|
|
143
|
+
variant: "body2",
|
|
144
|
+
className: i ? "ttw:text-destructive" : "ttw:text-muted-foreground",
|
|
145
|
+
children: e.dateLabel
|
|
146
|
+
})]
|
|
147
|
+
}), /* @__PURE__ */ y("div", {
|
|
148
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
149
|
+
children: [i && /* @__PURE__ */ v(T, {
|
|
150
|
+
label: r.overdueTag,
|
|
151
|
+
tone: "billDanger"
|
|
152
|
+
}), /* @__PURE__ */ v(T, {
|
|
153
|
+
label: e.statusLabel,
|
|
154
|
+
tone: e.statusTone
|
|
155
|
+
})]
|
|
156
|
+
})]
|
|
157
|
+
}), t < n.length - 1 && /* @__PURE__ */ v(o, {})]
|
|
158
|
+
}, e.id);
|
|
159
|
+
})
|
|
160
|
+
})]
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function k({ mode: e, addressLines: n, canEdit: r, onEditAddress: i, onAddAddress: a, labels: o, addressForm: s }) {
|
|
164
|
+
let c = n.length > 0;
|
|
165
|
+
return /* @__PURE__ */ y("section", {
|
|
166
|
+
className: e === "customer" ? "ttw:flex ttw:flex-col ttw:gap-3" : "ttw:flex ttw:flex-col",
|
|
167
|
+
children: [e === "customer" && !s && /* @__PURE__ */ y("div", {
|
|
168
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
|
|
169
|
+
children: [
|
|
170
|
+
/* @__PURE__ */ y(p, {
|
|
171
|
+
variant: "body1",
|
|
172
|
+
className: "ttw:font-medium",
|
|
173
|
+
children: [
|
|
174
|
+
o.customerAddressHeading,
|
|
175
|
+
" ",
|
|
176
|
+
/* @__PURE__ */ v("span", {
|
|
177
|
+
className: "ttw:text-muted-foreground",
|
|
178
|
+
children: o.optionalSuffix
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
}),
|
|
182
|
+
r && c && /* @__PURE__ */ v(t, {
|
|
183
|
+
type: "button",
|
|
184
|
+
variant: "link",
|
|
185
|
+
className: "ttw:h-auto ttw:p-0",
|
|
186
|
+
"aria-label": o.editAddressAction,
|
|
187
|
+
onClick: i,
|
|
188
|
+
children: o.editButton
|
|
189
|
+
}),
|
|
190
|
+
r && !c && /* @__PURE__ */ y(t, {
|
|
191
|
+
type: "button",
|
|
192
|
+
variant: "link",
|
|
193
|
+
className: "ttw:h-auto ttw:p-0",
|
|
194
|
+
onClick: a,
|
|
195
|
+
children: [/* @__PURE__ */ v(x, { className: "ttw:size-4" }), o.addAddressAction]
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
}), s ? /* @__PURE__ */ v(g, {
|
|
199
|
+
form: s,
|
|
200
|
+
labels: o
|
|
201
|
+
}) : c ? /* @__PURE__ */ v("address", {
|
|
202
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:not-italic ttw:text-sm",
|
|
203
|
+
children: n.map((e) => /* @__PURE__ */ v("span", { children: e }, e))
|
|
204
|
+
}) : /* @__PURE__ */ v(p, {
|
|
205
|
+
variant: "body2",
|
|
206
|
+
className: "ttw:text-muted-foreground",
|
|
207
|
+
children: o.noAddress
|
|
208
|
+
})]
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function ue({ paymentMethod: n, canEdit: r, onAddBankAccount: i, onEditBankAccount: a, onDeleteBankAccount: o, labels: s }) {
|
|
212
|
+
return /* @__PURE__ */ y("section", {
|
|
213
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:border-t ttw:border-border ttw:pt-6",
|
|
214
|
+
children: [/* @__PURE__ */ y("div", {
|
|
215
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
|
|
216
|
+
children: [/* @__PURE__ */ y("div", {
|
|
217
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
218
|
+
children: [/* @__PURE__ */ v(p, {
|
|
219
|
+
variant: "body1",
|
|
220
|
+
className: "ttw:font-medium",
|
|
221
|
+
children: s.paymentMethodsHeading
|
|
222
|
+
}), /* @__PURE__ */ v(p, {
|
|
223
|
+
variant: "body2",
|
|
224
|
+
className: "ttw:text-muted-foreground",
|
|
225
|
+
children: s.paymentMethodsDescription
|
|
226
|
+
})]
|
|
227
|
+
}), r && !n && /* @__PURE__ */ y(t, {
|
|
228
|
+
type: "button",
|
|
229
|
+
variant: "ghost",
|
|
230
|
+
size: "sm",
|
|
231
|
+
onClick: i,
|
|
232
|
+
children: [/* @__PURE__ */ v(x, { className: "ttw:size-4" }), s.addPaymentMethodAction]
|
|
233
|
+
})]
|
|
234
|
+
}), n ? /* @__PURE__ */ y("div", {
|
|
235
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-md ttw:border ttw:border-border ttw:p-4",
|
|
236
|
+
children: [/* @__PURE__ */ y("div", {
|
|
237
|
+
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-3",
|
|
238
|
+
children: [/* @__PURE__ */ y("div", {
|
|
239
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
240
|
+
children: [/* @__PURE__ */ v(p, {
|
|
241
|
+
variant: "body2",
|
|
242
|
+
className: "ttw:font-medium",
|
|
243
|
+
children: n.title
|
|
244
|
+
}), n.isIncomplete && /* @__PURE__ */ v(e, {
|
|
245
|
+
variant: "outline",
|
|
246
|
+
children: s.incompletePaymentMethod
|
|
247
|
+
})]
|
|
248
|
+
}), r && /* @__PURE__ */ y("div", {
|
|
249
|
+
className: "ttw:flex ttw:gap-1",
|
|
250
|
+
children: [/* @__PURE__ */ v(t, {
|
|
251
|
+
type: "button",
|
|
252
|
+
variant: "ghost",
|
|
253
|
+
size: "icon-sm",
|
|
254
|
+
"aria-label": s.editPaymentMethodAction,
|
|
255
|
+
onClick: () => a?.(n.id),
|
|
256
|
+
children: /* @__PURE__ */ v(b, { className: "ttw:size-4" })
|
|
257
|
+
}), /* @__PURE__ */ v(t, {
|
|
258
|
+
type: "button",
|
|
259
|
+
variant: "ghost",
|
|
260
|
+
size: "icon-sm",
|
|
261
|
+
"aria-label": s.deletePaymentMethodAction,
|
|
262
|
+
onClick: () => o?.(n.id),
|
|
263
|
+
children: /* @__PURE__ */ v(S, { className: "ttw:size-4" })
|
|
264
|
+
})]
|
|
265
|
+
})]
|
|
266
|
+
}), /* @__PURE__ */ y("div", {
|
|
267
|
+
className: "ttw:grid ttw:grid-cols-3 ttw:gap-3 ttw:text-sm",
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ y("div", {
|
|
270
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
271
|
+
children: [/* @__PURE__ */ v("span", {
|
|
272
|
+
className: "ttw:text-muted-foreground",
|
|
273
|
+
children: s.accountHolderLabel
|
|
274
|
+
}), /* @__PURE__ */ v("span", { children: n.accountHolderLabel || C })]
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ y("div", {
|
|
277
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
278
|
+
children: [/* @__PURE__ */ v("span", {
|
|
279
|
+
className: "ttw:text-muted-foreground",
|
|
280
|
+
children: s.accountNumberLabel
|
|
281
|
+
}), /* @__PURE__ */ v("span", { children: n.accountNumberLabel || C })]
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ y("div", {
|
|
284
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
285
|
+
children: [/* @__PURE__ */ v("span", {
|
|
286
|
+
className: "ttw:text-muted-foreground",
|
|
287
|
+
children: s.routingNumberLabel
|
|
288
|
+
}), /* @__PURE__ */ v("span", { children: n.routingNumberLabel || C })]
|
|
289
|
+
})
|
|
290
|
+
]
|
|
291
|
+
})]
|
|
292
|
+
}) : /* @__PURE__ */ v(p, {
|
|
293
|
+
variant: "body2",
|
|
294
|
+
className: "ttw:text-muted-foreground",
|
|
295
|
+
children: s.noPaymentMethods
|
|
296
|
+
})]
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
function A({ open: e, onOpenChange: o, privacyResetKey: g, mode: b = "customer", counterpart: x, isLoading: w, isError: T, canEdit: E = !0, canEditProfile: A = E, canEditAddress: j = E, canEditPaymentMethod: M = E, canDelete: N = !0, onEdit: P, onDelete: F, onClose: I, onEditAddress: L, onAddAddress: R, onAddBankAccount: z, onEditBankAccount: B, onDeleteBankAccount: V, onViewAllDocuments: H, onCreateDocument: U, editForm: W, addressForm: G, labels: de }) {
|
|
300
|
+
let K = {
|
|
301
|
+
...h,
|
|
302
|
+
...de
|
|
303
|
+
}, [fe, q] = re(null), J = [
|
|
304
|
+
g ?? x?.name ?? "",
|
|
305
|
+
x?.taxId ?? "",
|
|
306
|
+
x?.taxIdMasked ?? ""
|
|
307
|
+
].join(":"), Y = e && !!x?.taxId && fe === J;
|
|
308
|
+
ne(() => {
|
|
309
|
+
e || q(null);
|
|
310
|
+
}, [e]);
|
|
311
|
+
let X = b === "vendor", pe = Y ? x?.taxId ?? C : x?.taxIdMasked || x?.taxId || C, Z = x?.taxIdHelpText ?? (X ? K.vendorTaxIdHelp : K.customerTaxIdHelp), Q = (e) => {
|
|
312
|
+
e || q(null), o(e);
|
|
313
|
+
};
|
|
314
|
+
if (T) return /* @__PURE__ */ v(s, {
|
|
315
|
+
open: e,
|
|
316
|
+
onOpenChange: Q,
|
|
317
|
+
children: /* @__PURE__ */ v(c, {
|
|
318
|
+
className: "ttw:w-160 ttw:sm:max-w-160 ttw:gap-0",
|
|
319
|
+
children: /* @__PURE__ */ y("div", {
|
|
320
|
+
className: "ttw:m-auto ttw:flex ttw:w-3/4 ttw:flex-col ttw:items-center ttw:gap-4 ttw:p-4",
|
|
321
|
+
children: [/* @__PURE__ */ v(se, { className: "ttw:size-8 ttw:text-destructive" }), /* @__PURE__ */ y("div", {
|
|
322
|
+
className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-2",
|
|
323
|
+
children: [/* @__PURE__ */ v(d, {
|
|
324
|
+
className: "ttw:text-xl ttw:font-semibold ttw:tracking-tight",
|
|
325
|
+
children: X ? K.notFoundVendorTitle : K.notFoundCustomerTitle
|
|
326
|
+
}), /* @__PURE__ */ v(l, {
|
|
327
|
+
className: "ttw:text-center ttw:text-base ttw:text-foreground",
|
|
328
|
+
children: X ? K.notFoundVendorDescription : K.notFoundCustomerDescription
|
|
329
|
+
})]
|
|
330
|
+
})]
|
|
331
|
+
})
|
|
332
|
+
})
|
|
333
|
+
});
|
|
334
|
+
let $ = w || !x;
|
|
335
|
+
return /* @__PURE__ */ v(s, {
|
|
336
|
+
open: e,
|
|
337
|
+
onOpenChange: Q,
|
|
338
|
+
children: /* @__PURE__ */ y(c, {
|
|
339
|
+
showCloseButton: !1,
|
|
340
|
+
className: "ttw:w-160 ttw:sm:max-w-160 ttw:gap-0 ttw:overflow-y-auto",
|
|
341
|
+
children: [/* @__PURE__ */ y(u, {
|
|
342
|
+
className: "ttw:flex-row ttw:items-start ttw:justify-between ttw:gap-4 ttw:border-b ttw:border-border ttw:px-6 ttw:py-6",
|
|
343
|
+
children: [/* @__PURE__ */ v("div", {
|
|
344
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
|
|
345
|
+
children: $ ? /* @__PURE__ */ y(_, { children: [
|
|
346
|
+
/* @__PURE__ */ v(d, {
|
|
347
|
+
className: "ttw:sr-only",
|
|
348
|
+
children: K.loadingTitle
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ v(f, { className: "ttw:h-8 ttw:w-40" }),
|
|
351
|
+
/* @__PURE__ */ v(l, {
|
|
352
|
+
className: "ttw:sr-only",
|
|
353
|
+
children: K.hiddenDescription
|
|
354
|
+
}),
|
|
355
|
+
/* @__PURE__ */ v(f, { className: "ttw:h-5 ttw:w-60" })
|
|
356
|
+
] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(d, {
|
|
357
|
+
className: "ttw:truncate ttw:text-2xl",
|
|
358
|
+
children: x.name
|
|
359
|
+
}), /* @__PURE__ */ v(l, { children: x.subtitle ?? K.hiddenDescription })] })
|
|
360
|
+
}), /* @__PURE__ */ y("div", {
|
|
361
|
+
className: "ttw:flex ttw:gap-2",
|
|
362
|
+
children: [N && x && /* @__PURE__ */ y(n, { children: [/* @__PURE__ */ v(a, {
|
|
363
|
+
asChild: !0,
|
|
364
|
+
children: /* @__PURE__ */ v(t, {
|
|
365
|
+
type: "button",
|
|
366
|
+
variant: "outline",
|
|
367
|
+
size: "icon",
|
|
368
|
+
"aria-label": K.openActionsMenu,
|
|
369
|
+
children: /* @__PURE__ */ v(oe, { className: "ttw:size-4" })
|
|
370
|
+
})
|
|
371
|
+
}), /* @__PURE__ */ v(r, {
|
|
372
|
+
align: "end",
|
|
373
|
+
children: /* @__PURE__ */ y(i, {
|
|
374
|
+
variant: "destructive",
|
|
375
|
+
onClick: F,
|
|
376
|
+
children: [/* @__PURE__ */ v(S, { className: "ttw:size-4" }), X ? K.deleteVendorAction : K.deleteCustomerAction]
|
|
377
|
+
})
|
|
378
|
+
})] }), /* @__PURE__ */ v(t, {
|
|
379
|
+
type: "button",
|
|
380
|
+
variant: "outline",
|
|
381
|
+
size: "icon",
|
|
382
|
+
"aria-label": K.closeAction,
|
|
383
|
+
onClick: () => {
|
|
384
|
+
q(null), I();
|
|
385
|
+
},
|
|
386
|
+
children: /* @__PURE__ */ v(ce, { className: "ttw:size-4" })
|
|
387
|
+
})]
|
|
388
|
+
})]
|
|
389
|
+
}), $ ? /* @__PURE__ */ v("div", {
|
|
390
|
+
className: "ttw:flex ttw:flex-1 ttw:items-center ttw:justify-center ttw:p-6",
|
|
391
|
+
children: /* @__PURE__ */ v(ee, {})
|
|
392
|
+
}) : /* @__PURE__ */ y("main", {
|
|
393
|
+
className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:p-6",
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ y("div", {
|
|
396
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
397
|
+
children: [/* @__PURE__ */ v(O, {
|
|
398
|
+
mode: b,
|
|
399
|
+
summary: x.summary,
|
|
400
|
+
labels: K
|
|
401
|
+
}), U && /* @__PURE__ */ v(t, {
|
|
402
|
+
type: "button",
|
|
403
|
+
className: "ttw:w-fit",
|
|
404
|
+
onClick: U,
|
|
405
|
+
children: X ? K.sendPaymentAction : K.issueInvoiceAction
|
|
406
|
+
})]
|
|
407
|
+
}),
|
|
408
|
+
/* @__PURE__ */ v(le, {
|
|
409
|
+
mode: b,
|
|
410
|
+
documents: x.recentDocuments,
|
|
411
|
+
labels: K,
|
|
412
|
+
onViewAll: H
|
|
413
|
+
}),
|
|
414
|
+
/* @__PURE__ */ y("section", {
|
|
415
|
+
className: "ttw:flex ttw:flex-col",
|
|
416
|
+
children: [/* @__PURE__ */ y("div", {
|
|
417
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3 ttw:pb-5",
|
|
418
|
+
children: [/* @__PURE__ */ v(p, {
|
|
419
|
+
variant: "body1",
|
|
420
|
+
className: "ttw:font-medium",
|
|
421
|
+
children: X ? K.vendorDetailsHeading : K.customerDetailsHeading
|
|
422
|
+
}), A && !W && /* @__PURE__ */ v(t, {
|
|
423
|
+
type: "button",
|
|
424
|
+
variant: "link",
|
|
425
|
+
className: "ttw:h-auto ttw:p-0",
|
|
426
|
+
onClick: P,
|
|
427
|
+
children: K.editButton
|
|
428
|
+
})]
|
|
429
|
+
}), W ? /* @__PURE__ */ v(te, {
|
|
430
|
+
form: W,
|
|
431
|
+
labels: K
|
|
432
|
+
}) : /* @__PURE__ */ y("div", {
|
|
433
|
+
className: m("ttw:border-t ttw:border-border", !X && "ttw:border-b"),
|
|
434
|
+
children: [
|
|
435
|
+
/* @__PURE__ */ v(D, {
|
|
436
|
+
label: K.rowType,
|
|
437
|
+
children: x.entityTypeLabel ?? C
|
|
438
|
+
}),
|
|
439
|
+
/* @__PURE__ */ v(D, {
|
|
440
|
+
label: K.rowName,
|
|
441
|
+
children: x.name
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ v(D, {
|
|
444
|
+
label: K.rowEmail,
|
|
445
|
+
children: x.email || C
|
|
446
|
+
}),
|
|
447
|
+
!X && /* @__PURE__ */ v(D, {
|
|
448
|
+
label: K.rowPaymentReminders,
|
|
449
|
+
children: x.remindersLabel ?? C
|
|
450
|
+
}),
|
|
451
|
+
/* @__PURE__ */ v(D, {
|
|
452
|
+
label: K.rowPhone,
|
|
453
|
+
children: x.phone || C
|
|
454
|
+
}),
|
|
455
|
+
/* @__PURE__ */ v(D, {
|
|
456
|
+
label: x.entityType === "individual" ? K.rowTaxIdSsn : K.rowTaxIdEin,
|
|
457
|
+
isLast: !X,
|
|
458
|
+
children: /* @__PURE__ */ y("div", {
|
|
459
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
460
|
+
children: [/* @__PURE__ */ y("div", {
|
|
461
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
462
|
+
children: [/* @__PURE__ */ v("span", {
|
|
463
|
+
className: "ttw:font-medium",
|
|
464
|
+
children: pe
|
|
465
|
+
}), x.taxId && /* @__PURE__ */ y(t, {
|
|
466
|
+
type: "button",
|
|
467
|
+
variant: "outline",
|
|
468
|
+
size: "sm",
|
|
469
|
+
onClick: () => {
|
|
470
|
+
q((e) => e === J ? null : J);
|
|
471
|
+
},
|
|
472
|
+
children: [v(Y ? ae : ie, { className: "ttw:size-4" }), Y ? K.hideTaxId : K.showTaxId]
|
|
473
|
+
})]
|
|
474
|
+
}), Z && /* @__PURE__ */ v(p, {
|
|
475
|
+
variant: "body2",
|
|
476
|
+
className: "ttw:text-muted-foreground",
|
|
477
|
+
children: Z
|
|
478
|
+
})]
|
|
479
|
+
})
|
|
480
|
+
}),
|
|
481
|
+
X && /* @__PURE__ */ v(D, {
|
|
482
|
+
label: K.addressHeading,
|
|
483
|
+
isLast: !0,
|
|
484
|
+
children: /* @__PURE__ */ v(k, {
|
|
485
|
+
mode: b,
|
|
486
|
+
addressLines: x.addressLines,
|
|
487
|
+
canEdit: j,
|
|
488
|
+
onEditAddress: L,
|
|
489
|
+
onAddAddress: R,
|
|
490
|
+
labels: K,
|
|
491
|
+
addressForm: G
|
|
492
|
+
})
|
|
493
|
+
})
|
|
494
|
+
]
|
|
495
|
+
})]
|
|
496
|
+
}),
|
|
497
|
+
!X && /* @__PURE__ */ v(k, {
|
|
498
|
+
mode: b,
|
|
499
|
+
addressLines: x.addressLines,
|
|
500
|
+
canEdit: j,
|
|
501
|
+
onEditAddress: L,
|
|
502
|
+
onAddAddress: R,
|
|
503
|
+
labels: K,
|
|
504
|
+
addressForm: G
|
|
505
|
+
}),
|
|
506
|
+
X && /* @__PURE__ */ v(ue, {
|
|
507
|
+
paymentMethod: x.paymentMethod,
|
|
508
|
+
canEdit: M,
|
|
509
|
+
onAddBankAccount: z,
|
|
510
|
+
onEditBankAccount: B,
|
|
511
|
+
onDeleteBankAccount: V,
|
|
512
|
+
labels: K
|
|
513
|
+
})
|
|
514
|
+
]
|
|
515
|
+
})]
|
|
516
|
+
})
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
//#endregion
|
|
520
|
+
export { A as CounterpartDetailsSheet, A as default };
|
|
@@ -260,6 +260,8 @@ function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A
|
|
|
260
260
|
counterpartId: Z.customerDetailsId,
|
|
261
261
|
counterpartType: "customer",
|
|
262
262
|
onClose: Z.closeCustomerDetails,
|
|
263
|
+
formLabels: A,
|
|
264
|
+
messageLabels: j,
|
|
263
265
|
...Z.customerDetailsActions
|
|
264
266
|
}),
|
|
265
267
|
/* @__PURE__ */ O(v, {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useMoniteContext as e } from "./index45.js";
|
|
2
|
-
import {
|
|
3
|
-
import { VAT_SUPPORTED_COUNTRIES as r } from "./index142.js";
|
|
2
|
+
import { VAT_SUPPORTED_COUNTRIES as t } from "./index142.js";
|
|
4
3
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index143.js
|
|
5
|
-
var
|
|
4
|
+
var n = () => {
|
|
6
5
|
let { api: t } = e();
|
|
7
6
|
return t.finops.getEntityUsersMe.useQuery({}, {
|
|
8
7
|
retry: !1,
|
|
@@ -10,13 +9,13 @@ var i = () => {
|
|
|
10
9
|
refetchOnMount: !1,
|
|
11
10
|
refetchOnWindowFocus: !1
|
|
12
11
|
});
|
|
13
|
-
},
|
|
14
|
-
let { api:
|
|
12
|
+
}, r = () => {
|
|
13
|
+
let { api: n, entityId: r } = e(), i = n.finops.getEntityUsersMyEntity.useQuery({}, {
|
|
15
14
|
retry: !1,
|
|
16
15
|
staleTime: Infinity,
|
|
17
16
|
refetchOnMount: !1,
|
|
18
17
|
refetchOnWindowFocus: !1
|
|
19
|
-
}), { data: a } =
|
|
18
|
+
}), { data: a } = n.finops.getEntitiesIdSettings.useQuery({ path: { entity_id: r } }), s = !!(i.data?.address && t.includes(i.data?.address.country)), c = !!(i.data?.address && i.data?.address.country === "US"), l = a?.receivable_edit_flow === "non_compliant", u = o(i.data);
|
|
20
19
|
return {
|
|
21
20
|
...i,
|
|
22
21
|
entityName: u,
|
|
@@ -24,13 +23,13 @@ var i = () => {
|
|
|
24
23
|
isUSEntity: c,
|
|
25
24
|
isNonCompliantFlow: l
|
|
26
25
|
};
|
|
27
|
-
}, o = (e) => {
|
|
26
|
+
}, i = (e) => e?.type === "individual", a = (e) => e?.type === "organization", o = (e) => {
|
|
28
27
|
if (!e) return "";
|
|
29
|
-
if (
|
|
28
|
+
if (i(e)) {
|
|
30
29
|
let { first_name: t, last_name: n } = e.individual;
|
|
31
30
|
return `${t} ${n}`;
|
|
32
31
|
}
|
|
33
|
-
return
|
|
32
|
+
return a(e) ? e.organization.legal_name : "";
|
|
34
33
|
};
|
|
35
34
|
//#endregion
|
|
36
|
-
export { o as getEntityName,
|
|
35
|
+
export { o as getEntityName, n as useMe, r as useMyEntity };
|
|
@@ -24,8 +24,7 @@ var a = [10, 25], o = (o, s) => ({
|
|
|
24
24
|
pageSizeOptions: s?.counterparts?.pageSizeOptions || a,
|
|
25
25
|
paginationLayout: s?.counterparts?.paginationLayout,
|
|
26
26
|
navigationPosition: s?.counterparts?.navigationPosition,
|
|
27
|
-
pageSizePosition: s?.counterparts?.pageSizePosition
|
|
28
|
-
customerTypes: s?.counterparts?.customerTypes || ["customer", "vendor"]
|
|
27
|
+
pageSizePosition: s?.counterparts?.pageSizePosition
|
|
29
28
|
},
|
|
30
29
|
payables: {
|
|
31
30
|
pageSizeOptions: s?.payables?.pageSizeOptions || a,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { fromMinorUnits as e, toMinorUnits as t } from "./index13.js";
|
|
2
2
|
import "./index18.js";
|
|
3
|
-
import "./index53.js";
|
|
4
3
|
import { resolveNullableUpdate as n } from "./index285.js";
|
|
5
4
|
import { format as r } from "date-fns";
|
|
6
5
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index286.js
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { getIndividualName as e } from "./index15.js";
|
|
2
|
-
import "./index18.js";
|
|
3
|
-
import "date-fns";
|
|
4
2
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index53.js
|
|
5
3
|
var t = (e) => e.type === "individual", n = (e) => e.type === "organization";
|
|
6
4
|
function r(r) {
|
|
@@ -15,6 +13,5 @@ function r(r) {
|
|
|
15
13
|
}
|
|
16
14
|
return "";
|
|
17
15
|
}
|
|
18
|
-
var i = (e) => e?.type === "individual", a = (e) => e?.type === "organization";
|
|
19
16
|
//#endregion
|
|
20
|
-
export { r as getCounterpartName, t as isIndividualCounterpart,
|
|
17
|
+
export { r as getCounterpartName, t as isIndividualCounterpart, n as isOrganizationCounterpart };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index2.js";
|
|
2
2
|
import { useCounterpartQuery as e, useCounterpartsByIdsQuery as t, useCounterpartsQuery as n, useCreateCounterpartMutation as r, useDeleteCounterpartMutation as i, useUpdateCounterpartMutation as a } from "./index3.js";
|
|
3
3
|
import "./index4.js";
|
|
4
|
-
import { useCounterpartBankAccountsQuery as o, useCreateCounterpartBankAccountMutation as s, useDeleteCounterpartBankAccountMutation as c,
|
|
4
|
+
import { useCounterpartBankAccountsQuery as o, useCreateCounterpartBankAccountMutation as s, useDeleteCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "./index5.js";
|
|
5
5
|
import "./index6.js";
|
|
6
|
-
import { useCounterpartAddressesForRowsQuery as
|
|
7
|
-
export {
|
|
6
|
+
import { useCounterpartAddressesForRowsQuery as u, useCounterpartAddressesQuery as d, useCreateCounterpartAddressMutation as f, useUpdateCounterpartAddressMutation as p } from "./index7.js";
|
|
7
|
+
export { u as useCounterpartAddressesForRowsQuery, d as useCounterpartAddressesQuery, o as useCounterpartBankAccountsQuery, e as useCounterpartQuery, t as useCounterpartsByIdsQuery, n as useCounterpartsQuery, f as useCreateCounterpartAddressMutation, s as useCreateCounterpartBankAccountMutation, r as useCreateCounterpartMutation, c as useDeleteCounterpartBankAccountMutation, i as useDeleteCounterpartMutation, p as useUpdateCounterpartAddressMutation, l as useUpdateCounterpartBankAccountMutation, a as useUpdateCounterpartMutation };
|