@voyantjs/bookings-ui 0.62.2 → 0.63.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 +18 -21
- package/dist/components/booking-detail-page.d.ts +32 -1
- package/dist/components/booking-detail-page.d.ts.map +1 -1
- package/dist/components/booking-detail-page.js +53 -10
- package/dist/components/booking-item-list.d.ts.map +1 -1
- package/dist/components/booking-item-list.js +18 -5
- package/dist/components/booking-list-filters.d.ts +7 -1
- package/dist/components/booking-list-filters.d.ts.map +1 -1
- package/dist/components/booking-list-filters.js +44 -2
- package/dist/components/booking-list.d.ts.map +1 -1
- package/dist/components/booking-list.js +21 -7
- package/dist/components/supplier-status-list.d.ts.map +1 -1
- package/dist/components/supplier-status-list.js +46 -9
- package/dist/i18n/en.d.ts +9 -19
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +12 -22
- package/dist/i18n/messages.d.ts +9 -8
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/i18n/provider.d.ts +18 -38
- package/dist/i18n/provider.d.ts.map +1 -1
- package/dist/i18n/ro.d.ts +9 -19
- package/dist/i18n/ro.d.ts.map +1 -1
- package/dist/i18n/ro.js +12 -22
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/package.json +30 -30
- package/dist/components/booking-workspace-page.d.ts +0 -61
- package/dist/components/booking-workspace-page.d.ts.map +0 -1
- package/dist/components/booking-workspace-page.js +0 -113
package/dist/i18n/ro.js
CHANGED
|
@@ -43,7 +43,8 @@ export const bookingsUiRo = {
|
|
|
43
43
|
cancelBookingAction: "Anuleaza rezervarea",
|
|
44
44
|
deleteAction: "Sterge",
|
|
45
45
|
deleteConfirm: "Stergi aceasta rezervare?",
|
|
46
|
-
collectPaymentAction: "
|
|
46
|
+
collectPaymentAction: "Genereaza link de plata",
|
|
47
|
+
recordPaymentAction: "Inregistreaza plata",
|
|
47
48
|
noValue: "-",
|
|
48
49
|
tbd: "De stabilit",
|
|
49
50
|
summarySell: "Vanzare",
|
|
@@ -57,10 +58,12 @@ export const bookingsUiRo = {
|
|
|
57
58
|
summaryUpdated: "Actualizata",
|
|
58
59
|
tabOverview: "Prezentare",
|
|
59
60
|
tabTravelers: "Calatori",
|
|
60
|
-
tabFinance: "
|
|
61
|
+
tabFinance: "Plati",
|
|
62
|
+
tabInvoices: "Facturi",
|
|
61
63
|
tabSuppliers: "Furnizori",
|
|
62
64
|
tabDocuments: "Documente",
|
|
63
65
|
tabActivity: "Activitate",
|
|
66
|
+
tabLedger: "Jurnal",
|
|
64
67
|
internalNotesLabel: "Note interne",
|
|
65
68
|
billingPayer: "Platitor",
|
|
66
69
|
billingEmail: "Email",
|
|
@@ -68,25 +71,6 @@ export const bookingsUiRo = {
|
|
|
68
71
|
billingAddress: "Adresa",
|
|
69
72
|
documentsSlotEmpty: "Furnizeaza un slot de documente pentru rezervare.",
|
|
70
73
|
},
|
|
71
|
-
bookingWorkspacePage: {
|
|
72
|
-
description: "Coordoneaza rezervarea, financiarul, legalul, calatorii si activitatea.",
|
|
73
|
-
loadingTitle: "Spatiu de lucru rezervare",
|
|
74
|
-
notFoundTitle: "Spatiu de lucru rezervare",
|
|
75
|
-
notFoundDescription: "Spatiul de lucru nu a gasit aceasta rezervare.",
|
|
76
|
-
tabs: {
|
|
77
|
-
booking: "Rezervare",
|
|
78
|
-
finance: "Financiar",
|
|
79
|
-
legal: "Legal",
|
|
80
|
-
travelers: "Calatori",
|
|
81
|
-
activity: "Activitate",
|
|
82
|
-
},
|
|
83
|
-
empty: {
|
|
84
|
-
finance: "Furnizeaza un slot financiar pentru facturi, statusuri de plata sau incasari.",
|
|
85
|
-
legal: "Furnizeaza un slot legal pentru contracte, declaratii sau sarcini de conformitate.",
|
|
86
|
-
travelers: "Furnizeaza extensii pentru editari in masa si verificari operationale.",
|
|
87
|
-
activity: "Furnizeaza un slot de activitate pentru cronologie sau audit.",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
74
|
travelerDialog: {
|
|
91
75
|
titles: {
|
|
92
76
|
create: "Adauga calator",
|
|
@@ -1174,12 +1158,14 @@ export const bookingsUiRo = {
|
|
|
1174
1158
|
newBooking: "Rezervare noua",
|
|
1175
1159
|
columns: {
|
|
1176
1160
|
bookingNumber: "Rezervare #",
|
|
1177
|
-
whatBooked: "
|
|
1161
|
+
whatBooked: "Articole",
|
|
1178
1162
|
status: "Status",
|
|
1179
1163
|
sellAmount: "Pret vanzare",
|
|
1180
1164
|
pax: "Pax",
|
|
1181
1165
|
startDate: "Data/ora start",
|
|
1182
1166
|
endDate: "Data/ora final",
|
|
1167
|
+
lead: "Platitor",
|
|
1168
|
+
createdAt: "Creata",
|
|
1183
1169
|
},
|
|
1184
1170
|
filters: {
|
|
1185
1171
|
button: "Filtre",
|
|
@@ -1204,6 +1190,10 @@ export const bookingsUiRo = {
|
|
|
1204
1190
|
organizationLabel: "Organizatie",
|
|
1205
1191
|
organization: "Cauta organizatii...",
|
|
1206
1192
|
organizationEmpty: "Nicio organizatie gasita.",
|
|
1193
|
+
departureLabel: "Plecare",
|
|
1194
|
+
departure: "Cauta plecari...",
|
|
1195
|
+
departureEmpty: "Nicio plecare gasita.",
|
|
1196
|
+
departureNeedsProduct: "Alege mai intai un produs.",
|
|
1207
1197
|
dateRangeLabel: "Data start",
|
|
1208
1198
|
dateRange: "Orice data",
|
|
1209
1199
|
paxLabel: "Pax",
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { BookingCancellationDialog, type BookingCancellationDialogProps, } from
|
|
|
3
3
|
export { BookingCombobox, type BookingComboboxProps, } from "./components/booking-combobox.js";
|
|
4
4
|
export { BookingCreateDialog, type BookingCreateDialogProps, BookingCreateForm, type BookingCreateFormProps, } from "./components/booking-create-dialog.js";
|
|
5
5
|
export { BookingCreatePage, type BookingCreatePageProps, } from "./components/booking-create-page.js";
|
|
6
|
-
export { BookingBillingContextCard, BookingDetailPage, type BookingDetailPageProps, type BookingDetailPageSlots, } from "./components/booking-detail-page.js";
|
|
6
|
+
export { BookingBillingContextCard, BookingDetailPage, type BookingDetailPageProps, type BookingDetailPageSlots, type BookingDetailTabSlot, } from "./components/booking-detail-page.js";
|
|
7
7
|
export { BookingDialog, type BookingDialogProps } from "./components/booking-dialog.js";
|
|
8
8
|
export { BookingDocumentDialog, type BookingDocumentDialogProps, } from "./components/booking-document-dialog.js";
|
|
9
9
|
export { BookingDocumentList, type BookingDocumentListProps, } from "./components/booking-document-list.js";
|
|
@@ -19,7 +19,6 @@ export { BookingNotes, type BookingNotesProps } from "./components/booking-notes
|
|
|
19
19
|
export { BookingPaymentScheduleDialog, type BookingPaymentScheduleDialogProps, } from "./components/booking-payment-schedule-dialog.js";
|
|
20
20
|
export { BookingPaymentScheduleList, type BookingPaymentScheduleListProps, } from "./components/booking-payment-schedule-list.js";
|
|
21
21
|
export { BookingPaymentsSummary, type BookingPaymentsSummaryProps, } from "./components/booking-payments-summary.js";
|
|
22
|
-
export { type BookingWorkspaceBulkActionContext, type BookingWorkspaceNavigationItem, BookingWorkspacePage, type BookingWorkspacePageProps, type BookingWorkspacePageSlots, type BookingWorkspaceSection, BookingWorkspaceShell, type BookingWorkspaceShellProps, type BookingWorkspaceSlotContext, useBookingWorkspaceBulkActions, } from "./components/booking-workspace-page.js";
|
|
23
22
|
export { BookingsPage, type BookingsPageProps } from "./components/bookings-page.js";
|
|
24
23
|
export { FileDropzone, type FileDropzoneProps, type UploadedFile, } from "./components/file-dropzone.js";
|
|
25
24
|
export { OptionUnitsStepperSection, type OptionUnitsStepperSectionProps, type OptionUnitsStepperValue, } from "./components/option-units-stepper-section.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,2CAA2C,CAAA;AAClD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B,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,6 @@ export { BookingNotes } from "./components/booking-notes.js";
|
|
|
19
19
|
export { BookingPaymentScheduleDialog, } from "./components/booking-payment-schedule-dialog.js";
|
|
20
20
|
export { BookingPaymentScheduleList, } from "./components/booking-payment-schedule-list.js";
|
|
21
21
|
export { BookingPaymentsSummary, } from "./components/booking-payments-summary.js";
|
|
22
|
-
export { BookingWorkspacePage, BookingWorkspaceShell, useBookingWorkspaceBulkActions, } from "./components/booking-workspace-page.js";
|
|
23
22
|
export { BookingsPage } from "./components/bookings-page.js";
|
|
24
23
|
export { FileDropzone, } from "./components/file-dropzone.js";
|
|
25
24
|
export { OptionUnitsStepperSection, } from "./components/option-units-stepper-section.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/bookings-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,23 +51,23 @@
|
|
|
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/crm-ui": "0.
|
|
60
|
-
"@voyantjs/extras-react": "0.
|
|
61
|
-
"@voyantjs/finance-react": "0.
|
|
62
|
-
"@voyantjs/identity-react": "0.
|
|
63
|
-
"@voyantjs/legal-react": "0.
|
|
64
|
-
"@voyantjs/pricing-react": "0.
|
|
65
|
-
"@voyantjs/products-react": "0.
|
|
66
|
-
"@voyantjs/suppliers-react": "0.
|
|
67
|
-
"@voyantjs/ui": "0.
|
|
54
|
+
"@voyantjs/availability-react": "0.63.0",
|
|
55
|
+
"@voyantjs/bookings-react": "0.63.0",
|
|
56
|
+
"@voyantjs/catalog": "0.63.0",
|
|
57
|
+
"@voyantjs/catalog-react": "0.63.0",
|
|
58
|
+
"@voyantjs/crm-react": "0.63.0",
|
|
59
|
+
"@voyantjs/crm-ui": "0.63.0",
|
|
60
|
+
"@voyantjs/extras-react": "0.63.0",
|
|
61
|
+
"@voyantjs/finance-react": "0.63.0",
|
|
62
|
+
"@voyantjs/identity-react": "0.63.0",
|
|
63
|
+
"@voyantjs/legal-react": "0.63.0",
|
|
64
|
+
"@voyantjs/pricing-react": "0.63.0",
|
|
65
|
+
"@voyantjs/products-react": "0.63.0",
|
|
66
|
+
"@voyantjs/suppliers-react": "0.63.0",
|
|
67
|
+
"@voyantjs/ui": "0.63.0"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@voyantjs/i18n": "0.
|
|
70
|
+
"@voyantjs/i18n": "0.63.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@tanstack/react-query": "^5.100.11",
|
|
@@ -80,20 +80,20 @@
|
|
|
80
80
|
"typescript": "^6.0.2",
|
|
81
81
|
"vitest": "^4.1.2",
|
|
82
82
|
"zod": "^4.3.6",
|
|
83
|
-
"@voyantjs/availability-react": "0.
|
|
84
|
-
"@voyantjs/bookings-react": "0.
|
|
85
|
-
"@voyantjs/catalog": "0.
|
|
86
|
-
"@voyantjs/catalog-react": "0.
|
|
87
|
-
"@voyantjs/crm-react": "0.
|
|
88
|
-
"@voyantjs/crm-ui": "0.
|
|
89
|
-
"@voyantjs/extras-react": "0.
|
|
90
|
-
"@voyantjs/finance-react": "0.
|
|
91
|
-
"@voyantjs/identity-react": "0.
|
|
92
|
-
"@voyantjs/legal-react": "0.
|
|
93
|
-
"@voyantjs/pricing-react": "0.
|
|
94
|
-
"@voyantjs/products-react": "0.
|
|
95
|
-
"@voyantjs/suppliers-react": "0.
|
|
96
|
-
"@voyantjs/ui": "0.
|
|
83
|
+
"@voyantjs/availability-react": "0.63.0",
|
|
84
|
+
"@voyantjs/bookings-react": "0.63.0",
|
|
85
|
+
"@voyantjs/catalog": "0.63.0",
|
|
86
|
+
"@voyantjs/catalog-react": "0.63.0",
|
|
87
|
+
"@voyantjs/crm-react": "0.63.0",
|
|
88
|
+
"@voyantjs/crm-ui": "0.63.0",
|
|
89
|
+
"@voyantjs/extras-react": "0.63.0",
|
|
90
|
+
"@voyantjs/finance-react": "0.63.0",
|
|
91
|
+
"@voyantjs/identity-react": "0.63.0",
|
|
92
|
+
"@voyantjs/legal-react": "0.63.0",
|
|
93
|
+
"@voyantjs/pricing-react": "0.63.0",
|
|
94
|
+
"@voyantjs/products-react": "0.63.0",
|
|
95
|
+
"@voyantjs/suppliers-react": "0.63.0",
|
|
96
|
+
"@voyantjs/ui": "0.63.0",
|
|
97
97
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
98
98
|
},
|
|
99
99
|
"files": [
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { type BookingRecord } from "@voyantjs/bookings-react";
|
|
2
|
-
import { type Dispatch, type ReactNode, type SetStateAction } from "react";
|
|
3
|
-
import { type BookingDetailPageSlots } from "./booking-detail-page.js";
|
|
4
|
-
export type BookingWorkspaceSection = "booking" | "finance" | "legal" | "travelers" | "activity";
|
|
5
|
-
export interface BookingWorkspaceBulkActionContext {
|
|
6
|
-
bookingId: string;
|
|
7
|
-
selectedTravelerIds: string[];
|
|
8
|
-
selectedFinanceItemIds: string[];
|
|
9
|
-
setSelectedTravelerIds: Dispatch<SetStateAction<string[]>>;
|
|
10
|
-
setSelectedFinanceItemIds: Dispatch<SetStateAction<string[]>>;
|
|
11
|
-
clearBulkSelection: () => void;
|
|
12
|
-
}
|
|
13
|
-
export interface BookingWorkspaceSlotContext {
|
|
14
|
-
booking: BookingRecord;
|
|
15
|
-
bookingId: string;
|
|
16
|
-
activeSection: BookingWorkspaceSection;
|
|
17
|
-
setActiveSection: (section: BookingWorkspaceSection) => void;
|
|
18
|
-
bulkActions: BookingWorkspaceBulkActionContext;
|
|
19
|
-
}
|
|
20
|
-
export interface BookingWorkspaceNavigationItem {
|
|
21
|
-
value: BookingWorkspaceSection;
|
|
22
|
-
label: string;
|
|
23
|
-
badge?: ReactNode;
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface BookingWorkspacePageSlots {
|
|
27
|
-
actionBar?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
28
|
-
bulkActionBar?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
29
|
-
afterNavigation?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
30
|
-
workspaceSidebar?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
31
|
-
financeSidebar?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
32
|
-
legalSidebar?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
33
|
-
travelersSidebar?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
34
|
-
activitySidebar?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
35
|
-
bookingTab?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
36
|
-
financeTab?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
37
|
-
legalTab?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
38
|
-
travelersTabExtensions?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
39
|
-
activityTab?: (context: BookingWorkspaceSlotContext) => ReactNode;
|
|
40
|
-
}
|
|
41
|
-
export interface BookingWorkspacePageProps {
|
|
42
|
-
id: string;
|
|
43
|
-
className?: string;
|
|
44
|
-
locale?: string;
|
|
45
|
-
defaultSection?: BookingWorkspaceSection;
|
|
46
|
-
navigationItems?: BookingWorkspaceNavigationItem[];
|
|
47
|
-
onBack?: () => void;
|
|
48
|
-
onPersonOpen?: (personId: string) => void;
|
|
49
|
-
onOrganizationOpen?: (organizationId: string) => void;
|
|
50
|
-
onCollectPayment?: (booking: BookingRecord) => void;
|
|
51
|
-
bookingDetailSlots?: BookingDetailPageSlots;
|
|
52
|
-
slots?: BookingWorkspacePageSlots;
|
|
53
|
-
}
|
|
54
|
-
export interface BookingWorkspaceShellProps extends BookingWorkspacePageProps {
|
|
55
|
-
booking?: BookingRecord | null;
|
|
56
|
-
isLoading?: boolean;
|
|
57
|
-
}
|
|
58
|
-
export declare function useBookingWorkspaceBulkActions(): BookingWorkspaceBulkActionContext;
|
|
59
|
-
export declare function BookingWorkspacePage(props: BookingWorkspacePageProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
-
export declare function BookingWorkspaceShell({ id, className, locale, defaultSection, navigationItems, onBack, onPersonOpen, onOrganizationOpen, onCollectPayment, bookingDetailSlots, slots, booking, isLoading, }: BookingWorkspaceShellProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
-
//# sourceMappingURL=booking-workspace-page.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"booking-workspace-page.d.ts","sourceRoot":"","sources":["../../src/components/booking-workspace-page.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,0BAA0B,CAAA;AAIzE,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EAMpB,MAAM,OAAO,CAAA;AAGd,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEzF,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,CAAA;AAEhG,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,EAAE,MAAM,EAAE,CAAA;I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B,EAChB,kBAAkB,EAClB,KAAK,EACL,OAAO,EACP,SAAiB,GAClB,EAAE,0BAA0B,2CAoK5B"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useBooking } from "@voyantjs/bookings-react";
|
|
4
|
-
import { Button, Card, CardContent, cn } from "@voyantjs/ui/components";
|
|
5
|
-
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@voyantjs/ui/components/tabs";
|
|
6
|
-
import { ArrowLeft, BriefcaseBusiness, FileText, Landmark, ListChecks, Users } from "lucide-react";
|
|
7
|
-
import { createContext, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
8
|
-
import { useBookingsUiMessagesOrDefault } from "../i18n/index.js";
|
|
9
|
-
import { BookingDetailPage } from "./booking-detail-page.js";
|
|
10
|
-
const BookingWorkspaceBulkActionsContext = createContext(null);
|
|
11
|
-
export function useBookingWorkspaceBulkActions() {
|
|
12
|
-
const context = useContext(BookingWorkspaceBulkActionsContext);
|
|
13
|
-
if (!context) {
|
|
14
|
-
throw new Error("useBookingWorkspaceBulkActions must be used inside BookingWorkspacePage");
|
|
15
|
-
}
|
|
16
|
-
return context;
|
|
17
|
-
}
|
|
18
|
-
export function BookingWorkspacePage(props) {
|
|
19
|
-
const bookingQuery = useBooking(props.id);
|
|
20
|
-
return (_jsx(BookingWorkspaceShell, { ...props, booking: bookingQuery.data?.data ?? null, isLoading: bookingQuery.isPending }));
|
|
21
|
-
}
|
|
22
|
-
export function BookingWorkspaceShell({ id, className, locale, defaultSection = "booking", navigationItems, onBack, onPersonOpen, onOrganizationOpen, onCollectPayment, bookingDetailSlots, slots, booking, isLoading = false, }) {
|
|
23
|
-
const messages = useBookingsUiMessagesOrDefault();
|
|
24
|
-
const workspaceMessages = messages.bookingWorkspacePage;
|
|
25
|
-
const [activeSection, setActiveSection] = useState(defaultSection);
|
|
26
|
-
const [selectedTravelerIds, setSelectedTravelerIds] = useState([]);
|
|
27
|
-
const [selectedFinanceItemIds, setSelectedFinanceItemIds] = useState([]);
|
|
28
|
-
const bookingId = booking?.id ?? id;
|
|
29
|
-
const previousBookingId = useRef(bookingId);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (previousBookingId.current === bookingId)
|
|
32
|
-
return;
|
|
33
|
-
previousBookingId.current = bookingId;
|
|
34
|
-
setSelectedTravelerIds([]);
|
|
35
|
-
setSelectedFinanceItemIds([]);
|
|
36
|
-
}, [bookingId]);
|
|
37
|
-
const bulkActions = useMemo(() => ({
|
|
38
|
-
bookingId,
|
|
39
|
-
selectedTravelerIds,
|
|
40
|
-
selectedFinanceItemIds,
|
|
41
|
-
setSelectedTravelerIds,
|
|
42
|
-
setSelectedFinanceItemIds,
|
|
43
|
-
clearBulkSelection: () => {
|
|
44
|
-
setSelectedTravelerIds([]);
|
|
45
|
-
setSelectedFinanceItemIds([]);
|
|
46
|
-
},
|
|
47
|
-
}), [bookingId, selectedFinanceItemIds, selectedTravelerIds]);
|
|
48
|
-
if (isLoading) {
|
|
49
|
-
return (_jsxs("div", { "data-slot": "booking-workspace-page", className: cn("flex flex-col gap-6 p-6", className), children: [_jsx(WorkspaceHeader, { title: workspaceMessages.loadingTitle, onBack: onBack }), _jsx(Card, { className: "border-dashed", children: _jsx(CardContent, { className: "flex min-h-48 items-center justify-center py-10", children: _jsx("p", { className: "text-sm text-muted-foreground", children: messages.common.loading }) }) })] }));
|
|
50
|
-
}
|
|
51
|
-
if (!booking) {
|
|
52
|
-
return (_jsxs("div", { "data-slot": "booking-workspace-page", className: cn("flex flex-col gap-6 p-6", className), children: [_jsx(WorkspaceHeader, { title: workspaceMessages.notFoundTitle, onBack: onBack }), _jsx(Card, { className: "border-dashed", children: _jsxs(CardContent, { className: "flex min-h-48 flex-col items-center justify-center gap-4 py-10", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: workspaceMessages.notFoundDescription }), onBack ? (_jsx(Button, { type: "button", variant: "outline", onClick: onBack, children: messages.bookingDetailPage.backToBookings })) : null] }) })] }));
|
|
53
|
-
}
|
|
54
|
-
const context = {
|
|
55
|
-
booking,
|
|
56
|
-
bookingId,
|
|
57
|
-
activeSection,
|
|
58
|
-
setActiveSection,
|
|
59
|
-
bulkActions,
|
|
60
|
-
};
|
|
61
|
-
const items = navigationItems ?? getDefaultNavigationItems(workspaceMessages.tabs);
|
|
62
|
-
const sidebar = renderSidebar(activeSection, slots, context);
|
|
63
|
-
const hasSidebar = Boolean(sidebar);
|
|
64
|
-
return (_jsx(BookingWorkspaceBulkActionsContext.Provider, { value: bulkActions, children: _jsxs("div", { "data-slot": "booking-workspace-page", className: cn("flex flex-col gap-5 p-6", className), children: [_jsx(WorkspaceHeader, { title: booking.bookingNumber, description: workspaceMessages.description, onBack: onBack, actions: slots?.actionBar?.(context) }), slots?.bulkActionBar?.(context), _jsxs(Tabs, { value: activeSection, onValueChange: (value) => setActiveSection(value), className: "flex min-w-0 flex-col gap-5", children: [_jsx("div", { className: "overflow-x-auto", children: _jsx(TabsList, { className: "h-auto min-w-max justify-start", children: items.map((item) => (_jsxs(TabsTrigger, { value: item.value, disabled: item.disabled, className: "gap-2", children: [_jsx(WorkspaceTabIcon, { section: item.value }), _jsx("span", { children: item.label }), item.badge] }, item.value))) }) }), slots?.afterNavigation?.(context), _jsxs("div", { className: cn("grid min-w-0 gap-6", hasSidebar ? "xl:grid-cols-[minmax(0,1fr)_320px]" : "xl:grid-cols-1"), children: [_jsxs("div", { className: "min-w-0", children: [_jsx(TabsContent, { value: "booking", className: "mt-0", children: slots?.bookingTab ? (slots.bookingTab(context)) : (_jsx(BookingDetailPage, { id: bookingId, className: "p-0", locale: locale, onBack: onBack, onPersonOpen: onPersonOpen, onOrganizationOpen: onOrganizationOpen, onCollectPayment: onCollectPayment, slots: bookingDetailSlots })) }), _jsx(TabsContent, { value: "finance", className: "mt-0", children: renderTabSlot(slots?.financeTab, context, workspaceMessages.empty.finance) }), _jsx(TabsContent, { value: "legal", className: "mt-0", children: renderTabSlot(slots?.legalTab, context, workspaceMessages.empty.legal) }), _jsx(TabsContent, { value: "travelers", className: "mt-0", children: renderTabSlot(slots?.travelersTabExtensions, context, workspaceMessages.empty.travelers) }), _jsx(TabsContent, { value: "activity", className: "mt-0", children: renderTabSlot(slots?.activityTab, context, workspaceMessages.empty.activity) })] }), hasSidebar ? (_jsx("aside", { "data-slot": "booking-workspace-sidebar", className: "flex min-w-0 flex-col gap-4", children: sidebar })) : null] })] })] }) }));
|
|
65
|
-
}
|
|
66
|
-
function WorkspaceHeader({ title, description, onBack, actions, }) {
|
|
67
|
-
return (_jsxs("div", { "data-slot": "booking-workspace-header", className: "flex flex-col gap-4 border-b pb-4 sm:flex-row sm:items-start sm:justify-between", children: [_jsxs("div", { className: "min-w-0 space-y-1", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [onBack ? (_jsxs(Button, { type: "button", variant: "ghost", size: "icon-sm", onClick: onBack, children: [_jsx(ArrowLeft, { className: "size-4", "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: "Back" })] })) : null, _jsx("h1", { className: "truncate text-2xl font-semibold tracking-tight", children: title })] }), description ? _jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null] }), actions ? _jsx("div", { className: "flex flex-wrap items-center gap-2", children: actions }) : null] }));
|
|
68
|
-
}
|
|
69
|
-
function WorkspaceTabIcon({ section }) {
|
|
70
|
-
const iconClassName = "size-4";
|
|
71
|
-
switch (section) {
|
|
72
|
-
case "booking":
|
|
73
|
-
return _jsx(BriefcaseBusiness, { className: iconClassName, "aria-hidden": "true" });
|
|
74
|
-
case "finance":
|
|
75
|
-
return _jsx(Landmark, { className: iconClassName, "aria-hidden": "true" });
|
|
76
|
-
case "legal":
|
|
77
|
-
return _jsx(FileText, { className: iconClassName, "aria-hidden": "true" });
|
|
78
|
-
case "travelers":
|
|
79
|
-
return _jsx(Users, { className: iconClassName, "aria-hidden": "true" });
|
|
80
|
-
case "activity":
|
|
81
|
-
return _jsx(ListChecks, { className: iconClassName, "aria-hidden": "true" });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function renderTabSlot(slot, context, emptyMessage) {
|
|
85
|
-
const content = slot?.(context);
|
|
86
|
-
if (content)
|
|
87
|
-
return content;
|
|
88
|
-
return (_jsx(Card, { className: "border-dashed", children: _jsx(CardContent, { className: "flex min-h-48 items-center justify-center py-10", children: _jsx("p", { className: "max-w-md text-center text-sm text-muted-foreground", children: emptyMessage }) }) }));
|
|
89
|
-
}
|
|
90
|
-
function renderSidebar(activeSection, slots, context) {
|
|
91
|
-
const sectionSidebar = activeSection === "finance"
|
|
92
|
-
? slots?.financeSidebar?.(context)
|
|
93
|
-
: activeSection === "legal"
|
|
94
|
-
? slots?.legalSidebar?.(context)
|
|
95
|
-
: activeSection === "travelers"
|
|
96
|
-
? slots?.travelersSidebar?.(context)
|
|
97
|
-
: activeSection === "activity"
|
|
98
|
-
? slots?.activitySidebar?.(context)
|
|
99
|
-
: null;
|
|
100
|
-
const workspaceSidebar = slots?.workspaceSidebar?.(context);
|
|
101
|
-
if (!workspaceSidebar && !sectionSidebar)
|
|
102
|
-
return null;
|
|
103
|
-
return (_jsxs(_Fragment, { children: [sectionSidebar, workspaceSidebar] }));
|
|
104
|
-
}
|
|
105
|
-
function getDefaultNavigationItems(tabs) {
|
|
106
|
-
return [
|
|
107
|
-
{ value: "booking", label: tabs.booking },
|
|
108
|
-
{ value: "finance", label: tabs.finance },
|
|
109
|
-
{ value: "legal", label: tabs.legal },
|
|
110
|
-
{ value: "travelers", label: tabs.travelers },
|
|
111
|
-
{ value: "activity", label: tabs.activity },
|
|
112
|
-
];
|
|
113
|
-
}
|