@voyantjs/bookings-ui 0.33.0 → 0.35.0
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 +4 -0
- package/dist/components/booking-dialog.d.ts.map +1 -1
- package/dist/components/booking-dialog.js +14 -7
- package/dist/components/booking-guarantee-dialog.d.ts.map +1 -1
- package/dist/components/booking-guarantee-dialog.js +5 -1
- package/dist/components/booking-item-dialog.d.ts.map +1 -1
- package/dist/components/booking-item-dialog.js +19 -6
- package/dist/components/booking-list.js +3 -2
- package/dist/components/booking-payment-schedule-dialog.d.ts.map +1 -1
- package/dist/components/booking-payment-schedule-dialog.js +6 -2
- package/dist/components/bookings-page.js +1 -1
- package/dist/components/payment-schedule-section.d.ts.map +1 -1
- package/dist/components/payment-schedule-section.js +4 -22
- package/dist/components/supplier-status-dialog.d.ts.map +1 -1
- package/dist/components/supplier-status-dialog.js +5 -1
- package/dist/components/traveler-dialog.d.ts.map +1 -1
- package/dist/components/traveler-dialog.js +8 -1
- package/dist/i18n/en.js +9 -9
- package/dist/i18n/ro.js +9 -9
- package/package.json +20 -20
package/README.md
CHANGED
|
@@ -12,6 +12,10 @@ pnpm add @voyantjs/bookings-ui @voyantjs/bookings-react @voyantjs/ui @tanstack/r
|
|
|
12
12
|
|
|
13
13
|
All components accept a `className` prop and merge it with `cn()`. Wrap or compose to extend; use the registry copy-paste path (`npx shadcn add @voyant/...`) for components you want to fork outright.
|
|
14
14
|
|
|
15
|
+
Page components render with `p-6` outer padding by default and are intended to
|
|
16
|
+
mount directly into an app route outlet. Pass `className` to extend or override
|
|
17
|
+
that spacing when a shell owns the page chrome.
|
|
18
|
+
|
|
15
19
|
## Components
|
|
16
20
|
|
|
17
21
|
- `BookingsPage`, `BookingDetailPage`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking-dialog.d.ts","sourceRoot":"","sources":["../../src/components/booking-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"booking-dialog.d.ts","sourceRoot":"","sources":["../../src/components/booking-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,0BAA0B,CAAA;AAwDjF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;IAC5C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAWD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,SAAS,EACT,gBAAgB,GACjB,EAAE,kBAAkB,2CAoBpB"}
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useBookingMutation } from "@voyantjs/bookings-react";
|
|
4
4
|
import { Button, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Textarea, } from "@voyantjs/ui/components";
|
|
5
5
|
import { CurrencyCombobox } from "@voyantjs/ui/components/currency-combobox";
|
|
6
|
+
import { CurrencyInput } from "@voyantjs/ui/components/currency-input";
|
|
6
7
|
import { DateRangePicker } from "@voyantjs/ui/components/date-picker";
|
|
7
8
|
import { zodResolver } from "@voyantjs/ui/lib/zod-resolver";
|
|
8
9
|
import { Loader2 } from "lucide-react";
|
|
@@ -94,12 +95,8 @@ function BookingEditDialog({ open, onOpenChange, booking, onSuccess }) {
|
|
|
94
95
|
bookingNumber: values.bookingNumber,
|
|
95
96
|
status: values.status,
|
|
96
97
|
sellCurrency: values.sellCurrency,
|
|
97
|
-
sellAmountCents: values.sellAmountCents
|
|
98
|
-
|
|
99
|
-
: null,
|
|
100
|
-
costAmountCents: values.costAmountCents && typeof values.costAmountCents === "number"
|
|
101
|
-
? values.costAmountCents
|
|
102
|
-
: null,
|
|
98
|
+
sellAmountCents: typeof values.sellAmountCents === "number" ? values.sellAmountCents : null,
|
|
99
|
+
costAmountCents: typeof values.costAmountCents === "number" ? values.costAmountCents : null,
|
|
103
100
|
startDate: values.startDate || null,
|
|
104
101
|
endDate: values.endDate || null,
|
|
105
102
|
pax: values.pax && typeof values.pax === "number" ? values.pax : null,
|
|
@@ -119,5 +116,15 @@ function BookingEditDialog({ open, onOpenChange, booking, onSuccess }) {
|
|
|
119
116
|
}, onChange: (nextValue) => {
|
|
120
117
|
form.setValue("startDate", nextValue?.from ?? "", { shouldDirty: true });
|
|
121
118
|
form.setValue("endDate", nextValue?.to ?? "", { shouldDirty: true });
|
|
122
|
-
}, placeholder: messages.bookingDialog.placeholders.travelDates, className: "w-full" })] })] }), _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingDialog.fields.sellAmountCents }), _jsx(
|
|
119
|
+
}, placeholder: messages.bookingDialog.placeholders.travelDates, className: "w-full" })] })] }), _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingDialog.fields.sellAmountCents }), _jsx(CurrencyInput, { value: typeof form.watch("sellAmountCents") === "number"
|
|
120
|
+
? form.watch("sellAmountCents")
|
|
121
|
+
: null, onChange: (next) => form.setValue("sellAmountCents", next, {
|
|
122
|
+
shouldDirty: true,
|
|
123
|
+
shouldValidate: true,
|
|
124
|
+
}), currency: form.watch("sellCurrency") })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingDialog.fields.costAmountCents }), _jsx(CurrencyInput, { value: typeof form.watch("costAmountCents") === "number"
|
|
125
|
+
? form.watch("costAmountCents")
|
|
126
|
+
: null, onChange: (next) => form.setValue("costAmountCents", next, {
|
|
127
|
+
shouldDirty: true,
|
|
128
|
+
shouldValidate: true,
|
|
129
|
+
}), currency: form.watch("sellCurrency") })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingDialog.fields.pax }), _jsx(Input, { ...form.register("pax"), type: "number", min: "1", placeholder: messages.bookingDialog.placeholders.pax })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingDialog.fields.internalNotes }), _jsx(Textarea, { ...form.register("internalNotes"), placeholder: messages.bookingDialog.placeholders.internalNotes })] })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onOpenChange(false), children: messages.common.cancel }), _jsxs(Button, { type: "submit", size: "sm", disabled: isSubmitting, children: [isSubmitting && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), messages.common.saveChanges] })] })] })] }) }));
|
|
123
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking-guarantee-dialog.d.ts","sourceRoot":"","sources":["../../src/components/booking-guarantee-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAA+B,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"booking-guarantee-dialog.d.ts","sourceRoot":"","sources":["../../src/components/booking-guarantee-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAA+B,MAAM,yBAAyB,CAAA;AAiElG,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,sBAAsB,CAAA;IAClC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,GACV,EAAE,2BAA2B,2CAqN7B"}
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useBookingGuaranteeMutation } from "@voyantjs/finance-react";
|
|
4
4
|
import { Button, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Textarea, } from "@voyantjs/ui/components";
|
|
5
5
|
import { CurrencyCombobox } from "@voyantjs/ui/components/currency-combobox";
|
|
6
|
+
import { CurrencyInput } from "@voyantjs/ui/components/currency-input";
|
|
6
7
|
import { DateTimePicker } from "@voyantjs/ui/components/date-time-picker";
|
|
7
8
|
import { zodResolver } from "@voyantjs/ui/lib/zod-resolver";
|
|
8
9
|
import { Loader2 } from "lucide-react";
|
|
@@ -108,7 +109,10 @@ export function BookingGuaranteeDialog({ open, onOpenChange, bookingId, guarante
|
|
|
108
109
|
})), value: form.watch("status"), onValueChange: (v) => form.setValue("status", (v ?? "pending")), children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: guaranteeStatuses.map((s) => (_jsx(SelectItem, { value: s, children: messages.bookingGuaranteeDialog.guaranteeStatusLabels[s] }, s))) })] })] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingGuaranteeDialog.fields.currency }), _jsx(CurrencyCombobox, { value: form.watch("currency") || null, onChange: (next) => form.setValue("currency", next ?? DEFAULT_CURRENCY, {
|
|
109
110
|
shouldValidate: true,
|
|
110
111
|
shouldDirty: true,
|
|
111
|
-
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingGuaranteeDialog.fields.amountCents }), _jsx(
|
|
112
|
+
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingGuaranteeDialog.fields.amountCents }), _jsx(CurrencyInput, { value: form.watch("amountCents"), onChange: (next) => form.setValue("amountCents", next, {
|
|
113
|
+
shouldDirty: true,
|
|
114
|
+
shouldValidate: true,
|
|
115
|
+
}), currency: form.watch("currency") })] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingGuaranteeDialog.fields.provider }), _jsx(Input, { ...form.register("provider"), placeholder: messages.bookingGuaranteeDialog.placeholders.provider })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingGuaranteeDialog.fields.referenceNumber }), _jsx(Input, { ...form.register("referenceNumber"), placeholder: messages.bookingGuaranteeDialog.placeholders.referenceNumber })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingGuaranteeDialog.fields.expiresAt }), _jsx(DateTimePicker, { value: form.watch("expiresAt") || null, onChange: (next) => form.setValue("expiresAt", next ?? "", {
|
|
112
116
|
shouldValidate: true,
|
|
113
117
|
shouldDirty: true,
|
|
114
118
|
}), placeholder: messages.bookingGuaranteeDialog.placeholders.expiresAt, className: "w-full" })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingGuaranteeDialog.fields.notes }), _jsx(Textarea, { ...form.register("notes"), placeholder: messages.bookingGuaranteeDialog.placeholders.notes })] })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onOpenChange(false), children: messages.common.cancel }), _jsxs(Button, { type: "submit", size: "sm", disabled: isSubmitting, children: [isSubmitting && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), isEditing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking-item-dialog.d.ts","sourceRoot":"","sources":["../../src/components/booking-item-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAA0B,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"booking-item-dialog.d.ts","sourceRoot":"","sources":["../../src/components/booking-item-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAA0B,MAAM,0BAA0B,CAAA;AAiEzF,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,IAAI,EACJ,SAAS,GACV,EAAE,sBAAsB,2CA2RxB"}
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useBookingItemMutation } from "@voyantjs/bookings-react";
|
|
4
4
|
import { Button, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Textarea, } from "@voyantjs/ui/components";
|
|
5
5
|
import { CurrencyCombobox } from "@voyantjs/ui/components/currency-combobox";
|
|
6
|
+
import { CurrencyInput } from "@voyantjs/ui/components/currency-input";
|
|
6
7
|
import { DatePicker } from "@voyantjs/ui/components/date-picker";
|
|
7
8
|
import { zodResolver } from "@voyantjs/ui/lib/zod-resolver";
|
|
8
9
|
import { Loader2 } from "lucide-react";
|
|
@@ -93,11 +94,11 @@ export function BookingItemDialog({ open, onOpenChange, bookingId, item, onSucce
|
|
|
93
94
|
status: values.status,
|
|
94
95
|
quantity: values.quantity,
|
|
95
96
|
sellCurrency: values.sellCurrency,
|
|
96
|
-
unitSellAmountCents: values.unitSellAmountCents
|
|
97
|
-
totalSellAmountCents: values.totalSellAmountCents
|
|
97
|
+
unitSellAmountCents: values.unitSellAmountCents ?? null,
|
|
98
|
+
totalSellAmountCents: values.totalSellAmountCents ?? null,
|
|
98
99
|
costCurrency: values.costCurrency || null,
|
|
99
|
-
unitCostAmountCents: values.unitCostAmountCents
|
|
100
|
-
totalCostAmountCents: values.totalCostAmountCents
|
|
100
|
+
unitCostAmountCents: values.unitCostAmountCents ?? null,
|
|
101
|
+
totalCostAmountCents: values.totalCostAmountCents ?? null,
|
|
101
102
|
serviceDate: values.serviceDate || null,
|
|
102
103
|
description: values.description || null,
|
|
103
104
|
notes: values.notes || null,
|
|
@@ -123,10 +124,22 @@ export function BookingItemDialog({ open, onOpenChange, bookingId, item, onSucce
|
|
|
123
124
|
})), value: form.watch("status"), onValueChange: (v) => form.setValue("status", v), children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: itemStatuses.map((s) => (_jsx(SelectItem, { value: s, children: messages.bookingItemDialog.itemStatusLabels[s] }, s))) })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.quantity }), _jsx(Input, { ...form.register("quantity"), type: "number", min: 1 })] })] }), _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.sellCurrency }), _jsx(CurrencyCombobox, { value: form.watch("sellCurrency") || null, onChange: (next) => form.setValue("sellCurrency", next ?? DEFAULT_CURRENCY, {
|
|
124
125
|
shouldValidate: true,
|
|
125
126
|
shouldDirty: true,
|
|
126
|
-
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.unitSellAmountCents }), _jsx(
|
|
127
|
+
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.unitSellAmountCents }), _jsx(CurrencyInput, { value: form.watch("unitSellAmountCents"), onChange: (next) => form.setValue("unitSellAmountCents", next, {
|
|
128
|
+
shouldDirty: true,
|
|
129
|
+
shouldValidate: true,
|
|
130
|
+
}), currency: form.watch("sellCurrency"), placeholder: messages.bookingItemDialog.placeholders.unitSellAmountCents })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.totalSellAmountCents }), _jsx(CurrencyInput, { value: form.watch("totalSellAmountCents"), onChange: (next) => form.setValue("totalSellAmountCents", next, {
|
|
131
|
+
shouldDirty: true,
|
|
132
|
+
shouldValidate: true,
|
|
133
|
+
}), currency: form.watch("sellCurrency"), placeholder: messages.bookingItemDialog.placeholders.totalSellAmountCents })] })] }), _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.costCurrency }), _jsx(CurrencyCombobox, { value: form.watch("costCurrency") || null, onChange: (next) => form.setValue("costCurrency", next ?? DEFAULT_CURRENCY, {
|
|
127
134
|
shouldValidate: true,
|
|
128
135
|
shouldDirty: true,
|
|
129
|
-
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.unitCostAmountCents }), _jsx(
|
|
136
|
+
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.unitCostAmountCents }), _jsx(CurrencyInput, { value: form.watch("unitCostAmountCents"), onChange: (next) => form.setValue("unitCostAmountCents", next, {
|
|
137
|
+
shouldDirty: true,
|
|
138
|
+
shouldValidate: true,
|
|
139
|
+
}), currency: form.watch("costCurrency") || form.watch("sellCurrency"), placeholder: messages.bookingItemDialog.placeholders.unitCostAmountCents })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.totalCostAmountCents }), _jsx(CurrencyInput, { value: form.watch("totalCostAmountCents"), onChange: (next) => form.setValue("totalCostAmountCents", next, {
|
|
140
|
+
shouldDirty: true,
|
|
141
|
+
shouldValidate: true,
|
|
142
|
+
}), currency: form.watch("costCurrency") || form.watch("sellCurrency"), placeholder: messages.bookingItemDialog.placeholders.totalCostAmountCents })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.serviceDate }), _jsx(DatePicker, { value: form.watch("serviceDate") || null, onChange: (next) => form.setValue("serviceDate", next ?? "", {
|
|
130
143
|
shouldValidate: true,
|
|
131
144
|
shouldDirty: true,
|
|
132
145
|
}), placeholder: messages.bookingItemDialog.placeholders.serviceDate, className: "w-full" })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.description }), _jsx(Textarea, { ...form.register("description"), placeholder: messages.bookingItemDialog.placeholders.description })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.bookingItemDialog.fields.notes }), _jsx(Textarea, { ...form.register("notes"), placeholder: messages.bookingItemDialog.placeholders.notes })] })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onOpenChange(false), children: messages.common.cancel }), _jsxs(Button, { type: "submit", size: "sm", disabled: isSubmitting, children: [isSubmitting && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), isEditing ? messages.common.saveChanges : messages.bookingItemDialog.actions.addItem] })] })] })] }) }));
|
|
@@ -169,9 +169,10 @@ function formatBookingItems(booking, moreTemplate) {
|
|
|
169
169
|
const [first, ...rest] = items;
|
|
170
170
|
if (!first)
|
|
171
171
|
return _jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
172
|
+
const label = first.productName ?? first.title;
|
|
172
173
|
if (rest.length === 0)
|
|
173
|
-
return
|
|
174
|
-
return (_jsxs("span", { children: [
|
|
174
|
+
return label;
|
|
175
|
+
return (_jsxs("span", { children: [label, _jsx("span", { className: "ml-1 text-xs text-muted-foreground", children: formatMessage(moreTemplate, { count: rest.length }) })] }));
|
|
175
176
|
}
|
|
176
177
|
function formatBookingDateTime(value, formatDateTime) {
|
|
177
178
|
if (!value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking-payment-schedule-dialog.d.ts","sourceRoot":"","sources":["../../src/components/booking-payment-schedule-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,4BAA4B,EAElC,MAAM,yBAAyB,CAAA;AAgDhC,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,4BAA4B,CAAA;IACvC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EAAE,iCAAiC,
|
|
1
|
+
{"version":3,"file":"booking-payment-schedule-dialog.d.ts","sourceRoot":"","sources":["../../src/components/booking-payment-schedule-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,4BAA4B,EAElC,MAAM,yBAAyB,CAAA;AAgDhC,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,4BAA4B,CAAA;IACvC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EAAE,iCAAiC,2CAsMnC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useBookingPaymentScheduleMutation, } from "@voyantjs/finance-react";
|
|
4
|
-
import { Button, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle,
|
|
4
|
+
import { Button, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Textarea, } from "@voyantjs/ui/components";
|
|
5
5
|
import { CurrencyCombobox } from "@voyantjs/ui/components/currency-combobox";
|
|
6
|
+
import { CurrencyInput } from "@voyantjs/ui/components/currency-input";
|
|
6
7
|
import { DatePicker } from "@voyantjs/ui/components/date-picker";
|
|
7
8
|
import { zodResolver } from "@voyantjs/ui/lib/zod-resolver";
|
|
8
9
|
import { Loader2 } from "lucide-react";
|
|
@@ -90,7 +91,10 @@ export function BookingPaymentScheduleDialog({ open, onOpenChange, bookingId, sc
|
|
|
90
91
|
}), placeholder: messages.paymentScheduleDialog.placeholders.dueDate, className: "w-full" }), form.formState.errors.dueDate && (_jsx("p", { className: "text-xs text-destructive", children: form.formState.errors.dueDate.message }))] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.paymentScheduleDialog.fields.currency }), _jsx(CurrencyCombobox, { value: form.watch("currency") || null, onChange: (next) => form.setValue("currency", next ?? DEFAULT_CURRENCY, {
|
|
91
92
|
shouldValidate: true,
|
|
92
93
|
shouldDirty: true,
|
|
93
|
-
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.paymentScheduleDialog.fields.amountCents }), _jsx(
|
|
94
|
+
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.paymentScheduleDialog.fields.amountCents }), _jsx(CurrencyInput, { value: form.watch("amountCents"), onChange: (next) => form.setValue("amountCents", next ?? 0, {
|
|
95
|
+
shouldDirty: true,
|
|
96
|
+
shouldValidate: true,
|
|
97
|
+
}), currency: form.watch("currency") }), form.formState.errors.amountCents && (_jsx("p", { className: "text-xs text-destructive", children: form.formState.errors.amountCents.message }))] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.paymentScheduleDialog.fields.notes }), _jsx(Textarea, { ...form.register("notes"), placeholder: messages.paymentScheduleDialog.placeholders.notes })] })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onOpenChange(false), children: messages.common.cancel }), _jsxs(Button, { type: "submit", size: "sm", disabled: isSubmitting, children: [isSubmitting && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), isEditing
|
|
94
98
|
? messages.common.saveChanges
|
|
95
99
|
: messages.paymentScheduleDialog.actions.addSchedule] })] })] })] }) }));
|
|
96
100
|
}
|
|
@@ -5,5 +5,5 @@ import { useBookingsUiMessagesOrDefault } from "../i18n/index.js";
|
|
|
5
5
|
import { BookingList } from "./booking-list.js";
|
|
6
6
|
export function BookingsPage({ pageSize, onBookingOpen, className } = {}) {
|
|
7
7
|
const messages = useBookingsUiMessagesOrDefault().bookingsPage;
|
|
8
|
-
return (_jsxs("div", { "data-slot": "bookings-page", className: cn("flex flex-col gap-6", className), children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-bold tracking-tight", children: messages.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: messages.description })] }), _jsx(BookingList, { pageSize: pageSize, onSelectBooking: onBookingOpen })] }));
|
|
8
|
+
return (_jsxs("div", { "data-slot": "bookings-page", className: cn("flex flex-col gap-6 p-6", className), children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-bold tracking-tight", children: messages.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: messages.description })] }), _jsx(BookingList, { pageSize: pageSize, onSelectBooking: onBookingOpen })] }));
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-schedule-section.d.ts","sourceRoot":"","sources":["../../src/components/payment-schedule-section.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payment-schedule-section.d.ts","sourceRoot":"","sources":["../../src/components/payment-schedule-section.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;AAEzE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,mBAAmB,CAAA;IACzB,wEAAwE;IACxE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,wEAAwE;IACxE,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,qDAAqD;IACrD,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AAED,eAAO,MAAM,yBAAyB,EAAE,oBASvC,CAAA;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,oBAAoB,CAAA;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC/C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,iBAAiB,CAAC,EAAE,MAAM,CAAA;QAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;CACF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,MAAM,GACP,EAAE,2BAA2B,2CAmH7B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Button,
|
|
3
|
+
import { Button, Label } from "@voyantjs/ui/components";
|
|
4
|
+
import { CurrencyInput } from "@voyantjs/ui/components/currency-input";
|
|
5
|
+
import { DatePicker } from "@voyantjs/ui/components/date-picker";
|
|
4
6
|
import { useBookingsUiMessagesOrDefault } from "../i18n/provider.js";
|
|
5
7
|
export const emptyPaymentScheduleValue = {
|
|
6
8
|
mode: "unpaid",
|
|
@@ -12,25 +14,6 @@ export const emptyPaymentScheduleValue = {
|
|
|
12
14
|
splitSecondAmountCents: null,
|
|
13
15
|
splitSecondDueDate: null,
|
|
14
16
|
};
|
|
15
|
-
/**
|
|
16
|
-
* Converts an `<input type="number">` string value to minor units (cents).
|
|
17
|
-
* Accepts `""` / `NaN` → `null`. Multiplies by 100 and rounds to avoid
|
|
18
|
-
* floating-point garbage (`19.99 * 100` → `1999`, not `1998.99999...`).
|
|
19
|
-
*/
|
|
20
|
-
function majorStringToCents(value) {
|
|
21
|
-
const trimmed = value.trim();
|
|
22
|
-
if (!trimmed)
|
|
23
|
-
return null;
|
|
24
|
-
const parsed = Number(trimmed);
|
|
25
|
-
if (!Number.isFinite(parsed) || parsed < 0)
|
|
26
|
-
return null;
|
|
27
|
-
return Math.round(parsed * 100);
|
|
28
|
-
}
|
|
29
|
-
function centsToMajorString(cents) {
|
|
30
|
-
if (cents == null)
|
|
31
|
-
return "";
|
|
32
|
-
return (cents / 100).toFixed(2);
|
|
33
|
-
}
|
|
34
17
|
/**
|
|
35
18
|
* Payment schedule picker for booking-create flows. Operators choose one of
|
|
36
19
|
* four modes; only the relevant fields render for the selected mode, so the
|
|
@@ -55,7 +38,6 @@ export function PaymentScheduleSection({ value, onChange, totalAmountCents, curr
|
|
|
55
38
|
const messages = useBookingsUiMessagesOrDefault();
|
|
56
39
|
const merged = { ...messages.paymentScheduleSection.labels, ...labels };
|
|
57
40
|
const set = (patch) => onChange({ ...value, ...patch });
|
|
58
|
-
const currencySuffix = currency ? ` ${currency}` : "";
|
|
59
41
|
const modes = [
|
|
60
42
|
{ id: "unpaid", label: merged.modeUnpaid },
|
|
61
43
|
{ id: "full", label: merged.modeFull },
|
|
@@ -73,5 +55,5 @@ export function PaymentScheduleSection({ value, onChange, totalAmountCents, curr
|
|
|
73
55
|
splitSecondAmountCents: totalAmountCents - half,
|
|
74
56
|
});
|
|
75
57
|
};
|
|
76
|
-
return (_jsxs("div", { className: "flex flex-col gap-3 rounded-md border p-3", children: [_jsx(Label, { children: merged.heading }), _jsx("div", { className: "flex flex-wrap items-center gap-2", children: modes.map((mode) => (_jsx(Button, { type: "button", size: "sm", variant: value.mode === mode.id ? "default" : "ghost", onClick: () => set({ mode: mode.id }), children: mode.label }, mode.id))) }), value.mode === "unpaid" && (_jsx("p", { className: "text-xs text-muted-foreground", children: merged.unpaidHint })), value.mode === "full" && (_jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
58
|
+
return (_jsxs("div", { className: "flex flex-col gap-3 rounded-md border p-3", children: [_jsx(Label, { children: merged.heading }), _jsx("div", { className: "flex flex-wrap items-center gap-2", children: modes.map((mode) => (_jsx(Button, { type: "button", size: "sm", variant: value.mode === mode.id ? "default" : "ghost", onClick: () => set({ mode: mode.id }), children: mode.label }, mode.id))) }), value.mode === "unpaid" && (_jsx("p", { className: "text-xs text-muted-foreground", children: merged.unpaidHint })), value.mode === "full" && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs", children: merged.dueDate }), _jsx(DatePicker, { value: value.fullDueDate ?? "", onChange: (nextValue) => set({ fullDueDate: nextValue }) })] })), value.mode === "advance" && (_jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs", children: merged.amount }), _jsx(CurrencyInput, { value: value.advanceAmountCents, onChange: (next) => set({ advanceAmountCents: next }), currency: currency })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs", children: merged.dueDate }), _jsx(DatePicker, { value: value.advanceDueDate ?? "", onChange: (nextValue) => set({ advanceDueDate: nextValue }) })] })] })), value.mode === "split" && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-xs font-medium", children: merged.firstInstallment }), totalAmountCents ? (_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: handlePreset5050, children: merged.preset5050 })) : null] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx(CurrencyInput, { placeholder: merged.amount, value: value.splitFirstAmountCents, onChange: (next) => set({ splitFirstAmountCents: next }), currency: currency }), _jsx(DatePicker, { value: value.splitFirstDueDate ?? "", onChange: (nextValue) => set({ splitFirstDueDate: nextValue }) })] }), _jsx("div", { className: "text-xs font-medium", children: merged.secondInstallment }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx(CurrencyInput, { placeholder: merged.amount, value: value.splitSecondAmountCents, onChange: (next) => set({ splitSecondAmountCents: next }), currency: currency }), _jsx(DatePicker, { value: value.splitSecondDueDate ?? "", onChange: (nextValue) => set({ splitSecondDueDate: nextValue }) })] })] }))] }));
|
|
77
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supplier-status-dialog.d.ts","sourceRoot":"","sources":["../../src/components/supplier-status-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"supplier-status-dialog.d.ts","sourceRoot":"","sources":["../../src/components/supplier-status-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,0BAA0B,CAAA;AA8CjC,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,2BAA2B,CAAA;IAC5C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAUD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,cAAc,EACd,SAAS,GACV,EAAE,yBAAyB,2CAyK3B"}
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useSupplierStatusMutation, } from "@voyantjs/bookings-react";
|
|
4
4
|
import { Button, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Textarea, } from "@voyantjs/ui/components";
|
|
5
5
|
import { CurrencyCombobox } from "@voyantjs/ui/components/currency-combobox";
|
|
6
|
+
import { CurrencyInput } from "@voyantjs/ui/components/currency-input";
|
|
6
7
|
import { zodResolver } from "@voyantjs/ui/lib/zod-resolver";
|
|
7
8
|
import { Loader2 } from "lucide-react";
|
|
8
9
|
import { useEffect } from "react";
|
|
@@ -87,7 +88,10 @@ export function SupplierStatusDialog({ open, onOpenChange, bookingId, supplierSt
|
|
|
87
88
|
})), children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: CONFIRMATION_STATUSES.map((status) => (_jsx(SelectItem, { value: status.value, children: messages.common.supplierStatusLabels[status.value] }, status.value))) })] })] })] }), _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.supplierStatusDialog.fields.costCurrency }), _jsx(CurrencyCombobox, { value: form.watch("costCurrency") || null, onChange: (next) => form.setValue("costCurrency", next ?? DEFAULT_CURRENCY, {
|
|
88
89
|
shouldValidate: true,
|
|
89
90
|
shouldDirty: true,
|
|
90
|
-
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.supplierStatusDialog.fields.costAmountCents }), _jsx(
|
|
91
|
+
}) })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.supplierStatusDialog.fields.costAmountCents }), _jsx(CurrencyInput, { value: form.watch("costAmountCents"), onChange: (next) => form.setValue("costAmountCents", next ?? 0, {
|
|
92
|
+
shouldDirty: true,
|
|
93
|
+
shouldValidate: true,
|
|
94
|
+
}), currency: form.watch("costCurrency") })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.supplierStatusDialog.fields.supplierReference }), _jsx(Input, { ...form.register("supplierReference"), placeholder: messages.supplierStatusDialog.placeholders.supplierReference })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.supplierStatusDialog.fields.notes }), _jsx(Textarea, { ...form.register("notes"), placeholder: messages.supplierStatusDialog.placeholders.notes })] })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onOpenChange(false), children: messages.common.cancel }), _jsxs(Button, { type: "submit", size: "sm", disabled: isSubmitting, children: [isSubmitting && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), isEditing
|
|
91
95
|
? messages.common.saveChanges
|
|
92
96
|
: messages.supplierStatusDialog.actions.addSupplierStatus] })] })] })] }) }));
|
|
93
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traveler-dialog.d.ts","sourceRoot":"","sources":["../../src/components/traveler-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,qBAAqB,EAG3B,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"traveler-dialog.d.ts","sourceRoot":"","sources":["../../src/components/traveler-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,qBAAqB,EAG3B,MAAM,0BAA0B,CAAA;AA2DjC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,qBAAqB,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EAAE,mBAAmB,2CAqZrB"}
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useRevealTraveler, useTravelerWithTravelDetailsMutation, } from "@voyantjs/bookings-react";
|
|
4
4
|
import { usePersonDocumentMutation, usePersonDocuments, usePersonMutation, usePersonTravelSnapshot, } from "@voyantjs/crm-react";
|
|
5
5
|
import { Button, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, Label, Textarea, } from "@voyantjs/ui/components";
|
|
6
|
+
import { DatePicker } from "@voyantjs/ui/components/date-picker";
|
|
6
7
|
import { zodResolver } from "@voyantjs/ui/lib/zod-resolver";
|
|
7
8
|
import { Loader2, Sparkles, Upload } from "lucide-react";
|
|
8
9
|
import { useEffect, useMemo, useState } from "react";
|
|
@@ -224,7 +225,13 @@ export function TravelerDialog({ open, onOpenChange, bookingId, traveler, onSucc
|
|
|
224
225
|
});
|
|
225
226
|
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { size: "lg", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: isEditing
|
|
226
227
|
? messages.travelerDialog.titles.edit
|
|
227
|
-
: messages.travelerDialog.titles.create }) }), _jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-1 flex-col overflow-hidden", children: [_jsxs(DialogBody, { className: "grid gap-4", children: [_jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.firstName }), _jsx(Input, { ...form.register("firstName"), placeholder: messages.travelerDialog.placeholders.firstName }), form.formState.errors.firstName && (_jsx("p", { className: "text-xs text-destructive", children: form.formState.errors.firstName.message }))] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.lastName }), _jsx(Input, { ...form.register("lastName"), placeholder: messages.travelerDialog.placeholders.lastName }), form.formState.errors.lastName && (_jsx("p", { className: "text-xs text-destructive", children: form.formState.errors.lastName.message }))] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.email }), _jsx(Input, { ...form.register("email"), type: "email", placeholder: messages.travelerDialog.placeholders.email })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.phone }), _jsx(Input, { ...form.register("phone"), placeholder: messages.travelerDialog.placeholders.phone })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.specialRequests }), _jsx(Textarea, { ...form.register("specialRequests"), placeholder: messages.travelerDialog.placeholders.specialRequests })] }), _jsxs("div", { className: "flex flex-col gap-3 border-t pt-4", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("h3", { className: "text-sm font-semibold", children: messages.travelerDialog.fields.travelDetailsHeading }), personId ? (_jsxs(Button, { type: "button", variant: "ghost", size: "sm", disabled: !snapshot || snapshotQuery.isLoading, onClick: prefillFromProfile, children: [_jsx(Sparkles, { className: "mr-2 h-3.5 w-3.5" }), messages.travelerDialog.actions.prefillFromProfile] })) : null] }), prefilledNotice ? (_jsx("p", { className: "text-xs text-muted-foreground", children: messages.travelerDialog.hints.prefilledFromProfile })) : null, _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.passportNumber }), _jsx(Input, { ...form.register("passportNumber"), placeholder: messages.travelerDialog.placeholders.passportNumber })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.passportExpiry }), _jsx(
|
|
228
|
+
: messages.travelerDialog.titles.create }) }), _jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-1 flex-col overflow-hidden", children: [_jsxs(DialogBody, { className: "grid gap-4", children: [_jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.firstName }), _jsx(Input, { ...form.register("firstName"), placeholder: messages.travelerDialog.placeholders.firstName }), form.formState.errors.firstName && (_jsx("p", { className: "text-xs text-destructive", children: form.formState.errors.firstName.message }))] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.lastName }), _jsx(Input, { ...form.register("lastName"), placeholder: messages.travelerDialog.placeholders.lastName }), form.formState.errors.lastName && (_jsx("p", { className: "text-xs text-destructive", children: form.formState.errors.lastName.message }))] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.email }), _jsx(Input, { ...form.register("email"), type: "email", placeholder: messages.travelerDialog.placeholders.email })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.phone }), _jsx(Input, { ...form.register("phone"), placeholder: messages.travelerDialog.placeholders.phone })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.specialRequests }), _jsx(Textarea, { ...form.register("specialRequests"), placeholder: messages.travelerDialog.placeholders.specialRequests })] }), _jsxs("div", { className: "flex flex-col gap-3 border-t pt-4", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("h3", { className: "text-sm font-semibold", children: messages.travelerDialog.fields.travelDetailsHeading }), personId ? (_jsxs(Button, { type: "button", variant: "ghost", size: "sm", disabled: !snapshot || snapshotQuery.isLoading, onClick: prefillFromProfile, children: [_jsx(Sparkles, { className: "mr-2 h-3.5 w-3.5" }), messages.travelerDialog.actions.prefillFromProfile] })) : null] }), prefilledNotice ? (_jsx("p", { className: "text-xs text-muted-foreground", children: messages.travelerDialog.hints.prefilledFromProfile })) : null, _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.passportNumber }), _jsx(Input, { ...form.register("passportNumber"), placeholder: messages.travelerDialog.placeholders.passportNumber })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.passportExpiry }), _jsx(DatePicker, { value: form.watch("passportExpiry") || null, onChange: (nextValue) => form.setValue("passportExpiry", nextValue ?? "", {
|
|
229
|
+
shouldDirty: true,
|
|
230
|
+
shouldValidate: true,
|
|
231
|
+
}), placeholder: messages.travelerDialog.placeholders.passportExpiry })] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.passportIssuingCountry }), _jsx(Input, { ...form.register("passportIssuingCountry"), placeholder: messages.travelerDialog.placeholders.passportIssuingCountry })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.passportIssuingAuthority }), _jsx(Input, { ...form.register("passportIssuingAuthority"), placeholder: messages.travelerDialog.placeholders.passportIssuingAuthority })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.dateOfBirth }), _jsx(DatePicker, { value: form.watch("dateOfBirth") || null, onChange: (nextValue) => form.setValue("dateOfBirth", nextValue ?? "", {
|
|
232
|
+
shouldDirty: true,
|
|
233
|
+
shouldValidate: true,
|
|
234
|
+
}), placeholder: messages.travelerDialog.placeholders.dateOfBirth })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.dietaryRequirements }), _jsx(Textarea, { ...form.register("dietaryRequirements"), placeholder: messages.travelerDialog.placeholders.dietaryRequirements })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { children: messages.travelerDialog.fields.accessibilityNeeds }), _jsx(Textarea, { ...form.register("accessibilityNeeds"), placeholder: messages.travelerDialog.placeholders.accessibilityNeeds })] })] }), personId && hasDivergence ? (_jsxs("div", { className: "flex items-center justify-between gap-2 rounded-md border bg-muted/40 px-3 py-2", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: savedToProfileMessage ? messages.travelerDialog.hints.savedToProfile : null }), _jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: isSavingProfile, onClick: saveBackToProfile, children: [isSavingProfile ? (_jsx(Loader2, { className: "mr-2 h-3.5 w-3.5 animate-spin" })) : (_jsx(Upload, { className: "mr-2 h-3.5 w-3.5" })), messages.travelerDialog.actions.saveToProfile] })] })) : null] })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onOpenChange(false), children: messages.common.cancel }), _jsxs(Button, { type: "submit", size: "sm", disabled: isSubmitting, children: [isSubmitting && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), isEditing
|
|
228
235
|
? messages.common.saveChanges
|
|
229
236
|
: messages.travelerDialog.actions.addTraveler] })] })] })] }) }));
|
|
230
237
|
}
|
package/dist/i18n/en.js
CHANGED
|
@@ -155,11 +155,11 @@ export const bookingsUiEn = {
|
|
|
155
155
|
status: "Status",
|
|
156
156
|
quantity: "Quantity",
|
|
157
157
|
sellCurrency: "Sell currency",
|
|
158
|
-
unitSellAmountCents: "Unit sell
|
|
159
|
-
totalSellAmountCents: "Total sell
|
|
158
|
+
unitSellAmountCents: "Unit sell",
|
|
159
|
+
totalSellAmountCents: "Total sell",
|
|
160
160
|
costCurrency: "Cost currency",
|
|
161
|
-
unitCostAmountCents: "Unit cost
|
|
162
|
-
totalCostAmountCents: "Total cost
|
|
161
|
+
unitCostAmountCents: "Unit cost",
|
|
162
|
+
totalCostAmountCents: "Total cost",
|
|
163
163
|
serviceDate: "Service date",
|
|
164
164
|
description: "Description",
|
|
165
165
|
notes: "Notes",
|
|
@@ -224,7 +224,7 @@ export const bookingsUiEn = {
|
|
|
224
224
|
status: "Status",
|
|
225
225
|
dueDate: "Due date",
|
|
226
226
|
currency: "Currency",
|
|
227
|
-
amountCents: "Amount
|
|
227
|
+
amountCents: "Amount",
|
|
228
228
|
notes: "Notes",
|
|
229
229
|
},
|
|
230
230
|
placeholders: {
|
|
@@ -439,7 +439,7 @@ export const bookingsUiEn = {
|
|
|
439
439
|
serviceName: "Service name",
|
|
440
440
|
status: "Status",
|
|
441
441
|
costCurrency: "Cost currency",
|
|
442
|
-
costAmountCents: "Cost amount
|
|
442
|
+
costAmountCents: "Cost amount",
|
|
443
443
|
supplierReference: "Supplier reference",
|
|
444
444
|
notes: "Notes",
|
|
445
445
|
},
|
|
@@ -593,7 +593,7 @@ export const bookingsUiEn = {
|
|
|
593
593
|
type: "Type",
|
|
594
594
|
status: "Status",
|
|
595
595
|
currency: "Currency",
|
|
596
|
-
amountCents: "Amount
|
|
596
|
+
amountCents: "Amount",
|
|
597
597
|
provider: "Provider",
|
|
598
598
|
referenceNumber: "Reference number",
|
|
599
599
|
expiresAt: "Expires at",
|
|
@@ -683,8 +683,8 @@ export const bookingsUiEn = {
|
|
|
683
683
|
status: "Status",
|
|
684
684
|
sellCurrency: "Sell currency",
|
|
685
685
|
travelDates: "Travel dates",
|
|
686
|
-
sellAmountCents: "Sell amount
|
|
687
|
-
costAmountCents: "Cost amount
|
|
686
|
+
sellAmountCents: "Sell amount",
|
|
687
|
+
costAmountCents: "Cost amount",
|
|
688
688
|
pax: "Travelers (pax)",
|
|
689
689
|
internalNotes: "Internal notes",
|
|
690
690
|
},
|
package/dist/i18n/ro.js
CHANGED
|
@@ -155,11 +155,11 @@ export const bookingsUiRo = {
|
|
|
155
155
|
status: "Status",
|
|
156
156
|
quantity: "Cantitate",
|
|
157
157
|
sellCurrency: "Moneda vanzare",
|
|
158
|
-
unitSellAmountCents: "Pret unitar vanzare
|
|
159
|
-
totalSellAmountCents: "Pret total vanzare
|
|
158
|
+
unitSellAmountCents: "Pret unitar vanzare",
|
|
159
|
+
totalSellAmountCents: "Pret total vanzare",
|
|
160
160
|
costCurrency: "Moneda cost",
|
|
161
|
-
unitCostAmountCents: "Cost unitar
|
|
162
|
-
totalCostAmountCents: "Cost total
|
|
161
|
+
unitCostAmountCents: "Cost unitar",
|
|
162
|
+
totalCostAmountCents: "Cost total",
|
|
163
163
|
serviceDate: "Data serviciului",
|
|
164
164
|
description: "Descriere",
|
|
165
165
|
notes: "Note",
|
|
@@ -224,7 +224,7 @@ export const bookingsUiRo = {
|
|
|
224
224
|
status: "Status",
|
|
225
225
|
dueDate: "Data scadenta",
|
|
226
226
|
currency: "Moneda",
|
|
227
|
-
amountCents: "Suma
|
|
227
|
+
amountCents: "Suma",
|
|
228
228
|
notes: "Note",
|
|
229
229
|
},
|
|
230
230
|
placeholders: {
|
|
@@ -439,7 +439,7 @@ export const bookingsUiRo = {
|
|
|
439
439
|
serviceName: "Nume serviciu",
|
|
440
440
|
status: "Status",
|
|
441
441
|
costCurrency: "Moneda cost",
|
|
442
|
-
costAmountCents: "Cost
|
|
442
|
+
costAmountCents: "Cost",
|
|
443
443
|
supplierReference: "Referinta furnizor",
|
|
444
444
|
notes: "Note",
|
|
445
445
|
},
|
|
@@ -593,7 +593,7 @@ export const bookingsUiRo = {
|
|
|
593
593
|
type: "Tip",
|
|
594
594
|
status: "Status",
|
|
595
595
|
currency: "Moneda",
|
|
596
|
-
amountCents: "Suma
|
|
596
|
+
amountCents: "Suma",
|
|
597
597
|
provider: "Furnizor",
|
|
598
598
|
referenceNumber: "Numar referinta",
|
|
599
599
|
expiresAt: "Expira la",
|
|
@@ -683,8 +683,8 @@ export const bookingsUiRo = {
|
|
|
683
683
|
status: "Status",
|
|
684
684
|
sellCurrency: "Moneda vanzare",
|
|
685
685
|
travelDates: "Date calatorie",
|
|
686
|
-
sellAmountCents: "Pret vanzare
|
|
687
|
-
costAmountCents: "Cost
|
|
686
|
+
sellAmountCents: "Pret vanzare",
|
|
687
|
+
costAmountCents: "Cost",
|
|
688
688
|
pax: "Calatori (pax)",
|
|
689
689
|
internalNotes: "Note interne",
|
|
690
690
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/bookings-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,18 +51,18 @@
|
|
|
51
51
|
"react-dom": "^19.0.0",
|
|
52
52
|
"react-hook-form": "^7.60.0",
|
|
53
53
|
"zod": "^4.3.6",
|
|
54
|
-
"@voyantjs/availability-react": "0.
|
|
55
|
-
"@voyantjs/bookings-react": "0.
|
|
56
|
-
"@voyantjs/catalog": "0.
|
|
57
|
-
"@voyantjs/catalog-react": "0.
|
|
58
|
-
"@voyantjs/crm-react": "0.
|
|
59
|
-
"@voyantjs/finance-react": "0.
|
|
60
|
-
"@voyantjs/legal-react": "0.
|
|
61
|
-
"@voyantjs/products-react": "0.
|
|
62
|
-
"@voyantjs/ui": "0.
|
|
54
|
+
"@voyantjs/availability-react": "0.35.0",
|
|
55
|
+
"@voyantjs/bookings-react": "0.35.0",
|
|
56
|
+
"@voyantjs/catalog": "0.35.0",
|
|
57
|
+
"@voyantjs/catalog-react": "0.35.0",
|
|
58
|
+
"@voyantjs/crm-react": "0.35.0",
|
|
59
|
+
"@voyantjs/finance-react": "0.35.0",
|
|
60
|
+
"@voyantjs/legal-react": "0.35.0",
|
|
61
|
+
"@voyantjs/products-react": "0.35.0",
|
|
62
|
+
"@voyantjs/ui": "0.35.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@voyantjs/i18n": "0.
|
|
65
|
+
"@voyantjs/i18n": "0.35.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -75,16 +75,16 @@
|
|
|
75
75
|
"typescript": "^6.0.2",
|
|
76
76
|
"vitest": "^4.1.2",
|
|
77
77
|
"zod": "^4.3.6",
|
|
78
|
-
"@voyantjs/availability-react": "0.
|
|
79
|
-
"@voyantjs/bookings-react": "0.
|
|
80
|
-
"@voyantjs/catalog": "0.
|
|
81
|
-
"@voyantjs/catalog-react": "0.
|
|
82
|
-
"@voyantjs/crm-react": "0.
|
|
83
|
-
"@voyantjs/finance-react": "0.
|
|
84
|
-
"@voyantjs/legal-react": "0.
|
|
85
|
-
"@voyantjs/products-react": "0.
|
|
78
|
+
"@voyantjs/availability-react": "0.35.0",
|
|
79
|
+
"@voyantjs/bookings-react": "0.35.0",
|
|
80
|
+
"@voyantjs/catalog": "0.35.0",
|
|
81
|
+
"@voyantjs/catalog-react": "0.35.0",
|
|
82
|
+
"@voyantjs/crm-react": "0.35.0",
|
|
83
|
+
"@voyantjs/finance-react": "0.35.0",
|
|
84
|
+
"@voyantjs/legal-react": "0.35.0",
|
|
85
|
+
"@voyantjs/products-react": "0.35.0",
|
|
86
86
|
"@voyantjs/voyant-typescript-config": "0.1.0",
|
|
87
|
-
"@voyantjs/ui": "0.
|
|
87
|
+
"@voyantjs/ui": "0.35.0"
|
|
88
88
|
},
|
|
89
89
|
"files": [
|
|
90
90
|
"dist",
|