@tesouro/embedded-components-react 0.5.200 → 0.5.201
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 +4 -0
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +4 -0
- package/dist/lib/ReceivablesWidget.js +1 -1
- 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 +47 -250
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +267 -65
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +66 -105
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +103 -214
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +226 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +67 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +83 -79
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +207 -172
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,381 +1,416 @@
|
|
|
1
|
-
import { Alert as e, AlertDescription as t, Button as n,
|
|
2
|
-
import { RECEIVABLE_FORM_SHEET_LABELS_EN as
|
|
3
|
-
import { ReceivableNotesSection as
|
|
1
|
+
import { Alert as e, AlertDescription as t, Button as n, Checkbox as r, Field as i, FieldContent as a, FieldLabel as o, Input as s, InputGroup as c, InputGroupAddon as l, InputGroupInput as u, Label as d, RadioGroup as f, RadioGroupItem as p, Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v, Sheet as y, SheetContent as b, SheetDescription as x, SheetFooter as S, SheetHeader as C, SheetTitle as w, Spinner as T, Typography as E, cn as D } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { RECEIVABLE_FORM_SHEET_LABELS_EN as O } from "./index2.js";
|
|
3
|
+
import { ReceivableNotesSection as k } from "./index13.js";
|
|
4
4
|
import { useId as ee } from "react";
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { MinusIcon as
|
|
5
|
+
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
6
|
+
import { MinusIcon as M, PlusIcon as N, Trash2Icon as P } from "lucide-react";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
return e ? /* @__PURE__ */
|
|
8
|
+
var F = "__none__", I = "__manage__";
|
|
9
|
+
function L({ message: e }) {
|
|
10
|
+
return e ? /* @__PURE__ */ A("p", {
|
|
11
11
|
className: "ttw:text-sm ttw:text-destructive",
|
|
12
12
|
children: e
|
|
13
13
|
}) : null;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function R({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, canRemove: s, unitOptions: d, currencySymbol: f, labels: p, renderProductSelector: y, onChange: b, onCommit: x, onQuantityStep: S, onManageUnits: C, onRemove: w }) {
|
|
16
16
|
let T = `${e}-line-${t.id}`;
|
|
17
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ j("li", {
|
|
18
18
|
className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
|
|
19
19
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ A("div", {
|
|
21
21
|
className: "ttw:min-w-30 ttw:flex-1",
|
|
22
|
-
children:
|
|
22
|
+
children: y(t, {
|
|
23
23
|
inputId: `${T}-name`,
|
|
24
|
-
invalid: !!
|
|
25
|
-
focusOnMount:
|
|
24
|
+
invalid: !!i?.name,
|
|
25
|
+
focusOnMount: o
|
|
26
26
|
})
|
|
27
27
|
}),
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
className:
|
|
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
30
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ A("button", {
|
|
32
32
|
type: "button",
|
|
33
|
-
"aria-label":
|
|
34
|
-
disabled:
|
|
33
|
+
"aria-label": p.decreaseQuantityButton,
|
|
34
|
+
disabled: a ? !a.canDecreaseQuantity : !1,
|
|
35
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: () =>
|
|
37
|
-
children: /* @__PURE__ */
|
|
36
|
+
onClick: () => S(-1),
|
|
37
|
+
children: /* @__PURE__ */ A(M, { className: "ttw:size-3.5" })
|
|
38
38
|
}),
|
|
39
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ A("input", {
|
|
40
40
|
id: `${T}-quantity`,
|
|
41
|
-
"aria-label":
|
|
42
|
-
"aria-invalid": !!
|
|
41
|
+
"aria-label": p.quantityLabel,
|
|
42
|
+
"aria-invalid": !!i?.quantity || void 0,
|
|
43
43
|
type: "text",
|
|
44
44
|
inputMode: "decimal",
|
|
45
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
46
|
value: t.quantity,
|
|
47
|
-
onChange: (e) =>
|
|
48
|
-
onBlur: () =>
|
|
47
|
+
onChange: (e) => b({ quantity: e.target.value }),
|
|
48
|
+
onBlur: () => x("quantity")
|
|
49
49
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ A("button", {
|
|
51
51
|
type: "button",
|
|
52
|
-
"aria-label":
|
|
53
|
-
disabled:
|
|
52
|
+
"aria-label": p.increaseQuantityButton,
|
|
53
|
+
disabled: a ? !a.canIncreaseQuantity : !1,
|
|
54
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: () =>
|
|
56
|
-
children: /* @__PURE__ */
|
|
55
|
+
onClick: () => S(1),
|
|
56
|
+
children: /* @__PURE__ */ A(N, { className: "ttw:size-3.5" })
|
|
57
57
|
})
|
|
58
58
|
]
|
|
59
59
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
value: t.unit ||
|
|
60
|
+
/* @__PURE__ */ j(m, {
|
|
61
|
+
value: t.unit || F,
|
|
62
62
|
onValueChange: (e) => {
|
|
63
|
-
if (e ===
|
|
64
|
-
|
|
63
|
+
if (e === I) {
|
|
64
|
+
C?.();
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
b({ unit: e === F ? "" : e });
|
|
68
68
|
},
|
|
69
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ A(_, {
|
|
70
70
|
id: `${T}-unit`,
|
|
71
|
-
"aria-label":
|
|
72
|
-
"aria-invalid": !!
|
|
71
|
+
"aria-label": p.unitLabel,
|
|
72
|
+
"aria-invalid": !!i?.measureUnit || void 0,
|
|
73
73
|
className: "ttw:w-22",
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ A(v, {
|
|
75
75
|
className: "ttw:truncate",
|
|
76
|
-
placeholder:
|
|
76
|
+
placeholder: p.unitPlaceholder
|
|
77
77
|
})
|
|
78
|
-
}), /* @__PURE__ */
|
|
79
|
-
|
|
80
|
-
value:
|
|
78
|
+
}), /* @__PURE__ */ j(h, { children: [
|
|
79
|
+
C && /* @__PURE__ */ j(g, {
|
|
80
|
+
value: I,
|
|
81
81
|
className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
|
|
82
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ A(N, { className: "ttw:text-primary" }), p.manageUnitsOption]
|
|
83
83
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
value:
|
|
86
|
-
children:
|
|
84
|
+
/* @__PURE__ */ A(g, {
|
|
85
|
+
value: F,
|
|
86
|
+
children: p.unitNone
|
|
87
87
|
}),
|
|
88
|
-
|
|
88
|
+
d.map((e) => /* @__PURE__ */ A(g, {
|
|
89
89
|
value: e.value,
|
|
90
90
|
children: e.label
|
|
91
91
|
}, e.value))
|
|
92
92
|
] })]
|
|
93
93
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ j(c, {
|
|
95
95
|
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ A(l, {
|
|
97
97
|
align: "inline-start",
|
|
98
|
-
children:
|
|
99
|
-
}), /* @__PURE__ */
|
|
98
|
+
children: f
|
|
99
|
+
}), /* @__PURE__ */ A(u, {
|
|
100
100
|
id: `${T}-price`,
|
|
101
|
-
"aria-label":
|
|
102
|
-
"aria-invalid": !!
|
|
101
|
+
"aria-label": p.priceLabel,
|
|
102
|
+
"aria-invalid": !!i?.price || void 0,
|
|
103
103
|
"data-has-start-addon": !0,
|
|
104
104
|
type: "text",
|
|
105
105
|
inputMode: "decimal",
|
|
106
106
|
className: "ttw:text-right",
|
|
107
107
|
value: t.price,
|
|
108
|
-
onChange: (e) =>
|
|
109
|
-
onBlur: () =>
|
|
108
|
+
onChange: (e) => b({ price: e.target.value }),
|
|
109
|
+
onBlur: () => x("price")
|
|
110
110
|
})]
|
|
111
111
|
}),
|
|
112
|
-
|
|
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, {
|
|
113
122
|
type: "button",
|
|
114
123
|
variant: "ghost",
|
|
115
124
|
size: "sm",
|
|
116
|
-
"aria-label":
|
|
125
|
+
"aria-label": p.removeLineItemButton,
|
|
117
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",
|
|
118
127
|
onClick: w,
|
|
119
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ A(P, {})
|
|
120
129
|
})
|
|
121
130
|
]
|
|
122
131
|
});
|
|
123
132
|
}
|
|
124
|
-
function
|
|
133
|
+
function z({ open: r, onOpenChange: D, mode: M = "create", values: P, errors: F, currencyOptions: I, paymentTermsOptions: z, unitOptions: te, currencySymbol: ne, lineItemControls: re, autoFocusLineItemId: B, lineItemsLoading: V, inProgress: H, customerSelector: U, renderProductSelector: W, onChange: G, onLineItemChange: K, onLineItemCommit: q, onLineItemQuantityStep: J, onTaxRateCommit: Y, onManageUnits: ie, onAddLineItem: ae, onRemoveLineItem: oe, onSubmit: se, onCancel: ce, labels: X }) {
|
|
125
134
|
let Z = {
|
|
126
|
-
...
|
|
135
|
+
...O,
|
|
127
136
|
...X
|
|
128
|
-
}, Q = ee(), $ =
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
open:
|
|
131
|
-
onOpenChange:
|
|
132
|
-
children: /* @__PURE__ */
|
|
137
|
+
}, Q = ee(), $ = M === "edit", le = P.type === "invoice" || M === "edit", ue = $ ? "ttw:grid ttw:grid-cols-3 ttw:gap-4" : "ttw:grid ttw:grid-cols-2 ttw:gap-4";
|
|
138
|
+
return /* @__PURE__ */ A(y, {
|
|
139
|
+
open: r,
|
|
140
|
+
onOpenChange: D,
|
|
141
|
+
children: /* @__PURE__ */ j(b, {
|
|
133
142
|
className: "ttw:w-180 ttw:overflow-y-auto ttw:sm:max-w-180",
|
|
134
143
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ j(C, { children: [/* @__PURE__ */ A(w, { children: M === "edit" ? Z.editTitle : Z.createTitle }), /* @__PURE__ */ A(x, {
|
|
136
145
|
className: "ttw:sr-only",
|
|
137
146
|
children: Z.hiddenDescription
|
|
138
147
|
})] }),
|
|
139
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ A("form", {
|
|
140
149
|
id: Q,
|
|
141
150
|
onSubmit: (e) => {
|
|
142
|
-
e.preventDefault(), e.stopPropagation(),
|
|
151
|
+
e.preventDefault(), e.stopPropagation(), se();
|
|
143
152
|
},
|
|
144
|
-
children: /* @__PURE__ */
|
|
153
|
+
children: /* @__PURE__ */ j("div", {
|
|
145
154
|
className: "ttw:flex ttw:flex-col ttw:gap-5 ttw:px-6 ttw:pb-6",
|
|
146
155
|
children: [
|
|
147
|
-
|
|
156
|
+
F?.form && /* @__PURE__ */ A("p", {
|
|
148
157
|
role: "alert",
|
|
149
158
|
className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
|
|
150
|
-
children:
|
|
159
|
+
children: F.form
|
|
151
160
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ j("div", {
|
|
153
162
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
154
163
|
children: [
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ A(d, { children: Z.documentTypeLabel }),
|
|
165
|
+
/* @__PURE__ */ j(f, {
|
|
157
166
|
className: "ttw:flex ttw:flex-row ttw:gap-6",
|
|
158
|
-
disabled:
|
|
159
|
-
value:
|
|
160
|
-
onValueChange: (e) =>
|
|
161
|
-
children: [/* @__PURE__ */
|
|
167
|
+
disabled: M === "edit",
|
|
168
|
+
value: P.type,
|
|
169
|
+
onValueChange: (e) => G({ type: e }),
|
|
170
|
+
children: [/* @__PURE__ */ j("div", {
|
|
162
171
|
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ A(p, {
|
|
164
173
|
value: "invoice",
|
|
165
174
|
id: `${Q}-invoice`
|
|
166
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ A(d, {
|
|
167
176
|
htmlFor: `${Q}-invoice`,
|
|
168
177
|
children: Z.typeInvoice
|
|
169
178
|
})]
|
|
170
|
-
}), /* @__PURE__ */
|
|
179
|
+
}), /* @__PURE__ */ j("div", {
|
|
171
180
|
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ A(p, {
|
|
173
182
|
value: "quote",
|
|
174
183
|
id: `${Q}-quote`
|
|
175
|
-
}), /* @__PURE__ */
|
|
184
|
+
}), /* @__PURE__ */ A(d, {
|
|
176
185
|
htmlFor: `${Q}-quote`,
|
|
177
186
|
children: Z.typeQuote
|
|
178
187
|
})]
|
|
179
188
|
})]
|
|
180
189
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ A(L, { message: F?.type })
|
|
182
191
|
]
|
|
183
192
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ j("div", {
|
|
185
194
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
186
195
|
children: [
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
|
|
189
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ A(d, { children: Z.customerLabel }),
|
|
197
|
+
U,
|
|
198
|
+
/* @__PURE__ */ A("p", {
|
|
190
199
|
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
191
200
|
children: Z.customerHint
|
|
192
201
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ A(L, { message: F?.customerId })
|
|
194
203
|
]
|
|
195
204
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
className:
|
|
205
|
+
/* @__PURE__ */ j("div", {
|
|
206
|
+
className: ue,
|
|
198
207
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ j("div", {
|
|
200
209
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
201
210
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ A(d, {
|
|
203
212
|
htmlFor: `${Q}-currency`,
|
|
204
213
|
children: Z.currencyLabel
|
|
205
214
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
value:
|
|
208
|
-
onValueChange: (e) =>
|
|
209
|
-
children: [/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ j(m, {
|
|
216
|
+
value: P.currency,
|
|
217
|
+
onValueChange: (e) => G({ currency: e }),
|
|
218
|
+
children: [/* @__PURE__ */ A(_, {
|
|
210
219
|
id: `${Q}-currency`,
|
|
211
|
-
children: /* @__PURE__ */
|
|
212
|
-
}), /* @__PURE__ */
|
|
220
|
+
children: /* @__PURE__ */ A(v, {})
|
|
221
|
+
}), /* @__PURE__ */ A(h, { children: I.map((e) => /* @__PURE__ */ A(g, {
|
|
213
222
|
value: e.value,
|
|
214
223
|
children: e.label
|
|
215
224
|
}, e.value)) })]
|
|
216
225
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ A(L, { message: F?.currency })
|
|
218
227
|
]
|
|
219
228
|
}),
|
|
220
|
-
$ && /* @__PURE__ */
|
|
229
|
+
$ && /* @__PURE__ */ j("div", {
|
|
221
230
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
222
231
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ A(d, {
|
|
224
233
|
htmlFor: `${Q}-issue-date`,
|
|
225
234
|
children: Z.issueDateLabel
|
|
226
235
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ A(s, {
|
|
228
237
|
id: `${Q}-issue-date`,
|
|
229
238
|
type: "date",
|
|
230
|
-
value:
|
|
231
|
-
onChange: (e) =>
|
|
239
|
+
value: P.issueDate,
|
|
240
|
+
onChange: (e) => G({ issueDate: e.target.value })
|
|
232
241
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ A(L, { message: F?.issueDate })
|
|
234
243
|
]
|
|
235
244
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ j("div", {
|
|
237
246
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
238
247
|
children: [
|
|
239
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ A(d, {
|
|
240
249
|
htmlFor: `${Q}-due-date`,
|
|
241
250
|
children: Z.dueDateLabel
|
|
242
251
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ A(s, {
|
|
244
253
|
id: `${Q}-due-date`,
|
|
245
254
|
type: "date",
|
|
246
|
-
value:
|
|
247
|
-
onChange: (e) =>
|
|
255
|
+
value: P.dueDate,
|
|
256
|
+
onChange: (e) => G({ dueDate: e.target.value })
|
|
248
257
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ A(L, { message: F?.dueDate })
|
|
250
259
|
]
|
|
251
260
|
})
|
|
252
261
|
]
|
|
253
262
|
}),
|
|
254
|
-
|
|
263
|
+
le && /* @__PURE__ */ j("div", {
|
|
255
264
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
256
265
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ A(d, {
|
|
258
267
|
htmlFor: `${Q}-payment-terms`,
|
|
259
268
|
children: Z.paymentTermsLabel
|
|
260
269
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
value:
|
|
263
|
-
onValueChange: (e) =>
|
|
264
|
-
children: [/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ j(m, {
|
|
271
|
+
value: P.paymentTermsId || void 0,
|
|
272
|
+
onValueChange: (e) => G({ paymentTermsId: e === "__none__" ? "" : e }),
|
|
273
|
+
children: [/* @__PURE__ */ A(_, {
|
|
265
274
|
id: `${Q}-payment-terms`,
|
|
266
|
-
children: /* @__PURE__ */
|
|
267
|
-
}), /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ A(v, { placeholder: Z.paymentTermsPlaceholder })
|
|
276
|
+
}), /* @__PURE__ */ j(h, { children: [/* @__PURE__ */ A(g, {
|
|
268
277
|
value: "__none__",
|
|
269
278
|
children: Z.paymentTermsNone
|
|
270
|
-
}),
|
|
279
|
+
}), z.map((e) => /* @__PURE__ */ A(g, {
|
|
271
280
|
value: e.value,
|
|
272
281
|
children: e.label
|
|
273
282
|
}, e.value))] })]
|
|
274
283
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ A(L, { message: F?.paymentTermsId })
|
|
276
285
|
]
|
|
277
286
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ j("div", {
|
|
279
288
|
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
|
|
280
289
|
children: [
|
|
281
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ j("div", {
|
|
282
291
|
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
|
|
283
|
-
children: [/* @__PURE__ */ E
|
|
292
|
+
children: [/* @__PURE__ */ A(E, {
|
|
284
293
|
variant: "h4",
|
|
285
294
|
children: Z.lineItemsHeading
|
|
286
|
-
}), /* @__PURE__ */ E
|
|
295
|
+
}), /* @__PURE__ */ A(E, {
|
|
287
296
|
variant: "body2",
|
|
288
297
|
color: "muted",
|
|
289
298
|
className: "ttw:font-medium",
|
|
290
299
|
children: Z.lineItemsDescription
|
|
291
300
|
})]
|
|
292
301
|
}),
|
|
293
|
-
|
|
302
|
+
F?.lineItemsSummary?.length ? /* @__PURE__ */ A(e, {
|
|
294
303
|
variant: "destructive",
|
|
295
304
|
className: "ttw:mb-2",
|
|
296
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ A(t, { children: /* @__PURE__ */ A("ul", { children: F.lineItemsSummary.map((e) => /* @__PURE__ */ A("li", { children: e }, e)) }) })
|
|
297
306
|
}) : null,
|
|
298
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ j("ul", {
|
|
299
308
|
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
309
|
+
children: [/* @__PURE__ */ j("li", {
|
|
301
310
|
"aria-hidden": !0,
|
|
302
311
|
className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
|
|
303
312
|
children: [
|
|
304
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ A("span", {
|
|
305
314
|
className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
|
|
306
315
|
children: Z.productLabel
|
|
307
316
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ A("span", {
|
|
309
318
|
className: "ttw:w-24 ttw:min-w-24",
|
|
310
319
|
children: Z.quantityLabel
|
|
311
320
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ A("span", {
|
|
313
322
|
className: "ttw:w-20.5 ttw:min-w-20.5",
|
|
314
323
|
children: Z.unitLabel
|
|
315
324
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ A("span", {
|
|
317
326
|
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
318
327
|
children: Z.priceLabel
|
|
319
328
|
}),
|
|
320
|
-
|
|
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" })
|
|
321
334
|
]
|
|
322
|
-
}),
|
|
335
|
+
}), V ? /* @__PURE__ */ A("li", {
|
|
323
336
|
className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
|
|
324
|
-
children: /* @__PURE__ */
|
|
325
|
-
}) :
|
|
337
|
+
children: /* @__PURE__ */ A(T, { className: "ttw:size-5" })
|
|
338
|
+
}) : P.lineItems.map((e) => /* @__PURE__ */ A(R, {
|
|
326
339
|
formId: Q,
|
|
327
340
|
lineItem: e,
|
|
328
|
-
errors:
|
|
329
|
-
controls:
|
|
330
|
-
focusOnMount: e.id ===
|
|
331
|
-
canRemove:
|
|
332
|
-
unitOptions:
|
|
333
|
-
currencySymbol:
|
|
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,
|
|
334
347
|
labels: Z,
|
|
335
|
-
renderProductSelector:
|
|
336
|
-
onChange: (t) =>
|
|
337
|
-
onCommit: (t) =>
|
|
338
|
-
onQuantityStep: (t) =>
|
|
339
|
-
onManageUnits:
|
|
340
|
-
onRemove: () =>
|
|
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)
|
|
341
354
|
}, e.id))]
|
|
342
355
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ j(n, {
|
|
344
357
|
type: "button",
|
|
345
358
|
variant: "ghost",
|
|
346
359
|
className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
|
|
347
|
-
onClick:
|
|
348
|
-
children: [/* @__PURE__ */
|
|
349
|
-
})
|
|
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
|
+
}) })
|
|
350
385
|
]
|
|
351
386
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ A(k, {
|
|
353
388
|
idPrefix: Q,
|
|
354
|
-
openingNote:
|
|
355
|
-
closingNote:
|
|
356
|
-
openingNoteError:
|
|
357
|
-
closingNoteError:
|
|
358
|
-
disabled:
|
|
359
|
-
onOpeningNoteChange: (e) =>
|
|
360
|
-
onClosingNoteChange: (e) =>
|
|
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 }),
|
|
361
396
|
labels: Z
|
|
362
397
|
})
|
|
363
398
|
]
|
|
364
399
|
})
|
|
365
400
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ A(S, { children: /* @__PURE__ */ j("div", {
|
|
367
402
|
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ A(n, {
|
|
369
404
|
type: "button",
|
|
370
405
|
variant: "ghost",
|
|
371
|
-
onClick:
|
|
406
|
+
onClick: ce,
|
|
372
407
|
children: Z.cancelButton
|
|
373
|
-
}), /* @__PURE__ */
|
|
408
|
+
}), /* @__PURE__ */ A(n, {
|
|
374
409
|
type: "submit",
|
|
375
410
|
form: Q,
|
|
376
|
-
loading:
|
|
377
|
-
disabled:
|
|
378
|
-
children:
|
|
411
|
+
loading: H,
|
|
412
|
+
disabled: V,
|
|
413
|
+
children: M === "edit" ? Z.updateButton : Z.createButton
|
|
379
414
|
})]
|
|
380
415
|
}) })
|
|
381
416
|
]
|
|
@@ -383,4 +418,4 @@ function F({ open: i, onOpenChange: a, mode: o = "create", values: C, errors: O,
|
|
|
383
418
|
});
|
|
384
419
|
}
|
|
385
420
|
//#endregion
|
|
386
|
-
export {
|
|
421
|
+
export { z as ReceivableFormSheet, z as default };
|
|
@@ -82,6 +82,10 @@ var e = {
|
|
|
82
82
|
unitNone: "None",
|
|
83
83
|
manageUnitsOption: "Manage measure units",
|
|
84
84
|
priceLabel: "Price",
|
|
85
|
+
taxableLabel: "Taxable",
|
|
86
|
+
taxRateLabel: "Tax rate",
|
|
87
|
+
taxRatePlaceholder: "e.g. 6.25",
|
|
88
|
+
taxRateSuffix: "%",
|
|
85
89
|
decreaseQuantityButton: "Decrease quantity",
|
|
86
90
|
increaseQuantityButton: "Increase quantity",
|
|
87
91
|
addLineItemButton: "Add item",
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.201", n = "cd0c735e2c3567051bef81ad70e386b70463397e", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|