@tesouro/embedded-components-react 0.5.201 → 0.5.203
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 +20 -6
- package/dist/index.css +3 -0
- package/dist/index.d.ts +82 -7
- package/dist/index.js +8 -7
- package/dist/lib/MarketingWidget.d.ts +66 -7
- package/dist/lib/MarketingWidget.js +5 -4
- package/dist/lib/ReceivablesWidget.d.ts +16 -0
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +24 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +65 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +188 -45
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +30 -265
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +144 -64
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +47 -109
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +293 -216
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +75 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +114 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +237 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index4.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +28 -243
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +212 -375
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +64 -62
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +409 -187
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +73 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +0 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +10 -263
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +1 -72
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +241 -398
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +66 -100
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +406 -76
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +92 -330
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +344 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +6 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +157 -20
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +24 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +3 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +18 -4
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js +33 -81
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index5.js +34 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index6.js +20 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js +161 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index3.js +5 -1
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index8.js +34 -81
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index9.js +92 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +38 -37
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +54 -54
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +115 -94
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationApplicationStatus.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,421 +1,264 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { Button as e, Sheet as t, SheetContent as n, SheetDescription as r, SheetFooter as i, SheetHeader as a, SheetTitle as o, Typography as s } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { ErrorState as c } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
3
|
+
import "../../../shared/ui/dist/index.js";
|
|
4
|
+
import { RECEIVABLE_DETAILS_SHEET_LABELS_EN as l } from "./index2.js";
|
|
5
|
+
import { ReceivableStatusBadge as u } from "./index5.js";
|
|
6
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
+
import { DownloadIcon as m } from "lucide-react";
|
|
7
8
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let T = `${e}-line-${t.id}`;
|
|
17
|
-
return /* @__PURE__ */ j("li", {
|
|
18
|
-
className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
|
|
19
|
-
children: [
|
|
20
|
-
/* @__PURE__ */ A("div", {
|
|
21
|
-
className: "ttw:min-w-30 ttw:flex-1",
|
|
22
|
-
children: y(t, {
|
|
23
|
-
inputId: `${T}-name`,
|
|
24
|
-
invalid: !!i?.name,
|
|
25
|
-
focusOnMount: o
|
|
26
|
-
})
|
|
27
|
-
}),
|
|
28
|
-
/* @__PURE__ */ j("div", {
|
|
29
|
-
className: D("ttw:flex ttw:h-9 ttw:w-26 ttw:min-w-26 ttw:items-center ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs", i?.quantity && "ttw:border-destructive"),
|
|
30
|
-
children: [
|
|
31
|
-
/* @__PURE__ */ A("button", {
|
|
32
|
-
type: "button",
|
|
33
|
-
"aria-label": p.decreaseQuantityButton,
|
|
34
|
-
disabled: a ? !a.canDecreaseQuantity : !1,
|
|
35
|
-
className: "ttw:flex ttw:size-6 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:text-muted-foreground ttw:hover:bg-accent ttw:disabled:pointer-events-none ttw:disabled:opacity-50",
|
|
36
|
-
onClick: () => S(-1),
|
|
37
|
-
children: /* @__PURE__ */ A(M, { className: "ttw:size-3.5" })
|
|
38
|
-
}),
|
|
39
|
-
/* @__PURE__ */ A("input", {
|
|
40
|
-
id: `${T}-quantity`,
|
|
41
|
-
"aria-label": p.quantityLabel,
|
|
42
|
-
"aria-invalid": !!i?.quantity || void 0,
|
|
43
|
-
type: "text",
|
|
44
|
-
inputMode: "decimal",
|
|
45
|
-
className: "ttw:h-full ttw:w-full ttw:min-w-0 ttw:bg-transparent ttw:px-0 ttw:text-center ttw:text-sm ttw:outline-none",
|
|
46
|
-
value: t.quantity,
|
|
47
|
-
onChange: (e) => b({ quantity: e.target.value }),
|
|
48
|
-
onBlur: () => x("quantity")
|
|
49
|
-
}),
|
|
50
|
-
/* @__PURE__ */ A("button", {
|
|
51
|
-
type: "button",
|
|
52
|
-
"aria-label": p.increaseQuantityButton,
|
|
53
|
-
disabled: a ? !a.canIncreaseQuantity : !1,
|
|
54
|
-
className: "ttw:flex ttw:size-6 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:text-muted-foreground ttw:hover:bg-accent ttw:disabled:pointer-events-none ttw:disabled:opacity-50",
|
|
55
|
-
onClick: () => S(1),
|
|
56
|
-
children: /* @__PURE__ */ A(N, { className: "ttw:size-3.5" })
|
|
57
|
-
})
|
|
58
|
-
]
|
|
59
|
-
}),
|
|
60
|
-
/* @__PURE__ */ j(m, {
|
|
61
|
-
value: t.unit || F,
|
|
62
|
-
onValueChange: (e) => {
|
|
63
|
-
if (e === I) {
|
|
64
|
-
C?.();
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
b({ unit: e === F ? "" : e });
|
|
68
|
-
},
|
|
69
|
-
children: [/* @__PURE__ */ A(_, {
|
|
70
|
-
id: `${T}-unit`,
|
|
71
|
-
"aria-label": p.unitLabel,
|
|
72
|
-
"aria-invalid": !!i?.measureUnit || void 0,
|
|
73
|
-
className: "ttw:w-22",
|
|
74
|
-
children: /* @__PURE__ */ A(v, {
|
|
75
|
-
className: "ttw:truncate",
|
|
76
|
-
placeholder: p.unitPlaceholder
|
|
77
|
-
})
|
|
78
|
-
}), /* @__PURE__ */ j(h, { children: [
|
|
79
|
-
C && /* @__PURE__ */ j(g, {
|
|
80
|
-
value: I,
|
|
81
|
-
className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
|
|
82
|
-
children: [/* @__PURE__ */ A(N, { className: "ttw:text-primary" }), p.manageUnitsOption]
|
|
83
|
-
}),
|
|
84
|
-
/* @__PURE__ */ A(g, {
|
|
85
|
-
value: F,
|
|
86
|
-
children: p.unitNone
|
|
87
|
-
}),
|
|
88
|
-
d.map((e) => /* @__PURE__ */ A(g, {
|
|
89
|
-
value: e.value,
|
|
90
|
-
children: e.label
|
|
91
|
-
}, e.value))
|
|
92
|
-
] })]
|
|
93
|
-
}),
|
|
94
|
-
/* @__PURE__ */ j(c, {
|
|
95
|
-
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
96
|
-
children: [/* @__PURE__ */ A(l, {
|
|
97
|
-
align: "inline-start",
|
|
98
|
-
children: f
|
|
99
|
-
}), /* @__PURE__ */ A(u, {
|
|
100
|
-
id: `${T}-price`,
|
|
101
|
-
"aria-label": p.priceLabel,
|
|
102
|
-
"aria-invalid": !!i?.price || void 0,
|
|
103
|
-
"data-has-start-addon": !0,
|
|
104
|
-
type: "text",
|
|
105
|
-
inputMode: "decimal",
|
|
106
|
-
className: "ttw:text-right",
|
|
107
|
-
value: t.price,
|
|
108
|
-
onChange: (e) => b({ price: e.target.value }),
|
|
109
|
-
onBlur: () => x("price")
|
|
110
|
-
})]
|
|
111
|
-
}),
|
|
112
|
-
/* @__PURE__ */ A("div", {
|
|
113
|
-
className: "ttw:flex ttw:w-12 ttw:min-w-12 ttw:items-center ttw:justify-center",
|
|
114
|
-
children: /* @__PURE__ */ A(r, {
|
|
115
|
-
id: `${T}-taxable`,
|
|
116
|
-
"aria-label": p.taxableLabel,
|
|
117
|
-
checked: t.taxable,
|
|
118
|
-
onCheckedChange: (e) => b({ taxable: e === !0 })
|
|
119
|
-
})
|
|
120
|
-
}),
|
|
121
|
-
s && /* @__PURE__ */ A(n, {
|
|
122
|
-
type: "button",
|
|
123
|
-
variant: "ghost",
|
|
124
|
-
size: "sm",
|
|
125
|
-
"aria-label": p.removeLineItemButton,
|
|
126
|
-
className: "ttw:w-10 ttw:rounded-none ttw:border-l ttw:border-border ttw:pl-4 ttw:text-muted-foreground ttw:hover:bg-transparent ttw:hover:text-destructive ttw:has-[>svg]:pr-0",
|
|
127
|
-
onClick: w,
|
|
128
|
-
children: /* @__PURE__ */ A(P, {})
|
|
129
|
-
})
|
|
130
|
-
]
|
|
9
|
+
function h({ title: e, children: t }) {
|
|
10
|
+
return /* @__PURE__ */ p("section", {
|
|
11
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
12
|
+
children: [/* @__PURE__ */ f(s, {
|
|
13
|
+
variant: "body2",
|
|
14
|
+
className: "ttw:font-semibold",
|
|
15
|
+
children: e
|
|
16
|
+
}), t]
|
|
131
17
|
});
|
|
132
18
|
}
|
|
133
|
-
function
|
|
134
|
-
let
|
|
135
|
-
...
|
|
136
|
-
...
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
19
|
+
function g({ open: s, onOpenChange: g, details: _, isLoading: v, isError: y, onActionClick: b, onClose: x, labels: S }) {
|
|
20
|
+
let C = {
|
|
21
|
+
...l,
|
|
22
|
+
...S,
|
|
23
|
+
statusBadge: {
|
|
24
|
+
...l.statusBadge,
|
|
25
|
+
...S?.statusBadge
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ f(t, {
|
|
29
|
+
open: s,
|
|
30
|
+
onOpenChange: g,
|
|
31
|
+
children: /* @__PURE__ */ p(n, {
|
|
142
32
|
className: "ttw:w-180 ttw:overflow-y-auto ttw:sm:max-w-180",
|
|
143
33
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ p(a, { children: [/* @__PURE__ */ f(o, { children: v ? C.loadingTitle : _?.title }), /* @__PURE__ */ f(r, {
|
|
145
35
|
className: "ttw:sr-only",
|
|
146
|
-
children:
|
|
36
|
+
children: C.hiddenDescription
|
|
147
37
|
})] }),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
/* @__PURE__ */ A(L, { message: F?.type })
|
|
191
|
-
]
|
|
192
|
-
}),
|
|
193
|
-
/* @__PURE__ */ j("div", {
|
|
194
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
195
|
-
children: [
|
|
196
|
-
/* @__PURE__ */ A(d, { children: Z.customerLabel }),
|
|
197
|
-
U,
|
|
198
|
-
/* @__PURE__ */ A("p", {
|
|
38
|
+
/* @__PURE__ */ f("div", {
|
|
39
|
+
className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:px-6 ttw:pb-6",
|
|
40
|
+
children: y ? /* @__PURE__ */ f(c, {
|
|
41
|
+
title: C.errorTitle,
|
|
42
|
+
description: C.errorDescription
|
|
43
|
+
}) : _ ? /* @__PURE__ */ p(d, { children: [
|
|
44
|
+
/* @__PURE__ */ p("div", {
|
|
45
|
+
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-3",
|
|
46
|
+
children: [/* @__PURE__ */ p("div", {
|
|
47
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
48
|
+
children: [/* @__PURE__ */ f("span", {
|
|
49
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
50
|
+
children: _.customerLabel
|
|
51
|
+
}), /* @__PURE__ */ p("div", {
|
|
52
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
53
|
+
children: [/* @__PURE__ */ f(u, {
|
|
54
|
+
status: _.status,
|
|
55
|
+
tone: _.statusTone,
|
|
56
|
+
labels: C.statusBadge
|
|
57
|
+
}), /* @__PURE__ */ f("span", {
|
|
58
|
+
className: "ttw:text-sm ttw:font-medium",
|
|
59
|
+
children: _.totalLabel
|
|
60
|
+
})]
|
|
61
|
+
})]
|
|
62
|
+
}), _.pdfUrl && /* @__PURE__ */ f(e, {
|
|
63
|
+
asChild: !0,
|
|
64
|
+
variant: "outline",
|
|
65
|
+
children: /* @__PURE__ */ p("a", {
|
|
66
|
+
href: _.pdfUrl,
|
|
67
|
+
target: "_blank",
|
|
68
|
+
rel: "noreferrer",
|
|
69
|
+
children: [/* @__PURE__ */ f(m, { className: "ttw:size-4" }), C.downloadPdfButton]
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ f(h, {
|
|
74
|
+
title: C.summaryHeading,
|
|
75
|
+
children: /* @__PURE__ */ f("dl", {
|
|
76
|
+
className: "ttw:grid ttw:grid-cols-2 ttw:gap-x-6 ttw:gap-y-3",
|
|
77
|
+
children: _.summaryItems.map((e) => /* @__PURE__ */ p("div", {
|
|
78
|
+
className: "ttw:flex ttw:flex-col",
|
|
79
|
+
children: [/* @__PURE__ */ f("dt", {
|
|
199
80
|
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
200
|
-
children:
|
|
201
|
-
}),
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
children: e.label
|
|
224
|
-
}, e.value)) })]
|
|
81
|
+
children: e.label
|
|
82
|
+
}), /* @__PURE__ */ f("dd", {
|
|
83
|
+
className: "ttw:text-sm ttw:font-medium",
|
|
84
|
+
children: e.value
|
|
85
|
+
})]
|
|
86
|
+
}, e.label))
|
|
87
|
+
})
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ f(h, {
|
|
90
|
+
title: C.lineItemsHeading,
|
|
91
|
+
children: _.lineItems.length === 0 ? /* @__PURE__ */ f("p", {
|
|
92
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
93
|
+
children: C.noLineItems
|
|
94
|
+
}) : /* @__PURE__ */ f("div", {
|
|
95
|
+
className: "ttw:overflow-hidden ttw:rounded-md ttw:border",
|
|
96
|
+
children: /* @__PURE__ */ p("table", {
|
|
97
|
+
className: "ttw:w-full ttw:text-sm",
|
|
98
|
+
children: [/* @__PURE__ */ f("thead", {
|
|
99
|
+
className: "ttw:bg-muted/50",
|
|
100
|
+
children: /* @__PURE__ */ p("tr", { children: [
|
|
101
|
+
/* @__PURE__ */ f("th", {
|
|
102
|
+
className: "ttw:p-2 ttw:text-left",
|
|
103
|
+
children: C.lineItemsHeading
|
|
225
104
|
}),
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
$ && /* @__PURE__ */ j("div", {
|
|
230
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
231
|
-
children: [
|
|
232
|
-
/* @__PURE__ */ A(d, {
|
|
233
|
-
htmlFor: `${Q}-issue-date`,
|
|
234
|
-
children: Z.issueDateLabel
|
|
105
|
+
/* @__PURE__ */ f("th", {
|
|
106
|
+
className: "ttw:p-2 ttw:text-right",
|
|
107
|
+
children: C.quantityColumn
|
|
235
108
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
value: P.issueDate,
|
|
240
|
-
onChange: (e) => G({ issueDate: e.target.value })
|
|
109
|
+
/* @__PURE__ */ f("th", {
|
|
110
|
+
className: "ttw:p-2 ttw:text-right",
|
|
111
|
+
children: C.unitPriceColumn
|
|
241
112
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
113
|
+
/* @__PURE__ */ f("th", {
|
|
114
|
+
className: "ttw:p-2 ttw:text-right",
|
|
115
|
+
children: C.totalColumn
|
|
116
|
+
})
|
|
117
|
+
] })
|
|
118
|
+
}), /* @__PURE__ */ f("tbody", { children: _.lineItems.map((e) => /* @__PURE__ */ p("tr", {
|
|
119
|
+
className: "ttw:border-t",
|
|
247
120
|
children: [
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
|
|
250
|
-
children:
|
|
121
|
+
/* @__PURE__ */ f("td", {
|
|
122
|
+
className: "ttw:p-2",
|
|
123
|
+
children: e.name
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ f("td", {
|
|
126
|
+
className: "ttw:p-2 ttw:text-right",
|
|
127
|
+
children: e.quantityLabel
|
|
251
128
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
value: P.dueDate,
|
|
256
|
-
onChange: (e) => G({ dueDate: e.target.value })
|
|
129
|
+
/* @__PURE__ */ f("td", {
|
|
130
|
+
className: "ttw:p-2 ttw:text-right",
|
|
131
|
+
children: e.unitPriceLabel
|
|
257
132
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ f("td", {
|
|
134
|
+
className: "ttw:p-2 ttw:text-right",
|
|
135
|
+
children: e.totalLabel
|
|
136
|
+
})
|
|
259
137
|
]
|
|
260
|
-
})
|
|
261
|
-
|
|
262
|
-
})
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
|
|
315
|
-
children: Z.productLabel
|
|
316
|
-
}),
|
|
317
|
-
/* @__PURE__ */ A("span", {
|
|
318
|
-
className: "ttw:w-24 ttw:min-w-24",
|
|
319
|
-
children: Z.quantityLabel
|
|
320
|
-
}),
|
|
321
|
-
/* @__PURE__ */ A("span", {
|
|
322
|
-
className: "ttw:w-20.5 ttw:min-w-20.5",
|
|
323
|
-
children: Z.unitLabel
|
|
324
|
-
}),
|
|
325
|
-
/* @__PURE__ */ A("span", {
|
|
326
|
-
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
327
|
-
children: Z.priceLabel
|
|
328
|
-
}),
|
|
329
|
-
/* @__PURE__ */ A("span", {
|
|
330
|
-
className: "ttw:w-12 ttw:min-w-12",
|
|
331
|
-
children: Z.taxableLabel
|
|
332
|
-
}),
|
|
333
|
-
P.lineItems.length > 1 && /* @__PURE__ */ A("span", { className: "ttw:w-10 ttw:min-w-10" })
|
|
334
|
-
]
|
|
335
|
-
}), V ? /* @__PURE__ */ A("li", {
|
|
336
|
-
className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
|
|
337
|
-
children: /* @__PURE__ */ A(T, { className: "ttw:size-5" })
|
|
338
|
-
}) : P.lineItems.map((e) => /* @__PURE__ */ A(R, {
|
|
339
|
-
formId: Q,
|
|
340
|
-
lineItem: e,
|
|
341
|
-
errors: F?.lineItems?.[e.id],
|
|
342
|
-
controls: re?.[e.id],
|
|
343
|
-
focusOnMount: e.id === B,
|
|
344
|
-
canRemove: P.lineItems.length > 1,
|
|
345
|
-
unitOptions: te,
|
|
346
|
-
currencySymbol: ne,
|
|
347
|
-
labels: Z,
|
|
348
|
-
renderProductSelector: W,
|
|
349
|
-
onChange: (t) => K(e.id, t),
|
|
350
|
-
onCommit: (t) => q(e.id, t),
|
|
351
|
-
onQuantityStep: (t) => J(e.id, t),
|
|
352
|
-
onManageUnits: ie,
|
|
353
|
-
onRemove: () => oe(e.id)
|
|
354
|
-
}, e.id))]
|
|
355
|
-
}),
|
|
356
|
-
/* @__PURE__ */ j(n, {
|
|
357
|
-
type: "button",
|
|
358
|
-
variant: "ghost",
|
|
359
|
-
className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
|
|
360
|
-
onClick: ae,
|
|
361
|
-
children: [/* @__PURE__ */ A(N, { className: "ttw:size-5 ttw:text-primary" }), Z.addLineItemButton]
|
|
362
|
-
}),
|
|
363
|
-
/* @__PURE__ */ A(i, { children: /* @__PURE__ */ j(a, {
|
|
364
|
-
className: "ttw:flex-row ttw:justify-end",
|
|
365
|
-
children: [/* @__PURE__ */ A(o, {
|
|
366
|
-
htmlFor: `${Q}-tax-rate`,
|
|
367
|
-
children: Z.taxRateLabel
|
|
368
|
-
}), /* @__PURE__ */ j(c, {
|
|
369
|
-
className: "ttw:w-40 ttw:has-[>[data-align=inline-end]]:[&>input]:pr-0",
|
|
370
|
-
children: [/* @__PURE__ */ A(u, {
|
|
371
|
-
id: `${Q}-tax-rate`,
|
|
372
|
-
className: "ttw:text-right",
|
|
373
|
-
placeholder: Z.taxRatePlaceholder,
|
|
374
|
-
type: "text",
|
|
375
|
-
inputMode: "decimal",
|
|
376
|
-
value: P.taxRate,
|
|
377
|
-
onChange: (e) => G({ taxRate: e.target.value }),
|
|
378
|
-
onBlur: Y
|
|
379
|
-
}), /* @__PURE__ */ A(l, {
|
|
380
|
-
align: "inline-end",
|
|
381
|
-
children: Z.taxRateSuffix
|
|
382
|
-
})]
|
|
383
|
-
})]
|
|
384
|
-
}) })
|
|
385
|
-
]
|
|
386
|
-
}),
|
|
387
|
-
/* @__PURE__ */ A(k, {
|
|
388
|
-
idPrefix: Q,
|
|
389
|
-
openingNote: P.openingNote,
|
|
390
|
-
closingNote: P.closingNote,
|
|
391
|
-
openingNoteError: F?.openingNote,
|
|
392
|
-
closingNoteError: F?.closingNote,
|
|
393
|
-
disabled: H,
|
|
394
|
-
onOpeningNoteChange: (e) => G({ openingNote: e }),
|
|
395
|
-
onClosingNoteChange: (e) => G({ closingNote: e }),
|
|
396
|
-
labels: Z
|
|
138
|
+
}, e.id)) })]
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ f(h, {
|
|
143
|
+
title: C.activityHeading,
|
|
144
|
+
children: _.activityItems.length === 0 ? /* @__PURE__ */ f("p", {
|
|
145
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
146
|
+
children: C.noActivity
|
|
147
|
+
}) : /* @__PURE__ */ f("div", {
|
|
148
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
149
|
+
children: _.activityItems.map((e) => /* @__PURE__ */ p("div", {
|
|
150
|
+
className: "ttw:flex ttw:flex-col",
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ f("span", {
|
|
153
|
+
className: "ttw:text-sm ttw:font-medium",
|
|
154
|
+
children: e.title
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ f("span", {
|
|
157
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
158
|
+
children: e.description
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ f("span", {
|
|
161
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
162
|
+
children: e.timestampLabel
|
|
163
|
+
})
|
|
164
|
+
]
|
|
165
|
+
}, e.id))
|
|
166
|
+
})
|
|
167
|
+
}),
|
|
168
|
+
/* @__PURE__ */ f(h, {
|
|
169
|
+
title: C.mailsHeading,
|
|
170
|
+
children: _.mailItems.length === 0 ? /* @__PURE__ */ f("p", {
|
|
171
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
172
|
+
children: C.noMails
|
|
173
|
+
}) : /* @__PURE__ */ f("div", {
|
|
174
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
175
|
+
children: _.mailItems.map((e) => /* @__PURE__ */ p("div", {
|
|
176
|
+
className: "ttw:flex ttw:flex-col",
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ f("span", {
|
|
179
|
+
className: "ttw:text-sm ttw:font-medium",
|
|
180
|
+
children: e.statusLabel
|
|
181
|
+
}),
|
|
182
|
+
/* @__PURE__ */ f("span", {
|
|
183
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
184
|
+
children: e.recipientsLabel
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ f("span", {
|
|
187
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
188
|
+
children: e.sentAtLabel
|
|
189
|
+
})
|
|
190
|
+
]
|
|
191
|
+
}, e.id))
|
|
397
192
|
})
|
|
398
|
-
|
|
399
|
-
})
|
|
193
|
+
})
|
|
194
|
+
] }) : null
|
|
400
195
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
-
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
403
|
-
children: [
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
196
|
+
/* @__PURE__ */ f(i, { children: _ && /* @__PURE__ */ p("div", {
|
|
197
|
+
className: "ttw:flex ttw:flex-wrap ttw:justify-end ttw:gap-2",
|
|
198
|
+
children: [
|
|
199
|
+
_.actions.edit && /* @__PURE__ */ f(e, {
|
|
200
|
+
variant: "outline",
|
|
201
|
+
onClick: () => b("edit", _),
|
|
202
|
+
children: C.editButton
|
|
203
|
+
}),
|
|
204
|
+
_.actions.issue && /* @__PURE__ */ f(e, {
|
|
205
|
+
onClick: () => b("issue", _),
|
|
206
|
+
children: C.issueButton
|
|
207
|
+
}),
|
|
208
|
+
_.actions.send && /* @__PURE__ */ f(e, {
|
|
209
|
+
variant: "outline",
|
|
210
|
+
onClick: () => b("send", _),
|
|
211
|
+
children: C.sendButton
|
|
212
|
+
}),
|
|
213
|
+
_.actions.accept && /* @__PURE__ */ f(e, {
|
|
214
|
+
onClick: () => b("accept", _),
|
|
215
|
+
children: C.acceptButton
|
|
216
|
+
}),
|
|
217
|
+
_.actions.decline && /* @__PURE__ */ f(e, {
|
|
218
|
+
variant: "outline",
|
|
219
|
+
onClick: () => b("decline", _),
|
|
220
|
+
children: C.declineButton
|
|
221
|
+
}),
|
|
222
|
+
_.actions.recordPayment && /* @__PURE__ */ f(e, {
|
|
223
|
+
variant: "outline",
|
|
224
|
+
onClick: () => b("recordPayment", _),
|
|
225
|
+
children: C.recordPaymentButton
|
|
226
|
+
}),
|
|
227
|
+
_.actions.markPaid && /* @__PURE__ */ f(e, {
|
|
228
|
+
variant: "outline",
|
|
229
|
+
onClick: () => b("markPaid", _),
|
|
230
|
+
children: C.markPaidButton
|
|
231
|
+
}),
|
|
232
|
+
_.actions.markUncollectible && /* @__PURE__ */ f(e, {
|
|
233
|
+
variant: "outline",
|
|
234
|
+
onClick: () => b("markUncollectible", _),
|
|
235
|
+
children: C.markUncollectibleButton
|
|
236
|
+
}),
|
|
237
|
+
_.actions.cancel && /* @__PURE__ */ f(e, {
|
|
238
|
+
variant: "outline",
|
|
239
|
+
onClick: () => b("cancel", _),
|
|
240
|
+
children: C.cancelButton
|
|
241
|
+
}),
|
|
242
|
+
_.actions.clone && /* @__PURE__ */ f(e, {
|
|
243
|
+
variant: "outline",
|
|
244
|
+
onClick: () => b("clone", _),
|
|
245
|
+
children: C.cloneButton
|
|
246
|
+
}),
|
|
247
|
+
_.actions.delete && /* @__PURE__ */ f(e, {
|
|
248
|
+
variant: "destructive",
|
|
249
|
+
onClick: () => b("delete", _),
|
|
250
|
+
children: C.deleteButton
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ f(e, {
|
|
253
|
+
variant: "ghost",
|
|
254
|
+
onClick: x,
|
|
255
|
+
children: C.closeButton
|
|
256
|
+
})
|
|
257
|
+
]
|
|
415
258
|
}) })
|
|
416
259
|
]
|
|
417
260
|
})
|
|
418
261
|
});
|
|
419
262
|
}
|
|
420
263
|
//#endregion
|
|
421
|
-
export {
|
|
264
|
+
export { g as ReceivableDetailsSheet, g as default };
|