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