@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.
Files changed (46) hide show
  1. package/README.md +1 -2
  2. package/dist/index.css +3 -3
  3. package/dist/index.d.ts +12 -3
  4. package/dist/index.js +1 -1
  5. package/dist/lib/ReceivablesWidget.d.ts +12 -3
  6. package/dist/lib/ReceivablesWidget.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +245 -65
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +66 -106
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +102 -223
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +225 -0
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +182 -371
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +401 -60
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +62 -193
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +184 -31
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +31 -149
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +292 -161
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +11 -3
  19. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index4.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index5.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +4 -1
  22. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +36 -36
  23. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +597 -604
  24. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index.js +12 -11
  26. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +16 -23
  27. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index11.js +7 -8
  28. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index12.js +17 -18
  29. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index13.js +36 -0
  30. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +43 -16
  31. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +23 -13
  32. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index5.js +13 -30
  33. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index6.js +18 -23
  34. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index7.js +22 -16
  35. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index8.js +22 -15
  36. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +10 -11
  37. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +10 -9
  38. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +5 -5
  39. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/ProductSelector.js +9 -13
  40. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnits.js +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +2 -2
  42. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductSelector.js +28 -41
  43. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index.js +6 -6
  44. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +7 -15
  45. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +100 -69
  46. package/package.json +1 -1
@@ -1,254 +1,385 @@
1
- import { Button as e, Input as t, Label as n, RadioGroup as r, RadioGroupItem as i, Select as a, SelectContent as o, SelectItem as s, SelectTrigger as c, SelectValue as l, Sheet as u, SheetContent as d, SheetDescription as f, SheetFooter as p, SheetHeader as m, SheetTitle as h, Textarea as g, Typography as _ } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_FORM_SHEET_LABELS_EN as v } from "./index2.js";
3
- import { useId as y } from "react";
4
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
5
- import { PlusIcon as S, Trash2Icon as C } from "lucide-react";
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
- function w({ message: e }) {
8
- return e ? /* @__PURE__ */ b("p", {
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 T({ open: T, onOpenChange: E, mode: D = "create", values: O, errors: k, currencyOptions: A, paymentTermsOptions: j, inProgress: M, customerSelector: N, renderProductSelector: P, onChange: F, onLineItemChange: I, onAddLineItem: L, onRemoveLineItem: R, onSubmit: z, onCancel: B, labels: V }) {
14
- let H = {
15
- ...v,
16
- ...V
17
- }, U = y(), W = D === "edit", G = O.type === "invoice" || D === "edit", K = W ? "ttw:grid ttw:grid-cols-3 ttw:gap-4" : "ttw:grid ttw:grid-cols-2 ttw:gap-4";
18
- return /* @__PURE__ */ b(u, {
19
- open: T,
20
- onOpenChange: E,
21
- children: /* @__PURE__ */ x(d, {
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__ */ x(m, { children: [/* @__PURE__ */ b(h, { children: D === "edit" ? H.editTitle : H.createTitle }), /* @__PURE__ */ b(f, {
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: H.hiddenDescription
136
+ children: Z.hiddenDescription
27
137
  })] }),
28
- /* @__PURE__ */ b("form", {
29
- id: U,
138
+ /* @__PURE__ */ D("form", {
139
+ id: Q,
30
140
  onSubmit: (e) => {
31
- e.preventDefault(), e.stopPropagation(), z();
141
+ e.preventDefault(), e.stopPropagation(), J();
32
142
  },
33
- children: /* @__PURE__ */ x("div", {
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__ */ b("p", {
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__ */ x("div", {
151
+ /* @__PURE__ */ O("div", {
42
152
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
43
153
  children: [
44
- /* @__PURE__ */ b(n, { children: H.documentTypeLabel }),
45
- /* @__PURE__ */ x(r, {
154
+ /* @__PURE__ */ D(s, { children: Z.documentTypeLabel }),
155
+ /* @__PURE__ */ O(c, {
46
156
  className: "ttw:flex ttw:flex-row ttw:gap-6",
47
- disabled: D === "edit",
48
- value: O.type,
49
- onValueChange: (e) => F({ type: e }),
50
- children: [/* @__PURE__ */ x("div", {
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__ */ b(i, {
162
+ children: [/* @__PURE__ */ D(l, {
53
163
  value: "invoice",
54
- id: `${U}-invoice`
55
- }), /* @__PURE__ */ b(n, {
56
- htmlFor: `${U}-invoice`,
57
- children: H.typeInvoice
164
+ id: `${Q}-invoice`
165
+ }), /* @__PURE__ */ D(s, {
166
+ htmlFor: `${Q}-invoice`,
167
+ children: Z.typeInvoice
58
168
  })]
59
- }), /* @__PURE__ */ x("div", {
169
+ }), /* @__PURE__ */ O("div", {
60
170
  className: "ttw:flex ttw:items-center ttw:gap-2",
61
- children: [/* @__PURE__ */ b(i, {
171
+ children: [/* @__PURE__ */ D(l, {
62
172
  value: "quote",
63
- id: `${U}-quote`
64
- }), /* @__PURE__ */ b(n, {
65
- htmlFor: `${U}-quote`,
66
- children: H.typeQuote
173
+ id: `${Q}-quote`
174
+ }), /* @__PURE__ */ D(s, {
175
+ htmlFor: `${Q}-quote`,
176
+ children: Z.typeQuote
67
177
  })]
68
178
  })]
69
179
  }),
70
- /* @__PURE__ */ b(w, { message: k?.type })
180
+ /* @__PURE__ */ D(P, { message: k?.type })
71
181
  ]
72
182
  }),
73
- /* @__PURE__ */ x("div", {
183
+ /* @__PURE__ */ O("div", {
74
184
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
75
185
  children: [
76
- /* @__PURE__ */ b(n, { children: H.customerLabel }),
77
- N,
78
- /* @__PURE__ */ b("p", {
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: H.customerHint
190
+ children: Z.customerHint
81
191
  }),
82
- /* @__PURE__ */ b(w, { message: k?.customerId })
192
+ /* @__PURE__ */ D(P, { message: k?.customerId })
83
193
  ]
84
194
  }),
85
- /* @__PURE__ */ x("div", {
86
- className: K,
195
+ /* @__PURE__ */ O("div", {
196
+ className: re,
87
197
  children: [
88
- /* @__PURE__ */ x("div", {
198
+ /* @__PURE__ */ O("div", {
89
199
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
90
200
  children: [
91
- /* @__PURE__ */ b(n, {
92
- htmlFor: `${U}-currency`,
93
- children: H.currencyLabel
201
+ /* @__PURE__ */ D(s, {
202
+ htmlFor: `${Q}-currency`,
203
+ children: Z.currencyLabel
94
204
  }),
95
- /* @__PURE__ */ x(a, {
96
- value: O.currency,
97
- onValueChange: (e) => F({ currency: e }),
98
- children: [/* @__PURE__ */ b(c, {
99
- id: `${U}-currency`,
100
- children: /* @__PURE__ */ b(l, {})
101
- }), /* @__PURE__ */ b(o, { children: A.map((e) => /* @__PURE__ */ b(s, {
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__ */ b(w, { message: k?.currency })
216
+ /* @__PURE__ */ D(P, { message: k?.currency })
107
217
  ]
108
218
  }),
109
- W && /* @__PURE__ */ x("div", {
219
+ $ && /* @__PURE__ */ O("div", {
110
220
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
111
221
  children: [
112
- /* @__PURE__ */ b(n, {
113
- htmlFor: `${U}-issue-date`,
114
- children: H.issueDateLabel
222
+ /* @__PURE__ */ D(s, {
223
+ htmlFor: `${Q}-issue-date`,
224
+ children: Z.issueDateLabel
115
225
  }),
116
- /* @__PURE__ */ b(t, {
117
- id: `${U}-issue-date`,
226
+ /* @__PURE__ */ D(r, {
227
+ id: `${Q}-issue-date`,
118
228
  type: "date",
119
- value: O.issueDate,
120
- onChange: (e) => F({ issueDate: e.target.value })
229
+ value: w.issueDate,
230
+ onChange: (e) => V({ issueDate: e.target.value })
121
231
  }),
122
- /* @__PURE__ */ b(w, { message: k?.issueDate })
232
+ /* @__PURE__ */ D(P, { message: k?.issueDate })
123
233
  ]
124
234
  }),
125
- /* @__PURE__ */ x("div", {
235
+ /* @__PURE__ */ O("div", {
126
236
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
127
237
  children: [
128
- /* @__PURE__ */ b(n, {
129
- htmlFor: `${U}-due-date`,
130
- children: H.dueDateLabel
238
+ /* @__PURE__ */ D(s, {
239
+ htmlFor: `${Q}-due-date`,
240
+ children: Z.dueDateLabel
131
241
  }),
132
- /* @__PURE__ */ b(t, {
133
- id: `${U}-due-date`,
242
+ /* @__PURE__ */ D(r, {
243
+ id: `${Q}-due-date`,
134
244
  type: "date",
135
- value: O.dueDate,
136
- onChange: (e) => F({ dueDate: e.target.value })
245
+ value: w.dueDate,
246
+ onChange: (e) => V({ dueDate: e.target.value })
137
247
  }),
138
- /* @__PURE__ */ b(w, { message: k?.dueDate })
248
+ /* @__PURE__ */ D(P, { message: k?.dueDate })
139
249
  ]
140
250
  })
141
251
  ]
142
252
  }),
143
- G && /* @__PURE__ */ x("div", {
253
+ ne && /* @__PURE__ */ O("div", {
144
254
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
145
255
  children: [
146
- /* @__PURE__ */ b(n, {
147
- htmlFor: `${U}-payment-terms`,
148
- children: H.paymentTermsLabel
256
+ /* @__PURE__ */ D(s, {
257
+ htmlFor: `${Q}-payment-terms`,
258
+ children: Z.paymentTermsLabel
149
259
  }),
150
- /* @__PURE__ */ x(a, {
151
- value: O.paymentTermsId || void 0,
152
- onValueChange: (e) => F({ paymentTermsId: e === "__none__" ? "" : e }),
153
- children: [/* @__PURE__ */ b(c, {
154
- id: `${U}-payment-terms`,
155
- children: /* @__PURE__ */ b(l, { placeholder: H.paymentTermsPlaceholder })
156
- }), /* @__PURE__ */ x(o, { children: [/* @__PURE__ */ b(s, {
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: H.paymentTermsNone
159
- }), j.map((e) => /* @__PURE__ */ b(s, {
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__ */ b(w, { message: k?.paymentTermsId })
274
+ /* @__PURE__ */ D(P, { message: k?.paymentTermsId })
165
275
  ]
166
276
  }),
167
- /* @__PURE__ */ x("div", {
168
- className: "ttw:flex ttw:flex-col ttw:gap-3",
169
- children: [/* @__PURE__ */ x("div", {
170
- className: "ttw:flex ttw:items-center ttw:justify-between",
171
- children: [/* @__PURE__ */ b(_, {
172
- variant: "body2",
173
- className: "ttw:font-semibold",
174
- children: H.lineItemsHeading
175
- }), /* @__PURE__ */ x(e, {
176
- type: "button",
177
- variant: "outline",
178
- onClick: L,
179
- children: [/* @__PURE__ */ b(S, { className: "ttw:size-4" }), H.addLineItemButton]
180
- })]
181
- }), O.lineItems.map((r) => /* @__PURE__ */ x("div", {
182
- className: "ttw:grid ttw:grid-cols-[1fr_120px_40px] ttw:items-start ttw:gap-3",
183
- children: [
184
- /* @__PURE__ */ x("div", {
185
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
186
- children: [
187
- /* @__PURE__ */ b(n, { children: H.productLabel }),
188
- P(r),
189
- /* @__PURE__ */ b(w, { message: k?.lineItems?.[r.id]?.productId })
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__ */ b(n, {
196
- htmlFor: `${U}-quantity-${r.id}`,
197
- children: H.quantityLabel
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__ */ b(t, {
200
- id: `${U}-quantity-${r.id}`,
201
- inputMode: "decimal",
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__ */ b(w, { message: k?.lineItems?.[r.id]?.quantity })
319
+ w.lineItems.length > 1 && /* @__PURE__ */ D("span", { className: "ttw:w-10 ttw:min-w-10" })
206
320
  ]
207
- }),
208
- /* @__PURE__ */ b(e, {
209
- type: "button",
210
- variant: "ghost",
211
- size: "icon-sm",
212
- className: "ttw:mt-6",
213
- "aria-label": H.removeLineItemButton,
214
- onClick: () => R(r.id),
215
- disabled: O.lineItems.length <= 1,
216
- children: /* @__PURE__ */ b(C, { className: "ttw:size-4" })
217
- })
218
- ]
219
- }, r.id))]
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__ */ x("div", {
351
+ /* @__PURE__ */ O("div", {
222
352
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
223
353
  children: [
224
- /* @__PURE__ */ b(n, {
225
- htmlFor: `${U}-memo`,
226
- children: H.memoLabel
354
+ /* @__PURE__ */ D(s, {
355
+ htmlFor: `${Q}-memo`,
356
+ children: Z.memoLabel
227
357
  }),
228
- /* @__PURE__ */ b(g, {
229
- id: `${U}-memo`,
358
+ /* @__PURE__ */ D(S, {
359
+ id: `${Q}-memo`,
230
360
  rows: 3,
231
- value: O.memo,
232
- onChange: (e) => F({ memo: e.target.value })
361
+ value: w.memo,
362
+ onChange: (e) => V({ memo: e.target.value })
233
363
  }),
234
- /* @__PURE__ */ b(w, { message: k?.memo })
364
+ /* @__PURE__ */ D(P, { message: k?.memo })
235
365
  ]
236
366
  })
237
367
  ]
238
368
  })
239
369
  }),
240
- /* @__PURE__ */ b(p, { children: /* @__PURE__ */ x("div", {
370
+ /* @__PURE__ */ D(v, { children: /* @__PURE__ */ O("div", {
241
371
  className: "ttw:flex ttw:justify-end ttw:gap-2",
242
- children: [/* @__PURE__ */ b(e, {
372
+ children: [/* @__PURE__ */ D(n, {
243
373
  type: "button",
244
374
  variant: "ghost",
245
- onClick: B,
246
- children: H.cancelButton
247
- }), /* @__PURE__ */ b(e, {
375
+ onClick: Y,
376
+ children: Z.cancelButton
377
+ }), /* @__PURE__ */ D(n, {
248
378
  type: "submit",
249
- form: U,
250
- loading: M,
251
- children: D === "edit" ? H.updateButton : H.createButton
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 { T as ReceivableFormSheet, T as default };
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: "Line items",
78
- productLabel: "Product or service",
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
- addLineItemButton: "Add line item",
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/index7.js";
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/index3.js";
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
@@ -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, {