mautourco-components 0.2.21 → 0.2.22
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/dist/components/atoms/Checkbox/Checkbox.d.ts +3 -2
- package/dist/components/atoms/Checkbox/Checkbox.js +16 -6
- package/dist/components/atoms/Inputs/Input/Input.d.ts +1 -1
- package/dist/components/molecules/BookingPax/BookingPax.d.ts +43 -0
- package/dist/components/molecules/BookingPax/BookingPax.js +43 -0
- package/dist/components/molecules/BookingPax/BookingPaxAccom.d.ts +34 -0
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +10 -0
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.d.ts +89 -1
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.js +34 -11
- package/dist/components/molecules/BookingPax/BookingPaxExcursion.d.ts +43 -0
- package/dist/components/molecules/BookingPax/BookingPaxExcursion.js +19 -0
- package/dist/components/molecules/BookingPax/BookingPaxHeader.d.ts +15 -0
- package/dist/components/molecules/BookingPax/BookingPaxHeader.js +13 -0
- package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.d.ts +30 -0
- package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.js +15 -0
- package/dist/components/molecules/BookingPax/BookingPaxRemarks.d.ts +14 -0
- package/dist/components/molecules/BookingPax/BookingPaxRemarks.js +11 -0
- package/dist/components/molecules/BookingPax/BookingPaxTransfer.d.ts +51 -0
- package/dist/components/molecules/BookingPax/BookingPaxTransfer.js +19 -2
- package/dist/components/molecules/BookingPax/index.d.ts +1 -0
- package/dist/components/molecules/BookingPax/index.js +1 -0
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.d.ts +20 -0
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.js +17 -6
- package/dist/components/molecules/DialogContentPolicy/DialogContentPolicy.d.ts +18 -0
- package/dist/components/molecules/DialogContentPolicy/DialogContentPolicy.js +14 -3
- package/dist/components/organisms/Booking/BookingPaxList.d.ts +64 -0
- package/dist/components/organisms/Booking/BookingPaxList.js +19 -0
- package/dist/components/organisms/Dialog/Dialog.d.ts +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +4 -4
- package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.d.ts +29 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.js +31 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingMailSent.d.ts +29 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingMailSent.js +31 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingReference.d.ts +35 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingReference.js +37 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingSuccess.d.ts +35 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingSuccess.js +33 -0
- package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.d.ts +39 -2
- package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.js +25 -1
- package/dist/components/organisms/DialogBookingConfirm/index.d.ts +5 -0
- package/dist/components/organisms/DialogBookingConfirm/index.js +1 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationAccom.d.ts +25 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationAccom.js +16 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationBody.d.ts +24 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationBody.js +24 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationExcursion.d.ts +30 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationExcursion.js +15 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationHeader.d.ts +23 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationHeader.js +23 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationTransfer.d.ts +22 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationTransfer.js +13 -0
- package/dist/components/organisms/TabCancellationPolicy/HeaderAccom.d.ts +22 -0
- package/dist/components/organisms/TabCancellationPolicy/HeaderAccom.js +13 -0
- package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion.d.ts +18 -0
- package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion.js +12 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +7 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.js +2 -1
- package/dist/components/organisms/TabCancellationPolicy/PolicyExcursion.d.ts +18 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyExcursion.js +12 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyTransfer.d.ts +11 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyTransfer.js +11 -0
- package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicy.d.ts +29 -0
- package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicy.js +29 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -2
- package/dist/styles/components/checkbox.css +11 -5
- package/package.json +1 -2
- package/src/components/atoms/Checkbox/Checkbox.tsx +38 -23
- package/src/components/atoms/Inputs/Input/Input.tsx +1 -1
- package/src/components/molecules/BookingPax/BookingPax.tsx +43 -0
- package/src/components/molecules/BookingPax/BookingPaxAccom.tsx +34 -0
- package/src/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +6 -0
- package/src/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.tsx +92 -18
- package/src/components/molecules/BookingPax/BookingPaxExcursion.tsx +43 -0
- package/src/components/molecules/BookingPax/BookingPaxHeader.tsx +28 -1
- package/src/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.tsx +30 -0
- package/src/components/molecules/BookingPax/BookingPaxRemarks.tsx +14 -0
- package/src/components/molecules/BookingPax/BookingPaxTransfer.tsx +52 -2
- package/src/components/molecules/BookingPax/index.ts +2 -0
- package/src/components/molecules/DialogContentPolicy/DialogCancellationList.tsx +32 -12
- package/src/components/molecules/DialogContentPolicy/DialogContentPolicy.tsx +27 -11
- package/src/components/organisms/Booking/BookingPaxList.tsx +64 -0
- package/src/components/organisms/Dialog/Dialog.tsx +13 -20
- package/src/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.tsx +44 -0
- package/src/components/organisms/DialogBookingConfirm/BookingMailSent.tsx +56 -0
- package/src/components/organisms/DialogBookingConfirm/BookingReference.tsx +74 -0
- package/src/components/organisms/DialogBookingConfirm/BookingSuccess.tsx +67 -0
- package/src/components/organisms/DialogBookingConfirm/DialogBookingConfirm.tsx +43 -2
- package/src/components/organisms/DialogBookingConfirm/index.ts +6 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationAccom.tsx +25 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationBody.tsx +24 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationExcursion.tsx +30 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationHeader.tsx +23 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationTransfer.tsx +22 -0
- package/src/components/organisms/TabCancellationPolicy/HeaderAccom.tsx +22 -0
- package/src/components/organisms/TabCancellationPolicy/HeaderExcursion.tsx +18 -0
- package/src/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +3 -0
- package/src/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.tsx +3 -2
- package/src/components/organisms/TabCancellationPolicy/PolicyExcursion.tsx +18 -0
- package/src/components/organisms/TabCancellationPolicy/PolicyTransfer.tsx +11 -0
- package/src/components/organisms/TabCancellationPolicy/TabCancellationPolicy.tsx +29 -0
- package/src/styles/components/checkbox.css +11 -5
- package/dist/components/ui/checkbox.d.ts +0 -4
- package/dist/components/ui/checkbox.js +0 -31
- package/src/components/ui/checkbox.tsx +0 -32
|
@@ -3,16 +3,67 @@ import { DateTimePickerProps } from '../../organisms/DateTimePicker/DateTimePick
|
|
|
3
3
|
import { BookingPaxClientInfo, BookingPaxClientProps } from './BookingPaxClient/BookingPaxClient';
|
|
4
4
|
export type ExcursionType = 'sea' | 'land' | 'catamaran';
|
|
5
5
|
export interface BookingPaxTransferProps extends Pick<BookingPaxClientProps, 'selectedClientsInfoIds' | 'onPaxChange'> {
|
|
6
|
+
/**
|
|
7
|
+
* The clients info of the booking pax transfer.
|
|
8
|
+
*/
|
|
6
9
|
clientsInfo: BookingPaxClientInfo[];
|
|
10
|
+
/**
|
|
11
|
+
* The type of the booking pax transfer.
|
|
12
|
+
*/
|
|
7
13
|
type: 'ARV' | 'DEP' | 'INH';
|
|
14
|
+
/**
|
|
15
|
+
* The from of the booking pax transfer.
|
|
16
|
+
*/
|
|
8
17
|
from: string;
|
|
18
|
+
/**
|
|
19
|
+
* The to of the booking pax transfer.
|
|
20
|
+
*/
|
|
9
21
|
to: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the booking pax transfer is submitted.
|
|
24
|
+
*/
|
|
10
25
|
isSubmitted?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The pax count of the booking pax transfer.
|
|
28
|
+
*/
|
|
11
29
|
paxCount: number;
|
|
30
|
+
/**
|
|
31
|
+
* The max pax count of the booking pax transfer.
|
|
32
|
+
*/
|
|
12
33
|
maxPaxCount?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The callback function to call when the remark changes.
|
|
36
|
+
*/
|
|
13
37
|
onRemarkChange?: (value: string) => void;
|
|
38
|
+
/**
|
|
39
|
+
* The callback function to call when the flight number changes.
|
|
40
|
+
*/
|
|
14
41
|
onFlightNumberChange?: (value: string) => void;
|
|
42
|
+
/**
|
|
43
|
+
* The callback function to call when the time changes.
|
|
44
|
+
*/
|
|
15
45
|
onTimeChange?: DateTimePickerProps['onValueChange'];
|
|
46
|
+
/**
|
|
47
|
+
* The callback function to call when the error changes.
|
|
48
|
+
*/
|
|
16
49
|
onError?: (hasError: boolean) => void;
|
|
17
50
|
}
|
|
51
|
+
export declare const mapTransferType: Record<BookingPaxTransferProps['type'], string>;
|
|
52
|
+
/**
|
|
53
|
+
* BookingPaxTransfer is a component that allows the user to display the booking pax transfer.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* <BookingPaxTransfer
|
|
57
|
+
* type="ARV"
|
|
58
|
+
* from="Plaisance Airport"
|
|
59
|
+
* to="Grand Paradise Hotel"
|
|
60
|
+
* clientsInfo={clientsInfo}
|
|
61
|
+
* paxCount={2}
|
|
62
|
+
* selectedClientsInfoIds={{ 0: [] }}
|
|
63
|
+
* isSubmitted={false}
|
|
64
|
+
* onPaxChange={onPaxChange}
|
|
65
|
+
*
|
|
66
|
+
* @param props - The props for the BookingPaxTransfer component.
|
|
67
|
+
* @returns The BookingPaxTransfer component.
|
|
68
|
+
*/
|
|
18
69
|
export declare const BookingPaxTransfer: React.FC<BookingPaxTransferProps>;
|
|
@@ -19,11 +19,28 @@ import { BookingPaxClient, } from './BookingPaxClient/BookingPaxClient';
|
|
|
19
19
|
import { BookingPaxHeader } from './BookingPaxHeader';
|
|
20
20
|
import { BookingPaxLayout } from './BookingPaxLayout/BookingPaxLayout';
|
|
21
21
|
import { BookingPaxRemarks } from './BookingPaxRemarks';
|
|
22
|
-
var
|
|
22
|
+
export var mapTransferType = {
|
|
23
23
|
ARV: 'Arrival',
|
|
24
24
|
DEP: 'Departure',
|
|
25
25
|
INH: 'Inter-Hotel',
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* BookingPaxTransfer is a component that allows the user to display the booking pax transfer.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <BookingPaxTransfer
|
|
32
|
+
* type="ARV"
|
|
33
|
+
* from="Plaisance Airport"
|
|
34
|
+
* to="Grand Paradise Hotel"
|
|
35
|
+
* clientsInfo={clientsInfo}
|
|
36
|
+
* paxCount={2}
|
|
37
|
+
* selectedClientsInfoIds={{ 0: [] }}
|
|
38
|
+
* isSubmitted={false}
|
|
39
|
+
* onPaxChange={onPaxChange}
|
|
40
|
+
*
|
|
41
|
+
* @param props - The props for the BookingPaxTransfer component.
|
|
42
|
+
* @returns The BookingPaxTransfer component.
|
|
43
|
+
*/
|
|
27
44
|
export var BookingPaxTransfer = function (props) {
|
|
28
45
|
var from = props.from, to = props.to, type = props.type, clientsInfo = props.clientsInfo, paxCount = props.paxCount, selectedClientsInfoIds = props.selectedClientsInfoIds, isSubmitted = props.isSubmitted, onPaxChange = props.onPaxChange, onRemarkChange = props.onRemarkChange, onTimeChange = props.onTimeChange, onError = props.onError, onFlightNumberChange = props.onFlightNumberChange;
|
|
29
46
|
var _a = useBookingPax(selectedClientsInfoIds), changeOptions = _a.changeOptions, onPaxOptionsChange = _a.onPaxOptionsChange, onSelectedClients = _a.onSelectedClients;
|
|
@@ -36,5 +53,5 @@ export var BookingPaxTransfer = function (props) {
|
|
|
36
53
|
useEffect(function () {
|
|
37
54
|
onSelectedClients(clientsInfo, onPaxChange);
|
|
38
55
|
}, [changeOptions, onPaxChange]);
|
|
39
|
-
return (_jsxs(BookingPaxLayout, __assign({ title: _jsxs(_Fragment, { children: ["Transfer", ' ', _jsxs(Text, __assign({ as: "span", color: "accent", variant: "bold", size: "xl", className: "italic" }, { children: ["(",
|
|
56
|
+
return (_jsxs(BookingPaxLayout, __assign({ title: _jsxs(_Fragment, { children: ["Transfer", ' ', _jsxs(Text, __assign({ as: "span", color: "accent", variant: "bold", size: "xl", className: "italic" }, { children: ["(", mapTransferType[type], ")"] }))] }), icon: "car", className: "booking-pax-accom", header: _jsx(BookingPaxHeader, { children: _jsx(BookingPaxHeader.Location, { from: from, to: to }) }) }, { children: [type === 'INH' ? (_jsx(DateTimePicker, { icon: "clock", mode: "time", onValueChange: onTimeChange, placeholder: "Time of Transfer" })) : (_jsx(Input, { icon: "arrival", iconPosition: "leading", placeholder: "Flight number", onChange: handleFlightNumberChange })), _jsx(BookingPaxClient, { id: id, clients: clientsInfo, selectedClientsInfoIds: selectedClientsInfoIds, selectedIndex: 0, paxCount: paxCount, isSubmitted: isSubmitted, onPaxChange: onPaxOptionsChange, onError: onError }), _jsx(BookingPaxRemarks, { onChange: onRemarkChange })] })));
|
|
40
57
|
};
|
|
@@ -2,4 +2,5 @@ export type { BookingPaxAccomProps, RoomData } from './BookingPaxAccom';
|
|
|
2
2
|
export type { BookingPaxClientInfo, BookingPaxClientProps, } from './BookingPaxClient/BookingPaxClient';
|
|
3
3
|
export type { BookingPaxExcursionProps } from './BookingPaxExcursion';
|
|
4
4
|
export type { BookingPaxTransferProps } from './BookingPaxTransfer';
|
|
5
|
+
export { mapTransferType } from './BookingPaxTransfer';
|
|
5
6
|
export * from './BookingPax';
|
|
@@ -2,10 +2,30 @@ import React from 'react';
|
|
|
2
2
|
import { DialogCancellationAccomProps } from './DialogCancellationAccom';
|
|
3
3
|
import { DialogCancellationExcursionProps } from './DialogCancellationExcursion';
|
|
4
4
|
export interface CancellationItem {
|
|
5
|
+
/**
|
|
6
|
+
* The type of the cancellation.
|
|
7
|
+
*/
|
|
5
8
|
type: 'accommodation' | 'excursion';
|
|
9
|
+
/**
|
|
10
|
+
* The data of the cancellation.
|
|
11
|
+
*/
|
|
6
12
|
data: DialogCancellationAccomProps | DialogCancellationExcursionProps;
|
|
7
13
|
}
|
|
8
14
|
export interface DialogCancellationListProps {
|
|
15
|
+
/**
|
|
16
|
+
* The cancellations to display.
|
|
17
|
+
*/
|
|
9
18
|
cancellations: CancellationItem[];
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* DialogCancellationList is a component that allows the user to display the cancellations.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <DialogCancellationList
|
|
25
|
+
* cancellations={cancellations}
|
|
26
|
+
* />
|
|
27
|
+
*
|
|
28
|
+
* @param props - The props for the DialogCancellationList component.
|
|
29
|
+
* @returns The DialogCancellationList component.
|
|
30
|
+
*/
|
|
11
31
|
export declare const DialogCancellationList: React.FC<DialogCancellationListProps>;
|
|
@@ -13,14 +13,25 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import { DialogCancellationAccom, } from './DialogCancellationAccom';
|
|
14
14
|
import { DialogCancellationExcursion, } from './DialogCancellationExcursion';
|
|
15
15
|
import { DialogContentPolicy } from './DialogContentPolicy';
|
|
16
|
+
var isAccommodation = function (data) {
|
|
17
|
+
return 'hotelName' in data;
|
|
18
|
+
};
|
|
19
|
+
var isExcursion = function (data) {
|
|
20
|
+
return 'excursionName' in data;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* DialogCancellationList is a component that allows the user to display the cancellations.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <DialogCancellationList
|
|
27
|
+
* cancellations={cancellations}
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* @param props - The props for the DialogCancellationList component.
|
|
31
|
+
* @returns The DialogCancellationList component.
|
|
32
|
+
*/
|
|
16
33
|
export var DialogCancellationList = function (props) {
|
|
17
34
|
var cancellations = props.cancellations;
|
|
18
|
-
var isAccommodation = function (data) {
|
|
19
|
-
return 'hotelName' in data;
|
|
20
|
-
};
|
|
21
|
-
var isExcursion = function (data) {
|
|
22
|
-
return 'excursionName' in data;
|
|
23
|
-
};
|
|
24
35
|
return (_jsx(DialogContentPolicy, { children: cancellations.map(function (c, index) {
|
|
25
36
|
if (c.type === 'accommodation' && isAccommodation(c.data)) {
|
|
26
37
|
return _jsx(DialogCancellationAccom, __assign({}, c.data), "acc-".concat(index));
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface DialogContentPolicyProps {
|
|
3
|
+
/**
|
|
4
|
+
* The children to display.
|
|
5
|
+
*/
|
|
3
6
|
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* The callback function to call when the submit button is clicked.
|
|
9
|
+
*/
|
|
4
10
|
onSubmit?: () => void;
|
|
5
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* DialogContentPolicy is a component that allows the user to display the cancellation policy.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <DialogContentPolicy
|
|
17
|
+
* children={children}
|
|
18
|
+
* onSubmit={onSubmit}
|
|
19
|
+
* />
|
|
20
|
+
*
|
|
21
|
+
* @param props - The props for the DialogContentPolicy component.
|
|
22
|
+
* @returns The DialogContentPolicy component.
|
|
23
|
+
*/
|
|
6
24
|
export declare const DialogContentPolicy: {
|
|
7
25
|
(props: DialogContentPolicyProps): import("react/jsx-runtime").JSX.Element;
|
|
8
26
|
Accommodation: React.FC<import("./DialogCancellationAccom").DialogCancellationAccomProps>;
|
|
@@ -12,15 +12,26 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useState } from 'react';
|
|
14
14
|
import Button from '../../atoms/Button/Button';
|
|
15
|
-
import
|
|
16
|
-
import { Checkbox } from '../../ui/checkbox';
|
|
15
|
+
import Checkbox from '../../atoms/Checkbox/Checkbox';
|
|
17
16
|
import { DialogCancellationAccom } from './DialogCancellationAccom';
|
|
18
17
|
import { DialogCancellationExcursion } from './DialogCancellationExcursion';
|
|
19
18
|
import { DialogCancellationList } from './DialogCancellationList';
|
|
19
|
+
/**
|
|
20
|
+
* DialogContentPolicy is a component that allows the user to display the cancellation policy.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <DialogContentPolicy
|
|
24
|
+
* children={children}
|
|
25
|
+
* onSubmit={onSubmit}
|
|
26
|
+
* />
|
|
27
|
+
*
|
|
28
|
+
* @param props - The props for the DialogContentPolicy component.
|
|
29
|
+
* @returns The DialogContentPolicy component.
|
|
30
|
+
*/
|
|
20
31
|
export var DialogContentPolicy = function (props) {
|
|
21
32
|
var children = props.children, onSubmit = props.onSubmit;
|
|
22
33
|
var _a = useState(false), accepted = _a[0], setAccepted = _a[1];
|
|
23
|
-
return (_jsxs("div", __assign({ className: "cancellation-policy" }, { children: [children, _jsxs("div", __assign({ className: "flex justify-end gap-x-
|
|
34
|
+
return (_jsxs("div", __assign({ className: "cancellation-policy" }, { children: [children, _jsxs("div", __assign({ className: "flex justify-end gap-x-5 py-9" }, { children: [_jsx("div", __assign({ className: "flex gap-x-2.5 items-center" }, { children: _jsx(Checkbox, { checked: accepted, onChange: setAccepted, label: "I've read and accept the cancellation policy.", labelPosition: "leading" }) })), _jsx(Button, __assign({ className: "w-[250px]", variant: "secondary", disabled: !accepted, onClick: onSubmit }, { children: "Next" }))] }))] })));
|
|
24
35
|
};
|
|
25
36
|
DialogContentPolicy.Accommodation = DialogCancellationAccom;
|
|
26
37
|
DialogContentPolicy.Excursion = DialogCancellationExcursion;
|
|
@@ -2,24 +2,88 @@ import React from 'react';
|
|
|
2
2
|
import { BookingPaxAccomProps, BookingPaxExcursionProps, BookingPaxTransferProps } from '../../molecules/BookingPax';
|
|
3
3
|
import { BookingPaxClientInfo, BookingPaxClientOptions } from '../../molecules/BookingPax/BookingPaxClient/BookingPaxClient';
|
|
4
4
|
export interface BookingPaxData {
|
|
5
|
+
/**
|
|
6
|
+
* The type of the booking pax.
|
|
7
|
+
*/
|
|
5
8
|
type: 'accommodation' | 'excursion' | 'transfer';
|
|
9
|
+
/**
|
|
10
|
+
* The data of the booking pax.
|
|
11
|
+
*/
|
|
6
12
|
data: Omit<BookingPaxAccomProps, 'clientsInfo'> | Omit<BookingPaxExcursionProps, 'clientsInfo'> | Omit<BookingPaxTransferProps, 'clientsInfo'>;
|
|
7
13
|
}
|
|
8
14
|
export interface BookingPaxAutoFilledData {
|
|
15
|
+
/**
|
|
16
|
+
* The type of the booking pax.
|
|
17
|
+
*/
|
|
9
18
|
type: BookingPaxData['type'];
|
|
19
|
+
/**
|
|
20
|
+
* The parent index of the booking pax.
|
|
21
|
+
*/
|
|
10
22
|
parentIndex: number;
|
|
23
|
+
/**
|
|
24
|
+
* The room index of the booking pax.
|
|
25
|
+
*/
|
|
11
26
|
roomIndex?: number;
|
|
27
|
+
/**
|
|
28
|
+
* The selected clients of the booking pax.
|
|
29
|
+
*/
|
|
12
30
|
selectedClients: BookingPaxClientInfo[];
|
|
13
31
|
}
|
|
14
32
|
export interface BookingPaxProps {
|
|
33
|
+
/**
|
|
34
|
+
* The data of the booking pax.
|
|
35
|
+
*/
|
|
15
36
|
data: BookingPaxData[];
|
|
37
|
+
/**
|
|
38
|
+
* The clients info of the booking pax.
|
|
39
|
+
*/
|
|
16
40
|
clientsInfo: BookingPaxClientInfo[];
|
|
41
|
+
/**
|
|
42
|
+
* Whether the booking pax is submitted.
|
|
43
|
+
*/
|
|
17
44
|
isSubmitted?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The callback function to call when the pax changes.
|
|
47
|
+
*/
|
|
18
48
|
onPaxChange?: (index: number, type: BookingPaxData['type'], options: BookingPaxClientOptions) => void;
|
|
49
|
+
/**
|
|
50
|
+
* The callback function to call when the remark changes.
|
|
51
|
+
*/
|
|
19
52
|
onRemarkChange?: (index: number, type: BookingPaxData['type'], value: string) => void;
|
|
53
|
+
/**
|
|
54
|
+
* The callback function to call when the error changes.
|
|
55
|
+
*/
|
|
20
56
|
onError?: (index: number, type: BookingPaxData['type'], hasError: boolean) => void;
|
|
57
|
+
/**
|
|
58
|
+
* The callback function to call when the time changes.
|
|
59
|
+
*/
|
|
21
60
|
onTimeChange?: (index: number, value: string | string[]) => void;
|
|
61
|
+
/**
|
|
62
|
+
* The callback function to call when the flight number changes.
|
|
63
|
+
*/
|
|
22
64
|
onFlightNumberChange?: (index: number, value: string) => void;
|
|
65
|
+
/**
|
|
66
|
+
* The callback function to call when the auto filled data changes.
|
|
67
|
+
*/
|
|
23
68
|
onAutoFilled?: (data: BookingPaxAutoFilledData[]) => void;
|
|
24
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* BookingPaxList is a component that allows the user to select the pax for a booking.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* <BookingPaxList
|
|
75
|
+
* data={data}
|
|
76
|
+
* clientsInfo={clientsInfo}
|
|
77
|
+
* isSubmitted={isSubmitted}
|
|
78
|
+
* onPaxChange={onPaxChange}
|
|
79
|
+
* onRemarkChange={onRemarkChange}
|
|
80
|
+
* onError={onError}
|
|
81
|
+
* onTimeChange={onTimeChange}
|
|
82
|
+
* onFlightNumberChange={onFlightNumberChange}
|
|
83
|
+
* onAutoFilled={onAutoFilled}
|
|
84
|
+
* />
|
|
85
|
+
*
|
|
86
|
+
* @param props - The props for the BookingPaxList component.
|
|
87
|
+
* @returns The BookingPaxList component.
|
|
88
|
+
*/
|
|
25
89
|
export declare const BookingPaxList: React.FC<BookingPaxProps>;
|
|
@@ -31,6 +31,25 @@ var isExcursionData = function (data) {
|
|
|
31
31
|
var isTransferData = function (data) {
|
|
32
32
|
return 'from' in data && 'to' in data && 'type' in data;
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* BookingPaxList is a component that allows the user to select the pax for a booking.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <BookingPaxList
|
|
39
|
+
* data={data}
|
|
40
|
+
* clientsInfo={clientsInfo}
|
|
41
|
+
* isSubmitted={isSubmitted}
|
|
42
|
+
* onPaxChange={onPaxChange}
|
|
43
|
+
* onRemarkChange={onRemarkChange}
|
|
44
|
+
* onError={onError}
|
|
45
|
+
* onTimeChange={onTimeChange}
|
|
46
|
+
* onFlightNumberChange={onFlightNumberChange}
|
|
47
|
+
* onAutoFilled={onAutoFilled}
|
|
48
|
+
* />
|
|
49
|
+
*
|
|
50
|
+
* @param props - The props for the BookingPaxList component.
|
|
51
|
+
* @returns The BookingPaxList component.
|
|
52
|
+
*/
|
|
34
53
|
export var BookingPaxList = function (props) {
|
|
35
54
|
var data = props.data, isSubmitted = props.isSubmitted, clientsInfo = props.clientsInfo, onPaxChange = props.onPaxChange, onRemarkChange = props.onRemarkChange, onError = props.onError, onTimeChange = props.onTimeChange, onFlightNumberChange = props.onFlightNumberChange, onAutoFilled = props.onAutoFilled;
|
|
36
55
|
var _a = useState([]), autoFilledData = _a[0], setAutoFilledData = _a[1];
|
|
@@ -10,12 +10,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import {
|
|
13
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
14
14
|
import { createPortal } from 'react-dom';
|
|
15
15
|
import { useMobile } from '../../../hooks/useMobile';
|
|
16
|
+
import '../../../styles/components/organism/dialog.css';
|
|
16
17
|
import Button from '../../atoms/Button/Button';
|
|
17
18
|
import Icon from '../../atoms/Icon/Icon';
|
|
18
|
-
import '../../../styles/components/organism/dialog.css';
|
|
19
19
|
/**
|
|
20
20
|
* Dialog component - A modal dialog that adapts to different screen sizes
|
|
21
21
|
*
|
|
@@ -32,8 +32,8 @@ import '../../../styles/components/organism/dialog.css';
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
export var Dialog = function (_a) {
|
|
35
|
-
var isOpen = _a.isOpen, onClose = _a.onClose,
|
|
36
|
-
var
|
|
35
|
+
var isOpen = _a.isOpen, onClose = _a.onClose, _b = _a.title, title = _b === void 0 ? '' : _b, children = _a.children, footer = _a.footer, _c = _a.size, size = _c === void 0 ? 'responsive' : _c, _d = _a.primaryButtonText, primaryButtonText = _d === void 0 ? 'Save and update' : _d, _e = _a.secondaryButtonText, secondaryButtonText = _e === void 0 ? 'Cancel' : _e, onPrimaryClick = _a.onPrimaryClick, onSecondaryClick = _a.onSecondaryClick, _f = _a.showFooter, showFooter = _f === void 0 ? true : _f, _g = _a.showCloseButton, showCloseButton = _g === void 0 ? true : _g, _h = _a.closeOnOverlayClick, closeOnOverlayClick = _h === void 0 ? true : _h, _j = _a.closeOnEscape, closeOnEscape = _j === void 0 ? true : _j, _k = _a.className, className = _k === void 0 ? '' : _k, ariaLabelledBy = _a.ariaLabelledBy, ariaDescribedBy = _a.ariaDescribedBy;
|
|
36
|
+
var _l = useMobile(), isMobile = _l.isMobile, isTablet = _l.isTablet, isDesktop = _l.isDesktop;
|
|
37
37
|
var dialogRef = useRef(null);
|
|
38
38
|
var previousFocusRef = useRef(null);
|
|
39
39
|
// Determine the actual size based on responsive setting
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CancellationItem } from '../../molecules/DialogContentPolicy/DialogCancellationList';
|
|
2
|
+
export interface BookingCancellationPolicyProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the dialog is open.
|
|
5
|
+
*/
|
|
6
|
+
open: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The callback function to call when the dialog is closed.
|
|
9
|
+
*/
|
|
10
|
+
setOpen: (open: boolean) => void;
|
|
11
|
+
/**
|
|
12
|
+
* The cancellations to display.
|
|
13
|
+
*/
|
|
14
|
+
cancellations: CancellationItem[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* BookingCancellationPolicy is a component that allows the user to display the booking cancellation policy.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <BookingCancellationPolicy
|
|
21
|
+
* open={open}
|
|
22
|
+
* setOpen={setOpen}
|
|
23
|
+
* cancellations={cancellations}
|
|
24
|
+
* />
|
|
25
|
+
*
|
|
26
|
+
* @param props - The props for the BookingCancellationPolicy component.
|
|
27
|
+
* @returns The BookingCancellationPolicy component.
|
|
28
|
+
*/
|
|
29
|
+
export declare const BookingCancellationPolicy: (props: BookingCancellationPolicyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { DialogContentPolicy } from '../../molecules/DialogContentPolicy';
|
|
14
|
+
import { DialogBookingConfirm } from './DialogBookingConfirm';
|
|
15
|
+
/**
|
|
16
|
+
* BookingCancellationPolicy is a component that allows the user to display the booking cancellation policy.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <BookingCancellationPolicy
|
|
20
|
+
* open={open}
|
|
21
|
+
* setOpen={setOpen}
|
|
22
|
+
* cancellations={cancellations}
|
|
23
|
+
* />
|
|
24
|
+
*
|
|
25
|
+
* @param props - The props for the BookingCancellationPolicy component.
|
|
26
|
+
* @returns The BookingCancellationPolicy component.
|
|
27
|
+
*/
|
|
28
|
+
export var BookingCancellationPolicy = function (props) {
|
|
29
|
+
var open = props.open, setOpen = props.setOpen, cancellations = props.cancellations;
|
|
30
|
+
return (_jsx(DialogBookingConfirm, __assign({ open: open, setOpen: setOpen, title: "Confirmation of Terms & Cancellation policy", className: "!max-w-[800px]" }, { children: _jsx(DialogContentPolicy.List, { cancellations: cancellations }) })));
|
|
31
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BookingMailSentProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the dialog is open.
|
|
5
|
+
*/
|
|
6
|
+
open: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The callback function to call when the dialog is closed.
|
|
9
|
+
*/
|
|
10
|
+
setOpen: (open: boolean) => void;
|
|
11
|
+
/**
|
|
12
|
+
* The callback function to call when the next button is clicked.
|
|
13
|
+
*/
|
|
14
|
+
onNext: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* BookingMailSent is a component that allows the user to display the booking mail sent confirmation.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <BookingMailSent
|
|
21
|
+
* open={open}
|
|
22
|
+
* setOpen={setOpen}
|
|
23
|
+
* onNext={onNext}
|
|
24
|
+
* />
|
|
25
|
+
*
|
|
26
|
+
* @param props - The props for the BookingMailSent component.
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare const BookingMailSent: React.FC<BookingMailSentProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Button, Heading } from '@/src';
|
|
14
|
+
import { DialogBookingConfirm } from './DialogBookingConfirm';
|
|
15
|
+
/**
|
|
16
|
+
* BookingMailSent is a component that allows the user to display the booking mail sent confirmation.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <BookingMailSent
|
|
20
|
+
* open={open}
|
|
21
|
+
* setOpen={setOpen}
|
|
22
|
+
* onNext={onNext}
|
|
23
|
+
* />
|
|
24
|
+
*
|
|
25
|
+
* @param props - The props for the BookingMailSent component.
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export var BookingMailSent = function (props) {
|
|
29
|
+
var open = props.open, setOpen = props.setOpen, onNext = props.onNext;
|
|
30
|
+
return (_jsx(DialogBookingConfirm, __assign({ open: open, setOpen: setOpen, className: "!max-w-[800px]" }, { children: _jsxs("div", __assign({ className: "space-y-9" }, { children: [_jsxs("div", __assign({ className: "space-y-8" }, { children: [_jsx("img", { src: "/images/svg/booking-mail-sent.svg", alt: "Booking success", className: "mx-auto", width: 150, height: 150 }), _jsx(Heading, __assign({ as: "p", level: 6, variant: "medium", className: "text-center" }, { children: "You will receive a copy of your booking in your mail inbox." }))] })), _jsx(Button, __assign({ variant: "secondary", onClick: onNext, className: "w-full" }, { children: "Go to booking grid" }))] })) })));
|
|
31
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BookingReferenceProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the dialog is open.
|
|
5
|
+
*/
|
|
6
|
+
open: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The callback function to call when the dialog is closed.
|
|
9
|
+
*/
|
|
10
|
+
setOpen: (open: boolean) => void;
|
|
11
|
+
/**
|
|
12
|
+
* The callback function to call when the cancel button is clicked.
|
|
13
|
+
*/
|
|
14
|
+
onCancel: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* The callback function to call when the confirm button is clicked.
|
|
17
|
+
*/
|
|
18
|
+
onConfirm: (ref: string) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* BookingReference is a component that allows the user to display the booking reference.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <BookingReference
|
|
25
|
+
* open={open}
|
|
26
|
+
* setOpen={setOpen}
|
|
27
|
+
* onCancel={onCancel}
|
|
28
|
+
* onConfirm={onConfirm}
|
|
29
|
+
* />
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @param props - The props for the BookingReference component.
|
|
33
|
+
* @returns The BookingReference component.
|
|
34
|
+
*/
|
|
35
|
+
export declare const BookingReference: React.FC<BookingReferenceProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useState } from 'react';
|
|
14
|
+
import Button from '../../atoms/Button/Button';
|
|
15
|
+
import Input from '../../atoms/Inputs/Input/Input';
|
|
16
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
17
|
+
import { DialogBookingConfirm } from './DialogBookingConfirm';
|
|
18
|
+
/**
|
|
19
|
+
* BookingReference is a component that allows the user to display the booking reference.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <BookingReference
|
|
23
|
+
* open={open}
|
|
24
|
+
* setOpen={setOpen}
|
|
25
|
+
* onCancel={onCancel}
|
|
26
|
+
* onConfirm={onConfirm}
|
|
27
|
+
* />
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
* @param props - The props for the BookingReference component.
|
|
31
|
+
* @returns The BookingReference component.
|
|
32
|
+
*/
|
|
33
|
+
export var BookingReference = function (props) {
|
|
34
|
+
var open = props.open, setOpen = props.setOpen, onCancel = props.onCancel, onConfirm = props.onConfirm;
|
|
35
|
+
var _a = useState(''), reference = _a[0], setReference = _a[1];
|
|
36
|
+
return (_jsx(DialogBookingConfirm, __assign({ open: open, setOpen: setOpen, title: "Reference number", className: "!max-w-[500px]" }, { children: _jsxs("div", __assign({ className: "space-y-9" }, { children: [_jsxs("div", __assign({ className: "space-y-2" }, { children: [_jsx("label", { children: _jsx(Text, __assign({ as: "span", size: "sm" }, { children: "Reference number" })) }), _jsx(Input, { placeholder: "Please insert a reference number", value: reference, onChange: function (e) { return setReference(e.target.value); } })] })), _jsxs("div", __assign({ className: "grid grid-cols-2 gap-x-4" }, { children: [_jsx(Button, __assign({ variant: "outline-secondary", onClick: onCancel }, { children: "Cancel" })), _jsx(Button, __assign({ variant: "secondary", onClick: function () { return onConfirm(reference); } }, { children: "Confirm booking" }))] }))] })) })));
|
|
37
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BookingSuccessProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the dialog is open.
|
|
5
|
+
*/
|
|
6
|
+
open: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The name of the booking.
|
|
9
|
+
*/
|
|
10
|
+
bookingName: string;
|
|
11
|
+
/**
|
|
12
|
+
* The callback function to call when the dialog is closed.
|
|
13
|
+
*/
|
|
14
|
+
setOpen: (open: boolean) => void;
|
|
15
|
+
/**
|
|
16
|
+
* The callback function to call when the next button is clicked.
|
|
17
|
+
*/
|
|
18
|
+
onNext: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* BookingSuccess is a component that allows the user to display the booking success.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <BookingSuccess
|
|
25
|
+
* open={open}
|
|
26
|
+
* bookingName={bookingName}
|
|
27
|
+
* setOpen={setOpen}
|
|
28
|
+
* onNext={onNext}
|
|
29
|
+
* />
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @param props - The props for the BookingSuccess component.
|
|
33
|
+
* @returns The BookingSuccess component.
|
|
34
|
+
*/
|
|
35
|
+
export declare const BookingSuccess: React.FC<BookingSuccessProps>;
|