@tesouro/embedded-components-react 0.5.235 → 0.5.236
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 +3 -0
- package/dist/index.d.ts +110 -1
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +110 -1
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +210 -208
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +98 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +159 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +53 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +99 -132
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index36.js +40 -341
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index37.js +43 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index38.js +92 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index39.js +146 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index40.js +354 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +28 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +2 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +9 -214
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +27 -159
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +233 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +34 -22
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +214 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +153 -87
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +16 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +22 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +2 -51
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +30 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +90 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +3 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +20 -69
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +51 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +16 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +8 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +70 -30
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +33 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +17 -25
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +12 -83
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +9 -121
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +28 -401
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +16 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +22 -42
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +80 -65
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +383 -473
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +2 -106
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +48 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +72 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +498 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +106 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +141 -93
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +2 -28
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +4 -236
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +90 -239
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +24 -89
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +231 -54
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -353
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +249 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +3 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +59 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +353 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +121 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +100 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +38 -233
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +0 -100
|
@@ -1,496 +1,406 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { Accordion as e, AccordionContent as t, AccordionItem as n, AccordionTrigger as r, Badge as i, Button as a, Sheet as o, SheetContent as ee, SheetDescription as s, SheetHeader as c, SheetTitle as l, Spinner as te, Tooltip as u, TooltipContent as d, TooltipProvider as f, TooltipTrigger as p, cn as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { ErrorState as h } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
3
|
+
import "../../../shared/ui/dist/index.js";
|
|
4
|
+
import { RECEIVABLE_DETAILS_PANEL_LABELS_EN as g } from "./index13.js";
|
|
5
|
+
import { ReceivableStatusBadge as _ } from "./index22.js";
|
|
6
|
+
import { RECEIVABLE_DETAILS_SECTION as v } from "./index25.js";
|
|
7
|
+
import { ACTION_ICON as y, ACTION_LABEL_KEY as b, STATUS_ICON as x, amountValueToneClass as S, headerIconButtonClass as C } from "./index23.js";
|
|
8
|
+
import { AmountCell as w } from "./index24.js";
|
|
9
|
+
import { AttachmentsItem as ne } from "./index26.js";
|
|
10
|
+
import { AuditHistoryItem as re } from "./index27.js";
|
|
11
|
+
import { CloseButton as T } from "./index28.js";
|
|
12
|
+
import { InfoRow as E } from "./index29.js";
|
|
13
|
+
import { OverflowMenu as ie } from "./index30.js";
|
|
14
|
+
import { SeriesStatusChip as ae } from "./index32.js";
|
|
15
|
+
import { ScheduledInvoicesTable as D } from "./index33.js";
|
|
16
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
17
|
+
import { ChevronLeft as j, CircleAlert as M, EyeIcon as N, Repeat as P } from "lucide-react";
|
|
8
18
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ k("div", {
|
|
22
|
-
className: "ttw:min-w-30 ttw:flex-1",
|
|
23
|
-
children: m(t, {
|
|
24
|
-
inputId: `${T}-name`,
|
|
25
|
-
invalid: !!i?.name,
|
|
26
|
-
focusOnMount: o
|
|
27
|
-
})
|
|
28
|
-
}),
|
|
29
|
-
/* @__PURE__ */ A("div", {
|
|
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
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ k("button", {
|
|
33
|
-
type: "button",
|
|
34
|
-
"aria-label": p.decreaseQuantityButton,
|
|
35
|
-
disabled: a ? !a.canDecreaseQuantity : !1,
|
|
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
|
-
onClick: () => S(-1),
|
|
38
|
-
children: /* @__PURE__ */ k(j, { className: "ttw:size-3.5" })
|
|
39
|
-
}),
|
|
40
|
-
/* @__PURE__ */ k("input", {
|
|
41
|
-
id: `${T}-quantity`,
|
|
42
|
-
"aria-label": p.quantityLabel,
|
|
43
|
-
"aria-invalid": !!i?.quantity || void 0,
|
|
44
|
-
type: "text",
|
|
45
|
-
inputMode: "decimal",
|
|
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
|
-
value: t.quantity,
|
|
48
|
-
onChange: (e) => b({ quantity: e.target.value }),
|
|
49
|
-
onBlur: () => x("quantity")
|
|
50
|
-
}),
|
|
51
|
-
/* @__PURE__ */ k("button", {
|
|
52
|
-
type: "button",
|
|
53
|
-
"aria-label": p.increaseQuantityButton,
|
|
54
|
-
disabled: a ? !a.canIncreaseQuantity : !1,
|
|
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
|
-
onClick: () => S(1),
|
|
57
|
-
children: /* @__PURE__ */ k(M, { className: "ttw:size-3.5" })
|
|
58
|
-
})
|
|
59
|
-
]
|
|
60
|
-
}),
|
|
61
|
-
/* @__PURE__ */ A(h, {
|
|
62
|
-
value: t.unit || P,
|
|
63
|
-
onValueChange: (e) => {
|
|
64
|
-
if (e === F) {
|
|
65
|
-
C?.();
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
b({ unit: e === P ? "" : e });
|
|
69
|
-
},
|
|
70
|
-
children: [/* @__PURE__ */ k(v, {
|
|
71
|
-
id: `${T}-unit`,
|
|
72
|
-
"aria-label": p.unitLabel,
|
|
73
|
-
"aria-invalid": !!i?.measureUnit || void 0,
|
|
74
|
-
className: "ttw:w-22",
|
|
75
|
-
children: /* @__PURE__ */ k(y, {
|
|
76
|
-
className: "ttw:truncate",
|
|
77
|
-
placeholder: p.unitPlaceholder
|
|
78
|
-
})
|
|
79
|
-
}), /* @__PURE__ */ A(g, { children: [
|
|
80
|
-
C && /* @__PURE__ */ A(_, {
|
|
81
|
-
value: F,
|
|
82
|
-
className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
|
|
83
|
-
children: [/* @__PURE__ */ k(M, { className: "ttw:text-primary" }), p.manageUnitsOption]
|
|
84
|
-
}),
|
|
85
|
-
/* @__PURE__ */ k(_, {
|
|
86
|
-
value: P,
|
|
87
|
-
children: p.unitNone
|
|
88
|
-
}),
|
|
89
|
-
c.map((e) => /* @__PURE__ */ k(_, {
|
|
90
|
-
value: e.value,
|
|
91
|
-
children: e.label
|
|
92
|
-
}, e.value))
|
|
93
|
-
] })]
|
|
94
|
-
}),
|
|
95
|
-
/* @__PURE__ */ A(l, {
|
|
96
|
-
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
97
|
-
children: [/* @__PURE__ */ k(u, {
|
|
98
|
-
align: "inline-start",
|
|
99
|
-
children: f
|
|
100
|
-
}), /* @__PURE__ */ k(d, {
|
|
101
|
-
id: `${T}-price`,
|
|
102
|
-
"aria-label": p.priceLabel,
|
|
103
|
-
"aria-invalid": !!i?.price || void 0,
|
|
104
|
-
"data-has-start-addon": !0,
|
|
105
|
-
type: "text",
|
|
106
|
-
inputMode: "decimal",
|
|
107
|
-
className: "ttw:text-right",
|
|
108
|
-
value: t.price,
|
|
109
|
-
onChange: (e) => b({ price: e.target.value }),
|
|
110
|
-
onBlur: () => x("price")
|
|
111
|
-
})]
|
|
112
|
-
}),
|
|
113
|
-
/* @__PURE__ */ k("div", {
|
|
114
|
-
className: "ttw:flex ttw:w-12 ttw:min-w-12 ttw:items-center ttw:justify-center",
|
|
115
|
-
children: /* @__PURE__ */ k(r, {
|
|
116
|
-
id: `${T}-taxable`,
|
|
117
|
-
"aria-label": p.taxableLabel,
|
|
118
|
-
checked: t.taxable,
|
|
119
|
-
onCheckedChange: (e) => b({ taxable: e === !0 })
|
|
120
|
-
})
|
|
121
|
-
}),
|
|
122
|
-
s && /* @__PURE__ */ k(n, {
|
|
123
|
-
type: "button",
|
|
124
|
-
variant: "ghost",
|
|
19
|
+
function F({ open: F, onOpenChange: I, details: L, unsupported: R, isLoading: z, isError: B, onActionClick: V, onClose: H, openSections: U, onOpenSectionsChange: W, disabledActions: G, labels: K }) {
|
|
20
|
+
let q = {
|
|
21
|
+
...g,
|
|
22
|
+
...K
|
|
23
|
+
}, J = L?.panel, Y = B ? {
|
|
24
|
+
title: q.errorTitle,
|
|
25
|
+
description: q.errorDescription
|
|
26
|
+
} : R, oe = J?.amountTone === "danger", X = (e) => q[b[e]], Z = L ? x[L.status] : void 0, Q = J?.recurringSeries, $ = L && J && J.primaryActions.length > 0 ? /* @__PURE__ */ k("div", {
|
|
27
|
+
className: "ttw:flex ttw:items-center ttw:gap-2 ttw:border-t ttw:border-border ttw:pt-3",
|
|
28
|
+
children: J.primaryActions.map((e, t) => {
|
|
29
|
+
let n = y[e], r = t === J.primaryActions.length - 1;
|
|
30
|
+
return /* @__PURE__ */ A(a, {
|
|
125
31
|
size: "sm",
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
className: D(r && "ttw:text-destructive"),
|
|
151
|
-
children: p.discountLabel
|
|
152
|
-
}), /* @__PURE__ */ A(l, {
|
|
153
|
-
className: "ttw:w-40 ttw:overflow-hidden",
|
|
154
|
-
children: [/* @__PURE__ */ k(u, {
|
|
155
|
-
align: "inline-start",
|
|
156
|
-
className: "ttw:gap-0 ttw:self-stretch ttw:p-0 ttw:has-[>button]:ml-0",
|
|
157
|
-
children: y.map((e) => /* @__PURE__ */ k("button", {
|
|
158
|
-
type: "button",
|
|
159
|
-
"aria-label": e.ariaLabel,
|
|
160
|
-
"aria-pressed": t === e.type,
|
|
161
|
-
disabled: f,
|
|
162
|
-
className: D("ttw:pointer-events-auto 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"),
|
|
163
|
-
onClick: () => h(e.type),
|
|
164
|
-
children: e.label
|
|
165
|
-
}, e.type))
|
|
166
|
-
}), /* @__PURE__ */ k(d, {
|
|
167
|
-
id: e,
|
|
168
|
-
type: "text",
|
|
169
|
-
inputMode: "decimal",
|
|
170
|
-
className: "ttw:text-right",
|
|
171
|
-
"aria-invalid": !!r || void 0,
|
|
172
|
-
"aria-describedby": r ? v : void 0,
|
|
173
|
-
disabled: f,
|
|
174
|
-
value: n,
|
|
175
|
-
onChange: (e) => m(e.target.value),
|
|
176
|
-
onFocus: g,
|
|
177
|
-
onBlur: _
|
|
32
|
+
variant: r ? "default" : "outline",
|
|
33
|
+
onClick: () => V(e, L),
|
|
34
|
+
children: [/* @__PURE__ */ k(n, { className: "ttw:size-4" }), X(e)]
|
|
35
|
+
}, e);
|
|
36
|
+
})
|
|
37
|
+
}) : null;
|
|
38
|
+
return /* @__PURE__ */ k(o, {
|
|
39
|
+
open: F,
|
|
40
|
+
onOpenChange: I,
|
|
41
|
+
children: /* @__PURE__ */ A(ee, {
|
|
42
|
+
showCloseButton: !1,
|
|
43
|
+
className: "ttw:w-180 ttw:overflow-y-auto ttw:p-0 ttw:sm:max-w-180",
|
|
44
|
+
children: [Y || z || !L ? /* @__PURE__ */ k(T, {
|
|
45
|
+
label: q.closeButton,
|
|
46
|
+
onClose: H,
|
|
47
|
+
className: m(C, "ttw:absolute ttw:right-4 ttw:top-4 ttw:z-10")
|
|
48
|
+
}) : null, Y ? /* @__PURE__ */ A("div", {
|
|
49
|
+
className: "ttw:p-6",
|
|
50
|
+
children: [/* @__PURE__ */ A(c, {
|
|
51
|
+
className: "ttw:sr-only",
|
|
52
|
+
children: [/* @__PURE__ */ k(l, { children: Y.title }), /* @__PURE__ */ k(s, { children: q.hiddenDescription })]
|
|
53
|
+
}), /* @__PURE__ */ k(h, {
|
|
54
|
+
title: Y.title,
|
|
55
|
+
description: Y.description
|
|
178
56
|
})]
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
className: "ttw:text-right",
|
|
183
|
-
children: r
|
|
184
|
-
})]
|
|
185
|
-
});
|
|
186
|
-
}
|
|
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
|
-
let Z = {
|
|
189
|
-
...ne,
|
|
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
|
-
open: r,
|
|
194
|
-
onOpenChange: j,
|
|
195
|
-
children: /* @__PURE__ */ A(S, {
|
|
196
|
-
ref: Ce,
|
|
197
|
-
className: "ttw:w-180 ttw:overflow-y-auto ttw:sm:max-w-180",
|
|
198
|
-
children: [
|
|
199
|
-
/* @__PURE__ */ A(T, { children: [/* @__PURE__ */ k(ee, { children: N === "edit" ? Z.editTitle : Z.createTitle }), /* @__PURE__ */ k(C, {
|
|
57
|
+
}) : z || !L || !J ? /* @__PURE__ */ A(c, {
|
|
58
|
+
className: "ttw:p-6",
|
|
59
|
+
children: [/* @__PURE__ */ k(l, { children: q.loadingTitle }), /* @__PURE__ */ k(s, {
|
|
200
60
|
className: "ttw:sr-only",
|
|
201
|
-
children:
|
|
202
|
-
})]
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
61
|
+
children: q.hiddenDescription
|
|
62
|
+
})]
|
|
63
|
+
}) : /* @__PURE__ */ A(O, { children: [
|
|
64
|
+
J.seriesLink ? /* @__PURE__ */ k("div", {
|
|
65
|
+
className: "ttw:border-b ttw:border-border ttw:px-6 ttw:py-3",
|
|
66
|
+
children: /* @__PURE__ */ A("button", {
|
|
67
|
+
type: "button",
|
|
68
|
+
onClick: J.seriesLink.onOpen,
|
|
69
|
+
className: "ttw:flex ttw:items-center ttw:gap-1 ttw:text-sm ttw:text-primary ttw:hover:underline",
|
|
70
|
+
children: [/* @__PURE__ */ k(j, {
|
|
71
|
+
className: "ttw:size-4",
|
|
72
|
+
"aria-hidden": "true"
|
|
73
|
+
}), J.seriesLink.backLabel]
|
|
74
|
+
})
|
|
75
|
+
}) : null,
|
|
76
|
+
/* @__PURE__ */ A(c, {
|
|
77
|
+
className: "ttw:flex ttw:flex-row ttw:items-start ttw:justify-between ttw:gap-2 ttw:space-y-0 ttw:px-6 ttw:py-4",
|
|
78
|
+
children: [/* @__PURE__ */ A("div", {
|
|
79
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
215
80
|
children: [
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
className: "ttw:
|
|
218
|
-
children:
|
|
219
|
-
/* @__PURE__ */ k(f, { children: Z.documentTypeLabel }),
|
|
220
|
-
/* @__PURE__ */ A(p, {
|
|
221
|
-
className: "ttw:flex ttw:flex-row ttw:gap-6",
|
|
222
|
-
disabled: N === "edit",
|
|
223
|
-
value: P.type,
|
|
224
|
-
onValueChange: (e) => K({ type: e }),
|
|
225
|
-
children: [/* @__PURE__ */ A("div", {
|
|
226
|
-
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
227
|
-
children: [/* @__PURE__ */ k(m, {
|
|
228
|
-
value: "invoice",
|
|
229
|
-
id: `${Q}-invoice`
|
|
230
|
-
}), /* @__PURE__ */ k(f, {
|
|
231
|
-
htmlFor: `${Q}-invoice`,
|
|
232
|
-
children: Z.typeInvoice
|
|
233
|
-
})]
|
|
234
|
-
}), /* @__PURE__ */ A("div", {
|
|
235
|
-
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
236
|
-
children: [/* @__PURE__ */ k(m, {
|
|
237
|
-
value: "quote",
|
|
238
|
-
id: `${Q}-quote`
|
|
239
|
-
}), /* @__PURE__ */ k(f, {
|
|
240
|
-
htmlFor: `${Q}-quote`,
|
|
241
|
-
children: Z.typeQuote
|
|
242
|
-
})]
|
|
243
|
-
})]
|
|
244
|
-
}),
|
|
245
|
-
/* @__PURE__ */ k(I, { message: F?.type })
|
|
246
|
-
]
|
|
81
|
+
/* @__PURE__ */ k(l, {
|
|
82
|
+
className: "ttw:text-xl ttw:font-semibold ttw:text-foreground",
|
|
83
|
+
children: L.title
|
|
247
84
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
className: "ttw:
|
|
250
|
-
children:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
85
|
+
J.subtitle ? /* @__PURE__ */ k("p", {
|
|
86
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
87
|
+
children: J.subtitle
|
|
88
|
+
}) : null,
|
|
89
|
+
/* @__PURE__ */ k(s, {
|
|
90
|
+
className: "ttw:sr-only",
|
|
91
|
+
children: q.hiddenDescription
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}), /* @__PURE__ */ k(f, {
|
|
95
|
+
delayDuration: 500,
|
|
96
|
+
children: /* @__PURE__ */ A("div", {
|
|
97
|
+
className: "ttw:flex ttw:items-center ttw:gap-1.5",
|
|
98
|
+
children: [
|
|
99
|
+
L.pdfUrl ? /* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(p, {
|
|
100
|
+
asChild: !0,
|
|
101
|
+
children: /* @__PURE__ */ k(a, {
|
|
102
|
+
asChild: !0,
|
|
103
|
+
variant: "ghost",
|
|
104
|
+
size: "icon",
|
|
105
|
+
className: C,
|
|
106
|
+
children: /* @__PURE__ */ k("a", {
|
|
107
|
+
href: L.pdfUrl,
|
|
108
|
+
target: "_blank",
|
|
109
|
+
rel: "noreferrer",
|
|
110
|
+
"aria-label": q.viewPdfButton,
|
|
111
|
+
children: /* @__PURE__ */ k(N, { className: "ttw:size-4" })
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
}), /* @__PURE__ */ k(d, { children: q.viewPdfButton })] }) : null,
|
|
115
|
+
J.overflowActions.length > 0 ? /* @__PURE__ */ k(ie, {
|
|
116
|
+
actions: J.overflowActions,
|
|
117
|
+
triggerLabel: q.moreActionsLabel,
|
|
118
|
+
getActionLabel: X,
|
|
119
|
+
onSelect: (e) => V(e, L),
|
|
120
|
+
disabledActions: G,
|
|
121
|
+
className: C
|
|
122
|
+
}) : null,
|
|
123
|
+
/* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(p, {
|
|
124
|
+
asChild: !0,
|
|
125
|
+
children: /* @__PURE__ */ k(T, {
|
|
126
|
+
label: q.closeButton,
|
|
127
|
+
onClose: H,
|
|
128
|
+
className: C
|
|
129
|
+
})
|
|
130
|
+
}), /* @__PURE__ */ k(d, { children: q.closeButton })] })
|
|
131
|
+
]
|
|
132
|
+
})
|
|
133
|
+
})]
|
|
134
|
+
}),
|
|
135
|
+
/* @__PURE__ */ A("div", {
|
|
136
|
+
className: "ttw:flex ttw:flex-col",
|
|
137
|
+
children: [/* @__PURE__ */ k("div", {
|
|
138
|
+
className: "ttw:px-6",
|
|
139
|
+
children: Q ? /* @__PURE__ */ A("div", {
|
|
140
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:bg-violet-50 ttw:p-4 ttw:dark:bg-violet-950",
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ A("div", {
|
|
143
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
144
|
+
children: [/* @__PURE__ */ k("span", {
|
|
254
145
|
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
255
|
-
children:
|
|
256
|
-
}),
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
]
|
|
299
|
-
})
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
146
|
+
children: q.recurringAmountCaption
|
|
147
|
+
}), /* @__PURE__ */ A("div", {
|
|
148
|
+
className: "ttw:flex ttw:items-baseline ttw:gap-1.5",
|
|
149
|
+
children: [/* @__PURE__ */ k("span", {
|
|
150
|
+
className: m("ttw:text-2xl ttw:font-semibold", S[J.amountTone]),
|
|
151
|
+
children: Q.amountLabel
|
|
152
|
+
}), /* @__PURE__ */ k("span", {
|
|
153
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
154
|
+
children: Q.amountPeriodLabel
|
|
155
|
+
})]
|
|
156
|
+
})]
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ A("div", {
|
|
159
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
160
|
+
children: [/* @__PURE__ */ A(i, {
|
|
161
|
+
variant: "outline",
|
|
162
|
+
className: "ttw:gap-1 ttw:border-violet-200 ttw:bg-violet-50 ttw:text-violet-700",
|
|
163
|
+
children: [/* @__PURE__ */ k(P, { className: "ttw:size-3" }), q.recurringBadge]
|
|
164
|
+
}), /* @__PURE__ */ k(ae, {
|
|
165
|
+
label: Q.statusLabel,
|
|
166
|
+
tone: Q.statusTone,
|
|
167
|
+
icon: Q.statusIcon
|
|
168
|
+
})]
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ A("div", {
|
|
171
|
+
className: "ttw:flex ttw:gap-12 ttw:text-sm",
|
|
172
|
+
children: [/* @__PURE__ */ A("div", {
|
|
173
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
174
|
+
children: [/* @__PURE__ */ k("span", {
|
|
175
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
176
|
+
children: q.startsOnCaption
|
|
177
|
+
}), /* @__PURE__ */ k("span", {
|
|
178
|
+
className: "ttw:text-foreground",
|
|
179
|
+
children: Q.startsOnLabel
|
|
180
|
+
})]
|
|
181
|
+
}), /* @__PURE__ */ A("div", {
|
|
182
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
183
|
+
children: [/* @__PURE__ */ k("span", {
|
|
184
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
185
|
+
children: q.endsOnCaption
|
|
186
|
+
}), /* @__PURE__ */ k("span", {
|
|
187
|
+
className: "ttw:text-foreground",
|
|
188
|
+
children: Q.endsOnLabel
|
|
189
|
+
})]
|
|
190
|
+
})]
|
|
191
|
+
}),
|
|
192
|
+
$
|
|
193
|
+
]
|
|
194
|
+
}) : /* @__PURE__ */ A("div", {
|
|
195
|
+
className: m("ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:bg-muted ttw:p-4", oe && "ttw:border ttw:border-red-200"),
|
|
196
|
+
children: [
|
|
197
|
+
/* @__PURE__ */ k("div", {
|
|
198
|
+
className: "ttw:flex ttw:flex-row ttw:flex-wrap ttw:gap-x-12 ttw:gap-y-2",
|
|
199
|
+
children: J.amountRows.map((e) => /* @__PURE__ */ k(w, {
|
|
200
|
+
row: e,
|
|
201
|
+
defaultTone: J.amountTone
|
|
202
|
+
}, e.label))
|
|
203
|
+
}),
|
|
204
|
+
/* @__PURE__ */ A("div", {
|
|
205
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
206
|
+
children: [J.overdueLabel ? /* @__PURE__ */ A("span", {
|
|
207
|
+
className: "ttw:inline-flex ttw:items-center ttw:gap-1 ttw:rounded-full ttw:bg-red-100 ttw:px-2.5 ttw:py-0.5 ttw:text-xs ttw:font-medium ttw:text-red-700",
|
|
208
|
+
children: [/* @__PURE__ */ k(M, { className: "ttw:size-3" }), J.overdueLabel]
|
|
209
|
+
}) : /* @__PURE__ */ k(_, {
|
|
210
|
+
label: J.statusLabel,
|
|
211
|
+
tone: L.statusTone,
|
|
212
|
+
icon: Z ? /* @__PURE__ */ k(Z, { className: "ttw:size-3" }) : void 0
|
|
213
|
+
}), J.recurring ? /* @__PURE__ */ A(i, {
|
|
214
|
+
variant: "outline",
|
|
215
|
+
className: "ttw:gap-1 ttw:border-violet-200 ttw:bg-violet-50 ttw:text-violet-700",
|
|
216
|
+
children: [/* @__PURE__ */ k(P, { className: "ttw:size-3" }), q.recurringBadge]
|
|
217
|
+
}) : null]
|
|
218
|
+
}),
|
|
219
|
+
/* @__PURE__ */ A("div", {
|
|
220
|
+
className: "ttw:flex ttw:gap-12 ttw:text-sm",
|
|
221
|
+
children: [/* @__PURE__ */ A("div", {
|
|
222
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
223
|
+
children: [/* @__PURE__ */ k("span", {
|
|
224
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
225
|
+
children: q.invoiceDateCaption
|
|
226
|
+
}), /* @__PURE__ */ k("span", {
|
|
227
|
+
className: "ttw:text-foreground",
|
|
228
|
+
children: J.issueDateLabel
|
|
229
|
+
})]
|
|
230
|
+
}), /* @__PURE__ */ A("div", {
|
|
231
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
232
|
+
children: [/* @__PURE__ */ k("span", {
|
|
233
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
234
|
+
children: J.dueDateCaption
|
|
235
|
+
}), /* @__PURE__ */ k("span", {
|
|
236
|
+
className: "ttw:text-foreground",
|
|
237
|
+
children: J.dueDateLabel
|
|
238
|
+
})]
|
|
239
|
+
})]
|
|
240
|
+
}),
|
|
241
|
+
$
|
|
242
|
+
]
|
|
243
|
+
})
|
|
244
|
+
}), /* @__PURE__ */ A("div", {
|
|
245
|
+
className: "ttw:px-6",
|
|
246
|
+
children: [
|
|
247
|
+
J.paymentHistory ? /* @__PURE__ */ A("section", {
|
|
248
|
+
"aria-label": q.paymentHistoryHeading,
|
|
249
|
+
className: "ttw:border-b ttw:py-4",
|
|
250
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
251
|
+
className: "ttw:mb-3 ttw:text-sm ttw:font-medium",
|
|
252
|
+
children: q.paymentHistoryHeading
|
|
253
|
+
}), J.paymentHistory.isLoading ? /* @__PURE__ */ k("div", {
|
|
254
|
+
className: "ttw:flex ttw:py-2",
|
|
255
|
+
children: /* @__PURE__ */ k(te, {
|
|
256
|
+
className: "ttw:size-5",
|
|
257
|
+
"aria-label": q.paymentHistoryLoading
|
|
315
258
|
})
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
259
|
+
}) : J.paymentHistory.rows.length === 0 ? /* @__PURE__ */ k("p", {
|
|
260
|
+
className: m("ttw:text-sm", J.paymentHistory.emptyTone === "danger" ? "ttw:text-red-600" : "ttw:text-muted-foreground"),
|
|
261
|
+
children: q.paymentHistoryEmpty
|
|
262
|
+
}) : /* @__PURE__ */ A("div", {
|
|
263
|
+
className: "ttw:flex ttw:flex-col",
|
|
264
|
+
children: [J.paymentHistory.rows.map((e) => /* @__PURE__ */ A("div", {
|
|
265
|
+
className: "ttw:flex ttw:justify-between ttw:border-b ttw:border-border ttw:py-2 ttw:text-sm",
|
|
266
|
+
children: [/* @__PURE__ */ k("span", { children: e.dateLabel }), /* @__PURE__ */ k("span", { children: e.amountLabel })]
|
|
267
|
+
}, e.id)), /* @__PURE__ */ A("div", {
|
|
268
|
+
className: "ttw:flex ttw:justify-between ttw:py-2 ttw:text-sm ttw:font-medium",
|
|
269
|
+
children: [/* @__PURE__ */ k("span", { children: q.paymentHistoryTotalLabel }), /* @__PURE__ */ k("span", { children: J.paymentHistory.totalLabel })]
|
|
270
|
+
})]
|
|
271
|
+
})]
|
|
272
|
+
}) : null,
|
|
273
|
+
J.customerContact.length > 0 ? /* @__PURE__ */ A("section", {
|
|
274
|
+
"aria-label": q.customerDetailsHeading,
|
|
275
|
+
className: "ttw:border-b ttw:py-4",
|
|
276
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
277
|
+
className: "ttw:mb-3 ttw:text-sm ttw:font-medium",
|
|
278
|
+
children: q.customerDetailsHeading
|
|
279
|
+
}), /* @__PURE__ */ k("div", {
|
|
280
|
+
className: "ttw:flex ttw:flex-col",
|
|
281
|
+
children: J.customerContact.map((e) => /* @__PURE__ */ k(E, { ...e }, e.label))
|
|
282
|
+
})]
|
|
283
|
+
}) : null,
|
|
284
|
+
/* @__PURE__ */ A(e, {
|
|
285
|
+
type: "multiple",
|
|
286
|
+
value: U,
|
|
287
|
+
onValueChange: W,
|
|
288
|
+
className: "ttw:w-full",
|
|
322
289
|
children: [
|
|
323
|
-
/* @__PURE__ */ A("div", {
|
|
324
|
-
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
|
|
325
|
-
children: [/* @__PURE__ */ k(E, {
|
|
326
|
-
variant: "h4",
|
|
327
|
-
children: Z.lineItemsHeading
|
|
328
|
-
}), /* @__PURE__ */ k(E, {
|
|
329
|
-
variant: "body2",
|
|
330
|
-
color: "muted",
|
|
331
|
-
className: "ttw:font-medium",
|
|
332
|
-
children: Z.lineItemsDescription
|
|
333
|
-
})]
|
|
334
|
-
}),
|
|
335
|
-
F?.lineItemsSummary?.length ? /* @__PURE__ */ k(e, {
|
|
336
|
-
variant: "destructive",
|
|
337
|
-
className: "ttw:mb-2",
|
|
338
|
-
children: /* @__PURE__ */ k(t, { children: /* @__PURE__ */ k("ul", { children: F.lineItemsSummary.map((e) => /* @__PURE__ */ k("li", { children: e }, e)) }) })
|
|
339
|
-
}) : null,
|
|
340
|
-
/* @__PURE__ */ A("ul", {
|
|
341
|
-
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
342
|
-
children: [/* @__PURE__ */ A("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__ */ k("span", {
|
|
347
|
-
className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
|
|
348
|
-
children: Z.productLabel
|
|
349
|
-
}),
|
|
350
|
-
/* @__PURE__ */ k("span", {
|
|
351
|
-
className: "ttw:w-24 ttw:min-w-24",
|
|
352
|
-
children: Z.quantityLabel
|
|
353
|
-
}),
|
|
354
|
-
/* @__PURE__ */ k("span", {
|
|
355
|
-
className: "ttw:w-20.5 ttw:min-w-20.5",
|
|
356
|
-
children: Z.unitLabel
|
|
357
|
-
}),
|
|
358
|
-
/* @__PURE__ */ k("span", {
|
|
359
|
-
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
360
|
-
children: Z.priceLabel
|
|
361
|
-
}),
|
|
362
|
-
/* @__PURE__ */ k("span", {
|
|
363
|
-
className: "ttw:w-12 ttw:min-w-12",
|
|
364
|
-
children: Z.taxableLabel
|
|
365
|
-
}),
|
|
366
|
-
P.lineItems.length > 1 && /* @__PURE__ */ k("span", { className: "ttw:w-10 ttw:min-w-10" })
|
|
367
|
-
]
|
|
368
|
-
}), H ? /* @__PURE__ */ k("li", {
|
|
369
|
-
className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
|
|
370
|
-
children: /* @__PURE__ */ k(te, { className: "ttw:size-5" })
|
|
371
|
-
}) : P.lineItems.map((e) => /* @__PURE__ */ k(L, {
|
|
372
|
-
formId: Q,
|
|
373
|
-
lineItem: e,
|
|
374
|
-
errors: F?.lineItems?.[e.id],
|
|
375
|
-
controls: B?.[e.id],
|
|
376
|
-
focusOnMount: e.id === V,
|
|
377
|
-
canRemove: P.lineItems.length > 1,
|
|
378
|
-
unitOptions: oe,
|
|
379
|
-
currencySymbol: z,
|
|
380
|
-
labels: Z,
|
|
381
|
-
renderProductSelector: G,
|
|
382
|
-
onChange: (t) => q(e.id, t),
|
|
383
|
-
onCommit: (t) => se(e.id, t),
|
|
384
|
-
onQuantityStep: (t) => ce(e.id, t),
|
|
385
|
-
onManageUnits: fe,
|
|
386
|
-
onRemove: () => me(e.id)
|
|
387
|
-
}, e.id))]
|
|
388
|
-
}),
|
|
389
290
|
/* @__PURE__ */ A(n, {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
labels: Z,
|
|
404
|
-
onChange: (e) => K({ discount: e }),
|
|
405
|
-
onTypeChange: (e) => K({ discountType: e }),
|
|
406
|
-
onFocus: le,
|
|
407
|
-
onBlur: ue
|
|
408
|
-
}),
|
|
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
|
|
291
|
+
value: v.billing,
|
|
292
|
+
children: [/* @__PURE__ */ k(r, { children: q.billingHeading }), /* @__PURE__ */ k(t, { children: /* @__PURE__ */ A("div", {
|
|
293
|
+
className: "ttw:flex ttw:flex-col",
|
|
294
|
+
children: [J.billingItems.map((e) => /* @__PURE__ */ k(E, { ...e }, e.label)), J.seriesLink ? /* @__PURE__ */ A("div", {
|
|
295
|
+
className: "ttw:flex ttw:gap-4 ttw:border-b ttw:border-border ttw:py-3 ttw:text-sm ttw:last:border-b-0",
|
|
296
|
+
children: [/* @__PURE__ */ k("span", {
|
|
297
|
+
className: "ttw:w-40 ttw:shrink-0 ttw:text-muted-foreground",
|
|
298
|
+
children: q.recurringSeriesRowLabel
|
|
299
|
+
}), /* @__PURE__ */ k("button", {
|
|
300
|
+
type: "button",
|
|
301
|
+
onClick: J.seriesLink.onOpen,
|
|
302
|
+
className: "ttw:text-left ttw:text-primary ttw:hover:underline",
|
|
303
|
+
children: J.seriesLink.title
|
|
433
304
|
})]
|
|
305
|
+
}) : null]
|
|
306
|
+
}) })]
|
|
307
|
+
}),
|
|
308
|
+
J.lineItemsSection ? /* @__PURE__ */ A(n, {
|
|
309
|
+
value: v.lineItems,
|
|
310
|
+
children: [/* @__PURE__ */ k(r, { children: /* @__PURE__ */ A("span", {
|
|
311
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
312
|
+
children: [q.lineItemsHeading, /* @__PURE__ */ k(i, {
|
|
313
|
+
variant: "secondary",
|
|
314
|
+
className: "ttw:rounded-full",
|
|
315
|
+
children: J.lineItemsSection.countLabel
|
|
434
316
|
})]
|
|
435
|
-
}),
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
317
|
+
}) }), /* @__PURE__ */ k(t, { children: /* @__PURE__ */ A("div", {
|
|
318
|
+
className: "ttw:flex ttw:flex-col ttw:text-sm",
|
|
319
|
+
children: [L.lineItems.length === 0 ? /* @__PURE__ */ k("p", {
|
|
320
|
+
className: "ttw:py-3 ttw:text-muted-foreground",
|
|
321
|
+
children: q.noLineItems
|
|
322
|
+
}) : L.lineItems.map((e) => /* @__PURE__ */ A("div", {
|
|
323
|
+
className: "ttw:flex ttw:items-start ttw:justify-between ttw:border-b ttw:border-border ttw:py-3",
|
|
324
|
+
children: [/* @__PURE__ */ A("div", {
|
|
325
|
+
className: "ttw:flex ttw:flex-col",
|
|
326
|
+
children: [/* @__PURE__ */ k("span", {
|
|
327
|
+
className: "ttw:font-medium",
|
|
328
|
+
children: e.name
|
|
329
|
+
}), /* @__PURE__ */ A("span", {
|
|
330
|
+
className: "ttw:text-muted-foreground",
|
|
331
|
+
children: [
|
|
332
|
+
e.quantityLabel,
|
|
333
|
+
" ",
|
|
334
|
+
q.lineItemMultiplier,
|
|
335
|
+
" ",
|
|
336
|
+
e.unitPriceLabel,
|
|
337
|
+
" ",
|
|
338
|
+
q.lineItemEaLabel
|
|
339
|
+
]
|
|
340
|
+
})]
|
|
341
|
+
}), /* @__PURE__ */ k("span", { children: e.totalLabel })]
|
|
342
|
+
}, e.id)), J.lineItemsSection.totals.length > 0 ? /* @__PURE__ */ k("div", {
|
|
343
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:py-3",
|
|
344
|
+
children: J.lineItemsSection.totals.map((e) => /* @__PURE__ */ A("div", {
|
|
345
|
+
className: m("ttw:flex ttw:justify-between", e.emphasis && "ttw:font-medium"),
|
|
346
|
+
children: [/* @__PURE__ */ k("span", { children: e.label }), /* @__PURE__ */ k("span", { children: e.value })]
|
|
347
|
+
}, e.label))
|
|
348
|
+
}) : null]
|
|
349
|
+
}) })]
|
|
350
|
+
}) : null,
|
|
351
|
+
J.notes ? /* @__PURE__ */ A(n, {
|
|
352
|
+
value: v.notes,
|
|
353
|
+
children: [/* @__PURE__ */ k(r, { children: /* @__PURE__ */ A("span", {
|
|
354
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
355
|
+
children: [q.notesHeading, /* @__PURE__ */ k(i, {
|
|
356
|
+
variant: "secondary",
|
|
357
|
+
className: "ttw:rounded-full",
|
|
358
|
+
children: J.notes.countLabel
|
|
359
|
+
})]
|
|
360
|
+
}) }), /* @__PURE__ */ k(t, { children: /* @__PURE__ */ A("div", {
|
|
361
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:text-sm",
|
|
362
|
+
children: [J.notes.opening ? /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
363
|
+
className: "ttw:mb-1 ttw:font-medium",
|
|
364
|
+
children: q.notesOpeningLabel
|
|
365
|
+
}), /* @__PURE__ */ k("p", {
|
|
366
|
+
className: "ttw:text-muted-foreground",
|
|
367
|
+
children: J.notes.opening
|
|
368
|
+
})] }) : null, J.notes.closing ? /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
369
|
+
className: "ttw:mb-1 ttw:font-medium",
|
|
370
|
+
children: q.notesClosingLabel
|
|
371
|
+
}), /* @__PURE__ */ k("p", {
|
|
372
|
+
className: "ttw:text-muted-foreground",
|
|
373
|
+
children: J.notes.closing
|
|
374
|
+
})] }) : null]
|
|
375
|
+
}) })]
|
|
376
|
+
}) : null,
|
|
377
|
+
/* @__PURE__ */ k(ne, {
|
|
378
|
+
attachments: J.attachments,
|
|
379
|
+
labels: q
|
|
440
380
|
}),
|
|
441
|
-
/* @__PURE__ */ k(b, {}),
|
|
442
381
|
/* @__PURE__ */ k(re, {
|
|
443
|
-
|
|
444
|
-
labels:
|
|
382
|
+
auditHistory: J.auditHistory,
|
|
383
|
+
labels: q
|
|
445
384
|
})
|
|
446
385
|
]
|
|
447
386
|
}),
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}),
|
|
460
|
-
ve
|
|
387
|
+
Q ? /* @__PURE__ */ A("section", {
|
|
388
|
+
"aria-label": Q.scheduleTitle,
|
|
389
|
+
className: "ttw:border-t ttw:border-border ttw:py-4",
|
|
390
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
391
|
+
className: "ttw:mb-3 ttw:text-sm ttw:font-medium",
|
|
392
|
+
children: Q.scheduleTitle
|
|
393
|
+
}), /* @__PURE__ */ k(D, {
|
|
394
|
+
rows: Q.schedule,
|
|
395
|
+
labels: q
|
|
396
|
+
})]
|
|
397
|
+
}) : null
|
|
461
398
|
]
|
|
462
399
|
})]
|
|
463
|
-
})
|
|
464
|
-
|
|
465
|
-
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
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
|
-
]
|
|
490
|
-
}) })
|
|
491
|
-
]
|
|
400
|
+
})
|
|
401
|
+
] })]
|
|
492
402
|
})
|
|
493
403
|
});
|
|
494
404
|
}
|
|
495
405
|
//#endregion
|
|
496
|
-
export {
|
|
406
|
+
export { F as ReceivableDetailsPanel, F as default };
|