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