@tesouro/embedded-components-react 0.5.258 → 0.5.260
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 +2 -1
- package/dist/index.css +109 -9
- package/dist/index.d.ts +41 -10
- package/dist/lib/ReceivablesWidget.d.ts +41 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +42 -94
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +91 -76
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +67 -173
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +186 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +28 -72
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +128 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +66 -28
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +28 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +24 -168
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +173 -44
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +274 -267
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +99 -95
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +28 -25
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +49 -43
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/unsavedChanges.js +13 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +77 -72
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +363 -295
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePreview.js +36 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +12 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +21 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +68 -64
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +383 -379
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +8 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +258 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +2 -100
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +95 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +23 -231
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +237 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +3 -249
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +234 -78
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +87 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +49 -349
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +359 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +45 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -40
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +247 -214
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +175 -147
- 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/feature/dist/index.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +109 -89
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +0 -4
|
@@ -1,498 +1,502 @@
|
|
|
1
|
-
import { Alert as e, AlertDescription as t, Button as n, Checkbox as r,
|
|
2
|
-
import {
|
|
3
|
-
import { ReceivableFormTotals as
|
|
4
|
-
import { ReceivableNotesSection as
|
|
5
|
-
import { useId as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { MinusIcon as
|
|
1
|
+
import { Alert as e, AlertDescription as t, Button as n, Checkbox as r, Dialog as i, DialogContent as a, DialogDescription as o, DialogFooter as s, DialogHeader as c, DialogTitle as l, Field as u, FieldContent as d, FieldError as f, FieldLabel as p, Input as m, Label as h, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b, Separator as x, Spinner as S, Typography as C, cn as w } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { RECEIVABLE_FORM_DIALOG_LABELS_EN as ee } from "./index13.js";
|
|
3
|
+
import { ReceivableFormTotals as te } from "./index36.js";
|
|
4
|
+
import { ReceivableNotesSection as T } from "./index37.js";
|
|
5
|
+
import { useId as ne } from "react";
|
|
6
|
+
import { Fragment as re, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
7
|
+
import { MinusIcon as O, PlusIcon as k, Trash2Icon as A, XIcon as ie } from "lucide-react";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
return e ? /* @__PURE__ */
|
|
9
|
+
var j = "__none__", M = "__manage__", N = "ttw:flex ttw:h-9 ttw:min-w-0 ttw:items-center ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs ttw:transition-[color,box-shadow] ttw:has-[input:focus-visible]:border-ring ttw:has-[input:focus-visible]:ring-[3px] ttw:has-[input:focus-visible]:ring-ring/50 ttw:has-[[aria-invalid=true]]:border-destructive", P = "ttw:h-full ttw:min-w-0 ttw:flex-1 ttw:bg-transparent ttw:text-right ttw:text-base ttw:outline-none ttw:placeholder:text-muted-foreground ttw:disabled:cursor-not-allowed ttw:disabled:opacity-50 ttw:md:text-sm", F = "ttw:flex ttw:items-center ttw:text-sm ttw:font-medium ttw:text-muted-foreground ttw:select-none", I = "ttw:flex ttw:size-6 ttw:shrink-0 ttw:cursor-pointer ttw:items-center ttw:justify-center ttw:rounded-[calc(var(--radius)-5px)] ttw:text-muted-foreground ttw:outline-none ttw:transition-all ttw:hover:bg-accent ttw:hover:text-accent-foreground ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-ring/50 ttw:disabled:pointer-events-none ttw:disabled:opacity-50";
|
|
10
|
+
function L({ message: e }) {
|
|
11
|
+
return e ? /* @__PURE__ */ E("p", {
|
|
12
12
|
className: "ttw:text-sm ttw:text-destructive",
|
|
13
13
|
children: e
|
|
14
14
|
}) : null;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
return /* @__PURE__ */
|
|
16
|
+
function ae({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, canRemove: s, unitOptions: c, currencySymbol: l, labels: u, renderProductSelector: d, onChange: f, onCommit: p, onQuantityStep: m, onManageUnits: h, onRemove: x }) {
|
|
17
|
+
let S = `${e}-line-${t.id}`;
|
|
18
|
+
return /* @__PURE__ */ D("li", {
|
|
19
19
|
className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
|
|
20
20
|
children: [
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ E("div", {
|
|
22
22
|
className: "ttw:min-w-30 ttw:flex-1",
|
|
23
|
-
children:
|
|
24
|
-
inputId: `${
|
|
23
|
+
children: d(t, {
|
|
24
|
+
inputId: `${S}-name`,
|
|
25
25
|
invalid: !!i?.name,
|
|
26
26
|
focusOnMount: o
|
|
27
27
|
})
|
|
28
28
|
}),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
className:
|
|
29
|
+
/* @__PURE__ */ D("div", {
|
|
30
|
+
className: w(N, "ttw:w-26 ttw:min-w-26 ttw:px-[0.3rem]"),
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ E("button", {
|
|
33
33
|
type: "button",
|
|
34
|
-
"aria-label":
|
|
34
|
+
"aria-label": u.decreaseQuantityButton,
|
|
35
35
|
disabled: a ? !a.canDecreaseQuantity : !1,
|
|
36
|
-
className:
|
|
37
|
-
onClick: () =>
|
|
38
|
-
children: /* @__PURE__ */
|
|
36
|
+
className: I,
|
|
37
|
+
onClick: () => m(-1),
|
|
38
|
+
children: /* @__PURE__ */ E(O, { className: "ttw:size-3.5" })
|
|
39
39
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
id: `${
|
|
42
|
-
"aria-label":
|
|
40
|
+
/* @__PURE__ */ E("input", {
|
|
41
|
+
id: `${S}-quantity`,
|
|
42
|
+
"aria-label": u.quantityLabel,
|
|
43
43
|
"aria-invalid": !!i?.quantity || void 0,
|
|
44
44
|
type: "text",
|
|
45
45
|
inputMode: "decimal",
|
|
46
46
|
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",
|
|
47
47
|
value: t.quantity,
|
|
48
|
-
onChange: (e) =>
|
|
49
|
-
onBlur: () =>
|
|
48
|
+
onChange: (e) => f({ quantity: e.target.value }),
|
|
49
|
+
onBlur: () => p("quantity")
|
|
50
50
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ E("button", {
|
|
52
52
|
type: "button",
|
|
53
|
-
"aria-label":
|
|
53
|
+
"aria-label": u.increaseQuantityButton,
|
|
54
54
|
disabled: a ? !a.canIncreaseQuantity : !1,
|
|
55
|
-
className:
|
|
56
|
-
onClick: () =>
|
|
57
|
-
children: /* @__PURE__ */ k
|
|
55
|
+
className: I,
|
|
56
|
+
onClick: () => m(1),
|
|
57
|
+
children: /* @__PURE__ */ E(k, { className: "ttw:size-3.5" })
|
|
58
58
|
})
|
|
59
59
|
]
|
|
60
60
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
value: t.unit ||
|
|
61
|
+
/* @__PURE__ */ D(g, {
|
|
62
|
+
value: t.unit || j,
|
|
63
63
|
onValueChange: (e) => {
|
|
64
|
-
if (e ===
|
|
65
|
-
|
|
64
|
+
if (e === M) {
|
|
65
|
+
h?.();
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
f({ unit: e === j ? "" : e });
|
|
69
69
|
},
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
-
id: `${
|
|
72
|
-
"aria-label":
|
|
70
|
+
children: [/* @__PURE__ */ E(y, {
|
|
71
|
+
id: `${S}-unit`,
|
|
72
|
+
"aria-label": u.unitLabel,
|
|
73
73
|
"aria-invalid": !!i?.measureUnit || void 0,
|
|
74
74
|
className: "ttw:w-22",
|
|
75
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ E(b, {
|
|
76
76
|
className: "ttw:truncate",
|
|
77
|
-
placeholder:
|
|
77
|
+
placeholder: u.unitPlaceholder
|
|
78
78
|
})
|
|
79
|
-
}), /* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
value:
|
|
79
|
+
}), /* @__PURE__ */ D(_, { children: [
|
|
80
|
+
h && /* @__PURE__ */ D(v, {
|
|
81
|
+
value: M,
|
|
82
82
|
className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
|
|
83
|
-
children: [/* @__PURE__ */ k
|
|
83
|
+
children: [/* @__PURE__ */ E(k, { className: "ttw:text-primary" }), u.manageUnitsOption]
|
|
84
84
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
value:
|
|
87
|
-
children:
|
|
85
|
+
/* @__PURE__ */ E(v, {
|
|
86
|
+
value: j,
|
|
87
|
+
children: u.unitNone
|
|
88
88
|
}),
|
|
89
|
-
c.map((e) => /* @__PURE__ */
|
|
89
|
+
c.map((e) => /* @__PURE__ */ E(v, {
|
|
90
90
|
value: e.value,
|
|
91
91
|
children: e.label
|
|
92
92
|
}, e.value))
|
|
93
93
|
] })]
|
|
94
94
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
98
|
-
|
|
99
|
-
children:
|
|
100
|
-
}), /* @__PURE__ */
|
|
101
|
-
id: `${
|
|
102
|
-
"aria-label":
|
|
95
|
+
/* @__PURE__ */ D("div", {
|
|
96
|
+
className: w(N, "ttw:w-full ttw:max-w-41 ttw:min-w-29"),
|
|
97
|
+
children: [/* @__PURE__ */ E("span", {
|
|
98
|
+
className: w(F, "ttw:pl-3"),
|
|
99
|
+
children: l
|
|
100
|
+
}), /* @__PURE__ */ E("input", {
|
|
101
|
+
id: `${S}-price`,
|
|
102
|
+
"aria-label": u.priceLabel,
|
|
103
103
|
"aria-invalid": !!i?.price || void 0,
|
|
104
|
-
"data-has-start-addon": !0,
|
|
105
104
|
type: "text",
|
|
106
105
|
inputMode: "decimal",
|
|
107
|
-
className: "ttw:
|
|
106
|
+
className: w(P, "ttw:pr-3 ttw:pl-2"),
|
|
108
107
|
value: t.price,
|
|
109
|
-
onChange: (e) =>
|
|
110
|
-
onBlur: () =>
|
|
108
|
+
onChange: (e) => f({ price: e.target.value }),
|
|
109
|
+
onBlur: () => p("price")
|
|
111
110
|
})]
|
|
112
111
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ E("div", {
|
|
114
113
|
className: "ttw:flex ttw:w-12 ttw:min-w-12 ttw:items-center ttw:justify-center",
|
|
115
|
-
children: /* @__PURE__ */
|
|
116
|
-
id: `${
|
|
117
|
-
"aria-label":
|
|
114
|
+
children: /* @__PURE__ */ E(r, {
|
|
115
|
+
id: `${S}-taxable`,
|
|
116
|
+
"aria-label": u.taxableLabel,
|
|
118
117
|
checked: t.taxable,
|
|
119
|
-
onCheckedChange: (e) =>
|
|
118
|
+
onCheckedChange: (e) => f({ taxable: e === !0 })
|
|
120
119
|
})
|
|
121
120
|
}),
|
|
122
|
-
s && /* @__PURE__ */
|
|
121
|
+
s && /* @__PURE__ */ E(n, {
|
|
123
122
|
type: "button",
|
|
124
123
|
variant: "ghost",
|
|
125
124
|
size: "sm",
|
|
126
|
-
"aria-label":
|
|
125
|
+
"aria-label": u.removeLineItemButton,
|
|
127
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",
|
|
128
|
-
onClick:
|
|
129
|
-
children: /* @__PURE__ */
|
|
127
|
+
onClick: x,
|
|
128
|
+
children: /* @__PURE__ */ E(A, {})
|
|
130
129
|
})
|
|
131
130
|
]
|
|
132
131
|
});
|
|
133
132
|
}
|
|
134
|
-
function
|
|
135
|
-
let
|
|
133
|
+
function oe({ inputId: e, discountType: t, value: n, error: r, currencySymbol: i, disabled: a, labels: o, onChange: s, onTypeChange: c, onFocus: l, onBlur: m }) {
|
|
134
|
+
let h = `${e}-error`, g = [{
|
|
136
135
|
type: "amount",
|
|
137
|
-
label:
|
|
138
|
-
ariaLabel:
|
|
136
|
+
label: i,
|
|
137
|
+
ariaLabel: o.discountAmountOptionAriaLabel
|
|
139
138
|
}, {
|
|
140
139
|
type: "percentage",
|
|
141
|
-
label:
|
|
142
|
-
ariaLabel:
|
|
140
|
+
label: o.discountPercentageOption,
|
|
141
|
+
ariaLabel: o.discountPercentageOptionAriaLabel
|
|
143
142
|
}];
|
|
144
|
-
return /* @__PURE__ */
|
|
143
|
+
return /* @__PURE__ */ D(u, {
|
|
145
144
|
className: "ttw:flex-col",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ D(d, {
|
|
147
146
|
className: "ttw:flex-row ttw:items-center ttw:justify-end",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ E(p, {
|
|
149
148
|
htmlFor: e,
|
|
150
|
-
className:
|
|
151
|
-
children:
|
|
152
|
-
}), /* @__PURE__ */
|
|
153
|
-
className: "ttw:w-40 ttw:overflow-hidden",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
children: y.map((e) => /* @__PURE__ */ k("button", {
|
|
149
|
+
className: w(r && "ttw:text-destructive"),
|
|
150
|
+
children: o.discountLabel
|
|
151
|
+
}), /* @__PURE__ */ D("div", {
|
|
152
|
+
className: w(N, "ttw:w-40 ttw:overflow-hidden"),
|
|
153
|
+
children: [/* @__PURE__ */ E("div", {
|
|
154
|
+
className: w(F, "ttw:items-stretch ttw:self-stretch"),
|
|
155
|
+
children: g.map((e) => /* @__PURE__ */ E("button", {
|
|
158
156
|
type: "button",
|
|
159
157
|
"aria-label": e.ariaLabel,
|
|
160
158
|
"aria-pressed": t === e.type,
|
|
161
|
-
disabled:
|
|
162
|
-
className:
|
|
163
|
-
onClick: () =>
|
|
159
|
+
disabled: a,
|
|
160
|
+
className: w("ttw:h-full ttw:w-9 ttw:cursor-pointer ttw:border-r ttw:border-input ttw:text-sm ttw:transition-colors ttw:disabled:pointer-events-none ttw:disabled:opacity-50", t === e.type ? "ttw:bg-primary ttw:text-primary-foreground" : "ttw:text-muted-foreground ttw:hover:bg-muted ttw:hover:text-foreground"),
|
|
161
|
+
onClick: () => c(e.type),
|
|
164
162
|
children: e.label
|
|
165
163
|
}, e.type))
|
|
166
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ E("input", {
|
|
167
165
|
id: e,
|
|
168
166
|
type: "text",
|
|
169
167
|
inputMode: "decimal",
|
|
170
|
-
className: "ttw:
|
|
168
|
+
className: w(P, "ttw:pr-3 ttw:pl-2"),
|
|
171
169
|
"aria-invalid": !!r || void 0,
|
|
172
|
-
"aria-describedby": r ?
|
|
173
|
-
disabled:
|
|
170
|
+
"aria-describedby": r ? h : void 0,
|
|
171
|
+
disabled: a,
|
|
174
172
|
value: n,
|
|
175
|
-
onChange: (e) =>
|
|
176
|
-
onFocus:
|
|
177
|
-
onBlur:
|
|
173
|
+
onChange: (e) => s(e.target.value),
|
|
174
|
+
onFocus: l,
|
|
175
|
+
onBlur: m
|
|
178
176
|
})]
|
|
179
177
|
})]
|
|
180
|
-
}), r && /* @__PURE__ */
|
|
181
|
-
id:
|
|
178
|
+
}), r && /* @__PURE__ */ E(f, {
|
|
179
|
+
id: h,
|
|
182
180
|
className: "ttw:text-right",
|
|
183
181
|
children: r
|
|
184
182
|
})]
|
|
185
183
|
});
|
|
186
184
|
}
|
|
187
|
-
function R({ open: r,
|
|
185
|
+
function R({ open: r, onRequestClose: g, mode: _ = "create", values: v, errors: y, unitOptions: b, currencySymbol: O, lineItemControls: A, autoFocusLineItemId: j, lineItemsLoading: M, inProgress: I, customerSelector: R, renderProductSelector: se, onChange: z, onLineItemChange: B, onLineItemCommit: V, onLineItemQuantityStep: H, onTaxRateCommit: U, onDiscountFocus: W, onDiscountCommit: G, totals: K, onManageUnits: ce, onAddLineItem: le, onRemoveLineItem: ue, showDueDateField: q, onAddCustomerDetailsClick: J, billingSection: de, bankAccountSection: fe, attachmentsSection: pe, preview: me, closeDisabled: he, cancelDisabled: ge, draftButtonLabel: Y, draftDisabled: _e, draftLoading: ve, primaryButtonLabel: ye, primaryDisabled: be, primaryLoading: xe, scrollContainerRef: X, onSubmit: Se, onDraftClick: Ce, onPrimaryClick: we, labels: Te }) {
|
|
188
186
|
let Z = {
|
|
189
|
-
...
|
|
190
|
-
...
|
|
191
|
-
}, Q =
|
|
192
|
-
return /* @__PURE__ */
|
|
187
|
+
...ee,
|
|
188
|
+
...Te
|
|
189
|
+
}, Q = ne(), $ = _ === "edit";
|
|
190
|
+
return /* @__PURE__ */ E(i, {
|
|
193
191
|
open: r,
|
|
194
|
-
onOpenChange:
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
className: "ttw:sr-only",
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
192
|
+
onOpenChange: (e) => {
|
|
193
|
+
e || g();
|
|
194
|
+
},
|
|
195
|
+
modal: !1,
|
|
196
|
+
children: /* @__PURE__ */ D(a, {
|
|
197
|
+
fullScreen: !0,
|
|
198
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0 ttw:overflow-hidden ttw:p-0",
|
|
199
|
+
onInteractOutside: (e) => e.preventDefault(),
|
|
200
|
+
children: [/* @__PURE__ */ D(c, {
|
|
201
|
+
className: "ttw:w-full ttw:flex-row ttw:items-center ttw:justify-between ttw:border-b ttw:border-border ttw:px-6 ttw:pt-6 ttw:pb-7",
|
|
202
|
+
children: [/* @__PURE__ */ D("div", {
|
|
203
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
204
|
+
children: [/* @__PURE__ */ E(l, {
|
|
205
|
+
className: "ttw:text-3xl ttw:tracking-normal",
|
|
206
|
+
children: _ === "edit" ? Z.editTitle : Z.createTitle
|
|
207
|
+
}), /* @__PURE__ */ E(o, {
|
|
208
|
+
className: w(_ === "edit" && "ttw:sr-only"),
|
|
209
|
+
children: _ === "edit" ? Z.editDescription : Z.createDescription
|
|
210
|
+
})]
|
|
211
|
+
}), /* @__PURE__ */ E(n, {
|
|
212
|
+
type: "button",
|
|
213
|
+
variant: "ghost",
|
|
214
|
+
className: "ttw:p-2 ttw:has-[>svg]:px-2",
|
|
215
|
+
"aria-label": Z.closeButton,
|
|
216
|
+
disabled: he,
|
|
217
|
+
onClick: g,
|
|
218
|
+
children: /* @__PURE__ */ E(ie, { className: "ttw:size-6.5" })
|
|
219
|
+
})]
|
|
220
|
+
}), /* @__PURE__ */ D("div", {
|
|
221
|
+
className: "ttw:flex ttw:min-h-0 ttw:flex-1",
|
|
222
|
+
children: [/* @__PURE__ */ D("div", {
|
|
223
|
+
ref: X,
|
|
224
|
+
className: "ttw:h-full ttw:min-h-0 ttw:w-1/2 ttw:overflow-auto ttw:px-8 ttw:pt-6",
|
|
225
|
+
children: [/* @__PURE__ */ D("form", {
|
|
226
|
+
id: Q,
|
|
227
|
+
noValidate: !0,
|
|
228
|
+
className: "ttw:pb-10",
|
|
229
|
+
onSubmit: (e) => {
|
|
230
|
+
e.preventDefault(), e.stopPropagation(), Se();
|
|
231
|
+
},
|
|
232
|
+
children: [/* @__PURE__ */ E("button", {
|
|
233
|
+
type: "submit",
|
|
234
|
+
className: "ttw:sr-only",
|
|
235
|
+
tabIndex: -1,
|
|
236
|
+
"aria-hidden": "true"
|
|
237
|
+
}), /* @__PURE__ */ D("div", {
|
|
238
|
+
className: "ttw:flex ttw:flex-col ttw:gap-8",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ D("div", {
|
|
241
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
|
|
242
|
+
children: [
|
|
243
|
+
/* @__PURE__ */ D("div", {
|
|
244
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
|
|
245
|
+
children: [/* @__PURE__ */ E(C, {
|
|
246
|
+
variant: "h4",
|
|
247
|
+
children: Z.customerHeading
|
|
248
|
+
}), /* @__PURE__ */ E(C, {
|
|
249
|
+
variant: "body2",
|
|
250
|
+
color: "muted",
|
|
251
|
+
className: "ttw:font-medium",
|
|
252
|
+
children: Z.customerDescription
|
|
242
253
|
})]
|
|
243
|
-
})
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
children: [
|
|
251
|
-
/* @__PURE__ */ k(f, { children: Z.customerLabel }),
|
|
252
|
-
W,
|
|
253
|
-
/* @__PURE__ */ k("p", {
|
|
254
|
-
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
255
|
-
children: Z.customerHint
|
|
256
|
-
}),
|
|
257
|
-
/* @__PURE__ */ k(I, { message: F?.customerId })
|
|
258
|
-
]
|
|
259
|
-
}),
|
|
260
|
-
/* @__PURE__ */ A("div", {
|
|
261
|
-
className: je,
|
|
262
|
-
children: [
|
|
263
|
-
/* @__PURE__ */ A("div", {
|
|
264
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
265
|
-
children: [
|
|
266
|
-
/* @__PURE__ */ k(f, {
|
|
267
|
-
htmlFor: `${Q}-currency`,
|
|
268
|
-
children: Z.currencyLabel
|
|
254
|
+
}),
|
|
255
|
+
R,
|
|
256
|
+
/* @__PURE__ */ E(L, { message: y?.customerId }),
|
|
257
|
+
!v.customerId && /* @__PURE__ */ D(re, { children: [/* @__PURE__ */ E(u, { children: /* @__PURE__ */ D(d, { children: [
|
|
258
|
+
/* @__PURE__ */ E(p, {
|
|
259
|
+
htmlFor: `${Q}-customer-email`,
|
|
260
|
+
children: Z.customerEmailLabel
|
|
269
261
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
children: e.label
|
|
279
|
-
}, e.value)) })]
|
|
262
|
+
/* @__PURE__ */ E(m, {
|
|
263
|
+
id: `${Q}-customer-email`,
|
|
264
|
+
type: "email",
|
|
265
|
+
disabled: I,
|
|
266
|
+
"aria-invalid": !!y?.customerEmail || void 0,
|
|
267
|
+
"aria-describedby": y?.customerEmail ? `${Q}-customer-email-error` : void 0,
|
|
268
|
+
value: v.customerEmail,
|
|
269
|
+
onChange: (e) => z({ customerEmail: e.target.value })
|
|
280
270
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
271
|
+
y?.customerEmail && /* @__PURE__ */ E(f, {
|
|
272
|
+
id: `${Q}-customer-email-error`,
|
|
273
|
+
children: y.customerEmail
|
|
274
|
+
})
|
|
275
|
+
] }) }), J && /* @__PURE__ */ D(n, {
|
|
276
|
+
type: "button",
|
|
277
|
+
variant: "ghost",
|
|
278
|
+
disabled: I,
|
|
279
|
+
className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
|
|
280
|
+
onClick: J,
|
|
281
|
+
children: [/* @__PURE__ */ E(k, {}), Z.addCustomerDetailsButton]
|
|
282
|
+
})] })
|
|
283
|
+
]
|
|
284
|
+
}),
|
|
285
|
+
($ || q) && /* @__PURE__ */ D("div", {
|
|
286
|
+
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
287
|
+
children: [$ && /* @__PURE__ */ D("div", {
|
|
285
288
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
286
289
|
children: [
|
|
287
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ E(h, {
|
|
288
291
|
htmlFor: `${Q}-issue-date`,
|
|
289
292
|
children: Z.issueDateLabel
|
|
290
293
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ E(m, {
|
|
292
295
|
id: `${Q}-issue-date`,
|
|
293
296
|
type: "date",
|
|
294
|
-
value:
|
|
295
|
-
onChange: (e) =>
|
|
297
|
+
value: v.issueDate,
|
|
298
|
+
onChange: (e) => z({ issueDate: e.target.value })
|
|
296
299
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ E(L, { message: y?.issueDate })
|
|
298
301
|
]
|
|
299
|
-
}),
|
|
300
|
-
Y && /* @__PURE__ */ A("div", {
|
|
302
|
+
}), q && /* @__PURE__ */ D("div", {
|
|
301
303
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
302
304
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ E(h, {
|
|
304
306
|
htmlFor: `${Q}-due-date`,
|
|
305
307
|
children: Z.dueDateLabel
|
|
306
308
|
}),
|
|
307
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ E(m, {
|
|
308
310
|
id: `${Q}-due-date`,
|
|
309
311
|
type: "date",
|
|
310
|
-
value:
|
|
311
|
-
onChange: (e) =>
|
|
312
|
+
value: v.dueDate,
|
|
313
|
+
onChange: (e) => z({ dueDate: e.target.value })
|
|
312
314
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ E(L, { message: y?.dueDate })
|
|
314
316
|
]
|
|
315
|
-
})
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
317
|
+
})]
|
|
318
|
+
}),
|
|
319
|
+
de,
|
|
320
|
+
/* @__PURE__ */ D("div", {
|
|
321
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ D("div", {
|
|
324
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
|
|
325
|
+
children: [/* @__PURE__ */ E(C, {
|
|
326
|
+
variant: "h4",
|
|
327
|
+
children: Z.lineItemsHeading
|
|
328
|
+
}), /* @__PURE__ */ E(C, {
|
|
329
|
+
variant: "body2",
|
|
330
|
+
color: "muted",
|
|
331
|
+
className: "ttw:font-medium",
|
|
332
|
+
children: Z.lineItemsDescription
|
|
333
|
+
})]
|
|
334
|
+
}),
|
|
335
|
+
y?.lineItemsSummary?.length ? /* @__PURE__ */ E(e, {
|
|
336
|
+
variant: "destructive",
|
|
337
|
+
className: "ttw:mb-2",
|
|
338
|
+
children: /* @__PURE__ */ E(t, { children: /* @__PURE__ */ E("ul", { children: y.lineItemsSummary.map((e) => /* @__PURE__ */ E("li", { children: e }, e)) }) })
|
|
339
|
+
}) : null,
|
|
340
|
+
/* @__PURE__ */ D("ul", {
|
|
341
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
342
|
+
children: [/* @__PURE__ */ D("li", {
|
|
343
|
+
"aria-hidden": !0,
|
|
344
|
+
className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
|
|
345
|
+
children: [
|
|
346
|
+
/* @__PURE__ */ E("span", {
|
|
347
|
+
className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
|
|
348
|
+
children: Z.productLabel
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ E("span", {
|
|
351
|
+
className: "ttw:w-24 ttw:min-w-24",
|
|
352
|
+
children: Z.quantityLabel
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ E("span", {
|
|
355
|
+
className: "ttw:w-20.5 ttw:min-w-20.5",
|
|
356
|
+
children: Z.unitLabel
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ E("span", {
|
|
359
|
+
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
360
|
+
children: Z.priceLabel
|
|
361
|
+
}),
|
|
362
|
+
/* @__PURE__ */ E("span", {
|
|
363
|
+
className: "ttw:w-12 ttw:min-w-12",
|
|
364
|
+
children: Z.taxableLabel
|
|
365
|
+
}),
|
|
366
|
+
v.lineItems.length > 1 && /* @__PURE__ */ E("span", { className: "ttw:w-10 ttw:min-w-10" })
|
|
367
|
+
]
|
|
368
|
+
}), M ? /* @__PURE__ */ E("li", {
|
|
369
|
+
className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
|
|
370
|
+
children: /* @__PURE__ */ E(S, { className: "ttw:size-5" })
|
|
371
|
+
}) : v.lineItems.map((e) => /* @__PURE__ */ E(ae, {
|
|
372
|
+
formId: Q,
|
|
373
|
+
lineItem: e,
|
|
374
|
+
errors: y?.lineItems?.[e.id],
|
|
375
|
+
controls: A?.[e.id],
|
|
376
|
+
focusOnMount: e.id === j,
|
|
377
|
+
canRemove: v.lineItems.length > 1,
|
|
378
|
+
unitOptions: b,
|
|
379
|
+
currencySymbol: O,
|
|
380
|
+
labels: Z,
|
|
381
|
+
renderProductSelector: se,
|
|
382
|
+
onChange: (t) => B(e.id, t),
|
|
383
|
+
onCommit: (t) => V(e.id, t),
|
|
384
|
+
onQuantityStep: (t) => H(e.id, t),
|
|
385
|
+
onManageUnits: ce,
|
|
386
|
+
onRemove: () => ue(e.id)
|
|
387
|
+
}, e.id))]
|
|
388
|
+
}),
|
|
389
|
+
/* @__PURE__ */ D(n, {
|
|
390
|
+
type: "button",
|
|
391
|
+
variant: "ghost",
|
|
392
|
+
className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
|
|
393
|
+
onClick: le,
|
|
394
|
+
children: [/* @__PURE__ */ E(k, { className: "ttw:size-5 ttw:text-primary" }), Z.addLineItemButton]
|
|
395
|
+
}),
|
|
396
|
+
/* @__PURE__ */ E(oe, {
|
|
397
|
+
inputId: `${Q}-discount`,
|
|
398
|
+
discountType: v.discountType,
|
|
399
|
+
value: v.discount,
|
|
400
|
+
error: y?.discount,
|
|
401
|
+
currencySymbol: O,
|
|
402
|
+
disabled: I,
|
|
380
403
|
labels: Z,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
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: le
|
|
430
|
-
}), /* @__PURE__ */ k(u, {
|
|
431
|
-
align: "inline-end",
|
|
432
|
-
children: Z.taxRateSuffix
|
|
404
|
+
onChange: (e) => z({ discount: e }),
|
|
405
|
+
onTypeChange: (e) => z({ discountType: e }),
|
|
406
|
+
onFocus: W,
|
|
407
|
+
onBlur: G
|
|
408
|
+
}),
|
|
409
|
+
/* @__PURE__ */ D(u, {
|
|
410
|
+
className: "ttw:flex-col",
|
|
411
|
+
children: [/* @__PURE__ */ D(d, {
|
|
412
|
+
className: "ttw:flex-row ttw:justify-end",
|
|
413
|
+
children: [/* @__PURE__ */ E(p, {
|
|
414
|
+
htmlFor: `${Q}-tax-rate`,
|
|
415
|
+
className: w(y?.taxRate && "ttw:text-destructive"),
|
|
416
|
+
children: Z.taxRateLabel
|
|
417
|
+
}), /* @__PURE__ */ D("div", {
|
|
418
|
+
className: w(N, "ttw:w-40"),
|
|
419
|
+
children: [/* @__PURE__ */ E("input", {
|
|
420
|
+
id: `${Q}-tax-rate`,
|
|
421
|
+
className: w(P, "ttw:pl-3"),
|
|
422
|
+
placeholder: Z.taxRatePlaceholder,
|
|
423
|
+
type: "text",
|
|
424
|
+
inputMode: "decimal",
|
|
425
|
+
"aria-invalid": !!y?.taxRate || void 0,
|
|
426
|
+
"aria-describedby": y?.taxRate ? `${Q}-tax-rate-error` : void 0,
|
|
427
|
+
value: v.taxRate,
|
|
428
|
+
onChange: (e) => z({ taxRate: e.target.value }),
|
|
429
|
+
onBlur: U
|
|
430
|
+
}), /* @__PURE__ */ E("span", {
|
|
431
|
+
className: w(F, "ttw:pr-3"),
|
|
432
|
+
children: Z.taxRateSuffix
|
|
433
|
+
})]
|
|
433
434
|
})]
|
|
435
|
+
}), y?.taxRate && /* @__PURE__ */ E(f, {
|
|
436
|
+
id: `${Q}-tax-rate-error`,
|
|
437
|
+
className: "ttw:text-right",
|
|
438
|
+
children: y.taxRate
|
|
434
439
|
})]
|
|
435
|
-
}),
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
440
|
+
}),
|
|
441
|
+
/* @__PURE__ */ E(x, {}),
|
|
442
|
+
/* @__PURE__ */ E(te, {
|
|
443
|
+
totals: K,
|
|
444
|
+
labels: Z
|
|
445
|
+
})
|
|
446
|
+
]
|
|
447
|
+
}),
|
|
448
|
+
fe,
|
|
449
|
+
/* @__PURE__ */ E(T, {
|
|
450
|
+
idPrefix: Q,
|
|
451
|
+
openingNote: v.openingNote,
|
|
452
|
+
closingNote: v.closingNote,
|
|
453
|
+
openingNoteError: y?.openingNote,
|
|
454
|
+
closingNoteError: y?.closingNote,
|
|
455
|
+
disabled: I,
|
|
456
|
+
onOpeningNoteChange: (e) => z({ openingNote: e }),
|
|
457
|
+
onClosingNoteChange: (e) => z({ closingNote: e }),
|
|
458
|
+
labels: Z
|
|
459
|
+
}),
|
|
460
|
+
pe
|
|
461
|
+
]
|
|
462
|
+
})]
|
|
463
|
+
}), /* @__PURE__ */ D(s, {
|
|
464
|
+
className: "ttw:sticky ttw:bottom-0 ttw:z-10 ttw:flex-row ttw:items-center ttw:justify-end ttw:gap-4 ttw:bg-background ttw:px-6 ttw:pt-3 ttw:pb-6",
|
|
465
|
+
children: [
|
|
466
|
+
/* @__PURE__ */ E(n, {
|
|
467
|
+
type: "button",
|
|
468
|
+
variant: "outline",
|
|
469
|
+
className: "ttw:border-border",
|
|
470
|
+
disabled: ge,
|
|
471
|
+
onClick: g,
|
|
472
|
+
children: Z.cancelButton
|
|
447
473
|
}),
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
onOpeningNoteChange: (e) => K({ openingNote: e }),
|
|
457
|
-
onClosingNoteChange: (e) => K({ closingNote: e }),
|
|
458
|
-
labels: Z
|
|
474
|
+
Y && /* @__PURE__ */ E(n, {
|
|
475
|
+
type: "submit",
|
|
476
|
+
form: Q,
|
|
477
|
+
variant: "secondary",
|
|
478
|
+
loading: ve,
|
|
479
|
+
disabled: _e,
|
|
480
|
+
onClick: Ce,
|
|
481
|
+
children: Y
|
|
459
482
|
}),
|
|
460
|
-
|
|
483
|
+
/* @__PURE__ */ E(n, {
|
|
484
|
+
type: "submit",
|
|
485
|
+
form: Q,
|
|
486
|
+
loading: xe,
|
|
487
|
+
disabled: be,
|
|
488
|
+
onClick: we,
|
|
489
|
+
children: ye
|
|
490
|
+
})
|
|
461
491
|
]
|
|
462
492
|
})]
|
|
463
|
-
}),
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
type: "button",
|
|
469
|
-
variant: "ghost",
|
|
470
|
-
disabled: ye,
|
|
471
|
-
onClick: ke,
|
|
472
|
-
children: Z.cancelButton
|
|
473
|
-
}),
|
|
474
|
-
X && /* @__PURE__ */ k(n, {
|
|
475
|
-
type: "submit",
|
|
476
|
-
form: Q,
|
|
477
|
-
variant: "secondary",
|
|
478
|
-
loading: xe,
|
|
479
|
-
disabled: be,
|
|
480
|
-
onClick: De,
|
|
481
|
-
children: X
|
|
482
|
-
}),
|
|
483
|
-
/* @__PURE__ */ k(n, {
|
|
484
|
-
type: "submit",
|
|
485
|
-
form: Q,
|
|
486
|
-
loading: we,
|
|
487
|
-
disabled: Ce,
|
|
488
|
-
onClick: Oe,
|
|
489
|
-
children: Se
|
|
490
|
-
})
|
|
491
|
-
]
|
|
492
|
-
}) })
|
|
493
|
-
]
|
|
493
|
+
}), /* @__PURE__ */ E("div", {
|
|
494
|
+
className: "ttw:h-full ttw:min-h-0 ttw:w-1/2 ttw:overflow-auto ttw:bg-linear-to-b ttw:from-[#F6F6F6] ttw:to-[#E4E4FF]",
|
|
495
|
+
children: me
|
|
496
|
+
})]
|
|
497
|
+
})]
|
|
494
498
|
})
|
|
495
499
|
});
|
|
496
500
|
}
|
|
497
501
|
//#endregion
|
|
498
|
-
export { R as
|
|
502
|
+
export { R as ReceivableFormDialog, R as default };
|