@tesouro/embedded-components-react 0.5.224 → 0.5.226
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 +335 -413
- package/dist/index.d.ts +23 -2
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +23 -2
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +45 -31
- 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/index12.js +51 -32
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +20 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +17 -202
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +220 -31
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +32 -145
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -44
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +145 -117
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +46 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +113 -87
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +58 -116
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +98 -225
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +111 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +225 -462
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +34 -41
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +627 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +39 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -112
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +75 -310
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +124 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +324 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +20 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +56 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +33 -29
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +184 -162
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +78 -69
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +20 -19
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +39 -39
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +210 -199
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +60 -52
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { Alert as e, AlertDescription as t, Button as n, Checkbox as r, Field as i, FieldContent as a, FieldError as o, FieldLabel as s, Input as c, InputGroup as l, InputGroupAddon as u, InputGroupInput as d, Label as f, RadioGroup as p, RadioGroupItem as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, Separator as b, Sheet as x, SheetContent as S, SheetDescription as C, SheetFooter as w, SheetHeader as T, SheetTitle as ee, Spinner as te, Typography as E, cn as D } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
2
|
import { RECEIVABLE_FORM_SHEET_LABELS_EN as ne } from "./index4.js";
|
|
3
|
-
import { ReceivableFormTotals as
|
|
4
|
-
import { ReceivableNotesSection as
|
|
5
|
-
import { useId as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { MinusIcon as
|
|
3
|
+
import { ReceivableFormTotals as re } from "./index23.js";
|
|
4
|
+
import { ReceivableNotesSection as O } from "./index24.js";
|
|
5
|
+
import { useId as ie } from "react";
|
|
6
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
7
|
+
import { MinusIcon as j, PlusIcon as M, Trash2Icon as N } from "lucide-react";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
return e ? /* @__PURE__ */
|
|
9
|
+
var P = "__none__", F = "__manage__";
|
|
10
|
+
function I({ message: e }) {
|
|
11
|
+
return e ? /* @__PURE__ */ k("p", {
|
|
12
12
|
className: "ttw:text-sm ttw:text-destructive",
|
|
13
13
|
children: e
|
|
14
14
|
}) : null;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function L({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, canRemove: s, unitOptions: c, currencySymbol: f, labels: p, renderProductSelector: m, onChange: b, onCommit: x, onQuantityStep: S, onManageUnits: C, onRemove: w }) {
|
|
17
17
|
let T = `${e}-line-${t.id}`;
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ A("li", {
|
|
19
19
|
className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
|
|
20
20
|
children: [
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ k("div", {
|
|
22
22
|
className: "ttw:min-w-30 ttw:flex-1",
|
|
23
23
|
children: m(t, {
|
|
24
24
|
inputId: `${T}-name`,
|
|
@@ -26,18 +26,18 @@ function ie({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, c
|
|
|
26
26
|
focusOnMount: o
|
|
27
27
|
})
|
|
28
28
|
}),
|
|
29
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ A("div", {
|
|
30
30
|
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"),
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ k("button", {
|
|
33
33
|
type: "button",
|
|
34
34
|
"aria-label": p.decreaseQuantityButton,
|
|
35
35
|
disabled: a ? !a.canDecreaseQuantity : !1,
|
|
36
36
|
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",
|
|
37
37
|
onClick: () => S(-1),
|
|
38
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ k(j, { className: "ttw:size-3.5" })
|
|
39
39
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ k("input", {
|
|
41
41
|
id: `${T}-quantity`,
|
|
42
42
|
"aria-label": p.quantityLabel,
|
|
43
43
|
"aria-invalid": !!i?.quantity || void 0,
|
|
@@ -48,56 +48,56 @@ function ie({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, c
|
|
|
48
48
|
onChange: (e) => b({ quantity: e.target.value }),
|
|
49
49
|
onBlur: () => x("quantity")
|
|
50
50
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ k("button", {
|
|
52
52
|
type: "button",
|
|
53
53
|
"aria-label": p.increaseQuantityButton,
|
|
54
54
|
disabled: a ? !a.canIncreaseQuantity : !1,
|
|
55
55
|
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",
|
|
56
56
|
onClick: () => S(1),
|
|
57
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ k(M, { className: "ttw:size-3.5" })
|
|
58
58
|
})
|
|
59
59
|
]
|
|
60
60
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
value: t.unit ||
|
|
61
|
+
/* @__PURE__ */ A(h, {
|
|
62
|
+
value: t.unit || P,
|
|
63
63
|
onValueChange: (e) => {
|
|
64
|
-
if (e ===
|
|
64
|
+
if (e === F) {
|
|
65
65
|
C?.();
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
b({ unit: e ===
|
|
68
|
+
b({ unit: e === P ? "" : e });
|
|
69
69
|
},
|
|
70
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ k(v, {
|
|
71
71
|
id: `${T}-unit`,
|
|
72
72
|
"aria-label": p.unitLabel,
|
|
73
73
|
"aria-invalid": !!i?.measureUnit || void 0,
|
|
74
74
|
className: "ttw:w-22",
|
|
75
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ k(y, {
|
|
76
76
|
className: "ttw:truncate",
|
|
77
77
|
placeholder: p.unitPlaceholder
|
|
78
78
|
})
|
|
79
|
-
}), /* @__PURE__ */
|
|
80
|
-
C && /* @__PURE__ */
|
|
81
|
-
value:
|
|
79
|
+
}), /* @__PURE__ */ A(g, { children: [
|
|
80
|
+
C && /* @__PURE__ */ A(_, {
|
|
81
|
+
value: F,
|
|
82
82
|
className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ k(M, { className: "ttw:text-primary" }), p.manageUnitsOption]
|
|
84
84
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
value:
|
|
85
|
+
/* @__PURE__ */ k(_, {
|
|
86
|
+
value: P,
|
|
87
87
|
children: p.unitNone
|
|
88
88
|
}),
|
|
89
|
-
c.map((e) => /* @__PURE__ */
|
|
89
|
+
c.map((e) => /* @__PURE__ */ k(_, {
|
|
90
90
|
value: e.value,
|
|
91
91
|
children: e.label
|
|
92
92
|
}, e.value))
|
|
93
93
|
] })]
|
|
94
94
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ A(l, {
|
|
96
96
|
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ k(u, {
|
|
98
98
|
align: "inline-start",
|
|
99
99
|
children: f
|
|
100
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ k(d, {
|
|
101
101
|
id: `${T}-price`,
|
|
102
102
|
"aria-label": p.priceLabel,
|
|
103
103
|
"aria-invalid": !!i?.price || void 0,
|
|
@@ -110,23 +110,23 @@ function ie({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, c
|
|
|
110
110
|
onBlur: () => x("price")
|
|
111
111
|
})]
|
|
112
112
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ k("div", {
|
|
114
114
|
className: "ttw:flex ttw:w-12 ttw:min-w-12 ttw:items-center ttw:justify-center",
|
|
115
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ k(r, {
|
|
116
116
|
id: `${T}-taxable`,
|
|
117
117
|
"aria-label": p.taxableLabel,
|
|
118
118
|
checked: t.taxable,
|
|
119
119
|
onCheckedChange: (e) => b({ taxable: e === !0 })
|
|
120
120
|
})
|
|
121
121
|
}),
|
|
122
|
-
s && /* @__PURE__ */
|
|
122
|
+
s && /* @__PURE__ */ k(n, {
|
|
123
123
|
type: "button",
|
|
124
124
|
variant: "ghost",
|
|
125
125
|
size: "sm",
|
|
126
126
|
"aria-label": p.removeLineItemButton,
|
|
127
127
|
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",
|
|
128
128
|
onClick: w,
|
|
129
|
-
children: /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ k(N, {})
|
|
130
130
|
})
|
|
131
131
|
]
|
|
132
132
|
});
|
|
@@ -141,20 +141,20 @@ function ae({ inputId: e, discountType: t, value: n, error: r, currencySymbol: c
|
|
|
141
141
|
label: p.discountPercentageOption,
|
|
142
142
|
ariaLabel: p.discountPercentageOptionAriaLabel
|
|
143
143
|
}];
|
|
144
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ A(i, {
|
|
145
145
|
className: "ttw:flex-col",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ A(a, {
|
|
147
147
|
className: "ttw:flex-row ttw:items-center ttw:justify-end",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ k(s, {
|
|
149
149
|
htmlFor: e,
|
|
150
150
|
className: D(r && "ttw:text-destructive"),
|
|
151
151
|
children: p.discountLabel
|
|
152
|
-
}), /* @__PURE__ */
|
|
152
|
+
}), /* @__PURE__ */ A(l, {
|
|
153
153
|
className: "ttw:w-40 ttw:overflow-hidden",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ k(u, {
|
|
155
155
|
align: "inline-start",
|
|
156
156
|
className: "ttw:gap-0 ttw:self-stretch ttw:p-0 ttw:has-[>button]:ml-0",
|
|
157
|
-
children: y.map((e) => /* @__PURE__ */
|
|
157
|
+
children: y.map((e) => /* @__PURE__ */ k("button", {
|
|
158
158
|
type: "button",
|
|
159
159
|
"aria-label": e.ariaLabel,
|
|
160
160
|
"aria-pressed": t === e.type,
|
|
@@ -163,7 +163,7 @@ function ae({ inputId: e, discountType: t, value: n, error: r, currencySymbol: c
|
|
|
163
163
|
onClick: () => h(e.type),
|
|
164
164
|
children: e.label
|
|
165
165
|
}, e.type))
|
|
166
|
-
}), /* @__PURE__ */
|
|
166
|
+
}), /* @__PURE__ */ k(d, {
|
|
167
167
|
id: e,
|
|
168
168
|
type: "text",
|
|
169
169
|
inputMode: "decimal",
|
|
@@ -177,222 +177,223 @@ function ae({ inputId: e, discountType: t, value: n, error: r, currencySymbol: c
|
|
|
177
177
|
onBlur: _
|
|
178
178
|
})]
|
|
179
179
|
})]
|
|
180
|
-
}), r && /* @__PURE__ */
|
|
180
|
+
}), r && /* @__PURE__ */ k(o, {
|
|
181
181
|
id: v,
|
|
182
182
|
className: "ttw:text-right",
|
|
183
183
|
children: r
|
|
184
184
|
})]
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
function R({ open: r, onOpenChange:
|
|
187
|
+
function R({ open: r, onOpenChange: j, mode: N = "create", values: P, errors: F, currencyOptions: R, unitOptions: oe, currencySymbol: z, lineItemControls: B, autoFocusLineItemId: V, lineItemsLoading: H, inProgress: U, customerSelector: W, renderProductSelector: G, onChange: K, onLineItemChange: q, onLineItemCommit: se, onLineItemQuantityStep: ce, onTaxRateCommit: J, onDiscountFocus: le, onDiscountCommit: ue, totals: de, onManageUnits: fe, onAddLineItem: pe, onRemoveLineItem: me, showDueDateField: Y, billingSection: he, remindersSection: ge, bankAccountSection: _e, attachmentsSection: ve, cancelDisabled: ye, draftButtonLabel: X, draftDisabled: be, primaryButtonLabel: xe, primaryDisabled: Se, scrollContainerRef: Ce, onSubmit: we, onDraftClick: Te, onPrimaryClick: Ee, onCancel: De, labels: Oe }) {
|
|
188
188
|
let Z = {
|
|
189
189
|
...ne,
|
|
190
|
-
...
|
|
191
|
-
}, Q =
|
|
192
|
-
return /* @__PURE__ */
|
|
190
|
+
...Oe
|
|
191
|
+
}, Q = ie(), $ = N === "edit", ke = D("ttw:grid ttw:gap-4", $ && Y ? "ttw:grid-cols-3" : "ttw:grid-cols-2");
|
|
192
|
+
return /* @__PURE__ */ k(x, {
|
|
193
193
|
open: r,
|
|
194
|
-
onOpenChange:
|
|
195
|
-
children: /* @__PURE__ */
|
|
194
|
+
onOpenChange: j,
|
|
195
|
+
children: /* @__PURE__ */ A(S, {
|
|
196
|
+
ref: Ce,
|
|
196
197
|
className: "ttw:w-180 ttw:overflow-y-auto ttw:sm:max-w-180",
|
|
197
198
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ A(T, { children: [/* @__PURE__ */ k(ee, { children: N === "edit" ? Z.editTitle : Z.createTitle }), /* @__PURE__ */ k(C, {
|
|
199
200
|
className: "ttw:sr-only",
|
|
200
201
|
children: Z.hiddenDescription
|
|
201
202
|
})] }),
|
|
202
203
|
/* @__PURE__ */ A("form", {
|
|
203
204
|
id: Q,
|
|
204
205
|
onSubmit: (e) => {
|
|
205
|
-
e.preventDefault(), e.stopPropagation(),
|
|
206
|
+
e.preventDefault(), e.stopPropagation(), we();
|
|
206
207
|
},
|
|
207
|
-
children: /* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ k("button", {
|
|
209
|
+
type: "submit",
|
|
210
|
+
className: "ttw:sr-only",
|
|
211
|
+
tabIndex: -1,
|
|
212
|
+
"aria-hidden": "true"
|
|
213
|
+
}), /* @__PURE__ */ A("div", {
|
|
208
214
|
className: "ttw:flex ttw:flex-col ttw:gap-5 ttw:px-6 ttw:pb-6",
|
|
209
215
|
children: [
|
|
210
|
-
|
|
211
|
-
role: "alert",
|
|
212
|
-
className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
|
|
213
|
-
children: F.form
|
|
214
|
-
}),
|
|
215
|
-
/* @__PURE__ */ j("div", {
|
|
216
|
+
/* @__PURE__ */ A("div", {
|
|
216
217
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
217
218
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ k(f, { children: Z.documentTypeLabel }),
|
|
220
|
+
/* @__PURE__ */ A(p, {
|
|
220
221
|
className: "ttw:flex ttw:flex-row ttw:gap-6",
|
|
221
|
-
disabled:
|
|
222
|
+
disabled: N === "edit",
|
|
222
223
|
value: P.type,
|
|
223
224
|
onValueChange: (e) => K({ type: e }),
|
|
224
|
-
children: [/* @__PURE__ */
|
|
225
|
+
children: [/* @__PURE__ */ A("div", {
|
|
225
226
|
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
227
|
+
children: [/* @__PURE__ */ k(m, {
|
|
227
228
|
value: "invoice",
|
|
228
229
|
id: `${Q}-invoice`
|
|
229
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ k(f, {
|
|
230
231
|
htmlFor: `${Q}-invoice`,
|
|
231
232
|
children: Z.typeInvoice
|
|
232
233
|
})]
|
|
233
|
-
}), /* @__PURE__ */
|
|
234
|
+
}), /* @__PURE__ */ A("div", {
|
|
234
235
|
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ k(m, {
|
|
236
237
|
value: "quote",
|
|
237
238
|
id: `${Q}-quote`
|
|
238
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ k(f, {
|
|
239
240
|
htmlFor: `${Q}-quote`,
|
|
240
241
|
children: Z.typeQuote
|
|
241
242
|
})]
|
|
242
243
|
})]
|
|
243
244
|
}),
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ k(I, { message: F?.type })
|
|
245
246
|
]
|
|
246
247
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ A("div", {
|
|
248
249
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
249
250
|
children: [
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ k(f, { children: Z.customerLabel }),
|
|
251
252
|
W,
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ k("p", {
|
|
253
254
|
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
254
255
|
children: Z.customerHint
|
|
255
256
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ k(I, { message: F?.customerId })
|
|
257
258
|
]
|
|
258
259
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
className:
|
|
260
|
+
/* @__PURE__ */ A("div", {
|
|
261
|
+
className: ke,
|
|
261
262
|
children: [
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ A("div", {
|
|
263
264
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
264
265
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ k(f, {
|
|
266
267
|
htmlFor: `${Q}-currency`,
|
|
267
268
|
children: Z.currencyLabel
|
|
268
269
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ A(h, {
|
|
270
271
|
value: P.currency,
|
|
271
272
|
onValueChange: (e) => K({ currency: e }),
|
|
272
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ k(v, {
|
|
273
274
|
id: `${Q}-currency`,
|
|
274
|
-
children: /* @__PURE__ */
|
|
275
|
-
}), /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ k(y, {})
|
|
276
|
+
}), /* @__PURE__ */ k(g, { children: R.map((e) => /* @__PURE__ */ k(_, {
|
|
276
277
|
value: e.value,
|
|
277
278
|
children: e.label
|
|
278
279
|
}, e.value)) })]
|
|
279
280
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ k(I, { message: F?.currency })
|
|
281
282
|
]
|
|
282
283
|
}),
|
|
283
|
-
$ && /* @__PURE__ */
|
|
284
|
+
$ && /* @__PURE__ */ A("div", {
|
|
284
285
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
285
286
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ k(f, {
|
|
287
288
|
htmlFor: `${Q}-issue-date`,
|
|
288
289
|
children: Z.issueDateLabel
|
|
289
290
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ k(c, {
|
|
291
292
|
id: `${Q}-issue-date`,
|
|
292
293
|
type: "date",
|
|
293
294
|
value: P.issueDate,
|
|
294
295
|
onChange: (e) => K({ issueDate: e.target.value })
|
|
295
296
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ k(I, { message: F?.issueDate })
|
|
297
298
|
]
|
|
298
299
|
}),
|
|
299
|
-
|
|
300
|
+
Y && /* @__PURE__ */ A("div", {
|
|
300
301
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
301
302
|
children: [
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ k(f, {
|
|
303
304
|
htmlFor: `${Q}-due-date`,
|
|
304
305
|
children: Z.dueDateLabel
|
|
305
306
|
}),
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ k(c, {
|
|
307
308
|
id: `${Q}-due-date`,
|
|
308
309
|
type: "date",
|
|
309
310
|
value: P.dueDate,
|
|
310
311
|
onChange: (e) => K({ dueDate: e.target.value })
|
|
311
312
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ k(I, { message: F?.dueDate })
|
|
313
314
|
]
|
|
314
315
|
})
|
|
315
316
|
]
|
|
316
317
|
}),
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
/* @__PURE__ */
|
|
318
|
+
he,
|
|
319
|
+
ge,
|
|
320
|
+
/* @__PURE__ */ A("div", {
|
|
320
321
|
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
|
|
321
322
|
children: [
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ A("div", {
|
|
323
324
|
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ k(E, {
|
|
325
326
|
variant: "h4",
|
|
326
327
|
children: Z.lineItemsHeading
|
|
327
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ k(E, {
|
|
328
329
|
variant: "body2",
|
|
329
330
|
color: "muted",
|
|
330
331
|
className: "ttw:font-medium",
|
|
331
332
|
children: Z.lineItemsDescription
|
|
332
333
|
})]
|
|
333
334
|
}),
|
|
334
|
-
F?.lineItemsSummary?.length ? /* @__PURE__ */
|
|
335
|
+
F?.lineItemsSummary?.length ? /* @__PURE__ */ k(e, {
|
|
335
336
|
variant: "destructive",
|
|
336
337
|
className: "ttw:mb-2",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ k(t, { children: /* @__PURE__ */ k("ul", { children: F.lineItemsSummary.map((e) => /* @__PURE__ */ k("li", { children: e }, e)) }) })
|
|
338
339
|
}) : null,
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ A("ul", {
|
|
340
341
|
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ A("li", {
|
|
342
343
|
"aria-hidden": !0,
|
|
343
344
|
className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
|
|
344
345
|
children: [
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ k("span", {
|
|
346
347
|
className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
|
|
347
348
|
children: Z.productLabel
|
|
348
349
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ k("span", {
|
|
350
351
|
className: "ttw:w-24 ttw:min-w-24",
|
|
351
352
|
children: Z.quantityLabel
|
|
352
353
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ k("span", {
|
|
354
355
|
className: "ttw:w-20.5 ttw:min-w-20.5",
|
|
355
356
|
children: Z.unitLabel
|
|
356
357
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ k("span", {
|
|
358
359
|
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
359
360
|
children: Z.priceLabel
|
|
360
361
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ k("span", {
|
|
362
363
|
className: "ttw:w-12 ttw:min-w-12",
|
|
363
364
|
children: Z.taxableLabel
|
|
364
365
|
}),
|
|
365
|
-
P.lineItems.length > 1 && /* @__PURE__ */
|
|
366
|
+
P.lineItems.length > 1 && /* @__PURE__ */ k("span", { className: "ttw:w-10 ttw:min-w-10" })
|
|
366
367
|
]
|
|
367
|
-
}), H ? /* @__PURE__ */
|
|
368
|
+
}), H ? /* @__PURE__ */ k("li", {
|
|
368
369
|
className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
|
|
369
|
-
children: /* @__PURE__ */
|
|
370
|
-
}) : P.lineItems.map((e) => /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ k(te, { className: "ttw:size-5" })
|
|
371
|
+
}) : P.lineItems.map((e) => /* @__PURE__ */ k(L, {
|
|
371
372
|
formId: Q,
|
|
372
373
|
lineItem: e,
|
|
373
374
|
errors: F?.lineItems?.[e.id],
|
|
374
375
|
controls: B?.[e.id],
|
|
375
376
|
focusOnMount: e.id === V,
|
|
376
377
|
canRemove: P.lineItems.length > 1,
|
|
377
|
-
unitOptions:
|
|
378
|
+
unitOptions: oe,
|
|
378
379
|
currencySymbol: z,
|
|
379
380
|
labels: Z,
|
|
380
381
|
renderProductSelector: G,
|
|
381
382
|
onChange: (t) => q(e.id, t),
|
|
382
|
-
onCommit: (t) =>
|
|
383
|
-
onQuantityStep: (t) =>
|
|
384
|
-
onManageUnits:
|
|
385
|
-
onRemove: () =>
|
|
383
|
+
onCommit: (t) => se(e.id, t),
|
|
384
|
+
onQuantityStep: (t) => ce(e.id, t),
|
|
385
|
+
onManageUnits: fe,
|
|
386
|
+
onRemove: () => me(e.id)
|
|
386
387
|
}, e.id))]
|
|
387
388
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ A(n, {
|
|
389
390
|
type: "button",
|
|
390
391
|
variant: "ghost",
|
|
391
392
|
className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
|
|
392
|
-
onClick:
|
|
393
|
-
children: [/* @__PURE__ */
|
|
393
|
+
onClick: pe,
|
|
394
|
+
children: [/* @__PURE__ */ k(M, { className: "ttw:size-5 ttw:text-primary" }), Z.addLineItemButton]
|
|
394
395
|
}),
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ k(ae, {
|
|
396
397
|
inputId: `${Q}-discount`,
|
|
397
398
|
discountType: P.discountType,
|
|
398
399
|
value: P.discount,
|
|
@@ -402,40 +403,50 @@ function R({ open: r, onOpenChange: o, mode: M = "create", values: P, errors: F,
|
|
|
402
403
|
labels: Z,
|
|
403
404
|
onChange: (e) => K({ discount: e }),
|
|
404
405
|
onTypeChange: (e) => K({ discountType: e }),
|
|
405
|
-
onFocus:
|
|
406
|
-
onBlur:
|
|
406
|
+
onFocus: le,
|
|
407
|
+
onBlur: ue
|
|
407
408
|
}),
|
|
408
|
-
/* @__PURE__ */ A(i, {
|
|
409
|
-
className: "ttw:flex-
|
|
410
|
-
children: [/* @__PURE__ */ A(
|
|
411
|
-
|
|
412
|
-
children:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
className: "ttw:
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
409
|
+
/* @__PURE__ */ A(i, {
|
|
410
|
+
className: "ttw:flex-col",
|
|
411
|
+
children: [/* @__PURE__ */ A(a, {
|
|
412
|
+
className: "ttw:flex-row ttw:justify-end",
|
|
413
|
+
children: [/* @__PURE__ */ k(s, {
|
|
414
|
+
htmlFor: `${Q}-tax-rate`,
|
|
415
|
+
className: D(F?.taxRate && "ttw:text-destructive"),
|
|
416
|
+
children: Z.taxRateLabel
|
|
417
|
+
}), /* @__PURE__ */ A(l, {
|
|
418
|
+
className: "ttw:w-40 ttw:has-[>[data-align=inline-end]]:[&>input]:pr-0",
|
|
419
|
+
children: [/* @__PURE__ */ k(d, {
|
|
420
|
+
id: `${Q}-tax-rate`,
|
|
421
|
+
className: "ttw:text-right",
|
|
422
|
+
placeholder: Z.taxRatePlaceholder,
|
|
423
|
+
type: "text",
|
|
424
|
+
inputMode: "decimal",
|
|
425
|
+
"aria-invalid": !!F?.taxRate || void 0,
|
|
426
|
+
"aria-describedby": F?.taxRate ? `${Q}-tax-rate-error` : void 0,
|
|
427
|
+
value: P.taxRate,
|
|
428
|
+
onChange: (e) => K({ taxRate: e.target.value }),
|
|
429
|
+
onBlur: J
|
|
430
|
+
}), /* @__PURE__ */ k(u, {
|
|
431
|
+
align: "inline-end",
|
|
432
|
+
children: Z.taxRateSuffix
|
|
433
|
+
})]
|
|
427
434
|
})]
|
|
435
|
+
}), F?.taxRate && /* @__PURE__ */ k(o, {
|
|
436
|
+
id: `${Q}-tax-rate-error`,
|
|
437
|
+
className: "ttw:text-right",
|
|
438
|
+
children: F.taxRate
|
|
428
439
|
})]
|
|
429
|
-
})
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
totals:
|
|
440
|
+
}),
|
|
441
|
+
/* @__PURE__ */ k(b, {}),
|
|
442
|
+
/* @__PURE__ */ k(re, {
|
|
443
|
+
totals: de,
|
|
433
444
|
labels: Z
|
|
434
445
|
})
|
|
435
446
|
]
|
|
436
447
|
}),
|
|
437
|
-
|
|
438
|
-
/* @__PURE__ */
|
|
448
|
+
_e,
|
|
449
|
+
/* @__PURE__ */ k(O, {
|
|
439
450
|
idPrefix: Q,
|
|
440
451
|
openingNote: P.openingNote,
|
|
441
452
|
closingNote: P.closingNote,
|
|
@@ -446,25 +457,36 @@ function R({ open: r, onOpenChange: o, mode: M = "create", values: P, errors: F,
|
|
|
446
457
|
onClosingNoteChange: (e) => K({ closingNote: e }),
|
|
447
458
|
labels: Z
|
|
448
459
|
}),
|
|
449
|
-
|
|
460
|
+
ve
|
|
450
461
|
]
|
|
451
|
-
})
|
|
462
|
+
})]
|
|
452
463
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ k(w, { children: /* @__PURE__ */ A("div", {
|
|
454
465
|
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
455
|
-
children: [
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
466
|
+
children: [
|
|
467
|
+
/* @__PURE__ */ k(n, {
|
|
468
|
+
type: "button",
|
|
469
|
+
variant: "ghost",
|
|
470
|
+
disabled: ye,
|
|
471
|
+
onClick: De,
|
|
472
|
+
children: Z.cancelButton
|
|
473
|
+
}),
|
|
474
|
+
X && /* @__PURE__ */ k(n, {
|
|
475
|
+
type: "submit",
|
|
476
|
+
form: Q,
|
|
477
|
+
variant: "secondary",
|
|
478
|
+
disabled: be,
|
|
479
|
+
onClick: Te,
|
|
480
|
+
children: X
|
|
481
|
+
}),
|
|
482
|
+
/* @__PURE__ */ k(n, {
|
|
483
|
+
type: "submit",
|
|
484
|
+
form: Q,
|
|
485
|
+
disabled: Se,
|
|
486
|
+
onClick: Ee,
|
|
487
|
+
children: xe
|
|
488
|
+
})
|
|
489
|
+
]
|
|
468
490
|
}) })
|
|
469
491
|
]
|
|
470
492
|
})
|
|
@@ -22,7 +22,7 @@ var r = {
|
|
|
22
22
|
templateSettingsButton: "Template settings",
|
|
23
23
|
searchPlaceholder: "Search by number or customer",
|
|
24
24
|
statusFilterAll: "All statuses",
|
|
25
|
-
statusCardsAll:
|
|
25
|
+
statusCardsAll: i.all,
|
|
26
26
|
tabInvoices: "Invoices",
|
|
27
27
|
tabQuotes: "Quotes",
|
|
28
28
|
tabCreditNotes: "Credit notes",
|
|
@@ -104,8 +104,6 @@ var r = {
|
|
|
104
104
|
addLineItemButton: "Add item",
|
|
105
105
|
removeLineItemButton: "Remove line item",
|
|
106
106
|
cancelButton: "Cancel",
|
|
107
|
-
createButton: "Create",
|
|
108
|
-
updateButton: "Update",
|
|
109
107
|
notesHeading: "Notes",
|
|
110
108
|
notesDescription: "Provide additional information for your customer.",
|
|
111
109
|
optionalSuffix: "(optional)",
|